Salome HOME
Update from BR_V5_DEV 13Feb2009
authorjfa <jfa@opencascade.com>
Thu, 12 Feb 2009 15:17:13 +0000 (15:17 +0000)
committerjfa <jfa@opencascade.com>
Thu, 12 Feb 2009 15:17:13 +0000 (15:17 +0000)
1729 files changed:
GUI_version.h.in
Makefile.am
SUIT.pro [new file with mode: 0644]
adm_local/Makefile.am
adm_local/cmake_files/FindCAS.cmake [new file with mode: 0644]
adm_local/cmake_files/FindGUI.cmake [new file with mode: 0644]
adm_local/cmake_files/FindOPENGL.cmake [new file with mode: 0644]
adm_local/cmake_files/FindQT4.cmake [new file with mode: 0644]
adm_local/cmake_files/FindQWT.cmake [new file with mode: 0644]
adm_local/cmake_files/FindSIPPYQT.cmake [new file with mode: 0644]
adm_local/cmake_files/FindVTK.cmake [new file with mode: 0644]
adm_local/cmake_files/Makefile.am [new file with mode: 0644]
adm_local/unix/Makefile.am
adm_local/unix/config_files/Makefile.am
adm_local/unix/config_files/README [deleted file]
adm_local/unix/config_files/check_GLViewer.m4
adm_local/unix/config_files/check_GUI.m4
adm_local/unix/config_files/check_OCCViewer.m4
adm_local/unix/config_files/check_Plot2dViewer.m4
adm_local/unix/config_files/check_PyConsole.m4
adm_local/unix/config_files/check_QxGraphViewer.m4
adm_local/unix/config_files/check_SalomeObject.m4
adm_local/unix/config_files/check_SupervGraphViewer.m4
adm_local/unix/config_files/check_TestRecorder.m4 [new file with mode: 0644]
adm_local/unix/config_files/check_VTKViewer.m4
adm_local/unix/config_files/check_corba_in_GUI.m4
adm_local/unix/config_files/check_disable_Corba.m4
adm_local/unix/config_files/check_msg2qm.m4
adm_local/unix/config_files/check_opengl.m4
adm_local/unix/config_files/check_pyqt.m4
adm_local/unix/config_files/check_qt.m4
adm_local/unix/config_files/check_qwt.m4
adm_local/unix/config_files/check_sip.m4
adm_local/unix/config_files/check_vtk.m4
adm_local/unix/make_common_starter.am
adm_local/unix/make_conclude.in
bin/Makefile.am
bin/runLightSalome.csh
bin/runLightSalome.sh
build_cmake [new file with mode: 0755]
build_cmake.bat [new file with mode: 0644]
build_configure
clean_configure
configure.ac
doc/Makefile.am
doc/salome/Makefile.am
doc/salome/gui/GUI/doxyfile.in [deleted file]
doc/salome/gui/GUI/images/batchmode.png [deleted file]
doc/salome/gui/GUI/images/cataloggenerator.png [deleted file]
doc/salome/gui/GUI/images/choicepage.png [deleted file]
doc/salome/gui/GUI/images/clipping.png [deleted file]
doc/salome/gui/GUI/images/closestudy.png [deleted file]
doc/salome/gui/GUI/images/copy-paste.jpg [deleted file]
doc/salome/gui/GUI/images/dumpstudy.png [deleted file]
doc/salome/gui/GUI/images/geomview-alt.png [deleted file]
doc/salome/gui/GUI/images/graduatedaxes1.png [deleted file]
doc/salome/gui/GUI/images/icon_about.png [deleted file]
doc/salome/gui/GUI/images/image100.gif [deleted file]
doc/salome/gui/GUI/images/image102.gif [deleted file]
doc/salome/gui/GUI/images/image103.gif [deleted file]
doc/salome/gui/GUI/images/image105.gif [deleted file]
doc/salome/gui/GUI/images/image106.gif [deleted file]
doc/salome/gui/GUI/images/image108.gif [deleted file]
doc/salome/gui/GUI/images/image109.gif [deleted file]
doc/salome/gui/GUI/images/image157.gif [deleted file]
doc/salome/gui/GUI/images/image54.jpg [deleted file]
doc/salome/gui/GUI/images/image65.gif [deleted file]
doc/salome/gui/GUI/images/image67.gif [deleted file]
doc/salome/gui/GUI/images/image69.gif [deleted file]
doc/salome/gui/GUI/images/image70.gif [deleted file]
doc/salome/gui/GUI/images/image72.gif [deleted file]
doc/salome/gui/GUI/images/image73.gif [deleted file]
doc/salome/gui/GUI/images/image75.gif [deleted file]
doc/salome/gui/GUI/images/image77.gif [deleted file]
doc/salome/gui/GUI/images/image86.gif [deleted file]
doc/salome/gui/GUI/images/image88.gif [deleted file]
doc/salome/gui/GUI/images/image89.gif [deleted file]
doc/salome/gui/GUI/images/image91.gif [deleted file]
doc/salome/gui/GUI/images/image94.gif [deleted file]
doc/salome/gui/GUI/images/image95.gif [deleted file]
doc/salome/gui/GUI/images/image96.gif [deleted file]
doc/salome/gui/GUI/images/image97.gif [deleted file]
doc/salome/gui/GUI/images/image98.gif [deleted file]
doc/salome/gui/GUI/images/image99.gif [deleted file]
doc/salome/gui/GUI/images/import.png [deleted file]
doc/salome/gui/GUI/images/intropage.png [deleted file]
doc/salome/gui/GUI/images/loadscript.png [deleted file]
doc/salome/gui/GUI/images/loadstudy2.png [deleted file]
doc/salome/gui/GUI/images/lockedstudy.png [deleted file]
doc/salome/gui/GUI/images/neo-view2.png [deleted file]
doc/salome/gui/GUI/images/newsticn.jpg [deleted file]
doc/salome/gui/GUI/images/note1.gif [deleted file]
doc/salome/gui/GUI/images/objectbrowser1.png [deleted file]
doc/salome/gui/GUI/images/objectbrowser2.png [deleted file]
doc/salome/gui/GUI/images/open.jpg [deleted file]
doc/salome/gui/GUI/images/plot2d_clone.gif [deleted file]
doc/salome/gui/GUI/images/plot2d_legend.gif [deleted file]
doc/salome/gui/GUI/images/plot2d_lines.gif [deleted file]
doc/salome/gui/GUI/images/plot2d_logarithmic_horizontal.gif [deleted file]
doc/salome/gui/GUI/images/plot2d_logarithmic_vertical.gif [deleted file]
doc/salome/gui/GUI/images/plot2d_points.gif [deleted file]
doc/salome/gui/GUI/images/plot2d_settings.gif [deleted file]
doc/salome/gui/GUI/images/plot2d_splines.gif [deleted file]
doc/salome/gui/GUI/images/plot2d_view_settings.png [deleted file]
doc/salome/gui/GUI/images/ppref1.png [deleted file]
doc/salome/gui/GUI/images/ppref2.png [deleted file]
doc/salome/gui/GUI/images/ppref3.png [deleted file]
doc/salome/gui/GUI/images/pref11.png [deleted file]
doc/salome/gui/GUI/images/pref12.png [deleted file]
doc/salome/gui/GUI/images/pref13.png [deleted file]
doc/salome/gui/GUI/images/pref14.png [deleted file]
doc/salome/gui/GUI/images/pref15.png [deleted file]
doc/salome/gui/GUI/images/pref21.png [deleted file]
doc/salome/gui/GUI/images/pref22.png [deleted file]
doc/salome/gui/GUI/images/pref23.png [deleted file]
doc/salome/gui/GUI/images/pref24.png [deleted file]
doc/salome/gui/GUI/images/pref31.png [deleted file]
doc/salome/gui/GUI/images/pref33.png [deleted file]
doc/salome/gui/GUI/images/pref34.png [deleted file]
doc/salome/gui/GUI/images/pref37.png [deleted file]
doc/salome/gui/GUI/images/pref38.png [deleted file]
doc/salome/gui/GUI/images/pref39.png [deleted file]
doc/salome/gui/GUI/images/pref40.png [deleted file]
doc/salome/gui/GUI/images/productpage.png [deleted file]
doc/salome/gui/GUI/images/productpage1.png [deleted file]
doc/salome/gui/GUI/images/productpage2.png [deleted file]
doc/salome/gui/GUI/images/progresspage.png [deleted file]
doc/salome/gui/GUI/images/progresspage1.png [deleted file]
doc/salome/gui/GUI/images/readmepage.png [deleted file]
doc/salome/gui/GUI/images/registry1.png [deleted file]
doc/salome/gui/GUI/images/registry3.png [deleted file]
doc/salome/gui/GUI/images/registry4.png [deleted file]
doc/salome/gui/GUI/images/save.jpg [deleted file]
doc/salome/gui/GUI/images/selectcolor.png [deleted file]
doc/salome/gui/GUI/images/selectfont.png [deleted file]
doc/salome/gui/GUI/images/set_rotation_point_dialog1.png [deleted file]
doc/salome/gui/GUI/images/set_rotation_point_dialog2.png [deleted file]
doc/salome/gui/GUI/images/studyproperties.png [deleted file]
doc/salome/gui/GUI/images/updaterate.png [deleted file]
doc/salome/gui/GUI/images/urbutton.png [deleted file]
doc/salome/gui/GUI/images/view2.png [deleted file]
doc/salome/gui/GUI/images/view_rotation_point.png [deleted file]
doc/salome/gui/GUI/input/about_salome.doc [deleted file]
doc/salome/gui/GUI/input/creating_new_study.doc [deleted file]
doc/salome/gui/GUI/input/displaying_studies.doc [deleted file]
doc/salome/gui/GUI/input/editing_studies.doc [deleted file]
doc/salome/gui/GUI/input/geometry_preferences.doc [deleted file]
doc/salome/gui/GUI/input/getting_started.doc [deleted file]
doc/salome/gui/GUI/input/gui_module_chapter.doc [deleted file]
doc/salome/gui/GUI/input/index.doc [deleted file]
doc/salome/gui/GUI/input/installing_salome.doc [deleted file]
doc/salome/gui/GUI/input/intro_to_salome.doc [deleted file]
doc/salome/gui/GUI/input/introduction.doc [deleted file]
doc/salome/gui/GUI/input/introduction_to_gui.doc [deleted file]
doc/salome/gui/GUI/input/mesh_preferences.doc [deleted file]
doc/salome/gui/GUI/input/occ_3d_viewer.doc [deleted file]
doc/salome/gui/GUI/input/opening_studies.doc [deleted file]
doc/salome/gui/GUI/input/plot2d_viewer.doc [deleted file]
doc/salome/gui/GUI/input/postpro_preferences.doc [deleted file]
doc/salome/gui/GUI/input/running_salome.doc [deleted file]
doc/salome/gui/GUI/input/salome_architecture.doc [deleted file]
doc/salome/gui/GUI/input/salome_desktop.doc [deleted file]
doc/salome/gui/GUI/input/salome_preferences.doc [deleted file]
doc/salome/gui/GUI/input/saving_and_closing_studies.doc [deleted file]
doc/salome/gui/GUI/input/select_color_and_font.doc [deleted file]
doc/salome/gui/GUI/input/setting_preferences.doc [deleted file]
doc/salome/gui/GUI/input/setting_preferences_chapter.doc [deleted file]
doc/salome/gui/GUI/input/setting_study_properties.doc [deleted file]
doc/salome/gui/GUI/input/study_management_chapter.doc [deleted file]
doc/salome/gui/GUI/input/using_catalog_generator.doc [deleted file]
doc/salome/gui/GUI/input/using_object_browser.doc [deleted file]
doc/salome/gui/GUI/input/using_registry_tool.doc [deleted file]
doc/salome/gui/GUI/input/viewers_chapter.doc [deleted file]
doc/salome/gui/GUI/input/vtk_3d_viewer.doc [deleted file]
doc/salome/gui/GUI/input/working_with_python_scripts.doc [deleted file]
doc/salome/gui/GUI/kernel/about_salome_pro_architecture.htm [deleted file]
doc/salome/gui/GUI/kernel/about_salome_pro_help_system.htm [deleted file]
doc/salome/gui/GUI/kernel/application.png [deleted file]
doc/salome/gui/GUI/kernel/batchmode.png [deleted file]
doc/salome/gui/GUI/kernel/choicepage.png [deleted file]
doc/salome/gui/GUI/kernel/creating_a_new_study.htm [deleted file]
doc/salome/gui/GUI/kernel/displaying_studies.htm [deleted file]
doc/salome/gui/GUI/kernel/editing_studies.htm [deleted file]
doc/salome/gui/GUI/kernel/getting_properties_of_the_study.htm [deleted file]
doc/salome/gui/GUI/kernel/getting_started2.htm [deleted file]
doc/salome/gui/GUI/kernel/introduction.bak [deleted file]
doc/salome/gui/GUI/kernel/introduction.htm [deleted file]
doc/salome/gui/GUI/kernel/introduction_to_salome_pro.htm [deleted file]
doc/salome/gui/GUI/kernel/intropage.png [deleted file]
doc/salome/gui/GUI/kernel/logocorp.png [deleted file]
doc/salome/gui/GUI/kernel/navigating_topics.htm [deleted file]
doc/salome/gui/GUI/kernel/opening_studies.htm [deleted file]
doc/salome/gui/GUI/kernel/productpage.png [deleted file]
doc/salome/gui/GUI/kernel/productpage1.png [deleted file]
doc/salome/gui/GUI/kernel/productpage2.png [deleted file]
doc/salome/gui/GUI/kernel/progresspage.png [deleted file]
doc/salome/gui/GUI/kernel/progresspage1.png [deleted file]
doc/salome/gui/GUI/kernel/readme.html [deleted file]
doc/salome/gui/GUI/kernel/readmepage.png [deleted file]
doc/salome/gui/GUI/kernel/running_salome_pro.htm [deleted file]
doc/salome/gui/GUI/kernel/salome_pro_desktop.htm [deleted file]
doc/salome/gui/GUI/kernel/saving_a_study.htm [deleted file]
doc/salome/gui/GUI/kernel/setting_preferences.htm [deleted file]
doc/salome/gui/GUI/kernel/using_catalog_generator.htm [deleted file]
doc/salome/gui/GUI/kernel/using_left-hand_tabs.htm [deleted file]
doc/salome/gui/GUI/kernel/using_object_browser.htm [deleted file]
doc/salome/gui/GUI/kernel/using_registry.htm [deleted file]
doc/salome/gui/GUI/pics/cataloggenerator.png [deleted file]
doc/salome/gui/GUI/pics/choicepage.png [deleted file]
doc/salome/gui/GUI/pics/clipping.png [deleted file]
doc/salome/gui/GUI/pics/copy-paste.jpg [deleted file]
doc/salome/gui/GUI/pics/dumpstudy.png [deleted file]
doc/salome/gui/GUI/pics/exemple.gif [deleted file]
doc/salome/gui/GUI/pics/geomview-alt.png [deleted file]
doc/salome/gui/GUI/pics/graduatedaxes1.png [deleted file]
doc/salome/gui/GUI/pics/icon_about.png [deleted file]
doc/salome/gui/GUI/pics/image100.gif [deleted file]
doc/salome/gui/GUI/pics/image102.gif [deleted file]
doc/salome/gui/GUI/pics/image103.gif [deleted file]
doc/salome/gui/GUI/pics/image105.gif [deleted file]
doc/salome/gui/GUI/pics/image106.gif [deleted file]
doc/salome/gui/GUI/pics/image108.gif [deleted file]
doc/salome/gui/GUI/pics/image109.gif [deleted file]
doc/salome/gui/GUI/pics/image157.gif [deleted file]
doc/salome/gui/GUI/pics/image77.gif [deleted file]
doc/salome/gui/GUI/pics/image86.gif [deleted file]
doc/salome/gui/GUI/pics/image88.gif [deleted file]
doc/salome/gui/GUI/pics/image89.gif [deleted file]
doc/salome/gui/GUI/pics/image91.gif [deleted file]
doc/salome/gui/GUI/pics/image95.gif [deleted file]
doc/salome/gui/GUI/pics/image96.gif [deleted file]
doc/salome/gui/GUI/pics/image97.gif [deleted file]
doc/salome/gui/GUI/pics/image98.gif [deleted file]
doc/salome/gui/GUI/pics/image99.gif [deleted file]
doc/salome/gui/GUI/pics/import.png [deleted file]
doc/salome/gui/GUI/pics/intropage.png [deleted file]
doc/salome/gui/GUI/pics/launch1.png [deleted file]
doc/salome/gui/GUI/pics/loadscript.png [deleted file]
doc/salome/gui/GUI/pics/loadstudy2.png [deleted file]
doc/salome/gui/GUI/pics/lockedstudy.png [deleted file]
doc/salome/gui/GUI/pics/neo-view2.png [deleted file]
doc/salome/gui/GUI/pics/newsticn.jpg [deleted file]
doc/salome/gui/GUI/pics/objectbrowser1.png [deleted file]
doc/salome/gui/GUI/pics/objectbrowser2.png [deleted file]
doc/salome/gui/GUI/pics/open.jpg [deleted file]
doc/salome/gui/GUI/pics/ppref1.png [deleted file]
doc/salome/gui/GUI/pics/ppref2.png [deleted file]
doc/salome/gui/GUI/pics/ppref3.png [deleted file]
doc/salome/gui/GUI/pics/pref11.png [deleted file]
doc/salome/gui/GUI/pics/pref12.png [deleted file]
doc/salome/gui/GUI/pics/pref13.png [deleted file]
doc/salome/gui/GUI/pics/pref14.png [deleted file]
doc/salome/gui/GUI/pics/pref15.png [deleted file]
doc/salome/gui/GUI/pics/pref21.png [deleted file]
doc/salome/gui/GUI/pics/pref22.png [deleted file]
doc/salome/gui/GUI/pics/pref23.png [deleted file]
doc/salome/gui/GUI/pics/pref24.png [deleted file]
doc/salome/gui/GUI/pics/pref31.png [deleted file]
doc/salome/gui/GUI/pics/pref32.png [deleted file]
doc/salome/gui/GUI/pics/pref33.png [deleted file]
doc/salome/gui/GUI/pics/pref34.png [deleted file]
doc/salome/gui/GUI/pics/pref37.png [deleted file]
doc/salome/gui/GUI/pics/pref38.png [deleted file]
doc/salome/gui/GUI/pics/pref39.png [deleted file]
doc/salome/gui/GUI/pics/productpage.png [deleted file]
doc/salome/gui/GUI/pics/progresspage.png [deleted file]
doc/salome/gui/GUI/pics/readmepage.png [deleted file]
doc/salome/gui/GUI/pics/registry1.png [deleted file]
doc/salome/gui/GUI/pics/registry3.png [deleted file]
doc/salome/gui/GUI/pics/registry4.png [deleted file]
doc/salome/gui/GUI/pics/save.jpg [deleted file]
doc/salome/gui/GUI/pics/selectcolor.png [deleted file]
doc/salome/gui/GUI/pics/selectfont.png [deleted file]
doc/salome/gui/GUI/pics/set_rotation_point_dialog1.png [deleted file]
doc/salome/gui/GUI/pics/set_rotation_point_dialog2.png [deleted file]
doc/salome/gui/GUI/pics/studyproperties.png [deleted file]
doc/salome/gui/GUI/pics/view2.png [deleted file]
doc/salome/gui/GUI/pics/view_rotation_point.png [deleted file]
doc/salome/gui/GUI/static/footer.html [deleted file]
doc/salome/gui/GUI/static/header.html [deleted file]
doc/salome/gui/GUI/whdata/whftdata.js [deleted file]
doc/salome/gui/GUI/whdata/whftdata0.htm [deleted file]
doc/salome/gui/GUI/whdata/whfts.htm [deleted file]
doc/salome/gui/GUI/whdata/whfts.js [deleted file]
doc/salome/gui/GUI/whdata/whfwdata.js [deleted file]
doc/salome/gui/GUI/whdata/whfwdata0.htm [deleted file]
doc/salome/gui/GUI/whdata/whgdata.js [deleted file]
doc/salome/gui/GUI/whdata/whgdata0.htm [deleted file]
doc/salome/gui/GUI/whdata/whglo.htm [deleted file]
doc/salome/gui/GUI/whdata/whglo.js [deleted file]
doc/salome/gui/GUI/whdata/whidata.js [deleted file]
doc/salome/gui/GUI/whdata/whidx.htm [deleted file]
doc/salome/gui/GUI/whdata/whidx.js [deleted file]
doc/salome/gui/GUI/whdata/whtdata.js [deleted file]
doc/salome/gui/GUI/whdata/whtdata0.htm [deleted file]
doc/salome/gui/GUI/whdata/whtoc.htm [deleted file]
doc/salome/gui/GUI/whdata/whtoc.js [deleted file]
doc/salome/gui/GUI/whgdata/whexpbar.gif [deleted file]
doc/salome/gui/GUI/whgdata/whlstf0.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstf1.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstf10.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstf11.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstf2.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstf3.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstf4.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstf5.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstf6.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstf7.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstf8.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstf9.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl0.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl1.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl10.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl11.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl12.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl13.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl14.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl15.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl16.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl17.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl18.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl19.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl2.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl20.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl21.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl22.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl23.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl24.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl25.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl26.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl3.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl4.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl5.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl6.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl7.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl8.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstfl9.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstg0.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlsti0.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstt0.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstt1.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstt2.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstt3.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstt4.htm [deleted file]
doc/salome/gui/GUI/whgdata/whlstt5.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvf30.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvf31.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvf32.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvf33.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvl31.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvl32.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvl33.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvp30.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvp31.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvp32.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvp33.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvt30.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvt31.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvt32.htm [deleted file]
doc/salome/gui/GUI/whgdata/whnvt33.htm [deleted file]
doc/salome/gui/GUI/whxdata/whftdata0.xml [deleted file]
doc/salome/gui/GUI/whxdata/whfts.xml [deleted file]
doc/salome/gui/GUI/whxdata/whfwdata0.xml [deleted file]
doc/salome/gui/GUI/whxdata/whgdata0.xml [deleted file]
doc/salome/gui/GUI/whxdata/whglo.xml [deleted file]
doc/salome/gui/GUI/whxdata/whidx.xml [deleted file]
doc/salome/gui/GUI/whxdata/whtdata0.xml [deleted file]
doc/salome/gui/GUI/whxdata/whtoc.xml [deleted file]
doc/salome/gui/Makefile.am
doc/salome/gui/doxyfile.in [new file with mode: 0755]
doc/salome/gui/images/batchmode.png [new file with mode: 0644]
doc/salome/gui/images/cataloggenerator.png [new file with mode: 0755]
doc/salome/gui/images/choicepage.png [new file with mode: 0644]
doc/salome/gui/images/clipping.png [new file with mode: 0644]
doc/salome/gui/images/closestudy.png [new file with mode: 0755]
doc/salome/gui/images/copy-paste.jpg [new file with mode: 0755]
doc/salome/gui/images/directorypage.png [new file with mode: 0755]
doc/salome/gui/images/dumpstudy.png [new file with mode: 0755]
doc/salome/gui/images/featureedgesprops.png [new file with mode: 0755]
doc/salome/gui/images/findtool1.png [new file with mode: 0644]
doc/salome/gui/images/findtool2.png [new file with mode: 0644]
doc/salome/gui/images/geomview-alt.png [new file with mode: 0755]
doc/salome/gui/images/graduateaxes1.png [new file with mode: 0755]
doc/salome/gui/images/graduatedaxes1.png [new file with mode: 0644]
doc/salome/gui/images/icon_about.png [new file with mode: 0755]
doc/salome/gui/images/image100.gif [new file with mode: 0644]
doc/salome/gui/images/image100.png [new file with mode: 0755]
doc/salome/gui/images/image102.gif [new file with mode: 0644]
doc/salome/gui/images/image103.gif [new file with mode: 0644]
doc/salome/gui/images/image103.png [new file with mode: 0755]
doc/salome/gui/images/image105.gif [new file with mode: 0644]
doc/salome/gui/images/image106.gif [new file with mode: 0644]
doc/salome/gui/images/image106.png [new file with mode: 0755]
doc/salome/gui/images/image108.gif [new file with mode: 0644]
doc/salome/gui/images/image108.png [new file with mode: 0755]
doc/salome/gui/images/image109.gif [new file with mode: 0644]
doc/salome/gui/images/image157.gif [new file with mode: 0644]
doc/salome/gui/images/image54.jpg [new file with mode: 0755]
doc/salome/gui/images/image65.gif [new file with mode: 0755]
doc/salome/gui/images/image67.gif [new file with mode: 0755]
doc/salome/gui/images/image69.gif [new file with mode: 0755]
doc/salome/gui/images/image70.gif [new file with mode: 0755]
doc/salome/gui/images/image72.gif [new file with mode: 0755]
doc/salome/gui/images/image72.png [new file with mode: 0755]
doc/salome/gui/images/image73.gif [new file with mode: 0755]
doc/salome/gui/images/image75.gif [new file with mode: 0755]
doc/salome/gui/images/image77.gif [new file with mode: 0644]
doc/salome/gui/images/image77.png [new file with mode: 0755]
doc/salome/gui/images/image86.gif [new file with mode: 0644]
doc/salome/gui/images/image86.png [new file with mode: 0755]
doc/salome/gui/images/image88.gif [new file with mode: 0644]
doc/salome/gui/images/image89.gif [new file with mode: 0644]
doc/salome/gui/images/image89.png [new file with mode: 0755]
doc/salome/gui/images/image91.gif [new file with mode: 0644]
doc/salome/gui/images/image91.png [new file with mode: 0755]
doc/salome/gui/images/image94.gif [new file with mode: 0755]
doc/salome/gui/images/image95.gif [new file with mode: 0644]
doc/salome/gui/images/image96.gif [new file with mode: 0644]
doc/salome/gui/images/image96.png [new file with mode: 0755]
doc/salome/gui/images/image97.gif [new file with mode: 0644]
doc/salome/gui/images/image97.png [new file with mode: 0755]
doc/salome/gui/images/image98.gif [new file with mode: 0644]
doc/salome/gui/images/image98.png [new file with mode: 0755]
doc/salome/gui/images/image99.gif [new file with mode: 0644]
doc/salome/gui/images/image99.png [new file with mode: 0755]
doc/salome/gui/images/import.png [new file with mode: 0755]
doc/salome/gui/images/installtypepage.png [new file with mode: 0755]
doc/salome/gui/images/intropage.png [new file with mode: 0644]
doc/salome/gui/images/loadscript.png [new file with mode: 0755]
doc/salome/gui/images/loadstudy2.png [new file with mode: 0755]
doc/salome/gui/images/lockedstudy.png [new file with mode: 0755]
doc/salome/gui/images/mainmenu.png [new file with mode: 0755]
doc/salome/gui/images/neo-view2.png [new file with mode: 0755]
doc/salome/gui/images/newsticn.jpg [new file with mode: 0755]
doc/salome/gui/images/note1.gif [new file with mode: 0755]
doc/salome/gui/images/notebook1.png [new file with mode: 0644]
doc/salome/gui/images/objectbrowser1.png [new file with mode: 0755]
doc/salome/gui/images/objectbrowser2.png [new file with mode: 0755]
doc/salome/gui/images/occviewer_axialscale.png [new file with mode: 0644]
doc/salome/gui/images/occviewer_toolbar.png [new file with mode: 0644]
doc/salome/gui/images/open.jpg [new file with mode: 0755]
doc/salome/gui/images/platformpage.png [new file with mode: 0755]
doc/salome/gui/images/plot2d_clone.gif [new file with mode: 0644]
doc/salome/gui/images/plot2d_clone.png [new file with mode: 0755]
doc/salome/gui/images/plot2d_legend.gif [new file with mode: 0644]
doc/salome/gui/images/plot2d_legend.png [new file with mode: 0755]
doc/salome/gui/images/plot2d_lines.gif [new file with mode: 0644]
doc/salome/gui/images/plot2d_lines.png [new file with mode: 0755]
doc/salome/gui/images/plot2d_logarithmic_horizontal.gif [new file with mode: 0644]
doc/salome/gui/images/plot2d_logarithmic_horizontal.png [new file with mode: 0755]
doc/salome/gui/images/plot2d_logarithmic_vertical.gif [new file with mode: 0644]
doc/salome/gui/images/plot2d_logarithmic_vertical.png [new file with mode: 0755]
doc/salome/gui/images/plot2d_points.gif [new file with mode: 0644]
doc/salome/gui/images/plot2d_points.png [new file with mode: 0755]
doc/salome/gui/images/plot2d_settings.gif [new file with mode: 0644]
doc/salome/gui/images/plot2d_settings.png [new file with mode: 0755]
doc/salome/gui/images/plot2d_splines.gif [new file with mode: 0644]
doc/salome/gui/images/plot2d_splines.png [new file with mode: 0755]
doc/salome/gui/images/plot2d_view_settings.png [new file with mode: 0644]
doc/salome/gui/images/polyselection1.png [new file with mode: 0755]
doc/salome/gui/images/polyselection2.png [new file with mode: 0755]
doc/salome/gui/images/ppref1.png [new file with mode: 0755]
doc/salome/gui/images/ppref2.png [new file with mode: 0755]
doc/salome/gui/images/ppref3.png [new file with mode: 0755]
doc/salome/gui/images/pref11.png [new file with mode: 0755]
doc/salome/gui/images/pref12.png [new file with mode: 0755]
doc/salome/gui/images/pref13.png [new file with mode: 0755]
doc/salome/gui/images/pref14.png [new file with mode: 0755]
doc/salome/gui/images/pref15.png [new file with mode: 0755]
doc/salome/gui/images/pref21.png [new file with mode: 0755]
doc/salome/gui/images/pref22.png [new file with mode: 0755]
doc/salome/gui/images/pref23.png [new file with mode: 0644]
doc/salome/gui/images/pref24.png [new file with mode: 0755]
doc/salome/gui/images/pref31.png [new file with mode: 0755]
doc/salome/gui/images/pref33.png [new file with mode: 0755]
doc/salome/gui/images/pref34.png [new file with mode: 0755]
doc/salome/gui/images/pref37.png [new file with mode: 0755]
doc/salome/gui/images/pref38.png [new file with mode: 0755]
doc/salome/gui/images/pref39.png [new file with mode: 0755]
doc/salome/gui/images/pref40.png [new file with mode: 0755]
doc/salome/gui/images/productpage.png [new file with mode: 0644]
doc/salome/gui/images/productpage1.png [new file with mode: 0644]
doc/salome/gui/images/productpage2.png [new file with mode: 0644]
doc/salome/gui/images/productpage3.png [new file with mode: 0755]
doc/salome/gui/images/productpage4.png [new file with mode: 0755]
doc/salome/gui/images/progresspage.png [new file with mode: 0644]
doc/salome/gui/images/progresspage1.png [new file with mode: 0644]
doc/salome/gui/images/progresspage2.png [new file with mode: 0755]
doc/salome/gui/images/readmepage.png [new file with mode: 0644]
doc/salome/gui/images/registry1.png [new file with mode: 0755]
doc/salome/gui/images/registry3.png [new file with mode: 0755]
doc/salome/gui/images/registry4.png [new file with mode: 0755]
doc/salome/gui/images/save.jpg [new file with mode: 0755]
doc/salome/gui/images/selectcolor.png [new file with mode: 0755]
doc/salome/gui/images/selectfont.png [new file with mode: 0755]
doc/salome/gui/images/set_rotation_point_dialog1.png [new file with mode: 0644]
doc/salome/gui/images/set_rotation_point_dialog2.png [new file with mode: 0644]
doc/salome/gui/images/studymanagement.png [new file with mode: 0755]
doc/salome/gui/images/studyproperties.png [new file with mode: 0755]
doc/salome/gui/images/theme1.png [new file with mode: 0755]
doc/salome/gui/images/theme2.png [new file with mode: 0755]
doc/salome/gui/images/updaterate.png [new file with mode: 0755]
doc/salome/gui/images/urbutton.png [new file with mode: 0755]
doc/salome/gui/images/view2.png [new file with mode: 0755]
doc/salome/gui/images/view_rotation_point.png [new file with mode: 0644]
doc/salome/gui/images/viewmenu.png [new file with mode: 0755]
doc/salome/gui/images/windowmenu.png [new file with mode: 0755]
doc/salome/gui/input/geometry_preferences.doc [new file with mode: 0644]
doc/salome/gui/input/index.doc [new file with mode: 0644]
doc/salome/gui/input/installing_salome.doc [new file with mode: 0644]
doc/salome/gui/input/introduction_to_gui.doc [new file with mode: 0644]
doc/salome/gui/input/mesh_preferences.doc [new file with mode: 0644]
doc/salome/gui/input/occ_3d_viewer.doc [new file with mode: 0644]
doc/salome/gui/input/plot2d_viewer.doc [new file with mode: 0644]
doc/salome/gui/input/postpro_preferences.doc [new file with mode: 0644]
doc/salome/gui/input/running_salome.doc [new file with mode: 0644]
doc/salome/gui/input/salome_architecture.doc [new file with mode: 0644]
doc/salome/gui/input/salome_desktop.doc [new file with mode: 0644]
doc/salome/gui/input/salome_preferences.doc [new file with mode: 0644]
doc/salome/gui/input/select_color_and_font.doc [new file with mode: 0644]
doc/salome/gui/input/setting_preferences.doc [new file with mode: 0644]
doc/salome/gui/input/study_management_chapter.doc [new file with mode: 0644]
doc/salome/gui/input/text_user_interface.doc [new file with mode: 0644]
doc/salome/gui/input/themes.doc [new file with mode: 0755]
doc/salome/gui/input/using_catalog_generator.doc [new file with mode: 0644]
doc/salome/gui/input/using_find_tool.doc [new file with mode: 0644]
doc/salome/gui/input/using_notebook.doc [new file with mode: 0644]
doc/salome/gui/input/using_object_browser.doc [new file with mode: 0644]
doc/salome/gui/input/using_registry_tool.doc [new file with mode: 0644]
doc/salome/gui/input/viewers_chapter.doc [new file with mode: 0644]
doc/salome/gui/input/vtk_3d_viewer.doc [new file with mode: 0644]
doc/salome/gui/input/working_with_python_scripts.doc [new file with mode: 0644]
doc/salome/gui/static/footer.html [new file with mode: 0755]
doc/salome/gui/static/header.html [new file with mode: 0755]
doc/salome/tui/GUI/doxyfile.in [deleted file]
doc/salome/tui/GUI/sources/Application-About.png [deleted file]
doc/salome/tui/GUI/sources/application.gif [deleted file]
doc/salome/tui/GUI/sources/doxygen.css [deleted file]
doc/salome/tui/GUI/sources/footer.html [deleted file]
doc/salome/tui/GUI/sources/html_comments.gif [deleted file]
doc/salome/tui/GUI/sources/logocorp.gif [deleted file]
doc/salome/tui/GUI/sources/myheader.html [deleted file]
doc/salome/tui/Makefile.am
doc/salome/tui/doxyfile.in [new file with mode: 0755]
doc/salome/tui/images/Application-About.png [new file with mode: 0755]
doc/salome/tui/images/application.gif [new file with mode: 0755]
doc/salome/tui/images/html_comments.gif [new file with mode: 0755]
doc/salome/tui/images/logocorp.gif [new file with mode: 0755]
doc/salome/tui/static/doxygen.css [new file with mode: 0755]
doc/salome/tui/static/footer.html [new file with mode: 0755]
doc/salome/tui/static/myheader.html [new file with mode: 0755]
idl/Makefile.am
idl/SalomeApp_Engine.idl
resources/Makefile.am
resources/Tools_en.xml [deleted file]
resources/Tools_fr.xml [deleted file]
resources/back.xpm [deleted file]
resources/cascade.png [deleted file]
resources/channel.cfg [deleted file]
resources/close.png [deleted file]
resources/copy.png [deleted file]
resources/default.png [deleted file]
resources/dl_delete.png [deleted file]
resources/dl_insert.png [deleted file]
resources/dl_movedown.png [deleted file]
resources/dl_moveup.png [deleted file]
resources/forward.xpm [deleted file]
resources/help.png [deleted file]
resources/home.xpm [deleted file]
resources/new.png [deleted file]
resources/open.png [deleted file]
resources/paste.png [deleted file]
resources/plot2d_dump.png [deleted file]
resources/plot2d_fitall.png [deleted file]
resources/plot2d_fitarea.png [deleted file]
resources/plot2d_legend.png [deleted file]
resources/plot2d_linear.png [deleted file]
resources/plot2d_linear_y.png [deleted file]
resources/plot2d_lines.png [deleted file]
resources/plot2d_log.png [deleted file]
resources/plot2d_log_y.png [deleted file]
resources/plot2d_pan.png [deleted file]
resources/plot2d_points.png [deleted file]
resources/plot2d_settings.png [deleted file]
resources/plot2d_splines.png [deleted file]
resources/plot2d_zoom.png [deleted file]
resources/print.png [deleted file]
resources/reset.png [deleted file]
resources/save.png [deleted file]
resources/select1.png [deleted file]
resources/tile.png [deleted file]
resources/uc_add.png [deleted file]
resources/uc_clear.png [deleted file]
resources/uc_current.png [deleted file]
resources/uc_del.png [deleted file]
resources/uc_new.png [deleted file]
resources/view_back.png [deleted file]
resources/view_bottom.png [deleted file]
resources/view_camera_dump.png [deleted file]
resources/view_fitall.png [deleted file]
resources/view_fitarea.png [deleted file]
resources/view_front.png [deleted file]
resources/view_glpan.png [deleted file]
resources/view_left.png [deleted file]
resources/view_pan.png [deleted file]
resources/view_reset.png [deleted file]
resources/view_right.png [deleted file]
resources/view_rotate.png [deleted file]
resources/view_top.png [deleted file]
resources/view_triedre.png [deleted file]
resources/view_zoom.png [deleted file]
src/CAF/CAF.h
src/CAF/CAF.pro [new file with mode: 0644]
src/CAF/CAF_Application.cxx
src/CAF/CAF_Application.h
src/CAF/CAF_Operation.cxx
src/CAF/CAF_Operation.h
src/CAF/CAF_Study.cxx
src/CAF/CAF_Study.h
src/CAF/CAF_Tools.cxx
src/CAF/CAF_Tools.h
src/CAF/Makefile.am
src/CAF/resources/CAF_images.po
src/CAF/resources/CAF_msg_en.po
src/CAF/resources/CAF_msg_en.ts [new file with mode: 0644]
src/CAF/resources/redo.png [deleted file]
src/CAF/resources/undo.png [deleted file]
src/CAM/CAM.h
src/CAM/CAM.pro [new file with mode: 0644]
src/CAM/CAM_Application.cxx
src/CAM/CAM_Application.h
src/CAM/CAM_DataModel.cxx
src/CAM/CAM_DataModel.h
src/CAM/CAM_DataObject.cxx
src/CAM/CAM_DataObject.h
src/CAM/CAM_Module.cxx
src/CAM/CAM_Module.h
src/CAM/CAM_RootObject.cxx [deleted file]
src/CAM/CAM_RootObject.h [deleted file]
src/CAM/CAM_Study.cxx
src/CAM/CAM_Study.h
src/CAM/Makefile.am
src/CAM/resources/CAM_msg_en.po
src/CAM/resources/CAM_msg_en.ts [new file with mode: 0644]
src/CASCatch/CASCatch.hxx
src/CASCatch/CASCatch_CatchSignals.cxx
src/CASCatch/CASCatch_CatchSignals.hxx
src/CASCatch/CASCatch_ErrorHandler.cxx
src/CASCatch/CASCatch_ErrorHandler.hxx
src/CASCatch/CASCatch_Failure.cxx
src/CASCatch/CASCatch_Failure.hxx
src/CASCatch/Makefile.am
src/DDS/DDS.h
src/DDS/DDS.pro [new file with mode: 0644]
src/DDS/DDS_DicGroup.cxx
src/DDS/DDS_DicGroup.h
src/DDS/DDS_DicItem.cxx
src/DDS/DDS_DicItem.h
src/DDS/DDS_Dictionary.cxx
src/DDS/DDS_Dictionary.h
src/DDS/DDS_KeyWords.cxx
src/DDS/DDS_KeyWords.h
src/DDS/Makefile.am
src/Event/Event.h
src/Event/Event.pro [new file with mode: 0644]
src/Event/Makefile.am
src/Event/SALOME_Event.cxx
src/Event/SALOME_Event.h [new file with mode: 0644]
src/Event/SALOME_Event.hxx [deleted file]
src/Event/SALOME_EventFilter.cxx [new file with mode: 0755]
src/Event/SALOME_EventFilter.h [new file with mode: 0755]
src/GLViewer/GLViewer.h
src/GLViewer/GLViewer.pro [new file with mode: 0644]
src/GLViewer/GLViewer_AspectLine.cxx
src/GLViewer/GLViewer_AspectLine.h
src/GLViewer/GLViewer_BaseDrawers.cxx
src/GLViewer/GLViewer_BaseDrawers.h
src/GLViewer/GLViewer_BaseObjects.cxx
src/GLViewer/GLViewer_BaseObjects.h
src/GLViewer/GLViewer_Compass.cxx
src/GLViewer/GLViewer_Compass.h
src/GLViewer/GLViewer_Context.cxx
src/GLViewer/GLViewer_Context.h
src/GLViewer/GLViewer_CoordSystem.cxx
src/GLViewer/GLViewer_CoordSystem.h
src/GLViewer/GLViewer_Defs.h
src/GLViewer/GLViewer_Drawer.cxx
src/GLViewer/GLViewer_Drawer.h
src/GLViewer/GLViewer_Geom.cxx
src/GLViewer/GLViewer_Geom.h
src/GLViewer/GLViewer_Grid.cxx
src/GLViewer/GLViewer_Grid.h
src/GLViewer/GLViewer_Group.cxx
src/GLViewer/GLViewer_Group.h
src/GLViewer/GLViewer_MimeData.cxx [new file with mode: 0644]
src/GLViewer/GLViewer_MimeData.h [new file with mode: 0644]
src/GLViewer/GLViewer_MimeSource.cxx [deleted file]
src/GLViewer/GLViewer_MimeSource.h [deleted file]
src/GLViewer/GLViewer_Object.cxx
src/GLViewer/GLViewer_Object.h
src/GLViewer/GLViewer_Selector.cxx
src/GLViewer/GLViewer_Selector.h
src/GLViewer/GLViewer_Selector2d.cxx
src/GLViewer/GLViewer_Selector2d.h
src/GLViewer/GLViewer_Text.cxx
src/GLViewer/GLViewer_Text.h
src/GLViewer/GLViewer_ToolTip.cxx
src/GLViewer/GLViewer_ToolTip.h
src/GLViewer/GLViewer_Tools.cxx
src/GLViewer/GLViewer_Tools.h
src/GLViewer/GLViewer_ViewFrame.cxx
src/GLViewer/GLViewer_ViewFrame.h
src/GLViewer/GLViewer_ViewManager.cxx
src/GLViewer/GLViewer_ViewManager.h
src/GLViewer/GLViewer_ViewPort.cxx
src/GLViewer/GLViewer_ViewPort.h
src/GLViewer/GLViewer_ViewPort2d.cxx
src/GLViewer/GLViewer_ViewPort2d.h
src/GLViewer/GLViewer_Viewer.cxx
src/GLViewer/GLViewer_Viewer.h
src/GLViewer/GLViewer_Viewer2d.cxx
src/GLViewer/GLViewer_Viewer2d.h
src/GLViewer/GLViewer_Widget.cxx
src/GLViewer/GLViewer_Widget.h
src/GLViewer/Makefile.am
src/GLViewer/resources/GLViewer_images.po
src/GLViewer/resources/GLViewer_images.ts [new file with mode: 0644]
src/GLViewer/resources/GLViewer_msg_en.po
src/GLViewer/resources/GLViewer_msg_en.ts [new file with mode: 0644]
src/GLViewer/resources/cursor_rotate.png [deleted file]
src/GLViewer/resources/cursor_sketch.png [deleted file]
src/GLViewer/resources/cursor_zoom.png [deleted file]
src/GLViewer/resources/gl_cursor_rotate.png [new file with mode: 0755]
src/GLViewer/resources/gl_cursor_sketch.png [new file with mode: 0755]
src/GLViewer/resources/gl_cursor_zoom.png [new file with mode: 0755]
src/GLViewer/resources/gl_view_dump.png [new file with mode: 0644]
src/GLViewer/resources/gl_view_fitall.png [new file with mode: 0644]
src/GLViewer/resources/gl_view_fitarea.png [new file with mode: 0644]
src/GLViewer/resources/gl_view_fitselect.png [new file with mode: 0755]
src/GLViewer/resources/gl_view_glpan.png [new file with mode: 0644]
src/GLViewer/resources/gl_view_pan.png [new file with mode: 0644]
src/GLViewer/resources/gl_view_reset.png [new file with mode: 0644]
src/GLViewer/resources/gl_view_zoom.png [new file with mode: 0644]
src/GLViewer/resources/view_dump.png [deleted file]
src/GLViewer/resources/view_fitall.png [deleted file]
src/GLViewer/resources/view_fitarea.png [deleted file]
src/GLViewer/resources/view_fitselect.png [deleted file]
src/GLViewer/resources/view_glpan.png [deleted file]
src/GLViewer/resources/view_pan.png [deleted file]
src/GLViewer/resources/view_reset.png [deleted file]
src/GLViewer/resources/view_zoom.png [deleted file]
src/LightApp/LightApp.h
src/LightApp/LightApp.pro [new file with mode: 0644]
src/LightApp/LightApp_AboutDlg.cxx
src/LightApp/LightApp_AboutDlg.h
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_Application.h
src/LightApp/LightApp_DataModel.cxx
src/LightApp/LightApp_DataModel.h
src/LightApp/LightApp_DataObject.cxx
src/LightApp/LightApp_DataObject.h
src/LightApp/LightApp_DataOwner.cxx
src/LightApp/LightApp_DataOwner.h
src/LightApp/LightApp_DataSubOwner.cxx
src/LightApp/LightApp_DataSubOwner.h
src/LightApp/LightApp_Dialog.cxx
src/LightApp/LightApp_Dialog.h
src/LightApp/LightApp_Displayer.cxx
src/LightApp/LightApp_Displayer.h
src/LightApp/LightApp_Driver.cxx
src/LightApp/LightApp_Driver.h
src/LightApp/LightApp_EventFilter.cxx
src/LightApp/LightApp_EventFilter.h
src/LightApp/LightApp_GLSelector.cxx
src/LightApp/LightApp_GLSelector.h
src/LightApp/LightApp_HDFDriver.cxx
src/LightApp/LightApp_HDFDriver.h
src/LightApp/LightApp_Module.cxx
src/LightApp/LightApp_Module.h
src/LightApp/LightApp_ModuleAction.cxx [new file with mode: 0755]
src/LightApp/LightApp_ModuleAction.h [new file with mode: 0755]
src/LightApp/LightApp_ModuleDlg.cxx
src/LightApp/LightApp_ModuleDlg.h
src/LightApp/LightApp_NameDlg.cxx
src/LightApp/LightApp_NameDlg.h
src/LightApp/LightApp_OBFilter.cxx
src/LightApp/LightApp_OBFilter.h
src/LightApp/LightApp_OBSelector.cxx
src/LightApp/LightApp_OBSelector.h
src/LightApp/LightApp_OCCSelector.cxx
src/LightApp/LightApp_OCCSelector.h
src/LightApp/LightApp_Operation.cxx
src/LightApp/LightApp_Operation.h
src/LightApp/LightApp_Plot2dSelector.cxx [new file with mode: 0755]
src/LightApp/LightApp_Plot2dSelector.h [new file with mode: 0755]
src/LightApp/LightApp_Preferences.cxx
src/LightApp/LightApp_Preferences.h
src/LightApp/LightApp_PreferencesDlg.cxx
src/LightApp/LightApp_PreferencesDlg.h
src/LightApp/LightApp_RootObject.h [deleted file]
src/LightApp/LightApp_Selection.cxx
src/LightApp/LightApp_Selection.h
src/LightApp/LightApp_SelectionMgr.cxx
src/LightApp/LightApp_SelectionMgr.h
src/LightApp/LightApp_ShowHideOp.cxx
src/LightApp/LightApp_ShowHideOp.h
src/LightApp/LightApp_Study.cxx
src/LightApp/LightApp_Study.h
src/LightApp/LightApp_SwitchOp.cxx
src/LightApp/LightApp_SwitchOp.h
src/LightApp/LightApp_UpdateFlags.h
src/LightApp/LightApp_VTKSelector.cxx
src/LightApp/LightApp_VTKSelector.h
src/LightApp/LightApp_WidgetContainer.cxx [deleted file]
src/LightApp/LightApp_WidgetContainer.h [deleted file]
src/LightApp/Makefile.am
src/LightApp/resources/LightApp.ini
src/LightApp/resources/LightApp.xml
src/LightApp/resources/LightApp_images.po
src/LightApp/resources/LightApp_images.ts [new file with mode: 0644]
src/LightApp/resources/LightApp_msg_en.po
src/LightApp/resources/LightApp_msg_en.ts [new file with mode: 0644]
src/LightApp/resources/icon_about.png
src/LightApp/resources/icon_applogo.png
src/LightApp/resources/icon_module.png
src/LightApp/resources/icon_module_big.png
src/LightApp/resources/icon_select.png
src/LogWindow/LogWindow.cxx
src/LogWindow/LogWindow.h
src/LogWindow/LogWindow.pro [new file with mode: 0644]
src/LogWindow/Makefile.am
src/LogWindow/resources/LogWindow_msg_en.ts [new file with mode: 0644]
src/Makefile.am
src/OBJECT/Handle_SALOME_AISObject.hxx
src/OBJECT/Handle_SALOME_AISShape.hxx
src/OBJECT/Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
src/OBJECT/Handle_SALOME_Filter.hxx
src/OBJECT/Handle_SALOME_InteractiveObject.hxx
src/OBJECT/Handle_SALOME_ListNodeOfListIO.hxx
src/OBJECT/Handle_SALOME_TypeFilter.hxx
src/OBJECT/Makefile.am
src/OBJECT/OBJECT.pro [new file with mode: 0644]
src/OBJECT/SALOME_AISObject.cxx
src/OBJECT/SALOME_AISObject.hxx
src/OBJECT/SALOME_AISObject.ixx
src/OBJECT/SALOME_AISObject.jxx
src/OBJECT/SALOME_AISShape.cxx
src/OBJECT/SALOME_AISShape.hxx
src/OBJECT/SALOME_AISShape.ixx
src/OBJECT/SALOME_AISShape.jxx
src/OBJECT/SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx
src/OBJECT/SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx
src/OBJECT/SALOME_DataMapOfIOMapOfInteger.hxx
src/OBJECT/SALOME_DataMapOfIOMapOfInteger_0.cxx
src/OBJECT/SALOME_Filter.cxx
src/OBJECT/SALOME_Filter.hxx
src/OBJECT/SALOME_Filter.ixx
src/OBJECT/SALOME_Filter.jxx
src/OBJECT/SALOME_InteractiveObject.cxx
src/OBJECT/SALOME_InteractiveObject.hxx
src/OBJECT/SALOME_InteractiveObject.ixx
src/OBJECT/SALOME_InteractiveObject.jxx
src/OBJECT/SALOME_ListIO.hxx
src/OBJECT/SALOME_ListIO_0.cxx
src/OBJECT/SALOME_ListIteratorOfListIO.hxx
src/OBJECT/SALOME_ListIteratorOfListIO_0.cxx
src/OBJECT/SALOME_ListNodeOfListIO.hxx
src/OBJECT/SALOME_ListNodeOfListIO_0.cxx
src/OBJECT/SALOME_Selection.h
src/OBJECT/SALOME_TypeFilter.cxx
src/OBJECT/SALOME_TypeFilter.hxx
src/OBJECT/SALOME_TypeFilter.ixx
src/OBJECT/SALOME_TypeFilter.jxx
src/OCCViewer/Makefile.am
src/OCCViewer/OCCViewer.h
src/OCCViewer/OCCViewer.pro [new file with mode: 0644]
src/OCCViewer/OCCViewer_AISSelector.cxx
src/OCCViewer/OCCViewer_AISSelector.h
src/OCCViewer/OCCViewer_AxialScaleDlg.cxx [new file with mode: 0644]
src/OCCViewer/OCCViewer_AxialScaleDlg.h [new file with mode: 0644]
src/OCCViewer/OCCViewer_ClippingDlg.cxx
src/OCCViewer/OCCViewer_ClippingDlg.h
src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx
src/OCCViewer/OCCViewer_CreateRestoreViewDlg.h
src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx
src/OCCViewer/OCCViewer_SetRotationPointDlg.h
src/OCCViewer/OCCViewer_ToolTip.cxx [new file with mode: 0644]
src/OCCViewer/OCCViewer_ToolTip.h [new file with mode: 0644]
src/OCCViewer/OCCViewer_Trihedron.cxx [new file with mode: 0755]
src/OCCViewer/OCCViewer_Trihedron.h [new file with mode: 0644]
src/OCCViewer/OCCViewer_VService.cxx
src/OCCViewer/OCCViewer_VService.h
src/OCCViewer/OCCViewer_ViewManager.cxx
src/OCCViewer/OCCViewer_ViewManager.h
src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewModel.h
src/OCCViewer/OCCViewer_ViewPort.cxx
src/OCCViewer/OCCViewer_ViewPort.h
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewPort3d.h
src/OCCViewer/OCCViewer_ViewSketcher.cxx
src/OCCViewer/OCCViewer_ViewSketcher.h
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/OCCViewer/OCCViewer_ViewWindow.h
src/OCCViewer/resources/OCCViewer_images.po
src/OCCViewer/resources/OCCViewer_images.ts [new file with mode: 0644]
src/OCCViewer/resources/OCCViewer_msg_en.po
src/OCCViewer/resources/OCCViewer_msg_en.ts [new file with mode: 0644]
src/OCCViewer/resources/occ_view_back.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_bottom.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_camera_dump.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_clipping.png [new file with mode: 0644]
src/OCCViewer/resources/occ_view_clipping_pressed.png [new file with mode: 0644]
src/OCCViewer/resources/occ_view_clone.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_fitall.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_fitarea.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_front.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_glpan.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_left.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_pan.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_presets.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_reset.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_right.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_rotate.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_rotation_point.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_scaling.png [new file with mode: 0644]
src/OCCViewer/resources/occ_view_shoot.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_top.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_triedre.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_zoom.png [new file with mode: 0755]
src/OCCViewer/resources/view_back.png [deleted file]
src/OCCViewer/resources/view_bottom.png [deleted file]
src/OCCViewer/resources/view_camera_dump.png [deleted file]
src/OCCViewer/resources/view_clipping.png [deleted file]
src/OCCViewer/resources/view_clipping_pressed.png [deleted file]
src/OCCViewer/resources/view_clone.png [deleted file]
src/OCCViewer/resources/view_fitall.png [deleted file]
src/OCCViewer/resources/view_fitarea.png [deleted file]
src/OCCViewer/resources/view_front.png [deleted file]
src/OCCViewer/resources/view_glpan.png [deleted file]
src/OCCViewer/resources/view_left.png [deleted file]
src/OCCViewer/resources/view_pan.png [deleted file]
src/OCCViewer/resources/view_presets.png [deleted file]
src/OCCViewer/resources/view_reset.png [deleted file]
src/OCCViewer/resources/view_right.png [deleted file]
src/OCCViewer/resources/view_rotate.png [deleted file]
src/OCCViewer/resources/view_rotation_point.png [deleted file]
src/OCCViewer/resources/view_shoot.png [deleted file]
src/OCCViewer/resources/view_top.png [deleted file]
src/OCCViewer/resources/view_triedre.png [deleted file]
src/OCCViewer/resources/view_zoom.png [deleted file]
src/ObjBrowser/Makefile.am
src/ObjBrowser/OB.h
src/ObjBrowser/OB_Browser.cxx
src/ObjBrowser/OB_Browser.h
src/ObjBrowser/OB_Filter.cxx
src/ObjBrowser/OB_Filter.h
src/ObjBrowser/OB_FindDlg.cxx [deleted file]
src/ObjBrowser/OB_FindDlg.h [deleted file]
src/ObjBrowser/OB_ListItem.cxx [deleted file]
src/ObjBrowser/OB_ListItem.h [deleted file]
src/ObjBrowser/OB_ListView.cxx [deleted file]
src/ObjBrowser/OB_ListView.h [deleted file]
src/ObjBrowser/OB_ObjSearch.cxx [deleted file]
src/ObjBrowser/OB_ObjSearch.h [deleted file]
src/ObjBrowser/resources/OB_msg_en.po
src/ObjBrowser/resources/OB_msg_en.ts [new file with mode: 0644]
src/Plot2d/Makefile.am
src/Plot2d/Plot2d.cxx [new file with mode: 0755]
src/Plot2d/Plot2d.h
src/Plot2d/Plot2d.pro [new file with mode: 0644]
src/Plot2d/Plot2d_Curve.cxx
src/Plot2d/Plot2d_Curve.h
src/Plot2d/Plot2d_FitDataDlg.cxx
src/Plot2d/Plot2d_FitDataDlg.h
src/Plot2d/Plot2d_Prs.cxx
src/Plot2d/Plot2d_Prs.h
src/Plot2d/Plot2d_SetupCurveDlg.cxx
src/Plot2d/Plot2d_SetupCurveDlg.h
src/Plot2d/Plot2d_SetupViewDlg.cxx
src/Plot2d/Plot2d_SetupViewDlg.h
src/Plot2d/Plot2d_ToolTip.cxx
src/Plot2d/Plot2d_ToolTip.h
src/Plot2d/Plot2d_ViewFrame.cxx
src/Plot2d/Plot2d_ViewFrame.h
src/Plot2d/Plot2d_ViewManager.cxx
src/Plot2d/Plot2d_ViewManager.h
src/Plot2d/Plot2d_ViewModel.cxx
src/Plot2d/Plot2d_ViewModel.h
src/Plot2d/Plot2d_ViewWindow.cxx
src/Plot2d/Plot2d_ViewWindow.h
src/Plot2d/resources/Plot2d_images.po
src/Plot2d/resources/Plot2d_images.ts [new file with mode: 0644]
src/Plot2d/resources/Plot2d_msg_en.po
src/Plot2d/resources/Plot2d_msg_en.ts [new file with mode: 0644]
src/Plot2d/resources/plot2d_camera_dump.png
src/Plot2d/resources/plot2d_clone.png
src/Plot2d/resources/plot2d_fitall.png
src/Plot2d/resources/plot2d_fitarea.png
src/Plot2d/resources/plot2d_glpan.png
src/Plot2d/resources/plot2d_legend.png
src/Plot2d/resources/plot2d_linear.png
src/Plot2d/resources/plot2d_linear_y.png
src/Plot2d/resources/plot2d_lines.png
src/Plot2d/resources/plot2d_log.png
src/Plot2d/resources/plot2d_log_y.png
src/Plot2d/resources/plot2d_pan.png
src/Plot2d/resources/plot2d_points.png
src/Plot2d/resources/plot2d_settings.png
src/Plot2d/resources/plot2d_splines.png
src/Plot2d/resources/plot2d_zoom.png
src/Prs/Makefile.am
src/Prs/Prs.pro [new file with mode: 0644]
src/Prs/SALOME_Prs.cxx
src/Prs/SALOME_Prs.h
src/PyConsole/Makefile.am [new file with mode: 0755]
src/PyConsole/PyConsole.h [new file with mode: 0644]
src/PyConsole/PyConsole.pro [new file with mode: 0644]
src/PyConsole/PyConsole_Console.cxx [new file with mode: 0644]
src/PyConsole/PyConsole_Console.h [new file with mode: 0644]
src/PyConsole/PyConsole_Editor.cxx [new file with mode: 0644]
src/PyConsole/PyConsole_Editor.h [new file with mode: 0644]
src/PyConsole/PyConsole_Interp.cxx [new file with mode: 0644]
src/PyConsole/PyConsole_Interp.h [new file with mode: 0644]
src/PyConsole/resources/PyConsole_msg_en.ts [new file with mode: 0644]
src/PyInterp/Makefile.am
src/PyInterp/PyInterp.h
src/PyInterp/PyInterp.pro [new file with mode: 0644]
src/PyInterp/PyInterp_Dispatcher.cxx
src/PyInterp/PyInterp_Dispatcher.h
src/PyInterp/PyInterp_Interp.cxx [new file with mode: 0644]
src/PyInterp/PyInterp_Interp.h [new file with mode: 0644]
src/PyInterp/PyInterp_Watcher.h
src/PyInterp/PyInterp_base.cxx [deleted file]
src/PyInterp/PyInterp_base.h [deleted file]
src/PythonConsole/Makefile.am [deleted file]
src/PythonConsole/PythonConsole.h [deleted file]
src/PythonConsole/PythonConsole_PyConsole.cxx [deleted file]
src/PythonConsole/PythonConsole_PyConsole.h [deleted file]
src/PythonConsole/PythonConsole_PyEditor.cxx [deleted file]
src/PythonConsole/PythonConsole_PyEditor.h [deleted file]
src/PythonConsole/PythonConsole_PyInterp.cxx [deleted file]
src/PythonConsole/PythonConsole_PyInterp.h [deleted file]
src/QDS/Makefile.am
src/QDS/QDS.cxx
src/QDS/QDS.h
src/QDS/QDS.pro [new file with mode: 0644]
src/QDS/QDS_CheckBox.cxx
src/QDS/QDS_CheckBox.h
src/QDS/QDS_ComboBox.cxx
src/QDS/QDS_ComboBox.h
src/QDS/QDS_Datum.cxx
src/QDS/QDS_Datum.h
src/QDS/QDS_LineEdit.cxx
src/QDS/QDS_LineEdit.h
src/QDS/QDS_RadioBox.cxx
src/QDS/QDS_RadioBox.h
src/QDS/QDS_SpinBox.cxx
src/QDS/QDS_SpinBox.h
src/QDS/QDS_SpinBoxDbl.cxx
src/QDS/QDS_SpinBoxDbl.h
src/QDS/QDS_Table.cxx
src/QDS/QDS_Table.h
src/QDS/QDS_TextEdit.cxx
src/QDS/QDS_TextEdit.h
src/QDS/QDS_Validator.cxx
src/QDS/QDS_Validator.h
src/QDS/resources/QDS_msg_en.po
src/QDS/resources/QDS_msg_en.ts [new file with mode: 0644]
src/Qtx/Makefile.am
src/Qtx/Qtx.cxx
src/Qtx/Qtx.h
src/Qtx/Qtx.pro [new file with mode: 0644]
src/Qtx/QtxAction.cxx
src/Qtx/QtxAction.h
src/Qtx/QtxActionGroup.cxx [new file with mode: 0644]
src/Qtx/QtxActionGroup.h [new file with mode: 0644]
src/Qtx/QtxActionMenuMgr.cxx
src/Qtx/QtxActionMenuMgr.h
src/Qtx/QtxActionMgr.cxx
src/Qtx/QtxActionMgr.h
src/Qtx/QtxActionSet.cxx [new file with mode: 0644]
src/Qtx/QtxActionSet.h [new file with mode: 0644]
src/Qtx/QtxActionToolMgr.cxx
src/Qtx/QtxActionToolMgr.h
src/Qtx/QtxColorButton.cxx [new file with mode: 0644]
src/Qtx/QtxColorButton.h [new file with mode: 0644]
src/Qtx/QtxColorScale.cxx
src/Qtx/QtxColorScale.h
src/Qtx/QtxComboBox.cxx
src/Qtx/QtxComboBox.h
src/Qtx/QtxDblSpinBox.cxx [deleted file]
src/Qtx/QtxDblSpinBox.h [deleted file]
src/Qtx/QtxDblValidator.cxx [deleted file]
src/Qtx/QtxDblValidator.h [deleted file]
src/Qtx/QtxDialog.cxx
src/Qtx/QtxDialog.h
src/Qtx/QtxDirListEditor.cxx [deleted file]
src/Qtx/QtxDirListEditor.h [deleted file]
src/Qtx/QtxDockAction.cxx
src/Qtx/QtxDockAction.h
src/Qtx/QtxDockWidget.cxx [new file with mode: 0644]
src/Qtx/QtxDockWidget.h [new file with mode: 0644]
src/Qtx/QtxDockWindow.cxx [deleted file]
src/Qtx/QtxDockWindow.h [deleted file]
src/Qtx/QtxDoubleSpinBox.cxx [new file with mode: 0644]
src/Qtx/QtxDoubleSpinBox.h [new file with mode: 0644]
src/Qtx/QtxEvalExpr.cxx [new file with mode: 0644]
src/Qtx/QtxEvalExpr.h [new file with mode: 0644]
src/Qtx/QtxFontEdit.cxx [new file with mode: 0644]
src/Qtx/QtxFontEdit.h [new file with mode: 0644]
src/Qtx/QtxGridBox.cxx [new file with mode: 0644]
src/Qtx/QtxGridBox.h [new file with mode: 0644]
src/Qtx/QtxGroupBox.cxx
src/Qtx/QtxGroupBox.h
src/Qtx/QtxIntSpinBox.cxx
src/Qtx/QtxIntSpinBox.h
src/Qtx/QtxListAction.cxx
src/Qtx/QtxListAction.h
src/Qtx/QtxListBox.cxx
src/Qtx/QtxListBox.h
src/Qtx/QtxListOfOperations.cxx [deleted file]
src/Qtx/QtxListOfOperations.h [deleted file]
src/Qtx/QtxListResourceEdit.cxx [deleted file]
src/Qtx/QtxListResourceEdit.h [deleted file]
src/Qtx/QtxListView.cxx [deleted file]
src/Qtx/QtxListView.h [deleted file]
src/Qtx/QtxLogoMgr.cxx
src/Qtx/QtxLogoMgr.h
src/Qtx/QtxMRUAction.cxx
src/Qtx/QtxMRUAction.h
src/Qtx/QtxMainWindow.cxx
src/Qtx/QtxMainWindow.h
src/Qtx/QtxMap.h [new file with mode: 0644]
src/Qtx/QtxMenu.cxx [new file with mode: 0644]
src/Qtx/QtxMenu.h [new file with mode: 0644]
src/Qtx/QtxMenuButton.cxx [deleted file]
src/Qtx/QtxMenuButton.h [deleted file]
src/Qtx/QtxMultiAction.cxx [new file with mode: 0644]
src/Qtx/QtxMultiAction.h [new file with mode: 0644]
src/Qtx/QtxOperations.cxx [deleted file]
src/Qtx/QtxOperations.h [deleted file]
src/Qtx/QtxPagePrefMgr.cxx [new file with mode: 0644]
src/Qtx/QtxPagePrefMgr.h [new file with mode: 0644]
src/Qtx/QtxParser.cxx [deleted file]
src/Qtx/QtxParser.h [deleted file]
src/Qtx/QtxPathDialog.cxx
src/Qtx/QtxPathDialog.h
src/Qtx/QtxPathEdit.cxx [new file with mode: 0644]
src/Qtx/QtxPathEdit.h [new file with mode: 0644]
src/Qtx/QtxPathListEdit.cxx [new file with mode: 0644]
src/Qtx/QtxPathListEdit.h [new file with mode: 0644]
src/Qtx/QtxPopupMenu.cxx [deleted file]
src/Qtx/QtxPopupMenu.h [deleted file]
src/Qtx/QtxPopupMgr.cxx
src/Qtx/QtxPopupMgr.h
src/Qtx/QtxPreferenceMgr.cxx [new file with mode: 0644]
src/Qtx/QtxPreferenceMgr.h [new file with mode: 0644]
src/Qtx/QtxResourceEdit.cxx [deleted file]
src/Qtx/QtxResourceEdit.h [deleted file]
src/Qtx/QtxResourceMgr.cxx
src/Qtx/QtxResourceMgr.h
src/Qtx/QtxRubberBand.cxx [new file with mode: 0755]
src/Qtx/QtxRubberBand.h [new file with mode: 0755]
src/Qtx/QtxSearchTool.cxx [new file with mode: 0644]
src/Qtx/QtxSearchTool.h [new file with mode: 0644]
src/Qtx/QtxSplash.cxx
src/Qtx/QtxSplash.h
src/Qtx/QtxStdOperations.cxx [deleted file]
src/Qtx/QtxStdOperations.h [deleted file]
src/Qtx/QtxTable.cxx
src/Qtx/QtxTable.h
src/Qtx/QtxToolBar.cxx
src/Qtx/QtxToolBar.h
src/Qtx/QtxToolTip.cxx
src/Qtx/QtxToolTip.h
src/Qtx/QtxTranslator.cxx [new file with mode: 0644]
src/Qtx/QtxTranslator.h [new file with mode: 0644]
src/Qtx/QtxTreeView.cxx [new file with mode: 0644]
src/Qtx/QtxTreeView.h [new file with mode: 0644]
src/Qtx/QtxValidator.cxx [new file with mode: 0644]
src/Qtx/QtxValidator.h [new file with mode: 0644]
src/Qtx/QtxWorkspace.cxx [new file with mode: 0644]
src/Qtx/QtxWorkspace.h [new file with mode: 0644]
src/Qtx/QtxWorkspaceAction.cxx
src/Qtx/QtxWorkspaceAction.h
src/Qtx/QtxWorkstack.cxx
src/Qtx/QtxWorkstack.h
src/Qtx/QtxWorkstackAction.cxx
src/Qtx/QtxWorkstackAction.h
src/QxGraph/Makefile.am
src/QxGraph/QxGraph.h
src/QxGraph/QxGraph.pro [new file with mode: 0644]
src/QxGraph/QxGraph_ActiveItem.h
src/QxGraph/QxGraph_Canvas.cxx
src/QxGraph/QxGraph_Canvas.h
src/QxGraph/QxGraph_CanvasView.cxx
src/QxGraph/QxGraph_CanvasView.h
src/QxGraph/QxGraph_Def.h
src/QxGraph/QxGraph_Prs.cxx
src/QxGraph/QxGraph_Prs.h
src/QxGraph/QxGraph_ViewManager.cxx
src/QxGraph/QxGraph_ViewManager.h
src/QxGraph/QxGraph_ViewModel.cxx
src/QxGraph/QxGraph_ViewModel.h
src/QxGraph/QxGraph_ViewWindow.cxx
src/QxGraph/QxGraph_ViewWindow.h
src/QxGraph/resources/QxGraph_images.po
src/QxGraph/resources/QxGraph_images.ts [new file with mode: 0644]
src/QxGraph/resources/QxGraph_msg_en.po
src/QxGraph/resources/QxGraph_msg_en.ts [new file with mode: 0644]
src/QxGraph/resources/qx_view_fitall.png [new file with mode: 0755]
src/QxGraph/resources/qx_view_fitarea.png [new file with mode: 0755]
src/QxGraph/resources/qx_view_glpan.png [new file with mode: 0644]
src/QxGraph/resources/qx_view_pan.png [new file with mode: 0755]
src/QxGraph/resources/qx_view_reset.png [new file with mode: 0755]
src/QxGraph/resources/qx_view_zoom.png [new file with mode: 0755]
src/QxGraph/resources/view_fitall.png [deleted file]
src/QxGraph/resources/view_fitarea.png [deleted file]
src/QxGraph/resources/view_glpan.png [deleted file]
src/QxGraph/resources/view_pan.png [deleted file]
src/QxGraph/resources/view_reset.png [deleted file]
src/QxGraph/resources/view_zoom.png [deleted file]
src/QxScene/DebTrace.hxx [new file with mode: 0644]
src/QxScene/Makefile.am [new file with mode: 0755]
src/QxScene/QxScene.h [new file with mode: 0644]
src/QxScene/QxScene_Def.h [new file with mode: 0644]
src/QxScene/QxScene_ViewManager.cxx [new file with mode: 0644]
src/QxScene/QxScene_ViewManager.h [new file with mode: 0644]
src/QxScene/QxScene_ViewModel.cxx [new file with mode: 0644]
src/QxScene/QxScene_ViewModel.h [new file with mode: 0644]
src/QxScene/QxScene_ViewWindow.cxx [new file with mode: 0644]
src/QxScene/QxScene_ViewWindow.h [new file with mode: 0644]
src/QxScene/resources/QxSceneViewer_images.ts [new file with mode: 0644]
src/QxScene/resources/QxSceneViewer_msg_en.ts [new file with mode: 0644]
src/QxScene/resources/QxScene_images.po [new file with mode: 0644]
src/QxScene/resources/QxScene_msg_en.po [new file with mode: 0644]
src/QxScene/resources/qx_view_fitall.png [new file with mode: 0755]
src/QxScene/resources/qx_view_fitarea.png [new file with mode: 0755]
src/QxScene/resources/qx_view_glpan.png [new file with mode: 0644]
src/QxScene/resources/qx_view_pan.png [new file with mode: 0755]
src/QxScene/resources/qx_view_reset.png [new file with mode: 0755]
src/QxScene/resources/qx_view_zoom.png [new file with mode: 0755]
src/RegistryDisplay/HelpWindow.cxx [deleted file]
src/RegistryDisplay/HelpWindow.hxx [deleted file]
src/RegistryDisplay/IntervalWindow.cxx [deleted file]
src/RegistryDisplay/IntervalWindow.hxx [deleted file]
src/RegistryDisplay/Makefile.am [deleted file]
src/RegistryDisplay/RegWidget.cxx [deleted file]
src/RegistryDisplay/RegWidget.h [deleted file]
src/RegistryDisplay/RegWidgetFactory.cxx [deleted file]
src/ResExporter/Makefile.am
src/ResExporter/ResExporter.pro [new file with mode: 0644]
src/ResExporter/ResourceExporter.cxx
src/SALOME_PY/Makefile.am
src/SALOME_PY/SalomePy.cxx
src/SALOME_PYQT/Makefile.am
src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.am
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_GUI.h
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_GUI.sip
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.cxx
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.h
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_SipDefs.h.in [deleted file]
src/SALOME_PYQT/SalomePyQt/Makefile.am
src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx
src/SALOME_PYQT/SalomePyQt/SalomePyQt.h
src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip
src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip [deleted file]
src/SALOME_SWIG/Help.py
src/SALOME_SWIG/Makefile.am
src/SALOME_SWIG/PyInterp.py
src/SALOME_SWIG/SALOMEGUI_Swig.cxx
src/SALOME_SWIG/SALOMEGUI_Swig.hxx
src/SALOME_SWIG/SALOMEGUI_Swig.i
src/SALOME_SWIG/SALOMEGUI_shared_modules.py
src/SALOME_SWIG/examplevtk1.py
src/SALOME_SWIG/libSALOME_Swig.i
src/SALOME_SWIG/salome.py
src/SALOME_SWIG/supervisionexample.py.in
src/SALOME_SWIG/supervisiongeomexample.py.in
src/SALOME_SWIG/test_big_table.py
src/SALOME_SWIG/test_many_objects.py
src/SALOME_SWIG/test_remove_ref.py
src/SALOME_SWIG/test_table.py
src/SOCC/Makefile.am
src/SOCC/SOCC.h
src/SOCC/SOCC.pro [new file with mode: 0644]
src/SOCC/SOCC_Prs.cxx
src/SOCC/SOCC_Prs.h
src/SOCC/SOCC_ViewModel.cxx
src/SOCC/SOCC_ViewModel.h
src/SOCC/SOCC_ViewWindow.cxx
src/SOCC/SOCC_ViewWindow.h
src/SPlot2d/Makefile.am
src/SPlot2d/SPlot2d.h
src/SPlot2d/SPlot2d.pro [new file with mode: 0644]
src/SPlot2d/SPlot2d_Curve.cxx
src/SPlot2d/SPlot2d_Curve.h
src/SPlot2d/SPlot2d_Prs.cxx
src/SPlot2d/SPlot2d_Prs.h
src/SPlot2d/SPlot2d_ViewModel.cxx
src/SPlot2d/SPlot2d_ViewModel.h
src/SPlot2d/SPlot2d_ViewWindow.cxx
src/SPlot2d/SPlot2d_ViewWindow.h
src/SPlot2d/resources/SPlot2d_msg_en.po
src/STD/Makefile.am
src/STD/STD.h
src/STD/STD.pro [new file with mode: 0644]
src/STD/STD_Application.cxx
src/STD/STD_Application.h
src/STD/STD_LoadStudiesDlg.cxx [deleted file]
src/STD/STD_LoadStudiesDlg.h [deleted file]
src/STD/STD_MDIDesktop.cxx
src/STD/STD_MDIDesktop.h
src/STD/STD_SDIDesktop.cxx
src/STD/STD_SDIDesktop.h
src/STD/STD_TabDesktop.cxx
src/STD/STD_TabDesktop.h
src/STD/resources/STD_images.po
src/STD/resources/STD_images.ts [new file with mode: 0644]
src/STD/resources/STD_msg_en.po
src/STD/resources/STD_msg_en.ts [new file with mode: 0644]
src/STD/resources/cascade.png [new file with mode: 0644]
src/STD/resources/close.png
src/STD/resources/config [deleted file]
src/STD/resources/copy.png
src/STD/resources/cursor_rotate.png [deleted file]
src/STD/resources/cursor_zoom.png [deleted file]
src/STD/resources/cut.png
src/STD/resources/delete.png [new file with mode: 0644]
src/STD/resources/help.png
src/STD/resources/htile.png [new file with mode: 0644]
src/STD/resources/new.png
src/STD/resources/open.png
src/STD/resources/paste.png
src/STD/resources/print.png
src/STD/resources/redo.png
src/STD/resources/reset.png
src/STD/resources/save.png
src/STD/resources/undo.png
src/STD/resources/undo_arrow.png [deleted file]
src/STD/resources/vtile.png [new file with mode: 0644]
src/SUIT/Makefile.am
src/SUIT/SUIT.h
src/SUIT/SUIT.pro [new file with mode: 0644]
src/SUIT/SUIT_Accel.cxx
src/SUIT/SUIT_Accel.h
src/SUIT/SUIT_ActionOperation.cxx
src/SUIT/SUIT_ActionOperation.h
src/SUIT/SUIT_Application.cxx
src/SUIT/SUIT_Application.h
src/SUIT/SUIT_Convertor.h [deleted file]
src/SUIT/SUIT_DataBrowser.cxx [new file with mode: 0644]
src/SUIT/SUIT_DataBrowser.h [new file with mode: 0644]
src/SUIT/SUIT_DataObject.cxx
src/SUIT/SUIT_DataObject.h
src/SUIT/SUIT_DataObjectIterator.cxx
src/SUIT/SUIT_DataObjectIterator.h
src/SUIT/SUIT_DataObjectKey.cxx
src/SUIT/SUIT_DataObjectKey.h
src/SUIT/SUIT_DataOwner.cxx
src/SUIT/SUIT_DataOwner.h
src/SUIT/SUIT_Desktop.cxx
src/SUIT/SUIT_Desktop.h
src/SUIT/SUIT_ExceptionHandler.cxx
src/SUIT/SUIT_ExceptionHandler.h
src/SUIT/SUIT_FileDlg.cxx
src/SUIT/SUIT_FileDlg.h
src/SUIT/SUIT_FileValidator.cxx
src/SUIT/SUIT_FileValidator.h
src/SUIT/SUIT_LicenseDlg.cxx [new file with mode: 0755]
src/SUIT/SUIT_LicenseDlg.h [new file with mode: 0755]
src/SUIT/SUIT_MessageBox.cxx
src/SUIT/SUIT_MessageBox.h
src/SUIT/SUIT_MsgDlg.cxx [deleted file]
src/SUIT/SUIT_MsgDlg.h [deleted file]
src/SUIT/SUIT_Operation.cxx
src/SUIT/SUIT_Operation.h
src/SUIT/SUIT_OverrideCursor.cxx
src/SUIT/SUIT_OverrideCursor.h
src/SUIT/SUIT_ParserSettings.cxx [deleted file]
src/SUIT/SUIT_ParserSettings.h [deleted file]
src/SUIT/SUIT_PopupClient.cxx
src/SUIT/SUIT_PopupClient.h
src/SUIT/SUIT_PreferenceMgr.cxx [new file with mode: 0644]
src/SUIT/SUIT_PreferenceMgr.h [new file with mode: 0644]
src/SUIT/SUIT_ResourceMgr.cxx
src/SUIT/SUIT_ResourceMgr.h
src/SUIT/SUIT_SelectionFilter.cxx
src/SUIT/SUIT_SelectionFilter.h
src/SUIT/SUIT_SelectionMgr.cxx
src/SUIT/SUIT_SelectionMgr.h
src/SUIT/SUIT_Selector.cxx
src/SUIT/SUIT_Selector.h
src/SUIT/SUIT_Session.cxx
src/SUIT/SUIT_Session.h
src/SUIT/SUIT_SmartPtr.h
src/SUIT/SUIT_Study.cxx
src/SUIT/SUIT_Study.h
src/SUIT/SUIT_ToolButton.cxx [deleted file]
src/SUIT/SUIT_ToolButton.h [deleted file]
src/SUIT/SUIT_Tools.cxx
src/SUIT/SUIT_Tools.h
src/SUIT/SUIT_TreeModel.cxx [new file with mode: 0755]
src/SUIT/SUIT_TreeModel.h [new file with mode: 0755]
src/SUIT/SUIT_TreeSync.h
src/SUIT/SUIT_ViewManager.cxx
src/SUIT/SUIT_ViewManager.h
src/SUIT/SUIT_ViewModel.cxx
src/SUIT/SUIT_ViewModel.h
src/SUIT/SUIT_ViewWindow.cxx
src/SUIT/SUIT_ViewWindow.h
src/SUIT/resources/SUIT_images.po
src/SUIT/resources/SUIT_msg_en.po
src/SUIT/resources/SUIT_msg_en.ts [new file with mode: 0644]
src/SUIT/resources/cascade.png [deleted file]
src/SUIT/resources/htile.png [deleted file]
src/SUIT/resources/vtile.png [deleted file]
src/SUIT/utilities.h [deleted file]
src/SUITApp/Makefile.am
src/SUITApp/SUITApp.cxx
src/SUITApp/SUITApp.pro [new file with mode: 0644]
src/SUITApp/SUITApp_Application.cxx
src/SUITApp/SUITApp_Application.h
src/SUITApp/resources/SUITApp_msg_en.po
src/SUITApp/resources/SUITApp_msg_en.ts [new file with mode: 0644]
src/SUPERVGraph/Makefile.am
src/SUPERVGraph/SUPERVGraph.cxx
src/SUPERVGraph/SUPERVGraph.h
src/SUPERVGraph/SUPERVGraph.pro [new file with mode: 0644]
src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx
src/SUPERVGraph/SUPERVGraph_ViewFrame.h
src/SUPERVGraph/SUPERVGraph_ViewManager.cxx
src/SUPERVGraph/SUPERVGraph_ViewManager.h
src/SUPERVGraph/SUPERVGraph_ViewModel.cxx
src/SUPERVGraph/SUPERVGraph_ViewModel.h
src/SUPERVGraph/resources/SUPERVGraph_images.po
src/SUPERVGraph/resources/SUPERVGraph_images.ts [new file with mode: 0644]
src/SUPERVGraph/resources/SUPERVGraph_msg_en.po
src/SUPERVGraph/resources/SUPERVGraph_msg_en.ts [new file with mode: 0644]
src/SUPERVGraph/resources/superv_view_pan.png [new file with mode: 0644]
src/SUPERVGraph/resources/superv_view_reset.png [new file with mode: 0644]
src/SUPERVGraph/resources/view_pan.png [deleted file]
src/SUPERVGraph/resources/view_reset.png [deleted file]
src/SVTK/Makefile.am
src/SVTK/SALOME_Actor.cxx
src/SVTK/SALOME_Actor.h
src/SVTK/SVTK.cxx
src/SVTK/SVTK.h
src/SVTK/SVTK.pro [new file with mode: 0644]
src/SVTK/SVTK_Actor.cxx
src/SVTK/SVTK_Actor.h
src/SVTK/SVTK_ComboAction.cxx [new file with mode: 0644]
src/SVTK/SVTK_ComboAction.h [new file with mode: 0644]
src/SVTK/SVTK_CubeAxesActor2D.cxx
src/SVTK/SVTK_CubeAxesActor2D.h
src/SVTK/SVTK_CubeAxesDlg.cxx
src/SVTK/SVTK_CubeAxesDlg.h
src/SVTK/SVTK_DeviceActor.cxx
src/SVTK/SVTK_DeviceActor.h
src/SVTK/SVTK_DialogBase.cxx
src/SVTK/SVTK_DialogBase.h
src/SVTK/SVTK_Event.h
src/SVTK/SVTK_Extension.cxx
src/SVTK/SVTK_Extension.h
src/SVTK/SVTK_FontWidget.cxx
src/SVTK/SVTK_FontWidget.h
src/SVTK/SVTK_Functor.h
src/SVTK/SVTK_GenericRenderWindowInteractor.cxx
src/SVTK/SVTK_GenericRenderWindowInteractor.h
src/SVTK/SVTK_ImageWriter.cxx [new file with mode: 0755]
src/SVTK/SVTK_ImageWriter.h [new file with mode: 0755]
src/SVTK/SVTK_ImageWriterMgr.cxx [new file with mode: 0755]
src/SVTK/SVTK_ImageWriterMgr.h [new file with mode: 0755]
src/SVTK/SVTK_InteractorStyle.cxx
src/SVTK/SVTK_InteractorStyle.h
src/SVTK/SVTK_KeyFreeInteractorStyle.cxx [new file with mode: 0644]
src/SVTK/SVTK_KeyFreeInteractorStyle.h [new file with mode: 0644]
src/SVTK/SVTK_MainWindow.cxx [deleted file]
src/SVTK/SVTK_MainWindow.h [deleted file]
src/SVTK/SVTK_NonIsometricDlg.cxx
src/SVTK/SVTK_NonIsometricDlg.h
src/SVTK/SVTK_Prs.cxx
src/SVTK/SVTK_Prs.h
src/SVTK/SVTK_Recorder.cxx [new file with mode: 0755]
src/SVTK/SVTK_Recorder.h [new file with mode: 0755]
src/SVTK/SVTK_RecorderDlg.cxx [new file with mode: 0644]
src/SVTK/SVTK_RecorderDlg.h [new file with mode: 0644]
src/SVTK/SVTK_RectPicker.cxx
src/SVTK/SVTK_RectPicker.h
src/SVTK/SVTK_RenderWindowInteractor.cxx
src/SVTK/SVTK_RenderWindowInteractor.h
src/SVTK/SVTK_Renderer.cxx
src/SVTK/SVTK_Renderer.h
src/SVTK/SVTK_Selection.h
src/SVTK/SVTK_SelectionEvent.h
src/SVTK/SVTK_Selector.cxx
src/SVTK/SVTK_Selector.h
src/SVTK/SVTK_SelectorDef.h
src/SVTK/SVTK_SetRotationPointDlg.cxx
src/SVTK/SVTK_SetRotationPointDlg.h
src/SVTK/SVTK_SpaceMouse.cxx
src/SVTK/SVTK_SpaceMouse.h
src/SVTK/SVTK_Trihedron.cxx
src/SVTK/SVTK_Trihedron.h
src/SVTK/SVTK_UpdateRateDlg.cxx
src/SVTK/SVTK_UpdateRateDlg.h
src/SVTK/SVTK_View.cxx
src/SVTK/SVTK_View.h
src/SVTK/SVTK_ViewManager.cxx
src/SVTK/SVTK_ViewManager.h
src/SVTK/SVTK_ViewModel.cxx
src/SVTK/SVTK_ViewModel.h
src/SVTK/SVTK_ViewModelBase.h
src/SVTK/SVTK_ViewParameterDlg.cxx [new file with mode: 0755]
src/SVTK/SVTK_ViewParameterDlg.h [new file with mode: 0755]
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h
src/SVTK/resources/SVTK_images.po
src/SVTK/resources/SVTK_images.ts [new file with mode: 0644]
src/SVTK/resources/SVTK_msg_en.po
src/SVTK/resources/SVTK_msg_en.ts [new file with mode: 0644]
src/SVTK/resources/vtk_view_graduated_axes.png [new file with mode: 0755]
src/SVTK/resources/vtk_view_parallel.png [new file with mode: 0755]
src/SVTK/resources/vtk_view_parameters.png [new file with mode: 0755]
src/SVTK/resources/vtk_view_perspective.png [new file with mode: 0755]
src/SVTK/resources/vtk_view_recording_pause.png [new file with mode: 0644]
src/SVTK/resources/vtk_view_recording_play.png [new file with mode: 0644]
src/SVTK/resources/vtk_view_recording_start.png [new file with mode: 0644]
src/SVTK/resources/vtk_view_recording_stop.png [new file with mode: 0644]
src/SVTK/resources/vtk_view_rotation_point.png [new file with mode: 0755]
src/SVTK/resources/vtk_view_scaling.png [new file with mode: 0644]
src/SVTK/resources/vtk_view_style_switch.png [new file with mode: 0755]
src/SVTK/resources/vtk_view_update_rate.png [new file with mode: 0755]
src/SalomeApp/Makefile.am
src/SalomeApp/SalomeApp.h
src/SalomeApp/SalomeApp.pro [new file with mode: 0644]
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/SalomeApp_CheckFileDlg.cxx
src/SalomeApp/SalomeApp_CheckFileDlg.h
src/SalomeApp/SalomeApp_DataModel.cxx
src/SalomeApp/SalomeApp_DataModel.h
src/SalomeApp/SalomeApp_DataObject.cxx
src/SalomeApp/SalomeApp_DataObject.h
src/SalomeApp/SalomeApp_DoubleSpinBox.cxx [new file with mode: 0644]
src/SalomeApp/SalomeApp_DoubleSpinBox.h [new file with mode: 0644]
src/SalomeApp/SalomeApp_EventFilter.cxx [deleted file]
src/SalomeApp/SalomeApp_EventFilter.h [deleted file]
src/SalomeApp/SalomeApp_ExceptionHandler.cxx
src/SalomeApp/SalomeApp_ExceptionHandler.h
src/SalomeApp/SalomeApp_ExitDlg.cxx
src/SalomeApp/SalomeApp_ExitDlg.h
src/SalomeApp/SalomeApp_Filter.cxx
src/SalomeApp/SalomeApp_Filter.h
src/SalomeApp/SalomeApp_ImportOperation.cxx
src/SalomeApp/SalomeApp_ImportOperation.h
src/SalomeApp/SalomeApp_IntSpinBox.cxx [new file with mode: 0644]
src/SalomeApp/SalomeApp_IntSpinBox.h [new file with mode: 0644]
src/SalomeApp/SalomeApp_ListView.cxx
src/SalomeApp/SalomeApp_ListView.h
src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx [new file with mode: 0644]
src/SalomeApp/SalomeApp_LoadStudiesDlg.h [new file with mode: 0644]
src/SalomeApp/SalomeApp_Module.cxx
src/SalomeApp/SalomeApp_Module.h
src/SalomeApp/SalomeApp_NoteBookDlg.cxx [new file with mode: 0644]
src/SalomeApp/SalomeApp_NoteBookDlg.h [new file with mode: 0644]
src/SalomeApp/SalomeApp_PyInterp.cxx
src/SalomeApp/SalomeApp_PyInterp.h
src/SalomeApp/SalomeApp_Study.cxx
src/SalomeApp/SalomeApp_Study.h
src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx
src/SalomeApp/SalomeApp_StudyPropertiesDlg.h
src/SalomeApp/SalomeApp_Tools.cxx
src/SalomeApp/SalomeApp_Tools.h
src/SalomeApp/SalomeApp_TypeFilter.cxx
src/SalomeApp/SalomeApp_TypeFilter.h
src/SalomeApp/SalomeApp_VisualState.cxx
src/SalomeApp/SalomeApp_VisualState.h
src/SalomeApp/Test/Makefile.am
src/SalomeApp/Test/SalomeAppTest.cxx
src/SalomeApp/Test/SalomeAppTest.hxx
src/SalomeApp/Test/TestSalomeApp.cxx
src/SalomeApp/Test/TestSalomeApp.py
src/SalomeApp/resources/SalomeApp.xml
src/SalomeApp/resources/SalomeApp_images.po
src/SalomeApp/resources/SalomeApp_images.ts [new file with mode: 0644]
src/SalomeApp/resources/SalomeApp_msg_en.po
src/SalomeApp/resources/SalomeApp_msg_en.ts [new file with mode: 0644]
src/Session/InquireServersQThread.cxx [deleted file]
src/Session/InquireServersQThread.h [deleted file]
src/Session/Makefile.am
src/Session/SALOME_Session.hxx
src/Session/SALOME_Session_Server.cxx
src/Session/SalomeApp_Engine_i.cxx
src/Session/SalomeApp_Engine_i.hxx
src/Session/Session.pro [new file with mode: 0644]
src/Session/Session_ServerCheck.cxx
src/Session/Session_ServerCheck.hxx
src/Session/Session_ServerLauncher.cxx
src/Session/Session_ServerLauncher.hxx
src/Session/Session_ServerThread.cxx
src/Session/Session_ServerThread.hxx
src/Session/Session_Session_i.cxx
src/Session/Session_Session_i.hxx
src/Style/Makefile.am
src/Style/SalomeStyle.cxx [deleted file]
src/Style/SalomeStyle.h [deleted file]
src/Style/Style.h [new file with mode: 0644]
src/Style/Style.qrc [new file with mode: 0644]
src/Style/Style_Model.cxx [new file with mode: 0644]
src/Style/Style_Model.h [new file with mode: 0644]
src/Style/Style_PrefDlg.cxx [new file with mode: 0644]
src/Style/Style_PrefDlg.h [new file with mode: 0644]
src/Style/Style_ResourceMgr.cxx [new file with mode: 0644]
src/Style/Style_ResourceMgr.h [new file with mode: 0644]
src/Style/Style_Salome.cxx [new file with mode: 0644]
src/Style/Style_Salome.h [new file with mode: 0644]
src/Style/Style_Tools.cxx [new file with mode: 0644]
src/Style/Style_Tools.h [new file with mode: 0644]
src/Style/images/critical.png [new file with mode: 0644]
src/Style/images/information.png [new file with mode: 0644]
src/Style/images/question.png [new file with mode: 0644]
src/Style/images/warning.png [new file with mode: 0644]
src/Style/resources/SalomeStyle.xml [new file with mode: 0644]
src/TOOLSGUI/Makefile.am
src/TOOLSGUI/TOOLSGUI.pro [new file with mode: 0644]
src/TOOLSGUI/ToolsGUI.cxx
src/TOOLSGUI/ToolsGUI.h
src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx
src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h
src/TOOLSGUI/ToolsGUI_HelpWindow.cxx [deleted file]
src/TOOLSGUI/ToolsGUI_HelpWindow.h [deleted file]
src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx [deleted file]
src/TOOLSGUI/ToolsGUI_IntervalWindow.h [deleted file]
src/TOOLSGUI/ToolsGUI_RegWidget.cxx
src/TOOLSGUI/ToolsGUI_RegWidget.h
src/TOOLSGUI/resources/ToolsGUI_icons.po
src/TOOLSGUI/resources/ToolsGUI_msg_en.po
src/TOOLSGUI/resources/ToolsGUI_msg_en.ts [new file with mode: 0644]
src/VTKViewer/Makefile.am
src/VTKViewer/VTKViewer.cxx
src/VTKViewer/VTKViewer.h
src/VTKViewer/VTKViewer.pro [new file with mode: 0644]
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_Actor.h
src/VTKViewer/VTKViewer_Algorithm.h
src/VTKViewer/VTKViewer_AppendFilter.cxx
src/VTKViewer/VTKViewer_AppendFilter.h
src/VTKViewer/VTKViewer_CellLocationsArray.cxx
src/VTKViewer/VTKViewer_CellLocationsArray.h
src/VTKViewer/VTKViewer_ConvexTool.cxx
src/VTKViewer/VTKViewer_ConvexTool.h
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h
src/VTKViewer/VTKViewer_Filter.cxx
src/VTKViewer/VTKViewer_Filter.h
src/VTKViewer/VTKViewer_Functor.h
src/VTKViewer/VTKViewer_GeometryFilter.cxx
src/VTKViewer/VTKViewer_GeometryFilter.h
src/VTKViewer/VTKViewer_InteractorStyle.cxx
src/VTKViewer/VTKViewer_InteractorStyle.h
src/VTKViewer/VTKViewer_PassThroughFilter.cxx
src/VTKViewer/VTKViewer_PassThroughFilter.h
src/VTKViewer/VTKViewer_RenderWindow.cxx
src/VTKViewer/VTKViewer_RenderWindow.h
src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx
src/VTKViewer/VTKViewer_RenderWindowInteractor.h
src/VTKViewer/VTKViewer_ShrinkFilter.cxx
src/VTKViewer/VTKViewer_ShrinkFilter.h
src/VTKViewer/VTKViewer_Transform.cxx
src/VTKViewer/VTKViewer_Transform.h
src/VTKViewer/VTKViewer_TransformFilter.cxx
src/VTKViewer/VTKViewer_TransformFilter.h
src/VTKViewer/VTKViewer_Trihedron.cxx
src/VTKViewer/VTKViewer_Trihedron.h
src/VTKViewer/VTKViewer_Utilities.cxx
src/VTKViewer/VTKViewer_Utilities.h
src/VTKViewer/VTKViewer_VectorText.cxx
src/VTKViewer/VTKViewer_VectorText.h
src/VTKViewer/VTKViewer_ViewManager.cxx
src/VTKViewer/VTKViewer_ViewManager.h
src/VTKViewer/VTKViewer_ViewModel.cxx
src/VTKViewer/VTKViewer_ViewModel.h
src/VTKViewer/VTKViewer_ViewWindow.cxx
src/VTKViewer/VTKViewer_ViewWindow.h
src/VTKViewer/resources/VTKViewer_images.po
src/VTKViewer/resources/VTKViewer_images.ts [new file with mode: 0644]
src/VTKViewer/resources/VTKViewer_msg_en.po
src/VTKViewer/resources/VTKViewer_msg_en.ts [new file with mode: 0644]
src/VTKViewer/resources/view_back.png [deleted file]
src/VTKViewer/resources/view_bottom.png [deleted file]
src/VTKViewer/resources/view_camera_dump.png [deleted file]
src/VTKViewer/resources/view_fitall.png [deleted file]
src/VTKViewer/resources/view_fitarea.png [deleted file]
src/VTKViewer/resources/view_front.png [deleted file]
src/VTKViewer/resources/view_glpan.png [deleted file]
src/VTKViewer/resources/view_graduated_axes.png [deleted file]
src/VTKViewer/resources/view_left.png [deleted file]
src/VTKViewer/resources/view_pan.png [deleted file]
src/VTKViewer/resources/view_reset.png [deleted file]
src/VTKViewer/resources/view_right.png [deleted file]
src/VTKViewer/resources/view_rotate.png [deleted file]
src/VTKViewer/resources/view_rotation_point.png [deleted file]
src/VTKViewer/resources/view_scaling.png [deleted file]
src/VTKViewer/resources/view_top.png [deleted file]
src/VTKViewer/resources/view_triedre.png [deleted file]
src/VTKViewer/resources/view_update_rate.png [deleted file]
src/VTKViewer/resources/view_zoom.png [deleted file]
src/VTKViewer/resources/vtk_view_back.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_bottom.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_camera_dump.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_fitall.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_fitarea.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_front.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_glpan.png [new file with mode: 0644]
src/VTKViewer/resources/vtk_view_left.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_pan.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_reset.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_right.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_rotate.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_top.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_triedre.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_zoom.png [new file with mode: 0755]
src/src.pro [new file with mode: 0644]

index 9a5df78eb6f66e73f76dad717af0d82a48db4b23..9669a71af4b69ffdf30653bc74c7b49e66a449a6 100644 (file)
@@ -1,26 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : GUI_version.h
-//  Author : Vadim SANDLER
-//  Module : SALOME
-
+//  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
 #if !defined(__GUI_VERSION_H__)
 #define __GUI_VERSION_H__
 
index 62e21b1b5c7e9a8475073ba41e36d6eb4009ba92..38c49561ad444a1ca8b54292c99aaa6bb257f882 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # -* Makefile *-
-#
 # Author : Patrick GOLDBRONN (CEA)
 # Date : 28/06/2001
 # $Header$
 #
-
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
+ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
+                  -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+
 if GUI_ENABLE_CORBA
     IDLDIR = idl
 else !GUI_ENABLE_CORBA
@@ -37,11 +41,11 @@ DIST_SUBDIRS = idl adm_local resources src doc bin
 
 DISTCLEANFILES = a.out aclocal.m4 configure
 
-salomeinclude_DATA=GUI_version.h
+salomeinclude_DATA = GUI_version.h
 
-EXTRA_DIST+= \
-       build_configure \
-       clean_configure \
+EXTRA_DIST +=          \
+       build_configure \
+       clean_configure \
        LICENCE
 
 dist-hook:
@@ -50,7 +54,7 @@ dist-hook:
 usr_docs:
        (cd doc && $(MAKE) $(AM_MAKEFLAGS) usr_docs)
 
-docs:usr_docs
+docs: usr_docs
 
 dev_docs:
        (cd doc && $(MAKE) $(AM_MAKEFLAGS) dev_docs)
diff --git a/SUIT.pro b/SUIT.pro
new file mode 100644 (file)
index 0000000..307a125
--- /dev/null
+++ b/SUIT.pro
@@ -0,0 +1,26 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+TEMPLATE = subdirs
+CONFIG += ordered
+
+SUBDIRS = src
index 7ae83a6fc82f9b81116b259ad29f7610ead06353..c3877a44042c123f2ba491b200d8c522af51c97b 100644 (file)
@@ -1,19 +1,22 @@
-# Copyright (C) 2005  OPEN CASCADE, CEA, EDF R&D, LEG
-#           PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
-# 
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-# 
-SUBDIRS = unix
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+SUBDIRS = unix cmake_files
diff --git a/adm_local/cmake_files/FindCAS.cmake b/adm_local/cmake_files/FindCAS.cmake
new file mode 100644 (file)
index 0000000..8490c7c
--- /dev/null
@@ -0,0 +1,160 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(CASROOT $ENV{CASROOT})
+
+SET(OCC_VERSION_MAJOR 6)
+SET(OCC_VERSION_MINOR 3)
+SET(OCC_VERSION_MAINTENANCE 0)
+
+SET(CAS_CPPFLAGS)
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MAJOR=${OCC_VERSION_MAJOR})
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MINOR=${OCC_VERSION_MINOR})
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MAINTENANCE=${OCC_VERSION_MAINTENANCE})
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DLIN -DLINTEL -DCSFDB)
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DNo_exception)
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DHAVE_CONFIG_H)
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DHAVE_LIMITS_H)
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -I${CASROOT}/inc)
+
+IF(WINDOWS)
+  SET(CASROOT_LIBDIR ${CASROOT}/win32/libd)
+ELSE(WINDOWS)
+  SET(CASROOT_LIBDIR ${CASROOT}/lib)
+ENDIF(WINDOWS)
+
+FIND_LIBRARY(BinLPlugin BinLPlugin PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(BinPlugin BinPlugin PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(BinTObjPlugin BinTObjPlugin PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(BinXCAFPlugin BinXCAFPlugin PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(FWOSPlugin FWOSPlugin PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(mscmd mscmd PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(PTKernel PTKernel PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(StdLPlugin StdLPlugin PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(StdPlugin StdPlugin PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKAdvTools TKAdvTools PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKBin TKBin PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKBinL TKBinL PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKBinTObj TKBinTObj PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKBinXCAF TKBinXCAF PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKBO TKBO PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKBool TKBool PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKBRep TKBRep PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKCAF TKCAF PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKCDF TKCDF PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKCDLFront TKCDLFront PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKCPPClient TKCPPClient PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKCPPExt TKCPPExt PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKCPPIntExt TKCPPIntExt PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKCPPJini TKCPPJini PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKCSFDBSchema TKCSFDBSchema PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKDCAF TKDCAF PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKDraw TKDraw PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKernel TKernel PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKFeat TKFeat PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKFillet TKFillet PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKG2d TKG2d PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKG3d TKG3d PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKGeomAlgo TKGeomAlgo PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKGeomBase TKGeomBase PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKHLR TKHLR PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKIDLFront TKIDLFront PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKIGES TKIGES PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKLCAF TKLCAF PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKMath TKMath PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKMesh TKMesh PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKMeshVS TKMeshVS PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKNIS TKNIS PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKOffset TKOffset PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKOpenGl TKOpenGl PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKPCAF TKPCAF PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKPLCAF TKPLCAF PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKPrim TKPrim PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKPShape TKPShape PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKService TKService PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKShapeSchema TKShapeSchema PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKShHealing TKShHealing PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKStdLSchema TKStdLSchema PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKStdSchema TKStdSchema PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKSTEP TKSTEP PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKSTEP209 TKSTEP209 PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKSTEPAttr TKSTEPAttr PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKSTEPBase TKSTEPBase PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKSTL TKSTL PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKTCPPExt TKTCPPExt PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKTObj TKTObj PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKTObjDRAW TKTObjDRAW PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKTopAlgo TKTopAlgo PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKTopTest TKTopTest PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKV2d TKV2d PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKV3d TKV3d PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKViewerTest TKViewerTest PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKVRML TKVRML PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKWOK TKWOK PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKWOKTcl TKWOKTcl PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKXCAF TKXCAF PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKXCAFSchema TKXCAFSchema PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKXDEDRAW TKXDEDRAW PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKXDEIGES TKXDEIGES PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKXDESTEP TKXDESTEP PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKXMesh TKXMesh PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKXml TKXml PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKXmlL TKXmlL PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKXmlTObj TKXmlTObj PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKXmlXCAF TKXmlXCAF PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(TKXSBase TKXSBase PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(TKXSDRAW TKXSDRAW PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(wokcmd wokcmd PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(wokdeliverysteps wokdeliverysteps PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(wokdfltsteps wokdfltsteps PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(wokobjssteps wokobjssteps PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(wokorbixsteps wokorbixsteps PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(woksteps woksteps PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(woktoolscmd woktoolscmd PATHS ${CASROOT_LIBDIR})
+# FIND_LIBRARY(wokutilscmd wokutilscmd PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(XCAFPlugin XCAFPlugin PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(XmlLPlugin XmlLPlugin PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(XmlPlugin XmlPlugin PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(XmlTObjPlugin XmlTObjPlugin PATHS ${CASROOT_LIBDIR})
+FIND_LIBRARY(XmlXCAFPlugin XmlXCAFPlugin PATHS ${CASROOT_LIBDIR})
+
+SET(CAS_KERNEL ${TKernel} ${TKMath})
+SET(CAS_OCAF ${TKernel} ${TKMath} ${TKCDF} ${TKLCAF})
+SET(CAS_VIEWER ${TKService} ${TKV3d} ${TKG3d} ${TKGeomBase} ${TKBRep})
+SET(CAS_OCAFVIS ${TKCAF} ${TKBRep} ${TKG2d})
+SET(CAS_MODELER ${TKG3d} ${TKGeomBase} ${TKGeomAlgo} ${TKBRep} ${TKTopAlgo} ${TKG2d})
+
+SET(TKV3d_EA ${TKernel} ${TKMath} ${TKV3d})
+SET(TKBool_EA ${TKernel} ${TKMath} ${TKBRep} ${TKG2d} ${TKG3d} ${TKGeomBase} ${TKGeomAlgo} ${TKTopAlgo} ${TKBool})
+SET(TKBRep_EA ${TKernel} ${TKMath} ${TKBRep})
+SET(TKIGES_EA ${TKernel} ${TKMath} ${TKXSBase} ${TKBRep} ${TKIGES})
+SET(TKSTEP_EA ${TKernel} ${TKMath} ${TKXSBase} ${TKBRep} ${TKSTEP})
+SET(TKSTL_EA ${TKernel} ${TKMath} ${TKSTL})
+SET(TKCAF_EA ${TKPrim} ${TKCAF})
+
+SET(TKV3d ${TKV3d_EA})
+SET(TKBool ${TKBool_EA})
+SET(TKBRep ${TKBRep_EA})
+SET(TKIGES ${TKIGES_EA})
+SET(TKSTEP ${TKSTEP_EA})
+SET(TKSTL ${TKSTL_EA})
+SET(TKCAF ${TKCAF_EA})
diff --git a/adm_local/cmake_files/FindGUI.cmake b/adm_local/cmake_files/FindGUI.cmake
new file mode 100644 (file)
index 0000000..14ca379
--- /dev/null
@@ -0,0 +1,55 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(GUI_CXXFLAGS -I${GUI_ROOT_DIR}/include/salome)
+
+FIND_LIBRARY(caf caf ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(CAM CAM ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(CASCatch CASCatch ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(DDS DDS ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(Event Event ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GLViewer GLViewer ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(LightApp LightApp ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(LogWindow LogWindow ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(ObjBrowser ObjBrowser ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(OCCViewer OCCViewer ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(Plot2d Plot2d ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(PyConsole PyConsole ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(PyInterp PyInterp ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(QDS QDS ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(qtx qtx ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(QxScene QxScene ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomeApp SalomeApp ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomeIDLGUI SalomeIDLGUI ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomeObject SalomeObject ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomePrs SalomePrs ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomeSession SalomeSession ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomeStyle SalomeStyle ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SOCC SOCC ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SPlot2d SPlot2d ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(std std ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SUITApp SUITApp ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(suit suit ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SUPERVGraph SUPERVGraph ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SVTK SVTK ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(ToolsGUI ToolsGUI ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(VTKViewer VTKViewer ${GUI_ROOT_DIR}/lib/salome)
diff --git a/adm_local/cmake_files/FindOPENGL.cmake b/adm_local/cmake_files/FindOPENGL.cmake
new file mode 100644 (file)
index 0000000..1458405
--- /dev/null
@@ -0,0 +1,27 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+IF(${WINDOWS})
+  FIND_LIBRARY(OpenGL_LIB OpenGL32 "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib")
+  FIND_LIBRARY(GlU_LIB GlU32 "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib")
+  SET(OGL_LIBS ${OpenGL_LIB} ${GlU_LIB})
+ENDIF(${WINDOWS})
diff --git a/adm_local/cmake_files/FindQT4.cmake b/adm_local/cmake_files/FindQT4.cmake
new file mode 100644 (file)
index 0000000..6b98c5f
--- /dev/null
@@ -0,0 +1,33 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(FindQt4)
+INCLUDE(UseQt4)
+SET(DIRS)
+FOREACH(D ${QT_INCLUDES})
+SET(DIRS ${DIRS} -I${D})
+ENDFOREACH(D ${QT_INCLUDES})
+SET(QT_INCLUDES ${DIRS})
+SET(QT_INCLUDES ${QT_INCLUDES} -DQT_THREAD_SUPPORT)
+SET(QT_MT_LIBS ${QT_LIBRARIES} ${QT_QTXML_LIBRARY} ${QT_QTOPENGL_LIBRARY})
+
+FIND_PROGRAM(QT_LRELEASE_EXECUTABLE lrelease)
diff --git a/adm_local/cmake_files/FindQWT.cmake b/adm_local/cmake_files/FindQWT.cmake
new file mode 100644 (file)
index 0000000..ea5f11d
--- /dev/null
@@ -0,0 +1,33 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(QWTHOME $ENV{QWTHOME})
+FIND_PATH(QWT_INCLUDE_DIR qwt_plot.h ${QWTHOME}/include)
+SET(QWT_INCLUDES -I${QWT_INCLUDE_DIR})
+IF(WINDOWS)
+SET(QWT_INCLUDES ${QWT_INCLUDES} -DQWT_DLL)
+ENDIF(WINDOWS)
+IF(WINDOWS)
+FIND_LIBRARY(QWT_LIBS qwt5 ${QWTHOME}/lib)
+ELSE(WINDOWS)
+FIND_LIBRARY(QWT_LIBS qwt ${QWTHOME}/lib)
+ENDIF(WINDOWS)
diff --git a/adm_local/cmake_files/FindSIPPYQT.cmake b/adm_local/cmake_files/FindSIPPYQT.cmake
new file mode 100644 (file)
index 0000000..1f4ff95
--- /dev/null
@@ -0,0 +1,55 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+FIND_PROGRAM(SIP_EXECUTABLE sip)
+
+SET(SIP_ROOT ${SIP_EXECUTABLE})
+IF(SIP_ROOT)
+GET_FILENAME_COMPONENT(SIP_ROOT ${SIP_ROOT} PATH)
+GET_FILENAME_COMPONENT(SIP_ROOT ${SIP_ROOT} PATH)
+ENDIF(SIP_ROOT)
+
+SET(SIP_INCLUDES -I${SIP_ROOT}/include/python${PYTHON_VERSION})
+
+FIND_PROGRAM(PYUIC_EXECUTABLE pyuic4)
+
+SET(PYUIC_ROOT ${PYUIC_EXECUTABLE})
+IF(PYUIC_ROOT)
+GET_FILENAME_COMPONENT(PYUIC_ROOT ${PYUIC_ROOT} PATH)
+GET_FILENAME_COMPONENT(PYUIC_ROOT ${PYUIC_ROOT} PATH)
+ENDIF(PYUIC_ROOT)
+
+IF(WINDOWS)
+  SET(PYQT_SIPS ${PYUIC_ROOT}/sip)
+ELSE(WINDOWS)
+  SET(PYQT_SIPS ${PYUIC_ROOT}/share/sip)
+ENDIF(WINDOWS)
+
+SET(PYQT_INCLUDES -I${PYQT_SIPS})
+SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtCore -I${PYQT_SIPS}/QtGui)
+SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtXml -I${PYQT_SIPS}/QtOpenGL)
+SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtAssistant -I${PYQT_SIPS}/QtDesigner)
+SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtNetwork -I${PYQT_SIPS}/QtSql)
+SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtSvg -I${PYQT_SIPS}/QtTest)
+
+SET(PYQT_SIPFLAGS -x VendorID -x PyQt_NoPrintRangeBug -t WS_X11 -t Qt_4_4_1 -g -s .cc -c .)
+SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} ${PYQT_INCLUDES})
diff --git a/adm_local/cmake_files/FindVTK.cmake b/adm_local/cmake_files/FindVTK.cmake
new file mode 100644 (file)
index 0000000..550256c
--- /dev/null
@@ -0,0 +1,48 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(FindVTK)
+
+SET(VTK_INCLUDES)
+FOREACH(dir ${VTK_INCLUDE_DIRS})
+  SET(VTK_INCLUDES ${VTK_INCLUDES} -I${dir})
+ENDFOREACH(dir ${VTK_INCLUDE_DIRS})
+
+SET(VTK_LIBS)
+FIND_LIBRARY(VTK_COMMON vtkCommon ${VTK_LIBRARY_DIRS})
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_COMMON})
+FIND_LIBRARY(VTK_GRAPHICS vtkGraphics ${VTK_LIBRARY_DIRS})
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_GRAPHICS})
+FIND_LIBRARY(VTK_IMAGING vtkImaging ${VTK_LIBRARY_DIRS})
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_IMAGING})
+FIND_LIBRARY(VTK_FILTERING vtkFiltering ${VTK_LIBRARY_DIRS})
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_FILTERING})
+FIND_LIBRARY(VTK_IO vtkIO ${VTK_LIBRARY_DIRS})
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_IO})
+FIND_LIBRARY(VTK_RENDERING vtkRendering ${VTK_LIBRARY_DIRS})
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_RENDERING})
+FIND_LIBRARY(VTK_HYBRID vtkHybrid ${VTK_LIBRARY_DIRS})
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_HYBRID})
+FIND_LIBRARY(VTK_PARALLEL vtkParallel ${VTK_LIBRARY_DIRS})
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_PARALLEL})
+FIND_LIBRARY(VTK_WIDGETS vtkWidgets ${VTK_LIBRARY_DIRS})
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_WIDGETS})
diff --git a/adm_local/cmake_files/Makefile.am b/adm_local/cmake_files/Makefile.am
new file mode 100644 (file)
index 0000000..d94ed4e
--- /dev/null
@@ -0,0 +1,32 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+dist_admlocal_cmake_DATA = \
+FindCAS.cmake \
+FindOPENGL.cmake \
+FindQT4.cmake \
+FindQWT.cmake \
+FindSIPPYQT.cmake \
+FindVTK.cmake \
+FindGUI.cmake
+
index f9243d2f5bf7f5ff7e19db17b5b64ccbfa7c0f79..5f6d5f7536c72fc43090c511c2a26518cb92af5d 100644 (file)
@@ -1,25 +1,24 @@
-# Copyright (C) 2005  OPEN CASCADE, CEA, EDF R&D, LEG
-#           PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
-# 
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-# 
-
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 SUBDIRS = config_files
-
-# this is for LIGHT module compatibility
-dist_admlocalunix_DATA=make_conclude.in
\ No newline at end of file
index de8790b70cb73f0dcc7aefb7d5514f82a8a8dd1a..c370531796e5fbd7fcba493d2c119a57111d77eb 100644 (file)
@@ -1,40 +1,43 @@
-# Copyright (C) 2005  OPEN CASCADE, CEA, EDF R&D, LEG
-#           PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
-# 
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-# 
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-dist_admlocalm4_DATA=\
-check_disable_Corba.m4 \
-check_GLViewer.m4 \
-check_GUI.m4 \
-check_msg2qm.m4 \
-check_OCCViewer.m4 \
-check_opengl.m4 \
-check_Plot2dViewer.m4 \
-check_PyConsole.m4 \
-check_pyqt.m4 \
-check_qt.m4 \
-check_qwt.m4 \
-check_SalomeObject.m4 \
-check_sip.m4 \
-check_SupervGraphViewer.m4 \
-check_vtk.m4 \
-check_VTKViewer.m4 \
-check_corba_in_GUI.m4 \
-check_QxGraphViewer.m4 \
-README
+dist_admlocalm4_DATA =         \
+check_disable_Corba.m4         \
+check_GLViewer.m4              \
+check_GUI.m4                   \
+check_msg2qm.m4                        \
+check_OCCViewer.m4             \
+check_opengl.m4                        \
+check_Plot2dViewer.m4          \
+check_PyConsole.m4             \
+check_pyqt.m4                  \
+check_qt.m4                    \
+check_qwt.m4                   \
+check_SalomeObject.m4          \
+check_sip.m4                   \
+check_SupervGraphViewer.m4     \
+check_vtk.m4                   \
+check_VTKViewer.m4             \
+check_corba_in_GUI.m4          \
+check_QxGraphViewer.m4          \
+check_TestRecorder.m4
diff --git a/adm_local/unix/config_files/README b/adm_local/unix/config_files/README
deleted file mode 100644 (file)
index feb997b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-This file is only here for CVS:
-CVS does not always create empty directory, and adm_local/unix/config_file
-is needed by build_configure.
index 90a304173bc8859270d51c16a6d28067bfa1944b..064a60ae06f2a1c333741ec2fd33b0b7482252a2 100644 (file)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 #
 # Check configure option --disable-glViewer=[yes|no|DIR] taking into account that
 # DISABLE_GLVIEWER may be already set during build_configure,
index e0b0e24ae518b443656bf99cf25bbc9c1279b6bb..ec07762f324976e49fa1abc31d0a912db33c16a8 100755 (executable)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 #  Check availability of Salome binary distribution
 #
 #  Author : Marc Tajchman (CEA, 2002)
index cae33b9712532089b8eb1a8e5cbfe74e95140a74..ee23fd53d2eb78647538ed7ed41d3091924badae 100644 (file)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 #
 # Check configure option --disable-occViewer=[yes|no|DIR] taking into account that
 # DISABLE_OCCVIEWER may be already set during build_configure,
index a8fb1ad857c949d07ebea05cf683b55b949668bc..ebef2706894746504fa9e30f8d0a3e064becd902 100644 (file)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 #
 # Check configure option --disable-plot2dViewer=[yes|no|DIR] taking into account that
 # DISABLE_PLOT2DVIEWER may be already set during build_configure,
index 503646f84b337125a9eff8d12caa12a0a0a24c30..304867485121579143dbe2333ca1a23f3676eb6a 100644 (file)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 #
 # Check configure option --disable-pyConsole=[yes|no|DIR] taking into account that
 # DISABLE_PYCONSOLE may be already set during build_configure,
index 1ef9f7314b8127f8ebafbf4735c97bfa4e5f44e7..ddd2a3c9488d802b4002f3f1ed22fac0af7b5361 100644 (file)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 #
 # Check configure option --disable-qxGraphViewer=[yes|no|DIR] taking into account that
 # DISABLE_QXGRAPHVIEWER may be already set during build_configure,
index 453dbd7abcf695d455c37baa7203ff44d86229dc..76d83431ff34d3403c181faf029ef6f0e633185e 100644 (file)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 #
 # Check configure option --disable-salomeObject=[yes|no|DIR] taking into account that
 # DISABLE_SALOMEOBJECT may be already set during build_configure,
index 455f021366ecbee3478f9876f1834296131fcfb5..2ba31b6fa0b49461c9b6fc0d8bc5f11095181646 100644 (file)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 #
 # Check configure option --disable-supervGraphViewer=[yes|no|DIR] taking into account that
 # DISABLE_SUPERVGRAPHVIEWER may be already set during build_configure,
diff --git a/adm_local/unix/config_files/check_TestRecorder.m4 b/adm_local/unix/config_files/check_TestRecorder.m4
new file mode 100644 (file)
index 0000000..0dbe0b6
--- /dev/null
@@ -0,0 +1,122 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
+#
+# Check existence of Test recorder sources and libraries.
+# Set ENABLE_TESTRECORDER to yes|no
+#
+# Author : Margarita KARPUNINA (OCN, 2008)
+#
+
+AC_DEFUN([CHECK_TESTRECORDER],[
+
+AC_ARG_WITH(testrecorder,
+           [  --with-testrecorder=DIR       root directory path of TestRecorder installation],
+           [],
+           [with_testrecorder=no])
+
+AS_IF([test "x$with_testrecorder" != xno || test "$with_testrecorder" != "no"],[
+
+  echo
+  echo ---------------------------------------------
+  echo Testing TestRecorder
+  echo ---------------------------------------------
+  echo
+
+  AC_REQUIRE([CHECK_QT])dnl
+  AC_REQUIRE([AC_PROG_CXX])dnl
+  AC_REQUIRE([AC_PROG_CXXCPP])dnl
+  
+  AC_CHECKING(for TestRecorder product)
+  
+  AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
+  
+  TESTRECORDER_INCLUDES=""
+  TESTRECORDER_LIBS=""
+  ENABLE_TESTRECORDER="no"
+  
+  TestRecorder_ok=no
+
+  if test "$with_testrecorder" == "yes" || test "$with_testrecorder" == "auto"; then
+      TESTRECORDER_HOME=""
+  else
+      TESTRECORDER_HOME="$with_testrecorder"
+  fi
+  
+  if test "$TESTRECORDER_HOME" == "" ; then
+      if test "x$TESTRECORDERHOME" != "x" ; then
+          TESTRECORDER_HOME=$TESTRECORDERHOME
+      fi
+  fi
+  
+  if test "x$TESTRECORDER_HOME" != "x"; then
+    TESTRECORDER_INCLUDES="-I$TESTRECORDER_HOME/include"
+    TESTRECORDER_LIBS="-L$TESTRECORDER_HOME/lib -lTestRecorder"
+  
+    CPPFLAGS_old="$CPPFLAGS"
+    CXXFLAGS_old="$CXXFLAGS"
+    CPPFLAGS="$TESTRECORDER_INCLUDES $QT_INLCUDES $CPPFLAGS"
+    CXXFLAGS="$TESTRECORDER_INCLUDES $QT_INCLUDES $CXXFLAGS"
+  
+    AC_MSG_CHECKING(for TestRecorder header file)
+  
+    AC_CHECK_HEADER(TestApplication.h,TestRecorder_ok=yes,TestRecorder_ok=no)
+  
+    if test "x$TestRecorder_ok" == "xyes"; then
+  
+      AC_MSG_CHECKING(for TestRecorder library)
+  
+      LDFLAGS_old="$LDFLAGS"
+      LDFLAGS="-L. -$TESTRECORDER_LIBS $QT_LIBS $LDFLAGS"
+  
+      AC_TRY_LINK(
+         #include "TestApplication.h",
+          TESTRECORDER_init();,
+         TestRecorder_ok=yes,TestRecorder_ok=no
+         )
+  
+      LDFLAGS="$LDFLAGS_old"
+  
+      AC_MSG_RESULT($TestRecorder_ok)
+    fi
+  
+    CPPFLAGS="$CPPFLAGS_old"
+    CXXFLAGS="$CXXFLAGS_old"
+  
+  fi
+  
+  if test "x$TestRecorder_ok" == xno ; then
+    AC_MSG_RESULT(for TestRecorder: no)
+    AC_MSG_WARN(TestRecorder is not found or not properly installed)
+  else
+    AC_MSG_RESULT(for TestRecorder: yes)
+    ENABLE_TESTRECORDER="yes"
+  fi
+  
+  AC_SUBST(TESTRECORDER_INCLUDES)
+  AC_SUBST(TESTRECORDER_LIBS)
+  
+  AC_LANG_RESTORE
+
+  ])
+  
+])dnl
index c2adb23b90b5c7d695a22f2b6af4c65ed99d5faa..774de209fc38e9208d7db9bf2c1b5f8dc4563952 100644 (file)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 #
 # Check configure option --disable-vtkViewer=[yes|no|DIR] taking into account that
 # DISABLE_VTKVIEWER may be already set during build_configure,
index 381bf3b7d43a38255fe368820e1d57bf78141469..cfa4a04d777798f6291bf59272a99f29960a940f 100755 (executable)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 #  Check availability of full Salome binary distribution
 #
 #  Author : Marc Tajchman (CEA, 2002)
index 5c777c3c1684f5c82cb19cd460a3c50e680cb815..94105766b060a0e123670f8ddbe2a93d25c4b387 100644 (file)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 #
 # Check configure option --disable-corba=[yes|no|DIR] taking into account that
 # GUI_DISABLE_CORBA may be already set during build_configure,
index 8d0c5474f5ce7a297f17a1c9e1659d54dd8d4aa2..afda71bea18b0dd03b95bfb2823e0a5ea6f4bc23 100755 (executable)
@@ -1,3 +1,24 @@
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 # Check availability of Qt's msg2qm tool binary distribution
 #
 # Author : Jerome Roy (CEA, 2003)
index a1eb48ee2ab54bd59ae81f021a7f60d31a88721a..dc94b12715c14da06f2376694a5f2c61f22b03c9 100644 (file)
@@ -1,23 +1,23 @@
-dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-dnl 
-dnl  This library is free software; you can redistribute it and/or 
-dnl  modify it under the terms of the GNU Lesser General Public 
-dnl  License as published by the Free Software Foundation; either 
-dnl  version 2.1 of the License. 
-dnl 
-dnl  This library is distributed in the hope that it will be useful, 
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-dnl  Lesser General Public License for more details. 
-dnl 
-dnl  You should have received a copy of the GNU Lesser General Public 
-dnl  License along with this library; if not, write to the Free Software 
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-dnl 
-dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
 AC_DEFUN([CHECK_OPENGL],[
 AC_REQUIRE([AC_PROG_CC])dnl
@@ -30,7 +30,7 @@ AC_LANG_CPLUSPLUS
 AC_ARG_WITH(opengl,
   [AC_HELP_STRING([--with-opengl=DIR],[root directory path of OpenGL installation])],
   [opengl_dir="$withval"], 
-  [dirs="/usr/lib${LIB_LOCATION_SUFFIX} /usr/local/lib${LIB_LOCATION_SUFFIX} /opt/graphics/OpenGL/lib${LIB_LOCATION_SUFFIX} /usr/openwin/lib${LIB_LOCATION_SUFFIX} /usr/X11R6/lib${LIB_LOCATION_SUFFIX}"])dnl
+  [dirs="/usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /opt/graphics/OpenGL/lib64 /opt/graphics/OpenGL/lib /usr/openwin/lib64 /usr/openwin/lib /usr/X11R6/lib64 /usr/X11R6/lib"])dnl
 
 AC_CHECKING(for OpenGL)
 AC_CHECKING(for OpenGL headers)
@@ -107,7 +107,7 @@ if test "x${OpenGL_headers_ok}" = "xyes" ; then
   for idir in $dirs; do
     if test -r "${idir}/libGL.so"; then
       AC_MSG_RESULT(in ${idir})
-      if test "x${idir}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then
+      if test "x${idir}" = "x/usr/lib64" -o "x${idir}" = "x/usr/lib" ; then
         GL_LIB_PATH=""
       else
         GL_LIB_PATH="-L${idir}"
@@ -117,7 +117,7 @@ if test "x${OpenGL_headers_ok}" = "xyes" ; then
     # under IRIX ?
     if test -r "${idir}/libGL.sl"; then
       AC_MSG_RESULT(in ${idir})
-      if test "x${idir}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then
+      if test "x${idir}" = "x/usr/lib64" -o "x${idir}" = "x/usr/lib" ; then
         GL_LIB_PATH=""
       else
         GL_LIB_PATH="-L${idir}"
@@ -144,7 +144,7 @@ if test "x${OpenGL_libs_ok}" = "xyes" ; then
   for idir in $dirs; do
     if test -r "${idir}/libGLU.so"; then
       AC_MSG_RESULT(in ${idir})
-      if test "x${idir}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then
+      if test "x${idir}" = "x/usr/lib64" -o "x${idir}" = "x/usr/lib" ; then
         GLU_LIB_PATH=""
       else
         GLU_LIB_PATH="-L${idir}"
@@ -154,7 +154,7 @@ if test "x${OpenGL_libs_ok}" = "xyes" ; then
     # under IRIX ?
     if test -r "${idir}/libGLU.sl"; then
       AC_MSG_RESULT(in ${idir})
-      if test "x${idir}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then
+      if test "x${idir}" = "x/usr/lib64" -o "x${idir}" = "x/usr/lib" ; then
         GLU_LIB_PATH=""
       else
         GLU_LIB_PATH="-L${idir}"
index f63479879dce7340981677009dc6f17d9a52b3a8..9f201a915893b8f64979aa0c98c4afc3179e90ab 100644 (file)
-dnl Copyright (C) 2003  CEA/DEN, EDF R&D
-
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 AC_DEFUN([CHECK_PYQT],[
 AC_REQUIRE([CHECK_PYTHON])dnl
 AC_REQUIRE([CHECK_QT])dnl
 AC_REQUIRE([CHECK_SIP])dnl
 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
 
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
+dnl AC_LANG_SAVE
+dnl AC_LANG_CPLUSPLUS
 
 AC_ARG_WITH(pyqt,
     [  --with-pyqt=DIR      root directory path to PyQt installation ],
     [PYQTDIR="$withval"
-      AC_MSG_RESULT("select $withval as path to PyQt")
+      AC_MSG_RESULT([Try $withval as path to the PyQt])
     ])
 
 AC_ARG_WITH(pyqt_sips,
     [  --with-pyqt_sips=DIR      a directory path to PyQt sips installation ],
     [PYQT_SIPS="$withval"
-      AC_MSG_RESULT("select $withval as path to PyQt sips")
+      AC_MSG_RESULT([Try $withval as path to the PyQt sip files])
     ])
 
-
-AC_ARG_WITH(pyuic,
-    [  --with-pyuic=EXEC pyuic executable ],
+AC_ARG_WITH(pyuic4,
+    [  --with-pyuic4=EXEC pyuic4 executable ],
     [PYUIC="$withval"
-      AC_MSG_RESULT("select $withval as pyqt executable")
+      AC_MSG_RESULT([Try $withval as pyuic4 executable])
     ])
 
 AC_CHECKING(for pyqt)
 
-pyqt_ok=yes
-
-dnl look for pyuic
-pyqt_uic_ok=no
-if test "x$PYUIC" != x; then
-  dnl try withval value
-  AC_CHECK_FILE($PYUIC,pyqt_uic_ok=yes,pyqt_uic_ok=no)
-fi
-if test "x$pyqt_uic_ok" == "xno"; then
-  dnl try ${PYQTDIR}
-  if test "x${PYQTDIR}" != "x"; then
-    if test -d ${PYQTDIR} ; then
-      AC_CHECK_FILE(${PYQTDIR}/pyuic,pyqt_uic_ok=yes,pyqt_uic_ok=no)
-      if test "x$pyqt_uic_ok" == "xyes"; then
-        PYUIC="${PYQTDIR}/pyuic"
-      fi
-    fi
-  fi   
-fi
-if test "x$pyqt_uic_ok" == "xno"; then
-  dnl try in $PATH
-  AC_PATH_PROG(PYUIC, pyuic)
-  if test "x$PYUIC" != x; then
-    PYQTDIR=$PYUIC
-    PYQTDIR=`dirname $PYQTDIR`
-    PYQTDIR=`dirname $PYQTDIR`
-    pyqt_uic_ok=yes
-  fi
-fi
-if test "x$pyqt_uic_ok" == "xno"; then
-  dnl try ${SIPDIR}
-  if test "x${SIPDIR}" != "x"; then
-    if test -d ${SIPDIR} ; then
-      AC_CHECK_FILE(${SIPDIR}/pyuic,pyqt_uic_ok=yes,pyqt_uic_ok=no)
-      if test "x$pyqt_uic_ok" == "xyes"; then
-        PYUIC="${SIPDIR}/pyuic"
-      fi
-    fi
-  fi   
-fi
-if test "x$pyqt_uic_ok" == "xno"; then
-  dnl try ${PYTHONHOME}/bin
-  if test "x${PYTHONHOME}" != "x"; then
-    if test -d ${PYTHONHOME}/bin ; then
-      AC_CHECK_FILE(${PYTHONHOME}/bin/pyuic,pyqt_uic_ok=yes,pyqt_uic_ok=no)
-      if test "x$pyqt_uic_ok" == "xyes"; then
-        PYUIC="${PYTHONHOME}/bin/pyuic"
-      fi
-    fi
-  fi   
-fi
-if test "x$pyqt_uic_ok" == "xno"; then
-  dnl try /usr/bin
-  AC_CHECK_FILE(/usr/bin/pyuic,pyqt_uic_ok=yes,pyqt_uic_ok=no)
-  if test "x$pyqt_uic_ok" == "xyes"; then
-    PYUIC="/usr/bin/pyuic"
-  fi
-fi
-if test "x$pyqt_uic_ok" == "xno"; then
-  pyqt_ok=no
-fi
+pyqt_ok=no
 
-dnl look for PyQt libs
-pyqt_lib_ok=no
-if test "x${PYQTDIR}" != "x"; then
-  dnl try {PYQTDIR}
-  AC_CHECK_FILE(${PYQTDIR}/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-  if test "x$pyqt_lib_ok" == "xyes"; then
-    if test "x${PYQTDIR}" = "x/usr/lib"
-    then
-      PYQT_LIBS="-lqtcmodule"
-    else
-      PYQT_LIBS="-L${PYQTDIR} -lqtcmodule"
-    fi
-  else 
-    AC_CHECK_FILE(${PYQTDIR}/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-    if test "x$pyqt_lib_ok" == "xyes"; then
-      if test "x${PYQTDIR}" = "x/usr/lib"
-      then
-        PYQT_LIBS=""
-      else
-        PYQT_LIBS="-L${PYQTDIR}"
-      fi
+dnl check pyuic4
+if test "x$PYUIC" != "x" ; then
+    dnl try $withval value
+    AC_CHECK_FILE($PYUIC,pyqt_ok=yes,pyqt_ok=no)
+else
+    TEST_BIN_DIRS=""
+    if test "x${PYQTDIR}" != "x" ; then
+        TEST_BIN_DIRS="${TEST_BIN_DIRS} ${PYQTDIR} ${PYQTDIR}/bin"
     fi
-  fi
-  if test "x$pyqt_lib_ok" == "xno"; then
-    dnl try ${PYQTDIR}/lib
-    if test -d ${PYQTDIR}/lib; then
-      AC_CHECK_FILE(${PYQTDIR}/lib/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-      if test "x$pyqt_lib_ok" == "xyes"; then
-        PYQT_LIBS="-L${PYQTDIR}/lib -lqtcmodule"
-      else 
-        AC_CHECK_FILE(${PYQTDIR}/lib/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-        if test "x$pyqt_lib_ok" == "xyes"; then
-          PYQT_LIBS="-L${PYQTDIR}/lib"
-        fi
-      fi
+    TEST_BIN_DIRS="${TEST_BIN_DIRS} __CHECK__PATH__"
+    if test "x${SIPDIR}" != "x" ; then
+        TEST_BIN_DIRS="${TEST_BIN_DIRS} ${SIPDIR} ${SIPDIR}/bin"
     fi
-  fi
-  if test "x$pyqt_lib_ok" == "xno"; then
-    dnl try ${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages
-    if test -d ${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages; then
-      AC_CHECK_FILE(${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-      if test "x$pyqt_lib_ok" == "xyes"; then
-        PYQT_LIBS="-L${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lqtcmodule"
-      else 
-        AC_CHECK_FILE(${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-        if test "x$pyqt_lib_ok" == "xyes"; then
-          PYQT_LIBS="-L${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
-        fi
-      fi
+    if test "x${PYTHONHOME}" != "x" ; then
+        TEST_BIN_DIRS="${TEST_BIN_DIRS} ${PYTHONHOME}/bin"
     fi
-  fi
-fi
-if test "x$pyqt_lib_ok" == "xno"; then
-  dnl try ${SIPDIR}
-  if test "x${SIPDIR}" != "x"; then
-    if test -d ${SIPDIR} ; then
-      AC_CHECK_FILE(${SIPDIR}/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-      if test "x$pyqt_lib_ok" == "xyes"; then
-        if test "x${SIPDIR}" = "x/usr/lib"
-        then
-          PYQT_LIBS="-lqtcmodule"
+    TEST_BIN_DIRS="${TEST_BIN_DIRS} /usr/bin"
+
+    dnl search pyuic4
+    pyqt_ok=no
+    for d in ${TEST_BIN_DIRS} ; do
+        if test "x${d}" = "x__CHECK__PATH__" ; then
+            AC_PATH_PROG(TEMP, pyuic4)
+            if test "x${TEMP}" != "x" ; then
+                PYUIC=${TEMP}
+                if test "x$PYQTDIR" = "x" ; then
+                    PYQTDIR=`dirname ${PYUIC}`
+                    PYQTDIR=`dirname ${PYQTDIR}`
+                fi
+                pyqt_ok=yes
+                break
+            fi
         else
-          PYQT_LIBS="-L${SIPDIR} -lqtcmodule"
-        fi
-      else 
-        AC_CHECK_FILE(${SIPDIR}/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-        if test "x$pyqt_lib_ok" == "xyes"; then
-          if test "x${SIPDIR}" = "x/usr/lib"
-          then
-            PYQT_LIBS=""
-          else
-            PYQT_LIBS="-L${SIPDIR}"
-          fi
+            if test -d $d ; then
+                AC_CHECK_FILE(${d}/pyuic4,pyqt_ok=yes,pyqt_ok=no)
+               if test "x$pyqt_ok" == "xyes" ; then
+                    PYUIC=${d}/pyuic4
+                    break
+                fi
+            fi
         fi
-      fi
-    fi
-  fi
+    done
 fi
-if test "x$pyqt_lib_ok" == "xno"; then
-  dnl try ${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages
-  if test "x${PYTHONHOME}" != "x"; then
-    if test -d ${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages ; then
-      AC_CHECK_FILE(${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-      if test "x$pyqt_lib_ok" == "xyes"; then
-        PYQT_LIBS="-L${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lqtcmodule"
-      else 
-        AC_CHECK_FILE(${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-        if test "x$pyqt_lib_ok" == "xyes"; then
-          PYQT_LIBS="-L${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
-        fi
-      fi
+
+dnl check PyQt version
+if test "x$pyqt_ok" == "xyes" ; then
+    AC_MSG_CHECKING(whether PyQt version >= 4.2)
+    PYQT_VERSION=`${PYUIC} --version 2>&1 | grep "Python User Interface Compiler"`
+    if test "$?" != "0" ; then
+        PYQT_VERSION=`${PYUIC} -version 2>&1 | grep "Python User Interface Compiler"`
     fi
-  fi   
-fi
-if test "x$pyqt_lib_ok" == "xno"; then
-  dnl try /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages
-  AC_CHECK_FILE(/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-  if test "x$pyqt_lib_ok" == "xyes"; then
-    PYQT_LIBS="-L/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lqtcmodule"
-  else 
-    AC_CHECK_FILE(/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no)
-    if test "x$pyqt_lib_ok" == "xyes"; then
-      PYQT_LIBS="-L/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
+    if test "x${PYQT_VERSION}" != "x" ; then
+        PYQT_VERSION=`echo $PYQT_VERSION | sed -e 's%[[[:alpha:][:space:]]]*\([[[:digit:].]]*\).*%\1%g'`
+        PYQT_VERSION_ID=`echo $PYQT_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
+    else
+        PYQT_VERSION="<unknown>"
+        PYQT_VERSION_ID=0
     fi
-  fi
-fi
-if test "x$pyqt_lib_ok" == "xno"; then
-  pyqt_ok=no
+    if test $PYQT_VERSION_ID -ge 40200 ; then 
+        AC_MSG_RESULT(yes)
+        AC_MSG_RESULT(PyQt version is $PYQT_VERSION)
+    else
+        AC_MSG_RESULT(no)
+        AC_MSG_RESULT(WARNING! PyQt version $PYQT_VERSION is not supported (at least 4.2 is required)!)
+        pyqt_ok=no
+    fi
+else
+    AC_MSG_RESULT(Warning! pyuic4 is not found!)
 fi
 
-dnl look for PyQt sips
-pyqt_sips_ok=no
-dnl try ${PYQT_SIPS} or ${PYQT_SIPS}/qt
-if test "x${PYQT_SIPS}" != "x"; then
-  AC_CHECK_FILE(${PYQT_SIPS}/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
-  if test "x$pyqt_sips_ok" == "xno"; then
-    AC_CHECK_FILE(${PYQT_SIPS}/qt/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
-    if test "x$pyqt_sips_ok" == "xyes"; then
-      PYQT_SIPS="${PYQT_SIPS}/qt"
+if test "x$pyqt_ok" == "xyes" ; then
+    TESTLIBFILE=QtCore.so
+    TESTSIPFILE=QtCore/QtCoremod.sip
+    TEST_LIB_DIRS=""
+    TEST_SIPS_DIRS=""
+    if test "x${PYQT_SIPS}" != "x" ; then
+        TEST_SIPS_DIRS="${TEST_SIPS_DIRS} ${PYQT_SIPS}"
     fi
-  fi
-fi
-if test "x$pyqt_sips_ok" == "xno"; then
-  dnl try ${PYQTDIR}/sip
-  if test "x${PYQTDIR}" != "x"; then
-    if test -d ${PYQTDIR}/sip ; then
-      AC_CHECK_FILE(${PYQTDIR}/sip/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
-      if test "x$pyqt_sips_ok" == "xyes"; then
-        PYQT_SIPS="${PYQTDIR}/sip"
-      else
-        AC_CHECK_FILE(${PYQTDIR}/sip/qt/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
-        if test "x$pyqt_sips_ok" == "xyes"; then
-          PYQT_SIPS="${PYQTDIR}/sip/qt"
-        fi
-      fi
+    if test "x${PYQTDIR}" != "x" ; then
+        TEST_LIB_DIRS="${TEST_LIB_DIRS} ${PYQTDIR} ${PYQTDIR}/lib ${PYQTDIR}/PyQt4"
+        TEST_LIB_DIRS="${TEST_LIB_DIRS} ${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
+        TEST_LIB_DIRS="${TEST_LIB_DIRS} ${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/PyQt4"
+        TEST_SIPS_DIRS="${TEST_SIPS_DIRS} ${PYQTDIR} ${PYQTDIR}/sip"
+       TEST_SIPS_DIRS="${TEST_SIPS_DIRS} ${PYQTDIR}/share ${PYQTDIR}/share/sip"
     fi
-  fi
-fi
-if test "x$pyqt_sips_ok" == "xno"; then
-  dnl try ${PYQTDIR}/share/sip/qt
-  if test "x${PYQTDIR}" != "x"; then
-    if test -d ${PYQTDIR}/share/sip/qt ; then
-      AC_CHECK_FILE(${PYQTDIR}/share/sip/qt/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
-      if test "x$pyqt_sips_ok" == "xyes"; then
-        PYQT_SIPS="${PYQTDIR}/share/sip/qt"
-      fi
+    if test "x${SIPDIR}" != "x" ; then
+        TEST_LIB_DIRS="${TEST_LIB_DIRS} ${SIPDIR} ${SIPDIR}/lib ${SIPDIR}/PyQt4"
+       TEST_LIB_DIRS="${TEST_LIB_DIRS} ${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
+       TEST_LIB_DIRS="${TEST_LIB_DIRS} ${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/PyQt4"
+        TEST_SIPS_DIRS="${TEST_SIPS_DIRS} ${SIPDIR} ${SIPDIR}/sip"
+        TEST_SIPS_DIRS="${TEST_SIPS_DIRS} ${SIPDIR}/share ${SIPDIR}/share/sip ${SIPDIR}/share/sip/PyQt4"
     fi
-  fi
-fi
-if test "x$pyqt_sips_ok" == "xno"; then
-  dnl try ${SIPDIR}/sip
-  if test "x${SIPDIR}" != "x"; then
-    if test -d ${SIPDIR}/sip ; then
-      AC_CHECK_FILE(${SIPDIR}/sip/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
-      if test "x$pyqt_sips_ok" == "xyes"; then
-        PYQT_SIPS="${SIPDIR}/sip"
-      else
-        AC_CHECK_FILE(${SIPDIR}/sip/qt/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
-        if test "x$pyqt_sips_ok" == "xyes"; then
-          PYQT_SIPS="${SIPDIR}/sip/qt"
-        fi
-      fi
+    if test "x${PYTHONHOME}" != "x" ; then
+        TEST_LIB_DIRS="${TEST_LIB_DIRS} ${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
+        TEST_LIB_DIRS="${TEST_LIB_DIRS} ${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/PyQt4"
     fi
-  fi
-fi
-if test "x$pyqt_sips_ok" == "xno"; then
-  dnl try /usr/share/sip
-  if test -d /usr/share/sip ; then
-    AC_CHECK_FILE(/usr/share/sip/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
-    if test "x$pyqt_sips_ok" == "xyes"; then
-      PYQT_SIPS="/usr/share/sip"
-    else
-      AC_CHECK_FILE(/usr/share/sip/qt/qglobal.sip,pyqt_sips_ok=yes,pyqt_sips_ok=no)
-      if test "x$pyqt_sips_ok" == "xyes"; then
-        PYQT_SIPS="/usr/share/sip/qt"
-      fi
+    TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
+    TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/PyQt4"
+    TEST_SIPS_DIRS="${TEST_SIPS_DIRS} /usr/share/sip"
+    TEST_SIPS_DIRS="${TEST_SIPS_DIRS} /usr/share/sip/PyQt4"
+
+    dnl check PyQt libs
+    pyqt_ok=no
+    for d in ${TEST_LIB_DIRS} ; do
+        if test -d $d ; then
+            AC_CHECK_FILE(${d}/${TESTLIBFILE},pyqt_ok=yes,pyqt_ok=no)
+            if test "x$pyqt_ok" == "xyes" ; then
+                if test "x${d}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then
+                    PYQT_LIBS=""
+                else
+                    PYQT_LIBS="-L${d}"
+                fi
+                break
+            fi
+        fi
+    done
+
+    dnl check PyQt sips
+    if test "x$pyqt_ok" == "xyes" ; then
+        pyqt_ok=no
+        for d in ${TEST_SIPS_DIRS} ; do
+            if test -d $d ; then
+                AC_CHECK_FILE(${d}/${TESTSIPFILE},pyqt_ok=yes,pyqt_ok=no)
+                if test "x$pyqt_ok" == "xyes" ; then
+                    PYQT_SIPS=${d}
+                    PYQT_INCLUDES="-I ${d}"
+                    PYQT_INCLUDES="${PYQT_INCLUDES} -I ${d}/QtCore -I ${d}/QtGui"
+                    PYQT_INCLUDES="${PYQT_INCLUDES} -I ${d}/QtXml -I ${d}/QtOpenGL"
+                    PYQT_INCLUDES="${PYQT_INCLUDES} -I ${d}/QtAssistant -I ${d}/QtDesigner"
+                    PYQT_INCLUDES="${PYQT_INCLUDES} -I ${d}/QtNetwork -I ${d}/QtSql"
+                    PYQT_INCLUDES="${PYQT_INCLUDES} -I ${d}/QtSvg -I ${d}/QtTest"
+
+                    # check compatibility with Qt
+                    SUPPORTED=`grep -e "[[[:space:]]]*Qt_[[[:digit:]_]]\+}" ${PYQT_SIPS}/QtCore/QtCoremod.sip | sed -e "s/\(.*\)[[[:space:]]]*\(Qt_[[[:digit:]_]]\+\)}/\2/g"`
+                    SUPPORTED=`echo $SUPPORTED | sed -e "s/Qt_//g" -e "s/_/./g"`
+                    SUPPORTED_ID=`echo $SUPPORTED | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
+                    if test $SUPPORTED_ID -lt $QT_VERSION_ID ; then 
+                        AC_MSG_RESULT(Warning! Used Qt version ($QT_VERSION) is not supported by PyQt)
+                        AC_MSG_RESULT(Latest supported Qt version is ${SUPPORTED})
+                    else
+                        SUPPORTED=${QT_VERSION}
+                    fi
+                    SUPPORTED="Qt_`echo ${SUPPORTED} | sed -e 's/\./_/g'`"
+                    PYQT_SIPFLAGS="-x VendorID -x PyQt_NoPrintRangeBug -t WS_X11 -t ${SUPPORTED} -g -s ".cc" -c . ${PYQT_INCLUDES}"
+                    break
+                fi
+            fi
+        done
     fi
-  fi
-fi
-if test "x$pyqt_sips_ok" == "xno"; then
-  pyqt_ok=no
-else
-  PYQT_INCLUDES="-I$PYQT_SIPS"
-  
-  dnl Additional sip flags required for correct wrappers compilation
-  AC_MSG_CHECKING(which qt classes should be excluded)
-
-  PYQT_SIPFLAGS=""
-
-  CXXFLAGS_old=$CXXFLAGS
-  CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
-  LIBS_old=$LIBS
-  LIBS="$LIBS $QT_LIBS"
-
-  AC_TRY_COMPILE([#include <qcdestyle.h>],
-                 [new QCDEStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_CDE")
-  AC_TRY_COMPILE([#include <qinterlacestyle.h>],
-                 [new QInterlaceStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_INTERLACE")
-  AC_TRY_COMPILE([#include <qmotifstyle.h>],
-                 [new QMotifStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_MOTIF")
-  AC_TRY_COMPILE([#include <qmotifplusstyle.h>],
-                 [new QMotifPlusStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_MOTIFPLUS")
-  AC_TRY_COMPILE([#include <qplatinumstyle.h>],
-                 [new QPlatinumStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_PLATINUM")
-  AC_TRY_COMPILE([#include <qsgistyle.h>],
-                 [new QSGIStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_SGI")
-  AC_TRY_COMPILE([#include <qwindowsstyle.h>],
-                 [new QWindowsStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_WINDOWS")
-  AC_TRY_COMPILE([#include <qwindowsxpstyle.h>],
-                 [new QWindowsXPStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_WINDOWSXP")
-
-  LIBS="$LIBS -lqassistantclient"
-  AC_TRY_LINK([#include <qassistantclient.h>],
-              [new QAssistantClient("foo");],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_ASSISTANTCLIENT")
-
-  AC_MSG_RESULT(done)
-
-  CXXFLAGS=$CXXFLAGS_old
-  LIBS=$LIBS_old
 fi
-# get latest Qt version supported
-QT_VERS=`grep -e "[[[:space:]]]*Qt_[[[:digit:]_]]\+}" ${PYQT_SIPS}/versions.sip | sed -e "s/\(.*\)[[[:space:]]]*\(Qt_[[[:digit:]_]]\+\)}/\2/g"`
-AC_MSG_RESULT(Latest Qt version supported by PyQt is $QT_VERS)
 
 AC_SUBST(PYQT_INCLUDES)
 AC_SUBST(PYQT_LIBS)
 AC_SUBST(PYQT_SIPS)
 AC_SUBST(PYUIC)
 AC_SUBST(PYQT_SIPFLAGS)
-AC_SUBST(QT_VERS)
 
-AC_LANG_RESTORE
+dnl AC_LANG_RESTORE
 
 AC_MSG_RESULT(for pyqt: $pyqt_ok)
 
index 1aea9c3a2b121c0789a0a0a02181cbd8a3edc0da..5859b6afce7671fdbb82edea677fbff19921a807 100644 (file)
@@ -1,24 +1,37 @@
-dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-dnl 
-dnl  This library is free software; you can redistribute it and/or 
-dnl  modify it under the terms of the GNU Lesser General Public 
-dnl  License as published by the Free Software Foundation; either 
-dnl  version 2.1 of the License. 
-dnl 
-dnl  This library is distributed in the hope that it will be useful, 
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-dnl  Lesser General Public License for more details. 
-dnl 
-dnl  You should have received a copy of the GNU Lesser General Public 
-dnl  License along with this library; if not, write to the Free Software 
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-dnl 
-dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
 dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
+dnl  OPTIONS_QT
+dnl  ------------------------------------------------------------------------
+dnl  Adds the --with-qt=path
+dnl
+AC_DEFUN([OPTIONS_QT], [
+  AC_ARG_WITH([qt],
+              [AC_HELP_STRING([--with-qt], [Possible usage:
+                                             "Qt_Install_Path" - prefix to path where Qt was installd;
+                                             "" or "yes" or "auto" - means seaching installed Qt product in the system (checking $QTDIR and then - standard system paths );
+                                             "no" - not use Qt product (is not supported)
+                                            By default "" option is used)])],
+              [with_qt=$withval], [with_qt=""])
+])
 
 AC_DEFUN([CHECK_QT],[
 AC_REQUIRE([AC_PROG_CC])dnl
@@ -28,6 +41,8 @@ AC_REQUIRE([AC_PROG_CXXCPP])dnl
 AC_REQUIRE([CHECK_OPENGL])dnl
 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
 
+AC_REQUIRE([OPTIONS_QT])dnl
+
 AC_CHECKING(for Qt)
 
 if test "x$OpenGL_ok" != "xyes" ; then
@@ -39,19 +54,94 @@ qt_ok=yes
 AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
 
+dnl QT install dir
+if test -z $with_qt ; then
+  with_qt=""
+fi
+if test "x$with_qt" = "xyes" ; then
+  dnl in case user wrote --with-qt=yes
+  with_qt=""
+fi
+if test "x$with_qt" = "xauto" ; then
+  dnl in case user wrote --with-qt=auto
+  with_qt=""
+fi
+if test "x$with_qt" = "xno" ; then
+  dnl in case user wrote --with-qt=no
+  with_qt=""
+  AC_MSG_WARN(Value no, specified for option --with-qt, is not supported)
+fi
+
+if test "x$with_qt" != "x" ; then
+  dnl Using "--with-qt" prefix path
+  QTDIR="$with_qt"
+else
+  if test -z $QTDIR ; then
+    AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed)
+    for d in /usr/local/lib/qt4 /usr/lib/qt4 ; do
+      if test -f ${d}/include/Qt/qconfig.h ; then
+        AC_MSG_RESULT(trying ${d})
+        QTDIR="${d}"
+        break
+      else
+        if test -f ${d}/include/qconfig.h ; then
+          AC_MSG_RESULT(trying ${d})
+          QTDIR="${d}"
+          break
+        fi
+      fi
+    done
+  else
+    dnl Using QTDIR environment variable
+    AC_MSG_RESULT(QTDIR is $QTDIR)
+  fi
+fi
+
+#
+# check QTDIR environment variable
+#
 if test "x$QTDIR" = "x"
 then
-   AC_MSG_RESULT(please define QTDIR variable)
+   AC_MSG_RESULT(Please define correct path in "--with-qt" option or use correct $QTDIR variable)
    qt_ok=no
-else
-   AC_MSG_RESULT(QTDIR is $QTDIR)
+fi
+
+#
+# check Qt version
+#
+if  test "x$qt_ok" = "xyes"
+then
    qt_inc_ok=no
    QTINC=""
-   AC_CHECK_FILE(${QTDIR}/include/qt3/qglobal.h,QTINC="/qt3",QTINC="")
-   QT_VERSION=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
-   AC_MSG_RESULT(Qt version is $QT_VERSION)
+   AC_CHECK_FILE(${QTDIR}/include/qt4/QtCore/qglobal.h,QTINC="/qt4",QTINC="")
+   if test "x$QTINC" = "x"
+   then
+     AC_CHECK_FILE(${QTDIR}/include${QTINC}/QtCore/qglobal.h,qt_inc_ok=yes,qt_inc_ok=no)
+   else
+     qt_inc_ok=yes
+   fi
+   if test "x$qt_inc_ok" = "xyes"
+   then
+     AC_MSG_CHECKING(whether Qt version >= 4.0)
+     QT_VERSION=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/QtCore/qglobal.h | sed -e 's%^#define QT_VERSION_STR[[:space:]]*\"\([[:digit:]\.]*\)\"%\1%g'`
+     QT_VERSION_ID=`echo $QT_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
+     if test $QT_VERSION_ID -ge 40000
+     then
+       AC_MSG_RESULT(yes)
+     else
+       AC_MSG_RESULT(no)
+       qt_ok=no
+     fi
+     AC_MSG_CHECKING(Qt version)
+     AC_MSG_RESULT($QT_VERSION)
+   else
+     qt_ok=no
+   fi
 fi
 
+#
+# check moc presence (meta-object compiler)
+#
 if  test "x$qt_ok" = "xyes"
 then
   if test -f ${QTDIR}/bin/moc
@@ -63,13 +153,31 @@ then
   if test "x$MOC" = "x"
   then
     qt_ok=no
-    AC_MSG_RESULT(moc qt-compiler not in PATH variable)
+    AC_MSG_RESULT(moc (Qt meta-object compiler) is not in the PATH variable)
   else
     qt_ok=yes
-    AC_MSG_RESULT(moc found)
+    AC_MSG_RESULT(moc (Qt meta-object compiler) is found)
+  fi
+
+  if test "x$qt_ok" = "xyes"
+  then
+    dnl check moc version
+    AC_MSG_CHECKING(cheching equality Qt and moc tool version)
+    MOC_VERSION=`$MOC -v 2>&1 | awk 'BEGIN{FS="[[ ()]]"};{print $(NF-1)}'`
+    if test "x$QT_VERSION" = "x$MOC_VERSION"
+    then
+      AC_MSG_RESULT(yes)
+      qt_ok=yes
+    else
+      AC_MSG_RESULT(moc tool and Qt product are inpompatible $MOC_VERSION)
+      qt_ok=no
+    fi
   fi
 fi
 
+#
+# check uic presence (user interface compiler)
+#
 if  test "x$qt_ok" = "xyes"
 then
   if test -f ${QTDIR}/bin/uic
@@ -81,94 +189,227 @@ then
   if test "x$UIC" = "x"
   then
     qt_ok=no
-    AC_MSG_RESULT(uic qt-interface compiler not in PATH variable)
+    AC_MSG_RESULT(uic (Qt user interface compiler) is not in the PATH variable)
   else
     qt_ok=yes
-    AC_MSG_RESULT(uic found)
+    AC_MSG_RESULT(uic (Qt user interface compiler) is found)
   fi
 fi
 
-AC_SUBST(QTDIR)
-QT_ROOT=$QTDIR
+#
+# check rcc presence (resources compiler)
+#
+if  test "x$qt_ok" = "xyes"
+then
+  if test -f ${QTDIR}/bin/rcc
+  then
+    QRCC=${QTDIR}/bin/rcc
+  else
+    AC_PATH_PROG(QRCC, rcc)
+  fi
+  if test "x$QRCC" = "x"
+  then
+    qt_ok=no
+    AC_MSG_RESULT(rcc (Qt resources compiler) is not in the PATH variable)
+  else
+    qt_ok=yes
+    AC_MSG_RESULT(rcc (Qt resources compiler) is found)
+  fi
+
+  if test "x$qt_ok" = "xyes"
+  then
+    dnl check rcc version
+    AC_MSG_CHECKING(cheching equality Qt and rcc tool version)
+    QRCC_VERSION=`$QRCC -v 2>&1 | awk '{print $NF}'`
+    if test "x$QT_VERSION" = "x$QRCC_VERSION"
+    then
+      AC_MSG_RESULT(yes)
+      qt_ok=yes
+    else
+      AC_MSG_RESULT(rcc tool and Qt product are inpompatible)
+      qt_ok=no
+    fi
+  fi
+fi
 
+#
+# check lrelease presence (translation files compiler)
+#
 if  test "x$qt_ok" = "xyes"
 then
-  CPPFLAGS_old=$CPPFLAGS
-  CPPFLAGS="$CPPFLAGS -I$QTDIR/include${QTINC}"
+  if test -f ${QTDIR}/bin/lrelease
+  then
+    LRELEASE=${QTDIR}/bin/lrelease
+  else
+    AC_PATH_PROG(LRELEASE, lrelease)
+  fi
+  if test "x$LRELEASE" = "x"
+  then
+    qt_ok=no
+    AC_MSG_RESULT(lrelease (Qt translation files compiler) is not in the PATH variable)
+  else
+    qt_ok=yes
+    AC_MSG_RESULT(lrelease (Qt translation files compiler) is found)
+  fi
+  
+  if test "x$qt_ok" = "xyes"
+  then
+    dnl check lrelease version
+    AC_MSG_CHECKING( equality of Qt and lrelease tool version)
+    LRELEASE_VERSION=`$LRELEASE -version 2>&1 | awk '{print $NF}'`
+    if test "x$QT_VERSION" = "x$LRELEASE_VERSION"
+    then
+      AC_MSG_RESULT(yes)
+      qt_ok=yes
+    else
+      AC_MSG_RESULT(lrelease tool and Qt product are inpompatible)
+      qt_ok=no
+    fi
+  fi
+fi
 
-  AC_LANG_CPLUSPLUS
-  AC_CHECK_HEADER(qaction.h,qt_ok=yes ,qt_ok=no)
+QT_ROOT=$QTDIR
 
-  CPPFLAGS=$CPPFLAGS_old
+#
+# check Qt header files
+#
+if  test "x$qt_ok" = "xyes"
+then
+  AC_CHECKING(include Qt header files)
 
-  AC_MSG_CHECKING(include of qt headers)
+  CPPFLAGS_old=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS -I${QTDIR}/include${QTINC} -I${QTDIR}/include${QTINC}/QtCore"
+  AC_CHECK_HEADER(QObject,qt_ok=yes,qt_ok=no)
+  CPPFLAGS=$CPPFLAGS_old
 
   if  test "x$qt_ok" = "xno"
   then
-    AC_MSG_RESULT(qt headers not found, or too old qt version, in $QTDIR/include)
-    AC_MSG_RESULT(QTDIR environment variable may be wrong)
+    AC_MSG_RESULT(qt header files are not found in $QTDIR/include${QTINC}/QtCore)
+    AC_MSG_RESULT(QTDIR environment variable may be wrong (probably too old Qt version))
   else
-    AC_MSG_RESULT(yes)
-    QT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
-    QT_MT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
+    AC_MSG_RESULT(qt header files seem to be OK)
+    QT_INCLUDES="-I${QTDIR}/include${QTINC}"
+    # user header files
+    QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtCore"
+    QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtGui"
+    QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtOpenGL"
+    QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtXml"
+    # not used currently header files (uncomment if required)
+    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtAssistant"
+    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDBus"
+    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDesigner"
+    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtNetwork"
+    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSql"
+    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSvg"
+    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtTest"
+    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtUiTools"
+
+    QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtAssistant"
+    QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtNetwork"
+
+    # this flag is obsolete with Qt 4
+    QT_MT_INCLUDES="$QT_INCLUDES"
   fi
 fi
 
+#
+# test Qt libraries
+#
 if  test "x$qt_ok" = "xyes"
 then
-  AC_MSG_CHECKING(linking qt library)
+  AC_MSG_CHECKING(linking against Qt library)
+
+  CXXFLAGS_old=$CXXFLAGS
+  CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
+
   LIBS_old=$LIBS
   if test "x$QTDIR" = "x/usr"
   then
-    LIBS="$LIBS -lqt-mt $OGL_LIBS"
+    QT_LIB_DIR=""
+  elif test -d ${QTDIR}/lib; then
+    QT_LIB_DIR="-L$QTDIR/lib"
+  elif test -d ${QTDIR}/lib64; then
+    QT_LIB_DIR="-L$QTDIR/lib64"
   else
-    LIBS="$LIBS -L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt $OGL_LIBS"
+    AC_MSG_ERROR(Can't detect of Qt library directory )
+    qt_ok=no
   fi
-
-  CXXFLAGS_old=$CXXFLAGS
-  CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
+  LIBS="$LIBS $QT_LIB_DIR -lQtCore"
 
   AC_CACHE_VAL(salome_cv_lib_qt,[
     AC_TRY_LINK(
-#include <qapplication.h>
+#include <QCoreApplication>
 ,   int n;
     char **s;
-    QApplication a(n, s);
+    QCoreApplication a(n, s);
     a.exec();,
     eval "salome_cv_lib_qt=yes",eval "salome_cv_lib_qt=no")
   ])
   qt_ok="$salome_cv_lib_qt"
 
+  # BEGIN: for CCRT (installation of qt have only a "lib" directory)
   if  test "x$qt_ok" = "xno"
   then
+    QT_LIB_DIR="-L$QTDIR/lib"
+    LIBS="$LIBS_old $QT_LIB_DIR -lQtCore"
+
+    AC_CACHE_VAL(salome_cv_lib_qt,[
+      AC_TRY_LINK(
+#include <QCoreApplication>
+,     int n;
+      char **s;
+      QCoreApplication a(n, s);
+      a.exec();,
+      eval "salome_cv_lib_qt=yes",eval "salome_cv_lib_qt=no")
+    ])
+    qt_ok="$salome_cv_lib_qt"
+  fi
+  # END: for CCRT
+
+  if  test "x$qt_ok" = "xno"
+  then
+    AC_MSG_RESULT(no)
     AC_MSG_RESULT(unable to link with qt library)
-    AC_MSG_RESULT(QTDIR environment variable may be wrong)
+    AC_MSG_RESULT(QTDIR environment variable may be wrong (probably too old Qt version))
   else
     AC_MSG_RESULT(yes)
-    if test "x$QTDIR" = "x/usr"
-    then
-         QT_LIBS=" -lqt-mt"
-      QT_MT_LIBS=" -lqt-mt"
-    else
-         QT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
-      QT_MT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
-    fi
+    # core libs
+    QT_CORE_LIBS="$QT_LIB_DIR -lQtCore -lQtXml"
+    # gui libs
+    QT_GUI_LIBS="$QT_LIB_DIR -lQtGui -lQtOpenGL"
+    # other libs (currently not used)
+    QT_OTHER_LIBS="$QT_LIB_DIR"
+    # other libs (can be used if necessary)
+    #QT_OTHER_LIBS="$QT_LIB_DIR -lQt3Support -lQtAssistantClient -lQtDesigner -lQtNetwork -lQtSql -lQtSvg -lQtTest -ltQtUiTools"
+    QT_ASSISTANT_LIBS="$QT_LIB_DIR -lQtAssistantClient -lQtNetwork"
+    # all libs
+    QT_LIBS="$QT_CORE_LIBS $QT_GUI_LIBS $QT_OTHER_LIBS"
+    # this flag is obsolete with Qt 4
+    QT_MT_LIBS="$QT_LIBS"
   fi
-
   LIBS=$LIBS_old
   CXXFLAGS=$CXXFLAGS_old
-
 fi
 
+AC_SUBST(QTDIR)
 AC_SUBST(MOC)
 AC_SUBST(UIC)
+AC_SUBST(QRCC)
+AC_SUBST(LRELEASE)
 
 AC_SUBST(QT_ROOT)
 AC_SUBST(QT_INCLUDES)
 AC_SUBST(QT_MT_INCLUDES)
+AC_SUBST(QT_ASSISTANT_INCLUDES)
+AC_SUBST(QT_LIB_DIR)
+AC_SUBST(QT_CORE_LIBS)
+AC_SUBST(QT_GUI_LIBS)
+AC_SUBST(QT_OTHER_LIBS)
 AC_SUBST(QT_LIBS)
 AC_SUBST(QT_MT_LIBS)
+AC_SUBST(QT_ASSISTANT_LIBS)
 AC_SUBST(QT_VERSION)
+AC_SUBST(QT_VERSION_ID)
 
 AC_LANG_RESTORE
 
index d9bc23fbf59a314d74d59bc2299dd2ee7bc5509b..c62506993e6b1203f8d81038fd442c8027a5e530 100644 (file)
@@ -1,14 +1,36 @@
-dnl Copyright (C) 2003  CEA/DEN, EDF R&D
-
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 AC_DEFUN([CHECK_QWT],[
 AC_REQUIRE([CHECK_QT])dnl
 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
 
 AC_CHECKING(for qwt)
 
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
 qwt_ok=yes
 
-dnl were is qwt ?
+dnl where is qwt ?
 
 AC_ARG_WITH(qwt,
     [  --with-qwt=DIR     directory path to QWT installation ],
@@ -18,47 +40,49 @@ AC_ARG_WITH(qwt,
 
 AC_ARG_WITH(qwt_inc,
     [  --with-qwt_inc=DIR   directory path to QWT includes ],
-    [QWT_INCLUDES="$withval"
+    [QWT_INCDIR="$withval"
       AC_MSG_RESULT("select $withval as path to QWT includes")
     ])
 
 if test -z $QWTHOME; then
   AC_MSG_RESULT(QWTHOME not defined)
-  exits_ok=no  
-  if test "x$exits_ok" = "xno"; then
+  exist_ok=no  
+  if test "x$exist_ok" = "xno"; then
      for d in /usr/local /usr ; do
-        AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/libqwt.so,exits_ok=yes,exits_ok=no)
-        if test "x$exits_ok" = "xyes"; then
+        AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/libqwt.so,exist_ok=yes,exist_ok=no)
+        if test "x$exist_ok" = "xyes"; then
            QWTHOME=$d
            AC_MSG_RESULT(libqwt.so detected in $d/lib)
         fi
      done
   fi
-  if test "x$exits_ok" = "xno"; then
+  if test "x$exist_ok" = "xno"; then
      for d in `echo $LD_LIBRARY_PATH | sed -e "s/:/ /g"` ; do
         if test -f $d/libqwt.so ; then
            AC_MSG_RESULT(libqwt.so detected in $d)
            QWTHOME=$d
            QWTHOME=`echo ${QWTHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
-           exits_ok=yes
+           exist_ok=yes
            break
         fi
      done
   fi
-  if test "x$exits_ok" = "xyes"; then
-     if test -z $QWT_INCLUDES; then
-        QWT_INCLUDES=$QWTHOME"/include/qwt"
-        if test ! -f $QWT_INCLUDES/qwt.h ; then
-          QWT_INCLUDES=$QWTHOME"/include"
+  if test "x$exist_ok" = "xyes"; then
+     if test -z $QWT_INCDIR; then
+        QWT_INCDIR=$QWTHOME"/include/qwt"
+        if test ! -f $QWT_INCDIR/qwt.h ; then
+          QWT_INCDIR=$QWTHOME"/include"
         fi
-        if test ! -f $QWT_INCLUDES/qwt.h ; then
-          QWT_INCLUDES=/usr/lib/qt3/include/qwt
+        if test ! -f $QWT_INCDIR/qwt.h ; then
+          QWT_INCDIR=/usr/lib/qt4/include/qwt
         fi
      fi
+  else
+     qwt_ok=no
   fi
 else
-  if test -z $QWT_INCLUDES; then
-     QWT_INCLUDES="$QWTHOME/include"
+  if test -z $QWT_INCDIR; then
+     QWT_INCDIR="$QWTHOME/include"
   fi           
 fi
 
@@ -67,86 +91,80 @@ if test "x$qwt_ok" = xno -o ! -d "$QWTHOME" ; then
   AC_MSG_WARN(qwt not found)
   qwt_ok=no
 else
-   AC_LANG_SAVE
-   AC_LANG_CPLUSPLUS
-   CPPFLAGS_old=$CPPFLAGS
-   CPPFLAGS="$CPPFLAGS -I$QWT_INCLUDES"
-   CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
-
-   AC_CHECK_HEADER(qwt.h,qwt_ok=yes,qwt_ok=no) 
+  CPPFLAGS_old=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS $QT_INCLUDES -I$QWT_INCDIR"
 
-   CPPFLAGS=$CPPFLAGS_old
+  AC_CHECK_HEADER(qwt.h,qwt_ok=yes,qwt_ok=no) 
+  CPPFLAGS=$CPPFLAGS_old
 
-   if test "x$qwt_ok" = xno ; then
-     AC_MSG_RESULT(no)
-     AC_MSG_WARN(qwt not found)
-  else
-     qwt_ok=yes
-  fi
+  AC_MSG_CHECKING(include of qwt headers)
 
-if  test "x$qwt_ok" = "xyes"
-then
-  AC_MSG_CHECKING(linking qwt library)
-  LIBS_old=$LIBS
-  if test "x$QTDIR" = "x/usr"
-  then
-    LIBS="$LIBS -lqt-mt"
+  if test "x$qwt_ok" = xno ; then
+    AC_MSG_RESULT(no)
+    AC_MSG_WARN(qwt not found)
   else
-    LIBS="$LIBS -L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
-  fi
-  if test "x$QWTHOME" = "x/usr"
-  then
-    LIBS="$LIBS -lqwt"
-  else
-    LIBS="$LIBS -L$QWTHOME/lib -lqwt"
+    AC_MSG_RESULT(yes)
+    QWT_INCLUDES=-I$QWT_INCDIR
   fi
 
-  CXXFLAGS_old=$CXXFLAGS
-  CXXFLAGS="$CXXFLAGS $QT_INCLUDES -I$QWT_INCLUDES"
+  #
+  # test Qwt libraries
+  #
+  if test "x$qwt_ok" = "xyes" ; then
+    AC_MSG_CHECKING(linking qwt library)
 
-  AC_CACHE_VAL(salome_cv_lib_qwt,[
-    AC_TRY_LINK(
-#include <qapplication.h>
-#include <qwt_plot.h>
-,   int n;
-    char **s;
-    QApplication a(n, s);
-    QwtPlot* p;
-    a.setMainWidget(p);
-    a.exec();,
-    eval "salome_cv_lib_qwt=yes",eval "salome_cv_lib_qwt=no")
-  ])
-  qwt_ok="$salome_cv_lib_qwt"
-
-  if  test "x$qwt_ok" = "xno"
-  then
-    AC_MSG_RESULT(unable to link with qwt library)
-    AC_MSG_RESULT(QWTHOME environment variable may be wrong)
-  else
-    QWT_INCLUDES="-I$QWT_INCLUDES"
-    if test "x$QWTHOME" = "x/usr"
-    then
-      QWT_LIBS=" -lqwt"
+    LIBS_old=$LIBS
+    LIBS="$LIBS $QT_LIBS"
+    if test "x$QWTHOME" = "x/usr" ; then
+      LIBS="$LIBS -lqwt"
     else
-      QWT_LIBS="-L$QWTHOME/lib -lqwt"
+      LIBS="$LIBS -L$QWTHOME/lib -lqwt"
     fi
 
-    AC_SUBST(QWT_INCLUDES)
-    AC_SUBST(QWT_LIBS)
+    CXXFLAGS_old=$CXXFLAGS
+    CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QWT_INCLUDES"
 
-    AC_MSG_RESULT(yes)
-  fi
+    AC_CACHE_VAL(salome_cv_lib_qwt,[
+      AC_TRY_LINK(
+#include <QApplication>
+#include <qwt_plot.h>
+,     int n;
+      char **s;
+      QApplication a(n, s);
+      QwtPlot p;
+      p.resize( 600, 400 );
+      p.show();
+      a.exec();,
+      eval "salome_cv_lib_qwt=yes",eval "salome_cv_lib_qwt=no")
+    ])
+    qwt_ok="$salome_cv_lib_qwt"
 
-  LIBS=$LIBS_old
-  CXXFLAGS=$CXXFLAGS_old
+    if  test "x$qwt_ok" = "xno" ; then
+      AC_MSG_RESULT(unable to link with qwt library)
+      AC_MSG_RESULT(QWTHOME environment variable may be wrong)
+    else
+      AC_MSG_RESULT(yes)
+      if test "x$QWTHOME" = "x/usr" ; then
+        QWT_LIBS=" -lqwt"
+      else
+        QWT_LIBS="-L$QWTHOME/lib -lqwt"
+      fi
+    fi
 
+    LIBS=$LIBS_old
+    CXXFLAGS=$CXXFLAGS_old
+  fi
 fi
 
+AC_SUBST(QWT_INCLUDES)
+AC_SUBST(QWT_LIBS)
 
-  AC_LANG_RESTORE
+AC_LANG_RESTORE
 
-fi
+AC_MSG_RESULT(for qwt: $qwt_ok)
 
+# Save cache
+AC_CACHE_SAVE
 
 ])dnl
 dnl
index 88cbe5951156f9c55b4c5d7e6bb20a42784ca54f..464bdfd7eb8b47fcf2e24b2613fa67d87f49f449 100644 (file)
@@ -1,5 +1,24 @@
-dnl Copyright (C) 2003  CEA/DEN, EDF R&D
-
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 AC_DEFUN([CHECK_SIP],[
 AC_REQUIRE([CHECK_PYTHON])dnl
 AC_REQUIRE([CHECK_QT])dnl
@@ -10,176 +29,85 @@ sip_ok=yes
 AC_ARG_WITH(sip,
     [  --with-sip=EXEC sip executable ],
     [SIP="$withval"
-      AC_MSG_RESULT("select $withval as sip executable")
+      AC_MSG_RESULT([Try $withval as sip executable])
     ], [
       AC_PATH_PROG(SIP, sip)
     ])
 
 if test "x$SIP" = "x" ; then
     sip_ok=no
-    AC_MSG_RESULT(sip not in PATH variable)
+    AC_MSG_RESULT(sip is not in the PATH variable)
 else
-    version=`$SIP -V`
-    AC_MSG_RESULT(sip version is $version)
-    case "$version" in
-         3.2*)
-           SIP_VERS=v3_old ;;
-         3.3*)
-           SIP_VERS=v3_old ;;
-         3.4*)
-           SIP_VERS=v3_old ;;
-         3.5*)
-           SIP_VERS=v3_old ;;
-         3.6*)
-           SIP_VERS=v3_old ;;
-         3.7*)
-           SIP_VERS=v3_old ;;
-         3.8*)
-           SIP_VERS=v3_old ;;
-         3.9*)
-           SIP_VERS=v3_old ;;
-         3.10*)
-           SIP_VERS=v3_new ;;
-         4.1*)
-           SIP_VERS=v4_old ;;
-         4.2*)
-           SIP_VERS=v4_new ;;
-         4.3*)
-           SIP_VERS=v4_new ;;
-         4.4*)
-           SIP_VERS=v4_new ;;
-         4.5*)
-           SIP_VERS=v4_new ;;
-        4.6*)
-           SIP_VERS=v4_new ;;
-        4.7*)
-           SIP_VERS=v4_new ;;
-         *)
-           AC_MSG_RESULT(sip version $version not supported)
-           SIP_VERS=unsupported ;;
-    esac
+    AC_MSG_CHECKING(whether sip version >= 4.6)
+    SIP_VERSION=`$SIP -V | awk '{print $[1]}'`
+    SIP_VERSION_ID=`echo $SIP_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
+    if test $SIP_VERSION_ID -ge 40600 ; then 
+        AC_MSG_RESULT(yes)
+        AC_MSG_RESULT(sip version is $SIP_VERSION)
+    else
+        AC_MSG_RESULT(no)
+        AC_MSG_RESULT(WARNING! sip version $SIP_VERSION is not supported (at least 4.6 is required)!)
+        sip_ok=no
+    fi
+fi
 
+if test "x$sip_ok" = "xyes" ; then
     if test "x$SIPDIR" = "x" ; then
         SIPDIR=`dirname $SIP`
         SIPDIR=`dirname $SIPDIR`
     fi
 
-    sip_ok=no
-    dnl Search sip.h file
-    if test "x$SIPDIR" != "x" ; then
-        dnl look for sip.h in ${SIPDIR}
-        AC_CHECK_FILE(${SIPDIR}/sip.h,sip_ok=yes,sip_ok=no)
-       if test "x$sip_ok" == "xyes" ; then
-           SIP_INCLUDES="-I${SIPDIR}"
-       fi
-        if test "x$sip_ok" == "xno" ; then
-            dnl look for sip.h in ${SIPDIR}/include/python${PYTHON_VERSION}
-           if test -d ${SIPDIR}/include/python${PYTHON_VERSION} ; then
-               AC_CHECK_FILE(${SIPDIR}/include/python${PYTHON_VERSION}/sip.h,sip_ok=yes,sip_ok=no)
-               if test "x$sip_ok" == "xyes" ; then
-                   SIP_INCLUDES="-I${SIPDIR}/include/python${PYTHON_VERSION}"
-               fi
-           fi
-       fi
+    TEST_INC_DIRS=""
+    TEST_LIB_DIRS=""
+    if test "x${SIPDIR}" != "x" ; then
+        TEST_INC_DIRS="${TEST_INC_DIRS} ${SIPDIR} ${SIPDIR}/include"
+       TEST_INC_DIRS="${TEST_INC_DIRS} ${SIPDIR}/include/python${PYTHON_VERSION}"
+        TEST_LIB_DIRS="${TEST_LIB_DIRS} ${SIPDIR} ${SIPDIR}/lib"
+       TEST_LIB_DIRS="${TEST_LIB_DIRS} ${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
     fi
-    if test "x$sip_ok" == "xno" ; then
-        dnl look for sip.h in ${PYTHON_PREFIX}/include/python${PYTHON_VERSION}
-       if test -d ${PYTHON_PREFIX}/include/python${PYTHON_VERSION} ; then
-            AC_CHECK_FILE(${PYTHON_PREFIX}/include/python${PYTHON_VERSION}/sip.h,sip_ok=yes,sip_ok=no)
-           if test "x$sip_ok" == "xyes" ; then
-               SIP_INCLUDES="${PYTHON_INCLUDES}"
-            fi
-       fi
-    fi
-    if test "x$sip_ok" == "xno" ; then
-        dnl look for sip.h in /usr/include/python${PYTHON_VERSION}
-       if test -d /usr/include/python${PYTHON_VERSION} ; then
-            AC_CHECK_FILE(/usr/include/python${PYTHON_VERSION}/sip.h,sip_ok=yes,sip_ok=no)
-           if test "x$sip_ok" == "xyes" ; then
-               SIP_INCLUDES="/usr/include/python${PYTHON_VERSION}"
-            fi
-       fi
+    if test "x${PYTHONHOME}" != "x" ; then
+       TEST_INC_DIRS="${TEST_INC_DIRS} ${PYTHONHOME}/include/python${PYTHON_VERSION}"
+       TEST_LIB_DIRS="${TEST_LIB_DIRS} ${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
     fi
-       
-    dnl Search (lib)sip.so file
-    sip_lib_ok=no
-    if test "x$SIPDIR" != "x" ; then
-        dnl look for (lib)sip.so in ${SIPDIR}
-        AC_CHECK_FILE(${SIPDIR}/libsip.so,sip_lib_ok=yes,sip_lib_ok=no)
-       if test "x$sip_lib_ok" == "xyes" ; then
-            if test "x${SIPDIR}" = "x/usr/lib"
-            then
-              SIP_LIBS="-lsip"
-            else
-              SIP_LIBS="-L${SIPDIR} -lsip"
+    TEST_INC_DIRS="${TEST_INC_DIRS} /usr/include /usr/include/python${PYTHON_VERSION}"
+    TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
+
+    dnl Search sip.h file
+    sip_ok=no
+    for d in ${TEST_INC_DIRS} ; do
+        if test -d $d ; then
+            AC_CHECK_FILE(${d}/sip.h,sip_ok=yes,sip_ok=no)
+           if test "x$sip_ok" == "xyes" ; then
+               SIP_INCLUDES="-I${d}"
+                break
             fi
-       else
-           AC_CHECK_FILE(${SIPDIR}/sip.so,sip_lib_ok=yes,sip_lib_ok=no)
-           if test "x$sip_lib_ok" == "xyes" ; then
-              if test "x${SIPDIR}" = "x/usr/lib"
-              then
-                SIP_LIBS=""
-              else
-                SIP_LIBS="-L${SIPDIR}"
-              fi
-           fi
-       fi
+        fi
+    done
 
-        if test "x$sip_lib_ok" == "xno" ; then
-            dnl look for (lib)sip.so in ${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages
-           if test -d ${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages ; then
-               AC_CHECK_FILE(${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no)
-               if test "x$sip_lib_ok" == "xyes" ; then
-                   SIP_LIBS="-L${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lsip"
-               else
-                   AC_CHECK_FILE(${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no)
-                   if test "x$sip_lib_ok" == "xyes" ; then
-                       SIP_LIBS="-L${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
-                   fi
-               fi
-           fi
-       fi
-    fi
-    if test "x$sip_lib_ok" == "xno" ; then
-        dnl look for (lib)sip.so in ${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages
-       if test -d ${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages ; then
-            AC_CHECK_FILE(${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no)
-           if test "x$sip_lib_ok" == "xyes" ; then
-               SIP_LIBS="-L${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lsip"
-           else
-               AC_CHECK_FILE(${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no)
-                if test "x$sip_lib_ok" == "xyes" ; then
-                   SIP_LIBS="-L${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
+    if test "x$sip_ok" == "xyes" ; then
+        dnl Search sip.so file
+        sip_ok=no
+        for d in ${TEST_LIB_DIRS} ; do
+            if test -d $d ; then
+                AC_CHECK_FILE(${d}/sip.so,sip_ok=yes,sip_ok=no)
+               if test "x$sip_ok" == "xyes" ; then
+                    if test "x${d}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then
+                        SIP_LIBS=""
+                    else
+                        SIP_LIBS="-L${d}"
+                    fi
+                    break
                 fi
-           fi
-       fi
-    fi
-    if test "x$sip_lib_ok" == "xno" ; then
-        dnl look for (lib)sip.so in /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages
-       if test -d /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages ; then
-            AC_CHECK_FILE(/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no)
-           if test "x$sip_lib_ok" == "xyes" ; then
-               SIP_LIBS="-L$/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lsip"
-           else
-               AC_CHECK_FILE(/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no)
-                if test "x$sip_lib_ok" == "xyes" ; then
-                   SIP_LIBS="-L/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
-               fi
             fi
-       fi
-    fi
-    if test "x$sip_lib_ok" == "xno" ; then
-        sip_ok=no
+        done
     fi
 fi
 
 AC_SUBST(SIP)
 AC_SUBST(SIP_INCLUDES)
 AC_SUBST(SIP_LIBS)
-AC_SUBST(SIP_VERS)
-
-AM_CONDITIONAL(IS_SIP_V4, [test $SIP_VERS == v4_old || test $SIP_VERS == v4_new])
-AM_CONDITIONAL(IS_SIP_NEW, [test $SIP_VERS == v3_new || test $SIP_VERS == v4_new])
+AC_SUBST(SIP_VERSION)
+AC_SUBST(SIP_VERSION_ID)
 
 AC_MSG_RESULT(for sip: $sip_ok)
 
index 5e4fc444ea5325f5e88ee5ccdb860f418f72bbcc..c70c5adda2d7de6e8c4ee0e5892211cc698776a8 100644 (file)
@@ -1,25 +1,23 @@
-dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-dnl 
-dnl  This library is free software; you can redistribute it and/or 
-dnl  modify it under the terms of the GNU Lesser General Public 
-dnl  License as published by the Free Software Foundation; either 
-dnl  version 2.1 of the License. 
-dnl 
-dnl  This library is distributed in the hope that it will be useful, 
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-dnl  Lesser General Public License for more details. 
-dnl 
-dnl  You should have received a copy of the GNU Lesser General Public 
-dnl  License along with this library; if not, write to the Free Software 
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-dnl 
-dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
 dnl
-
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
 dnl  OPTIONS_VTK
 dnl  ------------------------------------------------------------------------
@@ -33,6 +31,9 @@ AC_DEFUN([OPTIONS_VTK], [
   AC_ARG_WITH([vtk-version],
               [AC_HELP_STRING([--with-vtk-version], [VTK include directory name is vtk-suffix, e.g. vtk-5.0/. What is the suffix? (Default "yes" means taking from environment variable)])],
               [vtk_suffix=$withval], [vtk_suffix="yes"])
+
+  AC_ARG_WITH([paraview],
+              [AC_HELP_STRING([--with-paraview], [ParaView from the specified location is used instead of VTK (default "" means ParaView should not be used)])])
 ])
 
 dnl
@@ -86,8 +87,8 @@ then
 fi
 
 LOCAL_INCLUDES="$OGL_INCLUDES"
-LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets $OGL_LIBS $LXLIB -lX11 -lXt"
-TRY_LINK_LIBS="-lvtkCommon $OGL_LIBS $LXLIB -lX11 -lXt"
+LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets $LXLIB -lX11 -lXt"
+TRY_LINK_LIBS="-lvtkCommon $LXLIB -lX11 -lXt"
 
 dnl VTK version suffix
 if test -z $vtk_suffix ; then
@@ -149,11 +150,35 @@ else
   fi
 fi
 
-LOCAL_INCLUDES="-I$VTKHOME/include/vtk${VTKSUFFIX} $LOCAL_INCLUDES"
-LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $LOCAL_LIBS"
-TRY_LINK_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX} -L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $TRY_LINK_LIBS"
-if test "x$VTKHOME" != "x/usr" ; then
-  LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX} $LOCAL_LIBS"
+# Using regular VTK installation
+if test "x$with_paraview" = "x" ; then
+  LOCAL_INCLUDES="-I$VTKHOME/include/vtk${VTKSUFFIX} $LOCAL_INCLUDES"
+  LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $LOCAL_LIBS"
+  TRY_LINK_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX} -L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $TRY_LINK_LIBS"
+  if test "x$VTKHOME" != "x/usr" ; then
+    LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX} $LOCAL_LIBS"
+  fi
+else
+# VTK from ParaView overrides other VTK versions
+  if test "${with_paraview}" = "yes" ; then
+    if test -z $PVHOME ; then
+      PVHOME="/usr"
+    fi
+  else
+    PVHOME=${with_paraview}
+  fi
+
+  if test -z $PVSRCHOME ; then
+    PVSRCHOME="$PVHOME/src"
+  fi
+
+  if test -z $PVINSTALLHOME ; then
+    PVINSTALLHOME="$PVHOME/bin"
+  fi
+
+  LOCAL_INCLUDES="-I$PVSRCHOME/VTK/Common -I$PVSRCHOME/VTK/Filtering -I$PVSRCHOME/VTK/GenericFiltering -I$PVSRCHOME/VTK/Graphics -I$PVSRCHOME/VTK/Hybrid -I$PVSRCHOME/VTK/Imaging -I$PVSRCHOME/VTK/Infovis -I$PVSRCHOME/VTK/IO -I$PVSRCHOME/VTK/Parallel -I$PVSRCHOME/VTK/Rendering -I$PVSRCHOME/VTK/Utilities -I$PVSRCHOME/VTK/Views -I$PVSRCHOME/VTK/VolumeRendering -I$PVSRCHOME/VTK/Widgets -I$PVINSTALLHOME/VTK -I$PVINSTALLHOME/VTK/Common -I$PVINSTALLHOME/VTK/Filtering -I$PVINSTALLHOME/VTK/GenericFiltering -I$PVINSTALLHOME/VTK/Graphics -I$PVINSTALLHOME/VTK/Hybrid -I$PVINSTALLHOME/VTK/Imaging -I$PVINSTALLHOME/VTK/Infovis -I$PVINSTALLHOME/VTK/IO -I$PVINSTALLHOME/VTK/Parallel -I$PVINSTALLHOME/VTK/Rendering -I$PVINSTALLHOME/VTK/Utilities -I$PVINSTALLHOME/VTK/Views -I$PVINSTALLHOME/VTK/VolumeRendering -I$PVINSTALLHOME/VTK/Widgets $LOCAL_INCLUDES"
+  LOCAL_LIBS="-L$PVINSTALLHOME/bin -lvtksys -lvtkzlib -lvtkpng -lvtkjpeg -lvtktiff -lvtkexpat -lvtksqlite -lvtkmetaio -lvtkverdict -lvtkNetCDF -lvtkDICOMParser -lvtkfreetype -lvtkftgl -lvtkexoIIc $LOCAL_LIBS"
+  TRY_LINK_LIBS="-L$PVINSTALLHOME/bin -lvtksys $TRY_LINK_LIBS"
 fi
 
 dnl vtk headers
index 16a5054e50f1554ec6b08f5e8cb8ef36474d3fdf..f21fc707621a86fe4079c2ac337665e211f1356d 100644 (file)
@@ -1,49 +1,86 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # ============================================================
 # This file defines the common definitions used in several
 # Makefile. This file must be included, if needed, by the file
 # Makefile.am.
 # ============================================================
-#
-
 # Standard directory for installation
-salomeincludedir   = $(includedir)/@PACKAGE@
-libdir             = $(prefix)/lib@LIB_LOCATION_SUFFIX@/@PACKAGE@
-bindir             = $(prefix)/bin/@PACKAGE@
+#
+salomeincludedir   = $(includedir)/salome
+libdir             = $(prefix)/lib@LIB_LOCATION_SUFFIX@/salome
+bindir             = $(prefix)/bin/salome
 salomescriptdir    = $(bindir)
+salomepythondir    = $(pythondir)/salome
+salomepyexecdir    = $(pyexecdir)/salome
 
 # Directory for installing idl files
-salomeidldir       = $(prefix)/idl/@PACKAGE@
+salomeidldir       = $(prefix)/idl/salome
 
 # Directory for installing resource files
-salomeresdir       = $(prefix)/share/@PACKAGE@/resources/@MODULE_NAME@
+salomeresdir       = $(prefix)/share/salome/resources/@MODULE_NAME@
 
 # Directories for installing admin files
-admlocaldir       = $(prefix)/adm_local
-admlocalunixdir     = $(admlocaldir)/unix
-admlocalm4dir        = $(admlocaldir)/unix/config_files
+admlocaldir        = $(prefix)/adm_local
+admlocalunixdir    = $(admlocaldir)/unix
+admlocalm4dir      = $(admlocaldir)/unix/config_files
+
+# Directory for install cmake files
+admlocal_cmakedir = $(admlocaldir)/cmake_files
 
 # Shared modules installation directory
-sharedpkgpythondir =$(pkgpythondir)/shared_modules
+sharedpkgpythondir = $(salomepythondir)/shared_modules
 
 # Documentation directory
-docdir             = $(datadir)/doc/@PACKAGE@
+docdir             = $(datadir)/doc/salome
 
 # common rules
 
-# moc-files generation
+# meta object implementation files generation (moc)
 %_moc.cxx: %.h
-       $(MOC) $< -o $@
+       $(MOC) $(MOC_FLAGS) $< -o $@
+
+# translation (*.qm) files generation (lrelease)
+%.qm: resources/%.ts
+       $(LRELEASE) $< -qm $@
+
+# resource files generation (qrcc)
+qrc_%.cxx: %.qrc
+       $(QRCC) $< -o $@ -name $(*F)
 
-# qm-files generation
-%.qm: resources/%.po
-       $(MSG2QM) $< $@
+# qt forms files generation (uic)
+ui_%.h: %.ui
+       $(UIC) -o $@ $<
 
-EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=resources/%.po)
+# extra distributed files
+EXTRA_DIST = $(MOC_FILES:%_moc.cxx=%.h) $(QRC_FILES:qrc_%.cxx=%.qrc) \
+             $(UIC_FILES:ui_%.h=%.ui) $(nodist_salomeres_DATA:%.qm=resources/%.ts)
 
+# customize clean operation
 mostlyclean-local:
        rm -f @builddir@/*_moc.cxx
        rm -f @builddir@/*.qm
+       rm -f @builddir@/qrc_*.cxx
+       rm -f @builddir@/ui_*.h
 
 # tests
 tests: unittest
index da7a678e1e498f5528128fe1b016f209292e23bf..69822e43700fd56ac7b2fc836006c5443a05c560 100644 (file)
@@ -1,15 +1,34 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 #=======================================================================
 # This section of this makefile comes from the file 
 # 'adm/unix/make_conclude' which was generated with config.status
 # from file adm/unix/make_conclude.in
 #=======================================================================
 # -* Makefile *- 
-#
 # Authors : Patrick GOLDBRONN (CEA) - Marc Tajchman (CEA)
 # Date : 6/07/2001
 # $Header$
 #
-
 ifneq ($(GUI_DISABLE_CORBA),yes)
 # ORB Specifics rules
 
index a0f5c84884b218d65de3192e9b555513ac81cf19..7d549a912d1fa04d6d4057cda8227e4a02b4364f 100644 (file)
@@ -1,41 +1,35 @@
-# Copyright (C) 2005  OPEN CASCADE, CEA, EDF R&D, LEG
-#           PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
-# 
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-# -* Makefile *- 
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+# -* Makefile *- 
 # Author : Guillaume Boulant (CSSI)
 # Module : KERNEL
 # $Header$
 #
-
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-#
-# ===============================================================
-# Files to be installed
-# ===============================================================
-#
-
-# These files are data, module or lib files
-nodist_salomescript_DATA= VERSION
-
-EXTRA_DIST+= VERSION.in
+# non-distributed files 
+nodist_salomescript_DATA = VERSION
 
-# These files are executable scripts
-dist_salomescript_SCRIPTS=\
-       runLightSalome.csh \
+# distributed files
+dist_salomescript_SCRIPTS =    \
+       runLightSalome.csh      \
        runLightSalome.sh
index 3a751e9933f9f2292b8b19bb7c1d69f11ffdfa86..51b64d9f596de8393aa4bd36577b559e9500bb18 100755 (executable)
@@ -1,7 +1,157 @@
 #!/bin/csh -f
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  File   : runLightSalome.csh
+#  Author : Vadim SANDLER, Open CASCADE S.A.S, vadim.sandler@opencascade.com
+#
 
-# this variable necessary for loading .ini or .xml file
-if ( ! $?LightAppConfig )    setenv LightAppConfig ${GUI_ROOT_DIR}/share/salome/resources/gui
-if ( ! $?LightAppResources ) setenv LightAppResources ${GUI_ROOT_DIR}/share/salome/resources/gui
+###
+# set default value for the LightAppConfig variable, which 
+# is necessary for loading of .ini or .xml resources file
+###
 
-SUITApp LightApp -style salome $* &
+if ( ! ($?LightAppConfig) ) then
+    setenv LightAppConfig ${GUI_ROOT_DIR}/share/salome/resources/gui
+else
+    setenv LightAppConfig ${LightAppConfig}:${GUI_ROOT_DIR}/share/salome/resources/gui
+endif
+if ( ! ($?LightAppResources) ) then
+    setenv LightAppResources ${GUI_ROOT_DIR}/share/salome/resources/gui
+else
+    setenv LightAppResources ${LightAppResources}:${GUI_ROOT_DIR}/share/salome/resources/gui
+endif
+
+###
+# default settings 
+###
+
+if (! ($?PATH) ) setenv PATH
+if (! ($?LD_LIBRARY_PATH) ) setenv LD_LIBRARY_PATH
+if (! ($?PYTHONPATH) ) setenv PYTHONPATH
+if (! ($?SALOMEPATH) ) setenv SALOMEPATH
+
+###
+# process --modules=... command line option (get list of modules)
+###
+
+set modules=""
+
+foreach arg ( X $* )
+    if ( "$arg" != "X" ) then
+       switch ( $arg )
+           case --modules=*:
+               set modules=`echo $arg | awk -F= '{ print $2 }' | sed -e "s%,% %g"`
+               breaksw
+           default:
+               breaksw
+       endsw
+    endif
+end
+
+set modules="KERNEL GUI $modules"
+
+###
+# exclude modules duplication
+###
+
+set mods=""
+
+foreach mod ( $modules )
+    echo $mods | grep -E "\<$mod\>" >/dev/null
+    if ( "$?" == "1" ) then
+       set mods="$mods $mod"
+    endif
+end
+
+###
+# set additional environment
+###
+
+set python_version=`python -c "import sys; print sys.version[:3]"`
+
+set MY_PATH=""
+set MY_LD_LIBRARY_PATH=""
+set MY_PYTHONPATH=""
+
+foreach mod ( $mods )
+    if ( "$arg" != "X" ) then
+       set root_dir=`printenv ${mod}_ROOT_DIR`
+       if ( "$root_dir" != "" ) then
+           set mod_lower=`echo $mod | tr "A-Z" "a-z"`
+           if ( -d ${root_dir}/bin/salome ) then
+               if ( "${MY_PATH}" == "" ) then
+                   set MY_PATH=${root_dir}/bin/salome
+               else
+                   set MY_PATH=${MY_PATH}:${root_dir}/bin/salome
+               endif
+           endif
+           if ( -d ${root_dir}/lib/salome ) then
+               if ( "${MY_LD_LIBRARY_PATH}" == "" ) then
+                   set MY_LD_LIBRARY_PATH=${root_dir}/lib/salome
+               else
+                   set MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${root_dir}/lib/salome
+               endif
+           endif
+           if ( "${python_version}" != "" ) then
+               if ( -d ${root_dir}/bin/salome ) then
+                   if ( "${MY_PYTHONPATH}" == "" ) then
+                       set MY_PYTHONPATH=${root_dir}/bin/salome
+                   else
+                       set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/bin/salome
+                   endif
+               endif
+               if ( -d ${root_dir}/lib/salome ) then
+                   if ( "${MY_PYTHONPATH}" == "" ) then
+                       set MY_PYTHONPATH=${root_dir}/lib/salome
+                   else
+                       set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/salome
+                   endif
+               endif
+               if ( -d ${root_dir}/lib/python${python_version}/site-packages/salome ) then 
+                   if ( "${MY_PYTHONPATH}" == "" ) then
+                       set MY_PYTHONPATH=${root_dir}/lib/python${python_version}/site-packages/salome
+                   else
+                       set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/python${python_version}/site-packages/salome
+                   endif
+               endif
+           endif
+           if ( "$mod" != "KERNEL" && "$mod" != "GUI" ) then
+               setenv LightAppConfig ${LightAppConfig}:${root_dir}/share/salome/resources/${mod_lower}
+           endif
+           if ( "${SALOMEPATH}" == "" ) then
+               setenv SALOMEPATH ${root_dir}
+           else
+               setenv SALOMEPATH ${SALOMEPATH}:${root_dir}
+           endif
+       endif
+    endif
+end
+
+if ( "${MY_PATH}" != "" ) setenv PATH ${MY_PATH}:${PATH}
+if ( "${MY_LD_LIBRARY_PATH}" != "" ) setenv LD_LIBRARY_PATH ${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+if ( "${PYTHONPATH}" != "" ) setenv PYTHONPATH ${MY_PYTHONPATH}:${PYTHONPATH}
+
+###
+# start application
+###
+
+SUITApp LightApp $* &
index df19ca7ba30d005bc9f87eb78b51cf0dfcbb36cb..8caaaa9165d44e1606378bdff7ea5e4b56861529 100755 (executable)
@@ -1,4 +1,8 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#!/bin/bash -f
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# File   : runLightSalome.sh
+# Author : Vadim SANDLER, Open CASCADE S.A.S, vadim.sandler@opencascade.com
+###
+# set default value for the LightAppConfig variable, which 
+# is necessary for loading of .ini or .xml resources file
+###
 #
-#!/bin/bash -f
-
-# this variable necessary for loading .ini or .xml file
 if [ -z "$LightAppConfig" ] ; then
   export LightAppConfig=${GUI_ROOT_DIR}/share/salome/resources/gui
+else
+  export LightAppConfig=${LightAppConfig}:${GUI_ROOT_DIR}/share/salome/resources/gui
 fi
 if [ -z "$LightAppResources" ] ; then
   export LightAppResources=${GUI_ROOT_DIR}/share/salome/resources/gui
+else
+  export LightAppResources=${LightAppResources}:${GUI_ROOT_DIR}/share/salome/resources/gui
 fi
 
-SUITApp LightApp -style salome $* &
+###
+# process --modules=... command line option (get list of modules)
+###
+
+modules=""
+
+for arg in X $* ; do
+    if [ "$arg" != "X" ] ; then
+       case $arg in
+           --modules=* )  modules=`echo $arg | awk -F= '{ print $2 }' | sed -e "s%,% %g"` ;;
+            *)             ;;
+        esac
+    fi
+done
+
+modules="KERNEL GUI $modules"
+
+###
+# exclude modules duplication
+###
+
+mods=""
+
+for mod in $modules ; do
+    echo $mods | grep -E "\<$mod\>" >/dev/null 2>&1
+    if [ "$?" == "1" ] ; then
+       mods="$mods $mod"
+    fi
+done
+
+###
+# set additional environment
+###
+
+python_version=`python -c "import sys; print sys.version[:3]" 2>/dev/null`
+
+MY_PATH=""
+MY_LD_LIBRARY_PATH=""
+MY_PYTHONPATH=""
+
+for mod in $mods ; do
+    if [ "$arg" != "X" ] ; then
+       root_dir=`printenv ${mod}_ROOT_DIR`
+       if [ "$root_dir" != "" ] ; then
+           mod_lower=`echo $mod | tr "A-Z" "a-z"`
+           if [ -d ${root_dir}/bin/salome ] ; then
+               if [ "${MY_PATH}" == "" ] ; then
+                   MY_PATH=${root_dir}/bin/salome
+               else
+                   MY_PATH=${MY_PATH}:${root_dir}/bin/salome
+               fi
+           fi
+           if [ -d ${root_dir}/lib/salome ] ; then
+               if [ "${MY_LD_LIBRARY_PATH}" == "" ] ; then
+                   MY_LD_LIBRARY_PATH=${root_dir}/lib/salome
+               else
+                   MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${root_dir}/lib/salome
+               fi
+           fi
+           if [ "${python_version}" != "" ] ; then
+               if [ -d ${root_dir}/bin/salome ] ; then
+                   if [ "${MY_PYTHONPATH}" == "" ] ; then
+                       MY_PYTHONPATH=${root_dir}/bin/salome
+                   else
+                       MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/bin/salome
+                   fi
+               fi
+               if [ -d ${root_dir}/lib/salome ] ; then
+                   if [ "${MY_PYTHONPATH}" == "" ] ; then
+                       MY_PYTHONPATH=${root_dir}/lib/salome
+                   else
+                       MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/salome
+                   fi
+               fi
+               if [ -d ${root_dir}/lib/python${python_version}/site-packages/salome ] ; then 
+                   if [ "${MY_PYTHONPATH}" == "" ] ; then
+                       MY_PYTHONPATH=${root_dir}/lib/python${python_version}/site-packages/salome
+                   else
+                       MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/python${python_version}/site-packages/salome
+                   fi
+               fi
+           fi
+           if [ "$mod" != "KERNEL" ] && [ "$mod" != "GUI" ] ; then
+               export LightAppConfig=${LightAppConfig}:${root_dir}/share/salome/resources/${mod_lower}
+           fi
+           if [ "${SALOMEPATH}" == "" ] ; then
+               export SALOMEPATH=${root_dir}
+           else
+               export SALOMEPATH=${SALOMEPATH}:${root_dir}
+           fi
+       fi
+    fi
+done
+
+if [ "${MY_PATH}" != "" ] ; then
+    export PATH=${MY_PATH}:${PATH}
+fi
+if [ "${MY_LD_LIBRARY_PATH}" != "" ] ; then
+    export LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+fi
+if [ "${PYTHONPATH}" != "" ] ; then
+    export PYTHONPATH=${MY_PYTHONPATH}:${PYTHONPATH}
+fi
+
+###
+# start application
+###
+
+SUITApp LightApp $* &
diff --git a/build_cmake b/build_cmake
new file mode 100755 (executable)
index 0000000..844a4f2
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+CURRENT_DIR=`pwd`
+CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
+cd ${CONF_DIR}
+python $KERNEL_ROOT_DIR/salome_adm/cmake_files/am2cmake.py --gui
+status=$?
+cd ${CURRENT_DIR}
+exit $status
diff --git a/build_cmake.bat b/build_cmake.bat
new file mode 100644 (file)
index 0000000..58a10b0
--- /dev/null
@@ -0,0 +1,2 @@
+\r
+%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --gui\r
index 733a8cea69bde22bdb1fcec1f67a5be6fd7dfb71..1fc78886f7820f64681a92c05c8fcb039526b729 100755 (executable)
@@ -1,16 +1,33 @@
 #!/bin/bash
-
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # Tool for updating list of .in file for the SALOME project
 # and regenerating configure script
-#
 # Author : Marc Tajchman - CEA
 # Date : 10/10/2002
 # $Header$
-#
 # 26/10/2006: Mikhail PONIKAROV - OCN
 # Reorganization for uage of autotools
-
+#
 ORIG_DIR=`pwd`
 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
 
@@ -53,8 +70,8 @@ cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
 #   autom4te.cache (directory)
 echo "====================================================== aclocal"
 
-aclocal -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-        -I adm_local/unix/config_files  || exit 1
+aclocal -I adm_local/unix/config_files \
+        -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files || exit 1
 
 # ____________________________________________________________________
 # libtoolize creates some configuration files (ltmain.sh,
index be0b5427f39955a0e5a4704b1b5c9b22605fde78..f57f7b3bf98d03cab5f0acc1a75b80d039d61886 100755 (executable)
@@ -1,5 +1,25 @@
 #!/bin/sh
-
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 rm -rf autom4te.cache aclocal.m4 configure make_config
 find . -name "*~" -print -exec rm {} \;
 find . -name "*.pyc" -print -exec rm {} \;
index a1ec14bbfe5b913f1e5638e2ae03f14d3ebb88a0..d8f8664f27078b736ee6cee1eae8c5a370506ad7 100644 (file)
@@ -1,3 +1,23 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # Author : Marc Tajchman (CEA)
 # Date : 28/06/2001
@@ -5,9 +25,7 @@
 # Modified by : Marc Tajchman (CEA)
 # Modified by : Mikhail PONIKAROV (OCN) - autotools usage
 #
-# Created from configure.in.base
-#
-AC_INIT([Salome2 Project GUI module], [4.1.1], [webmaster.salome@opencascade.com], [salome])
+AC_INIT([Salome2 Project GUI module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeGUI])
 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
@@ -82,7 +100,9 @@ if test "x${enable_qxGraphViewer}" != "xno" ; then
 else 
     DISABLE_QXGRAPHVIEWER="yes"
 fi
-
+dnl THIS IS A TEMPORARY SOLUTION BECAUSE QXGRAPH NOT YET PORTING TO QT4
+dnl AFTER PORTING QXGARPH TO QT4 THE STRING BELOW HAVE TO BE REMOVED
+DISABLE_QXGRAPHVIEWER="yes"
 
 dnl
 dnl Initialize source and build root directories
@@ -297,14 +317,6 @@ echo
 
 CHECK_QT
 
-echo
-echo ---------------------------------------------
-echo testing msg2qm
-echo ---------------------------------------------
-echo
-
-CHECK_MSG2QM
-
 echo
 echo ---------------------------------------------
 echo testing VTK
@@ -361,6 +373,8 @@ echo
 
 CHECK_QWT
 
+CHECK_TESTRECORDER
+
 echo
 echo ---------------------------------------------
 echo Testing PyConsole
@@ -462,10 +476,12 @@ if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
     echo "failed : for full configuration of GUI module necessary enable SalomeObject !"
     exit
   fi
-  if test "x${DISABLE_QXGRAPHVIEWER}" == "xyes" ; then
-    echo "failed : for full configuration of GUI module necessary enable QxGraphViewer !"
-    exit
-  fi
+  dnl THIS IS A TEMPORARY SOLUTION BECAUSE QXGRAPH NOT YET PORTING TO QT4
+  dnl AFTER PORTING QXGARPH TO QT4 THE FOLLOWING CHECK HAVE TO BE UNCOMMENTED
+  dnl if test "x${DISABLE_QXGRAPHVIEWER}" == "xyes" ; then
+  dnl   echo "failed : for full configuration of GUI module necessary enable QxGraphViewer !"
+  dnl   exit
+  dnl fi
 fi
 
 echo
@@ -513,10 +529,10 @@ fi
 
 
 if test "$GUI_DISABLE_CORBA" != "yes"; then
-variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok msg2qm_ok vtk_ok hdf5_ok
-omniORB_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok"
+variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok
+omniORB_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok libxml_ok Kernel_ok"
 else
-variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok msg2qm_ok vtk_ok hdf5_ok boost_ok
+variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok boost_ok
 occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok"
 fi
 
@@ -527,7 +543,7 @@ do
 done
 
 echo "---Optional:"
-variables="cppunit_ok"
+variables="cppunit_ok TestRecorder_ok"
 
 for var in $variables
 do
@@ -561,32 +577,7 @@ AM_CONDITIONAL(ENABLE_OCCVIEWER, [test "$DISABLE_OCCVIEWER" = no])
 AM_CONDITIONAL(ENABLE_VTKVIEWER, [test "$DISABLE_VTKVIEWER" = no])
 AM_CONDITIONAL(ENABLE_SALOMEOBJECT, [test "$DISABLE_SALOMEOBJECT" = no])
 AM_CONDITIONAL(ENABLE_QXGRAPHVIEWER, [test "$DISABLE_QXGRAPHVIEWER" = no])
-
-echo
-echo ---------------------------------------------
-echo copying resource files, shell scripts, and
-echo xml files
-echo ---------------------------------------------
-echo
-
-
-dnl copy shells and utilities contained in the bin directory
-dnl excluding .in files (treated in AC-OUTPUT below) and CVS
-dnl directory
-
-mkdir -p bin/salome
-cd bin/salome
-
-for i in $ROOT_SRCDIR/bin/*
-do
-  local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
-  case "$local_bin" in
-        *.in | *~)                    ;;
-        ./bin/CVS | ./bin/salome)                    ;;
-        *) $INSTALL $i . ; echo $local_bin ;;
-  esac
-done
-cd $ROOT_BUILDDIR
+AM_CONDITIONAL(ENABLE_TESTRECORDER, [test "$ENABLE_TESTRECORDER" = yes])
 
 echo
 echo ---------------------------------------------
@@ -594,10 +585,10 @@ echo generating Makefiles and configure files
 echo ---------------------------------------------
 echo
 
-AC_OUTPUT_COMMANDS([ \
-  chmod +x ./bin/*; \
-  chmod +x ./bin/salome/*; \
-])
+#AC_OUTPUT_COMMANDS([ \
+#  chmod +x ./bin/*; \
+#  chmod +x ./bin/salome/*; \
+#])
 
 # This list is initiated using autoscan and must be updated manually
 # when adding a new file <filename>.in to manage. When you execute
@@ -606,6 +597,7 @@ AC_OUTPUT_COMMANDS([ \
 AC_OUTPUT([ \
   ./salome_adm/unix/SALOMEconfig.h \
   ./adm_local/Makefile \
+  ./adm_local/cmake_files/Makefile \
   ./adm_local/unix/Makefile \
   ./adm_local/unix/config_files/Makefile \
   ./bin/VERSION \
@@ -614,9 +606,9 @@ AC_OUTPUT([ \
   ./doc/Makefile \
   ./doc/salome/Makefile \
   ./doc/salome/gui/Makefile \
-  ./doc/salome/gui/GUI/doxyfile \
+  ./doc/salome/gui/doxyfile \
   ./doc/salome/tui/Makefile \
-  ./doc/salome/tui/GUI/doxyfile \
+  ./doc/salome/tui/doxyfile \
   ./src/Makefile \
   ./src/CASCatch/Makefile \
   ./src/Qtx/Makefile \
@@ -638,14 +630,14 @@ AC_OUTPUT([ \
   ./src/OCCViewer/Makefile \
   ./src/SOCC/Makefile \
   ./src/PyInterp/Makefile \
-  ./src/PythonConsole/Makefile \
+  ./src/PyConsole/Makefile \
   ./src/Plot2d/Makefile \
   ./src/SPlot2d/Makefile \
   ./src/SUPERVGraph/Makefile \
   ./src/QxGraph/Makefile \
+  ./src/QxScene/Makefile \
   ./src/LightApp/Makefile \
   ./src/ResExporter/Makefile \
-  ./src/RegistryDisplay/Makefile \
   ./src/TOOLSGUI/Makefile \
   ./src/Event/Makefile \
   ./src/Session/Makefile \
@@ -657,7 +649,6 @@ AC_OUTPUT([ \
   ./src/SALOME_PY/Makefile \
   ./src/SALOME_PYQT/Makefile \
   ./src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile \
-  ./src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_SipDefs.h \
   ./src/SALOME_PYQT/SalomePyQt/Makefile \
   ./resources/Makefile \
   ./idl/Makefile \
index 6a2c2428b3e5fe8dacaee457a723779176759e4a..7ab931dd60a489f2c969fa1c8d0974edd8393e3e 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
 # -* Makefile *- 
-#
 # Author : Patrick GOLDBRONN (CEA)
 # Date : 30/11/2001
 # $Header$
 #
+SUBDIRS = salome
+
+usr_docs:
+       (cd salome && $(MAKE) $(AM_MAKEFLAGS) usr_docs)
+
+docs: usr_docs
 
-SUBDIRS= salome
+dev_docs:
+       (cd salome && $(MAKE) $(AM_MAKEFLAGS) dev_docs)
index 29f7e1854ce9be2c1d172690e4e8a1635ea2c26c..7fce292871455cd8f99460d387146e3d70c0fe85 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
 # -* Makefile *- 
-#
 # Author : Patrick GOLDBRONN (CEA)
 # Date : 30/11/2001
 # $Header$
 #
-
-SUBDIRS= tui gui
-SUBDIRSTUI= tui
-SUBDIRSGUI= gui
+SUBDIRS = tui gui
+SUBDIRSTUI = tui
+SUBDIRSGUI = gui
 
 usr_docs:
        @@SETX@; for d in $(SUBDIRSGUI); do     \
diff --git a/doc/salome/gui/GUI/doxyfile.in b/doc/salome/gui/GUI/doxyfile.in
deleted file mode 100755 (executable)
index dfb7f36..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME      = "GUI Module Reference Manual v.@VERSION@"
-OUTPUT_DIRECTORY  = ./
-CREATE_SUBDIRS   = NO
-OUTPUT_LANGUAGE   = English
-TAB_SIZE          = 5
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET             = NO
-WARNINGS          = YES
-
-#---------------------------------------------------------------------------
-#Input related options
-#---------------------------------------------------------------------------
-INPUT             = @srcdir@/input               
-FILE_PATTERNS     = *.doc
-IMAGE_PATH        = @srcdir@/images
-
-#---------------------------------------------------------------------------
-#HTML related options
-#---------------------------------------------------------------------------
-GENERATE_HTML     = YES
-HTML_OUTPUT       = ./
-HTML_HEADER       = @srcdir@/static/header.html
-HTML_FOOTER       = @srcdir@/static/footer.html
-#HTML_STYLESHEET  = @srcdir@/static/doxygen.css
-TOC_EXPAND        = YES
-DISABLE_INDEX     = NO
-GENERATE_TREEVIEW = YES
-TREEVIEW_WIDTH    = 300
-
-#---------------------------------------------------------------------------
-#LaTeX related option
-#---------------------------------------------------------------------------
-GENERATE_LATEX    = NO
-
-#---------------------------------------------------------------------------
-#RTF related options
-#---------------------------------------------------------------------------
-GENERATE_RTF      = NO
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/images/batchmode.png b/doc/salome/gui/GUI/images/batchmode.png
deleted file mode 100644 (file)
index c439d7e..0000000
Binary files a/doc/salome/gui/GUI/images/batchmode.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/cataloggenerator.png b/doc/salome/gui/GUI/images/cataloggenerator.png
deleted file mode 100755 (executable)
index 51a0f27..0000000
Binary files a/doc/salome/gui/GUI/images/cataloggenerator.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/choicepage.png b/doc/salome/gui/GUI/images/choicepage.png
deleted file mode 100644 (file)
index e3afcc5..0000000
Binary files a/doc/salome/gui/GUI/images/choicepage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/clipping.png b/doc/salome/gui/GUI/images/clipping.png
deleted file mode 100644 (file)
index 6d73855..0000000
Binary files a/doc/salome/gui/GUI/images/clipping.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/closestudy.png b/doc/salome/gui/GUI/images/closestudy.png
deleted file mode 100755 (executable)
index fb7abe1..0000000
Binary files a/doc/salome/gui/GUI/images/closestudy.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/copy-paste.jpg b/doc/salome/gui/GUI/images/copy-paste.jpg
deleted file mode 100755 (executable)
index e243122..0000000
Binary files a/doc/salome/gui/GUI/images/copy-paste.jpg and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/dumpstudy.png b/doc/salome/gui/GUI/images/dumpstudy.png
deleted file mode 100755 (executable)
index f899e77..0000000
Binary files a/doc/salome/gui/GUI/images/dumpstudy.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/geomview-alt.png b/doc/salome/gui/GUI/images/geomview-alt.png
deleted file mode 100755 (executable)
index e797b08..0000000
Binary files a/doc/salome/gui/GUI/images/geomview-alt.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/graduatedaxes1.png b/doc/salome/gui/GUI/images/graduatedaxes1.png
deleted file mode 100644 (file)
index cf021ba..0000000
Binary files a/doc/salome/gui/GUI/images/graduatedaxes1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/icon_about.png b/doc/salome/gui/GUI/images/icon_about.png
deleted file mode 100755 (executable)
index 0cfa37a..0000000
Binary files a/doc/salome/gui/GUI/images/icon_about.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image100.gif b/doc/salome/gui/GUI/images/image100.gif
deleted file mode 100644 (file)
index c44d68f..0000000
Binary files a/doc/salome/gui/GUI/images/image100.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image102.gif b/doc/salome/gui/GUI/images/image102.gif
deleted file mode 100644 (file)
index 3507814..0000000
Binary files a/doc/salome/gui/GUI/images/image102.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image103.gif b/doc/salome/gui/GUI/images/image103.gif
deleted file mode 100644 (file)
index be534c3..0000000
Binary files a/doc/salome/gui/GUI/images/image103.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image105.gif b/doc/salome/gui/GUI/images/image105.gif
deleted file mode 100644 (file)
index 4f6173f..0000000
Binary files a/doc/salome/gui/GUI/images/image105.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image106.gif b/doc/salome/gui/GUI/images/image106.gif
deleted file mode 100644 (file)
index 2bbcb4d..0000000
Binary files a/doc/salome/gui/GUI/images/image106.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image108.gif b/doc/salome/gui/GUI/images/image108.gif
deleted file mode 100644 (file)
index bec69e6..0000000
Binary files a/doc/salome/gui/GUI/images/image108.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image109.gif b/doc/salome/gui/GUI/images/image109.gif
deleted file mode 100644 (file)
index 5dbba46..0000000
Binary files a/doc/salome/gui/GUI/images/image109.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image157.gif b/doc/salome/gui/GUI/images/image157.gif
deleted file mode 100644 (file)
index 2f66e05..0000000
Binary files a/doc/salome/gui/GUI/images/image157.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image54.jpg b/doc/salome/gui/GUI/images/image54.jpg
deleted file mode 100755 (executable)
index a67ac4c..0000000
Binary files a/doc/salome/gui/GUI/images/image54.jpg and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image65.gif b/doc/salome/gui/GUI/images/image65.gif
deleted file mode 100755 (executable)
index fbf6a81..0000000
Binary files a/doc/salome/gui/GUI/images/image65.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image67.gif b/doc/salome/gui/GUI/images/image67.gif
deleted file mode 100755 (executable)
index 4c5d4d6..0000000
Binary files a/doc/salome/gui/GUI/images/image67.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image69.gif b/doc/salome/gui/GUI/images/image69.gif
deleted file mode 100755 (executable)
index f8ea563..0000000
Binary files a/doc/salome/gui/GUI/images/image69.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image70.gif b/doc/salome/gui/GUI/images/image70.gif
deleted file mode 100755 (executable)
index c88c53e..0000000
Binary files a/doc/salome/gui/GUI/images/image70.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image72.gif b/doc/salome/gui/GUI/images/image72.gif
deleted file mode 100755 (executable)
index 77c21bd..0000000
Binary files a/doc/salome/gui/GUI/images/image72.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image73.gif b/doc/salome/gui/GUI/images/image73.gif
deleted file mode 100755 (executable)
index 0ebcf97..0000000
Binary files a/doc/salome/gui/GUI/images/image73.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image75.gif b/doc/salome/gui/GUI/images/image75.gif
deleted file mode 100755 (executable)
index 9fdfbdc..0000000
Binary files a/doc/salome/gui/GUI/images/image75.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image77.gif b/doc/salome/gui/GUI/images/image77.gif
deleted file mode 100644 (file)
index ef7a62f..0000000
Binary files a/doc/salome/gui/GUI/images/image77.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image86.gif b/doc/salome/gui/GUI/images/image86.gif
deleted file mode 100644 (file)
index 3397331..0000000
Binary files a/doc/salome/gui/GUI/images/image86.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image88.gif b/doc/salome/gui/GUI/images/image88.gif
deleted file mode 100644 (file)
index 9466aa6..0000000
Binary files a/doc/salome/gui/GUI/images/image88.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image89.gif b/doc/salome/gui/GUI/images/image89.gif
deleted file mode 100644 (file)
index 373a6c0..0000000
Binary files a/doc/salome/gui/GUI/images/image89.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image91.gif b/doc/salome/gui/GUI/images/image91.gif
deleted file mode 100644 (file)
index 9e93c1c..0000000
Binary files a/doc/salome/gui/GUI/images/image91.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image94.gif b/doc/salome/gui/GUI/images/image94.gif
deleted file mode 100755 (executable)
index e2d310c..0000000
Binary files a/doc/salome/gui/GUI/images/image94.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image95.gif b/doc/salome/gui/GUI/images/image95.gif
deleted file mode 100644 (file)
index fb293e2..0000000
Binary files a/doc/salome/gui/GUI/images/image95.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image96.gif b/doc/salome/gui/GUI/images/image96.gif
deleted file mode 100644 (file)
index 4580d5b..0000000
Binary files a/doc/salome/gui/GUI/images/image96.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image97.gif b/doc/salome/gui/GUI/images/image97.gif
deleted file mode 100644 (file)
index 1d78de1..0000000
Binary files a/doc/salome/gui/GUI/images/image97.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image98.gif b/doc/salome/gui/GUI/images/image98.gif
deleted file mode 100644 (file)
index 6519dbb..0000000
Binary files a/doc/salome/gui/GUI/images/image98.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/image99.gif b/doc/salome/gui/GUI/images/image99.gif
deleted file mode 100644 (file)
index 3711be8..0000000
Binary files a/doc/salome/gui/GUI/images/image99.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/import.png b/doc/salome/gui/GUI/images/import.png
deleted file mode 100755 (executable)
index 093c667..0000000
Binary files a/doc/salome/gui/GUI/images/import.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/intropage.png b/doc/salome/gui/GUI/images/intropage.png
deleted file mode 100644 (file)
index 226793c..0000000
Binary files a/doc/salome/gui/GUI/images/intropage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/loadscript.png b/doc/salome/gui/GUI/images/loadscript.png
deleted file mode 100755 (executable)
index e681fc7..0000000
Binary files a/doc/salome/gui/GUI/images/loadscript.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/loadstudy2.png b/doc/salome/gui/GUI/images/loadstudy2.png
deleted file mode 100755 (executable)
index 595ea05..0000000
Binary files a/doc/salome/gui/GUI/images/loadstudy2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/lockedstudy.png b/doc/salome/gui/GUI/images/lockedstudy.png
deleted file mode 100755 (executable)
index 9ec7e74..0000000
Binary files a/doc/salome/gui/GUI/images/lockedstudy.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/neo-view2.png b/doc/salome/gui/GUI/images/neo-view2.png
deleted file mode 100755 (executable)
index df1c7fe..0000000
Binary files a/doc/salome/gui/GUI/images/neo-view2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/newsticn.jpg b/doc/salome/gui/GUI/images/newsticn.jpg
deleted file mode 100755 (executable)
index 94c8ee9..0000000
Binary files a/doc/salome/gui/GUI/images/newsticn.jpg and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/note1.gif b/doc/salome/gui/GUI/images/note1.gif
deleted file mode 100755 (executable)
index b53e21d..0000000
Binary files a/doc/salome/gui/GUI/images/note1.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/objectbrowser1.png b/doc/salome/gui/GUI/images/objectbrowser1.png
deleted file mode 100755 (executable)
index 16ab896..0000000
Binary files a/doc/salome/gui/GUI/images/objectbrowser1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/objectbrowser2.png b/doc/salome/gui/GUI/images/objectbrowser2.png
deleted file mode 100755 (executable)
index e010ef2..0000000
Binary files a/doc/salome/gui/GUI/images/objectbrowser2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/open.jpg b/doc/salome/gui/GUI/images/open.jpg
deleted file mode 100755 (executable)
index 5829aef..0000000
Binary files a/doc/salome/gui/GUI/images/open.jpg and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/plot2d_clone.gif b/doc/salome/gui/GUI/images/plot2d_clone.gif
deleted file mode 100644 (file)
index f980a5d..0000000
Binary files a/doc/salome/gui/GUI/images/plot2d_clone.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/plot2d_legend.gif b/doc/salome/gui/GUI/images/plot2d_legend.gif
deleted file mode 100644 (file)
index a40211e..0000000
Binary files a/doc/salome/gui/GUI/images/plot2d_legend.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/plot2d_lines.gif b/doc/salome/gui/GUI/images/plot2d_lines.gif
deleted file mode 100644 (file)
index 8d1dc23..0000000
Binary files a/doc/salome/gui/GUI/images/plot2d_lines.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/plot2d_logarithmic_horizontal.gif b/doc/salome/gui/GUI/images/plot2d_logarithmic_horizontal.gif
deleted file mode 100644 (file)
index 3473ad9..0000000
Binary files a/doc/salome/gui/GUI/images/plot2d_logarithmic_horizontal.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/plot2d_logarithmic_vertical.gif b/doc/salome/gui/GUI/images/plot2d_logarithmic_vertical.gif
deleted file mode 100644 (file)
index 0d3b25e..0000000
Binary files a/doc/salome/gui/GUI/images/plot2d_logarithmic_vertical.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/plot2d_points.gif b/doc/salome/gui/GUI/images/plot2d_points.gif
deleted file mode 100644 (file)
index 6700f00..0000000
Binary files a/doc/salome/gui/GUI/images/plot2d_points.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/plot2d_settings.gif b/doc/salome/gui/GUI/images/plot2d_settings.gif
deleted file mode 100644 (file)
index 87e1105..0000000
Binary files a/doc/salome/gui/GUI/images/plot2d_settings.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/plot2d_splines.gif b/doc/salome/gui/GUI/images/plot2d_splines.gif
deleted file mode 100644 (file)
index 1d50b20..0000000
Binary files a/doc/salome/gui/GUI/images/plot2d_splines.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/plot2d_view_settings.png b/doc/salome/gui/GUI/images/plot2d_view_settings.png
deleted file mode 100644 (file)
index d4b4d29..0000000
Binary files a/doc/salome/gui/GUI/images/plot2d_view_settings.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/ppref1.png b/doc/salome/gui/GUI/images/ppref1.png
deleted file mode 100755 (executable)
index dd91013..0000000
Binary files a/doc/salome/gui/GUI/images/ppref1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/ppref2.png b/doc/salome/gui/GUI/images/ppref2.png
deleted file mode 100755 (executable)
index 5a15f0e..0000000
Binary files a/doc/salome/gui/GUI/images/ppref2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/ppref3.png b/doc/salome/gui/GUI/images/ppref3.png
deleted file mode 100755 (executable)
index 1ecffe3..0000000
Binary files a/doc/salome/gui/GUI/images/ppref3.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref11.png b/doc/salome/gui/GUI/images/pref11.png
deleted file mode 100755 (executable)
index 26ddbe9..0000000
Binary files a/doc/salome/gui/GUI/images/pref11.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref12.png b/doc/salome/gui/GUI/images/pref12.png
deleted file mode 100755 (executable)
index 8cafab8..0000000
Binary files a/doc/salome/gui/GUI/images/pref12.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref13.png b/doc/salome/gui/GUI/images/pref13.png
deleted file mode 100755 (executable)
index 4cfe950..0000000
Binary files a/doc/salome/gui/GUI/images/pref13.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref14.png b/doc/salome/gui/GUI/images/pref14.png
deleted file mode 100755 (executable)
index 2f8bcfb..0000000
Binary files a/doc/salome/gui/GUI/images/pref14.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref15.png b/doc/salome/gui/GUI/images/pref15.png
deleted file mode 100755 (executable)
index 10053fb..0000000
Binary files a/doc/salome/gui/GUI/images/pref15.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref21.png b/doc/salome/gui/GUI/images/pref21.png
deleted file mode 100755 (executable)
index 8f7ad1d..0000000
Binary files a/doc/salome/gui/GUI/images/pref21.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref22.png b/doc/salome/gui/GUI/images/pref22.png
deleted file mode 100755 (executable)
index 26921dc..0000000
Binary files a/doc/salome/gui/GUI/images/pref22.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref23.png b/doc/salome/gui/GUI/images/pref23.png
deleted file mode 100644 (file)
index e1a082a..0000000
Binary files a/doc/salome/gui/GUI/images/pref23.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref24.png b/doc/salome/gui/GUI/images/pref24.png
deleted file mode 100755 (executable)
index c539e9b..0000000
Binary files a/doc/salome/gui/GUI/images/pref24.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref31.png b/doc/salome/gui/GUI/images/pref31.png
deleted file mode 100755 (executable)
index e5606d1..0000000
Binary files a/doc/salome/gui/GUI/images/pref31.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref33.png b/doc/salome/gui/GUI/images/pref33.png
deleted file mode 100755 (executable)
index bdc9b76..0000000
Binary files a/doc/salome/gui/GUI/images/pref33.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref34.png b/doc/salome/gui/GUI/images/pref34.png
deleted file mode 100755 (executable)
index 5072c62..0000000
Binary files a/doc/salome/gui/GUI/images/pref34.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref37.png b/doc/salome/gui/GUI/images/pref37.png
deleted file mode 100755 (executable)
index 1d4d082..0000000
Binary files a/doc/salome/gui/GUI/images/pref37.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref38.png b/doc/salome/gui/GUI/images/pref38.png
deleted file mode 100755 (executable)
index 5c8d31c..0000000
Binary files a/doc/salome/gui/GUI/images/pref38.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref39.png b/doc/salome/gui/GUI/images/pref39.png
deleted file mode 100755 (executable)
index 878a526..0000000
Binary files a/doc/salome/gui/GUI/images/pref39.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/pref40.png b/doc/salome/gui/GUI/images/pref40.png
deleted file mode 100755 (executable)
index e86c1e2..0000000
Binary files a/doc/salome/gui/GUI/images/pref40.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/productpage.png b/doc/salome/gui/GUI/images/productpage.png
deleted file mode 100644 (file)
index bc05c8b..0000000
Binary files a/doc/salome/gui/GUI/images/productpage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/productpage1.png b/doc/salome/gui/GUI/images/productpage1.png
deleted file mode 100644 (file)
index b666166..0000000
Binary files a/doc/salome/gui/GUI/images/productpage1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/productpage2.png b/doc/salome/gui/GUI/images/productpage2.png
deleted file mode 100644 (file)
index 998d286..0000000
Binary files a/doc/salome/gui/GUI/images/productpage2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/progresspage.png b/doc/salome/gui/GUI/images/progresspage.png
deleted file mode 100644 (file)
index 0779fcc..0000000
Binary files a/doc/salome/gui/GUI/images/progresspage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/progresspage1.png b/doc/salome/gui/GUI/images/progresspage1.png
deleted file mode 100644 (file)
index efaa4d1..0000000
Binary files a/doc/salome/gui/GUI/images/progresspage1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/readmepage.png b/doc/salome/gui/GUI/images/readmepage.png
deleted file mode 100644 (file)
index b6aee29..0000000
Binary files a/doc/salome/gui/GUI/images/readmepage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/registry1.png b/doc/salome/gui/GUI/images/registry1.png
deleted file mode 100755 (executable)
index b8912c6..0000000
Binary files a/doc/salome/gui/GUI/images/registry1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/registry3.png b/doc/salome/gui/GUI/images/registry3.png
deleted file mode 100755 (executable)
index f44e2ec..0000000
Binary files a/doc/salome/gui/GUI/images/registry3.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/registry4.png b/doc/salome/gui/GUI/images/registry4.png
deleted file mode 100755 (executable)
index 98a3772..0000000
Binary files a/doc/salome/gui/GUI/images/registry4.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/save.jpg b/doc/salome/gui/GUI/images/save.jpg
deleted file mode 100755 (executable)
index 90001af..0000000
Binary files a/doc/salome/gui/GUI/images/save.jpg and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/selectcolor.png b/doc/salome/gui/GUI/images/selectcolor.png
deleted file mode 100755 (executable)
index 70800b2..0000000
Binary files a/doc/salome/gui/GUI/images/selectcolor.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/selectfont.png b/doc/salome/gui/GUI/images/selectfont.png
deleted file mode 100755 (executable)
index 04eff08..0000000
Binary files a/doc/salome/gui/GUI/images/selectfont.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/set_rotation_point_dialog1.png b/doc/salome/gui/GUI/images/set_rotation_point_dialog1.png
deleted file mode 100644 (file)
index bdab73b..0000000
Binary files a/doc/salome/gui/GUI/images/set_rotation_point_dialog1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/set_rotation_point_dialog2.png b/doc/salome/gui/GUI/images/set_rotation_point_dialog2.png
deleted file mode 100644 (file)
index 7f3696a..0000000
Binary files a/doc/salome/gui/GUI/images/set_rotation_point_dialog2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/studyproperties.png b/doc/salome/gui/GUI/images/studyproperties.png
deleted file mode 100755 (executable)
index af88317..0000000
Binary files a/doc/salome/gui/GUI/images/studyproperties.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/updaterate.png b/doc/salome/gui/GUI/images/updaterate.png
deleted file mode 100755 (executable)
index 4a6c299..0000000
Binary files a/doc/salome/gui/GUI/images/updaterate.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/urbutton.png b/doc/salome/gui/GUI/images/urbutton.png
deleted file mode 100755 (executable)
index d7c0841..0000000
Binary files a/doc/salome/gui/GUI/images/urbutton.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/view2.png b/doc/salome/gui/GUI/images/view2.png
deleted file mode 100755 (executable)
index 9d48a09..0000000
Binary files a/doc/salome/gui/GUI/images/view2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/images/view_rotation_point.png b/doc/salome/gui/GUI/images/view_rotation_point.png
deleted file mode 100644 (file)
index 7fe8f83..0000000
Binary files a/doc/salome/gui/GUI/images/view_rotation_point.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/input/about_salome.doc b/doc/salome/gui/GUI/input/about_salome.doc
deleted file mode 100644 (file)
index 4f132ab..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*!
-
-\page about_salome_page About SALOME
-
-<ul>
-<li>\subpage intro_to_salome_page</li>
-<li>\subpage salome_architecture_page</li>
-<li>\subpage installing_salome_page "Installing SALOME"</li>
-<li>\subpage running_salome_page</li>
-</ul>
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/creating_new_study.doc b/doc/salome/gui/GUI/input/creating_new_study.doc
deleted file mode 100644 (file)
index 3c4d0e3..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*!
-
-\page creating_new_study_page Creating a new study
-
-Study is a document within GUI, an abstraction layer between actual
-document data (probably, remote data available through CORBA) and data
-presentation (in the Object Browser). It contains a tree of Data
-Object instances.
-
-<em>To create a new study:</em>
-
-\par 
-From the main menu select <b>File > New</b> or in the standard toolbar
-click "New document" button.
-
-\image html newsticn.jpg "&quot;New document&quot; button"
-
-Your study will be created with default name \b Study1. In SALOME you
-can create several studies.
-
-In addition to it, you can create several windows with different
-activated viewers (VTK, OCC, Plot2d) for each study.
-
-<em>To create a new window for a definite study:</em>
-<ol>
-<li>Make your study \b active: maximize it (if it minimized) or  click on
-the top control zone of the study window.
-</li>
-<li>\n From the main menu select <b>Window > New Window</b> and from the submenu
-choose the viewer, which will be activated in a new window.
-</li>
-</ol>
-
-The window for your study will be created with a default name \b Study1.
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/displaying_studies.doc b/doc/salome/gui/GUI/input/displaying_studies.doc
deleted file mode 100644 (file)
index b45a8ed..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*!
-
-\page displaying_studies_page Displaying studies
-
-Starting from SALOME version 3.0.0. you are able to work in a
-multi-desktop environment, which means that you can open as many
-studies as you need, place them wherever you wish on the desktop, in
-brief, work with Salome Platform like with a normal Windows
-application.
-\n Such windows as Object Browser and Python Console are dockable and
-also can be placed at any part of the desktop.
-\n Only one study window in representation area can be active. You can
-change their size and move any windows between representation
-areas. When an area becomes empty, it is not displayed.
-\n All windows are placed inside tabs where you can switch between
-them. If there are several windows (viewers) in your current study and
-you want to display more then one at the same time, you can split
-representation area into two parts, in horizontal or vertical
-direction, to create two representation areas with windows be placed
-in them. To do this, right-click on the tab and select <b>Split
-Vertically</b> or <b>Split Horizontally</b>.
-
-For example, on this screen-shot the active zone has been split
-horizontally to be able to work with OCC and VTK viewers
-simultaneously, the one of the windows was split again, at this time
-vertically to see Plot 2d graphs.
-
-\image html neo-view2.png
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/editing_studies.doc b/doc/salome/gui/GUI/input/editing_studies.doc
deleted file mode 100644 (file)
index cafc03e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*!
-
-\page editing_studies_page Editing studies
-
-\b SALOME has \b Copy/Paste functionality allowing to edit your study
-within a definite component:
-
-<em>To copy/paste a definite object:</em>
-\par
-In the main toolbar click "Copy"/"Paste" button or from the main menu
-choose <b>Edit > Copy/Paste</b> option. 
-
-\image html copy-paste.jpg "&quot;Copy&quot; and &quot;Paste&quot; buttons"
-
-\n The availability of \b Copy/Paste operations depends on the module and
-the nature of an operation or an object, so if the module does not
-provide this functionality, it won't be available.
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/geometry_preferences.doc b/doc/salome/gui/GUI/input/geometry_preferences.doc
deleted file mode 100644 (file)
index 651ef2e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*!
-
-\page geometry_preferences_page Geometry preferences
-
-In the \b Geometry module you can set preferences for visualisation of
-geometrical figures which can be used in later sessions with this
-module.
-
-\image html pref15.png
-
-\par
-For all color definitions click on the respective line to access to
-the \ref select_color_and_font_page "Select Color" dialog box.
-
-<ul>
-<li><b>General</b></li>
-<ul>
-<li><b>Default Display Mode</b> - allows to choose between wireframe
-or shading.<li>
-<li><b>Default Shading Color</b> - allows to select default shading
-color.<li>
-<li><b> Default Wireframe Color</b> - allows to select default
-wireframe color (to be applied to any lines not being free boundaries
-or isolated lines).<li>
-<li><b>Color of free boundaries</b> - allows to select default color for free boundaries.<li>
-<li><b>Color of edges, vectors and wires</b> - allows to select
-default color for edges, vectors and wires (isolated lines).<li>
-<li><b>Color of points</b> - allows to select default color for
-vertices.<li>
-<li><b>Color of isolines</b> - allows to select default color for
-isolines.<li>
-<li><b>Step Value for Spin Boxes</b> - allows to define the increment
-of values set in spin boxes.<li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Marker of Points</b></li>
-<ul>
-<li><b>Type</b> - allows to select the symbol for representation of
-points (cross, asterisk, etc.).</li>
-<li><b>Size</b> - allows to define the size of the marker from 1
-(smallest) to 7 (largest).</li>
-</ul>
-</ul>
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/getting_started.doc b/doc/salome/gui/GUI/input/getting_started.doc
deleted file mode 100644 (file)
index a068735..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*!
-
-\page getting_started_page Getting started
-
-When you start the SALOME Platform, the following initial desktop window appears:
-
-\image html view2.png
-
-&nbsp;&nbsp;&nbsp;&nbsp;In general, the SALOME platform is destined
-for performance of different numerical calculations and  visualization
-of the resulting data. For that purpose, in the SALOME environment the
-following notion is used  - \b Study.
-<br>Study represents a working document in which you can realize all
-operations connected with the SALOME functionality. 
-<br>SALOME is a multi-study platform. It means that simultaneously you can
-work with several studies. 
-
-\note To proceed working in SALOME you should create or open a new study.     
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/gui_module_chapter.doc b/doc/salome/gui/GUI/input/gui_module_chapter.doc
deleted file mode 100644 (file)
index 3d4f43c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*!
-
-\page gui_module_page GUI module
-
-<ul>
-<li>\subpage introduction_to_gui_page</li>
-<li>\subpage getting_started_page</li>
-<li>\subpage salome_desktop_page</li>
-<li>\subpage study_management_page</li>
-<ul>
-<li>\ref creating_new_study_page</li>
-<li>\ref opening_studies_page</li>
-<li>\ref saving_and_closing_studies_page</li>
-<li>\ref editing_studies_page</li>
-<li>\ref displaying_studies_page</li>
-<li>\ref working_with_python_scripts_page</li>
-<li>\ref setting_study_properties_page</li>
-</ul>
-<li>\subpage using_object_browser_page</li>
-<li>\subpage using_registry_tool_page</li>
-<li>\subpage using_catalog_generator_page "Using Catalog Generator"</li>
-<li>\subpage viewers_page</li>
-<ul>
-<li>\ref occ_3d_viewer_page</li>
-<li>\ref vtk_3d_viewer_page</li>
-<li>\ref plot2d_viewer_page</li>
-</ul>
-<li>\subpage setting_preferences_page</li>
-<ul>
-<li>\ref setting_preferences_subpage</li>
-<li>\ref select_color_and_font_page</li>
-<li>\ref salome_preferences_page</li>
-<li>\ref geometry_preferences_page</li>
-<li>\ref mesh_preferences_page</li>
-<li>\ref postpro_preferences_page</li>
-</ul>
-</ul>
-
-*/
diff --git a/doc/salome/gui/GUI/input/index.doc b/doc/salome/gui/GUI/input/index.doc
deleted file mode 100644 (file)
index 1f340a4..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*!
-
-\mainpage GUI Module Reference Documentation
-
-<ul>
-<li>\subpage introduction_page</li>
-<li>\subpage about_salome_page</li>
-<ul>
-<li>\ref intro_to_salome_page</li>
-<li>\ref salome_architecture_page</li>
-<li>\ref installing_salome_page</li>
-<li>\ref running_salome_page</li>
-</ul>
-<li>\subpage gui_module_page "GUI module"</li>
-<ul>
-<li>\ref introduction_to_gui_page</li>
-<li>\ref getting_started_page</li>
-<li>\ref salome_desktop_page</li>
-<li>\ref study_management_page</li>
-<ul>
-<li>\ref creating_new_study_page</li>
-<li>\ref opening_studies_page</li>
-<li>\ref saving_and_closing_studies_page</li>
-<li>\ref editing_studies_page</li>
-<li>\ref displaying_studies_page</li>
-<li>\ref working_with_python_scripts_page</li>
-<li>\ref setting_study_properties_page</li>
-</ul>
-</ul>
-<li>\ref using_object_browser_page</li>
-<li>\ref using_registry_tool_page</li>
-<li>\ref using_catalog_generator_page "Using Catalog Generator"</li>
-<li>\ref viewers_page</li>
-<ul>
-<li>\ref occ_3d_viewer_page</li>
-<li>\ref vtk_3d_viewer_page</li>
-<li>\ref plot2d_viewer_page</li>
-</ul>
-<li>\ref setting_preferences_page</li>
-<ul>
-<li>\ref setting_preferences_subpage</li>
-<li>\ref select_color_and_font_page</li>
-<li>\ref salome_preferences_page</li>
-<li>\ref geometry_preferences_page</li>
-<li>\ref mesh_preferences_page</li>
-<li>\ref postpro_preferences_page</li>
-</ul>
-</ul>
-
-
-*/
diff --git a/doc/salome/gui/GUI/input/installing_salome.doc b/doc/salome/gui/GUI/input/installing_salome.doc
deleted file mode 100644 (file)
index e0f26af..0000000
+++ /dev/null
@@ -1,961 +0,0 @@
-/*!
-
-\page installing_salome_page SALOME Installation Wizard Help
-
-<hr>
-<ul>
-<li>\ref installing_products "Installing products with the Installation Wizard"
-<ul>
-<li>\ref gui_mode_install "GUI mode"
-<li>\ref batch_mode_install "Batch mode"
-<li>\ref environment_files "Environment files"
-</ul>
-<li>\ref notes_on_check "Notes on check products version procedure"
-<li>\ref pick_up_env "Pick up the environment"
-<li>\ref modifying_xml "Modifying XML configuration file"
-<li>\ref installation_scripts "Implementing installation scripts for the new products"
-<li>\ref finish_buttons "Customizing Readme page buttons"
-</ul>
-<hr>
-\anchor installing_products 
-<h1>Installing products with the <em>Installation Wizard</em></h1>
-
-The Installation Wizard can be launched in two modes: \b GUI and \b
-batch.
-<br>The root directory of the Installation Wizard contains Python
-script \b runInstall. To run the Installation Wizard just type \b runInstall.
-in the terminal window:
-<br><br>[ python ] \b runInstall [options]
-
-Without options this script will launch the SALOME Installation
-Wizard in the default mode (GUI). \n The default installation settings
-can be overridden by using command line options. Each option has a
-short and a long notation:
-
-<b>-g / --gui</b>
-\par
-Runs the Installation Wizard in the GUI mode (this is the default
-mode).
-
-<b>-b / --batch</b>
-\par
-Runs the Installation Wizard in the terminal mode.
-
-<b>-f FILE / --file=FILE</b>
-\par
-The XML configuration file to be used by the Installation Wizard.  If
-this option is not used then the installation script tries to define
-the \e Linux version and use the corresponding XML file if it exists. For
-examle, for <em>Linux Mandrake 10.1</em>  the <b>config_Mandrake_10.1.xml</b>  file
-will be used by default. If no appropriate file is found, the file
-<b>config.xml</b> will be used. This file refers to the basic target platform 
-which is <em>Linux Mandrake 10.1</em> for SALOME 3.0 and newer. If <b>config.xml</b>
-file is not found either, a warning message box is shown (in GUI mode)
-or printed to the console (in batch mode) and the Installation Wizard 
-quits.
-
-<b>-d DIR / --target=DIR</b>
-\par
-The target directory SALOME platform is to be installed to. 
-If used, this option overrides the default target directory, given in
-the configuration XML file (usually <b>${HOME}/salome_\<version\></b>, 
-see \ref modifying_xml "here" for more details).
-
-<b>-t DIR / --tmp=DIR</b>
-\par
-The directory, which should be used for temporary files. If given,
-this option overrides the default temporary directory, given in the
-configuration xml file (usually \b /tmp, see \ref modifying_xml "here"
-for more information).
-
-<b>-a / --all-from-sources</b>
-\par
-Forces all the products to be installed from sources (including all
-SALOME modules). If this option is used, all default installation
-modes for all products are ignored.
-\n This option is helpful when the user wants to install SALOME on the
-platform which is not officially supported. In this case, the user can
-try to run the SALOME Installation Wizard with the \b -a option in order
-to build all the products from sources.
-\n <b>Note, that this is a time-consuming operation which can take
-more than 24 hours depending on the computer.</b>
-
-<b>-h / --help</b>
-\par
-Prints help information on the Installation Wizard's use.
-
-<b>-v / --version</b>
-\par
-Prints version information (\b Note: this is the Installation Wizard's
-version number, not the number of SALOME platform version).
-
-The installation procedure supports different \em Linux platforms and
-installs various installation 3d-party prerequisite products which are
-required by SALOME platform. As it was mentioned above, the basic
-target platform for SALOME 3.0 and newer is <em>Linux Mandrake 10.1</em>.
-Use of configuration XML files gives a flexible way to modify the list
-of products to be installed by the Installation Wizard without
-changing the program source code. Just create your own XML
-configuration file and implement installation scripts for the
-prerequisite products you need and then use this XML file with the
-Installation Wizard. This can be done, for example, for some Linux
-platform which is not supported directly by the Installation
-Wizard. See \ref modifying_xml "Modifying XML configuration file" and
-\ref installation_scripts "Implementing installation scripts for the new products"
-sections for more information.
-
-<br>
-\anchor gui_mode_install
-<h2>GUI mode</h2>
-
-The <b>Installation Wizard</b> GUI has been developed using
-Trolltech's <b>Qt 3.0.5</b> toolkit. After launching the Installation
-Wizard in the GUI mode the wizard window is shown to the user. This
-wizard guides the user through several subsequent pages. To navigate
-between the pages use \em "Next" and \em "Back" buttons in the lower
-part of the wizard window. The \em "Cancel" button closes the wizard
-window and quits the installation procedure after the user's
-confirmation. The \em "Help" button opens an additional window to show
-help information.
-
-The first \em "Introduction" page is shown in \ref figure_1 "Figure 1". 
-Skip this page by clicking \em "Next":
-
-\anchor figure_1
-\image html intropage.png 
-\n <center><b>Figure 1:</b> "Introduction" page</center>
-
-In the second page you are proposed to enter the target directory
-where the SALOME platform should be installed to. You can also click
-<em>"Browse..."</em> and choose the destination folder using the standard
-browse directory dialog box.
-\n If the directory you want to install products to does not exist you
-are prompted to confirm directory creation. If you type a wrong
-directory path, or if you do not have write permissions 
-for the directory you use, the corresponding message box is shown.
-
-You can also change the temporary directory (which is used to store
-temporary files required for the installation).
-\n In the bottom part of the window the total disk space required for
-the installation and for the temporary files is displayed (see below
-for more details).
-
-In the GUI mode the Installation Wizard provides two different options
-to install the SALOME platform: \b basic (default option) and
-\b advanced. In the \b basic mode the user should enter the target
-installation directory and temporary folder. All other installation
-options are taken from the XML configuration file (see \ref figure_2 "Figure 2"):
-
-\anchor figure_2
-\image html productpage1.png
-\n <center><b>Figure 2:</b> "Installation settings"</center>
-
-In addition, you have a choice to use "Install all products from
-sources" check box. If this option is turned on, all the products will
-be installed from the sources (using their own build procedures). This
-check box corresponds to the <b>--all-from-sources (-a)</b> option of
-the \b runInstall script (see \ref installing_products "here").
-
-\Note <b>Installation of all products from sources is a long-time
-operation.</b>
-
-To switch to the \b advanced option, click <em>"More..."</em> (see 
-\ref figure_3 "Figure 3" ).
-
-In the advanced mode you have a possibility to select products to be
-installed. Each product can have several options of installation: you
-have a possibility to use the native product (provided with Linux
-distribution and installed in the system folders), install already
-precompiled binaries, build the product from sources or not install it
-at all. Available options and default option are taken from the XML
-configuration file. You can mark the products you want to install by
-clicking the corresponding radio-buttons in the list view in the left
-part of the page.
-\n Note, that some products may require some other pre-requisite
-products to be installed (or these prerequisite products should be
-already available on your computer). The installation procedure has a
-special feature to automatically mark these products in the list
-view. For example, in order to install \b PyQt it is necessary to have
-<b>gcc, Python, Qt</b> and \b Sip installed. Therefore all these
-products will also be  turned on when you check on \b PyQt. This
-feature can be switched off by clicking the <em>"Automatic
-dependencies"</em> checkbox. Turn on this checkbox if you want all
-prerequisite products to be automatically checked when you select some
-product to be installed. Turn off this checkbox if you want to disable
-this feature.
-
-\anchor figure_3
-\image html productpage.png
-\n <center><b>Figure 3:</b> "Installation settings" page in the 'advanced' mode</center>
-
-If you want to use native products (like \b gcc, \b tcl, etc.), select <em>"use
-native"</em> option. 
-\n Special button in the right part of the page - <em>"Unselect All"</em> -
-allows to reset quickly all products to the <em>"not install"</em> state.
-<br><br>
-There are also two checkboxes on this page: <em>"SALOME sources"</em>
-and <em>"SALOME binaries"</em>. These three-state checkboxes allow
-quick selecting/unselecting sources/binaries packages of SALOME
-modules for installation.
-<br><br>
-In addition, when some SALOME sources are selected, one more check box
-becomes available: <em>"Build SALOME sources"</em>. If this option is
-turned on, the selected SALOME modules will be built and installed
-from sources.
-
-\note <b>If this check box is turned on, the corresponding SALOME
-module binaries package installation is disabled, because of  SALOME
-module sources and binaries packages conflict</b> (see \ref figure_4 "Figure 4" below).
-
-\anchor figure_4
-\image html productpage2.png
-\n <center><b>Figure 4:</b> "Build SALOME sources" check box
-usage</center>
-
-The box at the right side of the page displays the information about
-currently highlighted product: name, version and short description,
-required disk space, disk space required for temporary files, list of
-prerequisites (this information is provided in the XML file) and
-current user choice.
-<br><br>
-The <em>"Disk space required:"</em> field displays how much disk space
-on the hard drive is required for installation of selected products.
-
-\note <b>Please, take into account that the displayed amount of
-required disk space is approximate and may differ when you install
-products on your hard drive.</b>
-
-The installation procedure uses a special directory to store temporary
-files. The <em>"Space for temporary files:"</em> field shows the information
-about required disk space on the hard drive for extracting and
-compiling the selected products. You can change the temporary
-directory - just type a path to the folder you want to use or click on 
-the corresponding <em>"Browse..."</em> button.
-
-\note Actually, temporary files are not stored directly in the
-directory entered by the user. The Installation Wizard creates an
-additional folder in this directory named something like
-INSTALLWORK<b>XXXXX</b> where XXXXX is a unique number. This allows to launch
-several Installation Wizards simultaneously. This temporary directory
-is removed automatically when the installation finishes.
-
-The installation procedure also checks the available disk space. If
-there is not enough disk space on your hard drive you will see a
-corresponding error message box.
-
-\note <b>You are strongly recommended not to use directory names
-containing spaces</b>. Otherwise you can experience 
-some troubles with the installation.
-
-To proceed further click <em>"Next"</em>. At this moment the program will make
-some tests to check installation settings: if there is enough disk
-space on the hard drive, check for native products installation,
-dependencies (prerequisites) for each product you have selected to be
-installed. If any test fails you will see the corresponding warning
-message box. Otherwise the wizard will proceed to the next page:
-
-\anchor figure_5
-\image html choicepage.png
-\n <center><b>Figure 5:</b> "Check your choice" page</center>
-
-This page summarizes the installation options you've made on the
-previous pages. You can check again your choice and change it if
-necessary by getting back to the previous page.
-\n When you are sure that everything is OK, click <em>"Next"</em> to
-follow to the \ref figure_6 "next page".
-
-\anchor figure_6
-\image html progresspage1.png
-\n <center><b>Figure 6:</b> "Installation progress" page</center>
-
-To start installation of the selected products click "Start". It
-launches the shell installation script and you will be able to see the
-output of the script in the  dialog topmost frame. If any errors occur
-during the installation progress the corresponding messages will be
-printed to the log window in bold red font.
-
-It is possible to break the installation at any time by clicking
-"Stop". Then you can get back to the previous pages if you wish to
-change installation settings or restart installation by pressing again
-"Start" button.
-
-\note <b>In the current implementation it is not possible to resume
-the stopped installation process; it will be re-started from the very
-beginning.</b>
-
-\anchor figure_7
-\image html progresspage.png
-\n <center><b>Figure 7:</b> "Installation progress" page: installation in progress</center>
-
-The <em>"Installation Status"</em> frame window shows you the progress of
-installation. \c "Waiting" status means that installation of this product
-has not been started yet. The product currently being installed is
-marked as \c "Processing". All installed products have \c "Completed"
-status.
-
-You can abort installation and close the installation procedure using
-\em "Cancel" button.
-
-\note <b>This button sends the signal "SIGTERM" to the shell
-script. The script tries to clear all temporary files. The process of
-removing temporary files can take some time, so the installation
-wizard will wait 3 seconds before closing.</b>
-
-At the end of installation (all selected products have been installed
-successfully) you can go back to the previous pages to start a new
-installation or click \em "Next" to go the Readme page:
-
-\anchor figure_8
-\image html readmepage.png
-\n <center><b>Figure 8:</b> "Finish installation" page</center>
-
-In this page you can read important information about the Instalation
-Wizard itself and some tips: how to run and test SALOME or how to
-build SALOME from the sources. This is the contents of the README file
-which you can find in the root directory of the Installation Wizard.
-
-You can also launch SALOME Desktop from this page or read the Release
-Notes file by clicking on the corresponding buttons in the lower part
-of the page (see \ref modifying_xml "here" and \ref finish_buttons
-"here" for more information about customizing these buttons).
-
-<br>
-\anchor batch_mode_install
-<h2>Batch mode</h2>
-
-To launch the Installation Wizard in the batch mode use -\b b (--\b batch)
-parameter.
-\n In this mode the GUI wizard is not shown but all the installation
-status is displayed directly in the console. In the batch mode the
-user does not have a possibility to change installation settings which
-are given in the configuration file, except target and temporary
-directories which can be overridden by the corresponding command line
-options.
-\n The only exception is --\b all-from-sources (-\b a) option which enables
-special installation mode in which all the products (including SALOME
-modules) are installed from sources, ignoring the default mode defined
-in the XML configuration file (see \ref installing_products "here" for details).
-
-\anchor figure_9
-\image html batchmode.png
-\n <center><b>Figure 9:</b> Batch mode</center>
-
-<br>
-\anchor environment_files
-<h2>Environment files</h2>
-
-During the process of installation the script creates some environment
-files to simplify the procedure of launching SALOME. These shell
-scripts set all necessary environment variables for all products you
-have installed. To learn how installation scripts collects the
-environment, see \ref pick_up_env "here". These files are: \b
-salome.csh + \b salome.sh in the <b><em>KERNEL module sources</em></b>
-and <b><em>KERNEL module binaries</em></b> root directories and
-\b env_products.csh + \b env_products.sh and \b env_build.csh + 
-\b env_build.sh in the target installation directory.
-
-\note there is some difference between these files: \b env_build.*
-files are optimized to be used for building SALOME modules from
-sources (see \b README file provided with the installation procedure
-on the CD). The \b env_products.* (and \b salome.*) files are
-optimized for SALOME launching. The behavior is defined by the
-environment variable \b ENV_FOR_LAUNCH which is set to \b 0 in
-env_build.* files and to \b 1 in env_products.* (salome.*) files.
-
-<br>
-<hr>
-\anchor notes_on_check
-<h2>Notes on <em>check products version</em> procedure</h2>
-
-Unfortunately there is no exact algorithm to identify the product
-version under Linux platform. The information in this section gives an
-idea how the version is checked for the native/preinstalled products
-(this information refers to the base platform <em>Linux Mandrake
-10.1</em>; and the same algorithms are used for other platforms).
-
-The general rule for all products is that the path to the binaries
-should be set via the \b PATH environment variable, path to the libraries
-should be set via the \b LD_LIBRARY_PATH variable and the python modules
-should be available via the \b PYTHONPATH variable.
-
-\note the information given in this section refers to the prerequisite
-products for SALOME version 3.2.4.
-
-<ul>
-<li>gcc 3.4.1
-\n\n Version number is checked by <b>gcc -dumpversion</b> command. The \b gcc
-executable should be in the \b PATH environment variable. Version should
-be equal to "3.4.1". It is recommended to use native gcc on Mandrake
-10.1.<br><br>
-</li>
-<li>tcl/tk 8.4.5
-\n\n Version number for \b tcl/tk can be found in tclConfig.sh and
-tkConfig.sh files (\b TCL_VERSION and \b TK_VERSION variables
-correspondingly). Version number should be equal to "8.4" (release
-number is not checked). Set the \b TCLHOME environment variable to the
-root directory of tcl/tk installation. It is recommended to use native
-tcl/tk on Mandrake 10.1.<br><br>
-</li>
-<li>boost 1.31.0
-\n\n Version number is defined by \b version.hpp file which is part of
-the boost distribution. This file defines the \b BOOST_VERSION macro
-which should be equal to "103100". In addition the existence of boost
-libraries is checked. Set the \b BOOSTDIR environment variable if you
-have a preinstalled version of boost.<br><br>
-</li>
-<li>Python 2.3.4
-\n\n Version number is checked by \b python -\b V command. The \b python
-executable should be in the \b PATH environment variable. Version
-number should be equal to "2.3.4". It is recommended to use native
-Python on Mandrake 10.1. Set the \b PYTHONHOME environment variable if
-you have a preinstalled version of Python.<br><br>
-</li>
-<li>Swig 1.3.24
-\n\n Version number is checked by \b swig -\b version command. The \b swig
-executable should be in the \b PATH environment variable. Version number
-should be equal to "1.3.24".
-<br><br>
-</li>
-<li>Qt 3.3.3
-\n\n Version number is defined by \b qglobal.h file which is part of the
-Qt distribution. This file defines \b QT_VERSION_STR macro which should be equal to "3.3.3". It is recommended to use native Qt on Mandrake 10.1.
-\n Set the \b QTDIR environment variable if you have a preinstalled version of qt.<br><br>
-</li>
-<li>msg2qm
-\n\n \b msg2qm is a Qt tool which is used to convert text *.po files
-to *.qm resource files. Unfortunately this tool is not included to the
-Linux distribution and provided only in Qt sources package. This is
-the reason why this tool is supplied with the SALOME Installation
-Wizard. There is no way to check the version number of msg2qm tool. Just set
-\b MSG2QM_ROOT environment variable if you have a preinstalled version
-of msg2qm tool.<br><br>
-</li>
-<li>Open CASCADE 6.1.2a2
-\n\n Version number is defined by \b Standard_Version.hxx file which
-is part of the Open CASCADE distribution. This file defines \b
-OCC_VERSION_MAJOR, \b OCC_VERSION_MINOR and \b OCC_VERSION_MAINTENANCE
-macros which should refer to version 6.1.2. \n Set the CASROOT
-environment variable if you have a preinstalled version of Open
-CASCADE.<br><br>
-</li>
-<li>qwt 4.2.0/0.4.2
-\n\n Version number is defined by \b qwt_global.h file which is part of
-the qwt distribution. This file defines \b QWT_VERSION_STR macro which should be equal to "4.2.0".
-\n Set the \b QWTHOME environment variable if you have a preinstalled version of qwt.<br><br>
-</li>
-<li>hdf 5-1.6.4
-\n\n Version number is defined by \b libhdf5.settings file which is
-part of the \b hdf5 distribution. Version should be equal to 1.6.4.
-\n Set the \b HDF5HOME environment variable if you have a preinstalled
-version of hdf5.<br><br>
-</li>
-<li>med 2.2.3
-\n\n Unfortunately there is no formal way to check med version
-number. We check existence of libmed.so.1.0.2 library on the
-computer. If you have any problem with a preinstalled version of med,
-please, reinstall it.
-\n Set the \b MED2HOME environment variable if you have a preinstalled
-version of med.<br><br>
-</li>
-<li>Vtk 4.2.6
-\n\n Unfortunately there is no formal way to check VTK version
-number. We just check the existence of \b libvtkCommon.so library on
-the computer and hope that it is of version we need. If you have any
-problem with a preinstalled version of Vtk, please, reinstall it.
-\n Set the \b VTKHOME environment variable if you have a preinstalled
-version of Vtk.<br><br>
-</li>
-<li>OmniORB 4.0.5, OmniORBpy 2.5, OmniNotify 2.1
-\n\n We just check existence of some omniORB libraries and executable
-on the computer, like \b libomniORB4.so.0.5, \b _omnipymodule.so.2.4,
-\b libCOSNotify4.so.0.1 and \b notifd. \n Set the \b OMNIORBDIR
-environment variable if you have a preinstalled version of omniORB
-products.<br><br>
-</li>
-<li>sip 4.1
-\n\n Version number is checked by \b sip -\b V command. The \b sip
-executable should be in the \b PATH environment variable. Version number should be equal to "4.1".
-\n Set the \b SIPDIR environment variable to the directory where you
-have sip executable preinstalled.<br><br>
-</li>
-<li>PyQt 3.13
-\n\n Version number is defined by \b pyqtconfig.py Python module file
-which is part of the \b PyQt distribution. Version should be equal to "3.13".
-\n Set the \b PYQTDIR environment variable if you have a preinstalled
-version of PyQt.<br><br>
-</li>
-<li>netgen 4.5
-\n\n Unfortunarely we can't find anything about netgen version. We
-just check if \b NETGENROOT environment variable is set. \n Set the\b
-NETGENROOT environment variable if you have a preinstalled version of
-netgen mesher.<br>
-\note netgen 4.5 provided with the SALOME installation Wizard has been patched to improve its performance.
-</li>
-<li>Numeric 23.7
-\n\n Version number is checked by <b>python -c 'import Numeric; print
-Numeric.__version__'</b> command. The \b python executable should be
-in the \b PATH environment variable and \b Numeric module should be
-available for the Python (for example it should be in the \b PYTHONPATH environment variable). Version number should be equal to "23.7". If you have any problem with a preinstalled version of Numeric 23.7, please, reinstall it.
-\n Add the directory where you have a preinstalled version of Numeric
-package to the the \b PYTHONHOME environment variable.<br><br>
-</li>
-<li>graphviz 2.2.1
-\n\n Version number is checked by \b dot -\b V command. The dot
-executable should be in the \b PATH environment variable. Version
-number should be equal to "2.2.1". \n Add \b graphviz bin directory to
-the the \b PATH environment variable.<br><br>
-</li>
-<li>doxygen 1.4.6
-\n\n Version number is checked by \b doxygen --\b version command. The
-\b doxygen executable should be in the \b PATH environment
-variable. Version number should be equal to "1.4.6".<br><br>
-</li>
-<li>\b SALOME module \b sources (3.2.4).
-\n\n For each SALOME module sources package (KERNEL, GUI, GEOM,
-etc...) the root directory contains file configure.in (configure.ac)
-which defines version information.\n Set the \b \<MODULE\>_SRC_DIR environment variable for each SALOME \b
-MODULE sources package installed (where \b MODULE is KERNEL, GUI,
-GEOM, ...).<br><br>
-</li>
-<li>\b SALOME module \b binaries (3.2.4)
-\n\n For each SALOME module binaries package (KERNEL, GUI, GEOM,
-etc...) the \b bin/salome directory contains file \b VERSION which
-defines version information.\n Set \<MODULE\>_ROOT_DIR environment
-variable for each SALOME \b MODULE binaries package installed (where
-\b MODULE is KERNEL, GUI, GEOM, ...).<br><br>
-</li>
-</ul>
-
-If you have native products installed to directories different from
-default ones (not \b /usr/bin, \b /usr/lib...), it is recommended to follow
-the above mentioned instructions. Or you should properly set \b PATH and
-\b LD_LIBRARY_PATH variables \em before starting the Installation
-Wizard. Otherwise the installation script will fail to find
-preinstalled/native products.
-
-\note for some native products (e.g. gcc, Python) the rules of version
-checking are not so strict as described above. Only major and minor
-version numbers should coincide with the prerequisite. Newer version
-of the product can also be used. If some native product has version
-number larger than that required by the installation procedure, the
-user will be prompted by the warning message like this: "<em>You have
-newer version of gcc installed on your computer than that is required
-(3.4.1). Continue?</em>". You can click "\em Yes" to proceed with the
-installation but in this case you should be aware of what you are
-doing. SALOME binaries (including other products) are compiled with
-the predefined prerequisites and most likely can not be run
-successfully if these products are not found. This can be helpful only
-if you plan to build all products from sources.
-
-<br>
-<hr>
-\anchor pick_up_env
-<h2>Pick up the <em>environment</em></h2>
-
-Please, read the following information carefully . This section
-describes how the installation procedure generates the environment
-scripts for the SALOME platform being installed.
-<br><br>
-After installing each product shell the script creates a special
-environment file for the product in its installation folder. The name
-of the file is generated from the name of product by the following
-scheme: \b env_<product_name>.sh (for example \b env_Vtk.sh for the
-Vtk). This file includes all necessary environment settings. At the
-final step of the installation the script picks up all the settings
-files and generates two common environment files from them: \b salome.sh
-and \b salome.csh for \b bash and \b csh shells correspondingly. Such approach
-helps to save time when reinstalling products and you may not bother
-about setting all environment variables manually to build/launch
-SALOME. What you simply need is to source one of these environment
-files.
-<br><br>
-This also concerns those products which are not being installed. For
-example, you install some SALOME binaries to the directory where you
-have previously installed other products.  The Installation procedure
-tries to collect environment files from the target directory if it
-finds necessary products installed there. If some product is not found
-in the target directory the corresponding section of
-\b salome.sh/salome.csh files will be skipped.
-\n For native products (like \b gcc, \b tcl, etc...) the installation
-procedure tries to find them first using \b PATH / \b LD_LIBRARY_PATH
-variables and then in the system default directories (\b /usr/bin,
-\b /usr/lib etc., depending on the product).
-<br><br>
-In any case you may edit \b salome.* files after the installation
-procedure finishes, if you want.
-
-\note As it was mentioned \ref environment_files "above" there are
-other environment files which are generated by the installation
-procedure: \b env_products.csh + \b env_products.sh and \b env_build.csh +
-\b env_build.sh. These files can be found in the target installation root
-directory.
-
-<br>
-<hr>
-\anchor modifying_xml
-<h2>Modifying <em>XML</em> configuration <em>file</em></h2>
-
-You can create your own XML configuration file. The Installation
-Wizard can then take it as a command line argument to provide a list
-of products you want to install with it. The list of products and some
-other settings for the Installation Wizard are provided in the XML
-file. The default file which Installation Wizard looks for if no
-command line arguments are given, is \b config.xml.
-\n This section describes the structure of the configuration file. 
-\n Optional sections/tags are in brackets.
-
-\code
-<document> 
-    [ <config [ version=<install_wizard_version> ] 
-              [ caption=<install_wizard_caption> ] 
-              [ copyright=<install_wizard_copyright>  ] 
-              [ license=<install_wizard_license_info> ] 
-              [ os=<target_platform> ]
-      /> 
-    ] 
-    [ <path   [ targetdir=<target_directory> ] 
-              [ tempdir=<temp_directory>     ]
-      /> 
-    ] 
-    [ <button   label=<button_label>      
-              [ tooltip=<button_tooltip> ] 
-                script=<button_script>    
-              [ disable=<disable_flag>   ]
-      /> 
-    ] 
-    [ <button ... 
-      />
-    ] 
-    [ <product  name=<product_name> 
-                version=<product_version> 
-              [ context=<product_context>         ]
-              [ description=<product_description> ]
-                install=<installation_mode> 
-                supported=<supported_installation_modes> 
-              [ disable=<disable_flag>            ]
-              [ pickupenv=<pickup_env_flag>       ]
-                dependancies=<list_of_prerequisites> 
-                installdiskspace=<install_disk_space> 
-                temporarydiskspace=<tmp_disk_space> 
-                script=<installation_script_name>
-      /> 
-    ] 
-    [ <product ... 
-      /> 
-    ]
-    ...
-</document>
-\endcode
-
-<b>\<config\> section</b>
-\n\n This is an optional section; it provides general information about
-the Installation Wizard itself.
-<br><br>
-Attributes:
-<ul>
-<li><b>version</b>
-\n\n The application version number to be shown in the caption.<br><br>
-</li>
-<li><b>caption</b>
-\n\n The application main window caption - if this string contains
-'\%1' text the title will contain the version number in this place (see
-above).<br><br>
-</li>
-<li><b>copyright</b>
-\n\n The application copyright information (shown in the first
-page).<br><br>
-</li>
-<li><b>license</b>
-\n\n The application license information (shown in the first
-page).<br><br>
-</li>
-<li><b>os</b>
-\n\n This parameter defines the directory (relative from
-./Products/BINARIES) where the Installation Wizard will search
-precompiled binaries packages. If this tag is not provided, binaries
-packages are looked for in the ./Products/BINARIES directory.<br><br>
-</li>
-</ul>
-
-<b>\<path\> section</b>
-\n\n This is an optional section; it defines default installation
-directories.
-<br><br>
-Attributes:
-<ul>
-<li><b>targetdir</b>
-\n\n The target directory - the path to the directory where products
-should be installed.<br><br>
-</li>
-<li><b>tempdir</b>
-\n\n The temporary directory - the path to the directory for the
-temporary files.<br><br>
-</li>
-</ul>
-
-<b>\<product\> section</b>
-\n\n This section describes product to be installed with the
-Installation Wizard. The XML file should include a \<product\> section
-for each product to be installed. The products appear in the tree view
-and are installed in the order they are described in the configuration
-file. It is recommended (but not obligatory) to define native products
-at the top of the list before all other products.
-<br><br>
-Attributes:
-<ul>
-<li><b>name</b>
-\n\n Product name.<br><br>
-</li>
-<li><b>version</b>
-\n\n Product version.<br><br>
-</li>
-<li><b>description</b>
-\n\n Product description (optional).<br><br>
-</li>
-<li><b>context</b>
-\n\n Context (optional). The possible values are '<b>salome
-sources</b>', '<b>salome binaries</b>' and '<b>prerequisite</b>'
-(several contexts can be given separated by ":" symbol).<br><br>
-</li>
-<li><b>supported</b>
-\n\n Supported modes of installation. Several modes can be separated
-by comma. Possible value are: <em>install sources, install binaries, use
-native</em>. The Installation script should contain the corresponding
-functions for each of the supported installation modes (see
-\ref installation_scripts "here").<br><br>
-</li>
-<li><b>install</b>
-\n\n Default (starting) installation mode.<br><br>
-</li>
-<li><b>disable</b>
-\n\n If this optional flag has 'true' value, the corresponding product
-will not appear in the list of products and will not be
-installed.<br><br>
-</li>
-<li><b>pickupenv</b>
-\n\n This flag points that pickup environment procedure should be
-performed for this product. If this flag equal to 'true',  salome.sh
-and salome.csh files will  be created in the product installation
-directory. Usually this option is set to true for SALOME KERNEL module
-sources and binaries package. This is an optional key, default value
-is 'false'.<br><br>
-</li>
-<li><b>dependancies</b>
-\n\n List of prerequisite products, which are necessary to build this
-product, separated by comma.<br><br>
-</li>
-<li><b>installdiskspace</b>
-\n\n Total amount of space (integer, in Kbytes), which the product
-occupies on the hard drive after the installation.<br><br>
-</li>
-<li><b>temporarydiskspace</b>
-\n\n Disk space (integer, in Kbytes) for temporary files, which is
-necessary to build the product from the sources.<br><br>
-</li>
-<li><b>script</b>
-\n\n The installation script name. This script is in charge of the
-installation of the product. It is called automatically by the
-Installation Wizard when necessary from the main program. 
-See the \ref installation_scripts "next section" for more information.<br><br>
-</li>
-</ul>
-
-<b>\<button\> section</b>
-\n\n This is an optional section. It allows customization of the last
-"Finish installation" page of the Installation Wizard by adding one or
-more buttons in the lower part of the wizard's window. The script
-which is attached to each such button, can perform some specific
-action, for example, launch the application or show the Release Notes
-file by using an external program. See \ref finish_buttons "here" for
-more details about writing scripts.<br><br>
-Attributes:
-<ul>
-<li><b>label</b>
-\n\n This is the button text.<br><br>
-</li>
-<li><b>tooltip</b>
-\n\n The button tooltip (optional).<br><br>
-</li>
-<li><b>script</b>
-\n\n The script attached to the button.<br><br>
-</li>
-<li><b>disable</b>
-\n\n If this optional flag has 'true' value, the corresponding button
-will not appear in the "<em>Finish installation</em>" page - the section of XML
-file is silently ignored.<br><br>
-</li>
-</ul>
-
-\note If you add new products to be installed with Installation
-Wizard, you should also provide installation script for this
-product. See the next section for more details.
-
-<br>
-<hr>
-\anchor installation_scripts
-<h2>Implementing <em>installation scripts</em> for the new products</h2>
-
-When you want some product to be installed with the Installation
-Wizard, you should add its description \ref modifying_xml "to the configuration file"
-and create the installation script, following the rules described in this section.
-
-There are some obligatory functions which should be implemented in
-this installation script. These functions are automatically called by
-the master installation script or/and its GUI shell when it is
-necessary. \n File \b common.sh contains some service functions which can
-be used in your installation script, like \b make_env(), \b make_dir(),
-\b try_existing(), \b sort_path(), \b find_in_path(), etc.
-
-<ul>
-<li><b>check_version()</b>
-\n\n This function allows to check the version of the product already
-installed on the computer. It should try to find the product (native
-or preinstalled in the target directory) and check its version. This
-helps to avoid unnecessary reinstallation. This is an internal
-function and is not called from the master installation
-script.<br><br>
-</li>
-<li><b>try_native()</b>
-\n\n This function is called when the 'use native' installation mode
-is selected by the user. The function should try to find a native
-version of the product and define possibility of its use. It should
-create the environment file for the product in the temporary directory
-(see also the description of \b print_env() function). It is not
-necessary to implement this function if you do not provide native mode
-installation.<br><br>
-</li>
-<li><b>install_source()</b>
-\n\n This function is called when the 'install sources' installation
-mode is selected by the user. The function is responsible for building
-the product from the sources package. It should create the environment
-file for the product in the temporary directory (see also description
-of \b print_env() function). It is not necessary to implement this
-function if you do not provide sources mode installation.<br><br>
-</li>
-<li><b>install_source_and_build()</b>
-\n\n This function is called when SALOME module is installed and the
---\b all-from-sources (-\b a) option is used (<em>"Build SALOME sources"</em>
-check box in GUI mode). This function should be used to unpack SALOME
-sources package and then call the build/install procedure for it.
-For more details please refer to the \ref installing_products "this"
-and \ref gui_mode_install "this" sections for more details.<br><br>
-</li>
-<li><b>install_binary()</b>
-\n\n This function is called when the <em>'install binaries'</em> installation
-mode is selected by the user. The function is responsible for the
-extracting of the product from the binaries package. It should create
-environment for the product in the temporary directory (see also
-description of \b print_env() function). It is not necessary to implement
-this function if you do not provide binaries mode
-installation.<br><br>
-</li>
-<li><b>try_preinstalled()</b>
-\n\n This function is called when the 'not install' installation mode
-is selected by the user. In this case the script should inspect the
-target directory to try to find an already preinstalled product, pick
-up and check the environment from there. See \ref pick_up_env "here" for more
-details.<br><br>
-</li>
-<li><b>print_env()</b>
-\n\n This function is in charge of creating the environment script. It
-should create a file with name \b env_<product_name>.sh in the temporary
-directory and then copy it into the product installation
-directory. The file should contain all necessary environment variables
-settings for the product. It will be collected during the
-'pick-up-environment' procedure.<br><br>
-</li>
-<li><b>pickup_env()</b>
-\n\n This procedure corresponds to the \b pickupenv tag of the
-configuration xml file (see previous section). It should call the
-\b make_env procedure to perform the pick-up environment procedure for
-the product.<br><br>
-</li>
-</ul>
-
-The calling signature of the product installation script is the following: 
-<b>\<product_script_name\> \<function_name\> \<temp_folder\>
-\<products_directory\> \<target_directory\> \<dependancies\>
-\<product_name\></b>
-\n\n where \n\n
-<b>\<product_script_name\></b> - installation script name (described in the
-configuration xml file);\n
-<b>\<function_name\></b> - the name of function, corresponding to the selected
-installation mode: \em try_native, \em install_source, \em install_binary or
-\em try_preinstalled;\n
-<b>\<temp_folder\></b> - temporary files directory;\n
-<b>\<products_directory\></b> - directory where the sources/binaries package
-can be found. You should provide the sources package in the
-<em>\<Install_Wizard_root_directory\>/Products/SOURCES</em> directory and
-binaries package in the
-<em>\<InstallWizard_root_directory\>/Products/BINARIES/\<os_version\></em>, where
-\<os_version\> is the target platform description, which appears in the
-corresponding section of the \ref modifying_xml "configuration xml file";
-<em>\<target_directory\></em> - root target directory where the product should be installed to; 
-<em>\<dependancies\></em> - single-quoted list of prerequisite products, separated by space; 
-<em>\<product_name\></em> - product name itself.
-
-\b Example:
-\n <em>med-2.2.3.sh install_binary /tmp/work
-./Products/BINARIES/Mandrake10.1 /usr/salome 'gcc Hdf' med</em>
-
-Copy the created script into the
-<em>\<Install_Wizard_root_directory\>/config_files</em> sub-directory where all
-installation scripts are stored. Installation Wizard will
-automatically search and call your script during the installation
-procedure.
-
-<br>
-<hr>
-\anchor finish_buttons
-<h2>Customizing <em>Readme page</em> buttons</h2>
-
-The Installation Wizard allows customizing the look-n-feel of the last
-<em>"Finish installation"</em> page. If you want to add one or more buttons to
-this page in order to perform some specific actions at the end of the
-installation (for example, to show the Release Notes file by using
-Open Office) you can put an additional section to the XML
-configuration file. This is the \b \<button\> section (see 
-\ref modifying_xml "here" for more details).
-
-To implement the action which will be performed when the user clicks
-the button, you need to create a script and put it to the
-<em>\<Install_Wizard_root_directory\>/config_files</em> directory.
-\n There are some obligatory functions which should be implemented in
-this script. These functions are automatically called by the
-Installation Wizard GUI.
-
-<ul>
-<li><b>check_enabled()</b>
-\n\n This procedure is called by the Installation Wizard when the
-<em>"Finish installation"</em> page is displayed and the status of the buttons
-should be modified according to the installation options. This
-procedure should return \b 0 if the corresponding action can be performed
-and, thus, the button should become enabled. Otherwise, it should
-return \b 1 - in this case the corresponding button will be
-disabled.<br><br>
-</li>
-<li><b>execute()</b>
-\n\n This procedure is invoked when the user clicks the button. This
-procedure should return \b 0 if the corresponding action is done
-successfully and \b 1 if any error occurs.<br><br>
-</li>
-</ul>
-
-The calling signature of the script is the following:
-\n <b>\<product_script_name\> \<function_name\> \<target_directory\>
-\<temp_folder\></b>
-\n\n where \n\n
-\b \<product_script_name\> - the script name itself (retrieved from the XML configuration xml file); 
-\n \b \<function_name\> - the name of function; 
-\n \b \<target_directory\> - root target directory where the product is installed to; 
-\n \b \<temp_folder\> - temporary files directory;
-
-\note The standard Installation Wizard buttons "Launch SALOME" and
-"Release Notes" are implemented with this feature. Refer to scripts
-\b start_salome.sh and \b release_notes.sh for sample implementation.
-
-\note Any button (even standard) can be ignored by the Installation
-Wizard if the attribute \b \<disable\> in the XML configuration file is set
-to the "true" value.
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/intro_to_salome.doc b/doc/salome/gui/GUI/input/intro_to_salome.doc
deleted file mode 100644 (file)
index daeca31..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*!
-
-\page intro_to_salome_page Introduction to SALOME
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-\b SALOME platform represents a generic open source platform for pre-
-and post-processing in numeric simulations. \b SALOME combines several
-software components, which are built in such a way that it allows to
-integrate solvers and existing meshing algorithms along with the
-specification of physical properties for a given domain. The
-originality of this approach is that the various components must
-cooperate dynamically and be 
-configurable.
-
-\image html image54.jpg
-
-<br>SALOME platform integrates a number of modules each having its own function:
-<ul>
-<li>\b KERNEL :  provides a common shell for all components, which can be integrated into the SALOME platform.
-<li>\b GUI : provides visual representation: basic widgets, viewers
-etc. Third party modules optionally can have GUI, but in any case they always connected with KERNEL.
-<li>\b Geometry :  facilitates construction and optimization of geometrical models using a wide range of  CAD functions. 
-<li>\b Mesh :  generates meshes on geometrical models previously created or imported by the Geometry component.
-<li>\b Supervisor :  provides tools for construction of graphs and execution of calculations. 
-<li>\b Post-Pro :  performs data visualization.
-<li>\b MED :  allows to work with MED files.
-</ul>
-
-*/
diff --git a/doc/salome/gui/GUI/input/introduction.doc b/doc/salome/gui/GUI/input/introduction.doc
deleted file mode 100644 (file)
index 6d9b76b..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*!
-
-\image html icon_about.png
-
-\page introduction_page Introduction
-
-<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-Welcome to SALOME Platform! Modern technological products (cars,
-structures, electrical or electronic equipment) are getting more and
-more complex every year and must meet increasingly severe requirements
-in terms of quality and performance. For example, for structures and
-their environment the demands to reduce risks and optimize costs are
-extremely high. It requires particularly refined simulations
-concerning structural behavior and robustness to ensure high
-reliability.
-\n The numeric modeling of a physical problem, the development of
-solutions and their integration into the design process are often
-handled in very specific environments. SALOME represents a generic
-CAD-based application for digital simulation with "high reactivity to
-market evolutions and customer expectations".
-
-SALOME is a free software that provides a generic platform for Pre and
-Post-Processing for numerical simulation. It is based on an open and
-flexible architecture made of reusable components available as free
-software.
-
-SALOME is a CAD/CAE integration platform. It provides reusable
-components for: 
-<ul>
-<li>3D modeling (bottom-up construction, import, healing);
-<li>Visualization;
-<li>Computational schemas management;
-<li>Post-processing.
-</ul>
-
-SALOME is tailored for integration of custom components:
-<ul>
-<li>CAD interfaces;
-<li>Mesh generators;
-<li>Finite Element solvers with specific pre-processors.
-</ul>
-
-The SALOME platform is available in Open Source.
-
-<b>Salome Platform:</b>
-<ul>
-<li>Supports interoperability between CAD modeling and computation software (CAD-CAE link) 
-<li>Makes easier the integration of new components on heterogeneous systems for numerical computation 
-<li>Sets the priority to multi-physics coupling between computation software 
-<li>Provides a generic user interface, user-friendly and efficient, which helps to reduce the costs and delays of carrying out the studies 
-<li>Reduces training time to the specific time for learning the software solution which has been based on this platform 
-<li>All functionalities are accessible through the programmatic
-integrated Python console
-</ul>
-
-\image html image65.gif
-
-<b>What can you do in SALOME? (Some of SALOME main functions)</b>
-<ul>
-<li>Define geometrical models (create/modify geometrical items), import and export them using the BREP, IGES and STEP formats; 
-<li>Define meshing of these geometrical items, import and export them;
-<li>Handle physical properties and quantities attached to geometrical items, import and export them to a reusable format;
-<li>Perform computations using a solver (optionally provided): read input data, configure the solver, and write calculation results);
-<li>Visualize result fields in 3D, 2D and export images of their visualization to an appropriate format;
-<li>Manage study schemes: definition, save/restore;
-<li>Manage computation schemes: definition, execution.
-</ul>
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/introduction_to_gui.doc b/doc/salome/gui/GUI/input/introduction_to_gui.doc
deleted file mode 100644 (file)
index 0b1d51f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*!
-
-\page introduction_to_gui_page Introduction to GUI
-
-\b GUI (Graphical User Interface) provides a common shell for all components, which can be integrated into the SALOME platform.
-
-\b GUI component in SALOME platform provides:
-<ul>
-<li>Common desktop environment (\ref salome_desktop_page "SALOME desktop") for all
-components</li>
-<li>Component integration and management: uploading, switching,
-component menus/toolbars handling</li> 
-<li>Study management (creation, saving, loading, editing studies)</li>
-<li>Multi-window management in the framework of one study</li>
-<li>Management of objects created or imported into the SALOME
-application (\ref using_object_browser_page "Object Browser")</li>
-<li>Integrated Python interpreter</li> 
-<li>Output messages window</li>
-<li>Additional tools : \ref using_catalog_generator_page "Catalogue Generator", 
-\ref using_registry_tool_page "Registry tool"</li>
-<li>Standard viewers for data visualization:</li>
-<ul>
-<li>VTK 3d viewer
-<li>OCC 3d viewer
-<li>Gauss Points viewer
-<li>Plot 2d viewer
-<li>Supervision viewer
-</ul>
-</ul>
-
-
-Since version 3.0.0 SALOME GUI is based on SUIT (Salome User Interface
-Toolkit) that proposes very flexible, powerful and safe mechanisms of
-interaction with SALOME tool components (both CORBA and standalone),
-resources management, viewers and selection handling,
-exception/signals processing, bringing to top multi-desktop
-dockable-windowed user interface which improves the usability of
-SALOME GUI.
-\n All Graphical User Interfaces of standard modules have plug-in
-structure, i.e. each module is placed in a dynamic library which is
-loaded on demand. All modules can create their own menu items, buttons
-in toolbar, windows etc
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/mesh_preferences.doc b/doc/salome/gui/GUI/input/mesh_preferences.doc
deleted file mode 100644 (file)
index 047afc6..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*!
-
-\page mesh_preferences_page Mesh preferences
-
-In the Mesh module you can set mesh preferences, which can be used in
-later sessions with this module.
-
-<h2>General Preferences</h2>
-
-\image html pref21.png
-
-<ul>
-<li><b>Update</b></li>
-<ul>
-<li>If you toggle <b>Automatic Update</b> checkbox, the model in your
-viewer automatically updated whenever you make changes in it.</li>
-</ul>
-<li><b>Quality Controls</b></li>
-<ul>
-<li>If you toggle <b>Display entity</b>, both faces and edges of an
-object will be displayed in the viewer by default.</li>
-<li>If you toggle <b>Use precision</b> checkbox, you can display numbers in
-<b>Quality Control</b> diagrams at the necessary level of precision.</li>
-</ul>
-<li><b>Precision</b> - can be defined by the <b>Number of digits after point</b> in
-the corresponding field. By default, numbers in <b>Quality Control</b>
-diagrams are presented as integers.</li>
-<li><b>Display mode</b> - allows to set Wireframe, Shading, Nodes or Shrink
-presentation mode as default.</li>
-<li><b>Mesh export</b></li>
-<ul>
-<li>If you toggle <b>Automatically create groups for MED export</b> checkbox,
-this operation will be carried out automatically.</li>
-<li>If you toggle <b>Automatic renumbering</b> checkbox, the exported
-mesh will be renumbered automatically</li>
-</ul>
-</ul>
-
-<h2>Mesh Preferences</h2>
-
-\image html pref22.png
-
-<ul>
-<li><b>Nodes</b></li>
-<ul>
-<li><b>Color</b> -  allows to select the color of nodes. Click on the
-colored line to access to the \ref select_color_and_font_page "Select Color" 
-dialog box.</li>
-<li><b>Size</b> - allows to define the size of nodes.</li>
-</ul>
-<li><b>Elements</b></li>
-<ul>
-<li><b>Fill</b>  - allows to select the color of surface of elements
-(seen in Shading mode). Click on the colored line to access to the
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Outline</b> - allows to select the color of borders of
-elements. Click on the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Back Face</b> - allows to select the color of interior surface
-of elements. Click on the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Width</b> - allows to define the width of lines (edges and borders of elements).</li>
-<li><b>Shrink coef.</b> - allows to define relative space of elements
-compared to gaps between them in shrink mode.</li>
-</ul>
-</ul>
-
-<br><h2>Selection Preferences</h2>
-
-\image html pref23.png
-
-<ul>
-<li><b>Selection</b> - performed with mouse-indexing (preselection)
-and left-clicking on an object, whose appearance changes as defined in
-the <b>Preferences</b>.</li>
-<ul>
-<li><b>Object Color</b> -  allows to select the color of mesh (edges and
-borders of meshes) of the selected entity. Click on the colored line
-to access to the \ref select_color_and_font_page "Select Color" dialog
-box.</li>
-<li><b>Element color</b> - allows to select the color of surface of selected
-elements (seen in Shading mode). Click on the colored line to access
-to the \ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Width</b> - allows to define the width of selected edges. </li>
-</ul>
-<li><b>Preselection</b> - performed with mouse-indexing on an object,
-whose appearance changes as defined in the <b>Preferences</b>.</li>
-<ul>
-<li><b>Highlight Color</b> -  allows to select the color of mesh (edges and
-borders of meshes) of the entity . Click on the colored line to access
-to the \ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Width</b> - allows to define the width of preselected edges.</li>
-</ul>
-<li><b>Precision</b> - in this menu you can set the value of precision
-used for <b>Nodes</b>, <b>Elements</b> and <b>Objects</b>.</li>
-</ul>
-
-<br><h2>Scalar Bar Preferences</h2>
-
-\image html pref24.png
-
-<ul>
-<li><b>Font</b> - in this menu you can set type, face and color for
-the font of <b>Title</b> and <b>Labels</b>.</li>
-<li><b>Colors & Labels</b> - in this menu you can set the <b>number of
-colors</b> and the <b>number of labels</b> in use.<li>
-<li><b>Orientation</b> - here you can choose between vertical and
-horizontal orientation of the <b>Scalar Bar</b></li>.
-<li><b>Origin & Size Vertical & Horizontal</b> - allows to define
-placement (<b>X</b> and <b>Y</b>) and lookout (<b>Width</b> and
-<b>Height</b>) of Scalar Bars</li>
-<ul>
-<li><b>X</b>: abscissa of the point of origin (from the left
-side)</li>
-<li><b>Y</b>: ordinate of the origin of the bar (from the bottom)</li>
-</ul>
-</ul>
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/occ_3d_viewer.doc b/doc/salome/gui/GUI/input/occ_3d_viewer.doc
deleted file mode 100644 (file)
index 6638fac..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*!
-
-\page occ_3d_viewer_page OCC 3D Viewer
-
-<b>OCC (Open CasCade) 3D viewer</b> has been developed on the basis of Open
-CASCADE Technology. This is the default viewer for Geometry Module,
-providing good representation of construction and transformation of
-geometrical objects. Only this viewer allows to work with groups and
-sub-shapes. This viewer can also work in Mesh module, however, it
-doesn't allow to visualize meshes.
-
-The functionalities of OCC viewer are available via its Viewer
-Toolbar. Buttons marked with small downward triangles have extended
-functionality which can be accessed by locking on them with left mouse
-button.
-
-\image html image95.gif "Viewer Toolbar"
-
-<hr>
-\image html image77.gif
-\n <center><b>Dump View</b> - exports an object from the viewer in bmp, png, jpg
-or jpeg image format.</center>
-<hr>
-
-\image html image88.gif
-\n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
-<hr>
-
-\image html image96.gif
-\n <center><b>Fit all</b> - allows to select a point to be the center of a
-scene representing all displayed objects in the visible area.</center>
-<hr>
-
-\image html image97.gif
-\n <center><b>Fit area</b> - resizes the view to place in the visible area
-only the contents of a frame drawn with pressed left mouse button.</center>
-<hr>
-
-\image html image98.gif
-\n <center><b>Zoom</b> - allows to zoom in and out.</center>
-<hr>
-
-\image html image99.gif
-\n <center><b>Panning</b> - if the represented objects are greater that the
-visible area and you don't wish to use <b>Fit all</b> functionality, click on
-this button and you'll be able to drag the scene to see its remote
-parts.</center>
-<hr>
-
-\image html image100.gif
-\n <center><b>Global panning</b> - represents all displayed objects in
-the visible area.</center>
-<hr>
-
-\image html view_rotation_point.png
-\n <center><b>Change rotation point</b> - allows to to choose the point around
-which the rotation is performed.</center>
-
-\image html set_rotation_point_dialog1.png
-
-<center>By default the rotation point is located in the Center of the bounding
-box of an object.</center>
-
-\image html set_rotation_point_dialog2.png
-
-<center>Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
-define the coordinates of the rotation point manually.</center>
-
-<b>Set to Origin</b> button restores the default rotation point
-coordinates.\n
-<b>Select Point from View</b> button allows to select the rotation
-point in the 3D Viewer.
-<hr>
-
-\image html image89.gif
-\n <center><b>Rotation</b> - allows to rotate the selected object using the
-mouse.</center>
-
-\image html image102.gif
-
-<center>These buttons orientate the scene strictly about coordinate axes.</center>
-<hr>
-
-\image html image91.gif
-\n <center><b>Reset</b> - restores the default position (isometric) of
-objects in the scene.</center>
-<hr>
-
-\image html image103.gif
-\n <center><b>Memorise view</b> - saves the current position of
-objects in the scene.</center>
-<hr>
-
-\image html image105.gif
-\n <center><b>Restore view</b> - restores the saved position of
-objects in the scene.</center>
-<hr>
-
-\image html image86.gif
-\n <center><b>Clone view</b> - opens a new duplicate scene.</center>
-<hr>
-
-\image html image106.gif
-\n <center><b>Clipping</b> - allows to create cross-section views
-(clipping planes) of geometrical objects.</center>
-
-\image html clipping.png
-
-<ul>
-<li><b>Base point</b> - allows to define the coordinates of the base
-point for the clipping plane.</li>
-<ul>
-<li><b>Reset</b> - returns the base point to coordinate origin.</li>
-</ul>
-<li><b>Direction</b> - allows to define the orientation of the
-clipping plane.</li>
-<ul>
-<li><b>Invert</b> - allows to select which part of the object will be removed
-and which will remain after clipping.</li>
-</ul>
-<li><b>Preview</b> - allows to see the results of clipping in the
-viewer.</li>
-</ul>
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/opening_studies.doc b/doc/salome/gui/GUI/input/opening_studies.doc
deleted file mode 100644 (file)
index 0c44f27..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*!
-
-\page opening_studies_page Opening studies
-
-In \b SALOME all studies are stored in a special format *.hdf.
-
-<em>To open an existing study:</em>
-\par
-In the main toolbar click "Open document" button or from the main menu select <b>File > Open</b>
-option. From a standard Search File dialog box choose the required
-*.hdf file and click \b Open button.
-
-\image html open.jpg "&quot;Open document&quot; button"
-
-<em>To load an unloaded study (\ref saving_and_closing_studies_page
-"see also"):</em>
-\par
-From the main menu select <b>File > Connect</b> option. In the following
-dialog box select one of the studies, which has been previously
-created and unloaded and click \b Ok button:
-
-\image html loadstudy2.png
-
-\n\b Tip:  After opening an existing study, you will see its structure
-in the \ref using_object_browser_page "Object Browser". It will contain the objects created with the
-help of different components during the previous study session. If you
-right-click on one of the objects and from the associated pop-up menu
-choose <b>Open With</b> option, which will automatically launch the component
-corresponding to this object.
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/plot2d_viewer.doc b/doc/salome/gui/GUI/input/plot2d_viewer.doc
deleted file mode 100644 (file)
index e6208d6..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*!
-
-\page plot2d_viewer_page Plot 2D viewer
-
-\n <b>Plot 2d viewer</b> is destined to the representation of  2d
-plots and graphs in Post-Pro module.
-\n Its viewer toolbar gives you fast access to the following
-operations:
-
-\image html image77.gif
-<center><b>Dump View</b> - exports an object from the viewer in bmp,
-png, jpg or jpeg image format.</center>
-
-\image html image96.gif
-<center><b>Fit all</b> - scales the display to show the entire
-scene. Use this to resize the scene so that it could fit within the
-Viewer boundary.</center>
-
-\image html image97.gif
-<center><b>Fit area</b> - resizes the view to place in the visible
-area only the contents of a frame drawn with pressed left mouse
-button.</center>
-
-\image html image98.gif
-<center><b>Zoom</b> - allows to zoom in and out.</center>
-
-\image html image99.gif
-<center>\b Panning - if the represented objects are greater that the
-visible area and you don't wish to use Fit all functionality, click on
-this button and you'll be able to drag the scene to see its remote
-parts.</center>
-
-\image html image100.gif
-<center><b>Global panning</b> - allows to define the center of the
-scene presenting all displayed objects in the visible area.</center>
-
-\image html plot2d_points.gif
-<center><b>Draw Points</b> - represents points on the graph.</center>
-
-\image html plot2d_lines.gif
-<center><b>Draw Lines</b> - represents lines on the graph.</center>
-
-\image html plot2d_splines.gif
-<center><b>Draw Splines</b> - represents splines on the graph.</center>
-
-\image html plot2d_logarithmic_horizontal.gif
-<center><b>Horizontal axis logarithmic</b> - changes the scaling on
-horizontal axis to logarithmic.</center>
-
-\image html plot2d_logarithmic_vertical.gif
-<center><b>Vertical axis logarithmic</b> - changes the scaling on vertical
-axis to logarithmic.</center>
-
-\image html plot2d_legend.gif
-<center><b>Show Legend</b> - reveals all verbal and numerical
-information on the graphs.</center>
-
-\image html plot2d_settings.gif
-<center>\b Settings - calls a menu, in which you can specify advanced
-settings for your Plot 2d Viewer.</center>
-
-\image html plot2d_clone.gif
-<center><b>Clone view</b> - opens a new duplicate scene.</center>
-
-\anchor settings
-\n \image html plot2d_view_settings.png
-
-The options are as follows:
-<ul>
-<li><b>Main title:</b> the title of the XY plot. By default, it will
-consist of the names of the tables, on the basis of which the curve
-lines have been constructed.</li>
-<li><b>Curve type:</b> you can select from \b Points, \b Lines and \b Spline.</li>
-<li><b>Show legend:</b> here you can define the position of the
-description table on the XY plot (to the \b Left, to the \b Right, on
-\b Top or on \b Bottom).</li>
-<li><b>Marker size</b> - size of the points (markers) forming curve lines.</li>
-<li><b>Background color</b> of the XY plot.</li>
-<li><b>Scale mode:</b> here you can select the type of scaling (\b
-Linear or \b Logarithmic) along <b>X (Horizontal)</b> or <b>Y (Vertical)</b> axes.</li>
-</ul>
-
-You can define settings for each axis separately:
-<ul>
-<li>\b Horizontal or \b Vertical axis title.</li>
-<li><b>Grid/Axes marks:</b>  here you can define the maximum number of major
-and minor scale divisions for a specified axis. The real number of
-intervals fits to {1,2,5}*10^N, where N is a natural number, and
-doesn't exceed the maximum.</li>
-<li><b>Save settings as default:</b> If this check box is marked, all
-XY plots will be displayed with these defined properties.</li>
-</ul>
-
-*/
diff --git a/doc/salome/gui/GUI/input/postpro_preferences.doc b/doc/salome/gui/GUI/input/postpro_preferences.doc
deleted file mode 100644 (file)
index 37a094a..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-/*!
-
-\page postpro_preferences_page Post-Pro Preferences
-
-In the Post-Pro module you can set preferences, default settings,
-which can be used in later sessions with this module.
-
-<h2>MED import Preferences</h2>
-
-\image html ppref1.png
-
-<ul>
-<li><b>MED files import</b></li>
-<ul>
-<li><b>Use Build Progress</b> - when this option is checked you can choose
-all other import MED options at the moment of loading of each file
-using <b>Build Progress</b> menu, otherwise the loading will be done
-according to the <b>Preferences</b> without addressing to the
-user.</li>
-<li><b>Full MED Loading</b> - when this option is checked, the MED file is
-fully loaded in the study, and no additional access to the MED file is
-needed during the session. Reversibly, when unchecked, the MED file is
-loaded on demand. This is the default behaviour in SALOME and
-recommended for big files to optimize memory usage.</li>
-<li><b>Build at once</b> - when this option is checked, you can't
-perform any operations until the MED file is fully loaded and
-processed.</li>
-<li><b>Build fields</b> - when this option is checked, the fields are
-built automatically at loading.</li>
-<li><b>Build min/max</b> - when this option is checked, minimum and
-maximum values of the time stamps are found at loading.</li>
-<li><b>Build groups</b> - when this option is checked, the groups and
-families are built automatically at loading.</li>
-<li><b>Close dialog at finish</b> - when this option is checked, the
-dialog box is closed after loading of the selected MED file. When
-unchecked, it allows loading other MED files.</li>
-</ul>
-</ul>
-
-<br><h2>Scalar Bar Preferences</h2>
-
-\image html pref31.png
-
-<ul>
-<li><b>Scalar Range</b></li>
-<ul>
-<li><b>Scalar Mode</b> - this feature allows refining the value to be
-inspected:</li>
-<ul>
-<li><b>Modulus:</b> value of a scalar or modulus of a vector.</li>
-<li><b>Component N:</b> Nth component of a vector, a tensor or a matrix.</li>
-</ul>
-<li><b>Logarithmic Scaling</b> - this checkbox toggles logarithmic
-scaling.</li>
-<li><b>Ranges to Use</b> - you can use either Field Range or Imposed Range.</li>
-</ul>
-<li><b>Min and Max for Imposed Range</b> - in this menu  you can set
-the limits for your Imposed Range, if you have chosen to use it.</li>
-<li><b>Font</b> - in this menu you can set type, face and color for
-the font of <b>Title</b> and <b>Labels</b>.</li>
-<li><b>Colors & Labels</b> - in this menu you can set the <b>number of
-colors</b> and the <b>number of labels</b> in the Scalar bar.</li>
-<li><b>Orientation</b> - here you can choose between vertical and horizontal
-orientation of the Scalar Bar.</li>
-<li><b>Origin & Size Vertical & Horizontal</b> - allows to define
-placement (<b>X</b> and <b>Y</b>) and lookout (<b>Width</b> and
-<b>Height</b>) of Scalar Bars.</li>
-<ul>
-<li><b>X:</b> abscissa of the point of origin (from the left
-side)</li>
-<li><b>Y:</b> ordinate of the origin of the bar (from the bottom)</li>
-</ul>
-<li><b>Scalar bars default position</b></li>
-<ul>
-<li><b>Arrange Scalar Bars</b> - this option prevents superposition of
-scalar bars during visualisation of several fields in the same
-window. If checked, a separate scalar bar is displayed for each
-presentation.</li>
-</ul>
-</ul>
-
-<br><h2>Cut Lines Preferences</h2>
-
-\image html ppref2.png
-
-<ul>
-<li><b>CutLine Preferences</b></li>
-<ul>
-<li><b>Show preview</b> check box allows to edit the parameters of the
-presentation and simultaneously observe the preview of this
-presentation in the viewer.</li>
-<li><b>Invert all curves</b> check box allows to invert the resulting
-curves.</li>
-<li><b>Use absolute length</b> check box allows to use absolute length
-for curves.</li>
-<li><b>Generate Data Table:</b> If this check box is marked, <b>Post
-Pro</b> will automatically generate a data table on the basis of your
-Cut Lines presentation. This table will be created in the structure of
-the study.</li>
-<li><b>Generate Curves:</b> If this check box is marked, <b>Post Pro</b>  will
-automatically generate curve lines on the basis of values taken from
-the generated data table. These curves will be created in the
-structure of the study and can be visualized in a XY plot.</li>
-</ul>
-</ul>
-
-<br><h2>Sweep Preferences</h2>
-
-\image html ppref3.png
-
-<ul>
-<li><b>Sweeping preferences</b></li>
-<ul>
-<li><b>Mode of the Sweeping</b> - allows to choose between Linear,
-Cosinusoidal and sinusoidal sweeping.</li>
-<li><b>Time step</b> - in this menu you can set the time of
-representation of one step.</li>
-<li><b>Number of cycles</b> - in this menu you can define the number
-of times this animation will be repeated.</li>
-<li><b>Number of steps</b> - in this menu you can define the number of
-steps, which will compose the whole animation.</li>
-<li><b>Parameter varies</b> - allows to choose the range for the
-parameter: from 0 to Pi or from Pi to -Pi.</li>  
-</ul>
-</ul>
-
-<ul>
-<li><b>Animation preferences</b></li>
-<ul>
-<li><b>Speed</b> - allows to define the speed of the animation.</li>
-<li><b>Cycled animation</b> - allows to start a cycled animation of the presentation.</li>
-<li><b>Use proportional timing</b> - allows to render the animation with proportional periods of time between every frame (not depending on the time stamps).</li>
-<li><b>Clean memory at each frame</b> - this option allows to optimize the performance of the operation.</li>
-</ul>
-</ul>
-
-<br><h2>Representation Preferences</h2>
-
-\image html pref33.png
-
-<ul>
-<li><b>Representation properties</b> - these checkboxes allow to
-choose the default representation type for each field presentation.</li>
-<ul>
-<li><b>Use Shading</b> - when this option is checked, the objects will
-be displayed with shading.</li>
-<li><b>Display only on creation</b> - when this option is checked, all
-previously created presentations will be automatically removed from
-the viewer when a new presentation is created and displayed. You can
-restore the previously created presentations using the Object
-Browser.</li>
-</ul>
-</ul>
-
-<br><h2>3D Cache</h2>
-
-\image.html pref40.png
-
-<ul>
-<li><b>3D Cache Preferences</b> - allow to define the mode of usage
-and the size of the 3D Cache, which enables to save in RAM and quickly
-restore the states of field animation.</li>
-<ul>
-<li><b>Memory Mode</b> - allows to define the mode of usage
-of the 3D Cache: <b>Minimal</b> actually disables the Cache,
-<b>Limited</b> Cache size depends on the current system
-configuration.</li>
-<li><b>Memory Limit</b> - allows to define the maximum size of the 3D
-Cache</li> 
-</ul>
-</ul>
-  
-
-<br><h2>Gauss Points Preferences</h2>
-
-\image html pref34.png
-
-<ul>
-<li><b>Primitive</b> - this menu allows user to choose the graphic
-primitive to use to present the results at Gauss points in the
-viewer.</li>
-<ul>
-<li><b>Primitive type</b> - provides choice between <b>Point
-sprites</b>, <b>Open GL points</b> and <b>Geometrical Spheres</b>.</li>
-<li><b>Maximum Size (Clamp)</b> - defines the maximum size of sprite
-points ranging from 1 to 512. By default the value is set to 256
-pixels.</li>
-<li><b>Main Texture</b> -  path to the <b>Main Texture</b> (16x16
-pixels) which defines the shape of the point sprite used for
-rendering.</li>
-<li><b>Alpha Channel Texture (16*16)</b> - path to the <b>Alpha
-Channel Texture</b> which defines the texture of the point
-sprite.</li>
-<li><b>Alpha Channel Threshold</b> - defines the level of transparency
-ranging from 0 to 1.</li>
-<li><b>Geometrical Sphere Resolution</b> - defines the number of faces
-of <b>Geometry Spheres</b>.</li>
-<li><b>Notify when number of faces exceeds</b> - limitation of the
-number of faces; the user will be warned if it exceeds the given
-value.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Size</b> - in this menu you can define:</li>
-<ul>
-<li><b>Range value for min and max size</b> - these two parameters
-will be respectively multiplied by a reference length (average size of
-cells of the mesh) to define the range for minimum and maximum size of
-a point during rendering (at magnification = 100%). Default values
-are:</li>
-<ul>
-<li><b>Rainbow</b> scale: <b>min</b> = <b>10%</b>, <b>max</b> =
-<b>33%</b></li>
-<ul>
-<li>Min size is associated to the smallest real value (including
-negative values).</li>
-<li>Max size is associated to the largest real value.</li>
-</ul>
-<li><b>Bicolor</b> scale: <b>min</b> = <b>0</b> (not editable),
-<b>max</b> = <b>33%</b></li>
-<ul>
-<li>Null size is associated to the 0 scalar value.</li>
-<li>Max size is associated to the largest absolute value.</li>
-</ul>
-</ul>
-Both values are dynamically updated by the system according to the
-selected scalar bar. In the case of a Bicolor scale, the minimum value
-is set to 0 in the dialog and the control is disabled.
-<li><b>Magnification (%)</b> corresponds to the change of size of
-results at Gauss point primitives in 2D space. Acceptable values range
-from 0 to N; 100% means no magnification, 50% means half of its size,
-200% mean twice its size and so forth. By default this value is set to
-100%.</li>
-<li><b>+/- Ratio</b> corresponds to the number by which the
-magnification will be respectively multiplied or divided at edition,
-ranging from 0.01 to 10. By default this value is set to 2.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Geometry</b></li>
-<ul>
-<li><b>Size of points (%)</b> defines a value that will be multiplied
-by a reference length (representative of the average size of cells of
-the mesh) to define the size of points during rendering (at
-magnification = 100%). Default values 10%.</li>
-<li><b>Color</b> -  allows to select the color of points used for
-presentations. Click on the colored line to access to the \ref
-select_color_and_font_page "Select Color" dialog box.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Gauss Points Scalar Bar</b></li>
-<ul>
-<li><b>Active Bar</b> - this option allows to choose <b>Local</b> or
-<b>Global</b> Bar as active.</li>
-<li><b>Display Global Bar</b> - this option allows to visualize or to
-hide the Global Bar.</li>
-<li><b>Scalar Bar Mode</b> - this option allows to choose between
-<b>Bicolor</b> and <b>Rainbow</b> Scalar Bar Mode.</li>
-<li><b>Spacing</b> - allows to define Spacing from 0.01 to 1.</li>
-</ul>
-</ul>
-
-<br><br><b>Inside<b> and </b>Outside Cursor Preferences</b> allow to set
-<b>Primitives</b>, <b>Size</b> and <b>Magnification</b> for the
-respective zones.
-
-<br><h2>Picking Preferences</h2>
-
-\image html pref37.png
-
-<ul>
-<li><b>Cursor</b> - allows to adjust the Size of the cursor used for
-Picking (ranging from 0.1 to 1), the Height of the pyramids (ranging
-from 0 to 10) and the Selection cursor color.</li>
-<li><b>Tolerance</b> - defines at which distance of the cursor from
-the point it becomes selected (ranges from 0.001 to 10).</li>
-<li><b>Information window</b> - allows to define the
-<b>Transparency</b> (from 0% = opaque to 100% = transparent) and
-<b>Position</b> of the window, which can be:</li>
-<ul>
-<li><b>Centred below the point</b>, or</li>
-<li>located at <b>Top-left corner of the 3D view</b></li>
-</ul>
-<li><b>Movement of the Camera</b> can also be define by the user.</li>
-<ul>
-<li><b>Zoom at first selected point</b> - This value is used to define
-the focal distance at the first selected point (at the end of the
-movement of the camera). This value is a ratio that will be multiplied
-by the current zoom value.</li>
-<li><b>Number of steps between two positions</b> - defines the
-smoothness of camera movement at selection by the number of
-iterations. If set to 1 the camera is zoomed and centered at the point
-momentarily. Greater numbers mean very slow camera movement.</li>
-</ul>
-<li><b>Display parent mesh element</b> - allows to visualize or hide
-the patent mesh element of the selected gauss point.</li>
-</ul>
-
-<br><h2>Navigation Preferences</h2>
-
-\image html pref38.png
-
-<br>
-<ul>
-<li><b>Mouse</b></li>
-<ul>
-<li><b>Mouse Behaviour</b> - this option allows to choose one of the
-modes of work with mouse in Gauss Viewer.</li>
-<ul>
-<li><b>Salome Standard Controls</b> - allows to manipulate objects in the
-viewer with the mouse and locked Ctrl button: increase or decrease the
-zoom ratio with the left mouse button, translate object in any
-direction with the central mouse button or rotate it with the right
-mouse button.</li>
-<li><b>Keyboard Free</b> - allows to manipulate objects in the viewer
-with the mouse without locking Ctrl button. In this case the
-operations are assigned to the buttons differently: rotation is made
-with the left button, translation with the right and zoom with both
-pressed in the same time.</li>
-</ul>
-</ul>
-</ul>
-
-<ul>
-<li><b>Keyboard</b></li>
-<ul>
-<li><b>[+]/[-] Speed Increment</b> - defines the number of units by
-which the speed increases or respectively decreases after pressing [+]
-or [-] keyboard buttons.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Spacemouse</b> - a mouse-like manipulator device specially designed
-for working with 3D presentations, objects, etc. You can reassign the
-actions listed below to any of its buttons.</li>
-<ul>
-<li><b>Decrease Speed Increment</b> - decreases by 1 the speed increment used for the keyboard (same as [-] key).</li>
-<li><b>Increase Speed Increment</b> - increase by 1 the speed increment used for the keyboard (same as [+] key).</li>
-<li><b>Decrease Gauss Points Magnification</b> - divides the current magnification by the magnification ratio.</li>
-<li><b>Increase Gauss Points Magnification</b> - multiplies the current magnification by the magnification ratio.</li>
-<li><b>Dominant / combined switch</b> - toggles button to switch to dominant or combined movements.</li>
-</ul>
-</ul>
-
-<br><h2>Recorder Preferences</h2>
-
-\image html pref38.png
-
-<ul>
-<li><b>Settings</b></li>
-<ul>
-<li><b>Mode</b> - allows to choose from two recording regimes:</li>
-<ul>
-<li><b>Recording all displayed frames</b> - records exactly at the FPS rate specified by the user.</li>
-<li><b>Recording at a given FPS</b> - records only when the contents
-of the viewer change (some activity is performed).  In the AVI file
-non-recorded images are substituted with the copies of the latest
-recorded image, which produces files with lower quality but requires
-less system resources.   </li>
-</ul>
-<li><b>FPS</b> - allows to define the FPS (frames per second) rate for
-the clip. Set greater value for better quality.</li>
-<li><b>Quality</b> - allows to set the quality of the clip in the
-interval between 0 and 100.</li>
-<li><b>Progressive</b> - allows to record a progressive API
-file.</li>
-</ul>
-</ul>
-
-*/
diff --git a/doc/salome/gui/GUI/input/running_salome.doc b/doc/salome/gui/GUI/input/running_salome.doc
deleted file mode 100644 (file)
index 630c5d2..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*!
-
-\page running_salome_page Running SALOME
-
-<em>To launch SALOME:</em>
-<ol>
-<li>Install the SALOME package into a definite directory (ex. \b SALOME)
-on your hard disk. It is preferable if you use the special
-installation procedure allowing to install the  SALOME platform and
-all corresponding applications.</li>
-<li>The installation shell script will create a special file:
-<b>salome.csh</b> (CShell file) in your SALOME/KERNEL directory. This file
-contains all environment variables necessary for launching SALOME
-platform with other application products provided with SALOME
-installation package. You have a possibility to add one of them into
-your profile if you enter in the command console the following: <br><br>
-<tt>source salome.csh</tt>
-
-<b>Tip:</b> During the installation procedure you have a possibility to set your profile automatically.</li>
-
-<li> Launch SALOME platform, using the following Python script located
-in the <b>SALOME/KERNEL/bin/salome</b> directory:<br><br> 
-<ul>
-<li>\b runSalome.py [command line options]
-</ul>
-</li>
-</ol>
-
-\anchor batch_mode_run
-
-<table>
-<tr>
-<td><h2>Options</h2></td>
-<td><h2>Description</h2></td>
-</tr>
-<tr>
-<td>--\b help or -\b h</td>
-<td>print this help</td>
-</tr>
-<tr>
-<td>--\b gui or -\b g</td>
-<td>launch with GUI</td>
-</tr>
-<tr>
-<td> --\b terminal or -\b t</td>
-<td>launch without GUI in batch mode</td>
-</tr>
-<tr>
-<td>--\b logger or -\b l</td>
-<td>redirects log messages in the file <em>logger.log</em></td>
-</tr>
-<tr>
-<td>--\b file=<b>\<FILE\></b> or -\b f=<b>\<FILE\></b></td>
-<td>redirects  log messages in a custom file</td>
-</tr>
-<tr>
-<td>--\b xterm or -\b x</td>
-<td>the servers open an xterm window and log messages are displayed in this window</td>
-</tr>
-<tr>
-<td>--\b modules=\b module1,\b module2,... or -\b m=\b module1,\b module2,...</td>
-<td>list of SALOME modules which will be loaded into the module catalogue</td>
-</tr>
-<tr>
-<td>--\b embedded=<b>registry,study,moduleCatalog,cppContainer</b>,
-or -\b e=<b>registry,study,moduleCatalog,cppContainer</b></td>
-<td>embedded CORBA servers (default: registry,study,moduleCatalog,cppContainer)
-note that logger,pyContainer,supervContainer can't be embedded</td>
-</tr>
-<tr>
-<td>--\b standalone=<b>registry,study,moduleCatalog,cppContainer,pyContainer,supervContainer</b>, or
--\b s=<b>registry,study,moduleCatalog,cppContainer,pyContainer,supervContainer</b></td>
-<td>standalone CORBA servers (default: pyContainer,supervContainer)</td>
-</tr>
-<tr>
-<td>--\b containers=<b>cpp,python,superv</b>
-or -\b c=<b>cpp,python,superv</b></td>
-<td>launch of cpp, python and supervision containers</td>
-</tr>
-<tr>
-<td>--\b portkill or -\b p</td>
-<td>kill SALOME launched with the current port</td>
-</tr>
-<tr>
-<td>--\b killall or -\b k</td>
-<td>kill SALOME</td>
-</tr>
-<tr>
-<td>--<b>interp</b>=<b>n</b> or -<b>i</b>=<b>n</b></td>
-<td>number of additional xterm to open, with session environment</td>
-</tr>
-<tr>
-<td>-\b z</td>
-<td>display splash screen</td>
-</tr>
-<tr>
-<td>-\b r</td>
-<td>disable centralized exception handling mechanism</td>
-</tr>
-</table>
-
-<b>Tip:</b> If the \b runSalome.py script is launched without prompting
-any options, they will be taken by default from the file <b>SalomeApp.xml
-(SALOME/GUI/share/salome/resources/SalomeApp.xml)</b>. If you are
-constantly launching SALOME with some specific options which are
-different from the defaults, you can edit this file according to your
-requirements. So the next time you run SALOME, you won't have to enter
-these numerous command console options.
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/salome_architecture.doc b/doc/salome/gui/GUI/input/salome_architecture.doc
deleted file mode 100644 (file)
index 8849a83..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*!
-
-\page salome_architecture_page SALOME architecture
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-\b SALOME architecture is based on \b CORBA technology using
-distributed system model of applications. This architecture takes the
-concept of multitier client/server to its natural conclusion. The
-distributed system model exposes all functionality of the application
-as objects, each of which can use any of the services provided by
-other objects in the system, or even objects in other systems. The
-architecture can also blur the distinction between "client" and
-"server" because the client components can also create objects that
-behave in server-like roles. This architecture provides the ultimate
-in flexibility.
-
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-The distributed system architecture achieves its flexibility by
-encouraging (or enforcing) the definition of specific component
-interfaces. The interface of a component specifies to other components
-what services are offered by that component and how they are used. As
-long as the interface of a component remains constant, that
-component's implementation can change dramatically without affecting
-other components.
-
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-All software components (Post-Pro, Geometry, Mesh...) integrated into
-\b SALOME platform  implement predefined interfaces. Each component
-provides data for the \b SALOME study in a form of links (stored in
-the Study) to the specific data created and stored in the
-component. All components represent \b CORBA servers and it allows to
-run them on different host stations.
-
-\image html image67.gif
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-It is equally possible to create engine-independent modules. These
-modules may not use CORBA at all, and can have internal data structure
-which can be written in pure C++ (or python). Such modules are located
-inside SALOME GUI process and from the point of view of the end user
-have no difference with standard components. Such modules not using
-the standard tools of SALOME platform are defined on a special
-separated level named CAM. CAM component is the basis for new SALOME
-GUI and contains all basic functionality for working with modules
-(loading; saving, closing, customization of toolbar and menu).
-
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-Another fundamental piece of the \b SALOME architecture is the use of
-the Interface Definition Language (IDL). IDL, which specifies
-interfaces between CORBA components, is instrumental in ensuring
-CORBA's language independence. Because interfaces described in IDL can
-be mapped to any programming language, CORBA applications and
-components are thus independent of the language(s) used to implement
-them.
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-Additional information about CORBA technology
-is available at http://www.omg.org
-
-\note In \b SALOME there is a possibility to run
-definite components in the so-called \ref batch_mode_run "batch mode" without GUI provided
-by GUI component. In this case you can work with these components with
-the help of Python commands and scripts.
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-The architecture of this all-inclusive
-platform for numerical components  responds to the following
-objectives:
-<ol>
-<li>\b Flexibility :  the creation and modification of computation
-schemes must be easy. The developer must have easy access to all
-modeling parameters to create domain-specific tools adapted to new
-situations or to test new numerical algorithms. SALOME allows
-integration and implementation of numerical and physical components
-derived from existing code.</li>
-<li>\b Productivity :  the implementation of code is simple for the
-user and the reuse of components (within other environments for
-macro-components) is noticeably facilitated.</li>
-<li> \b Performance :\b  SALOME is able to more finely simulate
-phenomena that is more complex in scale and in physical coupling
-requirements. \b SALOME economically exploits the performance of used
-machines (massively parallel processors, PC clusters, etc).</li>
-<li> \b Expandability:  on the one hand, software technologies and
-physical architectures evolve rapidly compared to the development
-time, validation and use of a scientific application while on the
-other hand, the development of a database model adapted to the
-totality of exchanges between components can be achieved
-incrementally. \b SALOME  is able to easily follow these
-developments.</li>
-</ol>
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/salome_desktop.doc b/doc/salome/gui/GUI/input/salome_desktop.doc
deleted file mode 100644 (file)
index 101d77f..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*!
-
-\page salome_desktop_page SALOME desktop
-
-The main SALOME Desktop consists of the following sections and
-toolbars:
-
-\image html geomview-alt.png
-
-<b>Basic parts of the SALOME Desktop:</b>
-<ul>
-<li><b>Main menu</b> - This is a set of context-sensitive menus, which will
-be updated according the functionality of the loaded component. In
-general,  these menus contain all functional options of SALOME
-platform.</li>
-<li><b>Standard Toolbar</b> - This toolbar contains icons allowing
-creating/saving studies, correcting mistakes, copying/pasting
-objects.</li>
-<li><b>Components Toolbar</b> - This toolbar is destined for uploading
-components in SALOME platform.</li>
-<li><b>Module Toolbar</b> - This toolbar contains icons specific to the
-loaded module.</li>
-<li><b>Viewer Toolbar</b> - This is a set of tools destined for visualization
-of the presentations in the viewer.</li>
-</ul>
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;All toolbars in the
-\b SALOME Platform are context-sensitive. Loading of a definite component
-(Geometry, Post-Pro, Mesh etc.) will automatically add some additional
-toolbars specific to this component. To display/hide a definite
-toolbar, in the main menu choose <b>View > Toolbars</b>, and from this
-submenu check or uncheck the toolbar, you would like to display/hide.
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;By default all
-toolbars are located on the top of the SALOME desktop. But you can
-relocate toolbars by dragging with the mouse and dropping it in any
-place of the window.
-
-<b>Parts of  the study window:</b>
-<ul>
-<li><b>Object Browser</b> - Management of objects created or imported into
-SALOME application.</li>
-<li>\b Viewer - This window is destined for visualization of
-presentations.</li>
-<li><b>Python console</b> - Window for Python interpreter. This window
-functions like a standard document: the pop-up menu invoked by
-right-click in this window gives access to
-<b>Copy/Paste/SelectAll/ClearAll</b> options.</li>
-</ul>
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object Browser, Python
-Console, MenuBar, etc are, in fact, separate dockable windows.
-Dockable windows can be placed in special areas, on the borders of
-desktop like toolbars. You can change the size and the position of
-dockable windows, hide them or even place outside desktop. SALOME
-saves in the same file all positions and sizes of dockable windows. It
-means that the difference in settings of the same windows (for example
-Python console) is possible between different modules (the same window
-can have different size and position when other module is
-activated). Also each module can indicate which common windows are
-necessary for working, and only they will be displayed when this
-module is active.
-
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Starting from the
-version 3.0.0 Salome uses a <b>Multi-Desktop Approach</b>. Multi-desktop
-Approach means that now there is separate Desktop for each document
-(Study)  and all windows connected to a Study (viewers, dockable
-windows etc) are placed in one container. It is very comfortable,
-because you can't mix up windows from different studies. This approach
-positively differs from the classic multi document interface in case
-if many windows are used, i.e. when one document contains a lot of
-viewers, dialogs, etc. Each desktop also has its own menu and toolbar.
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/salome_preferences.doc b/doc/salome/gui/GUI/input/salome_preferences.doc
deleted file mode 100644 (file)
index 6a85158..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*!
-
-\page salome_preferences_page SALOME preferences
-
-To begin setting preferences for your study, select \b Preferences in the
-main menu, the following dialog box will appear:
-
-\image html pref11.png
-If you've just started your study and haven't yet loaded other
-modules, you'll be able to change only those settings, which refer to
-the whole GUI SALOME session. These settings will be valid for the
-whole study session.
-
-<h2>General Preferences</h2>
-
-<ul>
-<li><b>Study Properties</b></li>
-<ul>
-<li><b>MultiFile Save</b> - if checked in, your study will be saved in
-several HDF files (one file for the data created by each component
-used during the study session).</li>
-<li><b>ASCII Save</b> - if checked in, your study will be saved in
-ASCII format file (or files).</li>
-<li><b>Store positions of windows</b> -  if checked in, positions of windows
-will be saved in a special file at the end of the current session and
-then restored for a new session.</li>
-<li><b>Store/restore last GUI state</b> - if checked in, all GUI settings are
-saved with the rest of the data whenever you save the study. When the
-study is reopened, the GUI state is restored.</li>
-</ul>
-<li><b>External browser</b></li>
-<ul>
-<li>\b Application - this option allows you to set an external browser (IE,
-Netscape) which will be used for viewing SALOME reference manuals. By
-default, Mozilla is used. Press the &quot;<b>...</b>&quot; button(see
-the picture below) to browse for the application you need in the data
-tree of your computer.</li>
-<li>\b Parameters</li>
-</ul>
-<li><b>Python console properties</b> - here you can quickly set the
-parameters (style, size, face) of the font used in your Python
-console.</li>
-</ul>
-\par
-For detailed settings in \ref select_color_and_font_page "Select Font"
-dialog box press the &quot;<b>...</b>&quot; button(see the picture below).
-
-\image html image69.gif "&quot;...&quot; button"
-
-<br><h2>Viewers Preferences</h2>
-
-\image html pref12.png
-
-<ul>
-<li><b>OCC and VTK 3D Viewers</b></li>
-<ul>
-<li><b>Trihedron size</b> - this submenu allows to set the size of
-coordinate axes displayed in the viewer.</li>
-<li><b>Background Color</b> - this submenu allows to select background
-color. Click on the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Number of isolines along U</b> (or <b>V</b>) - this submenu allows to specify
-the number of isolines along the axes of coordinates.</li>
-<li><b>Relative size</b> - if checked in, trihedron axes scale to fit the
-size of the area displayed in 3D Viewer.</li>
-</ul>
-<br>
-<li><b>Plot2d Viewer</b></li>
-<ul>
-<li><b>Legend Position</b> - this submenu allows to set the default position
-of the legend, it can be located to the left, to the right, on top or
-on bottom of the graph.</li>
-<li><b>Curve Type</b> - this allows to set the representation of graphs in
-your presentations. You can see only <b>Points</b>, points connected with
-<b>Lines</b> or points connected with smooth <b>Splines</b>.</li>
-<li><b>Marker Size</b> - this submenu allows you to set the size of
-markers in your graphs</li>
-<li><b>Horizontal & Vertical Axis Scale</b> - this submenu allows you to set
-the scale for vertical and horizontal axes. It can be either <b>Linear</b> or
-<b>Logarithmic</b></li>
-<li>Background Color - this submenu allows to select the background
-color. Click on the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-</ul>
-<br>
-<li><b>Graph Supervisor</b></li>
-<ul>
-<li><b>Background Color</b> - this submenu allows to select background
-color. Click on the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Title Color</b> - this submenu allows to select title color. Click on
-the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-</ul>
-</ul>
-
-<br><h2>Directories Preferences</h2>
-
-\image html pref13.png
-
-<ul>
-<li>
-<b>Quick Directory List</b> - this section allows to create and manage
-a custom quick directory list. To add a directory in the list, press
-the "Add directory" button:
-\image html image70.gif
-
-then the &quot;<b>...</b>&quot; button and browse the data tree for the
-directory you need.
-The "Up" and "Down" buttons(see the picture below) help you to sort
-the directories in the list:
-\image html image73.gif
-
-\image html image75.gif
-To remove the selected directory from the list, press the "Delete"
-button:
-\image html image72.gif
-</li>
-</ul>
-
-<br><h2>Object Browser Preferences</h2>
-
-\image html pref14.png
-
-<ul>
-<li><b>Object browser settings</b></li>
-<ul>
-<li><b>Auto size for the first column</b> - this checkbox enables automatic
-resizing for the first column.</li>
-<li><b>Auto size for other columns</b> - this checkbox enables
-automatic resizing for the other columns.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Default columns</b> - these checkboxes allow to display or hide <b>Value</b>,
-<b>Entry</b>, <b>IOR</b> and <b>Reference entry</b> columns in the Object Browser.</li>
-</ul>
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/saving_and_closing_studies.doc b/doc/salome/gui/GUI/input/saving_and_closing_studies.doc
deleted file mode 100644 (file)
index c996b09..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*!
-
-\page saving_and_closing_studies_page Saving and closing studies
-
-In \b SALOME a study can be saved in \b HDF binary (by default) or \b ASCII
-files (see also: \ref salome_preferences_page "Setting ASCII save option").
-
-You can also specify  two options of saving your study:
-<ul>
-<li><b>In one HDF file:</b> in this case all components used during this
-study session will write their data into one common HDF file.
-</li>
-<li>
-<b>In multiple files</b> (see also: \ref salome_preferences_page
-"Setting Multifile save option") : in this
-case SALOME will create one base HDF file which will store the main
-information about the saved study and several other special files with
-particular extensions storing the data written by each component which
-has been used during this study session. Opening of this study
-requires that \b ALL saved files should be stored in the \b SAME directory.
-If you would like to copy your saved study in another directory or
-machine, you should copy all stored files. Otherwise, if you try to
-open this study, some data will be lost and it will lead to invalid
-functioning of the SALOME platform.
-</li>
-</ul>
-
-Saving a study you also save its layout, i.e. all positions and sizes
-of dockable windows. It means that the difference in settings of the
-same windows (for example Python console) is possible between
-different modules (the same window can have different size and
-position when other module is activated). Also each module can
-indicate which common windows are necessary for working, and only they
-will be displayed when this module is active.
-
-<em>To save an existing study:</em>
-\par
-In the main toolbar click "Save document" button or from the main menu
-select <b>File > Save</b> option. Your study will be automatically
-updated.
-
-\image html save.jpg "&quot;Save document&quot; button"
-
-\note If your study hasn't been previously saved, this option will
-call the standard Search File dialog box where you can enter the name
-for your study and save it.
-
-<em>To save a study with a new name:</em>
-\par
-From the main menu select <b>File > Save as</b> option. In the standard
-Search File dialog box enter a new name for your study and click \b Save
-button.
-
-<em>To save the current layout of the GUI:</em>
-\par
-From the main menu select <b>File > Save VISU State</b>. The current
-state of the graphic interface is published in Object Browser in the
-folder GUI states and can be at any time \b Restored, \b Renamed or \b
-Deleted. This operation saves and allows to
-restore almost all GUI settings: names, position, zooming and panning
-of viewers  and all displayed objects (in Post-Pro module only).
-
-<em>To close a study:</em>
-\par
-In the main toolbar click "Close document" button or  from the main menu select <b>File > Close</b>
-option or click on the cross in the upper right corner of the study
-window.
-
-\image html image94.gif "&quot;Close document&quot; button"
-
-\note If your study hasn't been previously saved, this option will
-call the following dialog box with several options:
-
-\image html closestudy.png
-
-\n\b Unload option allows to unload your current study from the SALOME
-Desktop. In the same working session you can  reload it again (see:
-\ref opening_studies_page "Opening studies"). But if you quit the SALOME application, all changes
-in the unloaded study will be lost.
-
-*/
diff --git a/doc/salome/gui/GUI/input/select_color_and_font.doc b/doc/salome/gui/GUI/input/select_color_and_font.doc
deleted file mode 100644 (file)
index 96b570a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*!
-
-\page select_color_and_font_page Select Color and Font
-
-<b>Select Color</b> and <b>Select Font</b> menus are used in many
-Preferences.
-
-<br><h2>Select color</h2>
-
-\image html selectcolor.png
-
-This menu  allows to choose from either predefined <b>Basic Colors</b>
-grouped in the upper left corner of the window or <b>Custom Colors</b>, which
-you can define yourselves. To define a Custom Color, click on one of
-the Custom Color cells, select the color you need in the field of
-colors or by typing in its numeric parameters in the lower right
-corner of the window, then click <b>Add to Custom Colors</b> button. The
-chosen color will be added to <b>Custom Colors</b> table.
-
-<br><h2>Select font</h2>
-
-\image html selectfont.png
-
-This menu provides a wide choice of \b Fonts, <b>Font Styles</b> and
-\b Sizes. Characters can be underlined or struck out. It is possible to
-preview them in the \b Sample window. \b Script dialog-box gives the
-possibility to use not only Latin and Latin Extended but also
-Cyrillic, Greek, Arabic, Runic and many other subsets.
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/setting_preferences.doc b/doc/salome/gui/GUI/input/setting_preferences.doc
deleted file mode 100644 (file)
index 49802ee..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*!
-
-\page setting_preferences_subpage Setting Preferences
-
-In \b SALOME you can set preferences for each module in the common editor
-of preferences. SALOME preferences refer to the whole GUI SALOME
-session, other preferences are module-specific and are accessible only
-after you load a respective module.
-\n When you change settings (click \b OK or \b Apply button) each module
-receives the notification about what preferences are changed. You can
-also click \b Defaults button to restore default preferences or \b Close
-button to quit the menu without any changes. 
-\n \b Import button allows to load a user file containing preferences
-from your home directory through a standard Import dialog box.
-
-\image html import.png
-
-This file has no extension and by default starts with
-.SalomeApprc. followed by Salome version number. There exists one file
-for each Salome version in use.
-\n The preferences, set during the current study session, are
-automatically saved in this file at the end of the session. Next time
-you launch SALOME application, these preferences will be restored.
-
-\note The preferences you set will be default preferences for all \b new
-objects, but they are not retroactive and do not automatically apply
-to the existing objects.
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/setting_preferences_chapter.doc b/doc/salome/gui/GUI/input/setting_preferences_chapter.doc
deleted file mode 100644 (file)
index b04a761..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*!
-
-\page setting_preferences_page Setting Preferences
-
-<ul>
-<li>\subpage setting_preferences_subpage</li>
-<li>\subpage select_color_and_font_page</li>
-<li>\subpage salome_preferences_page</li>
-<li>\subpage geometry_preferences_page</li>
-<li>\subpage mesh_preferences_page</li>
-<li>\subpage postpro_preferences_page</li>
-</ul>
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/setting_study_properties.doc b/doc/salome/gui/GUI/input/setting_study_properties.doc
deleted file mode 100644 (file)
index 2101f43..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*!
-
-\page setting_study_properties_page Setting study properties
-
-<em>To view the properties of the current study:</em>
-\par
-From the main menu select \b File > \b Properties option. The following
-dialog box will appear:
-
-\image html studyproperties.png
-
-This dialog box gives complete information about your study.
-
-<em>To change the name of the study author:</em>
-\par
-In this dialog box click on the \b Author field and enter a new name.
-
-<em>To view the list of changes made with your study:</em>
-\par
-In this dialog box click on the \b Modifications field and scroll it
-down. Each record contains the following information: date and time of
-modification of the study, name of the user, who has made these
-changes.
-
-<em>To lock your study for modifications:</em>
-\par
-In the dialog box shown on the picture above click on the \b Locked
-field and choose \b Yes item.
-
-In this case your study will be locked for any kind of modifications
-for all users. Next time you try to edit it, you will see the
-following warning message:
-
-\image html lockedstudy.png
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/study_management_chapter.doc b/doc/salome/gui/GUI/input/study_management_chapter.doc
deleted file mode 100644 (file)
index 54ffda2..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*!
-
-\page study_management_page Study management
-
-<ul>
-<li>\subpage creating_new_study_page</li>
-<li>\subpage opening_studies_page</li>
-<li>\subpage saving_and_closing_studies_page</li>
-<li>\subpage editing_studies_page</li>
-<li>\subpage displaying_studies_page</li>
-<li>\subpage working_with_python_scripts_page</li>
-<li>\subpage setting_study_properties_page</li>
-</ul>
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/using_catalog_generator.doc b/doc/salome/gui/GUI/input/using_catalog_generator.doc
deleted file mode 100644 (file)
index af50de5..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*!
-
-\page using_catalog_generator_page Using Catalog Generator (for advanced users)
-
-SALOME platform is an open platform for
-integration of your custom components, which can used in the same way
-as typical modules provided in the standard installed package. The
-<b>Catalog Generator</b> tool serves for implementation of the interface of
-your custom component. It allows to generate from IDL description of
-your component interface its xml description.  The component xml
-description allows SALOME application to know about the component and
-its services and provides the possibility to call the component
-services, for example, inside Supervisor module.
-
-If you have a look at runSalome,
-runSalomeWithPort scripts running SALOME application, which are stored
-in build/bin directory you will see that SALOME_ModuleCatalog_Server
-is started with two xml files as its input parameters:
-\b CatalogModuleGeneral.xml and \b CatalogModulePersonnel.xml. These two
-files store the descriptions of interfaces and services of all
-components, provided with typical SALOME package. To add a new
-component into SALOME platform you should either update one of these
-existing xml files with generated xml description of your component or
-create a new one.
-
-<em>To open the Catalog Generator:</em>
-\par
-From the main menu choose <b>Tools > Catalog Generator</b>, the following
-dialog box will appear:
-
-\image html cataloggenerator.png
-
-<br>In this dialog box you can specify:
-<ul>
-<li>Name and location of the IDL file describing the interface of your
-component (Click the \b Browse button to find it using the data tree).</li>
-<li>Name and location of an existing XML file, which will be updated
-with the interface of you component or name and desired location of a
-new XML file, which will be generated (Click the \b Browse button to find
-it using the data tree).</li>
-<li>Name of the author.</li>
-<li>Name of the component.</li>
-<li>Name of the user.</li>
-<li>Version.</li>
-<li>Capability of multi study support.</li>
-<li>Type of the component.</li>
-<li>Icon of your component (Click the \b Browse button to find it using
-the data tree).</li>
-</ul>
-
-\note If you have chosen to create a new xml file containing the
-description of your component, don't forget to specify it as
-input parameter for SALOME_ModuleCatalog_Server in the file, you are
-using as a running script of SALOME platform (in runSalomeWithPort,
-for example).
-
-When launching SALOME next time you will see your module alongside other components.
-
-\b Tip: You can use the <b>Catalog Generator</b> tool, if you would like to \b
-test the functionality of your new component. After implementation of
-your component interface, launch SUPERVISION module where you can try
-using the services of your new component. (see also: Adding factory
-nodes)
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/using_object_browser.doc b/doc/salome/gui/GUI/input/using_object_browser.doc
deleted file mode 100644 (file)
index 5aea269..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*!
-
-\page using_object_browser_page Using Object Browser
-
-The <b>Object Browser</b> in SALOME is destined for displaying the
-structure of the current study in a tree-like form. It contains:
-
-<ul>
-<li>components, loaded during the current session</li>
-<li>objects created with the help of different components (The objects
-created with the help of a definite component are located in the
-folder having the name of this component)
-</li>
-<li>references to different objects (they are highlighted in red)</li>
-</ul>
-
-\image html objectbrowser1.png
-
-\note The <b>Object Browser</b> is destined to getting quick access to
-different objects created during SALOME session. All pop-up menus
-associated with the objects displayed in the Object Browser are
-context-sensitive. So it depends on a definite currently loaded SALOME
-component what options you will see in the pop-up menu, if you
-right-click on a definite object in the Object Browser.
-
-The Object Browser may contain supplementary attributes of the objects
-displayed in additional columns. By default, these columns are not
-displayed -  displaying/hiding these columns is possible through
-\ref salome_preferences_page "setting study preferences" or
-right-clicking on the attributes bar and toggling the necessary
-attributes.
-
-\image html objectbrowser2.png
-
-<ul>
-<li>\b Entry  - Identification index of the object in the structure of
-the study</li>
-<li>\b IOR -  Interoperable Object Reference</li>
-<li><b>Reference entry</b>  -  Identification index of the references
-to the objects</li>
-<li>\b Value  -  Displays the value of the first object attribute</li>
-</ul>
-
-\note <b>Entry, IOR and Reference entry</b> attributes are displayed for debugging purposes only.
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/using_registry_tool.doc b/doc/salome/gui/GUI/input/using_registry_tool.doc
deleted file mode 100644 (file)
index a652a78..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*!
-
-\page using_registry_tool_page Using Registry tool
-
-\b Registry tool is in the SALOME platform is destined for providing
-information about the processes (components), which have ever been
-launched in the current study session.
-
-<em>To view the Registry:</em>
-\par
-From the main menu choose <b>Tools > Registry display</b>, the
-following dialog box will appear:
-
-\image html registry1.png
-
-\b Running tab of this dialog box displays a list of the currently
-started processes (components) with supplementary information on each
-of them divided into columns:
-
-<ul>
-<li>\b Component: name of the started component
-<li>\b PID: process identification number
-<li>\b User \b Name: name of the user launching the component
-<li>\b Machine: name of the machine, on which the process has been started
-<li>\b begins: date and time of the starting of the component
-<li>\b hello: date and time of the last call to the component
-</ul>
-
-\b History tab displays a list of all processes, which have ever been
-launched within this study session. It contains the same supplementary
-information on each of the processes (components).
-
-\b Refresh button allows to refresh the current list of processes
-(components).
-
-\b Interval button allows to set an interval for refreshment of the
-current list of processes (components).
-
-\image html registry3.png
-
-<em>To display complete information on a definite process
-(component):</em>
-\par
-Double-click on this process (component). The following window will
-appear:
-
-\image html registry4.png
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/viewers_chapter.doc b/doc/salome/gui/GUI/input/viewers_chapter.doc
deleted file mode 100644 (file)
index 44271fc..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*!
-
-\page viewers_page Viewers
-
-<ul>
-<li>\subpage occ_3d_viewer_page</li>
-<li>\subpage vtk_3d_viewer_page</li>
-<li>\subpage plot2d_viewer_page</li>
-</ul>
-
-*/
diff --git a/doc/salome/gui/GUI/input/vtk_3d_viewer.doc b/doc/salome/gui/GUI/input/vtk_3d_viewer.doc
deleted file mode 100644 (file)
index fe7f91f..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*!
-
-\page vtk_3d_viewer_page VTK 3D Viewer
-
-<b>VTK 3D viewer</b> is the default viewer for Mesh Module, allowing to
-visualize meshes. It is also used in Post-Pro module for all 3D
-presentations except for Gauss Points.
-
-The functionalities of VTK viewer are available via its Viewer
-Toolbar. Buttons marked with small downward triangles have extended
-functionality which can be accessed by locking on them with left mouse
-button.  
-
-\image html image157.gif "Viewer Toolbar"
-
-<hr>
-\image html image77.gif
-\n <center><b>Dump View</b> - exports an object from the viewer in bmp, png, jpg
-or jpeg image format.</center>
-<hr>
-
-\image html image88.gif
-\n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
-<hr>
-
-\image html image96.gif
-\n <center><b>Fit all</b> - scales the presentation so that it could
-fit within the Viewer boundaries. </center>
-<hr>
-
-\image html image97.gif
-\n <center><b>Fit area</b> - resizes the view to place in the visible area
-only the contents of a frame drawn with pressed left mouse button.</center>
-<hr>
-
-\image html image98.gif
-\n <center><b>Zoom</b> - allows to zoom in and out.</center>
-<hr>
-
-\image html image99.gif
-\n <center><b>Panning</b> - if the represented objects are greater that the
-visible area and you don't wish to use <b>Fit all</b> functionality, click on
-this button and you'll be able to drag the scene to see its remote
-parts.</center>
-<hr>
-
-\image html image100.gif
-\n <center><b>Global panning</b> - allows to select a point to be the
-center of the presentation showing all displayeed objects in the
-visible ares <center>
-<hr>
-
-\image html view_rotation_point.png
-\n <center><b>Change rotation point</b> - allows to to choose the point around
-which the rotation is performed.</center>
-
-\image html set_rotation_point_dialog1.png
-
-<center>By default the rotation point is located in the Center of the bounding
-box of an object.</center>
-
-\image html set_rotation_point_dialog2.png
-
-<center>Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
-define the coordinates of the rotation point manually.</center>
-
-<b>Set to Origin</b> button restores the default rotation point
-coordinates.\n
-<b>Select Point from View</b> button allows to select the rotation
-point in the 3D Viewer.
-<hr>
-
-\image html image89.gif
-\n <center><b>Rotation</b> - allows to rotate the selected object using the
-mouse.</center>
-
-\image html image102.gif
-
-<center>These buttons orientate the scene strictly about coordinate axes.</center>
-<hr>
-
-\image html image91.gif
-\n <center><b>Reset</b> - restores the default position (isometric) of
-objects in the scene.</center>
-<hr>
-
-\image html urbutton.png
-\n <center><b>Update Rate</b> - allows to define the Update Rate for
-the presentations displayed in the viewer</center>
-
-\image html updaterate.png
-
-<ul>
-<li><b>Desired Update Rate, FPS</b> - allows to set the target Update
-Rate</li>
-<li><b>Still Update Rate, FPS</b> - allows to set the Update Rate for
-the periods when both the user and the application do not perform any
-actions in the viewer</li>
-<li><b>Current Update Rate, FPS</b> - shows the Update Rate currently
-available on your configuration</li>
-<li><b>Number of Cells</b> - shows the number of cells currently in
-display</li> 
-</ul>
-
-\image html image108.gif
-\n <center><b>Scaling</b> - represents objects deformed (stretched or
-stuffed) along the axes of coordinates.</center>
-<hr>
-
-\image html image109.gif
-\n <center><b>Graduated axes</b> - allows to define parameters of axes
-and graduate them.</center>
-
-\image html graduatedaxes1.png
-
-<ul>
-<li><b>Axis name</b></li>
-<ul>
-<li><b>Is visible</b> - if checked the axis name is displayed in the
-viewer.</li>
-<li><b>Name</b> - allows to redefine the name of the axis.</li>
-<li><b>Font</b> - allows to define color and properties of the font of
-axis name.</li>
-</ul>
-<li><b>Labels</b></li>
-<ul>
-<li><b>Is visible</b> - if checked the labels are displayed in the
-viewer.</li>
-<li><b>Number</b> - allows to define the number of labels.</li>
-<li><b>Offset</b> - allows to define the distance between labels.</li>
-<li><b>Font</b> - allows to define color and properties of the font of
-labels names.</li>
-</ul>
-<li><b>Tick marks</b></li>
-<ul>
-<li><b>Is visible</b> - if checked the tick marks are displayed in the
-viewer.</li>
-<li><b>Length</b> - allows to define the length of tick marks.</li>
-</ul>
-<li><b>Is visible</b> - if checked the axis is displayed in the
-viewer. </li>
-</ul>
-
-*/
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/input/working_with_python_scripts.doc b/doc/salome/gui/GUI/input/working_with_python_scripts.doc
deleted file mode 100644 (file)
index 83bfe3e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*!
-
-\page working_with_python_scripts_page Working with Python Scripts
-
-\b SALOME Platform can be launched in the batch mode, without Graphical
-User Interface, and operated with the use of Python scripts, which can
-fulfill most of the necessary tasks, however, the process of scripting
-is quite time consuming and rather error-prone.
-\n This problem has been resolved by the possibility to automatically
-generate a set of Python scripts from data created with SALOME GUI,
-which greatly increases the productivity of using SALOME platform in
-the batch mode. This mechanism can convert a SALOME Study in one or
-several Python scripts, which can be stored and imported later to
-re-create the content of the original study. The first script is a
-SALOME document, which re-creates the SALOME Study, adds the
-stored Salome components to the SALOME and automatically calls
-Python scripts of the second type containing component specific Python
-function calls. This architecture gives great flexibility in manual
-modification of the generated scripts because you can modify only one
-of the component specific Python scripts without touching others, thus
-avoiding expert knowledge of Python API of unused components.
-
-To Dump a  SALOME Study in one or several scripts, in the main menu
-select \b File --> <b>Dump study</b>
-\n The following dialog box allowing to browse for the location and
-define the name for a Python file will appear:
-
-\image html dumpstudy.png
-
-\par
-<ul>
-<li>
-<b>Publish in study</b> - if checked in, the component objects created by
-Python commands will be published in the created Study when the script
-is played, otherwise the objects will not be published in the Study.
-</li>
-<li>
-<b>Save GUI state</b> - if checked in, the current application layout will be
-saved in the Python file.
-</li>
-</ul>
-To confirm your choice click \b Save.
-
-Reversibly it is possible to load a saved Python Script selecting in
-the main menu \b File -> <b>Load Script</b>.
-
-\image html loadscript.png
-
-\par
-To confirm your choice click \b Open.
-
-*/
diff --git a/doc/salome/gui/GUI/kernel/about_salome_pro_architecture.htm b/doc/salome/gui/GUI/kernel/about_salome_pro_architecture.htm
deleted file mode 100755 (executable)
index fea72b8..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>About SALOME architecture</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { margin-left:40px; }\r
-p.whs2 { font-family:'Times New Roman' , serif; text-align:justify; text-indent:48px; }\r
-p.whs3 { text-indent:48px; font-weight:bold; font-family:'Times New Roman' , serif; text-align:justify; }\r
-img_whs4 { border:none; width:445px; height:288px; border-style:none; }\r
-p.whs5 { text-indent:48px; font-family:'Times New Roman' , serif; text-align:justify; font-weight:normal; }\r
-p.whs6 { font-family:'Times New Roman'  , serif; text-align:justify; font-weight:bold; text-indent:8px; background-image:url('../texture_horiz_ltbluebubbles.jpg'); }\r
-img_whs7 { border:none; width:35px; height:37px; float:none; border-style:none; }\r
-p.whs8 { font-family:'Times New Roman' , serif; text-align:justify; font-weight:bold; text-indent:8px; }\r
-p.whs9 { margin-left:40px; font-family:'Times New Roman' , serif; }\r
-p.whs10 { font-family:'Times New Roman' , serif; margin-left:40px; }\r
-ul.whs11 { list-style:disc; }\r
-p.whs12 { font-family:'Times New Roman' , serif; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("About SALOME\nSALOME architecture");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">&nbsp;SALOME \r
- architecture</h1>\r
-\r
-<p class="whs2"><span style="font-weight: bold;"><B>SALOME \r
- </B></span>architecture is based on <span style="font-weight: bold;"><B>CORBA</B></span> \r
- technology using distributed system model of applications. This architecture \r
- takes the concept of multitier client/server to its natural conclusion. \r
- The distributed system model exposes all functionality of the application \r
- as objects, each of which can use any of the services provided by other \r
- objects in the system, or even objects in other systems. The architecture \r
- can also blur the distinction between &quot;client&quot; and &quot;server&quot; \r
- because the client components can also create objects that behave in server-like \r
- roles. This architecture provides the ultimate in flexibility.</p>\r
-\r
-<p class="whs2"><span style="font-family: 'Times New Roman', serif;">The \r
- distributed system architecture achieves its flexibility by encouraging \r
- (or enforcing) the definition of specific component interfaces. The interface \r
- of a component specifies to other components what services are offered \r
- by that component and how they are used. As long as the interface of a \r
- component remains constant, that component's implementation can change \r
- dramatically without affecting other components. </span></p>\r
-\r
-<p class="whs3"><span style="font-weight: normal;">All \r
- software components (Post-Pro, Geometry, Mesh...) integrated into </span>SALOME \r
- <span style="font-weight: normal;">platform &nbsp;implement \r
- predefined interfaces. Each component provides data for the </span>SALOME<span \r
- style="font-weight: normal;"> study in a form of links (stored in the \r
- Study) to the specific data created and stored in the component. All components \r
- represent</span> CORBA <span style="font-weight: normal;">servers and \r
- it allows to run them on different host stations.</span></p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs2"><img src="../image67.gif" width="445px" height="288px" border="0" class="img_whs4"></p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs5">It is equally possible to create engine-independent \r
- modules. These modules may not use CORBA at all, and can have internal \r
- data structure which can be written in pure C++ (or python). Such modules \r
- are located inside SALOME GUI process and from the point of view of the \r
- end user have no difference with standard components. Such modules not \r
- using the standard tools of SALOME platform are defined on a special separated \r
- level named CAM. CAM component is the basis for new SALOME GUI and contains \r
- all basic functionality for working with modules (loading; saving, closing, \r
- customization of toolbar and menu).</p>\r
-\r
-<p class="whs5">Another fundamental piece of the <span \r
- style="font-weight: bold;"><B>SALOME</B></span> architecture is the use of the \r
- Interface Definition Language (IDL). IDL, which specifies interfaces between \r
- CORBA components, is instrumental in ensuring CORBA's language independence. \r
- Because interfaces described in IDL can be mapped to any programming language, \r
- CORBA applications and components are thus independent of the language(s) \r
- used to implement them. </p>\r
-\r
-<p class="whs3"><span style="font-weight: normal;">Additional \r
- information about CORBA technology is available at </span><span style="text-indent: 8px;"><a \r
- href="http://www.omg.org">www.omg.org</a></span><span style="font-weight: normal;"> \r
- &nbsp;</span></p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs6"><span \r
- style="font-weight: normal;">&nbsp;<img src="../note1.gif" x-maintain-ratio="TRUE" width="35px" height="37px" border="0" class="img_whs7">In </span>SALOME<span style="font-weight: normal;"> there \r
- is a possibility to run definite components in the so-called </span><a href="running_salome_pro.htm#batchmode">batch mode</a><span style="font-weight: normal;"> \r
- without GUI provided by GUI component. In this case you can work with \r
- these components with the help of Python commands and scripts. </span>&nbsp;</p>\r
-\r
-<p class="whs8">&nbsp;</p>\r
-\r
-<p class="whs9">The \r
- architecture of this all-inclusive platform for numerical components &nbsp;responds \r
- to the following objectives: </p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs11">\r
-       \r
-       <li style="margin-left: -20px;"\r
-               class=kadov-p><p class="whs12"><span \r
- style="font-weight: bold;"><B>Flexibility</B></span> : &nbsp;the \r
- creation and modification of computation schemes must be easy. The developer \r
- must have easy access to all modeling parameters to create domain-specific \r
- tools adapted to new situations or to test new numerical algorithms. SALOME \r
- allows integration and implementation of numerical and physical components \r
- derived from existing code. </p></li>\r
-</ul>\r
-\r
-<p class="whs12">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs11">\r
-       \r
-       <li style="margin-left: -20px;"\r
-               class=kadov-p><p class="whs12"><span \r
- style="font-weight: bold;"><B>Productivity</B></span> : &nbsp;the \r
- implementation of code is simple for the user and the reuse of components \r
- (within other environments for macro-components) is noticeably facilitated.</p></li>\r
-</ul>\r
-\r
-<p class="whs12">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs11">\r
-       \r
-       <li style="margin-left: -20px;"\r
-               class=kadov-p><p class="whs12"><span \r
- style="font-weight: bold;"><B>Performance</B></span> : &nbsp;<span \r
- style="font-weight: bold;"><B>SALOME</B></span> \r
- is able to more finely simulate phenomena that is more complex in scale \r
- and in physical coupling requirements. <span style="font-weight: bold;"><B>SALOME \r
- </B></span>economically exploits the performance of used machines (massively \r
- parallel processors, PC clusters, etc).</p></li>\r
-</ul>\r
-\r
-<p class="whs12">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs11">\r
-       \r
-       <li style="margin-left: -20px;"\r
-               class=kadov-p><p class="whs12"><span \r
- style="font-weight: bold;"><B>Expandability</B></span>: &nbsp;on \r
- the one hand, software technologies and physical architectures evolve \r
- rapidly compared to the development time, validation and use of a scientific \r
- application while on the other hand, the development of a database model \r
- adapted to the totality of exchanges between components can be achieved \r
- incrementally. <span style="font-weight: bold;"><B>SALOME</B></span> &nbsp;is \r
- able to easily follow these developments.</p></li>\r
-</ul>\r
-\r
-<p class="whs12">&nbsp;</p>\r
-\r
-<p class="whs12">&nbsp;</p>\r
-\r
-<p class="whs12">&nbsp;</p>\r
-\r
-<p class="whs12">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Introduction to SALOME ','introduction_to_salome_pro.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs12">&nbsp;</p>\r
-\r
-<p class="whs12">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/about_salome_pro_help_system.htm b/doc/salome/gui/GUI/kernel/about_salome_pro_help_system.htm
deleted file mode 100755 (executable)
index 0159d82..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>About SALOME help system</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { font-family:'Times New Roman' , serif; }\r
-p.whs2 { font-family:'Times New Roman' , serif; text-indent:48px; }\r
-p.whs3 { font-family:'Times New Roman' , serif; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("Using this reference manual\nAbout SALOME help system");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">About SALOME help system</h1>\r
-\r
-<p class="whs2">Welcome \r
- to SALOME help system. This on-line help has been created in the HTML \r
- format with the help of Java applets. It can be launched in any WEB browser \r
- (Internet Explorer, Netscape Navigator and others) and on any platform \r
- (Windows, Macintosh, Linux and UNIX).</p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs3">The SALOME reference \r
- manual contains a set of topics which are divided into different chapters \r
- describing the functionality of different modules of the SALOME platform. \r
- This help system contains a wide variety of <a href="navigating_topics.htm" style="font-family: 'Times New Roman', serif;">navigation \r
- components</a> and <a href="using_left-hand_tabs.htm" style="font-family: 'Times New Roman', serif;">search \r
- utilities</a> which will help you to get acquainted with all features \r
- of SALOME. </p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs3">&nbsp;\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Navigating topics','navigating_topics.htm','Using left-hand tabs','using_left-hand_tabs.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/application.png b/doc/salome/gui/GUI/kernel/application.png
deleted file mode 100644 (file)
index c9fd6fd..0000000
Binary files a/doc/salome/gui/GUI/kernel/application.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/kernel/batchmode.png b/doc/salome/gui/GUI/kernel/batchmode.png
deleted file mode 100644 (file)
index c439d7e..0000000
Binary files a/doc/salome/gui/GUI/kernel/batchmode.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/kernel/choicepage.png b/doc/salome/gui/GUI/kernel/choicepage.png
deleted file mode 100644 (file)
index e3afcc5..0000000
Binary files a/doc/salome/gui/GUI/kernel/choicepage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/kernel/creating_a_new_study.htm b/doc/salome/gui/GUI/kernel/creating_a_new_study.htm
deleted file mode 100755 (executable)
index e8655a8..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Creating a new study</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { text-align:justify; }\r
-p.whs2 { font-family:'Arial Black' , sans-serif; font-style:italic; }\r
-p.whs3 { color:#ff0000; font-style:italic; margin-left:40px; text-align:justify; }\r
-img_whs4 { border:none; width:24px; height:29px; float:none; border-style:none; }\r
-p.whs5 { margin-left:0px; text-align:justify; }\r
-p.whs6 { margin-left:0px; font-style:italic; text-align:justify; color:#000000; font-family:'Arial Black' , sans-serif; }\r
-p.whs7 { margin-left:40px; text-align:justify; }\r
-p.whs8 { font-style:italic; color:#ff0000; margin-left:40px; text-align:justify; }\r
-p.whs9 { margin-left:0px; font-weight:bold; text-align:justify; }\r
-p.whs10 { font-weight:bold; margin-left:0px; text-align:justify; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs5 {margin-left:1pt; }";\r
-  strNSS += "p.whs6 {margin-left:1pt; }";\r
-  strNSS += "p.whs9 {margin-left:1pt; }";\r
-  strNSS += "p.whs10 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nStudy management\nCreating a new study");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Creating a new study</h1>\r
-\r
-<p>Study is a document within GUI, an abstraction layer between actual \r
- document data (probably, remote data available through CORBA) and data \r
- presentation (in the Object Browser). It contains a tree of Data Object \r
- instances.</p>\r
-\r
-<p>&nbsp;</p>\r
-\r
-<p class="whs2">To \r
- create a new study:</p>\r
-\r
-<p class="whs3"><span style="font-style: normal; color: #000000;"><font color=black >From \r
- the main menu select </font></span><span style="font-style: normal;\r
-                                                                                       color: #000000;\r
-                                                                                       font-weight: bold;"><font color=black ><B>File &gt; \r
- New </B></font></span><span style="font-style: normal; color: #000000;"><font color=black >or in the \r
- standard toolbar click </font></span><img src="../pics/newsticn.jpg" x-maintain-ratio="TRUE" width="24px" height="29px" border="0" class="img_whs4"> <span style="font-style: normal; color: #000000;"><font color=black >icon.</font></span></p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs5">Your study will be created \r
- with default name <span style="font-weight: bold;"><B>Study1</B></span>. In SALOME \r
- you can create several studies. </p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">In addition to it, you \r
- can create several windows with different activated viewers (VTK, OCC, \r
- Plot2d) for each study.</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs6">To create a new window \r
- for a definite study:</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs7">1. &nbsp;Make \r
- your study <span style="font-weight: bold;"><B>active:</B></span> maximize it \r
- (if it minimized) or &nbsp;click \r
- on the top control zone of the study window.</p>\r
-\r
-<p class="whs8">&nbsp;</p>\r
-\r
-<p class="whs7">2. &nbsp;From \r
- the main menu select <span style="font-weight: bold;"><B>Window &gt; New \r
- Window </B></span>and from the submenu choose the viewer, which will be activated \r
- in a new window. </p>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<p class="whs5">The window for your study \r
- will be created with a default name <span style="font-weight: bold;"><B>Study1</B></span>.<span \r
- style="font-weight: bold;"> <B></B></span></p>\r
-\r
-<p class="whs9">&nbsp;</p>\r
-\r
-<p class="whs10">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Displaying studies','displaying_studies.htm','Introduction to GUI','../introduction_to_gui.htm','Opening studies','opening_studies.htm','SALOME desktop','salome_pro_desktop.htm','Saving and closing studies','saving_a_study.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/displaying_studies.htm b/doc/salome/gui/GUI/kernel/displaying_studies.htm
deleted file mode 100755 (executable)
index ce1e0b7..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Displaying studies</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { text-align:justify; }\r
-p.whs2 { font-weight:bold; text-align:justify; margin-left:40px; }\r
-img_whs3 { border:none; width:811px; height:513px; float:none; border-style:none; }\r
-p.whs4 { font-style:italic; color:#ff0000; margin-left:40px; text-align:justify; }\r
-p.whs5 { font-weight:bold; margin-left:0px; text-align:justify; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs5 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nStudy management\nDisplaying studies");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Displaying studies</h1>\r
-\r
-<p>Starting from SALOME version 3.0.0. you are able to work in a multi-desktop \r
- environment, which means that you can open as many studies as you need, \r
- place them wherever you wish on the desktop, in brief, work with Salome \r
- Platform like with a normal Windows application.</p>\r
-\r
-<p>Such windows as Object Browser and Python Console are dockable and also \r
- can be placed at any part of the desktop.</p>\r
-\r
-<p>Only one study window in representation area can be active. You can \r
- change their size and move any windows between representation areas. When \r
- an area becomes empty, it is not displayed.</p>\r
-\r
-<p>All windows are placed inside tabs where you can switch between them. \r
- If there are several windows (viewers) in your current study and you want \r
- to display more then one at the same time, you can split representation \r
- area into two parts, in horizontal or vertical direction, to create two \r
- representation areas with windows be placed in them. To do this, right-click \r
- on the tab and select <span style="font-weight: bold;"><B>Split Vertically</B></span> \r
- or <span style="font-weight: bold;"><B>Split Horizontally</B></span>. </p>\r
-\r
-<p>&nbsp;</p>\r
-\r
-<p>For example, on this screen-shot the active zone has been split horizontally \r
- to be able to work with OCC and VTK viewers simultaneously, the one of \r
- the windows was split again, at this time vertically to see Plot 2d graphs. \r
- </p>\r
-\r
-<p>&nbsp;</p>\r
-\r
-<p class="whs2"><img src="../pics/neo-view2.png" x-maintain-ratio="TRUE" width="811px" height="513px" border="0" class="img_whs3"></p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Creating a new study','creating_a_new_study.htm','Introduction to GUI','../introduction_to_gui.htm','Opening studies','opening_studies.htm','SALOME desktop','salome_pro_desktop.htm','Saving and closing studies','saving_a_study.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/editing_studies.htm b/doc/salome/gui/GUI/kernel/editing_studies.htm
deleted file mode 100755 (executable)
index 68d8497..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Editing studies</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { text-align:justify; }\r
-p.whs2 { text-align:justify; }\r
-img_whs3 { border:none; float:none; width:30px; height:30px; border-style:none; }\r
-p.whs4 { margin-left:0px; font-style:italic; text-align:justify; color:#000000; font-family:'Arial Black' , sans-serif; }\r
-p.whs5 { margin-left:40px; text-align:justify; }\r
-img_whs6 { border:none; width:48px; height:26px; float:none; border-style:none; }\r
-p.whs7 { text-align:justify; margin-left:0px; font-size:12pt; }\r
-p.whs8 { margin-left:0px; text-align:justify; }\r
-p.whs9 { margin-left:0px; font-weight:bold; text-align:justify; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs4 {margin-left:1pt; }";\r
-  strNSS += "p.whs7 {margin-left:1pt; }";\r
-  strNSS += "p.whs8 {margin-left:1pt; }";\r
-  strNSS += "p.whs9 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nStudy management\nEditing studies");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Editing studies</h1>\r
-\r
-<p class="whs2"><img src="../i_blue.jpg" x-maintain-ratio="TRUE" width="30px" height="30px" border="0" class="img_whs3"><span style="font-weight: bold;"><B>SALOME \r
- </B></span>has <span style="font-weight: bold;"><B>Copy/Paste </B></span>functionality \r
- allowing to edit your study within a definite component: </p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs4">To copy/paste a definite \r
- object:</p>\r
-\r
-<p class="whs5">In the main toolbar \r
- click one of the icons <img src="../pics/copy-paste.jpg" x-maintain-ratio="TRUE" width="48px" height="26px" border="0" class="img_whs6"> or from the main menu choose <span \r
- style="font-weight: bold;"><B>Edit &gt; Copy/Paste</B></span> option. </p>\r
-\r
-<p class="whs7"><span lang=EN-US><font size=3 style="font-size:12pt;">The availability of </font></span><span \r
- lang=EN-US\r
-       style="font-weight: bold;"><B>Copy/Paste</B></span><span lang=EN-US> operations \r
- depends on the module and the nature of an operation or an object, so \r
- if the module does not provide this functionality, it won't be available.</span></p>\r
-\r
-<p class="whs8">&nbsp;</p>\r
-\r
-<p class="whs9">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Creating a new study','creating_a_new_study.htm','Displaying studies','displaying_studies.htm','Introduction to GUI','../introduction_to_gui.htm','Opening studies','opening_studies.htm','SALOME desktop','salome_pro_desktop.htm','Saving and closing studies','saving_a_study.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/getting_properties_of_the_study.htm b/doc/salome/gui/GUI/kernel/getting_properties_of_the_study.htm
deleted file mode 100755 (executable)
index 5f56db4..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Getting properties of the study</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { text-align:justify; }\r
-p.whs2 { font-style:italic; text-align:justify; color:#000000; font-family:'Arial Black' , sans-serif; }\r
-p.whs3 { font-style:italic; color:#ff0000; text-align:justify; }\r
-p.whs4 { margin-left:40px; text-align:justify; }\r
-img_whs5 { border:none; width:332px; height:236px; float:none; border-style:none; }\r
-p.whs6 { margin-left:0px; text-align:justify; }\r
-img_whs7 { border:none; width:221px; height:123px; float:none; border-style:none; }\r
-p.whs8 { margin-left:0px; font-weight:bold; text-align:justify; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs6 {margin-left:1pt; }";\r
-  strNSS += "p.whs8 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nStudy management\nSetting study properties");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Setting study properties</h1>\r
-\r
-<p class="whs2">To view the properties \r
- of the current study:</p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs4">From the main menu select \r
- <span style="font-weight: bold;"><B>File &gt; Properties</B></span> option. The \r
- following dialog box will appear:</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs4"><img src="../pics/studyproperties.png" x-maintain-ratio="TRUE" width="332px" height="236px" border="0" class="img_whs5"></p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs6">This dialog box gives \r
- complete information about your study. </p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class=TODO>To change the name of the study author:</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs4">In this dialog box click \r
- on the <span style="font-weight: bold;"><B>Author</B></span> field and enter \r
- a new name.</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class=TODO>To view the list of changes made with your study:</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs4">In this dialog box click \r
- on the <span style="font-weight: bold;"><B>Modifications</B></span> field and \r
- scroll it down. Each record contains the following information: date and \r
- time of modification of the study, name of the user, who has made these \r
- changes. &nbsp;&nbsp;&nbsp;</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class=TODO>To lock your study for modifications:</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs4">In the dialog box shown \r
- on the picture above click on the <span style="font-weight: bold;"><B>Locked \r
- </B></span>field and choose <span style="font-weight: bold;"><B>Yes</B></span> item. \r
- </p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs6">In this case your study \r
- will be locked for any kind of modifications for all users. Next time \r
- you try to edit it, you will see the following warning message:</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs4"><img src="../pics/lockedstudy.png" x-maintain-ratio="TRUE" width="221px" height="123px" border="0" class="img_whs7"></p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs8">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Creating a new study','creating_a_new_study.htm','Displaying studies','displaying_studies.htm','Introduction to GUI','../introduction_to_gui.htm','Opening studies','opening_studies.htm','SALOME desktop','salome_pro_desktop.htm','Saving and closing studies','saving_a_study.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs8">&nbsp;</p>\r
-\r
-<p class="whs8">&nbsp;</p>\r
-\r
-<p class="whs8">&nbsp;</p>\r
-\r
-<p class="whs8">&nbsp;</p>\r
-\r
-<p class="whs8">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/getting_started2.htm b/doc/salome/gui/GUI/kernel/getting_started2.htm
deleted file mode 100755 (executable)
index b355d9e..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Getting started2</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { text-align:justify; }\r
-p.whs2 { text-align:justify; }\r
-p.whs3 { margin-left:40px; text-align:justify; }\r
-img_whs4 { border:none; width:604px; height:376px; float:none; border-style:none; }\r
-img_whs5 { border:none; width:30px; height:30px; float:none; border-style:none; }\r
-p.whs6 { text-align:justify; background-image:url('../texture_horiz_ltbluebubbles.jpg'); }\r
-img_whs7 { border:none; width:36px; height:38px; float:none; border-style:none; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nGetting started");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Getting started</h1>\r
-\r
-<p class="whs2">When you start the SALOME Platform, the \r
- following initial desktop window appears:</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"><img src="../pics/view2.png" x-maintain-ratio="TRUE" width="604px" height="376px" border="0" class="img_whs4"></p>\r
-\r
-<p class="whs2"><img src="../i_blue.jpg" x-maintain-ratio="TRUE" width="30px" height="30px" border="0" class="img_whs5"> In general, the SALOME platform \r
- is destined for performance of different numerical calculations and &nbsp;visualization \r
- of the resulting data. For that purpose, in the SALOME environment the \r
- following notion is used &nbsp;- \r
- <span style="font-weight: bold;"><B>Study. </B></span></p>\r
-\r
-<p class="whs2">Study represents a working document in \r
- which you can realize all operations connected with the SALOME functionality. \r
- </p>\r
-\r
-<p class="whs2">SALOME is a multi-study platform. It means \r
- that simultaneously you can work with several studies. <span>&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs6"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs7">To proceed working in SALOME you should create or open a new \r
- study. &nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Creating a new study','creating_a_new_study.htm','Introduction to GUI','../introduction_to_gui.htm','SALOME desktop','salome_pro_desktop.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/introduction.bak b/doc/salome/gui/GUI/kernel/introduction.bak
deleted file mode 100644 (file)
index 7fe0eb4..0000000
+++ /dev/null
@@ -1,2088 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<!--(==============================================================)-->\r
-<!--(Document created with RoboEditor. )============================-->\r
-<!--(==============================================================)-->\r
-\r
-<head>\r
-\r
-<title>SALOME Installation Wizard Help</title>\r
-\r
-<!--(Meta)==========================================================-->\r
-\r
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">\r
-<meta name=Author content="Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)">\r
-<meta name=Copyright content="2002-2006 CEA">\r
-<meta name=generator content="RoboHELP by eHelp Corporation - www.ehelp.com">\r
-<meta name=generator-major-version content=0.1>\r
-<meta name=generator-minor-version content=1>\r
-<meta name=filetype content=kadov>\r
-<meta name=filetype-version content=1>\r
-<meta name=page-count content=1>\r
-<meta name=layout-height content=18589>\r
-<meta name=layout-width content=901>\r
-\r
-\r
-\r
-<!--(Style Sheet)===================================================-->\r
-\r
-<style>\r
-<!--\r
-\r
-A:visited {\r
-       color: #551a8b;\r
-}\r
-\r
-A:active {\r
-       color: #ff0000;\r
-}\r
-\r
-A:link {\r
-       color: #0000ee;\r
-}\r
-\r
--->\r
-</style>\r
-\r
-\r
-<!--(Body)==========================================================-->\r
-\r
-\r
-</head>\r
-\r
-<body style="color: #000000;">\r
-\r
-<p style="text-align: center;"\r
-       align=center>&nbsp; </p>\r
-\r
-<!--(Table)=========================================================-->\r
-<table nosave\r
-               x-use-null-cells\r
-               style="width: 100%;"\r
-               width=100%>\r
-\r
-<tr nosave>\r
-<td nosave>\r
-<h1><a href="http://www.opencascade.com"><img src="logocorp.png"\r
-                                                                                               style="width: 139px;\r
-                                                                                                               height: 47px;\r
-                                                                                                               border-style: none;\r
-                                                                                                               border-style: none;"\r
-                                                                                               width=139\r
-                                                                                               height=47\r
-                                                                                               border=0> </a></h1>\r
-</td>\r
-<td>\r
-<h3 style="text-align: center;"\r
-       align=center><font style="font-size: xx-large;"\r
-                                               size=7><font style="color: #000099;"\r
-                                                                       color=#000099>SALOME Installation Wizard \r
- Help</font></font></h3>\r
-</td>\r
-<td>\r
-<div style="text-align: right;"\r
-       align=right>\r
-<!--kadov_tag{{<implicit_p>}}--><a href="http://www.opencascade.org/SALOME/"><img \r
- src="application.png"\r
-       style="width: 109px;\r
-                       height: 47px;\r
-                       border-style: none;\r
-                       border-style: none;"\r
-       width=109\r
-       height=47\r
-       border=0> </a>\r
-</div></td></tr>\r
-</table>\r
-\r
-<div style="text-align: right;"\r
-       align=right>\r
-&nbsp; \r
-</div>\r
-\r
-\r
-<!--(HR)============================================================-->\r
-<hr style="/*begin!kadov{{*/ float: aligncenter; /*}}end!kadov*/ ">\r
-\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#install_from_wizard">Installing products \r
- with the Installation Wizard</a></li>\r
-       \r
-       <ul>\r
-               \r
-               <li class=kadov-p\r
-                       class=kadov-p><a href="#gui_mode">GUI mode</a></li>\r
-               \r
-               <li class=kadov-p\r
-                       class=kadov-p><a href="#batch_mode">Batch mode</a></li>\r
-               \r
-               <li class=kadov-p\r
-                       class=kadov-p><a href="#env_files">Environment files</a></li>\r
-       </ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#check_version_proc">Notes on check products \r
- version procedure</a></li>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#pick_up_env">Pick up the environment</a></li>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#xml_files">Modifying XML configuration \r
- file</a></li>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#new_products">Implementing installation \r
- scripts for the new products</a></li>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#finish_buttons">Customizing Readme page \r
- buttons</a></li>\r
-</ul>\r
-\r
-\r
-<!--(HR)============================================================-->\r
-<hr style="/*begin!kadov{{*/ float: aligncenter; /*}}end!kadov*/ ">\r
-\r
-\r
-<h3><a name=install_from_wizard></a>Installing products with the <font \r
- style="color: #ff0000;"\r
-       color=#FF0000>Installation Wizard</font></h3>\r
-\r
-<span>The Installation Wizard can be launched in two modes: </span><span \r
- style="font-weight: bold;">GUI </span><span>and </span><span \r
- style="font-weight: bold;">batch</span><span>. \r
- <br>\r
-The root directory of the Installation Wizard contains Python script </span><span \r
- style="font-weight: bold;">runInstall</span><span>. To run the Installation \r
- Wizard just type <b>runInstall</b> in the terminal window: \r
-\r
-</span><p>[ python ] <b>runInstall </b>[options]</p>\r
-\r
-<p>Without options this script will launch the SALOME Installation Wizard \r
- in the default mode (GUI).<br>\r
-The default installation settings can be overridden by using command line \r
- options. Each option has a short and a long notation:</p>\r
-\r
-<p><b style="font-weight: bold;">-g / --gui</b></p>\r
-\r
-<div style="margin-left: 40px;">\r
-<span>Runs the Installation Wizard in the GUI mode (this is the default \r
- mode). \r
-</span></div>\r
-\r
-<p><b style="font-weight: bold;">-b / --batch</b></p>\r
-\r
-<div style="margin-left: 40px;">\r
-<span>Runs the Installation Wizard in the terminal mode. \r
-</span></div>\r
-\r
-<p><b style="font-weight: bold;">-f FILE / --file=</b><span \r
- style="font-weight: bold;">FILE</span></p>\r
-\r
-<div style="margin-left: 40px;">\r
-<span>The XML configuration file to be used by the Installation Wizard.&nbsp; \r
- If this option is not used then the installation script tries to define \r
- the <i>Linux </i>version and use the corresponding XML file if it exists. \r
- For examle, for </span><span style="color: rgb(0, 0, 153);">Linux Mandrake \r
- 10.1</span><span>&nbsp; the <b>config_Mandrake_10.1.xml</b>&nbsp; file \r
- will be used by default. If no appropriate file is found, the file <b>config.xml</b> \r
- will be used. This file refers to the basic target platform which is </span><span style="color: rgb(0, 0, 153);">Linux Mandrake 10.1</span><span> for SALOME \r
- 3.0 and newer. If </span><span \r
- style="font-weight: bold;">config.xml</span><span> \r
- file is not found either, a warning message box is shown (in GUI mode) \r
- or printed to the console (in batch mode) and the Installation Wizard \r
- quits. \r
-</span></div>\r
-\r
-<p><b style="font-weight: bold;">-d DIR / --target=DIR</b></p>\r
-\r
-<div style="margin-left: 40px;">\r
-<span>The target directory SALOME platform is to be installed to. If used, \r
- this option overrides the default target directory, given in the configuration \r
- XML file (usually</span><span \r
- style="font-weight: bold;"> ${HOME}/salome_&lt;version&gt;</span><span>, \r
- see <a href="#xml_files"\r
-               style="font-size: 12pt;">here</a> for more details). \r
-</span></div>\r
-\r
-<p><b style="font-weight: bold;">-t DIR / --tmp=DIR </b></p>\r
-\r
-<div style="margin-left: 40px;">\r
-<span>The directory, which should be used for temporary files. If given, \r
- this option overrides the default temporary directory, given in the configuration \r
- xml file (usually </span><span \r
- style="font-weight: bold;">/tmp</span><span>, \r
- see <a href="#xml_files"\r
-               style="font-size: 12pt;">here</a> for more information). \r
-</span></div>\r
-\r
-<p><b style="font-weight: bold;">-a / --all-from-sources</b></p>\r
-\r
-<div style="margin-left: 40px;">\r
-<span>Forces all the products to be installed from sources (including all \r
- SALOME modules). If this option is used, all default installation modes \r
- for all products are ignored.<br>\r
-This option is helpful when the user wants to install SALOME on the platform \r
- which is not officially supported. In this case, the user can try to run \r
- the SALOME Installation Wizard with the </span><span \r
- style="font-weight: bold;">-a</span><span> \r
- option in order to build all the products from sources.</span><span style="font-weight: bold; color: #ff0000;"><br>\r
-Note, that this is a time-consuming operation which can take more than \r
- 24 hours depending on the computer.</span><span> \r
-</span></div>\r
-\r
-<p><b style="font-weight: bold;">-h / --help</b></p>\r
-\r
-<div style="margin-left: 40px;">\r
-<span>Prints help information on the Installation Wizard's use. \r
-</span></div>\r
-\r
-<p><b style="font-weight: bold;">-v / --version</b></p>\r
-\r
-<div style="margin-left: 40px;">\r
-<span>Prints version information (</span><span \r
- style="font-weight: bold;">Note: \r
- </span><span>this is the Installation Wizard's version number, not the \r
- number of SALOME platform version). \r
-</span></div>\r
-\r
-<p>The installation procedure supports different <span style="color: rgb(0, 0, 153);">Linux \r
- </span>platforms and installs various installation 3d-party prerequisite \r
- products which are required by SALOME platform. As it was mentioned above, \r
- the basic target platform for SALOME 3.0 and newer is <span style="color: rgb(0, 0, 153);">Linux \r
- Mandrake 10.1</span>.<br>\r
-Use of configuration XML files gives a flexible way to modify the list \r
- of products to be installed by the Installation Wizard without changing \r
- the program source code. Just create your own XML configuration file and \r
- implement installation scripts for the prerequisite products you need \r
- and then use this XML file with the Installation Wizard. This can be done, \r
- for example, for some <span style="color: rgb(0, 0, 153);">Linux </span>platform \r
- which is not supported directly by the Installation Wizard. See <a href="#xml_files"\r
-       style="font-size: 12pt;">Modifying XML configuration file</a> and <a \r
- href="#new_products"\r
-       style="font-size: 12pt;">Implementing installation scripts for the \r
- new products</a> sections for more information. </p>\r
-\r
-<h3 style="margin-left: 40px;"><a name=gui_mode></a>GUI mode</h3>\r
-\r
-<p>The <font \r
- style="color: #ff0000;"\r
-       color=#FF0000>Installation Wizard</font> GUI has been developed \r
- using <span style="color: rgb(0, 0, 153);">Trolltech's </span><span \r
- style="font-weight: bold;">Qt \r
- 3.0.5 </span>toolkit. After launching the Installation Wizard in the GUI \r
- mode the wizard window is shown to the user. This wizard guides the user \r
- through several subsequent pages. To navigate between the pages use <i>&quot;Next&quot;</i> \r
- and <i>&quot;Back&quot;</i> buttons in the lower part of the wizard window. \r
- The <i>&quot;Cancel&quot;</i> button closes the wizard window&nbsp;and \r
- quits the installation procedure after the user's confirmation. The <i>&quot;Help&quot;</i> \r
- button opens an additional window to show help information. </p>\r
-\r
-<p>The first &quot;<span style="font-style: italic;">Introduction&quot;</span> \r
- page is shown in <a href="#IntroPage">Figure 1</a>. Skip this page by \r
- clicking <i>&quot;Next&quot;</i>: </p>\r
-\r
-<a name=IntroPage></a>\r
-\r
-<p style="text-align: center;"\r
-       align=center>&nbsp;</p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><img alt="Intro page"\r
-                                               src="intropage.png"\r
-                                               style="width: 586px;\r
-                                                               height: 364px;\r
-                                                               border-style: none;\r
-                                                               border-style: none;"\r
-                                               width=586\r
-                                               height=364\r
-                                               border=0> </p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><b style="font-weight: bold;">Figure 1:</b> &quot;Introduction&quot; \r
- page</p>\r
-\r
-<p>In the second page you are proposed to enter the target directory where \r
- the SALOME platform should be installed to. You can also click <i>&quot;Browse...&quot;</i> \r
- and choose the destination folder using the standard browse directory \r
- dialog box. <br>\r
-If the directory you want to install products to does not exist you are \r
- prompted to confirm directory creation. If you type a wrong directory \r
- path, or if you do not have write permissions for the directory you use, \r
- the corresponding message box is shown.</p>\r
-\r
-<p>You can also change the temporary directory (which is used to store \r
- temporary files required for the installation).<br>\r
-In the bottom part of the window the total disk space required for the \r
- installation and for the temporary files is displayed (see below for more \r
- details).</p>\r
-\r
-<p>In the GUI mode the Installation Wizard provides two different options \r
- to install the SALOME platform: <span \r
- style="font-weight: bold;">basic</span> \r
- (default option) and <span \r
- style="font-weight: bold;">advanced.</span> \r
- In the <span \r
- style="font-weight: bold;">basic</span> mode the user should \r
- enter the target installation directory and temporary folder. All other \r
- installation options are taken from the XML configuration file (see <a \r
- href="#Product_page1">Fig.2</a>):</p>\r
-\r
-<a name=Product_page1></a>\r
-\r
-<p style="text-align: center;"\r
-       align=center>&nbsp;</p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><img alt="Intro page"\r
-                                               src="productpage1.png"\r
-                                               style="width: 586px;\r
-                                                               height: 364px;\r
-                                                               border-style: none;\r
-                                                               border-style: none;"\r
-                                               width=586\r
-                                               height=364\r
-                                               border=0> </p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><b style="font-weight: bold;">Figure 2:</b> &quot;Installation \r
- settings&quot; </p>\r
-\r
-<p>In addition, you have a choice to use &quot;Install all products from \r
- sources&quot; check box. If this option is turned on, all the products \r
- will be installed from the sources (using their own build procedures). \r
- This check box corresponds to the <span \r
- style="font-weight: bold;">--all-from-sources</span> \r
- (<span \r
- style="font-weight: bold;">-a</span>) option of the <span \r
- style="font-weight: bold;">runInstall</span> \r
- script (see <a href="#install_from_wizard">here</a>). </p>\r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><img \r
- src="../note1.gif"\r
-       x-maintain-ratio=TRUE\r
-       style="border: none;\r
-                       width: 35px;\r
-                       height: 37px;\r
-                       float: none;\r
-                       border-style: none;\r
-                       border-style: none;"\r
-       width=35\r
-       height=37\r
-       border=0><span \r
- style="font-weight: bold;"> Installation of all products \r
- from sources is a long-time operation.</span></p>\r
-\r
-<p>To switch to the <span \r
- style="font-weight: bold;">advanced</span> option, \r
- click <i>&quot;More...&quot;</i> (see <a href="#ProductPage2">Fig.3</a> \r
- ).</p>\r
-\r
-<p>In the advanced mode you have a possibility to select products to be \r
- installed. Each product can have several options of installation: you \r
- have a possibility to use the native product (provided with Linux distribution \r
- and installed in the system folders), install already precompiled binaries, \r
- build the product from sources or not install it at all. Available options \r
- and default option are taken from the XML configuration file. You can \r
- mark the products you want to install by clicking the corresponding radio-buttons \r
- in the list view in the left part of the page. <br>\r
-Note, that some products may require some other pre-requisite products \r
- to be installed (or these prerequisite products should be already available \r
- on your computer). The installation procedure has a special feature to \r
- automatically mark these products in the list view. For example, in order \r
- to install <b><i>PyQt</i></b> it is necessary to have <b><i>gcc, Python</i></b>,<b><i> \r
- Qt</i></b> and <b><i>Sip</i></b> installed. Therefore all these products \r
- will also be <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->turned \r
- on when you check on <b><i>PyQt</i></b>. This feature can be switched \r
- off by clicking the <i>&quot;Automatic dependencies&quot;</i> checkbox. \r
- Turn on this checkbox if you want all prerequisite products to be automatically \r
- checked when you select some product to be installed. Turn off this checkbox \r
- if you want to disable this feature.</p>\r
-\r
-<a name=ProductPage2></a>\r
-\r
-<p style="text-align: center;"\r
-       align=center>&nbsp;</p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><img src="productpage.png"\r
-                                               alt="Products page"\r
-                                               style="float: none;\r
-                                                               width: 586px;\r
-                                                               height: 525px;\r
-                                                               border-style: none;\r
-                                                               border-style: none;"\r
-                                               width=586\r
-                                               height=525\r
-                                               border=0> </p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><b style="font-weight: bold;">Figure 3:</b> &quot;Installation \r
- settings&quot; page in the 'advanced' mode</p>\r
-\r
-<p>If you want to use native products (like <span \r
- style="font-weight: bold;">gcc</span>, \r
- <span \r
- style="font-weight: bold;">tcl</span>, etc.), select <i>&quot;use \r
- native&quot; </i>option. <br>\r
-Special button in the right part of the page - <i>&quot;Unselect All&quot; \r
- </i>- allows to reset quickly all products to the <i>&quot;not install&quot;</i> \r
- state. </p>\r
-\r
-<p>There are also two checkboxes on this page: <i>&quot;SALOME sources&quot;</i> \r
- and <i>&quot;SALOME binaries&quot;</i>. These three-state checkboxes allow \r
- quick selecting/unselecting sources/binaries packages of SALOME modules \r
- for installation.</p>\r
-\r
-<p>In addition, when some SALOME sources are selected, one more check box \r
- becomes available: <span style="font-style: italic;">&quot;Build SALOME \r
- sources&quot;</span>. If this option is turned on, the selected SALOME \r
- modules will be built and installed from sources.<span \r
- style="font-weight: bold;"><br>\r
-&nbsp;</span></p>\r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><span \r
- style="font-weight: bold;"><img src="../note1.gif"\r
-                                                               x-maintain-ratio=TRUE\r
-                                                               style="border: none;\r
-                                                                               width: 36px;\r
-                                                                               height: 38px;\r
-                                                                               float: none;\r
-                                                                               border-style: none;\r
-                                                                               border-style: none;"\r
-                                                               width=36\r
-                                                               height=38\r
-                                                               border=0> If this check box is turned on, \r
- the corresponding SALOME module binaries package installation is disabled, \r
- because of <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->SALOME \r
- module sources and binaries packages conflict </span>(see <a href="#ProductPage3">Fig. \r
- 4</a> below). </p>\r
-\r
-<a name=ProductPage3></a>\r
-\r
-<p style="text-align: center;"\r
-       align=center><img src="productpage2.png"\r
-                                               alt="Products page"\r
-                                               style="width: 586px;\r
-                                                               height: 525px;\r
-                                                               border-style: none;\r
-                                                               border-style: none;"\r
-                                               width=586\r
-                                               height=525\r
-                                               border=0> </p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><b style="font-weight: bold;">Figure 4:</b> &quot;Build \r
- SALOME sources&quot; check box usage</p>\r
-\r
-<p>The box at the right side of the page displays the information about \r
- currently highlighted product: name, version and short description, required \r
- disk space, disk space required for temporary files, list of prerequisites \r
- (this information is provided in the XML file) and current user choice. \r
- </p>\r
-\r
-The <i>&quot;Disk space required:&quot;</i> field displays how much disk \r
- space on the hard drive is required for installation of selected products. \r
\r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><b style="font-weight: bold;"><img src="../note1.gif"\r
-                                                               x-maintain-ratio=TRUE\r
-                                                               style="border: none;\r
-                                                                               width: 36px;\r
-                                                                               height: 38px;\r
-                                                                               float: none;\r
-                                                                               border-style: none;\r
-                                                                               border-style: none;"\r
-                                                               width=36\r
-                                                               height=38\r
-                                                               border=0></b><span \r
- style="font-weight: bold;">Please, \r
- take into account that the displayed amount of required disk space is \r
- approximate and may differ when you install products on your hard drive.</span> \r
- </p>\r
-\r
-<p>The installation procedure uses a special directory to store temporary \r
- files. The <i>&quot;Space for temporary files:&quot;</i> field shows the \r
- information about required disk space on the hard drive for extracting \r
- and compiling the selected products. You can change the temporary directory \r
- - just type a path to the folder you want to use or click on the corresponding \r
- <i>&quot;Browse...&quot;</i> button. <span \r
- style="font-weight: bold;"><br>\r
-&nbsp;</span></p>\r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><span><b \r
- style="font-weight: bold;"><img src="../note1.gif"\r
-                                                               x-maintain-ratio=TRUE\r
-                                                               style="border: none;\r
-                                                                               width: 36px;\r
-                                                                               height: 38px;\r
-                                                                               float: none;\r
-                                                                               border-style: none;\r
-                                                                               border-style: none;"\r
-                                                               width=36\r
-                                                               height=38\r
-                                                               border=0></b></span><b \r
- style="font-weight: bold;"><span style="font-weight: normal;">A</span></b>ctually, \r
- temporary files are not stored directly in the directory entered by the \r
- user. The Installation Wizard creates an additional folder in this directory \r
- named something like INSTALLWORK<span \r
- style="font-weight: bold;">XXXXX</span> \r
- where XXXXX is a unique number. This allows to launch several Installation \r
- Wizards simultaneously. This temporary directory is removed automatically \r
- when the installation finishes.</p>\r
-\r
-<p>The installation procedure also checks the available disk space. If \r
- there is not enough disk space on your hard drive you will see a corresponding \r
- error message box. </p>\r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><b style="font-weight: bold;"><img src="../note1.gif"\r
-                                                               x-maintain-ratio=TRUE\r
-                                                               style="border: none;\r
-                                                                               width: 36px;\r
-                                                                               height: 38px;\r
-                                                                               float: none;\r
-                                                                               border-style: none;\r
-                                                                               border-style: none;"\r
-                                                               width=36\r
-                                                               height=38\r
-                                                               border=0>You are strongly recommended not \r
- to use directory names containing spaces. </b>Otherwise you can experience \r
- some troubles with the installation.<b> </b></p>\r
-\r
-<p>To proceed further click <i>&quot;Next&quot;</i>. At this moment the \r
- program will make some tests to check installation settings: if there \r
- is enough disk space on the hard drive, check for native products installation, \r
- dependencies (prerequisites) for each product you have selected to be \r
- installed. If any test fails you will see the corresponding warning message \r
- box. Otherwise the wizard will proceed to the next page: </p>\r
-\r
-<a name=ChoicePage></a>\r
-\r
-<p style="text-align: center;"\r
-       align=center>&nbsp;</p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><img src="choicepage.png"\r
-                                               alt="Choice page"\r
-                                               style="width: 586px;\r
-                                                               height: 485px;\r
-                                                               border-style: none;\r
-                                                               border-style: none;"\r
-                                               width=586\r
-                                               height=485\r
-                                               border=0> </p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><b style="font-weight: bold;">Figure 5:</b> &quot;Check \r
- your choice&quot; page</p>\r
-\r
-<p>This page summarizes the installation options you've made on the previous \r
- pages. You can check again your choice and change it if necessary by getting \r
- back to the previous page. <br>\r
-When you are sure that everything is OK, click <i>&quot;Next&quot;</i> \r
- to follow to the <a href="#ProgressPage">next page</a>. </p>\r
-\r
-<a name=ProgressPage></a>\r
-\r
-<p style="text-align: center;"\r
-       align=center>&nbsp;</p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><img alt="Progress page"\r
-                                               src="progresspage1.png"\r
-                                               style="width: 586px;\r
-                                                               height: 364px;\r
-                                                               border-style: none;\r
-                                                               border-style: none;"\r
-                                               width=586\r
-                                               height=364\r
-                                               border=0></p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><b style="font-weight: bold;">Figure 6:</b> &quot;Installation \r
- progress&quot; page</p>\r
-\r
-<p style="text-align: justify;">To start installation of the selected products \r
- click &quot;Start&quot;. It launches the shell installation script and \r
- you will be able to see the output of the script in the <!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}-->dialog \r
- topmost frame. If any errors occur during the installation progress the \r
- corresponding messages will be printed to the log window in bold red font.</p>\r
-\r
-<p style="text-align: justify;">It is possible to break the installation \r
- at any time by clicking &quot;Stop&quot;. Then you can get back to the \r
- previous pages if you wish to change installation settings or restart \r
- installation by pressing again &quot;Start&quot; button.</p>\r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><b><span \r
- style="font-weight: bold;"><img src="../note1.gif"\r
-                                                               x-maintain-ratio=TRUE\r
-                                                               style="border: none;\r
-                                                                               width: 36px;\r
-                                                                               height: 38px;\r
-                                                                               float: none;\r
-                                                                               border-style: none;\r
-                                                                               border-style: none;"\r
-                                                               width=36\r
-                                                               height=38\r
-                                                               border=0> I</span></b><span \r
- style="font-weight: bold;">n the current implementation \r
- it is not possible to resume the stopped installation process; it will \r
- be re-started from the very beginning.</span> </p>\r
-\r
-<a name=ProgressPage1></a>\r
-\r
-<p style="text-align: center;"\r
-       align=center>&nbsp;</p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><img alt="Progress page"\r
-                                               src="progresspage.png"\r
-                                               style="width: 586px;\r
-                                                               height: 364px;\r
-                                                               border-style: none;\r
-                                                               border-style: none;"\r
-                                               width=586\r
-                                               height=364\r
-                                               border=0> </p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><b style="font-weight: bold;">Figure 7:</b> &quot;Installation \r
- progress&quot; page: installation in progress</p>\r
-\r
-<p>The <i>&quot;Installation Status&quot;</i> frame window shows you the \r
- progress of installation. &quot;<font \r
- style="color: #ff0000;"\r
-       color=#FF0000>Waiting</font>&quot; \r
- status means that installation of this product has not been started yet. \r
- The product currently being installed is marked as &quot;<font style="color: #ff9900;"\r
-       color=#FF9900>Processing</font>&quot;. All installed products have \r
- &quot;<font style="color: #33ff33;"\r
-                       color=#33FF33>Completed</font>&quot; status. </p>\r
-\r
-<p>You can abort installation and close the installation procedure using \r
- <i>&quot;Cancel&quot;</i> button. </p>\r
-\r
-&nbsp; \r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><span \r
- style="font-weight: bold;"><b style="font-weight: bold;"><img src="../note1.gif"\r
-       x-maintain-ratio=TRUE\r
-       style="border: none;\r
-                       width: 36px;\r
-                       height: 38px;\r
-                       float: none;\r
-                       border-style: none;\r
-                       border-style: none;"\r
-       width=36\r
-       height=38\r
-       border=0>T</b>his button sends the signal &quot;SIGTERM&quot; to the \r
- shell script. The script tries to clear all temporary files. The process \r
- of removing temporary files can take some time, so the installation wizard \r
- will wait 3 seconds before closing.</span> </p>\r
-\r
-<p>At the end of installation (all selected products have been installed \r
- successfully) you can go back to the previous pages to start a new installation \r
- or click <i>&quot;Next&quot; </i>to go the Readme page: </p>\r
-\r
-<a name=readmepage></a>\r
-\r
-<p style="text-align: center;"\r
-       align=center>&nbsp;</p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><img alt="Read page"\r
-                                               src="readmepage.png"\r
-                                               style="width: 586px;\r
-                                                               height: 484px;\r
-                                                               border-style: none;\r
-                                                               border-style: none;"\r
-                                               width=586\r
-                                               height=484\r
-                                               border=0> </p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><b style="font-weight: bold;">Figure 8:</b> &quot;Finish \r
- installation&quot; page</p>\r
-\r
-<p>In this page you can read important information about the Instalation \r
- Wizard itself and some tips: how to run and test SALOME or how to build \r
- SALOME from the sources. This is the contents of the README file which \r
- you can find in the root directory of the Installation Wizard. <br>\r
-You can also launch SALOME Desktop from this page or read the Release Notes \r
- file by clicking on the corresponding buttons in the lower part of the \r
- page (see <a href="#xml_files">here</a> and <a href="#finish_buttons">here</a> \r
- for more information about customizing these buttons).</p>\r
-\r
-<h3 style="margin-left: 40px;"><a name=batch_mode></a>Batch mode</h3>\r
-\r
-<p>To launch the Installation Wizard in the batch mode use <span \r
- style="font-weight: bold;">-b</span> \r
- (<span \r
- style="font-weight: bold;">--batch</span>) parameter.<br>\r
-In this mode the GUI wizard is not shown but all the installation status \r
- is displayed directly in the console. In the batch mode the user does \r
- not have a possibility to change installation settings which are given \r
- in the configuration file, except target and temporary directories which \r
- can be overridden by the corresponding command line options.<br>\r
-The only exception is <span \r
- style="font-weight: bold;">--all-from-sources</span> \r
- (<span \r
- style="font-weight: bold;">-a</span>) option which enables special \r
- installation mode in which all the products (including SALOME modules) \r
- are installed from sources, ignoring the default mode defined in the XML \r
- configuration file (see <a href="#install_from_wizard">here</a> for details).</p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><!--kadov_tag{{<spaces>}}-->&nbsp;<!--kadov_tag{{</spaces>}}--><a \r
- name=BatchMode></a><br>\r
-<br>\r
-<img alt="Batch mode"\r
-       src="batchmode.png"\r
-       style="width: 660px;\r
-                       height: 410px;\r
-                       border-style: none;\r
-                       border-style: none;"\r
-       width=660\r
-       height=410\r
-       border=0> </p>\r
-\r
-<p style="text-align: center;"\r
-       align=center><b style="font-weight: bold;">Figure 9:</b> Batch mode</p>\r
-\r
-<h3 style="margin-left: 40px;"><a name=env_files></a>Environment files</h3>\r
-\r
-<p>During the process of installation the script creates some environment \r
- files to simplify the procedure of launching SALOME. These shell scripts \r
- set all necessary environment variables for all products you have installed. \r
- To learn how installation scripts collects the environment, see <a href="#pick_up_env">here</a>. \r
- These files are: <b>salome.csh</b> + <b>salome.sh</b> in the <span style="font-style: italic; font-weight: bold;">KERNEL \r
- module</span><b><i> sources</i></b> and <span style="font-style: italic; font-weight: bold;">KERNEL \r
- module</span><b><i> binaries</i></b> root directories and <b>env_products.csh</b> \r
- + <b>env_products.sh </b>and <span \r
- style="font-weight: bold;">env_build.csh \r
- </span>+ <span \r
- style="font-weight: bold;">env_build.sh</span> in the target \r
- installation directory.</p>\r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><b><span \r
- style="font-weight: bold;"><img src="../note1.gif"\r
-                                                               x-maintain-ratio=TRUE\r
-                                                               style="border: none;\r
-                                                                               width: 36px;\r
-                                                                               height: 38px;\r
-                                                                               float: none;\r
-                                                                               border-style: none;\r
-                                                                               border-style: none;"\r
-                                                               width=36\r
-                                                               height=38\r
-                                                               border=0></span></b><span \r
- style="font-weight: bold;">Note:</span> there is some \r
- difference between these files: <span \r
- style="font-weight: bold;">env_build.*</span> \r
- files are optimized to be used for building SALOME modules from sources \r
- (see <span \r
- style="font-weight: bold;">README </span>file provided with \r
- the installation procedure on the CD). The <span \r
- style="font-weight: bold;">env_products.*</span> \r
- (and<span \r
- style="font-weight: bold;"> salome.*</span>) files are optimized \r
- for SALOME launching. The behavior is defined by the environment variable<span \r
- style="font-weight: bold;"> </span><b>ENV_FOR_LAUNCH</b> which is set \r
- to <span \r
- style="font-weight: bold;">0</span> in env_build.* files and \r
- to <span \r
- style="font-weight: bold;">1</span> in env_products.* (salome.*) \r
- files. </p>\r
-\r
-<!--kadov_tag{{<implicit_empty_p>}}-->&nbsp;<br><!--kadov_tag{{</implicit_empty_p>}}-->\r
-\r
-\r
-<!--(HR)============================================================-->\r
-<hr style="/*begin!kadov{{*/ float: aligncenter; /*}}end!kadov*/ ">\r
-\r
-\r
-<h3><a name=check_version_proc></a>Notes on<font \r
- style="color: #ff0000;"\r
-       color=#FF0000> check products \r
- version</font> procedure</h3>\r
-\r
-Unfortunately there is no exact algorithm to identify the product version \r
- under Linux platform. The information in this section gives an idea how \r
- the version is checked for the native/preinstalled products (this information \r
- refers to the base platform <span style="color: rgb(0, 0, 153);">Linux \r
- Mandrake 10.1</span>; and the same algorithms are used for other platforms). \r
- <br>\r
-The general rule for all products is that the path to the binaries should \r
- be set via the <span \r
- style="font-weight: bold;">PATH</span> environment \r
- variable, path to the libraries should be set via the <span \r
- style="font-weight: bold;">LD_LIBRARY_PATH</span> \r
- variable and the python modules should be available via the <span \r
- style="font-weight: bold;">PYTHONPATH</span> \r
- variable. \r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><b><span \r
- style="font-weight: bold;"><img src="../note1.gif"\r
-                                                               x-maintain-ratio=TRUE\r
-                                                               style="border: none;\r
-                                                                               width: 36px;\r
-                                                                               height: 38px;\r
-                                                                               float: none;\r
-                                                                               border-style: none;\r
-                                                                               border-style: none;"\r
-                                                               width=36\r
-                                                               height=38\r
-                                                               border=0></span></b><span \r
- style="font-weight: bold;">Note:</span> the information \r
- given in this section refers to the prerequisite products for SALOME version \r
- 3.2.4. </p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>gcc 3.4.1</li>\r
-</ul>\r
-\r
-Version number is checked by <span \r
- style="font-weight: bold;">gcc -dumpversion</span> \r
- command. The <span \r
- style="font-weight: bold;">gcc</span> executable should \r
- be in the <span \r
- style="font-weight: bold;">PATH</span> environment variable. \r
- Version should be equal to &quot;3.4.1&quot;. It is recommended to use \r
- native gcc on Mandrake 10.1. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>tcl/tk 8.4.5</li>\r
-</ul>\r
-\r
-Version number for <span \r
- style="font-weight: bold;">tcl/tk</span> can be \r
- found in tclConfig.sh and tkConfig.sh files (<span \r
- style="font-weight: bold;">TCL_VERSION</span> \r
- and <span \r
- style="font-weight: bold;">TK_VERSION</span> variables correspondingly). \r
- Version number should be equal to &quot;8.4&quot; (release number is not \r
- checked). <br>\r
-Set the <span \r
- style="font-weight: bold;">TCLHOME</span> environment variable \r
- to the root directory of tcl/tk installation.<br>\r
-It is recommended to use native tcl/tk on Mandrake 10.1. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>boost 1.31.0</li>\r
-</ul>\r
-\r
-Version number is defined by <span \r
- style="font-weight: bold;">version.hpp</span> \r
- file which is part of the boost distribution. This file defines the <span \r
- style="font-weight: bold;">BOOST_VERSION</span> macro which should be \r
- equal to &quot;103100&quot;. In addition the existence of boost libraries \r
- is checked. <br>\r
-Set the <span \r
- style="font-weight: bold;">BOOSTDIR</span> environment variable \r
- if you have a preinstalled version of boost. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>Python 2.3.4</li>\r
-</ul>\r
-\r
-Version number is checked by <span \r
- style="font-weight: bold;">python -V</span> \r
- command. The <span \r
- style="font-weight: bold;">python</span> executable \r
- should be in the <span \r
- style="font-weight: bold;">PATH</span> environment \r
- variable. Version number should be equal to &quot;2.3.4&quot;. It is recommended \r
- to use native Python on Mandrake 10.1.<br>\r
-Set the <span \r
- style="font-weight: bold;">PYTHONHOME</span> environment \r
- variable if you have a preinstalled version of Python. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>Swig 1.3.24</li>\r
-</ul>\r
-\r
-Version number is checked by <span \r
- style="font-weight: bold;">swig -version</span> \r
- command. The <span \r
- style="font-weight: bold;">swig</span> executable should \r
- be in the <span \r
- style="font-weight: bold;">PATH</span> environment variable. \r
- Version number should be equal to &quot;1.3.24&quot;. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>Qt 3.3.3</li>\r
-</ul>\r
-\r
-Version number is defined by <span \r
- style="font-weight: bold;">qglobal.h</span> \r
- file which is part of the Qt distribution. This file defines <span \r
- style="font-weight: bold;">QT_VERSION_STR</span> \r
- macro which should be equal to &quot;3.3.3&quot;. It is recommended to \r
- use native Qt on Mandrake 10.1.<br>\r
-Set the <span \r
- style="font-weight: bold;">QTDIR</span> environment variable \r
- if you have a preinstalled version of qt. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>msg2qm</li>\r
-</ul>\r
-\r
-<span \r
- style="font-weight: bold;">msg2qm</span> is a Qt tool which is used \r
- to convert text *.po files to *.qm resource files. Unfortunately this \r
- tool is not included to the Linux distribution and provided only in Qt \r
- sources package. This is the reason why this tool is supplied with the \r
- SALOME Installation Wizard.<br>\r
-There is no way to check the version number of msg2qm tool. Just set <span \r
- style="font-weight: bold;">MSG2QM_ROOT</span> environment variable if \r
- you have a preinstalled version of msg2qm tool. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>Open CASCADE 6.1.2a2</li>\r
-</ul>\r
-\r
-Version number is defined by <span \r
- style="font-weight: bold;">Standard_Version.hxx</span> \r
- file which is part of the Open CASCADE distribution. This file defines \r
- <span \r
- style="font-weight: bold;">OCC_VERSION_MAJOR,</span> <span \r
- style="font-weight: bold;">OCC_VERSION_MINOR</span> \r
- and <span \r
- style="font-weight: bold;">OCC_VERSION_MAINTENANCE</span> macros \r
- which should refer to version 6.1.2.<br>\r
-Set the <span \r
- style="font-weight: bold;">CASROOT</span> environment variable \r
- if you have a preinstalled version of Open CASCADE. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>qwt 4.2.0/0.4.2</li>\r
-</ul>\r
-\r
-Version number is defined by <span \r
- style="font-weight: bold;">qwt_global.h</span> \r
- file which is part of the qwt distribution. This file defines <span \r
- style="font-weight: bold;">QWT_VERSION_STR</span> \r
- macro which should be equal to &quot;4.2.0&quot;.<br>\r
-Set the <span \r
- style="font-weight: bold;">QWTHOME</span> environment variable \r
- if you have a preinstalled version of qwt. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>hdf 5-1.6.4</li>\r
-</ul>\r
-\r
-Version number is defined by <span \r
- style="font-weight: bold;">libhdf5.settings</span> \r
- file which is part of the <span \r
- style="font-weight: bold;">hdf5</span> \r
- distribution. Version should be equal to 1.6.4.<br>\r
-Set the <span \r
- style="font-weight: bold;">HDF5HOME</span> environment variable \r
- if you have a preinstalled version of hdf5. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>med 2.2.3</li>\r
-</ul>\r
-\r
-Unfortunately there is no formal way to check med version number. We check \r
- existence of libmed.so.1.0.2 library on the computer. If you have any \r
- problem with a preinstalled version of med, please, reinstall it.<br>\r
-Set the <span \r
- style="font-weight: bold;">MED2HOME</span> environment variable \r
- if you have a preinstalled version of med. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>Vtk 4.2.6</li>\r
-</ul>\r
-\r
-Unfortunately there is no formal way to check VTK version number. We just \r
- check the existence of <span \r
- style="font-weight: bold;">libvtkCommon.so</span> \r
- library on the computer and hope that it is of version we need. If you \r
- have any problem with a preinstalled version of Vtk, please, reinstall \r
- it.<br>\r
-Set the <span \r
- style="font-weight: bold;">VTKHOME</span> environment variable \r
- if you have a preinstalled version of Vtk. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>OmniORB 4.0.5, OmniORBpy 2.5, OmniNotify 2.1</li>\r
-</ul>\r
-\r
-We just check existence of some omniORB libraries and executable on the \r
- computer, like <span \r
- style="font-weight: bold;">libomniORB4.so.0.5</span>, \r
- <span \r
- style="font-weight: bold;">_omnipymodule.so.2.4</span>, <span \r
- style="font-weight: bold;">libCOSNotify4.so.0.1</span> \r
- and <span \r
- style="font-weight: bold;">notifd</span>.<br>\r
-Set the <span \r
- style="font-weight: bold;">OMNIORBDIR</span> environment \r
- variable if you have a preinstalled version of omniORB products. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>sip 4.1</li>\r
-</ul>\r
-\r
-Version number is checked by <span \r
- style="font-weight: bold;">sip -V</span> \r
- command. The <span \r
- style="font-weight: bold;">sip</span> executable should \r
- be in the <span \r
- style="font-weight: bold;">PATH</span> environment variable. \r
- Version number should be equal to &quot;4.1&quot;.<br>\r
-Set the <span \r
- style="font-weight: bold;">SIPDIR</span> environment variable \r
- to the directory where you have sip executable preinstalled. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>PyQt 3.13</li>\r
-</ul>\r
-\r
-Version number is defined by <span \r
- style="font-weight: bold;">pyqtconfig.py</span> \r
- Python module file which is part of the <span \r
- style="font-weight: bold;">PyQt</span> \r
- distribution. Version should be equal to &quot;3.13&quot;.<br>\r
-Set the <span \r
- style="font-weight: bold;">PYQTDIR </span>environment variable \r
- if you have a preinstalled version of PyQt. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>netgen 4.5</li>\r
-</ul>\r
-\r
-Unfortunarely we can't find anything about netgen version. We just check \r
- if <span \r
- style="font-weight: bold;">NETGENROOT</span> environment variable \r
- is set.<br>\r
-Set the <span \r
- style="font-weight: bold;">NETGENROOT</span> environment \r
- variable if you have a preinstalled version of netgen mesher. \r
-\r
-<!--begin!kadov{{--><br><!--}}end!kadov--><!--kadov_tag{{<implicit_p>}}-->&nbsp; \r
\r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><span \r
- style="font-weight: bold;"><b style="font-weight: bold;"><img src="../note1.gif"\r
-       x-maintain-ratio=TRUE\r
-       style="border: none;\r
-                       width: 36px;\r
-                       height: 38px;\r
-                       float: none;\r
-                       border-style: none;\r
-                       border-style: none;"\r
-       width=36\r
-       height=38\r
-       border=0></b>Note: </span>netgen 4.5 provided with the SALOME installation \r
- Wizard has been patched to improve its performance. </p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>Numeric 23.7</li>\r
-</ul>\r
-\r
-Version number is checked by <span \r
- style="font-weight: bold;">python -c \r
- 'import Numeric; print Numeric.__version__'</span> command. The <span \r
- style="font-weight: bold;">python</span> executable should be in the <span \r
- style="font-weight: bold;">PATH</span> environment variable and <span \r
- style="font-weight: bold;">Numeric</span> module should be available for \r
- the Python (for example it should be in the <span \r
- style="font-weight: bold;">PYTHONPATH</span> \r
- environment variable). Version number should be equal to &quot;23.7&quot;. \r
- If you have any problem with a preinstalled version of Numeric 23.7, please, \r
- reinstall it.<br>\r
-Add the directory where&nbsp;you have a preinstalled version of Numeric \r
- package to the the <span \r
- style="font-weight: bold;">PYTHONHOME </span>environment \r
- variable. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>graphviz 2.2.1</li>\r
-</ul>\r
-\r
-Version number is checked by <span \r
- style="font-weight: bold;">dot -V</span> \r
- command. The <span \r
- style="font-weight: bold;">dot</span> executable should \r
- be in the <span \r
- style="font-weight: bold;">PATH</span> environment variable. \r
- Version number should be equal to &quot;2.2.1&quot;.<br>\r
-Add <span \r
- style="font-weight: bold;">graphviz</span> bin directory to the \r
- the <span \r
- style="font-weight: bold;">PATH</span> environment variable. \r
\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p>doxygen 1.4.6</li>\r
-</ul>\r
-\r
-Version number is checked by <span \r
- style="font-weight: bold;">doxygen --version</span> \r
- command. The <span \r
- style="font-weight: bold;">doxygen</span> executable \r
- should be in the <span \r
- style="font-weight: bold;">PATH</span> environment \r
- variable. Version number should be equal to &quot;1.4.6&quot;. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-weight: bold; color: rgb(0, 0, 153);">SALOME \r
- </span>module <span style="font-weight: bold; color: rgb(0, 0, 153);">sources</span> \r
- (3.2.4).</li>\r
-</ul>\r
-\r
-For each SALOME module sources package (KERNEL, GUI, GEOM, etc...) the \r
- root directory contains file configure.in (configure.ac) which defines \r
- version information.<br>\r
-Set the <span \r
- style="font-weight: bold;">&lt;MODULE&gt;_SRC_DIR</span> \r
- environment variable for each SALOME <span \r
- style="font-weight: bold;">MODULE</span> \r
- sources package installed (where <span \r
- style="font-weight: bold;">MODULE</span> \r
- is KERNEL, GUI, GEOM, ...). \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-weight: bold; color: rgb(0, 0, 153);">SALOME \r
- </span>module <span style="font-weight: bold; color: rgb(0, 0, 153);">binaries \r
- </span>(3.2.4)</li>\r
-</ul>\r
-\r
-For each SALOME module binaries package (KERNEL, GUI, GEOM, etc...) the \r
- <span \r
- style="font-weight: bold;">bin/salome</span> directory contains \r
- file <span \r
- style="font-weight: bold;">VERSION</span> which defines version \r
- information.<br>\r
-Set <span \r
- style="font-weight: bold;">&lt;MODULE&gt;_ROOT_DIR</span> environment \r
- variable for each SALOME <span \r
- style="font-weight: bold;">MODULE</span> \r
- binaries package installed (where <span \r
- style="font-weight: bold;">MODULE</span> \r
- is KERNEL, GUI, GEOM, ...). \r
-\r
-<p>If you have native products installed to directories different from \r
- default ones (not <b>/usr/bin</b>, <b>/usr/lib</b>...), it is recommended \r
- to follow the above mentioned instructions. Or you should properly set \r
- <span \r
- style="font-weight: bold;">PATH</span> and <span \r
- style="font-weight: bold;">LD_LIBRARY_PATH</span> \r
- variables <b><font style="color: #ff0000;"\r
-                                       color=#FF0000>before</font></b> starting the Installation \r
- Wizard. Otherwise the installation script will fail to find preinstalled/native \r
- products. </p>\r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><span><b \r
- style="font-weight: bold;"><img src="../note1.gif"\r
-                                                               x-maintain-ratio=TRUE\r
-                                                               style="border: none;\r
-                                                                               width: 36px;\r
-                                                                               height: 38px;\r
-                                                                               float: none;\r
-                                                                               border-style: none;\r
-                                                                               border-style: none;"\r
-                                                               width=36\r
-                                                               height=38\r
-                                                               border=0></b></span><b style="font-weight: bold;">Note:</b> for some native \r
- products (e.g. gcc, Python) the rules of version checking are not so strict \r
- as described above. Only major and minor version numbers should coincide \r
- with the prerequisite. Newer version of the product can also be used. \r
- If some native product has version number larger than that required by \r
- the installation procedure, the user will be prompted by the warning message \r
- like this: <i>&quot;You have newer version of gcc installed on your computer \r
- than that is required (3.4.1). Continue?&quot;</i>. You can click <i>&quot;Yes&quot;</i> \r
- to proceed with the installation but in this case you should be aware \r
- of what you are doing. SALOME binaries (including other products) are \r
- compiled with the predefined prerequisites and most likely can not be \r
- run successfully if these products are not found. This can be helpful \r
- only if you plan to build all products from sources. </p>\r
-\r
-\r
-<!--(HR)============================================================-->\r
-<hr style="/*begin!kadov{{*/ float: aligncenter; /*}}end!kadov*/ ">\r
-\r
-\r
-<h3><a name=pick_up_env></a>Pick up the <font \r
- style="color: #ff0000;"\r
-       color=#FF0000>environment</font></h3>\r
-\r
-Please, read the following information carefully . This section describes \r
- how the installation procedure generates the environment scripts for the \r
- SALOME platform being installed. \r
-\r
-<p>After installing each product shell the script creates a special environment \r
- file for the product in its installation folder. The name of the file \r
- is generated from the name of product by the following scheme: <b>env_&lt;product_name&gt;.sh</b> \r
- (for example <b>env_Vtk.sh </b>for the Vtk). This file includes all necessary \r
- environment settings. At the final step of the installation the script \r
- picks up all the settings files and generates two common environment files \r
- from them: <b>salome.sh</b> and <b>salome.csh </b>for <span \r
- style="font-weight: bold;">bash</span> \r
- and <span \r
- style="font-weight: bold;">csh</span> shells correspondingly. \r
- Such approach helps to save time when reinstalling products and you may \r
- not bother about setting all environment variables manually to build/launch \r
- SALOME. What you simply need is to source one of these environment files. \r
- </p>\r
-\r
-<p>This also concerns those products which are not being installed. For \r
- example, you install some SALOME binaries to the directory where you have \r
- previously installed other products.&nbsp; The Installation procedure \r
- tries to collect environment files from the target directory if it finds \r
- necessary products installed there. If some product is not found in the \r
- target directory the corresponding section of <b>salome.sh/salome.csh</b> \r
- files will be skipped. <br>\r
-For native products (like <i><b>gcc, tcl, etc...)</b></i> the installation \r
- procedure tries to find them first using <b>PATH</b> / <b>LD_LIBRARY_PATH</b> \r
- variables and then in the system default directories (<b>/usr/bin, /usr/lib</b> \r
- etc., depending on the product). </p>\r
-\r
-<p>In any case you may edit <b>salome.*</b> files after the installation \r
- procedure finishes, if you want.</p>\r
-\r
-&nbsp; \r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><span><b \r
- style="font-weight: bold;"><img src="../note1.gif"\r
-                                                               x-maintain-ratio=TRUE\r
-                                                               style="border: none;\r
-                                                                               width: 36px;\r
-                                                                               height: 38px;\r
-                                                                               float: none;\r
-                                                                               border-style: none;\r
-                                                                               border-style: none;"\r
-                                                               width=36\r
-                                                               height=38\r
-                                                               border=0></b></span><span \r
- style="font-weight: bold;">Note:</span> \r
- as it was mentioned <a href="#env_files">above</a> there are other environment \r
- files which are generated by the installation procedure: <span \r
- style="font-weight: bold;">env_products.csh</span> \r
- + <span \r
- style="font-weight: bold;">env_products.sh</span> and <span \r
- style="font-weight: bold;">env_build.csh</span> \r
- + <span \r
- style="font-weight: bold;">env_build.sh</span>. These files can \r
- be found in the target installation root directory.</p>\r
-\r
-<!--kadov_tag{{<implicit_empty_p>}}-->&nbsp;<br><!--kadov_tag{{</implicit_empty_p>}}-->\r
-\r
-\r
-<!--(HR)============================================================-->\r
-<hr style="/*begin!kadov{{*/ float: aligncenter; /*}}end!kadov*/ ">\r
-\r
-\r
-<h3><a name=xml_files></a>Modifying <font \r
- style="color: #ff0000;"\r
-       color=#FF0000>XML</font> configuration \r
- <font \r
- style="color: #ff0000;"\r
-       color=#FF0000>file</font></h3>\r
-\r
-You can create your own XML configuration file. The Installation Wizard \r
- can then take it as a command line argument to provide a list of products \r
- you want to install with it. The list of products and some other settings \r
- for the Installation Wizard are provided in the XML file. The default \r
- file which Installation Wizard looks for if no command line arguments \r
- are given, is <b>config.xml</b>.<br>\r
-This section describes the structure of the configuration file. <br>\r
-XML tags are in bold blue, optional sections/tags are in brackets. \r
-\r
-<p><font style="font-family: Courier;"\r
-               face=Courier><b style="font-weight: bold;"><font style="color: #000099;"\r
-                                                                                                               color=#000099>&lt;document&gt;</font></b> \r
- <font style="color: #000000;"\r
-               color=#000000><b><br>\r
-&nbsp;&nbsp;&nbsp; </b>[</font><b><font style="color: #000099;"\r
-                                                                               color=#000099> &lt;config</font></b><font style="color: #000000;"\r
-               color=#000000> [ version=&lt;install_wizard_version&gt; ]</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- caption=&lt;install_wizard_caption&gt; ]</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- copyright=&lt;install_wizard_copyright&gt;&nbsp; ]</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- license=&lt;install_wizard_license_info&gt; ]</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- os=&lt;target_platform&gt; ]</font><b><font style="color: #000099;"\r
-                                                                               color=#000099><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt;</font></b><font style="color: #000000;"\r
-               color=#000000> <br>\r
-&nbsp;&nbsp;&nbsp; ]</font> <font style="color: #000000;"\r
-               color=#000000><b><br>\r
-&nbsp;&nbsp;&nbsp; </b>[ </font><b><font style="color: #000099;"\r
-                                                                               color=#000099>&lt;path</font></b><font style="color: #000000;"\r
-               color=#000000>&nbsp;&nbsp; [ targetdir=&lt;target_directory&gt; ]</font> \r
- <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- tempdir=&lt;temp_directory&gt;&nbsp;&nbsp;&nbsp;&nbsp; ]</font><b><font style="color: #000099;"\r
-                                                                               color=#000099><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt; </font></b><font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp; ]</font> <font style="color: #000000;"\r
-               color=#000000><b><br>\r
-&nbsp;&nbsp;&nbsp; </b>[ </font><b><font style="color: #000099;"\r
-                                                                               color=#000099>&lt;button</font></b><font style="color: #000000;"\r
-               color=#000000> &nbsp; label=&lt;button_label&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font> \r
- <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; \r
- [ tooltip=&lt;button_tooltip&gt; ]</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; \r
- &nbsp; script=&lt;button_script&gt;&nbsp;&nbsp;&nbsp;</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- [ disable=&lt;disable_flag&gt;&nbsp;&nbsp;&nbsp;]</font><b><font style="color: #000099;"\r
-                                                                               color=#000099><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt; </font></b><font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp; ]</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp; [</font><b><font style="color: #000099;"\r
-                                                                               color=#000099> &lt;button</font></b><font style="color: #000000;"\r
-               color=#000000> ... </font><font style="color: #000099;"\r
-                                                                       color=#000099><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /<b>&gt;</b></font><font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp; ]</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp; [</font><b><font style="color: #000099;"\r
-                                                                               color=#000099> &lt;product</font></b><font style="color: #000000;"\r
-               color=#000000>&nbsp; name=&lt;product_name&gt;</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- version=&lt;product_version&gt;</font> <br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [ context=&lt;product_context&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- ]<br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [ description=&lt;product_description&gt; \r
- ]<font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- install=&lt;installation_mode&gt;</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- supported=&lt;supported_installation_modes&gt;</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- disable=&lt;disable_flag&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]<br>\r
-&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; [ pickupenv=&lt;pickup_env_flag&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- ]<br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- dependancies=&lt;list_of_prerequisites&gt;</font>&nbsp;<font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; \r
- installdiskspace=&lt;install_disk_space&gt;</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; \r
- temporarydiskspace=&lt;tmp_disk_space&gt;</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; \r
- script=&lt;installation_script_name&gt;</font><font style="color: #000099;"\r
-                                                                       color=#000099><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /<b>&gt;</b></font><font style="color: #000000;"\r
-               color=#000000> \r
- <br>\r
-&nbsp;&nbsp;&nbsp; ]</font> <font style="color: #000000;"\r
-               color=#000000><br>\r
-&nbsp;&nbsp;&nbsp; [</font><b><font style="color: #000099;"\r
-                                                                               color=#000099> &lt;product</font></b><font style="color: #000000;"\r
-               color=#000000> ... </font><font style="color: #000099;"\r
-                                                                       color=#000099><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /<b>&gt;</b></font><font style="color: #000000;"\r
-               color=#000000> \r
- <br>\r
-&nbsp;&nbsp;&nbsp; ]<br>\r
-&nbsp;&nbsp;&nbsp; ...</font><b><font style="color: #000099;"\r
-                                                                               color=#000099><br>\r
-&lt;/document&gt;</font></b> </font></p>\r
-\r
-<h4><font style="color: #000000;"\r
-                       color=#000000>&lt;config&gt; section</font></h4>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>This is an optional section; it provides general \r
- information about the Installation Wizard itself.<br>\r
-<br>\r
-Attributes:</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">version</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>The application version number to be shown in the \r
- caption.</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">caption</b></font></li>\r
-</ul>\r
-\r
-The application main window caption - if this string contains '%1' text \r
- the title will contain the version number in this place (see above). \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">copyright</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>The application copyright information (shown in the \r
- first page).</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">license</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>The application license information (shown in the \r
- first page).</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">os</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>This parameter defines the directory (relative from \r
- ./Products/BINARIES) where the Installation Wizard will search precompiled \r
- binaries packages. If this tag is not provided, binaries packages are \r
- looked for in the ./Products/BINARIES directory.</font> \r
-\r
-<h4><b style="font-weight: bold;"><font style="color: #000000;"\r
-                                                                               color=#000000>&lt;path&gt; section</font></b></h4>\r
-\r
-This is an optional section; it defines default installation directories.<font style="color: #000000;"\r
-                       color=#000000><br>\r
-<br>\r
-Attributes:</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">targetdir</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>The target directory - the path to the directory \r
- where products should be installed.</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">tempdir</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>The temporary directory - the path to the directory \r
- for the temporary files.</font> \r
-\r
-<h4><b style="font-weight: bold;">&lt;product&gt; section</b></h4>\r
-\r
-This section describes product to be installed with the Installation Wizard. \r
- The XML file should include a &lt;product&gt; section for each product \r
- to be installed. The products appear in the tree view and are installed \r
- in the order they are described in the configuration file. It is recommended \r
- (but not obligatory) to define native products at the top of the list \r
- before all other products.<font style="color: #000000;"\r
-                       color=#000000><br>\r
-<br>\r
-Attributes:</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">name</b></font></li>\r
-</ul>\r
-\r
-Product name. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">version</b></font></li>\r
-</ul>\r
-\r
-<span>Product</span> version. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">description</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>Product description (optional).</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">context</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>Context (optional). The possible values are <b>'salome \r
- sources'</b>, <b>'salome binaries'</b> and <b>'prerequisite'</b> (several \r
- contexts can be given separated by &quot;:&quot; symbol).</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">supported</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>Supported modes of installation. Several modes can \r
- be separated by comma. Possible value are: <i>install sources</i>, <i>install \r
- binaries</i>, <i>use native</i>. The Installation script should contain \r
- the corresponding functions for each of the supported installation modes \r
- (see <a href="#new_products">here</a>).</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">install</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>Default (starting) installation mode.</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">disable</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>If this optional flag has 'true' value, the corresponding \r
- product will not appear in the list of products and will not be installed.</font> \r
\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;">pickupenv</b></li>\r
-</ul>\r
-\r
-This flag points that pickup environment procedure should be performed \r
- for this product. If this flag equal to 'true', &nbsp;salome.sh and salome.csh \r
- files will&nbsp; be created in the product installation directory. Usually \r
- this option is set to true for SALOME KERNEL module sources and binaries \r
- package. This is an optional key, default value is 'false'<b>.</b> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">dependancies</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>List of prerequisite products, which are necessary \r
- to build this product, separated by comma.</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">installdiskspace</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>Total amount of space (integer, in Kbytes), which \r
- the product occupies on the hard drive after the installation.</font> \r
\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">temporarydiskspace</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>Disk space (integer, in Kbytes) for temporary files, \r
- which is necessary to build the product from the sources.</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">script</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>The installation script name. This script is in charge \r
- of the installation of the product. It is called automatically by the \r
- Installation Wizard when necessary from the main program. See the <a href="#new_products">next \r
- section</a> for more information.</font> \r
-\r
-<h4><b style="font-weight: bold;">&lt;button&gt; section</b></h4>\r
-\r
-This is an optional section. It allows customization of the last <i>&quot;Finish \r
- installation&quot;</i> page of the Installation Wizard by adding one or \r
- more buttons in the lower part of the wizard's window. The script which \r
- is attached to each such button, can perform some specific action, for \r
- example, launch the application or show the Release Notes file by using \r
- an external program. See <a href="#finish_buttons">here</a> for more details \r
- about writing scripts.<font style="color: #000000;"\r
-                       color=#000000><br>\r
-<br>\r
-Attributes:</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">label</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>This is the button text.</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">tooltip</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>The button tooltip (optional).</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">script</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>The script attached to the button.</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">disable</b></font></li>\r
-</ul>\r
-\r
-<p style="background-color: #ffffff;">If this optional flag has 'true' \r
- value, the corresponding button will not appear in the <i>&quot;Finish \r
- installation&quot;</i> page - the section of XML file is silently ignored.<b>&nbsp;</b></p>\r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><b \r
- style="font-weight: bold;"><span style="font-weight: bold;"><img src="../note1.gif"\r
-       x-maintain-ratio=TRUE\r
-       style="border: none;\r
-                       width: 36px;\r
-                       height: 38px;\r
-                       float: none;\r
-                       border-style: none;\r
-                       border-style: none;"\r
-       width=36\r
-       height=38\r
-       border=0></span><span style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');">Note:</span></b><span style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"> \r
- If you add new products to be installed with Installation Wizard, you \r
- should also provide installation script for this product. See the next \r
- section for more details. </span></p>\r
-\r
-<!--kadov_tag{{<implicit_empty_p>}}-->&nbsp;<br><!--kadov_tag{{</implicit_empty_p>}}-->\r
-\r
-\r
-<!--(HR)============================================================-->\r
-<hr style="/*begin!kadov{{*/ float: aligncenter; /*}}end!kadov*/ ">\r
-\r
-\r
-<h3><a name=new_products></a>Implementing <font \r
- style="color: #ff0000;"\r
-       color=#FF0000>installation \r
- scripts</font> for the new products</h3>\r
-\r
-When you want some product to be installed with the Installation Wizard, \r
- you should add its description <a href="#xml_files">to the configuration \r
- file</a> and create the installation script, following the rules described \r
- in this section. <br>\r
-<br>\r
-There are some obligatory functions which should be implemented in this \r
- installation script. These functions are automatically called by the master \r
- installation script or/and its GUI shell when it is necessary.<font style="color: #000000;"\r
-                       color=#000000><br>\r
-File <b>common.sh</b> contains some service functions which can be used \r
- in your installation script, like <b>make_env()</b>,<b> make_dir()</b>, \r
- <b>try_existing()</b>, <b>sort_path()</b>,<b> find_in_path()</b>, etc.</font> \r
\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;">check_version()</b></li>\r
-</ul>\r
-\r
-This function allows to check the version of the product already installed \r
- on the computer. It should try to find the product (native or preinstalled \r
- in the target directory) and check its version. This helps to avoid unnecessary \r
- reinstallation. This is an internal function and is not called from the \r
- master installation script. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><b style="font-weight: bold;"><font style="color: #000000;"\r
-                                                                               color=#000000>try_native()</font></b></li>\r
-</ul>\r
-\r
-This function is called when the <i>'use native' </i>installation mode \r
- is selected by the user. The function should try to find a native version \r
- of the product and define possibility of its use. It should create the \r
- environment file for the product in the temporary directory (see also \r
- the description of <b>print_env(</b><span \r
- style="font-weight: bold;">)</span> \r
- function). It is not necessary to implement this function if you do not \r
- provide native mode installation. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">install_source()</b></font></li>\r
-</ul>\r
-\r
-This function is called when the <i>'install sources</i>' installation \r
- mode is selected by the user. The function is responsible for building \r
- the product from the sources package. It should create the environment \r
- file for the product in the temporary directory (see also description \r
- of <b>print_env(</b><span \r
- style="font-weight: bold;">)</span> function). \r
- It is not necessary to implement this function if you do not provide sources \r
- mode installation. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">install_source_and_build()</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>This function is called when SALOME module is installed \r
- and the <span style="font-weight: bold;">--all-from-sources</span> (<span style="font-weight: bold;">-a</span>) option is used (<span style="font-style: italic;">&quot;Build \r
- SALOME sources&quot;</span> check box in GUI mode). This function should \r
- be used to unpack SALOME sources package and then call the build/install \r
- procedure for it.<br>\r
-For more details please refer to the <a href="#install_from_wizard">this</a> \r
- and <a href="#gui_mode">this</a> sections for more details.</font> \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">install_binary()</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>This function is called when the <i>'install binaries'</i> \r
- installation mode is selected by the user. The function is responsible \r
- for the extracting of the product from the binaries package. It should \r
- create environment for the product in the temporary directory (see also \r
- description of <b>print_env(</b>) function). It is not necessary to implement \r
- this function if you do not provide binaries mode installation. \r
-\r
-</font><ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;">try_preinstalled()</b></li>\r
-</ul>\r
-\r
-This function is called when<i><span style="font-style: normal;"> the</span> \r
- 'not install'</i> installation mode is selected by the user. In this case \r
- the script should inspect the target directory to try to find an already \r
- preinstalled product, pick up and check the environment from there. See \r
- <a href="#pick_up_env">here</a> for more details. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">print_env()</b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-                       color=#000000>This function is in charge of creating the environment \r
- script. It should create a file with name </font><b>env_&lt;product_name&gt;.sh</b> \r
- in the temporary directory and then copy it into the product installation \r
- directory. The file should contain all necessary environment variables \r
- settings for the product. It will be collected during the 'pick-up-environment' \r
- procedure. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;">pickup_env()</b></li>\r
-</ul>\r
-\r
-This procedure corresponds to the <b>pickupenv</b> tag of the configuration \r
- xml file (see previous section). It should call the <b>make_env</b> procedure \r
- to perform the pick-up environment procedure for the product.<font style="color: #000000;"\r
-                       color=#000000><br>\r
-<br>\r
-The calling signature of the product installation script is the following:</font> \r
- <b><font style="color: #000000;"\r
-                       color=#000000><br>\r
-&lt;product_script_name&gt; &lt;function_name&gt; &lt;temp_folder&gt; &lt;products_directory&gt; \r
- &lt;target_directory&gt; &lt;dependancies&gt; &lt;product_name&gt;</font></b> \r
\r
-\r
-<p><font style="color: #000000;"\r
-                       color=#000000>where</font> </p>\r
-\r
-<p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;">&lt;product_script_name&gt;</b> \r
- - installation script name (described in the configuration xml file);</font> \r
- <font style="color: #000000;"\r
-               color=#000000><b><br>\r
-&lt;function_name&gt;</b> - the name of function, corresponding to the \r
- selected installation mode: <i>try_native, install_source, install_binary</i> \r
- or <i>try_preinstalled</i>;</font> <font style="color: #000000;"\r
-               color=#000000><b><br>\r
-&lt;temp_folder&gt;</b> - temporary files directory;</font> <font style="color: #000000;"\r
-               color=#000000><b><br>\r
-&lt;products_directory&gt;</b> - directory where the sources/binaries package \r
- can be found. You should provide the sources package in the <i>&lt;Install_Wizard_root_directory&gt;/Products/SOURCES</i> \r
- directory and binaries package in the <i>&lt;InstallWizard_root_directory&gt;/Products/BINARIES/&lt;os_version&gt;</i>, \r
- where &lt;os_version&gt; is the target platform description, which appears \r
- in the corresponding section of the <a href="#xml_files">configuration \r
- xml file</a>.</font> <font style="color: #000000;"\r
-               color=#000000><b><br>\r
-&lt;target_directory&gt;</b> - root target directory where the product \r
- should be installed to;</font> <font style="color: #000000;"\r
-               color=#000000><b><br>\r
-&lt;dependancies&gt;</b> - single-quoted list of prerequisite products, \r
- separated by space;</font> <font style="color: #000000;"\r
-               color=#000000><b><br>\r
-&lt;product_name&gt; </b>- product name itself.</font> </p>\r
-\r
-<p><font style="font-weight: bold;">Example:</font> <i><br>\r
-med-2.2.3.sh install_binary /tmp/work ./Products/BINARIES/Mandrake10.1 \r
- /usr/salome 'gcc Hdf' med</i> </p>\r
-\r
-<p><font style="color: #000000;"\r
-                       color=#000000>Copy the created script into the <i>&lt;Install_Wizard_root_directory&gt;/config_files</i> \r
- sub-directory where all installation scripts are stored. Installation \r
- Wizard will automatically search and call your script during the installation \r
- procedure.</font> </p>\r
-\r
-\r
-<!--(HR)============================================================-->\r
-<hr style="/*begin!kadov{{*/ float: aligncenter; /*}}end!kadov*/ ">\r
-\r
-\r
-&nbsp; \r
-\r
-<h3><a name=finish_buttons></a>Customizing <font \r
- style="color: #ff0000;"\r
-       color=#FF0000>Readme page</font> \r
- buttons</h3>\r
-\r
-The Installation Wizard allows customizing the look-n-feel of the last \r
- <i>&quot;Finish installation&quot;</i> page. If you want to add one or \r
- more buttons to this page in order to perform some specific actions at \r
- the end of the installation (for example, to show the Release Notes file \r
- by using Open Office) you can put an additional section to the XML configuration \r
- file. This is the <b>&lt;button&gt;</b> section (see <a href="#xml_files">here</a> \r
- for more details). \r
-\r
-<!--begin!kadov{{--><br><!--}}end!kadov--><!--kadov_tag{{<implicit_p>}}-->&nbsp; \r
\r
-\r
-<!--begin!kadov{{--><br><!--}}end!kadov--><!--kadov_tag{{<implicit_p>}}-->To \r
- implement the action which will be performed when the user clicks the \r
- button, you need to create a script and put it to the <i>&lt;Install_Wizard_root_directory&gt;/config_files</i> \r
- directory.<br>\r
-There are some obligatory functions which should be implemented in this \r
- script. These functions are automatically called by the Installation Wizard \r
- GUI. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;">check_enabled()</b></li>\r
-</ul>\r
-\r
-This procedure is called by the Installation Wizard when the <i>&quot;Finish \r
- installation&quot;</i> page is displayed and the status of the buttons \r
- should be modified according to the installation options. This procedure \r
- should return <b>0</b> if the corresponding action can be performed and, \r
- thus, the button should become enabled. Otherwise, it should return <b>1</b> \r
- - in this case the corresponding button will be disabled. \r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;">execute()</b></li>\r
-</ul>\r
-\r
-This procedure is invoked when the user clicks the button. This procedure \r
- should return <b>0</b> if the corresponding action is done successfully \r
- and <b>1</b> if any error occurs.<br>\r
-<br>\r
-The calling signature of the script is the following:<b><font style="color: #000000;"\r
-                       color=#000000><br>\r
-&lt;product_script_name&gt; &lt;function_name&gt; &lt;target_directory&gt; \r
- &lt;temp_folder&gt;</font></b> \r
-\r
-<p><font style="color: #000000;"\r
-                       color=#000000>where</font> </p>\r
-\r
-<p><b style="font-weight: bold;">&lt;product_script_name&gt;</b> - the \r
- script name itself (retrieved from the XML configuration xml file); <b><br>\r
-&lt;function_name&gt;</b> - the name of function; <b><br>\r
-&lt;target_directory&gt;</b> - root target directory where the product \r
- is installed to; <b><br>\r
-&lt;temp_folder&gt; </b>- temporary files directory; <b><br>\r
-&nbsp;</b></p>\r
-\r
-<p style="background-image: url('../Texture_horiz_ltbluebubbles.jpg');"><b><span \r
- style="font-weight: bold;"><img src="../note1.gif"\r
-                                                               x-maintain-ratio=TRUE\r
-                                                               style="border: none;\r
-                                                                               width: 36px;\r
-                                                                               height: 38px;\r
-                                                                               float: none;\r
-                                                                               border-style: none;\r
-                                                                               border-style: none;"\r
-                                                               width=36\r
-                                                               height=38\r
-                                                               border=0></span>Note:</b> The standard \r
- Installation Wizard buttons &quot;Launch SALOME&quot; and &quot;Release \r
- Notes&quot; are implemented with this feature. Refer to scripts <b>start_salome.sh</b> \r
- and <b>release_notes.sh</b> for sample implementation.<b><span \r
- style="font-weight: bold;"><br>\r
-<br>\r
-<img src="../note1.gif"\r
-       x-maintain-ratio=TRUE\r
-       style="border: none;\r
-                       width: 36px;\r
-                       height: 38px;\r
-                       float: none;\r
-                       border-style: none;\r
-                       border-style: none;"\r
-       width=36\r
-       height=38\r
-       border=0></span>Note:</b> Any button (even standard) can be \r
- ignored by the Installation Wizard if the attribute <b>&lt;disable&gt;</b> \r
- in the XML configuration file is set to the &quot;true&quot; value. </p>\r
-\r
-\r
-<!--(HR)============================================================-->\r
-<hr style="/*begin!kadov{{*/ float: aligncenter; /*}}end!kadov*/ ">\r
-\r
-\r
-&nbsp; \r
-\r
-</body>\r
-\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/introduction.htm b/doc/salome/gui/GUI/kernel/introduction.htm
deleted file mode 100755 (executable)
index 019cc7f..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Introduction</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { text-align:center; }\r
-img_whs2 { border:none; width:550px; height:275px; float:none; border-style:none; }\r
-h1.whs3 { text-align:justify; }\r
-p.whs4 { font-family:'Times New Roman' , serif; text-align:justify; text-indent:48px; }\r
-p.whs5 { font-family:'Times New Roman' , serif; text-align:justify; }\r
-ul.whs6 { list-style:disc; }\r
-p.whs7 { font-family:'Times New Roman' , serif; text-align:justify; font-weight:bold; }\r
-table.whs8 { x-cell-content-align:top; width:100%; border-spacing:0px; }\r
-col.whs9 { width:31.561%; }\r
-col.whs10 { width:68.439%; }\r
-tr.whs11 { x-cell-content-align:top; }\r
-td.whs12 { width:31.561%; padding-right:10px; padding-left:10px; border-right-style:none; border-left-style:none; border-top-style:none; border-bottom-style:none; }\r
-img_whs13 { border:none; width:249px; height:221px; border-style:none; }\r
-td.whs14 { width:68.439%; padding-right:10px; padding-left:10px; border-top-style:none; border-bottom-style:none; border-right-style:none; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("Welcome to SALOME");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 align="center" class="whs1"><img src="../pics/icon_about.png" x-maintain-ratio="TRUE" width="550px" height="275px" border="0" class="img_whs2"></h1>\r
-\r
-<h1 class="whs3"><span style="font-family: 'Times New Roman', serif;">Introduction</span></h1>\r
-\r
-<p class="whs4">Welcome to SALOME Platform! Modern technological \r
- products (cars, structures, electrical or electronic equipment) are getting \r
- more and more complex every year and must meet increasingly severe requirements \r
- in terms of quality and performance. For example, for structures and their \r
- environment the demands to reduce risks and optimize costs are extremely \r
- high. It requires particularly refined simulations concerning structural \r
- behavior and robustness to ensure high reliability.</p>\r
-\r
-<p class="whs5">The \r
- numeric modeling of a physical problem, the development of solutions and \r
- their integration into the design process are often handled in very specific \r
- environments. SALOME represents a generic CAD-based application for digital \r
- simulation with &quot;high reactivity to market evolutions and customer \r
- expectations&quot;. </p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">SALOME \r
- is a free software that provides a generic platform for Pre and Post-Processing \r
- for numerical simulation. It is based on an open and flexible architecture \r
- made of reusable components available as free software.</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">SALOME \r
- is a CAD/CAE integration platform. It provides reusable components for: \r
- </p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs5">3D \r
- modeling (bottom-up construction, import, healing);</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Visualization;</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Computational \r
- schemas management;</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Post-processing.</p></li>\r
-</ul>\r
-\r
-<p class="whs5">SALOME \r
- is tailored for integration of custom components:</p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs5">CAD \r
- interfaces;</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Mesh \r
- generators;</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Finite \r
- Element solvers with specific pre-processors.</p></li>\r
-</ul>\r
-\r
-<p class="whs5">The \r
- SALOME platform is available in Open Source.</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs7">Salome Platform:</p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs5">Supports \r
- interoperability between CAD modeling and computation software (CAD-CAE \r
- link) </p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Makes \r
- easier the integration of new components on heterogeneous systems for \r
- numerical computation </p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Sets \r
- the priority to multi-physics coupling between computation software </p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Provides \r
- a generic user interface, user-friendly and efficient, which helps to \r
- reduce the costs and delays of carrying out the studies </p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Reduces \r
- training time to the specific time for learning the software solution \r
- which has been based on this platform </p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">All \r
- functionalities are accessible through the programmatic integrated Python \r
- console</p></li>\r
-</ul>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<table x-use-null-cells cellspacing="0" width="100%" class="whs8">\r
-<col class="whs9">\r
-<col class="whs10">\r
-\r
-<tr valign="top" class="whs11">\r
-<td width="31.561%" class="whs12">\r
-<p><img src="../image65.gif" width="249px" height="221px" border="0" class="img_whs13"></td>\r
-<td width="68.439%" class="whs14">\r
-<p class="whs7"><span style="font-family: 'Times New Roman', serif; font-weight: bold;"><B>What \r
- can you do in SALOME? (Some of SALOME main functions)</B></span></p>\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs5"><span \r
- style="font-family: 'Times New Roman', serif;">Define geometrical models \r
- (create/modify geometrical items), import and export them using the BREP, \r
- IGES and STEP formats; </span></p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Define \r
- meshing of these geometrical items, import and export them;</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Handle \r
- physical properties and quantities attached to geometrical items, import \r
- and export them to a reusable format;</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Perform \r
- computations using a solver (optionally provided): read input data, configure \r
- the solver, and write calculation results);</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Visualize \r
- result fields in 3D, 2D and export images of their visualization to an \r
- appropriate format;</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Manage \r
- study schemes: definition, save/restore;</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs5">Manage \r
- computation schemes: definition, execution.</p></li>\r
-</ul></td></tr>\r
-</table>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/introduction_to_salome_pro.htm b/doc/salome/gui/GUI/kernel/introduction_to_salome_pro.htm
deleted file mode 100755 (executable)
index 5355481..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Introduction to SALOME</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { font-family:'Times New Roman' , serif; }\r
-p.whs2 { font-family:'Times New Roman' , serif; margin-left:0px; text-indent:48px; }\r
-p.whs3 { font-family:'Times New Roman' , serif; text-align:justify; text-indent:48px; font-weight:normal; }\r
-img_whs4 { border:none; width:623px; height:408px; border-style:none; }\r
-p.whs5 { font-family:'Times New Roman' , serif; margin-left:0px; }\r
-ul.whs6 { list-style:disc; }\r
-p.whs7 { font-family:'Times New Roman' , serif; margin-left:0px; font-weight:bold; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs2 {margin-left:1pt; }";\r
-  strNSS += "p.whs5 {margin-left:1pt; }";\r
-  strNSS += "p.whs7 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("About SALOME\nIntroduction to SALOME");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1"><span style="font-family: 'Times New Roman', serif;">Introduction \r
- to SALOME </span></h1>\r
-\r
-<p class="whs2">&nbsp;<span \r
- style="font-weight: bold;"><B>SALOME</B></span> \r
- platform represents a generic open source platform for pre- and post-processing \r
- in numeric simulations. <span style="font-weight: bold;"><B>SALOME</B></span> \r
- combines several software components, which are built in such a way that \r
- it allows to integrate solvers and existing meshing algorithms along with \r
- the specification of physical properties for a given domain. The originality \r
- of this approach is that the various components must cooperate dynamically \r
- and be configurable. </p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs3"><img src="../image54.jpg" width="623px" height="408px" border="0" class="img_whs4"></p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs5">SALOME \r
- platform integrates a number of modules each having its own function:</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs7"><span lang=EN-US><B>KERNEL</B></span><span \r
- lang=EN-US\r
-       style="font-weight: normal;"> : &nbsp;</span><span \r
- style="font-weight: normal;">provides a common \r
- shell for all components, which can be integrated into the SALOME platform.</span></p></li>\r
-</ul>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs7">GUI<span style="font-weight: normal;"> \r
- :</span> <span style="font-weight: normal;">provides visual representation: \r
- </span><span lang=EN-US\r
-                               style="font-weight: normal;">basic widgets, viewers etc. \r
- Third party modules optionally can have GUI, but in any case they always \r
- connected with KERNEL.</span></p></li>\r
-</ul>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs5"><span \r
- style="font-weight: bold;"><B>Geometry</B></span> : &nbsp;facilitates \r
- construction and optimization of geometrical models using a wide range \r
- of &nbsp;CAD \r
- functions. </p></li>\r
-</ul>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs5"><span \r
- style="font-weight: bold;"><B>Mesh</B></span> : &nbsp;generates \r
- meshes on geometrical models previously created or imported by the GEOM \r
- component.</p></li>\r
-</ul>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs5"><span \r
- style="font-weight: bold;"><B>Supervisor</B></span> : &nbsp;provides \r
- tools for construction of graphs and execution of calculations. </p></li>\r
-</ul>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs5"><span \r
- style="font-weight: bold;"><B>Post-Pro</B></span> : &nbsp;performs \r
- data visualization.</p></li>\r
-</ul>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs5"><span \r
- style="font-weight: bold;"><B>MED</B></span> : &nbsp;allows \r
- to work with MED files. </p></li>\r
-</ul>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','About SALOME architecture','about_salome_pro_architecture.htm','Introduction to GUI','../introduction_to_gui.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/intropage.png b/doc/salome/gui/GUI/kernel/intropage.png
deleted file mode 100644 (file)
index 226793c..0000000
Binary files a/doc/salome/gui/GUI/kernel/intropage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/kernel/logocorp.png b/doc/salome/gui/GUI/kernel/logocorp.png
deleted file mode 100644 (file)
index ab3c370..0000000
Binary files a/doc/salome/gui/GUI/kernel/logocorp.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/kernel/navigating_topics.htm b/doc/salome/gui/GUI/kernel/navigating_topics.htm
deleted file mode 100755 (executable)
index c98791e..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Navigating topics</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { font-family:'Times New Roman' , serif; }\r
-p.whs2 { font-family:'Times New Roman' , serif; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("Using this reference manual\nNavigating topics");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Navigating topics</h1>\r
-\r
-<p class="whs2">Topics in the SALOME \r
- <span style="font-family: 'Times New Roman', serif;">Help system include \r
- a variety of navigation components including:</span></p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p-CBULLETS><p class=BULLETS\r
-                                                                       style="font-weight: normal; font-family: 'Times New Roman', serif;"><span \r
- style="font-weight: bold;"><B>Related Topics buttons:</B></span> When you click \r
- a Related Topics button, a pop-up menu opens that displays a list of topics \r
- you can go to. The topics are relevant to what you are currently reading \r
- in the right-hand pane or they cross-reference related information that \r
- you can go to. Click a topic from the pop-up and it opens in the right-hand \r
- pane. </p></li>\r
-</ul>\r
-\r
-<p class=BULLETS\r
-       style="font-weight: normal; font-family: 'Times New Roman', serif;">&nbsp;</p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p-CBULLETS><p class=BULLETS\r
-                                                                       style="font-weight: normal; font-family: 'Times New Roman', serif;"><span \r
- style="font-weight: bold;"><B>Drop-down hotspots:</B></span> Many topics include \r
- drop-down hotspots. This is clickable text (text links) that displays \r
- more information below the hotspot. You only need to click the hotspots \r
- you want to read. To close the text, click the hotspot again. </p></li>\r
-</ul>\r
-\r
-<p class=BULLETS\r
-       style="font-weight: normal; font-family: 'Times New Roman', serif;">&nbsp;</p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p-CBULLETS><p class=BULLETS\r
-                                                                       style="font-weight: normal; font-family: 'Times New Roman', serif;"><span \r
- style="font-weight: bold;"><B>Expanding hotspots:</B></span> Some topics include \r
- expanding hotspots. This kind of hotspot is a text link that displays \r
- information immediately following the text. You only have to click the \r
- hotspots you want more information about. To close the text, click the \r
- hotspot again. </p></li>\r
-</ul>\r
-\r
-<p class=BULLETS\r
-       style="font-weight: normal; font-family: 'Times New Roman', serif;">&nbsp;</p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p-CBULLETS><p class=BULLETS\r
-                                                                       style="font-weight: normal; font-family: 'Times New Roman', serif;"><span \r
- style="font-weight: bold;"><B>Text-only popups:</B></span> This kind of link \r
- is text that displays a pop-up window when clicked. The popup window displays \r
- brief information about a term or concept relevant to the topic you're \r
- currently reading. When you finish viewing the information, you click \r
- inside the pop-up window to close it. </p></li>\r
-</ul>\r
-\r
-<p class=BULLETS\r
-       style="font-weight: normal; font-family: 'Times New Roman', serif;">&nbsp;</p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p-CBULLETS><p class=BULLETS\r
-                                                                       style="font-weight: normal; font-family: 'Times New Roman', serif;"><span \r
- style="font-weight: bold;"><B>Popups:</B></span> When you click some links, the \r
- destination topic opens in a popup inside the same window that's open. \r
- It's like having two windows in one, only the focus is on the information \r
- in the popup. When you finish reading the information in the popup, you \r
- can close it from view or navigate to any of its links. </p></li>\r
-</ul>\r
-\r
-<p class="whs2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>\r
-\r
-<p class="whs2">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'_blank','About SALOME help system','about_salome_pro_help_system.htm','Using left-hand tabs','using_left-hand_tabs.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/opening_studies.htm b/doc/salome/gui/GUI/kernel/opening_studies.htm
deleted file mode 100755 (executable)
index 454f55f..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Opening studies</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { text-align:justify; }\r
-p.whs2 { margin-left:0px; text-align:justify; }\r
-img_whs3 { border:none; width:30px; height:30px; float:none; border-style:none; }\r
-p.whs4 { font-style:italic; color:#ff0000; margin-left:0px; text-align:justify; }\r
-p.whs5 { font-style:italic; text-align:justify; color:#000000; font-family:'Arial Black' , sans-serif; }\r
-p.whs6 { font-style:italic; color:#ff0000; text-align:justify; }\r
-p.whs7 { font-style:italic; color:#ff0000; margin-left:40px; text-align:justify; }\r
-img_whs8 { border:none; width:25px; height:28px; float:none; border-style:none; }\r
-p.whs9 { margin-left:0px; font-style:italic; color:#ff0000; text-align:justify; }\r
-p.whs10 { margin-left:40px; text-align:justify; }\r
-img_whs11 { border:none; width:331px; height:207px; float:none; border-style:none; }\r
-p.whs12 { color:#ff0000; margin-left:0px; background-image:url('../texture_horiz_ltbluebubbles.jpg'); text-align:justify; }\r
-img_whs13 { border:none; float:none; width:35px; height:37px; border-style:none; }\r
-p.whs14 { color:#ff0000; margin-left:0px; text-align:justify; }\r
-p.whs15 { margin-left:0px; font-weight:bold; text-align:justify; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs2 {margin-left:1pt; }";\r
-  strNSS += "p.whs4 {margin-left:1pt; }";\r
-  strNSS += "p.whs9 {margin-left:1pt; }";\r
-  strNSS += "p.whs12 {margin-left:1pt; }";\r
-  strNSS += "p.whs14 {margin-left:1pt; }";\r
-  strNSS += "p.whs15 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nStudy management\nOpening studies");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Opening studies</h1>\r
-\r
-<p class="whs2"><img src="../i_blue.jpg" x-maintain-ratio="TRUE" width="30px" height="30px" border="0" class="img_whs3">In <span \r
- style="font-weight: bold;"><B>SALOME</B></span> all studies are stored in a special \r
- format *.hdf. </p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5">To open an existing \r
- study:</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs7"><span style="font-style: normal; color: #000000;"><font color=black >In \r
- the main toolbar click </font></span><img src="../pics/open.jpg" x-maintain-ratio="TRUE" width="25px" height="28px" border="0" class="img_whs8"> <span style="font-style: normal; color: #000000;"><font color=black >or \r
- from the main menu select </font></span><span style="font-style: normal;\r
-                                                                                               color: #000000;\r
-                                                                                               font-weight: bold;"><font color=black ><B>File \r
- &gt; Open</B></font></span><span style="font-style: normal; color: #000000;"><font color=black > option. \r
- From a standard Search File dialog box choose the required *.hdf file \r
- and click </font></span><span style="font-style: normal;\r
-                                                               color: #000000;\r
-                                                               font-weight: bold;"><font color=black ><B>Open</B></font></span><span style="font-style: normal; color: #000000;"><font color=black > \r
- button.</font></span></p>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<p class="whs9"><span style="color: #000000; font-family: 'Arial Black', sans-serif;"><font color=black >To \r
- load an unloaded study (<a href="saving_a_study.htm">see also</a>):</font></span> \r
- </p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs10">From the main menu select \r
- <span style="font-weight: bold;"><B>File &gt; Connect</B></span> option. In the \r
- following dialog box select one of the studies, which has been previously \r
- created and unloaded and click <span style="font-weight: bold;"><B>Ok</B></span> \r
- button:</p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs10"><img src="../pics/loadstudy2.png" x-maintain-ratio="TRUE" width="331px" height="207px" border="0" class="img_whs11"></p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs12"><span style="color: #000000;"><font color=black ><img src="../tip1.gif" x-maintain-ratio="TRUE" x-save-file="TRUE" x-save-method="compute-relative" width="35px" height="37px" border="0" class="img_whs13"> After opening an existing study, you will see its structure \r
- in the <a href="using_object_browser.htm">Object Browser</a>. It will \r
- contain the objects created with the help of different components during \r
- the previous study session. If you right-click on one of the objects and \r
- from the associated pop-up menu choose </font></span><span style="color: #000000; font-weight: bold;"><font color=black ><B>Open \r
- With</B></font></span><span style="color: #000000;"><font color=black > option, which will automatically \r
- launch the component corresponding to this object. </font></span></p>\r
-\r
-<p class="whs14">&nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs15">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Creating a new study','creating_a_new_study.htm','Displaying studies','displaying_studies.htm','Introduction to GUI','../introduction_to_gui.htm','SALOME desktop','salome_pro_desktop.htm','Saving and closing studies','saving_a_study.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs15">&nbsp;</p>\r
-\r
-<p class="whs15">&nbsp;</p>\r
-\r
-<p class="whs15">&nbsp;</p>\r
-\r
-<p class="whs15">&nbsp;</p>\r
-\r
-<p class="whs15">&nbsp;</p>\r
-\r
-<p class="whs15">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/productpage.png b/doc/salome/gui/GUI/kernel/productpage.png
deleted file mode 100644 (file)
index bc05c8b..0000000
Binary files a/doc/salome/gui/GUI/kernel/productpage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/kernel/productpage1.png b/doc/salome/gui/GUI/kernel/productpage1.png
deleted file mode 100644 (file)
index b666166..0000000
Binary files a/doc/salome/gui/GUI/kernel/productpage1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/kernel/productpage2.png b/doc/salome/gui/GUI/kernel/productpage2.png
deleted file mode 100644 (file)
index 998d286..0000000
Binary files a/doc/salome/gui/GUI/kernel/productpage2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/kernel/progresspage.png b/doc/salome/gui/GUI/kernel/progresspage.png
deleted file mode 100644 (file)
index 0779fcc..0000000
Binary files a/doc/salome/gui/GUI/kernel/progresspage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/kernel/progresspage1.png b/doc/salome/gui/GUI/kernel/progresspage1.png
deleted file mode 100644 (file)
index efaa4d1..0000000
Binary files a/doc/salome/gui/GUI/kernel/progresspage1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/kernel/readme.html b/doc/salome/gui/GUI/kernel/readme.html
deleted file mode 100755 (executable)
index 0b4411a..0000000
+++ /dev/null
@@ -1,2068 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>SALOME Installation Wizard Help</title>\r
-<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style>\r
-<!--\r
-A:visited { color:#551a8b; }\r
-A:active { color:#ff0000; }\r
-A:link { color:#0000ee; }\r
--->\r
-</style><style type="text/css">\r
-<!--\r
-p.whs1 { text-align:center; }\r
-table.whs2 { width:100%; }\r
-img_whs3 { width:139px; height:47px; border-style:none; }\r
-h3.whs4 { text-align:center; }\r
-div.whs5 { text-align:right; }\r
-img_whs6 { width:109px; height:47px; border-style:none; }\r
-hr.whs7 { float:aligncenter; }\r
-div.whs8 { margin-left:40px; }\r
-h3.whs9 { margin-left:40px; }\r
-img_whs10 { width:586px; height:364px; border-style:none; }\r
-p.whs11 { background-image:url('../texture_horiz_ltbluebubbles.jpg'); }\r
-img_whs12 { border:none; width:35px; height:37px; float:none; border-style:none; }\r
-img_whs13 { float:none; width:586px; height:525px; border-style:none; }\r
-img_whs14 { border:none; width:36px; height:38px; float:none; border-style:none; }\r
-img_whs15 { width:586px; height:525px; border-style:none; }\r
-img_whs16 { width:586px; height:485px; border-style:none; }\r
-p.whs17 { text-align:justify; }\r
-img_whs18 { width:586px; height:484px; border-style:none; }\r
-img_whs19 { width:660px; height:410px; border-style:none; }\r
-p.whs20 { background-color:#ffffff; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("About SALOME\nInstalling SALOME");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body style="color: #000000;"><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<p align="center" class="whs1">&nbsp; </p>\r
-\r
-<table nosave x-use-null-cells width="100%" class="whs2">\r
-\r
-<tr nosave>\r
-<td nosave>\r
-<h1><a href="http://www.opencascade.com"><img src="logocorp.png" width="139px" height="47px" border="0" class="img_whs3"> </a></td>\r
-<td>\r
-<h3 align="center" class="whs4"><font style="font-size: xx-large;"\r
-                                               size=7><font style="color: #000099;"\r
-                                                                       color=#000099>SALOME Installation Wizard \r
- Help</font></font></td>\r
-<td>\r
-<div align="right" class="whs5">\r
-<a href="http://www.opencascade.org/SALOME/"><img src="application.png" width="109px" height="47px" border="0" class="img_whs6"> </a>\r
-</div></td></tr>\r
-</table>\r
-\r
-<div align="right" class="whs5">\r
-&nbsp; \r
-</div>\r
-\r
-\r
-<hr class="whs7">\r
-\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#install_from_wizard">Installing products \r
- with the Installation Wizard</a></li>\r
-       \r
-       <ul>\r
-               \r
-               <li class=kadov-p\r
-                       class=kadov-p><a href="#gui_mode">GUI mode</a></li>\r
-               \r
-               <li class=kadov-p\r
-                       class=kadov-p><a href="#batch_mode">Batch mode</a></li>\r
-               \r
-               <li class=kadov-p\r
-                       class=kadov-p><a href="#env_files">Environment files</a></li>\r
-       </ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#check_version_proc">Notes on check products \r
- version procedure</a></li>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#pick_up_env">Pick up the environment</a></li>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#xml_files">Modifying XML configuration \r
- file</a></li>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#new_products">Implementing installation \r
- scripts for the new products</a></li>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><a href="#finish_buttons">Customizing Readme page \r
- buttons</a></li>\r
-</ul>\r
-\r
-\r
-<hr class="whs7">\r
-\r
-\r
-<h3><a name=install_from_wizard></a>Installing products with the <font \r
- style="color: #ff0000;"\r
-       color=#FF0000>Installation Wizard</font></h3>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The Installation Wizard can be launched \r
- in two modes: </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>GUI \r
- </B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">and </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>batch</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. <br>\r
-The root directory of the Installation Wizard contains Python script </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>runInstall</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. \r
- To run the Installation Wizard just type <b>runInstall</b> in the terminal \r
- window: </font></span>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">[ python ] </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">runInstall \r
- </font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">[options]</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Without options this script will launch \r
- the SALOME Installation Wizard in the default mode (GUI).<br>\r
-The default installation settings can be overridden by using command line \r
- options. Each option has a short and a long notation:</font></span></p>\r
-\r
-<p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">-g / --gui</font></span></b></p>\r
-\r
-<div class="whs8">\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Runs the Installation Wizard in the GUI \r
- mode (this is the default mode). </font></span>\r
-</div>\r
-\r
-<p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">-b / --batch</font></span></b></p>\r
-\r
-<div class="whs8">\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Runs the Installation Wizard in the terminal \r
- mode. </font></span>\r
-</div>\r
-\r
-<p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">-f FILE \r
- / --file=</font></span></b><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>FILE</B></font></span></p>\r
-\r
-<div class="whs8">\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The XML configuration file to be used by \r
- the Installation Wizard.&nbsp; If this option is not used then the installation \r
- script tries to define the <i>Linux </i>version and use the corresponding \r
- XML file if it exists. For examle, for </font></span><span style="font-size: 12pt; color: rgb(0, 0, 153);"><font size=3 style="font-size:12pt;">Linux \r
- Mandrake 10.1</font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&nbsp; the <b>config_Mandrake_10.1.xml</b>&nbsp; \r
- file will be used by default. If no appropriate file is found, the file \r
- <b>config.xml</b> will be used. This file refers to the basic target platform \r
- which is </font></span><span style="font-size: 12pt; color: rgb(0, 0, 153);"><font size=3 style="font-size:12pt;">Linux \r
- Mandrake 10.1</font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> for SALOME 3.0 and \r
- newer. If </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>config.xml</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> file is not found either, a warning message \r
- box is shown (in GUI mode) or printed to the console (in batch mode) and \r
- the Installation Wizard quits. </font></span>\r
-</div>\r
-\r
-<p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">-d DIR \r
- / --target=DIR</font></span></b></p>\r
-\r
-<div class="whs8">\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The target directory SALOME platform is \r
- to be installed to. If used, this option overrides the default target \r
- directory, given in the configuration XML file (usually</font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B> \r
- ${HOME}/salome_&lt;version&gt;</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, \r
- see <a href="#xml_files"\r
-               style="font-size: 12pt;">here</a> for more details). </font></span>\r
-</div>\r
-\r
-<p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">-t DIR \r
- / --tmp=DIR </font></span></b></p>\r
-\r
-<div class="whs8">\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The directory, which should be used for \r
- temporary files. If given, this option overrides the default temporary \r
- directory, given in the configuration xml file (usually </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>/tmp</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, see <a href="#xml_files"\r
-                                                                       style="font-size: 12pt;">here</a> for \r
- more information). </font></span>\r
-</div>\r
-\r
-<p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">-a / --all-from-sources</font></span></b></p>\r
-\r
-<div class="whs8">\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Forces all the products to be installed \r
- from sources (including all SALOME modules). If this option is used, all \r
- default installation modes for all products are ignored.<br>\r
-This option is helpful when the user wants to install SALOME on the platform \r
- which is not officially supported. In this case, the user can try to run \r
- the SALOME Installation Wizard with the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>-a</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> option in order to build all the products from \r
- sources.</font></span><span style="font-weight: bold;\r
-                                                               font-size: 12pt;\r
-                                                               color: #ff0000;"><font size=3 color=red style="font-size:12.000000pt;"><B><br>\r
-Note, that this is a time-consuming operation which can take more than \r
- 24 hours depending on the computer.</B></font></span><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span>\r
-</div>\r
-\r
-<p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">-h / --help</font></span></b></p>\r
-\r
-<div class="whs8">\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Prints help information on the Installation \r
- Wizard's use. </font></span>\r
-</div>\r
-\r
-<p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">-v / --version</font></span></b></p>\r
-\r
-<div class="whs8">\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Prints version information (</font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>Note: </B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">this \r
- is the Installation Wizard's version number, not the number of SALOME \r
- platform version). </font></span>\r
-</div>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The installation procedure supports different \r
- </font></span><span style="font-size: 12pt; color: rgb(0, 0, 153);"><font size=3 style="font-size:12pt;">Linux </font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">platforms and installs various installation 3d-party \r
- prerequisite products which are required by SALOME platform. As it was \r
- mentioned above, the basic target platform for SALOME 3.0 and newer is \r
- </font></span><span style="font-size: 12pt; color: rgb(0, 0, 153);"><font size=3 style="font-size:12pt;">Linux Mandrake \r
- 10.1</font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">.<br>\r
-Use of configuration XML files gives a flexible way to modify the list \r
- of products to be installed by the Installation Wizard without changing \r
- the program source code. Just create your own XML configuration file and \r
- implement installation scripts for the prerequisite products you need \r
- and then use this XML file with the Installation Wizard. This can be done, \r
- for example, for some </font></span><span style="font-size: 12pt; color: rgb(0, 0, 153);"><font size=3 style="font-size:12pt;">Linux \r
- </font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">platform which is not supported \r
- directly by the Installation Wizard. See </font></span><a href="#xml_files"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Modifying XML configuration file</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><a href="#new_products"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Implementing \r
- installation scripts for the new products</font></span></a><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- sections for more information. </font></span></p>\r
-\r
-<h3 class="whs9"><a name=gui_mode></a>GUI mode</h3>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The </font></span><font style="color: #ff0000;"\r
-                                                                                                       color=#FF0000><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Installation Wizard</font></span></font><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- GUI has been developed using </font></span><span style="font-size: 12pt; color: rgb(0, 0, 153);"><font size=3 style="font-size:12pt;">Trolltech's \r
- </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>Qt 3.0.5 </B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">toolkit. After launching the Installation Wizard \r
- in the GUI mode the wizard window is shown to the user. This wizard guides \r
- the user through several subsequent pages. To navigate between the pages \r
- use </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Next&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Back&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> buttons in the lower part of the wizard window. \r
- The </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Cancel&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> button closes the wizard window&nbsp;and quits \r
- the installation procedure after the user's confirmation. The </font></span><i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Help&quot;</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- button opens an additional window to show help information. </font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The first &quot;</font></span><span style="font-style: italic; font-size: 12pt;"><font size=3 style="font-size:12pt;"><I>Introduction&quot;</I></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> page is shown in </font></span><a href="#IntroPage"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Figure 1</font></span></a><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. \r
- Skip this page by clicking </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Next&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">: </font></span></p>\r
-\r
-<a name=IntroPage></a>\r
-\r
-<p align="center" class="whs1">&nbsp;</p>\r
-\r
-<p align="center" class="whs1"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><img alt="Intro page" src="intropage.png" width="586px" height="364px" border="0" class="img_whs10"> </font></span></p>\r
-\r
-<p align="center" class="whs1"><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Figure \r
- 1:</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> &quot;Introduction&quot; \r
- page</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">In the second page you are proposed to \r
- enter the target directory where the SALOME platform should be installed \r
- to. You can also click </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Browse...&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and choose the destination folder using the \r
- standard browse directory dialog box. <br>\r
-If the directory you want to install products to does not exist you are \r
- prompted to confirm directory creation. If you type a wrong directory \r
- path, or if you do not have write permissions for the directory you use, \r
- the corresponding message box is shown.</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">You can also change the temporary directory \r
- (which is used to store temporary files required for the installation).<br>\r
-In the bottom part of the window the total disk space required for the \r
- installation and for the temporary files is displayed (see below for more \r
- details).</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">In the GUI mode the Installation Wizard \r
- provides two different options to install the SALOME platform: </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>basic</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- (default option) and </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>advanced.</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> In the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>basic</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> mode the user should enter the target installation \r
- directory and temporary folder. All other installation options are taken \r
- from the XML configuration file (see </font></span><a href="#Product_page1"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Fig.2</font></span></a><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">):</font></span></p>\r
-\r
-<a name=Product_page1></a>\r
-\r
-<p align="center" class="whs1">&nbsp;</p>\r
-\r
-<p align="center" class="whs1"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><img alt="Intro page" src="productpage1.png" width="586px" height="364px" border="0" class="img_whs10"> </font></span></p>\r
-\r
-<p align="center" class="whs1"><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Figure \r
- 2:</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> &quot;Installation settings&quot; \r
- </font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">In addition, you have a choice to use \r
- &quot;Install all products from sources&quot; check box. If this option \r
- is turned on, all the products will be installed from the sources (using \r
- their own build procedures). This check box corresponds to the </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>--all-from-sources</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> (</font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>-a</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">) option of the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>runInstall</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> script (see </font></span><a href="#install_from_wizard"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">here</font></span></a><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">). \r
- </font></span></p>\r
-\r
-<p class="whs11"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><img src="../note1.gif" x-maintain-ratio="TRUE" width="35px" height="37px" border="0" class="img_whs12"></font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B> \r
- Installation of all products from sources is a long-time operation.</B></font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">To switch to the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>advanced</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> option, click </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;More...&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> (see </font></span><a href="#ProductPage2"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Fig.3</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> ).</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">In the advanced mode you have a possibility \r
- to select products to be installed. Each product can have several options \r
- of installation: you have a possibility to use the native product (provided \r
- with Linux distribution and installed in the system folders), install \r
- already precompiled binaries, build the product from sources or not install \r
- it at all. Available options and default option are taken from the XML \r
- configuration file. You can mark the products you want to install by clicking \r
- the corresponding radio-buttons in the list view in the left part of the \r
- page. <br>\r
-Note, that some products may require some other pre-requisite products \r
- to be installed (or these prerequisite products should be already available \r
- on your computer). The installation procedure has a special feature to \r
- automatically mark these products in the list view. For example, in order \r
- to install </font></span><b><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">PyQt</font></span></i></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> it is necessary to have </font></span><b><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">gcc, \r
- Python</font></span></i></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">,</font></span><b><i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> Qt</font></span></i></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- and </font></span><b><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Sip</font></span></i></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> installed. Therefore all these products will \r
- also be &nbsp;turned \r
- on when you check on </font></span><b><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">PyQt</font></span></i></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. This feature can be switched off by clicking \r
- the </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Automatic dependencies&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> checkbox. Turn on this checkbox if you want \r
- all prerequisite products to be automatically checked when you select \r
- some product to be installed. Turn off this checkbox if you want to disable \r
- this feature.</font></span></p>\r
-\r
-<a name=ProductPage2></a>\r
-\r
-<p align="center" class="whs1">&nbsp;</p>\r
-\r
-<p align="center" class="whs1"><img src="productpage.png" alt="Products page" width="586px" height="525px" border="0" class="img_whs13"> </p>\r
-\r
-<p align="center" class="whs1"><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Figure \r
- 3:</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> &quot;Installation settings&quot; \r
- page in the 'advanced' mode</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">If you want to use native products (like \r
- </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>gcc</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>tcl</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, etc.), select </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;use \r
- native&quot; </font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">option. <br>\r
-Special button in the right part of the page - </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Unselect \r
- All&quot; </font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">- allows to reset \r
- quickly all products to the </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;not \r
- install&quot;</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> state. </font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">There are also two checkboxes on this \r
- page: </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;SALOME sources&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;SALOME \r
- binaries&quot;</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. These three-state \r
- checkboxes allow quick selecting/unselecting sources/binaries packages \r
- of SALOME modules for installation.</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">In addition, when some SALOME sources \r
- are selected, one more check box becomes available: </font></span><span style="font-style: italic; font-size: 12pt;"><font size=3 style="font-size:12pt;"><I>&quot;Build \r
- SALOME sources&quot;</I></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. If this option \r
- is turned on, the selected SALOME modules will be built and installed \r
- from sources.</font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B><br>\r
-&nbsp;</B></font></span></p>\r
-\r
-<p class="whs11"><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"> If this check \r
- box is turned on, the corresponding SALOME module binaries package installation \r
- is disabled, because of &nbsp;SALOME \r
- module sources and binaries packages conflict </B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">(see \r
- </font></span><a href="#ProductPage3"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Fig. 4</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> below). </font></span></p>\r
-\r
-<a name=ProductPage3></a>\r
-\r
-<p align="center" class="whs1"><img src="productpage2.png" alt="Products page" width="586px" height="525px" border="0" class="img_whs15"> </p>\r
-\r
-<p align="center" class="whs1"><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Figure \r
- 4:</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> &quot;Build SALOME sources&quot; \r
- check box usage</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The box at the right side of the page \r
- displays the information about currently highlighted product: name, version \r
- and short description, required disk space, disk space required for temporary \r
- files, list of prerequisites (this information is provided in the XML \r
- file) and current user choice. </font></span></p>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Disk \r
- space required:&quot;</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> field \r
- displays how much disk space on the hard drive is required for installation \r
- of selected products. </font></span>\r
-\r
-<p class="whs11"><b \r
- style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"></font></span></b><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>Please, \r
- take into account that the displayed amount of required disk space is \r
- approximate and may differ when you install products on your hard drive.</B></font></span><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The installation procedure uses a special \r
- directory to store temporary files. The </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Space \r
- for temporary files:&quot;</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> field \r
- shows the information about required disk space on the hard drive for \r
- extracting and compiling the selected products. You can change the temporary \r
- directory - just type a path to the folder you want to use or click on \r
- the corresponding </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Browse...&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> button. </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B><br>\r
-&nbsp;</B></font></span></p>\r
-\r
-<p class="whs11"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><b style="font-weight: bold;"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"></b></font></span><b><span \r
- style="font-weight: normal; font-size: 12pt;"><font size=3 style="font-size:12pt;">A</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">ctually, \r
- temporary files are not stored directly in the directory entered by the \r
- user. The Installation Wizard creates an additional folder in this directory \r
- named something like INSTALLWORK</font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>XXXXX</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> where XXXXX is a unique number. This allows \r
- to launch several Installation Wizards simultaneously. This temporary \r
- directory is removed automatically when the installation finishes.</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The installation procedure also checks \r
- the available disk space. If there is not enough disk space on your hard \r
- drive you will see a corresponding error message box. </font></span></p>\r
-\r
-<p class="whs11"><b \r
- style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14">You are strongly recommended not to use directory names containing \r
- spaces. </font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Otherwise you can experience \r
- some troubles with the installation.</font></span><b><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span></b></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">To proceed further click </font></span><i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Next&quot;</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. \r
- At this moment the program will make some tests to check installation \r
- settings: if there is enough disk space on the hard drive, check for native \r
- products installation, dependencies (prerequisites) for each product you \r
- have selected to be installed. If any test fails you will see the corresponding \r
- warning message box. Otherwise the wizard will proceed to the next page: \r
- </font></span></p>\r
-\r
-<a name=ChoicePage></a>\r
-\r
-<p align="center" class="whs1">&nbsp;</p>\r
-\r
-<p align="center" class="whs1"><img src="choicepage.png" alt="Choice page" width="586px" height="485px" border="0" class="img_whs16"> </p>\r
-\r
-<p align="center" class="whs1"><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Figure \r
- 5:</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> &quot;Check your choice&quot; \r
- page</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This page summarizes the installation \r
- options you've made on the previous pages. You can check again your choice \r
- and change it if necessary by getting back to the previous page. <br>\r
-When you are sure that everything is OK, click </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Next&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> to follow to the </font></span><a href="#ProgressPage"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">next page</font></span></a><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. \r
- </font></span></p>\r
-\r
-<a name=ProgressPage></a>\r
-\r
-<p align="center" class="whs1">&nbsp;</p>\r
-\r
-<p align="center" class="whs1"><img alt="Progress page" src="progresspage1.png" width="586px" height="364px" border="0" class="img_whs10"></p>\r
-\r
-<p align="center" class="whs1"><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Figure \r
- 6:</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> &quot;Installation progress&quot; \r
- page</font></span></p>\r
-\r
-<p class="whs17"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">To start \r
- installation of the selected products click &quot;Start&quot;. It launches \r
- the shell installation script and you will be able to see the output of \r
- the script in the &nbsp;dialog \r
- topmost frame. If any errors occur during the installation progress the \r
- corresponding messages will be printed to the log window in bold red font.</font></span></p>\r
-\r
-<p class="whs17"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">It is possible \r
- to break the installation at any time by clicking &quot;Stop&quot;. Then \r
- you can get back to the previous pages if you wish to change installation \r
- settings or restart installation by pressing again &quot;Start&quot; button.</font></span></p>\r
-\r
-<p class="whs11"><b><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"> I</B></font></span></b><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>n the current implementation \r
- it is not possible to resume the stopped installation process; it will \r
- be re-started from the very beginning.</B></font></span><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span></p>\r
-\r
-<a name=ProgressPage1></a>\r
-\r
-<p align="center" class="whs1">&nbsp;</p>\r
-\r
-<p align="center" class="whs1"><img alt="Progress page" src="progresspage.png" width="586px" height="364px" border="0" class="img_whs10"> </p>\r
-\r
-<p align="center" class="whs1"><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Figure \r
- 7:</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> &quot;Installation progress&quot; \r
- page: installation in progress</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Installation \r
- Status&quot;</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> frame window shows \r
- you the progress of installation. &quot;</font></span><font style="color: #ff0000;"\r
-                                                                                                               color=#FF0000><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Waiting</font></span></font><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot; \r
- status means that installation of this product has not been started yet. \r
- The product currently being installed is marked as &quot;</font></span><font \r
- style="color: #ff9900;"\r
-       color=#FF9900><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Processing</font></span></font><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;. All installed products have &quot;</font></span><font \r
- style="color: #33ff33;"\r
-       color=#33FF33><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Completed</font></span></font><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot; status. </font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">You can abort installation and close \r
- the installation procedure using </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Cancel&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> button. </font></span></p>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&nbsp; </font></span>\r
-\r
-<p class="whs11"><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B><b style="font-weight: bold;"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14">T</b>his button sends the signal &quot;SIGTERM&quot; to the \r
- shell script. The script tries to clear all temporary files. The process \r
- of removing temporary files can take some time, so the installation wizard \r
- will wait 3 seconds before closing.</B></font></span><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">At the end of installation (all selected \r
- products have been installed successfully) you can go back to the previous \r
- pages to start a new installation or click </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Next&quot; \r
- </font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">to go the Readme page: </font></span></p>\r
-\r
-<a name=readmepage></a>\r
-\r
-<p align="center" class="whs1">&nbsp;</p>\r
-\r
-<p align="center" class="whs1"><img alt="Read page" src="readmepage.png" width="586px" height="484px" border="0" class="img_whs18"> </p>\r
-\r
-<p align="center" class="whs1"><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Figure \r
- 8:</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> &quot;Finish installation&quot; \r
- page</font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">In this page you can read important information \r
- about the Instalation Wizard itself and some tips: how to run and test \r
- SALOME or how to build SALOME from the sources. This is the contents of \r
- the README file which you can find in the root directory of the Installation \r
- Wizard. <br>\r
-You can also launch SALOME Desktop from this page or read the Release Notes \r
- file by clicking on the corresponding buttons in the lower part of the \r
- page (see </font></span><a href="#xml_files"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">here</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><a href="#finish_buttons"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">here</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> for more information about customizing these \r
- buttons).</font></span></p>\r
-\r
-<h3 class="whs9"><a name=batch_mode></a>Batch mode</h3>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">To launch the Installation Wizard in \r
- the batch mode use </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>-b</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> (</font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>--batch</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">) parameter.<br>\r
-In this mode the GUI wizard is not shown but all the installation status \r
- is displayed directly in the console. In the batch mode the user does \r
- not have a possibility to change installation settings which are given \r
- in the configuration file, except target and temporary directories which \r
- can be overridden by the corresponding command line options.<br>\r
-The only exception is </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>--all-from-sources</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> (</font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>-a</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">) option which enables special installation mode \r
- in which all the products (including SALOME modules) are installed from \r
- sources, ignoring the default mode defined in the XML configuration file \r
- (see </font></span><a href="#install_from_wizard"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">here</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> for details).</font></span></p>\r
-\r
-<p align="center" class="whs1">&nbsp;<a \r
- name=BatchMode></a><br>\r
-<br>\r
-<img alt="Batch mode" src="batchmode.png" width="660px" height="410px" border="0" class="img_whs19"> </p>\r
-\r
-<p align="center" class="whs1"><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Figure \r
- 9:</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> Batch mode</font></span></p>\r
-\r
-<h3 class="whs9"><a name=env_files></a>Environment files</h3>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">During the process of installation the \r
- script creates some environment files to simplify the procedure of launching \r
- SALOME. These shell scripts set all necessary environment variables for \r
- all products you have installed. To learn how installation scripts collects \r
- the environment, see </font></span><a href="#pick_up_env"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">here</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. These files are: </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">salome.csh</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> + </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">salome.sh</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> in the </font></span><span style="font-style: italic;\r
-                                                                                                               font-weight: bold;\r
-                                                                                                               font-size: 12pt;"><font size=3 style="font-size:12pt;"><I><B>KERNEL \r
- module</B></I></font></span><b><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> sources</font></span></i></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><span style="font-style: italic;\r
-                                                                                                       font-weight: bold;\r
-                                                                                                       font-size: 12pt;"><font size=3 style="font-size:12pt;"><I><B>KERNEL \r
- module</B></I></font></span><b><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> binaries</font></span></i></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> root directories and </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">env_products.csh</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> + </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">env_products.sh \r
- </font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">and </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>env_build.csh \r
- </B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">+ </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>env_build.sh</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> in the target installation directory.</font></span></p>\r
-\r
-<p class="whs11"><b><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"></B></font></span></b><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>Note:</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- there is some difference between these files: </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>env_build.*</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> files are optimized to be used for building \r
- SALOME modules from sources (see </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>README \r
- </B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">file provided with the installation \r
- procedure on the CD). The </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>env_products.*</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> (and</font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B> \r
- salome.*</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">) files are optimized for \r
- SALOME launching. The behavior is defined by the environment variable</font></span><span \r
- style="font-weight: bold; font-size: 12pt;"> <font size=3 style="font-size:12pt;"><B></B></font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">ENV_FOR_LAUNCH</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> which is set to </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>0</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> in env_build.* files and to </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>1</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> in env_products.* (salome.*) files. </font></span></p>\r
-\r
-&nbsp;<br>\r
-\r
-\r
-<hr class="whs7">\r
-\r
-\r
-<h3><a name=check_version_proc></a>Notes on<font style="color: #ff0000;"\r
-                                                                                               color=#FF0000> check products \r
- version</font> procedure</h3>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Unfortunately there is no exact algorithm \r
- to identify the product version under Linux platform. The information \r
- in this section gives an idea how the version is checked for the native/preinstalled \r
- products (this information refers to the base platform </font></span><span style="font-size: 12pt; color: rgb(0, 0, 153);"><font size=3 style="font-size:12pt;">Linux \r
- Mandrake 10.1</font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">; and the same algorithms \r
- are used for other platforms). <br>\r
-The general rule for all products is that the path to the binaries should \r
- be set via the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable, path to the libraries \r
- should be set via the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>LD_LIBRARY_PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> variable and the python modules should be available \r
- via the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PYTHONPATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> variable. </font></span>\r
-\r
-<p class="whs11"><b><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"></B></font></span></b><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>Note:</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- the information given in this section refers to the prerequisite products \r
- for SALOME version 3.2.4. </font></span></p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">gcc 3.4.1</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is checked by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>gcc -dumpversion</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> command. The </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>gcc</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> executable should be in the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable. Version should be equal \r
- to &quot;3.4.1&quot;. It is recommended to use native gcc on Mandrake \r
- 10.1. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">tcl/tk 8.4.5</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number for </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>tcl/tk</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> can be found in tclConfig.sh and tkConfig.sh \r
- files (</font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>TCL_VERSION</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>TK_VERSION</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> variables correspondingly). Version number should \r
- be equal to &quot;8.4&quot; (release number is not checked). <br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>TCLHOME</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable to the root directory of \r
- tcl/tk installation.<br>\r
-It is recommended to use native tcl/tk on Mandrake 10.1. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">boost 1.31.0</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is defined by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>version.hpp</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- file which is part of the boost distribution. This file defines the </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>BOOST_VERSION</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> macro which should be equal to &quot;103100&quot;. \r
- In addition the existence of boost libraries is checked. <br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>BOOSTDIR</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable if you have a preinstalled \r
- version of boost. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Python 2.3.4</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is checked by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>python -V</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- command. The </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>python</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> executable should be in the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable. Version number should \r
- be equal to &quot;2.3.4&quot;. It is recommended to use native Python \r
- on Mandrake 10.1.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PYTHONHOME</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable if you have a preinstalled \r
- version of Python. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Swig 1.3.24</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is checked by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>swig -version</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> command. The </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>swig</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> executable should be in the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable. Version number should \r
- be equal to &quot;1.3.24&quot;. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Qt 3.3.3</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is defined by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>qglobal.h</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- file which is part of the Qt distribution. This file defines </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>QT_VERSION_STR</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> macro which should be equal to &quot;3.3.3&quot;. \r
- It is recommended to use native Qt on Mandrake 10.1.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>QTDIR</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable if you have a preinstalled \r
- version of qt. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">msg2qm</font></span></li>\r
-</ul>\r
-\r
-<span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>msg2qm</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- is a Qt tool which is used to convert text *.po files to *.qm resource \r
- files. Unfortunately this tool is not included to the Linux distribution \r
- and provided only in Qt sources package. This is the reason why this tool \r
- is supplied with the SALOME Installation Wizard.<br>\r
-There is no way to check the version number of msg2qm tool. Just set </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>MSG2QM_ROOT</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- environment variable if you have a preinstalled version of msg2qm tool. \r
- </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Open CASCADE 6.1.2a2</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is defined by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>Standard_Version.hxx</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> file which is part of the Open CASCADE distribution. \r
- This file defines </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>OCC_VERSION_MAJOR,</B></font></span><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>OCC_VERSION_MINOR</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>OCC_VERSION_MAINTENANCE</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> macros which should refer to version 6.1.2.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>CASROOT</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable if you have a preinstalled \r
- version of Open CASCADE. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">qwt 4.2.0/0.4.2</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is defined by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>qwt_global.h</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- file which is part of the qwt distribution. This file defines </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>QWT_VERSION_STR</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> macro which should be equal to &quot;4.2.0&quot;.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>QWTHOME</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable if you have a preinstalled \r
- version of qwt. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">hdf 5-1.6.4</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is defined by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>libhdf5.settings</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> file which is part of the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>hdf5</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> distribution. Version should be equal to 1.6.4.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>HDF5HOME</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable if you have a preinstalled \r
- version of hdf5. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">med 2.2.3</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Unfortunately there is no formal way to \r
- check med version number. We check existence of libmed.so.1.0.2 library \r
- on the computer. If you have any problem with a preinstalled version of \r
- med, please, reinstall it.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>MED2HOME</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable if you have a preinstalled \r
- version of med. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Vtk 4.2.6</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Unfortunately there is no formal way to \r
- check VTK version number. We just check the existence of </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>libvtkCommon.so</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> library on the computer and hope that it is \r
- of version we need. If you have any problem with a preinstalled version \r
- of Vtk, please, reinstall it.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>VTKHOME</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable if you have a preinstalled \r
- version of Vtk. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">OmniORB 4.0.5, OmniORBpy \r
- 2.5, OmniNotify 2.1</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">We just check existence of some omniORB \r
- libraries and executable on the computer, like </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>libomniORB4.so.0.5</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>_omnipymodule.so.2.4</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>libCOSNotify4.so.0.1</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>notifd</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>OMNIORBDIR</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable if you have a preinstalled \r
- version of omniORB products. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">sip 4.1</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is checked by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>sip -V</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- command. The </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>sip</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> executable should be in the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable. Version number should \r
- be equal to &quot;4.1&quot;.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>SIPDIR</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable to the directory where \r
- you have sip executable preinstalled. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">PyQt 3.13</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is defined by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>pyqtconfig.py</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> Python module file which is part of the </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PyQt</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- distribution. Version should be equal to &quot;3.13&quot;.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PYQTDIR \r
- </B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">environment variable if you have \r
- a preinstalled version of PyQt. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">netgen 4.5</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Unfortunarely we can't find anything about \r
- netgen version. We just check if </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>NETGENROOT</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable is set.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>NETGENROOT</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable if you have a preinstalled \r
- version of netgen mesher. </font></span>\r
-\r
-<br><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&nbsp; </font></span>\r
-\r
-<p class="whs11"><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B><b style="font-weight: bold;"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"></b>Note: </B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">netgen 4.5 \r
- provided with the SALOME installation Wizard has been patched to improve \r
- its performance. </font></span></p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Numeric 23.7</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is checked by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>python -c 'import Numeric; \r
- print Numeric.__version__'</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> command. \r
- The </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>python</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> executable should be in the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable and </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>Numeric</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> module should be available for the Python (for \r
- example it should be in the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PYTHONPATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable). Version number should \r
- be equal to &quot;23.7&quot;. If you have any problem with a preinstalled \r
- version of Numeric 23.7, please, reinstall it.<br>\r
-Add the directory where&nbsp;you have a preinstalled version of Numeric \r
- package to the the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PYTHONHOME \r
- </B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">environment variable. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">graphviz 2.2.1</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is checked by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>dot -V</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- command. The </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>dot</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> executable should be in the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable. Version number should \r
- be equal to &quot;2.2.1&quot;.<br>\r
-Add </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>graphviz</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> bin directory to the the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">doxygen 1.4.6</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Version number is checked by </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>doxygen --version</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> command. The </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>doxygen</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> executable should be in the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable. Version number should \r
- be equal to &quot;1.4.6&quot;. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-weight: bold;\r
-                                                                       font-size: 12pt;\r
-                                                                       color: rgb(0, 0, 153);"><font size=3 style="font-size:12pt;"><B>SALOME </B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">module </font></span><span style="font-weight: bold;\r
-                                                                                                               font-size: 12pt;\r
-                                                                                                               color: rgb(0, 0, 153);"><font size=3 style="font-size:12pt;"><B>sources</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> (3.2.4).</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">For each SALOME module sources package (KERNEL, \r
- GUI, GEOM, etc...) the root directory contains file configure.in (configure.ac) \r
- which defines version information.<br>\r
-Set the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>&lt;MODULE&gt;_SRC_DIR</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable for each SALOME </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>MODULE</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- sources package installed (where </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>MODULE</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> is KERNEL, GUI, GEOM, ...). </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><span style="font-weight: bold;\r
-                                                                       font-size: 12pt;\r
-                                                                       color: rgb(0, 0, 153);"><font size=3 style="font-size:12pt;"><B>SALOME </B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">module </font></span><span style="font-weight: bold;\r
-                                                                                                               font-size: 12pt;\r
-                                                                                                               color: rgb(0, 0, 153);"><font size=3 style="font-size:12pt;"><B>binaries \r
- </B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">(3.2.4)</font></span></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">For each SALOME module binaries package \r
- (KERNEL, GUI, GEOM, etc...) the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>bin/salome</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> directory contains file </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>VERSION</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> which defines version information.<br>\r
-Set </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>&lt;MODULE&gt;_ROOT_DIR</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> environment variable for each SALOME </font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>MODULE</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- binaries package installed (where </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>MODULE</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> is KERNEL, GUI, GEOM, ...). </font></span>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">If you have native products installed \r
- to directories different from default ones (not </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">/usr/bin</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">/usr/lib</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">...), it is recommended to follow the above mentioned \r
- instructions. Or you should properly set </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>LD_LIBRARY_PATH</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> variables </font></span><b><font style="color: #ff0000;"\r
-                                                                                                       color=#FF0000><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">before</font></span></font></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- starting the Installation Wizard. Otherwise the installation script will \r
- fail to find preinstalled/native products. </font></span></p>\r
-\r
-<p class="whs11"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><b style="font-weight: bold;"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"></b></font></span><b \r
- style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Note:</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> for some native products (e.g. gcc, Python) \r
- the rules of version checking are not so strict as described above. Only \r
- major and minor version numbers should coincide with the prerequisite. \r
- Newer version of the product can also be used. If some native product \r
- has version number larger than that required by the installation procedure, \r
- the user will be prompted by the warning message like this: </font></span><i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;You have newer version of gcc installed \r
- on your computer than that is required (3.4.1). Continue?&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. You can click </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Yes&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> to proceed with the installation but in this \r
- case you should be aware of what you are doing. SALOME binaries (including \r
- other products) are compiled with the predefined prerequisites and most \r
- likely can not be run successfully if these products are not found. This \r
- can be helpful only if you plan to build all products from sources. </font></span></p>\r
-\r
-\r
-<hr class="whs7">\r
-\r
-\r
-<h3><a name=pick_up_env></a>Pick up the <font style="color: #ff0000;"\r
-                                                                                               color=#FF0000>environment</font></h3>\r
-\r
-P<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">lease, read the following information carefully \r
- . This section describes how the installation procedure generates the \r
- environment scripts for the SALOME platform being installed. </font></span>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">After installing each product shell the \r
- script creates a special environment file for the product in its installation \r
- folder. The name of the file is generated from the name of product by \r
- the following scheme: </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">env_&lt;product_name&gt;.sh</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> (for example </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">env_Vtk.sh \r
- </font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">for the Vtk). This file includes \r
- all necessary environment settings. At the final step of the installation \r
- the script picks up all the settings files and generates two common environment \r
- files from them: </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">salome.sh</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">salome.csh \r
- </font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">for </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>bash</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>csh</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> shells correspondingly. Such approach helps \r
- to save time when reinstalling products and you may not bother about setting \r
- all environment variables manually to build/launch SALOME. What you simply \r
- need is to source one of these environment files. </font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This also concerns those products which \r
- are not being installed. For example, you install some SALOME binaries \r
- to the directory where you have previously installed other products.&nbsp; \r
- The Installation procedure tries to collect environment files from the \r
- target directory if it finds necessary products installed there. If some \r
- product is not found in the target directory the corresponding section \r
- of </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">salome.sh/salome.csh</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> files will be skipped. <br>\r
-For native products (like </font></span><i><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">gcc, \r
- tcl, etc...)</font></span></b></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> the installation \r
- procedure tries to find them first using </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">PATH</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> / </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">LD_LIBRARY_PATH</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> variables and then in the system default directories \r
- (</font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">/usr/bin, /usr/lib</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> etc., depending on the product). </font></span></p>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">In any case you may edit </font></span><b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">salome.*</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- files after the installation procedure finishes, if you want.</font></span></p>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&nbsp; </font></span>\r
-\r
-<p class="whs11"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><b style="font-weight: bold;"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"></b></font></span><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>Note:</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- as it was mentioned </font></span><a href="#env_files"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">above</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> there are other environment files which are \r
- generated by the installation procedure: </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>env_products.csh</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> + </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>env_products.sh</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>env_build.csh</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> + </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>env_build.sh</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. These files can be found in the target installation \r
- root directory.</font></span></p>\r
-\r
-&nbsp;<br>\r
-\r
-\r
-<hr class="whs7">\r
-\r
-\r
-<h3><a name=xml_files></a>Modifying <font style="color: #ff0000;"\r
-                                                                                       color=#FF0000>XML</font> configuration \r
- <font style="color: #ff0000;"\r
-               color=#FF0000>file</font></h3>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">You can create your own XML configuration \r
- file. The Installation Wizard can then take it as a command line argument \r
- to provide a list of products you want to install with it. The list of \r
- products and some other settings for the Installation Wizard are provided \r
- in the XML file. The default file which Installation Wizard looks for \r
- if no command line arguments are given, is </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">config.xml</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">.<br>\r
-This section describes the structure of the configuration file. <br>\r
-XML tags are in bold blue, optional sections/tags are in brackets. </font></span>\r
-\r
-<p><font style="font-family: Courier;"\r
-               face=Courier><b style="font-weight: bold;"><font style="color: #000099;"\r
-                                                                                                               color=#000099><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;document&gt;</font></span></font></b><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; </font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">[</font></span></font><b><font \r
- style="color: #000099;"\r
-       color=#000099><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> &lt;config</font></span></font></b><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> [ version=&lt;install_wizard_version&gt; \r
- ]</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                                                                                                                       color=#000000><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- caption=&lt;install_wizard_caption&gt; ]</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- copyright=&lt;install_wizard_copyright&gt;&nbsp; ]</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                                                                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- license=&lt;install_wizard_license_info&gt; ]</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- os=&lt;target_platform&gt; ]</font></span></font><b><font style="color: #000099;"\r
-                                                                                                       color=#000099><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt;</font></span></font></b><font style="color: #000000;"\r
-                                                                                                                       color=#000000><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; ]</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font \r
- style="color: #000000;"\r
-       color=#000000><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; </font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">[ </font></span></font><b><font \r
- style="color: #000099;"\r
-       color=#000099><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;path</font></span></font></b><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&nbsp;&nbsp; [ targetdir=&lt;target_directory&gt; \r
- ]</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                                                                                                                       color=#000000><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- tempdir=&lt;temp_directory&gt;&nbsp;&nbsp;&nbsp;&nbsp; ]</font></span></font><b><font \r
- style="color: #000099;"\r
-       color=#000099><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt; </font></span></font></b><font style="color: #000000;"\r
-                                                                                                                       color=#000000><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; ]</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font \r
- style="color: #000000;"\r
-       color=#000000><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; </font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">[ </font></span></font><b><font \r
- style="color: #000099;"\r
-       color=#000099><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;button</font></span></font></b><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> &nbsp; label=&lt;button_label&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                                                                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; \r
- [ tooltip=&lt;button_tooltip&gt; ]</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; \r
- &nbsp; script=&lt;button_script&gt;&nbsp;&nbsp;&nbsp;</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                                                                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- [ disable=&lt;disable_flag&gt;&nbsp;&nbsp;&nbsp;]</font></span></font><b><font \r
- style="color: #000099;"\r
-       color=#000099><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt; </font></span></font></b><font style="color: #000000;"\r
-                                                                                                                       color=#000000><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; ]</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; [</font></span></font><b><font style="color: #000099;"\r
-                                                                                       color=#000099><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- &lt;button</font></span></font></b><font style="color: #000000;"\r
-                                                                       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- ... </font></span></font><font style="color: #000099;"\r
-                                               color=#000099><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /</font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&gt;</font></span></b></font><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; ]</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; [</font></span></font><b><font style="color: #000099;"\r
-                                                                                       color=#000099><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- &lt;product</font></span></font></b><font style="color: #000000;"\r
-                                                                       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&nbsp; \r
- name=&lt;product_name&gt;</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- version=&lt;product_version&gt;</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [ context=&lt;product_context&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- ]<br>\r
-&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [ description=&lt;product_description&gt; \r
- ]</font></span><font style="color: #000000;"\r
-                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- install=&lt;installation_mode&gt;</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- supported=&lt;supported_installation_modes&gt;</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ \r
- disable=&lt;disable_flag&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]<br>\r
-&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; [ pickupenv=&lt;pickup_env_flag&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- ]<br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
- dependancies=&lt;list_of_prerequisites&gt;</font></span></font><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&nbsp;</font></span><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; \r
- installdiskspace=&lt;install_disk_space&gt;</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; \r
- temporarydiskspace=&lt;tmp_disk_space&gt;</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; \r
- script=&lt;installation_script_name&gt;</font></span></font><font style="color: #000099;"\r
-                                                                                                                       color=#000099><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /</font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&gt;</font></span></b></font><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; ]</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; [</font></span></font><b><font style="color: #000099;"\r
-                                                                                       color=#000099><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- &lt;product</font></span></font></b><font style="color: #000000;"\r
-                                                                       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- ... </font></span></font><font style="color: #000099;"\r
-                                               color=#000099><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /</font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&gt;</font></span></b></font><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"><br>\r
-&nbsp;&nbsp;&nbsp; ]<br>\r
-&nbsp;&nbsp;&nbsp; ...</font></span></font><b><font style="color: #000099;"\r
-                                                                                       color=#000099><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;/document&gt;</font></span></font></b><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span></font></p>\r
-\r
-<h4><font style="color: #000000;"\r
-                       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;config&gt; \r
- section</font></span></font></h4>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This is an optional \r
- section; it provides general information about the Installation Wizard \r
- itself.<br>\r
-<br>\r
-Attributes:</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">version</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The application version \r
- number to be shown in the caption.</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">caption</font></span></b></font></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The application main window caption - if \r
- this string contains '%1' text the title will contain the version number \r
- in this place (see above). </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">copyright</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The application copyright \r
- information (shown in the first page).</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">license</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The application license \r
- information (shown in the first page).</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">os</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This parameter defines \r
- the directory (relative from ./Products/BINARIES) where the Installation \r
- Wizard will search precompiled binaries packages. If this tag is not provided, \r
- binaries packages are looked for in the ./Products/BINARIES directory.</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<h4><b style="font-weight: bold;"><font style="color: #000000;"\r
-                                                                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;path&gt; \r
- section</font></span></font></b></h4>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This is an optional section; it defines \r
- default installation directories.</font></span><font style="color: #000000;"\r
-                                                                                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-<br>\r
-Attributes:</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">targetdir</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The target directory \r
- - the path to the directory where products should be installed.</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">tempdir</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The temporary directory \r
- - the path to the directory for the temporary files.</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<h4><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;product&gt; \r
- section</font></span></b></h4>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This section describes product to be installed \r
- with the Installation Wizard. The XML file should include a &lt;product&gt; \r
- section for each product to be installed. The products appear in the tree \r
- view and are installed in the order they are described in the configuration \r
- file. It is recommended (but not obligatory) to define native products \r
- at the top of the list before all other products.</font></span><font style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-<br>\r
-Attributes:</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">name</font></span></b></font></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Product name. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">version</font></span></b></font></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Product version. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">description</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Product description \r
- (optional).</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">context</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Context (optional). \r
- The possible values are </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">'salome \r
- sources'</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">'salome \r
- binaries'</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">'prerequisite'</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- (several contexts can be given separated by &quot;:&quot; symbol).</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">supported</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Supported modes of \r
- installation. Several modes can be separated by comma. Possible value \r
- are: </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">install sources</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">install \r
- binaries</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">use \r
- native</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">. The Installation script \r
- should contain the corresponding functions for each of the supported installation \r
- modes (see </font></span><a href="#new_products"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">here</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">).</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">install</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Default (starting) \r
- installation mode.</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">disable</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">If this optional flag \r
- has 'true' value, the corresponding product will not appear in the list \r
- of products and will not be installed.</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">pickupenv</font></span></b></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This flag points that pickup environment \r
- procedure should be performed for this product. If this flag equal to \r
- 'true', &nbsp;salome.sh and salome.csh files will&nbsp; be created in \r
- the product installation directory. Usually this option is set to true \r
- for SALOME KERNEL module sources and binaries package. This is an optional \r
- key, default value is 'false'</font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">.</font></span></b><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">dependancies</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">List of prerequisite \r
- products, which are necessary to build this product, separated by comma.</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">installdiskspace</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Total amount of space \r
- (integer, in Kbytes), which the product occupies on the hard drive after \r
- the installation.</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">temporarydiskspace</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Disk space (integer, \r
- in Kbytes) for temporary files, which is necessary to build the product \r
- from the sources.</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">script</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The installation script \r
- name. This script is in charge of the installation of the product. It \r
- is called automatically by the Installation Wizard when necessary from \r
- the main program. See the </font></span><a href="#new_products"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">next \r
- section</font></span></a><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> for more information.</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<h4><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;button&gt; \r
- section</font></span></b></h4>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This is an optional section. It allows customization \r
- of the last </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Finish installation&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> page of the Installation Wizard by adding one \r
- or more buttons in the lower part of the wizard's window. The script which \r
- is attached to each such button, can perform some specific action, for \r
- example, launch the application or show the Release Notes file by using \r
- an external program. See </font></span><a href="#finish_buttons"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">here</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> for more details about writing scripts.</font></span><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-<br>\r
-Attributes:</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">label</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This is the button \r
- text.</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">tooltip</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The button tooltip \r
- (optional).</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">script</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The script attached \r
- to the button.</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">disable</font></span></b></font></li>\r
-</ul>\r
-\r
-<p class="whs20"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">If \r
- this optional flag has 'true' value, the corresponding button will not \r
- appear in the </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Finish installation&quot;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> page - the section of XML file is silently ignored.</font></span><b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&nbsp;</font></span></b></p>\r
-\r
-<p class="whs11"><b \r
- style="font-weight: bold;"><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"></B></font></span><span style="font-size:12pt; background-image:url('../texture_horiz_ltbluebubbles.jpg'); "><font size=3 style="font-size:12pt;">Note:</font></span></b><span style="font-size:12pt; background-image:url('../texture_horiz_ltbluebubbles.jpg'); "><font size=3 style="font-size:12pt;"> \r
- If you add new products to be installed with Installation Wizard, you \r
- should also provide installation script for this product. See the next \r
- section for more details. </font></span></p>\r
-\r
-&nbsp;<br>\r
-\r
-\r
-<hr class="whs7">\r
-\r
-\r
-<h3><a name=new_products></a>Implementing <font style="color: #ff0000;"\r
-                                                                                               color=#FF0000>installation \r
- scripts</font> for the new products</h3>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">When you want some product to be installed \r
- with the Installation Wizard, you should add its description </font></span><a \r
- href="#xml_files"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">to the configuration \r
- file</font></span></a><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and create the installation \r
- script, following the rules described in this section. <br>\r
-<br>\r
-There are some obligatory functions which should be implemented in this \r
- installation script. These functions are automatically called by the master \r
- installation script or/and its GUI shell when it is necessary.</font></span><font \r
- style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-File </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">common.sh</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> contains some service functions which can be \r
- used in your installation script, like </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">make_env()</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">,</font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> make_dir()</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">try_existing()</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">sort_path()</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">,</font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> find_in_path()</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, etc.</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">check_version()</font></span></b></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This function allows to check the version \r
- of the product already installed on the computer. It should try to find \r
- the product (native or preinstalled in the target directory) and check \r
- its version. This helps to avoid unnecessary reinstallation. This is an \r
- internal function and is not called from the master installation script. \r
- </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><b style="font-weight: bold;"><font style="color: #000000;"\r
-                                                                                                                       color=#000000><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">try_native()</font></span></font></b></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This function is called when the </font></span><i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">'use native' </font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">installation \r
- mode is selected by the user. The function should try to find a native \r
- version of the product and define possibility of its use. It should create \r
- the environment file for the product in the temporary directory (see also \r
- the description of </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">print_env(</font></span></b><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>)</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- function). It is not necessary to implement this function if you do not \r
- provide native mode installation. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">install_source()</font></span></b></font></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This function is called when the </font></span><i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">'install sources</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">' \r
- installation mode is selected by the user. The function is responsible \r
- for building the product from the sources package. It should create the \r
- environment file for the product in the temporary directory (see also \r
- description of </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">print_env(</font></span></b><span \r
- style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>)</B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- function). It is not necessary to implement this function if you do not \r
- provide sources mode installation. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">install_source_and_build()</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This function is called \r
- when SALOME module is installed and the </font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>--all-from-sources</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> (</font></span><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>-a</B></font></span><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">) option is used (</font></span><span style="font-style: italic; font-size: 12pt;"><font size=3 style="font-size:12pt;"><I>&quot;Build \r
- SALOME sources&quot;</I></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> check box in \r
- GUI mode). This function should be used to unpack SALOME sources package \r
- and then call the build/install procedure for it.<br>\r
-For more details please refer to the </font></span><a href="#install_from_wizard"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">this</font></span></a><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- and </font></span><a href="#gui_mode"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">this</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> sections for more details.</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">install_binary()</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This function is called \r
- when the </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">'install binaries'</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> installation mode is selected by the user. The \r
- function is responsible for the extracting of the product from the binaries \r
- package. It should create environment for the product in the temporary \r
- directory (see also description of </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">print_env(</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">) function). It is not necessary to implement \r
- this function if you do not provide binaries mode installation. </font></span></font>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">try_preinstalled()</font></span></b></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This function is called when</font></span><i><span \r
- style="font-style: normal; font-size: 12pt;"><font size=3 style="font-size:12pt;"> the</font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- 'not install'</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> installation mode \r
- is selected by the user. In this case the script should inspect the target \r
- directory to try to find an already preinstalled product, pick up and \r
- check the environment from there. See </font></span><a href="#pick_up_env"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">here</font></span></a><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- for more details. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               style="/*begin!kadov{{*/ color: #000000; /*}}end!kadov*/ "\r
-               class=kadov-p><font style="color: #000000;"\r
-                                                       color=#000000><b style="font-weight: bold;"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">print_env()</font></span></b></font></li>\r
-</ul>\r
-\r
-<font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This function is in \r
- charge of creating the environment script. It should create a file with \r
- name </font></span></font><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">env_&lt;product_name&gt;.sh</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> in the temporary directory and then copy it \r
- into the product installation directory. The file should contain all necessary \r
- environment variables settings for the product. It will be collected during \r
- the 'pick-up-environment' procedure. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">pickup_env()</font></span></b></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This procedure corresponds to the </font></span><b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">pickupenv</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- tag of the configuration xml file (see previous section). It should call \r
- the </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">make_env</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> procedure to perform the pick-up environment \r
- procedure for the product.</font></span><font style="color: #000000;"\r
-                                                                               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-<br>\r
-The calling signature of the product installation script is the following:</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><b><font style="color: #000000;"\r
-                                                                                       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;product_script_name&gt; &lt;function_name&gt; &lt;temp_folder&gt; &lt;products_directory&gt; \r
- &lt;target_directory&gt; &lt;dependancies&gt; &lt;product_name&gt;</font></span></font></b><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<p><font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">where</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span></p>\r
-\r
-<p><font style="color: #000000;"\r
-               color=#000000><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;product_script_name&gt;</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> - installation script name (described in the \r
- configuration xml file);</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;function_name&gt;</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> - the name \r
- of function, corresponding to the selected installation mode: </font></span><i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">try_native, install_source, install_binary</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> or </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">try_preinstalled</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">;</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;temp_folder&gt;</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> - temporary \r
- files directory;</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font \r
- style="color: #000000;"\r
-       color=#000000><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;products_directory&gt;</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> - \r
- directory where the sources/binaries package can be found. You should \r
- provide the sources package in the </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;Install_Wizard_root_directory&gt;/Products/SOURCES</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> directory and binaries package in the </font></span><i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;InstallWizard_root_directory&gt;/Products/BINARIES/&lt;os_version&gt;</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">, where &lt;os_version&gt; is the target platform \r
- description, which appears in the corresponding section of the </font></span><a \r
- href="#xml_files"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">configuration xml file</font></span></a><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">.</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                               color=#000000><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;target_directory&gt;</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> - root \r
- target directory where the product should be installed to;</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                                                                               color=#000000><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;dependancies&gt;</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> - single-quoted \r
- list of prerequisite products, separated by space;</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><font style="color: #000000;"\r
-                                                                               color=#000000><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;product_name&gt; </font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">- product \r
- name itself.</font></span></font><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span></p>\r
-\r
-<p><font style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Example:</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-med-2.2.3.sh install_binary /tmp/work ./Products/BINARIES/Mandrake10.1 \r
- /usr/salome 'gcc Hdf' med</font></span></i><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span></p>\r
-\r
-<p><font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Copy the created script \r
- into the </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;Install_Wizard_root_directory&gt;/config_files</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> sub-directory where all installation scripts \r
- are stored. Installation Wizard will automatically search and call your \r
- script during the installation procedure.</font></span></font><span style="font-size: 12pt;"> \r
- <font size=3 style="font-size:12pt;"></font></span></p>\r
-\r
-\r
-<hr class="whs7">\r
-\r
-\r
-&nbsp; \r
-\r
-<h3><a name=finish_buttons></a>Customizing <font style="color: #ff0000;"\r
-                                                                                               color=#FF0000>Readme page</font> \r
- buttons</h3>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">The Installation Wizard allows customizing \r
- the look-n-feel of the last </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Finish \r
- installation&quot;</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> page. If \r
- you want to add one or more buttons to this page in order to perform some \r
- specific actions at the end of the installation (for example, to show \r
- the Release Notes file by using Open Office) you can put an additional \r
- section to the XML configuration file. This is the </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;button&gt;</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> section (see </font></span><a href="#xml_files"><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">here</font></span></a><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- for more details). </font></span>\r
-\r
-<br><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&nbsp; </font></span>\r
-\r
-<br><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;">To implement the action which will be performed \r
- when the user clicks the button, you need to create a script and put it \r
- to the </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;Install_Wizard_root_directory&gt;/config_files</font></span></i><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> directory.<br>\r
-There are some obligatory functions which should be implemented in this \r
- script. These functions are automatically called by the Installation Wizard \r
- GUI. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">check_enabled()</font></span></b></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This procedure is called by the Installation \r
- Wizard when the </font></span><i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&quot;Finish \r
- installation&quot;</font></span></i><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> page is displayed \r
- and the status of the buttons should be modified according to the installation \r
- options. This procedure should return </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">0</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> if the corresponding action can be performed \r
- and, thus, the button should become enabled. Otherwise, it should return \r
- </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">1</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- - in this case the corresponding button will be disabled. </font></span>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p\r
-               class=kadov-p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">execute()</font></span></b></li>\r
-</ul>\r
-\r
-<span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">This procedure is invoked when the user \r
- clicks the button. This procedure should return </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">0</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> if the corresponding action is done successfully \r
- and </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">1</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> \r
- if any error occurs.<br>\r
-<br>\r
-The calling signature of the script is the following:</font></span><b><font style="color: #000000;"\r
-       color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;product_script_name&gt; &lt;function_name&gt; &lt;target_directory&gt; \r
- &lt;temp_folder&gt;</font></span></font></b><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span>\r
-\r
-<p><font style="color: #000000;"\r
-               color=#000000><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">where</font></span></font><span \r
- style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span></p>\r
-\r
-<p><b style="font-weight: bold;"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;product_script_name&gt;</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> - the script name itself (retrieved from the \r
- XML configuration xml file); </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;function_name&gt;</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> - the name \r
- of function; </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;target_directory&gt;</font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> - root \r
- target directory where the product is installed to; </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&lt;temp_folder&gt; </font></span></b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">- temporary \r
- files directory; </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><br>\r
-&nbsp;</font></span></b></p>\r
-\r
-<p class="whs11"><b \r
- style="font-weight: bold;"><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"></B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Note:</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> The standard Installation Wizard buttons &quot;Launch \r
- SALOME&quot; and &quot;Release Notes&quot; are implemented with this feature. \r
- Refer to scripts </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">start_salome.sh</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> and </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">release_notes.sh</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> for sample implementation.</font></span><b><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B><br>\r
-<br>\r
-<img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs14"></B></font></span><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Note:</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> Any button (even standard) can be ignored by \r
- the Installation Wizard if the attribute </font></span><b><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">&lt;disable&gt;</font></span></b><span \r
- style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> in the XML configuration file is set to the \r
- &quot;true&quot; value. </font></span></p>\r
-\r
-\r
-<hr class="whs7">\r
-\r
-\r
-&nbsp; \r
-\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/readmepage.png b/doc/salome/gui/GUI/kernel/readmepage.png
deleted file mode 100644 (file)
index b6aee29..0000000
Binary files a/doc/salome/gui/GUI/kernel/readmepage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/kernel/running_salome_pro.htm b/doc/salome/gui/GUI/kernel/running_salome_pro.htm
deleted file mode 100755 (executable)
index 0ef619a..0000000
+++ /dev/null
@@ -1,344 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Running SALOME</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { font-family:'Times New Roman' , serif; }\r
-p.whs2 { margin-left:0px; font-style:italic; color:#000000; font-family:'Arial Black' , sans-serif; }\r
-p.whs3 { font-family:'Times New Roman' , serif; margin-left:0px; }\r
-p.whs4 { font-family:'Times New Roman' , serif; margin-left:40px; font-style:normal; color:#000000; }\r
-p.whs5 { font-family:'Times New Roman' , serif; color:#ff0000; font-style:italic; margin-left:40px; }\r
-p.whs6 { font-family:'Times New Roman' , serif; margin-left:40px; color:#000000; font-style:normal; }\r
-p.whs7 { font-family:'Courier New'  , monospace; margin-left:0px; background-image:url('../texture_horiz_ltbluebubbles.jpg'); }\r
-img_whs8 { border:none; width:35px; height:37px; float:none; border-style:none; }\r
-p.whs9 { margin-left:0px; }\r
-p.whs10 { margin-left:40px; }\r
-p.whs11 { margin-left:40px; font-style:normal; color:#000000; font-weight:normal; font-family:'Times New Roman' , serif; }\r
-ul.whs12 { list-style:disc; }\r
-table.whs13 { x-cell-content-align:top; width:96.029%; border-left-style:Solid; border-left-width:1px; border-right-style:Solid; border-right-width:1px; border-top-style:Solid; border-top-width:1px; border-bottom-style:Solid; border-bottom-width:1px; border-left-color:#c0c0c0; border-right-color:#c0c0c0; border-top-color:#c0c0c0; border-bottom-color:#c0c0c0; border-spacing:0px; }\r
-col.whs14 { width:645px; }\r
-col.whs15 { width:421px; }\r
-tr.whs16 { x-cell-content-align:top; height:41px; }\r
-td.whs17 { width:645px; padding-right:10px; padding-left:10px; background-color:#400080; border-left-color:#c0c0c0; border-top-color:#c0c0c0; border-top-style:Solid; border-bottom-color:#c0c0c0; border-bottom-width:1px; border-bottom-style:Solid; border-right-color:#c0c0c0; border-right-width:1px; border-right-style:Solid; border-left-width:1px; border-left-style:Solid; border-top-width:1px; }\r
-p.whs18 { color:#ffffff; }\r
-td.whs19 { width:421px; padding-right:10px; padding-left:10px; background-color:#400080; border-top-color:#c0c0c0; border-top-style:Solid; border-right-color:#c0c0c0; border-right-style:Solid; border-bottom-color:#c0c0c0; border-bottom-width:1px; border-bottom-style:Solid; border-top-width:1px; border-right-width:1px; }\r
-td.whs20 { width:645px; padding-right:10px; padding-left:10px; border-left-color:#c0c0c0; border-bottom-color:#c0c0c0; border-bottom-width:1px; border-bottom-style:Solid; border-right-color:#c0c0c0; border-right-width:1px; border-right-style:Solid; border-left-width:1px; border-left-style:Solid; }\r
-td.whs21 { width:421px; padding-right:10px; padding-left:10px; border-right-color:#c0c0c0; border-right-style:Solid; border-bottom-color:#c0c0c0; border-bottom-width:1px; border-bottom-style:Solid; border-right-width:1px; }\r
-p.whs22 { font-weight:bold; }\r
-td.whs23 { width:645px; padding-right:10px; padding-left:10px; border-left-color:#c0c0c0; border-bottom-color:#c0c0c0; border-bottom-style:Solid; border-right-color:#c0c0c0; border-right-width:1px; border-right-style:Solid; border-left-width:1px; border-left-style:Solid; border-bottom-width:1px; }\r
-td.whs24 { width:421px; padding-right:10px; padding-left:10px; border-right-color:#c0c0c0; border-right-style:Solid; border-bottom-color:#c0c0c0; border-bottom-style:Solid; border-bottom-width:1px; border-right-width:1px; }\r
-td.whs25 { width:645px; padding-right:10px; padding-left:10px; border-left-style:Solid; border-left-width:1px; border-left-color:#c0c0c0; border-right-style:Solid; border-right-width:1px; border-right-color:#c0c0c0; border-bottom-width:1px; border-bottom-style:Solid; border-bottom-color:#c0c0c0; }\r
-td.whs26 { width:421px; padding-right:10px; padding-left:10px; border-right-width:1px; border-right-style:Solid; border-right-color:#c0c0c0; border-bottom-width:1px; border-bottom-style:Solid; border-bottom-color:#c0c0c0; }\r
-td.whs27 { width:645px; padding-right:10px; padding-left:10px; border-left-color:#c0c0c0; border-left-width:1px; border-left-style:Solid; border-right-color:#c0c0c0; border-right-width:1px; border-right-style:Solid; border-bottom-color:#c0c0c0; border-bottom-style:Solid; border-bottom-width:1px; }\r
-td.whs28 { width:421px; padding-right:10px; padding-left:10px; border-right-color:#c0c0c0; border-right-style:Solid; border-right-width:1px; border-bottom-color:#c0c0c0; border-bottom-style:Solid; border-bottom-width:1px; }\r
-p.whs29 { font-weight:bold; margin-left:0px; font-family:'Courier New'  , monospace; background-image:url('../texture_horiz_ltbluebubbles.jpg'); }\r
-p.whs30 { font-family:'Times New Roman' , serif; margin-left:80px; }\r
-p.whs31 { font-family:'Courier New' , monospace; margin-left:0px; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs2 {margin-left:1pt; }";\r
-  strNSS += "p.whs3 {margin-left:1pt; }";\r
-  strNSS += "p.whs7 {margin-left:1pt; }";\r
-  strNSS += "p.whs9 {margin-left:1pt; }";\r
-  strNSS += "p.whs29 {margin-left:1pt; }";\r
-  strNSS += "p.whs31 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("About SALOME\nRunning SALOME");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Running SALOME</h1>\r
-\r
-<p class="whs2">To launch SALOME:</p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs4">1. Install the SALOME package into a definite \r
- directory (ex. <span style="font-weight: bold;"><B>SALOME</B></span>) on your \r
- hard disk. It is preferable if you use the special installation procedure \r
- allowing to install the &nbsp;SALOME \r
- platform and all corresponding applications. </p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs6">2.<span style="font-family: 'Courier New', monospace;"> \r
- </span>The installation shell script will create a special file: <b>salome.csh</b> \r
- (CShell file) in your <b><i><span style="font-style: normal; font-weight: bold;"><B>SALOME/KERNEL</B></span><span \r
- style="font-weight: normal; font-style: normal;"> </span></i></b>directory. \r
- This file contains all environment variables necessary for launching SALOME \r
- platform with other application products provided with SALOME installation \r
- package. You have a possibility to add one of them into your profile if \r
- you enter in the command console the following:</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"><span style="font-family: 'Courier New', monospace;">source \r
- salome.csh </span></p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs7"><img src="../tip1.gif" x-maintain-ratio="TRUE" width="35px" height="37px" border="0" class="img_whs8"> <span style="font-family: 'Times New Roman', serif;">During \r
- the installation procedure you have a possibility to set your profile \r
- automatically. </span>&nbsp;</p>\r
-\r
-<p class="whs9">&nbsp;</p>\r
-\r
-<p>&nbsp;</p>\r
-\r
-<p class="whs10">3. Launch SALOME platform, using the following \r
- Python script located in the <span style="font-weight: bold;"><B>SALOME/KERNEL/bin/salome</B></span> \r
- directory:</p>\r
-\r
-<p class="whs11">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs12">\r
-       \r
-       <li class=kadov-p><p class="whs10"><span style="font-weight: bold;"><B>runSalome.py</B></span> \r
- [command line options]</p></li>\r
-</ul>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<table x-use-null-cells resizable="no" cellspacing="0" width="96.029%" class="whs13">\r
-<script language='JavaScript'><!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) document.write("</table><table x-use-null-cells resizable='no' cellspacing='0' width='96.029%' border='1' bordercolor='silver' bordercolorlight='silver' bordercolordark='silver'>");\r
-//--></script>\r
-<col class="whs14">\r
-<col class="whs15">\r
-\r
-<tr valign="top" class="whs16">\r
-<td bgcolor="#400080" width="645px" class="whs17">\r
-<p class="whs18">Options</td>\r
-<td bgcolor="#400080" width="421px" class="whs19">\r
-<p class="whs18">Description</td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td width="645px" class="whs20">\r
-<p><span style="font-weight: bold;"><B>--help</B></span> <span style="font-style: italic;"><I>or</I></span> \r
- <span style="font-weight: bold;"><B>-h</B></span> &nbsp;&nbsp;</td>\r
-<td width="421px" class="whs21">\r
-<p>print this help</p>\r
-<p>&nbsp;</td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td width="645px" class="whs20">\r
-<p><span style="font-weight: bold;"><B>--gui</B></span> <span style="font-style: italic;"><I>or</I></span> \r
- <span style="font-weight: bold;"><B>-g</B></span> &nbsp;&nbsp;</td>\r
-<td width="421px" class="whs21">\r
-<p>launch with GUI</td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td width="645px" class="whs20">\r
-<p>&nbsp;<span style="font-weight: bold;"><B><a \r
- name=batchmode></a>--terminal</B></span> <span style="font-style: italic;"><I>or \r
- </I></span><span style="font-weight: bold;"><B>-t</B></span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>\r
-<td width="421px" class="whs21">\r
-<p>launch without GUI in batch mode</td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs20">\r
-<p><span style="font-weight: bold;"><B>--logger</B></span> <span style="font-style: italic;"><I>or</I></span> \r
- <span style="font-weight: bold;"><B>-l</B></span> &nbsp;&nbsp;</td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs21">\r
-<p>redirects &nbsp;log \r
- messages in the file <span style="font-style: italic;"><I>logger.log</I></span></td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs20">\r
-<p class="whs22">--file=&lt;FILE&gt; <span style="font-weight: normal; font-style: italic;"><I>or</I></span> \r
- -f=&lt;FILE&gt;</td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs21">\r
-<p>redirects &nbsp;log \r
- messages in a custom file</td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs20">\r
-<p><span style="font-weight: bold;"><B>--xterm</B></span> <span style="font-style: italic;"><I>or</I></span> \r
- <span style="font-weight: bold;"><B>-x</B></span> </td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs21">\r
-<p>the servers open an xterm window and log messages are displayed in this \r
- window</td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs20">\r
-<p><span style="font-weight: bold;"><B>--modules=module1,module2,...</B></span> \r
- <span style="font-style: italic;"><I>or</I></span> <span style="font-weight: bold;"><B>-m=module1,module2,...</B></span></td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs21">\r
-<p>list of SALOME modules which will be loaded into the module catalogue</td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs23">\r
-<p class="whs22">--embedded=registry,study,moduleCatalog,cppContainer,</p>\r
-<p><span style="font-style: italic;"><I>or</I></span> &nbsp;<span \r
- style="font-weight: bold;"><B>-e=registry,study,moduleCatalog,cppContainer</B></span> \r
- </td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs24">\r
-<p>embedded CORBA servers (default: registry,study,moduleCatalog,cppContainer)</p>\r
-<p>note that logger,pyContainer,supervContainer can't be embedded </td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs23">\r
-<p><span style="font-weight: bold;"><B>--standalone=registry,study,moduleCatalog,cppContainer,pyContainer,supervContainer</B></span>, \r
- or</p>\r
-<p><span style="font-weight: bold;"><B>-s=registry,study,moduleCatalog,cppContainer,pyContainer,supervContainer</B></span> \r
- </td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs24">\r
-<p>standalone CORBA servers (default: pyContainer,supervContainer) </td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs23">\r
-<p><span style="font-weight: bold;"><B>--containers=cpp,python,superv</B></span></p>\r
-<p><span style="font-style: italic;"><I>or</I></span> <span style="font-weight: bold;"><B>-c=cpp,python,superv</B></span></td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs24">\r
-<p>launch of cpp, python and supervision containers</td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs25">\r
-<p><span style="font-weight: bold;"><B>--portkill</B></span> <span style="font-style: italic;"><I>or</I></span> \r
- <span style="font-weight: bold;"><B>-p</B></span></td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs26">\r
-<p>kill SALOME launched with the current port</td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs27">\r
-<p><span style="font-weight: bold;"><B>--killall</B></span> <span style="font-style: italic;"><I>or</I></span> \r
- <span style="font-weight: bold;"><B>-k</B></span> &nbsp;&nbsp;&nbsp;</p>\r
-<p>&nbsp;</td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs28">\r
-<p>kill SALOME</p>\r
-<p>&nbsp;</td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs27">\r
-<p><span style="font-weight: bold;"><B>--interp=n</B></span> <span style="font-style: italic;"><I>or</I></span> \r
- <span style="font-weight: bold;"><B>-i=n</B></span> &nbsp;&nbsp;&nbsp;</td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs28">\r
-<p>number of additional xterm to open, with session environment </td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs27">\r
-<p class="whs22">-z</td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs28">\r
-<p>display splash screen</td></tr>\r
-\r
-<tr valign="top" class="whs16">\r
-<td colspan="1" rowspan="1" width="645px" class="whs27">\r
-<p class="whs22">-r</td>\r
-<td colspan="1" rowspan="1" width="421px" class="whs28">\r
-<p>disable centralized exception handling mechanism </td></tr>\r
-<script language='JavaScript'><!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) document.write("</table></table><table>");\r
-//--></script>\r
-</table>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs29"><img src="../tip1.gif" x-maintain-ratio="TRUE" width="35px" height="37px" border="0" class="img_whs8"><span style="font-weight: normal; font-family: 'Times New Roman', serif;"> \r
- If the </span><span style="font-family: 'Times New Roman', serif;">runSalome.py \r
- </span><span style="font-family: 'Times New Roman', serif; font-weight: normal;">script \r
- is launched without prompting any options, they will be taken by default \r
- from the file </span><span style="font-family: 'Times New Roman', serif;">SalomeApp.xml \r
- (SALOME/GUI/share/salome/resources/SalomeApp.xml)</span><span style="font-family: 'Times New Roman', serif; font-weight: normal;">. \r
- If you are constantly launching SALOME with some specific options which \r
- are different from the defaults, you can edit this file according to your \r
- requirements. So the next time you run SALOME, you won't have to enter \r
- these numerous command console options. </span>&nbsp;&nbsp;&nbsp;</p>\r
-\r
-<p class="whs30">&nbsp;</p>\r
-\r
-<p class="whs31">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','About SALOME architecture','about_salome_pro_architecture.htm','Introduction to SALOME ','introduction_to_salome_pro.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
- </p>\r
-\r
-<p class="whs31">&nbsp;</p>\r
-\r
-<p class="whs31">&nbsp;</p>\r
-\r
-<p class="whs31">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/salome_pro_desktop.htm b/doc/salome/gui/GUI/kernel/salome_pro_desktop.htm
deleted file mode 100755 (executable)
index 8548692..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>SALOME desktop</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { font-family:'Times New Roman' , serif; }\r
-p.whs2 { font-family:'Times New Roman' , serif; }\r
-img_whs3 { border:none; width:694px; height:549px; float:none; border-style:none; }\r
-p.whs4 { font-family:'Times New Roman' , serif; margin-left:40px; font-weight:bold; }\r
-p.whs5 { font-family:'Times New Roman' , serif; margin-left:40px; }\r
-ul.whs6 { list-style:disc; }\r
-p.whs7 { text-indent:36px; }\r
-p.whs8 { text-align:justify; margin-left:0px; text-indent:36px; }\r
-p.whs9 { text-align:justify; font-weight:bold; margin-left:40px; }\r
-p.whs10 { text-align:justify; }\r
-p.whs11 { text-align:justify; font-weight:bold; margin-left:0px; text-indent:36px; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs8 {margin-left:1pt; }";\r
-  strNSS += "p.whs11 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nSALOME desktop");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">SALOME Desktop</h1>\r
-\r
-<p class="whs2">The main SALOME Desktop \r
- consists of the following sections and toolbars:</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2"><img src="../pics/geomview-alt.png" x-maintain-ratio="TRUE" width="694px" height="549px" border="0" class="img_whs3"></p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs4">Basic parts of the SALOME Desktop:</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs2"><span \r
- style="font-weight: bold;"><B>Main menu - </B></span>This is a set of context-sensitive \r
- menus, which will be updated according the functionality of the loaded \r
- component. In general, &nbsp;these \r
- menus contain all functional options of SALOME platform.</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs2"><span \r
- style="font-weight: bold;"><B>Standard Toolbar - </B></span>This toolbar contains \r
- icons allowing creating/saving studies, correcting mistakes, copying/pasting \r
- objects</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs2"><span \r
- style="font-weight: bold;"><B>Components Toolbar - </B></span>This toolbar is \r
- destined for uploading components in SALOME platform</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs2"><span \r
- style="font-weight: bold;"><B>Module Toolbar</B></span> - This toolbar contains \r
- icons specific to the loaded module.</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs2"><span \r
- style="font-weight: bold;"><B>Viewer Toolbar - </B></span>This is a set of tools \r
- destined for visualization of the presentations in the viewer. </p></li>\r
-</ul>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<p class="whs7">All toolbars in the <span style="font-weight: bold;"><B>SALOME</B></span> \r
- Platform are context-sensitive. Loading of a definite component (Geometry, \r
- Post-Pro, Mesh etc.) will automatically add some additional toolbars specific \r
- to this component. To display/hide a definite toolbar, in the main menu \r
- choose <span style="font-weight: bold;"><B>View</B></span> &gt; Toolbars, and \r
- from this submenu check or uncheck the toolbar, you would like to display/hide. \r
- </p>\r
-\r
-<p class="whs8">By default all toolbars are located on \r
- the top of the SALOME desktop. But you can relocate toolbars by dragging \r
- with the mouse and dropping it in any place of the window. </p>\r
-\r
-<p class="whs9">&nbsp;</p>\r
-\r
-<p class="whs4">Parts of &nbsp;the \r
- study window:</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs6">\r
-       \r
-       <li class=kadov-p><p class="whs10"><span style="font-weight: bold;"><B>Object \r
- Browser</B></span> - Management of objects created or imported into SALOME \r
- application</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs10"><span style="font-weight: bold;"><B>Viewer \r
- - </B></span>This window is destined for visualization of presentations. </p></li>\r
-       \r
-       <li class=kadov-p><p class="whs10"><span style="font-weight: bold;"><B>Python \r
- console</B></span> - Window for Python interpreter. This window functions \r
- like a standard document: the pop-up menu invoked by right-click in this \r
- window gives access to <span style="font-weight: bold;"><B>Copy/Paste/SelectAll/ClearAll \r
- </B></span>options.</p></li>\r
-</ul>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs8">Object Browser, Python Console, MenuBar, \r
- etc are, in fact, separate dockable windows. &nbsp;Dockable \r
- windows can be placed in special areas, on the borders of desktop like \r
- toolbars. You can change the size and the position of dockable windows, \r
- hide them or even place outside desktop. SALOME saves in the same file \r
- all positions and sizes of dockable windows. It means that the difference \r
- in settings of the same windows (for example Python console) is possible \r
- between different modules (the same window can have different size and \r
- position when other module is activated). Also each module can indicate \r
- which common windows are necessary for working, and only they will be \r
- displayed when this module is active.</p>\r
-\r
-<p class="whs9">&nbsp;</p>\r
-\r
-<p class="whs11"><span style="font-weight: normal;">Starting \r
- from the version 3.0.0 Salome uses a</span> Multi-Desktop Approach. <span \r
- style="font-weight: normal;">Multi-desktop Approach means that now there \r
- is separate Desktop for each document (Study) &nbsp;and \r
- all windows connected to a Study (viewers, dockable windows etc) are placed \r
- in one container. It is very comfortable, because you can't mix up windows \r
- from different studies. This approach positively differs from the classic \r
- multi document interface in case if many windows are used, i.e. when one \r
- document contains a lot of viewers, dialogs, etc. Each desktop also has \r
- its own menu and toolbar.</span></p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Creating a new study','creating_a_new_study.htm','Displaying studies','displaying_studies.htm','Editing studies','editing_studies.htm','Introduction to GUI','../introduction_to_gui.htm','Saving and closing studies','saving_a_study.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/saving_a_study.htm b/doc/salome/gui/GUI/kernel/saving_a_study.htm
deleted file mode 100755 (executable)
index 2c5d449..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Saving a study</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { text-align:justify; }\r
-p.whs2 { text-align:justify; }\r
-img_whs3 { border:none; float:none; width:30px; height:30px; border-style:none; }\r
-p.whs4 { font-style:italic; color:#ff0000; text-align:justify; }\r
-ul.whs5 { list-style:disc; }\r
-p.whs6 { font-weight:bold; margin-left:0px; text-align:justify; }\r
-p.whs7 { margin-left:0px; text-align:justify; }\r
-p.whs8 { font-style:italic; text-align:justify; color:#000000; font-family:'Arial Black' , sans-serif; }\r
-p.whs9 { font-style:italic; color:#ff0000; margin-left:40px; text-align:justify; }\r
-img_whs10 { border:none; width:23px; height:29px; float:none; border-style:none; }\r
-p.whs11 { margin-left:0px; background-image:url('../texture_horiz_ltbluebubbles.jpg'); text-align:justify; }\r
-img_whs12 { border:none; float:none; width:36px; height:38px; border-style:none; }\r
-p.whs13 { margin-left:0px; font-style:italic; text-align:justify; color:#000000; font-family:'Arial Black' , sans-serif; }\r
-p.whs14 { margin-left:0px; font-style:italic; color:#ff0000; text-align:justify; }\r
-p.whs15 { margin-left:40px; text-align:justify; }\r
-p.whs16 { text-align:justify; margin-left:40px; font-family:'Times New Roman' , serif; font-style:normal; }\r
-p.whs17 { font-style:italic; margin-left:0px; text-align:justify; color:#000000; font-family:'Arial Black' , sans-serif; }\r
-p.whs18 { font-style:italic; color:#ff0000; margin-left:0px; text-align:justify; }\r
-img_whs19 { border:none; width:22px; height:23px; border-style:none; }\r
-img_whs20 { border:none; width:394px; height:161px; float:none; border-style:none; }\r
-p.whs21 { margin-left:0px; font-weight:bold; text-align:justify; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs6 {margin-left:1pt; }";\r
-  strNSS += "p.whs7 {margin-left:1pt; }";\r
-  strNSS += "p.whs11 {margin-left:1pt; }";\r
-  strNSS += "p.whs13 {margin-left:1pt; }";\r
-  strNSS += "p.whs14 {margin-left:1pt; }";\r
-  strNSS += "p.whs17 {margin-left:1pt; }";\r
-  strNSS += "p.whs18 {margin-left:1pt; }";\r
-  strNSS += "p.whs21 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nStudy management\nSaving and closing studies");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Saving and closing studies</h1>\r
-\r
-<p class="whs2"><img src="../i_blue.jpg" x-maintain-ratio="TRUE" width="30px" height="30px" border="0" class="img_whs3">In <span style="font-weight: bold;"><B>SALOME \r
- </B></span>a study can be saved in <span style="font-weight: bold;"><B>HDF</B></span> \r
- binary (by default) or <span style="font-weight: bold;"><B>ASCII</B></span> files \r
- (<a href="setting_preferences.htm#ASCII">see also: Setting ASCII save \r
- option</a>).</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">You can also specify &nbsp;two \r
- options of saving your study: </p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs5">\r
-       \r
-       <li style="margin-left: -20px;"\r
-               class=kadov-p><p class="whs6">In one HDF file: \r
- <span style="font-weight: normal;">in this case all components used during \r
- this study session will write their data into one common HDF file. </span></p></li>\r
-       \r
-       <li style="margin-left: -20px;"\r
-               class=kadov-p><p class="whs7"><span \r
- style="font-weight: bold;"><B>In multiple files </B></span>(<a href="setting_preferences.htm#MultiFile">see \r
- also: Setting Multifile save option</a>)<span style="font-weight: bold;"> \r
- <B></B></span>: in this case SALOME will create one base HDF file which will \r
- store the main information about the saved study and several other special \r
- files with particular extensions storing the data written by each component \r
- which has been used during this study session. Opening of this study requires \r
- that <span style="font-weight: bold;"><B>ALL</B></span> saved files should be \r
- stored in the <span style="font-weight: bold;"><B>SAME</B></span> directory. \r
- &nbsp;If you \r
- would like to copy your saved study in another directory or machine, you \r
- should copy all stored files. Otherwise, if you try to open this study, \r
- some data will be lost and it will lead to invalid functioning of the \r
- SALOME platform. &nbsp;&nbsp;&nbsp;</p></li>\r
-</ul>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<p class="whs7">Saving a study you also \r
- save its layout, i.e. all positions and sizes of dockable windows. It \r
- means that the difference in settings of the same windows (for example \r
- Python console) is possible between different modules (the same window \r
- can have different size and position when other module is activated). \r
- Also each module can indicate which common windows are necessary for working, \r
- and only they will be displayed when this module is active.</p>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<p class="whs8">To save an existing \r
- study :</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs9"><span style="font-style: normal; color: #000000;"><font color=black >In \r
- the main toolbar click </font></span><img src="../pics/save.jpg" x-maintain-ratio="TRUE" width="23px" height="29px" border="0" class="img_whs10"> <span style="font-style: normal; color: #000000;"><font color=black >or \r
- from the main menu select </font></span><span style="font-style: normal;\r
-                                                                                               color: #000000;\r
-                                                                                               font-weight: bold;"><font color=black ><B>File \r
- &gt; Save </B></font></span><span style="font-style: normal; color: #000000;"><font color=black >option. \r
- Your study will be automatically updated. </font></span></p>\r
-\r
-<p class="whs9">&nbsp;</p>\r
-\r
-<p class="whs11"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs12">If your study hasn't been \r
- previously saved, this option will call the standard Search File dialog \r
- box where you can enter the name for your study and save it. </p>\r
-\r
-<p class="whs9">&nbsp;</p>\r
-\r
-<p class="whs13">To save a study with \r
- a new name:</p>\r
-\r
-<p class="whs14">&nbsp;</p>\r
-\r
-<p class="whs15">From the main menu select \r
- <span style="font-weight: bold;"><B>File &gt; Save as </B></span>option. In the \r
- standard Search File dialog box enter a new name for your study and click \r
- <span style="font-weight: bold;"><B>Save</B></span> button.</p>\r
-\r
-<p class="whs15">&nbsp;</p>\r
-\r
-<p class="whs13">To save the current \r
- layout of the GUI:</p>\r
-\r
-<p class="whs13">&nbsp;</p>\r
-\r
-<p class="whs16">From the main menu select <span style="font-weight: bold;"><B>File \r
- &gt; Save GUI State</B></span>. The GUI state is published in Object Browser \r
- in the folder GUI states and can be at any time <span style="font-weight: bold;"><B>Restored</B></span>, \r
- <span style="font-weight: bold;"><B>Renamed</B></span> or <span style="font-weight: bold;"><B>Deleted.</B></span> \r
- &nbsp;This operation \r
- saves and allows to restore almost all GUI settings: names, position, \r
- zooming and panning of viewers &nbsp;and \r
- all displayed objects (in Post-Pro module only). &nbsp;</p>\r
-\r
-<p>&nbsp;</p>\r
-\r
-<p class="whs17">To close a study:</p>\r
-\r
-<p class="whs18">&nbsp;</p>\r
-\r
-<p class="whs9"><span style="font-style: normal; color: #000000;"><font color=black >In \r
- the main toolbar click<img src="../image94.gif" width="22px" height="23px" border="0" class="img_whs19"> or &nbsp;from \r
- the main menu select </font></span><span style="font-weight: bold;\r
-                                                                                       font-style: normal;\r
-                                                                                       color: #000000;"><font color=black ><B>File &gt; \r
- Close</B></font></span><span style="font-weight: bold;"> <B></B></span><span style="font-style: normal; color: #000000;"><font color=black >option \r
- or click on the cross in the upper right corner of the study window.</font></span></p>\r
-\r
-<p class="whs9">&nbsp;</p>\r
-\r
-<p class="whs11"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs12">If your study hasn't been \r
- previously saved, this option will call the following dialog box with \r
- several options:</p>\r
-\r
-<p class="whs15">&nbsp;</p>\r
-\r
-<p class="whs15"><img src="../closestudy.png" x-maintain-ratio="TRUE" width="394px" height="161px" border="0" class="img_whs20"></p>\r
-\r
-<p class="whs15">&nbsp;</p>\r
-\r
-<p class="whs7"><span style="font-weight: bold;"><B>Unload \r
- </B></span>option allows to unload your current study from the SALOME Desktop. \r
- In the same working session you can &nbsp;reload \r
- it again (<a href="opening_studies.htm">see: Opening studies</a>). But \r
- if you quit the SALOME application, all changes in the unloaded study \r
- will be lost.</p>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<p class="whs21">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Creating a new study','creating_a_new_study.htm','Displaying studies','displaying_studies.htm','Introduction to GUI','../introduction_to_gui.htm','Opening studies','opening_studies.htm','SALOME desktop','salome_pro_desktop.htm','Setting preferences','setting_preferences.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs21">&nbsp;</p>\r
-\r
-<p class="whs21">&nbsp;</p>\r
-\r
-<p class="whs21">&nbsp;</p>\r
-\r
-<p class="whs21">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/setting_preferences.htm b/doc/salome/gui/GUI/kernel/setting_preferences.htm
deleted file mode 100755 (executable)
index 9421349..0000000
+++ /dev/null
@@ -1,378 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Setting preferences</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { font-family:'Times New Roman' , serif; }\r
-p.whs2 { font-family:'Times New Roman' , serif; }\r
-img_whs3 { border:none; border-style:none; width:752px; height:646px; float:none; }\r
-ul.whs4 { list-style:disc; }\r
-p.whs5 { font-family:'Times New Roman' , serif; margin-left:0px; font-weight:bold; }\r
-img_whs6 { border:none; width:23px; height:29px; border-style:none; }\r
-p.whs7 { font-family:'Times New Roman' , serif; font-weight:bold; }\r
-p.whs8 { font-weight:bold; margin-left:0px; }\r
-p.whs9 { font-weight:bold; margin-left:38px; }\r
-p.whs10 { font-family:'Times New Roman' , serif; font-weight:normal; }\r
-p.whs11 { font-family:'Times New Roman' , serif; font-style:normal; font-weight:bold; }\r
-img_whs12 { border:none; width:20px; height:20px; border-style:none; }\r
-img_whs13 { border:none; width:22px; height:23px; border-style:none; float:none; }\r
-img_whs14 { border:none; width:22px; height:21px; border-style:none; }\r
-img_whs15 { border:none; width:23px; height:23px; border-style:none; }\r
-img_whs16 { border:none; width:25px; height:24px; border-style:none; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs5 {margin-left:1pt; }";\r
-  strNSS += "p.whs8 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nSetting Preferences\nSALOME preferences");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">SALOME preferences</h1>\r
-\r
-<p class="whs2">To begin setting preferences \r
- for your study, select <span style="font-weight: bold;"><B>Preferences </B></span>in \r
- the main menu, the following dialog box will appear:</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;<img src="../pics/pref11.png" x-maintain-ratio="TRUE" width="752px" height="646px" border="0" class="img_whs3"></p>\r
-\r
-<p class="whs2">If you've just started \r
- your study and haven't yet loaded other modules, you'll be able to change \r
- only those settings, which refer to the whole GUI SALOME session. These \r
- settings will be valid for the whole study session.</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2"><span style="font-weight: bold; font-size: 12pt;"><font size=3 style="font-size:12pt;"><B>General \r
- Preferences</B></font></span> </p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <li class=kadov-p><p class="whs5">Study Properties</p></li>\r
-</ul>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <ul type="disc" class="whs4">\r
-               \r
-               <li class=kadov-p><p class="whs5">MultiFile Save<span \r
- style="font-weight: normal;"> - if checked in, your study will be saved \r
- in several HDF files (one file for the data created by each component \r
- used during the study session).</span></p></li>\r
-               \r
-               <li class=kadov-p><p class="whs5">ASCII Save - <span \r
- style="font-weight: normal;">if checked in, your study will be saved in \r
- ASCII format file (or files).</span></p></li>\r
-               \r
-               <li class=kadov-p><p class="whs5">Store positions \r
- of windows<span style="font-weight: normal;"> - </span>&nbsp;<span \r
- style="font-weight: normal;">if checked in, \r
- positions of windows will be saved in a special file at the end of the \r
- current session and then restored for a new session.</span></p></li>\r
-               \r
-               <li class=kadov-p><p class="whs5">Store/restore last \r
- GUI state -<span style="font-weight: normal;"> if checked in, all GUI \r
- settings are saved with the rest of the data whenever you save the study. \r
- When the study is reopened, the GUI state is restored. </span></p></li>\r
-       </ul>\r
-       \r
-       <li class=kadov-p><p class="whs5">External browser </p></li>\r
-       \r
-       <ul type="disc" class="whs4">\r
-               \r
-               <li class=kadov-p><p class="whs5">Application <span \r
- style="font-weight: normal;">this option allows you to set an external \r
- browser (IE, Netscape) which will be used for viewing SALOME reference \r
- manuals. By default, Mozilla is used. Press the </span><img src="../image69.gif" width="23px" height="29px" border="0" class="img_whs6"> <span \r
- style="font-weight: normal;">button to browse for the application you \r
- need in the data tree of your computer.</span></p></li>\r
-               \r
-               <li class=kadov-p><p class="whs5">Parameters</p></li>\r
-       </ul>\r
-</ul>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <li class=kadov-p><p class="whs5">Python console properties \r
- -<span style="font-weight: normal;"> here you can quickly set the parameters \r
- (style, size, face) of the font used in your Python console. For detailed \r
- settings in </span><a href="../select_color_and_font.htm">Select Font</a><span \r
- style="font-weight: normal;"> dialog box press the </span><img src="../image68.gif" width="23px" height="29px" border="0" class="img_whs6"> <span style="font-weight: normal;">button.</span></p></li>\r
-</ul>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<p class="whs7"><span \r
- style="font-family: 'Times New Roman', serif; font-weight: bold;"><B>Viewers \r
- Preferences</B></span></p>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<p class="whs7"><img src="../pics/pref12.png" x-maintain-ratio="TRUE" width="752px" height="646px" border="0" class="img_whs3"></p>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <li class=kadov-p><p class="whs7">OCC \r
- and VTK 3D Viewers</p></li>\r
-</ul>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <ul type="disc" class="whs4">\r
-               \r
-               <li class=kadov-p><p class="whs5">Trihedron size \r
- - <span style="font-weight: normal;">this submenu allows to set the size \r
- of coordinate axes displayed in the viewer.</span></p></li>\r
-               \r
-               <li class=kadov-p><p class="whs8">Background \r
- Color - <span style="font-weight: normal;">this submenu allows to select \r
- background color. Click on the colored line to access to the </span><a href="../select_color_and_font.htm">Select Color</a><span style="font-weight: normal;"> \r
- dialog box. </span></p></li>\r
-       </ul>\r
-</ul>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <ul type="disc" class="whs4">\r
-               \r
-               <li class=kadov-p><p class="whs8"><span \r
- style="font-weight: normal;">&nbsp;</span>Number \r
- of isolines along U <span style="font-weight: normal;">(or</span> V<span \r
- style="font-weight: normal;">) - this submenu allows to specify the number \r
- of isolines along the axes of coordinates.</span></p></li>\r
-               \r
-               <li class=kadov-p><p class="whs8">Relative \r
- size<span style="font-weight: normal;"> - if checked in, trihedron axes \r
- scale to fit the size of the area displayed in 3D Viewer. &nbsp;</span></p></li>\r
-       </ul>\r
-</ul>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <li class=kadov-p><p class="whs7">Plot2d \r
- Viewer</p></li>\r
-       \r
-       <ul type="disc" class="whs4">\r
-               \r
-               <li class=kadov-p><p class="whs7">Legend \r
- Position - <span style="font-weight: normal;">this submenu allows to set \r
- the default position of the legend, it can be located to the left, to \r
- the right, on top or on bottom of the graph.</span> &nbsp;</p></li>\r
-               \r
-               <li class=kadov-p><p class="whs7">Curve \r
- Type - <span style="font-weight: normal;">this allows to set the representation \r
- of graphs in your presentations. You can see only</span> Points<span style="font-weight: normal;">, \r
- points connected with</span> Lines <span style="font-weight: normal;">or \r
- points connected with smooth</span> Splines. &nbsp;&nbsp;</p></li>\r
-               \r
-               <li class=kadov-p><p class="whs7">Marker \r
- Size - <span style="font-weight: normal;">this submenu allows you to set \r
- the size of markers in your graphs</span></p></li>\r
-               \r
-               <li class=kadov-p><p class="whs7">Horizontal \r
- <span style="font-weight: normal;">&amp;</span> Vertical Axis Scale - \r
- <span style="font-weight: normal;">this submenu allows you to set the \r
- scale for vertical and horizontal axes. It can be either</span> Linear \r
- <span style="font-weight: normal;">or</span> Logarithmic</p></li>\r
-               \r
-               <li class=kadov-p><p class="whs7">Background \r
- Color - <span style="font-weight: normal;">this submenu allows to select \r
- the background color. Click on the colored line to access to the </span><a href="../select_color_and_font.htm">Select Color</a><span style="font-weight: normal;"> \r
- dialog box. </span></p></li>\r
-       </ul>\r
-</ul>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <li class=kadov-p><p class="whs7">Graph \r
- Supervisor</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs9">Background \r
- Color - <span style="font-weight: normal;">this submenu allows to select \r
- background color. Click on the colored line to access to the </span><a href="../select_color_and_font.htm">Select Color</a><span style="font-weight: normal;"> \r
- dialog box. </span></p></li>\r
-       \r
-       <li class=kadov-p><p class="whs9">Title \r
- Color - <span style="font-weight: normal;">this submenu allows to select \r
- title color. Click on the colored line to access to the </span><a href="../select_color_and_font.htm">Select \r
- Color</a><span style="font-weight: normal;"> dialog box. </span></p></li>\r
-</ul>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs11">Directories Preferences</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2"><img src="../pics/pref13.png" x-maintain-ratio="TRUE" width="752px" height="646px" border="0" class="img_whs3"></p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <li class=kadov-p><p class="whs5">Quick Directory List \r
- - <span style="font-weight: normal;">this section allows to create and \r
- manage a custom quick directory list. To add a directory in the list, \r
- press the </span><img src="../image70.gif" width="20px" height="20px" border="0" class="img_whs12"> <span style="font-weight: normal;">button, \r
- then the <img src="../image71.gif" width="22px" height="23px" border="0" class="img_whs13"> button and browse the data tree for the</span> \r
- <span style="font-weight: normal;">directory you need.</span> <span style="font-weight: normal;"><br>\r
-       The <img src="../image73.gif" width="22px" height="21px" border="0" class="img_whs14"> and <img src="../image75.gif" width="23px" height="23px" border="0" class="img_whs15"> buttons help you to sort the \r
- directories in the list.<br>\r
-       To remove the selected directory from the list, press the <img src="../image72.gif" width="25px" height="24px" border="0" class="img_whs16"> button.</span> </p></li>\r
-</ul>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs7"><span \r
- style="font-family: 'Times New Roman', serif; font-weight: bold;"><B>Object \r
- Browser Preferences</B></span></p>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<p class="whs7"><img src="../pics/pref14.png" x-maintain-ratio="TRUE" width="752px" height="646px" border="0" class="img_whs3"></p>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <li class=kadov-p><p class="whs7">Object \r
- browser settings</p></li>\r
-       \r
-       <ul type="disc" class="whs4">\r
-               \r
-               <li class=kadov-p><p class="whs7">Auto \r
- size for the first column - <span style="font-weight: normal;">this checkbox \r
- enables automatic resizing for the first column.</span> &nbsp;</p></li>\r
-               \r
-               <li class=kadov-p><p class="whs7">Auto \r
- size for other columns - <span style="font-weight: normal;">this checkbox \r
- enables automatic resizing for the other columns.</span></p></li>\r
-       </ul>\r
-</ul>\r
-\r
-<p class="whs7">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <li class=kadov-p><p class="whs7">Default \r
- columns - <span style="font-weight: normal;">these checkboxes allow to</span> \r
- <span style="font-weight: normal;">display or hide </span>Value, Entry, \r
- IOR<span style="font-weight: normal;"> and </span>Reference entry<span \r
- style="font-weight: normal;"> columns in the Object Browser.</span></p></li>\r
-</ul>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Introduction to GUI','../introduction_to_gui.htm','SALOME desktop','salome_pro_desktop.htm','Saving a study','saving_a_study.htm','Using Object Browser','using_object_browser.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/using_catalog_generator.htm b/doc/salome/gui/GUI/kernel/using_catalog_generator.htm
deleted file mode 100755 (executable)
index 41e50d3..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Using Catalog Generator</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { font-family:'Times New Roman' , serif; }\r
-p.whs2 { margin-left:0px; text-align:justify; }\r
-img_whs3 { border:none; width:30px; height:30px; float:none; border-style:none; }\r
-p.whs4 { margin-left:0px; text-indent:48px; text-align:justify; }\r
-p.whs5 { text-align:justify; }\r
-p.whs6 { font-family:'Times New Roman' , serif; }\r
-p.whs7 { font-family:'Times New Roman' , serif; margin-left:40px; font-style:normal; color:#000000; }\r
-p.whs8 { font-family:'Times New Roman' , serif; margin-left:40px; }\r
-img_whs9 { border:none; width:475px; height:289px; float:none; border-style:none; }\r
-p.whs10 { font-family:'Times New Roman' , serif; margin-left:0px; }\r
-ul.whs11 { list-style:disc; }\r
-p.whs12 { font-family:'Times New Roman'  , serif; margin-left:0px; background-image:url('../texture_horiz_ltbluebubbles.jpg'); }\r
-img_whs13 { border:none; float:none; width:36px; height:38px; border-style:none; }\r
-img_whs14 { border:none; width:35px; height:37px; float:none; border-style:none; }\r
-p.whs15 { font-family:'Times New Roman' , serif; margin-left:0px; font-weight:bold; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs2 {margin-left:1pt; }";\r
-  strNSS += "p.whs4 {margin-left:1pt; }";\r
-  strNSS += "p.whs10 {margin-left:1pt; }";\r
-  strNSS += "p.whs12 {margin-left:1pt; }";\r
-  strNSS += "p.whs15 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nUsing Catalog Generator");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Using Catalog Generator \r
- (for advanced users)</h1>\r
-\r
-<p class="whs2"><img src="../i_blue.jpg" x-maintain-ratio="TRUE" width="30px" height="30px" border="0" class="img_whs3"> &nbsp;&nbsp;&nbsp;SALOME \r
- platform is an open platform for integration of your custom components, \r
- which can used in the same way as typical modules provided in the standard \r
- installed package. The <span style="font-weight: bold;"><B>Catalog Generator \r
- </B></span>tool serves for implementation of the interface of your custom \r
- component. It allows to generate from IDL description of your component \r
- interface its xml description. &nbsp;The \r
- component xml description allows SALOME application to know about the \r
- component and its services and provides the possibility to call the component \r
- services, for example, inside Supervisor module.</p>\r
-\r
-<p class="whs4">If you have a look at runSalome, runSalomeWithPort \r
- scripts running SALOME application, which are stored in build/bin directory \r
- you will see that SALOME_ModuleCatalog_Server is started with two xml \r
- files as its input parameters: <span style="font-weight: bold;"><B>CatalogModuleGeneral.xml</B></span> \r
- and <span style="font-weight: bold;"><B>CatalogModulePersonnel.xml</B></span>. \r
- These two files store the descriptions of interfaces and services of all \r
- components, provided with typical SALOME package. To add a new component \r
- into SALOME platform you should either update one of these existing xml \r
- files with generated xml description of your component or create a new \r
- one.</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class=TODO>To open the Catalog Generator:</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs7">From the main menu choose <span style="font-weight: bold;"><B>Tools \r
- &gt; Catalog Generato</B></span>r, the following dialog box will appear:</p>\r
-\r
-<p>&nbsp;</p>\r
-\r
-<p class="whs8"><img src="../pics/cataloggenerator.png" x-maintain-ratio="TRUE" width="475px" height="289px" border="0" class="img_whs9"></p>\r
-\r
-<p class="whs8">&nbsp;</p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs10">In \r
- this dialog box you can specify:</p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs11">\r
-       \r
-       <li class=kadov-p><p class="whs8">Name \r
- and location of the IDL file describing the interface of your component \r
- (Click the <span style="font-weight: bold;"><B>Browse</B></span> button to find \r
- it using the data tree).</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs8">Name \r
- and location of an existing XML file, which will be updated with the interface \r
- of you component or name and desired location of a new XML file, which \r
- will be generated (Click the <span style="font-weight: bold;"><B>Browse</B></span> \r
- button to find it using the data tree).</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs8">Name \r
- of the author,</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs8">Name \r
- of the component,</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs8">Name \r
- of the user</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs8">Version,</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs8">Capability \r
- of multi study support</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs8">Type \r
- of the component,</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs8">Icon \r
- of your component (Click the <span style="font-weight: bold;"><B>Browse</B></span> \r
- button to find it using the data tree).</p></li>\r
-</ul>\r
-\r
-<p class="whs8">&nbsp;</p>\r
-\r
-<p class="whs12"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs13">If you have chosen to create a new xml file containing the \r
- description of your component, don't forget to specify it as input parameter \r
- for SALOME_ModuleCatalog_Server in the file, you are using as a running \r
- script of SALOME platform (in runSalomeWithPort, for example).</p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs10">&nbsp;When \r
- launching SALOME next time you will see your module alongside other components.</p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs12"><img src="../tip1.gif" x-maintain-ratio="TRUE" width="35px" height="37px" border="0" class="img_whs14"> You can use the <span style="font-weight: bold;"><B>Catalog \r
- Generator</B></span> tool, if you would like to <span style="font-weight: bold;"><B>test</B></span> \r
- the functionality of your new component. After implementation of your \r
- component interface, launch SUPERVISION module where you can try using \r
- the services of your new component. (see also: Adding factory nodes)</p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs15">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Introduction to GUI','../introduction_to_gui.htm','SALOME desktop','salome_pro_desktop.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs15">&nbsp;</p>\r
-\r
-<p class="whs15">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/using_left-hand_tabs.htm b/doc/salome/gui/GUI/kernel/using_left-hand_tabs.htm
deleted file mode 100755 (executable)
index cb43d00..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Using left-hand tabs</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { font-family:'Times New Roman' , serif; }\r
-p.whs2 { font-family:'Times New Roman' , serif; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("Using this reference manual\nUsing left-hand tabs");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Using left-hand tabs</h1>\r
-\r
-<p class="whs2">SALOME Help system includes \r
- the following left-hand tabs:</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p-Cbullets><p CLASS=bullets\r
-                                                                       style="font-weight: normal; font-family: 'Times New Roman', serif;"><span \r
- style="font-weight: bold;"><B>Contents:</B></span> The Contents tab displays \r
- books and pages that represent the categories of information in the online \r
- Help system. When you click a closed book, it opens to display its content \r
- (sub-books and pages). When you click an open book, it closes. When you \r
- click pages, you select topics to view in the right-hand pane of the HTML \r
- Help viewer.</p></li>\r
-</ul>\r
-\r
-<p CLASS=bullets\r
-       style="font-weight: normal; font-family: 'Times New Roman', serif;">&nbsp;</p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p-Cbullets><p CLASS=bullets\r
-                                                                       style="font-weight: normal; font-family: 'Times New Roman', serif;"><span \r
- style="font-weight: bold;"><B>Search:</B></span> The Search tab enables you to \r
- search for words in the Help system and locate topics containing those \r
- words. Full-text searching looks through every word in the online Help \r
- to find matches. When the search is completed, a list of topics is displayed \r
- so you can select a specific topic to view.</p></li>\r
-</ul>\r
-\r
-<p CLASS=bullets\r
-       style="font-weight: normal; font-family: 'Times New Roman', serif;">&nbsp;</p>\r
-\r
-<ul>\r
-       \r
-       <li class=kadov-p-Cbullets><p CLASS=bullets\r
-                                                                       style="font-weight: normal; font-family: 'Times New Roman', serif;"><span \r
- style="font-weight: bold;"><B>Glossary:</B></span> The Glossary tab displays \r
- a glossary providing a list of words, short phrases, and their definitions \r
- related to SALOME. When you select a term from the list, its corresponding \r
- definition is displayed in the lower pane.</p></li>\r
-</ul>\r
-\r
-<p class="whs2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>\r
-\r
-<p class="whs2">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','About SALOME help system','about_salome_pro_help_system.htm','Navigating topics','navigating_topics.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/using_object_browser.htm b/doc/salome/gui/GUI/kernel/using_object_browser.htm
deleted file mode 100755 (executable)
index 24f4e91..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Using Object Browser</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { text-align:justify; }\r
-p.whs2 { text-align:justify; }\r
-img_whs3 { border:none; width:30px; height:30px; float:none; border-style:none; }\r
-ul.whs4 { list-style:disc; }\r
-p.whs5 { text-align:justify; margin-left:40px; }\r
-img_whs6 { border:none; width:294px; height:280px; float:none; border-style:none; }\r
-p.whs7 { background-image:url('../texture_horiz_ltbluebubbles.jpg'); text-align:justify; }\r
-img_whs8 { border:none; float:none; width:36px; height:38px; border-style:none; }\r
-img_whs9 { border:none; width:354px; height:280px; float:none; border-style:none; }\r
-p.whs10 { margin-left:0px; font-weight:bold; text-align:justify; }\r
-p.whs11 { margin-left:0px; text-align:justify; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs10 {margin-left:1pt; }";\r
-  strNSS += "p.whs11 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nUsing Object Browser");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Using Object Browser</h1>\r
-\r
-<p class="whs2"><img src="../i_blue.jpg" x-maintain-ratio="TRUE" width="30px" height="30px" border="0" class="img_whs3"> The <span style="font-weight: bold;"><B>Object \r
- Browser</B></span> in SALOME is destined for displaying the structure of the \r
- current study in a tree-like form. It contains: </p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <li class=kadov-p><p class="whs2">components, loaded \r
- during the current session</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs2">objects created with \r
- the help of different components &nbsp;(The \r
- objects created with the help of a definite component are located in the \r
- folder having the name of this component.)</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs2">references to different \r
- objects (they are highlighted in red).</p></li>\r
-</ul>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs5"><img src="../pics/objectbrowser1.png" x-maintain-ratio="TRUE" width="294px" height="280px" border="0" class="img_whs6"></p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs7"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs8">The <span style="font-weight: bold;"><B>Object Browser </B></span>is \r
- destined to getting quick access to different objects created during SALOME \r
- session. All pop-up menus associated with the objects displayed in the \r
- Object Browser are context-sensitive. So it depends on a definite currently \r
- loaded SALOME component what options you will see in the pop-up menu, \r
- if you right-click on a definite object in the Object Browser.</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">The Object Browser may contain supplementary \r
- attributes of the objects displayed in additional columns. By default, \r
- these columns are not displayed - &nbsp;displaying/hiding \r
- these columns is possible through <a href="setting_preferences.htm#Object_Browser">setting \r
- study preferences</a> or right-clicking on the attributes bar and toggling \r
- the necessary attributes.</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs5"><img src="../pics/objectbrowser2.png" x-maintain-ratio="TRUE" width="354px" height="280px" border="0" class="img_whs9"> </p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <li class=kadov-p><p class="whs2"><span style="font-weight: bold;"><B>Entry</B></span> \r
- &nbsp;- Identification \r
- index of the object in the structure of the study</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs2"><span style="font-weight: bold;"><B>IOR</B></span> \r
- - &nbsp;Interoperable \r
- Object Reference</p></li>\r
-       \r
-       <li class=kadov-p><p class="whs2"><span style="font-weight: bold;"><B>Reference \r
- entry</B></span> &nbsp;- \r
- &nbsp;Identification \r
- index of the references to the objects</p></li>\r
-</ul>\r
-\r
-<ul type="disc" class="whs4">\r
-       \r
-       <li class=kadov-p><p class="whs2"><span style="font-weight: bold;"><B>Value</B></span> \r
- &nbsp;- &nbsp;Displays \r
- the value of the first object attribute </p></li>\r
-</ul>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs7"><img src="../note1.gif" x-maintain-ratio="TRUE" width="36px" height="38px" border="0" class="img_whs8"> <span style="font-weight: bold;"><B>Entry, IOR and Reference \r
- entry &nbsp;</B></span>attributes \r
- are displayed for debugging purposes only.</p>\r
-\r
-<p class="whs2"><span style="text-align: justify;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>\r
-\r
-<p class="whs10">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Introduction to GUI','../introduction_to_gui.htm','SALOME desktop','salome_pro_desktop.htm','Setting preferences','setting_preferences.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs10">&nbsp;</p>\r
-\r
-<p class="whs11">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/kernel/using_registry.htm b/doc/salome/gui/GUI/kernel/using_registry.htm
deleted file mode 100755 (executable)
index ab5ec1f..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Using Registry tool</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { text-align:justify; }\r
-p.whs2 { text-align:justify; }\r
-p.whs3 { margin-left:40px; text-align:justify; }\r
-p.whs4 { font-style:italic; color:#ff0000; margin-left:40px; text-align:justify; }\r
-img_whs5 { border:none; width:604px; height:201px; float:none; border-style:none; }\r
-p.whs6 { margin-left:0px; text-align:justify; }\r
-p.whs7 { text-align:justify; margin-left:40px; }\r
-img_whs8 { border:none; width:327px; height:128px; float:none; border-style:none; }\r
-p.whs9 { text-align:justify; margin-left:80px; }\r
-img_whs10 { border:none; width:460px; height:283px; float:none; border-style:none; }\r
-p.whs11 { margin-left:0px; font-weight:bold; text-align:justify; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs6 {margin-left:1pt; }";\r
-  strNSS += "p.whs11 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="BSSC Special Effects" src="../ehlpdhtm.js"></script><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("GUI module\nUsing Registry tool");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Using Registry tool</h1>\r
-\r
-<p class="whs2"><span style="font-weight: bold;"><B>Registry</B></span> \r
- tool is in the SALOME platform is destined for providing information about \r
- the processes (components), which have ever been launched in the current \r
- study session. &nbsp;</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class=TODO>To view the Registry:</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3">From the main menu choose \r
- <span style="font-weight: bold;"><B>Tools &gt; Registry display</B></span>, the \r
- following dialog box will appear:</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs3"><img src="../pics/registry1.png" x-maintain-ratio="TRUE" width="604px" height="201px" border="0" class="img_whs5"></p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs6"><span style="font-weight: bold;"><B>Running</B></span> \r
- tab of this dialog box displays a list of the currently started processes \r
- (components) with supplementary information on each of them divided into \r
- columns:</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs3">- <span style="font-weight: bold;"><B>Component: \r
- </B></span>name of the started component</p>\r
-\r
-<p class="whs3">- <span style="font-weight: bold;"><B>PID: \r
- </B></span>process identification number</p>\r
-\r
-<p class="whs3">- <span style="font-weight: bold;"><B>User \r
- Name: </B></span>name of the user launching the component</p>\r
-\r
-<p class="whs3">- <span style="font-weight: bold;"><B>Machine: \r
- </B></span>name of the machine, on which the process has been started</p>\r
-\r
-<p class="whs3">- <span style="font-weight: bold;"><B>begins: \r
- </B></span>date and time of the starting of the component</p>\r
-\r
-<p class="whs3">- <span style="font-weight: bold;"><B>hello:</B></span> \r
- date and time of the last call to the component</p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs6"><span style="font-weight: bold;"><B>History</B></span> \r
- tab displays a list of all processes, which have ever been launched within \r
- this study session. It contains the same supplementary information on \r
- each of the processes (components).</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"><span style="font-weight: bold;"><B>Refresh \r
- </B></span>button allows to refresh the current list of processes (components).</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"><span style="font-weight: bold;"><B>Interval</B></span> \r
- button allows to set an interval for refreshment of the current list of \r
- processes (components).</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs7"><img src="../pics/registry3.png" x-maintain-ratio="TRUE" width="327px" height="128px" border="0" class="img_whs8"></p>\r
-\r
-<p class="whs9">&nbsp;</p>\r
-\r
-<p class=TODO>To display complete information on a definite process (component):</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3">Double-click on this \r
- process (component). The following window will appear:</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs3"><img src="../pics/registry4.png" x-maintain-ratio="TRUE" width="460px" height="283px" border="0" class="img_whs10"></p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs11">\r
-<a href="javascript:void(0);" onClick="var e; if (parseInt(navigator.appVersion)>=4){e=event;}  if (parseInt(navigator.appVersion) >=2 && typeof(PickupDialog_Invoke) == 'function') PickupDialog_Invoke(e,'','Introduction to GUI','../introduction_to_gui.htm','SALOME desktop','salome_pro_desktop.htm');return false;" title="Related Topics"><img src="../ss_btn_related_topics.gif" border=0 height=17 width=82 alt="Related Topics"></a>\r
-\r
-\r
- </p>\r
-\r
-<p class="whs11">&nbsp;</p>\r
-\r
-<p class="whs11">&nbsp;</p>\r
-\r
-<script type="text/javascript" language="JavaScript" title="WebHelpRelatedTopics"><!--\r
-if (parseInt(navigator.appVersion) >= 3 && typeof (WritePopupMenuLayer) == "function")\r
-  WritePopupMenuLayer();\r
-//--></script><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/pics/cataloggenerator.png b/doc/salome/gui/GUI/pics/cataloggenerator.png
deleted file mode 100755 (executable)
index 51a0f27..0000000
Binary files a/doc/salome/gui/GUI/pics/cataloggenerator.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/choicepage.png b/doc/salome/gui/GUI/pics/choicepage.png
deleted file mode 100755 (executable)
index fefd66e..0000000
Binary files a/doc/salome/gui/GUI/pics/choicepage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/clipping.png b/doc/salome/gui/GUI/pics/clipping.png
deleted file mode 100644 (file)
index 6d73855..0000000
Binary files a/doc/salome/gui/GUI/pics/clipping.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/copy-paste.jpg b/doc/salome/gui/GUI/pics/copy-paste.jpg
deleted file mode 100755 (executable)
index e243122..0000000
Binary files a/doc/salome/gui/GUI/pics/copy-paste.jpg and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/dumpstudy.png b/doc/salome/gui/GUI/pics/dumpstudy.png
deleted file mode 100755 (executable)
index f899e77..0000000
Binary files a/doc/salome/gui/GUI/pics/dumpstudy.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/exemple.gif b/doc/salome/gui/GUI/pics/exemple.gif
deleted file mode 100755 (executable)
index 6350d17..0000000
Binary files a/doc/salome/gui/GUI/pics/exemple.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/geomview-alt.png b/doc/salome/gui/GUI/pics/geomview-alt.png
deleted file mode 100755 (executable)
index e797b08..0000000
Binary files a/doc/salome/gui/GUI/pics/geomview-alt.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/graduatedaxes1.png b/doc/salome/gui/GUI/pics/graduatedaxes1.png
deleted file mode 100644 (file)
index cf021ba..0000000
Binary files a/doc/salome/gui/GUI/pics/graduatedaxes1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/icon_about.png b/doc/salome/gui/GUI/pics/icon_about.png
deleted file mode 100755 (executable)
index 0cfa37a..0000000
Binary files a/doc/salome/gui/GUI/pics/icon_about.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image100.gif b/doc/salome/gui/GUI/pics/image100.gif
deleted file mode 100644 (file)
index c44d68f..0000000
Binary files a/doc/salome/gui/GUI/pics/image100.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image102.gif b/doc/salome/gui/GUI/pics/image102.gif
deleted file mode 100644 (file)
index 3507814..0000000
Binary files a/doc/salome/gui/GUI/pics/image102.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image103.gif b/doc/salome/gui/GUI/pics/image103.gif
deleted file mode 100644 (file)
index be534c3..0000000
Binary files a/doc/salome/gui/GUI/pics/image103.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image105.gif b/doc/salome/gui/GUI/pics/image105.gif
deleted file mode 100644 (file)
index 4f6173f..0000000
Binary files a/doc/salome/gui/GUI/pics/image105.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image106.gif b/doc/salome/gui/GUI/pics/image106.gif
deleted file mode 100644 (file)
index 2bbcb4d..0000000
Binary files a/doc/salome/gui/GUI/pics/image106.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image108.gif b/doc/salome/gui/GUI/pics/image108.gif
deleted file mode 100644 (file)
index bec69e6..0000000
Binary files a/doc/salome/gui/GUI/pics/image108.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image109.gif b/doc/salome/gui/GUI/pics/image109.gif
deleted file mode 100644 (file)
index 5dbba46..0000000
Binary files a/doc/salome/gui/GUI/pics/image109.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image157.gif b/doc/salome/gui/GUI/pics/image157.gif
deleted file mode 100644 (file)
index 2f66e05..0000000
Binary files a/doc/salome/gui/GUI/pics/image157.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image77.gif b/doc/salome/gui/GUI/pics/image77.gif
deleted file mode 100644 (file)
index ef7a62f..0000000
Binary files a/doc/salome/gui/GUI/pics/image77.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image86.gif b/doc/salome/gui/GUI/pics/image86.gif
deleted file mode 100644 (file)
index 3397331..0000000
Binary files a/doc/salome/gui/GUI/pics/image86.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image88.gif b/doc/salome/gui/GUI/pics/image88.gif
deleted file mode 100644 (file)
index 9466aa6..0000000
Binary files a/doc/salome/gui/GUI/pics/image88.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image89.gif b/doc/salome/gui/GUI/pics/image89.gif
deleted file mode 100644 (file)
index 373a6c0..0000000
Binary files a/doc/salome/gui/GUI/pics/image89.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image91.gif b/doc/salome/gui/GUI/pics/image91.gif
deleted file mode 100644 (file)
index 9e93c1c..0000000
Binary files a/doc/salome/gui/GUI/pics/image91.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image95.gif b/doc/salome/gui/GUI/pics/image95.gif
deleted file mode 100644 (file)
index fb293e2..0000000
Binary files a/doc/salome/gui/GUI/pics/image95.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image96.gif b/doc/salome/gui/GUI/pics/image96.gif
deleted file mode 100644 (file)
index 4580d5b..0000000
Binary files a/doc/salome/gui/GUI/pics/image96.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image97.gif b/doc/salome/gui/GUI/pics/image97.gif
deleted file mode 100644 (file)
index 1d78de1..0000000
Binary files a/doc/salome/gui/GUI/pics/image97.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image98.gif b/doc/salome/gui/GUI/pics/image98.gif
deleted file mode 100644 (file)
index 6519dbb..0000000
Binary files a/doc/salome/gui/GUI/pics/image98.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/image99.gif b/doc/salome/gui/GUI/pics/image99.gif
deleted file mode 100644 (file)
index 3711be8..0000000
Binary files a/doc/salome/gui/GUI/pics/image99.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/import.png b/doc/salome/gui/GUI/pics/import.png
deleted file mode 100755 (executable)
index 093c667..0000000
Binary files a/doc/salome/gui/GUI/pics/import.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/intropage.png b/doc/salome/gui/GUI/pics/intropage.png
deleted file mode 100755 (executable)
index 143d8d0..0000000
Binary files a/doc/salome/gui/GUI/pics/intropage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/launch1.png b/doc/salome/gui/GUI/pics/launch1.png
deleted file mode 100755 (executable)
index e181247..0000000
Binary files a/doc/salome/gui/GUI/pics/launch1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/loadscript.png b/doc/salome/gui/GUI/pics/loadscript.png
deleted file mode 100755 (executable)
index e681fc7..0000000
Binary files a/doc/salome/gui/GUI/pics/loadscript.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/loadstudy2.png b/doc/salome/gui/GUI/pics/loadstudy2.png
deleted file mode 100755 (executable)
index 595ea05..0000000
Binary files a/doc/salome/gui/GUI/pics/loadstudy2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/lockedstudy.png b/doc/salome/gui/GUI/pics/lockedstudy.png
deleted file mode 100755 (executable)
index 9ec7e74..0000000
Binary files a/doc/salome/gui/GUI/pics/lockedstudy.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/neo-view2.png b/doc/salome/gui/GUI/pics/neo-view2.png
deleted file mode 100755 (executable)
index df1c7fe..0000000
Binary files a/doc/salome/gui/GUI/pics/neo-view2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/newsticn.jpg b/doc/salome/gui/GUI/pics/newsticn.jpg
deleted file mode 100755 (executable)
index 94c8ee9..0000000
Binary files a/doc/salome/gui/GUI/pics/newsticn.jpg and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/objectbrowser1.png b/doc/salome/gui/GUI/pics/objectbrowser1.png
deleted file mode 100755 (executable)
index 16ab896..0000000
Binary files a/doc/salome/gui/GUI/pics/objectbrowser1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/objectbrowser2.png b/doc/salome/gui/GUI/pics/objectbrowser2.png
deleted file mode 100755 (executable)
index e010ef2..0000000
Binary files a/doc/salome/gui/GUI/pics/objectbrowser2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/open.jpg b/doc/salome/gui/GUI/pics/open.jpg
deleted file mode 100755 (executable)
index 5829aef..0000000
Binary files a/doc/salome/gui/GUI/pics/open.jpg and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/ppref1.png b/doc/salome/gui/GUI/pics/ppref1.png
deleted file mode 100755 (executable)
index dd91013..0000000
Binary files a/doc/salome/gui/GUI/pics/ppref1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/ppref2.png b/doc/salome/gui/GUI/pics/ppref2.png
deleted file mode 100755 (executable)
index 5a15f0e..0000000
Binary files a/doc/salome/gui/GUI/pics/ppref2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/ppref3.png b/doc/salome/gui/GUI/pics/ppref3.png
deleted file mode 100755 (executable)
index 767c5cf..0000000
Binary files a/doc/salome/gui/GUI/pics/ppref3.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref11.png b/doc/salome/gui/GUI/pics/pref11.png
deleted file mode 100755 (executable)
index 26ddbe9..0000000
Binary files a/doc/salome/gui/GUI/pics/pref11.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref12.png b/doc/salome/gui/GUI/pics/pref12.png
deleted file mode 100755 (executable)
index 8cafab8..0000000
Binary files a/doc/salome/gui/GUI/pics/pref12.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref13.png b/doc/salome/gui/GUI/pics/pref13.png
deleted file mode 100755 (executable)
index 4cfe950..0000000
Binary files a/doc/salome/gui/GUI/pics/pref13.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref14.png b/doc/salome/gui/GUI/pics/pref14.png
deleted file mode 100755 (executable)
index 2f8bcfb..0000000
Binary files a/doc/salome/gui/GUI/pics/pref14.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref15.png b/doc/salome/gui/GUI/pics/pref15.png
deleted file mode 100755 (executable)
index 10053fb..0000000
Binary files a/doc/salome/gui/GUI/pics/pref15.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref21.png b/doc/salome/gui/GUI/pics/pref21.png
deleted file mode 100755 (executable)
index a487dba..0000000
Binary files a/doc/salome/gui/GUI/pics/pref21.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref22.png b/doc/salome/gui/GUI/pics/pref22.png
deleted file mode 100755 (executable)
index 26921dc..0000000
Binary files a/doc/salome/gui/GUI/pics/pref22.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref23.png b/doc/salome/gui/GUI/pics/pref23.png
deleted file mode 100755 (executable)
index bbd4525..0000000
Binary files a/doc/salome/gui/GUI/pics/pref23.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref24.png b/doc/salome/gui/GUI/pics/pref24.png
deleted file mode 100755 (executable)
index 55a0ed5..0000000
Binary files a/doc/salome/gui/GUI/pics/pref24.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref31.png b/doc/salome/gui/GUI/pics/pref31.png
deleted file mode 100755 (executable)
index e5606d1..0000000
Binary files a/doc/salome/gui/GUI/pics/pref31.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref32.png b/doc/salome/gui/GUI/pics/pref32.png
deleted file mode 100755 (executable)
index 63daf46..0000000
Binary files a/doc/salome/gui/GUI/pics/pref32.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref33.png b/doc/salome/gui/GUI/pics/pref33.png
deleted file mode 100755 (executable)
index bdc9b76..0000000
Binary files a/doc/salome/gui/GUI/pics/pref33.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref34.png b/doc/salome/gui/GUI/pics/pref34.png
deleted file mode 100755 (executable)
index 5072c62..0000000
Binary files a/doc/salome/gui/GUI/pics/pref34.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref37.png b/doc/salome/gui/GUI/pics/pref37.png
deleted file mode 100755 (executable)
index 1d4d082..0000000
Binary files a/doc/salome/gui/GUI/pics/pref37.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref38.png b/doc/salome/gui/GUI/pics/pref38.png
deleted file mode 100755 (executable)
index 5c8d31c..0000000
Binary files a/doc/salome/gui/GUI/pics/pref38.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/pref39.png b/doc/salome/gui/GUI/pics/pref39.png
deleted file mode 100755 (executable)
index 878a526..0000000
Binary files a/doc/salome/gui/GUI/pics/pref39.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/productpage.png b/doc/salome/gui/GUI/pics/productpage.png
deleted file mode 100755 (executable)
index 71fe213..0000000
Binary files a/doc/salome/gui/GUI/pics/productpage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/progresspage.png b/doc/salome/gui/GUI/pics/progresspage.png
deleted file mode 100755 (executable)
index 88fc080..0000000
Binary files a/doc/salome/gui/GUI/pics/progresspage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/readmepage.png b/doc/salome/gui/GUI/pics/readmepage.png
deleted file mode 100755 (executable)
index 5466362..0000000
Binary files a/doc/salome/gui/GUI/pics/readmepage.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/registry1.png b/doc/salome/gui/GUI/pics/registry1.png
deleted file mode 100755 (executable)
index b8912c6..0000000
Binary files a/doc/salome/gui/GUI/pics/registry1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/registry3.png b/doc/salome/gui/GUI/pics/registry3.png
deleted file mode 100755 (executable)
index f44e2ec..0000000
Binary files a/doc/salome/gui/GUI/pics/registry3.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/registry4.png b/doc/salome/gui/GUI/pics/registry4.png
deleted file mode 100755 (executable)
index 98a3772..0000000
Binary files a/doc/salome/gui/GUI/pics/registry4.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/save.jpg b/doc/salome/gui/GUI/pics/save.jpg
deleted file mode 100755 (executable)
index 90001af..0000000
Binary files a/doc/salome/gui/GUI/pics/save.jpg and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/selectcolor.png b/doc/salome/gui/GUI/pics/selectcolor.png
deleted file mode 100755 (executable)
index 70800b2..0000000
Binary files a/doc/salome/gui/GUI/pics/selectcolor.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/selectfont.png b/doc/salome/gui/GUI/pics/selectfont.png
deleted file mode 100755 (executable)
index 04eff08..0000000
Binary files a/doc/salome/gui/GUI/pics/selectfont.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/set_rotation_point_dialog1.png b/doc/salome/gui/GUI/pics/set_rotation_point_dialog1.png
deleted file mode 100644 (file)
index bdab73b..0000000
Binary files a/doc/salome/gui/GUI/pics/set_rotation_point_dialog1.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/set_rotation_point_dialog2.png b/doc/salome/gui/GUI/pics/set_rotation_point_dialog2.png
deleted file mode 100644 (file)
index 7f3696a..0000000
Binary files a/doc/salome/gui/GUI/pics/set_rotation_point_dialog2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/studyproperties.png b/doc/salome/gui/GUI/pics/studyproperties.png
deleted file mode 100755 (executable)
index af88317..0000000
Binary files a/doc/salome/gui/GUI/pics/studyproperties.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/view2.png b/doc/salome/gui/GUI/pics/view2.png
deleted file mode 100755 (executable)
index 9d48a09..0000000
Binary files a/doc/salome/gui/GUI/pics/view2.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/pics/view_rotation_point.png b/doc/salome/gui/GUI/pics/view_rotation_point.png
deleted file mode 100644 (file)
index 7fe8f83..0000000
Binary files a/doc/salome/gui/GUI/pics/view_rotation_point.png and /dev/null differ
diff --git a/doc/salome/gui/GUI/static/footer.html b/doc/salome/gui/GUI/static/footer.html
deleted file mode 100755 (executable)
index 56d52a6..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-</head>
-<body>
-<hr style="width: 100%; height: 2px;">
-<div style="text-align: center;">Copyright &copy; 2003-2007 CEA, EDF<br>
-</div>
-</body>
-</html>
diff --git a/doc/salome/gui/GUI/static/header.html b/doc/salome/gui/GUI/static/header.html
deleted file mode 100755 (executable)
index a70a95e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-   <title>$title</title>
-   <link href="doxygen.css" rel="stylesheet" type="text/css">
-</head>
-<hr>
-<center>
-SALOME documentation central
-</center>
-<hr>
diff --git a/doc/salome/gui/GUI/whdata/whftdata.js b/doc/salome/gui/GUI/whdata/whftdata.js
deleted file mode 100755 (executable)
index 071ae6f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-//     WebHelp 5.10.001\r
-var gTEA = new Array();\r
-function aTE(sTopicTitle, sTopicURL)\r
-{\r
-       var len = gTEA.length;\r
-       gTEA[len] = new topicEntry(sTopicTitle, sTopicURL);\r
-}\r
-\r
-function topicEntry(sTopicTitle, sTopicURL)\r
-{\r
-       this.sTopicTitle = sTopicTitle;\r
-       this.sTopicURL = sTopicURL;\r
-}\r
-\r
-function window_OnLoad()\r
-{\r
-       if (parent && parent != this) {\r
-               if (parent.putFtsTData) \r
-               {\r
-                       parent.putFtsTData(gTEA);\r
-               }\r
-       }\r
-}\r
-\r
-window.onload = window_OnLoad;
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whdata/whftdata0.htm b/doc/salome/gui/GUI/whdata/whftdata0.htm
deleted file mode 100755 (executable)
index dff115e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<html>\r
-<head>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<body>\r
-<script language="javascript" src="whftdata.js"></script>\r
-<script language="javascript">\r
-<!--\r
-//-->\r
-</script>\r
-<script language="javascript">\r
-<!--\r
-aTE("Dump Study","dump_study.htm");\r
-aTE("GEOM preferences","geom_preferences.htm");\r
-aTE("Introduction to GUI","introduction_to_gui.htm");\r
-aTE("About SALOME architecture","kernel/about_salome_pro_architecture.htm");\r
-aTE("About SALOME help system","kernel/about_salome_pro_help_system.htm");\r
-aTE("Creating a new study","kernel/creating_a_new_study.htm");\r
-aTE("Displaying studies","kernel/displaying_studies.htm");\r
-aTE("Editing studies","kernel/editing_studies.htm");\r
-aTE("Getting properties of the study","kernel/getting_properties_of_the_study.htm");\r
-aTE("Getting started2","kernel/getting_started2.htm");\r
-aTE("Introduction","kernel/introduction.htm");\r
-aTE("Introduction to SALOME","kernel/introduction_to_salome_pro.htm");\r
-aTE("Navigating topics","kernel/navigating_topics.htm");\r
-aTE("Opening studies","kernel/opening_studies.htm");\r
-aTE("SALOME Installation Wizard Help","kernel/readme.html");\r
-aTE("Running SALOME","kernel/running_salome_pro.htm");\r
-aTE("SALOME desktop","kernel/salome_pro_desktop.htm");\r
-aTE("Saving a study","kernel/saving_a_study.htm");\r
-aTE("Setting preferences","kernel/setting_preferences.htm");\r
-aTE("Using Catalog Generator","kernel/using_catalog_generator.htm");\r
-aTE("Using left-hand tabs","kernel/using_left-hand_tabs.htm");\r
-aTE("Using Object Browser","kernel/using_object_browser.htm");\r
-aTE("Using Registry tool","kernel/using_registry.htm");\r
-aTE("MESH preferences","mesh_preferences.htm");\r
-aTE("OCC 3D Viewer","occ_3d_viewer.htm");\r
-aTE("Post-Pro Preferences","post-pro_preferences.htm");\r
-aTE("Select Color and Font","select_color_and_font.htm");\r
-aTE("Setting Preferences","setting_preferences.htm");\r
-aTE("VTK 3D Viewer","vtk_3d_viewer.htm");\r
-\r
-//-->\r
-</script>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/whdata/whfts.htm b/doc/salome/gui/GUI/whdata/whfts.htm
deleted file mode 100755 (executable)
index 7a1060e..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<html>\r
-<head>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<body>\r
-<script language="javascript" src="whfts.js"></script>\r
-<script language="javascript">\r
-<!--\r
-iWM("__version__","zoom","whfwdata0.htm");\r
-\r
-iTM(0,26,"whftdata0.htm");\r
-\r
-//-->\r
-</script>\r
-</body>\r
-</html>
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whdata/whfts.js b/doc/salome/gui/GUI/whdata/whfts.js
deleted file mode 100755 (executable)
index 2b66786..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//     WebHelp 5.10.001\r
-var gaFileMapping = new Array();\r
-var gaFileTopicMapping = new Array();\r
-\r
-function fileMapping(sStartKey, sEndKey, sFileName)\r
-{\r
-       this.sStartKey = sStartKey;\r
-       this.sEndKey = sEndKey;\r
-       this.sFileName = sFileName;\r
-       this.aFtsKeys = null;\r
-}\r
-\r
-function fileTopicMapping(nIdBegin, nIdEnd, sFileName)\r
-{\r
-       this.nBegin = nIdBegin;\r
-       this.nEnd = nIdEnd;\r
-       this.sFileName = sFileName;\r
-       this.aTopics = null;\r
-}\r
-\r
-\r
-function iWM(sStartKey, sEndKey, sFileName)\r
-{\r
-       gaFileMapping[gaFileMapping.length] = new fileMapping(sStartKey, sEndKey, sFileName);   \r
-}\r
-\r
-function window_OnLoad()\r
-{\r
-       if (parent && parent != this && parent.ftsReady)\r
-       {\r
-               parent.ftsReady(gaFileMapping, gaFileTopicMapping);\r
-       }               \r
-}\r
-\r
-function iTM(nIdBegin, nIdEnd, sFileName)\r
-{\r
-       gaFileTopicMapping[gaFileTopicMapping.length] = new fileTopicMapping(nIdBegin, nIdEnd, sFileName);      \r
-}\r
-\r
-window.onload = window_OnLoad;\r
diff --git a/doc/salome/gui/GUI/whdata/whfwdata.js b/doc/salome/gui/GUI/whdata/whfwdata.js
deleted file mode 100755 (executable)
index e9e8bc6..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//     WebHelp 5.10.001\r
-var gWEA = new Array();\r
-function aWE()\r
-{\r
-       var len = gWEA.length;\r
-       gWEA[len] = new ftsEntry(aWE.arguments);\r
-}\r
-\r
-function ftsEntry(fn_arguments) \r
-{\r
-       if (fn_arguments.length && fn_arguments.length >= 1) \r
-       {\r
-               this.sItemName = fn_arguments[0];\r
-               this.aTopics = null;\r
-               var nLen = fn_arguments.length;\r
-               if (nLen > 1) \r
-               {\r
-                       this.aTopics = new Array();\r
-                       for (var i = 0; i < nLen - 1; i ++ )\r
-                       {\r
-                               this.aTopics[i] = fn_arguments[i + 1];\r
-                       }\r
-               }\r
-       }\r
-}\r
-\r
-function window_OnLoad()\r
-{\r
-       if (parent && parent != this) {\r
-               if (parent.putFtsWData) \r
-               {\r
-                       parent.putFtsWData(gWEA);\r
-               }\r
-       }\r
-}\r
-\r
-window.onload = window_OnLoad;
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whdata/whfwdata0.htm b/doc/salome/gui/GUI/whdata/whfwdata0.htm
deleted file mode 100755 (executable)
index 09a7521..0000000
+++ /dev/null
@@ -1,1399 +0,0 @@
-<html>\r
-<head>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<body>\r
-<script language="javascript" src="whfwdata.js"></script>\r
-<script language="javascript">\r
-<!--\r
-//-->\r
-</script>\r
-<script language="javascript">\r
-<!--\r
-aWE("__version__",14);\r
-aWE("_omnipymodul",14);\r
-aWE("_root_dir",14);\r
-aWE("_src_dir",14);\r
-aWE("0",6,2,25,16,14);\r
-aWE("001",25);\r
-aWE("01",25);\r
-aWE("1",5,25,15,14);\r
-aWE("10",25,14);\r
-aWE("100",25);\r
-aWE("103100",14);\r
-aWE("13",14);\r
-aWE("16",25);\r
-aWE("16x16",25);\r
-aWE("2",5,25,15,14);\r
-aWE("200",25);\r
-aWE("23",14);\r
-aWE("24",14);\r
-aWE("256",25);\r
-aWE("2a2",14);\r
-aWE("2d",6,10,2,25);\r
-aWE("3",6,2,15,16,14);\r
-aWE("31",14);\r
-aWE("33",25);\r
-aWE("3d",10,2,24,25,14,18,28);\r
-aWE("4",14);\r
-aWE("5",14);\r
-aWE("50",25);\r
-aWE("512",25);\r
-aWE("6",14);\r
-aWE("7",14);\r
-aWE("8",14);\r
-aWE("9",14);\r
-aWE("abl",3,6,24,14,18,28);\r
-aWE("abort",14);\r
-aWE("abov",8,14);\r
-aWE("abscissa",23,25);\r
-aWE("absolut",25);\r
-aWE("abstraction",5);\r
-aWE("ac",14);\r
-aWE("acceptabl",25);\r
-aWE("acces",3,1,23,24,25,16,18,21,28);\r
-aWE("accessibl",10,27);\r
-aWE("accord",25,15,16,14);\r
-aWE("account",14);\r
-aWE("achiev",3);\r
-aWE("acquaint",4);\r
-aWE("action",25,14);\r
-aWE("activ",5,6,25,16,17);\r
-aWE("activat",5,16,17);\r
-aWE("activity",25);\r
-aWE("actual",5,14);\r
-aWE("ad",0,14,26,19);\r
-aWE("adapt",3);\r
-aWE("add",15,16,14,26,18,19);\r
-aWE("addition",5,14);\r
-aWE("additional",3,2,25,15,16,14,21);\r
-aWE("addres",25);\r
-aWE("adjust",25);\r
-aWE("advanc",14,19);\r
-aWE("affect",3);\r
-aWE("again",6,12,14,17);\r
-aWE("algorithm",3,11,14);\r
-aWE("allow",3,0,7,1,11,23,24,25,15,16,14,17,26,18,27,19,22,28);\r
-aWE("almost",17);\r
-aWE("along",11,18,28);\r
-aWE("alongsid",19);\r
-aWE("alpha",25);\r
-aWE("already",14);\r
-aWE("alway",11);\r
-aWE("amount",14);\r
-aWE("animation",25);\r
-aWE("anoth",3,17);\r
-aWE("any",3,4,6,1,8,11,12,25,15,16,14,17,27);\r
-aWE("anyth",14);\r
-aWE("ap",27);\r
-aWE("api",0,25);\r
-aWE("appear",0,8,9,14,18,19,22);\r
-aWE("appearanc",23);\r
-aWE("applet",4);\r
-aWE("appli",1);\r
-aWE("application",3,6,0,10,2,15,16,14,17,18,27,19);\r
-aWE("approach",11,16,14);\r
-aWE("appropriat",10,14);\r
-aWE("approximat",14);\r
-aWE("arabic",26);\r
-aWE("architectur",3,0,10);\r
-aWE("area",6,24,16,18,28);\r
-aWE("argument",14);\r
-aWE("around",24,28);\r
-aWE("arrang",25);\r
-aWE("ascii",17,18);\r
-aWE("assign",25);\r
-aWE("associat",13,25,21);\r
-aWE("attach",10,14);\r
-aWE("attribut",14,21);\r
-aWE("author",8,19);\r
-aWE("auto",18);\r
-aWE("automatic",23,14,18);\r
-aWE("automatical",0,23,13,25,15,16,14,17,27);\r
-aWE("availability",7);\r
-aWE("availabl",3,5,7,10,24,14,28);\r
-aWE("averag",25);\r
-aWE("avi",25);\r
-aWE("avoid",0,14);\r
-aWE("awar",14);\r
-aWE("ax",24,18,28);\r
-aWE("axi",18,28);\r
-aWE("b",14);\r
-aWE("back",23,14);\r
-aWE("background",25,18);\r
-aWE("bar",23,25,21);\r
-aWE("bas",3,10,2,24,14,17);\r
-aWE("bash",14);\r
-aWE("basi",3,24,25);\r
-aWE("basic",3,11,16,14,26);\r
-aWE("batch",3,0,15,14);\r
-aWE("be",1,14);\r
-aWE("becom",6,25,14);\r
-aWE("befor",14);\r
-aWE("begin",14,18,22);\r
-aWE("behav",3);\r
-aWE("behavior",10,14);\r
-aWE("behaviour",25);\r
-aWE("below",12,25,14);\r
-aWE("bet",25);\r
-aWE("bicolor",25);\r
-aWE("big",25);\r
-aWE("bin",15,14,19);\r
-aWE("binari",14);\r
-aWE("binary",17);\r
-aWE("blu",14);\r
-aWE("blur",3);\r
-aWE("bmp",24,28);\r
-aWE("bold",14);\r
-aWE("book",20);\r
-aWE("boost",14);\r
-aWE("boost_version",14);\r
-aWE("boostdir",14);\r
-aWE("border",23,16);\r
-aWE("both",2,23,25,14);\r
-aWE("bottom",10,23,25,14,18);\r
-aWE("bound",24,28);\r
-aWE("boundari",1);\r
-aWE("box",0,1,8,23,24,13,25,14,17,26,18,27,19,22,28);\r
-aWE("bracket",14);\r
-aWE("break",14);\r
-aWE("brep",10);\r
-aWE("brief",6,12);\r
-aWE("bring",2);\r
-aWE("brows",4,5,6,0,2,13,25,16,14,17,18,19,21);\r
-aWE("build",25,14,19);\r
-aWE("built",11,25,14);\r
-aWE("button",2,12,24,13,25,14,17,26,18,27,19,22,28);\r
-aWE("button_label",14);\r
-aWE("button_script",14);\r
-aWE("button_tooltip",14);\r
-aWE("c",3,15,14);\r
-aWE("ca",10);\r
-aWE("cad",10,11);\r
-aWE("cal",3,0,14);\r
-aWE("calculation",9,10,11);\r
-aWE("call",14,17,19,22);\r
-aWE("cam",3);\r
-aWE("camera",25);\r
-aWE("cancel",14);\r
-aWE("capability",19);\r
-aWE("caption",14);\r
-aWE("car",10);\r
-aWE("careful",14);\r
-aWE("carri",23);\r
-aWE("carry",10);\r
-aWE("cas",3,8,11,25,16,14,17);\r
-aWE("cascad",24,14);\r
-aWE("casroot",14);\r
-aWE("catalog",19);\r
-aWE("catalogmodulegeneral",19);\r
-aWE("catalogmodulepersonnel",19);\r
-aWE("catalogu",2,15);\r
-aWE("categori",20);\r
-aWE("cd",14);\r
-aWE("cel",25,26);\r
-aWE("cent",24,28);\r
-aWE("center",25);\r
-aWE("centr",25);\r
-aWE("central",25);\r
-aWE("centraliz",15);\r
-aWE("chang",3,6,8,23,24,25,16,14,17,18,27,28);\r
-aWE("channel",25);\r
-aWE("chapter",4);\r
-aWE("character",26);\r
-aWE("charg",14);\r
-aWE("check",0,25,16,14,18,28);\r
-aWE("check_enabl",14);\r
-aWE("check_version",14);\r
-aWE("checkbox",23,25,14,18);\r
-aWE("choic",0,25,14,26);\r
-aWE("choos",5,7,1,8,23,24,13,25,16,14,26,19,22,28);\r
-aWE("chosen",25,26,19);\r
-aWE("clamp",25);\r
-aWE("classic",16);\r
-aWE("clean",25);\r
-aWE("clear",14);\r
-aWE("clearall",16);\r
-aWE("click",5,6,0,7,1,8,23,12,24,13,25,16,14,17,26,18,27,19,20,21,22,28);\r
-aWE("clickabl",12);\r
-aWE("client",3);\r
-aWE("clip",24,25);\r
-aWE("clon",24);\r
-aWE("clos",3,12,25,14,17,27,20);\r
-aWE("cluster",3);\r
-aWE("cod",3,14);\r
-aWE("coef",23);\r
-aWE("coincid",14);\r
-aWE("collect",14);\r
-aWE("color",1,23,25,26,18,28);\r
-aWE("column",18,21,22);\r
-aWE("combin",11,25);\r
-aWE("comfortabl",16);\r
-aWE("comma",14);\r
-aWE("command",3,0,15,14);\r
-aWE("common",2,11,16,14,17,27);\r
-aWE("compar",3,23);\r
-aWE("compil",14);\r
-aWE("complet",8,14,20,22);\r
-aWE("complex",3,10);\r
-aWE("component",3,4,0,7,10,2,11,12,13,25,16,17,18,19,21,22);\r
-aWE("compos",25);\r
-aWE("comput",14,18);\r
-aWE("computation",3,10);\r
-aWE("computational",10);\r
-aWE("concept",3,12);\r
-aWE("concern",10,14);\r
-aWE("conclusion",3);\r
-aWE("config",14);\r
-aWE("config_fil",14);\r
-aWE("config_mandrake_10",14);\r
-aWE("configur",10,14);\r
-aWE("configurabl",11);\r
-aWE("configuration",14);\r
-aWE("confirm",0,14);\r
-aWE("confirmation",14);\r
-aWE("conflict",14);\r
-aWE("connect",9,11,13,16,18);\r
-aWE("consist",16);\r
-aWE("consol",6,10,15,16,14,17,18);\r
-aWE("constant",3,15);\r
-aWE("construction",10,11,24);\r
-aWE("consum",0,14);\r
-aWE("contain",3,4,5,0,8,13,15,16,14,27,19,20,21,22);\r
-aWE("container",15);\r
-aWE("content",0,24,25,14,20,28);\r
-aWE("context",16,14,21);\r
-aWE("continu",14);\r
-aWE("control",5,23,25);\r
-aWE("convert",0,14);\r
-aWE("cooperat",11);\r
-aWE("coordinat",24,18,28);\r
-aWE("copi",25);\r
-aWE("copy",7,16,14,17);\r
-aWE("copyright",14);\r
-aWE("corba",3,5,2,15);\r
-aWE("corn",25,17,26);\r
-aWE("correct",16);\r
-aWE("correspond",23,13,25,15,14,20);\r
-aWE("cost",10);\r
-aWE("coupl",3,10);\r
-aWE("cpp",15);\r
-aWE("cppcontain",15);\r
-aWE("creat",3,4,5,6,0,9,10,2,11,23,24,13,25,15,16,14,17,18,19,21);\r
-aWE("creation",3,2,25,14);\r
-aWE("cros",12,24,17);\r
-aWE("csh",15,14);\r
-aWE("cshell",15);\r
-aWE("ctrl",25);\r
-aWE("current",6,0,8,12,24,25,15,14,17,18,27,21,22);\r
-aWE("cursor",25);\r
-aWE("curv",25,18);\r
-aWE("custom",10,15,26,18,19);\r
-aWE("customiz",14);\r
-aWE("customization",3,14);\r
-aWE("cut",25);\r
-aWE("cutlin",25);\r
-aWE("cycl",25);\r
-aWE("cyrillic",26);\r
-aWE("d",14);\r
-aWE("dat",8,22);\r
-aWE("data",3,5,0,9,10,2,11,25,17,18,19);\r
-aWE("databas",3);\r
-aWE("debug",21);\r
-aWE("decreas",25);\r
-aWE("default",5,1,23,24,25,15,16,14,17,18,27,21,28);\r
-aWE("defin",3,0,1,10,23,24,25,14,26,28);\r
-aWE("definit",3,5,7,15,16,21,22);\r
-aWE("definition",3,1,10,20);\r
-aWE("deform",28);\r
-aWE("delay",10);\r
-aWE("delet",17);\r
-aWE("demand",10,2,25);\r
-aWE("depend",7,25,14,21);\r
-aWE("dependanci",14);\r
-aWE("dependenci",14);\r
-aWE("deriv",3);\r
-aWE("describ",3,4,14,19);\r
-aWE("description",15,14,19);\r
-aWE("design",10,25);\r
-aWE("desir",19);\r
-aWE("desktop",6,9,2,16,14,17);\r
-aWE("destin",9,16,21,22);\r
-aWE("destination",12,14);\r
-aWE("detail",14,18);\r
-aWE("develop",3,24,14);\r
-aWE("development",3,10);\r
-aWE("devic",25);\r
-aWE("diagram",23);\r
-aWE("dialog",0,1,8,23,13,25,16,14,17,26,18,27,19,22);\r
-aWE("dif",14);\r
-aWE("differ",16);\r
-aWE("differenc",3,16,14,17);\r
-aWE("different",3,4,5,9,13,25,15,16,14,17,21);\r
-aWE("digit",23);\r
-aWE("digital",10);\r
-aWE("dir",14);\r
-aWE("direct",14);\r
-aWE("direction",6,24,25);\r
-aWE("directori",14,18);\r
-aWE("directory",15,14,17,18,27,19);\r
-aWE("disabl",25,15,14);\r
-aWE("disable_flag",14);\r
-aWE("disk",15,14);\r
-aWE("display",6,1,23,12,24,25,15,16,14,17,18,20,21,22,28);\r
-aWE("distanc",25,28);\r
-aWE("distinction",3);\r
-aWE("distribut",3);\r
-aWE("distribution",14);\r
-aWE("divid",4,25,22);\r
-aWE("do",7,14);\r
-aWE("dockabl",6,2,16,17);\r
-aWE("document",5,0,9,16,14);\r
-aWE("doesn",24);\r
-aWE("domain",3,11);\r
-aWE("dominant",25);\r
-aWE("don",24,25,14,19,28);\r
-aWE("dot",14);\r
-aWE("doubl",22);\r
-aWE("down",8,12);\r
-aWE("downward",24,28);\r
-aWE("doxygen",14);\r
-aWE("drag",24,16,28);\r
-aWE("dramatical",3);\r
-aWE("drawn",24,28);\r
-aWE("driv",14);\r
-aWE("drop",12,16);\r
-aWE("dump",0,24,28);\r
-aWE("dumpversion",14);\r
-aWE("duplicat",24);\r
-aWE("dynamic",2);\r
-aWE("dynamical",11,25);\r
-aWE("e",2,15,16,14,17);\r
-aWE("easi",3,10);\r
-aWE("easy",3);\r
-aWE("economical",3);\r
-aWE("edg",1,23);\r
-aWE("edit",7,8,2,25,15,14);\r
-aWE("editabl",25);\r
-aWE("edition",25);\r
-aWE("editor",27);\r
-aWE("efficient",10);\r
-aWE("eith",25,14,26,18,19);\r
-aWE("electrical",10);\r
-aWE("electronic",10);\r
-aWE("element",10,23,25);\r
-aWE("embed",15);\r
-aWE("empty",6);\r
-aWE("enabl",14,18,20);\r
-aWE("encourag",3);\r
-aWE("end",3,25,14,18,27);\r
-aWE("enforc",3);\r
-aWE("engin",3);\r
-aWE("enough",14);\r
-aWE("ensur",3,10);\r
-aWE("ent",8,15,14,17);\r
-aWE("enter",14);\r
-aWE("entity",23);\r
-aWE("entry",18,21);\r
-aWE("env_",14);\r
-aWE("env_build",14);\r
-aWE("env_for_launch",14);\r
-aWE("env_product",14);\r
-aWE("env_vtk",14);\r
-aWE("environment",3,6,9,10,2,15,14);\r
-aWE("environmentpleas",14);\r
-aWE("equal",3,14);\r
-aWE("equipment",10);\r
-aWE("error",0,14);\r
-aWE("etc",3,2,11,25,16,14);\r
-aWE("ev",22);\r
-aWE("even",3,16,14);\r
-aWE("every",10,25,20);\r
-aWE("everyth",14);\r
-aWE("evolution",10);\r
-aWE("evolv",3);\r
-aWE("ex",15);\r
-aWE("exact",25,14);\r
-aWE("examl",14);\r
-aWE("exampl",6,10,16,14,17,19);\r
-aWE("exceed",25);\r
-aWE("except",14,28);\r
-aWE("exception",2,15,14);\r
-aWE("exchang",3);\r
-aWE("execut",14);\r
-aWE("executabl",14);\r
-aWE("execution",10,11);\r
-aWE("exist",3,11,13,14,17,27,19);\r
-aWE("existenc",14);\r
-aWE("expand",12);\r
-aWE("expandability",3);\r
-aWE("expectation",10);\r
-aWE("experienc",14);\r
-aWE("expert",0);\r
-aWE("exploit",3);\r
-aWE("explor",4);\r
-aWE("export",10,23,24,28);\r
-aWE("expos",3);\r
-aWE("extend",24,26,28);\r
-aWE("extension",17,27);\r
-aWE("external",14,18);\r
-aWE("extract",14);\r
-aWE("extreme",10);\r
-aWE("f",15,14);\r
-aWE("fac",23,25,18);\r
-aWE("facilitat",3,11);\r
-aWE("fact",16);\r
-aWE("factory",19);\r
-aWE("fail",14);\r
-aWE("fals",14);\r
-aWE("famili",25);\r
-aWE("featur",4,25,14);\r
-aWE("feel",14);\r
-aWE("field",8,10,23,25,14,26);\r
-aWE("fig",14);\r
-aWE("figur",1,14);\r
-aWE("fil",5,0,8,11,13,25,15,16,14,17,18,27,19);\r
-aWE("fill",23);\r
-aWE("final",14);\r
-aWE("find",14,19,20);\r
-aWE("find_in_path",14);\r
-aWE("fine",3);\r
-aWE("finish",12,25,14);\r
-aWE("finit",10);\r
-aWE("first",0,25,14,18,21);\r
-aWE("fit",24,18,28);\r
-aWE("flag",14);\r
-aWE("flexibility",3,0);\r
-aWE("flexibl",10,2,14);\r
-aWE("focal",25);\r
-aWE("focu",12);\r
-aWE("fold",14,17,21);\r
-aWE("folder",14);\r
-aWE("follow",3,0,8,9,12,13,15,16,14,17,18,27,19,20,22);\r
-aWE("font",23,25,14,26,18,28);\r
-aWE("forc",14);\r
-aWE("forget",19);\r
-aWE("formal",14);\r
-aWE("format",4,10,24,13,18,28);\r
-aWE("forth",25);\r
-aWE("fp",25);\r
-aWE("fram",24,25,14,28);\r
-aWE("framework",2);\r
-aWE("fre",1,10,25);\r
-aWE("friend",10);\r
-aWE("ful",25);\r
-aWE("fulfill",0);\r
-aWE("full",25,20);\r
-aWE("function",0,10,11,16,14,17);\r
-aWE("function_nam",14);\r
-aWE("functional",16);\r
-aWE("functionaliti",10,24,28);\r
-aWE("functionality",3,4,7,9,24,16,19,28);\r
-aWE("fundamental",3);\r
-aWE("furth",14);\r
-aWE("g",15,14);\r
-aWE("gap",23);\r
-aWE("gaus",2,25,28);\r
-aWE("gcc",14);\r
-aWE("general",9,23,16,14,18);\r
-aWE("generat",0,11,25,14,19);\r
-aWE("generator",10,2,19);\r
-aWE("generic",10,11);\r
-aWE("geom",11,14);\r
-aWE("geometrical",1,10,11,24,25);\r
-aWE("geometry",3,1,11,24,25,16);\r
-aWE("get",4,9,10,14,21);\r
-aWE("giv",0,8,16,14,26);\r
-aWE("given",11,25,14);\r
-aWE("gl",25);\r
-aWE("global",24,25,28);\r
-aWE("glossary",20);\r
-aWE("go",12,14);\r
-aWE("good",24);\r
-aWE("graduat",28);\r
-aWE("graph",6,11,18);\r
-aWE("graphic",25);\r
-aWE("graphical",0,2);\r
-aWE("graphviz",14);\r
-aWE("great",0,24,25,28);\r
-aWE("greek",26);\r
-aWE("group",23,24,25,26);\r
-aWE("gui",3,5,0,2,11,15,14,17,18,27);\r
-aWE("guid",14);\r
-aWE("h",15,14);\r
-aWE("half",25);\r
-aWE("hand",3,12,20);\r
-aWE("handl",10,2,15);\r
-aWE("hard",15,14);\r
-aWE("hasn",17);\r
-aWE("hav",11,12,21);\r
-aWE("haven",18);\r
-aWE("hdf",13,14,17,18);\r
-aWE("hdf5",14);\r
-aWE("hdf5hom",14);\r
-aWE("heal",10);\r
-aWE("height",23,25);\r
-aWE("hello",22);\r
-aWE("help",3,4,10,12,13,15,14,18,20,21);\r
-aWE("helpful",14);\r
-aWE("her",23,25,14,18);\r
-aWE("heterogeneou",10);\r
-aWE("hid",24,25,16,18,21,28);\r
-aWE("high",10);\r
-aWE("highlight",23,14,21);\r
-aWE("history",22);\r
-aWE("hom",14,27);\r
-aWE("hop",14);\r
-aWE("horizontal",6,23,25,18);\r
-aWE("host",3);\r
-aWE("hotspot",12);\r
-aWE("hour",14);\r
-aWE("how",3,14);\r
-aWE("hpp",14);\r
-aWE("html",4,20);\r
-aWE("hxx",14);\r
-aWE("i",2,15,16,17);\r
-aWE("icon",5,7,16,19);\r
-aWE("idea",14);\r
-aWE("identification",21,22);\r
-aWE("identify",14);\r
-aWE("idl",3,19);\r
-aWE("ie",18);\r
-aWE("if",5,6,0,7,23,24,13,25,15,16,14,17,18,19,21,28);\r
-aWE("ig",10);\r
-aWE("ignor",14);\r
-aWE("imag",10,24,25,28);\r
-aWE("immediate",12);\r
-aWE("implement",3,14);\r
-aWE("implementation",3,14,19);\r
-aWE("import",0,10,2,11,25,16,14,27);\r
-aWE("important",14);\r
-aWE("impos",25);\r
-aWE("improv",2,14);\r
-aWE("includ",12,25,14,20);\r
-aWE("inclusiv",3);\r
-aWE("increas",0,10,25);\r
-aWE("increment",1,25);\r
-aWE("incremental",3);\r
-aWE("independenc",3);\r
-aWE("independent",3);\r
-aWE("index",23,21);\r
-aWE("indicat",16,17);\r
-aWE("information",3,8,12,25,14,17,20,22);\r
-aWE("initial",9);\r
-aWE("input",10,19);\r
-aWE("insid",3,6,12,25,19);\r
-aWE("inspect",25,14);\r
-aWE("instal",14,19);\r
-aWE("instalation",14);\r
-aWE("install",15,14);\r
-aWE("install_binary",14);\r
-aWE("install_disk_spac",14);\r
-aWE("install_sourc",14);\r
-aWE("install_source_and_build",14);\r
-aWE("install_wizard_caption",14);\r
-aWE("install_wizard_copyright",14);\r
-aWE("install_wizard_license_info",14);\r
-aWE("install_wizard_root_directory",14);\r
-aWE("install_wizard_version",14);\r
-aWE("installation",15,14);\r
-aWE("installation_mod",14);\r
-aWE("installation_script_nam",14);\r
-aWE("installdiskspac",14);\r
-aWE("installwizard_root_directory",14);\r
-aWE("installworkxxxxx",14);\r
-aWE("instanc",5);\r
-aWE("instruction",14);\r
-aWE("instrumental",3);\r
-aWE("integ",14);\r
-aWE("integer",23);\r
-aWE("integrat",3,10,2,11);\r
-aWE("integration",3,10,2,19);\r
-aWE("interaction",2);\r
-aWE("interfac",3,0,10,2,16,19);\r
-aWE("interior",23);\r
-aWE("internal",3,14);\r
-aWE("internet",4);\r
-aWE("interoperability",10);\r
-aWE("interoperabl",21);\r
-aWE("interp",15);\r
-aWE("interpret",2,16);\r
-aWE("interval",25,22);\r
-aWE("introduction",10,2,11,14);\r
-aWE("invalid",17);\r
-aWE("invert",24,25);\r
-aWE("invok",16,14);\r
-aWE("ior",18,21);\r
-aWE("isolat",1);\r
-aWE("isolin",1,18);\r
-aWE("isometric",24,28);\r
-aWE("item",8,10,2);\r
-aWE("iteration",25);\r
-aWE("itself",14);\r
-aWE("java",4);\r
-aWE("jpeg",24,28);\r
-aWE("jpg",24,28);\r
-aWE("just",14,18);\r
-aWE("k",15);\r
-aWE("kbyt",14);\r
-aWE("kernel",11,15,14);\r
-aWE("key",25,14);\r
-aWE("keyboard",25);\r
-aWE("kill",15);\r
-aWE("killall",15);\r
-aWE("kind",8,12);\r
-aWE("know",19);\r
-aWE("knowledg",0);\r
-aWE("l",15);\r
-aWE("label",23,25,14,28);\r
-aWE("languag",3);\r
-aWE("larg",14);\r
-aWE("largest",25);\r
-aWE("last",14,18,22);\r
-aWE("latest",25);\r
-aWE("latin",26);\r
-aWE("launch",4,0,13,15,14,27,19,22);\r
-aWE("lay",5);\r
-aWE("layout",0,17);\r
-aWE("ld_library_path",14);\r
-aWE("lead",17);\r
-aWE("learn",10,14);\r
-aWE("left",23,24,25,14,26,18,20,28);\r
-aWE("legend",18);\r
-aWE("length",25,28);\r
-aWE("les",25);\r
-aWE("level",3,23,25);\r
-aWE("lib",14);\r
-aWE("libcosnotify4",14);\r
-aWE("libhdf5",14);\r
-aWE("libm",14);\r
-aWE("libomniorb4",14);\r
-aWE("librari",14);\r
-aWE("library",2,14);\r
-aWE("libvtkcommon",14);\r
-aWE("licens",14);\r
-aWE("lik",3,6,12,25,16,14,17,19,21);\r
-aWE("like",14);\r
-aWE("limit",25);\r
-aWE("limitation",25);\r
-aWE("lin",4,1,23,25,15,14,18);\r
-aWE("linear",18);\r
-aWE("link",3,10,12);\r
-aWE("linux",4,14);\r
-aWE("list",8,12,25,15,14,18,20,22);\r
-aWE("list_of_prerequisit",14);\r
-aWE("ll",24,18,28);\r
-aWE("load",3,0,2,13,25,15,16,18,27,21);\r
-aWE("local",25);\r
-aWE("locat",3,24,25,15,16,18,20,21,28);\r
-aWE("location",0,19);\r
-aWE("lock",8,24,25,28);\r
-aWE("log",15,14);\r
-aWE("logarithmic",25,18);\r
-aWE("long",3,14);\r
-aWE("look",14,19,20);\r
-aWE("lookout",23,25);\r
-aWE("lost",17);\r
-aWE("lot",16);\r
-aWE("low",25,14,26,20);\r
-aWE("m",15);\r
-aWE("machin",3,17,22);\r
-aWE("macintosh",4);\r
-aWE("macro",3,14);\r
-aWE("magnification",25);\r
-aWE("main",5,0,7,8,10,13,25,16,14,17,18,19,22);\r
-aWE("major",14);\r
-aWE("mak",5,10,23,14);\r
-aWE("make_dir",14);\r
-aWE("make_env",14);\r
-aWE("manag",10,18);\r
-aWE("management",10,2,16);\r
-aWE("mandrak",14);\r
-aWE("mandrake10",14);\r
-aWE("manipulat",25);\r
-aWE("manipulator",25);\r
-aWE("manual",4,0,24,14,18,28);\r
-aWE("map",3);\r
-aWE("mark",24,25,14,18,28);\r
-aWE("marker",18);\r
-aWE("market",10);\r
-aWE("massive",3);\r
-aWE("mast",14);\r
-aWE("match",20);\r
-aWE("matrix",25);\r
-aWE("max",25);\r
-aWE("maximiz",5);\r
-aWE("maximum",25);\r
-aWE("mean",6,9,25,16,14,17);\r
-aWE("mechanism",0,2,15);\r
-aWE("med2hom",14);\r
-aWE("meet",10);\r
-aWE("memoris",24);\r
-aWE("memory",25);\r
-aWE("mention",14);\r
-aWE("menu",3,5,0,7,8,2,23,12,13,25,16,17,26,18,27,19,21,22);\r
-aWE("menubar",16);\r
-aWE("mesh",3,10,11,23,24,25,16,14,28);\r
-aWE("messag",8,2,15,14);\r
-aWE("min",25);\r
-aWE("minimiz",5);\r
-aWE("minimum",25);\r
-aWE("minor",14);\r
-aWE("mistak",16);\r
-aWE("mix",16);\r
-aWE("mod",3,0,1,23,25,15,14);\r
-aWE("model",3,10,11,23);\r
-aWE("modern",10);\r
-aWE("modifi",14);\r
-aWE("modification",3,0,8);\r
-aWE("modify",0,10,14);\r
-aWE("modul",3,4,7,1,2,11,23,24,25,15,16,14,17,18,27,19,28);\r
-aWE("module1",15);\r
-aWE("module2",15);\r
-aWE("modulecatalog",15);\r
-aWE("modulu",25);\r
-aWE("moment",25,14);\r
-aWE("momentari",25);\r
-aWE("mous",23,24,25,16,28);\r
-aWE("mov",6);\r
-aWE("movement",25);\r
-aWE("mozilla",18);\r
-aWE("msg2qm",14);\r
-aWE("msg2qm_root",14);\r
-aWE("much",14);\r
-aWE("multi",6,9,10,2,16,19);\r
-aWE("multifil",17,18);\r
-aWE("multipl",17);\r
-aWE("multipli",25);\r
-aWE("multiti",3);\r
-aWE("must",3,10,11);\r
-aWE("n",25,15,14);\r
-aWE("nam",3,5,0,8,14,17,19,21,22,28);\r
-aWE("nativ",14);\r
-aWE("natur",7);\r
-aWE("natural",3);\r
-aWE("navigat",12,14);\r
-aWE("navigation",4,12,25);\r
-aWE("navigator",4);\r
-aWE("ne",6,12,14,26,18);\r
-aWE("necessary",0,23,15,16,14,17,21);\r
-aWE("need",25);\r
-aWE("negativ",25);\r
-aWE("netgen",14);\r
-aWE("netgenroot",14);\r
-aWE("netscap",4,18);\r
-aWE("new",3,5,8,9,10,24,25,14,17,18,27,19);\r
-aWE("next",8,15,14,27,19);\r
-aWE("nod",23,19);\r
-aWE("normal",6);\r
-aWE("not",15,14);\r
-aWE("notation",14);\r
-aWE("noticeab",3);\r
-aWE("notifd",14);\r
-aWE("notification",27);\r
-aWE("notify",25);\r
-aWE("notion",9);\r
-aWE("now",16);\r
-aWE("nth",25);\r
-aWE("null",25);\r
-aWE("numb",11,23,25,15,14,18,27,22,28);\r
-aWE("number",23,25,14);\r
-aWE("numeric",10,11,14,26);\r
-aWE("numerical",3,9,10);\r
-aWE("numerou",15);\r
-aWE("object",3,5,6,0,7,2,23,24,13,25,16,17,18,27,21,28);\r
-aWE("objectiv",3);\r
-aWE("obligatory",14);\r
-aWE("observ",25);\r
-aWE("occ",5,6,2,24,18);\r
-aWE("occ_version_maintenanc",14);\r
-aWE("occ_version_major",14);\r
-aWE("occ_version_minor",14);\r
-aWE("occupi",14);\r
-aWE("occur",14);\r
-aWE("off",14);\r
-aWE("offer",3);\r
-aWE("offic",14);\r
-aWE("official",14);\r
-aWE("offset",28);\r
-aWE("often",10);\r
-aWE("ok",13,14,27);\r
-aWE("omg",3);\r
-aWE("omninotify",14);\r
-aWE("omniorb",14);\r
-aWE("omniorbdir",14);\r
-aWE("omniorbpy",14);\r
-aWE("on",3,6,0,7,2,12,13,25,15,16,14,17,26,18,27,19);\r
-aWE("onc",25);\r
-aWE("onlin",20);\r
-aWE("opaqu",25);\r
-aWE("open",6,0,9,10,11,12,24,13,25,15,14,17,19,20);\r
-aWE("operat",0);\r
-aWE("operation",7,9,23,25,14,17);\r
-aWE("optimiz",10,25,14);\r
-aWE("optimization",11);\r
-aWE("option",7,8,13,25,15,16,14,17,18,21);\r
-aWE("optional",10,11,14);\r
-aWE("ord",14);\r
-aWE("ordinat",23,25);\r
-aWE("org",3);\r
-aWE("orientat",24,28);\r
-aWE("orientation",23,24,25);\r
-aWE("origin",23,24,25,28);\r
-aWE("original",0);\r
-aWE("originality",11);\r
-aWE("os",14);\r
-aWE("os_version",14);\r
-aWE("other",4,0);\r
-aWE("otherwis",0,25,14,17);\r
-aWE("out",10,23,24,26,28);\r
-aWE("outlin",23);\r
-aWE("output",2,14);\r
-aWE("outsid",25,16);\r
-aWE("overrid",14);\r
-aWE("overridden",14);\r
-aWE("own",2,11,16,14);\r
-aWE("p",15);\r
-aWE("packag",15,14,19);\r
-aWE("pag",14,20);\r
-aWE("pan",12,24,17,20,28);\r
-aWE("parallel",3);\r
-aWE("paramet",14,19);\r
-aWE("parameter",3,25,26,18,19,28);\r
-aWE("parent",25);\r
-aWE("part",6,24,16,14,28);\r
-aWE("particular",10,17);\r
-aWE("party",11,14);\r
-aWE("past",7,16);\r
-aWE("patch",14);\r
-aWE("patent",25);\r
-aWE("path",25,14);\r
-aWE("pc",3);\r
-aWE("per",25);\r
-aWE("perform",10,11,23,24,25,14,28);\r
-aWE("performanc",3,9,10,25,14);\r
-aWE("period",25);\r
-aWE("permission",14);\r
-aWE("phenomena",3);\r
-aWE("phras",20);\r
-aWE("physic",10);\r
-aWE("physical",3,10,11);\r
-aWE("pick",25,14);\r
-aWE("pickup",14);\r
-aWE("pickup_env",14);\r
-aWE("pickup_env_flag",14);\r
-aWE("pickupenv",14);\r
-aWE("pictur",8);\r
-aWE("pid",22);\r
-aWE("piec",3);\r
-aWE("pixel",25);\r
-aWE("plac",6,2,24,16,14,28);\r
-aWE("placement",23,25);\r
-aWE("plan",24,14);\r
-aWE("platform",3,4,6,0,9,10,2,11,15,16,14,17,19,22);\r
-aWE("play",0);\r
-aWE("pleas",14);\r
-aWE("plot",6,2,25);\r
-aWE("plot2d",5,18);\r
-aWE("plug",2);\r
-aWE("png",24,28);\r
-aWE("po",14);\r
-aWE("point",3,1,2,23,24,25,14,18,28);\r
-aWE("pop",12,13,16,21);\r
-aWE("popup",12);\r
-aWE("port",15);\r
-aWE("portkill",15);\r
-aWE("position",24,25,16,17,18,28);\r
-aWE("positive",16);\r
-aWE("possibility",3,0,15,14,26,19);\r
-aWE("possibl",3,0,16,14,17,26,21);\r
-aWE("post",3,10,11,25,16,17,28);\r
-aWE("powerful",2);\r
-aWE("pr",10,11,14);\r
-aWE("precision",23);\r
-aWE("precompil",14);\r
-aWE("predefin",3,14,26);\r
-aWE("preferabl",15);\r
-aWE("preferenc",1,23,25,26,18,27,21);\r
-aWE("preinstal",14);\r
-aWE("prerequisit",14);\r
-aWE("pres",24,25,14,18,28);\r
-aWE("preselect",23);\r
-aWE("preselection",23);\r
-aWE("present",23,25);\r
-aWE("presentation",5,23,25,16,18,28);\r
-aWE("prevent",25);\r
-aWE("preview",24,25,26);\r
-aWE("previou",13,14);\r
-aWE("previous",11,13,25,14,17);\r
-aWE("primitiv",25);\r
-aWE("print",15,14);\r
-aWE("print_env",14);\r
-aWE("priority",10);\r
-aWE("pro",3,11,25,16,17,28);\r
-aWE("probab",5);\r
-aWE("problem",0,10,14);\r
-aWE("proce",9,14);\r
-aWE("procedur",15,14);\r
-aWE("proces",3,0,10,2,11,25,14,22);\r
-aWE("processor",3,10);\r
-aWE("produc",25);\r
-aWE("product",10,15,14);\r
-aWE("product_context",14);\r
-aWE("product_description",14);\r
-aWE("product_nam",14);\r
-aWE("product_script_nam",14);\r
-aWE("product_version",14);\r
-aWE("productivity",3,0);\r
-aWE("products_directory",14);\r
-aWE("profil",15);\r
-aWE("program",3,14);\r
-aWE("programmatic",10);\r
-aWE("progres",25,14);\r
-aWE("progressiv",25);\r
-aWE("prompt",15,14);\r
-aWE("pron",0);\r
-aWE("proper",14);\r
-aWE("properti",8,10,11,25,18,28);\r
-aWE("proportional",25);\r
-aWE("propos",2,14);\r
-aWE("provid",3,7,10,2,11,24,25,15,14,26,19,20,22);\r
-aWE("publish",0,17);\r
-aWE("pur",3);\r
-aWE("purpos",9,21);\r
-aWE("put",14);\r
-aWE("py",15,14);\r
-aWE("pycontain",15);\r
-aWE("pyqt",14);\r
-aWE("pyqtconfig",14);\r
-aWE("pyqtdir",14);\r
-aWE("pyramid",25);\r
-aWE("python",3,6,0,10,2,15,16,14,17,18);\r
-aWE("pythonhom",14);\r
-aWE("pythonpath",14);\r
-aWE("qglobal",14);\r
-aWE("qm",14);\r
-aWE("qt",14);\r
-aWE("qt_version_str",14);\r
-aWE("qtdir",14);\r
-aWE("quality",10,23,25);\r
-aWE("quantiti",10);\r
-aWE("quick",14,18,21);\r
-aWE("quit",0,14,17,27);\r
-aWE("quot",14);\r
-aWE("qwt",14);\r
-aWE("qwt_global",14);\r
-aWE("qwt_version_str",14);\r
-aWE("qwthom",14);\r
-aWE("r",15);\r
-aWE("radio",14);\r
-aWE("rainbow",25);\r
-aWE("rang",11,25);\r
-aWE("rapid",3);\r
-aWE("rat",25);\r
-aWE("rath",0);\r
-aWE("ratio",25);\r
-aWE("re",0,12,14);\r
-aWE("reactivity",10);\r
-aWE("read",10,12,14);\r
-aWE("readm",14);\r
-aWE("real",25);\r
-aWE("realiz",9);\r
-aWE("reason",14);\r
-aWE("reassign",25);\r
-aWE("receiv",27);\r
-aWE("recommend",25,14);\r
-aWE("record",8,25);\r
-aWE("red",14,21);\r
-aWE("redefin",28);\r
-aWE("redirect",15);\r
-aWE("reduc",10);\r
-aWE("ref",14,18,27);\r
-aWE("refer",14);\r
-aWE("referenc",4,12,25,18,21);\r
-aWE("refin",10,25);\r
-aWE("refresh",22);\r
-aWE("refreshment",22);\r
-aWE("regim",25);\r
-aWE("registry",2,15,22);\r
-aWE("reinstal",14);\r
-aWE("reinstall",14);\r
-aWE("reinstallation",14);\r
-aWE("relat",12,20);\r
-aWE("relativ",23,14,18);\r
-aWE("releas",14);\r
-aWE("release_not",14);\r
-aWE("relevant",12);\r
-aWE("reliability",10);\r
-aWE("reload",17);\r
-aWE("relocat",16);\r
-aWE("remain",3,24);\r
-aWE("remot",5,24,28);\r
-aWE("remov",24,25,14,18);\r
-aWE("renam",17);\r
-aWE("rend",25);\r
-aWE("render",25);\r
-aWE("reopen",18);\r
-aWE("repeat",25);\r
-aWE("represent",3,9,10,11,24,20,28);\r
-aWE("representation",6,11,24,25,18);\r
-aWE("representativ",25);\r
-aWE("requir",10,13,25,14,17);\r
-aWE("requirement",3,10,15);\r
-aWE("requisit",14);\r
-aWE("reset",24,14,28);\r
-aWE("resiz",24,18,28);\r
-aWE("resolution",25);\r
-aWE("resolv",0);\r
-aWE("resourc",2,25,15,14);\r
-aWE("respectiv",1,25,27);\r
-aWE("respective",25);\r
-aWE("respond",3);\r
-aWE("responsibl",14);\r
-aWE("rest",18);\r
-aWE("restart",14);\r
-aWE("restor",10,24,25,17,18,27,28);\r
-aWE("result",9,10,24,25);\r
-aWE("resum",14);\r
-aWE("retriev",14);\r
-aWE("retroactiv",27);\r
-aWE("return",24,14);\r
-aWE("reus",3);\r
-aWE("reusabl",10);\r
-aWE("reversib",0,25);\r
-aWE("right",6,12,13,25,16,14,17,26,18,20,21);\r
-aWE("risk",10);\r
-aWE("robustnes",10);\r
-aWE("rol",3);\r
-aWE("root",14);\r
-aWE("rotat",24,25,28);\r
-aWE("rotation",24,25,28);\r
-aWE("rul",14);\r
-aWE("run",3,15,14,19,22);\r
-aWE("runic",26);\r
-aWE("runinstall",14);\r
-aWE("runsalom",15,19);\r
-aWE("runsalomewithport",19);\r
-aWE("s",3,12,15,14);\r
-aWE("saf",2);\r
-aWE("salom",3,4,5,6,0,7,9,10,2,11,12,13,25,15,16,14,17,18,27,19,20,21,22);\r
-aWE("salome_",14);\r
-aWE("salome_modulecatalog_serv",19);\r
-aWE("salomeapp",15);\r
-aWE("salomeapprc",27);\r
-aWE("salomed",0);\r
-aWE("sam",6,12,25,16,14,17,19,22);\r
-aWE("sampl",14,26);\r
-aWE("sav",3,0,10,2,24,16,14,17,18,27);\r
-aWE("scal",3,25,18,28);\r
-aWE("scalar",23,25);\r
-aWE("scen",24,28);\r
-aWE("schem",3,10,14);\r
-aWE("schema",10);\r
-aWE("scientific",3);\r
-aWE("screen",6,15);\r
-aWE("script",3,0,15,14,26,19);\r
-aWE("scroll",8);\r
-aWE("se",6,8,24,13,14,17,18,19,21,28);\r
-aWE("search",4,13,14,17,20);\r
-aWE("second",0,25,14);\r
-aWE("section",24,16,14,18);\r
-aWE("seen",23);\r
-aWE("select",5,6,0,1,8,23,24,13,25,14,17,26,18,20,28);\r
-aWE("selectall",16);\r
-aWE("selection",2,23,25);\r
-aWE("send",14);\r
-aWE("sensitiv",16,21);\r
-aWE("separat",3,25,16,14);\r
-aWE("serv",3,19);\r
-aWE("server",3,15);\r
-aWE("servic",3,14,19);\r
-aWE("session",1,23,13,25,15,17,18,27,21,22);\r
-aWE("set",4,0,1,8,10,23,24,25,15,16,14,17,18,27,21,22,28);\r
-aWE("setting",25,16,14,17,18,27);\r
-aWE("sever",10);\r
-aWE("sh",14);\r
-aWE("shad",1,23,25);\r
-aWE("shap",24,25);\r
-aWE("shar",15);\r
-aWE("shel",14);\r
-aWE("shell",2,11,15,14);\r
-aWE("short",14,20);\r
-aWE("shot",6);\r
-aWE("should",9,14,17,19);\r
-aWE("show",24,25,14,28);\r
-aWE("shown",8,14);\r
-aWE("shrink",23);\r
-aWE("sid",23,25,14);\r
-aWE("signal",2,14);\r
-aWE("signatur",14);\r
-aWE("sigterm",14);\r
-aWE("silent",14);\r
-aWE("simp",14);\r
-aWE("simpl",3);\r
-aWE("simplify",14);\r
-aWE("simulat",3);\r
-aWE("simulation",10,11);\r
-aWE("simultaneous",6,9,25,14);\r
-aWE("sinc",2);\r
-aWE("singl",14);\r
-aWE("sip",14);\r
-aWE("sipdir",14);\r
-aWE("situation",3);\r
-aWE("siz",6,23,25,16,17,26,18);\r
-aWE("skip",14);\r
-aWE("slow",25);\r
-aWE("small",24,28);\r
-aWE("smallest",25);\r
-aWE("smooth",18);\r
-aWE("smoothnes",25);\r
-aWE("so",3,7,25,15,14,20,21);\r
-aWE("softwar",3,10,11);\r
-aWE("solution",10);\r
-aWE("solv",10);\r
-aWE("solver",10,11);\r
-aWE("someth",14);\r
-aWE("sort",18);\r
-aWE("sort_path",14);\r
-aWE("sourc",10,11,15,14);\r
-aWE("spac",23,25,14);\r
-aWE("spacemous",25);\r
-aWE("spe",25);\r
-aWE("special",3,13,25,15,16,14,17,18);\r
-aWE("specifi",3,25);\r
-aWE("specific",3,0,10,15,16,14,27,20);\r
-aWE("specification",11);\r
-aWE("specify",17,18,19);\r
-aWE("spher",25);\r
-aWE("spin",1);\r
-aWE("splash",15);\r
-aWE("splin",18);\r
-aWE("split",6);\r
-aWE("sprit",25);\r
-aWE("stamp",25);\r
-aWE("standalon",2,15);\r
-aWE("standard",3,5,2,13,25,16,14,17,27,19);\r
-aWE("standard_version",14);\r
-aWE("start",6,9,25,16,14,18,27,19,22);\r
-aWE("start_salom",14);\r
-aWE("stat",0,14,17,18);\r
-aWE("station",3);\r
-aWE("statu",14);\r
-aWE("step",1,10,25,14);\r
-aWE("stop",14);\r
-aWE("stor",3,0,13,14,17,18,19);\r
-aWE("str",14);\r
-aWE("stretch",28);\r
-aWE("strict",24,14,28);\r
-aWE("strong",14);\r
-aWE("struck",26);\r
-aWE("structur",3,10,2,13,25,14,21);\r
-aWE("structural",10);\r
-aWE("studi",5,6,7,9,10,2,13,16,17);\r
-aWE("study",3,5,6,0,7,8,9,10,2,13,25,15,16,17,18,27,19,21,22);\r
-aWE("study1",5);\r
-aWE("stuf",28);\r
-aWE("styl",26,18);\r
-aWE("sub",24,14,20);\r
-aWE("submenu",5,16,18);\r
-aWE("subsequent",14);\r
-aWE("subset",26);\r
-aWE("substitut",25);\r
-aWE("successful",14);\r
-aWE("suit",2);\r
-aWE("summariz",14);\r
-aWE("superposition",25);\r
-aWE("superv",15);\r
-aWE("supervcontain",15);\r
-aWE("supervision",2,15,19);\r
-aWE("supervisor",11,18,19);\r
-aWE("supplementary",21,22);\r
-aWE("suppli",14);\r
-aWE("support",10,14,19);\r
-aWE("supported_installation_mod",14);\r
-aWE("sur",14);\r
-aWE("surfac",23);\r
-aWE("sweep",25);\r
-aWE("swig",14);\r
-aWE("switch",6,2,25,14);\r
-aWE("symbol",14);\r
-aWE("system",3,4,10,12,25,14,20);\r
-aWE("t",7,24,25,15,16,14,17,18,19,28);\r
-aWE("tab",6,20,22);\r
-aWE("tabl",25,26);\r
-aWE("tag",14);\r
-aWE("tailor",10);\r
-aWE("tak",3,14);\r
-aWE("taken",25,15,14);\r
-aWE("target",14);\r
-aWE("target_directory",14);\r
-aWE("target_platform",14);\r
-aWE("targetdir",14);\r
-aWE("task",0);\r
-aWE("tcl",14);\r
-aWE("tcl_version",14);\r
-aWE("tclconfig",14);\r
-aWE("tclhom",14);\r
-aWE("technologi",3);\r
-aWE("technological",10);\r
-aWE("technology",3,24);\r
-aWE("temp_directory",14);\r
-aWE("temp_fold",14);\r
-aWE("tempdir",14);\r
-aWE("temporary",14);\r
-aWE("temporarydiskspac",14);\r
-aWE("tensor",25);\r
-aWE("term",10,12,20);\r
-aWE("terminal",15,14);\r
-aWE("test",3,14,19);\r
-aWE("text",12,14,20);\r
-aWE("textur",25);\r
-aWE("them",3,6,10,23,24,15,16,14,26,22,28);\r
-aWE("therefor",14);\r
-aWE("third",11);\r
-aWE("thos",14,18,20);\r
-aWE("thre",14);\r
-aWE("threshold",25);\r
-aWE("thu",3,0,14);\r
-aWE("tick",28);\r
-aWE("tim",3,6,0,8,10,25,15,14,17,27,19,22);\r
-aWE("tip",14);\r
-aWE("titl",23,25,14,18);\r
-aWE("tk",14);\r
-aWE("tk_version",14);\r
-aWE("tkconfig",14);\r
-aWE("tmp",14);\r
-aWE("tmp_disk_spac",14);\r
-aWE("toggl",23,25,21);\r
-aWE("toleranc",25);\r
-aWE("tool",3,2,11,16,14,19,22);\r
-aWE("toolbar",3,5,7,2,24,13,16,17,28);\r
-aWE("toolkit",2,14);\r
-aWE("tooltip",14);\r
-aWE("top",5,2,25,16,14,18);\r
-aWE("topic",4,12,20);\r
-aWE("topmost",14);\r
-aWE("total",14);\r
-aWE("totality",3);\r
-aWE("touch",0);\r
-aWE("train",10);\r
-aWE("transformation",24);\r
-aWE("translat",25);\r
-aWE("translation",25);\r
-aWE("transparency",25);\r
-aWE("transparent",25);\r
-aWE("tre",5,14,18,19,21);\r
-aWE("tri",14);\r
-aWE("triangl",24,28);\r
-aWE("trihedron",24,18,28);\r
-aWE("trolltech",14);\r
-aWE("troubl",14);\r
-aWE("tru",14);\r
-aWE("try",8,14,17,19);\r
-aWE("try_exist",14);\r
-aWE("try_nativ",14);\r
-aWE("try_preinstal",14);\r
-aWE("turn",14);\r
-aWE("twic",25);\r
-aWE("two",6,12,25,14,17,19);\r
-aWE("typ",0,23,25,14,26,18,19);\r
-aWE("typical",19);\r
-aWE("u",18);\r
-aWE("ultimat",3);\r
-aWE("uncheck",24,25,16,28);\r
-aWE("underlin",26);\r
-aWE("unfortunare",14);\r
-aWE("unfortunate",14);\r
-aWE("uniqu",14);\r
-aWE("unit",25);\r
-aWE("unix",4);\r
-aWE("unload",13,17);\r
-aWE("unnecessary",14);\r
-aWE("unpack",14);\r
-aWE("unselect",14);\r
-aWE("unus",0);\r
-aWE("up",10,12,13,16,14,17,26,21);\r
-aWE("updat",23,25,16,17,19);\r
-aWE("upload",2,16);\r
-aWE("us",3,0,1,8,9,10,2,11,23,24,25,15,16,14,17,26,18,27,19,20,21,22,28);\r
-aWE("usability",2);\r
-aWE("usag",25,14);\r
-aWE("user",8,19);\r
-aWE("usr",14);\r
-aWE("usual",14);\r
-aWE("utiliti",4);\r
-aWE("v",14,18);\r
-aWE("valid",18);\r
-aWE("validation",3);\r
-aWE("valu",1,23,25,14,18,21);\r
-aWE("variabl",15,14);\r
-aWE("variety",4,12);\r
-aWE("variou",11,14);\r
-aWE("ve",14,18);\r
-aWE("vector",1,25);\r
-aWE("version",6,2,16,14,27,19);\r
-aWE("vertic",1);\r
-aWE("vertical",6,23,25,18);\r
-aWE("very",10,2,25,16,14);\r
-aWE("via",24,14,28);\r
-aWE("view",3,5,8,2,23,12,24,25,16,14,18,20,22,28);\r
-aWE("viewer",5,6,2,11,16,17,18);\r
-aWE("visibl",24,28);\r
-aWE("visual",11);\r
-aWE("visualisation",1,25);\r
-aWE("visualiz",10,24,25,28);\r
-aWE("visualization",9,10,2,11,16);\r
-aWE("vtk",5,6,2,14,18,28);\r
-aWE("vtkhom",14);\r
-aWE("wait",14);\r
-aWE("want",6,12,14);\r
-aWE("warn",8,25,14);\r
-aWE("way",11,14,19);\r
-aWE("web",4);\r
-aWE("welcom",4,10);\r
-aWE("what",3,10,12,14,27,21);\r
-aWE("whenev",23,18);\r
-aWE("wherev",6);\r
-aWE("whil",3);\r
-aWE("whol",25,18,27);\r
-aWE("whos",23);\r
-aWE("why",14);\r
-aWE("wid",4,11,26);\r
-aWE("widget",11);\r
-aWE("width",23,25);\r
-aWE("will",4,5,0,8,23,24,13,25,15,16,14,17,26,18,27,19,21,22);\r
-aWE("window",4,5,6,9,2,12,25,15,16,14,17,26,18,22);\r
-aWE("wir",1);\r
-aWE("wirefram",1,23);\r
-aWE("wish",6,24,14,28);\r
-aWE("within",3,5,7,22);\r
-aWE("without",3,0,25,15,14,27);\r
-aWE("wizard",14);\r
-aWE("won",7,15);\r
-aWE("word",20);\r
-aWE("work",3,6,0,9,11,24,25,16,14,17);\r
-aWE("would",16,17,19);\r
-aWE("writ",10,14,17);\r
-aWE("written",3,17);\r
-aWE("wrong",14);\r
-aWE("www",3);\r
-aWE("x",23,25,15);\r
-aWE("xml",15,14,19);\r
-aWE("xterm",15);\r
-aWE("xxxxx",14);\r
-aWE("xy",25);\r
-aWE("y",23,25);\r
-aWE("year",10);\r
-aWE("yes",8,14);\r
-aWE("yet",14,18);\r
-aWE("your",5,6,0,7,8,23,25,15,14,17,18,27,19);\r
-aWE("yourselv",26);\r
-aWE("z",15);\r
-aWE("zon",5,6,25);\r
-aWE("zoom",24,25,17,28);\r
-\r
-//-->\r
-</script>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/whdata/whgdata.js b/doc/salome/gui/GUI/whdata/whgdata.js
deleted file mode 100755 (executable)
index 77e0107..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//     WebHelp 5.10.001\r
-var gIEA = new Array();\r
-function aGE(sName, sDef)\r
-{\r
-       var len = gIEA.length;\r
-       gIEA[len] = new gloEntry(sName, sDef);\r
-}\r
-\r
-function gloEntry(sName, sDef) \r
-{\r
-       this.sName = sName;\r
-       this.sDef = sDef;\r
-       this.nNKOff = 0;\r
-}\r
-\r
-function window_OnLoad()\r
-{\r
-       if (parent && parent != this) {\r
-               if (parent.putData) \r
-               {\r
-                       parent.putData(gIEA);\r
-               }\r
-       }\r
-}\r
-\r
-window.onload = window_OnLoad;
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whdata/whgdata0.htm b/doc/salome/gui/GUI/whdata/whgdata0.htm
deleted file mode 100755 (executable)
index 9d256b1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<html>\r
-<head>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<body>\r
-<script language="javascript" src="whgdata.js"></script>\r
-<script language="javascript">\r
-<!--\r
- aGE("Cell","Element of a mesh. Cells are determined by their connectivity. They can have 0,1,2 or 3 dimension.");\r
- aGE("Component","One integer or real value can correspond to each component of a field and to each entity of a mesh");\r
- aGE("Descendant connectivity","It is a description of the entities of the mesh with dimension N. This description is made by an ordered list of geometrical entities (nodes, edges, or faces) with dimension N-1.");\r
- aGE("Edge","An edge of a volumetric or surface mesh. It is composed of 2 or 3 nodes (2 vertex nodes and optionally one middle node).");\r
- aGE("Entity of a mesh","Geometrical component of the mesh: node, cell, face and edge. Faces and edges are only intermediate entities allowing to define the cells in descendant connectivity.");\r
- aGE("Equivalence","Equivalence represents a list of correspondance 2 by 2 of the entities of the same dimension.");\r
- aGE("Face","Face of a volumetrical cell (triangle, quadrangle).");\r
- aGE("Family","Entities of a mesh are described by a certain number   of characteristics (boundary conditions, groups membership). Families represent classes equivalent to these characteristics (two entities of a mesh can belong to the same family if they have the same characteristics). Every family is determined by a set of attributes and a list of groups membership.");\r
- aGE("Field","Field consists of one or several scalar components. One definite type is associated to the given field and the values corresponding to different components are all of the same type.");\r
- aGE("Field profile","Fields can be defined only on one part of the mesh. Profile   of the field or profile of the component of a field indicates which entities of the mesh contain values.");\r
- aGE("Group","Unordered set of entities of a mesh. One entity can belong to   several groups.");\r
- aGE("Mesh","Mesh is described by its geometry: list of nodes and list of cells which constitute this mesh. Supplementary information is added with the help of families (initial, boundary conditions).");\r
- aGE("Nodal connectivity","It is a description of an entity of the mesh by an ordered list of nodes constituting this entity.");\r
- aGE("Node","Node can be an isolated node of a mesh, a vertex or middle node of an edge. A node is associated to a point.");\r
- aGE("Point","Geometrical entity determined by its coordinates in the space.");\r
- aGE("Reference connectivity","For each type of entity of a mesh, reference connectivity define the topology of an entity.");\r
- aGE("Result","List of fields referring to one mesh.");\r
- aGE("Study","Study represents a chain of sequences of calculations.");\r
-\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/whdata/whglo.htm b/doc/salome/gui/GUI/whdata/whglo.htm
deleted file mode 100755 (executable)
index dc5a677..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<html>\r
-<head>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<body>\r
-<script language="javascript" src="whglo.js"></script>\r
-<script language="javascript">\r
-<!--\r
-iFM("Cell","Study","whgdata0.htm",18);\r
-\r
-//-->\r
-</script>\r
-</body>\r
-</html>
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whdata/whglo.js b/doc/salome/gui/GUI/whdata/whglo.js
deleted file mode 100755 (executable)
index e0519af..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//     WebHelp 5.10.001\r
-var gaFileMapping = new Array();\r
-function fileMapping(sBK, sEK, sFileName, nNum)\r
-{\r
-       this.sBK = sBK;\r
-       this.sEK = sEK;\r
-       this.sFileName = sFileName;\r
-       this.aKs = null;\r
-       this.nNum = nNum;\r
-       this.oUsedItems = null;\r
-}\r
-\r
-\r
-function iFM(sBK, sEK, sFileName, nNum)\r
-{\r
-       var i = gaFileMapping.length;\r
-       gaFileMapping[i] = new fileMapping(sBK, sEK, sFileName, nNum);  \r
-       if (i == 0) {\r
-               gaFileMapping[i].nTotal = nNum;\r
-       }\r
-       else {\r
-               gaFileMapping[i].nTotal = nNum + gaFileMapping[i - 1].nTotal;\r
-       }\r
-}\r
-\r
-function window_OnLoad()\r
-{\r
-       if (parent && parent != this && parent.projReady)\r
-       {\r
-               parent.projReady(gaFileMapping);\r
-       }               \r
-}\r
-\r
-window.onload = window_OnLoad;\r
diff --git a/doc/salome/gui/GUI/whdata/whidata.js b/doc/salome/gui/GUI/whdata/whidata.js
deleted file mode 100755 (executable)
index 9f0eb15..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-//     WebHelp 5.10.001\r
-// const strings\r
-var gIEA = new Array();\r
-function aIE()\r
-{\r
-       var len = gIEA.length;\r
-       gIEA[len] = new indexEntry(aIE.arguments);\r
-}\r
-\r
-function topic(sName, sURL)\r
-{\r
-       this.sName = sName;\r
-       this.sURL = sURL;\r
-}\r
-\r
-function indexEntry(fn_arguments) \r
-{\r
-       if (fn_arguments.length && fn_arguments.length >= 3) \r
-       {\r
-               this.nType = fn_arguments[0];\r
-               this.nPKOff = 0;\r
-               this.nNKOff = fn_arguments[1];\r
-               this.sName = fn_arguments[2];\r
-               this.aTopics = null;\r
-               var nLen = fn_arguments.length;\r
-               if (Math.floor(nLen / 2) * 2 == nLen)\r
-               {\r
-                       this.sTarget = fn_arguments[3];\r
-                       if (nLen > 5)\r
-                       {\r
-                               this.aTopics = new Array();\r
-                               for (var i = 0; i < (nLen - 5)/2; i++)\r
-                               {\r
-                                       this.aTopics[i] = new topic(fn_arguments[i * 2 + 4], fn_arguments[i * 2 + 5]);\r
-                               }\r
-                       }\r
-\r
-               }\r
-               else \r
-               {\r
-                       if (nLen > 4) \r
-                       {\r
-                               this.aTopics = new Array();\r
-                               for (var i = 0; i < (nLen - 4)/2; i++)\r
-                               {\r
-                                       this.aTopics[i] = new topic(fn_arguments[i * 2 + 3], fn_arguments[i * 2 + 4]);\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-}\r
-\r
-function getIndexTopicMappingList(nItemIndex)\r
-{\r
-       var sTopics = "";\r
-       if (gIEA.length > nItemIndex)\r
-       {\r
-               if (gIEA[nItemIndex].aTopics) \r
-               {\r
-                       var i = 0;\r
-                       var nLen = gIEA[nItemIndex].aTopics.length;\r
-                       for (i = 0; i < nLen; i ++) \r
-                       {\r
-                               sTopics += "," + gIEA[nItemIndex].aTopics[i];\r
-                       }\r
-               }\r
-       }\r
-       return sTopics;         \r
-}\r
-\r
-function window_OnLoad()\r
-{\r
-       if (parent && parent != this) {\r
-               if (parent.putData) \r
-               {\r
-                       for (var i = 0; i < gIEA.length; i ++ )\r
-                       {\r
-                               if (gIEA[i].nNKOff != 0 && i + gIEA[i].nNKOff + 1 < gIEA.length)\r
-                               {\r
-                               \r
-                                       gIEA[i + gIEA[i].nNKOff + 1].nPKOff = gIEA[i].nNKOff;\r
-                               }\r
-                       }\r
-                       parent.putData(gIEA);\r
-               }\r
-       }\r
-}\r
-\r
-window.onload = window_OnLoad;
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whdata/whidx.htm b/doc/salome/gui/GUI/whdata/whidx.htm
deleted file mode 100755 (executable)
index 0a0deed..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<html>\r
-<head>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<body>\r
-<script language="javascript" src="whidx.js"></script>\r
-<script language="javascript">\r
-<!--\r
-\r
-//-->\r
-</script>\r
-</body>\r
-</html>
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whdata/whidx.js b/doc/salome/gui/GUI/whdata/whidx.js
deleted file mode 100755 (executable)
index e0519af..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//     WebHelp 5.10.001\r
-var gaFileMapping = new Array();\r
-function fileMapping(sBK, sEK, sFileName, nNum)\r
-{\r
-       this.sBK = sBK;\r
-       this.sEK = sEK;\r
-       this.sFileName = sFileName;\r
-       this.aKs = null;\r
-       this.nNum = nNum;\r
-       this.oUsedItems = null;\r
-}\r
-\r
-\r
-function iFM(sBK, sEK, sFileName, nNum)\r
-{\r
-       var i = gaFileMapping.length;\r
-       gaFileMapping[i] = new fileMapping(sBK, sEK, sFileName, nNum);  \r
-       if (i == 0) {\r
-               gaFileMapping[i].nTotal = nNum;\r
-       }\r
-       else {\r
-               gaFileMapping[i].nTotal = nNum + gaFileMapping[i - 1].nTotal;\r
-       }\r
-}\r
-\r
-function window_OnLoad()\r
-{\r
-       if (parent && parent != this && parent.projReady)\r
-       {\r
-               parent.projReady(gaFileMapping);\r
-       }               \r
-}\r
-\r
-window.onload = window_OnLoad;\r
diff --git a/doc/salome/gui/GUI/whdata/whtdata.js b/doc/salome/gui/GUI/whdata/whtdata.js
deleted file mode 100755 (executable)
index d5428a7..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-//     WebHelp 5.10.001\r
-var gTEA = new Array();\r
-function aTE()\r
-{\r
-       gTEA[gTEA.length] = new tocEntry(aTE.arguments);\r
-}\r
-\r
-function tocEntry(fn_arguments) \r
-{\r
-       if (fn_arguments.length < 3)    \r
-       {\r
-               alert ("data format wrong!!!");\r
-               return;\r
-       }\r
-       \r
-       this.nType = fn_arguments[0];\r
-       this.nContents = fn_arguments[1];\r
-       this.sItemName = fn_arguments[2];\r
-       \r
-       if (this.nType == 1 || this.nType == 2 || this.nType == 16)\r
-       {\r
-               if (fn_arguments.length > 3)\r
-               {\r
-                       this.sItemURL = fn_arguments[3];\r
-                       if (fn_arguments.length > 4)\r
-                       {\r
-                               this.sTarget = fn_arguments[4];\r
-                               if (fn_arguments.length > 5)\r
-                                       this.sIconRef = fn_arguments[5];\r
-                       }\r
-               }\r
-       }\r
-       if (this.nType == 4 || this.nType == 8)\r
-       {\r
-               if (fn_arguments.length > 3)\r
-               {\r
-                       this.sRefURL = fn_arguments[3];\r
-                       if (this.nType == 4)\r
-                       {\r
-                               if(this.sRefURL.lastIndexOf("/")!=this.sRefURL.length-1)\r
-                                       this.sRefURL+="/";\r
-                       }\r
-                       if (fn_arguments.length > 4)\r
-                       {\r
-                               this.sItemURL = fn_arguments[4];\r
-                               if (fn_arguments.length > 5)\r
-                               {\r
-                                       this.sTarget = fn_arguments[5];\r
-                                       if (fn_arguments.length > 6)\r
-                                               this.sIconRef = fn_arguments[6];\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-}\r
-\r
-\r
-function window_OnLoad()\r
-{\r
-       if (parent && parent != this && parent.putData) {\r
-               parent.putData(gTEA);\r
-       }\r
-}\r
-window.onload = window_OnLoad;
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whdata/whtdata0.htm b/doc/salome/gui/GUI/whdata/whtdata0.htm
deleted file mode 100755 (executable)
index 15cf816..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<html>\r
-<head>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<body>\r
-<script language="javascript" src="whtdata.js"></script>\r
-<script language="javascript">\r
-<!--\r
- aTE(2,0,"Welcome to SALOME","kernel/introduction.htm");\r
- aTE(1,3,"Using this reference manual");\r
-   aTE(2,0,"About SALOME help system","kernel/about_salome_pro_help_system.htm");\r
-   aTE(2,0,"Navigating topics","kernel/navigating_topics.htm");\r
-   aTE(2,0,"Using left-hand tabs","kernel/using_left-hand_tabs.htm");\r
- aTE(1,4,"About SALOME");\r
-   aTE(2,0,"Introduction to SALOME","kernel/introduction_to_salome_pro.htm");\r
-   aTE(2,0,"SALOME architecture","kernel/about_salome_pro_architecture.htm");\r
-   aTE(2,0,"Installing SALOME","kernel/readme.html");\r
-   aTE(2,0,"Running SALOME","kernel/running_salome_pro.htm");\r
- aTE(1,24,"GUI module");\r
-   aTE(2,0,"Introduction to GUI","introduction_to_gui.htm");\r
-   aTE(2,0,"Getting started","kernel/getting_started2.htm");\r
-   aTE(2,0,"SALOME desktop","kernel/salome_pro_desktop.htm");\r
-   aTE(1,7,"Study management");\r
-     aTE(2,0,"Creating a new study","kernel/creating_a_new_study.htm");\r
-     aTE(2,0,"Opening studies","kernel/opening_studies.htm");\r
-     aTE(2,0,"Saving and closing studies","kernel/saving_a_study.htm");\r
-     aTE(2,0,"Editing studies","kernel/editing_studies.htm");\r
-     aTE(2,0,"Displaying studies","kernel/displaying_studies.htm");\r
-     aTE(2,0,"Working with Python Scripts","dump_study.htm");\r
-     aTE(2,0,"Setting study properties","kernel/getting_properties_of_the_study.htm");\r
-   aTE(2,0,"Using Object Browser","kernel/using_object_browser.htm");\r
-   aTE(2,0,"Using Registry tool","kernel/using_registry.htm");\r
-   aTE(2,0,"Using Catalog Generator","kernel/using_catalog_generator.htm");\r
-   aTE(1,2,"Viewers");\r
-     aTE(2,0,"OCC 3D Viewer","occ_3d_viewer.htm");\r
-     aTE(2,0,"VTK 3D Viewer","vtk_3d_viewer.htm");\r
-   aTE(1,6,"Setting Preferences");\r
-     aTE(2,0,"Setting Preferences","setting_preferences.htm");\r
-     aTE(2,0,"Select Color and Font","select_color_and_font.htm");\r
-     aTE(2,0,"SALOME preferences","kernel/setting_preferences.htm");\r
-     aTE(2,0,"Geometry preferences","geom_preferences.htm");\r
-     aTE(2,0,"Mesh preferences","mesh_preferences.htm");\r
-     aTE(2,0,"Post-Pro Preferences","post-pro_preferences.htm");\r
-\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
diff --git a/doc/salome/gui/GUI/whdata/whtoc.htm b/doc/salome/gui/GUI/whdata/whtoc.htm
deleted file mode 100755 (executable)
index 54e0cbf..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<html>\r
-<head>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<body>\r
-<script language="javascript" src="whtoc.js"></script>\r
-<script language="javascript">\r
-<!--\r
-  setRoot("whtdata0.htm");\r
-\r
-//-->\r
-</script>\r
-</body>\r
-</html>
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whdata/whtoc.js b/doc/salome/gui/GUI/whdata/whtoc.js
deleted file mode 100755 (executable)
index 163d8cc..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-//     WebHelp 5.10.001\r
-// const strings\r
-var gaProj = new Array();\r
-var gsRoot = "";\r
-\r
-function setRoot(sRoot)\r
-{\r
-       gsRoot = sRoot\r
-}\r
-\r
-function aPE(sProjPath, sRootPath)\r
-{\r
-       gaProj[gaProj.length] = new tocProjEntry(sProjPath, sRootPath);\r
-}\r
-\r
-function tocProjEntry(sProjPath, sRootPath) \r
-{\r
-       if(sProjPath.lastIndexOf("/")!=sProjPath.length-1)\r
-               sProjPath+="/"; \r
-       this.sPPath = sProjPath;\r
-       this.sRPath = sRootPath;\r
-}\r
-\r
-\r
-function window_OnLoad()\r
-{\r
-       if (parent && parent != this && parent.projReady) {\r
-               parent.projReady(gsRoot, gaProj);\r
-       }\r
-}\r
-window.onload = window_OnLoad;
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whgdata/whexpbar.gif b/doc/salome/gui/GUI/whgdata/whexpbar.gif
deleted file mode 100755 (executable)
index e677dc6..0000000
Binary files a/doc/salome/gui/GUI/whgdata/whexpbar.gif and /dev/null differ
diff --git a/doc/salome/gui/GUI/whgdata/whlstf0.htm b/doc/salome/gui/GUI/whgdata/whlstf0.htm
deleted file mode 100755 (executable)
index ee72453..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" >\r
-\r
-\r
-<a name="bm_{"></a><a name="subkey_{{"></a><a href="../kernel/readme.html"><b>__version__</b></a> <br><a name="bms_{O"></a><a name="subkey_{O"></a><a href="../kernel/readme.html"><b>_omnipymodule</b></a> <br><a name="bms_{{"></a><a name="subkey_{{"></a><a href="../post-pro_preferences.htm"><b>16x16</b></a> <br><nobr><a name="bms_{D"></a><a name="subkey_{D"></a>2d <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> </nobr><br><nobr>3d <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br>\r
-<br><br>\r
-<nobr><a name="bm_A"></a><a name="subkey_AB"></a>able <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a href="../kernel/readme.html"><b>abort</b></a> <br><nobr>above <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> </nobr><br><nobr>abscissa <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>absolute</b></a> <br><a href="../kernel/creating_a_new_study.htm"><b>abstraction</b></a> <br><a name="bms_AC"></a><a name="subkey_AC"></a><a href="../post-pro_preferences.htm"><b>acceptable</b></a> <br><nobr>access <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../geom_preferences.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../mesh_preferences.htm"><b>4</b></a> <a href="../kernel/using_object_browser.htm"><b>5</b></a> <a href="../kernel/setting_preferences.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><nobr>accessible <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>accidentally</b></a> <br><nobr>according <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><a href="../kernel/readme.html"><b>account</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>achieved</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>achieves</b></a> <br><a href="../kernel/about_salome_pro_help_system.htm"><b>acquainted</b></a> <br><a href="../post-pro_preferences.htm"><b>actions</b></a> <br><nobr>activated <a href="../kernel/creating_a_new_study.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>3</b></a> </nobr><br><nobr>active <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../kernel/creating_a_new_study.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>activity</b></a> <br><a href="../kernel/creating_a_new_study.htm"><b>actual</b></a> <br><a name="bms_AD"></a><a name="subkey_AD"></a><a href="../kernel/about_salome_pro_architecture.htm"><b>adapted</b></a> <br><nobr>add <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../select_color_and_font.htm"><b>3</b></a> <a href="../kernel/using_catalog_generator.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><a href="../select_color_and_font.htm"><b>added</b></a> <br><a href="../kernel/using_catalog_generator.htm"><b>adding</b></a> <br><nobr>addition <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/creating_a_new_study.htm"><b>2</b></a> </nobr><br><nobr>additional <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> <a href="../post-pro_preferences.htm"><b>5</b></a> <a href="../kernel/using_object_browser.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>addressing</b></a> <br><a href="../dump_study.htm"><b>adds</b></a> <br><a href="../post-pro_preferences.htm"><b>adjust</b></a> <br><nobr>advanced <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><a name="bms_AF"></a><a name="subkey_AF"></a><a href="../kernel/about_salome_pro_architecture.htm"><b>affecting</b></a> <br><nobr><a name="bms_AG"></a><a name="subkey_AG"></a>again <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><a name="bms_AL"></a><a name="subkey_AL"></a><a href="../kernel/readme.html"><b>algorithm</b></a> <br><nobr>algorithms <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><nobr>allow <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> </nobr><br><nobr>allowing <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/editing_studies.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><nobr>allows <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../geom_preferences.htm"><b>5</b></a> <a href="../setting_preferences.htm"><b>6</b></a> <a href="../select_color_and_font.htm"><b>7</b></a> <a href="../post-pro_preferences.htm"><b>8</b></a> <a href="../mesh_preferences.htm"><b>9</b></a> <a href="../kernel/using_registry.htm"><b>10</b></a> <a href="../kernel/using_catalog_generator.htm"><b>11</b></a> <a href="../kernel/setting_preferences.htm"><b>12</b></a> <a href="../kernel/saving_a_study.htm"><b>13</b></a> </nobr><br><a href="../kernel/saving_a_study.htm"><b>almost</b></a> <br><nobr>along <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/using_catalog_generator.htm"><b>alongside</b></a> <br><a href="../post-pro_preferences.htm"><b>alpha</b></a> <br><a href="../kernel/readme.html"><b>already</b></a> <br><a href="../kernel/introduction_to_salome_pro.htm"><b>always</b></a> <br><a name="bms_AM"></a><a name="subkey_AM"></a><a href="../kernel/readme.html"><b>amount</b></a> <br><a name="bms_AN"></a><a name="subkey_AN"></a><a href="../post-pro_preferences.htm"><b>animation</b></a> <br><a href="../kernel/readme.html"><b>annoying</b></a> <br><nobr>another <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>answer</b></a> <br><nobr>any <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/navigating_topics.htm"><b>3</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>4</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>5</b></a> <a href="../kernel/displaying_studies.htm"><b>6</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>7</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>8</b></a> <a href="../setting_preferences.htm"><b>9</b></a> <a href="../post-pro_preferences.htm"><b>10</b></a> <a href="../kernel/saving_a_study.htm"><b>11</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>12</b></a> </nobr><br><a href="../kernel/readme.html"><b>anything</b></a> <br><nobr><a name="bms_AP"></a><a name="subkey_AP"></a>api <a href="../dump_study.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><nobr>appear <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> <a href="../kernel/using_registry.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/setting_preferences.htm"><b>6</b></a> </nobr><br><a href="../mesh_preferences.htm"><b>appearance</b></a> <br><nobr>appears <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_help_system.htm"><b>applets</b></a> <br><nobr>application <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../introduction_to_gui.htm"><b>5</b></a> <a href="../dump_study.htm"><b>6</b></a> <a href="../setting_preferences.htm"><b>7</b></a> <a href="../kernel/using_catalog_generator.htm"><b>8</b></a> <a href="../kernel/setting_preferences.htm"><b>9</b></a> <a href="../kernel/saving_a_study.htm"><b>10</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>11</b></a> </nobr><br><nobr>applications <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../setting_preferences.htm"><b>apply</b></a> <br><nobr>approach <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>3</b></a> </nobr><br><nobr>appropriate <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>approximate</b></a> <br><a name="bms_AR"></a><a name="subkey_AR"></a><a href="../select_color_and_font.htm"><b>arabic</b></a> <br><nobr>architecture <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>architectures</b></a> <br><nobr>area <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>areas <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>argument</b></a> <br><a href="../kernel/readme.html"><b>arguments</b></a> <br><a href="../post-pro_preferences.htm"><b>arrange</b></a> <br><nobr><a name="bms_AS"></a><a name="subkey_AS"></a>ascii <a href="../kernel/setting_preferences.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>ask</b></a> <br><a href="../post-pro_preferences.htm"><b>assigned</b></a> <br><nobr>associated <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../kernel/using_object_browser.htm"><b>3</b></a> </nobr><br><a name="bms_AT"></a><a name="subkey_AT"></a><a href="../kernel/introduction.htm"><b>attached</b></a> <br><a href="../kernel/using_object_browser.htm"><b>attribute</b></a> <br><a href="../kernel/using_object_browser.htm"><b>attributes</b></a> <br><nobr><a name="bms_AU"></a><a name="subkey_AU"></a>author <a href="../kernel/getting_properties_of_the_study.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><nobr>auto <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>automatic <a href="../mesh_preferences.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>automatically <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> <a href="../setting_preferences.htm"><b>5</b></a> <a href="../post-pro_preferences.htm"><b>6</b></a> <a href="../mesh_preferences.htm"><b>7</b></a> <a href="../kernel/saving_a_study.htm"><b>8</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>9</b></a> </nobr><br><a name="bms_AV"></a><a name="subkey_AV"></a><a href="../kernel/editing_studies.htm"><b>availability</b></a> <br><nobr>available <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/editing_studies.htm"><b>3</b></a> <a href="../kernel/creating_a_new_study.htm"><b>4</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>5</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>average</b></a> <br><a href="../post-pro_preferences.htm"><b>avi</b></a> <br><a href="../kernel/readme.html"><b>avoid</b></a> <br><a href="../dump_study.htm"><b>avoiding</b></a> <br><a name="bms_AW"></a><a name="subkey_AW"></a><a href="../kernel/readme.html"><b>aware</b></a> <br><a href="../kernel/readme.html"><b>awk</b></a> <br><a name="bms_AX"></a><a name="subkey_AX"></a><a href="../kernel/setting_preferences.htm"><b>axes</b></a> <br><a href="../kernel/setting_preferences.htm"><b>axis</b></a> <br>\r
-<br><br>\r
-<a name="bm_B"></a><a name="subkey_B{"></a><a href="../kernel/readme.html"><b>b</b></a> <br><nobr><a name="bms_BA"></a><a name="subkey_BA"></a>back <a href="../kernel/readme.html"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><nobr>background <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>bar <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> <a href="../kernel/using_object_browser.htm"><b>3</b></a> </nobr><br><nobr>bars <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/saving_a_study.htm"><b>base</b></a> <br><nobr>based <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>bash</b></a> <br><nobr>basic <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../select_color_and_font.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>basis</b></a> <br><nobr>batch <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> </nobr><br><nobr><a name="bms_BE"></a><a name="subkey_BE"></a>becomes <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>before</b></a> <br><a href="../kernel/setting_preferences.htm"><b>begin</b></a> <br><a href="../kernel/using_registry.htm"><b>begins</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>behave</b></a> <br><a href="../kernel/introduction.htm"><b>behavior</b></a> <br><a href="../post-pro_preferences.htm"><b>behaviour</b></a> <br><a href="../kernel/readme.html"><b>being</b></a> <br><nobr>below <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>better</b></a> <br><a name="bms_BI"></a><a name="subkey_BI"></a><a href="../post-pro_preferences.htm"><b>bicolor</b></a> <br><a href="../post-pro_preferences.htm"><b>big</b></a> <br><nobr>bin <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>binaries</b></a> <br><nobr>binary <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a name="bms_BL"></a><a name="subkey_BL"></a><a href="../kernel/readme.html"><b>blue</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>blur</b></a> <br><a name="bms_BO"></a><a name="subkey_BO"></a><a href="../kernel/readme.html"><b>bold</b></a> <br><a href="../kernel/using_left-hand_tabs.htm"><b>book</b></a> <br><a href="../kernel/using_left-hand_tabs.htm"><b>books</b></a> <br><a href="../kernel/readme.html"><b>boost</b></a> <br><a href="../kernel/readme.html"><b>boost_version</b></a> <br><a href="../kernel/readme.html"><b>boostdir</b></a> <br><nobr>borders <a href="../mesh_preferences.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><nobr>both <a href="../introduction_to_gui.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><nobr>bottom <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><nobr>box <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../geom_preferences.htm"><b>4</b></a> <a href="../dump_study.htm"><b>5</b></a> <a href="../setting_preferences.htm"><b>6</b></a> <a href="../select_color_and_font.htm"><b>7</b></a> <a href="../post-pro_preferences.htm"><b>8</b></a> <a href="../mesh_preferences.htm"><b>9</b></a> <a href="../kernel/using_registry.htm"><b>10</b></a> <a href="../kernel/using_catalog_generator.htm"><b>11</b></a> <a href="../kernel/setting_preferences.htm"><b>12</b></a> <a href="../kernel/saving_a_study.htm"><b>13</b></a> </nobr><br><a href="../geom_preferences.htm"><b>boxes</b></a> <br><br><br></p><p class="ftsbody" align="center"><a href="whlstf1.htm" target="_self" title="previous search group"><b>&gt;&gt;</b></a>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstf1.htm b/doc/salome/gui/GUI/whgdata/whlstf1.htm
deleted file mode 100755 (executable)
index cf6630c..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" align="center"><a href="whlstf0.htm" target="_self" title="previous search group"><b>&lt;&lt;</b></a><br><br></p>\r
-<p class="ftsbody" >\r
-<a name="bms_BR"></a><a name="subkey_BR"></a><a href="../kernel/readme.html"><b>brackets</b></a> <br><a href="../kernel/introduction.htm"><b>brep</b></a> <br><nobr>brief <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> </nobr><br><a href="../introduction_to_gui.htm"><b>bringing</b></a> <br><nobr>browse <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><nobr>browser <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../kernel/creating_a_new_study.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>4</b></a> <a href="../introduction_to_gui.htm"><b>5</b></a> <a href="../kernel/using_object_browser.htm"><b>6</b></a> <a href="../kernel/setting_preferences.htm"><b>7</b></a> <a href="../kernel/saving_a_study.htm"><b>8</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>9</b></a> </nobr><br><a name="bms_BU"></a><a name="subkey_BU"></a><a href="../kernel/readme.html"><b>bug</b></a> <br><nobr>build <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>building</b></a> <br><nobr>built <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><nobr>button <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/navigating_topics.htm"><b>3</b></a> <a href="../setting_preferences.htm"><b>4</b></a> <a href="../select_color_and_font.htm"><b>5</b></a> <a href="../post-pro_preferences.htm"><b>6</b></a> <a href="../kernel/using_registry.htm"><b>7</b></a> <a href="../kernel/using_catalog_generator.htm"><b>8</b></a> <a href="../kernel/setting_preferences.htm"><b>9</b></a> <a href="../kernel/saving_a_study.htm"><b>10</b></a> </nobr><br><nobr>buttons <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> </nobr><br>\r
-<br><br>\r
-<nobr><a name="bm_C"></a><a name="subkey_C{"></a>c <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> </nobr><br><nobr><a name="bms_CA"></a><a name="subkey_CA"></a>cad <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>cae</b></a> <br><a href="../kernel/introduction.htm"><b>calculation</b></a> <br><nobr>calculations <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> </nobr><br><nobr>call <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_registry.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><nobr>called <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>calling</b></a> <br><a href="../dump_study.htm"><b>calls</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>cam</b></a> <br><a href="../post-pro_preferences.htm"><b>camera</b></a> <br><a href="../kernel/readme.html"><b>cancel</b></a> <br><a href="../kernel/using_catalog_generator.htm"><b>capability</b></a> <br><a href="../kernel/readme.html"><b>caption</b></a> <br><a href="../kernel/readme.html"><b>care</b></a> <br><a href="../kernel/readme.html"><b>carefully</b></a> <br><a href="../mesh_preferences.htm"><b>carried</b></a> <br><a href="../kernel/introduction.htm"><b>carrying</b></a> <br><a href="../kernel/introduction.htm"><b>cars</b></a> <br><a href="../kernel/readme.html"><b>cascade</b></a> <br><nobr>case <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../post-pro_preferences.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><a href="../kernel/readme.html"><b>casroot</b></a> <br><a href="../kernel/readme.html"><b>cat</b></a> <br><a href="../kernel/using_catalog_generator.htm"><b>catalog</b></a> <br><a href="../kernel/using_catalog_generator.htm"><b>catalogmodulegeneral</b></a> <br><a href="../kernel/using_catalog_generator.htm"><b>catalogmodulepersonnel</b></a> <br><nobr>catalogue <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> </nobr><br><a href="../kernel/using_left-hand_tabs.htm"><b>categories</b></a> <br><a name="bms_CD"></a><a name="subkey_CD"></a><a href="../kernel/readme.html"><b>cd</b></a> <br><nobr><a name="bms_CE"></a><a name="subkey_CE"></a>cells <a href="../select_color_and_font.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>centered</b></a> <br><a href="../post-pro_preferences.htm"><b>central</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>centralized</b></a> <br><a href="../post-pro_preferences.htm"><b>centred</b></a> <br><nobr><a name="bms_CH"></a><a name="subkey_CH"></a>change <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../setting_preferences.htm"><b>5</b></a> <a href="../post-pro_preferences.htm"><b>6</b></a> <a href="../kernel/setting_preferences.htm"><b>7</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>8</b></a> </nobr><br><a href="../setting_preferences.htm"><b>changed</b></a> <br><nobr>changes <a href="../kernel/getting_properties_of_the_study.htm"><b>1</b></a> <a href="../setting_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><a href="../kernel/readme.html"><b>changing</b></a> <br><a href="../post-pro_preferences.htm"><b>channel</b></a> <br><a href="../kernel/about_salome_pro_help_system.htm"><b>chapters</b></a> <br><a href="../select_color_and_font.htm"><b>characters</b></a> <br><a href="../kernel/readme.html"><b>charge</b></a> <br><nobr>check <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>check_version</b></a> <br><nobr>checkbox <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><nobr>checkboxes <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> </nobr><br><nobr>checked <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a href="../kernel/readme.html"><b>checking</b></a> <br><a href="../kernel/readme.html"><b>checks</b></a> <br><nobr>choice <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../select_color_and_font.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> </nobr><br><nobr>choose <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/editing_studies.htm"><b>4</b></a> <a href="../kernel/creating_a_new_study.htm"><b>5</b></a> <a href="../geom_preferences.htm"><b>6</b></a> <a href="../select_color_and_font.htm"><b>7</b></a> <a href="../post-pro_preferences.htm"><b>8</b></a> <a href="../mesh_preferences.htm"><b>9</b></a> <a href="../kernel/using_registry.htm"><b>10</b></a> <a href="../kernel/using_catalog_generator.htm"><b>11</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>12</b></a> </nobr><br><nobr>chosen <a href="../select_color_and_font.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><a name="bms_CL"></a><a name="subkey_CL"></a><a href="../post-pro_preferences.htm"><b>clamp</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>classic</b></a> <br><a href="../kernel/readme.html"><b>clear</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>clearall</b></a> <br><nobr>click <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/navigating_topics.htm"><b>3</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>4</b></a> <a href="../kernel/editing_studies.htm"><b>5</b></a> <a href="../kernel/displaying_studies.htm"><b>6</b></a> <a href="../kernel/creating_a_new_study.htm"><b>7</b></a> <a href="../geom_preferences.htm"><b>8</b></a> <a href="../dump_study.htm"><b>9</b></a> <a href="../setting_preferences.htm"><b>10</b></a> <a href="../select_color_and_font.htm"><b>11</b></a> <a href="../post-pro_preferences.htm"><b>12</b></a> <a href="../mesh_preferences.htm"><b>13</b></a> <a href="../kernel/using_registry.htm"><b>14</b></a> <a href="../kernel/using_object_browser.htm"><b>15</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>16</b></a> <a href="../kernel/using_catalog_generator.htm"><b>17</b></a> <a href="../kernel/setting_preferences.htm"><b>18</b></a> <a href="../kernel/saving_a_study.htm"><b>19</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>20</b></a> </nobr><br><a href="../kernel/navigating_topics.htm"><b>clickable</b></a> <br><a href="../kernel/navigating_topics.htm"><b>clicked</b></a> <br><nobr>clicking <a href="../kernel/readme.html"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> <a href="../kernel/using_object_browser.htm"><b>3</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>client</b></a> <br><a href="../post-pro_preferences.htm"><b>clip</b></a> <br><nobr>close <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../setting_preferences.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> </nobr><br><nobr>closed <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><nobr>closes <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><nobr>closing <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>clusters</b></a> <br><nobr><a name="bms_CO"></a><a name="subkey_CO"></a>code <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../mesh_preferences.htm"><b>coef</b></a> <br><a href="../kernel/readme.html"><b>coincide</b></a> <br><a href="../kernel/readme.html"><b>collect</b></a> <br><a href="../kernel/readme.html"><b>collected</b></a> <br><a href="../kernel/readme.html"><b>collects</b></a> <br><nobr>color <a href="../geom_preferences.htm"><b>1</b></a> <a href="../select_color_and_font.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../mesh_preferences.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> </nobr><br><nobr>colored <a href="../geom_preferences.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><nobr>colors <a href="../select_color_and_font.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/setting_preferences.htm"><b>column</b></a> <br><nobr>columns <a href="../kernel/using_registry.htm"><b>1</b></a> <a href="../kernel/using_object_browser.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>combined</b></a> <br><a href="../kernel/introduction_to_salome_pro.htm"><b>combines</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>comfortable</b></a> <br><a href="../kernel/readme.html"><b>comma</b></a> <br><nobr>command <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><nobr>commands <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><nobr>common <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../setting_preferences.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>compared <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>compatible</b></a> <br><a href="../kernel/readme.html"><b>compiled</b></a> <br><a href="../kernel/readme.html"><b>compiling</b></a> <br><nobr>complete <a href="../kernel/getting_properties_of_the_study.htm"><b>1</b></a> <a href="../kernel/using_registry.htm"><b>2</b></a> </nobr><br><nobr>completed <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><nobr>complex <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><nobr>component <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/editing_studies.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../introduction_to_gui.htm"><b>5</b></a> <a href="../dump_study.htm"><b>6</b></a> <a href="../post-pro_preferences.htm"><b>7</b></a> <a href="../kernel/using_registry.htm"><b>8</b></a> <a href="../kernel/using_object_browser.htm"><b>9</b></a> <a href="../kernel/using_catalog_generator.htm"><b>10</b></a> <a href="../kernel/setting_preferences.htm"><b>11</b></a> <a href="../kernel/saving_a_study.htm"><b>12</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>13</b></a> </nobr><br><nobr>components <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> <a href="../kernel/introduction.htm"><b>4</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>5</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>6</b></a> <a href="../introduction_to_gui.htm"><b>7</b></a> <a href="../dump_study.htm"><b>8</b></a> <a href="../kernel/using_registry.htm"><b>9</b></a> <a href="../kernel/using_object_browser.htm"><b>10</b></a> <a href="../kernel/using_catalog_generator.htm"><b>11</b></a> <a href="../kernel/saving_a_study.htm"><b>12</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>13</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>compose</b></a> <br><nobr>computation <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>computational</b></a> <br><a href="../kernel/introduction.htm"><b>computations</b></a> <br><nobr>computer <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>concept <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>concerning</b></a> <br><a href="../kernel/readme.html"><b>concerns</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>conclusion</b></a> <br><a href="../kernel/readme.html"><b>config</b></a> <br><a href="../kernel/readme.html"><b>config_files</b></a> <br><a href="../kernel/readme.html"><b>config_mandrake10_1</b></a> <br><a href="../kernel/introduction_to_salome_pro.htm"><b>configurable</b></a> <br><a href="../kernel/readme.html"><b>configuration</b></a> <br><nobr>configure <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><nobr>confirm <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/opening_studies.htm"><b>connect</b></a> <br><nobr>connected <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><a href="../kernel/salome_pro_desktop.htm"><b>consists</b></a> <br><nobr>console <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/displaying_studies.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>constant</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>constantly</b></a> <br><nobr>construction <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><a href="../dump_study.htm"><b>consuming</b></a> <br><nobr>contain <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/using_object_browser.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><a href="../kernel/salome_pro_desktop.htm"><b>container</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>containers</b></a> <br><nobr>containing <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../setting_preferences.htm"><b>3</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> </nobr><br><nobr>contains <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/creating_a_new_study.htm"><b>4</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>5</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>6</b></a> <a href="../kernel/using_registry.htm"><b>7</b></a> <a href="../kernel/using_object_browser.htm"><b>8</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>9</b></a> </nobr><br><nobr>content <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>3</b></a> </nobr><br><nobr>contents <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><nobr>context <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_object_browser.htm"><b>2</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>continue</b></a> <br><nobr>control <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/creating_a_new_study.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../mesh_preferences.htm"><b>4</b></a> </nobr><br><nobr>controls <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><nobr>convert <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction_to_salome_pro.htm"><b>cooperate</b></a> <br><a href="../kernel/setting_preferences.htm"><b>coordinate</b></a> <br><a href="../kernel/setting_preferences.htm"><b>coordinates</b></a> <br><a href="../post-pro_preferences.htm"><b>copies</b></a> <br><nobr>copy <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/editing_studies.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><a href="../kernel/salome_pro_desktop.htm"><b>copying</b></a> <br><a href="../kernel/readme.html"><b>copyright</b></a> <br><nobr>corba <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/creating_a_new_study.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> </nobr><br><nobr>corner <a href="../select_color_and_font.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> </nobr><br><a href="../kernel/salome_pro_desktop.htm"><b>correcting</b></a> <br><nobr>corresponding <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../mesh_preferences.htm"><b>4</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>5</b></a> </nobr><br><a href="../kernel/readme.html"><b>correspondingly</b></a> <br><nobr>corresponds <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>costs</b></a> <br><nobr>coupling <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><br><br></p><p class="ftsbody" align="center"><a href="whlstf2.htm" target="_self" title="previous search group"><b>&gt;&gt;</b></a>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstf10.htm b/doc/salome/gui/GUI/whgdata/whlstf10.htm
deleted file mode 100755 (executable)
index 68fefcb..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" align="center"><a href="whlstf9.htm" target="_self" title="previous search group"><b>&lt;&lt;</b></a><br><br></p>\r
-<p class="ftsbody" >\r
-<nobr><a name="bms_SU"></a><a name="subkey_SU"></a>sub <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><nobr>submenu <a href="../kernel/creating_a_new_study.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>3</b></a> </nobr><br><a href="../select_color_and_font.htm"><b>subsets</b></a> <br><a href="../post-pro_preferences.htm"><b>substituted</b></a> <br><a href="../kernel/readme.html"><b>successfully</b></a> <br><a href="../introduction_to_gui.htm"><b>suit</b></a> <br><a href="../kernel/readme.html"><b>summarizes</b></a> <br><a href="../post-pro_preferences.htm"><b>superposition</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>superv</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>supervcontainer</b></a> <br><nobr>supervision <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><nobr>supervisor <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> </nobr><br><nobr>supplementary <a href="../kernel/using_registry.htm"><b>1</b></a> <a href="../kernel/using_object_browser.htm"><b>2</b></a> </nobr><br><nobr>support <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>supported</b></a> <br><a href="../kernel/readme.html"><b>supported_installation_modes</b></a> <br><a href="../kernel/introduction.htm"><b>supports</b></a> <br><a href="../kernel/readme.html"><b>sure</b></a> <br><a href="../mesh_preferences.htm"><b>surface</b></a> <br><a name="bms_SW"></a><a name="subkey_SW"></a><a href="../post-pro_preferences.htm"><b>sweep</b></a> <br><a href="../post-pro_preferences.htm"><b>sweeping</b></a> <br><a href="../kernel/readme.html"><b>swig</b></a> <br><nobr>switch <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>switched</b></a> <br><a href="../introduction_to_gui.htm"><b>switching</b></a> <br><nobr><a name="bms_SY"></a><a name="subkey_SY"></a>system <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../post-pro_preferences.htm"><b>5</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>6</b></a> </nobr><br><nobr>systems <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br>\r
-<br><br>\r
-<nobr><a name="bm_T"></a><a name="subkey_T{"></a>t <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/editing_studies.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/setting_preferences.htm"><b>6</b></a> <a href="../kernel/saving_a_study.htm"><b>7</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>8</b></a> </nobr><br><nobr><a name="bms_TA"></a><a name="subkey_TA"></a>tab <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../kernel/using_registry.htm"><b>2</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>3</b></a> </nobr><br><nobr>table <a href="../kernel/readme.html"><b>1</b></a> <a href="../select_color_and_font.htm"><b>2</b></a> </nobr><br><nobr>tabs <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>tag</b></a> <br><a href="../kernel/readme.html"><b>tags</b></a> <br><a href="../kernel/introduction.htm"><b>tailored</b></a> <br><a href="../kernel/readme.html"><b>take</b></a> <br><nobr>taken <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>takes</b></a> <br><a href="../kernel/readme.html"><b>target</b></a> <br><a href="../kernel/readme.html"><b>target_directory</b></a> <br><a href="../kernel/readme.html"><b>target_platform</b></a> <br><a href="../kernel/readme.html"><b>targetdir</b></a> <br><a href="../dump_study.htm"><b>tasks</b></a> <br><a name="bms_TC"></a><a name="subkey_TC"></a><a href="../kernel/readme.html"><b>tcl</b></a> <br><a href="../kernel/readme.html"><b>tclhome</b></a> <br><a href="../kernel/readme.html"><b>tclsh8</b></a> <br><a name="bms_TE"></a><a name="subkey_TE"></a><a href="../kernel/introduction.htm"><b>technological</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>technologies</b></a> <br><nobr>technology <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>temp</b></a> <br><a href="../kernel/readme.html"><b>temp_directory</b></a> <br><a href="../kernel/readme.html"><b>temp_folder</b></a> <br><a href="../kernel/readme.html"><b>tempdir</b></a> <br><a href="../kernel/readme.html"><b>temporary</b></a> <br><a href="../kernel/readme.html"><b>temporarydiskspace</b></a> <br><a href="../post-pro_preferences.htm"><b>tensor</b></a> <br><nobr>term <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><nobr>terminal <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>terms</b></a> <br><nobr>test <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>tests</b></a> <br><nobr>text <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>3</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>texture</b></a> <br><nobr><a name="bms_TH"></a><a name="subkey_TH"></a>them <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/displaying_studies.htm"><b>4</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>5</b></a> <a href="../select_color_and_font.htm"><b>6</b></a> <a href="../mesh_preferences.htm"><b>7</b></a> <a href="../kernel/using_registry.htm"><b>8</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>9</b></a> </nobr><br><a href="../kernel/readme.html"><b>therefore</b></a> <br><a href="../kernel/introduction_to_salome_pro.htm"><b>third</b></a> <br><nobr>those <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>three</b></a> <br><a href="../post-pro_preferences.htm"><b>threshold</b></a> <br><nobr>thus <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><nobr><a name="bms_TI"></a><a name="subkey_TI"></a>time <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>4</b></a> <a href="../kernel/displaying_studies.htm"><b>5</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>6</b></a> <a href="../dump_study.htm"><b>7</b></a> <a href="../setting_preferences.htm"><b>8</b></a> <a href="../post-pro_preferences.htm"><b>9</b></a> <a href="../kernel/using_registry.htm"><b>10</b></a> <a href="../kernel/using_catalog_generator.htm"><b>11</b></a> <a href="../kernel/saving_a_study.htm"><b>12</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>times</b></a> <br><nobr>title <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a name="bms_TK"></a><a name="subkey_TK"></a><a href="../kernel/readme.html"><b>tk</b></a> <br><a name="bms_TM"></a><a name="subkey_TM"></a><a href="../kernel/readme.html"><b>tmp</b></a> <br><a href="../kernel/readme.html"><b>tmp_disk_space</b></a> <br><a name="bms_TO"></a><a name="subkey_TO"></a><a href="../kernel/readme.html"><b>together</b></a> <br><a href="../mesh_preferences.htm"><b>toggle</b></a> <br><a href="../post-pro_preferences.htm"><b>toggles</b></a> <br><a href="../kernel/using_object_browser.htm"><b>toggling</b></a> <br><a href="../post-pro_preferences.htm"><b>tolerance</b></a> <br><nobr>tool <a href="../kernel/readme.html"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../kernel/using_registry.htm"><b>3</b></a> <a href="../kernel/using_catalog_generator.htm"><b>4</b></a> </nobr><br><nobr>toolbar <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/editing_studies.htm"><b>2</b></a> <a href="../kernel/creating_a_new_study.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../introduction_to_gui.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><nobr>toolbars <a href="../introduction_to_gui.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><a href="../introduction_to_gui.htm"><b>toolkit</b></a> <br><nobr>tools <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../kernel/using_registry.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>top <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/creating_a_new_study.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>topic <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><nobr>topics <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>2</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>topmost</b></a> <br><a href="../kernel/readme.html"><b>total</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>totality</b></a> <br><a href="../dump_study.htm"><b>touching</b></a> <br><a name="bms_TR"></a><a name="subkey_TR"></a><a href="../kernel/readme.html"><b>tr</b></a> <br><a href="../kernel/introduction.htm"><b>training</b></a> <br><a href="../post-pro_preferences.htm"><b>translate</b></a> <br><a href="../post-pro_preferences.htm"><b>translation</b></a> <br><a href="../post-pro_preferences.htm"><b>transparency</b></a> <br><a href="../post-pro_preferences.htm"><b>transparent</b></a> <br><nobr>tree <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/creating_a_new_study.htm"><b>2</b></a> <a href="../kernel/using_object_browser.htm"><b>3</b></a> <a href="../kernel/using_catalog_generator.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> </nobr><br><a href="../kernel/readme.html"><b>tries</b></a> <br><a href="../kernel/setting_preferences.htm"><b>trihedron</b></a> <br><a href="../kernel/readme.html"><b>trolltech</b></a> <br><a href="../kernel/readme.html"><b>true</b></a> <br><nobr>try <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><a href="../kernel/readme.html"><b>try_existing</b></a> <br><a href="../kernel/readme.html"><b>try_native</b></a> <br><a href="../kernel/readme.html"><b>try_preinstalled</b></a> <br><a name="bms_TW"></a><a name="subkey_TW"></a><a href="../post-pro_preferences.htm"><b>twice</b></a> <br><nobr>two <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> </nobr><br><nobr><a name="bms_TY"></a><a name="subkey_TY"></a>type <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../mesh_preferences.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/setting_preferences.htm"><b>6</b></a> </nobr><br><a href="../kernel/using_catalog_generator.htm"><b>typical</b></a> <br><nobr>typing <a href="../kernel/readme.html"><b>1</b></a> <a href="../select_color_and_font.htm"><b>2</b></a> </nobr><br>\r
-<br><br>\r
-<a name="bm_U"></a><a name="subkey_U{"></a><a href="../kernel/setting_preferences.htm"><b>u</b></a> <br><a name="bms_UL"></a><a name="subkey_UL"></a><a href="../kernel/about_salome_pro_architecture.htm"><b>ultimate</b></a> <br><a name="bms_UN"></a><a name="subkey_UN"></a><a href="../kernel/salome_pro_desktop.htm"><b>uncheck</b></a> <br><a href="../post-pro_preferences.htm"><b>unchecked</b></a> <br><a href="../select_color_and_font.htm"><b>underlined</b></a> <br><a href="../kernel/readme.html"><b>unfortunately</b></a> <br><a href="../kernel/readme.html"><b>unique</b></a> <br><a href="../post-pro_preferences.htm"><b>units</b></a> <br><a href="../kernel/about_salome_pro_help_system.htm"><b>unix</b></a> <br><a href="../kernel/saving_a_study.htm"><b>unload</b></a> <br><nobr>unloaded <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>unnecessary</b></a> <br><a href="../kernel/readme.html"><b>unselect</b></a> <br><a href="../kernel/readme.html"><b>unselecting</b></a> <br><a href="../dump_study.htm"><b>unused</b></a> <br><nobr><a name="bms_UP"></a><a name="subkey_UP"></a>up <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/navigating_topics.htm"><b>3</b></a> <a href="../kernel/introduction.htm"><b>4</b></a> <a href="../kernel/using_object_browser.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>update <a href="../mesh_preferences.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><nobr>updated <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><nobr>uploading <a href="../introduction_to_gui.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><nobr>upper <a href="../select_color_and_font.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a name="bms_US"></a><a name="subkey_US"></a><a href="../introduction_to_gui.htm"><b>usability</b></a> <br><nobr>usage <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><nobr>used <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../geom_preferences.htm"><b>4</b></a> <a href="../select_color_and_font.htm"><b>5</b></a> <a href="../post-pro_preferences.htm"><b>6</b></a> <a href="../mesh_preferences.htm"><b>7</b></a> <a href="../kernel/using_catalog_generator.htm"><b>8</b></a> <a href="../kernel/setting_preferences.htm"><b>9</b></a> <a href="../kernel/saving_a_study.htm"><b>10</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>11</b></a> </nobr><br><nobr>user <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../introduction_to_gui.htm"><b>5</b></a> <a href="../dump_study.htm"><b>6</b></a> <a href="../setting_preferences.htm"><b>7</b></a> <a href="../post-pro_preferences.htm"><b>8</b></a> <a href="../kernel/using_registry.htm"><b>9</b></a> <a href="../kernel/using_catalog_generator.htm"><b>10</b></a> </nobr><br><nobr>users <a href="../kernel/getting_properties_of_the_study.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><nobr>uses <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><nobr>using <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> <a href="../kernel/introduction.htm"><b>4</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>5</b></a> <a href="../dump_study.htm"><b>6</b></a> <a href="../post-pro_preferences.htm"><b>7</b></a> <a href="../kernel/using_registry.htm"><b>8</b></a> <a href="../kernel/using_object_browser.htm"><b>9</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>10</b></a> <a href="../kernel/using_catalog_generator.htm"><b>11</b></a> </nobr><br><a href="../kernel/readme.html"><b>usr</b></a> <br><a href="../kernel/readme.html"><b>usually</b></a> <br><br><br></p><p class="ftsbody" align="center"><a href="whlstf11.htm" target="_self" title="previous search group"><b>&gt;&gt;</b></a>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstf11.htm b/doc/salome/gui/GUI/whgdata/whlstf11.htm
deleted file mode 100755 (executable)
index 021dbc0..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" align="center"><a href="whlstf10.htm" target="_self" title="previous search group"><b>&lt;&lt;</b></a><br><br></p>\r
-<p class="ftsbody" >\r
-<a name="bms_UT"></a><a name="subkey_UT"></a><a href="../kernel/about_salome_pro_help_system.htm"><b>utilities</b></a> <br>\r
-<br><br>\r
-<nobr><a name="bm_V"></a><a name="subkey_V{"></a>v <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a name="bms_VA"></a><a name="subkey_VA"></a><a href="../kernel/setting_preferences.htm"><b>valid</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>validation</b></a> <br><nobr>value <a href="../kernel/readme.html"><b>1</b></a> <a href="../geom_preferences.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../mesh_preferences.htm"><b>4</b></a> <a href="../kernel/using_object_browser.htm"><b>5</b></a> <a href="../kernel/setting_preferences.htm"><b>6</b></a> </nobr><br><nobr>values <a href="../kernel/readme.html"><b>1</b></a> <a href="../geom_preferences.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>variable</b></a> <br><nobr>variables <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><nobr>variety <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>2</b></a> </nobr><br><nobr>various <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> </nobr><br><nobr><a name="bms_VE"></a><a name="subkey_VE"></a>ve <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>vector</b></a> <br><a href="../kernel/readme.html"><b>ver</b></a> <br><a href="../kernel/readme.html"><b>ver_major</b></a> <br><a href="../kernel/readme.html"><b>ver_minor</b></a> <br><nobr>version <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../setting_preferences.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><a href="../kernel/readme.html"><b>versions</b></a> <br><nobr>vertical <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a href="../kernel/displaying_studies.htm"><b>vertically</b></a> <br><nobr>very <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><nobr><a name="bms_VI"></a><a name="subkey_VI"></a>view <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../post-pro_preferences.htm"><b>5</b></a> <a href="../kernel/using_registry.htm"><b>6</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>7</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>8</b></a> </nobr><br><nobr>viewer <a href="../kernel/creating_a_new_study.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../mesh_preferences.htm"><b>4</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>5</b></a> <a href="../kernel/setting_preferences.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><nobr>viewers <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../kernel/creating_a_new_study.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><nobr>viewing <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction_to_salome_pro.htm"><b>visual</b></a> <br><nobr>visualisation <a href="../geom_preferences.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><nobr>visualization <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/getting_started2.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><nobr>visualize <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><nobr><a name="bms_VT"></a><a name="subkey_VT"></a>vtk <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../kernel/creating_a_new_study.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> </nobr><br><a href="../kernel/readme.html"><b>vtkhome</b></a> <br>\r
-<br><br>\r
-<a name="bm_W"></a><a name="subkey_WA"></a><a href="../kernel/readme.html"><b>wait</b></a> <br><a href="../kernel/readme.html"><b>waiting</b></a> <br><nobr>want <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>warned</b></a> <br><nobr>warning <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> </nobr><br><nobr>way <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><a name="bms_WE"></a><a name="subkey_WE"></a><a href="../kernel/about_salome_pro_help_system.htm"><b>web</b></a> <br><nobr>welcome <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>2</b></a> </nobr><br><nobr><a name="bms_WH"></a><a name="subkey_WH"></a>what <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../setting_preferences.htm"><b>5</b></a> <a href="../kernel/using_object_browser.htm"><b>6</b></a> </nobr><br><nobr>whenever <a href="../mesh_preferences.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/displaying_studies.htm"><b>wherever</b></a> <br><a href="../kernel/readme.html"><b>whether</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>while</b></a> <br><nobr>whole <a href="../setting_preferences.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> </nobr><br><a href="../mesh_preferences.htm"><b>whose</b></a> <br><nobr><a name="bms_WI"></a><a name="subkey_WI"></a>wide <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>2</b></a> <a href="../select_color_and_font.htm"><b>3</b></a> </nobr><br><a href="../kernel/introduction_to_salome_pro.htm"><b>widgets</b></a> <br><nobr>width <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><nobr>will <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>4</b></a> <a href="../kernel/creating_a_new_study.htm"><b>5</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>6</b></a> <a href="../dump_study.htm"><b>7</b></a> <a href="../setting_preferences.htm"><b>8</b></a> <a href="../select_color_and_font.htm"><b>9</b></a> <a href="../post-pro_preferences.htm"><b>10</b></a> <a href="../mesh_preferences.htm"><b>11</b></a> <a href="../kernel/using_registry.htm"><b>12</b></a> <a href="../kernel/using_object_browser.htm"><b>13</b></a> <a href="../kernel/using_catalog_generator.htm"><b>14</b></a> <a href="../kernel/setting_preferences.htm"><b>15</b></a> <a href="../kernel/saving_a_study.htm"><b>16</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>17</b></a> </nobr><br><nobr>window <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/navigating_topics.htm"><b>3</b></a> <a href="../kernel/getting_started2.htm"><b>4</b></a> <a href="../kernel/displaying_studies.htm"><b>5</b></a> <a href="../kernel/creating_a_new_study.htm"><b>6</b></a> <a href="../introduction_to_gui.htm"><b>7</b></a> <a href="../select_color_and_font.htm"><b>8</b></a> <a href="../post-pro_preferences.htm"><b>9</b></a> <a href="../kernel/using_registry.htm"><b>10</b></a> <a href="../kernel/saving_a_study.htm"><b>11</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>12</b></a> </nobr><br><a href="../introduction_to_gui.htm"><b>windowed</b></a> <br><nobr>windows <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../kernel/creating_a_new_study.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>4</b></a> <a href="../introduction_to_gui.htm"><b>5</b></a> <a href="../kernel/setting_preferences.htm"><b>6</b></a> <a href="../kernel/saving_a_study.htm"><b>7</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>8</b></a> </nobr><br><nobr>wireframe <a href="../geom_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/displaying_studies.htm"><b>wish</b></a> <br><a href="../kernel/readme.html"><b>wish8</b></a> <br><nobr>within <a href="../kernel/editing_studies.htm"><b>1</b></a> <a href="../kernel/creating_a_new_study.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../kernel/using_registry.htm"><b>4</b></a> </nobr><br><nobr>without <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> <a href="../setting_preferences.htm"><b>5</b></a> <a href="../post-pro_preferences.htm"><b>6</b></a> </nobr><br><a href="../kernel/readme.html"><b>wizard</b></a> <br><a href="../kernel/readme.html"><b>wizards</b></a> <br><nobr><a name="bms_WO"></a><a name="subkey_WO"></a>won <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/editing_studies.htm"><b>3</b></a> </nobr><br><a href="../kernel/using_left-hand_tabs.htm"><b>word</b></a> <br><a href="../kernel/using_left-hand_tabs.htm"><b>words</b></a> <br><nobr>work <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/getting_started2.htm"><b>3</b></a> <a href="../kernel/displaying_studies.htm"><b>4</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>5</b></a> <a href="../post-pro_preferences.htm"><b>6</b></a> </nobr><br><nobr>working <a href="../kernel/getting_started2.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>would <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><nobr><a name="bms_WR"></a><a name="subkey_WR"></a>write <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><nobr>written <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>wrong</b></a> <br><a name="bms_WW"></a><a name="subkey_WW"></a><a href="../kernel/about_salome_pro_architecture.htm"><b>www</b></a> <br>\r
-<br><br>\r
-<nobr><a name="bm_X"></a><a name="subkey_X{"></a>x <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><nobr><a name="bms_XM"></a><a name="subkey_XM"></a>xml <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><a name="bms_XT"></a><a name="subkey_XT"></a><a href="../kernel/running_salome_pro.htm"><b>xterm</b></a> <br><a name="bms_XX"></a><a name="subkey_XX"></a><a href="../kernel/readme.html"><b>xxxxx</b></a> <br>\r
-<br><br>\r
-<nobr><a name="bm_Y"></a><a name="subkey_Y{"></a>y <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><a name="bms_YE"></a><a name="subkey_YE"></a><a href="../kernel/introduction.htm"><b>year</b></a> <br><nobr>yes <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> </nobr><br><nobr>yet <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr><a name="bms_YO"></a><a name="subkey_YO"></a>your <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/editing_studies.htm"><b>4</b></a> <a href="../kernel/displaying_studies.htm"><b>5</b></a> <a href="../kernel/creating_a_new_study.htm"><b>6</b></a> <a href="../dump_study.htm"><b>7</b></a> <a href="../setting_preferences.htm"><b>8</b></a> <a href="../post-pro_preferences.htm"><b>9</b></a> <a href="../mesh_preferences.htm"><b>10</b></a> <a href="../kernel/using_catalog_generator.htm"><b>11</b></a> <a href="../kernel/setting_preferences.htm"><b>12</b></a> <a href="../kernel/saving_a_study.htm"><b>13</b></a> </nobr><br><a href="../select_color_and_font.htm"><b>yourselves</b></a> <br>\r
-<br><br>\r
-<a name="bm_Z"></a><a name="subkey_Z{"></a><a href="../kernel/running_salome_pro.htm"><b>z</b></a> <br><nobr><a name="bms_ZO"></a><a name="subkey_ZO"></a>zone <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../kernel/creating_a_new_study.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>zones</b></a> <br><a href="../post-pro_preferences.htm"><b>zoom</b></a> <br><a href="../post-pro_preferences.htm"><b>zoomed</b></a> <br><a href="../kernel/saving_a_study.htm"><b>zooming</b></a> <br><br><br></p>\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstf2.htm b/doc/salome/gui/GUI/whgdata/whlstf2.htm
deleted file mode 100755 (executable)
index e120a73..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" align="center"><a href="whlstf1.htm" target="_self" title="previous search group"><b>&lt;&lt;</b></a><br><br></p>\r
-<p class="ftsbody" >\r
-<a name="bms_CP"></a><a name="subkey_CP"></a><a href="../kernel/running_salome_pro.htm"><b>cpp</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>cppcontainer</b></a> <br><nobr><a name="bms_CR"></a><a name="subkey_CR"></a>create <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/getting_started2.htm"><b>4</b></a> <a href="../kernel/displaying_studies.htm"><b>5</b></a> <a href="../kernel/creating_a_new_study.htm"><b>6</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>7</b></a> <a href="../introduction_to_gui.htm"><b>8</b></a> <a href="../dump_study.htm"><b>9</b></a> <a href="../mesh_preferences.htm"><b>10</b></a> <a href="../kernel/using_catalog_generator.htm"><b>11</b></a> <a href="../kernel/setting_preferences.htm"><b>12</b></a> <a href="../kernel/saving_a_study.htm"><b>13</b></a> </nobr><br><nobr>created <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> <a href="../kernel/creating_a_new_study.htm"><b>4</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>5</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>6</b></a> <a href="../introduction_to_gui.htm"><b>7</b></a> <a href="../dump_study.htm"><b>8</b></a> <a href="../kernel/using_object_browser.htm"><b>9</b></a> <a href="../kernel/setting_preferences.htm"><b>10</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>11</b></a> </nobr><br><nobr>creates <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><nobr>creating <a href="../kernel/creating_a_new_study.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><nobr>creation <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> </nobr><br><nobr>cross <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><nobr><a name="bms_CS"></a><a name="subkey_CS"></a>csh <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><a href="../kernel/running_salome_pro.htm"><b>cshell</b></a> <br><a name="bms_CT"></a><a name="subkey_CT"></a><a href="../post-pro_preferences.htm"><b>ctrl</b></a> <br><nobr><a name="bms_CU"></a><a name="subkey_CU"></a>current <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/displaying_studies.htm"><b>4</b></a> <a href="../dump_study.htm"><b>5</b></a> <a href="../setting_preferences.htm"><b>6</b></a> <a href="../post-pro_preferences.htm"><b>7</b></a> <a href="../kernel/using_registry.htm"><b>8</b></a> <a href="../kernel/using_object_browser.htm"><b>9</b></a> <a href="../kernel/setting_preferences.htm"><b>10</b></a> <a href="../kernel/saving_a_study.htm"><b>11</b></a> </nobr><br><nobr>currently <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/using_registry.htm"><b>3</b></a> <a href="../kernel/using_object_browser.htm"><b>4</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>cursor</b></a> <br><a href="../kernel/setting_preferences.htm"><b>curve</b></a> <br><nobr>custom <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../select_color_and_font.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>customer</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>customization</b></a> <br><a name="bms_CY"></a><a name="subkey_CY"></a><a href="../post-pro_preferences.htm"><b>cycles</b></a> <br><a href="../select_color_and_font.htm"><b>cyrillic</b></a> <br>\r
-<br><br>\r
-<a name="bm_D"></a><a name="subkey_D{"></a><a href="../kernel/readme.html"><b>d</b></a> <br><nobr><a name="bms_DA"></a><a name="subkey_DA"></a>data <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/getting_started2.htm"><b>4</b></a> <a href="../kernel/creating_a_new_study.htm"><b>5</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>6</b></a> <a href="../introduction_to_gui.htm"><b>7</b></a> <a href="../dump_study.htm"><b>8</b></a> <a href="../kernel/using_catalog_generator.htm"><b>9</b></a> <a href="../kernel/setting_preferences.htm"><b>10</b></a> <a href="../kernel/saving_a_study.htm"><b>11</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>database</b></a> <br><nobr>date <a href="../kernel/getting_properties_of_the_study.htm"><b>1</b></a> <a href="../kernel/using_registry.htm"><b>2</b></a> </nobr><br><a name="bms_DE"></a><a name="subkey_DE"></a><a href="../kernel/using_object_browser.htm"><b>debugging</b></a> <br><a href="../post-pro_preferences.htm"><b>decrease</b></a> <br><a href="../post-pro_preferences.htm"><b>decreases</b></a> <br><nobr>default <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/creating_a_new_study.htm"><b>3</b></a> <a href="../geom_preferences.htm"><b>4</b></a> <a href="../setting_preferences.htm"><b>5</b></a> <a href="../post-pro_preferences.htm"><b>6</b></a> <a href="../mesh_preferences.htm"><b>7</b></a> <a href="../kernel/using_object_browser.htm"><b>8</b></a> <a href="../kernel/setting_preferences.htm"><b>9</b></a> <a href="../kernel/saving_a_study.htm"><b>10</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>11</b></a> </nobr><br><nobr>defaults <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>define <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../geom_preferences.htm"><b>4</b></a> <a href="../dump_study.htm"><b>5</b></a> <a href="../select_color_and_font.htm"><b>6</b></a> <a href="../post-pro_preferences.htm"><b>7</b></a> <a href="../mesh_preferences.htm"><b>8</b></a> </nobr><br><nobr>defined <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../mesh_preferences.htm"><b>4</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>defines</b></a> <br><nobr>definite <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/editing_studies.htm"><b>2</b></a> <a href="../kernel/creating_a_new_study.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../kernel/using_registry.htm"><b>5</b></a> <a href="../kernel/using_object_browser.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><nobr>definition <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>3</b></a> </nobr><br><a href="../kernel/using_left-hand_tabs.htm"><b>definitions</b></a> <br><a href="../kernel/introduction.htm"><b>delays</b></a> <br><a href="../kernel/saving_a_study.htm"><b>deleted</b></a> <br><nobr>demand <a href="../introduction_to_gui.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>demands</b></a> <br><a href="../kernel/readme.html"><b>dependancies</b></a> <br><a href="../kernel/readme.html"><b>dependencies</b></a> <br><a href="../kernel/readme.html"><b>depending</b></a> <br><nobr>depends <a href="../kernel/editing_studies.htm"><b>1</b></a> <a href="../kernel/using_object_browser.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>derived</b></a> <br><nobr>described <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>describes</b></a> <br><nobr>describing <a href="../kernel/about_salome_pro_help_system.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><nobr>description <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><nobr>descriptions <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>design</b></a> <br><a href="../post-pro_preferences.htm"><b>designed</b></a> <br><a href="../kernel/using_catalog_generator.htm"><b>desired</b></a> <br><nobr>desktop <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><a href="../kernel/navigating_topics.htm"><b>destination</b></a> <br><nobr>destined <a href="../kernel/getting_started2.htm"><b>1</b></a> <a href="../kernel/using_registry.htm"><b>2</b></a> <a href="../kernel/using_object_browser.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><a href="../kernel/setting_preferences.htm"><b>detailed</b></a> <br><a href="../kernel/readme.html"><b>details</b></a> <br><a href="../kernel/readme.html"><b>dev</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>developer</b></a> <br><nobr>development <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>developments</b></a> <br><a href="../post-pro_preferences.htm"><b>device</b></a> <br><a name="bms_DI"></a><a name="subkey_DI"></a><a href="../mesh_preferences.htm"><b>diagrams</b></a> <br><nobr>dialog <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../geom_preferences.htm"><b>4</b></a> <a href="../dump_study.htm"><b>5</b></a> <a href="../setting_preferences.htm"><b>6</b></a> <a href="../select_color_and_font.htm"><b>7</b></a> <a href="../post-pro_preferences.htm"><b>8</b></a> <a href="../mesh_preferences.htm"><b>9</b></a> <a href="../kernel/using_registry.htm"><b>10</b></a> <a href="../kernel/using_catalog_generator.htm"><b>11</b></a> <a href="../kernel/setting_preferences.htm"><b>12</b></a> <a href="../kernel/saving_a_study.htm"><b>13</b></a> </nobr><br><a href="../kernel/salome_pro_desktop.htm"><b>dialogs</b></a> <br><a href="../kernel/readme.html"><b>differ</b></a> <br><nobr>difference <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><nobr>different <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../kernel/getting_started2.htm"><b>4</b></a> <a href="../kernel/creating_a_new_study.htm"><b>5</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>6</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>7</b></a> <a href="../kernel/using_object_browser.htm"><b>8</b></a> <a href="../kernel/saving_a_study.htm"><b>9</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>10</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>differently</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>differs</b></a> <br><a href="../kernel/introduction.htm"><b>digital</b></a> <br><a href="../mesh_preferences.htm"><b>digits</b></a> <br><a href="../kernel/readme.html"><b>dir</b></a> <br><nobr>direction <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><nobr>directories <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>directory <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../setting_preferences.htm"><b>3</b></a> <a href="../kernel/using_catalog_generator.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> </nobr><br><nobr>disable <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>disable_flag</b></a> <br><a href="../post-pro_preferences.htm"><b>disabled</b></a> <br><nobr>disk <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><nobr>display <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../geom_preferences.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../mesh_preferences.htm"><b>5</b></a> <a href="../kernel/using_registry.htm"><b>6</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>7</b></a> <a href="../kernel/setting_preferences.htm"><b>8</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>9</b></a> </nobr><br><nobr>displayed <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../mesh_preferences.htm"><b>5</b></a> <a href="../kernel/using_object_browser.htm"><b>6</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>7</b></a> <a href="../kernel/setting_preferences.htm"><b>8</b></a> <a href="../kernel/saving_a_study.htm"><b>9</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>10</b></a> </nobr><br><nobr>displaying <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../kernel/using_object_browser.htm"><b>2</b></a> </nobr><br><nobr>displays <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/using_registry.htm"><b>3</b></a> <a href="../kernel/using_object_browser.htm"><b>4</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>5</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>distance</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>distinction</b></a> <br><a href="../kernel/readme.html"><b>distribute</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>distributed</b></a> <br><a href="../kernel/readme.html"><b>distribution</b></a> <br><nobr>divided <a href="../kernel/about_salome_pro_help_system.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../kernel/using_registry.htm"><b>3</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>divides</b></a> <br><nobr><a name="bms_DO"></a><a name="subkey_DO"></a>dockable <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><nobr>document <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/creating_a_new_study.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><nobr>does <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/editing_studies.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>doesn</b></a> <br><a href="../kernel/readme.html"><b>doing</b></a> <br><nobr>domain <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>dominant</b></a> <br><a href="../kernel/using_catalog_generator.htm"><b>don</b></a> <br><nobr>done <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>dot</b></a> <br><a href="../kernel/using_registry.htm"><b>double</b></a> <br><nobr>down <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>doxygen</b></a> <br><a href="../kernel/readme.html"><b>doxytag</b></a> <br><a href="../kernel/readme.html"><b>doxywizard</b></a> <br><a name="bms_DR"></a><a name="subkey_DR"></a><a href="../kernel/salome_pro_desktop.htm"><b>dragging</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>dramatically</b></a> <br><a href="../kernel/readme.html"><b>drive</b></a> <br><a href="../kernel/navigating_topics.htm"><b>drop</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>dropping</b></a> <br><a name="bms_DU"></a><a name="subkey_DU"></a><a href="../dump_study.htm"><b>dump</b></a> <br><a href="../kernel/readme.html"><b>dumpversion</b></a> <br><a name="bms_DY"></a><a name="subkey_DY"></a><a href="../introduction_to_gui.htm"><b>dynamic</b></a> <br><nobr>dynamically <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br>\r
-<br><br>\r
-<nobr><a name="bm_E"></a><a name="subkey_E{"></a>e <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><a name="bms_EA"></a><a name="subkey_EA"></a><a href="../kernel/introduction.htm"><b>easier</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>easily</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>easy</b></a> <br><a name="bms_EC"></a><a name="subkey_EC"></a><a href="../kernel/about_salome_pro_architecture.htm"><b>economically</b></a> <br><a name="bms_ED"></a><a name="subkey_ED"></a><a href="../mesh_preferences.htm"><b>edges</b></a> <br><nobr>edit <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/editing_studies.htm"><b>4</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>editable</b></a> <br><nobr>editing <a href="../kernel/editing_studies.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>edition</b></a> <br><a href="../setting_preferences.htm"><b>editor</b></a> <br><br><br></p><p class="ftsbody" align="center"><a href="whlstf3.htm" target="_self" title="previous search group"><b>&gt;&gt;</b></a>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstf3.htm b/doc/salome/gui/GUI/whgdata/whlstf3.htm
deleted file mode 100755 (executable)
index f9292a8..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" align="center"><a href="whlstf2.htm" target="_self" title="previous search group"><b>&lt;&lt;</b></a><br><br></p>\r
-<p class="ftsbody" >\r
-<a name="bms_EF"></a><a name="subkey_EF"></a><a href="../kernel/introduction.htm"><b>efficient</b></a> <br><a name="bms_EG"></a><a name="subkey_EG"></a><a href="../kernel/readme.html"><b>egrep</b></a> <br><nobr><a name="bms_EI"></a><a name="subkey_EI"></a>either <a href="../select_color_and_font.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a name="bms_EL"></a><a name="subkey_EL"></a><a href="../kernel/introduction.htm"><b>electrical</b></a> <br><a href="../kernel/introduction.htm"><b>electronic</b></a> <br><nobr>element <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><a href="../mesh_preferences.htm"><b>elements</b></a> <br><a name="bms_EM"></a><a name="subkey_EM"></a><a href="../kernel/running_salome_pro.htm"><b>embedded</b></a> <br><a href="../kernel/displaying_studies.htm"><b>empty</b></a> <br><nobr><a name="bms_EN"></a><a name="subkey_EN"></a>enables <a href="../kernel/using_left-hand_tabs.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>encouraging</b></a> <br><nobr>end <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../setting_preferences.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>enforcing</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>engine</b></a> <br><a href="../kernel/readme.html"><b>enough</b></a> <br><a href="../kernel/introduction.htm"><b>ensure</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>ensuring</b></a> <br><nobr>enter <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><a href="../kernel/readme.html"><b>entered</b></a> <br><a href="../mesh_preferences.htm"><b>entity</b></a> <br><nobr>entry <a href="../kernel/using_object_browser.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>env_</b></a> <br><a href="../kernel/readme.html"><b>env_for_launch</b></a> <br><a href="../kernel/readme.html"><b>env_products</b></a> <br><a href="../kernel/readme.html"><b>env_vtk</b></a> <br><nobr>environment <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/getting_started2.htm"><b>4</b></a> <a href="../kernel/displaying_studies.htm"><b>5</b></a> <a href="../introduction_to_gui.htm"><b>6</b></a> </nobr><br><nobr>environments <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a name="bms_EQ"></a><a name="subkey_EQ"></a><a href="../kernel/readme.html"><b>equal</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>equally</b></a> <br><a href="../kernel/introduction.htm"><b>equipment</b></a> <br><nobr><a name="bms_ER"></a><a name="subkey_ER"></a>error <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><nobr><a name="bms_ET"></a><a name="subkey_ET"></a>etc <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> <a href="../post-pro_preferences.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr><a name="bms_EV"></a><a name="subkey_EV"></a>even <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><a href="../kernel/using_registry.htm"><b>ever</b></a> <br><nobr>every <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>everything</b></a> <br><a href="../kernel/introduction.htm"><b>evolutions</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>evolve</b></a> <br><a name="bms_EX"></a><a name="subkey_EX"></a><a href="../kernel/running_salome_pro.htm"><b>ex</b></a> <br><a href="../kernel/readme.html"><b>exact</b></a> <br><nobr>exactly <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><nobr>example <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../kernel/using_catalog_generator.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>exceeds</b></a> <br><nobr>exception <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>exchanges</b></a> <br><nobr>execution <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>exist</b></a> <br><a href="../kernel/readme.html"><b>existence</b></a> <br><nobr>existing <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../setting_preferences.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> </nobr><br><nobr>exists <a href="../kernel/readme.html"><b>1</b></a> <a href="../setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>expandability</b></a> <br><a href="../kernel/navigating_topics.htm"><b>expanding</b></a> <br><a href="../kernel/introduction.htm"><b>expectations</b></a> <br><a href="../dump_study.htm"><b>expert</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>exploits</b></a> <br><a href="../kernel/about_salome_pro_help_system.htm"><b>explorer</b></a> <br><nobr>export <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>exposes</b></a> <br><a href="../select_color_and_font.htm"><b>extended</b></a> <br><a href="../setting_preferences.htm"><b>extension</b></a> <br><a href="../kernel/saving_a_study.htm"><b>extensions</b></a> <br><a href="../kernel/setting_preferences.htm"><b>external</b></a> <br><a href="../kernel/readme.html"><b>extracting</b></a> <br><a href="../kernel/introduction.htm"><b>extremely</b></a> <br>\r
-<br><br>\r
-<nobr><a name="bm_F"></a><a name="subkey_F{"></a>f <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><nobr><a name="bms_FA"></a><a name="subkey_FA"></a>face <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> </nobr><br><nobr>faces <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>facilitated</b></a> <br><a href="../kernel/introduction_to_salome_pro.htm"><b>facilitates</b></a> <br><nobr>fact <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><a href="../kernel/using_catalog_generator.htm"><b>factory</b></a> <br><a href="../kernel/readme.html"><b>fail</b></a> <br><a href="../kernel/readme.html"><b>fails</b></a> <br><a href="../kernel/readme.html"><b>false</b></a> <br><a href="../post-pro_preferences.htm"><b>families</b></a> <br><nobr><a name="bms_FE"></a><a name="subkey_FE"></a>feature <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_help_system.htm"><b>features</b></a> <br><nobr><a name="bms_FI"></a><a name="subkey_FI"></a>field <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> <a href="../select_color_and_font.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../mesh_preferences.htm"><b>5</b></a> </nobr><br><nobr>fields <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>fig</b></a> <br><a href="../kernel/readme.html"><b>figure</b></a> <br><a href="../geom_preferences.htm"><b>figures</b></a> <br><nobr>file <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>4</b></a> <a href="../kernel/creating_a_new_study.htm"><b>5</b></a> <a href="../dump_study.htm"><b>6</b></a> <a href="../setting_preferences.htm"><b>7</b></a> <a href="../post-pro_preferences.htm"><b>8</b></a> <a href="../kernel/using_catalog_generator.htm"><b>9</b></a> <a href="../kernel/setting_preferences.htm"><b>10</b></a> <a href="../kernel/saving_a_study.htm"><b>11</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>12</b></a> </nobr><br><nobr>files <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/using_catalog_generator.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> </nobr><br><a href="../mesh_preferences.htm"><b>fill</b></a> <br><nobr>find <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>find_in_path</b></a> <br><a href="../kernel/readme.html"><b>finds</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>finely</b></a> <br><nobr>finish <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>finishes</b></a> <br><a href="../kernel/introduction.htm"><b>finite</b></a> <br><nobr>first <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/using_object_browser.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> </nobr><br><a href="../kernel/setting_preferences.htm"><b>fit</b></a> <br><a name="bms_FL"></a><a name="subkey_FL"></a><a href="../kernel/readme.html"><b>flag</b></a> <br><nobr>flexibility <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><nobr>flexible <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> </nobr><br><a name="bms_FO"></a><a name="subkey_FO"></a><a href="../post-pro_preferences.htm"><b>focal</b></a> <br><a href="../kernel/navigating_topics.htm"><b>focus</b></a> <br><nobr>folder <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_object_browser.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> </nobr><br><nobr>follow <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../setting_preferences.htm"><b>followed</b></a> <br><nobr>following <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../kernel/navigating_topics.htm"><b>4</b></a> <a href="../kernel/getting_started2.htm"><b>5</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>6</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>7</b></a> <a href="../dump_study.htm"><b>8</b></a> <a href="../kernel/using_registry.htm"><b>9</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>10</b></a> <a href="../kernel/using_catalog_generator.htm"><b>11</b></a> <a href="../kernel/setting_preferences.htm"><b>12</b></a> <a href="../kernel/saving_a_study.htm"><b>13</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>14</b></a> </nobr><br><nobr>font <a href="../select_color_and_font.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a href="../select_color_and_font.htm"><b>fonts</b></a> <br><a href="../kernel/using_catalog_generator.htm"><b>forget</b></a> <br><nobr>format <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>formats</b></a> <br><a href="../post-pro_preferences.htm"><b>forth</b></a> <br><a name="bms_FP"></a><a name="subkey_FP"></a><a href="../post-pro_preferences.htm"><b>fps</b></a> <br><a name="bms_FR"></a><a name="subkey_FR"></a><a href="../kernel/readme.html"><b>frame</b></a> <br><a href="../post-pro_preferences.htm"><b>frames</b></a> <br><a href="../introduction_to_gui.htm"><b>framework</b></a> <br><nobr>free <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>friendly</b></a> <br><a name="bms_FU"></a><a name="subkey_FU"></a><a href="../dump_study.htm"><b>fulfill</b></a> <br><nobr>full <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>fully</b></a> <br><nobr>function <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>function_name</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>functional</b></a> <br><a href="../kernel/introduction.htm"><b>functionalities</b></a> <br><nobr>functionality <a href="../kernel/getting_started2.htm"><b>1</b></a> <a href="../kernel/editing_studies.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><a href="../kernel/saving_a_study.htm"><b>functioning</b></a> <br><nobr>functions <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>fundamental</b></a> <br><a href="../kernel/readme.html"><b>further</b></a> <br>\r
-<br><br>\r
-<nobr><a name="bm_G"></a><a name="subkey_G{"></a>g <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><a name="bms_GA"></a><a name="subkey_GA"></a><a href="../mesh_preferences.htm"><b>gaps</b></a> <br><nobr>gauss <a href="../introduction_to_gui.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a name="bms_GC"></a><a name="subkey_GC"></a><a href="../kernel/readme.html"><b>gcc</b></a> <br><nobr><a name="bms_GE"></a><a name="subkey_GE"></a>general <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><nobr>generate <a href="../dump_study.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><nobr>generated <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><nobr>generates <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> </nobr><br><nobr>generator <a href="../introduction_to_gui.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>generators</b></a> <br><nobr>generic <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><nobr>geom <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> </nobr><br><nobr>geometrical <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../geom_preferences.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> </nobr><br><nobr>geometry <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../geom_preferences.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><nobr>get <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>2</b></a> </nobr><br><nobr>getting <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/using_object_browser.htm"><b>3</b></a> </nobr><br><br><br></p><p class="ftsbody" align="center"><a href="whlstf4.htm" target="_self" title="previous search group"><b>&gt;&gt;</b></a>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstf4.htm b/doc/salome/gui/GUI/whgdata/whlstf4.htm
deleted file mode 100755 (executable)
index 16b1286..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" align="center"><a href="whlstf3.htm" target="_self" title="previous search group"><b>&lt;&lt;</b></a><br><br></p>\r
-<p class="ftsbody" >\r
-<a name="bms_GI"></a><a name="subkey_GI"></a><a href="../kernel/readme.html"><b>give</b></a> <br><nobr>given <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><nobr>gives <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> <a href="../select_color_and_font.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><a name="bms_GL"></a><a name="subkey_GL"></a><a href="../post-pro_preferences.htm"><b>gl</b></a> <br><a href="../post-pro_preferences.htm"><b>global</b></a> <br><a href="../kernel/using_left-hand_tabs.htm"><b>glossary</b></a> <br><nobr><a name="bms_GO"></a><a name="subkey_GO"></a>go <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> </nobr><br><a name="bms_GR"></a><a name="subkey_GR"></a><a href="../kernel/setting_preferences.htm"><b>graph</b></a> <br><a href="../post-pro_preferences.htm"><b>graphic</b></a> <br><nobr>graphical <a href="../introduction_to_gui.htm"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><nobr>graphs <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>graphviz</b></a> <br><a href="../dump_study.htm"><b>great</b></a> <br><a href="../post-pro_preferences.htm"><b>greater</b></a> <br><a href="../dump_study.htm"><b>greatly</b></a> <br><a href="../select_color_and_font.htm"><b>greek</b></a> <br><a href="../kernel/readme.html"><b>grep</b></a> <br><a href="../select_color_and_font.htm"><b>grouped</b></a> <br><nobr>groups <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><nobr><a name="bms_GU"></a><a name="subkey_GU"></a>gui <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> <a href="../kernel/creating_a_new_study.htm"><b>4</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>5</b></a> <a href="../introduction_to_gui.htm"><b>6</b></a> <a href="../dump_study.htm"><b>7</b></a> <a href="../setting_preferences.htm"><b>8</b></a> <a href="../kernel/setting_preferences.htm"><b>9</b></a> <a href="../kernel/saving_a_study.htm"><b>10</b></a> </nobr><br>\r
-<br><br>\r
-<nobr><a name="bm_H"></a><a name="subkey_H{"></a>h <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><a name="bms_HA"></a><a name="subkey_HA"></a><a href="../post-pro_preferences.htm"><b>half</b></a> <br><nobr>hand <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>3</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>handle</b></a> <br><a href="../kernel/introduction.htm"><b>handled</b></a> <br><a href="../kernel/readme.html"><b>handler</b></a> <br><nobr>handling <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> </nobr><br><nobr>hard <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><a href="../kernel/saving_a_study.htm"><b>hasn</b></a> <br><a href="../kernel/setting_preferences.htm"><b>haven</b></a> <br><nobr>having <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/using_object_browser.htm"><b>3</b></a> </nobr><br><nobr><a name="bms_HD"></a><a name="subkey_HD"></a>hdf <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><a href="../kernel/readme.html"><b>hdf5</b></a> <br><a href="../kernel/readme.html"><b>hdf5home</b></a> <br><a name="bms_HE"></a><a name="subkey_HE"></a><a href="../kernel/introduction.htm"><b>healing</b></a> <br><nobr>height <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/using_registry.htm"><b>hello</b></a> <br><nobr>help <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../kernel/navigating_topics.htm"><b>4</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>5</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>6</b></a> <a href="../kernel/using_object_browser.htm"><b>7</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>8</b></a> <a href="../kernel/setting_preferences.htm"><b>9</b></a> </nobr><br><a href="../kernel/readme.html"><b>helpful</b></a> <br><nobr>helps <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><nobr>here <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>heterogeneous</b></a> <br><nobr><a name="bms_HI"></a><a name="subkey_HI"></a>hide <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>3</b></a> </nobr><br><a href="../kernel/using_object_browser.htm"><b>hiding</b></a> <br><a href="../kernel/introduction.htm"><b>high</b></a> <br><a href="../kernel/readme.html"><b>higher</b></a> <br><a href="../mesh_preferences.htm"><b>highlight</b></a> <br><nobr>highlighted <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_object_browser.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>hints</b></a> <br><a href="../kernel/using_registry.htm"><b>history</b></a> <br><nobr><a name="bms_HO"></a><a name="subkey_HO"></a>home <a href="../kernel/readme.html"><b>1</b></a> <a href="../setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>horizontal <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a href="../kernel/displaying_studies.htm"><b>horizontally</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>host</b></a> <br><a href="../kernel/navigating_topics.htm"><b>hotspot</b></a> <br><a href="../kernel/navigating_topics.htm"><b>hotspots</b></a> <br><nobr>how <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a name="bms_HP"></a><a name="subkey_HP"></a><a href="../kernel/readme.html"><b>hpp</b></a> <br><nobr><a name="bms_HT"></a><a name="subkey_HT"></a>html <a href="../kernel/about_salome_pro_help_system.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><a name="bms_HX"></a><a name="subkey_HX"></a><a href="../kernel/readme.html"><b>hxx</b></a> <br>\r
-<br><br>\r
-<nobr><a name="bm_I"></a><a name="subkey_I{"></a>i <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><nobr><a name="bms_IC"></a><a name="subkey_IC"></a>icon <a href="../kernel/creating_a_new_study.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><nobr>icons <a href="../kernel/editing_studies.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><a name="bms_ID"></a><a name="subkey_ID"></a><a href="../kernel/readme.html"><b>idea</b></a> <br><nobr>identification <a href="../kernel/using_registry.htm"><b>1</b></a> <a href="../kernel/using_object_browser.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>identify</b></a> <br><nobr>idl <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><a name="bms_IE"></a><a name="subkey_IE"></a><a href="../kernel/setting_preferences.htm"><b>ie</b></a> <br><nobr><a name="bms_IF"></a><a name="subkey_IF"></a>if <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../kernel/editing_studies.htm"><b>4</b></a> <a href="../kernel/displaying_studies.htm"><b>5</b></a> <a href="../kernel/creating_a_new_study.htm"><b>6</b></a> <a href="../dump_study.htm"><b>7</b></a> <a href="../post-pro_preferences.htm"><b>8</b></a> <a href="../mesh_preferences.htm"><b>9</b></a> <a href="../kernel/using_object_browser.htm"><b>10</b></a> <a href="../kernel/using_catalog_generator.htm"><b>11</b></a> <a href="../kernel/setting_preferences.htm"><b>12</b></a> <a href="../kernel/saving_a_study.htm"><b>13</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>14</b></a> </nobr><br><a name="bms_IG"></a><a name="subkey_IG"></a><a href="../kernel/introduction.htm"><b>iges</b></a> <br><a href="../kernel/readme.html"><b>ignored</b></a> <br><a name="bms_IM"></a><a name="subkey_IM"></a><a href="../post-pro_preferences.htm"><b>image</b></a> <br><nobr>images <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/navigating_topics.htm"><b>immediately</b></a> <br><nobr>implement <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><nobr>implementation <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>implementing</b></a> <br><a href="../kernel/readme.html"><b>implied</b></a> <br><nobr>import <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../setting_preferences.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> </nobr><br><a href="../kernel/readme.html"><b>important</b></a> <br><nobr>imported <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>imposed</b></a> <br><a href="../introduction_to_gui.htm"><b>improves</b></a> <br><a name="bms_IN"></a><a name="subkey_IN"></a><a href="../kernel/readme.html"><b>inc</b></a> <br><a href="../kernel/readme.html"><b>included</b></a> <br><nobr>includes <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><nobr>including <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>inclusive</b></a> <br><a href="../post-pro_preferences.htm"><b>increase</b></a> <br><nobr>increases <a href="../dump_study.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>increasingly</b></a> <br><nobr>increment <a href="../geom_preferences.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>incrementally</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>independence</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>independent</b></a> <br><a href="../kernel/using_object_browser.htm"><b>index</b></a> <br><a href="../mesh_preferences.htm"><b>indexing</b></a> <br><nobr>indicate <a href="../kernel/saving_a_study.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><nobr>information <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../post-pro_preferences.htm"><b>5</b></a> <a href="../kernel/using_registry.htm"><b>6</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>7</b></a> <a href="../kernel/saving_a_study.htm"><b>8</b></a> </nobr><br><a href="../kernel/getting_started2.htm"><b>initial</b></a> <br><nobr>input <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>insert</b></a> <br><nobr>inside <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> </nobr><br><a href="../kernel/readme.html"><b>inspect</b></a> <br><a href="../post-pro_preferences.htm"><b>inspected</b></a> <br><a href="../kernel/readme.html"><b>instalation</b></a> <br><nobr>install <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>install_binary</b></a> <br><a href="../kernel/readme.html"><b>install_disk_space</b></a> <br><a href="../kernel/readme.html"><b>install_source</b></a> <br><a href="../kernel/readme.html"><b>install_wizard_caption</b></a> <br><a href="../kernel/readme.html"><b>install_wizard_copyright</b></a> <br><a href="../kernel/readme.html"><b>install_wizard_license_info</b></a> <br><a href="../kernel/readme.html"><b>install_wizard_root_directory</b></a> <br><a href="../kernel/readme.html"><b>install_wizard_version</b></a> <br><nobr>installation <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>installation_mode</b></a> <br><a href="../kernel/readme.html"><b>installation_script_name</b></a> <br><a href="../kernel/readme.html"><b>installdiskspace</b></a> <br><nobr>installed <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>installing</b></a> <br><a href="../kernel/readme.html"><b>installwizard_root_directory</b></a> <br><a href="../kernel/readme.html"><b>installworkxxxxx</b></a> <br><a href="../kernel/creating_a_new_study.htm"><b>instances</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>instrumental</b></a> <br><a href="../kernel/readme.html"><b>integer</b></a> <br><a href="../mesh_preferences.htm"><b>integers</b></a> <br><a href="../kernel/introduction_to_salome_pro.htm"><b>integrate</b></a> <br><nobr>integrated <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> </nobr><br><a href="../kernel/introduction_to_salome_pro.htm"><b>integrates</b></a> <br><nobr>integration <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../kernel/using_catalog_generator.htm"><b>4</b></a> </nobr><br><a href="../kernel/readme.html"><b>intend</b></a> <br><a href="../introduction_to_gui.htm"><b>interaction</b></a> <br><nobr>interface <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>interfaces <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../kernel/using_catalog_generator.htm"><b>4</b></a> </nobr><br><a href="../mesh_preferences.htm"><b>interior</b></a> <br><nobr>internal <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_help_system.htm"><b>internet</b></a> <br><a href="../kernel/introduction.htm"><b>interoperability</b></a> <br><a href="../kernel/using_object_browser.htm"><b>interoperable</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>interp</b></a> <br><nobr>interpreter <a href="../introduction_to_gui.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><nobr>interval <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/using_registry.htm"><b>2</b></a> </nobr><br><nobr>introduction <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> </nobr><br><a href="../kernel/saving_a_study.htm"><b>invalid</b></a> <br><a href="../kernel/readme.html"><b>invoke</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>invoked</b></a> <br><br><br></p><p class="ftsbody" align="center"><a href="whlstf5.htm" target="_self" title="previous search group"><b>&gt;&gt;</b></a>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstf5.htm b/doc/salome/gui/GUI/whgdata/whlstf5.htm
deleted file mode 100755 (executable)
index e85e021..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" align="center"><a href="whlstf4.htm" target="_self" title="previous search group"><b>&lt;&lt;</b></a><br><br></p>\r
-<p class="ftsbody" >\r
-<nobr><a name="bms_IO"></a><a name="subkey_IO"></a>ior <a href="../kernel/using_object_browser.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a name="bms_IS"></a><a name="subkey_IS"></a><a href="../kernel/setting_preferences.htm"><b>isolines</b></a> <br><a href="../kernel/readme.html"><b>ispython</b></a> <br><a name="bms_IT"></a><a name="subkey_IT"></a><a href="../kernel/getting_properties_of_the_study.htm"><b>item</b></a> <br><nobr>items <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>iterations</b></a> <br><a href="../kernel/readme.html"><b>itself</b></a> <br>\r
-<br><br>\r
-<a name="bm_J"></a><a name="subkey_JA"></a><a href="../kernel/about_salome_pro_help_system.htm"><b>java</b></a> <br><nobr><a name="bms_JU"></a><a name="subkey_JU"></a>just <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br>\r
-<br><br>\r
-<a name="bm_K"></a><a name="subkey_K{"></a><a href="../kernel/running_salome_pro.htm"><b>k</b></a> <br><a name="bms_KB"></a><a name="subkey_KB"></a><a href="../kernel/readme.html"><b>kbytes</b></a> <br><nobr><a name="bms_KE"></a><a name="subkey_KE"></a>kernel <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> </nobr><br><nobr>key <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>keyboard</b></a> <br><a name="bms_KI"></a><a name="subkey_KI"></a><a href="../kernel/running_salome_pro.htm"><b>kill</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>killall</b></a> <br><nobr>kind <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> </nobr><br><a name="bms_KN"></a><a name="subkey_KN"></a><a href="../kernel/using_catalog_generator.htm"><b>know</b></a> <br><a href="../dump_study.htm"><b>knowledge</b></a> <br>\r
-<br><br>\r
-<a name="bm_L"></a><a name="subkey_L{"></a><a href="../kernel/running_salome_pro.htm"><b>l</b></a> <br><nobr><a name="bms_LA"></a><a name="subkey_LA"></a>labels <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>language</b></a> <br><a href="../kernel/readme.html"><b>larger</b></a> <br><a href="../post-pro_preferences.htm"><b>largest</b></a> <br><nobr>last <a href="../kernel/using_registry.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>latest</b></a> <br><a href="../select_color_and_font.htm"><b>latin</b></a> <br><nobr>launch <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../setting_preferences.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> </nobr><br><nobr>launched <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> <a href="../kernel/using_registry.htm"><b>5</b></a> </nobr><br><a href="../kernel/readme.html"><b>launches</b></a> <br><nobr>launching <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/using_registry.htm"><b>3</b></a> <a href="../kernel/using_catalog_generator.htm"><b>4</b></a> </nobr><br><a href="../kernel/creating_a_new_study.htm"><b>layer</b></a> <br><nobr>layout <a href="../dump_study.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a name="bms_LD"></a><a name="subkey_LD"></a><a href="../kernel/readme.html"><b>ld_library_path</b></a> <br><a name="bms_LE"></a><a name="subkey_LE"></a><a href="../kernel/saving_a_study.htm"><b>lead</b></a> <br><a href="../kernel/readme.html"><b>learn</b></a> <br><a href="../kernel/introduction.htm"><b>learning</b></a> <br><nobr>left <a href="../kernel/readme.html"><b>1</b></a> <a href="../select_color_and_font.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../mesh_preferences.htm"><b>4</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>5</b></a> <a href="../kernel/setting_preferences.htm"><b>6</b></a> </nobr><br><a href="../kernel/setting_preferences.htm"><b>legend</b></a> <br><a href="../post-pro_preferences.htm"><b>length</b></a> <br><a href="../post-pro_preferences.htm"><b>less</b></a> <br><nobr>level <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><a name="bms_LI"></a><a name="subkey_LI"></a><a href="../kernel/readme.html"><b>lib</b></a> <br><a href="../kernel/readme.html"><b>libcosnotify4</b></a> <br><a href="../kernel/readme.html"><b>libhdf5</b></a> <br><a href="../kernel/readme.html"><b>libmed</b></a> <br><a href="../kernel/readme.html"><b>libomniorb4</b></a> <br><a href="../kernel/readme.html"><b>libqwt</b></a> <br><a href="../kernel/readme.html"><b>libraries</b></a> <br><nobr>library <a href="../kernel/readme.html"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>libstdplugin</b></a> <br><a href="../kernel/readme.html"><b>libtcl8</b></a> <br><a href="../kernel/readme.html"><b>libtk8</b></a> <br><a href="../kernel/readme.html"><b>libvtkcommon</b></a> <br><a href="../kernel/readme.html"><b>license</b></a> <br><nobr>like <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../post-pro_preferences.htm"><b>5</b></a> <a href="../kernel/using_object_browser.htm"><b>6</b></a> <a href="../kernel/using_catalog_generator.htm"><b>7</b></a> <a href="../kernel/saving_a_study.htm"><b>8</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>9</b></a> </nobr><br><a href="../kernel/readme.html"><b>likely</b></a> <br><a href="../post-pro_preferences.htm"><b>limitation</b></a> <br><a href="../post-pro_preferences.htm"><b>limits</b></a> <br><nobr>line <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>3</b></a> <a href="../geom_preferences.htm"><b>4</b></a> <a href="../post-pro_preferences.htm"><b>5</b></a> <a href="../mesh_preferences.htm"><b>6</b></a> <a href="../kernel/setting_preferences.htm"><b>7</b></a> </nobr><br><a href="../kernel/setting_preferences.htm"><b>linear</b></a> <br><nobr>lines <a href="../mesh_preferences.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>link <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><nobr>links <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><nobr>linux <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>2</b></a> </nobr><br><nobr>list <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/navigating_topics.htm"><b>3</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>4</b></a> <a href="../kernel/using_registry.htm"><b>5</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>6</b></a> <a href="../kernel/setting_preferences.htm"><b>7</b></a> </nobr><br><a href="../kernel/readme.html"><b>list_of_prerequisites</b></a> <br><a href="../post-pro_preferences.htm"><b>listed</b></a> <br><a name="bms_LL"></a><a name="subkey_LL"></a><a href="../kernel/setting_preferences.htm"><b>ll</b></a> <br><nobr><a name="bms_LO"></a><a name="subkey_LO"></a>load <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../setting_preferences.htm"><b>3</b></a> </nobr><br><nobr>loaded <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/using_object_browser.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>loading <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>local</b></a> <br><a href="../kernel/using_left-hand_tabs.htm"><b>locate</b></a> <br><nobr>located <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/using_object_browser.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>location <a href="../dump_study.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><a href="../kernel/getting_properties_of_the_study.htm"><b>lock</b></a> <br><nobr>locked <a href="../kernel/getting_properties_of_the_study.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>locking</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>log</b></a> <br><nobr>logarithmic <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/running_salome_pro.htm"><b>logger</b></a> <br><nobr>long <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../kernel/using_catalog_generator.htm"><b>look</b></a> <br><nobr>lookout <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><nobr>looks <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><a href="../kernel/saving_a_study.htm"><b>lost</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>lot</b></a> <br><nobr>lower <a href="../kernel/readme.html"><b>1</b></a> <a href="../select_color_and_font.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>4</b></a> </nobr><br>\r
-<br><br>\r
-<a name="bm_M"></a><a name="subkey_M{"></a><a href="../kernel/running_salome_pro.htm"><b>m</b></a> <br><nobr><a name="bms_MA"></a><a name="subkey_MA"></a>machine <a href="../kernel/using_registry.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>machines</b></a> <br><a href="../kernel/about_salome_pro_help_system.htm"><b>macintosh</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>macro</b></a> <br><a href="../post-pro_preferences.htm"><b>magnification</b></a> <br><nobr>main <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>4</b></a> <a href="../kernel/editing_studies.htm"><b>5</b></a> <a href="../kernel/creating_a_new_study.htm"><b>6</b></a> <a href="../dump_study.htm"><b>7</b></a> <a href="../post-pro_preferences.htm"><b>8</b></a> <a href="../kernel/using_registry.htm"><b>9</b></a> <a href="../kernel/using_catalog_generator.htm"><b>10</b></a> <a href="../kernel/setting_preferences.htm"><b>11</b></a> <a href="../kernel/saving_a_study.htm"><b>12</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>13</b></a> </nobr><br><a href="../kernel/readme.html"><b>major</b></a> <br><nobr>make <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/creating_a_new_study.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>make_dir</b></a> <br><a href="../kernel/readme.html"><b>make_env</b></a> <br><a href="../kernel/introduction.htm"><b>makes</b></a> <br><nobr>manage <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>management <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>mandrake</b></a> <br><a href="../kernel/readme.html"><b>mandrake10</b></a> <br><a href="../post-pro_preferences.htm"><b>manipulate</b></a> <br><a href="../post-pro_preferences.htm"><b>manipulator</b></a> <br><nobr>manual <a href="../kernel/about_salome_pro_help_system.htm"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>manually</b></a> <br><a href="../kernel/setting_preferences.htm"><b>manuals</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>mapped</b></a> <br><a href="../kernel/readme.html"><b>mark</b></a> <br><a href="../kernel/readme.html"><b>marked</b></a> <br><a href="../kernel/setting_preferences.htm"><b>marker</b></a> <br><a href="../kernel/setting_preferences.htm"><b>markers</b></a> <br><a href="../kernel/introduction.htm"><b>market</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>massively</b></a> <br><a href="../kernel/readme.html"><b>master</b></a> <br><a href="../kernel/using_left-hand_tabs.htm"><b>matches</b></a> <br><a href="../post-pro_preferences.htm"><b>matrix</b></a> <br><a href="../post-pro_preferences.htm"><b>max</b></a> <br><a href="../kernel/creating_a_new_study.htm"><b>maximize</b></a> <br><a href="../post-pro_preferences.htm"><b>maximum</b></a> <br><a name="bms_ME"></a><a name="subkey_ME"></a><a href="../post-pro_preferences.htm"><b>mean</b></a> <br><nobr>means <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>mechanism <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><a href="../introduction_to_gui.htm"><b>mechanisms</b></a> <br><a href="../kernel/readme.html"><b>med2home</b></a> <br><a href="../kernel/introduction.htm"><b>meet</b></a> <br><a href="../post-pro_preferences.htm"><b>memory</b></a> <br><a href="../kernel/readme.html"><b>mentioned</b></a> <br><nobr>menu <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/editing_studies.htm"><b>4</b></a> <a href="../kernel/creating_a_new_study.htm"><b>5</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>6</b></a> <a href="../introduction_to_gui.htm"><b>7</b></a> <a href="../dump_study.htm"><b>8</b></a> <a href="../setting_preferences.htm"><b>9</b></a> <a href="../select_color_and_font.htm"><b>10</b></a> <a href="../post-pro_preferences.htm"><b>11</b></a> <a href="../mesh_preferences.htm"><b>12</b></a> <a href="../kernel/using_registry.htm"><b>13</b></a> <a href="../kernel/using_object_browser.htm"><b>14</b></a> <a href="../kernel/using_catalog_generator.htm"><b>15</b></a> <a href="../kernel/setting_preferences.htm"><b>16</b></a> <a href="../kernel/saving_a_study.htm"><b>17</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>18</b></a> </nobr><br><a href="../kernel/salome_pro_desktop.htm"><b>menubar</b></a> <br><nobr>menus <a href="../introduction_to_gui.htm"><b>1</b></a> <a href="../select_color_and_font.htm"><b>2</b></a> <a href="../kernel/using_object_browser.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><nobr>mesh <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../mesh_preferences.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>meshes <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><nobr>meshing <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><nobr>message <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> </nobr><br><nobr>messages <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> </nobr><br><a name="bms_MI"></a><a name="subkey_MI"></a><a href="../kernel/readme.html"><b>middle</b></a> <br><a href="../post-pro_preferences.htm"><b>min</b></a> <br><a href="../kernel/creating_a_new_study.htm"><b>minimized</b></a> <br><a href="../post-pro_preferences.htm"><b>minimum</b></a> <br><a href="../kernel/readme.html"><b>minor</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>mistakes</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>mix</b></a> <br><br><br></p><p class="ftsbody" align="center"><a href="whlstf6.htm" target="_self" title="previous search group"><b>&gt;&gt;</b></a>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstf6.htm b/doc/salome/gui/GUI/whgdata/whlstf6.htm
deleted file mode 100755 (executable)
index 4b7703c..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" align="center"><a href="whlstf5.htm" target="_self" title="previous search group"><b>&lt;&lt;</b></a><br><br></p>\r
-<p class="ftsbody" >\r
-<nobr><a name="bms_MO"></a><a name="subkey_MO"></a>mode <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../geom_preferences.htm"><b>4</b></a> <a href="../dump_study.htm"><b>5</b></a> <a href="../post-pro_preferences.htm"><b>6</b></a> <a href="../mesh_preferences.htm"><b>7</b></a> </nobr><br><nobr>model <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><nobr>modeling <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><nobr>models <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>modern</b></a> <br><nobr>modes <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><nobr>modification <a href="../kernel/getting_properties_of_the_study.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> </nobr><br><a href="../kernel/getting_properties_of_the_study.htm"><b>modifications</b></a> <br><nobr>modify <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>modifying</b></a> <br><nobr>module <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/editing_studies.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> <a href="../geom_preferences.htm"><b>5</b></a> <a href="../setting_preferences.htm"><b>6</b></a> <a href="../post-pro_preferences.htm"><b>7</b></a> <a href="../mesh_preferences.htm"><b>8</b></a> <a href="../kernel/using_catalog_generator.htm"><b>9</b></a> <a href="../kernel/saving_a_study.htm"><b>10</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>11</b></a> </nobr><br><a href="../kernel/readme.html"><b>module_root_dir</b></a> <br><a href="../kernel/readme.html"><b>module_src_dir</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>module1</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>module2</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>modulecatalog</b></a> <br><nobr>modules <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>4</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>5</b></a> <a href="../introduction_to_gui.htm"><b>6</b></a> <a href="../kernel/using_catalog_generator.htm"><b>7</b></a> <a href="../kernel/setting_preferences.htm"><b>8</b></a> <a href="../kernel/saving_a_study.htm"><b>9</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>10</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>modulus</b></a> <br><nobr>moment <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>momentarily</b></a> <br><nobr>mouse <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>3</b></a> </nobr><br><a href="../kernel/displaying_studies.htm"><b>move</b></a> <br><a href="../post-pro_preferences.htm"><b>movement</b></a> <br><a href="../post-pro_preferences.htm"><b>movements</b></a> <br><a href="../kernel/setting_preferences.htm"><b>mozilla</b></a> <br><a name="bms_MS"></a><a name="subkey_MS"></a><a href="../kernel/readme.html"><b>msg2qm</b></a> <br><a href="../kernel/readme.html"><b>msg2qm_root</b></a> <br><a name="bms_MU"></a><a name="subkey_MU"></a><a href="../kernel/readme.html"><b>much</b></a> <br><nobr>multi <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>multifile <a href="../kernel/setting_preferences.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/saving_a_study.htm"><b>multiple</b></a> <br><a href="../post-pro_preferences.htm"><b>multiplied</b></a> <br><a href="../post-pro_preferences.htm"><b>multiplies</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>multitier</b></a> <br><nobr>must <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> </nobr><br>\r
-<br><br>\r
-<nobr><a name="bm_N"></a><a name="subkey_N{"></a>n <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><nobr><a name="bms_NA"></a><a name="subkey_NA"></a>name <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> <a href="../kernel/creating_a_new_study.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> <a href="../kernel/using_registry.htm"><b>5</b></a> <a href="../kernel/using_object_browser.htm"><b>6</b></a> <a href="../kernel/using_catalog_generator.htm"><b>7</b></a> <a href="../kernel/saving_a_study.htm"><b>8</b></a> </nobr><br><nobr>named <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><nobr>names <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>native</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>natural</b></a> <br><a href="../kernel/editing_studies.htm"><b>nature</b></a> <br><nobr>navigate <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> </nobr><br><a href="../kernel/navigating_topics.htm"><b>navigating</b></a> <br><nobr>navigation <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/about_salome_pro_help_system.htm"><b>navigator</b></a> <br><nobr><a name="bms_NE"></a><a name="subkey_NE"></a>necessary <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> <a href="../mesh_preferences.htm"><b>4</b></a> <a href="../kernel/using_object_browser.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><nobr>need <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../select_color_and_font.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>needed</b></a> <br><a href="../post-pro_preferences.htm"><b>negative</b></a> <br><a href="../kernel/readme.html"><b>netgen</b></a> <br><a href="../kernel/readme.html"><b>netgenroot</b></a> <br><nobr>netscape <a href="../kernel/about_salome_pro_help_system.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>nevertheless</b></a> <br><nobr>new <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/getting_started2.htm"><b>3</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>4</b></a> <a href="../kernel/creating_a_new_study.htm"><b>5</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>6</b></a> <a href="../setting_preferences.htm"><b>7</b></a> <a href="../kernel/using_catalog_generator.htm"><b>8</b></a> <a href="../kernel/setting_preferences.htm"><b>9</b></a> <a href="../kernel/saving_a_study.htm"><b>10</b></a> </nobr><br><a href="../kernel/readme.html"><b>newer</b></a> <br><nobr>next <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../setting_preferences.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> </nobr><br><a name="bms_NF"></a><a name="subkey_NF"></a><a href="../kernel/readme.html"><b>nf</b></a> <br><nobr><a name="bms_NO"></a><a name="subkey_NO"></a>nodes <a href="../mesh_preferences.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><a href="../kernel/displaying_studies.htm"><b>normal</b></a> <br><a href="../kernel/readme.html"><b>notation</b></a> <br><nobr>note <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>notes</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>noticeably</b></a> <br><a href="../kernel/readme.html"><b>notifd</b></a> <br><a href="../setting_preferences.htm"><b>notification</b></a> <br><a href="../post-pro_preferences.htm"><b>notify</b></a> <br><a href="../kernel/getting_started2.htm"><b>notion</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>now</b></a> <br><a name="bms_NT"></a><a name="subkey_NT"></a><a href="../post-pro_preferences.htm"><b>nth</b></a> <br><nobr><a name="bms_NU"></a><a name="subkey_NU"></a>null <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><nobr>number <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> <a href="../setting_preferences.htm"><b>4</b></a> <a href="../post-pro_preferences.htm"><b>5</b></a> <a href="../mesh_preferences.htm"><b>6</b></a> <a href="../kernel/using_registry.htm"><b>7</b></a> <a href="../kernel/setting_preferences.htm"><b>8</b></a> </nobr><br><nobr>numbers <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><nobr>numeric <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../select_color_and_font.htm"><b>4</b></a> </nobr><br><nobr>numerical <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> </nobr><br><a href="../kernel/running_salome_pro.htm"><b>numerous</b></a> <br>\r
-<br><br>\r
-<nobr><a name="bm_O"></a><a name="subkey_OB"></a>object <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/editing_studies.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> <a href="../kernel/creating_a_new_study.htm"><b>4</b></a> <a href="../introduction_to_gui.htm"><b>5</b></a> <a href="../post-pro_preferences.htm"><b>6</b></a> <a href="../mesh_preferences.htm"><b>7</b></a> <a href="../kernel/using_object_browser.htm"><b>8</b></a> <a href="../kernel/setting_preferences.htm"><b>9</b></a> <a href="../kernel/saving_a_study.htm"><b>10</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>11</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>objectives</b></a> <br><nobr>objects <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> <a href="../setting_preferences.htm"><b>5</b></a> <a href="../post-pro_preferences.htm"><b>6</b></a> <a href="../kernel/using_object_browser.htm"><b>7</b></a> <a href="../kernel/saving_a_study.htm"><b>8</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>9</b></a> </nobr><br><a href="../kernel/readme.html"><b>obligatory</b></a> <br><nobr><a name="bms_OC"></a><a name="subkey_OC"></a>occ <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../kernel/creating_a_new_study.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a href="../kernel/readme.html"><b>occ_version_major</b></a> <br><a href="../kernel/readme.html"><b>occ_version_minor</b></a> <br><a href="../kernel/readme.html"><b>occupies</b></a> <br><a name="bms_OF"></a><a name="subkey_OF"></a><a href="../kernel/readme.html"><b>off</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>offered</b></a> <br><a href="../kernel/readme.html"><b>officially</b></a> <br><a href="../kernel/introduction.htm"><b>often</b></a> <br><nobr><a name="bms_OK"></a><a name="subkey_OK"></a>ok <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../setting_preferences.htm"><b>3</b></a> </nobr><br><a name="bms_OM"></a><a name="subkey_OM"></a><a href="../kernel/about_salome_pro_architecture.htm"><b>omg</b></a> <br><a href="../kernel/readme.html"><b>omit</b></a> <br><a href="../kernel/readme.html"><b>omni</b></a> <br><a href="../kernel/readme.html"><b>omninotify</b></a> <br><a href="../kernel/readme.html"><b>omniorb</b></a> <br><a href="../kernel/readme.html"><b>omniorbdir</b></a> <br><a href="../kernel/readme.html"><b>omniorbpy</b></a> <br><a name="bms_ON"></a><a name="subkey_ON"></a><a href="../post-pro_preferences.htm"><b>once</b></a> <br><nobr>one <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../kernel/navigating_topics.htm"><b>4</b></a> <a href="../kernel/editing_studies.htm"><b>5</b></a> <a href="../kernel/displaying_studies.htm"><b>6</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>7</b></a> <a href="../introduction_to_gui.htm"><b>8</b></a> <a href="../dump_study.htm"><b>9</b></a> <a href="../setting_preferences.htm"><b>10</b></a> <a href="../select_color_and_font.htm"><b>11</b></a> <a href="../post-pro_preferences.htm"><b>12</b></a> <a href="../kernel/using_catalog_generator.htm"><b>13</b></a> <a href="../kernel/setting_preferences.htm"><b>14</b></a> <a href="../kernel/saving_a_study.htm"><b>15</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>16</b></a> </nobr><br><a href="../kernel/readme.html"><b>ones</b></a> <br><a href="../kernel/using_left-hand_tabs.htm"><b>online</b></a> <br><a name="bms_OP"></a><a name="subkey_OP"></a><a href="../post-pro_preferences.htm"><b>opaque</b></a> <br><nobr>open <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../kernel/navigating_topics.htm"><b>4</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>5</b></a> <a href="../kernel/introduction.htm"><b>6</b></a> <a href="../kernel/getting_started2.htm"><b>7</b></a> <a href="../kernel/displaying_studies.htm"><b>8</b></a> <a href="../dump_study.htm"><b>9</b></a> <a href="../post-pro_preferences.htm"><b>10</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>11</b></a> <a href="../kernel/using_catalog_generator.htm"><b>12</b></a> <a href="../kernel/saving_a_study.htm"><b>13</b></a> </nobr><br><a href="../kernel/readme.html"><b>opencascade</b></a> <br><nobr>opening <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><nobr>opens <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><a href="../dump_study.htm"><b>operated</b></a> <br><nobr>operation <a href="../kernel/editing_studies.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> </nobr><br><nobr>operations <a href="../kernel/getting_started2.htm"><b>1</b></a> <a href="../kernel/editing_studies.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/introduction_to_salome_pro.htm"><b>optimization</b></a> <br><nobr>optimize <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>optimized</b></a> <br><nobr>option <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/editing_studies.htm"><b>4</b></a> <a href="../post-pro_preferences.htm"><b>5</b></a> <a href="../kernel/setting_preferences.htm"><b>6</b></a> <a href="../kernel/saving_a_study.htm"><b>7</b></a> </nobr><br><a href="../kernel/readme.html"><b>optional</b></a> <br><nobr>optionally <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><nobr>options <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/using_object_browser.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><a name="bms_OR"></a><a name="subkey_OR"></a><a href="../kernel/readme.html"><b>order</b></a> <br><nobr>ordinate <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>org</b></a> <br><nobr>orientation <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><nobr>origin <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><a href="../dump_study.htm"><b>original</b></a> <br><a href="../kernel/introduction_to_salome_pro.htm"><b>originality</b></a> <br><a name="bms_OS"></a><a name="subkey_OS"></a><a href="../kernel/readme.html"><b>os</b></a> <br><a href="../kernel/readme.html"><b>os_version</b></a> <br><nobr><a name="bms_OT"></a><a name="subkey_OT"></a>others <a href="../kernel/about_salome_pro_help_system.htm"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><nobr>otherwise <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><br><br></p><p class="ftsbody" align="center"><a href="whlstf7.htm" target="_self" title="previous search group"><b>&gt;&gt;</b></a>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstf7.htm b/doc/salome/gui/GUI/whgdata/whlstf7.htm
deleted file mode 100755 (executable)
index b27ee0b..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" align="center"><a href="whlstf6.htm" target="_self" title="previous search group"><b>&lt;&lt;</b></a><br><br></p>\r
-<p class="ftsbody" >\r
-<nobr><a name="bms_OU"></a><a name="subkey_OU"></a>out <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../select_color_and_font.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><a href="../mesh_preferences.htm"><b>outline</b></a> <br><nobr>output <a href="../kernel/readme.html"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> </nobr><br><nobr>outside <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><a name="bms_OV"></a><a name="subkey_OV"></a><a href="../kernel/readme.html"><b>overrides</b></a> <br><nobr><a name="bms_OW"></a><a name="subkey_OW"></a>own <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../introduction_to_gui.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br>\r
-<br><br>\r
-<a name="bm_P"></a><a name="subkey_P{"></a><a href="../kernel/running_salome_pro.htm"><b>p</b></a> <br><nobr><a name="bms_PA"></a><a name="subkey_PA"></a>package <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>packages</b></a> <br><a href="../kernel/readme.html"><b>page</b></a> <br><nobr>pages <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><nobr>pane <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><a href="../kernel/saving_a_study.htm"><b>panning</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>parallel</b></a> <br><nobr>parameter <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><nobr>parameters <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../select_color_and_font.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/setting_preferences.htm"><b>6</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>parent</b></a> <br><nobr>part <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> </nobr><br><a href="../kernel/saving_a_study.htm"><b>particular</b></a> <br><a href="../kernel/introduction.htm"><b>particularly</b></a> <br><nobr>parts <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction_to_salome_pro.htm"><b>party</b></a> <br><a href="../kernel/readme.html"><b>pass</b></a> <br><nobr>paste <a href="../kernel/editing_studies.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><a href="../kernel/salome_pro_desktop.htm"><b>pasting</b></a> <br><a href="../kernel/readme.html"><b>patched</b></a> <br><a href="../post-pro_preferences.htm"><b>patent</b></a> <br><nobr>path <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a name="bms_PC"></a><a name="subkey_PC"></a><a href="../kernel/about_salome_pro_architecture.htm"><b>pc</b></a> <br><a name="bms_PE"></a><a name="subkey_PE"></a><a href="../post-pro_preferences.htm"><b>per</b></a> <br><nobr>perform <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><nobr>performance <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> </nobr><br><nobr>performed <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/introduction_to_salome_pro.htm"><b>performs</b></a> <br><a href="../kernel/readme.html"><b>permission</b></a> <br><a name="bms_PH"></a><a name="subkey_PH"></a><a href="../kernel/about_salome_pro_architecture.htm"><b>phenomena</b></a> <br><a href="../kernel/using_left-hand_tabs.htm"><b>phrases</b></a> <br><nobr>physical <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>physics</b></a> <br><a name="bms_PI"></a><a name="subkey_PI"></a><a href="../kernel/readme.html"><b>pick</b></a> <br><a href="../post-pro_preferences.htm"><b>picking</b></a> <br><a href="../kernel/readme.html"><b>picks</b></a> <br><a href="../kernel/readme.html"><b>pickup</b></a> <br><a href="../kernel/readme.html"><b>pickup_env</b></a> <br><a href="../kernel/readme.html"><b>pickup_env_flag</b></a> <br><a href="../kernel/readme.html"><b>pickupenv</b></a> <br><a href="../kernel/getting_properties_of_the_study.htm"><b>picture</b></a> <br><a href="../kernel/using_registry.htm"><b>pid</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>piece</b></a> <br><a href="../post-pro_preferences.htm"><b>pixels</b></a> <br><nobr><a name="bms_PL"></a><a name="subkey_PL"></a>place <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>3</b></a> </nobr><br><nobr>placed <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>3</b></a> </nobr><br><nobr>placement <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><nobr>platform <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> <a href="../kernel/introduction.htm"><b>4</b></a> <a href="../kernel/getting_started2.htm"><b>5</b></a> <a href="../kernel/displaying_studies.htm"><b>6</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>7</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>8</b></a> <a href="../introduction_to_gui.htm"><b>9</b></a> <a href="../dump_study.htm"><b>10</b></a> <a href="../kernel/using_registry.htm"><b>11</b></a> <a href="../kernel/using_catalog_generator.htm"><b>12</b></a> <a href="../kernel/saving_a_study.htm"><b>13</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>14</b></a> </nobr><br><a href="../kernel/readme.html"><b>platforms</b></a> <br><a href="../dump_study.htm"><b>played</b></a> <br><a href="../kernel/readme.html"><b>please</b></a> <br><nobr>plot <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> </nobr><br><nobr>plot2d <a href="../kernel/creating_a_new_study.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../introduction_to_gui.htm"><b>plug</b></a> <br><a name="bms_PO"></a><a name="subkey_PO"></a><a href="../kernel/readme.html"><b>po</b></a> <br><nobr>point <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><nobr>points <a href="../kernel/readme.html"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><nobr>pop <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/using_object_browser.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><a href="../kernel/navigating_topics.htm"><b>popup</b></a> <br><a href="../kernel/navigating_topics.htm"><b>popups</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>port</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>portkill</b></a> <br><nobr>position <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><nobr>positions <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><a href="../kernel/salome_pro_desktop.htm"><b>positively</b></a> <br><nobr>possibility <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> <a href="../select_color_and_font.htm"><b>5</b></a> <a href="../kernel/using_catalog_generator.htm"><b>6</b></a> </nobr><br><nobr>possible <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> <a href="../select_color_and_font.htm"><b>4</b></a> <a href="../kernel/using_object_browser.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><nobr>post <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><a href="../introduction_to_gui.htm"><b>powerful</b></a> <br><nobr><a name="bms_PR"></a><a name="subkey_PR"></a>pre <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><a href="../mesh_preferences.htm"><b>precision</b></a> <br><a href="../kernel/readme.html"><b>precompiled</b></a> <br><nobr>predefined <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../select_color_and_font.htm"><b>3</b></a> </nobr><br><a href="../kernel/running_salome_pro.htm"><b>preferable</b></a> <br><nobr>preferences <a href="../geom_preferences.htm"><b>1</b></a> <a href="../setting_preferences.htm"><b>2</b></a> <a href="../select_color_and_font.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../mesh_preferences.htm"><b>5</b></a> <a href="../kernel/using_object_browser.htm"><b>6</b></a> <a href="../kernel/setting_preferences.htm"><b>7</b></a> </nobr><br><a href="../kernel/readme.html"><b>prefix</b></a> <br><a href="../kernel/readme.html"><b>preinstalled</b></a> <br><a href="../kernel/readme.html"><b>preliminary</b></a> <br><a href="../kernel/readme.html"><b>prerequisite</b></a> <br><a href="../kernel/readme.html"><b>prerequisites</b></a> <br><a href="../mesh_preferences.htm"><b>preselected</b></a> <br><a href="../mesh_preferences.htm"><b>preselection</b></a> <br><a href="../post-pro_preferences.htm"><b>present</b></a> <br><nobr>presentation <a href="../kernel/creating_a_new_study.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><nobr>presentations <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>3</b></a> </nobr><br><a href="../mesh_preferences.htm"><b>presented</b></a> <br><nobr>press <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>pressed</b></a> <br><nobr>pressing <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>prevents</b></a> <br><a href="../select_color_and_font.htm"><b>preview</b></a> <br><nobr>previous <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> </nobr><br><nobr>previously <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>primitive</b></a> <br><a href="../post-pro_preferences.htm"><b>primitives</b></a> <br><nobr>print <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>print_env</b></a> <br><a href="../kernel/readme.html"><b>printed</b></a> <br><a href="../kernel/readme.html"><b>prints</b></a> <br><a href="../kernel/introduction.htm"><b>priority</b></a> <br><nobr>pro <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>5</b></a> </nobr><br><a href="../kernel/creating_a_new_study.htm"><b>probably</b></a> <br><nobr>problem <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>problems</b></a> <br><nobr>procedure <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> </nobr><br><nobr>proceed <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> </nobr><br><nobr>process <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> <a href="../kernel/using_registry.htm"><b>5</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>processed</b></a> <br><a href="../kernel/using_registry.htm"><b>processes</b></a> <br><nobr>processing <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> </nobr><br><nobr>processors <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>produces</b></a> <br><a href="../kernel/readme.html"><b>product</b></a> <br><a href="../kernel/readme.html"><b>product_context</b></a> <br><a href="../kernel/readme.html"><b>product_description</b></a> <br><a href="../kernel/readme.html"><b>product_name</b></a> <br><a href="../kernel/readme.html"><b>product_script_name</b></a> <br><a href="../kernel/readme.html"><b>product_version</b></a> <br><nobr>productivity <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><nobr>products <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>products_directory</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>profile</b></a> <br><a href="../kernel/readme.html"><b>program</b></a> <br><a href="../kernel/introduction.htm"><b>programmatic</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>programming</b></a> <br><nobr>progress <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>progressive</b></a> <br><a href="../kernel/readme.html"><b>prompted</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>prompting</b></a> <br><a href="../dump_study.htm"><b>prone</b></a> <br><a href="../kernel/readme.html"><b>proper</b></a> <br><a href="../kernel/readme.html"><b>properly</b></a> <br><nobr>properties <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> </nobr><br><a href="../kernel/readme.html"><b>proposed</b></a> <br><a href="../introduction_to_gui.htm"><b>proposes</b></a> <br><nobr>provide <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/editing_studies.htm"><b>2</b></a> </nobr><br><nobr>provided <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> </nobr><br><nobr>provides <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../introduction_to_gui.htm"><b>5</b></a> <a href="../select_color_and_font.htm"><b>6</b></a> <a href="../post-pro_preferences.htm"><b>7</b></a> <a href="../kernel/using_catalog_generator.htm"><b>8</b></a> </nobr><br><nobr>providing <a href="../kernel/using_registry.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><br><br></p><p class="ftsbody" align="center"><a href="whlstf8.htm" target="_self" title="previous search group"><b>&gt;&gt;</b></a>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstf8.htm b/doc/salome/gui/GUI/whgdata/whlstf8.htm
deleted file mode 100755 (executable)
index cbd91b5..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" align="center"><a href="whlstf7.htm" target="_self" title="previous search group"><b>&lt;&lt;</b></a><br><br></p>\r
-<p class="ftsbody" >\r
-<a name="bms_PU"></a><a name="subkey_PU"></a><a href="../dump_study.htm"><b>publish</b></a> <br><nobr>published <a href="../dump_study.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>pure</b></a> <br><a href="../kernel/getting_started2.htm"><b>purpose</b></a> <br><a href="../kernel/using_object_browser.htm"><b>purposes</b></a> <br><a name="bms_PY"></a><a name="subkey_PY"></a><a href="../kernel/running_salome_pro.htm"><b>py</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>pycontainer</b></a> <br><a href="../kernel/readme.html"><b>pyqt</b></a> <br><a href="../kernel/readme.html"><b>pyqtdir</b></a> <br><a href="../post-pro_preferences.htm"><b>pyramids</b></a> <br><nobr>python <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/displaying_studies.htm"><b>4</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>5</b></a> <a href="../introduction_to_gui.htm"><b>6</b></a> <a href="../dump_study.htm"><b>7</b></a> <a href="../kernel/setting_preferences.htm"><b>8</b></a> <a href="../kernel/saving_a_study.htm"><b>9</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>10</b></a> </nobr><br><a href="../kernel/readme.html"><b>pythonhome</b></a> <br>\r
-<br><br>\r
-<a name="bm_Q"></a><a name="subkey_QG"></a><a href="../kernel/readme.html"><b>qglobal</b></a> <br><a name="bms_QM"></a><a name="subkey_QM"></a><a href="../kernel/readme.html"><b>qm</b></a> <br><a name="bms_QT"></a><a name="subkey_QT"></a><a href="../kernel/readme.html"><b>qt</b></a> <br><a href="../kernel/readme.html"><b>qt_version_str</b></a> <br><a href="../kernel/readme.html"><b>qtdir</b></a> <br><nobr><a name="bms_QU"></a><a name="subkey_QU"></a>quality <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>quantities</b></a> <br><a href="../kernel/readme.html"><b>question</b></a> <br><nobr>quick <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_object_browser.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> </nobr><br><nobr>quickly <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>quit <a href="../setting_preferences.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> </nobr><br><a href="../dump_study.htm"><b>quite</b></a> <br><a href="../kernel/readme.html"><b>quits</b></a> <br><a href="../kernel/readme.html"><b>quoted</b></a> <br><a name="bms_QW"></a><a name="subkey_QW"></a><a href="../kernel/readme.html"><b>qwt</b></a> <br><a href="../kernel/readme.html"><b>qwthome</b></a> <br>\r
-<br><br>\r
-<a name="bm_R"></a><a name="subkey_R{"></a><a href="../kernel/running_salome_pro.htm"><b>r</b></a> <br><a name="bms_RA"></a><a name="subkey_RA"></a><a href="../kernel/readme.html"><b>radio</b></a> <br><a href="../post-pro_preferences.htm"><b>rainbow</b></a> <br><nobr>range <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>ranges</b></a> <br><a href="../post-pro_preferences.htm"><b>ranging</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>rapidly</b></a> <br><a href="../post-pro_preferences.htm"><b>rate</b></a> <br><a href="../dump_study.htm"><b>rather</b></a> <br><a href="../post-pro_preferences.htm"><b>ratio</b></a> <br><nobr><a name="bms_RE"></a><a name="subkey_RE"></a>re <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>reactivity</b></a> <br><nobr>read <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/navigating_topics.htm"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> </nobr><br><a href="../kernel/navigating_topics.htm"><b>reading</b></a> <br><a href="../kernel/readme.html"><b>readme</b></a> <br><a href="../post-pro_preferences.htm"><b>real</b></a> <br><a href="../kernel/getting_started2.htm"><b>realize</b></a> <br><a href="../post-pro_preferences.htm"><b>reassign</b></a> <br><a href="../setting_preferences.htm"><b>receives</b></a> <br><nobr>recommended <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><nobr>record <a href="../kernel/getting_properties_of_the_study.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>recorded</b></a> <br><a href="../post-pro_preferences.htm"><b>recorder</b></a> <br><a href="../post-pro_preferences.htm"><b>recording</b></a> <br><a href="../post-pro_preferences.htm"><b>records</b></a> <br><a href="../kernel/using_object_browser.htm"><b>red</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>redirects</b></a> <br><a href="../kernel/introduction.htm"><b>reduce</b></a> <br><a href="../kernel/introduction.htm"><b>reduces</b></a> <br><nobr>refer <a href="../setting_preferences.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>reference <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/using_object_browser.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> </nobr><br><a href="../kernel/using_object_browser.htm"><b>references</b></a> <br><a href="../kernel/readme.html"><b>refers</b></a> <br><a href="../kernel/introduction.htm"><b>refined</b></a> <br><a href="../post-pro_preferences.htm"><b>refining</b></a> <br><a href="../kernel/using_registry.htm"><b>refresh</b></a> <br><a href="../kernel/using_registry.htm"><b>refreshment</b></a> <br><a href="../post-pro_preferences.htm"><b>regimes</b></a> <br><nobr>registry <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../kernel/using_registry.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>reinstall</b></a> <br><a href="../kernel/readme.html"><b>reinstallation</b></a> <br><a href="../kernel/readme.html"><b>reinstalling</b></a> <br><nobr>related <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><nobr>relative <a href="../kernel/readme.html"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>release</b></a> <br><a href="../kernel/navigating_topics.htm"><b>relevant</b></a> <br><a href="../kernel/introduction.htm"><b>reliability</b></a> <br><a href="../kernel/saving_a_study.htm"><b>reload</b></a> <br><a href="../kernel/salome_pro_desktop.htm"><b>relocate</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>remains</b></a> <br><a href="../kernel/creating_a_new_study.htm"><b>remote</b></a> <br><a href="../kernel/setting_preferences.htm"><b>remove</b></a> <br><a href="../kernel/readme.html"><b>removed</b></a> <br><a href="../kernel/readme.html"><b>removing</b></a> <br><a href="../kernel/saving_a_study.htm"><b>renamed</b></a> <br><a href="../post-pro_preferences.htm"><b>rendering</b></a> <br><a href="../kernel/setting_preferences.htm"><b>reopened</b></a> <br><a href="../post-pro_preferences.htm"><b>repeated</b></a> <br><nobr>represent <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><nobr>representation <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>representative</b></a> <br><nobr>represents <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/getting_started2.htm"><b>3</b></a> </nobr><br><nobr>required <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> </nobr><br><nobr>requirements <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> </nobr><br><nobr>requires <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>reset</b></a> <br><a href="../kernel/setting_preferences.htm"><b>resizing</b></a> <br><a href="../post-pro_preferences.htm"><b>resolution</b></a> <br><a href="../dump_study.htm"><b>resolved</b></a> <br><a href="../kernel/readme.html"><b>resource</b></a> <br><nobr>resources <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><nobr>respective <a href="../setting_preferences.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>respectively</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>responds</b></a> <br><a href="../kernel/readme.html"><b>responsible</b></a> <br><a href="../kernel/setting_preferences.htm"><b>rest</b></a> <br><nobr>restore <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../setting_preferences.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><nobr>restored <a href="../setting_preferences.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>result</b></a> <br><a href="../kernel/getting_started2.htm"><b>resulting</b></a> <br><nobr>results <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../setting_preferences.htm"><b>retroactive</b></a> <br><a href="../kernel/introduction.htm"><b>reusable</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>reuse</b></a> <br><nobr>reversibly <a href="../dump_study.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><nobr><a name="bms_RI"></a><a name="subkey_RI"></a>right <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/navigating_topics.htm"><b>3</b></a> <a href="../kernel/displaying_studies.htm"><b>4</b></a> <a href="../select_color_and_font.htm"><b>5</b></a> <a href="../post-pro_preferences.htm"><b>6</b></a> <a href="../kernel/using_object_browser.htm"><b>7</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>8</b></a> <a href="../kernel/setting_preferences.htm"><b>9</b></a> <a href="../kernel/saving_a_study.htm"><b>10</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>11</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>risks</b></a> <br><a name="bms_RO"></a><a name="subkey_RO"></a><a href="../kernel/introduction.htm"><b>robustness</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>roles</b></a> <br><a href="../kernel/readme.html"><b>root</b></a> <br><a href="../post-pro_preferences.htm"><b>rotate</b></a> <br><a href="../post-pro_preferences.htm"><b>rotation</b></a> <br><a name="bms_RU"></a><a name="subkey_RU"></a><a href="../kernel/readme.html"><b>rules</b></a> <br><nobr>run <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> </nobr><br><a href="../select_color_and_font.htm"><b>runic</b></a> <br><a href="../kernel/readme.html"><b>runinstall</b></a> <br><nobr>running <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/using_registry.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>runs</b></a> <br><nobr>runsalome <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><a href="../kernel/using_catalog_generator.htm"><b>runsalomewithport</b></a> <br>\r
-<br><br>\r
-<nobr><a name="bm_S"></a><a name="subkey_S{"></a>s <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/navigating_topics.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> </nobr><br><a name="bms_SA"></a><a name="subkey_SA"></a><a href="../introduction_to_gui.htm"><b>safe</b></a> <br><nobr>salome <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../kernel/navigating_topics.htm"><b>4</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>5</b></a> <a href="../kernel/introduction.htm"><b>6</b></a> <a href="../kernel/getting_started2.htm"><b>7</b></a> <a href="../kernel/editing_studies.htm"><b>8</b></a> <a href="../kernel/displaying_studies.htm"><b>9</b></a> <a href="../kernel/creating_a_new_study.htm"><b>10</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>11</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>12</b></a> <a href="../introduction_to_gui.htm"><b>13</b></a> <a href="../dump_study.htm"><b>14</b></a> <a href="../setting_preferences.htm"><b>15</b></a> <a href="../post-pro_preferences.htm"><b>16</b></a> <a href="../kernel/using_registry.htm"><b>17</b></a> <a href="../kernel/using_object_browser.htm"><b>18</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>19</b></a> <a href="../kernel/using_catalog_generator.htm"><b>20</b></a> <a href="../kernel/setting_preferences.htm"><b>21</b></a> <a href="../kernel/saving_a_study.htm"><b>22</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>23</b></a> </nobr><br><a href="../kernel/readme.html"><b>salome_</b></a> <br><a href="../kernel/using_catalog_generator.htm"><b>salome_modulecatalog_server</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>salomeapp</b></a> <br><a href="../setting_preferences.htm"><b>salomeapprc</b></a> <br><a href="../dump_study.htm"><b>salomeds</b></a> <br><nobr>same <a href="../kernel/navigating_topics.htm"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/using_registry.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><a href="../select_color_and_font.htm"><b>sample</b></a> <br><nobr>save <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> </nobr><br><nobr>saved <a href="../dump_study.htm"><b>1</b></a> <a href="../setting_preferences.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><nobr>saves <a href="../kernel/saving_a_study.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><nobr>saving <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><nobr><a name="bms_SC"></a><a name="subkey_SC"></a>scalar <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><nobr>scale <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>scaling</b></a> <br><a href="../kernel/introduction.htm"><b>schemas</b></a> <br><a href="../kernel/readme.html"><b>scheme</b></a> <br><nobr>schemes <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>scientific</b></a> <br><nobr>screen <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> </nobr><br><nobr>script <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> <a href="../select_color_and_font.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> </nobr><br><a href="../dump_study.htm"><b>scripting</b></a> <br><nobr>scripts <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> <a href="../dump_study.htm"><b>3</b></a> <a href="../kernel/using_catalog_generator.htm"><b>4</b></a> </nobr><br><a href="../kernel/getting_properties_of_the_study.htm"><b>scroll</b></a> <br><br><br></p><p class="ftsbody" align="center"><a href="whlstf9.htm" target="_self" title="previous search group"><b>&gt;&gt;</b></a>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstf9.htm b/doc/salome/gui/GUI/whgdata/whlstf9.htm
deleted file mode 100755 (executable)
index eeac289..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words List</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsbody" align="center"><a href="whlstf8.htm" target="_self" title="previous search group"><b>&lt;&lt;</b></a><br><br></p>\r
-<p class="ftsbody" >\r
-<nobr><a name="bms_SE"></a><a name="subkey_SE"></a>search <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>3</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> </nobr><br><a href="../kernel/using_left-hand_tabs.htm"><b>searching</b></a> <br><nobr>second <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>seconds</b></a> <br><nobr>section <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> </nobr><br><nobr>sections <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>sectionthis</b></a> <br><a href="../kernel/readme.html"><b>sed</b></a> <br><nobr>see <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/displaying_studies.htm"><b>4</b></a> <a href="../kernel/using_object_browser.htm"><b>5</b></a> <a href="../kernel/using_catalog_generator.htm"><b>6</b></a> <a href="../kernel/setting_preferences.htm"><b>7</b></a> <a href="../kernel/saving_a_study.htm"><b>8</b></a> </nobr><br><a href="../mesh_preferences.htm"><b>seen</b></a> <br><nobr>select <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>3</b></a> <a href="../kernel/displaying_studies.htm"><b>4</b></a> <a href="../kernel/creating_a_new_study.htm"><b>5</b></a> <a href="../geom_preferences.htm"><b>6</b></a> <a href="../dump_study.htm"><b>7</b></a> <a href="../select_color_and_font.htm"><b>8</b></a> <a href="../post-pro_preferences.htm"><b>9</b></a> <a href="../mesh_preferences.htm"><b>10</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>11</b></a> <a href="../kernel/setting_preferences.htm"><b>12</b></a> <a href="../kernel/saving_a_study.htm"><b>13</b></a> </nobr><br><a href="../kernel/salome_pro_desktop.htm"><b>selectall</b></a> <br><nobr>selected <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> </nobr><br><nobr>selecting <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> </nobr><br><nobr>selection <a href="../introduction_to_gui.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><a href="../kernel/readme.html"><b>sends</b></a> <br><nobr>sensitive <a href="../kernel/using_object_browser.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><nobr>separate <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>2</b></a> </nobr><br><nobr>separated <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../kernel/about_salome_pro_architecture.htm"><b>server</b></a> <br><nobr>servers <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>2</b></a> </nobr><br><a href="../kernel/using_catalog_generator.htm"><b>serves</b></a> <br><a href="../kernel/readme.html"><b>service</b></a> <br><nobr>services <a href="../kernel/about_salome_pro_architecture.htm"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> </nobr><br><nobr>session <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../setting_preferences.htm"><b>3</b></a> <a href="../post-pro_preferences.htm"><b>4</b></a> <a href="../kernel/using_registry.htm"><b>5</b></a> <a href="../kernel/using_object_browser.htm"><b>6</b></a> <a href="../kernel/setting_preferences.htm"><b>7</b></a> <a href="../kernel/saving_a_study.htm"><b>8</b></a> </nobr><br><nobr>sessions <a href="../geom_preferences.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><nobr>set <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/about_salome_pro_help_system.htm"><b>3</b></a> <a href="../geom_preferences.htm"><b>4</b></a> <a href="../dump_study.htm"><b>5</b></a> <a href="../setting_preferences.htm"><b>6</b></a> <a href="../post-pro_preferences.htm"><b>7</b></a> <a href="../mesh_preferences.htm"><b>8</b></a> <a href="../kernel/using_registry.htm"><b>9</b></a> <a href="../kernel/setting_preferences.htm"><b>10</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>11</b></a> </nobr><br><nobr>sets <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><nobr>setting <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> <a href="../setting_preferences.htm"><b>3</b></a> <a href="../kernel/using_object_browser.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> </nobr><br><nobr>settings <a href="../kernel/readme.html"><b>1</b></a> <a href="../setting_preferences.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>severe</b></a> <br><a name="bms_SH"></a><a name="subkey_SH"></a><a href="../kernel/readme.html"><b>sh</b></a> <br><nobr>shading <a href="../geom_preferences.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>shape</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>share</b></a> <br><nobr>shell <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> </nobr><br><nobr>short <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>2</b></a> </nobr><br><a href="../kernel/displaying_studies.htm"><b>shot</b></a> <br><nobr>should <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/using_catalog_generator.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><nobr>shown <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>shows</b></a> <br><a href="../mesh_preferences.htm"><b>shrink</b></a> <br><nobr><a name="bms_SI"></a><a name="subkey_SI"></a>side <a href="../post-pro_preferences.htm"><b>1</b></a> <a href="../mesh_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>signal</b></a> <br><a href="../introduction_to_gui.htm"><b>signals</b></a> <br><a href="../kernel/readme.html"><b>signature</b></a> <br><a href="../kernel/readme.html"><b>sigterm</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>simple</b></a> <br><a href="../kernel/readme.html"><b>simplify</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>simulate</b></a> <br><a href="../kernel/introduction.htm"><b>simulation</b></a> <br><nobr>simulations <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><nobr>simultaneously <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/displaying_studies.htm"><b>3</b></a> </nobr><br><a href="../introduction_to_gui.htm"><b>since</b></a> <br><a href="../kernel/readme.html"><b>single</b></a> <br><a href="../kernel/readme.html"><b>sip</b></a> <br><a href="../kernel/readme.html"><b>sipdir</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>situations</b></a> <br><nobr>size <a href="../kernel/displaying_studies.htm"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> <a href="../kernel/setting_preferences.htm"><b>4</b></a> <a href="../kernel/saving_a_study.htm"><b>5</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>6</b></a> </nobr><br><nobr>sizes <a href="../select_color_and_font.htm"><b>1</b></a> <a href="../kernel/saving_a_study.htm"><b>2</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>3</b></a> </nobr><br><a name="bms_SK"></a><a name="subkey_SK"></a><a href="../kernel/readme.html"><b>skip</b></a> <br><a href="../kernel/readme.html"><b>skipped</b></a> <br><a name="bms_SL"></a><a name="subkey_SL"></a><a href="../kernel/readme.html"><b>slightly</b></a> <br><a href="../post-pro_preferences.htm"><b>slow</b></a> <br><a name="bms_SM"></a><a name="subkey_SM"></a><a href="../post-pro_preferences.htm"><b>smallest</b></a> <br><a href="../kernel/setting_preferences.htm"><b>smooth</b></a> <br><a href="../post-pro_preferences.htm"><b>smoothness</b></a> <br><nobr><a name="bms_SO"></a><a name="subkey_SO"></a>so <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/editing_studies.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../post-pro_preferences.htm"><b>5</b></a> <a href="../kernel/using_object_browser.htm"><b>6</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>7</b></a> </nobr><br><nobr>software <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>solution</b></a> <br><a href="../kernel/introduction.htm"><b>solutions</b></a> <br><a href="../kernel/introduction.htm"><b>solver</b></a> <br><nobr>solvers <a href="../kernel/introduction_to_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>something</b></a> <br><a href="../kernel/setting_preferences.htm"><b>sort</b></a> <br><a href="../kernel/readme.html"><b>sort_path</b></a> <br><nobr>source <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/introduction_to_salome_pro.htm"><b>3</b></a> <a href="../kernel/introduction.htm"><b>4</b></a> </nobr><br><a href="../kernel/readme.html"><b>sources</b></a> <br><nobr><a name="bms_SP"></a><a name="subkey_SP"></a>space <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> <a href="../mesh_preferences.htm"><b>3</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>spacemouse</b></a> <br><a href="../kernel/readme.html"><b>spaces</b></a> <br><a href="../post-pro_preferences.htm"><b>spacing</b></a> <br><nobr>special <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/readme.html"><b>2</b></a> <a href="../kernel/opening_studies.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>specially</b></a> <br><nobr>specific <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> <a href="../setting_preferences.htm"><b>5</b></a> <a href="../kernel/using_left-hand_tabs.htm"><b>6</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>7</b></a> </nobr><br><a href="../kernel/introduction_to_salome_pro.htm"><b>specification</b></a> <br><a href="../post-pro_preferences.htm"><b>specified</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>specifies</b></a> <br><nobr>specify <a href="../kernel/using_catalog_generator.htm"><b>1</b></a> <a href="../kernel/setting_preferences.htm"><b>2</b></a> <a href="../kernel/saving_a_study.htm"><b>3</b></a> </nobr><br><a href="../post-pro_preferences.htm"><b>speed</b></a> <br><a href="../post-pro_preferences.htm"><b>sphere</b></a> <br><a href="../post-pro_preferences.htm"><b>spheres</b></a> <br><a href="../geom_preferences.htm"><b>spin</b></a> <br><a href="../kernel/running_salome_pro.htm"><b>splash</b></a> <br><a href="../kernel/setting_preferences.htm"><b>splines</b></a> <br><a href="../kernel/displaying_studies.htm"><b>split</b></a> <br><a href="../post-pro_preferences.htm"><b>sprite</b></a> <br><a href="../post-pro_preferences.htm"><b>sprites</b></a> <br><a name="bms_ST"></a><a name="subkey_ST"></a><a href="../post-pro_preferences.htm"><b>stamps</b></a> <br><nobr>standalone <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../introduction_to_gui.htm"><b>2</b></a> </nobr><br><nobr>standard <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/creating_a_new_study.htm"><b>3</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>4</b></a> <a href="../introduction_to_gui.htm"><b>5</b></a> <a href="../setting_preferences.htm"><b>6</b></a> <a href="../post-pro_preferences.htm"><b>7</b></a> <a href="../kernel/using_catalog_generator.htm"><b>8</b></a> <a href="../kernel/saving_a_study.htm"><b>9</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>10</b></a> </nobr><br><a href="../kernel/readme.html"><b>standard_version</b></a> <br><nobr>start <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> </nobr><br><nobr>started <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/getting_started2.htm"><b>2</b></a> <a href="../kernel/using_registry.htm"><b>3</b></a> <a href="../kernel/using_catalog_generator.htm"><b>4</b></a> <a href="../kernel/setting_preferences.htm"><b>5</b></a> </nobr><br><nobr>starting <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/displaying_studies.htm"><b>2</b></a> <a href="../kernel/using_registry.htm"><b>3</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>4</b></a> </nobr><br><a href="../setting_preferences.htm"><b>starts</b></a> <br><nobr>state <a href="../kernel/readme.html"><b>1</b></a> <a href="../dump_study.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><a href="../kernel/saving_a_study.htm"><b>states</b></a> <br><a href="../kernel/about_salome_pro_architecture.htm"><b>stations</b></a> <br><a href="../kernel/readme.html"><b>status</b></a> <br><nobr>step <a href="../kernel/introduction.htm"><b>1</b></a> <a href="../geom_preferences.htm"><b>2</b></a> <a href="../post-pro_preferences.htm"><b>3</b></a> </nobr><br><nobr>steps <a href="../kernel/readme.html"><b>1</b></a> <a href="../post-pro_preferences.htm"><b>2</b></a> </nobr><br><a href="../kernel/readme.html"><b>still</b></a> <br><nobr>store <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/using_catalog_generator.htm"><b>2</b></a> <a href="../kernel/setting_preferences.htm"><b>3</b></a> <a href="../kernel/saving_a_study.htm"><b>4</b></a> </nobr><br><nobr>stored <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../dump_study.htm"><b>4</b></a> <a href="../kernel/using_catalog_generator.htm"><b>5</b></a> <a href="../kernel/saving_a_study.htm"><b>6</b></a> </nobr><br><a href="../kernel/saving_a_study.htm"><b>storing</b></a> <br><a href="../kernel/readme.html"><b>strict</b></a> <br><a href="../kernel/readme.html"><b>string</b></a> <br><a href="../kernel/readme.html"><b>strongly</b></a> <br><a href="../select_color_and_font.htm"><b>struck</b></a> <br><a href="../kernel/introduction.htm"><b>structural</b></a> <br><nobr>structure <a href="../kernel/readme.html"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>3</b></a> <a href="../introduction_to_gui.htm"><b>4</b></a> <a href="../kernel/using_object_browser.htm"><b>5</b></a> </nobr><br><a href="../kernel/introduction.htm"><b>structures</b></a> <br><nobr>studies <a href="../kernel/opening_studies.htm"><b>1</b></a> <a href="../kernel/introduction.htm"><b>2</b></a> <a href="../kernel/getting_started2.htm"><b>3</b></a> <a href="../kernel/editing_studies.htm"><b>4</b></a> <a href="../kernel/displaying_studies.htm"><b>5</b></a> <a href="../kernel/creating_a_new_study.htm"><b>6</b></a> <a href="../introduction_to_gui.htm"><b>7</b></a> <a href="../kernel/saving_a_study.htm"><b>8</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>9</b></a> </nobr><br><nobr>study <a href="../kernel/running_salome_pro.htm"><b>1</b></a> <a href="../kernel/opening_studies.htm"><b>2</b></a> <a href="../kernel/introduction.htm"><b>3</b></a> <a href="../kernel/getting_started2.htm"><b>4</b></a> <a href="../kernel/getting_properties_of_the_study.htm"><b>5</b></a> <a href="../kernel/editing_studies.htm"><b>6</b></a> <a href="../kernel/displaying_studies.htm"><b>7</b></a> <a href="../kernel/creating_a_new_study.htm"><b>8</b></a> <a href="../kernel/about_salome_pro_architecture.htm"><b>9</b></a> <a href="../introduction_to_gui.htm"><b>10</b></a> <a href="../dump_study.htm"><b>11</b></a> <a href="../setting_preferences.htm"><b>12</b></a> <a href="../post-pro_preferences.htm"><b>13</b></a> <a href="../kernel/using_registry.htm"><b>14</b></a> <a href="../kernel/using_object_browser.htm"><b>15</b></a> <a href="../kernel/using_catalog_generator.htm"><b>16</b></a> <a href="../kernel/setting_preferences.htm"><b>17</b></a> <a href="../kernel/saving_a_study.htm"><b>18</b></a> <a href="../kernel/salome_pro_desktop.htm"><b>19</b></a> </nobr><br><a href="../kernel/creating_a_new_study.htm"><b>study1</b></a> <br><a href="../kernel/setting_preferences.htm"><b>style</b></a> <br><a href="../select_color_and_font.htm"><b>styles</b></a> <br><br><br></p><p class="ftsbody" align="center"><a href="whlstf10.htm" target="_self" title="previous search group"><b>&gt;&gt;</b></a>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl0.htm b/doc/salome/gui/GUI/whgdata/whlstfl0.htm
deleted file mode 100755 (executable)
index 671ee04..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_{"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf0.htm#bm_{" target="ftslist" title="search letter { "><b>{ </b></a> <a href="whlstf0.htm#bms_{O" target="ftslist" title="search letter {O"><b>{O</b></a> <a href="whlstf0.htm#bms_{{" target="ftslist" title="search letter { "><b>{ </b></a> <a href="whlstf0.htm#bms_{D" target="ftslist" title="search letter {D"><b>{D</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl1.htm b/doc/salome/gui/GUI/whgdata/whlstfl1.htm
deleted file mode 100755 (executable)
index d5612c4..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_A"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf0.htm#bm_A" target="ftslist" title="search letter AB"><b>AB</b></a> <a href="whlstf0.htm#bms_AC" target="ftslist" title="search letter AC"><b>AC</b></a> <a href="whlstf0.htm#bms_AD" target="ftslist" title="search letter AD"><b>AD</b></a> <a href="whlstf0.htm#bms_AF" target="ftslist" title="search letter AF"><b>AF</b></a> <a href="whlstf0.htm#bms_AG" target="ftslist" title="search letter AG"><b>AG</b></a> <a href="whlstf0.htm#bms_AL" target="ftslist" title="search letter AL"><b>AL</b></a> <a href="whlstf0.htm#bms_AM" target="ftslist" title="search letter AM"><b>AM</b></a> <a href="whlstf0.htm#bms_AN" target="ftslist" title="search letter AN"><b>AN</b></a> <a href="whlstf0.htm#bms_AP" target="ftslist" title="search letter AP"><b>AP</b></a> <a href="whlstf0.htm#bms_AR" target="ftslist" title="search letter AR"><b>AR</b></a> <a href="whlstf0.htm#bms_AS" target="ftslist" title="search letter AS"><b>AS</b></a> <a href="whlstf0.htm#bms_AT" target="ftslist" title="search letter AT"><b>AT</b></a> <a href="whlstf0.htm#bms_AU" target="ftslist" title="search letter AU"><b>AU</b></a> <a href="whlstf0.htm#bms_AV" target="ftslist" title="search letter AV"><b>AV</b></a> <a href="whlstf0.htm#bms_AW" target="ftslist" title="search letter AW"><b>AW</b></a> <a href="whlstf0.htm#bms_AX" target="ftslist" title="search letter AX"><b>AX</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl10.htm b/doc/salome/gui/GUI/whgdata/whlstfl10.htm
deleted file mode 100755 (executable)
index e3e8d50..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_J"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf5.htm#bm_J" target="ftslist" title="search letter JA"><b>JA</b></a> <a href="whlstf5.htm#bms_JU" target="ftslist" title="search letter JU"><b>JU</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl11.htm b/doc/salome/gui/GUI/whgdata/whlstfl11.htm
deleted file mode 100755 (executable)
index 36c9fde..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_K"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf5.htm#bm_K" target="ftslist" title="search letter K "><b>K </b></a> <a href="whlstf5.htm#bms_KB" target="ftslist" title="search letter KB"><b>KB</b></a> <a href="whlstf5.htm#bms_KE" target="ftslist" title="search letter KE"><b>KE</b></a> <a href="whlstf5.htm#bms_KI" target="ftslist" title="search letter KI"><b>KI</b></a> <a href="whlstf5.htm#bms_KN" target="ftslist" title="search letter KN"><b>KN</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl12.htm b/doc/salome/gui/GUI/whgdata/whlstfl12.htm
deleted file mode 100755 (executable)
index 5bb5d42..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_L"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf5.htm#bm_L" target="ftslist" title="search letter L "><b>L </b></a> <a href="whlstf5.htm#bms_LA" target="ftslist" title="search letter LA"><b>LA</b></a> <a href="whlstf5.htm#bms_LD" target="ftslist" title="search letter LD"><b>LD</b></a> <a href="whlstf5.htm#bms_LE" target="ftslist" title="search letter LE"><b>LE</b></a> <a href="whlstf5.htm#bms_LI" target="ftslist" title="search letter LI"><b>LI</b></a> <a href="whlstf5.htm#bms_LL" target="ftslist" title="search letter LL"><b>LL</b></a> <a href="whlstf5.htm#bms_LO" target="ftslist" title="search letter LO"><b>LO</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl13.htm b/doc/salome/gui/GUI/whgdata/whlstfl13.htm
deleted file mode 100755 (executable)
index dd57640..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_M"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf5.htm#bm_M" target="ftslist" title="search letter M "><b>M </b></a> <a href="whlstf5.htm#bms_MA" target="ftslist" title="search letter MA"><b>MA</b></a> <a href="whlstf5.htm#bms_ME" target="ftslist" title="search letter ME"><b>ME</b></a> <a href="whlstf5.htm#bms_MI" target="ftslist" title="search letter MI"><b>MI</b></a> <a href="whlstf6.htm#bms_MO" target="ftslist" title="search letter MO"><b>MO</b></a> <a href="whlstf6.htm#bms_MS" target="ftslist" title="search letter MS"><b>MS</b></a> <a href="whlstf6.htm#bms_MU" target="ftslist" title="search letter MU"><b>MU</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl14.htm b/doc/salome/gui/GUI/whgdata/whlstfl14.htm
deleted file mode 100755 (executable)
index 539b47f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_N"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf6.htm#bm_N" target="ftslist" title="search letter N "><b>N </b></a> <a href="whlstf6.htm#bms_NA" target="ftslist" title="search letter NA"><b>NA</b></a> <a href="whlstf6.htm#bms_NE" target="ftslist" title="search letter NE"><b>NE</b></a> <a href="whlstf6.htm#bms_NF" target="ftslist" title="search letter NF"><b>NF</b></a> <a href="whlstf6.htm#bms_NO" target="ftslist" title="search letter NO"><b>NO</b></a> <a href="whlstf6.htm#bms_NT" target="ftslist" title="search letter NT"><b>NT</b></a> <a href="whlstf6.htm#bms_NU" target="ftslist" title="search letter NU"><b>NU</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl15.htm b/doc/salome/gui/GUI/whgdata/whlstfl15.htm
deleted file mode 100755 (executable)
index e5725ce..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_O"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf6.htm#bm_O" target="ftslist" title="search letter OB"><b>OB</b></a> <a href="whlstf6.htm#bms_OC" target="ftslist" title="search letter OC"><b>OC</b></a> <a href="whlstf6.htm#bms_OF" target="ftslist" title="search letter OF"><b>OF</b></a> <a href="whlstf6.htm#bms_OK" target="ftslist" title="search letter OK"><b>OK</b></a> <a href="whlstf6.htm#bms_OM" target="ftslist" title="search letter OM"><b>OM</b></a> <a href="whlstf6.htm#bms_ON" target="ftslist" title="search letter ON"><b>ON</b></a> <a href="whlstf6.htm#bms_OP" target="ftslist" title="search letter OP"><b>OP</b></a> <a href="whlstf6.htm#bms_OR" target="ftslist" title="search letter OR"><b>OR</b></a> <a href="whlstf6.htm#bms_OS" target="ftslist" title="search letter OS"><b>OS</b></a> <a href="whlstf6.htm#bms_OT" target="ftslist" title="search letter OT"><b>OT</b></a> <a href="whlstf7.htm#bms_OU" target="ftslist" title="search letter OU"><b>OU</b></a> <a href="whlstf7.htm#bms_OV" target="ftslist" title="search letter OV"><b>OV</b></a> <a href="whlstf7.htm#bms_OW" target="ftslist" title="search letter OW"><b>OW</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl16.htm b/doc/salome/gui/GUI/whgdata/whlstfl16.htm
deleted file mode 100755 (executable)
index fc17968..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_P"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf7.htm#bm_P" target="ftslist" title="search letter P "><b>P </b></a> <a href="whlstf7.htm#bms_PA" target="ftslist" title="search letter PA"><b>PA</b></a> <a href="whlstf7.htm#bms_PC" target="ftslist" title="search letter PC"><b>PC</b></a> <a href="whlstf7.htm#bms_PE" target="ftslist" title="search letter PE"><b>PE</b></a> <a href="whlstf7.htm#bms_PH" target="ftslist" title="search letter PH"><b>PH</b></a> <a href="whlstf7.htm#bms_PI" target="ftslist" title="search letter PI"><b>PI</b></a> <a href="whlstf7.htm#bms_PL" target="ftslist" title="search letter PL"><b>PL</b></a> <a href="whlstf7.htm#bms_PO" target="ftslist" title="search letter PO"><b>PO</b></a> <a href="whlstf7.htm#bms_PR" target="ftslist" title="search letter PR"><b>PR</b></a> <a href="whlstf8.htm#bms_PU" target="ftslist" title="search letter PU"><b>PU</b></a> <a href="whlstf8.htm#bms_PY" target="ftslist" title="search letter PY"><b>PY</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl17.htm b/doc/salome/gui/GUI/whgdata/whlstfl17.htm
deleted file mode 100755 (executable)
index 686f920..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_Q"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf8.htm#bm_Q" target="ftslist" title="search letter QG"><b>QG</b></a> <a href="whlstf8.htm#bms_QM" target="ftslist" title="search letter QM"><b>QM</b></a> <a href="whlstf8.htm#bms_QT" target="ftslist" title="search letter QT"><b>QT</b></a> <a href="whlstf8.htm#bms_QU" target="ftslist" title="search letter QU"><b>QU</b></a> <a href="whlstf8.htm#bms_QW" target="ftslist" title="search letter QW"><b>QW</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl18.htm b/doc/salome/gui/GUI/whgdata/whlstfl18.htm
deleted file mode 100755 (executable)
index e6e4676..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_R"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf8.htm#bm_R" target="ftslist" title="search letter R "><b>R </b></a> <a href="whlstf8.htm#bms_RA" target="ftslist" title="search letter RA"><b>RA</b></a> <a href="whlstf8.htm#bms_RE" target="ftslist" title="search letter RE"><b>RE</b></a> <a href="whlstf8.htm#bms_RI" target="ftslist" title="search letter RI"><b>RI</b></a> <a href="whlstf8.htm#bms_RO" target="ftslist" title="search letter RO"><b>RO</b></a> <a href="whlstf8.htm#bms_RU" target="ftslist" title="search letter RU"><b>RU</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl19.htm b/doc/salome/gui/GUI/whgdata/whlstfl19.htm
deleted file mode 100755 (executable)
index f3bb741..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_S"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf8.htm#bm_S" target="ftslist" title="search letter S "><b>S </b></a> <a href="whlstf8.htm#bms_SA" target="ftslist" title="search letter SA"><b>SA</b></a> <a href="whlstf8.htm#bms_SC" target="ftslist" title="search letter SC"><b>SC</b></a> <a href="whlstf9.htm#bms_SE" target="ftslist" title="search letter SE"><b>SE</b></a> <a href="whlstf9.htm#bms_SH" target="ftslist" title="search letter SH"><b>SH</b></a> <a href="whlstf9.htm#bms_SI" target="ftslist" title="search letter SI"><b>SI</b></a> <a href="whlstf9.htm#bms_SK" target="ftslist" title="search letter SK"><b>SK</b></a> <a href="whlstf9.htm#bms_SL" target="ftslist" title="search letter SL"><b>SL</b></a> <a href="whlstf9.htm#bms_SM" target="ftslist" title="search letter SM"><b>SM</b></a> <a href="whlstf9.htm#bms_SO" target="ftslist" title="search letter SO"><b>SO</b></a> <a href="whlstf9.htm#bms_SP" target="ftslist" title="search letter SP"><b>SP</b></a> <a href="whlstf9.htm#bms_ST" target="ftslist" title="search letter ST"><b>ST</b></a> <a href="whlstf10.htm#bms_SU" target="ftslist" title="search letter SU"><b>SU</b></a> <a href="whlstf10.htm#bms_SW" target="ftslist" title="search letter SW"><b>SW</b></a> <a href="whlstf10.htm#bms_SY" target="ftslist" title="search letter SY"><b>SY</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl2.htm b/doc/salome/gui/GUI/whgdata/whlstfl2.htm
deleted file mode 100755 (executable)
index da3d027..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_B"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf0.htm#bm_B" target="ftslist" title="search letter B "><b>B </b></a> <a href="whlstf0.htm#bms_BA" target="ftslist" title="search letter BA"><b>BA</b></a> <a href="whlstf0.htm#bms_BE" target="ftslist" title="search letter BE"><b>BE</b></a> <a href="whlstf0.htm#bms_BI" target="ftslist" title="search letter BI"><b>BI</b></a> <a href="whlstf0.htm#bms_BL" target="ftslist" title="search letter BL"><b>BL</b></a> <a href="whlstf0.htm#bms_BO" target="ftslist" title="search letter BO"><b>BO</b></a> <a href="whlstf1.htm#bms_BR" target="ftslist" title="search letter BR"><b>BR</b></a> <a href="whlstf1.htm#bms_BU" target="ftslist" title="search letter BU"><b>BU</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl20.htm b/doc/salome/gui/GUI/whgdata/whlstfl20.htm
deleted file mode 100755 (executable)
index 3ebf734..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_T"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf10.htm#bm_T" target="ftslist" title="search letter T "><b>T </b></a> <a href="whlstf10.htm#bms_TA" target="ftslist" title="search letter TA"><b>TA</b></a> <a href="whlstf10.htm#bms_TC" target="ftslist" title="search letter TC"><b>TC</b></a> <a href="whlstf10.htm#bms_TE" target="ftslist" title="search letter TE"><b>TE</b></a> <a href="whlstf10.htm#bms_TH" target="ftslist" title="search letter TH"><b>TH</b></a> <a href="whlstf10.htm#bms_TI" target="ftslist" title="search letter TI"><b>TI</b></a> <a href="whlstf10.htm#bms_TK" target="ftslist" title="search letter TK"><b>TK</b></a> <a href="whlstf10.htm#bms_TM" target="ftslist" title="search letter TM"><b>TM</b></a> <a href="whlstf10.htm#bms_TO" target="ftslist" title="search letter TO"><b>TO</b></a> <a href="whlstf10.htm#bms_TR" target="ftslist" title="search letter TR"><b>TR</b></a> <a href="whlstf10.htm#bms_TW" target="ftslist" title="search letter TW"><b>TW</b></a> <a href="whlstf10.htm#bms_TY" target="ftslist" title="search letter TY"><b>TY</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl21.htm b/doc/salome/gui/GUI/whgdata/whlstfl21.htm
deleted file mode 100755 (executable)
index 7f5fe55..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_U"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf10.htm#bm_U" target="ftslist" title="search letter U "><b>U </b></a> <a href="whlstf10.htm#bms_UL" target="ftslist" title="search letter UL"><b>UL</b></a> <a href="whlstf10.htm#bms_UN" target="ftslist" title="search letter UN"><b>UN</b></a> <a href="whlstf10.htm#bms_UP" target="ftslist" title="search letter UP"><b>UP</b></a> <a href="whlstf10.htm#bms_US" target="ftslist" title="search letter US"><b>US</b></a> <a href="whlstf11.htm#bms_UT" target="ftslist" title="search letter UT"><b>UT</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl22.htm b/doc/salome/gui/GUI/whgdata/whlstfl22.htm
deleted file mode 100755 (executable)
index cd25835..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_V"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf11.htm#bm_V" target="ftslist" title="search letter V "><b>V </b></a> <a href="whlstf11.htm#bms_VA" target="ftslist" title="search letter VA"><b>VA</b></a> <a href="whlstf11.htm#bms_VE" target="ftslist" title="search letter VE"><b>VE</b></a> <a href="whlstf11.htm#bms_VI" target="ftslist" title="search letter VI"><b>VI</b></a> <a href="whlstf11.htm#bms_VT" target="ftslist" title="search letter VT"><b>VT</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl23.htm b/doc/salome/gui/GUI/whgdata/whlstfl23.htm
deleted file mode 100755 (executable)
index 6a67db1..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_W"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf11.htm#bm_W" target="ftslist" title="search letter WA"><b>WA</b></a> <a href="whlstf11.htm#bms_WE" target="ftslist" title="search letter WE"><b>WE</b></a> <a href="whlstf11.htm#bms_WH" target="ftslist" title="search letter WH"><b>WH</b></a> <a href="whlstf11.htm#bms_WI" target="ftslist" title="search letter WI"><b>WI</b></a> <a href="whlstf11.htm#bms_WO" target="ftslist" title="search letter WO"><b>WO</b></a> <a href="whlstf11.htm#bms_WR" target="ftslist" title="search letter WR"><b>WR</b></a> <a href="whlstf11.htm#bms_WW" target="ftslist" title="search letter WW"><b>WW</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl24.htm b/doc/salome/gui/GUI/whgdata/whlstfl24.htm
deleted file mode 100755 (executable)
index 88429fa..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_X"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf11.htm#bm_X" target="ftslist" title="search letter X "><b>X </b></a> <a href="whlstf11.htm#bms_XM" target="ftslist" title="search letter XM"><b>XM</b></a> <a href="whlstf11.htm#bms_XT" target="ftslist" title="search letter XT"><b>XT</b></a> <a href="whlstf11.htm#bms_XX" target="ftslist" title="search letter XX"><b>XX</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl25.htm b/doc/salome/gui/GUI/whgdata/whlstfl25.htm
deleted file mode 100755 (executable)
index f84b419..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_Y"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf11.htm#bm_Y" target="ftslist" title="search letter Y "><b>Y </b></a> <a href="whlstf11.htm#bms_YE" target="ftslist" title="search letter YE"><b>YE</b></a> <a href="whlstf11.htm#bms_YO" target="ftslist" title="search letter YO"><b>YO</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl26.htm b/doc/salome/gui/GUI/whgdata/whlstfl26.htm
deleted file mode 100755 (executable)
index 5bf30cd..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_Z"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf11.htm#bm_Z" target="ftslist" title="search letter Z "><b>Z </b></a> <a href="whlstf11.htm#bms_ZO" target="ftslist" title="search letter ZO"><b>ZO</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl3.htm b/doc/salome/gui/GUI/whgdata/whlstfl3.htm
deleted file mode 100755 (executable)
index 90315f3..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_C"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf1.htm#bm_C" target="ftslist" title="search letter C "><b>C </b></a> <a href="whlstf1.htm#bms_CA" target="ftslist" title="search letter CA"><b>CA</b></a> <a href="whlstf1.htm#bms_CD" target="ftslist" title="search letter CD"><b>CD</b></a> <a href="whlstf1.htm#bms_CE" target="ftslist" title="search letter CE"><b>CE</b></a> <a href="whlstf1.htm#bms_CH" target="ftslist" title="search letter CH"><b>CH</b></a> <a href="whlstf1.htm#bms_CL" target="ftslist" title="search letter CL"><b>CL</b></a> <a href="whlstf1.htm#bms_CO" target="ftslist" title="search letter CO"><b>CO</b></a> <a href="whlstf2.htm#bms_CP" target="ftslist" title="search letter CP"><b>CP</b></a> <a href="whlstf2.htm#bms_CR" target="ftslist" title="search letter CR"><b>CR</b></a> <a href="whlstf2.htm#bms_CS" target="ftslist" title="search letter CS"><b>CS</b></a> <a href="whlstf2.htm#bms_CT" target="ftslist" title="search letter CT"><b>CT</b></a> <a href="whlstf2.htm#bms_CU" target="ftslist" title="search letter CU"><b>CU</b></a> <a href="whlstf2.htm#bms_CY" target="ftslist" title="search letter CY"><b>CY</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl4.htm b/doc/salome/gui/GUI/whgdata/whlstfl4.htm
deleted file mode 100755 (executable)
index c98f5ae..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_D"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf2.htm#bm_D" target="ftslist" title="search letter D "><b>D </b></a> <a href="whlstf2.htm#bms_DA" target="ftslist" title="search letter DA"><b>DA</b></a> <a href="whlstf2.htm#bms_DE" target="ftslist" title="search letter DE"><b>DE</b></a> <a href="whlstf2.htm#bms_DI" target="ftslist" title="search letter DI"><b>DI</b></a> <a href="whlstf2.htm#bms_DO" target="ftslist" title="search letter DO"><b>DO</b></a> <a href="whlstf2.htm#bms_DR" target="ftslist" title="search letter DR"><b>DR</b></a> <a href="whlstf2.htm#bms_DU" target="ftslist" title="search letter DU"><b>DU</b></a> <a href="whlstf2.htm#bms_DY" target="ftslist" title="search letter DY"><b>DY</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl5.htm b/doc/salome/gui/GUI/whgdata/whlstfl5.htm
deleted file mode 100755 (executable)
index 7b3b2ab..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_E"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf2.htm#bm_E" target="ftslist" title="search letter E "><b>E </b></a> <a href="whlstf2.htm#bms_EA" target="ftslist" title="search letter EA"><b>EA</b></a> <a href="whlstf2.htm#bms_EC" target="ftslist" title="search letter EC"><b>EC</b></a> <a href="whlstf2.htm#bms_ED" target="ftslist" title="search letter ED"><b>ED</b></a> <a href="whlstf3.htm#bms_EF" target="ftslist" title="search letter EF"><b>EF</b></a> <a href="whlstf3.htm#bms_EG" target="ftslist" title="search letter EG"><b>EG</b></a> <a href="whlstf3.htm#bms_EI" target="ftslist" title="search letter EI"><b>EI</b></a> <a href="whlstf3.htm#bms_EL" target="ftslist" title="search letter EL"><b>EL</b></a> <a href="whlstf3.htm#bms_EM" target="ftslist" title="search letter EM"><b>EM</b></a> <a href="whlstf3.htm#bms_EN" target="ftslist" title="search letter EN"><b>EN</b></a> <a href="whlstf3.htm#bms_EQ" target="ftslist" title="search letter EQ"><b>EQ</b></a> <a href="whlstf3.htm#bms_ER" target="ftslist" title="search letter ER"><b>ER</b></a> <a href="whlstf3.htm#bms_ET" target="ftslist" title="search letter ET"><b>ET</b></a> <a href="whlstf3.htm#bms_EV" target="ftslist" title="search letter EV"><b>EV</b></a> <a href="whlstf3.htm#bms_EX" target="ftslist" title="search letter EX"><b>EX</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl6.htm b/doc/salome/gui/GUI/whgdata/whlstfl6.htm
deleted file mode 100755 (executable)
index 77d777e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_F"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf3.htm#bm_F" target="ftslist" title="search letter F "><b>F </b></a> <a href="whlstf3.htm#bms_FA" target="ftslist" title="search letter FA"><b>FA</b></a> <a href="whlstf3.htm#bms_FE" target="ftslist" title="search letter FE"><b>FE</b></a> <a href="whlstf3.htm#bms_FI" target="ftslist" title="search letter FI"><b>FI</b></a> <a href="whlstf3.htm#bms_FL" target="ftslist" title="search letter FL"><b>FL</b></a> <a href="whlstf3.htm#bms_FO" target="ftslist" title="search letter FO"><b>FO</b></a> <a href="whlstf3.htm#bms_FP" target="ftslist" title="search letter FP"><b>FP</b></a> <a href="whlstf3.htm#bms_FR" target="ftslist" title="search letter FR"><b>FR</b></a> <a href="whlstf3.htm#bms_FU" target="ftslist" title="search letter FU"><b>FU</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl7.htm b/doc/salome/gui/GUI/whgdata/whlstfl7.htm
deleted file mode 100755 (executable)
index 11540ce..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_G"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf3.htm#bm_G" target="ftslist" title="search letter G "><b>G </b></a> <a href="whlstf3.htm#bms_GA" target="ftslist" title="search letter GA"><b>GA</b></a> <a href="whlstf3.htm#bms_GC" target="ftslist" title="search letter GC"><b>GC</b></a> <a href="whlstf3.htm#bms_GE" target="ftslist" title="search letter GE"><b>GE</b></a> <a href="whlstf4.htm#bms_GI" target="ftslist" title="search letter GI"><b>GI</b></a> <a href="whlstf4.htm#bms_GL" target="ftslist" title="search letter GL"><b>GL</b></a> <a href="whlstf4.htm#bms_GO" target="ftslist" title="search letter GO"><b>GO</b></a> <a href="whlstf4.htm#bms_GR" target="ftslist" title="search letter GR"><b>GR</b></a> <a href="whlstf4.htm#bms_GU" target="ftslist" title="search letter GU"><b>GU</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl8.htm b/doc/salome/gui/GUI/whgdata/whlstfl8.htm
deleted file mode 100755 (executable)
index c26fde9..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_H"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf4.htm#bm_H" target="ftslist" title="search letter H "><b>H </b></a> <a href="whlstf4.htm#bms_HA" target="ftslist" title="search letter HA"><b>HA</b></a> <a href="whlstf4.htm#bms_HD" target="ftslist" title="search letter HD"><b>HD</b></a> <a href="whlstf4.htm#bms_HE" target="ftslist" title="search letter HE"><b>HE</b></a> <a href="whlstf4.htm#bms_HI" target="ftslist" title="search letter HI"><b>HI</b></a> <a href="whlstf4.htm#bms_HO" target="ftslist" title="search letter HO"><b>HO</b></a> <a href="whlstf4.htm#bms_HP" target="ftslist" title="search letter HP"><b>HP</b></a> <a href="whlstf4.htm#bms_HT" target="ftslist" title="search letter HT"><b>HT</b></a> <a href="whlstf4.htm#bms_HX" target="ftslist" title="search letter HX"><b>HX</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstfl9.htm b/doc/salome/gui/GUI/whgdata/whlstfl9.htm
deleted file mode 100755 (executable)
index 9dbde6d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<title>Search Words letter</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<p class="ftsheader"><a name="subkey_I"></a> <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a> <a href="whlstf4.htm#bm_I" target="ftslist" title="search letter I "><b>I </b></a> <a href="whlstf4.htm#bms_IC" target="ftslist" title="search letter IC"><b>IC</b></a> <a href="whlstf4.htm#bms_ID" target="ftslist" title="search letter ID"><b>ID</b></a> <a href="whlstf4.htm#bms_IE" target="ftslist" title="search letter IE"><b>IE</b></a> <a href="whlstf4.htm#bms_IF" target="ftslist" title="search letter IF"><b>IF</b></a> <a href="whlstf4.htm#bms_IG" target="ftslist" title="search letter IG"><b>IG</b></a> <a href="whlstf4.htm#bms_IM" target="ftslist" title="search letter IM"><b>IM</b></a> <a href="whlstf4.htm#bms_IN" target="ftslist" title="search letter IN"><b>IN</b></a> <a href="whlstf5.htm#bms_IO" target="ftslist" title="search letter IO"><b>IO</b></a> <a href="whlstf5.htm#bms_IS" target="ftslist" title="search letter IS"><b>IS</b></a> <a href="whlstf5.htm#bms_IT" target="ftslist" title="search letter IT"><b>IT</b></a>  <a href="whnvl32.htm#home" target="_self" title="back to top level"><b>^</b></a></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstg0.htm b/doc/salome/gui/GUI/whgdata/whlstg0.htm
deleted file mode 100755 (executable)
index b2621b2..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<html>\r
-<head>\r
-<title>Glossary words list</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<base target="bsscright">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.glsheader {margin-left:10pt; margin-top:0pt;}\r
-.glsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.glsheader {margin-top:0pt; } .glsheader {margin-bottom:0pt; } .glsheader {margin-left:9pt; } \r
-\r
-.glsbody {margin-top:0pt; } .glsbody {margin-bottom:0pt; } .glsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; }A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="glsbody" style="margin-bottom:1pt;"><a name="bm_C"></a><nobr><b>Cell</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Element of a mesh. Cells are determined by their connectivity. They can have 0,1,2 or 3 dimension.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><nobr><b>Component</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">One integer or real value can correspond to each component of a field and to each entity of a mesh<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><a name="bm_D"></a><nobr><b>Descendant connectivity</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">It is a description of the entities of the mesh with dimension N. This description is made by an ordered list of geometrical entities (nodes, edges, or faces) with dimension N-1.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><a name="bm_E"></a><nobr><b>Edge</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">An edge of a volumetric or surface mesh. It is composed of 2 or 3 nodes (2 vertex nodes and optionally one middle node).<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><nobr><b>Entity of a mesh</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Geometrical component of the mesh: node, cell, face and edge. Faces and edges are only intermediate entities allowing to define the cells in descendant connectivity.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><nobr><b>Equivalence</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Equivalence represents a list of correspondance 2 by 2 of the entities of the same dimension.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><a name="bm_F"></a><nobr><b>Face</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Face of a volumetrical cell (triangle, quadrangle).<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><nobr><b>Family</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Entities of a mesh are described by a certain number&nbsp;  of characteristics (boundary conditions, groups membership). Families represent classes equivalent to these characteristics (two entities of a mesh can belong to the same family if they have the same characteristics). Every family is determined by a set of attributes and a list of groups membership.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><nobr><b>Field</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Field consists of one or several scalar components. One definite type is associated to the given field and the values corresponding to different components are all of the same type.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><nobr><b>Field profile</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Fields can be defined only on one part of the mesh. Profile&nbsp;  of the field or profile of the component of a field indicates which entities of the mesh contain values.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><a name="bm_G"></a><nobr><b>Group</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Unordered set of entities of a mesh. One entity can belong to&nbsp;  several groups.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><a name="bm_M"></a><nobr><b>Mesh</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Mesh is described by its geometry: list of nodes and list of cells which constitute this mesh. Supplementary information is added with the help of families (initial, boundary conditions).<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><a name="bm_N"></a><nobr><b>Nodal connectivity</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">It is a description of an entity of the mesh by an ordered list of nodes constituting this entity.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><nobr><b>Node</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Node can be an isolated node of a mesh, a vertex or middle node of an edge. A node is associated to a point.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><a name="bm_P"></a><nobr><b>Point</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Geometrical entity determined by its coordinates in the space.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><a name="bm_R"></a><nobr><b>Reference connectivity</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">For each type of entity of a mesh, reference connectivity define the topology of an entity.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><nobr><b>Result</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">List of fields referring to one mesh.<p>\r
-<p class="glsbody" style="margin-bottom:1pt;"><a name="bm_S"></a><nobr><b>Study</b></nobr></p>\r
-<p class="glsbody" style="margin-top:1pt;">Study represents a chain of sequences of calculations.<p>\r
-<p class="glsbody"><br><br></p>\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlsti0.htm b/doc/salome/gui/GUI/whgdata/whlsti0.htm
deleted file mode 100755 (executable)
index f3211ff..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Index words list</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ndxheader {margin-left:10pt; margin-top:0pt;}\r
-.ndxbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ndxheader {margin-top:0pt; } .ndxheader {margin-bottom:0pt; } .ndxheader {margin-left:9pt; } \r
-\r
-.ndxbody {margin-top:0pt; } .ndxbody {margin-bottom:0pt; } .ndxbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstt0.htm b/doc/salome/gui/GUI/whgdata/whlstt0.htm
deleted file mode 100755 (executable)
index f176dfd..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Content</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.tocbody {margin-left:10pt; margin-top:0pt;}\r
-.bo {}\r
-.bc {}\r
-.pn {}\r
-.pr {}\r
-\r
-.tocbody {margin-top:0pt; } .tocbody {margin-bottom:0pt; } .tocbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-img {vertial-align:middle;}\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<table border=0>\r
-<tr><td>\r
-<p class="tocbody">\r
-<nobr><a href="../kernel/introduction.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Welcome to SALOME</a></nobr><br>\r
-<nobr><a name="1"></a><a href="whlstt1.htm#1" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Using this reference manual</a></nobr><br>\r
-<nobr><a name="2"></a><a href="whlstt2.htm#2" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> About SALOME</a></nobr><br>\r
-<nobr><a name="3"></a><a href="whlstt3.htm#3" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> GUI module</a></nobr><br>\r
-</p>\r
-\r
-</td></tr>\r
-<tr><td>\r
-<p><img src="whexpbar.gif" > <p>\r
-</td></tr>\r
-</table>\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstt1.htm b/doc/salome/gui/GUI/whgdata/whlstt1.htm
deleted file mode 100755 (executable)
index 8f068de..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Content</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.tocbody {margin-left:10pt; margin-top:0pt;}\r
-.bo {}\r
-.bc {}\r
-.pn {}\r
-.pr {}\r
-\r
-.tocbody {margin-top:0pt; } .tocbody {margin-bottom:0pt; } .tocbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-img {vertial-align:middle;}\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<table border=0>\r
-<tr><td>\r
-<p class="tocbody">\r
-<nobr><a href="../kernel/introduction.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Welcome to SALOME</a></nobr><br>\r
-<nobr><a name="1"></a><a href="whlstt0.htm#1" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> Using this reference manual</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/about_salome_pro_help_system.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> About SALOME help system</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/navigating_topics.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Navigating topics</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/using_left-hand_tabs.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Using left-hand tabs</a></nobr><br>\r
-<nobr><a name="2"></a><a href="whlstt2.htm#2" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> About SALOME</a></nobr><br>\r
-<nobr><a name="3"></a><a href="whlstt3.htm#3" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> GUI module</a></nobr><br>\r
-</p>\r
-\r
-</td></tr>\r
-<tr><td>\r
-<p><img src="whexpbar.gif" > <p>\r
-</td></tr>\r
-</table>\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstt2.htm b/doc/salome/gui/GUI/whgdata/whlstt2.htm
deleted file mode 100755 (executable)
index 5064d6e..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Content</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.tocbody {margin-left:10pt; margin-top:0pt;}\r
-.bo {}\r
-.bc {}\r
-.pn {}\r
-.pr {}\r
-\r
-.tocbody {margin-top:0pt; } .tocbody {margin-bottom:0pt; } .tocbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-img {vertial-align:middle;}\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<table border=0>\r
-<tr><td>\r
-<p class="tocbody">\r
-<nobr><a href="../kernel/introduction.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Welcome to SALOME</a></nobr><br>\r
-<nobr><a name="1"></a><a href="whlstt1.htm#1" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Using this reference manual</a></nobr><br>\r
-<nobr><a name="2"></a><a href="whlstt0.htm#2" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> About SALOME</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/introduction_to_salome_pro.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Introduction to SALOME</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/about_salome_pro_architecture.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> SALOME architecture</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/readme.html"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Installing SALOME</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/running_salome_pro.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Running SALOME</a></nobr><br>\r
-<nobr><a name="3"></a><a href="whlstt3.htm#3" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> GUI module</a></nobr><br>\r
-</p>\r
-\r
-</td></tr>\r
-<tr><td>\r
-<p><img src="whexpbar.gif" > <p>\r
-</td></tr>\r
-</table>\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstt3.htm b/doc/salome/gui/GUI/whgdata/whlstt3.htm
deleted file mode 100755 (executable)
index 2ac91b3..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Content</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.tocbody {margin-left:10pt; margin-top:0pt;}\r
-.bo {}\r
-.bc {}\r
-.pn {}\r
-.pr {}\r
-\r
-.tocbody {margin-top:0pt; } .tocbody {margin-bottom:0pt; } .tocbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-img {vertial-align:middle;}\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<table border=0>\r
-<tr><td>\r
-<p class="tocbody">\r
-<nobr><a href="../kernel/introduction.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Welcome to SALOME</a></nobr><br>\r
-<nobr><a name="1"></a><a href="whlstt1.htm#1" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Using this reference manual</a></nobr><br>\r
-<nobr><a name="2"></a><a href="whlstt2.htm#2" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> About SALOME</a></nobr><br>\r
-<nobr><a name="3"></a><a href="whlstt0.htm#3" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> GUI module</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../introduction_to_gui.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Introduction to GUI</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/getting_started2.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Getting started</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/salome_pro_desktop.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> SALOME desktop</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a name="4"></a><a href="whlstt4.htm#4" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Study management</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/using_object_browser.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Using Object Browser</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/using_registry.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Using Registry tool</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/using_catalog_generator.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Using Catalog Generator</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a name="5"></a><a href="whlstt5.htm#5" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Setting Preferences</a></nobr><br>\r
-</p>\r
-\r
-</td></tr>\r
-<tr><td>\r
-<p><img src="whexpbar.gif" > <p>\r
-</td></tr>\r
-</table>\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstt4.htm b/doc/salome/gui/GUI/whgdata/whlstt4.htm
deleted file mode 100755 (executable)
index 5c273b7..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Content</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.tocbody {margin-left:10pt; margin-top:0pt;}\r
-.bo {}\r
-.bc {}\r
-.pn {}\r
-.pr {}\r
-\r
-.tocbody {margin-top:0pt; } .tocbody {margin-bottom:0pt; } .tocbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-img {vertial-align:middle;}\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<table border=0>\r
-<tr><td>\r
-<p class="tocbody">\r
-<nobr><a href="../kernel/introduction.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Welcome to SALOME</a></nobr><br>\r
-<nobr><a name="1"></a><a href="whlstt1.htm#1" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Using this reference manual</a></nobr><br>\r
-<nobr><a name="2"></a><a href="whlstt2.htm#2" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> About SALOME</a></nobr><br>\r
-<nobr><a name="3"></a><a href="whlstt0.htm#3" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> GUI module</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../introduction_to_gui.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Introduction to GUI</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/getting_started2.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Getting started</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/salome_pro_desktop.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> SALOME desktop</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a name="4"></a><a href="whlstt3.htm#4" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> Study management</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/creating_a_new_study.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Creating a new study</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/opening_studies.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Opening studies</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/saving_a_study.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Saving and closing studies</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/editing_studies.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Editing studies</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/displaying_studies.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Displaying studies</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../dump_study.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Working with Python Scripts</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/getting_properties_of_the_study.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Setting study properties</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/using_object_browser.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Using Object Browser</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/using_registry.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Using Registry tool</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/using_catalog_generator.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Using Catalog Generator</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a name="5"></a><a href="whlstt5.htm#5" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Setting Preferences</a></nobr><br>\r
-</p>\r
-\r
-</td></tr>\r
-<tr><td>\r
-<p><img src="whexpbar.gif" > <p>\r
-</td></tr>\r
-</table>\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whlstt5.htm b/doc/salome/gui/GUI/whgdata/whlstt5.htm
deleted file mode 100755 (executable)
index 6fb51f3..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Content</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.tocbody {margin-left:10pt; margin-top:0pt;}\r
-.bo {}\r
-.bc {}\r
-.pn {}\r
-.pr {}\r
-\r
-.tocbody {margin-top:0pt; } .tocbody {margin-bottom:0pt; } .tocbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-img {vertial-align:middle;}\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<table border=0>\r
-<tr><td>\r
-<p class="tocbody">\r
-<nobr><a href="../kernel/introduction.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Welcome to SALOME</a></nobr><br>\r
-<nobr><a name="1"></a><a href="whlstt1.htm#1" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Using this reference manual</a></nobr><br>\r
-<nobr><a name="2"></a><a href="whlstt2.htm#2" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> About SALOME</a></nobr><br>\r
-<nobr><a name="3"></a><a href="whlstt0.htm#3" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> GUI module</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../introduction_to_gui.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Introduction to GUI</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/getting_started2.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Getting started</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/salome_pro_desktop.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> SALOME desktop</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a name="4"></a><a href="whlstt4.htm#4" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Study management</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/using_object_browser.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Using Object Browser</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/using_registry.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Using Registry tool</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/using_catalog_generator.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Using Catalog Generator</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;<nobr><a name="5"></a><a href="whlstt3.htm#5" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> Setting Preferences</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../setting_preferences.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Setting Preferences</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../select_color_and_font.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Select Color and Font</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../kernel/setting_preferences.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> SALOME preferences</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../geom_preferences.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Geometry preferences</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../mesh_preferences.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Mesh preferences</a></nobr><br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../post-pro_preferences.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Post-Pro Preferences</a></nobr><br>\r
-</p>\r
-\r
-</td></tr>\r
-<tr><td>\r
-<p><img src="whexpbar.gif" > <p>\r
-</td></tr>\r
-</table>\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whnvf30.htm b/doc/salome/gui/GUI/whgdata/whnvf30.htm
deleted file mode 100755 (executable)
index 33dae3b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>toc frame</title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<frameset rows="100%, *" border="0" frameborder="0">\r
-       <frame name="toctree" title="toc tree frame" src="whlstt0.htm"></frame>\r
-</frameset>\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whnvf31.htm b/doc/salome/gui/GUI/whgdata/whnvf31.htm
deleted file mode 100755 (executable)
index a9128b8..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Index frame</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<frameset rows="40, *" border="0" frameborder="0">\r
-       <frame name="ndxletter" title="index letter frame" src="whnvl31.htm" noresize frameborder="1" scrolling="no" border="0" marginheight="0" marginwidth="0" ></frame>\r
-       <frame name="ndxlist" title="index list frame" src="whlsti0.htm"></frame>\r
-</frameset>\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whnvf32.htm b/doc/salome/gui/GUI/whgdata/whnvf32.htm
deleted file mode 100755 (executable)
index ae87273..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>search frame</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<frameset rows="40, *" border="0" frameborder="0">\r
-       <frame name="ftsletter" title="search letter frame" src="whnvl32.htm" noresize frameborder="1" scrolling="no" border="0" marginheight="0" marginwidth="0" ></frame>\r
-       <frame name="ftslist" title="seach word frame" src="whlstf0.htm"></frame>\r
-</frameset>\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whnvf33.htm b/doc/salome/gui/GUI/whgdata/whnvf33.htm
deleted file mode 100755 (executable)
index 9af2824..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Glossary frame</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-</head>\r
-<frameset rows="40, *" border="0" frameborder="0">\r
-       <frame name="glsletter" title="glossary letter frame" src="whnvl33.htm" noresize frameborder="1" scrolling="no" border="0" marginheight="0" marginwidth="0" ></frame>\r
-       <frame name="glslist" title="glossary defination frame" src="whlstg0.htm"></frame>\r
-</frameset>\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whnvl31.htm b/doc/salome/gui/GUI/whgdata/whnvl31.htm
deleted file mode 100755 (executable)
index 0b07308..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Index Letters</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ndxheader {margin-left:10pt; margin-top:0pt;}\r
-.ndxbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ndxheader {margin-top:0pt; } .ndxheader {margin-bottom:0pt; } .ndxheader {margin-left:9pt; } \r
-\r
-.ndxbody {margin-top:0pt; } .ndxbody {margin-bottom:0pt; } .ndxbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-\r
-<body>\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whnvl32.htm b/doc/salome/gui/GUI/whgdata/whnvl32.htm
deleted file mode 100755 (executable)
index b168193..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Search Letters</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="ftsheader">\r
-<a name="home"></a> <a href="whlstfl0.htm#subkey_{" target="_self"title="search non-alphabet letter"><b>#</b></a> \r
- <a href="whlstfl1.htm#subkey_A" target="_self"title="search letter A"><b>A</b></a> \r
- <a href="whlstfl2.htm#subkey_B" target="_self"title="search letter B"><b>B</b></a> \r
- <a href="whlstfl3.htm#subkey_C" target="_self"title="search letter C"><b>C</b></a> \r
- <a href="whlstfl4.htm#subkey_D" target="_self"title="search letter D"><b>D</b></a> \r
- <a href="whlstfl5.htm#subkey_E" target="_self"title="search letter E"><b>E</b></a> \r
- <a href="whlstfl6.htm#subkey_F" target="_self"title="search letter F"><b>F</b></a> \r
- <a href="whlstfl7.htm#subkey_G" target="_self"title="search letter G"><b>G</b></a> \r
- <a href="whlstfl8.htm#subkey_H" target="_self"title="search letter H"><b>H</b></a> \r
- <a href="whlstfl9.htm#subkey_I" target="_self"title="search letter I"><b>I</b></a> \r
- <a href="whlstfl10.htm#subkey_J" target="_self"title="search letter J"><b>J</b></a> \r
- <a href="whlstfl11.htm#subkey_K" target="_self"title="search letter K"><b>K</b></a> \r
- <a href="whlstfl12.htm#subkey_L" target="_self"title="search letter L"><b>L</b></a> \r
- <a href="whlstfl13.htm#subkey_M" target="_self"title="search letter M"><b>M</b></a> \r
- <a href="whlstfl14.htm#subkey_N" target="_self"title="search letter N"><b>N</b></a> \r
- <a href="whlstfl15.htm#subkey_O" target="_self"title="search letter O"><b>O</b></a> \r
- <a href="whlstfl16.htm#subkey_P" target="_self"title="search letter P"><b>P</b></a> \r
- <a href="whlstfl17.htm#subkey_Q" target="_self"title="search letter Q"><b>Q</b></a> \r
- <a href="whlstfl18.htm#subkey_R" target="_self"title="search letter R"><b>R</b></a> \r
- <a href="whlstfl19.htm#subkey_S" target="_self"title="search letter S"><b>S</b></a> \r
- <a href="whlstfl20.htm#subkey_T" target="_self"title="search letter T"><b>T</b></a> \r
- <a href="whlstfl21.htm#subkey_U" target="_self"title="search letter U"><b>U</b></a> \r
- <a href="whlstfl22.htm#subkey_V" target="_self"title="search letter V"><b>V</b></a> \r
- <a href="whlstfl23.htm#subkey_W" target="_self"title="search letter W"><b>W</b></a> \r
- <a href="whlstfl24.htm#subkey_X" target="_self"title="search letter X"><b>X</b></a> \r
- <a href="whlstfl25.htm#subkey_Y" target="_self"title="search letter Y"><b>Y</b></a> \r
- <a href="whlstfl26.htm#subkey_Z" target="_self"title="search letter Z"><b>Z</b></a> \r
-</p>\r
-\r
-<body>\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whnvl33.htm b/doc/salome/gui/GUI/whgdata/whnvl33.htm
deleted file mode 100755 (executable)
index e3c66ee..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Glossary Letters</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.glsheader {margin-left:10pt; margin-top:0pt;}\r
-.glsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.glsheader {margin-top:0pt; } .glsheader {margin-bottom:0pt; } .glsheader {margin-left:9pt; } \r
-\r
-.glsbody {margin-top:0pt; } .glsbody {margin-bottom:0pt; } .glsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; }A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-<style>\r
-<!--\r
-\r
--->\r
-</style>\r
-</head>\r
-<body marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<p class="glsheader">\r
- <font class="inactive">#</font> \r
- <font class="inactive">A</font> \r
- <font class="inactive">B</font> \r
- <a href="whlstg0.htm#bm_C" target="glslist"title="glossary letter C"><b>C</b></a> \r
- <a href="whlstg0.htm#bm_D" target="glslist"title="glossary letter D"><b>D</b></a> \r
- <a href="whlstg0.htm#bm_E" target="glslist"title="glossary letter E"><b>E</b></a> \r
- <a href="whlstg0.htm#bm_F" target="glslist"title="glossary letter F"><b>F</b></a> \r
- <a href="whlstg0.htm#bm_G" target="glslist"title="glossary letter G"><b>G</b></a> \r
- <font class="inactive">H</font> \r
- <font class="inactive">I</font> \r
- <font class="inactive">J</font> \r
- <font class="inactive">K</font> \r
- <font class="inactive">L</font> \r
- <a href="whlstg0.htm#bm_M" target="glslist"title="glossary letter M"><b>M</b></a> \r
- <a href="whlstg0.htm#bm_N" target="glslist"title="glossary letter N"><b>N</b></a> \r
- <font class="inactive">O</font> \r
- <a href="whlstg0.htm#bm_P" target="glslist"title="glossary letter P"><b>P</b></a> \r
- <font class="inactive">Q</font> \r
- <a href="whlstg0.htm#bm_R" target="glslist"title="glossary letter R"><b>R</b></a> \r
- <a href="whlstg0.htm#bm_S" target="glslist"title="glossary letter S"><b>S</b></a> \r
- <font class="inactive">T</font> \r
- <font class="inactive">U</font> \r
- <font class="inactive">V</font> \r
- <font class="inactive">W</font> \r
- <font class="inactive">X</font> \r
- <font class="inactive">Y</font> \r
- <font class="inactive">Z</font> \r
-</p>\r
-\r
-<body>\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whnvp30.htm b/doc/salome/gui/GUI/whgdata/whnvp30.htm
deleted file mode 100755 (executable)
index 1a8036d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- WebHelp version 5.10 -->\r
-<html>\r
-<head>\r
-<title> Content Navigation Pane </title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-\r
-</style>\r
-</head>\r
-<frameset rows="36, *" border="0" frameborder="0">\r
-       <frame name="toctabs" title="tab selection frame" src="whnvt30.htm" noresize frameborder="no" scrolling="no" border="0" marginheight="0" marginwidth="0" ></frame>\r
-       <frame name="toclist" title="content frame" src="whlstt0.htm"></frame>\r
-</frameset>\r
-</html>
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whgdata/whnvp31.htm b/doc/salome/gui/GUI/whgdata/whnvp31.htm
deleted file mode 100755 (executable)
index fa146f1..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- WebHelp version 5.10 -->\r
-<html>\r
-<head>\r
-<title> Index Navigation Pane </title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-\r
-</style>\r
-</head>\r
-<frameset rows="36, *" border="0" frameborder="0">\r
-       <frame name="ndxtabs" title="tab selection frame" src="whnvt31.htm" noresize frameborder="no" scrolling="no" border="0" marginheight="0" marginwidth="0" ></frame>\r
-       <frame name="ndxdata" title="index frame" src="whnvf31.htm"></frame>\r
-</frameset>\r
-</html>
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whgdata/whnvp32.htm b/doc/salome/gui/GUI/whgdata/whnvp32.htm
deleted file mode 100755 (executable)
index c334807..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- WebHelp version 5.10 -->\r
-<html>\r
-<head>\r
-<title> Search Navigation Pane </title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-\r
-</style>\r
-</head>\r
-<frameset rows="36, *" border="0" frameborder="0">\r
-       <frame name="ftstabs" title="tab selection frame" src="whnvt32.htm" noresize frameborder="no" scrolling="no" border="0" marginheight="0" marginwidth="0" ></frame>\r
-       <frame name="ftsdata" title="search frame" src="whnvf32.htm"></frame>\r
-</frameset>\r
-</html>
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whgdata/whnvp33.htm b/doc/salome/gui/GUI/whgdata/whnvp33.htm
deleted file mode 100755 (executable)
index 8fb4636..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- WebHelp version 5.10 -->\r
-<html>\r
-<head>\r
-<title> Glossary Navigation Pane </title>\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-\r
-</style>\r
-</head>\r
-<frameset rows="36, *" border="0" frameborder="0">\r
-       <frame name="glstabs" title="tab selection frame" src="whnvt33.htm" noresize frameborder="no" scrolling="no" border="0" marginheight="0" marginwidth="0" ></frame>\r
-       <frame name="glsdata" title="glossary frame" src="whnvf33.htm"></frame>\r
-</frameset>\r
-</html>
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whgdata/whnvt30.htm b/doc/salome/gui/GUI/whgdata/whnvt30.htm
deleted file mode 100755 (executable)
index f7b81b6..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Content Navigation Tab</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.tocbody {margin-left:10pt; margin-top:0pt;}\r
-.bo {}\r
-.bc {}\r
-.pn {}\r
-.pr {}\r
-\r
-.tocbody {margin-top:0pt; } .tocbody {margin-bottom:0pt; } .tocbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-img {vertial-align:middle;}\r
--->\r
-</style>\r
-</head>\r
-<body class="tabs" marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<table class="tabs" width="100%">\r
- <tr> \r
-   <td class="tabs">\r
-   <nobr><a href="javascript:void(0)" title="Contents"><img src="../whd_tab1.gif" border="0"></a><a href="whnvp32.htm" target="_parent" title="Search"><img src="../whd_tab6.gif" border="0"></a><a href="whnvp33.htm" target="_parent" title="Glossary"><img src="../whd_tab8.gif" border="0"></a></nobr>\r
-   </td>\r
- </tr>\r
-</table>\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whnvt31.htm b/doc/salome/gui/GUI/whgdata/whnvt31.htm
deleted file mode 100755 (executable)
index 37ae836..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Index Navigation Tab</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ndxheader {margin-left:10pt; margin-top:0pt;}\r
-.ndxbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ndxheader {margin-top:0pt; } .ndxheader {margin-bottom:0pt; } .ndxheader {margin-left:9pt; } \r
-\r
-.ndxbody {margin-top:0pt; } .ndxbody {margin-bottom:0pt; } .ndxbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body class="tabs" marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<table class="tabs" width="100%">\r
- <tr> \r
-   <td class="tabs">\r
-   <nobr><a href="whnvp30.htm" target="_parent" title="Contents"><img src="../whd_tab2.gif" border="0"></a><a href="whnvp32.htm" target="_parent" title="Search"><img src="../whd_tab6.gif" border="0"></a><a href="whnvp33.htm" target="_parent" title="Glossary"><img src="../whd_tab8.gif" border="0"></a></nobr>\r
-   </td>\r
- </tr>\r
-</table>\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whnvt32.htm b/doc/salome/gui/GUI/whgdata/whnvt32.htm
deleted file mode 100755 (executable)
index fc4ee7e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Search Navigation Tab</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.ftsheader {margin-left:10pt; margin-top:0pt;}\r
-.ftsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.ftsheader {margin-top:0pt; } .ftsheader {margin-bottom:0pt; } .ftsheader {margin-left:9pt; } \r
-\r
-.ftsbody {margin-top:0pt; } .ftsbody {margin-bottom:0pt; } .ftsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; } A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body class="tabs" marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<table class="tabs" width="100%">\r
- <tr> \r
-   <td class="tabs">\r
-   <nobr><a href="whnvp30.htm" target="_parent" title="Contents"><img src="../whd_tab2.gif" border="0"></a><a href="javascript:void(0)" title="Search"><img src="../whd_tab5.gif" border="0"></a><a href="whnvp33.htm" target="_parent" title="Glossary"><img src="../whd_tab8.gif" border="0"></a></nobr>\r
-   </td>\r
- </tr>\r
-</table>\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whgdata/whnvt33.htm b/doc/salome/gui/GUI/whgdata/whnvt33.htm
deleted file mode 100755 (executable)
index 54c7420..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>\r
-<head>\r
-<!-- WebHelp version 5.10 -->\r
-<title>Glossary Navigation Tab</title>\r
-<base target="bsscright">\r
-\r
-<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
-<meta name="description" content="WebHelp 5.50">\r
-<style>\r
-<!--\r
-body {margin-left:1pt; margin-top:1pt; margin-right:1pt;font-family:Arial; font-size:9pt;}\r
-\r
-A:link {font-family:Arial; font-size:9pt; color:#000000;  font-style:normal;  text-decoration:none; }\r
-A:visited {font-family:Arial; font-size:9pt; color:#000000; font-style:normal;  text-decoration:none; }\r
-A:active {background-color:#cccccc;}\r
-A:hover {font-family:Arial; font-size:9pt; color:#007f00; font-style:normal;  text-decoration:underline; }\r
-\r
-.tabs {background-color:#c0c0c0;}\r
-.glsheader {margin-left:10pt; margin-top:0pt;}\r
-.glsbody {margin-left:10pt; margin-top:0pt;}\r
-.inactive {color:#666666;}\r
-.glsheader {margin-top:0pt; } .glsheader {margin-bottom:0pt; } .glsheader {margin-left:9pt; } \r
-\r
-.glsbody {margin-top:0pt; } .glsbody {margin-bottom:0pt; } .glsbody {margin-left:9pt; } \r
-p {color:#000000; } p {font-family:Arial; } p {font-size:9pt; } p {font-style:normal; } p {text-decoration:none; } \r
-A:link {color:#000000; } A:link {font-family:Arial; } A:link {font-size:9pt; } A:link {font-style:normal; } A:link {text-decoration:none; } \r
-A:visited {color:#000000; } A:visited {font-family:Arial; }A:visited {font-size:9pt; } A:visited {font-style:normal; } A:visited {text-decoration:none; } \r
-A:active {background-color:#cccccc; } \r
-A:hover {color:#007f00; } A:hover {font-family:Arial; } A:hover {font-size:9pt; } A:hover {font-style:normal; } A:hover {text-decoration:underline; } \r
-\r
--->\r
-</style>\r
-</head>\r
-<body class="tabs" marginheight="0"  marginwidth="0" bgproperties="fixed">\r
-<table class="tabs" width="100%">\r
- <tr> \r
-   <td class="tabs">\r
-   <nobr><a href="whnvp30.htm" target="_parent" title="Contents"><img src="../whd_tab2.gif" border="0"></a><a href="whnvp32.htm" target="_parent" title="Search"><img src="../whd_tab6.gif" border="0"></a><a href="javascript:void(0)" title="Glossary"><img src="../whd_tab7.gif" border="0"></a></nobr>\r
-   </td>\r
- </tr>\r
-</table>\r
-</body>\r
-\r
-</html>\r
-\r
diff --git a/doc/salome/gui/GUI/whxdata/whftdata0.xml b/doc/salome/gui/GUI/whxdata/whftdata0.xml
deleted file mode 100755 (executable)
index b7e1347..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version='1.0' encoding='windows-1252' ?>\r
-<ftstdata>\r
-<topic name="Dump Study" url="dump_study.htm" />\r
-<topic name="GEOM preferences" url="geom_preferences.htm" />\r
-<topic name="Introduction to GUI" url="introduction_to_gui.htm" />\r
-<topic name="About SALOME architecture" url="kernel/about_salome_pro_architecture.htm" />\r
-<topic name="About SALOME help system" url="kernel/about_salome_pro_help_system.htm" />\r
-<topic name="Creating a new study" url="kernel/creating_a_new_study.htm" />\r
-<topic name="Displaying studies" url="kernel/displaying_studies.htm" />\r
-<topic name="Editing studies" url="kernel/editing_studies.htm" />\r
-<topic name="Getting properties of the study" url="kernel/getting_properties_of_the_study.htm" />\r
-<topic name="Getting started2" url="kernel/getting_started2.htm" />\r
-<topic name="Introduction" url="kernel/introduction.htm" />\r
-<topic name="Introduction to SALOME" url="kernel/introduction_to_salome_pro.htm" />\r
-<topic name="Navigating topics" url="kernel/navigating_topics.htm" />\r
-<topic name="Opening studies" url="kernel/opening_studies.htm" />\r
-<topic name="SALOME Installation Wizard Help" url="kernel/readme.html" />\r
-<topic name="Running SALOME" url="kernel/running_salome_pro.htm" />\r
-<topic name="SALOME desktop" url="kernel/salome_pro_desktop.htm" />\r
-<topic name="Saving a study" url="kernel/saving_a_study.htm" />\r
-<topic name="Setting preferences" url="kernel/setting_preferences.htm" />\r
-<topic name="Using Catalog Generator" url="kernel/using_catalog_generator.htm" />\r
-<topic name="Using left-hand tabs" url="kernel/using_left-hand_tabs.htm" />\r
-<topic name="Using Object Browser" url="kernel/using_object_browser.htm" />\r
-<topic name="Using Registry tool" url="kernel/using_registry.htm" />\r
-<topic name="MESH preferences" url="mesh_preferences.htm" />\r
-<topic name="OCC 3D Viewer" url="occ_3d_viewer.htm" />\r
-<topic name="Post-Pro Preferences" url="post-pro_preferences.htm" />\r
-<topic name="Select Color and Font" url="select_color_and_font.htm" />\r
-<topic name="Setting Preferences" url="setting_preferences.htm" />\r
-<topic name="VTK 3D Viewer" url="vtk_3d_viewer.htm" />\r
-\r
-</ftstdata>  \r
diff --git a/doc/salome/gui/GUI/whxdata/whfts.xml b/doc/salome/gui/GUI/whxdata/whfts.xml
deleted file mode 100755 (executable)
index 52af9b4..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='windows-1252' ?>\r
-<fts>\r
-<chunkinfo url="whfwdata0.xml" first="__version__" last="zoom"/>\r
-\r
-<tchunkinfo first="0" last="26" url="whftdata0.xml" />\r
-\r
-</fts>\r
diff --git a/doc/salome/gui/GUI/whxdata/whfwdata0.xml b/doc/salome/gui/GUI/whxdata/whfwdata0.xml
deleted file mode 100755 (executable)
index 8aa4a57..0000000
+++ /dev/null
@@ -1,1385 +0,0 @@
-<?xml version='1.0' encoding='windows-1252' ?>\r
-<ftswdata>\r
-<key name="__version__"> 14, </key>\r
-<key name="_omnipymodul"> 14, </key>\r
-<key name="_root_dir"> 14, </key>\r
-<key name="_src_dir"> 14, </key>\r
-<key name="0"> 6,2,25,16,14, </key>\r
-<key name="001"> 25, </key>\r
-<key name="01"> 25, </key>\r
-<key name="1"> 5,25,15,14, </key>\r
-<key name="10"> 25,14, </key>\r
-<key name="100"> 25, </key>\r
-<key name="103100"> 14, </key>\r
-<key name="13"> 14, </key>\r
-<key name="16"> 25, </key>\r
-<key name="16x16"> 25, </key>\r
-<key name="2"> 5,25,15,14, </key>\r
-<key name="200"> 25, </key>\r
-<key name="23"> 14, </key>\r
-<key name="24"> 14, </key>\r
-<key name="256"> 25, </key>\r
-<key name="2a2"> 14, </key>\r
-<key name="2d"> 6,10,2,25, </key>\r
-<key name="3"> 6,2,15,16,14, </key>\r
-<key name="31"> 14, </key>\r
-<key name="33"> 25, </key>\r
-<key name="3d"> 10,2,24,25,14,18,28, </key>\r
-<key name="4"> 14, </key>\r
-<key name="5"> 14, </key>\r
-<key name="50"> 25, </key>\r
-<key name="512"> 25, </key>\r
-<key name="6"> 14, </key>\r
-<key name="7"> 14, </key>\r
-<key name="8"> 14, </key>\r
-<key name="9"> 14, </key>\r
-<key name="abl"> 3,6,24,14,18,28, </key>\r
-<key name="abort"> 14, </key>\r
-<key name="abov"> 8,14, </key>\r
-<key name="abscissa"> 23,25, </key>\r
-<key name="absolut"> 25, </key>\r
-<key name="abstraction"> 5, </key>\r
-<key name="ac"> 14, </key>\r
-<key name="acceptabl"> 25, </key>\r
-<key name="acces"> 3,1,23,24,25,16,18,21,28, </key>\r
-<key name="accessibl"> 10,27, </key>\r
-<key name="accord"> 25,15,16,14, </key>\r
-<key name="account"> 14, </key>\r
-<key name="achiev"> 3, </key>\r
-<key name="acquaint"> 4, </key>\r
-<key name="action"> 25,14, </key>\r
-<key name="activ"> 5,6,25,16,17, </key>\r
-<key name="activat"> 5,16,17, </key>\r
-<key name="activity"> 25, </key>\r
-<key name="actual"> 5,14, </key>\r
-<key name="ad"> 0,14,26,19, </key>\r
-<key name="adapt"> 3, </key>\r
-<key name="add"> 15,16,14,26,18,19, </key>\r
-<key name="addition"> 5,14, </key>\r
-<key name="additional"> 3,2,25,15,16,14,21, </key>\r
-<key name="addres"> 25, </key>\r
-<key name="adjust"> 25, </key>\r
-<key name="advanc"> 14,19, </key>\r
-<key name="affect"> 3, </key>\r
-<key name="again"> 6,12,14,17, </key>\r
-<key name="algorithm"> 3,11,14, </key>\r
-<key name="allow"> 3,0,7,1,11,23,24,25,15,16,14,17,26,18,27,19,22,28, </key>\r
-<key name="almost"> 17, </key>\r
-<key name="along"> 11,18,28, </key>\r
-<key name="alongsid"> 19, </key>\r
-<key name="alpha"> 25, </key>\r
-<key name="already"> 14, </key>\r
-<key name="alway"> 11, </key>\r
-<key name="amount"> 14, </key>\r
-<key name="animation"> 25, </key>\r
-<key name="anoth"> 3,17, </key>\r
-<key name="any"> 3,4,6,1,8,11,12,25,15,16,14,17,27, </key>\r
-<key name="anyth"> 14, </key>\r
-<key name="ap"> 27, </key>\r
-<key name="api"> 0,25, </key>\r
-<key name="appear"> 0,8,9,14,18,19,22, </key>\r
-<key name="appearanc"> 23, </key>\r
-<key name="applet"> 4, </key>\r
-<key name="appli"> 1, </key>\r
-<key name="application"> 3,6,0,10,2,15,16,14,17,18,27,19, </key>\r
-<key name="approach"> 11,16,14, </key>\r
-<key name="appropriat"> 10,14, </key>\r
-<key name="approximat"> 14, </key>\r
-<key name="arabic"> 26, </key>\r
-<key name="architectur"> 3,0,10, </key>\r
-<key name="area"> 6,24,16,18,28, </key>\r
-<key name="argument"> 14, </key>\r
-<key name="around"> 24,28, </key>\r
-<key name="arrang"> 25, </key>\r
-<key name="ascii"> 17,18, </key>\r
-<key name="assign"> 25, </key>\r
-<key name="associat"> 13,25,21, </key>\r
-<key name="attach"> 10,14, </key>\r
-<key name="attribut"> 14,21, </key>\r
-<key name="author"> 8,19, </key>\r
-<key name="auto"> 18, </key>\r
-<key name="automatic"> 23,14,18, </key>\r
-<key name="automatical"> 0,23,13,25,15,16,14,17,27, </key>\r
-<key name="availability"> 7, </key>\r
-<key name="availabl"> 3,5,7,10,24,14,28, </key>\r
-<key name="averag"> 25, </key>\r
-<key name="avi"> 25, </key>\r
-<key name="avoid"> 0,14, </key>\r
-<key name="awar"> 14, </key>\r
-<key name="ax"> 24,18,28, </key>\r
-<key name="axi"> 18,28, </key>\r
-<key name="b"> 14, </key>\r
-<key name="back"> 23,14, </key>\r
-<key name="background"> 25,18, </key>\r
-<key name="bar"> 23,25,21, </key>\r
-<key name="bas"> 3,10,2,24,14,17, </key>\r
-<key name="bash"> 14, </key>\r
-<key name="basi"> 3,24,25, </key>\r
-<key name="basic"> 3,11,16,14,26, </key>\r
-<key name="batch"> 3,0,15,14, </key>\r
-<key name="be"> 1,14, </key>\r
-<key name="becom"> 6,25,14, </key>\r
-<key name="befor"> 14, </key>\r
-<key name="begin"> 14,18,22, </key>\r
-<key name="behav"> 3, </key>\r
-<key name="behavior"> 10,14, </key>\r
-<key name="behaviour"> 25, </key>\r
-<key name="below"> 12,25,14, </key>\r
-<key name="bet"> 25, </key>\r
-<key name="bicolor"> 25, </key>\r
-<key name="big"> 25, </key>\r
-<key name="bin"> 15,14,19, </key>\r
-<key name="binari"> 14, </key>\r
-<key name="binary"> 17, </key>\r
-<key name="blu"> 14, </key>\r
-<key name="blur"> 3, </key>\r
-<key name="bmp"> 24,28, </key>\r
-<key name="bold"> 14, </key>\r
-<key name="book"> 20, </key>\r
-<key name="boost"> 14, </key>\r
-<key name="boost_version"> 14, </key>\r
-<key name="boostdir"> 14, </key>\r
-<key name="border"> 23,16, </key>\r
-<key name="both"> 2,23,25,14, </key>\r
-<key name="bottom"> 10,23,25,14,18, </key>\r
-<key name="bound"> 24,28, </key>\r
-<key name="boundari"> 1, </key>\r
-<key name="box"> 0,1,8,23,24,13,25,14,17,26,18,27,19,22,28, </key>\r
-<key name="bracket"> 14, </key>\r
-<key name="break"> 14, </key>\r
-<key name="brep"> 10, </key>\r
-<key name="brief"> 6,12, </key>\r
-<key name="bring"> 2, </key>\r
-<key name="brows"> 4,5,6,0,2,13,25,16,14,17,18,19,21, </key>\r
-<key name="build"> 25,14,19, </key>\r
-<key name="built"> 11,25,14, </key>\r
-<key name="button"> 2,12,24,13,25,14,17,26,18,27,19,22,28, </key>\r
-<key name="button_label"> 14, </key>\r
-<key name="button_script"> 14, </key>\r
-<key name="button_tooltip"> 14, </key>\r
-<key name="c"> 3,15,14, </key>\r
-<key name="ca"> 10, </key>\r
-<key name="cad"> 10,11, </key>\r
-<key name="cal"> 3,0,14, </key>\r
-<key name="calculation"> 9,10,11, </key>\r
-<key name="call"> 14,17,19,22, </key>\r
-<key name="cam"> 3, </key>\r
-<key name="camera"> 25, </key>\r
-<key name="cancel"> 14, </key>\r
-<key name="capability"> 19, </key>\r
-<key name="caption"> 14, </key>\r
-<key name="car"> 10, </key>\r
-<key name="careful"> 14, </key>\r
-<key name="carri"> 23, </key>\r
-<key name="carry"> 10, </key>\r
-<key name="cas"> 3,8,11,25,16,14,17, </key>\r
-<key name="cascad"> 24,14, </key>\r
-<key name="casroot"> 14, </key>\r
-<key name="catalog"> 19, </key>\r
-<key name="catalogmodulegeneral"> 19, </key>\r
-<key name="catalogmodulepersonnel"> 19, </key>\r
-<key name="catalogu"> 2,15, </key>\r
-<key name="categori"> 20, </key>\r
-<key name="cd"> 14, </key>\r
-<key name="cel"> 25,26, </key>\r
-<key name="cent"> 24,28, </key>\r
-<key name="center"> 25, </key>\r
-<key name="centr"> 25, </key>\r
-<key name="central"> 25, </key>\r
-<key name="centraliz"> 15, </key>\r
-<key name="chang"> 3,6,8,23,24,25,16,14,17,18,27,28, </key>\r
-<key name="channel"> 25, </key>\r
-<key name="chapter"> 4, </key>\r
-<key name="character"> 26, </key>\r
-<key name="charg"> 14, </key>\r
-<key name="check"> 0,25,16,14,18,28, </key>\r
-<key name="check_enabl"> 14, </key>\r
-<key name="check_version"> 14, </key>\r
-<key name="checkbox"> 23,25,14,18, </key>\r
-<key name="choic"> 0,25,14,26, </key>\r
-<key name="choos"> 5,7,1,8,23,24,13,25,16,14,26,19,22,28, </key>\r
-<key name="chosen"> 25,26,19, </key>\r
-<key name="clamp"> 25, </key>\r
-<key name="classic"> 16, </key>\r
-<key name="clean"> 25, </key>\r
-<key name="clear"> 14, </key>\r
-<key name="clearall"> 16, </key>\r
-<key name="click"> 5,6,0,7,1,8,23,12,24,13,25,16,14,17,26,18,27,19,20,21,22,28, </key>\r
-<key name="clickabl"> 12, </key>\r
-<key name="client"> 3, </key>\r
-<key name="clip"> 24,25, </key>\r
-<key name="clon"> 24, </key>\r
-<key name="clos"> 3,12,25,14,17,27,20, </key>\r
-<key name="cluster"> 3, </key>\r
-<key name="cod"> 3,14, </key>\r
-<key name="coef"> 23, </key>\r
-<key name="coincid"> 14, </key>\r
-<key name="collect"> 14, </key>\r
-<key name="color"> 1,23,25,26,18,28, </key>\r
-<key name="column"> 18,21,22, </key>\r
-<key name="combin"> 11,25, </key>\r
-<key name="comfortabl"> 16, </key>\r
-<key name="comma"> 14, </key>\r
-<key name="command"> 3,0,15,14, </key>\r
-<key name="common"> 2,11,16,14,17,27, </key>\r
-<key name="compar"> 3,23, </key>\r
-<key name="compil"> 14, </key>\r
-<key name="complet"> 8,14,20,22, </key>\r
-<key name="complex"> 3,10, </key>\r
-<key name="component"> 3,4,0,7,10,2,11,12,13,25,16,17,18,19,21,22, </key>\r
-<key name="compos"> 25, </key>\r
-<key name="comput"> 14,18, </key>\r
-<key name="computation"> 3,10, </key>\r
-<key name="computational"> 10, </key>\r
-<key name="concept"> 3,12, </key>\r
-<key name="concern"> 10,14, </key>\r
-<key name="conclusion"> 3, </key>\r
-<key name="config"> 14, </key>\r
-<key name="config_fil"> 14, </key>\r
-<key name="config_mandrake_10"> 14, </key>\r
-<key name="configur"> 10,14, </key>\r
-<key name="configurabl"> 11, </key>\r
-<key name="configuration"> 14, </key>\r
-<key name="confirm"> 0,14, </key>\r
-<key name="confirmation"> 14, </key>\r
-<key name="conflict"> 14, </key>\r
-<key name="connect"> 9,11,13,16,18, </key>\r
-<key name="consist"> 16, </key>\r
-<key name="consol"> 6,10,15,16,14,17,18, </key>\r
-<key name="constant"> 3,15, </key>\r
-<key name="construction"> 10,11,24, </key>\r
-<key name="consum"> 0,14, </key>\r
-<key name="contain"> 3,4,5,0,8,13,15,16,14,27,19,20,21,22, </key>\r
-<key name="container"> 15, </key>\r
-<key name="content"> 0,24,25,14,20,28, </key>\r
-<key name="context"> 16,14,21, </key>\r
-<key name="continu"> 14, </key>\r
-<key name="control"> 5,23,25, </key>\r
-<key name="convert"> 0,14, </key>\r
-<key name="cooperat"> 11, </key>\r
-<key name="coordinat"> 24,18,28, </key>\r
-<key name="copi"> 25, </key>\r
-<key name="copy"> 7,16,14,17, </key>\r
-<key name="copyright"> 14, </key>\r
-<key name="corba"> 3,5,2,15, </key>\r
-<key name="corn"> 25,17,26, </key>\r
-<key name="correct"> 16, </key>\r
-<key name="correspond"> 23,13,25,15,14,20, </key>\r
-<key name="cost"> 10, </key>\r
-<key name="coupl"> 3,10, </key>\r
-<key name="cpp"> 15, </key>\r
-<key name="cppcontain"> 15, </key>\r
-<key name="creat"> 3,4,5,6,0,9,10,2,11,23,24,13,25,15,16,14,17,18,19,21, </key>\r
-<key name="creation"> 3,2,25,14, </key>\r
-<key name="cros"> 12,24,17, </key>\r
-<key name="csh"> 15,14, </key>\r
-<key name="cshell"> 15, </key>\r
-<key name="ctrl"> 25, </key>\r
-<key name="current"> 6,0,8,12,24,25,15,14,17,18,27,21,22, </key>\r
-<key name="cursor"> 25, </key>\r
-<key name="curv"> 25,18, </key>\r
-<key name="custom"> 10,15,26,18,19, </key>\r
-<key name="customiz"> 14, </key>\r
-<key name="customization"> 3,14, </key>\r
-<key name="cut"> 25, </key>\r
-<key name="cutlin"> 25, </key>\r
-<key name="cycl"> 25, </key>\r
-<key name="cyrillic"> 26, </key>\r
-<key name="d"> 14, </key>\r
-<key name="dat"> 8,22, </key>\r
-<key name="data"> 3,5,0,9,10,2,11,25,17,18,19, </key>\r
-<key name="databas"> 3, </key>\r
-<key name="debug"> 21, </key>\r
-<key name="decreas"> 25, </key>\r
-<key name="default"> 5,1,23,24,25,15,16,14,17,18,27,21,28, </key>\r
-<key name="defin"> 3,0,1,10,23,24,25,14,26,28, </key>\r
-<key name="definit"> 3,5,7,15,16,21,22, </key>\r
-<key name="definition"> 3,1,10,20, </key>\r
-<key name="deform"> 28, </key>\r
-<key name="delay"> 10, </key>\r
-<key name="delet"> 17, </key>\r
-<key name="demand"> 10,2,25, </key>\r
-<key name="depend"> 7,25,14,21, </key>\r
-<key name="dependanci"> 14, </key>\r
-<key name="dependenci"> 14, </key>\r
-<key name="deriv"> 3, </key>\r
-<key name="describ"> 3,4,14,19, </key>\r
-<key name="description"> 15,14,19, </key>\r
-<key name="design"> 10,25, </key>\r
-<key name="desir"> 19, </key>\r
-<key name="desktop"> 6,9,2,16,14,17, </key>\r
-<key name="destin"> 9,16,21,22, </key>\r
-<key name="destination"> 12,14, </key>\r
-<key name="detail"> 14,18, </key>\r
-<key name="develop"> 3,24,14, </key>\r
-<key name="development"> 3,10, </key>\r
-<key name="devic"> 25, </key>\r
-<key name="diagram"> 23, </key>\r
-<key name="dialog"> 0,1,8,23,13,25,16,14,17,26,18,27,19,22, </key>\r
-<key name="dif"> 14, </key>\r
-<key name="differ"> 16, </key>\r
-<key name="differenc"> 3,16,14,17, </key>\r
-<key name="different"> 3,4,5,9,13,25,15,16,14,17,21, </key>\r
-<key name="digit"> 23, </key>\r
-<key name="digital"> 10, </key>\r
-<key name="dir"> 14, </key>\r
-<key name="direct"> 14, </key>\r
-<key name="direction"> 6,24,25, </key>\r
-<key name="directori"> 14,18, </key>\r
-<key name="directory"> 15,14,17,18,27,19, </key>\r
-<key name="disabl"> 25,15,14, </key>\r
-<key name="disable_flag"> 14, </key>\r
-<key name="disk"> 15,14, </key>\r
-<key name="display"> 6,1,23,12,24,25,15,16,14,17,18,20,21,22,28, </key>\r
-<key name="distanc"> 25,28, </key>\r
-<key name="distinction"> 3, </key>\r
-<key name="distribut"> 3, </key>\r
-<key name="distribution"> 14, </key>\r
-<key name="divid"> 4,25,22, </key>\r
-<key name="do"> 7,14, </key>\r
-<key name="dockabl"> 6,2,16,17, </key>\r
-<key name="document"> 5,0,9,16,14, </key>\r
-<key name="doesn"> 24, </key>\r
-<key name="domain"> 3,11, </key>\r
-<key name="dominant"> 25, </key>\r
-<key name="don"> 24,25,14,19,28, </key>\r
-<key name="dot"> 14, </key>\r
-<key name="doubl"> 22, </key>\r
-<key name="down"> 8,12, </key>\r
-<key name="downward"> 24,28, </key>\r
-<key name="doxygen"> 14, </key>\r
-<key name="drag"> 24,16,28, </key>\r
-<key name="dramatical"> 3, </key>\r
-<key name="drawn"> 24,28, </key>\r
-<key name="driv"> 14, </key>\r
-<key name="drop"> 12,16, </key>\r
-<key name="dump"> 0,24,28, </key>\r
-<key name="dumpversion"> 14, </key>\r
-<key name="duplicat"> 24, </key>\r
-<key name="dynamic"> 2, </key>\r
-<key name="dynamical"> 11,25, </key>\r
-<key name="e"> 2,15,16,14,17, </key>\r
-<key name="easi"> 3,10, </key>\r
-<key name="easy"> 3, </key>\r
-<key name="economical"> 3, </key>\r
-<key name="edg"> 1,23, </key>\r
-<key name="edit"> 7,8,2,25,15,14, </key>\r
-<key name="editabl"> 25, </key>\r
-<key name="edition"> 25, </key>\r
-<key name="editor"> 27, </key>\r
-<key name="efficient"> 10, </key>\r
-<key name="eith"> 25,14,26,18,19, </key>\r
-<key name="electrical"> 10, </key>\r
-<key name="electronic"> 10, </key>\r
-<key name="element"> 10,23,25, </key>\r
-<key name="embed"> 15, </key>\r
-<key name="empty"> 6, </key>\r
-<key name="enabl"> 14,18,20, </key>\r
-<key name="encourag"> 3, </key>\r
-<key name="end"> 3,25,14,18,27, </key>\r
-<key name="enforc"> 3, </key>\r
-<key name="engin"> 3, </key>\r
-<key name="enough"> 14, </key>\r
-<key name="ensur"> 3,10, </key>\r
-<key name="ent"> 8,15,14,17, </key>\r
-<key name="enter"> 14, </key>\r
-<key name="entity"> 23, </key>\r
-<key name="entry"> 18,21, </key>\r
-<key name="env_"> 14, </key>\r
-<key name="env_build"> 14, </key>\r
-<key name="env_for_launch"> 14, </key>\r
-<key name="env_product"> 14, </key>\r
-<key name="env_vtk"> 14, </key>\r
-<key name="environment"> 3,6,9,10,2,15,14, </key>\r
-<key name="environmentpleas"> 14, </key>\r
-<key name="equal"> 3,14, </key>\r
-<key name="equipment"> 10, </key>\r
-<key name="error"> 0,14, </key>\r
-<key name="etc"> 3,2,11,25,16,14, </key>\r
-<key name="ev"> 22, </key>\r
-<key name="even"> 3,16,14, </key>\r
-<key name="every"> 10,25,20, </key>\r
-<key name="everyth"> 14, </key>\r
-<key name="evolution"> 10, </key>\r
-<key name="evolv"> 3, </key>\r
-<key name="ex"> 15, </key>\r
-<key name="exact"> 25,14, </key>\r
-<key name="examl"> 14, </key>\r
-<key name="exampl"> 6,10,16,14,17,19, </key>\r
-<key name="exceed"> 25, </key>\r
-<key name="except"> 14,28, </key>\r
-<key name="exception"> 2,15,14, </key>\r
-<key name="exchang"> 3, </key>\r
-<key name="execut"> 14, </key>\r
-<key name="executabl"> 14, </key>\r
-<key name="execution"> 10,11, </key>\r
-<key name="exist"> 3,11,13,14,17,27,19, </key>\r
-<key name="existenc"> 14, </key>\r
-<key name="expand"> 12, </key>\r
-<key name="expandability"> 3, </key>\r
-<key name="expectation"> 10, </key>\r
-<key name="experienc"> 14, </key>\r
-<key name="expert"> 0, </key>\r
-<key name="exploit"> 3, </key>\r
-<key name="explor"> 4, </key>\r
-<key name="export"> 10,23,24,28, </key>\r
-<key name="expos"> 3, </key>\r
-<key name="extend"> 24,26,28, </key>\r
-<key name="extension"> 17,27, </key>\r
-<key name="external"> 14,18, </key>\r
-<key name="extract"> 14, </key>\r
-<key name="extreme"> 10, </key>\r
-<key name="f"> 15,14, </key>\r
-<key name="fac"> 23,25,18, </key>\r
-<key name="facilitat"> 3,11, </key>\r
-<key name="fact"> 16, </key>\r
-<key name="factory"> 19, </key>\r
-<key name="fail"> 14, </key>\r
-<key name="fals"> 14, </key>\r
-<key name="famili"> 25, </key>\r
-<key name="featur"> 4,25,14, </key>\r
-<key name="feel"> 14, </key>\r
-<key name="field"> 8,10,23,25,14,26, </key>\r
-<key name="fig"> 14, </key>\r
-<key name="figur"> 1,14, </key>\r
-<key name="fil"> 5,0,8,11,13,25,15,16,14,17,18,27,19, </key>\r
-<key name="fill"> 23, </key>\r
-<key name="final"> 14, </key>\r
-<key name="find"> 14,19,20, </key>\r
-<key name="find_in_path"> 14, </key>\r
-<key name="fine"> 3, </key>\r
-<key name="finish"> 12,25,14, </key>\r
-<key name="finit"> 10, </key>\r
-<key name="first"> 0,25,14,18,21, </key>\r
-<key name="fit"> 24,18,28, </key>\r
-<key name="flag"> 14, </key>\r
-<key name="flexibility"> 3,0, </key>\r
-<key name="flexibl"> 10,2,14, </key>\r
-<key name="focal"> 25, </key>\r
-<key name="focu"> 12, </key>\r
-<key name="fold"> 14,17,21, </key>\r
-<key name="folder"> 14, </key>\r
-<key name="follow"> 3,0,8,9,12,13,15,16,14,17,18,27,19,20,22, </key>\r
-<key name="font"> 23,25,14,26,18,28, </key>\r
-<key name="forc"> 14, </key>\r
-<key name="forget"> 19, </key>\r
-<key name="formal"> 14, </key>\r
-<key name="format"> 4,10,24,13,18,28, </key>\r
-<key name="forth"> 25, </key>\r
-<key name="fp"> 25, </key>\r
-<key name="fram"> 24,25,14,28, </key>\r
-<key name="framework"> 2, </key>\r
-<key name="fre"> 1,10,25, </key>\r
-<key name="friend"> 10, </key>\r
-<key name="ful"> 25, </key>\r
-<key name="fulfill"> 0, </key>\r
-<key name="full"> 25,20, </key>\r
-<key name="function"> 0,10,11,16,14,17, </key>\r
-<key name="function_nam"> 14, </key>\r
-<key name="functional"> 16, </key>\r
-<key name="functionaliti"> 10,24,28, </key>\r
-<key name="functionality"> 3,4,7,9,24,16,19,28, </key>\r
-<key name="fundamental"> 3, </key>\r
-<key name="furth"> 14, </key>\r
-<key name="g"> 15,14, </key>\r
-<key name="gap"> 23, </key>\r
-<key name="gaus"> 2,25,28, </key>\r
-<key name="gcc"> 14, </key>\r
-<key name="general"> 9,23,16,14,18, </key>\r
-<key name="generat"> 0,11,25,14,19, </key>\r
-<key name="generator"> 10,2,19, </key>\r
-<key name="generic"> 10,11, </key>\r
-<key name="geom"> 11,14, </key>\r
-<key name="geometrical"> 1,10,11,24,25, </key>\r
-<key name="geometry"> 3,1,11,24,25,16, </key>\r
-<key name="get"> 4,9,10,14,21, </key>\r
-<key name="giv"> 0,8,16,14,26, </key>\r
-<key name="given"> 11,25,14, </key>\r
-<key name="gl"> 25, </key>\r
-<key name="global"> 24,25,28, </key>\r
-<key name="glossary"> 20, </key>\r
-<key name="go"> 12,14, </key>\r
-<key name="good"> 24, </key>\r
-<key name="graduat"> 28, </key>\r
-<key name="graph"> 6,11,18, </key>\r
-<key name="graphic"> 25, </key>\r
-<key name="graphical"> 0,2, </key>\r
-<key name="graphviz"> 14, </key>\r
-<key name="great"> 0,24,25,28, </key>\r
-<key name="greek"> 26, </key>\r
-<key name="group"> 23,24,25,26, </key>\r
-<key name="gui"> 3,5,0,2,11,15,14,17,18,27, </key>\r
-<key name="guid"> 14, </key>\r
-<key name="h"> 15,14, </key>\r
-<key name="half"> 25, </key>\r
-<key name="hand"> 3,12,20, </key>\r
-<key name="handl"> 10,2,15, </key>\r
-<key name="hard"> 15,14, </key>\r
-<key name="hasn"> 17, </key>\r
-<key name="hav"> 11,12,21, </key>\r
-<key name="haven"> 18, </key>\r
-<key name="hdf"> 13,14,17,18, </key>\r
-<key name="hdf5"> 14, </key>\r
-<key name="hdf5hom"> 14, </key>\r
-<key name="heal"> 10, </key>\r
-<key name="height"> 23,25, </key>\r
-<key name="hello"> 22, </key>\r
-<key name="help"> 3,4,10,12,13,15,14,18,20,21, </key>\r
-<key name="helpful"> 14, </key>\r
-<key name="her"> 23,25,14,18, </key>\r
-<key name="heterogeneou"> 10, </key>\r
-<key name="hid"> 24,25,16,18,21,28, </key>\r
-<key name="high"> 10, </key>\r
-<key name="highlight"> 23,14,21, </key>\r
-<key name="history"> 22, </key>\r
-<key name="hom"> 14,27, </key>\r
-<key name="hop"> 14, </key>\r
-<key name="horizontal"> 6,23,25,18, </key>\r
-<key name="host"> 3, </key>\r
-<key name="hotspot"> 12, </key>\r
-<key name="hour"> 14, </key>\r
-<key name="how"> 3,14, </key>\r
-<key name="hpp"> 14, </key>\r
-<key name="html"> 4,20, </key>\r
-<key name="hxx"> 14, </key>\r
-<key name="i"> 2,15,16,17, </key>\r
-<key name="icon"> 5,7,16,19, </key>\r
-<key name="idea"> 14, </key>\r
-<key name="identification"> 21,22, </key>\r
-<key name="identify"> 14, </key>\r
-<key name="idl"> 3,19, </key>\r
-<key name="ie"> 18, </key>\r
-<key name="if"> 5,6,0,7,23,24,13,25,15,16,14,17,18,19,21,28, </key>\r
-<key name="ig"> 10, </key>\r
-<key name="ignor"> 14, </key>\r
-<key name="imag"> 10,24,25,28, </key>\r
-<key name="immediate"> 12, </key>\r
-<key name="implement"> 3,14, </key>\r
-<key name="implementation"> 3,14,19, </key>\r
-<key name="import"> 0,10,2,11,25,16,14,27, </key>\r
-<key name="important"> 14, </key>\r
-<key name="impos"> 25, </key>\r
-<key name="improv"> 2,14, </key>\r
-<key name="includ"> 12,25,14,20, </key>\r
-<key name="inclusiv"> 3, </key>\r
-<key name="increas"> 0,10,25, </key>\r
-<key name="increment"> 1,25, </key>\r
-<key name="incremental"> 3, </key>\r
-<key name="independenc"> 3, </key>\r
-<key name="independent"> 3, </key>\r
-<key name="index"> 23,21, </key>\r
-<key name="indicat"> 16,17, </key>\r
-<key name="information"> 3,8,12,25,14,17,20,22, </key>\r
-<key name="initial"> 9, </key>\r
-<key name="input"> 10,19, </key>\r
-<key name="insid"> 3,6,12,25,19, </key>\r
-<key name="inspect"> 25,14, </key>\r
-<key name="instal"> 14,19, </key>\r
-<key name="instalation"> 14, </key>\r
-<key name="install"> 15,14, </key>\r
-<key name="install_binary"> 14, </key>\r
-<key name="install_disk_spac"> 14, </key>\r
-<key name="install_sourc"> 14, </key>\r
-<key name="install_source_and_build"> 14, </key>\r
-<key name="install_wizard_caption"> 14, </key>\r
-<key name="install_wizard_copyright"> 14, </key>\r
-<key name="install_wizard_license_info"> 14, </key>\r
-<key name="install_wizard_root_directory"> 14, </key>\r
-<key name="install_wizard_version"> 14, </key>\r
-<key name="installation"> 15,14, </key>\r
-<key name="installation_mod"> 14, </key>\r
-<key name="installation_script_nam"> 14, </key>\r
-<key name="installdiskspac"> 14, </key>\r
-<key name="installwizard_root_directory"> 14, </key>\r
-<key name="installworkxxxxx"> 14, </key>\r
-<key name="instanc"> 5, </key>\r
-<key name="instruction"> 14, </key>\r
-<key name="instrumental"> 3, </key>\r
-<key name="integ"> 14, </key>\r
-<key name="integer"> 23, </key>\r
-<key name="integrat"> 3,10,2,11, </key>\r
-<key name="integration"> 3,10,2,19, </key>\r
-<key name="interaction"> 2, </key>\r
-<key name="interfac"> 3,0,10,2,16,19, </key>\r
-<key name="interior"> 23, </key>\r
-<key name="internal"> 3,14, </key>\r
-<key name="internet"> 4, </key>\r
-<key name="interoperability"> 10, </key>\r
-<key name="interoperabl"> 21, </key>\r
-<key name="interp"> 15, </key>\r
-<key name="interpret"> 2,16, </key>\r
-<key name="interval"> 25,22, </key>\r
-<key name="introduction"> 10,2,11,14, </key>\r
-<key name="invalid"> 17, </key>\r
-<key name="invert"> 24,25, </key>\r
-<key name="invok"> 16,14, </key>\r
-<key name="ior"> 18,21, </key>\r
-<key name="isolat"> 1, </key>\r
-<key name="isolin"> 1,18, </key>\r
-<key name="isometric"> 24,28, </key>\r
-<key name="item"> 8,10,2, </key>\r
-<key name="iteration"> 25, </key>\r
-<key name="itself"> 14, </key>\r
-<key name="java"> 4, </key>\r
-<key name="jpeg"> 24,28, </key>\r
-<key name="jpg"> 24,28, </key>\r
-<key name="just"> 14,18, </key>\r
-<key name="k"> 15, </key>\r
-<key name="kbyt"> 14, </key>\r
-<key name="kernel"> 11,15,14, </key>\r
-<key name="key"> 25,14, </key>\r
-<key name="keyboard"> 25, </key>\r
-<key name="kill"> 15, </key>\r
-<key name="killall"> 15, </key>\r
-<key name="kind"> 8,12, </key>\r
-<key name="know"> 19, </key>\r
-<key name="knowledg"> 0, </key>\r
-<key name="l"> 15, </key>\r
-<key name="label"> 23,25,14,28, </key>\r
-<key name="languag"> 3, </key>\r
-<key name="larg"> 14, </key>\r
-<key name="largest"> 25, </key>\r
-<key name="last"> 14,18,22, </key>\r
-<key name="latest"> 25, </key>\r
-<key name="latin"> 26, </key>\r
-<key name="launch"> 4,0,13,15,14,27,19,22, </key>\r
-<key name="lay"> 5, </key>\r
-<key name="layout"> 0,17, </key>\r
-<key name="ld_library_path"> 14, </key>\r
-<key name="lead"> 17, </key>\r
-<key name="learn"> 10,14, </key>\r
-<key name="left"> 23,24,25,14,26,18,20,28, </key>\r
-<key name="legend"> 18, </key>\r
-<key name="length"> 25,28, </key>\r
-<key name="les"> 25, </key>\r
-<key name="level"> 3,23,25, </key>\r
-<key name="lib"> 14, </key>\r
-<key name="libcosnotify4"> 14, </key>\r
-<key name="libhdf5"> 14, </key>\r
-<key name="libm"> 14, </key>\r
-<key name="libomniorb4"> 14, </key>\r
-<key name="librari"> 14, </key>\r
-<key name="library"> 2,14, </key>\r
-<key name="libvtkcommon"> 14, </key>\r
-<key name="licens"> 14, </key>\r
-<key name="lik"> 3,6,12,25,16,14,17,19,21, </key>\r
-<key name="like"> 14, </key>\r
-<key name="limit"> 25, </key>\r
-<key name="limitation"> 25, </key>\r
-<key name="lin"> 4,1,23,25,15,14,18, </key>\r
-<key name="linear"> 18, </key>\r
-<key name="link"> 3,10,12, </key>\r
-<key name="linux"> 4,14, </key>\r
-<key name="list"> 8,12,25,15,14,18,20,22, </key>\r
-<key name="list_of_prerequisit"> 14, </key>\r
-<key name="ll"> 24,18,28, </key>\r
-<key name="load"> 3,0,2,13,25,15,16,18,27,21, </key>\r
-<key name="local"> 25, </key>\r
-<key name="locat"> 3,24,25,15,16,18,20,21,28, </key>\r
-<key name="location"> 0,19, </key>\r
-<key name="lock"> 8,24,25,28, </key>\r
-<key name="log"> 15,14, </key>\r
-<key name="logarithmic"> 25,18, </key>\r
-<key name="long"> 3,14, </key>\r
-<key name="look"> 14,19,20, </key>\r
-<key name="lookout"> 23,25, </key>\r
-<key name="lost"> 17, </key>\r
-<key name="lot"> 16, </key>\r
-<key name="low"> 25,14,26,20, </key>\r
-<key name="m"> 15, </key>\r
-<key name="machin"> 3,17,22, </key>\r
-<key name="macintosh"> 4, </key>\r
-<key name="macro"> 3,14, </key>\r
-<key name="magnification"> 25, </key>\r
-<key name="main"> 5,0,7,8,10,13,25,16,14,17,18,19,22, </key>\r
-<key name="major"> 14, </key>\r
-<key name="mak"> 5,10,23,14, </key>\r
-<key name="make_dir"> 14, </key>\r
-<key name="make_env"> 14, </key>\r
-<key name="manag"> 10,18, </key>\r
-<key name="management"> 10,2,16, </key>\r
-<key name="mandrak"> 14, </key>\r
-<key name="mandrake10"> 14, </key>\r
-<key name="manipulat"> 25, </key>\r
-<key name="manipulator"> 25, </key>\r
-<key name="manual"> 4,0,24,14,18,28, </key>\r
-<key name="map"> 3, </key>\r
-<key name="mark"> 24,25,14,18,28, </key>\r
-<key name="marker"> 18, </key>\r
-<key name="market"> 10, </key>\r
-<key name="massive"> 3, </key>\r
-<key name="mast"> 14, </key>\r
-<key name="match"> 20, </key>\r
-<key name="matrix"> 25, </key>\r
-<key name="max"> 25, </key>\r
-<key name="maximiz"> 5, </key>\r
-<key name="maximum"> 25, </key>\r
-<key name="mean"> 6,9,25,16,14,17, </key>\r
-<key name="mechanism"> 0,2,15, </key>\r
-<key name="med2hom"> 14, </key>\r
-<key name="meet"> 10, </key>\r
-<key name="memoris"> 24, </key>\r
-<key name="memory"> 25, </key>\r
-<key name="mention"> 14, </key>\r
-<key name="menu"> 3,5,0,7,8,2,23,12,13,25,16,17,26,18,27,19,21,22, </key>\r
-<key name="menubar"> 16, </key>\r
-<key name="mesh"> 3,10,11,23,24,25,16,14,28, </key>\r
-<key name="messag"> 8,2,15,14, </key>\r
-<key name="min"> 25, </key>\r
-<key name="minimiz"> 5, </key>\r
-<key name="minimum"> 25, </key>\r
-<key name="minor"> 14, </key>\r
-<key name="mistak"> 16, </key>\r
-<key name="mix"> 16, </key>\r
-<key name="mod"> 3,0,1,23,25,15,14, </key>\r
-<key name="model"> 3,10,11,23, </key>\r
-<key name="modern"> 10, </key>\r
-<key name="modifi"> 14, </key>\r
-<key name="modification"> 3,0,8, </key>\r
-<key name="modify"> 0,10,14, </key>\r
-<key name="modul"> 3,4,7,1,2,11,23,24,25,15,16,14,17,18,27,19,28, </key>\r
-<key name="module1"> 15, </key>\r
-<key name="module2"> 15, </key>\r
-<key name="modulecatalog"> 15, </key>\r
-<key name="modulu"> 25, </key>\r
-<key name="moment"> 25,14, </key>\r
-<key name="momentari"> 25, </key>\r
-<key name="mous"> 23,24,25,16,28, </key>\r
-<key name="mov"> 6, </key>\r
-<key name="movement"> 25, </key>\r
-<key name="mozilla"> 18, </key>\r
-<key name="msg2qm"> 14, </key>\r
-<key name="msg2qm_root"> 14, </key>\r
-<key name="much"> 14, </key>\r
-<key name="multi"> 6,9,10,2,16,19, </key>\r
-<key name="multifil"> 17,18, </key>\r
-<key name="multipl"> 17, </key>\r
-<key name="multipli"> 25, </key>\r
-<key name="multiti"> 3, </key>\r
-<key name="must"> 3,10,11, </key>\r
-<key name="n"> 25,15,14, </key>\r
-<key name="nam"> 3,5,0,8,14,17,19,21,22,28, </key>\r
-<key name="nativ"> 14, </key>\r
-<key name="natur"> 7, </key>\r
-<key name="natural"> 3, </key>\r
-<key name="navigat"> 12,14, </key>\r
-<key name="navigation"> 4,12,25, </key>\r
-<key name="navigator"> 4, </key>\r
-<key name="ne"> 6,12,14,26,18, </key>\r
-<key name="necessary"> 0,23,15,16,14,17,21, </key>\r
-<key name="need"> 25, </key>\r
-<key name="negativ"> 25, </key>\r
-<key name="netgen"> 14, </key>\r
-<key name="netgenroot"> 14, </key>\r
-<key name="netscap"> 4,18, </key>\r
-<key name="new"> 3,5,8,9,10,24,25,14,17,18,27,19, </key>\r
-<key name="next"> 8,15,14,27,19, </key>\r
-<key name="nod"> 23,19, </key>\r
-<key name="normal"> 6, </key>\r
-<key name="not"> 15,14, </key>\r
-<key name="notation"> 14, </key>\r
-<key name="noticeab"> 3, </key>\r
-<key name="notifd"> 14, </key>\r
-<key name="notification"> 27, </key>\r
-<key name="notify"> 25, </key>\r
-<key name="notion"> 9, </key>\r
-<key name="now"> 16, </key>\r
-<key name="nth"> 25, </key>\r
-<key name="null"> 25, </key>\r
-<key name="numb"> 11,23,25,15,14,18,27,22,28, </key>\r
-<key name="number"> 23,25,14, </key>\r
-<key name="numeric"> 10,11,14,26, </key>\r
-<key name="numerical"> 3,9,10, </key>\r
-<key name="numerou"> 15, </key>\r
-<key name="object"> 3,5,6,0,7,2,23,24,13,25,16,17,18,27,21,28, </key>\r
-<key name="objectiv"> 3, </key>\r
-<key name="obligatory"> 14, </key>\r
-<key name="observ"> 25, </key>\r
-<key name="occ"> 5,6,2,24,18, </key>\r
-<key name="occ_version_maintenanc"> 14, </key>\r
-<key name="occ_version_major"> 14, </key>\r
-<key name="occ_version_minor"> 14, </key>\r
-<key name="occupi"> 14, </key>\r
-<key name="occur"> 14, </key>\r
-<key name="off"> 14, </key>\r
-<key name="offer"> 3, </key>\r
-<key name="offic"> 14, </key>\r
-<key name="official"> 14, </key>\r
-<key name="offset"> 28, </key>\r
-<key name="often"> 10, </key>\r
-<key name="ok"> 13,14,27, </key>\r
-<key name="omg"> 3, </key>\r
-<key name="omninotify"> 14, </key>\r
-<key name="omniorb"> 14, </key>\r
-<key name="omniorbdir"> 14, </key>\r
-<key name="omniorbpy"> 14, </key>\r
-<key name="on"> 3,6,0,7,2,12,13,25,15,16,14,17,26,18,27,19, </key>\r
-<key name="onc"> 25, </key>\r
-<key name="onlin"> 20, </key>\r
-<key name="opaqu"> 25, </key>\r
-<key name="open"> 6,0,9,10,11,12,24,13,25,15,14,17,19,20, </key>\r
-<key name="operat"> 0, </key>\r
-<key name="operation"> 7,9,23,25,14,17, </key>\r
-<key name="optimiz"> 10,25,14, </key>\r
-<key name="optimization"> 11, </key>\r
-<key name="option"> 7,8,13,25,15,16,14,17,18,21, </key>\r
-<key name="optional"> 10,11,14, </key>\r
-<key name="ord"> 14, </key>\r
-<key name="ordinat"> 23,25, </key>\r
-<key name="org"> 3, </key>\r
-<key name="orientat"> 24,28, </key>\r
-<key name="orientation"> 23,24,25, </key>\r
-<key name="origin"> 23,24,25,28, </key>\r
-<key name="original"> 0, </key>\r
-<key name="originality"> 11, </key>\r
-<key name="os"> 14, </key>\r
-<key name="os_version"> 14, </key>\r
-<key name="other"> 4,0, </key>\r
-<key name="otherwis"> 0,25,14,17, </key>\r
-<key name="out"> 10,23,24,26,28, </key>\r
-<key name="outlin"> 23, </key>\r
-<key name="output"> 2,14, </key>\r
-<key name="outsid"> 25,16, </key>\r
-<key name="overrid"> 14, </key>\r
-<key name="overridden"> 14, </key>\r
-<key name="own"> 2,11,16,14, </key>\r
-<key name="p"> 15, </key>\r
-<key name="packag"> 15,14,19, </key>\r
-<key name="pag"> 14,20, </key>\r
-<key name="pan"> 12,24,17,20,28, </key>\r
-<key name="parallel"> 3, </key>\r
-<key name="paramet"> 14,19, </key>\r
-<key name="parameter"> 3,25,26,18,19,28, </key>\r
-<key name="parent"> 25, </key>\r
-<key name="part"> 6,24,16,14,28, </key>\r
-<key name="particular"> 10,17, </key>\r
-<key name="party"> 11,14, </key>\r
-<key name="past"> 7,16, </key>\r
-<key name="patch"> 14, </key>\r
-<key name="patent"> 25, </key>\r
-<key name="path"> 25,14, </key>\r
-<key name="pc"> 3, </key>\r
-<key name="per"> 25, </key>\r
-<key name="perform"> 10,11,23,24,25,14,28, </key>\r
-<key name="performanc"> 3,9,10,25,14, </key>\r
-<key name="period"> 25, </key>\r
-<key name="permission"> 14, </key>\r
-<key name="phenomena"> 3, </key>\r
-<key name="phras"> 20, </key>\r
-<key name="physic"> 10, </key>\r
-<key name="physical"> 3,10,11, </key>\r
-<key name="pick"> 25,14, </key>\r
-<key name="pickup"> 14, </key>\r
-<key name="pickup_env"> 14, </key>\r
-<key name="pickup_env_flag"> 14, </key>\r
-<key name="pickupenv"> 14, </key>\r
-<key name="pictur"> 8, </key>\r
-<key name="pid"> 22, </key>\r
-<key name="piec"> 3, </key>\r
-<key name="pixel"> 25, </key>\r
-<key name="plac"> 6,2,24,16,14,28, </key>\r
-<key name="placement"> 23,25, </key>\r
-<key name="plan"> 24,14, </key>\r
-<key name="platform"> 3,4,6,0,9,10,2,11,15,16,14,17,19,22, </key>\r
-<key name="play"> 0, </key>\r
-<key name="pleas"> 14, </key>\r
-<key name="plot"> 6,2,25, </key>\r
-<key name="plot2d"> 5,18, </key>\r
-<key name="plug"> 2, </key>\r
-<key name="png"> 24,28, </key>\r
-<key name="po"> 14, </key>\r
-<key name="point"> 3,1,2,23,24,25,14,18,28, </key>\r
-<key name="pop"> 12,13,16,21, </key>\r
-<key name="popup"> 12, </key>\r
-<key name="port"> 15, </key>\r
-<key name="portkill"> 15, </key>\r
-<key name="position"> 24,25,16,17,18,28, </key>\r
-<key name="positive"> 16, </key>\r
-<key name="possibility"> 3,0,15,14,26,19, </key>\r
-<key name="possibl"> 3,0,16,14,17,26,21, </key>\r
-<key name="post"> 3,10,11,25,16,17,28, </key>\r
-<key name="powerful"> 2, </key>\r
-<key name="pr"> 10,11,14, </key>\r
-<key name="precision"> 23, </key>\r
-<key name="precompil"> 14, </key>\r
-<key name="predefin"> 3,14,26, </key>\r
-<key name="preferabl"> 15, </key>\r
-<key name="preferenc"> 1,23,25,26,18,27,21, </key>\r
-<key name="preinstal"> 14, </key>\r
-<key name="prerequisit"> 14, </key>\r
-<key name="pres"> 24,25,14,18,28, </key>\r
-<key name="preselect"> 23, </key>\r
-<key name="preselection"> 23, </key>\r
-<key name="present"> 23,25, </key>\r
-<key name="presentation"> 5,23,25,16,18,28, </key>\r
-<key name="prevent"> 25, </key>\r
-<key name="preview"> 24,25,26, </key>\r
-<key name="previou"> 13,14, </key>\r
-<key name="previous"> 11,13,25,14,17, </key>\r
-<key name="primitiv"> 25, </key>\r
-<key name="print"> 15,14, </key>\r
-<key name="print_env"> 14, </key>\r
-<key name="priority"> 10, </key>\r
-<key name="pro"> 3,11,25,16,17,28, </key>\r
-<key name="probab"> 5, </key>\r
-<key name="problem"> 0,10,14, </key>\r
-<key name="proce"> 9,14, </key>\r
-<key name="procedur"> 15,14, </key>\r
-<key name="proces"> 3,0,10,2,11,25,14,22, </key>\r
-<key name="processor"> 3,10, </key>\r
-<key name="produc"> 25, </key>\r
-<key name="product"> 10,15,14, </key>\r
-<key name="product_context"> 14, </key>\r
-<key name="product_description"> 14, </key>\r
-<key name="product_nam"> 14, </key>\r
-<key name="product_script_nam"> 14, </key>\r
-<key name="product_version"> 14, </key>\r
-<key name="productivity"> 3,0, </key>\r
-<key name="products_directory"> 14, </key>\r
-<key name="profil"> 15, </key>\r
-<key name="program"> 3,14, </key>\r
-<key name="programmatic"> 10, </key>\r
-<key name="progres"> 25,14, </key>\r
-<key name="progressiv"> 25, </key>\r
-<key name="prompt"> 15,14, </key>\r
-<key name="pron"> 0, </key>\r
-<key name="proper"> 14, </key>\r
-<key name="properti"> 8,10,11,25,18,28, </key>\r
-<key name="proportional"> 25, </key>\r
-<key name="propos"> 2,14, </key>\r
-<key name="provid"> 3,7,10,2,11,24,25,15,14,26,19,20,22, </key>\r
-<key name="publish"> 0,17, </key>\r
-<key name="pur"> 3, </key>\r
-<key name="purpos"> 9,21, </key>\r
-<key name="put"> 14, </key>\r
-<key name="py"> 15,14, </key>\r
-<key name="pycontain"> 15, </key>\r
-<key name="pyqt"> 14, </key>\r
-<key name="pyqtconfig"> 14, </key>\r
-<key name="pyqtdir"> 14, </key>\r
-<key name="pyramid"> 25, </key>\r
-<key name="python"> 3,6,0,10,2,15,16,14,17,18, </key>\r
-<key name="pythonhom"> 14, </key>\r
-<key name="pythonpath"> 14, </key>\r
-<key name="qglobal"> 14, </key>\r
-<key name="qm"> 14, </key>\r
-<key name="qt"> 14, </key>\r
-<key name="qt_version_str"> 14, </key>\r
-<key name="qtdir"> 14, </key>\r
-<key name="quality"> 10,23,25, </key>\r
-<key name="quantiti"> 10, </key>\r
-<key name="quick"> 14,18,21, </key>\r
-<key name="quit"> 0,14,17,27, </key>\r
-<key name="quot"> 14, </key>\r
-<key name="qwt"> 14, </key>\r
-<key name="qwt_global"> 14, </key>\r
-<key name="qwt_version_str"> 14, </key>\r
-<key name="qwthom"> 14, </key>\r
-<key name="r"> 15, </key>\r
-<key name="radio"> 14, </key>\r
-<key name="rainbow"> 25, </key>\r
-<key name="rang"> 11,25, </key>\r
-<key name="rapid"> 3, </key>\r
-<key name="rat"> 25, </key>\r
-<key name="rath"> 0, </key>\r
-<key name="ratio"> 25, </key>\r
-<key name="re"> 0,12,14, </key>\r
-<key name="reactivity"> 10, </key>\r
-<key name="read"> 10,12,14, </key>\r
-<key name="readm"> 14, </key>\r
-<key name="real"> 25, </key>\r
-<key name="realiz"> 9, </key>\r
-<key name="reason"> 14, </key>\r
-<key name="reassign"> 25, </key>\r
-<key name="receiv"> 27, </key>\r
-<key name="recommend"> 25,14, </key>\r
-<key name="record"> 8,25, </key>\r
-<key name="red"> 14,21, </key>\r
-<key name="redefin"> 28, </key>\r
-<key name="redirect"> 15, </key>\r
-<key name="reduc"> 10, </key>\r
-<key name="ref"> 14,18,27, </key>\r
-<key name="refer"> 14, </key>\r
-<key name="referenc"> 4,12,25,18,21, </key>\r
-<key name="refin"> 10,25, </key>\r
-<key name="refresh"> 22, </key>\r
-<key name="refreshment"> 22, </key>\r
-<key name="regim"> 25, </key>\r
-<key name="registry"> 2,15,22, </key>\r
-<key name="reinstal"> 14, </key>\r
-<key name="reinstall"> 14, </key>\r
-<key name="reinstallation"> 14, </key>\r
-<key name="relat"> 12,20, </key>\r
-<key name="relativ"> 23,14,18, </key>\r
-<key name="releas"> 14, </key>\r
-<key name="release_not"> 14, </key>\r
-<key name="relevant"> 12, </key>\r
-<key name="reliability"> 10, </key>\r
-<key name="reload"> 17, </key>\r
-<key name="relocat"> 16, </key>\r
-<key name="remain"> 3,24, </key>\r
-<key name="remot"> 5,24,28, </key>\r
-<key name="remov"> 24,25,14,18, </key>\r
-<key name="renam"> 17, </key>\r
-<key name="rend"> 25, </key>\r
-<key name="render"> 25, </key>\r
-<key name="reopen"> 18, </key>\r
-<key name="repeat"> 25, </key>\r
-<key name="represent"> 3,9,10,11,24,20,28, </key>\r
-<key name="representation"> 6,11,24,25,18, </key>\r
-<key name="representativ"> 25, </key>\r
-<key name="requir"> 10,13,25,14,17, </key>\r
-<key name="requirement"> 3,10,15, </key>\r
-<key name="requisit"> 14, </key>\r
-<key name="reset"> 24,14,28, </key>\r
-<key name="resiz"> 24,18,28, </key>\r
-<key name="resolution"> 25, </key>\r
-<key name="resolv"> 0, </key>\r
-<key name="resourc"> 2,25,15,14, </key>\r
-<key name="respectiv"> 1,25,27, </key>\r
-<key name="respective"> 25, </key>\r
-<key name="respond"> 3, </key>\r
-<key name="responsibl"> 14, </key>\r
-<key name="rest"> 18, </key>\r
-<key name="restart"> 14, </key>\r
-<key name="restor"> 10,24,25,17,18,27,28, </key>\r
-<key name="result"> 9,10,24,25, </key>\r
-<key name="resum"> 14, </key>\r
-<key name="retriev"> 14, </key>\r
-<key name="retroactiv"> 27, </key>\r
-<key name="return"> 24,14, </key>\r
-<key name="reus"> 3, </key>\r
-<key name="reusabl"> 10, </key>\r
-<key name="reversib"> 0,25, </key>\r
-<key name="right"> 6,12,13,25,16,14,17,26,18,20,21, </key>\r
-<key name="risk"> 10, </key>\r
-<key name="robustnes"> 10, </key>\r
-<key name="rol"> 3, </key>\r
-<key name="root"> 14, </key>\r
-<key name="rotat"> 24,25,28, </key>\r
-<key name="rotation"> 24,25,28, </key>\r
-<key name="rul"> 14, </key>\r
-<key name="run"> 3,15,14,19,22, </key>\r
-<key name="runic"> 26, </key>\r
-<key name="runinstall"> 14, </key>\r
-<key name="runsalom"> 15,19, </key>\r
-<key name="runsalomewithport"> 19, </key>\r
-<key name="s"> 3,12,15,14, </key>\r
-<key name="saf"> 2, </key>\r
-<key name="salom"> 3,4,5,6,0,7,9,10,2,11,12,13,25,15,16,14,17,18,27,19,20,21,22, </key>\r
-<key name="salome_"> 14, </key>\r
-<key name="salome_modulecatalog_serv"> 19, </key>\r
-<key name="salomeapp"> 15, </key>\r
-<key name="salomeapprc"> 27, </key>\r
-<key name="salomed"> 0, </key>\r
-<key name="sam"> 6,12,25,16,14,17,19,22, </key>\r
-<key name="sampl"> 14,26, </key>\r
-<key name="sav"> 3,0,10,2,24,16,14,17,18,27, </key>\r
-<key name="scal"> 3,25,18,28, </key>\r
-<key name="scalar"> 23,25, </key>\r
-<key name="scen"> 24,28, </key>\r
-<key name="schem"> 3,10,14, </key>\r
-<key name="schema"> 10, </key>\r
-<key name="scientific"> 3, </key>\r
-<key name="screen"> 6,15, </key>\r
-<key name="script"> 3,0,15,14,26,19, </key>\r
-<key name="scroll"> 8, </key>\r
-<key name="se"> 6,8,24,13,14,17,18,19,21,28, </key>\r
-<key name="search"> 4,13,14,17,20, </key>\r
-<key name="second"> 0,25,14, </key>\r
-<key name="section"> 24,16,14,18, </key>\r
-<key name="seen"> 23, </key>\r
-<key name="select"> 5,6,0,1,8,23,24,13,25,14,17,26,18,20,28, </key>\r
-<key name="selectall"> 16, </key>\r
-<key name="selection"> 2,23,25, </key>\r
-<key name="send"> 14, </key>\r
-<key name="sensitiv"> 16,21, </key>\r
-<key name="separat"> 3,25,16,14, </key>\r
-<key name="serv"> 3,19, </key>\r
-<key name="server"> 3,15, </key>\r
-<key name="servic"> 3,14,19, </key>\r
-<key name="session"> 1,23,13,25,15,17,18,27,21,22, </key>\r
-<key name="set"> 4,0,1,8,10,23,24,25,15,16,14,17,18,27,21,22,28, </key>\r
-<key name="setting"> 25,16,14,17,18,27, </key>\r
-<key name="sever"> 10, </key>\r
-<key name="sh"> 14, </key>\r
-<key name="shad"> 1,23,25, </key>\r
-<key name="shap"> 24,25, </key>\r
-<key name="shar"> 15, </key>\r
-<key name="shel"> 14, </key>\r
-<key name="shell"> 2,11,15,14, </key>\r
-<key name="short"> 14,20, </key>\r
-<key name="shot"> 6, </key>\r
-<key name="should"> 9,14,17,19, </key>\r
-<key name="show"> 24,25,14,28, </key>\r
-<key name="shown"> 8,14, </key>\r
-<key name="shrink"> 23, </key>\r
-<key name="sid"> 23,25,14, </key>\r
-<key name="signal"> 2,14, </key>\r
-<key name="signatur"> 14, </key>\r
-<key name="sigterm"> 14, </key>\r
-<key name="silent"> 14, </key>\r
-<key name="simp"> 14, </key>\r
-<key name="simpl"> 3, </key>\r
-<key name="simplify"> 14, </key>\r
-<key name="simulat"> 3, </key>\r
-<key name="simulation"> 10,11, </key>\r
-<key name="simultaneous"> 6,9,25,14, </key>\r
-<key name="sinc"> 2, </key>\r
-<key name="singl"> 14, </key>\r
-<key name="sip"> 14, </key>\r
-<key name="sipdir"> 14, </key>\r
-<key name="situation"> 3, </key>\r
-<key name="siz"> 6,23,25,16,17,26,18, </key>\r
-<key name="skip"> 14, </key>\r
-<key name="slow"> 25, </key>\r
-<key name="small"> 24,28, </key>\r
-<key name="smallest"> 25, </key>\r
-<key name="smooth"> 18, </key>\r
-<key name="smoothnes"> 25, </key>\r
-<key name="so"> 3,7,25,15,14,20,21, </key>\r
-<key name="softwar"> 3,10,11, </key>\r
-<key name="solution"> 10, </key>\r
-<key name="solv"> 10, </key>\r
-<key name="solver"> 10,11, </key>\r
-<key name="someth"> 14, </key>\r
-<key name="sort"> 18, </key>\r
-<key name="sort_path"> 14, </key>\r
-<key name="sourc"> 10,11,15,14, </key>\r
-<key name="spac"> 23,25,14, </key>\r
-<key name="spacemous"> 25, </key>\r
-<key name="spe"> 25, </key>\r
-<key name="special"> 3,13,25,15,16,14,17,18, </key>\r
-<key name="specifi"> 3,25, </key>\r
-<key name="specific"> 3,0,10,15,16,14,27,20, </key>\r
-<key name="specification"> 11, </key>\r
-<key name="specify"> 17,18,19, </key>\r
-<key name="spher"> 25, </key>\r
-<key name="spin"> 1, </key>\r
-<key name="splash"> 15, </key>\r
-<key name="splin"> 18, </key>\r
-<key name="split"> 6, </key>\r
-<key name="sprit"> 25, </key>\r
-<key name="stamp"> 25, </key>\r
-<key name="standalon"> 2,15, </key>\r
-<key name="standard"> 3,5,2,13,25,16,14,17,27,19, </key>\r
-<key name="standard_version"> 14, </key>\r
-<key name="start"> 6,9,25,16,14,18,27,19,22, </key>\r
-<key name="start_salom"> 14, </key>\r
-<key name="stat"> 0,14,17,18, </key>\r
-<key name="station"> 3, </key>\r
-<key name="statu"> 14, </key>\r
-<key name="step"> 1,10,25,14, </key>\r
-<key name="stop"> 14, </key>\r
-<key name="stor"> 3,0,13,14,17,18,19, </key>\r
-<key name="str"> 14, </key>\r
-<key name="stretch"> 28, </key>\r
-<key name="strict"> 24,14,28, </key>\r
-<key name="strong"> 14, </key>\r
-<key name="struck"> 26, </key>\r
-<key name="structur"> 3,10,2,13,25,14,21, </key>\r
-<key name="structural"> 10, </key>\r
-<key name="studi"> 5,6,7,9,10,2,13,16,17, </key>\r
-<key name="study"> 3,5,6,0,7,8,9,10,2,13,25,15,16,17,18,27,19,21,22, </key>\r
-<key name="study1"> 5, </key>\r
-<key name="stuf"> 28, </key>\r
-<key name="styl"> 26,18, </key>\r
-<key name="sub"> 24,14,20, </key>\r
-<key name="submenu"> 5,16,18, </key>\r
-<key name="subsequent"> 14, </key>\r
-<key name="subset"> 26, </key>\r
-<key name="substitut"> 25, </key>\r
-<key name="successful"> 14, </key>\r
-<key name="suit"> 2, </key>\r
-<key name="summariz"> 14, </key>\r
-<key name="superposition"> 25, </key>\r
-<key name="superv"> 15, </key>\r
-<key name="supervcontain"> 15, </key>\r
-<key name="supervision"> 2,15,19, </key>\r
-<key name="supervisor"> 11,18,19, </key>\r
-<key name="supplementary"> 21,22, </key>\r
-<key name="suppli"> 14, </key>\r
-<key name="support"> 10,14,19, </key>\r
-<key name="supported_installation_mod"> 14, </key>\r
-<key name="sur"> 14, </key>\r
-<key name="surfac"> 23, </key>\r
-<key name="sweep"> 25, </key>\r
-<key name="swig"> 14, </key>\r
-<key name="switch"> 6,2,25,14, </key>\r
-<key name="symbol"> 14, </key>\r
-<key name="system"> 3,4,10,12,25,14,20, </key>\r
-<key name="t"> 7,24,25,15,16,14,17,18,19,28, </key>\r
-<key name="tab"> 6,20,22, </key>\r
-<key name="tabl"> 25,26, </key>\r
-<key name="tag"> 14, </key>\r
-<key name="tailor"> 10, </key>\r
-<key name="tak"> 3,14, </key>\r
-<key name="taken"> 25,15,14, </key>\r
-<key name="target"> 14, </key>\r
-<key name="target_directory"> 14, </key>\r
-<key name="target_platform"> 14, </key>\r
-<key name="targetdir"> 14, </key>\r
-<key name="task"> 0, </key>\r
-<key name="tcl"> 14, </key>\r
-<key name="tcl_version"> 14, </key>\r
-<key name="tclconfig"> 14, </key>\r
-<key name="tclhom"> 14, </key>\r
-<key name="technologi"> 3, </key>\r
-<key name="technological"> 10, </key>\r
-<key name="technology"> 3,24, </key>\r
-<key name="temp_directory"> 14, </key>\r
-<key name="temp_fold"> 14, </key>\r
-<key name="tempdir"> 14, </key>\r
-<key name="temporary"> 14, </key>\r
-<key name="temporarydiskspac"> 14, </key>\r
-<key name="tensor"> 25, </key>\r
-<key name="term"> 10,12,20, </key>\r
-<key name="terminal"> 15,14, </key>\r
-<key name="test"> 3,14,19, </key>\r
-<key name="text"> 12,14,20, </key>\r
-<key name="textur"> 25, </key>\r
-<key name="them"> 3,6,10,23,24,15,16,14,26,22,28, </key>\r
-<key name="therefor"> 14, </key>\r
-<key name="third"> 11, </key>\r
-<key name="thos"> 14,18,20, </key>\r
-<key name="thre"> 14, </key>\r
-<key name="threshold"> 25, </key>\r
-<key name="thu"> 3,0,14, </key>\r
-<key name="tick"> 28, </key>\r
-<key name="tim"> 3,6,0,8,10,25,15,14,17,27,19,22, </key>\r
-<key name="tip"> 14, </key>\r
-<key name="titl"> 23,25,14,18, </key>\r
-<key name="tk"> 14, </key>\r
-<key name="tk_version"> 14, </key>\r
-<key name="tkconfig"> 14, </key>\r
-<key name="tmp"> 14, </key>\r
-<key name="tmp_disk_spac"> 14, </key>\r
-<key name="toggl"> 23,25,21, </key>\r
-<key name="toleranc"> 25, </key>\r
-<key name="tool"> 3,2,11,16,14,19,22, </key>\r
-<key name="toolbar"> 3,5,7,2,24,13,16,17,28, </key>\r
-<key name="toolkit"> 2,14, </key>\r
-<key name="tooltip"> 14, </key>\r
-<key name="top"> 5,2,25,16,14,18, </key>\r
-<key name="topic"> 4,12,20, </key>\r
-<key name="topmost"> 14, </key>\r
-<key name="total"> 14, </key>\r
-<key name="totality"> 3, </key>\r
-<key name="touch"> 0, </key>\r
-<key name="train"> 10, </key>\r
-<key name="transformation"> 24, </key>\r
-<key name="translat"> 25, </key>\r
-<key name="translation"> 25, </key>\r
-<key name="transparency"> 25, </key>\r
-<key name="transparent"> 25, </key>\r
-<key name="tre"> 5,14,18,19,21, </key>\r
-<key name="tri"> 14, </key>\r
-<key name="triangl"> 24,28, </key>\r
-<key name="trihedron"> 24,18,28, </key>\r
-<key name="trolltech"> 14, </key>\r
-<key name="troubl"> 14, </key>\r
-<key name="tru"> 14, </key>\r
-<key name="try"> 8,14,17,19, </key>\r
-<key name="try_exist"> 14, </key>\r
-<key name="try_nativ"> 14, </key>\r
-<key name="try_preinstal"> 14, </key>\r
-<key name="turn"> 14, </key>\r
-<key name="twic"> 25, </key>\r
-<key name="two"> 6,12,25,14,17,19, </key>\r
-<key name="typ"> 0,23,25,14,26,18,19, </key>\r
-<key name="typical"> 19, </key>\r
-<key name="u"> 18, </key>\r
-<key name="ultimat"> 3, </key>\r
-<key name="uncheck"> 24,25,16,28, </key>\r
-<key name="underlin"> 26, </key>\r
-<key name="unfortunare"> 14, </key>\r
-<key name="unfortunate"> 14, </key>\r
-<key name="uniqu"> 14, </key>\r
-<key name="unit"> 25, </key>\r
-<key name="unix"> 4, </key>\r
-<key name="unload"> 13,17, </key>\r
-<key name="unnecessary"> 14, </key>\r
-<key name="unpack"> 14, </key>\r
-<key name="unselect"> 14, </key>\r
-<key name="unus"> 0, </key>\r
-<key name="up"> 10,12,13,16,14,17,26,21, </key>\r
-<key name="updat"> 23,25,16,17,19, </key>\r
-<key name="upload"> 2,16, </key>\r
-<key name="us"> 3,0,1,8,9,10,2,11,23,24,25,15,16,14,17,26,18,27,19,20,21,22,28, </key>\r
-<key name="usability"> 2, </key>\r
-<key name="usag"> 25,14, </key>\r
-<key name="user"> 8,19, </key>\r
-<key name="usr"> 14, </key>\r
-<key name="usual"> 14, </key>\r
-<key name="utiliti"> 4, </key>\r
-<key name="v"> 14,18, </key>\r
-<key name="valid"> 18, </key>\r
-<key name="validation"> 3, </key>\r
-<key name="valu"> 1,23,25,14,18,21, </key>\r
-<key name="variabl"> 15,14, </key>\r
-<key name="variety"> 4,12, </key>\r
-<key name="variou"> 11,14, </key>\r
-<key name="ve"> 14,18, </key>\r
-<key name="vector"> 1,25, </key>\r
-<key name="version"> 6,2,16,14,27,19, </key>\r
-<key name="vertic"> 1, </key>\r
-<key name="vertical"> 6,23,25,18, </key>\r
-<key name="very"> 10,2,25,16,14, </key>\r
-<key name="via"> 24,14,28, </key>\r
-<key name="view"> 3,5,8,2,23,12,24,25,16,14,18,20,22,28, </key>\r
-<key name="viewer"> 5,6,2,11,16,17,18, </key>\r
-<key name="visibl"> 24,28, </key>\r
-<key name="visual"> 11, </key>\r
-<key name="visualisation"> 1,25, </key>\r
-<key name="visualiz"> 10,24,25,28, </key>\r
-<key name="visualization"> 9,10,2,11,16, </key>\r
-<key name="vtk"> 5,6,2,14,18,28, </key>\r
-<key name="vtkhom"> 14, </key>\r
-<key name="wait"> 14, </key>\r
-<key name="want"> 6,12,14, </key>\r
-<key name="warn"> 8,25,14, </key>\r
-<key name="way"> 11,14,19, </key>\r
-<key name="web"> 4, </key>\r
-<key name="welcom"> 4,10, </key>\r
-<key name="what"> 3,10,12,14,27,21, </key>\r
-<key name="whenev"> 23,18, </key>\r
-<key name="wherev"> 6, </key>\r
-<key name="whil"> 3, </key>\r
-<key name="whol"> 25,18,27, </key>\r
-<key name="whos"> 23, </key>\r
-<key name="why"> 14, </key>\r
-<key name="wid"> 4,11,26, </key>\r
-<key name="widget"> 11, </key>\r
-<key name="width"> 23,25, </key>\r
-<key name="will"> 4,5,0,8,23,24,13,25,15,16,14,17,26,18,27,19,21,22, </key>\r
-<key name="window"> 4,5,6,9,2,12,25,15,16,14,17,26,18,22, </key>\r
-<key name="wir"> 1, </key>\r
-<key name="wirefram"> 1,23, </key>\r
-<key name="wish"> 6,24,14,28, </key>\r
-<key name="within"> 3,5,7,22, </key>\r
-<key name="without"> 3,0,25,15,14,27, </key>\r
-<key name="wizard"> 14, </key>\r
-<key name="won"> 7,15, </key>\r
-<key name="word"> 20, </key>\r
-<key name="work"> 3,6,0,9,11,24,25,16,14,17, </key>\r
-<key name="would"> 16,17,19, </key>\r
-<key name="writ"> 10,14,17, </key>\r
-<key name="written"> 3,17, </key>\r
-<key name="wrong"> 14, </key>\r
-<key name="www"> 3, </key>\r
-<key name="x"> 23,25,15, </key>\r
-<key name="xml"> 15,14,19, </key>\r
-<key name="xterm"> 15, </key>\r
-<key name="xxxxx"> 14, </key>\r
-<key name="xy"> 25, </key>\r
-<key name="y"> 23,25, </key>\r
-<key name="year"> 10, </key>\r
-<key name="yes"> 8,14, </key>\r
-<key name="yet"> 14,18, </key>\r
-<key name="your"> 5,6,0,7,8,23,25,15,14,17,18,27,19, </key>\r
-<key name="yourselv"> 26, </key>\r
-<key name="z"> 15, </key>\r
-<key name="zon"> 5,6,25, </key>\r
-<key name="zoom"> 24,25,17,28, </key>\r
-\r
-</ftswdata>  \r
diff --git a/doc/salome/gui/GUI/whxdata/whgdata0.xml b/doc/salome/gui/GUI/whxdata/whgdata0.xml
deleted file mode 100755 (executable)
index 0075ff8..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version='1.0' encoding='windows-1252' ?>\r
-<glossarydata>\r
- <entry name="Cell" value="Element of a mesh. Cells are determined by their connectivity. They can have 0,1,2 or 3 dimension." />\r
- <entry name="Component" value="One integer or real value can correspond to each component of a field and to each entity of a mesh" />\r
- <entry name="Descendant connectivity" value="It is a description of the entities of the mesh with dimension N. This description is made by an ordered list of geometrical entities (nodes, edges, or faces) with dimension N-1." />\r
- <entry name="Edge" value="An edge of a volumetric or surface mesh. It is composed of 2 or 3 nodes (2 vertex nodes and optionally one middle node)." />\r
- <entry name="Entity of a mesh" value="Geometrical component of the mesh: node, cell, face and edge. Faces and edges are only intermediate entities allowing to define the cells in descendant connectivity." />\r
- <entry name="Equivalence" value="Equivalence represents a list of correspondance 2 by 2 of the entities of the same dimension." />\r
- <entry name="Face" value="Face of a volumetrical cell (triangle, quadrangle)." />\r
- <entry name="Family" value="Entities of a mesh are described by a certain number   of characteristics (boundary conditions, groups membership). Families represent classes equivalent to these characteristics (two entities of a mesh can belong to the same family if they have the same characteristics). Every family is determined by a set of attributes and a list of groups membership." />\r
- <entry name="Field" value="Field consists of one or several scalar components. One definite type is associated to the given field and the values corresponding to different components are all of the same type." />\r
- <entry name="Field profile" value="Fields can be defined only on one part of the mesh. Profile   of the field or profile of the component of a field indicates which entities of the mesh contain values." />\r
- <entry name="Group" value="Unordered set of entities of a mesh. One entity can belong to   several groups." />\r
- <entry name="Mesh" value="Mesh is described by its geometry: list of nodes and list of cells which constitute this mesh. Supplementary information is added with the help of families (initial, boundary conditions)." />\r
- <entry name="Nodal connectivity" value="It is a description of an entity of the mesh by an ordered list of nodes constituting this entity." />\r
- <entry name="Node" value="Node can be an isolated node of a mesh, a vertex or middle node of an edge. A node is associated to a point." />\r
- <entry name="Point" value="Geometrical entity determined by its coordinates in the space." />\r
- <entry name="Reference connectivity" value="For each type of entity of a mesh, reference connectivity define the topology of an entity." />\r
- <entry name="Result" value="List of fields referring to one mesh." />\r
- <entry name="Study" value="Study represents a chain of sequences of calculations." />\r
-\r
-</glossarydata>\r
diff --git a/doc/salome/gui/GUI/whxdata/whglo.xml b/doc/salome/gui/GUI/whxdata/whglo.xml
deleted file mode 100755 (executable)
index 0f1cd68..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version='1.0' encoding='windows-1252' ?>\r
-<glossary>\r
-<chunkinfo url="whgdata0.xml" first="Cell" last="Study" num="18" />\r
-\r
-</glossary>
\ No newline at end of file
diff --git a/doc/salome/gui/GUI/whxdata/whidx.xml b/doc/salome/gui/GUI/whxdata/whidx.xml
deleted file mode 100755 (executable)
index ac66bb9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version='1.0' encoding='windows-1252' ?>\r
-<index>\r
-\r
-</index>\r
diff --git a/doc/salome/gui/GUI/whxdata/whtdata0.xml b/doc/salome/gui/GUI/whxdata/whtdata0.xml
deleted file mode 100755 (executable)
index d79d748..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version='1.0' encoding='windows-1252' ?>\r
-<tocdata>\r
-<item name="Welcome to SALOME" url="kernel/introduction.htm" />\r
-<book name="Using this reference manual" >\r
-  <item name="About SALOME help system" url="kernel/about_salome_pro_help_system.htm" />\r
-  <item name="Navigating topics" url="kernel/navigating_topics.htm" />\r
-  <item name="Using left-hand tabs" url="kernel/using_left-hand_tabs.htm" />\r
-</book>\r
-<book name="About SALOME" >\r
-  <item name="Introduction to SALOME" url="kernel/introduction_to_salome_pro.htm" />\r
-  <item name="SALOME architecture" url="kernel/about_salome_pro_architecture.htm" />\r
-  <item name="Installing SALOME" url="kernel/readme.html" />\r
-  <item name="Running SALOME" url="kernel/running_salome_pro.htm" />\r
-</book>\r
-<book name="GUI module" >\r
-  <item name="Introduction to GUI" url="introduction_to_gui.htm" />\r
-  <item name="Getting started" url="kernel/getting_started2.htm" />\r
-  <item name="SALOME desktop" url="kernel/salome_pro_desktop.htm" />\r
-  <book name="Study management" >\r
-    <item name="Creating a new study" url="kernel/creating_a_new_study.htm" />\r
-    <item name="Opening studies" url="kernel/opening_studies.htm" />\r
-    <item name="Saving and closing studies" url="kernel/saving_a_study.htm" />\r
-    <item name="Editing studies" url="kernel/editing_studies.htm" />\r
-    <item name="Displaying studies" url="kernel/displaying_studies.htm" />\r
-    <item name="Working with Python Scripts" url="dump_study.htm" />\r
-    <item name="Setting study properties" url="kernel/getting_properties_of_the_study.htm" />\r
-  </book>\r
-  <item name="Using Object Browser" url="kernel/using_object_browser.htm" />\r
-  <item name="Using Registry tool" url="kernel/using_registry.htm" />\r
-  <item name="Using Catalog Generator" url="kernel/using_catalog_generator.htm" />\r
-  <book name="Viewers" >\r
-    <item name="OCC 3D Viewer" url="occ_3d_viewer.htm" />\r
-    <item name="VTK 3D Viewer" url="vtk_3d_viewer.htm" />\r
-  </book>\r
-  <book name="Setting Preferences" >\r
-    <item name="Setting Preferences" url="setting_preferences.htm" />\r
-    <item name="Select Color and Font" url="select_color_and_font.htm" />\r
-    <item name="SALOME preferences" url="kernel/setting_preferences.htm" />\r
-    <item name="Geometry preferences" url="geom_preferences.htm" />\r
-    <item name="Mesh preferences" url="mesh_preferences.htm" />\r
-    <item name="Post-Pro Preferences" url="post-pro_preferences.htm" />\r
-  </book>\r
-</book>\r
-\r
-</tocdata>\r
diff --git a/doc/salome/gui/GUI/whxdata/whtoc.xml b/doc/salome/gui/GUI/whxdata/whtoc.xml
deleted file mode 100755 (executable)
index a271ba7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version='1.0' encoding='windows-1252' ?>\r
-<toc root="whtdata0.xml">\r
-\r
-</toc>\r
index 04ccab4baf07c866e0cce5d4ad486c61b907d8ef..61de9ca86ceb9b7317e457d89e1d3dadc9409e5b 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  File   : Makefile.in
 #  Author : Vasily Rusyaev (Open Cascade NN)
 #  Module : doc
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-EXTRA_DIST+=GUI
+EXTRA_DIST += images input static
 
-doxygen=@DOXYGEN@
-
-usr_docs:
-       cd ./GUI; \
+usr_docs: doxyfile
        echo "Running doxygen in directory: "`pwd`; \
-       $(doxygen) ./doxyfile;
+       $(DOXYGEN) $<
 
 docs: usr_docs
 
 clean-local:
-       cd ./GUI; \
-       rm -fr `ls | grep -v "doxyfile"`
-       rm -fr `ls | grep -vE "Makefile|GUI"`
+       -rm -fr GUI doxygen.bak
 
 install-data-local: usr_docs
-       mkdir -p $(docdir)/gui
-       cp -rf GUI $(docdir)/gui
-       -find $(PWD) -name CVS -prune -exec rm -rf {} \;
+       $(INSTALL) -d $(DESTDIR)$(docdir)/gui
+       cp -rp GUI $(DESTDIR)$(docdir)/gui
 
 uninstall-local:
-       rm -rf $(docdir)/gui/GUI
-
-docguidir=$(docdir)/gui/GUI
-
-nodist_docgui_DATA= GUI/doxyfile
-GUI/doxyfile: GUI/doxyfile.in
-EXTRA_DIST+= GUI/doxyfile.in
\ No newline at end of file
+       rm -rf $(DESTDIR)$(docdir)/gui/GUI
diff --git a/doc/salome/gui/doxyfile.in b/doc/salome/gui/doxyfile.in
new file mode 100755 (executable)
index 0000000..dd9ea65
--- /dev/null
@@ -0,0 +1,65 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME      = "GUI Module Reference Manual v.@VERSION@"
+OUTPUT_DIRECTORY  = GUI
+CREATE_SUBDIRS   = NO
+OUTPUT_LANGUAGE   = English
+TAB_SIZE          = 5
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET             = NO
+WARNINGS          = YES
+
+#---------------------------------------------------------------------------
+#Input related options
+#---------------------------------------------------------------------------
+INPUT             = @srcdir@/input               
+FILE_PATTERNS     = *.doc
+IMAGE_PATH        = @srcdir@/images
+
+#---------------------------------------------------------------------------
+#HTML related options
+#---------------------------------------------------------------------------
+GENERATE_HTML     = YES
+HTML_OUTPUT       = .
+HTML_HEADER       = @srcdir@/static/header.html
+HTML_FOOTER       = @srcdir@/static/footer.html
+#HTML_STYLESHEET  = @srcdir@/static/doxygen.css
+TOC_EXPAND        = YES
+DISABLE_INDEX     = NO
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH    = 300
+
+#---------------------------------------------------------------------------
+#LaTeX related option
+#---------------------------------------------------------------------------
+GENERATE_LATEX    = NO
+
+#---------------------------------------------------------------------------
+#RTF related options
+#---------------------------------------------------------------------------
+GENERATE_RTF      = NO
\ No newline at end of file
diff --git a/doc/salome/gui/images/batchmode.png b/doc/salome/gui/images/batchmode.png
new file mode 100644 (file)
index 0000000..3432946
Binary files /dev/null and b/doc/salome/gui/images/batchmode.png differ
diff --git a/doc/salome/gui/images/cataloggenerator.png b/doc/salome/gui/images/cataloggenerator.png
new file mode 100755 (executable)
index 0000000..252c421
Binary files /dev/null and b/doc/salome/gui/images/cataloggenerator.png differ
diff --git a/doc/salome/gui/images/choicepage.png b/doc/salome/gui/images/choicepage.png
new file mode 100644 (file)
index 0000000..7c99728
Binary files /dev/null and b/doc/salome/gui/images/choicepage.png differ
diff --git a/doc/salome/gui/images/clipping.png b/doc/salome/gui/images/clipping.png
new file mode 100644 (file)
index 0000000..3b26aa4
Binary files /dev/null and b/doc/salome/gui/images/clipping.png differ
diff --git a/doc/salome/gui/images/closestudy.png b/doc/salome/gui/images/closestudy.png
new file mode 100755 (executable)
index 0000000..4099cc8
Binary files /dev/null and b/doc/salome/gui/images/closestudy.png differ
diff --git a/doc/salome/gui/images/copy-paste.jpg b/doc/salome/gui/images/copy-paste.jpg
new file mode 100755 (executable)
index 0000000..e4006b6
Binary files /dev/null and b/doc/salome/gui/images/copy-paste.jpg differ
diff --git a/doc/salome/gui/images/directorypage.png b/doc/salome/gui/images/directorypage.png
new file mode 100755 (executable)
index 0000000..fafc989
Binary files /dev/null and b/doc/salome/gui/images/directorypage.png differ
diff --git a/doc/salome/gui/images/dumpstudy.png b/doc/salome/gui/images/dumpstudy.png
new file mode 100755 (executable)
index 0000000..af7c73f
Binary files /dev/null and b/doc/salome/gui/images/dumpstudy.png differ
diff --git a/doc/salome/gui/images/featureedgesprops.png b/doc/salome/gui/images/featureedgesprops.png
new file mode 100755 (executable)
index 0000000..4a41a1a
Binary files /dev/null and b/doc/salome/gui/images/featureedgesprops.png differ
diff --git a/doc/salome/gui/images/findtool1.png b/doc/salome/gui/images/findtool1.png
new file mode 100644 (file)
index 0000000..c0577ba
Binary files /dev/null and b/doc/salome/gui/images/findtool1.png differ
diff --git a/doc/salome/gui/images/findtool2.png b/doc/salome/gui/images/findtool2.png
new file mode 100644 (file)
index 0000000..a019667
Binary files /dev/null and b/doc/salome/gui/images/findtool2.png differ
diff --git a/doc/salome/gui/images/geomview-alt.png b/doc/salome/gui/images/geomview-alt.png
new file mode 100755 (executable)
index 0000000..e7e1ef6
Binary files /dev/null and b/doc/salome/gui/images/geomview-alt.png differ
diff --git a/doc/salome/gui/images/graduateaxes1.png b/doc/salome/gui/images/graduateaxes1.png
new file mode 100755 (executable)
index 0000000..9d2b197
Binary files /dev/null and b/doc/salome/gui/images/graduateaxes1.png differ
diff --git a/doc/salome/gui/images/graduatedaxes1.png b/doc/salome/gui/images/graduatedaxes1.png
new file mode 100644 (file)
index 0000000..9d2b197
Binary files /dev/null and b/doc/salome/gui/images/graduatedaxes1.png differ
diff --git a/doc/salome/gui/images/icon_about.png b/doc/salome/gui/images/icon_about.png
new file mode 100755 (executable)
index 0000000..bbbc7a9
Binary files /dev/null and b/doc/salome/gui/images/icon_about.png differ
diff --git a/doc/salome/gui/images/image100.gif b/doc/salome/gui/images/image100.gif
new file mode 100644 (file)
index 0000000..ec56cac
Binary files /dev/null and b/doc/salome/gui/images/image100.gif differ
diff --git a/doc/salome/gui/images/image100.png b/doc/salome/gui/images/image100.png
new file mode 100755 (executable)
index 0000000..ec56cac
Binary files /dev/null and b/doc/salome/gui/images/image100.png differ
diff --git a/doc/salome/gui/images/image102.gif b/doc/salome/gui/images/image102.gif
new file mode 100644 (file)
index 0000000..7880b7e
Binary files /dev/null and b/doc/salome/gui/images/image102.gif differ
diff --git a/doc/salome/gui/images/image103.gif b/doc/salome/gui/images/image103.gif
new file mode 100644 (file)
index 0000000..b02616f
Binary files /dev/null and b/doc/salome/gui/images/image103.gif differ
diff --git a/doc/salome/gui/images/image103.png b/doc/salome/gui/images/image103.png
new file mode 100755 (executable)
index 0000000..b02616f
Binary files /dev/null and b/doc/salome/gui/images/image103.png differ
diff --git a/doc/salome/gui/images/image105.gif b/doc/salome/gui/images/image105.gif
new file mode 100644 (file)
index 0000000..4f6173f
Binary files /dev/null and b/doc/salome/gui/images/image105.gif differ
diff --git a/doc/salome/gui/images/image106.gif b/doc/salome/gui/images/image106.gif
new file mode 100644 (file)
index 0000000..0356a9a
Binary files /dev/null and b/doc/salome/gui/images/image106.gif differ
diff --git a/doc/salome/gui/images/image106.png b/doc/salome/gui/images/image106.png
new file mode 100755 (executable)
index 0000000..0356a9a
Binary files /dev/null and b/doc/salome/gui/images/image106.png differ
diff --git a/doc/salome/gui/images/image108.gif b/doc/salome/gui/images/image108.gif
new file mode 100644 (file)
index 0000000..fa8cbbc
Binary files /dev/null and b/doc/salome/gui/images/image108.gif differ
diff --git a/doc/salome/gui/images/image108.png b/doc/salome/gui/images/image108.png
new file mode 100755 (executable)
index 0000000..fa8cbbc
Binary files /dev/null and b/doc/salome/gui/images/image108.png differ
diff --git a/doc/salome/gui/images/image109.gif b/doc/salome/gui/images/image109.gif
new file mode 100644 (file)
index 0000000..5dbba46
Binary files /dev/null and b/doc/salome/gui/images/image109.gif differ
diff --git a/doc/salome/gui/images/image157.gif b/doc/salome/gui/images/image157.gif
new file mode 100644 (file)
index 0000000..69fc55d
Binary files /dev/null and b/doc/salome/gui/images/image157.gif differ
diff --git a/doc/salome/gui/images/image54.jpg b/doc/salome/gui/images/image54.jpg
new file mode 100755 (executable)
index 0000000..a67ac4c
Binary files /dev/null and b/doc/salome/gui/images/image54.jpg differ
diff --git a/doc/salome/gui/images/image65.gif b/doc/salome/gui/images/image65.gif
new file mode 100755 (executable)
index 0000000..fbf6a81
Binary files /dev/null and b/doc/salome/gui/images/image65.gif differ
diff --git a/doc/salome/gui/images/image67.gif b/doc/salome/gui/images/image67.gif
new file mode 100755 (executable)
index 0000000..4c5d4d6
Binary files /dev/null and b/doc/salome/gui/images/image67.gif differ
diff --git a/doc/salome/gui/images/image69.gif b/doc/salome/gui/images/image69.gif
new file mode 100755 (executable)
index 0000000..f8ea563
Binary files /dev/null and b/doc/salome/gui/images/image69.gif differ
diff --git a/doc/salome/gui/images/image70.gif b/doc/salome/gui/images/image70.gif
new file mode 100755 (executable)
index 0000000..c88c53e
Binary files /dev/null and b/doc/salome/gui/images/image70.gif differ
diff --git a/doc/salome/gui/images/image72.gif b/doc/salome/gui/images/image72.gif
new file mode 100755 (executable)
index 0000000..4364ce7
Binary files /dev/null and b/doc/salome/gui/images/image72.gif differ
diff --git a/doc/salome/gui/images/image72.png b/doc/salome/gui/images/image72.png
new file mode 100755 (executable)
index 0000000..4364ce7
Binary files /dev/null and b/doc/salome/gui/images/image72.png differ
diff --git a/doc/salome/gui/images/image73.gif b/doc/salome/gui/images/image73.gif
new file mode 100755 (executable)
index 0000000..0ebcf97
Binary files /dev/null and b/doc/salome/gui/images/image73.gif differ
diff --git a/doc/salome/gui/images/image75.gif b/doc/salome/gui/images/image75.gif
new file mode 100755 (executable)
index 0000000..9fdfbdc
Binary files /dev/null and b/doc/salome/gui/images/image75.gif differ
diff --git a/doc/salome/gui/images/image77.gif b/doc/salome/gui/images/image77.gif
new file mode 100644 (file)
index 0000000..b02616f
Binary files /dev/null and b/doc/salome/gui/images/image77.gif differ
diff --git a/doc/salome/gui/images/image77.png b/doc/salome/gui/images/image77.png
new file mode 100755 (executable)
index 0000000..441482d
Binary files /dev/null and b/doc/salome/gui/images/image77.png differ
diff --git a/doc/salome/gui/images/image86.gif b/doc/salome/gui/images/image86.gif
new file mode 100644 (file)
index 0000000..441482d
Binary files /dev/null and b/doc/salome/gui/images/image86.gif differ
diff --git a/doc/salome/gui/images/image86.png b/doc/salome/gui/images/image86.png
new file mode 100755 (executable)
index 0000000..441482d
Binary files /dev/null and b/doc/salome/gui/images/image86.png differ
diff --git a/doc/salome/gui/images/image88.gif b/doc/salome/gui/images/image88.gif
new file mode 100644 (file)
index 0000000..9466aa6
Binary files /dev/null and b/doc/salome/gui/images/image88.gif differ
diff --git a/doc/salome/gui/images/image89.gif b/doc/salome/gui/images/image89.gif
new file mode 100644 (file)
index 0000000..28ec89f
Binary files /dev/null and b/doc/salome/gui/images/image89.gif differ
diff --git a/doc/salome/gui/images/image89.png b/doc/salome/gui/images/image89.png
new file mode 100755 (executable)
index 0000000..28ec89f
Binary files /dev/null and b/doc/salome/gui/images/image89.png differ
diff --git a/doc/salome/gui/images/image91.gif b/doc/salome/gui/images/image91.gif
new file mode 100644 (file)
index 0000000..66f81e6
Binary files /dev/null and b/doc/salome/gui/images/image91.gif differ
diff --git a/doc/salome/gui/images/image91.png b/doc/salome/gui/images/image91.png
new file mode 100755 (executable)
index 0000000..66f81e6
Binary files /dev/null and b/doc/salome/gui/images/image91.png differ
diff --git a/doc/salome/gui/images/image94.gif b/doc/salome/gui/images/image94.gif
new file mode 100755 (executable)
index 0000000..4364ce7
Binary files /dev/null and b/doc/salome/gui/images/image94.gif differ
diff --git a/doc/salome/gui/images/image95.gif b/doc/salome/gui/images/image95.gif
new file mode 100644 (file)
index 0000000..88941d0
Binary files /dev/null and b/doc/salome/gui/images/image95.gif differ
diff --git a/doc/salome/gui/images/image96.gif b/doc/salome/gui/images/image96.gif
new file mode 100644 (file)
index 0000000..87e001d
Binary files /dev/null and b/doc/salome/gui/images/image96.gif differ
diff --git a/doc/salome/gui/images/image96.png b/doc/salome/gui/images/image96.png
new file mode 100755 (executable)
index 0000000..87e001d
Binary files /dev/null and b/doc/salome/gui/images/image96.png differ
diff --git a/doc/salome/gui/images/image97.gif b/doc/salome/gui/images/image97.gif
new file mode 100644 (file)
index 0000000..450dc56
Binary files /dev/null and b/doc/salome/gui/images/image97.gif differ
diff --git a/doc/salome/gui/images/image97.png b/doc/salome/gui/images/image97.png
new file mode 100755 (executable)
index 0000000..450dc56
Binary files /dev/null and b/doc/salome/gui/images/image97.png differ
diff --git a/doc/salome/gui/images/image98.gif b/doc/salome/gui/images/image98.gif
new file mode 100644 (file)
index 0000000..87e001d
Binary files /dev/null and b/doc/salome/gui/images/image98.gif differ
diff --git a/doc/salome/gui/images/image98.png b/doc/salome/gui/images/image98.png
new file mode 100755 (executable)
index 0000000..87e001d
Binary files /dev/null and b/doc/salome/gui/images/image98.png differ
diff --git a/doc/salome/gui/images/image99.gif b/doc/salome/gui/images/image99.gif
new file mode 100644 (file)
index 0000000..ec56cac
Binary files /dev/null and b/doc/salome/gui/images/image99.gif differ
diff --git a/doc/salome/gui/images/image99.png b/doc/salome/gui/images/image99.png
new file mode 100755 (executable)
index 0000000..ec56cac
Binary files /dev/null and b/doc/salome/gui/images/image99.png differ
diff --git a/doc/salome/gui/images/import.png b/doc/salome/gui/images/import.png
new file mode 100755 (executable)
index 0000000..093c667
Binary files /dev/null and b/doc/salome/gui/images/import.png differ
diff --git a/doc/salome/gui/images/installtypepage.png b/doc/salome/gui/images/installtypepage.png
new file mode 100755 (executable)
index 0000000..8359d54
Binary files /dev/null and b/doc/salome/gui/images/installtypepage.png differ
diff --git a/doc/salome/gui/images/intropage.png b/doc/salome/gui/images/intropage.png
new file mode 100644 (file)
index 0000000..de29d06
Binary files /dev/null and b/doc/salome/gui/images/intropage.png differ
diff --git a/doc/salome/gui/images/loadscript.png b/doc/salome/gui/images/loadscript.png
new file mode 100755 (executable)
index 0000000..45d5aa4
Binary files /dev/null and b/doc/salome/gui/images/loadscript.png differ
diff --git a/doc/salome/gui/images/loadstudy2.png b/doc/salome/gui/images/loadstudy2.png
new file mode 100755 (executable)
index 0000000..97b4db5
Binary files /dev/null and b/doc/salome/gui/images/loadstudy2.png differ
diff --git a/doc/salome/gui/images/lockedstudy.png b/doc/salome/gui/images/lockedstudy.png
new file mode 100755 (executable)
index 0000000..b99cce0
Binary files /dev/null and b/doc/salome/gui/images/lockedstudy.png differ
diff --git a/doc/salome/gui/images/mainmenu.png b/doc/salome/gui/images/mainmenu.png
new file mode 100755 (executable)
index 0000000..5ee5a3e
Binary files /dev/null and b/doc/salome/gui/images/mainmenu.png differ
diff --git a/doc/salome/gui/images/neo-view2.png b/doc/salome/gui/images/neo-view2.png
new file mode 100755 (executable)
index 0000000..df1c7fe
Binary files /dev/null and b/doc/salome/gui/images/neo-view2.png differ
diff --git a/doc/salome/gui/images/newsticn.jpg b/doc/salome/gui/images/newsticn.jpg
new file mode 100755 (executable)
index 0000000..68555d2
Binary files /dev/null and b/doc/salome/gui/images/newsticn.jpg differ
diff --git a/doc/salome/gui/images/note1.gif b/doc/salome/gui/images/note1.gif
new file mode 100755 (executable)
index 0000000..b53e21d
Binary files /dev/null and b/doc/salome/gui/images/note1.gif differ
diff --git a/doc/salome/gui/images/notebook1.png b/doc/salome/gui/images/notebook1.png
new file mode 100644 (file)
index 0000000..a984085
Binary files /dev/null and b/doc/salome/gui/images/notebook1.png differ
diff --git a/doc/salome/gui/images/objectbrowser1.png b/doc/salome/gui/images/objectbrowser1.png
new file mode 100755 (executable)
index 0000000..16ab896
Binary files /dev/null and b/doc/salome/gui/images/objectbrowser1.png differ
diff --git a/doc/salome/gui/images/objectbrowser2.png b/doc/salome/gui/images/objectbrowser2.png
new file mode 100755 (executable)
index 0000000..e010ef2
Binary files /dev/null and b/doc/salome/gui/images/objectbrowser2.png differ
diff --git a/doc/salome/gui/images/occviewer_axialscale.png b/doc/salome/gui/images/occviewer_axialscale.png
new file mode 100644 (file)
index 0000000..fa8cbbc
Binary files /dev/null and b/doc/salome/gui/images/occviewer_axialscale.png differ
diff --git a/doc/salome/gui/images/occviewer_toolbar.png b/doc/salome/gui/images/occviewer_toolbar.png
new file mode 100644 (file)
index 0000000..88941d0
Binary files /dev/null and b/doc/salome/gui/images/occviewer_toolbar.png differ
diff --git a/doc/salome/gui/images/open.jpg b/doc/salome/gui/images/open.jpg
new file mode 100755 (executable)
index 0000000..8ed143e
Binary files /dev/null and b/doc/salome/gui/images/open.jpg differ
diff --git a/doc/salome/gui/images/platformpage.png b/doc/salome/gui/images/platformpage.png
new file mode 100755 (executable)
index 0000000..cfbf60c
Binary files /dev/null and b/doc/salome/gui/images/platformpage.png differ
diff --git a/doc/salome/gui/images/plot2d_clone.gif b/doc/salome/gui/images/plot2d_clone.gif
new file mode 100644 (file)
index 0000000..441482d
Binary files /dev/null and b/doc/salome/gui/images/plot2d_clone.gif differ
diff --git a/doc/salome/gui/images/plot2d_clone.png b/doc/salome/gui/images/plot2d_clone.png
new file mode 100755 (executable)
index 0000000..441482d
Binary files /dev/null and b/doc/salome/gui/images/plot2d_clone.png differ
diff --git a/doc/salome/gui/images/plot2d_legend.gif b/doc/salome/gui/images/plot2d_legend.gif
new file mode 100644 (file)
index 0000000..81c0627
Binary files /dev/null and b/doc/salome/gui/images/plot2d_legend.gif differ
diff --git a/doc/salome/gui/images/plot2d_legend.png b/doc/salome/gui/images/plot2d_legend.png
new file mode 100755 (executable)
index 0000000..81c0627
Binary files /dev/null and b/doc/salome/gui/images/plot2d_legend.png differ
diff --git a/doc/salome/gui/images/plot2d_lines.gif b/doc/salome/gui/images/plot2d_lines.gif
new file mode 100644 (file)
index 0000000..9789452
Binary files /dev/null and b/doc/salome/gui/images/plot2d_lines.gif differ
diff --git a/doc/salome/gui/images/plot2d_lines.png b/doc/salome/gui/images/plot2d_lines.png
new file mode 100755 (executable)
index 0000000..9789452
Binary files /dev/null and b/doc/salome/gui/images/plot2d_lines.png differ
diff --git a/doc/salome/gui/images/plot2d_logarithmic_horizontal.gif b/doc/salome/gui/images/plot2d_logarithmic_horizontal.gif
new file mode 100644 (file)
index 0000000..fb62cd7
Binary files /dev/null and b/doc/salome/gui/images/plot2d_logarithmic_horizontal.gif differ
diff --git a/doc/salome/gui/images/plot2d_logarithmic_horizontal.png b/doc/salome/gui/images/plot2d_logarithmic_horizontal.png
new file mode 100755 (executable)
index 0000000..fb62cd7
Binary files /dev/null and b/doc/salome/gui/images/plot2d_logarithmic_horizontal.png differ
diff --git a/doc/salome/gui/images/plot2d_logarithmic_vertical.gif b/doc/salome/gui/images/plot2d_logarithmic_vertical.gif
new file mode 100644 (file)
index 0000000..825d59e
Binary files /dev/null and b/doc/salome/gui/images/plot2d_logarithmic_vertical.gif differ
diff --git a/doc/salome/gui/images/plot2d_logarithmic_vertical.png b/doc/salome/gui/images/plot2d_logarithmic_vertical.png
new file mode 100755 (executable)
index 0000000..825d59e
Binary files /dev/null and b/doc/salome/gui/images/plot2d_logarithmic_vertical.png differ
diff --git a/doc/salome/gui/images/plot2d_points.gif b/doc/salome/gui/images/plot2d_points.gif
new file mode 100644 (file)
index 0000000..3cdea33
Binary files /dev/null and b/doc/salome/gui/images/plot2d_points.gif differ
diff --git a/doc/salome/gui/images/plot2d_points.png b/doc/salome/gui/images/plot2d_points.png
new file mode 100755 (executable)
index 0000000..3cdea33
Binary files /dev/null and b/doc/salome/gui/images/plot2d_points.png differ
diff --git a/doc/salome/gui/images/plot2d_settings.gif b/doc/salome/gui/images/plot2d_settings.gif
new file mode 100644 (file)
index 0000000..64df246
Binary files /dev/null and b/doc/salome/gui/images/plot2d_settings.gif differ
diff --git a/doc/salome/gui/images/plot2d_settings.png b/doc/salome/gui/images/plot2d_settings.png
new file mode 100755 (executable)
index 0000000..64df246
Binary files /dev/null and b/doc/salome/gui/images/plot2d_settings.png differ
diff --git a/doc/salome/gui/images/plot2d_splines.gif b/doc/salome/gui/images/plot2d_splines.gif
new file mode 100644 (file)
index 0000000..06a9557
Binary files /dev/null and b/doc/salome/gui/images/plot2d_splines.gif differ
diff --git a/doc/salome/gui/images/plot2d_splines.png b/doc/salome/gui/images/plot2d_splines.png
new file mode 100755 (executable)
index 0000000..06a9557
Binary files /dev/null and b/doc/salome/gui/images/plot2d_splines.png differ
diff --git a/doc/salome/gui/images/plot2d_view_settings.png b/doc/salome/gui/images/plot2d_view_settings.png
new file mode 100644 (file)
index 0000000..a9fab88
Binary files /dev/null and b/doc/salome/gui/images/plot2d_view_settings.png differ
diff --git a/doc/salome/gui/images/polyselection1.png b/doc/salome/gui/images/polyselection1.png
new file mode 100755 (executable)
index 0000000..1920e97
Binary files /dev/null and b/doc/salome/gui/images/polyselection1.png differ
diff --git a/doc/salome/gui/images/polyselection2.png b/doc/salome/gui/images/polyselection2.png
new file mode 100755 (executable)
index 0000000..8467a4d
Binary files /dev/null and b/doc/salome/gui/images/polyselection2.png differ
diff --git a/doc/salome/gui/images/ppref1.png b/doc/salome/gui/images/ppref1.png
new file mode 100755 (executable)
index 0000000..c6783b5
Binary files /dev/null and b/doc/salome/gui/images/ppref1.png differ
diff --git a/doc/salome/gui/images/ppref2.png b/doc/salome/gui/images/ppref2.png
new file mode 100755 (executable)
index 0000000..042a49a
Binary files /dev/null and b/doc/salome/gui/images/ppref2.png differ
diff --git a/doc/salome/gui/images/ppref3.png b/doc/salome/gui/images/ppref3.png
new file mode 100755 (executable)
index 0000000..8c31ab8
Binary files /dev/null and b/doc/salome/gui/images/ppref3.png differ
diff --git a/doc/salome/gui/images/pref11.png b/doc/salome/gui/images/pref11.png
new file mode 100755 (executable)
index 0000000..634da53
Binary files /dev/null and b/doc/salome/gui/images/pref11.png differ
diff --git a/doc/salome/gui/images/pref12.png b/doc/salome/gui/images/pref12.png
new file mode 100755 (executable)
index 0000000..6a711f3
Binary files /dev/null and b/doc/salome/gui/images/pref12.png differ
diff --git a/doc/salome/gui/images/pref13.png b/doc/salome/gui/images/pref13.png
new file mode 100755 (executable)
index 0000000..56dd24a
Binary files /dev/null and b/doc/salome/gui/images/pref13.png differ
diff --git a/doc/salome/gui/images/pref14.png b/doc/salome/gui/images/pref14.png
new file mode 100755 (executable)
index 0000000..ec035a8
Binary files /dev/null and b/doc/salome/gui/images/pref14.png differ
diff --git a/doc/salome/gui/images/pref15.png b/doc/salome/gui/images/pref15.png
new file mode 100755 (executable)
index 0000000..413a6cd
Binary files /dev/null and b/doc/salome/gui/images/pref15.png differ
diff --git a/doc/salome/gui/images/pref21.png b/doc/salome/gui/images/pref21.png
new file mode 100755 (executable)
index 0000000..19e2503
Binary files /dev/null and b/doc/salome/gui/images/pref21.png differ
diff --git a/doc/salome/gui/images/pref22.png b/doc/salome/gui/images/pref22.png
new file mode 100755 (executable)
index 0000000..154ad1b
Binary files /dev/null and b/doc/salome/gui/images/pref22.png differ
diff --git a/doc/salome/gui/images/pref23.png b/doc/salome/gui/images/pref23.png
new file mode 100644 (file)
index 0000000..6910088
Binary files /dev/null and b/doc/salome/gui/images/pref23.png differ
diff --git a/doc/salome/gui/images/pref24.png b/doc/salome/gui/images/pref24.png
new file mode 100755 (executable)
index 0000000..a9b9a56
Binary files /dev/null and b/doc/salome/gui/images/pref24.png differ
diff --git a/doc/salome/gui/images/pref31.png b/doc/salome/gui/images/pref31.png
new file mode 100755 (executable)
index 0000000..48c0557
Binary files /dev/null and b/doc/salome/gui/images/pref31.png differ
diff --git a/doc/salome/gui/images/pref33.png b/doc/salome/gui/images/pref33.png
new file mode 100755 (executable)
index 0000000..0c92552
Binary files /dev/null and b/doc/salome/gui/images/pref33.png differ
diff --git a/doc/salome/gui/images/pref34.png b/doc/salome/gui/images/pref34.png
new file mode 100755 (executable)
index 0000000..229ad9c
Binary files /dev/null and b/doc/salome/gui/images/pref34.png differ
diff --git a/doc/salome/gui/images/pref37.png b/doc/salome/gui/images/pref37.png
new file mode 100755 (executable)
index 0000000..0d4dd68
Binary files /dev/null and b/doc/salome/gui/images/pref37.png differ
diff --git a/doc/salome/gui/images/pref38.png b/doc/salome/gui/images/pref38.png
new file mode 100755 (executable)
index 0000000..5c8d31c
Binary files /dev/null and b/doc/salome/gui/images/pref38.png differ
diff --git a/doc/salome/gui/images/pref39.png b/doc/salome/gui/images/pref39.png
new file mode 100755 (executable)
index 0000000..878a526
Binary files /dev/null and b/doc/salome/gui/images/pref39.png differ
diff --git a/doc/salome/gui/images/pref40.png b/doc/salome/gui/images/pref40.png
new file mode 100755 (executable)
index 0000000..e86c1e2
Binary files /dev/null and b/doc/salome/gui/images/pref40.png differ
diff --git a/doc/salome/gui/images/productpage.png b/doc/salome/gui/images/productpage.png
new file mode 100644 (file)
index 0000000..bc05c8b
Binary files /dev/null and b/doc/salome/gui/images/productpage.png differ
diff --git a/doc/salome/gui/images/productpage1.png b/doc/salome/gui/images/productpage1.png
new file mode 100644 (file)
index 0000000..1033c0c
Binary files /dev/null and b/doc/salome/gui/images/productpage1.png differ
diff --git a/doc/salome/gui/images/productpage2.png b/doc/salome/gui/images/productpage2.png
new file mode 100644 (file)
index 0000000..dc39f2e
Binary files /dev/null and b/doc/salome/gui/images/productpage2.png differ
diff --git a/doc/salome/gui/images/productpage3.png b/doc/salome/gui/images/productpage3.png
new file mode 100755 (executable)
index 0000000..7c2db8b
Binary files /dev/null and b/doc/salome/gui/images/productpage3.png differ
diff --git a/doc/salome/gui/images/productpage4.png b/doc/salome/gui/images/productpage4.png
new file mode 100755 (executable)
index 0000000..9f0de36
Binary files /dev/null and b/doc/salome/gui/images/productpage4.png differ
diff --git a/doc/salome/gui/images/progresspage.png b/doc/salome/gui/images/progresspage.png
new file mode 100644 (file)
index 0000000..0779fcc
Binary files /dev/null and b/doc/salome/gui/images/progresspage.png differ
diff --git a/doc/salome/gui/images/progresspage1.png b/doc/salome/gui/images/progresspage1.png
new file mode 100644 (file)
index 0000000..20ac54b
Binary files /dev/null and b/doc/salome/gui/images/progresspage1.png differ
diff --git a/doc/salome/gui/images/progresspage2.png b/doc/salome/gui/images/progresspage2.png
new file mode 100755 (executable)
index 0000000..c2aad1f
Binary files /dev/null and b/doc/salome/gui/images/progresspage2.png differ
diff --git a/doc/salome/gui/images/readmepage.png b/doc/salome/gui/images/readmepage.png
new file mode 100644 (file)
index 0000000..0ddd39a
Binary files /dev/null and b/doc/salome/gui/images/readmepage.png differ
diff --git a/doc/salome/gui/images/registry1.png b/doc/salome/gui/images/registry1.png
new file mode 100755 (executable)
index 0000000..772c2d8
Binary files /dev/null and b/doc/salome/gui/images/registry1.png differ
diff --git a/doc/salome/gui/images/registry3.png b/doc/salome/gui/images/registry3.png
new file mode 100755 (executable)
index 0000000..90f944a
Binary files /dev/null and b/doc/salome/gui/images/registry3.png differ
diff --git a/doc/salome/gui/images/registry4.png b/doc/salome/gui/images/registry4.png
new file mode 100755 (executable)
index 0000000..c68dabe
Binary files /dev/null and b/doc/salome/gui/images/registry4.png differ
diff --git a/doc/salome/gui/images/save.jpg b/doc/salome/gui/images/save.jpg
new file mode 100755 (executable)
index 0000000..be10e0c
Binary files /dev/null and b/doc/salome/gui/images/save.jpg differ
diff --git a/doc/salome/gui/images/selectcolor.png b/doc/salome/gui/images/selectcolor.png
new file mode 100755 (executable)
index 0000000..7e1f496
Binary files /dev/null and b/doc/salome/gui/images/selectcolor.png differ
diff --git a/doc/salome/gui/images/selectfont.png b/doc/salome/gui/images/selectfont.png
new file mode 100755 (executable)
index 0000000..936b529
Binary files /dev/null and b/doc/salome/gui/images/selectfont.png differ
diff --git a/doc/salome/gui/images/set_rotation_point_dialog1.png b/doc/salome/gui/images/set_rotation_point_dialog1.png
new file mode 100644 (file)
index 0000000..9d3b89e
Binary files /dev/null and b/doc/salome/gui/images/set_rotation_point_dialog1.png differ
diff --git a/doc/salome/gui/images/set_rotation_point_dialog2.png b/doc/salome/gui/images/set_rotation_point_dialog2.png
new file mode 100644 (file)
index 0000000..60ee980
Binary files /dev/null and b/doc/salome/gui/images/set_rotation_point_dialog2.png differ
diff --git a/doc/salome/gui/images/studymanagement.png b/doc/salome/gui/images/studymanagement.png
new file mode 100755 (executable)
index 0000000..f6b2097
Binary files /dev/null and b/doc/salome/gui/images/studymanagement.png differ
diff --git a/doc/salome/gui/images/studyproperties.png b/doc/salome/gui/images/studyproperties.png
new file mode 100755 (executable)
index 0000000..e4f9f3d
Binary files /dev/null and b/doc/salome/gui/images/studyproperties.png differ
diff --git a/doc/salome/gui/images/theme1.png b/doc/salome/gui/images/theme1.png
new file mode 100755 (executable)
index 0000000..91d4d30
Binary files /dev/null and b/doc/salome/gui/images/theme1.png differ
diff --git a/doc/salome/gui/images/theme2.png b/doc/salome/gui/images/theme2.png
new file mode 100755 (executable)
index 0000000..9219093
Binary files /dev/null and b/doc/salome/gui/images/theme2.png differ
diff --git a/doc/salome/gui/images/updaterate.png b/doc/salome/gui/images/updaterate.png
new file mode 100755 (executable)
index 0000000..68d508c
Binary files /dev/null and b/doc/salome/gui/images/updaterate.png differ
diff --git a/doc/salome/gui/images/urbutton.png b/doc/salome/gui/images/urbutton.png
new file mode 100755 (executable)
index 0000000..d7c0841
Binary files /dev/null and b/doc/salome/gui/images/urbutton.png differ
diff --git a/doc/salome/gui/images/view2.png b/doc/salome/gui/images/view2.png
new file mode 100755 (executable)
index 0000000..82641a9
Binary files /dev/null and b/doc/salome/gui/images/view2.png differ
diff --git a/doc/salome/gui/images/view_rotation_point.png b/doc/salome/gui/images/view_rotation_point.png
new file mode 100644 (file)
index 0000000..fc303e3
Binary files /dev/null and b/doc/salome/gui/images/view_rotation_point.png differ
diff --git a/doc/salome/gui/images/viewmenu.png b/doc/salome/gui/images/viewmenu.png
new file mode 100755 (executable)
index 0000000..a188e6d
Binary files /dev/null and b/doc/salome/gui/images/viewmenu.png differ
diff --git a/doc/salome/gui/images/windowmenu.png b/doc/salome/gui/images/windowmenu.png
new file mode 100755 (executable)
index 0000000..6e47ee8
Binary files /dev/null and b/doc/salome/gui/images/windowmenu.png differ
diff --git a/doc/salome/gui/input/geometry_preferences.doc b/doc/salome/gui/input/geometry_preferences.doc
new file mode 100644 (file)
index 0000000..8000f2f
--- /dev/null
@@ -0,0 +1,47 @@
+/*!
+
+\page geometry_preferences_page Geometry preferences
+
+In the \b Geometry module you can set preferences for visualisation of
+geometrical figures which can be used in later sessions with this
+module.
+
+\image html pref15.png
+
+\par
+For all color definitions click on the respective line to access to
+the \ref select_color_and_font_page "Select Color" dialog box.
+
+<ul>
+<li><b>General</b></li>
+<ul>
+<li><b>Default Display Mode</b> - allows to choose between wireframe
+or shading.</li>
+<li><b>Default Shading Color</b> - allows to select default shading
+color.</li>
+<li><b> Default Wireframe Color</b> - allows to select default
+wireframe color (to be applied to any lines not being free boundaries
+or isolated lines).</li>
+<li><b>Color of free boundaries</b> - allows to select default color for free boundaries.</li>
+<li><b>Color of edges, vectors and wires</b> - allows to select
+default color for edges, vectors and wires (isolated lines).</li>
+<li><b>Color of points</b> - allows to select default color for
+vertices.</li>
+<li><b>Color of isolines</b> - allows to select default color for
+isolines.</li>
+<li><b>Step Value for Spin Boxes</b> - allows to define the increment
+of values set in spin boxes.</li>
+</ul>
+</ul>
+
+<ul>
+<li><b>Marker of Points</b></li>
+<ul>
+<li><b>Type</b> - allows to select the symbol for representation of
+points (cross, asterisk, etc.).</li>
+<li><b>Size</b> - allows to define the size of the marker from 1
+(smallest) to 7 (largest).</li>
+</ul>
+</ul>
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/index.doc b/doc/salome/gui/input/index.doc
new file mode 100644 (file)
index 0000000..be854bf
--- /dev/null
@@ -0,0 +1,85 @@
+/*!
+
+\mainpage Introduction to Salome Platform
+
+\image html icon_about.png
+
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Welcome to SALOME Platform! Modern technological products (cars,
+structures, electrical or electronic equipment) are getting more and
+more complex every year and must meet increasingly severe requirements
+in terms of quality and performance. For example, for structures and
+their environment the demands to reduce risks and optimize costs are
+extremely high. It requires particularly refined simulations
+concerning structural behavior and robustness to ensure high
+reliability.
+\n The numeric modeling of a physical problem, the development of
+solutions and their integration into the design process are often
+handled in very specific environments. SALOME represents a generic
+CAD-based application for digital simulation with "high reactivity to
+market evolutions and customer expectations".
+
+SALOME is a free software that provides a generic platform for Pre and
+Post-Processing for numerical simulation. It is based on an open and
+flexible architecture made of reusable components available as free
+software.
+
+SALOME is a CAD/CAE integration platform. It provides reusable
+components for: 
+<ul>
+<li>3D modeling (bottom-up construction, import, healing);
+<li>Visualization;
+<li>Computational schemas management;
+<li>Post-processing.
+</ul>
+
+SALOME is tailored for integration of custom components:
+<ul>
+<li>CAD interfaces;
+<li>Mesh generators;
+<li>Finite Element solvers with specific pre-processors.
+</ul>
+
+The SALOME platform is available in Open Source.
+
+<b>Salome Platform:</b>
+<ul>
+<li>Supports interoperability between CAD modeling and computation software (CAD-CAE link) 
+<li>Makes easier the integration of new components on heterogeneous systems for numerical computation 
+<li>Sets the priority to multi-physics coupling between computation software 
+<li>Provides a generic user interface, user-friendly and efficient, which helps to reduce the costs and delays of carrying out the studies 
+<li>Reduces training time to the specific time for learning the software solution which has been based on this platform 
+<li>All functionalities are accessible through the programmatic
+integrated Python console
+</ul>
+
+\image html image65.gif
+
+<b>What can you do in SALOME? (Some of SALOME main functions)</b>
+<ul>
+<li>Define geometrical models (create/modify geometrical items), import and export them using the BREP, IGES and STEP formats; 
+<li>Define meshing of these geometrical items, import and export them;
+<li>Handle physical properties and quantities attached to geometrical items, import and export them to a reusable format;
+<li>Perform computations using a solver (optionally provided): read input data, configure the solver, and write calculation results);
+<li>Visualize result fields in 3D, 2D and export images of their visualization to an appropriate format;
+<li>Manage study schemes: definition, save/restore;
+<li>Manage computation schemes: definition, execution.
+</ul>
+
+From the point of view of the \subpage salome_architecture_page "Architecture", 
+Salome is composed of several modules, which provides a
+great flexibility in its structure during 
+\subpage installing_salome_page "Installation" and
+\subpage running_salome_page "Running".
+
+This part of documentation on Salome also covers 
+\subpage introduction_to_gui_page "general Salome functionalities",
+common for all modules, such as study management, Salome viewers,
+preferences, etc.
+
+And finally, there is an additional chapter, which provides a short
+guide about the \subpage tui_page "usage of Python module salome.py" to access main SALOME
+functionalities from the Python code.
+
+*/
diff --git a/doc/salome/gui/input/installing_salome.doc b/doc/salome/gui/input/installing_salome.doc
new file mode 100644 (file)
index 0000000..5a2f0bd
--- /dev/null
@@ -0,0 +1,708 @@
+/*!
+
+\page installing_salome_page SALOME Installation Wizard Help
+
+<hr>
+<ul>
+<li>\ref installing_products "Installing products with the Installation Wizard"
+<ul>
+<li>\ref gui_mode_install "GUI mode"
+<li>\ref batch_mode_install "Batch mode"
+<li>\ref environment_files "Environment files"
+</ul>
+<li>\ref pick_up_env "Pick up the environment"
+<li>\ref modifying_xml "Modifying XML configuration file"
+<li>\ref installation_scripts "Implementing installation scripts for the new products"
+<li>\ref finish_buttons "Customizing Readme page buttons"
+</ul>
+<hr>
+\anchor installing_products 
+<h1>Installing products with the <em>Installation Wizard</em></h1>
+
+The Installation Wizard can be launched in two modes: \b GUI and \b
+batch.
+<br>The root directory of the Installation Wizard contains Python
+script \b runInstall. To run the Installation Wizard just type \b runInstall.
+in the terminal window:
+<br><br>[ python ] \b runInstall [options]
+
+Without options this script will launch the SALOME Installation
+Wizard in the default mode (GUI). \n The default installation settings
+can be overridden by using command line options. Each option has a
+short and a long notation:
+
+<b>-g / --gui</b>
+\par
+Runs the Installation Wizard in the GUI mode (this is the default
+mode).
+
+<b>-b / --batch</b>
+\par
+Runs the Installation Wizard in the terminal mode.
+
+<b>-f FILE / --file=FILE</b>
+\par
+The XML configuration file to be used by the Installation Wizard.  If
+this option is not used then the installation script tries to define
+the \e Linux version and use the corresponding XML file if it exists. For
+examle, for <em>Linux Mandrake 10.1</em>  the <b>config_Mandrake_10.1.xml</b>  file
+will be used by default. If no appropriate file is found, the file
+<b>config.xml</b> will be used. This file refers to the basic target platform 
+which is <em>Linux Mandrake 10.1</em> for SALOME 3.0 and newer. If <b>config.xml</b>
+file is not found either, a warning message box is shown (in GUI mode)
+or printed to the console (in batch mode) and the Installation Wizard 
+quits.
+
+<b>-d DIR / --target=DIR</b>
+\par
+The target directory SALOME platform is to be installed to. 
+If used, this option overrides the default target directory, given in
+the configuration XML file (usually <b>${HOME}/salome_\<version\></b>, 
+see \ref modifying_xml "here" for more details).
+
+<b>-t DIR / --tmp=DIR</b>
+\par
+The directory, which should be used for temporary files. If given,
+this option overrides the default temporary directory, given in the
+configuration xml file (usually \b /tmp, see \ref modifying_xml "here"
+for more information).
+
+<b>-a / --all-from-sources</b>
+\par
+Forces all the products to be installed from sources (including all
+SALOME modules). If this option is used, all default installation
+modes for all products are ignored.
+\n This option is helpful when the user wants to install SALOME on the
+platform which is not officially supported. In this case, the user can
+try to run the SALOME Installation Wizard with the \b -a option in order
+to build all the products from sources.
+\n<b>Note, that this is a time-consuming operation which can take
+more than 24 hours depending on the computer.</b>
+
+<b>-s / --single-directory</b>
+\par
+Install all SALOME binaries packages to one directory. <br><b>
+This option is ignored when --all-from-sources (-a) option is used.</b>
+
+<b>-h / --help</b>
+\par
+Prints help information on the Installation Wizard's use.
+
+<b>-v / --version</b>
+\par
+Prints version information (\b Note: this is the Installation Wizard's
+version number, not the number of SALOME platform version).
+
+The installation procedure supports different \em Linux platforms and
+installs various installation 3d-party prerequisite products which are
+required by SALOME platform. As it was mentioned above, the basic
+target platform for SALOME 3.0 and newer is <em>Linux Mandrake 10.1</em>.
+Use of configuration XML files gives a flexible way to modify the list
+of products to be installed by the Installation Wizard without
+changing the program source code. Just create your own XML
+configuration file and implement installation scripts for the
+prerequisite products you need and then use this XML file with the
+Installation Wizard. This can be done, for example, for some Linux
+platform which is not supported directly by the Installation
+Wizard. See \ref modifying_xml "Modifying XML configuration file" and
+\ref installation_scripts "Implementing installation scripts for the new products"
+sections for more information.
+
+<br>
+<hr>
+\anchor gui_mode_install
+<h2>GUI mode</h2>
+
+The <b>Installation Wizard</b> GUI has been developed using
+Trolltech's <b>Qt 3.0.5</b> toolkit. After launching the Installation
+Wizard in the GUI mode the wizard window is shown to the user. This
+wizard guides the user through several subsequent pages. To navigate
+between the pages use \em "Next" and \em "Back" buttons in the lower
+part of the wizard window. The \em "Cancel" button closes the wizard
+window and quits the installation procedure after the user's
+confirmation. The \em "Help" button opens an additional window to show
+help information.
+
+The first \em "Introduction" page is shown in \ref figure_1 "Figure 1". 
+Skip this page by clicking \em "Next":
+
+\anchor figure_1
+\image html intropage.png 
+\n <center><b>Figure 1:</b> "Introduction" page</center>
+
+In the second page you are proposed to select the type of the SALOME installation.<br><br>
+At this step three possible types of installation are available:
+
+1. <b><em>"Install binaries"</em></b> type:
+\par
+    - all binaries and sources of the chosen modules are installed;
+    - all binaries of the chosen prerequisites are installed.
+
+2. <b><em>"Install sources"</em></b> type:
+\par
+    - all sources of the chosen modules and prerequisites are installed without compilation.
+
+3. <b><em>"Install sources and make compilation"</em></b> type:
+\par
+    - all sources of the chosen modules and prerequisites are installed;<br>
+    - all sources are compiled.
+
+In case you select "Install sources and make compilation" installation type, then you can also check "Remove sources and temporary files after compilation" option.
+
+\anchor figure_2
+\image html installtypepage.png
+\n <center><b>Figure 1:</b> "Type Of Installation" page</center>
+
+After the installation type has been selected you click "Next" button and the Installation Wizard tries to determine the Linux platform to load the corresponding configuration file. If the user system is not defined or the current SALOME package does not support this one, the warning will appear (<em>"Install binaries"</em> and <em>"Install sources"</em> installation types only):
+
+\anchor figure_3
+\image html platformpage.png
+\n <center><b>Figure 3:</b> "Installation platform" page</center>
+
+If <em>"Install sources and make compilation"</em> installation type has been selected, the warning message will be slightly different: <em>"Your Linux platform is not supported by this SALOME package and compilation is not tested on this one".</em><br>
+There is a list of all platforms supported by SALOME, but only those supported by the current package are available for selection. in this page you need to to select the reference platform, if you wish to proceed with the present installation procedure.
+
+\b Note: this page is not displayed if the installation platform has been defined automatically.
+
+In the next page you are proposed to enter the target directory
+where the SALOME platform should be installed to. You can also click
+<em>"Browse..."</em> and choose the destination folder using the standard
+browse directory dialog box.
+\n If the necessary directory does not exist you
+are prompted to confirm directory creation. If you type a wrong
+directory path, or if you do not have write permissions 
+for the directory you use, the corresponding message box is shown.
+
+\b Note: you are strongly recommended to avoid using directory names containing spaces.</b> Otherwise you can experience some troubles with the installation.
+\n
+\anchor figure_4
+\image html directorypage.png
+\n <center><b>Figure 4:</b> "Installation directory" page</center>
+
+You can select the products to be installed in the "Choice of the products to be installed" page.
+\n In the default mode it gives you the possibility to view and select SALOME modules only. There is a hidden list of 3d-party prerequisite products. To show it, just click <em>"Show prerequisites..."</em> button.
+
+\anchor figure_5
+\image html productpage1.png
+\n <center><b>Figure 5:</b> Choice of the SALOME modules</center>
+
+In the full mode you also have the possibility to select prerequisites.
+\n The checkbox before each product indicates if this one will be installed or not (checked or unchecked). The second column shows the disk space occupied by the corresponding module. This value depends on the selected type of installation.
+\n To hide the prerequisites list - click <em>"Hide prerequisites"</em> button.
+
+\anchor figure_6
+\image html productpage2.png
+\n <center><b>Figure 6:</b> Choice of the prerequisites</center>
+
+Some products may require some other prerequisite products to be installed. So the installation procedure has a special feature to automatically mark these products in the list view. For example, to install PyQt it is necessary to have gcc, Python, Qt and Sip installed, and these products will be also turned on when you check on PyQt. GEOM module requires KERNEL, GUI modules and such prerequisites as: OpenCascade, Python, Swig, Qt, etc.
+\n
+\n The dependencies between SALOME modules are managed in the following way:
+\par
+- If one module is unchecked, all modules which depend on this one are also unchecked automatically;\n
+- If one module is checked, all modules required for this one are also checked automatically.
+
+Dependency between modules and prerequisites is realized in the following way:
+\par
+-  The choices made by the user in the list of modules have a direct impact on the list of prerequisites;
+- Whenever a module is checked, all the necessary prerequisites are checked automatically with no possibility for the user to uncheck them (see \ref figure_7 "Fig. 7" below);
+- Whenever a module is unchecked, according to the remaining checked modules, the unnecessary prerequisites are unchecked automatically (see \ref figure_7 "Fig. 7" below).
+
+It is possible to check again the prerequisites, which have been automatically unchecked. In other words, it is possible to add more prerequisites than necessary.
+
+\anchor figure_7
+\image html productpage3.png
+\n <center><b>Figure 7:</b> Dependencies between modules and prerequisites</center>
+
+The <em>"Installation with GUI"</em> checkbox allows managing the installation of the graphical interface. Only modules for that 'woguimode' attribute is set to "true" value in the XML file (see \ref modifying_xml "here" for more information about customizing this installation mode) support without GUI mode and will be checked and installed with their necessary prerequisites in case of installation without GUI. And other modules are unchecked with no possibility to check them in this mode (see \ref figure_8 "Figure below").
+\n By default 'Installation with GUI' checkbox is switched on.
+
+\anchor figure_8
+\image html productpage4.png
+\n <center><b>Figure 8:</b> Installation without GUI mode</center>
+
+The box at the right side of the page displays the information about
+currently selected product: name, version and short description,
+required disk space, disk space required for temporary files and the list of
+prerequisites (this information is provided in the XML file).
+
+The <em>"Disk space required:"</em> field displays how much disk space
+on the hard drive is required for installation of selected products.
+\n\b Note: Please, take into account that the displayed amount of
+required disk space is approximate and may differ when you actually install
+products on your hard drive.
+
+The installation procedure uses a special directory to store temporary
+files. The <em>"Space for temporary files:"</em> field shows the information
+about required disk space on the hard drive for extracting and
+compiling the selected products. You can change the temporary directory (this information is provided in the XML file) to the folder you want.
+\n\b Note: Actually, temporary files are not stored directly in the
+directory entered by the user. The Installation Wizard creates in this directory an additional folder named like INSTALLWORK<b>XXXXX</b> where XXXXX is a unique number. This allows launching several Installation Wizards simultaneously. This temporary directory is removed automatically when the installation finishes.
+
+The installation procedure also checks the available disk space. If there is not enough disk space on your hard drive you will see the corresponding error message box.
+
+Also in the current version of Installation Wizard is possible to install all binaries of the selected SALOME modules into a \b single directory. It is "SALOME" directory. For this purpose there is a checkbox "Install modules to a single directory" checkbox exists (see \ref figure_8 "Fig. 8").
+\n This feature helps to get shorter PYTHONPATH and LD_LIBRARY_PATH environment variables.
+\n\b Note: the installation into a single directory is available with the binaries installation type only.
+
+To proceed further click <em>"Next"</em>. At this moment the program will make some tests to check the installation settings: if there is enough disk space on the hard drive, check for the dependencies for each product you have selected to be installed. If any test fails you will see the corresponding warning message box. Otherwise the wizard will proceed to the next page:
+
+\anchor figure_9
+\image html choicepage.png
+\n <center><b>Figure 9:</b> "Check your choice" page</center>
+
+This page summarizes the installation options you've selected in the previous pages. You can review again your choices and change them if necessary returning to the previous pages.
+\n When you are sure that everything is OK, click <em>"Next"</em> to
+follow to the \ref figure_10 "progress page".
+
+\anchor figure_10
+\image html progresspage1.png
+\n <center><b>Figure 10:</b> "Installation progress" page</center>
+
+To start the installation of the selected products click <em>"Start"</em> button. It launches the shell installation script and you will be able to see the output of the script in the topmost frame of the dialog box. If any errors occur during the installation progress, the corresponding messages will be printed to the log window in the bold red font.
+\n It is possible to break the installation at any time by pressing <em>"Stop"</em> button. Then you can get back to the previous pages if you wish to change the installation settings or restart the installation by pressing <em>"Start"</em> button again.
+
+\b Note: in the current implementation it is not possible to resume the stopped installation process; the installation will restart from the very beginning.
+
+\anchor figure_11
+\image html progresspage2.png
+\n <center><b>Figure 11:</b> "Installation progress" page: installation in progress</center>
+
+The <em>"Installation Status"</em> frame window shows you the progress of
+installation. \c "Waiting" status means that installation of this product
+has not been started yet. The product currently being installed is
+marked as \c "Processing" and is displayed in the status bar under "Installation Status" view. All installed products have \c "Completed"
+status.
+
+You can abort installation and close the installation procedure using
+\em "Cancel" button.
+
+\b Note: This button sends the signal "SIGTERM" to the shell
+script. The script tries to clear all temporary files. The process of
+removing temporary files can take some time, so the installation
+wizard will wait 3 seconds before closing.
+
+At the end of the installation <b>"Installation completed"</b> message will appear in the status bar. You can return to the previous pages to start a new installation or click \em"Next" button to go to the readme page:
+
+\anchor figure_12
+\image html readmepage.png
+\n <center><b>Figure 12:</b> "Finish installation" page</center>
+
+In this page you can read important information about the Instalation
+Wizard itself and some tips: how to run and test SALOME or how to
+build SALOME from the sources. This is the contents of the README file
+which you can find in the root directory of the Installation Wizard.
+
+You can also launch SALOME Desktop from this page or read the Release
+Notes file by clicking on the corresponding buttons in the lower part
+of the page (see \ref modifying_xml "here" and \ref finish_buttons
+"here" for more information about customizing these buttons).
+
+<br>
+<hr>
+\anchor batch_mode_install
+<h2>Batch mode</h2>
+
+To launch the Installation Wizard in the batch mode use -\b b (--\b batch)
+parameter.
+\n In this mode the GUI wizard is not shown but all the installation
+status is displayed directly in the console. In the batch mode the
+user does not have a possibility to change installation settings which
+are given in the configuration file, except target and temporary
+directories which can be overridden by the corresponding command line
+options.
+\n The only exception is --\b all-from-sources (-\b a) option which enables
+special installation mode in which all the products (including SALOME
+modules) are installed from sources, ignoring the default mode defined
+in the XML configuration file (see \ref installing_products "here" for details) and <b>--single-directory (-s)</b> option which defines that all SALOME modules have to be installed into the one directory (SALOME_<version>, by default, where <version> is SALOME version).
+
+\anchor figure_13
+\image html batchmode.png
+\n <center><b>Figure 13:</b> Batch mode</center>
+
+<br>
+<hr>
+\anchor environment_files
+<h2>Environment files</h2>
+
+During the process of installation the script creates some environment
+files to simplify the procedure of launching SALOME. These shell
+scripts set all necessary environment variables for all products you
+have installed. To learn how installation scripts collects the
+environment, see \ref pick_up_env "here". These files are: \b
+salome.csh + \b salome.sh in the <b><em>KERNEL module sources</em></b>
+and <b><em>KERNEL module binaries</em></b> root directories and
+\b env_products.csh + \b env_products.sh and \b env_build.csh + 
+\b env_build.sh in the target installation directory.
+
+\b Note: there is some difference between these files: \b env_build.*
+files are optimized to be used for building SALOME modules from
+sources (see \b README file provided with the installation procedure
+on the CD). The \b env_products.* (and \b salome.*) files are
+optimized for SALOME launching. The behavior is defined by the
+environment variable \b ENV_FOR_LAUNCH which is set to \b 0 in
+env_build.* files and to \b 1 in env_products.* (salome.*) files.
+
+<br>
+<hr>
+\anchor pick_up_env
+<h2>Pick up the <em>environment</em></h2>
+
+Please, read carefully the following information. This section
+describes how the installation procedure generates the environment
+scripts for the SALOME platform being installed.
+
+After installing each product shell the script creates a special
+environment file for the product in its installation folder. The name
+of the file is generated from the name of product by the following
+scheme: \b env_<product_name>.sh (for example \b env_Vtk.sh for the
+Vtk). This file includes all necessary environment settings. At the
+final step of the installation the script picks up all the settings
+files and generates two common environment files from them: \b salome.sh
+and \b salome.csh for \b bash and \b csh shells correspondingly.
+Such approach helps to save time when reinstalling products and you may not bother about setting all environment variables manually to build/launch
+SALOME. What you simply need is to source one of these environment
+files.
+
+This also concerns those products which are not being installed. For
+example, you install some SALOME binaries to the directory where you
+have previously installed other products.  The Installation procedure
+tries to collect environment files from the target directory if it
+finds necessary products installed there. If some product is not found
+in the target directory the corresponding section of
+\b salome.sh/salome.csh files will be skipped.
+\n For native products (like \b gcc, \b tcl, etc...) the installation
+procedure tries to find them first using \b PATH / \b LD_LIBRARY_PATH
+variables and then in the system default directories (\b /usr/bin,
+\b /usr/lib etc., depending on the product).
+<br><br>
+In any case you may edit \b salome.* files after the installation
+procedure finishes, if you want.
+
+\n\b Note: As it was mentioned \ref environment_files "above" there are
+other environment files which are generated by the installation
+procedure: \b env_products.csh + \b env_products.sh and \b env_build.csh +
+\b env_build.sh. These files can be found in the target installation root
+directory.
+
+<br>
+<hr>
+\anchor modifying_xml
+<h2>Modifying <em>XML</em> configuration <em>file</em></h2>
+
+You can create your own XML configuration file. The Installation
+Wizard can then take it as a command line argument to provide a list
+of products you want to install with it. The list of products and some
+other settings for the Installation Wizard are provided in the XML
+file.
+\n This section describes the structure of the configuration file, optional sections/tags are in brackets.
+
+\code
+<document>
+      <config [ version=<application_version>      ]
+              [ caption=<application_caption>      ]
+              [ copyright=<application_copyright>  ]
+              [ license=<application_license_info> ]
+                platforms=<target_platform>
+              [ targetdir=<target_directory>       ]
+              [ tempdir=<temp_directory>           ]
+      />
+    [ <buttons>
+      [ <button   label=<button_label>     
+                [ tooltip=<button_tooltip> ]
+                  script=<button_script>   
+                [ disable=<disable_flag>   ]
+        />
+      ]
+      [ <button ...
+        />
+      ]
+        ...
+      </buttons>
+    ]
+    [ <products>
+      [ <product  name=<product_name>
+                  type=<product_type>
+                [ description=<product_description> ]
+          <installation  os=<installation_platform>
+                         version=<product_version>
+                       [ disable=<disable_flag>            ]
+                       [ woguimode=<without_gui_mode_flag> ]
+                         installdiskspace=<install_disk_space>
+                       [ pickupenv=<pickup_env_flag>       ] 
+                         script=<installation_script_name>
+          />
+          ...
+        />
+      ]
+      [ <product ...
+        />
+      ]
+        ...
+      </products>
+    ]
+    [ <dependencies>
+      [ <product  name=<product_name> >
+        [ <dep> <prerequisite_name> </dep> ]
+          ...
+        </product>
+      ]
+        ...
+      </dependencies>
+    ]
+</document> 
+\endcode
+
+<b>\<config\> section</b>
+\n\n This is an optional section; it provides general information about the Installation Wizard itself.<br><br>
+Attributes:
+<ul>
+<li><b>version</b>
+\n\n The application version number to be shown in the caption.<br><br>
+</li>
+<li><b>caption</b>
+\n\n The application main window caption - if this string contains '\%1' text the title will contain the version number in this place (see
+above).<br><br>
+</li>
+<li><b>copyright</b>
+\n\n The application copyright information (shown in the first page).<br><br>
+</li>
+<li><b>license</b>
+\n\n The application license information (shown in the first page).<br><br>
+</li>
+<li><b>platforms</b>
+\n\n This parameter defines the directory (relative from ./Products/BINARIES) where the Installation Wizard will search
+precompiled binaries packages. If this tag is not provided, binaries
+packages are looked for in the ./Products/BINARIES directory.<br><br>
+</li>
+<li><b>targetdir</b>
+\n\n The target directory - the path to the directory where products
+should be installed.<br><br>
+</li>
+<li><b>tempdir</b>
+\n\n The temporary directory - the path to the directory for the
+temporary files.<br><br>
+</li>
+</ul>
+
+<b>\<button\> section</b>
+\n\n This is an optional section. It allows customization of the last
+"Finish installation" page of the Installation Wizard by adding one or
+more buttons in the lower part of the wizard's window. The script
+which is attached to each such button, can perform some specific
+action, for example, launch the application or show the Release Notes
+file by using an external program. See \ref finish_buttons "here" for
+more details about writing scripts.<br><br>
+Attributes:
+<ul>
+<li><b>label</b>
+\n\n This is the button text.<br><br>
+</li>
+<li><b>tooltip</b>
+\n\n The button tooltip (optional).<br><br>
+</li>
+<li><b>script</b>
+\n\n The script attached to the button.<br><br>
+</li>
+<li><b>disable</b>
+\n\n If this optional flag has 'true' value, the corresponding button
+will not appear in the "<em>Finish installation</em>" page - the section of XML
+file is silently ignored.<br><br>
+</li>
+</ul>
+
+<b>\<product\> section</b>
+\n\n This section describes product to be installed with the
+Installation Wizard. The XML file should include a \<product\> section
+for each product to be installed. The products appear in the tree view
+and are installed in the order they are described in the configuration
+file. It is recommended (but not obligatory) to define native products
+at the top of the list before all other products.
+<br><br>
+Attributes:
+<ul>
+<li><b>name</b>
+\n\n Product name.<br><br>
+</li>
+<li><b>type</b>
+\n\n The type of the product: 'component' - SALOME module or 'prerequisite' - prerequisite product.<br><br>
+</li>
+<li><b>description</b>
+\n\n Product description (optional).<br><br>
+</li>
+</ul>
+
+<b>\<installation\> section</b>
+
+It is a part of the <product> section, that provides installation information by platforms. The <product> section may contains a several <installation> ones for the different platforms. 
+<br><br>
+Attributes:
+<ul>
+<li><b>os</b>
+\n\n A possible installation platform.<br><br>
+</li>
+<li><b>version</b>
+\n\n The version of the product.<br><br>
+</li>
+<li><b>disable</b>
+\n\n If this optional flag has 'true' value, the corresponding product will not appear in the list of products and will not be installed.<br><br>
+</li>
+<li><b>woguimode</b>
+\n\n This optional flag defines that it's possible to install this module without GUI.<br><br>
+</li>
+<li><b>installdiskspace</b>
+\n\n List of three total amount spaces (integer, in Kbytes, derived by comma), which product occupies on the hard drive after the installation in case 'binary', 'sources' and 'sources and compile' installation type.<br><br>
+</li>
+<li><b>pickenv</b>
+\n\n This flag shows that the pickup environment procedure should be performed for this product. If this flag equal to 'true',  salome.sh and salome.csh files will  be created in the product's installation directory. Usually this option is set to true for SALOME KERNEL module. This is optional key, default value is 'false'.<br><br>
+</li>
+<li><b>script</b>
+\n\n The installation script name. This script is in charge of the installation of the product. It is called automatically by the Installation Wizard when necessary from the main program. See the see 
+\ref installation_scripts "next section" for more information.<br><br>
+</li>
+</ul>
+
+\n\b Note: If you add new products to be installed with Installation
+Wizard, you should also provide installation script for this
+product. See the next section for more details.
+
+<br>
+<hr>
+\anchor installation_scripts
+<h2>Implementing <em>installation scripts</em> for the new products</h2>
+
+When you want some product to be installed with the Installation
+Wizard, you should add its description \ref modifying_xml "to the configuration file"
+and create the installation script, following the rules described in this section.
+
+There are some obligatory functions which should be implemented in
+this installation script. These functions are automatically called by
+the master installation script or/and its GUI shell when it is
+necessary. \n File \b common.sh contains some service functions which can
+be used in your installation script, like \b make_env(), \b make_dir(),
+\b try_existing(), \b sort_path(), \b find_in_path(), etc.
+
+<ul>
+<li><b>check_version()</b>
+\n\n This function allows to check the version of the product already
+installed on the computer. It should try to find the product (native
+or preinstalled in the target directory) and check its version. This
+helps to avoid unnecessary reinstallation. This is an internal
+function and is not called from the master installation
+script.<br><br>
+</li>
+<li><b>install_binary()</b>
+\n\n This function is called when <em>'Install binaries'</em> installation mode is selected by the user. The function is responsible for the extracting of the product from the binaries package. It should create environment for the product in the temporary directory (see also the description of \b print_env() function). It is not necessary to implement this function if you do not provide binaries mode installation for the current product.<br><br>
+</li>
+<li><b>install_source()</b>
+This function is called to install SALOME modules sources, if <em>'Install binaries'</em> installation mode is selected by the user, and to install prerequisite products sources, in <em>'Install sources'</em> case (\ref Figure_2 "Fig. 2" above). The function is responsible for the building of the product from the sources package. It should create the environment file for the product in the temporary directory (see also the description of print_env() function). It is not necessary to implement this function if you do not provide a sources mode installation for the current product. <br><br>
+</li>
+<li><b>install_source_and_build()</b>
+This function is called when <em>'Install sources and make a compilation'</em> installation mode is selected. This function should be used to unpack SALOME or prerequisite sources package and then call build/install procedure for it.
+For more details please refer to the \ref installing_products "this"
+and \ref gui_mode_install "this" sections for more details.<br><br>
+</li>
+<li><b>try_preinstalled()</b>
+\n\n This function is called when the 'not install' installation mode
+is selected by the user. In this case the script should inspect the
+target directory to try to find an already preinstalled product, pick
+up and check the environment from there. See \ref pick_up_env "here" for more
+details.<br><br>
+</li>
+<li><b>print_env_bin() & print_env_src()</b>
+\n\n These functions are in charge of the creation of the environment scripts. They should create in the temporary directory two files with \b env_<product_name>.sh and \b env_<product_name>_src.sh names and then copy them into the binary and sources product installation directories correspondingly. The file should contain all necessary environment variable settings for the product. It will be collected during the 'pick-up-environment' procedure.<br><br>
+</li>
+<li><b>pickup_env()</b>
+\n\n This procedure corresponds to the \b pickupenv tag of the
+configuration xml file (see previous section). It should call the
+\b make_env procedure to perform the pick-up environment procedure for
+the product.<br><br>
+</li>
+</ul>
+
+The calling signature of the product installation script is the following: 
+<b>\<product_script_name\> \<function_name\> \<temp_folder\>
+\<products_directory\> \<target_directory\> \<dependancies\>
+\<product_name\></b>
+\n\n where \n\n
+<b>\<product_script_name\></b> - installation script name (described in the
+configuration xml file);\n
+<b>\<function_name\></b> - the name of function, corresponding to the selected
+installation mode: \em try_native, \em install_source, \em install_binary or
+\em try_preinstalled;\n
+<b>\<temp_folder\></b> - temporary files directory;\n
+<b>\<products_directory\></b> - directory where the sources/binaries package
+can be found. You should provide the sources package in the
+<em>\<Install_Wizard_root_directory\>/Products/SOURCES</em> directory and
+binaries package in the
+<em>\<InstallWizard_root_directory\>/Products/BINARIES/\<os_version\></em>, where
+\<os_version\> is the target platform description, which appears in the
+corresponding section of the \ref modifying_xml "configuration xml file";
+<em>\<target_directory\></em> - root target directory where the product should be installed to; 
+<em>\<dependancies\></em> - single-quoted list of prerequisite products, separated by space; 
+<em>\<product_name\></em> - product name itself.
+
+\b Example:
+\n <em>med-2.2.3.sh install_binary /tmp/work
+./Products/BINARIES/Mandrake10.1 /usr/salome 'gcc Hdf' med</em>
+
+Copy the created script into the
+<em>\<Install_Wizard_root_directory\>/config_files</em> sub-directory where all
+installation scripts are stored. Installation Wizard will
+automatically search and call your script during the installation
+procedure.
+
+<br>
+<hr>
+\anchor finish_buttons
+<h2>Customizing <em>Readme page</em> buttons</h2>
+
+The Installation Wizard allows customizing the look-n-feel of the last
+<em>"Finish installation"</em> page. If you want to add one or more buttons to
+this page in order to perform some specific actions at the end of the
+installation (for example, to show the Release Notes file by using
+Open Office) you can put an additional section to the XML
+configuration file. This is the \b \<button\> section (see 
+\ref modifying_xml "here" for more details).
+
+To implement the action which will be performed when the user clicks
+the button, you need to create a script and put it to the
+<em>\<Install_Wizard_root_directory\>/config_files</em> directory.
+\n There are some obligatory functions which should be implemented in
+this script. These functions are automatically called by the
+Installation Wizard GUI.
+
+<ul>
+<li><b>check_enabled()</b>
+\n\n This procedure is called by the Installation Wizard when the
+<em>"Finish installation"</em> page is displayed and the status of the buttons
+should be modified according to the installation options. This
+procedure should return \b 0 if the corresponding action can be performed
+and, thus, the button should become enabled. Otherwise, it should
+return \b 1 - in this case the corresponding button will be
+disabled.<br><br>
+</li>
+<li><b>execute()</b>
+\n\n This procedure is invoked when the user clicks the button. This
+procedure should return \b 0 if the corresponding action is done
+successfully and \b 1 if any error occurs.<br><br>
+</li>
+</ul>
+
+The calling signature of the script is the following:
+\n <b>\<product_script_name\> \<function_name\> \<target_directory\>
+\<temp_folder\></b>
+\n\n where \n\n
+\b \<product_script_name\> - the script name itself (retrieved from the XML configuration xml file); 
+\n \b \<function_name\> - the name of function; 
+\n \b \<target_directory\> - root target directory where the product is installed to; 
+\n \b \<temp_folder\> - temporary files directory;
+
+\n\b Note: The standard Installation Wizard buttons "Launch SALOME" and
+"Release Notes" are implemented with this feature. Refer to scripts
+\b start_salome.sh and \b release_notes.sh for sample implementation.
+
+\n\b Note: Any button (even standard) can be ignored by the Installation
+Wizard if the attribute \b \<disable\> in the XML configuration file is set
+to the "true" value.
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/introduction_to_gui.doc b/doc/salome/gui/input/introduction_to_gui.doc
new file mode 100644 (file)
index 0000000..ddbccb0
--- /dev/null
@@ -0,0 +1,67 @@
+/*!
+
+\page introduction_to_gui_page Introduction to GUI
+
+\image html view2.png
+
+\n SALOME GUI is based on SUIT (Salome User Interface
+Toolkit) that proposes very flexible, powerful and safe mechanisms of
+interaction with SALOME tool components (both CORBA and standalone),
+resource management, viewers and selection handling,
+exception and signals processing. This approach brings to the top
+Salome multi-desktop dockable-windowed user interface.
+\n All Graphical User Interfaces of standard modules have plug-in
+structure, i.e. each module is placed in a dynamic library which is
+loaded on demand. So, all modules add their own menu items, buttons
+in toolbar, windows etc.
+\b GUI (Graphical User Interface) provides a common shell for all
+components, which can be integrated into the SALOME platform and some
+basic GUI functionalities, common for all modules.
+
+\image html mainmenu.png
+
+<ul>
+<li>\b File menu corresponds to \subpage study_management_page "Study management" functionalities
+(creation, saving, loading, editing studies, etc.).</li>
+<li>\b Edit menu gives access to <b> Copy/Paste</b> allowing to paste the
+objects from one study into the other. The availability of this
+functionality depends on the module and the nature of an operation or
+an object.</li>
+<li>\b View and \b Window menus provide functionalities of 
+\subpage salome_desktop_page "Desktop management". Basically, they
+allow to show/hide toolbars, activate and manage study windows, change
+the appearance of Salome, etc. Among key parts of study window are: 
+
+<ul>
+<li>Viewer window, used for visualization of objects,</li>
+<li>\subpage using_object_browser_page "Object Browser", used for
+management of objects created or imported into the SALOME
+application, also providing search possibilities with the 
+\subpage using_find_tool_page "Find Tool", and </li>
+<li>\subpage python_interpreter_page "Python interpreter", used for
+direct input of python commands and dumping studies into Python
+scripts. </li> 
+<li> Almost all aspects of Salome look and feel can be tuned by the
+user in \subpage themes_page "Themes" dialog. </li>
+</ul>
+</li>
+
+<li>\b Tools menu gives access to: \subpage using_catalog_generator_page "Catalogue Generator", and 
+\subpage using_registry_tool_page "Registry tool"</li>
+<li>\b Help menu gives access to the help on Salome modules. The
+appropriate help page can also be called from any operation dialog via
+\b Help button.</li>
+</ul>
+
+Help for the GUI module provides information about standard
+\subpage viewers_page "Salome Viewers":
+<ul>
+<li>\ref occ_3d_viewer_page "OCC 3D viewer", </li>
+<li>\ref vtk_3d_viewer_page "VTK 3D viewer" and </li>
+<li>\ref plot2d_viewer_page "Plot 2D viewer". </li>
+</ul>
+
+\subpage setting_preferences_page "Preferences" for all Salome modules
+are also described in this section of Salome GUI Help.
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/mesh_preferences.doc b/doc/salome/gui/input/mesh_preferences.doc
new file mode 100644 (file)
index 0000000..b9c68e8
--- /dev/null
@@ -0,0 +1,139 @@
+/*!
+
+\page mesh_preferences_page Mesh preferences
+
+In the Mesh module you can set mesh preferences, which can be used in
+later sessions with this module.
+
+<h2>General Preferences</h2>
+
+\image html pref21.png
+
+<ul>
+<li><b>Update</b></li>
+<ul>
+<li>If you toggle <b>Automatic Update</b> checkbox, the model in your
+viewer automatically updated whenever you make changes in it.</li>
+</ul>
+<li><b>Quality Controls</b></li>
+<ul>
+<li>If you toggle <b>Display entity</b>, both faces and edges of an
+object will be displayed in the viewer by default.</li>
+<li>If you toggle <b>Use precision</b> checkbox, you can display numbers in
+<b>Quality Control</b> diagrams at the necessary level of precision.</li>
+</ul>
+<li><b>Precision</b> - can be defined by the <b>Number of digits after point</b> in
+the corresponding field. By default, numbers in <b>Quality Control</b>
+diagrams are presented as integers.</li>
+<li><b>Display mode</b> - allows to set Wireframe, Shading, Nodes or Shrink
+presentation mode as default.</li>
+<li><b>Mesh export</b></li>
+<ul>
+<li>If you toggle <b>Automatically create groups for MED export</b> checkbox,
+this operation will be carried out automatically.</li>
+<li>If you toggle <b>Automatic renumbering</b> checkbox, the exported
+mesh will be renumbered automatically</li>
+</ul>
+<li><b>Mesh computation</b></li>
+<ul>
+<li><b>Show a computation result notification</b> combobox allows to
+select the notification mode about a mesh computation result.
+There are 3 possible modes:</li>
+<ul>
+<li><b>Never</b> - do not show the result dialog at all;</li>
+<li><b>Errors only</b> - the result dialog will be shown if there were
+some errors during a mesh computation;</li>
+<li><b>Always</b> - show the result dialog after each mesh
+computation. This is a default mode.</li>
+</ul>
+</ul>
+
+<h2>Mesh Preferences</h2>
+
+\image html pref22.png
+
+<ul>
+<li><b>Nodes</b></li>
+<ul>
+<li><b>Color</b> -  allows to select the color of nodes. Click on the
+colored line to access to the \ref select_color_and_font_page "Select Color" 
+dialog box.</li>
+<li><b>Size</b> - allows to define the size of nodes.</li>
+</ul>
+<li><b>Elements</b></li>
+<ul>
+<li><b>Fill</b>  - allows to select the color of surface of elements
+(seen in Shading mode). Click on the colored line to access to the
+\ref select_color_and_font_page "Select Color" dialog box.</li>
+<li><b>Outline</b> - allows to select the color of borders of
+elements. Click on the colored line to access to the 
+\ref select_color_and_font_page "Select Color" dialog box.</li>
+<li><b>Back Face</b> - allows to select the color of interior surface
+of elements. Click on the colored line to access to the 
+\ref select_color_and_font_page "Select Color" dialog box.</li>
+<li><b>Width</b> - allows to define the width of lines (edges and borders of elements).</li>
+<li><b>Shrink coef.</b> - allows to define relative space of elements
+compared to gaps between them in shrink mode.</li>
+</ul>
+<li><b>Orientation of Faces</b> - allows to define the behavior of
+<b>Orientation of faces</b> functionality</li>
+<ul>
+<li> \b Color - allows to define the color of orientation vertors;</li>
+<li> \b Scale - allows to define the size of orientation vectors;</li> 
+<li> <b> 3D Vector </b> checkbox allows to choose between 2D planar
+and 3D vectors.</li>
+</ul>
+</ul>
+
+<br><h2>Selection Preferences</h2>
+
+\image html pref23.png
+
+<ul>
+<li><b>Selection</b> - performed with mouse-indexing (preselection)
+and left-clicking on an object, whose appearance changes as defined in
+the <b>Preferences</b>.</li>
+<ul>
+<li><b>Object Color</b> -  allows to select the color of mesh (edges and
+borders of meshes) of the selected entity. Click on the colored line
+to access to the \ref select_color_and_font_page "Select Color" dialog
+box.</li>
+<li><b>Element color</b> - allows to select the color of surface of selected
+elements (seen in Shading mode). Click on the colored line to access
+to the \ref select_color_and_font_page "Select Color" dialog box.</li>
+<li><b>Width</b> - allows to define the width of selected edges. </li>
+</ul>
+<li><b>Preselection</b> - performed with mouse-indexing on an object,
+whose appearance changes as defined in the <b>Preferences</b>.</li>
+<ul>
+<li><b>Highlight Color</b> -  allows to select the color of mesh (edges and
+borders of meshes) of the entity . Click on the colored line to access
+to the \ref select_color_and_font_page "Select Color" dialog box.</li>
+<li><b>Width</b> - allows to define the width of preselected edges.</li>
+</ul>
+<li><b>Precision</b> - in this menu you can set the value of precision
+used for <b>Nodes</b>, <b>Elements</b> and <b>Objects</b>.</li>
+</ul>
+
+<br><h2>Scalar Bar Preferences</h2>
+
+\image html pref24.png
+
+<ul>
+<li><b>Font</b> - in this menu you can set type, face and color for
+the font of <b>Title</b> and <b>Labels</b>.</li>
+<li><b>Colors & Labels</b> - in this menu you can set the <b>number of
+colors</b> and the <b>number of labels</b> in use.</li>
+<li><b>Orientation</b> - here you can choose between vertical and
+horizontal orientation of the <b>Scalar Bar</b></li>.
+<li><b>Origin & Size Vertical & Horizontal</b> - allows to define
+placement (<b>X</b> and <b>Y</b>) and lookout (<b>Width</b> and
+<b>Height</b>) of Scalar Bars</li>
+<ul>
+<li><b>X</b>: abscissa of the point of origin (from the left
+side)</li>
+<li><b>Y</b>: ordinate of the origin of the bar (from the bottom)</li>
+</ul>
+</ul>
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/occ_3d_viewer.doc b/doc/salome/gui/input/occ_3d_viewer.doc
new file mode 100644 (file)
index 0000000..ce1ec2d
--- /dev/null
@@ -0,0 +1,131 @@
+/*!
+
+\page occ_3d_viewer_page OCC 3D Viewer
+
+The functionalities of OCC viewer are available via its Viewer
+Toolbar. Buttons marked with small downward triangles have extended
+functionality which can be accessed by locking on them with left mouse
+button.
+
+\image html occviewer_toolbar.png "Viewer Toolbar"
+
+<hr>
+\image html image77.png
+\n <center><b>Dump View</b> - exports an object from the viewer in bmp, png, jpg
+or jpeg image format.</center>
+<hr>
+
+\image html image88.gif
+\n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
+<hr>
+
+\image html image96.png
+\n <center><b>Fit all</b> - allows to select a point to be the center of a
+scene representing all displayed objects in the visible area.</center>
+<hr>
+
+\image html image97.png
+\n <center><b>Fit area</b> - resizes the view to place in the visible area
+only the contents of a frame drawn with pressed left mouse button.</center>
+<hr>
+
+\image html image98.png
+\n <center><b>Zoom</b> - allows to zoom in and out.</center>
+<hr>
+
+\image html image99.gif
+\n <center><b>Panning</b> - if the represented objects are greater that the
+visible area and you don't wish to use <b>Fit all</b> functionality, click on
+this button and you'll be able to drag the scene to see its remote
+parts.</center>
+<hr>
+
+\image html image100.png
+\n <center><b>Global panning</b> - represents all displayed objects in
+the visible area.</center>
+<hr>
+
+\image html view_rotation_point.png
+\n <center><b>Change rotation point</b> - allows to to choose the point around
+which the rotation is performed.</center>
+
+\image html set_rotation_point_dialog1.png
+
+<center>By default the rotation point is located in the Center of the bounding
+box of an object.</center>
+
+\image html set_rotation_point_dialog2.png
+
+<center>Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
+define the coordinates of the rotation point manually.</center>
+
+<b>Set to Origin</b> button restores the default rotation point
+coordinates.\n
+<b>Select Point from View</b> button allows to select the rotation
+point in the 3D Viewer.
+<hr>
+
+\image html image89.png
+\n <center><b>Rotation</b> - allows to rotate the selected object using the
+mouse.</center>
+
+\image html image102.gif
+
+<center>These buttons orientate the scene strictly about coordinate axes.</center>
+<hr>
+
+\image html image91.png
+\n <center><b>Reset</b> - restores the default position (isometric) of
+objects in the scene.</center>
+<hr>
+
+\image html image103.png
+\n <center><b>Memorise view</b> - saves the current position of
+objects in the scene.</center>
+<hr>
+
+\image html image105.gif
+\n <center><b>Restore view</b> - restores the saved position of
+objects in the scene.</center>
+<hr>
+
+\image html image86.png
+\n <center><b>Clone view</b> - opens a new duplicate scene.</center>
+<hr>
+
+\image html image106.png
+\n <center><b>Clipping</b> - allows to create cross-section views
+(clipping planes) of geometrical objects.</center>
+
+\image html clipping.png
+<ul>
+<li><b>Base point</b> - allows to define the coordinates of the base
+point for the clipping plane.</li>
+<ul>
+<li><b>Reset</b> - returns the base point to coordinate origin.</li>
+</ul>
+<li><b>Direction</b> - allows to define the orientation of the
+clipping plane.</li>
+<ul>
+<li><b>Invert</b> - allows to select which part of the object will be removed
+and which will remain after clipping.</li>
+</ul>
+<li><b>Preview</b> - allows to see the results of clipping in the
+viewer.</li>
+</ul>
+<hr>
+\image html occviewer_axialscale.png
+\n <center><b>Scaling</b> - represents objects deformed (stretched or
+stuffed) along the axes of coordinates.</center>
+
+<b>Note!</b> OCC Viewer features a special <b>Polyline Selection</b> mechanism, which allows selecting an arbitraty part of the graphic area using a polygon frame, instead of the usual selection with a rectangular frame.
+
+To produce a Polyline Selection, lock the right mouse button and draw the first side of the polygon, then change the direction by clicking  the left mouse button add draw another side, etc. The whole selection frame is drawn with the locked right mouse button. 
+   
+\image html polyselection1.png
+
+As a result, only the nodes within the frame are selected.
+
+\image html polyselection2.png
+
+*/
diff --git a/doc/salome/gui/input/plot2d_viewer.doc b/doc/salome/gui/input/plot2d_viewer.doc
new file mode 100644 (file)
index 0000000..d5a53bf
--- /dev/null
@@ -0,0 +1,92 @@
+/*!
+
+\page plot2d_viewer_page Plot 2D viewer
+
+\n <b>Plot 2d viewer</b> toolbar gives fast access to the following
+operations:
+
+\image html image77.png
+<center><b>Dump View</b> - exports an object from the viewer in bmp,
+png, jpg or jpeg image format.</center>
+
+\image html image96.png
+<center><b>Fit all</b> - scales the display to show the entire
+scene. Use this to resize the scene so that it could fit within the
+Viewer boundary.</center>
+
+\image html image97.png
+<center><b>Fit area</b> - resizes the view to place in the visible
+area only the contents of a frame drawn with pressed left mouse
+button.</center>
+
+\image html image98.png
+<center><b>Zoom</b> - allows to zoom in and out.</center>
+
+\image html image99.png
+<center>\b Panning - if the represented objects are greater that the
+visible area and you don't wish to use Fit all functionality, click on
+this button and you'll be able to drag the scene to see its remote
+parts.</center>
+
+\image html image100.png
+<center><b>Global panning</b> - allows to define the center of the
+scene presenting all displayed objects in the visible area.</center>
+
+\image html plot2d_points.png
+<center><b>Draw Points</b> - represents points on the graph.</center>
+
+\image html plot2d_lines.png
+<center><b>Draw Lines</b> - represents lines on the graph.</center>
+
+\image html plot2d_splines.png
+<center><b>Draw Splines</b> - represents splines on the graph.</center>
+
+\image html plot2d_logarithmic_horizontal.png
+<center><b>Horizontal axis logarithmic</b> - changes the scaling on
+horizontal axis to logarithmic.</center>
+
+\image html plot2d_logarithmic_vertical.png
+<center><b>Vertical axis logarithmic</b> - changes the scaling on vertical
+axis to logarithmic.</center>
+
+\image html plot2d_legend.png
+<center><b>Show Legend</b> - reveals all verbal and numerical
+information on the graphs.</center>
+
+\image html plot2d_settings.png
+<center>\b Settings - calls a menu, in which you can specify advanced
+settings for your Plot 2d Viewer.</center>
+
+\image html plot2d_clone.png
+<center><b>Clone view</b> - opens a new duplicate scene.</center>
+
+\anchor settings
+\n \image html plot2d_view_settings.png
+
+The options are as follows:
+<ul>
+<li><b>Main title:</b> the title of the XY plot. By default, it will
+consist of the names of the tables, on the basis of which the curve
+lines have been constructed.</li>
+<li><b>Curve type:</b> you can select from \b Points, \b Lines and \b Spline.</li>
+<li><b>Show legend:</b> here you can define the position of the
+description table on the XY plot (to the \b Left, to the \b Right, on
+\b Top or on \b Bottom).</li>
+<li><b>Marker size</b> - size of the points (markers) forming curve lines.</li>
+<li><b>Background color</b> of the XY plot.</li>
+<li><b>Scale mode:</b> here you can select the type of scaling (\b
+Linear or \b Logarithmic) along <b>X (Horizontal)</b> or <b>Y (Vertical)</b> axes.</li>
+</ul>
+
+You can define settings for each axis separately:
+<ul>
+<li>\b Horizontal or \b Vertical axis title.</li>
+<li><b>Grid/Axes marks:</b>  here you can define the maximum number of major
+and minor scale divisions for a specified axis. The real number of
+intervals fits to {1,2,5}*10^N, where N is a natural number, and
+doesn't exceed the maximum.</li>
+<li><b>Save settings as default:</b> If this check box is marked, all
+XY plots will be displayed with these defined properties.</li>
+</ul>
+
+*/
diff --git a/doc/salome/gui/input/postpro_preferences.doc b/doc/salome/gui/input/postpro_preferences.doc
new file mode 100644 (file)
index 0000000..0f4c195
--- /dev/null
@@ -0,0 +1,323 @@
+/*!
+
+\page postpro_preferences_page Post-Pro Preferences
+
+In the Post-Pro module you can set preferences, default settings,
+which can be used in later sessions with this module.
+
+<h2>MED import Preferences</h2>
+
+\image html ppref1.png
+
+<ul>
+<li><b>MED files import</b></li>
+<ul>
+<li><b>Use Build Progress</b> - when this option is checked you can choose
+all other import MED options at the moment of loading of each file
+using <b>Build Progress</b> menu, otherwise the loading will be done
+according to the <b>Preferences</b> without addressing to the
+user.</li>
+<li><b>Full MED Loading</b> - when this option is checked, the MED file is
+fully loaded in the study, and no additional access to the MED file is
+needed during the session. Reversibly, when unchecked, the MED file is
+loaded on demand. This is the default behaviour in SALOME and
+recommended for big files to optimize memory usage.</li>
+<li><b>Build at once</b> - when this option is checked, you can't
+perform any operations until the MED file is fully loaded and
+processed.</li>
+<li><b>Build fields</b> - when this option is checked, the fields are
+built automatically at loading.</li>
+<li><b>Build min/max</b> - when this option is checked, minimum and
+maximum values of the time stamps are found at loading.</li>
+<li><b>Build groups</b> - when this option is checked, the groups and
+families are built automatically at loading.</li>
+<li><b>Close dialog at finish</b> - when this option is checked, the
+dialog box is closed after loading of the selected MED file. When
+unchecked, it allows loading other MED files.</li>
+</ul>
+</ul>
+
+<br><h2>Scalar Bar Preferences</h2>
+
+\image html pref31.png
+
+<ul>
+<li><b>Scalar Range</b></li>
+<ul>
+<li><b>Scalar Mode</b> - this feature allows refining the value to be
+inspected:</li>
+<ul>
+<li><b>Modulus:</b> value of a scalar or modulus of a vector.</li>
+<li><b>Component N:</b> Nth component of a vector, a tensor or a matrix.</li>
+</ul>
+<li><b>Logarithmic Scaling</b> - this checkbox toggles logarithmic
+scaling.</li>
+<li><b>Ranges to Use</b> - you can use either Field Range or Imposed Range.</li>
+</ul>
+<li><b>Min and Max for Imposed Range</b> - in this menu  you can set
+the limits for your Imposed Range, if you have chosen to use it.</li>
+<li><b>Font</b> - in this menu you can set type, face and color for
+the font of <b>Title</b> and <b>Labels</b>.</li>
+<li><b>Colors & Labels</b> - in this menu you can set the <b>number of
+colors</b> and the <b>number of labels</b> in the Scalar bar.</li>
+<li><b>Orientation</b> - here you can choose between vertical and horizontal
+orientation of the Scalar Bar.</li>
+<li><b>Origin & Size Vertical & Horizontal</b> - allows to define
+placement (<b>X</b> and <b>Y</b>) and lookout (<b>Width</b> and
+<b>Height</b>) of Scalar Bars.</li>
+<ul>
+<li><b>X:</b> abscissa of the point of origin (from the left
+side)</li>
+<li><b>Y:</b> ordinate of the origin of the bar (from the bottom)</li>
+</ul>
+<li><b>Scalar bars default position</b></li>
+<ul>
+<li><b>Arrange Scalar Bars</b> - this option prevents superposition of
+scalar bars during visualisation of several fields in the same
+window. If checked, a separate scalar bar is displayed for each
+presentation.</li>
+</ul>
+</ul>
+
+<br><h2>Cut Lines Preferences</h2>
+
+\image html ppref2.png
+
+<ul>
+<li><b>CutLine Preferences</b></li>
+<ul>
+<li><b>Show preview</b> check box allows to edit the parameters of the
+presentation and simultaneously observe the preview of this
+presentation in the viewer.</li>
+<li><b>Invert all curves</b> check box allows to invert the resulting
+curves.</li>
+<li><b>Use absolute length</b> check box allows to use absolute length
+for curves.</li>
+<li><b>Generate Data Table:</b> If this check box is marked, <b>Post
+Pro</b> will automatically generate a data table on the basis of your
+Cut Lines presentation. This table will be created in the structure of
+the study.</li>
+<li><b>Generate Curves:</b> If this check box is marked, <b>Post Pro</b>  will
+automatically generate curve lines on the basis of values taken from
+the generated data table. These curves will be created in the
+structure of the study and can be visualized in a XY plot.</li>
+</ul>
+</ul>
+
+<br><h2>Sweep and Animation Preferences</h2>
+
+\image html ppref3.png
+
+
+<ul>
+<li><b>3D Cache</b> - allow to define the mode of usage
+and the size of the 3D Cache, which enables to save in RAM and quickly
+restore the states of field animation (\b Sliding functionality).</li>
+<ul>
+<li><b>Memory Mode</b> - allows to define the mode of usage
+of the 3D Cache: <b>Minimal</b> actually disables the Cache,
+<b>Limited</b> Cache size depends on the current system
+configuration.</li>
+<li><b>Memory Limit</b> - allows to define the maximum size of the 3D
+Cache</li> 
+</ul>
+
+<ul>
+<li><b>Animation preferences</b></li>
+<ul>
+<li><b>Speed</b> - allows to define the speed of the animation.</li>
+<li><b>Cycled animation</b> - allows to start a cycled animation of the presentation.</li>
+<li><b>Use proportional timing</b> - allows to render the animation with proportional periods of time between every frame (not depending on the time stamps).</li>
+<li><b>Clean memory at each frame</b> - this option allows to optimize the performance of the operation.</li>
+</ul>
+
+<li><b>Sweeping preferences</b></li>
+<ul>
+<li><b>Mode of the Sweeping</b> - allows to choose between Linear,
+Cosinusoidal and sinusoidal sweeping.</li>
+<li><b>Time step</b> - in this menu you can set the time of
+representation of one step.</li>
+<li><b>Number of cycles</b> - in this menu you can define the number
+of times this animation will be repeated.</li>
+<li><b>Number of steps</b> - in this menu you can define the number of
+steps, which will compose the whole animation.</li>
+<li><b>Parameter varies</b> - allows to choose the range for the
+parameter: from 0 to Pi or from Pi to -Pi.</li>  
+</ul>
+</ul>
+
+<br><h2>Representation Preferences</h2>
+
+\image html pref33.png
+
+<ul>
+<li><b>Representation properties</b> - these checkboxes allow to
+choose the default representation type for each field presentation.</li>
+<ul>
+<li><b>Use Shading</b> - when this option is checked, the objects will
+be displayed with shading.</li>
+<li><b>Display only on creation</b> - when this option is checked, all
+previously created presentations will be automatically removed from
+the viewer when a new presentation is created and displayed. You can
+restore the previously created presentations using the Object
+Browser.</li>
+</ul>
+</ul>
+
+<br><h2>Feature Edges</h2>
+
+\image html featureedgesprops.png
+
+These properties define which contours should be highlighted with
+<b>Feature Edges</b> functionality. 
+<ul>
+<li><b>Feature edges angle</b> - allows to define at which minimum
+angle between two faces a wire is considered an edge </li> 
+<li><b>Show feature edges</b> - allows to display feature edges.</li>
+<li><b>Show boundary edges</b> - allows to display boundary edges.</li>
+<li><b>Show manifold edges</b> - allows to display manifold edges. </li>
+<li><b>Show non-manifold edges</b> - allows to display non-manifold edges.</li>
+</ul>
+  
+
+<br><h2>Gauss Points Preferences</h2>
+
+\image html pref34.png
+
+<ul>
+<li><b>Primitive</b> - this menu allows user to choose the graphic
+primitive to use to present the results at Gauss points in the
+viewer.</li>
+<ul>
+<li><b>Primitive type</b> - provides choice between <b>Point
+sprites</b>, <b>Open GL points</b> and <b>Geometrical Spheres</b>.</li>
+<li><b>Maximum Size (Clamp)</b> - defines the maximum size of sprite
+points ranging from 1 to 512. By default the value is set to 256
+pixels.</li>
+<li><b>Main Texture</b> -  path to the <b>Main Texture</b> (16x16
+pixels) which defines the shape of the point sprite used for
+rendering.</li>
+<li><b>Alpha Channel Texture (16*16)</b> - path to the <b>Alpha
+Channel Texture</b> which defines the texture of the point
+sprite.</li>
+<li><b>Alpha Channel Threshold</b> - defines the level of transparency
+ranging from 0 to 1.</li>
+<li><b>Geometrical Sphere Resolution</b> - defines the number of faces
+of <b>Geometry Spheres</b>.</li>
+<li><b>Notify when number of faces exceeds</b> - limitation of the
+number of faces; the user will be warned if it exceeds the given
+value.</li>
+</ul>
+</ul>
+
+<ul>
+<li><b>Size</b> - in this menu you can define:</li>
+<ul>
+<li><b>Range value for min and max size</b> - these two parameters
+will be respectively multiplied by a reference length (average size of
+cells of the mesh) to define the range for minimum and maximum size of
+a point during rendering (at magnification = 100%). Default values
+are:</li>
+<ul>
+<li><b>Rainbow</b> scale: <b>min</b> = <b>10%</b>, <b>max</b> =
+<b>33%</b></li>
+<ul>
+<li>Min size is associated to the smallest real value (including
+negative values).</li>
+<li>Max size is associated to the largest real value.</li>
+</ul>
+<li><b>Bicolor</b> scale: <b>min</b> = <b>0</b> (not editable),
+<b>max</b> = <b>33%</b></li>
+<ul>
+<li>Null size is associated to the 0 scalar value.</li>
+<li>Max size is associated to the largest absolute value.</li>
+</ul>
+</ul>
+Both values are dynamically updated by the system according to the
+selected scalar bar. In the case of a Bicolor scale, the minimum value
+is set to 0 in the dialog and the control is disabled.
+<li><b>Magnification (%)</b> corresponds to the change of size of
+results at Gauss point primitives in 2D space. Acceptable values range
+from 0 to N; 100% means no magnification, 50% means half of its size,
+200% mean twice its size and so forth. By default this value is set to
+100%.</li>
+<li><b>+/- Ratio</b> corresponds to the number by which the
+magnification will be respectively multiplied or divided at edition,
+ranging from 0.01 to 10. By default this value is set to 2.</li>
+</ul>
+</ul>
+
+<ul>
+<li><b>Geometry</b></li>
+<ul>
+<li><b>Size of points (%)</b> defines a value that will be multiplied
+by a reference length (representative of the average size of cells of
+the mesh) to define the size of points during rendering (at
+magnification = 100%). Default values 10%.</li>
+<li><b>Color</b> -  allows to select the color of points used for
+presentations. Click on the colored line to access to the \ref
+select_color_and_font_page "Select Color" dialog box.</li>
+</ul>
+</ul>
+
+<ul>
+<li><b>Gauss Points Scalar Bar</b></li>
+<ul>
+<li><b>Active Bar</b> - this option allows to choose <b>Local</b> or
+<b>Global</b> Bar as active.</li>
+<li><b>Display Global Bar</b> - this option allows to visualize or to
+hide the Global Bar.</li>
+<li><b>Scalar Bar Mode</b> - this option allows to choose between
+<b>Bicolor</b> and <b>Rainbow</b> Scalar Bar Mode.</li>
+<li><b>Spacing</b> - allows to define Spacing from 0.01 to 1.</li>
+</ul>
+</ul>
+
+<ul>
+<b>Spacemouse</b>
+<ul>
+<li><b>Decrease Gauss Points Magnification </b> - divides the current
+magnification by magnification ratio. </li>
+<li><b>Increase Gauss Points Magnification </b> - multiplies the
+current magnification by magnification ratio. </li>
+</ulul>
+</ul>
+
+<br><br><b>Inside<b> and </b>Outside Cursor Preferences</b> allow to set
+<b>Primitives</b>, <b>Size</b> and <b>Magnification</b> for the
+respective zones.
+
+<br><h2>Picking Preferences</h2>
+
+\image html pref37.png
+
+<ul>
+<li><b>Cursor</b> - allows to adjust the Size of the cursor used for
+Picking (ranging from 0.1 to 1), the Height of the pyramids (ranging
+from 0 to 10) and the Selection cursor color.</li>
+<li><b>Tolerance</b> - defines at which distance of the cursor from
+the point it becomes selected (ranges from 0.001 to 10).</li>
+<li><b>Information window</b> - allows to define the
+<b>Transparency</b> (from 0% = opaque to 100% = transparent) and
+<b>Position</b> of the window, which can be:</li>
+<ul>
+<li><b>Centred below the point</b>, or</li>
+<li>located at <b>Top-left corner of the 3D view</b></li>
+</ul>
+<li><b>Movement of the Camera</b> can also be define by the user.</li>
+<ul>
+<li><b>Zoom at first selected point</b> - This value is used to define
+the focal distance at the first selected point (at the end of the
+movement of the camera). This value is a ratio that will be multiplied
+by the current zoom value.</li>
+<li><b>Number of steps between two positions</b> - defines the
+smoothness of camera movement at selection by the number of
+iterations. If set to 1 the camera is zoomed and centered at the point
+momentarily. Greater numbers mean very slow camera movement.</li>
+</ul>
+<li><b>Display parent mesh element</b> - allows to visualize or hide
+the patent mesh element of the selected gauss point.</li>
+</ul>
+</ul>
+
+*/
diff --git a/doc/salome/gui/input/running_salome.doc b/doc/salome/gui/input/running_salome.doc
new file mode 100644 (file)
index 0000000..630c5d2
--- /dev/null
@@ -0,0 +1,110 @@
+/*!
+
+\page running_salome_page Running SALOME
+
+<em>To launch SALOME:</em>
+<ol>
+<li>Install the SALOME package into a definite directory (ex. \b SALOME)
+on your hard disk. It is preferable if you use the special
+installation procedure allowing to install the  SALOME platform and
+all corresponding applications.</li>
+<li>The installation shell script will create a special file:
+<b>salome.csh</b> (CShell file) in your SALOME/KERNEL directory. This file
+contains all environment variables necessary for launching SALOME
+platform with other application products provided with SALOME
+installation package. You have a possibility to add one of them into
+your profile if you enter in the command console the following: <br><br>
+<tt>source salome.csh</tt>
+
+<b>Tip:</b> During the installation procedure you have a possibility to set your profile automatically.</li>
+
+<li> Launch SALOME platform, using the following Python script located
+in the <b>SALOME/KERNEL/bin/salome</b> directory:<br><br> 
+<ul>
+<li>\b runSalome.py [command line options]
+</ul>
+</li>
+</ol>
+
+\anchor batch_mode_run
+
+<table>
+<tr>
+<td><h2>Options</h2></td>
+<td><h2>Description</h2></td>
+</tr>
+<tr>
+<td>--\b help or -\b h</td>
+<td>print this help</td>
+</tr>
+<tr>
+<td>--\b gui or -\b g</td>
+<td>launch with GUI</td>
+</tr>
+<tr>
+<td> --\b terminal or -\b t</td>
+<td>launch without GUI in batch mode</td>
+</tr>
+<tr>
+<td>--\b logger or -\b l</td>
+<td>redirects log messages in the file <em>logger.log</em></td>
+</tr>
+<tr>
+<td>--\b file=<b>\<FILE\></b> or -\b f=<b>\<FILE\></b></td>
+<td>redirects  log messages in a custom file</td>
+</tr>
+<tr>
+<td>--\b xterm or -\b x</td>
+<td>the servers open an xterm window and log messages are displayed in this window</td>
+</tr>
+<tr>
+<td>--\b modules=\b module1,\b module2,... or -\b m=\b module1,\b module2,...</td>
+<td>list of SALOME modules which will be loaded into the module catalogue</td>
+</tr>
+<tr>
+<td>--\b embedded=<b>registry,study,moduleCatalog,cppContainer</b>,
+or -\b e=<b>registry,study,moduleCatalog,cppContainer</b></td>
+<td>embedded CORBA servers (default: registry,study,moduleCatalog,cppContainer)
+note that logger,pyContainer,supervContainer can't be embedded</td>
+</tr>
+<tr>
+<td>--\b standalone=<b>registry,study,moduleCatalog,cppContainer,pyContainer,supervContainer</b>, or
+-\b s=<b>registry,study,moduleCatalog,cppContainer,pyContainer,supervContainer</b></td>
+<td>standalone CORBA servers (default: pyContainer,supervContainer)</td>
+</tr>
+<tr>
+<td>--\b containers=<b>cpp,python,superv</b>
+or -\b c=<b>cpp,python,superv</b></td>
+<td>launch of cpp, python and supervision containers</td>
+</tr>
+<tr>
+<td>--\b portkill or -\b p</td>
+<td>kill SALOME launched with the current port</td>
+</tr>
+<tr>
+<td>--\b killall or -\b k</td>
+<td>kill SALOME</td>
+</tr>
+<tr>
+<td>--<b>interp</b>=<b>n</b> or -<b>i</b>=<b>n</b></td>
+<td>number of additional xterm to open, with session environment</td>
+</tr>
+<tr>
+<td>-\b z</td>
+<td>display splash screen</td>
+</tr>
+<tr>
+<td>-\b r</td>
+<td>disable centralized exception handling mechanism</td>
+</tr>
+</table>
+
+<b>Tip:</b> If the \b runSalome.py script is launched without prompting
+any options, they will be taken by default from the file <b>SalomeApp.xml
+(SALOME/GUI/share/salome/resources/SalomeApp.xml)</b>. If you are
+constantly launching SALOME with some specific options which are
+different from the defaults, you can edit this file according to your
+requirements. So the next time you run SALOME, you won't have to enter
+these numerous command console options.
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/salome_architecture.doc b/doc/salome/gui/input/salome_architecture.doc
new file mode 100644 (file)
index 0000000..d1f637b
--- /dev/null
@@ -0,0 +1,115 @@
+/*!
+
+\page salome_architecture_page SALOME architecture
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+\b SALOME architecture is based on \b CORBA technology using
+distributed system model of applications.
+\b SALOME combines several software components, which are built in such a way that it allows to
+integrate solvers and existing meshing algorithms along with the
+specification of physical properties for a given domain. The
+originality of this approach is that the various components must
+cooperate dynamically and be configurable.
+
+\image html image54.jpg
+
+<br>SALOME platform integrates a number of modules each having its own function:
+<ul>
+<li>\b KERNEL :  provides a common shell for all components, which can be integrated into the SALOME platform.
+<li>\b GUI : provides visual representation: basic widgets, viewers
+etc. Third party modules optionally can have GUI, but in any case they always connected with KERNEL.
+<li>\b Geometry :  facilitates construction and optimization of geometrical models using a wide range of  CAD functions. 
+<li>\b Mesh :  generates meshes on geometrical models previously created or imported by the Geometry component.
+<li>\b Post-Pro :  performs data visualization and post-processing.
+<li>\b MED :  allows to work with MED files.
+</ul>
+
+Salome architecture takes the concept of multitier client/server to its natural conclusion. The
+distributed system model exposes all functionality of the application
+as objects, each of which can use any of the services provided by
+other objects in the system, or even objects in other systems. The
+architecture can also blur the distinction between "client" and
+"server" because the client components can also create objects that
+behave in server-like roles. This architecture provides the ultimate
+in flexibility.
+
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+The distributed system architecture achieves its flexibility by
+encouraging (or enforcing) the definition of specific component
+interfaces. The interface of a component specifies to other components
+what services are offered by that component and how they are used. As
+long as the interface of a component remains constant, that
+component's implementation can change dramatically without affecting
+other components.
+
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+All software components (Post-Pro, Geometry, Mesh...) integrated into
+\b SALOME platform  implement predefined interfaces. Each component
+provides data for the \b SALOME study in a form of links (stored in
+the Study) to the specific data created and stored in the
+component. All components represent \b CORBA servers and it allows to
+run them on different host stations.
+
+\image html image67.gif
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+It is equally possible to create engine-independent modules. These
+modules may not use CORBA at all, and can have internal data structure
+which can be written in pure C++ (or python). Such modules are located
+inside SALOME GUI process and from the point of view of the end user
+have no difference with standard components. Such modules not using
+the standard tools of SALOME platform are defined on a special
+separated level named CAM. CAM component is the basis for new SALOME
+GUI and contains all basic functionality for working with modules
+(loading; saving, closing, customization of toolbar and menu).
+
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Another fundamental piece of the \b SALOME architecture is the use of
+the Interface Definition Language (IDL). IDL, which specifies
+interfaces between CORBA components, is instrumental in ensuring
+CORBA's language independence. Because interfaces described in IDL can
+be mapped to any programming language, CORBA applications and
+components are thus independent of the language(s) used to implement
+them.
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Additional information about CORBA technology
+is available at http://www.omg.org
+
+\note In \b SALOME there is a possibility to run
+definite components in the so-called \ref batch_mode_run "batch mode" without GUI provided
+by GUI component. In this case you can work with these components with
+the help of Python commands and scripts.
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+The architecture of this all-inclusive
+platform for numerical components  responds to the following
+objectives:
+<ol>
+<li>\b Flexibility :  the creation and modification of computation
+schemes must be easy. The developer must have easy access to all
+modeling parameters to create domain-specific tools adapted to new
+situations or to test new numerical algorithms. SALOME allows
+integration and implementation of numerical and physical components
+derived from existing code.</li>
+<li>\b Productivity :  the implementation of code is simple for the
+user and the reuse of components (within other environments for
+macro-components) is noticeably facilitated.</li>
+<li> \b Performance :\b  SALOME is able to more finely simulate
+phenomena that is more complex in scale and in physical coupling
+requirements. \b SALOME economically exploits the performance of used
+machines (massively parallel processors, PC clusters, etc).</li>
+<li> \b Expandability:  on the one hand, software technologies and
+physical architectures evolve rapidly compared to the development
+time, validation and use of a scientific application while on the
+other hand, the development of a database model adapted to the
+totality of exchanges between components can be achieved
+incrementally. \b SALOME  is able to easily follow these
+developments.</li>
+</ol>
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/salome_desktop.doc b/doc/salome/gui/input/salome_desktop.doc
new file mode 100644 (file)
index 0000000..5890eae
--- /dev/null
@@ -0,0 +1,109 @@
+/*!
+
+\page salome_desktop_page SALOME desktop
+
+<b>Multi-Desktop Approach</b> used in Salome means that there is a separate Desktop
+for each Study and all windows connected to one Study (viewers, dockable
+windows etc) are placed in one container. 
+This approach positively differs from the classic multi document interface 
+if many windows are used, i.e. when one document contains a lot of
+viewers, dialogs, etc. Each desktop also has its own menu and toolbar.
+
+The main SALOME Desktop consists of the following sections and
+toolbars:
+
+\image html geomview-alt.png
+
+
+<b>Basic parts of the SALOME Desktop:</b>
+<ul>
+<li><b>Main menu</b> - This is a set of context-sensitive menus, which will
+be updated according the functionality of the loaded component. In
+general,  these menus contain all functional options of SALOME
+platform.</li>
+<li><b>Standard Toolbar</b> - This toolbar contains icons allowing
+creating/saving studies, correcting mistakes, copying/pasting
+objects.</li>
+<li><b>Components Toolbar</b> - This toolbar is destined for uploading
+components in SALOME platform.</li>
+<li><b>Module Toolbar</b> - This toolbar contains icons specific to the
+loaded module.</li>
+<li><b>Viewer Toolbar</b> - This is a set of tools destined for visualization
+of the presentations in the viewer.</li>
+</ul>
+
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;All toolbars in the
+\b SALOME Platform are context-sensitive. Loading of a definite component
+(Geometry, Post-Pro, Mesh etc.) will automatically add some additional
+toolbars specific to this component. To display/hide a definite
+toolbar, in the main menu choose <b>View > Toolbars</b>, and from this
+submenu check or uncheck the toolbar, you would like to display/hide.
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;By default all
+toolbars are located on the top of the SALOME desktop. But you can
+relocate toolbars by dragging with the mouse and dropping it in any
+place of the window.
+
+<b>Parts of  the study window:</b>
+<ul>
+<li><b>Object Browser</b> - Management of objects created or imported into
+SALOME application.</li>
+<li>\b Viewer - This window is destined for visualization of
+presentations.</li>
+<li><b>Python console</b> - Window for Python interpreter. This window
+functions like a standard document: the pop-up menu invoked by
+right-click in this window gives access to
+<b>Copy/Paste/SelectAll/ClearAll</b> options.</li>
+</ul>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object Browser, Python
+Console, MenuBar, etc are, in fact, separate dockable windows.
+Dockable windows can be placed in special areas, on the borders of
+desktop like toolbars. You can change the size and the position of
+dockable windows, hide them or even place outside desktop. SALOME
+saves in the same file all positions and sizes of dockable windows. It
+means that the difference in settings of the same windows (for example
+Python console) is possible between different modules (the same window
+can have different size and position when other module is
+activated). Also each module can indicate which common windows are
+necessary for working, and only they will be displayed when this
+module is active.
+
+All parts of Salome desktop and study window can be managed through \b
+View menu.
+
+\image html viewmenu.png
+
+<ul>
+<li>\b Toolbars - allows to show and hide toolbars</li>
+<li>\b Windows - allows to show and hide dockable windows, such as
+Object Browser and Python Console</li>
+<li><b> Status Bar </b> allows showing and hiding the Status Bar.</li>
+<li>\ref themes_page "Theme" - allows to select and edit the style (colors and fonts) for
+Salome session.</li>
+</ul>
+
+If there are several viewer windows in your current study and
+you want to display more then one at the same time, you can use the
+functionalities provided by the \b Window menu.
+
+\image html windowmenu.png
+
+<ul>
+<li><b>New window </b> - allows to open a new instance of any
+viewer.</li> 
+<li><b>Close</b> - closes the currently active viewer window.</li> 
+<li><b>Close all</b> - closes all viewer windows.</li>
+<li><b>Group all</b> - arranges all created viewer windows on the same desktop</li>
+<li><b>Split Vertically</b> and <b>Split Horizontally</b> allows to split
+the representation area into two parts, in horizontal or vertical
+direction.</li>
+<li>List of all opened viewer windows provides fast access to
+them.</li>
+<li>\b Rename - allows to rename the currently selected viewer
+window. </li>
+
+
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/salome_preferences.doc b/doc/salome/gui/input/salome_preferences.doc
new file mode 100644 (file)
index 0000000..9673fa9
--- /dev/null
@@ -0,0 +1,207 @@
+/*!
+
+\page salome_preferences_page SALOME preferences
+
+To begin setting preferences for your study, select \b Preferences in the
+main menu, the following dialog box will appear:
+
+\image html pref11.png
+If you've just started your study and haven't yet loaded other
+modules, you'll be able to change only those settings, which refer to
+the whole GUI SALOME session. These settings will be valid for the
+whole study session.
+
+<h2>General Preferences</h2>
+
+<ul>
+<li><b>Study Properties</b></li>
+<ul>
+<li><b>MultiFile Save</b> - if checked in, your study will be saved in
+several HDF files (one basic HDF file which will store the main
+information about the saved study and several other files for the data created by each component
+used during the study session). Opening of this study
+requires that \b ALL saved files should be stored in the \b SAME directory.
+If you would like to copy your saved study in another directory or
+machine, you should copy all stored files. Otherwise, if you try to
+open this study, some data will be lost and it will lead to invalid
+functioning of the SALOME platform.</li>
+<li><b>ASCII Save</b> - if checked in, your study will be saved in
+ASCII format file (or files).</li>
+<li><b>Store positions of windows</b> -  if checked in, positions of windows
+will be saved in a special file at the end of the current session and
+then restored for a new session.</li>
+<li><b>Store/restore last GUI state</b> - if checked in, all GUI settings are
+saved with the rest of the data whenever you save the study. When the
+study is reopened, the GUI state is restored.</li>
+</ul>
+<li><b>External browser</b></li>
+<ul>
+<li>\b Application - this option allows you to set an external browser (IE,
+Netscape) which will be used for viewing SALOME reference manuals. By
+default, Mozilla is used. Press the &quot;<b>...</b>&quot; button(see
+the picture below) to browse for the application you need in the data
+tree of your computer.</li>
+<li>\b Parameters</li>
+</ul>
+<li><b>Python console properties</b> - here you can quickly set the
+parameters (style, size, face) of the font used in your Python
+console.</li>
+<li><b>Show MRU items</b> - allows to define the maximum \b Number of
+items in <b>Most Recently Used</b> list and the <b>Link type</b>: 
+<ul>
+<li>\b Long - shows the full path to the file. </li>
+<li>\b Short - shows the file name only. </li>
+<li>\b Auto - shows full paths to the files only if some files from
+different locations have the same name. </li>
+</ul>
+</li>  
+</ul>
+\par
+For detailed settings in \ref select_color_and_font_page "Select Font"
+dialog box press the &quot;<b>...</b>&quot; button(see the picture below).
+
+\image html image69.gif "&quot;...&quot; button"
+
+<br><h2>Viewers Preferences</h2>
+
+\image html pref12.png
+
+<ul>
+<li><b>OCC and VTK 3D Viewers</b></li>
+<ul>
+<li><b>Trihedron size</b> - this submenu allows to set the size of
+coordinate axes displayed in the viewer.</li>
+<li><b>Background Color</b> - this submenu allows to select background
+color. Click on the colored line to access to the 
+\ref select_color_and_font_page "Select Color" dialog box.</li>
+<li><b>Number of isolines along U</b> (or <b>V</b>) - this submenu allows to specify
+the number of isolines along the axes of coordinates.</li>
+<li><b>Relative size</b> - if checked in, trihedron axes scale to fit the
+size of the area displayed in 3D Viewer.</li>
+<li><b>Projection mode</b> - allows choosing between \b Orthogonal and
+\b Perspective projection mode. </b>
+<li><b>Navigation mode</b> - this option allows to choose one of the
+modes of work with mouse in VTK viewer.</li>
+<ul>
+<li><b>Salome Standard Controls</b> - allows to manipulate objects in the
+viewer with the mouse and locked Ctrl button: increase or decrease the
+zoom ratio with the left mouse button, translate object in any
+direction with the central mouse button or rotate it with the right
+mouse button.</li>
+<li><b>Keyboard Free</b> - allows to manipulate objects in the viewer
+with the mouse without locking Ctrl button. In this case the
+operations are assigned to the buttons differently: rotation is made
+with the left button, translation with the right and zoom with both
+pressed in the same time.</li>
+</ul>
+<li><b>[+]/[-] Speed Increment</b> - defines the number of units by
+which the speed increases or respectively decreases after pressing [+]
+or [-] keyboard buttons.</li>
+<li><b>Modification Mode</b> - allows choosing between \b Arithmetic
+and \b Geometrical progression used for zooming</li> 
+</ul>
+<li><b>Spacemouse</b> - a mouse-like manipulator device specially designed
+for working with 3D presentations, objects, etc. You can reassign the
+actions listed below to any of its buttons.</li>
+<ul>
+<li><b>Decrease Speed Increment</b> - decreases by 1 the speed increment used for the keyboard (same as [-] key).</li>
+<li><b>Increase Speed Increment</b> - increase by 1 the speed increment used for the keyboard (same as [+] key).</li>
+<li><b>Dominant / combined switch</b> - toggles button to switch to dominant or combined movements.</li>
+</ul>
+<li><b>AVI Recording</b></li>
+<ul>
+<li><b>Mode</b> - allows to choose from two recording regimes:</li>
+<ul>
+<li><b>Recording all displayed frames</b> - records exactly at the FPS rate specified by the user.</li>
+<li><b>Recording at a given FPS</b> - records only when the contents
+of the viewer change (some activity is performed).  In the AVI file
+non-recorded images are substituted with the copies of the latest
+recorded image, which produces files with lower quality but requires
+less system resources.   </li>
+</ul>
+<li><b>FPS</b> - allows to define the FPS (frames per second) rate for
+the clip. Set greater value for better quality.</li>
+<li><b>Quality</b> - allows to set the quality of the clip in the
+interval between 0 and 100.</li>
+<li><b>Progressive</b> - allows to record a progressive API
+file.</li>
+</ul>
+
+<br>
+<li><b>Plot2d Viewer</b></li>
+<ul>
+<li><b>Legend Position</b> - this submenu allows to set the default position
+of the legend, it can be located to the left, to the right, on top or
+on bottom of the graph.</li>
+<li><b>Curve Type</b> - this allows to set the representation of graphs in
+your presentations. You can see only <b>Points</b>, points connected with
+<b>Lines</b> or points connected with smooth <b>Splines</b>.</li>
+<li><b>Marker Size</b> - this submenu allows you to set the size of
+markers in your graphs</li>
+<li><b>Horizontal & Vertical Axis Scale</b> - this submenu allows you to set
+the scale for vertical and horizontal axes. It can be either <b>Linear</b> or
+<b>Logarithmic</b></li>
+<li>Background Color - this submenu allows to select the background
+color. Click on the colored line to access to the 
+\ref select_color_and_font_page "Select Color" dialog box.</li>
+</ul>
+<br>
+<li><b>Graph Supervisor</b></li>
+<ul>
+<li><b>Background Color</b> - this submenu allows to select background
+color. Click on the colored line to access to the 
+\ref select_color_and_font_page "Select Color" dialog box.</li>
+<li><b>Title Color</b> - this submenu allows to select title color. Click on
+the colored line to access to the 
+\ref select_color_and_font_page "Select Color" dialog box.</li>
+</ul>
+</ul>
+
+<br><h2>Directories Preferences</h2>
+
+\image html pref13.png
+
+<ul>
+<li>
+<b>Quick Directory List</b> - this section allows to create and manage
+a custom quick directory list. To add a directory in the list, press
+the "Add directory" button:
+\image html image70.gif
+
+then the &quot;<b>...</b>&quot; button and browse the data tree for the
+directory you need.
+The "Up" and "Down" buttons(see the picture below) help you to sort
+the directories in the list:
+\image html image73.gif
+
+\image html image75.gif
+To remove the selected directory from the list, press the "Delete"
+button:
+\image html image72.png
+</li>
+</ul>
+
+<br><h2>Object Browser Preferences</h2>
+
+\image html pref14.png
+
+<ul>
+<li><b>Enable auto-hiding</b> checkbox - hides the 
+\ref using_find_tool_page if nor used</li>
+<li><b>Object browser settings</b></li>
+<ul>
+<li><b>Auto size for the first column</b> - this checkbox enables automatic
+resizing for the first column.</li>
+<li><b>Auto size for other columns</b> - this checkbox enables
+automatic resizing for the other columns.</li>
+<li><b>Resize columns after expanding an item</b> - this checkbox enables
+resizing columns on expanding an object browser item.</li>
+</ul>
+</ul>
+
+<ul>
+<li><b>Default columns</b> - these checkboxes allow to display or hide <b>Value</b>,
+<b>Entry</b>, <b>IOR</b> and <b>Reference entry</b> columns in the Object Browser.</li>
+</ul>
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/select_color_and_font.doc b/doc/salome/gui/input/select_color_and_font.doc
new file mode 100644 (file)
index 0000000..96b570a
--- /dev/null
@@ -0,0 +1,30 @@
+/*!
+
+\page select_color_and_font_page Select Color and Font
+
+<b>Select Color</b> and <b>Select Font</b> menus are used in many
+Preferences.
+
+<br><h2>Select color</h2>
+
+\image html selectcolor.png
+
+This menu  allows to choose from either predefined <b>Basic Colors</b>
+grouped in the upper left corner of the window or <b>Custom Colors</b>, which
+you can define yourselves. To define a Custom Color, click on one of
+the Custom Color cells, select the color you need in the field of
+colors or by typing in its numeric parameters in the lower right
+corner of the window, then click <b>Add to Custom Colors</b> button. The
+chosen color will be added to <b>Custom Colors</b> table.
+
+<br><h2>Select font</h2>
+
+\image html selectfont.png
+
+This menu provides a wide choice of \b Fonts, <b>Font Styles</b> and
+\b Sizes. Characters can be underlined or struck out. It is possible to
+preview them in the \b Sample window. \b Script dialog-box gives the
+possibility to use not only Latin and Latin Extended but also
+Cyrillic, Greek, Arabic, Runic and many other subsets.
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/setting_preferences.doc b/doc/salome/gui/input/setting_preferences.doc
new file mode 100644 (file)
index 0000000..33608f4
--- /dev/null
@@ -0,0 +1,37 @@
+/*!
+
+\page setting_preferences_page Setting Preferences
+
+In \b SALOME you can set preferences for each module in the common editor
+of preferences. \subpage salome_preferences_page "SALOME preferences" refer to the whole GUI SALOME
+session, other preferences are module-specific and are accessible only
+after you load a respective module.
+It is possible to set preferences for 
+\subpage geometry_preferences_page "Geometry", 
+\subpage mesh_preferences_page "Mesh" and
+\subpage postpro_preferences_page "Post-Pro" modules. 
+
+\subpage select_color_and_font_page "Font and color preferences"
+dialogs are often called from other \b Preferences dialogs.
+
+\n When you change settings (click \b OK or \b Apply button) each module
+receives the notification about what preferences are changed. You can
+also click \b Defaults button to restore default preferences or \b Close
+button to quit the menu without any changes. 
+\n \b Import button allows to load a user file containing preferences
+from your home directory through a standard Import dialog box.
+
+\image html import.png
+
+This file has no extension and by default starts with
+.SalomeApprc. followed by Salome version number. There exists one file
+for each Salome version in use.
+\n The preferences, set during the current study session, are
+automatically saved in this file at the end of the session. Next time
+you launch SALOME application, these preferences will be restored.
+
+\note The preferences you set will be default preferences for all \b new
+objects, but they are not retroactive and do not automatically apply
+to the existing objects.
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/study_management_chapter.doc b/doc/salome/gui/input/study_management_chapter.doc
new file mode 100644 (file)
index 0000000..f855d43
--- /dev/null
@@ -0,0 +1,113 @@
+/*!
+
+\page study_management_page Study management
+
+Study is a document within GUI, where you can carry out all
+operations provided by the SALOME functionality. 
+This is a certain abstraction layer between actual
+document data (probably, remote data available through CORBA) and data
+presentation (in the Object Browser). The study is composed of Data
+Object instances, united in a tree-like structure.
+
+All operations with studies are available from the \b File menu.
+
+\image html studymanagement.png
+
+\b New - creates a new study. The study will be created
+with default name \b Study1. It is possible to create
+several studies, each accessible from the task bar.
+\b Open - allows to open an existing study by browsing for it in a
+standard Search File dialog box, choosing the required
+*.hdf file and clicking \b Open button.
+\b Connect - allows to open an unloaded study.
+\image html loadstudy2.png
+Select one of the studies, which has been previously
+created and unloaded and click \b Ok button.
+
+\note SALOME is a multi-study platform. It means that simultaneously you can
+work with several studies. 
+
+\b Close - closes the current study, alternatively it is
+possible to click on the cross in the upper right corner of the study window.
+
+\note If the study has not been previously saved, this option will
+call the following dialog box with several options:
+
+\image html closestudy.png
+
+Here, \b Unload option unloads the current study from the SALOME
+Desktop. It can be reloaded in the same working session, but if you quit the SALOME application, all changes
+in the unloaded study will be lost.
+
+\b Save - saves the current study. Saving a study you also save its layout, i.e. all positions and sizes
+of dockable windows. It means that the difference in settings of the
+same windows (for example Python console) is possible between
+different modules (the same window can have different size and
+position when other module is activated). Also each module can
+indicate which common windows are necessary for working, and only they
+will be displayed when this module is active.
+
+\note If the study hasn't been previously saved, \b Save will
+call the standard Search File dialog box where you can enter the name
+for your study and save it.
+
+\b Save \b as - allows to save the current study with a new name. Input  a new name for the study in the standard
+Search File dialog box and click \b Save button.
+
+<b>Dump study</b> - allows to Dump a SALOME Study in one or several
+Python scripts. The following dialog box allows to browse for the location and
+define the name for a Python file.
+
+\image html dumpstudy.png
+
+<ul>
+<li>
+<b>Publish in study</b> - if checked in, the component objects created by
+Python commands will be published in the created Study when the script
+is played, otherwise the objects will not be published in the Study.
+</li>
+<li>
+<b>Save GUI state</b> - if checked in, the current application layout will be
+saved in the Python file.
+</li>
+</ul>
+To confirm your choice click \b Save.
+
+<b>Notebook</b> - allows to manage study variables using \subpage using_notebook "NoteBook".
+
+<b>Load Script</b> - allows to load a saved Python Script.
+
+\image html loadscript.png
+
+To confirm your choice click \b Open.
+
+<b>Properties</b> - allows to edit the properties of the current study.
+
+\image html studyproperties.png
+
+<ul>
+<li>\b Author - allows to change the name of the study author</li>
+<li>\b Created - gives the date and time of Study creation</li>
+<li>\b Locked - allows to lock the  study for modifications. 
+Just click on this field and choose \b Yes item. In this case your study will be locked for any modifications
+for all users. Next time you try to edit it, you will see the
+following warning message:
+\image html lockedstudy.png </li>
+<li>\b Modified - allows to see if any modifications have been
+introduced into study since its last save. </li>
+<li>\b Modifications - allows to  view the list of changes made in the study.
+In this dialog box click on the \b Modifications field and scroll it
+down. Each record contains the date and time of the
+modification and the name of the user, who has introduced it.</li>
+</ul>
+
+\b Preferences - allows \ref setting_preferences_page "setting preferences"
+ applicable to Salome in general and its modules.
+
+<b>Most recently used</b> - contains a list of recently opened
+studies, giving the possibility to fast load the required study.
+
+\b Exit - unlike \b Close, closes not only the current, but all opened
+Salome studies.
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/text_user_interface.doc b/doc/salome/gui/input/text_user_interface.doc
new file mode 100644 (file)
index 0000000..ac0bc56
--- /dev/null
@@ -0,0 +1,370 @@
+/*!
+
+\page tui_page Using salome.py module
+
+The Python module salome.py provides a functionality to access main
+SALOME features from the Python console (either embedded in GUI
+desktop or external one).
+
+To use salome.py module, import it into the Python interpreter and
+initialize it by calling \c salome_init() function:
+
+\code
+import salome
+salome.salome_init()
+\endcode
+
+The salome.py Python module provides a set of variables and functions
+allowing access to different elements of the current SALOME
+session (this Python interpreter is connected to).
+This page gives a short description of most useful variables and
+functions.
+
+\li \b orb Reference to the CORBA::ORB instance
+
+This variable can be used to initialize different CORBA-related
+elements of the SALOME session (for example, naming service, etc).
+For example, to get an access to the SALOME naming service, you can
+use the following commands:
+\code
+import SALOME_NamingServicePy
+NS = SALOME_NamingServicePy.SALOME_NamingServicePy_i(salome.orb)
+\endcode
+
+The \b orb variable is also useful when it is necessary to convert
+CORBA reference object to its string representation (IOR) and vice
+versa:
+\code
+studyIOR = salome.orb.object_to_string(salome.myStudy)
+study    = salome.orb.string_to_object(studyIOR)
+is_same  = salome.myStudy._is_equivalent(study) # is_same = True
+\endcode
+
+\li \b naming_service SALOME naming service instance
+
+This variable can be used to register/find objects created in a
+distributed environment. For example, to get access to the SALOME
+Module Catalog server, use \c Resolve() method:
+\code
+import SALOME_ModuleCatalog
+mc = salome.naming_service.Resolve('/Kernel/ModulCatalog')
+\endcode
+
+Similarly, method \c Register() can be used to register objects
+in the naming service:
+\code
+salome.naming_service.Register(myObject,'/My/Object/Path')
+o = salome.naming_service.Resolve('/My/Object/Path')
+is_same = myObject._is_equivalent(o) # is_same = True
+\endcode
+
+\li \b lcc Life Cycle CORBA class instance
+
+This object can be used to get access to CORBA engine part of some
+SALOME module, available in the current SALOME session. The following
+code returns a reference to the Geometry module engine, loading it if
+necessary:
+\code
+import GEOM
+geom = salome.lcc.FindOrLoadComponent('FactoryServer', 'GEOM')
+\endcode
+\b Note, that in the above example, \e "FactoryServer" is a name of the
+SALOME container, where Geometry module engine should be loaded.
+
+\li \b myStudyManager Reference to the study manager
+
+SALOMEDS Study manager is used to manipulate with the studies: create,
+open, save, close. It also can be used to find the study by its
+numerical ID or name. The code below demonstrates main
+functionalities of a study manager:
+\code
+# create new study with the name "MyStudy"
+new_study = salome.myStudyManager.NewStudy("MyStudy")
+
+# open study from file /home/user/MyStudy.hdf
+study = salome.myStudyManager.OpenStudy("/home/user/MyStudy.hdf")
+
+# save study
+salome.myStudyManager.Save(study, False) # not using multifile save mode
+
+# save study in ASCII format
+salome.myStudyManager.SaveASCII(study, True) # using multifile save mode
+
+# save study with the new file path
+salome.myStudyManager.SaveAs("/home/user/MyStudy.hdf", study, False)
+
+# save study with the new file path in ASCII format
+salome.myStudyManager.SaveAsASCII("/home/user/MyStudy.hdf", study, False)
+
+# close study
+salome.myStudyManager.Close(study)
+
+# get list of all opened studies
+studies = salome.myStudyManager.GetOpenStudies()
+
+# find study by its numerical ID (integer value starting from 1)
+study = salome.myStudyManager.GetStudyByID(studyID)
+
+# find study by its name
+study = salome.myStudyManager.GetStudyByName("/home/user/MyStudy.hdf")
+
+# ...
+\endcode
+
+\li \b myStudy Reference to the current (active) study
+
+This variable can be used to manipulate with the date of the study:
+create data tree, assign attributes of different types to the objects
+in a data tree, create references between objects, etc.
+
+\b Note, that the term "active" or "current" study does not make much
+sense outise the GUI Python console. When working in GUI, user always
+deals with one only top-level study, which desktop is currently on the
+top if the windows stack. This is what is called \e "active study".
+In TUI mode (without GUI or outside GUI), user has to manipulate with
+studies manually; no any special control for the life cycle of the
+study is done. In TUI mode, \c salome.muStudy variable is an instance
+of the first study created when you call salome_init() function.
+
+The following code demonstrates some examples of \c salome.myStudy
+variable usage. For more details please refer to the SALOMEDS.idl file
+documentation.
+
+\code
+# get study name
+studyName = salome.myStudy._get_Name()
+
+# get study numerical ID
+studyID = salome.myStudy._get_StudyId()
+
+# find SALOMEDS component by its type
+scomponent = FindComponent("MyComponent")
+
+# find SALOMEDS component by its entry ID
+scomponent = FindComponentID("0:1:1") # "0:1:1" is a component ID 
+
+# find SALOMEDS object by its name (first found object is returned)
+sobject = salome.myStudy.FindObject("MyObject")
+
+# find SALOMEDS object by its entry ID
+sobject = salome.myStudy.FindObjectID() # "0:1:1:1" is an object ID 
+
+# find SALOMEDS object by its IOR attribute
+sobject = salome.myStudy.FindObjectIOR(IOR)
+
+# find SALOMEDS object by its path in the data tree
+sobject = salome.myStudy.FindObjectByPath("/MyComponent/MyObject/MySubObject")
+
+# get SALOMEDS object's path in a study data tree
+sobject_path = salome.myStudy.GetObjectPath(sobject)
+
+# get study properties
+prop = salome.myStudy.GetProperties()
+prop.GetCreationDate() # get creation date
+prop.IsModified() # check if study has been modified (and not yet saved)
+prop.SetLocked(True) # lock the study (prohibit modifications)
+prop.IsLocked() # check if study is locked
+
+# create objects with study builder
+builder = salome.myStudy.NewBuilder() # create builder
+comp = builder.NewComponent("MyComponent") # create a component of the "MyComponent" type
+attrName = builder.FindOrCreateAttribute(comp, "AttributeName")
+attrName.SetValue("MyComponent") # set name to the component
+object = builder.NewObject(comp) # create new object, a child of the component 
+attrName = builder.FindOrCreateAttribute(object, "AttributeName")
+attrName.SetValue("MyObject") # set name to the object
+attrInt = builder.FindOrCreateAttribute(object, "AttributeInteger")
+attrInt.SetValue(123) # assign integer attribute to the object
+attrIOR = builder.FindOrCreateAttribute(object, "AttributeIOR")
+attrIOR.SetValue(IOR) # assign IOR attribute to the object (to point to some CORBA object)
+
+# iterate through objects of the data tree with child iterator
+iter = salome.myStudy.NewChildIterator(comp) # initialize from the component
+iter.InitEx(True) # init recursive mode
+while iter.More():
+      c = iter.Value()
+      print c.GetID()
+      iter.Next()
+      pass
+
+# ...
+\endcode
+
+\li \b myStudyId Identifier of the current (active) study
+
+This variable contains the numerical identifier of the current
+(active) study. It is an equivalent of \c
+salome.myStudy._get_StudyId() code.
+
+\li \b myStudyName Name of the current (active) study
+
+This variable contains the name of the current (active) study. It is
+an equivalent of \c salome.myStudy._get_Name() code.
+
+\li \b DumpStudy() Print study contents
+
+This function prints the study data object tree to the terminal
+window. The output for each object includes its entry ID, name, IOR
+(if there is one) and referenced object ID (for references). I.e.
+this is the same data the user can see in the Object Browser columns.
+\code
+salome.DumpStudy(salome.myStudy)
+\endcode
+
+\li \b IDToSObject() Get SALOMEDS object by its entry ID.
+
+This function checks if the SObject with the specified entry ID exists
+in the current study and returns it. Otherwise \c None is returned.
+\code
+sobject = salome.IDToSObject("0:1:1:1") # "0:1:1:1" is an object ID 
+\endcode
+Actually this function is just a shortcut to the following code:
+\code
+sobject = salome.myStudy.FindObjectID("0:1:1:1")
+\endcode
+
+\li \b IDToObject() Get CORBA object by its entry ID.
+
+This function checks if the SObject with the specified entry ID exists
+in the current study, then retrieves IOR attribute from it and,
+finally, if IOR is not empty, returns CORBA object corresponding to
+the found SObject:
+\code
+object = salome.IDToObject("0:1:1:1") # "0:1:1:1" is an object ID 
+\endcode
+Actually this function is just a shortcut to the following code:
+\code
+sobject = salome.myStudy.FindObjectID("0:1:1:1")
+if sobject:
+   object = sobject.GetObject()
+else:
+   object = None
+\endcode
+
+\li \b ObjectToSObject() Get SALOMEDS object corresponding to the
+CORBA object.
+
+This function finds an object in the current study which corresponds
+to the specified CORBA object (i.e. it has IOR attribute, pointing to
+the CORBA object). If there is no corresponding SALOMEDS object in the
+study, \c None is returned:
+\code
+sobject = salome.ObjectToSObject(object)
+\endcode
+Actually this function is just a shortcut to the following code:
+\code
+ior = salome.orb.object_to_string(object)
+sobject = salome.myStudy.FindObjectIOR(ior)
+\endcode
+
+\li \b ObjectToID() Get SALOMEDS object entry ID corresponding to the
+CORBA object.
+
+This function finds an object in the current study which corresponds
+to the specified CORBA object (i.e. it has IOR attribute, pointing to
+the CORBA object). If the object is found, its entry ID is returned,
+otherwise empty string is returned:
+\code
+entry = salome.ObjectToID(object)
+\endcode
+Actually this function is just a shortcut to the following code:
+\code
+ior = salome.orb.object_to_string(object)
+sobject = salome.myStudy.FindObjectIOR(ior)
+if sobject:
+   entry = sobject.GetID()
+else:
+   entry = ""
+\endcode
+
+\li \b createNewStudy() Create new study
+
+This function can be used to create new SALOME study. Returns an ID of
+the created study.
+\code
+studyId = salome.createNewStudy()
+study   = salome.myStudyManager.GetStudyByID(s)
+\endcode
+
+\li \b generateName() Generate unique name
+
+This function adds random numerical suffix to the passed string
+parameter ("Study" by default) and returns the resulting string:
+\code
+name_1 = salome.generateName() # name_1 is something like "Study682"
+name_1 = salome.generateName("Obj") # name_1 is something like "Obj32"
+\endcode
+
+\li \b sg SWIG interface to the SALOME GUI
+
+This variable provides an access to some GUI functions.
+
+\b Note, that this variable is not available if you use salome.py
+Python module outside the GUI desktop, i.e. not in the embedded Python
+console (since SWIG library is linked directly to the GUI library).
+
+The example of usage:
+\code
+# update Object browser contents
+salome.sg.updateObjBrowser(True)
+
+# get active study ID
+studyId = salome.sg.getActiveStudyId() 
+
+# get active study name
+studyName = salome.sg.getActiveStudyName()
+
+# get selected objects
+selCount = salome.sg.SelectedCount() # total number of selected items
+for i in range(selCount):
+    print salome.sg.getSelected(i) # print entry ID of i-th selected item
+
+# get list of all selected objects' IDs
+selected = salome.sg.getAllSelected()
+
+# add object to the selection
+salome.sg.AddIObject("0:1:1:1") # "0:1:1:1" is an object ID 
+
+# remove object from the selection (make it unselected)
+salome.sg.RemoveIObject("0:1:1:1") # "0:1:1:1" is an object ID 
+
+# clear selection (set all objects unselected)
+salome.sg.ClearIObjects()
+
+# display object in the current view (if possible)
+salome.sg.Display("0:1:1:1") # "0:1:1:1" is an object ID 
+salome.sg.UpdateView() # update view
+
+# erase object from the current view
+salome.sg.Erase("0:1:1:1") # "0:1:1:1" is an object ID 
+salome.sg.UpdateView() # update view
+
+# display all objects in the current view (if possible)
+salome.sg.DisplayAll()
+salome.sg.UpdateView() # update view
+
+# erase all objects from the current view
+salome.sg.EraseAll()
+salome.sg.UpdateView() # update view
+
+# set top, bottom, front, rear, left, right view
+salome.sg.ViewTop() # top view
+salome.sg.ViewBottom() # bottom view
+salome.sg.ViewFront() # front view
+salome.sg.ViewTop() #  back view
+salome.sg.ViewLeft() # left view
+salome.sg.ViewRight() # right view
+
+# reset current view
+salome.sg.ResetView()
+
+# get component symbolic name by its user name
+compName = salome.sg.getComponentName("Geometry") # compoName = "GEOM"
+
+# get component user name by its symbolic name
+compName = salome.sg.getComponentUserName("SMESH") # compoName = "Mesh"
+
+# ...
+\endcode
+
+*/
diff --git a/doc/salome/gui/input/themes.doc b/doc/salome/gui/input/themes.doc
new file mode 100755 (executable)
index 0000000..9fff17a
--- /dev/null
@@ -0,0 +1,27 @@
+/*!
+
+\page themes_page Theme 
+
+\b Theme dialog is used for customization of the look and feel of
+Salome. To open it, select in the Main menu <b>View -> Theme </b>.
+
+\image html theme1.png
+
+It is possible to choose a predefined color scheme in the list to the left
+or to edit your custom color scheme using the controls to the right.
+
+\b Quick button allows to apply color change made in one position to all
+other positions using this color.
+
+\image html theme2.png
+
+<ul>
+<li>\b Font group allows to edit the default font used in Salome menus.</li>
+<li>\b Lines group allows to apply dashing to Salome elements. </li>
+<li><b> Widgets rounding</b> allows to round corners of Salome dialog
+boxes and define their parameters.</li>
+<li>\b Handle allows to define parameters of the handle.</li>
+<li><b> Widget effect </b> allows to apply special effects to Salome
+dialog boxes.</li>
+</ul>
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/using_catalog_generator.doc b/doc/salome/gui/input/using_catalog_generator.doc
new file mode 100644 (file)
index 0000000..d2208a7
--- /dev/null
@@ -0,0 +1,65 @@
+/*!
+
+\page using_catalog_generator_page Using Catalog Generator
+
+SALOME platform is an open platform for
+integration of your custom components, which can used in the same way
+as typical modules provided in the standard installed package. The
+<b>Catalog Generator</b> tool serves for implementation of the interface of
+your custom component. It allows to generate from IDL description of
+your component interface its xml description.  The component xml
+description allows SALOME application to know about the component and
+its services and provides the possibility to call the component
+services, for example, inside Supervisor module.
+
+If you have a look at runSalome,
+runSalomeWithPort scripts running SALOME application, which are stored
+in build/bin directory you will see that SALOME_ModuleCatalog_Server
+is started with two xml files as its input parameters:
+\b CatalogModuleGeneral.xml and \b CatalogModulePersonnel.xml. These two
+files store the descriptions of interfaces and services of all
+components, provided with typical SALOME package. To add a new
+component into SALOME platform you should either update one of these
+existing xml files with generated xml description of your component or
+create a new one.
+
+<em>To open the Catalog Generator:</em>
+\par
+From the main menu choose <b>Tools > Catalog Generator</b>, the following
+dialog box will appear:
+
+\image html cataloggenerator.png
+
+<br>In this dialog box you can specify:
+<ul>
+<li>Name and location of the IDL file describing the interface of your
+component (Click the \b Browse button to find it using the data tree).</li>
+<li>Name and location of an existing XML file, which will be updated
+with the interface of you component or name and desired location of a
+new XML file, which will be generated (Click the \b Browse button to find
+it using the data tree).</li>
+<li>Name of the author.</li>
+<li>Name of the component.</li>
+<li>Name of the user.</li>
+<li>Version.</li>
+<li>Capability of multi study support.</li>
+<li>Type of the component.</li>
+<li>Icon of your component (Click the \b Browse button to find it using
+the data tree).</li>
+</ul>
+
+\note If you have chosen to create a new xml file containing the
+description of your component, don't forget to specify it as
+input parameter for SALOME_ModuleCatalog_Server in the file, you are
+using as a running script of SALOME platform (in runSalomeWithPort,
+for example).
+
+When launching SALOME next time you will see your module alongside other components.
+
+\b Tip: You can use the <b>Catalog Generator</b> tool, if you would like to \b
+test the functionality of your new component. After implementation of
+your component interface, launch SUPERVISION module where you can try
+using the services of your new component. (see also: Adding factory
+nodes)
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/using_find_tool.doc b/doc/salome/gui/input/using_find_tool.doc
new file mode 100644 (file)
index 0000000..add541a
--- /dev/null
@@ -0,0 +1,76 @@
+/*!
+
+\page using_find_tool_page Using Find Tool
+
+The <b>Object Browser</b> is supplied with the \b Find toolbox. This tool
+allows performing context search of the items in the Object Browser:
+
+\image html findtool1.png
+
+The \b Find toolbox can be invoked in several ways:
+- Pressing \a &lt;Ctrl&gt;-&lt;F&gt; key combination starts a new
+search; the text previously input by the user in the edit control of
+the \b Find toolbox is automatically selected.
+- Pressing \a &lt;/&gt; (slash) key starts a new search; the text
+previously input by the user is cleared.
+- Pressing \a &lt;F3&gt; key repeats the previous search in the forward
+direction (from top to bottom).
+- Pressing \a &lt;Shift&gt;-&lt;F3&gt; key repeats the previous search in
+the backward direction (from bottom to top).
+- Activating \a Find command from the Object Browser context popup
+menu starts a new search (the same as \a &lt;Ctrl&gt;-&lt;F&gt;).
+
+Pressing \a &lt;Escape&gt; key closes the \b Find toolbox.
+
+The search is always started from the first selected item in
+the Object Browser. If there are no selected items, the search is
+started from the top of the Object Browser contents. If there is an
+item which satisfies the search conditions, it is selected and the
+Object Browser is expanded to show this item (if it is collapsed).
+
+The \b Find toolbox provides a set of widgets which are used to
+perform the search operations or change the search conditions:
+- \a "Close" button closes the \b Find toolbox.
+- Line edit box is used to input the searched text. Note that the
+search is always done by the object name, i.e. by the data displayed
+in the "Name" column of the Object Browser.
+- \a "Find first item" button searches the very first item
+which satisfies the search conditions.
+- \a "Find previous item" button searches the previous item
+which satisfies the search conditions.
+- \a "Find next item" button searches the next item
+which satisfies the search conditions.
+- \a "Find last item" button searches the very last item
+which satisfies the search conditions.
+- \a "Case sensitive" check box allows performing case sensitive
+search.
+- \a "Regular Expression" check box allows performing the search of the
+items by the regular expression, for example:
+  - <i>Face</i> - matches all faces
+  - <i>Face_[\\d]</i> - matches Face_1, Face_2, etc.. (all faces)
+  - <i>Face_[\\d]$</i> - matches Face_1, Face_2, but does not match Face_11, Face_12.
+  - <i>^Face_[\\d]$</i> - the same as above
+  - <i>^ Face_[\\d]$</i> - matches nothing
+
+- \a "Wrap search" check box: if checked and the search
+reaches the last item, satisfying the search conditions, pressing \a "Find
+Next" button moves the selection to the very first item which matches
+the search conditions (i.e. a cyclic search is performed).
+
+If there are no items satisfying the search
+conditions in the Object Browser, the edit control of the \b Find toolbox becomes
+red-colored:
+
+\image html findtool2.png
+
+The \b Find toolbox also has an auto-hiding feature. This works as
+follows:
+- If the input focus is inside the \b Find toolbox, auto-hiding is
+automatically deactivated.
+- If the input focus moves outside the \b Find toolbox, it hides
+automatically in 10 seconds after the last search operation (which can
+be done by clicking \a "Find Next", \a "Find Previous" button, or typing
+something in the edit field); each new search operation
+restarts the auto-hide timer.
+
+*/
diff --git a/doc/salome/gui/input/using_notebook.doc b/doc/salome/gui/input/using_notebook.doc
new file mode 100644 (file)
index 0000000..d48fe8f
--- /dev/null
@@ -0,0 +1,26 @@
+/*!
+
+\page using_notebook Using NoteBook
+
+SALOME <b>NoteBook</b> is destined for managing numerical and boolean
+parameters (variables) which are used to create and modify objects in
+different components.
+
+To open the <b>NoteBook</b> choose <b>File > Notebook</b>, the following
+dialog box will appear:
+
+\image html notebook1.png
+
+Here you can add new variables, remove and rename existing variables and 
+change their values.
+
+If you have modified some variables, which are already used in the current
+study, you should click <b>Update Study</b> button to apply your changes
+to the study.
+
+\note The dialog will not be validated until at least one of variables in
+the table has invalid name or value (marked by red color). Names of
+variables should be unique and their values should be numerical (integer or
+double) or boolean ("True" / "False").
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/using_object_browser.doc b/doc/salome/gui/input/using_object_browser.doc
new file mode 100644 (file)
index 0000000..5aea269
--- /dev/null
@@ -0,0 +1,46 @@
+/*!
+
+\page using_object_browser_page Using Object Browser
+
+The <b>Object Browser</b> in SALOME is destined for displaying the
+structure of the current study in a tree-like form. It contains:
+
+<ul>
+<li>components, loaded during the current session</li>
+<li>objects created with the help of different components (The objects
+created with the help of a definite component are located in the
+folder having the name of this component)
+</li>
+<li>references to different objects (they are highlighted in red)</li>
+</ul>
+
+\image html objectbrowser1.png
+
+\note The <b>Object Browser</b> is destined to getting quick access to
+different objects created during SALOME session. All pop-up menus
+associated with the objects displayed in the Object Browser are
+context-sensitive. So it depends on a definite currently loaded SALOME
+component what options you will see in the pop-up menu, if you
+right-click on a definite object in the Object Browser.
+
+The Object Browser may contain supplementary attributes of the objects
+displayed in additional columns. By default, these columns are not
+displayed -  displaying/hiding these columns is possible through
+\ref salome_preferences_page "setting study preferences" or
+right-clicking on the attributes bar and toggling the necessary
+attributes.
+
+\image html objectbrowser2.png
+
+<ul>
+<li>\b Entry  - Identification index of the object in the structure of
+the study</li>
+<li>\b IOR -  Interoperable Object Reference</li>
+<li><b>Reference entry</b>  -  Identification index of the references
+to the objects</li>
+<li>\b Value  -  Displays the value of the first object attribute</li>
+</ul>
+
+\note <b>Entry, IOR and Reference entry</b> attributes are displayed for debugging purposes only.
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/using_registry_tool.doc b/doc/salome/gui/input/using_registry_tool.doc
new file mode 100644 (file)
index 0000000..a652a78
--- /dev/null
@@ -0,0 +1,49 @@
+/*!
+
+\page using_registry_tool_page Using Registry tool
+
+\b Registry tool is in the SALOME platform is destined for providing
+information about the processes (components), which have ever been
+launched in the current study session.
+
+<em>To view the Registry:</em>
+\par
+From the main menu choose <b>Tools > Registry display</b>, the
+following dialog box will appear:
+
+\image html registry1.png
+
+\b Running tab of this dialog box displays a list of the currently
+started processes (components) with supplementary information on each
+of them divided into columns:
+
+<ul>
+<li>\b Component: name of the started component
+<li>\b PID: process identification number
+<li>\b User \b Name: name of the user launching the component
+<li>\b Machine: name of the machine, on which the process has been started
+<li>\b begins: date and time of the starting of the component
+<li>\b hello: date and time of the last call to the component
+</ul>
+
+\b History tab displays a list of all processes, which have ever been
+launched within this study session. It contains the same supplementary
+information on each of the processes (components).
+
+\b Refresh button allows to refresh the current list of processes
+(components).
+
+\b Interval button allows to set an interval for refreshment of the
+current list of processes (components).
+
+\image html registry3.png
+
+<em>To display complete information on a definite process
+(component):</em>
+\par
+Double-click on this process (component). The following window will
+appear:
+
+\image html registry4.png
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/viewers_chapter.doc b/doc/salome/gui/input/viewers_chapter.doc
new file mode 100644 (file)
index 0000000..be85863
--- /dev/null
@@ -0,0 +1,30 @@
+/*!
+
+\page viewers_page Viewers
+
+Salome provides a selection of viewers for data representation. Some
+of them are used in several modules, others are used only in one
+module or in some particular cases. 
+
+<ul>
+<li>\subpage occ_3d_viewer_page "OCC (Open CasCade) 3D viewer" has been developed on the basis of Open
+CASCADE Technology. This is the default viewer for Geometry Module,
+providing good representation of construction and transformation of
+geometrical objects. Only this viewer allows to work with groups and
+sub-shapes. This viewer can also work in Mesh module, however, it
+doesn't allow to visualize meshes. </li>
+<li>\subpage vtk_3d_viewer_page "VTK 3D viewer" has been developed
+basing on Visualization ToolKit library by Kitware, Inc. This is the default viewer for Mesh Module, allowing to
+visualize meshes. It is also used in Post-Pro module for all 3D presentations.</li>
+<li>\subpage plot2d_viewer_page "Plot 2D viewer" has been developed
+basing on open-source Qwt library. It is destined for the representation of 2d
+plots and graphs in Post-Pro module.</li>
+<li>GL 2D viewer - general purpose OpenGL-based viewer, which can be
+used for visualization of 2D scenes.</li>
+<li>QxScene 2D viewer - has been developed on the basis of
+QGraphicsView scene by Trolltech. This viewer is used in YACS module
+for visualization of computation schemes.</li>
+</ul>
+
+*/
diff --git a/doc/salome/gui/input/vtk_3d_viewer.doc b/doc/salome/gui/input/vtk_3d_viewer.doc
new file mode 100644 (file)
index 0000000..c0600f7
--- /dev/null
@@ -0,0 +1,140 @@
+/*!
+
+\page vtk_3d_viewer_page VTK 3D Viewer
+
+The functionalities of VTK viewer are available via its Viewer
+Toolbar. Buttons marked with small downward triangles have extended
+functionality which can be accessed by locking on them with left mouse
+button.  
+
+\image html image157.gif "Viewer Toolbar"
+
+<hr>
+\image html image77.png
+\n <center><b>Dump View</b> - exports an object from the viewer in bmp, png, jpg
+or jpeg image format.</center>
+<hr>
+
+\image html image88.gif
+\n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
+<hr>
+
+\image html image96.png
+\n <center><b>Fit all</b> - scales the presentation so that it could
+fit within the Viewer boundaries. </center>
+<hr>
+
+\image html image97.png
+\n <center><b>Fit area</b> - resizes the view to place in the visible area
+only the contents of a frame drawn with pressed left mouse button.</center>
+<hr>
+
+\image html image98.png
+\n <center><b>Zoom</b> - allows to zoom in and out.</center>
+<hr>
+
+\image html image99.png
+\n <center><b>Panning</b> - if the represented objects are greater that the
+visible area and you don't wish to use <b>Fit all</b> functionality, click on
+this button and you'll be able to drag the scene to see its remote
+parts.</center>
+<hr>
+
+\image html image100.png
+\n <center><b>Global panning</b> - allows to select a point to be the
+center of the presentation showing all displayeed objects in the
+visible ares <center>
+<hr>
+
+\image html view_rotation_point.png
+\n <center><b>Change rotation point</b> - allows to to choose the point around
+which the rotation is performed.</center>
+
+\image html set_rotation_point_dialog1.png
+
+<center>By default the rotation point is located in the Center of the bounding
+box of an object.</center>
+
+\image html set_rotation_point_dialog2.png
+
+<center>Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
+define the coordinates of the rotation point manually.</center>
+
+<b>Set to Origin</b> button restores the default rotation point
+coordinates.\n
+<b>Select Point from View</b> button allows to select the rotation
+point in the 3D Viewer.
+<hr>
+
+\image html image89.png
+\n <center><b>Rotation</b> - allows to rotate the selected object using the
+mouse.</center>
+
+\image html image102.gif
+
+<center>These buttons orientate the scene strictly about coordinate axes.</center>
+<hr>
+
+\image html image91.png
+\n <center><b>Reset</b> - restores the default position (isometric) of
+objects in the scene.</center>
+<hr>
+
+\image html urbutton.png
+\n <center><b>Update Rate</b> - allows to define the Update Rate for
+the presentations displayed in the viewer</center>
+
+\image html updaterate.png
+
+<ul>
+<li><b>Desired Update Rate, FPS</b> - allows to set the target Update
+Rate</li>
+<li><b>Still Update Rate, FPS</b> - allows to set the Update Rate for
+the periods when both the user and the application do not perform any
+actions in the viewer</li>
+<li><b>Current Update Rate, FPS</b> - shows the Update Rate currently
+available on your configuration</li>
+<li><b>Number of Cells</b> - shows the number of cells currently in
+display</li> 
+</ul>
+
+\image html image108.png
+\n <center><b>Scaling</b> - represents objects deformed (stretched or
+stuffed) along the axes of coordinates.</center>
+<hr>
+
+\image html image109.gif
+\n <center><b>Graduated axes</b> - allows to define parameters of axes
+and graduate them.</center>
+
+\image html graduatedaxes1.png
+
+<ul>
+<li><b>Axis name</b></li>
+<ul>
+<li><b>Is visible</b> - if checked the axis name is displayed in the
+viewer.</li>
+<li><b>Name</b> - allows to redefine the name of the axis.</li>
+<li><b>Font</b> - allows to define color and properties of the font of
+axis name.</li>
+</ul>
+<li><b>Labels</b></li>
+<ul>
+<li><b>Is visible</b> - if checked the labels are displayed in the
+viewer.</li>
+<li><b>Number</b> - allows to define the number of labels.</li>
+<li><b>Offset</b> - allows to define the distance between labels.</li>
+<li><b>Font</b> - allows to define color and properties of the font of
+labels names.</li>
+</ul>
+<li><b>Tick marks</b></li>
+<ul>
+<li><b>Is visible</b> - if checked the tick marks are displayed in the
+viewer.</li>
+<li><b>Length</b> - allows to define the length of tick marks.</li>
+</ul>
+<li><b>Is visible</b> - if checked the axis is displayed in the
+viewer. </li>
+</ul>
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/input/working_with_python_scripts.doc b/doc/salome/gui/input/working_with_python_scripts.doc
new file mode 100644 (file)
index 0000000..1b54bc8
--- /dev/null
@@ -0,0 +1,28 @@
+/*!
+
+\page python_interpreter_page Python Interpreter
+
+\b SALOME Platform can be launched in the batch mode, without Graphical
+User Interface, and operated with the use of Python scripts, which can
+fulfill most of the necessary tasks, however, the process of scripting
+is quite time consuming and rather error-prone.
+\n This problem has been resolved by the possibility to automatically
+generate a set of Python scripts from data created with SALOME GUI,
+which greatly increases the productivity of using SALOME platform in
+the batch mode. This mechanism can convert a SALOME Study in one or
+several Python scripts, which can be stored and imported later to
+re-create the content of the original study. The first script is a
+SALOME document, which re-creates the SALOME Study, adds the
+stored Salome components to the SALOME and automatically calls
+Python scripts of the second type containing component specific Python
+function calls. This architecture gives great flexibility in manual
+modification of the generated scripts because you can modify only one
+of the component specific Python scripts without touching others, thus
+avoiding expert knowledge of Python API of unused components.
+
+To Dump a  SALOME Study in one or several scripts, in the main menu
+select \b File --> <b>Dump study</b>.
+Reversibly, it is possible to load a saved Python Script selecting in
+the main menu \b File -> <b>Load Script</b>.
+
+*/
diff --git a/doc/salome/gui/static/footer.html b/doc/salome/gui/static/footer.html
new file mode 100755 (executable)
index 0000000..9211d57
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+</head>
+<body>
+<hr style="width: 100%; height: 2px;">
+<div style="text-align: center;">Copyright &copy; 2003-2009 CEA, EDF<br>
+</div>
+</body>
+</html>
diff --git a/doc/salome/gui/static/header.html b/doc/salome/gui/static/header.html
new file mode 100755 (executable)
index 0000000..a70a95e
--- /dev/null
@@ -0,0 +1,12 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+   <title>$title</title>
+   <link href="doxygen.css" rel="stylesheet" type="text/css">
+</head>
+<hr>
+<center>
+SALOME documentation central
+</center>
+<hr>
diff --git a/doc/salome/tui/GUI/doxyfile.in b/doc/salome/tui/GUI/doxyfile.in
deleted file mode 100755 (executable)
index 192abd0..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-# Doxyfile 1.4.6
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME           = "SALOME - GUI - v.@VERSION@"
-PROJECT_NUMBER         = 
-OUTPUT_DIRECTORY       = ../
-CREATE_SUBDIRS         = NO
-OUTPUT_LANGUAGE        = English
-USE_WINDOWS_ENCODING   = NO
-BRIEF_MEMBER_DESC      = YES
-REPEAT_BRIEF           = NO
-ABBREVIATE_BRIEF       = 
-ALWAYS_DETAILED_SEC    = YES
-INLINE_INHERITED_MEMB  = YES
-FULL_PATH_NAMES        = YES
-STRIP_FROM_PATH        = ../../../share/salome \
-                        ../../../build/salome
-STRIP_FROM_INC_PATH    = 
-SHORT_NAMES            = NO
-JAVADOC_AUTOBRIEF      = YES
-MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP         = NO
-INHERIT_DOCS           = NO
-SEPARATE_MEMBER_PAGES  = NO
-TAB_SIZE               = 5
-ALIASES                = 
-OPTIMIZE_OUTPUT_FOR_C  = YES
-OPTIMIZE_OUTPUT_JAVA   = YES
-BUILTIN_STL_SUPPORT    = NO
-DISTRIBUTE_GROUP_DOC   = NO
-SUBGROUPING            = YES
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL            = YES
-EXTRACT_PRIVATE        = YES
-EXTRACT_STATIC         = YES
-EXTRACT_LOCAL_CLASSES  = YES
-EXTRACT_LOCAL_METHODS  = NO
-HIDE_UNDOC_MEMBERS     = YES
-HIDE_UNDOC_CLASSES     = YES
-HIDE_FRIEND_COMPOUNDS  = NO
-HIDE_IN_BODY_DOCS      = NO
-INTERNAL_DOCS          = YES
-CASE_SENSE_NAMES       = YES
-HIDE_SCOPE_NAMES       = NO
-SHOW_INCLUDE_FILES     = YES
-INLINE_INFO            = YES
-SORT_MEMBER_DOCS       = NO
-SORT_BRIEF_DOCS        = NO
-SORT_BY_SCOPE_NAME     = NO
-GENERATE_TODOLIST      = YES
-GENERATE_TESTLIST      = YES
-GENERATE_BUGLIST       = YES
-GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS       = 
-MAX_INITIALIZER_LINES  = 25
-SHOW_USED_FILES        = NO
-SHOW_DIRECTORIES       = NO
-FILE_VERSION_FILTER    = 
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET                  = NO
-WARNINGS               = YES
-WARN_IF_UNDOCUMENTED   = YES
-WARN_IF_DOC_ERROR      = YES
-WARN_NO_PARAMDOC       = NO
-WARN_FORMAT            = "$file:$line: $text"
-WARN_LOGFILE           = log.txt
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT                  = ../../../share/salome/src \
-                        ../../../share/salome/bin \
-                        ../../../share/salome/idl \
-                        ../../../build/salome/bin
-FILE_PATTERNS          = *.idl *.hxx *.cxx *.h *.c *.hh *.cc python_extension_must_be_here
-RECURSIVE              = YES
-EXCLUDE                = 
-EXCLUDE_SYMLINKS       = NO
-EXCLUDE_PATTERNS       = 
-EXAMPLE_PATH           = 
-EXAMPLE_PATTERNS       = 
-EXAMPLE_RECURSIVE      = YES
-IMAGE_PATH             = sources/
-INPUT_FILTER           = 
-FILTER_PATTERNS        = 
-FILTER_SOURCE_FILES    = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER         = NO
-INLINE_SOURCES         = NO
-STRIP_CODE_COMMENTS    = YES
-REFERENCED_BY_RELATION = NO
-REFERENCES_RELATION    = YES
-USE_HTAGS              = NO
-VERBATIM_HEADERS       = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX     = YES
-COLS_IN_ALPHA_INDEX    = 3
-IGNORE_PREFIX          = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML          = YES
-HTML_OUTPUT            = GUI
-HTML_FILE_EXTENSION    = .html
-HTML_HEADER            = sources/myheader.html
-HTML_FOOTER            = sources/footer.html
-HTML_STYLESHEET        = sources/doxygen.css
-HTML_ALIGN_MEMBERS     = YES
-GENERATE_HTMLHELP      = NO
-CHM_FILE               = 
-HHC_LOCATION           = 
-GENERATE_CHI           = NO
-BINARY_TOC             = YES
-TOC_EXPAND             = YES
-DISABLE_INDEX          = NO
-ENUM_VALUES_PER_LINE   = 4
-GENERATE_TREEVIEW      = NO
-TREEVIEW_WIDTH         = 250
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX         = NO
-LATEX_OUTPUT           = latex
-LATEX_CMD_NAME         = latex
-MAKEINDEX_CMD_NAME     = makeindex
-COMPACT_LATEX          = NO
-PAPER_TYPE             = a4wide
-EXTRA_PACKAGES         = 
-LATEX_HEADER           = 
-PDF_HYPERLINKS         = NO
-USE_PDFLATEX           = NO
-LATEX_BATCHMODE        = NO
-LATEX_HIDE_INDICES     = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF           = NO
-RTF_OUTPUT             = rtf
-COMPACT_RTF            = NO
-RTF_HYPERLINKS         = NO
-RTF_STYLESHEET_FILE    = 
-RTF_EXTENSIONS_FILE    = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN           = NO
-MAN_OUTPUT             = man
-MAN_EXTENSION          = .3
-MAN_LINKS              = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML           = NO
-XML_OUTPUT             = xml
-XML_SCHEMA             = 
-XML_DTD                = 
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF   = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD       = NO
-PERLMOD_LATEX          = NO
-PERLMOD_PRETTY         = YES
-PERLMOD_MAKEVAR_PREFIX = 
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING   = YES
-MACRO_EXPANSION        = YES
-EXPAND_ONLY_PREDEF     = NO
-SEARCH_INCLUDES        = YES
-INCLUDE_PATH           = 
-INCLUDE_FILE_PATTERNS  = 
-PREDEFINED             = 
-EXPAND_AS_DEFINED      = 
-SKIP_FUNCTION_MACROS   = NO
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references   
-#---------------------------------------------------------------------------
-TAGFILES               = 
-GENERATE_TAGFILE       = 
-ALLEXTERNALS           = NO
-EXTERNAL_GROUPS        = YES
-PERL_PATH              = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS         = YES
-HIDE_UNDOC_RELATIONS   = NO
-HAVE_DOT               = YES
-CLASS_GRAPH            = YES
-COLLABORATION_GRAPH    = NO
-GROUP_GRAPHS           = NO
-UML_LOOK               = NO
-TEMPLATE_RELATIONS     = YES
-INCLUDE_GRAPH          = YES
-INCLUDED_BY_GRAPH      = NO
-CALL_GRAPH             = NO
-GRAPHICAL_HIERARCHY    = YES
-DIRECTORY_GRAPH        = YES
-DOT_IMAGE_FORMAT       = jpg
-DOT_PATH               = 
-DOTFILE_DIRS           = 
-MAX_DOT_GRAPH_WIDTH    = 1024
-MAX_DOT_GRAPH_HEIGHT   = 1200
-MAX_DOT_GRAPH_DEPTH    = 0
-DOT_TRANSPARENT        = NO
-DOT_MULTI_TARGETS      = NO
-GENERATE_LEGEND        = NO
-DOT_CLEANUP            = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine   
-#---------------------------------------------------------------------------
-SEARCHENGINE           = NO
diff --git a/doc/salome/tui/GUI/sources/Application-About.png b/doc/salome/tui/GUI/sources/Application-About.png
deleted file mode 100755 (executable)
index 7b58330..0000000
Binary files a/doc/salome/tui/GUI/sources/Application-About.png and /dev/null differ
diff --git a/doc/salome/tui/GUI/sources/application.gif b/doc/salome/tui/GUI/sources/application.gif
deleted file mode 100755 (executable)
index 0b05d5c..0000000
Binary files a/doc/salome/tui/GUI/sources/application.gif and /dev/null differ
diff --git a/doc/salome/tui/GUI/sources/doxygen.css b/doc/salome/tui/GUI/sources/doxygen.css
deleted file mode 100755 (executable)
index 4893b5e..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-H1 { 
-   text-align: center; 
-}
-
-CAPTION { 
-   font-weight: bold 
-}
-
-/* Link in the top navbar */
-A.qindex {}
-
-A.qindexRef {}
-
-/* Link to any cross-referenced Doxygen element */
-A.el { 
-   text-decoration: none; 
-   font-weight: bold 
-}
-
-A.elRef { 
-   font-weight: bold 
-}
-
-/* Link to any cross-referenced Doxygen element inside a code section 
-   (ex: header)
-*/
-A.code { 
-   text-decoration: none; 
-   font-weight: normal; 
-   color: #4444ee 
-}
-
-A.codeRef { 
-   font-weight: normal; 
-   color: #4444ee 
-}
-
-A:hover { 
-   text-decoration: none; 
-   background-color: lightblue 
-}
-
-DL.el { 
-   margin-left: -1cm 
-}
-
-/* A code fragment (ex: header) */
-DIV.fragment { 
-   width: 100%; 
-   border: none; 
-   background-color: #CCCCCC 
-}
-
-/* In the alpha list (coumpound index), style of an alphabetical index letter */
-DIV.ah { 
-   background-color: #CCCCCC; 
-   font-weight: bold; 
-   color: #ffffff; 
-   margin-bottom: 3px; 
-   margin-top: 3px 
-}
-
-/* Method name (+ type) */
-TD.md { 
-   background-color: lightblue; 
-   font-weight: bold; 
-}
-
-/* Method parameter (some of them) */
-TD.mdname1 { 
-   background-color: lightblue; 
-   font-weight: bold; color: #602020; 
-}
-
-/* Method parameter (some of them) */
-TD.mdname { 
-   background-color: lightblue; 
-   font-weight: bold; 
-   color: #602020; 
-   width: 600px; 
-}
-
-/* Separator between methods group (usually empty, seems not supported by IE) */
-DIV.groupHeader { 
-   margin-left: 16px; 
-   margin-top: 12px; 
-   margin-bottom: 6px; 
-   font-weight: bold 
-}
-
-DIV.groupText { 
-   margin-left: 16px; 
-   font-style: italic; 
-   font-size: smaller 
-}
-
-BODY { background: #FFFFFF
-}
-
-/* BODY { 
-   background: url(sources/bg_salome.gif) 
-} */
-
-div.tabs { 
-  text-align: justify; 
-  font-weight: bold;
-  color: #FFFFFF;
-}
-
-DIV.div-footer { 
-  margin-left: 1em;
-  margin-right: 1em;
-  margin-bottom: 0.2em;
-  text-align: right;
-  font-size: 9pt; 
-}
-
-/* In File List, Coumpound List, etc, 1st column of the index */
-TD.indexkey { 
-   background-color: #CCCCCC; 
-   font-weight: bold; 
-   padding-right  : 10px; 
-   padding-top    : 2px; 
-   padding-left   : 10px; 
-   padding-bottom : 2px; 
-   margin-left    : 0px; 
-   margin-right   : 0px; 
-   margin-top     : 2px; 
-   margin-bottom  : 2px  
-}
-
-/* In File List, Coumpound List, etc, 2nd column of the index */
-TD.indexvalue { 
-   background-color: #CCCCCC; 
-   font-style: italic; 
-   padding-right  : 10px; 
-   padding-top    : 2px; 
-   padding-left   : 10px; 
-   padding-bottom : 2px; 
-   margin-left    : 0px; 
-   margin-right   : 0px; 
-   margin-top     : 2px; 
-   margin-bottom  : 2px  
-}
-
-span.keyword       { color: #008000 }
-span.keywordtype   { color: #604020 }
-span.keywordflow   { color: #e08000 }
-span.comment       { color: #800000 }
-span.preprocessor  { color: #806020 }
-span.stringliteral { color: #002080 }
-span.charliteral   { color: #008080 }
diff --git a/doc/salome/tui/GUI/sources/footer.html b/doc/salome/tui/GUI/sources/footer.html
deleted file mode 100755 (executable)
index cb55f39..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-</DIV>
-<DIV class="div-footer">
-Generated on $datetime for $projectname by&nbsp;<A href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></A> $doxygenversion</DIV>
-</BODY>
-</HTML>
diff --git a/doc/salome/tui/GUI/sources/html_comments.gif b/doc/salome/tui/GUI/sources/html_comments.gif
deleted file mode 100755 (executable)
index f0c0f0b..0000000
Binary files a/doc/salome/tui/GUI/sources/html_comments.gif and /dev/null differ
diff --git a/doc/salome/tui/GUI/sources/logocorp.gif b/doc/salome/tui/GUI/sources/logocorp.gif
deleted file mode 100755 (executable)
index 7697e08..0000000
Binary files a/doc/salome/tui/GUI/sources/logocorp.gif and /dev/null differ
diff --git a/doc/salome/tui/GUI/sources/myheader.html b/doc/salome/tui/GUI/sources/myheader.html
deleted file mode 100755 (executable)
index d2efb75..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-   <meta name="GENERATOR" content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
-   <title>Main Page</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head>
-<body>
-&nbsp;
-</body>
-</html>
index fd092e676d0823ce8d5f28d482aa36764de55a86..af6eaab262a4e5fd28dd0d269389228ac38986c3 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  File   : Makefile.in
 #  Author : Vasily Rusyaev (Open Cascade NN)
 #  Module : doc
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-EXTRA_DIST+=GUI
+EXTRA_DIST += images static
+
+dev_docs: doxyfile
+       echo "Running doxygen in directory: "`pwd`; \
+       $(DOXYGEN) $<;
 
-dev_docs:
-       cp -fr $(srcdir)/GUI ./INPUT; \
-       cp -f ./GUI/doxyfile ./INPUT; \
-       cd INPUT; \
-       sed 's|../../../share/salome|$(top_srcdir)|' ./doxyfile > ./doxyfile1; \
-       sed 's|../../build/salome|$(top_builddir)|' ./doxyfile1 > ./doxyfile2; \
-       mv -f doxyfile2 doxyfile1; \
-       echo "DOXYGEN SUPPORT PYTHON - @DOXYGEN_WITH_PYTHON@"; \
-       if( test "x@DOXYGEN_WITH_PYTHON@" = "xyes"); then \
-         sed 's|python_extension_must_be_here|*.py|' ./doxyfile1 > ./doxyfile2; \
-         mv -f doxyfile2 doxyfile1; \
-         $(DOXYGEN) -u ./doxyfile1; \
-       else \
-         sed 's|python_extension_must_be_here||' ./doxyfile1 > ./doxyfile2; \
-         mv -f doxyfile2 doxyfile1; \
-       fi; \
-       if( test "x@DOXYGEN_WITH_STL@" = "xyes"); then \
-         sed -e 's|BUILTIN_STL_SUPPORT    = NO|BUILTIN_STL_SUPPORT    = YES|' ./doxyfile1 > ./doxyfile2; \
-         mv -f doxyfile2 doxyfile1; \
-       fi; \
-       mv -f doxyfile1 doxyfile; \
-       echo "Running doxygen in directory:"`pwd`; \
-       $(DOXYGEN) ./doxyfile; \
-       cd ../; \
-       cp -fr $(srcdir)/GUI/sources/ GUI/ ; \
-       rm -fr INPUT
+clean-local:
+       -rm -fr GUI doxygen.bak
 
-doctuidir=$(docdir)/tui/GUI
+install-data-local:
+       if test -d GUI; then \
+         $(INSTALL) -d $(DESTDIR)$(docdir)/tui ; \
+         cp -rp GUI $(DESTDIR)$(docdir)/tui ; \
+       fi;
 
-nodist_doctui_DATA= GUI/doxyfile
-EXTRA_DIST+= GUI/doxyfile.in
+uninstall-local:
+       rm -rf $(DESTDIR)$(docdir)/tui/GUI
diff --git a/doc/salome/tui/doxyfile.in b/doc/salome/tui/doxyfile.in
new file mode 100755 (executable)
index 0000000..201628e
--- /dev/null
@@ -0,0 +1,263 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Doxyfile 1.4.6
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = "GUI Module Programming Guide v.@VERSION@"
+PROJECT_NUMBER         = 
+OUTPUT_DIRECTORY       = GUI
+CREATE_SUBDIRS         = NO
+OUTPUT_LANGUAGE        = English
+USE_WINDOWS_ENCODING   = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = NO
+ABBREVIATE_BRIEF       = 
+ALWAYS_DETAILED_SEC    = YES
+INLINE_INHERITED_MEMB  = YES
+FULL_PATH_NAMES        = YES
+STRIP_FROM_PATH        = @top_srcdir@ @top_builddir@
+STRIP_FROM_INC_PATH    = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = NO
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 5
+ALIASES                = 
+OPTIMIZE_OUTPUT_FOR_C  = YES
+OPTIMIZE_OUTPUT_JAVA   = YES
+BUILTIN_STL_SUPPORT    = @DOXYGEN_SUPPORT_STL@
+DISTRIBUTE_GROUP_DOC   = NO
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+HIDE_UNDOC_MEMBERS     = YES
+HIDE_UNDOC_CLASSES     = YES
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = YES
+CASE_SENSE_NAMES       = YES
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = NO
+SORT_BRIEF_DOCS        = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 25
+SHOW_USED_FILES        = NO
+SHOW_DIRECTORIES       = NO
+FILE_VERSION_FILTER    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = @top_srcdir@/src \
+                        @top_srcdir@/bin \
+                        @top_srcdir@/idl \
+                        @top_builddir@/bin
+FILE_PATTERNS          = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = YES
+IMAGE_PATH             = @srcdir@/images
+INPUT_FILTER           = 
+FILTER_PATTERNS        = 
+FILTER_SOURCE_FILES    = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION    = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 3
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = .
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = @srcdir@/static/myheader.html
+HTML_FOOTER            = @srcdir@/static/footer.html
+HTML_STYLESHEET        = @srcdir@/static/doxygen.css
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = YES
+TOC_EXPAND             = YES
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NO
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = NO
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = YES
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = NO
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = NO
+HAVE_DOT               = YES
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = NO
+GROUP_GRAPHS           = NO
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = NO
+CALL_GRAPH             = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = jpg
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1200
+MAX_DOT_GRAPH_DEPTH    = 0
+DOT_TRANSPARENT        = NO
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = NO
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
diff --git a/doc/salome/tui/images/Application-About.png b/doc/salome/tui/images/Application-About.png
new file mode 100755 (executable)
index 0000000..7b58330
Binary files /dev/null and b/doc/salome/tui/images/Application-About.png differ
diff --git a/doc/salome/tui/images/application.gif b/doc/salome/tui/images/application.gif
new file mode 100755 (executable)
index 0000000..0b05d5c
Binary files /dev/null and b/doc/salome/tui/images/application.gif differ
diff --git a/doc/salome/tui/images/html_comments.gif b/doc/salome/tui/images/html_comments.gif
new file mode 100755 (executable)
index 0000000..f0c0f0b
Binary files /dev/null and b/doc/salome/tui/images/html_comments.gif differ
diff --git a/doc/salome/tui/images/logocorp.gif b/doc/salome/tui/images/logocorp.gif
new file mode 100755 (executable)
index 0000000..7697e08
Binary files /dev/null and b/doc/salome/tui/images/logocorp.gif differ
diff --git a/doc/salome/tui/static/doxygen.css b/doc/salome/tui/static/doxygen.css
new file mode 100755 (executable)
index 0000000..4893b5e
--- /dev/null
@@ -0,0 +1,152 @@
+H1 { 
+   text-align: center; 
+}
+
+CAPTION { 
+   font-weight: bold 
+}
+
+/* Link in the top navbar */
+A.qindex {}
+
+A.qindexRef {}
+
+/* Link to any cross-referenced Doxygen element */
+A.el { 
+   text-decoration: none; 
+   font-weight: bold 
+}
+
+A.elRef { 
+   font-weight: bold 
+}
+
+/* Link to any cross-referenced Doxygen element inside a code section 
+   (ex: header)
+*/
+A.code { 
+   text-decoration: none; 
+   font-weight: normal; 
+   color: #4444ee 
+}
+
+A.codeRef { 
+   font-weight: normal; 
+   color: #4444ee 
+}
+
+A:hover { 
+   text-decoration: none; 
+   background-color: lightblue 
+}
+
+DL.el { 
+   margin-left: -1cm 
+}
+
+/* A code fragment (ex: header) */
+DIV.fragment { 
+   width: 100%; 
+   border: none; 
+   background-color: #CCCCCC 
+}
+
+/* In the alpha list (coumpound index), style of an alphabetical index letter */
+DIV.ah { 
+   background-color: #CCCCCC; 
+   font-weight: bold; 
+   color: #ffffff; 
+   margin-bottom: 3px; 
+   margin-top: 3px 
+}
+
+/* Method name (+ type) */
+TD.md { 
+   background-color: lightblue; 
+   font-weight: bold; 
+}
+
+/* Method parameter (some of them) */
+TD.mdname1 { 
+   background-color: lightblue; 
+   font-weight: bold; color: #602020; 
+}
+
+/* Method parameter (some of them) */
+TD.mdname { 
+   background-color: lightblue; 
+   font-weight: bold; 
+   color: #602020; 
+   width: 600px; 
+}
+
+/* Separator between methods group (usually empty, seems not supported by IE) */
+DIV.groupHeader { 
+   margin-left: 16px; 
+   margin-top: 12px; 
+   margin-bottom: 6px; 
+   font-weight: bold 
+}
+
+DIV.groupText { 
+   margin-left: 16px; 
+   font-style: italic; 
+   font-size: smaller 
+}
+
+BODY { background: #FFFFFF
+}
+
+/* BODY { 
+   background: url(sources/bg_salome.gif) 
+} */
+
+div.tabs { 
+  text-align: justify; 
+  font-weight: bold;
+  color: #FFFFFF;
+}
+
+DIV.div-footer { 
+  margin-left: 1em;
+  margin-right: 1em;
+  margin-bottom: 0.2em;
+  text-align: right;
+  font-size: 9pt; 
+}
+
+/* In File List, Coumpound List, etc, 1st column of the index */
+TD.indexkey { 
+   background-color: #CCCCCC; 
+   font-weight: bold; 
+   padding-right  : 10px; 
+   padding-top    : 2px; 
+   padding-left   : 10px; 
+   padding-bottom : 2px; 
+   margin-left    : 0px; 
+   margin-right   : 0px; 
+   margin-top     : 2px; 
+   margin-bottom  : 2px  
+}
+
+/* In File List, Coumpound List, etc, 2nd column of the index */
+TD.indexvalue { 
+   background-color: #CCCCCC; 
+   font-style: italic; 
+   padding-right  : 10px; 
+   padding-top    : 2px; 
+   padding-left   : 10px; 
+   padding-bottom : 2px; 
+   margin-left    : 0px; 
+   margin-right   : 0px; 
+   margin-top     : 2px; 
+   margin-bottom  : 2px  
+}
+
+span.keyword       { color: #008000 }
+span.keywordtype   { color: #604020 }
+span.keywordflow   { color: #e08000 }
+span.comment       { color: #800000 }
+span.preprocessor  { color: #806020 }
+span.stringliteral { color: #002080 }
+span.charliteral   { color: #008080 }
diff --git a/doc/salome/tui/static/footer.html b/doc/salome/tui/static/footer.html
new file mode 100755 (executable)
index 0000000..cb55f39
--- /dev/null
@@ -0,0 +1,5 @@
+</DIV>
+<DIV class="div-footer">
+Generated on $datetime for $projectname by&nbsp;<A href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></A> $doxygenversion</DIV>
+</BODY>
+</HTML>
diff --git a/doc/salome/tui/static/myheader.html b/doc/salome/tui/static/myheader.html
new file mode 100755 (executable)
index 0000000..d2efb75
--- /dev/null
@@ -0,0 +1,13 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+   <meta name="GENERATOR" content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
+   <title>Main Page</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+<link href="tabs.css" rel="stylesheet" type="text/css">
+</head>
+<body>
+&nbsp;
+</body>
+</html>
index cd0eb79f3fa412beda1a472d529fcf4bcf6e9b3d..ada73f25bbacc8f3256b0e578f3059ed5d703633 100644 (file)
@@ -1,48 +1,46 @@
-# Copyright (C) 2005  OPEN CASCADE, CEA, EDF R&D, LEG
-#           PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
-# 
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-# 
-
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This Makefile is responsible of generating the client and server
 # implementation of IDL interfaces for both C++ and python usage.
 # The building process of the C++ files is in charge of each source
 # package and then is not manage here.
 #
-
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-BASEIDL_FILES= SalomeApp_Engine.idl
-
-EXTRA_DIST+= $(BASEIDL_FILES)
+BASEIDL_FILES = SalomeApp_Engine.idl
 
 # This variable defines the files to be installed
-salomeidl_DATA = $(BASEIDL_FILES)
+dist_salomeidl_DATA = $(BASEIDL_FILES)
 
 # GUI idl common library
 lib_LTLIBRARIES = libSalomeIDLGUI.la
 
 # Sources built from idl files
-nodist_libSalomeIDLGUI_la_SOURCES= SalomeApp_EngineSK.cc
+nodist_libSalomeIDLGUI_la_SOURCES = SalomeApp_EngineSK.cc
 
 # header files must be exported: other modules have to use this library
-nodist_salomeinclude_HEADERS= $(BASEIDL_FILES:%.idl=%.hh)
+nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh)
 
-libSalomeIDLGUI_la_CPPFLAGS =\
+libSalomeIDLGUI_la_CPPFLAGS = \
        -I$(top_builddir)/salome_adm/unix \
        -I$(top_builddir)/idl \
        @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @KERNEL_CXXFLAGS@
@@ -64,14 +62,14 @@ SUFFIXES = .idl .hh SK.cc
        $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
 
 install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%)
-       $(INSTALL) -d  $(pkgpythondir)
+       $(INSTALL) -d  $(DESTDIR)$(salomepythondir)
        ls $^ | while read file; do \
-         $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(pkgpythondir) $$file ; \
+         $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
        done
 
 # uninstall-local removes too much, but it works in distcheck
 uninstall-local:
-       rm -rf $(pkgpythondir)/*
+       rm -rf $(DESTDIR)$(salomepythondir)/*
 
 mostlyclean-local:
        -rm -f *.hh *.cc .depidl
index abce369ffeeaba7b52838504ac080015fd06584b..64fcfdcd3fc9e71504160750648756cb17295e27 100644 (file)
@@ -1,24 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SalomeApp_Engine.idl
 //  Author : Alexander SLADKOV
-
+//
 #ifndef __SalomeApp_Engine__
 #define __SalomeApp_Engine__
 
index c9700c3745fa7430a4a3267a87b3a706cea1ff52..150e510d8fd07d8118ec7a4267c7eb49df4c7c64 100644 (file)
@@ -1,95 +1,32 @@
-# Copyright (C) 2005  OPEN CASCADE, CEA, EDF R&D, LEG
-#           PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
-# 
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-# 
-# -* Makefile *- 
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+# -* Makefile *- 
 # Author : Guillaume Boulant (CSSI)
 # Module : KERNEL 
 # $Header$
 #
-
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 #
-# ===============================================================
-# Files to be installed
-# ===============================================================
+# add resource files here ...
 #
-
-DEPRECATED_FILES=\
-plot2d_settings.png \
-view_fitall.png \
-cascade.png \
-plot2d_fitarea.png \
-view_reset.png \
-save.png \
-view_back.png \
-plot2d_linear_y.png \
-plot2d_legend.png \
-paste.png \
-plot2d_fitall.png \
-view_bottom.png \
-plot2d_log_y.png \
-plot2d_log.png \
-view_triedre.png \
-view_glpan.png \
-new.png \
-copy.png \
-plot2d_linear.png \
-reset.png \
-plot2d_points.png \
-view_front.png \
-view_rotate.png \
-open.png \
-close.png \
-view_fitarea.png \
-view_top.png \
-view_camera_dump.png \
-plot2d_pan.png \
-view_left.png \
-view_zoom.png \
-view_right.png \
-plot2d_lines.png \
-plot2d_splines.png \
-plot2d_zoom.png \
-view_pan.png \
-print.png \
-help.png
-
-dist_salomeres_DATA=\
-default.png \
-uc_new.png \
-uc_add.png \
-select1.png \
-dl_delete.png \
-dl_moveup.png \
-home.xpm \
-forward.xpm \
-Tools_en.xml \
-plot2d_dump.png \
-uc_clear.png \
-dl_movedown.png \
-back.xpm \
-uc_del.png \
-uc_current.png \
-tile.png \
-dl_insert.png \
-channel.cfg \
-$(DEPRECATED_FILES)
-
-EXTRA_DIST+= Tools_fr.xml
+dist_salomeres_DATA =
diff --git a/resources/Tools_en.xml b/resources/Tools_en.xml
deleted file mode 100644 (file)
index 7457ddc..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version='1.0' encoding='us-ascii'?>
-<!DOCTYPE application PUBLIC "" "desktop.dtd">
-
-<!--  GUI customization   -->
-
-<application
-       title="SALOMEGUI Application "
-       date="14 novembre 2001"
-       author="Nicolas REJNERI"
-       appId="" 
-       >
-       <desktop>
-         <menubar>
-           <menu-item label-id="Tools" item-id="5" pos-id="">
-                <popup-item item-id="5101" pos-id="2" label-id="Registry" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action="onDispatchTools" chaine="libRegistryDisplay.so"/>
-                <popup-item item-id="5102" pos-id="3" label-id="Catalog Generator" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action="onDispatchTools" chaine=""/>
-           </menu-item>
-         </menubar>
-       </desktop>      
-</application>
-
diff --git a/resources/Tools_fr.xml b/resources/Tools_fr.xml
deleted file mode 100644 (file)
index 7457ddc..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version='1.0' encoding='us-ascii'?>
-<!DOCTYPE application PUBLIC "" "desktop.dtd">
-
-<!--  GUI customization   -->
-
-<application
-       title="SALOMEGUI Application "
-       date="14 novembre 2001"
-       author="Nicolas REJNERI"
-       appId="" 
-       >
-       <desktop>
-         <menubar>
-           <menu-item label-id="Tools" item-id="5" pos-id="">
-                <popup-item item-id="5101" pos-id="2" label-id="Registry" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action="onDispatchTools" chaine="libRegistryDisplay.so"/>
-                <popup-item item-id="5102" pos-id="3" label-id="Catalog Generator" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action="onDispatchTools" chaine=""/>
-           </menu-item>
-         </menubar>
-       </desktop>      
-</application>
-
diff --git a/resources/back.xpm b/resources/back.xpm
deleted file mode 100644 (file)
index 7dc5b72..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* XPM */
-/* Drawn  by Mark Donohoe for the K Desktop Environment */
-/* See http://www.kde.org */
-static char*back[]={
-"16 16 5 1",
-"# c #000000",
-"a c #ffffff",
-"c c #808080",
-"b c #c0c0c0",
-". c None",
-"................",
-".......#........",
-"......##........",
-".....#a#........",
-"....#aa########.",
-"...#aabaaaaaaa#.",
-"..#aabbbbbbbbb#.",
-"...#abbbbbbbbb#.",
-"...c#ab########.",
-"....c#a#ccccccc.",
-".....c##c.......",
-"......c#c.......",
-".......cc.......",
-"........c.......",
-"................",
-"......................"};
-
diff --git a/resources/cascade.png b/resources/cascade.png
deleted file mode 100644 (file)
index 9cd1715..0000000
Binary files a/resources/cascade.png and /dev/null differ
diff --git a/resources/channel.cfg b/resources/channel.cfg
deleted file mode 100755 (executable)
index afe59a7..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-# =================================================================
-# PARAM SETTINGS
-#
-# ** standard.cfg : 
-#      sets up the daemon with default params as given
-#      in the CosNotification specification.
-#
-# ** channel.cfg : 
-#      sets up daemon with default params which we prefer.
-#
-# You can choose which one to use, or copy one and edit it
-# to suit your needs.
-#
-# There are only a couple of differences:
-#
-#                        standard.cfg        channel.cfg
-#
-#   PacingInterval           0                  1000  (1 second)
-#   MaximumBatchSize        1                   8
-#
-
-# =================================================================
-#       omniNotify Configuration (Startup) Properties
-#                                                   
-# You can modify startup properties in one of 3 ways
-#
-# 1. copy this file to create your own .cfg file and edit it.  Use
-#       promp> notifd -i -c myconfig.cfg
-#    to start notifd using the config file myconfig.cfg
-#
-# 2. set an environment variable; this will override any
-#    config file settings.  e.g., for tcsh,
-#         promp> setenv LocalClockTDF 0
-#         promp> notifd -i -c channel.cfg
-#    This uses channel.cfg but changes the time zone to GMT
-#
-# 3. use explicit command-line param definitions
-#    these override both the config file and any env variable settings
-#         promp> setenv LocalClockTDF 0
-#         promp> notifd -i -c channel.cfg -DLocalClockTDF=-60
-#    This would set the time zone to 1 hour earlier than GMT
-#
-# omniNotify manages 3 kinds of properties
-#
-#   * ServerQOS properties are properties that all channels share;
-#     they cannot be changed on a per-channel basis.
-#
-#   * AdminQoS properties are properties that can only be
-#     set at the channel factory / channel level.
-#
-#   * NotifQoS properties are properties that can be set at
-#     many levels: channel factory, channel, admin, proxy;
-#     some of these can also be changed on a per-event basis.
-#
-# The channel factory's AdminQoS and NotifQoS property settings
-# are used as defaults: when creating a channel these property
-# values are used unless specific overrides are provided in
-# with the channel creation request.  Once a channel is created,
-# its AdminQoS and NotifQoS properties can be modified; the
-# factory's properties can also be modified.  Note that once a 
-# channel is created, its properties are independent of the
-# factory -- modifications to the channel properties do not affect
-# the factory defaults, and modifications to the factory defaults
-# do not affect the properties of already-created channels.
-#
-# The settings specified in config files, environment
-# variables and/or command line param definitions are used to
-# set the initial values for the server's ServerQoS properties and
-# for the channel factory's AdminQoS and NotifQoS
-# default properties.  Since the default channel is created on startup,
-# it also takes its AdminQoS and NotifQoS properties from
-# these initial settings.
-#
-#==================================================================
-
-#==================================================================
-# Misc Startup Properties
-#    -- these are essentially ServerQoS properties,
-#       but are not currently implemented that way 
-#==================================================================
-
-# Names to be assigned to the channel factory and channel created by
-# the notifd channel daemon
-
-ChannelFactoryName     ChannelFactory
-DefaultChannelName     EventChannel
-
-# Path names of the files used to store the string representation of
-# the above channel factory IOR and channel object IOR
-
-FactoryIORFileName     /tmp/rdifact.ior
-ChannelIORFileName     /tmp/rdichan.ior
-
-# If a file path is given for the following parameter,  the file is
-# used for storing debugging information. 'stderr' and 'stdout' can be
-# used to direct output to standard error / standard output.
-
-#DebugLogFile          ./debug.log
-DebugLogFile           stderr
-
-# If a file path is given for the following parameter,  the file is
-# used for storing report information.  'stderr' and 'stdout' can be
-# used to direct output to standard error / standard output.
-
-#ReportLogFile         ./report.log
-ReportLogFile          stdout
-
-# debug flags -- 0 is "off", 1 is "on"
-DebugDaemon               0
-DebugChannelFactory       0
-DebugFilter               0
-DebugChannel              0
-DebugConsumerAdmin        0 
-DebugSupplireAdmin        0
-DebugConsumerProxy        0
-DebugSupplierProxy        0
-DebugEventQueue           0
-DebugRDIEvent             0
-DebugFilterAdmin          0
-DebugFilterEval           0
-DebugCosConsumerProxies   0
-DebugCosSupplierProxies   0
-DebugNotifQoS             0
-DebugAdminQoS             0
-DebugNotifQueue           0
-
-# report flags -- 0 is "off", 1 is "on"
-ReportChannelStats        1
-ReportQueueSizeStats      1
-ReportConnectedConsumers  1 
-ReportConnectedSuppliers  1
-ReportConnectedFilters    1
-ReportUnconnectedFilters  1
-ReportEventRejections     1
-ReportEventDrops          1
-ReportNotifQoS            1
-ReportAdminQoS            1
-ReportServerQoS           1
-
-#==================================================================
-# Initial ServerQoS Properties
-#==================================================================
-
-# Each ConsumerAdmin and SupplierAdmin object is assigned to a group
-# and each group is processed by only one thread. The number of such
-# groups and the number of threads that handle the groups have to be
-# at least 1.  In addition,  the number of threads should not exceed
-# the number of groups
-
-NumAdminGroups         2
-NumAdminThreads                2
-
-# notifd may split the filter evaluation processing in two stages. In
-# this case, a second thread pool is used for evaluating proxy-level
-# filters.  The size of the pool is controled by the following 
-
-NumProxyThreads                0
-
-# The following variables control the number of threads created for
-# pushing matched events to push-style consumers and pulling events
-# from pull-style suppliers.  If these values are 0,  each consumer
-# and supplier is assigned its own thread.
-
-NumPushThreads         4
-NumPullThreads         2
-
-# The following variables control the number of threads created for
-# notifying suppliers of subscription changes (using subscription_change)
-# and for notifying consumers of offer changes (using offer_change).
-# CAREFUL: Setting NumSChangeThreads to zero DISABLES 
-# the sending of subscription_change messages!
-# CAREFUL: Setting NumOChangeThreads to zero DISABLES 
-# the sending of offer_change messages
-
-NumOChangeThreads      1
-NumSChangeThreads      1
-
-# For pull style suppliers,  the time period (milliseconds) between
-# pulls is controlled by the following variable.  
-# A value of 0 corresponds to continuous pulling
-
-PullEventPeriod                100
-
-# Period in seconds used by the garbage collector of the event queue
-# The minimum number that can be used is 1
-
-QueueGCPeriod          300
-
-# The next entry specifies the time period (in seconds) between
-# each 'report' (the Report.. flags above control what gets reported).
-# The channel may have a built-in minimum, e.g, even if you say 0,
-# the channel may choose a 10 second period.  (300 seconds = 5 mins)
-
-ReportingInterval      300
-
-# Description of local clock values returned from omnithread::get_time.
-# These values are here because we do not know a portable way to get
-# the clock accuracy and the time zone across all Unix flavors and
-# Windows.  Let us know if you have a portable approach.
-#
-# LocalClockInaccLo/Hi: local clock inaccuracy in units of 100ns
-#                       (must fit in 48 bits, 32 for Lo, 16 for Hi)
-# LocalClockTDF:   local time zone expressed in minutes west of
-#                  greenwhich meridian; 300=Eastern time zone, USA
-LocalClockInaccLo     0
-LocalClockInaccHi     0
-LocalClockTDF       300
-
-#==================================================================
-# Initial Default AdminQoS Properties
-#==================================================================
-
-# Maximum number of events that will be queued by the Channel before
-# before it begins discarding events or rejecting new ones.  A value 
-# of 0 does not place any upper limit.
-
-MaxQueueLength         0
-
-# The maximum number of Consumers that can be connected to a Channel
-# at any given time.  A value of 0 does not place any upper limit. 
-
-MaxConsumers           0
-
-# The maximum number of Suppliers that can be connected to a Channel
-# at any given time.  A value of 0 does not place any upper limit. 
-
-MaxSuppliers           0
-
-# If 1, newly announced events will be discarded when the number of
-# undelivered events in a Channel is equal to 'MaxQueueLength'.  If
-# 0,  newly announced events cause existing events to be discarded 
-# according to the 'DiscardPolicy' QoS.
-
-RejectNewEvents                1
-
-#==================================================================
-# Initial Default NotifQoS Properties
-#==================================================================
-
-# EventReliability and ConnectionReliability can take the values:
-#      0 --> CosNotification::BestEffort
-#      1 --> CosNotification::Persistent
-# OrderPolicy can take the values: 
-#      0 --> CosNotification::AnyOrder
-#      1 --> CosNotification::FifoOrder
-#      2 --> CosNotification::PriorityOrder
-#      3 --> CosNotification::DeadlineOrder
-# DiscardPolicy can take any of the above values and, in addition, 
-#      4 --> CosNotification::LifoOrder
-# StartTimeSupported and StopTimeSupported are boolean and can take
-# the values 
-#      0 --> FALSE
-#      1 --> TRUE
-#
-# NOTE: the current notifd implementation does NOT support all QoS 
-#       settings. In particular, it only supports the following:
-#              EventReliability        0
-#              ConnectionReliability   0
-#              StartTimeSupported      0
-#              StopTimeSupported       0
-
-# Note -- PacingInterval can be set programmatically to any
-# TimeBase::TimeT value (units = 100s of nanoseconds).  Here you
-# set number of MILLISECONDS, e.g., a value of 1000 means send a batch
-# roughly every 1 second (or when MaxBatchSize is reached).
-
-EventReliability       0
-ConnectionReliability  0
-Priority               0
-Timeout                        0
-StartTimeSupported     0
-StopTimeSupported      0
-OrderPolicy            0
-DiscardPolicy          0
-PacingInterval         1000
-MaxEventsPerConsumer   0
-MaximumBatchSize       8
-
diff --git a/resources/close.png b/resources/close.png
deleted file mode 100644 (file)
index b7126e0..0000000
Binary files a/resources/close.png and /dev/null differ
diff --git a/resources/copy.png b/resources/copy.png
deleted file mode 100644 (file)
index 1e43a09..0000000
Binary files a/resources/copy.png and /dev/null differ
diff --git a/resources/default.png b/resources/default.png
deleted file mode 100644 (file)
index 0140a66..0000000
Binary files a/resources/default.png and /dev/null differ
diff --git a/resources/dl_delete.png b/resources/dl_delete.png
deleted file mode 100644 (file)
index a7a0ad8..0000000
Binary files a/resources/dl_delete.png and /dev/null differ
diff --git a/resources/dl_insert.png b/resources/dl_insert.png
deleted file mode 100644 (file)
index 54e108a..0000000
Binary files a/resources/dl_insert.png and /dev/null differ
diff --git a/resources/dl_movedown.png b/resources/dl_movedown.png
deleted file mode 100644 (file)
index 9c87219..0000000
Binary files a/resources/dl_movedown.png and /dev/null differ
diff --git a/resources/dl_moveup.png b/resources/dl_moveup.png
deleted file mode 100644 (file)
index 45b2750..0000000
Binary files a/resources/dl_moveup.png and /dev/null differ
diff --git a/resources/forward.xpm b/resources/forward.xpm
deleted file mode 100644 (file)
index 2ed8134..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* XPM */
-/* Drawn  by Mark Donohoe for the K Desktop Environment */
-/* See http://www.kde.org */
-static char*forward[]={
-"16 16 5 1",
-"# c #000000",
-"a c #ffffff",
-"c c #808080",
-"b c #c0c0c0",
-". c None",
-"................",
-"................",
-".........#......",
-".........##.....",
-".........#a#....",
-"..########aa#...",
-"..#aaaaaaabaa#..",
-"..#bbbbbbbbbaa#.",
-"..#bbbbbbbbba#..",
-"..########ba#c..",
-"..ccccccc#a#c...",
-"........c##c....",
-"........c#c.....",
-"........cc......",
-"........c.......",
-"................",
-"................"};
-
diff --git a/resources/help.png b/resources/help.png
deleted file mode 100644 (file)
index 452b45f..0000000
Binary files a/resources/help.png and /dev/null differ
diff --git a/resources/home.xpm b/resources/home.xpm
deleted file mode 100644 (file)
index 9c1369d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* XPM */
-/* Drawn  by Mark Donohoe for the K Desktop Environment */
-/* See http://www.kde.org */
-static char*home[]={
-"16 16 4 1",
-"# c #000000",
-"a c #ffffff",
-"b c #c0c0c0",
-". c None",
-"........... ....",
-"   ....##.......",
-"..#...####......",
-"..#..#aabb#.....",
-"..#.#aaaabb#....",
-"..##aaaaaabb#...",
-"..#aaaaaaaabb#..",
-".#aaaaaaaaabbb#.",
-"###aaaaaaaabb###",
-"..#aaaaaaaabb#..",
-"..#aaa###aabb#..",
-"..#aaa#.#aabb#..",
-"..#aaa#.#aabb#..",
-"..#aaa#.#aabb#..",
-"..#aaa#.#aabb#..",
-"..#####.######..",
-"................"};
-
diff --git a/resources/new.png b/resources/new.png
deleted file mode 100644 (file)
index 953757a..0000000
Binary files a/resources/new.png and /dev/null differ
diff --git a/resources/open.png b/resources/open.png
deleted file mode 100644 (file)
index d9953b6..0000000
Binary files a/resources/open.png and /dev/null differ
diff --git a/resources/paste.png b/resources/paste.png
deleted file mode 100644 (file)
index c744625..0000000
Binary files a/resources/paste.png and /dev/null differ
diff --git a/resources/plot2d_dump.png b/resources/plot2d_dump.png
deleted file mode 100644 (file)
index e8bec70..0000000
Binary files a/resources/plot2d_dump.png and /dev/null differ
diff --git a/resources/plot2d_fitall.png b/resources/plot2d_fitall.png
deleted file mode 100644 (file)
index c09ff94..0000000
Binary files a/resources/plot2d_fitall.png and /dev/null differ
diff --git a/resources/plot2d_fitarea.png b/resources/plot2d_fitarea.png
deleted file mode 100644 (file)
index 5b79594..0000000
Binary files a/resources/plot2d_fitarea.png and /dev/null differ
diff --git a/resources/plot2d_legend.png b/resources/plot2d_legend.png
deleted file mode 100644 (file)
index cdcc1e0..0000000
Binary files a/resources/plot2d_legend.png and /dev/null differ
diff --git a/resources/plot2d_linear.png b/resources/plot2d_linear.png
deleted file mode 100644 (file)
index d79f214..0000000
Binary files a/resources/plot2d_linear.png and /dev/null differ
diff --git a/resources/plot2d_linear_y.png b/resources/plot2d_linear_y.png
deleted file mode 100644 (file)
index e396eac..0000000
Binary files a/resources/plot2d_linear_y.png and /dev/null differ
diff --git a/resources/plot2d_lines.png b/resources/plot2d_lines.png
deleted file mode 100644 (file)
index 6baf573..0000000
Binary files a/resources/plot2d_lines.png and /dev/null differ
diff --git a/resources/plot2d_log.png b/resources/plot2d_log.png
deleted file mode 100644 (file)
index aecca8c..0000000
Binary files a/resources/plot2d_log.png and /dev/null differ
diff --git a/resources/plot2d_log_y.png b/resources/plot2d_log_y.png
deleted file mode 100644 (file)
index 4e1e211..0000000
Binary files a/resources/plot2d_log_y.png and /dev/null differ
diff --git a/resources/plot2d_pan.png b/resources/plot2d_pan.png
deleted file mode 100644 (file)
index 038fba1..0000000
Binary files a/resources/plot2d_pan.png and /dev/null differ
diff --git a/resources/plot2d_points.png b/resources/plot2d_points.png
deleted file mode 100644 (file)
index 4847c4e..0000000
Binary files a/resources/plot2d_points.png and /dev/null differ
diff --git a/resources/plot2d_settings.png b/resources/plot2d_settings.png
deleted file mode 100644 (file)
index d291da9..0000000
Binary files a/resources/plot2d_settings.png and /dev/null differ
diff --git a/resources/plot2d_splines.png b/resources/plot2d_splines.png
deleted file mode 100644 (file)
index c39d432..0000000
Binary files a/resources/plot2d_splines.png and /dev/null differ
diff --git a/resources/plot2d_zoom.png b/resources/plot2d_zoom.png
deleted file mode 100644 (file)
index b465739..0000000
Binary files a/resources/plot2d_zoom.png and /dev/null differ
diff --git a/resources/print.png b/resources/print.png
deleted file mode 100644 (file)
index 37ca7c2..0000000
Binary files a/resources/print.png and /dev/null differ
diff --git a/resources/reset.png b/resources/reset.png
deleted file mode 100644 (file)
index ccda81c..0000000
Binary files a/resources/reset.png and /dev/null differ
diff --git a/resources/save.png b/resources/save.png
deleted file mode 100644 (file)
index 330493f..0000000
Binary files a/resources/save.png and /dev/null differ
diff --git a/resources/select1.png b/resources/select1.png
deleted file mode 100644 (file)
index a1a4ee1..0000000
Binary files a/resources/select1.png and /dev/null differ
diff --git a/resources/tile.png b/resources/tile.png
deleted file mode 100644 (file)
index b3e6d7b..0000000
Binary files a/resources/tile.png and /dev/null differ
diff --git a/resources/uc_add.png b/resources/uc_add.png
deleted file mode 100644 (file)
index c36d708..0000000
Binary files a/resources/uc_add.png and /dev/null differ
diff --git a/resources/uc_clear.png b/resources/uc_clear.png
deleted file mode 100644 (file)
index 8abb891..0000000
Binary files a/resources/uc_clear.png and /dev/null differ
diff --git a/resources/uc_current.png b/resources/uc_current.png
deleted file mode 100644 (file)
index 1c1e61f..0000000
Binary files a/resources/uc_current.png and /dev/null differ
diff --git a/resources/uc_del.png b/resources/uc_del.png
deleted file mode 100644 (file)
index ed6c97c..0000000
Binary files a/resources/uc_del.png and /dev/null differ
diff --git a/resources/uc_new.png b/resources/uc_new.png
deleted file mode 100644 (file)
index ae849de..0000000
Binary files a/resources/uc_new.png and /dev/null differ
diff --git a/resources/view_back.png b/resources/view_back.png
deleted file mode 100644 (file)
index 436f2da..0000000
Binary files a/resources/view_back.png and /dev/null differ
diff --git a/resources/view_bottom.png b/resources/view_bottom.png
deleted file mode 100644 (file)
index a18011c..0000000
Binary files a/resources/view_bottom.png and /dev/null differ
diff --git a/resources/view_camera_dump.png b/resources/view_camera_dump.png
deleted file mode 100644 (file)
index 8eb63e0..0000000
Binary files a/resources/view_camera_dump.png and /dev/null differ
diff --git a/resources/view_fitall.png b/resources/view_fitall.png
deleted file mode 100644 (file)
index c09ff94..0000000
Binary files a/resources/view_fitall.png and /dev/null differ
diff --git a/resources/view_fitarea.png b/resources/view_fitarea.png
deleted file mode 100644 (file)
index 5b79594..0000000
Binary files a/resources/view_fitarea.png and /dev/null differ
diff --git a/resources/view_front.png b/resources/view_front.png
deleted file mode 100644 (file)
index c5dfc00..0000000
Binary files a/resources/view_front.png and /dev/null differ
diff --git a/resources/view_glpan.png b/resources/view_glpan.png
deleted file mode 100644 (file)
index c23322a..0000000
Binary files a/resources/view_glpan.png and /dev/null differ
diff --git a/resources/view_left.png b/resources/view_left.png
deleted file mode 100644 (file)
index dbc06cc..0000000
Binary files a/resources/view_left.png and /dev/null differ
diff --git a/resources/view_pan.png b/resources/view_pan.png
deleted file mode 100644 (file)
index 038fba1..0000000
Binary files a/resources/view_pan.png and /dev/null differ
diff --git a/resources/view_reset.png b/resources/view_reset.png
deleted file mode 100644 (file)
index 1285064..0000000
Binary files a/resources/view_reset.png and /dev/null differ
diff --git a/resources/view_right.png b/resources/view_right.png
deleted file mode 100644 (file)
index 598def4..0000000
Binary files a/resources/view_right.png and /dev/null differ
diff --git a/resources/view_rotate.png b/resources/view_rotate.png
deleted file mode 100644 (file)
index 80926c5..0000000
Binary files a/resources/view_rotate.png and /dev/null differ
diff --git a/resources/view_top.png b/resources/view_top.png
deleted file mode 100644 (file)
index ebbf34d..0000000
Binary files a/resources/view_top.png and /dev/null differ
diff --git a/resources/view_triedre.png b/resources/view_triedre.png
deleted file mode 100644 (file)
index 3eed48d..0000000
Binary files a/resources/view_triedre.png and /dev/null differ
diff --git a/resources/view_zoom.png b/resources/view_zoom.png
deleted file mode 100644 (file)
index b465739..0000000
Binary files a/resources/view_zoom.png and /dev/null differ
index d70c01d806f9f2871978cdd1411d9db191e43dbc..b37265c5f24e2f75128f786fa4058109d2b97949 100755 (executable)
@@ -1,36 +1,35 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef CAF_H
 #define CAF_H
 
-#if defined CAF_EXPORTS
-#if defined WNT
-#define CAF_EXPORT __declspec( dllexport )
+#if defined WIN32
+#  if defined CAF_EXPORTS
+#    define CAF_EXPORT __declspec( dllexport )
+#  else
+#    define CAF_EXPORT __declspec( dllimport )
+#  endif
 #else
-#define CAF_EXPORT
-#endif
-#else
-#if defined WNT
-#define CAF_EXPORT __declspec( dllimport )
-#else
-#define CAF_EXPORT
-#endif
+#  define CAF_EXPORT
 #endif
 
 #if defined SOLARIS
@@ -39,7 +38,7 @@
 #define true  1
 #endif
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
 
diff --git a/src/CAF/CAF.pro b/src/CAF/CAF.pro
new file mode 100644 (file)
index 0000000..9b05bd5
--- /dev/null
@@ -0,0 +1,59 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = caf
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+INCLUDEPATH += ../../include ../Qtx ../SUIT ../STD
+LIBS += -L../../lib -lqtx -lsuit -lstd
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += CAF_EXPORTS
+
+HEADERS  = CAF.h
+HEADERS += CAF_Application.h
+HEADERS += CAF_Operation.h
+HEADERS += CAF_Study.h
+HEADERS += CAF_Tools.h
+
+SOURCES  = CAF_Application.cxx
+SOURCES += CAF_Operation.cxx
+SOURCES += CAF_Study.cxx
+SOURCES += CAF_Tools.cxx
+
+TRANSLATIONS = resources/CAF_images.ts \
+               resources/CAF_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm resources/*.xml resources/*.ini
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 78bc1d566264bd8a0184e385099a57f8b6a24c8a..d92c181d93f3a103335a29273e50e748fd822661 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "CAF_Application.h"
 
 #include "CAF_Study.h"
 
 #include <SUIT_Desktop.h>
-#include <SUIT_Session.h>
-#include <SUIT_ViewModel.h>
-#include <SUIT_Operation.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 
+#include <QtxAction.h>
 #include <QtxListAction.h>
 
-#include <qtoolbar.h>
-#include <qmenubar.h>
-#include <qpopupmenu.h>
-#include <qstatusbar.h>
-#include <qapplication.h>
+#include <QMap>
+#include <QStringList>
 
 #include <Resource_Manager.hxx>
-
 #include <TColStd_SequenceOfExtendedString.hxx>
 
+/*!
+  \brief Create new instance of CAF_Application.
+  \return new instance of CAF_Application class
+*/
 extern "C" CAF_EXPORT SUIT_Application* createApplication()
 {
   return new CAF_Application();
 }
 
 /*!
-  Default constructor
+  \class CAF_Application
+  \brief OCC OCAF-based application.
+
+  Defines application configuration and behaviour for application using 
+  standard OCC OCAF data model. Allows using OCC OCAF serives
+  (for example, undo/redo mechanizm).
+*/
+
+/*!
+  \brief Default constructor.
 */
 CAF_Application::CAF_Application()
 : STD_Application()
@@ -54,23 +64,24 @@ CAF_Application::CAF_Application()
 }
 
 /*!
-  Constructor with OCAF application
-  \param app OCAF application
+  \brief Constructor.
+  \param app OCAF application
 */
 CAF_Application::CAF_Application( const Handle( TDocStd_Application )& app )
 : STD_Application(),
-myStdApp( app )
+  myStdApp( app )
 {
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 CAF_Application::~CAF_Application()
 {
 }
 
 /*!
+  \brief Get application name.
   \return application name
 */
 QString CAF_Application::applicationName() const
@@ -79,7 +90,8 @@ QString CAF_Application::applicationName() const
 }
 
 /*!
-  \return OCAF application
+  \brief Get OCAF application.
+  \return handle to OCAF application object
 */
 Handle( TDocStd_Application ) CAF_Application::stdApp() const
 {
@@ -87,12 +99,16 @@ Handle( TDocStd_Application ) CAF_Application::stdApp() const
 }
 
 /*!
-  \return file filters for open/save document
+  \brief Get file extension filter.
+
+  The file extension filter is used in Open/Save dialog boxes.
+
+  \return file filters for open/save document dialog box
 */
 QString CAF_Application::getFileFilter() const
 {
   if ( stdApp().IsNull() )
-    return QString::null;
+    return QString();
 
   TColStd_SequenceOfExtendedString formats;
   stdApp()->Formats( formats );
@@ -104,13 +120,13 @@ QString CAF_Application::getFileFilter() const
   {
     QString extension;
     QString extResStr = CAF_Tools::toQString( formats.Value( i ) ) + QString( ".FileExtension" );
-    if ( resMgr->Find( (char*)extResStr.latin1() ) )
-      extension = QString( resMgr->Value( (char*)extResStr.latin1() ) );
+    if ( resMgr->Find( extResStr.toLatin1().data() ) )
+      extension = QString( resMgr->Value( extResStr.toLatin1().data() ) );
 
     QString descr;
     QString descrResStr = CAF_Tools::toQString( formats.Value( i ) ) + QString( ".Description" );
-    if ( resMgr->Find( (char*)descrResStr.latin1() ) )
-      descr = QString( resMgr->Value( (char*)descrResStr.latin1() ) );
+    if ( resMgr->Find( (char*)descrResStr.toLatin1().data() ) )
+      descr = QString( resMgr->Value( (char*)descrResStr.toLatin1().data() ) );
 
     if ( !descr.isEmpty() && !extension.isEmpty() )
     {
@@ -122,11 +138,11 @@ QString CAF_Application::getFileFilter() const
   }
 
   if ( wildCards.isEmpty() )
-    return QString::null;
+    return QString();
 
   QStringList filters;
   for ( QMap<QString, QStringList>::ConstIterator it = wildCards.begin(); it != wildCards.end(); ++it )
-    filters.append( QString( "%1 (%2)" ).arg( it.key() ).arg( it.data().join( "; " ) ) );
+    filters.append( QString( "%1 (%2)" ).arg( it.key() ).arg( it.value().join( "; " ) ) );
 
   if ( wildCards.count() > 1 )
     filters.prepend( QString( "%1 (%2)" ).arg( tr( "INF_ALL_DOCUMENTS_FILTER" ) ).arg( allWC.join( "; " ) ) );
@@ -138,7 +154,7 @@ QString CAF_Application::getFileFilter() const
 }
 
 /*!
-  Creates actions of application
+  \brief Create menu and toolbars actions.
 */
 void CAF_Application::createActions()
 {
@@ -147,22 +163,25 @@ void CAF_Application::createActions()
   SUIT_Desktop* desk = desktop();
   SUIT_ResourceMgr* resMgr = resourceMgr();
 
-  QtxListAction* editUndo =
-    new QtxListAction( tr( "TOT_APP_EDIT_UNDO" ), resMgr->loadPixmap( "CAF", tr( "ICON_APP_EDIT_UNDO" ) ),
-                                        tr( "MEN_APP_EDIT_UNDO" ), CTRL+Key_Z, desk );
+  QtxListAction* editUndo = 
+    new QtxListAction( tr( "TOT_APP_EDIT_UNDO" ), 
+                      resMgr->loadPixmap( "STD", tr( "ICON_EDIT_UNDO" ) ),
+                      tr( "MEN_APP_EDIT_UNDO" ), Qt::CTRL+Qt::Key_Z, desk );
+  editUndo->setStatusTip( tr( "PRP_APP_EDIT_UNDO" ) );
   registerAction( EditUndoId, editUndo );
 
   QtxListAction* editRedo =
-    new QtxListAction( tr( "TOT_APP_EDIT_REDO" ), resMgr->loadPixmap( "CAF", tr( "ICON_APP_EDIT_REDO" ) ),
-                                        tr( "MEN_APP_EDIT_REDO" ), CTRL+Key_Y, desk );
+    new QtxListAction( tr( "TOT_APP_EDIT_REDO" ), 
+                      resMgr->loadPixmap( "STD", tr( "ICON_EDIT_REDO" ) ),
+                      tr( "MEN_APP_EDIT_REDO" ), Qt::CTRL+Qt::Key_Y, desk );
+  editRedo->setStatusTip( tr( "PRP_APP_EDIT_REDO" ) );
   registerAction( EditRedoId, editRedo );
 
   editUndo->setComment( tr( "INF_APP_UNDOACTIONS" ) );
   editRedo->setComment( tr( "INF_APP_REDOACTIONS" ) );
 
-  connect( editUndo, SIGNAL( activated( int ) ), this, SLOT( onUndo( int ) ) );
-  connect( editRedo, SIGNAL( activated( int ) ), this, SLOT( onRedo( int ) ) );
-
+  connect( editUndo, SIGNAL( triggered( int ) ), this, SLOT( onUndo( int ) ) );
+  connect( editRedo, SIGNAL( triggered( int ) ), this, SLOT( onRedo( int ) ) );
 
   int editMenu = createMenu( tr( "MEN_DESK_EDIT" ), -1, -1, 10 );
 
@@ -179,7 +198,9 @@ void CAF_Application::createActions()
 }
 
 /*!
-    Undo operation on the given document. [ virtual protected ]
+  \brief Undo latest command operation for specified document.
+  \param doc OCAF document
+  \return \c true on success
 */
 bool CAF_Application::undo( CAF_Study* doc )
 {
@@ -193,7 +214,9 @@ bool CAF_Application::undo( CAF_Study* doc )
 }
 
 /*!
-    Redo operation on the given document. [ virtual protected ]
+  \brief Redo latest command operation undo for specified document.
+  \param doc OCAF document
+  \return \c true on success
 */
 bool CAF_Application::redo(CAF_Study* doc)
 {
@@ -207,69 +230,79 @@ bool CAF_Application::redo(CAF_Study* doc)
 }
 
 /*!
-    Undo operation on the active document. [ virtual protected slot ]
+  \brief Called when user activates "Undo" menu action.
+  
+  Undo operation on the active document.
+
+  \param numActions undo depth (number of commands)
+  \return \c true on success
 */
 bool CAF_Application::onUndo( int numActions )
 {
   bool ok = true;
   while ( numActions > 0 )
   {
-         CAF_Study* cafStudy = dynamic_cast<CAF_Study*>( activeStudy() );
-               if ( cafStudy )
+    CAF_Study* cafStudy = dynamic_cast<CAF_Study*>( activeStudy() );
+    if ( cafStudy )
     {
-           if ( !undo( cafStudy ) )
-                 {
-                         ok = false;
-                               break;
-                       }
-                       numActions--;
-               }
+      if ( !undo( cafStudy ) )
+      {
+       ok = false;
+       break;
+      }
+      numActions--;
+    }
   }
   updateCommandsStatus();     /* enable/disable undo/redo */
   return ok;
 }
 
 /*!
-    Redo operation on the active document. [ virtual protected slot ]
+  \brief Called when user activates "Redo" menu action.
+  
+  Redo latest undo commands on the active document.
+
+  \param numActions redo depth (number of commands)
+  \return \c true on success
 */
 bool CAF_Application::onRedo( int numActions )
 {
   bool ok = true;
   while ( numActions > 0 )
   {
-         CAF_Study* cafStudy = dynamic_cast<CAF_Study*>( activeStudy() );
-               if ( cafStudy )
+    CAF_Study* cafStudy = dynamic_cast<CAF_Study*>( activeStudy() );
+    if ( cafStudy )
     {
-                       if ( !redo( cafStudy ) )
-                       {
-             ok = false;
-                   break;
-                       }
-                       numActions--;
-               }
+      if ( !redo( cafStudy ) )
+      {
+       ok = false;
+       break;
+      }
+      numActions--;
+    }
   }
   updateCommandsStatus();     /* enable/disable undo/redo */
   return ok;
 }
 
 /*!
-  Enables / disables the actions according to the application state. [ virtual protected ]
+  \brief Update actions state (Undo/Redo).
 */
 void CAF_Application::updateCommandsStatus()
 {
-       STD_Application::updateCommandsStatus();
+  STD_Application::updateCommandsStatus();
 
   CAF_Study* cafStudy = 0;
   if ( activeStudy() && activeStudy()->inherits( "CAF_Study" ) )
     cafStudy = (CAF_Study*)activeStudy();
 
-  QAction* undo = action( EditUndoId );
+  QtxListAction* undo = qobject_cast<QtxListAction*>( action( EditUndoId ) );
   if ( cafStudy && undo )
-    undo->setProperty( "names", cafStudy->undoNames() );
+    undo->addNames( cafStudy->undoNames() );
 
-  QAction* redo = action( EditRedoId );
+  QtxListAction* redo = qobject_cast<QtxListAction*>( action( EditRedoId ) );
   if ( cafStudy && redo )
-    redo->setProperty( "names", cafStudy->redoNames() );
+    redo->addNames( cafStudy->redoNames() );
 
   if ( undo )
     undo->setEnabled( cafStudy && cafStudy->canUndo() );
@@ -278,15 +311,16 @@ void CAF_Application::updateCommandsStatus()
 }
 
 /*!
-  SLOT: called by clicking on Help->About in main menu
+  \brief Called when user activatees Help->About main menu command.
 */
 void CAF_Application::onHelpAbout()
 {
-  SUIT_MessageBox::info1( desktop(), tr( "About" ), tr( "ABOUT_INFO" ), "&OK" );
+  SUIT_MessageBox::information( desktop(), tr( "About" ), tr( "ABOUT_INFO" ) );
 }
 
 /*!
-  Creates new study
+  \brief Create new empty study.
+  \return new study
 */
 SUIT_Study* CAF_Application::createNewStudy()
 {
@@ -294,7 +328,8 @@ SUIT_Study* CAF_Application::createNewStudy()
 }
 
 /*!
-  Sets OCAF application
+  \brief Set OCAF application.
+  \param app new OCAF application
 */
 void CAF_Application::setStdApp( const Handle(TDocStd_Application)& app )
 {
index 81a16413d394766b3cb93d3438cf412c0af51fa4..c96016680c8c8108dff280a155480407423d703b 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef CAF_APPLICATION_H
 #define CAF_APPLICATION_H
 
 #include "STD_Application.h"
 
-#include <qmap.h>
-#include <qptrlist.h>
-
 #include <TDocStd_Application.hxx>
 
-class QtxAction;
 class CAF_Study;
 
 #if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
 
-/*!
-  \class CAF_Application
-  Defines application configuration and behaviour for application with 
-  link to standard OCC OCAF data model. Allows to use OCC OCAF serives
-  (for example, undo/redo)
-*/
 class CAF_EXPORT CAF_Application : public STD_Application
 {
   Q_OBJECT
@@ -72,8 +65,8 @@ protected:
 
   virtual SUIT_Study*         createNewStudy();
 
-  bool                                         undo( CAF_Study* doc );
-  bool                                         redo( CAF_Study* doc );
+  bool                        undo( CAF_Study* doc );
+  bool                        redo( CAF_Study* doc );
 
   virtual void                setStdApp( const Handle(TDocStd_Application)& );
 
index 67fd2785fb1d6b6cb26453fcab5f5ec1f0a7bb81..41ca0863509eefb6b6b64b38a6e4ce3c3646e030 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "CAF_Operation.h"
 
 #include <TDocStd_Document.hxx>
 
 /*!
-  Default constructor
+  \class CAF_Operation
+  \brief Base operation class for all operations used in CAF package.
+  
+  Operation interacts with OCC OCAF std document.
+*/
+
+/*!
+  \brief Constructor.
+  \param theApp application
 */
 CAF_Operation::CAF_Operation(SUIT_Application* theApp)
-:SUIT_Operation(theApp)
+: SUIT_Operation(theApp)
 {
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 CAF_Operation::~CAF_Operation()
 {
 }
 
 /*!
-  \return OCAF document
+  \brief Get OCAF document.
+  \return handle to the OCAF document object
 */
 Handle(TDocStd_Document) CAF_Operation::stdDoc() const
 {
   Handle(TDocStd_Document) doc;
-  CAF_Study* s = ::qt_cast<CAF_Study*>( study() );
+  CAF_Study* s = qobject_cast<CAF_Study*>( study() );
   if ( s )
     doc = s->stdDoc();
   return doc;
index d6ae43694c3a49a0cb4585a8a8aae93057fa758e..42781ed14230486c169a4e8601981cb274c46046 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef CAF_OPERATION_H
 #define CAF_OPERATION_H
 
 #include "SUIT_Operation.h"
 
-#include <qobject.h>
-#include <qstring.h>
-
 #include <Standard.hxx>
 
 class CAF_Study;
-//! OCC OCAF Std document
 class Handle(TDocStd_Document);
 
-/*!
-  \class CAF_Operation
-  Base operation for all operations used in CAF package
-  Operation has link to OCC OCAF std document
-*/
 class CAF_EXPORT CAF_Operation : public SUIT_Operation
 {
-       Q_OBJECT
+  Q_OBJECT
 
 public:
-       CAF_Operation( SUIT_Application* );
-       virtual ~CAF_Operation();
+  CAF_Operation( SUIT_Application* );
+  virtual ~CAF_Operation();
 
 protected:
   Handle(TDocStd_Document) stdDoc() const;
index 79d0da098ad6a9a674bf5a92f20ca7039e4de232..fa5dd5787b0c59e7c21052016376e0c9877585de 100755 (executable)
@@ -1,67 +1,82 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "CAF_Study.h"
 
 #include "CAF_Tools.h"
-#include "CAF_Operation.h"
 #include "CAF_Application.h"
 
 #include <SUIT_Desktop.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_Application.h>
 
-#include <qdir.h>
+#include <QDir>
 
 #include <TDF_Delta.hxx>
 #include <TDF_ListIteratorOfDeltaList.hxx>
+#include <TDocStd_Application.hxx>
 
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx>
 
 /*!
-  Constructor
+  \class CAF_Study
+  \brief Represents study for using in CAF module.
+
+  A study contains reference to OCAF std document and allows using OCAF services.
+  Provides necessary functionality for OCC transactions management.
+*/
+
+/*!
+  \brief Constructor.
+  \param theApp application
 */
 CAF_Study::CAF_Study(SUIT_Application* theApp)
 : SUIT_Study( theApp ),
-myModifiedCnt( 0 )
+  myModifiedCnt( 0 )
 {
 }
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param theApp application
+  \param aStdDoc OCAF document
 */
 CAF_Study::CAF_Study(SUIT_Application* theApp, Handle (TDocStd_Document)& aStdDoc)
 : SUIT_Study( theApp ),
-myStdDoc( aStdDoc ),
-myModifiedCnt( 0 )
+  myStdDoc( aStdDoc ),
+  myModifiedCnt( 0 )
 {
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 CAF_Study::~CAF_Study()
 {
 }
 
 /*!
-  \return OCAF document
+  \brief Get OCAF document.
+  \return handle to the OCAF document object
 */
 Handle(TDocStd_Document) CAF_Study::stdDoc() const
 {
@@ -69,8 +84,8 @@ Handle(TDocStd_Document) CAF_Study::stdDoc() const
 }
 
 /*!
-  Sets new OCAF document
-  \param aStdDoc new OCAF document
+  \brief Set OCAF document.
+  \param aStdDoc new OCAF document
 */
 void CAF_Study::setStdDoc( Handle(TDocStd_Document)& aStdDoc )
 {
@@ -78,14 +93,16 @@ void CAF_Study::setStdDoc( Handle(TDocStd_Document)& aStdDoc )
 }
 
 /*!
-  Custom document initialization
+  \brief Customize document initialization.
+  \param doc study name
+  \return \c true on success and \c false on error
 */
-void CAF_Study::createDocument()
+bool CAF_Study::createDocument( const QString& doc )
 {
-  SUIT_Study::createDocument();
+  bool res = SUIT_Study::createDocument( doc );
 
   CAF_Application* app = cafApplication();
-  if ( app && !app->stdApp().IsNull() )
+  if ( res && app && !app->stdApp().IsNull() )
   {
     try {
 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
@@ -97,25 +114,29 @@ void CAF_Study::createDocument()
         app->stdApp()->NewDocument( formats.First(), myStdDoc );
     }
     catch ( Standard_Failure ) {
+      res = false;
     }
   }
+  return res;
 }
 
 /*!
-  Close document
+  \brief Close document.
+  \param permanently if \c true, a document is closed permanently
 */
-void CAF_Study::closeDocument( bool permanent )
+void CAF_Study::closeDocument( bool permanently )
 {
   Handle(TDocStd_Application) app = stdApp();
   if ( !app.IsNull() && !stdDoc().IsNull() )
     app->Close( stdDoc() );
 
-  SUIT_Study::closeDocument( permanent );
+  SUIT_Study::closeDocument( permanently );
 }
 
 /*!
-  Open document
-  \param fname - name of file
+  \brief Open document.
+  \param fname study file name
+  \return \c true on success and \c false if document cannot be opened
 */
 bool CAF_Study::openDocument( const QString& fname )
 {
@@ -138,8 +159,8 @@ bool CAF_Study::openDocument( const QString& fname )
 }
 
 /*!
-  Save document with other name
-  \param fname - name of file
+  \brief Save document with other name.
+  \param fname study file name
 */
 bool CAF_Study::saveDocumentAs( const QString& fname )
 {
@@ -186,7 +207,8 @@ bool CAF_Study::saveDocumentAs( const QString& fname )
 }
 
 /*!
-  Open OCAF transaction
+  \brief Open OCAF transaction.
+  \return \c true if transaction is opened successfully
 */
 bool CAF_Study::openTransaction()
 {
@@ -211,7 +233,8 @@ bool CAF_Study::openTransaction()
 }
 
 /*!
-  Abort OCAF transaction
+  \brief Abort OCAF transaction.
+  \return \c true if transaction is aborted successfully
 */
 bool CAF_Study::abortTransaction()
 {
@@ -233,7 +256,8 @@ bool CAF_Study::abortTransaction()
 }
 
 /*!
-  Commit OCAF transaction
+  \brief Commit OCAF transaction
+  \return \c true if transaction is committed successfully
 */
 bool CAF_Study::commitTransaction( const QString& name )
 {
@@ -261,7 +285,8 @@ bool CAF_Study::commitTransaction( const QString& name )
 }
 
 /*!
-  \return true, if there is opened OCAF transaction
+  \brief Check if there is any transaction opened.
+  \return \c true if there is opened OCAF transaction
 */
 bool CAF_Study::hasTransaction() const
 {
@@ -272,7 +297,8 @@ bool CAF_Study::hasTransaction() const
 }
 
 /*!
-  \return whether the document was saved in file. [ public ]
+  \brief Check if the study is saved.
+  \return \c true if the document has been saved to file
 */
 bool CAF_Study::isSaved() const
 {
@@ -283,7 +309,8 @@ bool CAF_Study::isSaved() const
 }
 
 /*!
-  \return whether the document is modified. [ public ]
+  \brief Check if the study is modified.
+  \return \c true if the document has been modified
 */
 bool CAF_Study::isModified() const
 {
@@ -295,24 +322,30 @@ bool CAF_Study::isModified() const
 }
 
 /*!
-    Increments modification count. If 'undoable' is 'true', this modification
-    can be rolled back by 'undoModified' otherwise the document will be marked
-    as 'modiifed' until saved. [ protected ]
+  \brief Increment modifications count.
+
+  If \a undoable is \c true, this modification can be rolled back by
+  undoModified(), otherwise the document will be marked as \c modified
+  until it is saved.
+
+  \param undoable if \c true the operation is undoable
+  \sa undoModified(), clearModified()
 */
 void CAF_Study::doModified( bool undoable )
 {
-       if ( myStdDoc.IsNull() )
+  if ( myStdDoc.IsNull() )
     return;
 
-       myModifiedCnt++;
+  myModifiedCnt++;
 
-    /*  Assumed that number of available undos / redos is NOT changed dynamically */
-       if ( !undoable )
+  /*  Assumed that number of available undos / redos is NOT changed dynamically */
+  if ( !undoable )
     myModifiedCnt += myStdDoc->GetAvailableUndos();
 }
 
 /*!
-    Decrements modification count. [ protected ]
+  \brief Decrement modifications count.
+  \sa doModified(), clearModified()
 */
 void CAF_Study::undoModified()
 {
@@ -320,7 +353,8 @@ void CAF_Study::undoModified()
 }
 
 /*!
-    Clears modification count. [ public ]
+  \brief Clear modifications count.
+  \sa doModified(), undoModified()
 */
 void CAF_Study::clearModified()
 {
@@ -328,7 +362,8 @@ void CAF_Study::clearModified()
 }
 
 /*!
-    Undoes the last command. [ public ]
+  \brief Undo the last command.
+  \return \c true on success and \c false on error
 */
 bool CAF_Study::undo()
 {
@@ -343,15 +378,16 @@ bool CAF_Study::undo()
     undoModified();     /* decrement modification counter */
   }
   catch ( Standard_Failure ) {
-    SUIT_MessageBox::error1(application()->desktop(), tr( "ERR_ERROR" ),
-                            tr( "ERR_DOC_UNDO" ), tr ( "BUT_OK" ));
+    SUIT_MessageBox::critical(application()->desktop(), tr( "ERR_ERROR" ),
+                             tr( "ERR_DOC_UNDO" ));
     return false;
   }
   return true;
 }
 
 /*!
-    Redoes the last undo. [ public ]
+  \brief Redo the last undo.
+  \return \c true on success and \c false on error
 */
 bool CAF_Study::redo()
 {
@@ -366,15 +402,16 @@ bool CAF_Study::redo()
     doModified();      /* increment modification counter */
   }
   catch ( Standard_Failure ) {
-    SUIT_MessageBox::error1( application()->desktop(), tr( "ERR_ERROR" ),
-                             tr( "ERR_DOC_REDO" ), tr ( "BUT_OK" ) );
+    SUIT_MessageBox::critical( application()->desktop(), tr( "ERR_ERROR" ),
+                              tr( "ERR_DOC_REDO" ) );
     return false;
   }
   return true;
 }
 
 /*!
-  \return true if possible to perform 'undo' command. [ public ]
+  \brief Check if it is possible to undo last command.
+  \return \c true if undo is avaiable
 */
 bool CAF_Study::canUndo() const
 {
@@ -385,7 +422,8 @@ bool CAF_Study::canUndo() const
 }
 
 /*!
-  \return true if possible to perform 'redo' command. [ public ]
+  \brief Check if it is possible to redo last undo.
+  \return \c true if redo is avaiable
 */
 bool CAF_Study::canRedo() const
 {
@@ -396,7 +434,8 @@ bool CAF_Study::canRedo() const
 }
 
 /*!
-  \return the list of names of 'undo' actions available. [ public ]
+  \brief Get names of available undo commands.
+  \return list of commands names
 */
 QStringList CAF_Study::undoNames() const
 {
@@ -410,7 +449,8 @@ QStringList CAF_Study::undoNames() const
 }
 
 /*!
-  \return the list of names of 'redo' actions available. [ public ]
+  \brief Get names of available redo commands.
+  \return list of commands names
 */
 QStringList CAF_Study::redoNames() const
 {
@@ -424,7 +464,8 @@ QStringList CAF_Study::redoNames() const
 }
 
 /*!
-  \return the standard OCAF application from owner application. [ protected ]
+  \brief Get OCAF application.
+  \return handle to the OCAF application object
 */
 Handle(TDocStd_Application) CAF_Study::stdApp() const
 {
@@ -436,9 +477,10 @@ Handle(TDocStd_Application) CAF_Study::stdApp() const
 }
 
 /*!
-  \return the application casted to type CAF_Application. [ protected ]
+  \brief Get application.
+  \return application object (CAF_Application)
 */
 CAF_Application* CAF_Study::cafApplication() const
 {
-  return ::qt_cast<CAF_Application*>( application() );
+  return qobject_cast<CAF_Application*>( application() );
 }
index 0e5980cc970e2e7ef4042b283c342f4b2ec56c6d..4cde4fff96acf6020908249c3bd636ed435f3e40 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef CAF_STUDY_H
 #define CAF_STUDY_H
 
 #include "SUIT_Study.h"
 
-#include <qobject.h>
-
 #include <TDocStd_Document.hxx>
-#include <TDocStd_Application.hxx>
 
 class CAF_Application;
+class Handle(TDocStd_Application);
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
 
-/*!
-  \class CAF_Study
-  Represents study for using in CAF, contains reference
-  to OCAF std document and allows to use OCAF services.
-  Provides necessary functionality for OCC transactions management.
-*/
 class CAF_EXPORT CAF_Study : public SUIT_Study
 {
   Q_OBJECT
 
 public:
-       CAF_Study( SUIT_Application* theApp );
-       CAF_Study( SUIT_Application* theApp, Handle(TDocStd_Document)& aStdDoc );
-       virtual ~CAF_Study();
+  CAF_Study( SUIT_Application* theApp );
+  CAF_Study( SUIT_Application* theApp, Handle(TDocStd_Document)& aStdDoc );
+  virtual ~CAF_Study();
 
-  virtual void                createDocument();
+  virtual bool                createDocument( const QString& );
   virtual void                closeDocument( bool = true );
   virtual bool                openDocument( const QString& );
 
   virtual bool                saveDocumentAs( const QString& );
 
   bool                        isSaved() const;
-       bool                        isModified() const;
-       void                        doModified( bool = true );
-       void                        undoModified();
-       void                        clearModified();
-
+  bool                        isModified() const;
+  void                        doModified( bool = true );
+  void                        undoModified();
+  void                        clearModified();
+  
   bool                        undo();
-       bool                        redo();
-       bool                        canUndo() const;
-       bool                        canRedo() const;
-       QStringList                 undoNames() const;
-       QStringList                 redoNames() const;
-
+  bool                        redo();
+  bool                        canUndo() const;
+  bool                        canRedo() const;
+  QStringList                 undoNames() const;
+  QStringList                 redoNames() const;
+  
   Handle(TDocStd_Document)    stdDoc() const;
 
 protected:
@@ -77,18 +72,18 @@ protected:
   virtual bool                openTransaction();
   virtual bool                abortTransaction();
   virtual bool                hasTransaction() const;
-  virtual bool                commitTransaction( const QString& = QString::null );
+  virtual bool                commitTransaction( const QString& = QString() );
 
   virtual void                setStdDoc( Handle(TDocStd_Document)& );
 
 private:
-       Handle(TDocStd_Document)    myStdDoc;
-       int                         myModifiedCnt;
+  Handle(TDocStd_Document)    myStdDoc;
+  int                         myModifiedCnt;
 
   friend class CAF_Operation;
 };
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( default: 4251 )
 #endif
 
index f637a3e876e17be555459f03bdedc77262bf957f..f3ea13ed2f2a102d7702ede7f11bc90b98d88dc3 100755 (executable)
@@ -1,31 +1,38 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : CAF_Tools.cxx
 //  Author : UI team
-
+//
 #include "CAF_Tools.h"
 
-#include <string.h>
-#include <TCollection_ExtendedString.hxx>
+/*!
+  \class CAF_Tools
+  \brief Prodives a set of helpful static methods.
+*/
 
 /*!
-    Converts TCollection_ExtendedString 'src' to Qt string. [ static ]
+  \brief Convert TCollection_ExtendedString \a src to QString.
+  \param src string to be converted
+  \return resulting QString object
 */
 QString CAF_Tools::toQString ( const TCollection_ExtendedString& src )
 {
@@ -33,7 +40,9 @@ QString CAF_Tools::toQString ( const TCollection_ExtendedString& src )
 }
 
 /*!
-    Converts TCollection_AsciiString'src' to Qt string. [ static ]
+  \brief Convert TCollection_AsciiString \a src to QString.
+  \param src string to be converted
+  \return resulting QString object
 */
 QString CAF_Tools::toQString( const TCollection_AsciiString& src )
 {
@@ -41,18 +50,22 @@ QString CAF_Tools::toQString( const TCollection_AsciiString& src )
 }
 
 /*!
-    Converts Qt string to TCollection_AsciiString. [ static ]
+  \brief Convert QString \a src to TCollection_AsciiString.
+  \param src string to be converted
+  \return resulting TCollection_AsciiString object
 */
 TCollection_AsciiString CAF_Tools::toAsciiString( const QString& src )
 {
   TCollection_AsciiString res;
   if ( !src.isEmpty() )
-    res = TCollection_AsciiString( (char*)src.latin1() );
+    res = TCollection_AsciiString( src.toLatin1().data() );
   return res;
 }
 
 /*!
-    Converts Qt string to TCollection_ExtendedString. [ static ]
+  \brief Convert QString \a src to TCollection_ExtendedString.
+  \param src string to be converted
+  \return resulting TCollection_ExtendedString object
 */
 TCollection_ExtendedString CAF_Tools::toExtString ( const QString& src )
 {
@@ -63,7 +76,9 @@ TCollection_ExtendedString CAF_Tools::toExtString ( const QString& src )
 }
 
 /*!
-    Converts Qt color to OCC color
+  \brief Convert QColor object to Quantity_Color object.
+  \param c color object in Qt format
+  \return color object in OCC format
 */
 Quantity_Color CAF_Tools::color( const QColor& c )
 {
@@ -75,7 +90,9 @@ Quantity_Color CAF_Tools::color( const QColor& c )
 }
 
 /*!
-    Converts OCC color to Qt color
+  \brief Convert Quantity_Color object to QColor object.
+  \param c color object in OCC format
+  \return color object in Qt format
 */
 QColor CAF_Tools::color( const Quantity_Color& c )
 {
index c0183586e0975db7d74948e583eb3803d5b02036..2674afeb54016d7d0ae2656a93b4cea85ec4a671 100755 (executable)
@@ -1,42 +1,41 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : CAF_Tools.h
 //  Author : UI team
-
+//
 #ifndef CAF_TOOLS_H
 #define CAF_TOOLS_H
 
-#include <CAF.h>
+#include "CAF.h"
 
 #include <SUIT_Tools.h>
 
-#include <qcolor.h>
+#include <QColor>
 
 #include <Quantity_Color.hxx>
 
 #include <TCollection_AsciiString.hxx>
 #include <TCollection_ExtendedString.hxx>
 
-/*!
-  \class CAF_Tools
-  Prodives set of auxiliary static methods
-*/
 class CAF_EXPORT CAF_Tools : public SUIT_Tools
 {
 public:
index f60c261af45ca25ea4071040f37fc4c724395af9..578822503e16ef332fa32e94cd885ae798d2a354 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : caf
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libcaf.la
 
-salomeinclude_HEADERS= \
-       CAF.h \
-       CAF_Application.h \
-       CAF_Operation.h \
-       CAF_Study.h \
+salomeinclude_HEADERS =                \
+       CAF.h                   \
+       CAF_Application.h       \
+       CAF_Operation.h         \
+       CAF_Study.h             \
        CAF_Tools.h
 
-dist_libcaf_la_SOURCES= \
-       CAF_Application.cxx \
-       CAF_Operation.cxx \
-       CAF_Study.cxx \
+dist_libcaf_la_SOURCES =       \
+       CAF_Application.cxx     \
+       CAF_Operation.cxx       \
+       CAF_Study.cxx           \
        CAF_Tools.cxx           
 
-MOC_FILES= \
-       CAF_Application_moc.cxx \
-       CAF_Operation_moc.cxx \
+MOC_FILES =                    \
+       CAF_Application_moc.cxx \
+       CAF_Operation_moc.cxx   \
        CAF_Study_moc.cxx
-nodist_libcaf_la_SOURCES= $(MOC_FILES)
-
-dist_salomeres_DATA = \
-       resources/redo.png \
-       resources/undo.png
+nodist_libcaf_la_SOURCES = $(MOC_FILES)
 
 nodist_salomeres_DATA = \
-       CAF_images.qm \
        CAF_msg_en.qm
 
-libcaf_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) -I${QTDIR}/src/kernel -I$(QTDIR)/mkspecs/linux-g++ \
-                   -I$(srcdir)/../STD -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
-libcaf_la_LDFLAGS=$(QT_MT_LIBS) $(CAS_OCAF) $(CAS_OCAFVIS)
-libcaf_la_LIBADD=../STD/libstd.la ../SUIT/libsuit.la
+libcaf_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) -I$(srcdir)/../STD -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+libcaf_la_LDFLAGS  = $(QT_MT_LIBS) $(CAS_OCAF) $(CAS_OCAFVIS)
+libcaf_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../STD/libstd.la
 
index 083e775062b992c4b21fc1444a506176d514497e..89a031cc777cc696a2a246c12fca70aa793b04e7 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
index de9372fedfa49bfcdc5a6536b3355df9c06e4994..fcb277584560d032e282dac62ef24b62ba38df4a 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
diff --git a/src/CAF/resources/CAF_msg_en.ts b/src/CAF/resources/CAF_msg_en.ts
new file mode 100644 (file)
index 0000000..06bbb3d
--- /dev/null
@@ -0,0 +1,80 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>CAF_Application</name>
+    <message>
+        <source>MEN_APP_EDIT</source>
+        <translation>&amp;Edit</translation>
+    </message>
+    <message>
+        <source>INF_ALL_FILTER</source>
+        <translation>All Files (*.*)</translation>
+    </message>
+    <message>
+        <source>INF_ALL_DOCUMENTS_FILTER</source>
+        <translation>All Readable Documents</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_EDIT</source>
+        <translation>&amp;Edit</translation>
+    </message>
+    <message>
+        <source>MEN_APP_EDIT_UNDO</source>
+        <translation>&amp;Undo</translation>
+    </message>
+    <message>
+        <source>MEN_APP_EDIT_REDO</source>
+        <translation>&amp;Redo</translation>
+    </message>
+    <message>
+        <source>PRP_APP_EDIT_REDO</source>
+        <translation>Redoes the last operation</translation>
+    </message>
+    <message>
+        <source>PRP_APP_EDIT_UNDO</source>
+        <translation>Undoes the last operation</translation>
+    </message>
+    <message>
+        <source>TOT_APP_EDIT_REDO</source>
+        <translation>Redo</translation>
+    </message>
+    <message>
+        <source>TOT_APP_EDIT_UNDO</source>
+        <translation>Undo</translation>
+    </message>
+    <message>
+        <source>INF_APP_REDOACTIONS</source>
+        <translation> Redoes %1 action(s) </translation>
+    </message>
+    <message>
+        <source>INF_APP_UNDOACTIONS</source>
+        <translation> Undoes %1 action(s) </translation>
+    </message>
+    <message>
+        <source>ABOUT_INFO</source>
+        <translation>SUIT Caf application</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/CAF/resources/redo.png b/src/CAF/resources/redo.png
deleted file mode 100755 (executable)
index ac72e5c..0000000
Binary files a/src/CAF/resources/redo.png and /dev/null differ
diff --git a/src/CAF/resources/undo.png b/src/CAF/resources/undo.png
deleted file mode 100755 (executable)
index 61b1977..0000000
Binary files a/src/CAF/resources/undo.png and /dev/null differ
index b953c9927be718401521753c6fc95a9a268c319a..91efa9af1ff2183f8ace5dc942e7348e5d01a355 100755 (executable)
@@ -1,36 +1,35 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef CAM_H
 #define CAM_H
 
-#if defined CAM_EXPORTS
-#if defined WNT
-#define CAM_EXPORT __declspec( dllexport )
+#if defined WIN32
+#  if defined CAM_EXPORTS
+#    define CAM_EXPORT __declspec( dllexport )
+#  else
+#    define CAM_EXPORT __declspec( dllimport )
+#  endif
 #else
-#define CAM_EXPORT
-#endif
-#else
-#if defined WNT
-#define CAM_EXPORT __declspec( dllimport )
-#else
-#define CAM_EXPORT
-#endif
+#  define CAM_EXPORT
 #endif
 
 #if defined SOLARIS
@@ -39,7 +38,7 @@
 #define true  1
 #endif
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
 
diff --git a/src/CAM/CAM.pro b/src/CAM/CAM.pro
new file mode 100644 (file)
index 0000000..565af14
--- /dev/null
@@ -0,0 +1,61 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = CAM
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+INCLUDEPATH += ../../include ../Qtx ../SUIT ../STD
+LIBS += -L../../lib -lqtx -lsuit -lstd
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += CAM_EXPORTS
+
+HEADERS  = CAM.h
+HEADERS += CAM_Application.h
+HEADERS += CAM_DataModel.h
+HEADERS += CAM_DataObject.h
+HEADERS += CAM_Module.h
+HEADERS += CAM_Study.h
+
+SOURCES  = CAM_Application.cxx
+SOURCES += CAM_DataModel.cxx
+SOURCES += CAM_DataObject.cxx
+SOURCES += CAM_Module.cxx
+SOURCES += CAM_Study.cxx
+
+TRANSLATIONS = resources/CAM_images.ts \
+               resources/CAM_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm resources/*.xml resources/*.ini
+resources.path = ../../resources
+
+INSTALLS += includes resources
index cc2d1f703cacd82b24377e989885aaad3f13c311..354394bfb53e3efe7576061e6f1f8295667ba5c8 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "CAM_Application.h"
 
 #include "CAM_Module.h"
 
 #include <SUIT_Tools.h>
+#include <SUIT_Desktop.h>
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
 
-#include <qfile.h> 
-#include <qfileinfo.h>
-#include <qtextstream.h>
-#include <qlabel.h>
-#include <qfont.h>
-#include <qapplication.h>
-#include <qregexp.h>
+#include <QApplication>
+#include <QRegExp>
 
 #ifdef WIN32
 #include <windows.h>
 #include <dlfcn.h>
 #endif
 
-/*!Create new instance of CAM_Application*/
+/*!
+  \brief Create new instance of CAM_Application.
+  \return new instance of CAM_Application class
+*/
 extern "C" CAM_EXPORT SUIT_Application* createApplication()
 {
   return new CAM_Application();
 }
 
-/*!Constructor. read module list.
- * \param autoLoad - auto load flag.
- */
+/*!
+  \class CAM_Application
+  \brief Introduces an application class which provides modular architecture.
+  
+  This class defines multi-modular application configuration and behaviour.
+  Each module (CAM_Module) can have own data model, document windows and 
+  viewers, etc.
+
+  An application provides all necessary functionality for modules management,
+  like
+  - loading of modules
+  - modules activation/deactivation
+  - etc
+*/
+
+/*!
+  \brief Constructor.
+
+  Read modules list (from command line or from resource file). 
+  If \a autoLoad parameter is \c true all the modules will be loaded
+  immediately after application starting, otherwise each module will
+  be loaded by demand (with activateModule()).
+
+  \param autoLoad auto loading flag
+*/
 CAM_Application::CAM_Application( const bool autoLoad )
 : STD_Application(),
-myModule( 0 ),
-myAutoLoad( autoLoad )
+  myModule( 0 ),
+  myAutoLoad( autoLoad )
 {
   readModuleList();
 }
 
-/*!Destructor. Do nothing.*/
+/*!
+  \brief Destructor.
+
+  Does nothing currently.
+*/
 CAM_Application::~CAM_Application()
 {
 }
 
-/*! Load modules, if \a myAutoLoad flag is true.\n
- * Start application - call start() method from parent class.
- */
+/*! 
+  \brief Start an application.
+
+  Load all modules, if "auto loading" flag has been set to \c true.
+
+  \sa CAM_Application()
+*/
 void CAM_Application::start()
 {
   if ( myAutoLoad )
@@ -72,65 +105,87 @@ void CAM_Application::start()
   STD_Application::start();
 }
 
-/*!Get active module.
- * \retval CAM_Module - active module.
- */
+/*!
+  \brief Get active module.
+  \return active module or 0 if there are no any
+*/
 CAM_Module* CAM_Application::activeModule() const
 {
   return myModule;
 }
 
-/*!Get module with name \a modName from modules list.
- * \retval CAM_Module pointer - module.
- */
+/*!
+  \brief Get the module with specified name.
+  \return module or 0 if not found
+*/
 CAM_Module* CAM_Application::module(  const QString& modName ) const
 {
   CAM_Module* mod = 0;
-  for ( ModuleListIterator it( myModules ); it.current() && !mod; ++it )
-    if ( it.current()->moduleName() == modName )
-      mod = it.current();
+  for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); 
+       it != myModules.end() && !mod; ++it )
+    if ( (*it)->moduleName() == modName )
+      mod = *it;
   return mod;
 }
 
-/*!Gets modules iterator.*/
-CAM_Application::ModuleListIterator CAM_Application::modules() const
+/*!
+  \brief Get all loaded modules.
+  \return list of modules
+*/
+CAM_Application::ModuleList CAM_Application::modules() const
 {
-  return ModuleListIterator( myModules );
+  return myModules;
 }
 
-/*!Gets modules list.
- * \param out - output list of modules.
- */
+/*!
+  \brief Get all loaded modules.
+  \param returning list of modules
+*/
 void CAM_Application::modules( CAM_Application::ModuleList& out ) const
 {
-  out.setAutoDelete( false );
   out.clear();
 
-  for ( ModuleListIterator it( myModules ); it.current(); ++it )
-    out.append( it.current() );
+  for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); 
+       it != myModules.end(); ++it )
+    out.append( *it );
 }
 
-/*!Gets list of names for modules.\n
- * Get loaded modules names, if \a loaded is true, else \n
- * get names from information list.
- * \param lst - output list of names.
- * \param loaded - boolean flag.
- */
+/*!
+  \brief Get names of all modules.
+
+  Get loaded modules names if \a loaded is \c true, 
+  otherwise get all avaiable modules names.
+  
+  \param lst output list of modules names
+  \param loaded boolean flag, defines what modules names to return
+*/
 void CAM_Application::modules( QStringList& lst, const bool loaded ) const
 {
   lst.clear();
 
   if ( loaded )
-    for ( ModuleListIterator it( myModules ); it.current(); ++it )
-      lst.append( it.current()->moduleName() );
+  {
+    for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); 
+         it != myModules.end(); ++it )
+      lst.append( (*it)->moduleName() );
+  }
   else
-    for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end(); ++it )
+  {
+    for ( ModuleInfoList::const_iterator it = myInfoList.begin(); 
+         it != myInfoList.end(); ++it )
       lst.append( (*it).title );
+  }
 }
 
-/*!Adding module \a mod to list.
- *\param mod - module.
- */
+/*!
+  \brief Add module \a mod to the modules list.
+
+  Performes module initialization. Does nothing if the module
+  is already added. 
+  
+  \param mod module being added
+  \sa CAM_Module::initialize()
+*/
 void CAM_Application::addModule( CAM_Module* mod )
 {
   if ( !mod || myModules.contains( mod ) )
@@ -141,7 +196,8 @@ void CAM_Application::addModule( CAM_Module* mod )
   QMap<CAM_Module*, int> map;
 
   ModuleList newList;
-  for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end(); ++it )
+  for ( ModuleInfoList::const_iterator it = myInfoList.begin(); 
+       it != myInfoList.end(); ++it )
   {
     if ( (*it).title == mod->moduleName() )
       newList.append( mod );
@@ -151,17 +207,16 @@ void CAM_Application::addModule( CAM_Module* mod )
       if ( curMod )
         newList.append( curMod );
     }
-    if ( !newList.isEmpty() )
-      map.insert( newList.getLast(), 0 );
   }
 
-  for ( ModuleListIterator itr( myModules ); itr.current(); ++itr )
+  for ( QList<CAM_Module*>::const_iterator it = myModules.begin();
+       it != myModules.end(); ++it )
   {
-    if ( !map.contains( itr.current() ) )
-      newList.append( itr.current() );
+    if ( !newList.contains( *it ) )
+      newList.append( *it );
   }
 
-  if ( !map.contains( mod ) )
+  if ( !newList.contains( mod ) )
       newList.append( mod );
 
   myModules = newList;
@@ -169,9 +224,11 @@ void CAM_Application::addModule( CAM_Module* mod )
   moduleAdded( mod );
 }
 
-/*!Load modules from information list.
- * \warning If some of modules not loaded, error message appear on desktop.
- */
+/*!
+  \brief Load modules from the modules information list.
+  
+  If some module can not be loaded, an error message is shown.
+*/
 void CAM_Application::loadModules()
 {
   for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end(); ++it )
@@ -180,33 +237,38 @@ void CAM_Application::loadModules()
     if ( mod )
       addModule( mod );
     else {
-      if ( desktop() && desktop()->isShown() )
-       SUIT_MessageBox::error1( desktop(), tr( "Loading modules" ),
-                                tr( "Can not load module %1" ).arg( (*it).title ), tr( "Ok" ) );
+      if ( desktop() && desktop()->isVisible() )
+       SUIT_MessageBox::critical( desktop(), tr( "Loading modules" ),
+                                  tr( "Can not load module %1" ).arg( (*it).title ) );
       else
-       qWarning( tr( "Can not load module %1" ).arg( (*it).title ).latin1() ); 
+       qWarning( tr( "Can not load module %1" ).arg( (*it).title ).toLatin1().data() ); 
     }
   }
 }
 
-/*!Load module with name \a modName.
- *\param modName - module name for loading.
- *\warning If information list is empty.
- *\warning If module library (for module with \a modName) is empty.
- *\warning If module library is not loaded.
- */
-CAM_Module* CAM_Application::loadModule( const QString& modName )
+/*!
+  \brief Load module \a modName.
+
+  The function prints warning message if:
+  - modules information list is empty
+  - modules information list does not include specified module info
+  - module library can not be loaded by some reason
+
+  \param modName module name
+  \return module object pointer or 0 if module could not be loaded
+*/
+CAM_Module* CAM_Application::loadModule( const QString& modName, const bool showMsg )
 {
   if ( myInfoList.isEmpty() )
   {
-    qWarning( tr( "Modules configuration is not defined." ) );
+    qWarning( tr( "Modules configuration is not defined." ).toLatin1().data() );
     return 0;
   }
 
   QString libName = moduleLibrary( modName );
   if ( libName.isEmpty() )
   {
-    qWarning( tr( "Information about module \"%1\" doesn't exist." ).arg( modName ) );
+    qWarning( tr( "Information about module \"%1\" doesn't exist." ).arg( modName ).toLatin1().data() );
     return 0;
   }
 
@@ -214,7 +276,7 @@ CAM_Module* CAM_Application::loadModule( const QString& modName )
   GET_MODULE_FUNC crtInst = 0;
 
 #ifdef WIN32
-  HINSTANCE modLib = ::LoadLibrary( libName ); 
+  HINSTANCE modLib = ::LoadLibrary( libName.toLatin1() ); 
   if ( !modLib )
   {
     LPVOID lpMsgBuf;
@@ -236,7 +298,7 @@ CAM_Module* CAM_Application::loadModule( const QString& modName )
     }
   }
 #else
-  void* modLib = dlopen( (char*)libName.latin1(), RTLD_LAZY );
+  void* modLib = dlopen( libName.toLatin1(), RTLD_LAZY );
   if ( !modLib )
     err = QString( "Can not load library %1. %2" ).arg( libName ).arg( dlerror() );
   else
@@ -254,22 +316,21 @@ CAM_Module* CAM_Application::loadModule( const QString& modName )
     module->setName( moduleName( modName ) );
   }
 
-  if ( !err.isEmpty() ) {
-    if ( desktop() && desktop()->isShown() )
-      SUIT_MessageBox::warn1( desktop(), tr( "Error" ), err, tr( "Ok" ) );
+  if ( !err.isEmpty() && showMsg ) {
+    if ( desktop() && desktop()->isVisible() )
+      SUIT_MessageBox::warning( desktop(), tr( "Error" ), err );
     else
-      qWarning( err.latin1() ); 
+      qWarning( err.toLatin1().data() ); 
   }
 
   return module;
 }
 
-/*! @name Activate module group. */
-//@{
-/*!Activate module with name \a modName.
- *\param modName - module name.
- *\ratval true, if module loaded and activated successful, else false.
- */
+/*!
+  \brief Activate module \a modName.
+  \param modName module name
+  \return \c true, if module is loaded and activated successfully and \c false otherwise
+*/
 bool CAM_Application::activateModule( const QString& modName )
 {
   if ( !modName.isEmpty() && !activeStudy() )
@@ -294,11 +355,14 @@ bool CAM_Application::activateModule( const QString& modName )
   return res;
 }
 
-/*!Activate module \a mod
- *\param mod - module for activation.
- *\retval true - if all sucessful.
- *\warning Error message if module not activated in active study.
- */
+/*!
+  \brief Activate module \a mod.
+
+  Shows error message if module could not be activated in the current study.
+
+  \param mod module object pointer
+  \return \c true, if module is loaded and activated successfully and \c false otherwise
+*/
 bool CAM_Application::activateModule( CAM_Module* mod )
 {
   if ( mod && !activeStudy() )
@@ -323,10 +387,10 @@ bool CAM_Application::activateModule( CAM_Module* mod )
     {
       myModule->setMenuShown( false );
       myModule->setToolShown( false );
-      if ( desktop() && desktop()->isShown() )
-       SUIT_MessageBox::error1( desktop(), tr( "ERROR_TLT" ), tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ), tr( "BUT_OK" ) );
+      if ( desktop() && desktop()->isVisible() )
+       SUIT_MessageBox::critical( desktop(), tr( "ERROR_TLT" ), tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ) );
       else
-       qWarning( tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ).latin1() ); 
+       qWarning( tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ).toLatin1().data() ); 
       myModule = 0;
       return false;
     }
@@ -336,17 +400,19 @@ bool CAM_Application::activateModule( CAM_Module* mod )
 
   return true;
 }
-//@}
 
-/*!Create new study for current application.
- *\retval study pointer.
- */
+/*!
+  \brief Create new study.
+  \return study object pointer
+*/
 SUIT_Study* CAM_Application::createNewStudy() 
 { 
   return new CAM_Study( this );
 }
 
-/*!Update commands status for parent class and for current class(if module is active)*/
+/*!
+  \brief Update menu commands status.
+*/
 void CAM_Application::updateCommandsStatus()
 {
   STD_Application::updateCommandsStatus();
@@ -355,37 +421,45 @@ void CAM_Application::updateCommandsStatus()
     activeModule()->updateCommandsStatus();
 }
 
-/*!Close all modules in study \a theDoc.
- *\param theDoc - study
- */
+/*!
+  \brief Prepare application to study closing.
+
+  Closes all modules in study \a theDoc.
+  
+  \param theDoc study
+*/
 void CAM_Application::beforeCloseDoc( SUIT_Study* theDoc )
 {
-  for ( ModuleListIterator it( myModules ); it.current(); ++it )
-    it.current()->studyClosed( theDoc );
+  for ( QList<CAM_Module*>::iterator it = myModules.begin(); it != myModules.end(); ++it )
+    (*it)->studyClosed( theDoc );
 }
 
-/*!Sets active study for parent class.
- *\param study - study.
- */
+/*!
+  \brief Set active study.
+  \param study study to be made active
+*/
 void CAM_Application::setActiveStudy( SUIT_Study* study )
 {
   STD_Application::setActiveStudy( study );
 }
 
-/*!Do nothing.*/
-void CAM_Application::moduleAdded( CAM_Module* mod )
-{
-//  CAM_Study* study = dynamic_cast<CAM_Study*>( activeStudy() );
-//  if ( !study )
-//    return;
+/*!
+  \brief Callback function, called when the module is added to the application.
+  
+  This virtual method can be re-implemented in the successors. Base implementation
+  does nothing.
 
-//  study->insertDataModel( mod->dataModel() );
+  \param mod module being added
+*/
+void CAM_Application::moduleAdded( CAM_Module* /*mod*/ )
+{
 }
 
-/*!Gets module name by title \a title
- *\param title - title name
- *\retval QString module name.
- */
+/*!
+  \brief Get module name by its title (user name).
+  \param title module title (user name)
+  \return module name or null QString if module is not found
+*/
 QString CAM_Application::moduleName( const QString& title ) const
 {
   QString res;
@@ -397,10 +471,11 @@ QString CAM_Application::moduleName( const QString& title ) const
   return res;
 }
 
-/*!Gets module title by module name \a name
- *\param name - module name
- *\retval QString module title.
- */
+/*!
+  \brief Get module title (user name) by its name.
+  \param name module name
+  \return module title (user name) or null QString if module is not found
+*/
 QString CAM_Application::moduleTitle( const QString& name ) const
 {
   QString res;
@@ -412,10 +487,27 @@ QString CAM_Application::moduleTitle( const QString& name ) const
   return res;
 }
 
-/*!Get library name for module with title \a title.
- *\param title - module title name.
- *\param full  - boolean flag (if true - return full library name, else internal name)
- *\retval QString - library name.
+/*!
+  \brief Get module icon name.
+  \param name module name
+  \return module icon or null QString if module is not found
+*/
+QString CAM_Application::moduleIcon( const QString& name ) const
+{
+  QString res;
+  for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end() && res.isNull(); ++it )
+  {
+    if ( (*it).name == name )
+      res = (*it).icon;
+  }
+  return res;
+}
+
+/*!
+  \brief Get module library name by its title (user name).
+  \param title module title (user name)
+  \param full if \c true, return full library name, otherwise return its internal name
+  \return module library name or null QString if module is not found
  */
 QString CAM_Application::moduleLibrary( const QString& title, const bool full ) const
 {
@@ -430,7 +522,26 @@ QString CAM_Application::moduleLibrary( const QString& title, const bool full )
   return res;
 }
 
-/*!Read modules list*/
+/*!
+  \brief Read modules information list
+
+  This function first tries to get the modules names list by parsing
+  the application command line arguments, looking for the
+  "--modules ( <mod_name>[:<mod_name>...] )" option.
+  List of modules is separated by colon symbol (":").
+  
+  If "--modules" command line option is not used, the list of modules
+  is retrieved from the application resource file: parameter "modules" of
+  the section "launch".
+
+  Then the information about each module (module title (user name), 
+  library name) is retrieved from the corresponding section of resource
+  file with help of resources manager.
+
+  Shows the warning message, if module information list is empty.
+
+  \sa SUIT_ResourceMgr
+*/
 void CAM_Application::readModuleList()
 {
   if ( !myInfoList.isEmpty() )
@@ -440,55 +551,83 @@ void CAM_Application::readModuleList()
 
   QStringList modList;
 
-  QStringList args;
-  for (int i = 1; i < qApp->argc(); i++)
-    args.append( qApp->argv()[i] );
-
-  QRegExp rx("--modules\\s+\\(\\s*(.*)\\s*\\)");
-  rx.setMinimal( true );
-  if ( rx.search( args.join(" ") ) >= 0 && rx.capturedTexts().count() > 0 ) {
-    QString modules = rx.capturedTexts()[1];
-    QStringList mods = QStringList::split(":",modules,false);
-    for ( uint i = 0; i < mods.count(); i++ ) {
-      if ( !mods[i].stripWhiteSpace().isEmpty() )
-       modList.append( mods[i].stripWhiteSpace() );
+  QString args = QApplication::arguments().join( " " );
+
+  QRegExp rx1("--modules=([\\w,]*)");
+  rx1.setMinimal( false );
+  QRegExp rx2("--modules\\s+\\(\\s*(.*)\\s*\\)");
+  rx2.setMinimal( true );
+  int pos = 0;
+  while ( 1 ) {
+    QString modules;
+    int pos1 = rx1.indexIn( args, pos );
+    int pos2 = rx2.indexIn( args, pos );
+    if ( pos1 != -1 && pos2 != -1 ) {
+      modules = pos1 < pos2 ? rx1.cap( 1 ) : rx2.cap(1);
+      pos = pos1 < pos2 ? pos1 + rx1.matchedLength() : pos2 + rx2.matchedLength();
+    }
+    else if ( pos1 != -1 ) {
+      modules = rx1.cap( 1 );
+      pos = pos1 + rx1.matchedLength();
+    }
+    else if ( pos2 != -1 ) {
+      modules = rx2.cap( 1 );
+      pos = pos2 + rx2.matchedLength();
+    }
+    else {
+      break;
+    }
+
+    modList.clear();
+    QStringList mods = modules.split( QRegExp( "[:|,\\s]" ), QString::SkipEmptyParts );
+    for ( int i = 0; i < mods.count(); i++ ) {
+      if ( !mods[i].trimmed().isEmpty() )
+       modList.append( mods[i].trimmed() );
     }
   }
+
   if ( modList.isEmpty() ) {
-    QString mods = resMgr->stringValue( "launch", "modules", QString::null );
-    modList = QStringList::split( ",", mods );
+    QString mods = resMgr->stringValue( "launch", "modules", QString() );
+    modList = mods.split( ",", QString::SkipEmptyParts );
   }
 
   for ( QStringList::const_iterator it = modList.begin(); it != modList.end(); ++it )
   {
-    QString modName = (*it).stripWhiteSpace();
+    QString modName = (*it).trimmed();
+
     if ( modName.isEmpty() )
-      continue;
+      continue;  // empty module name
 
-    QString modTitle = resMgr->stringValue( *it, QString( "name" ), QString::null );
+    if ( !moduleTitle( modName ).isEmpty() )
+      continue;  // already added
+
+    QString modTitle = resMgr->stringValue( *it, "name", QString() );
     if ( modTitle.isEmpty() )
-      {
-       printf( "****************************************************************\n" );
-       printf( "*    Warning: %s not found in resources.\n", (*it).latin1() );
-       printf( "*    Module will not be available\n" );
-       printf( "****************************************************************\n" );
-       continue;
-      }
+    {
+      printf( "****************************************************************\n" );
+      printf( "*    Warning: %s not found in resources.\n", (*it).toLatin1().data() );
+      printf( "*    Module will not be available\n" );
+      printf( "****************************************************************\n" );
+      continue;
+    }
+
+    QString modIcon = resMgr->stringValue( *it, "icon", QString() );
 
-    QString modLibrary = resMgr->stringValue( *it, QString( "library" ), QString::null ).stripWhiteSpace();
+    QString modLibrary = resMgr->stringValue( *it, "library", QString() ).trimmed();
     if ( !modLibrary.isEmpty() )
     {
-      QString libExt;
-      modLibrary = SUIT_Tools::file( modLibrary.stripWhiteSpace() );
-      libExt = QString( "so" );
-      if ( SUIT_Tools::extension( modLibrary ).lower() == libExt )
-        modLibrary = modLibrary.mid( 0, modLibrary.length() - libExt.length() - 1 );
-      libExt = QString( "dll" );
-      if ( SUIT_Tools::extension( modLibrary ).lower() == libExt )
-        modLibrary = modLibrary.mid( 0, modLibrary.length() - libExt.length() - 1 );
+      modLibrary = SUIT_Tools::file( modLibrary.trimmed() );
+#ifdef WIN32
+      QString libExt = QString( "dll" );
+#else
+      QString libExt = QString( "so" );
+#endif
+      if ( SUIT_Tools::extension( modLibrary ).toLower() == libExt )
+        modLibrary.truncate( modLibrary.length() - libExt.length() - 1 );
 #ifndef WIN32
-      if ( modLibrary.startsWith( "lib" ) )
-        modLibrary = modLibrary.mid( 3 );
+      QString prefix = QString( "lib" );
+      if ( modLibrary.startsWith( prefix ) )
+        modLibrary.remove( 0, prefix.length() );
 #endif
     }
     else
@@ -498,12 +637,13 @@ void CAM_Application::readModuleList()
     inf.name = modName;
     inf.title = modTitle;
     inf.internal = modLibrary;
+    inf.icon = modIcon;
     myInfoList.append( inf );
   }
 
   if ( myInfoList.isEmpty() ) {
-    if ( desktop() && desktop()->isShown() )
-      SUIT_MessageBox::warn1( desktop(), tr( "Warning" ), tr( "Modules list is empty" ), tr( "&OK" ) );
+    if ( desktop() && desktop()->isVisible() )
+      SUIT_MessageBox::warning( desktop(), tr( "Warning" ), tr( "Modules list is empty" ) );
     else
       {
        printf( "****************************************************************\n" );
@@ -513,19 +653,25 @@ void CAM_Application::readModuleList()
   }
 }
 
-/*!Add common items for popup menu ( if they are exist )
- *\param type - type of popup menu
- *\param thePopup - popup menu
- *\param title - title of popup menu
- */
-void CAM_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopup, QString& title )
+/*!
+  \brief Add common menu items to the popup menu.
+
+  Menu items list is defined by the active module.
+
+  \param type popup menu context
+  \param menu popup menu
+  \param title popup menu title, which can be set by the module if required
+*/
+void CAM_Application::contextMenuPopup( const QString& type, QMenu* menu, QString& title )
 {
   // to do : add common items for popup menu ( if they are exist )
   if ( activeModule() ) 
-    activeModule()->contextMenuPopup( type, thePopup, title );
+    activeModule()->contextMenuPopup( type, menu, title );
 }
 
-/*!Create empty study.*/
+/*!
+  \brief Create new empty study.
+*/
 void CAM_Application::createEmptyStudy()
 {
   /*SUIT_Study* study = */activeStudy();
index c31e9052352c41432110fd0072bb9aeca6dd11fe..5ce540555e89d284dc6224aba22761ad166cac3f 100755 (executable)
@@ -1,50 +1,45 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef CAM_APPLICATION_H
 #define CAM_APPLICATION_H
 
-#include "STD_Application.h"
-
-#include "CAM_Module.h"
+#include "CAM.h"
 
-#include <qptrlist.h>
+#include <STD_Application.h>
+#include <QList>
 
-class QPopupMenu;
+class QMenu;
+class CAM_Module;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
-/*!
-  \class CAM_Application
-  Defines application configuration and behaviour for application with modules.
-  Every module has own data model, necessary windows and viewers, etc.
-  Application provides all necessary functionality for module management
-  (loading of modules/activation/deactivation, etc)
-*/
 class CAM_EXPORT CAM_Application : public STD_Application  
 {
   Q_OBJECT
 
 public:
-  typedef QPtrList<CAM_Module>         ModuleList;
-  typedef QPtrListIterator<CAM_Module> ModuleListIterator;
+  typedef QList<CAM_Module*> ModuleList;
 
 public:
   CAM_Application( const bool = true );
@@ -53,26 +48,24 @@ public:
   virtual void        start();
 
   CAM_Module*         activeModule() const;
-  CAM_Module*         module(  const QString& ) const;
+  CAM_Module*         module( const QString& ) const;
 
-  /** @name Modules lists.*/
-  //@{
-  ModuleListIterator  modules() const;
+  ModuleList          modules() const;
   void                modules( ModuleList& ) const;
   void                modules( QStringList&, const bool loaded = true ) const;
-  //@}
 
   virtual void        addModule( CAM_Module* );
 
   virtual void        loadModules();
-  virtual CAM_Module* loadModule( const QString& );
+  virtual CAM_Module* loadModule( const QString&, const bool = true );
 
   virtual bool        activateModule( const QString& );
 
-  virtual void        contextMenuPopup( const QString&, QPopupMenu*, QString& );
+  virtual void        contextMenuPopup( const QString&, QMenu*, QString& );
 
   QString             moduleName( const QString& ) const;
   QString             moduleTitle( const QString& ) const;
+  QString             moduleIcon( const QString& ) const;
 
   virtual void        createEmptyStudy();
 
@@ -92,14 +85,14 @@ private:
   void                readModuleList();
 
 private:
-  typedef struct { QString name, title, internal; } ModuleInfo;
-  typedef QValueList<ModuleInfo>                    ModuleInfoList;
+  typedef struct { QString name, title, internal, icon; } ModuleInfo;
+  typedef QList<ModuleInfo> ModuleInfoList;
 
 private:
-  CAM_Module*         myModule;
-  ModuleList          myModules;
-  ModuleInfoList      myInfoList;
-  bool                           myAutoLoad;
+  CAM_Module*         myModule;        //!< active module
+  ModuleList          myModules;       //!< loaded modules list
+  ModuleInfoList      myInfoList;      //!< modules info list
+  bool                myAutoLoad;      //!< auto loading flag
 };
 
 #ifdef WIN32
index 559901279bba6ca09039c385a1090e9fff9f3c9b..a9c5142fd061f98fdb5c65e2b1e7be5f749e7cef 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "CAM_DataModel.h"
 
 #include "CAM_Module.h"
-#include "CAM_RootObject.h"
+#include "CAM_DataObject.h"
+
+/*!
+  \class CAM_DataModel
+  \brief Base class for all data models used in CAM-based applications.
+  
+  Represents data model of the CAM module. Provides necessary interface
+  (default implementation is empty).
+*/
 
-/*!Constructor. Initialise module by \a module.*/
+/*!
+  \brief Constructor.
+  
+  Initialise data module by specified \a module.
+*/
 CAM_DataModel::CAM_DataModel( CAM_Module* module )
 : myRoot( 0 ),
-myModule( module )
+  myModule( module )
 {
 }
 
-/*!Destructor. Do nothing.*/
+/*!
+  \brief Destructor.
+
+  Does nothing.
+*/
 CAM_DataModel::~CAM_DataModel()
 {
 }
 
 /*!
-  Default implementation, does nothing.
-  Can be used for creation of root object.
+  \brief Initialize data model.
+
+  This method should be re-implemented in the successor classes 
+  and can be used for creation of root data object.
+  Default implementation does nothing.
 */
 void CAM_DataModel::initialize()
 {
 }
 
-/*!Get root object.
- *\retval CAM_DataObject pointer - root object.
- */
+/*!
+  \brief Get data model root object.
+  \return root object
+  \sa setRoot()
+*/
 CAM_DataObject* CAM_DataModel::root() const
 {
   return myRoot;
 }
 
-/*!Sets root object to \a newRoot.\n
- *Emit root changed, if it was.
- *\param newRoot - new root object
- */
+/*!
+  \brief Set data model root object.
+
+  This method should be used to specify custom root object instance.
+
+  Root object can be created in several ways, depending on application or module needs:
+  - in initialize() method
+  - while the data model is being loaded
+  - when the data model is updated and becomes non-empty 
+
+  If root object is changed, this method emits rootChanged() signal.
+
+  \param newRoot new root object
+*/
 void CAM_DataModel::setRoot( const CAM_DataObject* newRoot )
 {
   if ( myRoot == newRoot )
     return;
 
   if ( myRoot )
-    myRoot->disconnect( this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
+    myRoot->disconnect( SIGNAL( destroyed( SUIT_DataObject* ) ), 
+                       this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
 
   myRoot = (CAM_DataObject*)newRoot;
 
   if ( myRoot )
-    myRoot->connect( this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
+    myRoot->connect( SIGNAL( destroyed( SUIT_DataObject* ) ), 
+                    this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
 
   emit rootChanged( this );
 }
 
-/*!Gets module.
- *\retval CAM_Module pointer - module.
- */
+/*!
+  \brief Get module.
+  \return module owning this data model
+*/
 CAM_Module* CAM_DataModel::module() const
 {
   return myModule;
 }
 
-/*!Nullify root, if \a obj equal root.*/
+/*!
+  \brief Called when data object is destroyed.
+
+  Nullifies the root object if it is detroyed to avoid crashes.
+  
+  \param obj object being destroyed
+*/
 void CAM_DataModel::onDestroyed( SUIT_DataObject* obj )
 {
   if ( myRoot == obj )
     myRoot = 0;
 }
+
+/*!
+  \brief Load data model.
+
+  This method should be re-implemented in the successor classes.
+  Default implementation returns \c true.
+
+  \param name study name
+  \param study study
+  \param files list of file names from which data should be loaded
+  \return \c true if data model is loaded successfully
+*/
+bool CAM_DataModel::open( const QString& /*name*/, 
+                         CAM_Study*     /*study*/, 
+                         QStringList    /*files*/ )
+{
+  return true;
+}
+
+/*!
+  \brief Save data model.
+
+  This method should be re-implemented in the successor classes.
+  Default implementation returns \c true.
+
+  \param files list of file names to which data should be saved
+  \return \c true if data model is saved successfully
+*/
+bool CAM_DataModel::save( QStringList& )
+{ 
+  return true; 
+}
+
+/*!
+  \brief Save data to the new file.
+
+  This method should be re-implemented in the successor classes.
+  Default implementation returns \c true.
+
+  \param name study name
+  \param study study
+  \param files resulting list of file names to which data is saved
+  \return \c true if data model is saved successfully
+*/
+bool CAM_DataModel::saveAs( const QString& /*name*/,
+                           CAM_Study*     /*study*/,
+                           QStringList&   /*files*/ )
+{
+  return true;
+}
+
+/*!
+  \brief Close data model.
+
+  This method should be re-implemented in the successor classes.
+  Default implementation returns \c true.
+
+  \return \c true if data model is closed successfully
+*/
+bool CAM_DataModel::close()
+{ 
+  return true; 
+}
+
+/*!
+  \brief Create empty data model.
+
+  This method should be re-implemented in the successor classes.
+  Default implementation returns \c true.
+
+  \return \c true if data model is created successfully
+*/
+bool CAM_DataModel::create( CAM_Study* )
+{ 
+  return true; 
+}
+
+/*!
+  \fn void CAM_DataModel::rootChanged( const CAM_DataModel* root );
+  \brief Emitted when the root data object is changed.
+  \param root new root data object
+*/
index 4cbc8ab9328be761930c6069b56432621a33000e..5a9b96cfbc48c79b35197e61be00c300320170de 100755 (executable)
@@ -1,39 +1,37 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef CAM_DATAMODEL_H
 #define CAM_DATAMODEL_H
 
 #include "CAM.h"
 
-#include <qobject.h>
-#include <qstringlist.h>
+#include <QObject>
+#include <QStringList>
 
 class CAM_Module;
 class CAM_DataObject;
 class CAM_Study;
 class SUIT_DataObject;
 
-/*!
-  \class CAM_DataModel
-  Base class for all data models used in CAM-based applications.
-  Represents data model of CAM module. Provides necessary interface (default implementation is empty)
-*/
 class CAM_EXPORT CAM_DataModel : public QObject
 {
   Q_OBJECT
@@ -47,22 +45,13 @@ public:
   CAM_DataObject*  root() const;
   CAM_Module*      module() const;
 
-  /** @name These methods should be redefined in successors.*/
-  //@{
-  virtual bool     open( const QString&, CAM_Study*, QStringList ) { return true; }//!< return true
-  virtual bool     save( QStringList& ) { return true; };
-  virtual bool     saveAs( const QString&, CAM_Study*, QStringList&  ) { return true; };
-  virtual bool     close() { return true; };
-  virtual bool     create( CAM_Study* ) { return true; }
-  //@}
+  virtual bool     open( const QString&, CAM_Study*, QStringList );
+  virtual bool     save( QStringList& );
+  virtual bool     saveAs( const QString&, CAM_Study*, QStringList& );
+  virtual bool     close();
+  virtual bool     create( CAM_Study* );
 
 protected:
-  /*! setRoot() should be used to specify custom root object instance.\n
-   * Such an object can be created in several ways, depending on application or module needs:\n
-   * \li by initialize()
-   * \li while the model is being loaded
-   * \li when the model is updated and becomes non-empty 
-   */
   virtual void     setRoot( const CAM_DataObject* );
 
 private slots:
@@ -72,8 +61,8 @@ signals:
   void             rootChanged( const CAM_DataModel* );
 
 private:
-  CAM_DataObject*  myRoot;
-  CAM_Module*      myModule;
+  CAM_DataObject*  myRoot;     //!< root data object
+  CAM_Module*      myModule;   //!< module
 };
 
 #endif
index 62a3d3b134440b6fadebc2af3fb5440263f1a270..29563ef8ad38d65495262877c6fc55481677124d 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "CAM_DataObject.h"
 
 #include "CAM_Module.h"
 #include "CAM_DataModel.h"
 
-/*!Constructor. Sets parent object.*/
+#include <Qtx.h>
+
+/*!
+  \class CAM_DataObject
+  \brief CAM-based implementation of the data object.
+  
+  In addition to base implementation provides integration
+  with CAM_DataModel.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent data object
+*/
 CAM_DataObject::CAM_DataObject( SUIT_DataObject* parent )
 : SUIT_DataObject( parent )
 {
 }
 
-/*!Destructor.Do nothing*/
+/*!
+  \brief Destructor.
+
+  Does nothing.
+*/
 CAM_DataObject::~CAM_DataObject()
 {
 }
 
-/*!Get module.
- *\retval const CAM_Module pointer - module
- */
+/*!
+  \brief Get CAM module.
+  \return parent module object pointer
+*/
 CAM_Module* CAM_DataObject::module() const
 { 
-  CAM_Module* mod = 0;
-
-  CAM_DataModel* data = dataModel();
-  if ( data )
-    mod = data->module();
-
-  return mod;
+  CAM_DataModel* dm = dataModel();
+  return dm ? dm->module() : 0;
 }
 
-/*!Get data model.
- *Return 0 - if no parent obbject.
- *\retval const CAM_DataModel pointer - data model
- */
+/*!
+  \brief Get CAM data model.
+  \return data model or 0 if it is not set
+  \sa CAM_ModuleObject class
+*/
 CAM_DataModel* CAM_DataObject::dataModel() const
 {
   CAM_DataObject* parentObj = dynamic_cast<CAM_DataObject*>( parent() );
+  return parentObj ? parentObj->dataModel() : 0;
+}
+
+/*!
+  \class CAM_ModuleObject
+  \brief CAM data model root object.
+  
+  This class is intended for optimized access to CAM_DataModel instance
+  from CAM_DataObject instances.
 
-  if ( !parentObj )
-    return 0;
+  To take advantage of this class in a specific application, 
+  custom data model root object class should be derived from both CAM_ModuleObject
+  and application-specific DataObject implementation using virtual inheritance.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent data object
+*/
+CAM_ModuleObject::CAM_ModuleObject( SUIT_DataObject* parent )
+: CAM_DataObject( parent ),
+  myDataModel( 0 )
+{
+}
+
+/*!
+  \brief Constructor.
+  \param data data model
+  \param parent parent data object
+*/
+CAM_ModuleObject::CAM_ModuleObject( CAM_DataModel* data, SUIT_DataObject* parent )
+: CAM_DataObject( parent ),
+  myDataModel( data )
+{
+}
+
+/*!
+  \brief Destructor.
+
+  Does nothing.
+*/
+CAM_ModuleObject::~CAM_ModuleObject()
+{
+}
 
-  return parentObj->dataModel();
+/*!
+  \brief Get root object name.
+
+  If the data model is set, this method returns module name.
+  Otherwise returns empty string.
+
+  \return root object name
+*/
+QString CAM_ModuleObject::name() const
+{
+  return myDataModel ? myDataModel->module()->moduleName() : QString();
+}
+
+/*!
+  \brief Get data object icon for the specified column.
+
+  The parameter \a id specifies the column identificator
+
+  \param id column id
+  \return object icon for the specified column
+*/
+QPixmap CAM_ModuleObject::icon( const int id ) const
+{
+  QPixmap p;
+  // show icon only for the "Name" column
+  if ( id == NameId && dataModel() && dataModel()->module() )
+    p = dataModel()->module()->moduleIcon();
+  if ( !p.isNull() )
+    p = Qtx::scaleIcon( p, 16 );
+  return p;
+}
+
+/*!
+  \brief Get data object tooltip for the specified column.
+
+  The parameter \a id specifies the column identificator
+
+  \param id column id
+  \return object tooltip for the specified column
+*/
+QString CAM_ModuleObject::toolTip( const int /*id*/ ) const
+{
+  // show the same tooltip for all columns
+  QString tip;
+  if ( dataModel() && dataModel()->module() )
+    tip = QObject::tr( "MODULE_ROOT_OBJECT_TOOLTIP" ).arg( dataModel()->module()->moduleName() );
+  return tip;
+}
+
+/*!
+  \brief Get data model.
+  \return data model pointer or 0 if it is not set
+*/
+CAM_DataModel* CAM_ModuleObject::dataModel() const
+{
+  return myDataModel;
+}
+
+/*!
+  \brief Set data model.
+  \param dm data model
+*/
+void CAM_ModuleObject::setDataModel( CAM_DataModel* dm )
+{
+  myDataModel = dm;
 }
index 1e4e414b2ac23f15a870120068c72e767ac3b24d..a2f9aae40f311b8472d6bd212c332ae07cee44cd 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef CAM_DATAOBJECT_H
 #define CAM_DATAOBJECT_H
 class CAM_Module;
 class CAM_DataModel;
 
-/*!
-  \class CAM_DataObject
-  Provides only additional link to CAM_DataModel
-*/
 class CAM_EXPORT CAM_DataObject : public SUIT_DataObject
 {
 public:
@@ -40,6 +39,24 @@ public:
   virtual CAM_DataModel* dataModel() const;
 };
 
+class CAM_EXPORT CAM_ModuleObject : public virtual CAM_DataObject
+{
+public:
+  CAM_ModuleObject( SUIT_DataObject* = 0 );
+  CAM_ModuleObject( CAM_DataModel*, SUIT_DataObject* = 0 );
+  virtual ~CAM_ModuleObject();
+
+  virtual QString        name() const;
+  QPixmap                icon( const int = NameId ) const;
+  QString                toolTip( const int = NameId ) const;
+
+  virtual CAM_DataModel* dataModel() const;
+  virtual void           setDataModel( CAM_DataModel* );
+
+private:
+  CAM_DataModel*         myDataModel; 
+};
+
 #endif
 
 #if _MSC_VER > 1000
index 511cad9e38edaa9111aa49448f271e3dbe33b8fd..d3dde1a21557299bf381095074cfa5612bcc0aa7 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "CAM_Module.h"
 
 #include <QtxActionMenuMgr.h>
 #include <QtxActionToolMgr.h>
 
+#include <SUIT_Desktop.h>
 #include <SUIT_Session.h>
-#include <SUIT_Application.h>
-
-/*!Icon.*/
-static const char* ModuleIcon[] = {
-"20 20 2 1",
-"      c None",
-".     c #000000",
-"                    ",
-"                    ",
-"                    ",
-" .................. ",
-" .                . ",
-" .                . ",
-" .                . ",
-" .                . ",
-" .                . ",
-" .                . ",
-" .                . ",
-" .                . ",
-" .................. ",
-"    .     .     .   ",
-"    .     .     .   ",
-"   ...   ...   ...  ",
-"  .. .. .. .. .. .. ",
-"  .   . .   . .   . ",
-"  .. .. .. .. .. .. ",
-"   ...   ...   ...  "};
-
-QPixmap MYPixmap( ModuleIcon );
-
-/*!Constructor.*/
+#include <SUIT_ResourceMgr.h>
+
+/*!
+  \class CAM_Module
+  \brief Base implementation of the module in the CAM application architecture.
+
+  Provides support of menu/toolbars management.
+*/
+
+/*!
+  \brief Default constructor.
+
+  Creates unnamed module.
+*/
 CAM_Module::CAM_Module()
 : QObject(),
-myApp( 0 ),
-myIcon( MYPixmap ),
-myDataModel( 0 )
+  myApp( 0 ),
+  myDataModel( 0 )
 {
 }
 
-/*!Constructor. initialize \a name.*/
+/*!
+  \brief Constructor.
+
+  Creates module with the specified \a name.
+
+  \param name module name
+*/
 CAM_Module::CAM_Module( const QString& name )
 : QObject(),
-myApp( 0 ),
-myName( name ),
-myIcon( MYPixmap ),
-myDataModel( 0 )
+  myApp( 0 ),
+  myName( name ),
+  myDataModel( 0 )
 {
 }
 
-/*!Destructor. Remove data model.*/
+/*!
+  \brief Destructor.
+
+  Destroy data model.
+*/
 CAM_Module::~CAM_Module()
 {
   delete myDataModel;
   myDataModel = 0;
 }
 
-/*!Initialize application.*/
+/*!
+  \brief Initialize module.
+
+  This method is usually called when the module is created (for example,
+  on the module library loading).
+  Successor classes can use this method to create menu/toolbar actions
+  and perform other module initialization.
+
+  \param app parent application object
+  \sa activateModule(), deactivateModule()
+*/
 void CAM_Module::initialize( CAM_Application* app )
 {
   myApp = app;
@@ -97,27 +102,65 @@ void CAM_Module::initialize( CAM_Application* app )
   }
 }
 
-/*!\retval Module icon.*/
+/*!
+  \brief Get module icon.
+  \return module icon pixmap
+  \sa iconName()
+*/
 QPixmap CAM_Module::moduleIcon() const
 {
+  if ( myIcon.isNull() ) {
+    QString iname = iconName();
+    if ( !iname.isEmpty() ) {
+      CAM_Module* that = (CAM_Module*)this;
+      that->myIcon = application()->resourceMgr()->loadPixmap( name(), iname, false );
+    }
+  }
   return myIcon;
 }
 
-/*!\retval Module icon name.*/
+/*!
+  \brief Get module icon's name.
+
+  This function is used to get module icon's file name.
+  Default implementation returns empty string.
+
+  \return module icon's name.
+  \sa moduleIcon()
+*/
 QString CAM_Module::iconName() const
 {
-  return "";
+  return application()->moduleIcon( name() );
 }
 
-/*!\retval Module name.*/
+/*!
+  \brief Get module (internal) name
+  \return module name
+  \sa setName(), moduleName(), setModuleName()
+*/
+QString CAM_Module::name() const
+{
+  return objectName();
+}
+
+/*!
+  \brief Get module title (user name)
+  \return module title
+  \sa setModuleName(), name(), setName()
+*/
 QString CAM_Module::moduleName() const
 {
   return myName;
 }
 
-/*! \brief Return data model.
- * Create data model, if it was't created before.
- */
+/*!
+  \brief Get data model.
+
+  Creates data model, if it is not yet created.
+
+  \return data model pointer
+  \sa createDataModel()
+*/
 CAM_DataModel* CAM_Module::dataModel() const
 {
   if ( !myDataModel )
@@ -129,33 +172,68 @@ CAM_DataModel* CAM_Module::dataModel() const
   return myDataModel;
 }
 
-/*!\retval CAM_Application pointer - application.*/
+/*!
+  \brief Get application.
+  \return application pointer
+*/
 CAM_Application* CAM_Module::application() const
 {
   return myApp;
 }
 
-/*!Public slot
- * \retval true.
+/*!
+  \brief If return false, selection will be cleared at module activation
+*/
+bool CAM_Module::isSelectionCompatible()
+{
+  return false;
+}
+
+/*!
+  \brief Activate module.
+
+  This method is called when the user activates module.
+  Successor classes can use this method to customize module activation process,
+  for example, to show own menus, toolbars, etc.
+
+  Default implementation always returns \c true.
+
+  \return \c true if module is activated successfully.
+  \sa initialize(), deactivateModule()
  */
-bool CAM_Module::activateModule( SUIT_Study* study )
+bool CAM_Module::activateModule( SUIT_Study* /*study*/ )
 {
   return true;
 }
 
-/*!Public slot
- * \retval true.
+/*!
+  \brief Deactivate module.
+
+  This method is called when the user deactivates module.
+  Successor classes can use this method to customize module deactivation process,
+  for example, to hide own menus, toolbars, etc.
+
+  Default implementation always returns \c true.
+
+  \return \c true if module is deactivated successfully.
+  \sa initialize(), activateModule()
  */
 bool CAM_Module::deactivateModule( SUIT_Study* )
 {
   return true;
 }
 
-/*!Public slot, remove data model from \a study.*/
+/*!
+  \brief Called when study is closed.
+
+  Removes data model from the \a study.
+
+  \param study study being closed
+*/
 void CAM_Module::studyClosed( SUIT_Study* study )
 {
   CAM_Study* camDoc = dynamic_cast<CAM_Study*>( study );
-  if ( !camDoc ) 
+  if ( !camDoc )
     return;
 
   CAM_DataModel* dm = dataModel();
@@ -165,21 +243,35 @@ void CAM_Module::studyClosed( SUIT_Study* study )
   }
 }
 
-/*!Public slot, do nothing.*/
-void CAM_Module::studyChanged( SUIT_Study* , SUIT_Study* )
+/*!
+  \brief Called when study is changed (obsolete).
+
+  Default implementation does nothing.
+
+  \param oldStudy old study
+  \param newStudy new study
+*/
+void CAM_Module::studyChanged( SUIT_Study* /*oldStudy*/, SUIT_Study* /*newStudy*/ )
 {
 }
 
-/*!Return true if module is active.*/
+/*!
+  \brief Check if the module is active.
+  \return \c true if module is active.
+*/
 bool CAM_Module::isActiveModule() const
 {
   return application() ? application()->activeModule() == this : false;
 }
 
 /*!
-  Put the message into the status bar of the desktop. Message will be displayed
-  during specified \amscec milliseconds. If parameter \amsec is negative then
-  message will be persistently displayed when module is active.
+  \brief Put the text message into the status bar of the application main window.
+
+  If \a msec > 0, the message will be shown \a msec milliseconds.
+  If \a msec < 0, the message will be constantly displayed until module is active.
+
+  \param msg text message
+  \param msec message displaying duration in milliseconds
 */
 void CAM_Module::putInfo( const QString& msg, const int msec )
 {
@@ -191,8 +283,12 @@ void CAM_Module::putInfo( const QString& msg, const int msec )
 }
 
 /*!
-  Restore persistently displayed info string when previos information status string erasing
-  if module is active.
+  \brief Restore message info.
+
+  Restores constant text message when previous information status message is removed.
+
+  \param txt previous message (being removed)
+  \sa putInfo()
 */
 void CAM_Module::onInfoChanged( QString txt )
 {
@@ -200,40 +296,52 @@ void CAM_Module::onInfoChanged( QString txt )
     application()->putInfo( myInfo );
 }
 
+/*!
+  \brief Called when application is closed.
 
+  Nullify application pointer if the application is being closed.
 
-/*!Public slot, nullify application pointer if the application was closed.*/
+  \param theApp application
+*/
 void CAM_Module::onApplicationClosed( SUIT_Application* theApp )
 {
   if (myApp == theApp)
     myApp = NULL;
 }
 
-/*!Create and return new instance of CAM_DataModel.*/
+/*!
+  \brief Create data model.
+  \return created data model object or 0 if it could not be created
+*/
 CAM_DataModel* CAM_Module::createDataModel()
-{ 
+{
   return new CAM_DataModel( this );
 }
 
-/*!Sets module name to \a name.
- * \param name - new name for module.
+/*!
+  \brief Set module (internal) name
+  \param name new module name
+  \sa name(), moduleName(), setModuleName()
  */
-void CAM_Module::setModuleName( const QString& name )
+void CAM_Module::setName( const QString& name )
 {
-  myName = name;
+  setObjectName( name );
 }
 
-/*!Sets module icon to \a icon.
- * \param icon - new icon for module.
+/*!
+  \brief Set module title (user name)
+  \param name new module title
+  \sa moduleName(), name(), setName()
  */
-void CAM_Module::setModuleIcon( const QPixmap& icon )
+void CAM_Module::setModuleName( const QString& name )
 {
-  myIcon = icon;
+  myName = name;
 }
 
-/*! Return menu manager pointer.
- * \retval QtxActionMenuMgr pointer - menu manager.
- */
+/*!
+  \brief Get menu manager.
+  \return menu manager pointer
+*/
 QtxActionMenuMgr* CAM_Module::menuMgr() const
 {
   QtxActionMenuMgr* mgr = 0;
@@ -242,9 +350,10 @@ QtxActionMenuMgr* CAM_Module::menuMgr() const
   return mgr;
 }
 
-/*! Return tool manager pointer.
- * \retval QtxActionToolMgr pointer - tool manager.
- */
+/*!
+  \brief Get toolbar manager.
+  \return toolbar manager pointer
+*/
 QtxActionToolMgr* CAM_Module::toolMgr() const
 {
   QtxActionToolMgr* mgr = 0;
@@ -253,9 +362,14 @@ QtxActionToolMgr* CAM_Module::toolMgr() const
   return mgr;
 }
 
-/*! Create tool bar with name \a name, if it was't created before.
- * \retval -1 - if tool manager was't be created.
- */
+/*!
+  \brief Create toolbar with speicifed \a name.
+
+  If the toolbar has been already created, its ID is just returned.
+
+  \param name toolbar name
+  \return toolbar ID or -1 if toolbar could not be created
+*/
 int CAM_Module::createTool( const QString& name )
 {
   if ( !toolMgr() )
@@ -264,15 +378,25 @@ int CAM_Module::createTool( const QString& name )
   return toolMgr()->createToolBar( name );
 }
 
-/*! Create tool. Register action \a a with id \a id.
- * Insert QAction to tool manager.
- *\param a - QAction
- *\param tBar - integer
- *\param id   - integer
- *\param idx  - integer
- *\retval integer id of new action in tool manager.
- *\retval Return -1 if something wrong.
- */
+/*!
+  \brief Add toolbar item.
+
+  Insert action \a to the toolbar manager and register it with specified \a id.
+  Resulting action ID may differ from the requested one. This can happen if
+  requested ID is already in use.
+
+  If action has been already added previously, its ID is just returned.
+
+  If \a id < 0, the action ID is generated automatically.
+
+  If \a idx < 0, the action is added to the end of the toolbar.
+
+  \param a action
+  \param tBar toolbar ID
+  \param id requested action ID
+  \param idx action index (desired position in the toolbar)
+  \return action ID or -1 if toolbar item could not be added
+*/
 int CAM_Module::createTool( QAction* a, const int tBar, const int id, const int idx )
 {
   if ( !toolMgr() )
@@ -283,15 +407,25 @@ int CAM_Module::createTool( QAction* a, const int tBar, const int id, const int
   return intId != -1 ? regId : -1;
 }
 
-/*! Create tool. Register action \a a with id \a id.
- * Insert QAction to tool manager.
- *\param a - QAction
- *\param tBar - QString&
- *\param id   - integer
- *\param idx  - integer
- *\retval integer id of new action in tool manager.
- *\retval Return -1 if something wrong.
- */
+/*!
+  \brief Add toolbar item.
+
+  Insert action \a to the toolbar manager and register it with specified \a id.
+  Resulting action ID may differ from the requested one. This can happen if
+  requested ID is already in use.
+
+  If action has been already added previously, its ID is just returned.
+
+  If \a id < 0, the action ID is generated automatically.
+
+  If \a idx < 0, the action is added to the end of the toolbar.
+
+  \param a action
+  \param tBar toolbar name
+  \param id requested action ID
+  \param idx action index (desired position in the toolbar)
+  \return action ID or -1 if toolbar item could not be added
+*/
 int CAM_Module::createTool( QAction* a, const QString& tBar, const int id, const int idx )
 {
   if ( !toolMgr() )
@@ -302,14 +436,24 @@ int CAM_Module::createTool( QAction* a, const QString& tBar, const int id, const
   return intId != -1 ? regId : -1;
 }
 
-/*! Create tool.
- * Insert QAction with id \a id from action map(myActionMap) to tool manager.
- *\param id   - integer
- *\param tBar - integer
- *\param idx  - integer
- *\retval integer id of new action in tool manager.
- *\retval Return -1 if something wrong.
- */
+/*!
+  \brief Add toolbar item.
+
+  Insert action with \a id identifier to the toolbar manager.
+  It is assumed that action has been already registered.
+
+  Resulting action ID may differ from the requested one. This can happen if
+  requested ID is already in use.
+
+  If action has been already added previously, its ID is just returned.
+
+  If \a idx < 0, the action is added to the end of the toolbar.
+
+  \param id action ID
+  \param tBar toolbar ID
+  \param idx action index (desired position in the toolbar)
+  \return action ID or -1 if toolbar item could not be added
+*/
 int CAM_Module::createTool( const int id, const int tBar, const int idx )
 {
   if ( !toolMgr() )
@@ -319,14 +463,24 @@ int CAM_Module::createTool( const int id, const int tBar, const int idx )
   return intId != -1 ? id : -1;
 }
 
-/*! Create tool.
- * Insert QAction with id \a id from action map(myActionMap) to tool manager.
- *\param id   - integer
- *\param tBar - QString&
- *\param idx  - integer
- *\retval integer id of new action in tool manager.
- *\retval Return -1 if something wrong.
- */
+/*!
+  \brief Add toolbar item.
+
+  Insert action with \a id identifier to the toolbar manager.
+  It is assumed that action has been already registered.
+
+  Resulting action ID may differ from the requested one. This can happen if
+  requested ID is already in use.
+
+  If action has been already added previously, its ID is just returned.
+
+  If \a idx < 0, the action is added to the end of the toolbar.
+
+  \param id action ID
+  \param tBar toolbar name
+  \param idx action index (desired position in the toolbar)
+  \return action ID or -1 if toolbar item could not be added
+*/
 int CAM_Module::createTool( const int id, const QString& tBar, const int idx )
 {
   if ( !toolMgr() )
@@ -336,126 +490,211 @@ int CAM_Module::createTool( const int id, const QString& tBar, const int idx )
   return intId != -1 ? id : -1;
 }
 
-/*! Create menu.
- * Insert submenu \a subMenu to menu manager.
- *\param subMenu - QString&
- *\param menu    - integer
- *\param id      - integer
- *\param group   - integer
- *\param index   - integer
- *\retval integer id of new menu in tool manager.
- *\retval Return -1 if something wrong.
- */
+/*!
+  \brief Create menu or submenu.
+
+  Create main menu or popup submenu and register it with specified \a id.
+  Resulting action ID may differ from the requested one. This can happen if
+  requested ID is already in use.
+
+  If \a id < 0, the menu ID is generated automatically.
+  If menu has been already created previously, its ID is just returned.
+
+  The \a menu parameter represents the menu name - it could be a sequence
+  of strings, separated by '|' symbol. For example, "File|Edit" means
+  File->Edit submenu. If menu doesn't exist, it is created automatically.
+
+  Parameter \a idx defines the index of the menu item in the menu group which
+  is defined by the \a group. If \a idx < 0, the menu/submenu is added to the
+  end of the menu group.
+
+  \param subMenu subMenu name
+  \param menu parent menu ID
+  \param id requested menu ID
+  \param group menu group ID
+  \param idx menu item index (desired position in the menu group)
+  \return menu item ID or -1 if menu item could not be added
+*/
 int CAM_Module::createMenu( const QString& subMenu, const int menu,
-                            const int id, const int group, const int index,
-                           const bool enableEmpty )
+                            const int id, const int group, const int idx )
 {
   if ( !menuMgr() )
     return -1;
 
-  return menuMgr()->insert( subMenu, menu, group, id, index, enableEmpty );
+  return menuMgr()->insert( subMenu, menu, group, id, idx );
 }
 
-/*! Create menu.
- * Insert submenu \a subMenu to menu manager.
- *\param subMenu - QString&
- *\param menu    - QString&
- *\param id      - integer
- *\param group   - integer
- *\param index   - integer
- *\retval integer id of new menu in tool manager.
- *\retval Return -1 if something wrong.
- */
+/*!
+  \brief Create menu or submenu.
+
+  Create main menu or popup submenu and register it with specified \a id.
+  Resulting action ID may differ from the requested one. This can happen if
+  requested ID is already in use.
+
+  If \a id < 0, the menu ID is generated automatically.
+  If menu has been already created previously, its ID is just returned.
+
+  The \a menu parameter represents the menu name - it could be a sequence
+  of strings, separated by '|' symbol. For example, "File|Edit" means
+  File->Edit submenu. If menu doesn't exist, it is created automatically.
+
+  Parameter \a idx defines the index of the menu item in the menu group which
+  is defined by the \a group. If \a idx < 0, the menu/submenu is added to the
+  end of the menu group.
+
+  \param subMenu subMenu name
+  \param menu parent menu name(s)
+  \param id requested menu ID
+  \param group menu group ID
+  \param idx menu item index (desired position in the menu group)
+  \return menu item ID or -1 if menu item could not be added
+*/
 int CAM_Module::createMenu( const QString& subMenu, const QString& menu,
-                            const int id, const int group, const int index,
-                           const bool enableEmpty )
+                            const int id, const int group, const int idx )
 {
   if ( !menuMgr() )
     return -1;
 
-  return menuMgr()->insert( subMenu, menu, group, id, index, enableEmpty );
+  return menuMgr()->insert( subMenu, menu, group, id, idx );
 }
 
+/*!
+  \brief Add menu item.
 
-/*! Create menu. Register action \a a with id \a id.
- * Insert QAction to menu manager.
- *\param a       - Qaction
- *\param menu    - integer
- *\param id      - integer
- *\param group   - integer
- *\param index   - integer
- *\retval integer id of new menu in tool manager.
- *\retval Return -1 if something wrong.
- */
-int CAM_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int index )
+  Insert action \a to the menu manager and register it with specified \a id.
+  Resulting action ID may differ from the requested one. This can happen if
+  requested ID is already in use.
+
+  If \a id < 0, the action ID is generated automatically.
+
+  If action has been already added previously, its ID is just returned.
+
+  Parameter \a idx defines the index of the menu item in the menu group which
+  is defined by the \a group. If \a idx < 0, the action is added to the
+  end of the menu group.
+
+  \param a action
+  \param menu menu ID
+  \param id requested action ID
+  \param group menu group ID
+  \param idx action index (desired position in the menu group)
+  \return action ID or -1 if menu item could not be added
+*/
+int CAM_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int idx )
 {
   if ( !a || !menuMgr() )
     return -1;
 
   int regId = registerAction( id, a );
-  int intId = menuMgr()->insert( a, menu, group, index );
+  int intId = menuMgr()->insert( a, menu, group, idx );
   return intId != -1 ? regId : -1;
 }
 
-/*! Create menu. Register action \a a with id \a id.
- * Insert QAction to menu manager.
- *\param a       - Qaction
- *\param menu    - QString&
- *\param id      - integer
- *\param group   - integer
- *\param index   - integer
- *\retval integer id of new menu in tool manager.
- *\retval Return -1 if something wrong.
- */
-int CAM_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int index )
+/*!
+  \brief Add menu item.
+
+  Insert action \a to the menu manager and register it with specified \a id.
+  Resulting action ID may differ from the requested one. This can happen if
+  requested ID is already in use.
+
+  If \a id < 0, the action ID is generated automatically.
+
+  If action has been already added previously, its ID is just returned.
+
+  The \a menu parameter represents the menu name - it could be a sequence
+  of strings, separated by '|' symbol. For example, "File|Edit" means
+  File->Edit submenu. If menu doesn't exist, it is created automatically.
+
+  Parameter \a idx defines the index of the menu item in the menu group which
+  is defined by the \a group. If \a idx < 0, the action is added to the
+  end of the menu group.
+
+  \param a action
+  \param menu menu name(s)
+  \param id requested action ID
+  \param group menu group ID
+  \param idx action index (desired position in the menu group)
+  \return action ID or -1 if menu item could not be added
+*/
+int CAM_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int idx )
 {
   if ( !a || !menuMgr() )
     return -1;
 
   int regId = registerAction( id, a );
-  int intId = menuMgr()->insert( a, menu, group, index );
+  int intId = menuMgr()->insert( a, menu, group, idx );
   return intId != -1 ? regId : -1;
 }
 
-/*! Create menu.
- * Insert QAction with id \a id from action map(myActionMap) to menu manager.
- *\param menu    - integer
- *\param id      - integer
- *\param group   - integer
- *\param index   - integer
- *\retval integer id of new menu in tool manager.
- *\retval Return -1 if something wrong.
- */
-int CAM_Module::createMenu( const int id, const int menu, const int group, const int index )
+/*!
+  \brief Add menu item.
+
+  Insert action with \a id identifier to the menu manager.
+  It is assumed that action has been already registered.
+
+  Resulting action ID may differ from the requested one. This can happen if
+  requested ID is already in use.
+
+  If action has been already added previously, its ID is just returned.
+
+  Parameter \a idx defines the index of the menu item in the menu group which
+  is defined by the \a group. If \a idx < 0, the action is added to the
+  end of the menu group.
+
+  \param id action ID
+  \param menu menu ID
+  \param group menu group ID
+  \param idx action index (desired position in the menu group)
+  \return action ID or -1 if menu item could not be added
+*/
+int CAM_Module::createMenu( const int id, const int menu, const int group, const int idx )
 {
   if ( !menuMgr() )
     return -1;
 
-  int intId = menuMgr()->insert( action( id ), menu, group, index );
+  int intId = menuMgr()->insert( action( id ), menu, group, idx );
   return intId != -1 ? id : -1;
 }
 
-/*! Create menu.
- * Insert QAction with id \a id from action map(myActionMap) to menu manager.
- *\param menu    - QString&
- *\param id      - integer
- *\param group   - integer
- *\param index   - integer
- *\retval integer id of new menu in tool manager.
- *\retval Return -1 if something wrong.
- */
-int CAM_Module::createMenu( const int id, const QString& menu, const int group, const int index )
+/*!
+  \brief Add menu item.
+
+  Insert action with \a id identifier to the menu manager.
+  It is assumed that action has been already registered.
+
+  Resulting action ID may differ from the requested one. This can happen if
+  requested ID is already in use.
+
+  If action has been already added previously, its ID is just returned.
+
+  The \a menu parameter represents the menu name - it could be a sequence
+  of strings, separated by '|' symbol. For example, "File|Edit" means
+  File->Edit submenu. If menu doesn't exist, it is created automatically.
+
+  Parameter \a idx defines the index of the menu item in the menu group which
+  is defined by the \a group. If \a idx < 0, the action is added to the
+  end of the menu group.
+
+  \param id action ID
+  \param menu menu name(s)
+  \param group menu group ID
+  \param idx action index (desired position in the menu group)
+  \return action ID or -1 if menu item could not be added
+*/
+int CAM_Module::createMenu( const int id, const QString& menu, const int group, const int idx )
 {
   if ( !menuMgr() )
     return -1;
 
-  int intId = menuMgr()->insert( action( id ), menu, group, index );
+  int intId = menuMgr()->insert( action( id ), menu, group, idx );
   return intId != -1 ? id : -1;
 }
 
-/*!Sets menus shown to \a on floag.
- *\param on - flag.
- */
+/*!
+  \brief Show/hide all module's menus.
+  \param on if \c true, show menus, otherwise, hide all menus
+  \sa setToolShown()
+*/
 void CAM_Module::setMenuShown( const bool on )
 {
   QtxActionMenuMgr* mMgr = menuMgr();
@@ -468,8 +707,8 @@ void CAM_Module::setMenuShown( const bool on )
   QAction* sep = separator();
   for ( QMap<int, QAction*>::Iterator it = myActionMap.begin(); it != myActionMap.end(); ++it )
   {
-    if ( it.data() != sep )
-      mMgr->setShown( mMgr->actionId( it.data() ), on );
+    if ( it.value() != sep )
+      mMgr->setShown( mMgr->actionId( it.value() ), on );
   }
 
   mMgr->setUpdatesEnabled( upd );
@@ -477,28 +716,32 @@ void CAM_Module::setMenuShown( const bool on )
     mMgr->update();
 }
 
-/*!Sets menu shown for QAction \a a to \a on flag.
- * \param a - QAction
- * \param on - flag
- */
+/*!
+  \brief Show/hide specified menu item.
+  \param a action
+  \param on if \c true, show menu item, otherwise, hide it
+*/
 void CAM_Module::setMenuShown( QAction* a, const bool on )
 {
   if ( menuMgr() )
     menuMgr()->setShown( menuMgr()->actionId( a ), on );
 }
 
-/*!Sets menu shown for action with id=\a id to \a on flag.
- * \param id - id of action
- * \param on - flag
- */
+/*!
+  \brief Show/hide specified menu item.
+  \param id menu item ID
+  \param on if \c true, show menu item, otherwise, hide it
+*/
 void CAM_Module::setMenuShown( const int id, const bool on )
 {
   setMenuShown( action( id ), on );
 }
 
-/*!Set tools shown to \a on flag.
- *\param on - boolean flag.
- */
+/*!
+  \brief Show/hide all module's toolbars.
+  \param on if \c true, show toolbars, otherwise, hide all toolbars
+  \sa setMenuShown()
+*/
 void CAM_Module::setToolShown( const bool on )
 {
   QtxActionToolMgr* tMgr = toolMgr();
@@ -511,8 +754,8 @@ void CAM_Module::setToolShown( const bool on )
   QAction* sep = separator();
   for ( QMap<int, QAction*>::Iterator it = myActionMap.begin(); it != myActionMap.end(); ++it )
   {
-    if ( it.data() != sep )
-      tMgr->setShown( tMgr->actionId( it.data() ), on );
+    if ( it.value() != sep )
+      tMgr->setShown( tMgr->actionId( it.value() ), on );
   }
 
   tMgr->setUpdatesEnabled( upd );
@@ -520,29 +763,32 @@ void CAM_Module::setToolShown( const bool on )
     tMgr->update();
 }
 
-/*!Set tools shown for QAction \a a to \a on flag.
- * \param a - QAction
- * \param on - boolean flag
- */
+/*!
+  \brief Show/hide specified toolbar item.
+  \param a action
+  \param on if \c true, show toolbar item, otherwise, hide it
+*/
 void CAM_Module::setToolShown( QAction* a, const bool on )
 {
   if ( toolMgr() )
     toolMgr()->setShown( toolMgr()->actionId( a ), on );
 }
 
-/*!Set tools shown for action with id=\a id to \a on flag.
- * \param id - integer action id
- * \param on - boolean flag
- */
+/*!
+  \brief Show/hide specified toolbar item.
+  \param id toolbar item ID
+  \param on if \c true, show toolbar item, otherwise, hide it
+*/
 void CAM_Module::setToolShown( const int id, const bool on )
 {
   setToolShown( action( id ), on );
 }
 
-/*! Return action by id. 
- * \param id - id of action.
- * \retval QAction.
- */
+/*!
+  \brief Get action by specified \a id.
+  \param id action ID
+  \return action or 0 if not found
+*/
 QAction* CAM_Module::action( const int id ) const
 {
   QAction* a = 0;
@@ -551,58 +797,71 @@ QAction* CAM_Module::action( const int id ) const
   return a;
 }
 
-/*! Return id by action. 
- * \param a - QAction.
- * \retval id of action.
- */
+/*!
+  \brief Get action ID.
+  \param a action
+  \return action ID or -1 if not found
+*/
 int CAM_Module::actionId( const QAction* a ) const
 {
   int id = -1;
   for ( QMap<int, QAction*>::ConstIterator it = myActionMap.begin(); it != myActionMap.end() && id == -1; ++it )
   {
-    if ( it.data() == a )
+    if ( it.value() == a )
       id = it.key();
   }
   return id;
 }
 
-/*! Create new instance of QtxAction and register action with \a id.
- * \param id - id for new action.
- * \param text - parameter for creation QtxAction
- * \param icon - parameter for creation QtxAction
- * \param menu - parameter for creation QtxAction
- * \param tip  - tip status for QtxAction action.
- * \param key  - parameter for creation QtxAction
- * \param parent - parent for action
- * \param toggle - parameter for creation QtxAction
- * \param reciever - 
- * \param member   - 
- */
-QAction* CAM_Module::createAction( const int id, const QString& text, const QIconSet& icon,
+/*!
+  \brief Create new instance of QtxAction and register action with specified \a id.
+
+  Resulting action ID may differ from the requested one. This can happen if
+  requested ID is already in use.
+
+  If \a id < 0, the action ID is generated automatically.
+
+  \param id required action ID
+  \param text tooltip text
+  \param icon action icon
+  \param menu menu text
+  \param tip status bar tip
+  \param key keyboard accelerator
+  \param parent parent object
+  \param toggle if \c true, the action will be toggled
+  \param reciever action activation signal receiver object
+  \param member action activation signal receiver slot
+*/
+QAction* CAM_Module::createAction( const int id, const QString& text, const QIcon& icon,
                                    const QString& menu, const QString& tip, const int key,
                                    QObject* parent, const bool toggle, QObject* reciever, const char* member )
 {
-  QtxAction* a = new QtxAction( text, icon, menu, key, parent, 0, toggle );
+  QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle );
   a->setStatusTip( tip );
 
   if ( reciever && member )
-    connect( a, SIGNAL( activated() ), reciever, member );
+    connect( a, SIGNAL( triggered( bool ) ), reciever, member );
 
   registerAction( id, a );
 
   return a;
 }
 
-/*! Register action in action map.
- * \param id - id for action.
- * \param a  - action
- * \retval new id for action.
- */
+/*!
+  \brief Register action in the internal action map.
+
+  If action has been already added previously, its ID is just returned.
+  If \a id < 0, the action ID is generated automatically.
+
+  \param id action required ID
+  \param a action
+  \return action ID
+*/
 int CAM_Module::registerAction( const int id, QAction* a )
 {
   int ident = -1;
   for ( QMap<int, QAction*>::ConstIterator it = myActionMap.begin(); it != myActionMap.end() && ident == -1; ++it )
-    if ( it.data() == a )
+    if ( it.value() == a )
       ident = it.key();
 
   if ( ident != -1 )
@@ -619,22 +878,29 @@ int CAM_Module::registerAction( const int id, QAction* a )
   if ( toolMgr() )
     toolMgr()->registerAction( a );
 
+  if ( application() && application()->desktop() )
+    application()->desktop()->addAction( a );
+
   return ident;
 }
 
-/*! Unregister an action.
- * \param id - id for action.
- * \retval true if succeded, false if action is used
- */
+/*!
+  \brief Unregister action from the internal action map.
+
+  \param id action ID
+  \return \c true on success or \c false if action is in use
+*/
 bool CAM_Module::unregisterAction( const int id )
 {
   return unregisterAction( action( id ) );
 }
 
-/*! Unregister an action.
- * \param a  - action
- * \retval true if succeded, false if action is used
- */
+/*!
+  \brief Unregister action from the internal action map.
+
+  \param a action
+  \return \c true on success or \c false if action is in use
+*/
 bool CAM_Module::unregisterAction( QAction* a )
 {
   if ( !a )
@@ -656,13 +922,22 @@ bool CAM_Module::unregisterAction( QAction* a )
   return true;
 }
 
-/*! Return qt action manager separator.*/
+/*!
+  \brief Create separator action.
+
+  Separator action can be used in menus or toolbars.
+
+  \return new separator action
+*/
 QAction* CAM_Module::separator()
 {
   return QtxActionMgr::separator();
 }
 
-/*! Connect data model of module with active study */
+/*!
+  \brief Connect data model of the module to the active study
+  \param camStudy CAM study object
+*/
 void CAM_Module::connectToStudy( CAM_Study* camStudy )
 {
   CAM_Application* app = camStudy ? dynamic_cast<CAM_Application*>( camStudy->application() ) : 0;
@@ -670,16 +945,30 @@ void CAM_Module::connectToStudy( CAM_Study* camStudy )
     return;
 
   CAM_DataModel* prev = 0;
-  for( CAM_Application::ModuleListIterator it = app->modules(); it.current(); ++it )
+  CAM_Application::ModuleList mods = app->modules();
+  for( QList<CAM_Module*>::const_iterator it = mods.begin(); it != mods.end(); ++it )
   {
-    CAM_DataModel* dm = it.current()->dataModel();
-    if( it.current() == this && !camStudy->containsDataModel( dm ) )
+    CAM_DataModel* dm = (*it)->dataModel();
+    if( (*it) == this && !camStudy->containsDataModel( dm ) )
     {
       if ( prev )
-             camStudy->insertDataModel( it.current()->dataModel(), prev );
+       camStudy->insertDataModel( (*it)->dataModel(), prev );
       else
-             camStudy->insertDataModel( it.current()->dataModel(), 0 );
+       camStudy->insertDataModel( (*it)->dataModel(), 0 );
     }
     prev = dm;
   }
 }
+
+/*!
+  \fn void CAM_Module::contextMenuPopup( const QString& type, QMenu* menu, QString& title );
+  \brief Create context popup menu.
+  \param type popup menu context
+  \param menu popup menu
+  \param title popup menu title, which can be set by the module if required
+*/
+
+/*!
+  \fn void CAM_Module::updateCommandsStatus();
+  \brief Update menu/toolbar actions.
+*/
index df9282a410f7df1e0c051fa603df0d67034112f3..628623f115d4efcaece3e0895f3b09663b7c1ad4 100755 (executable)
@@ -1,47 +1,50 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef CAM_MODULE_H
 #define CAM_MODULE_H
 
 #include "CAM.h"
 
-#include <qpixmap.h>
-#include <qobject.h>
-#include <qpopupmenu.h>
-#include <qstring.h>
+#include <QObject>
+#include <QPixmap>
+#include <QString>
+#include <QMap>
 
 class QAction;
+class QMenu;
+class QIcon;
+
+class QtxActionMenuMgr;
+class QtxActionToolMgr;
 class SUIT_Study;
 class SUIT_Application;
 class CAM_Study;
 class CAM_DataModel;
 class CAM_Application;
-class QtxActionMenuMgr;
-class QtxActionToolMgr;
 
 #ifdef WIN32
 #pragma warning( disable: 4251 )
 #endif
 
-/*! 
- * Class provide support of tool and menu managers.
- */
 class CAM_EXPORT CAM_Module : public QObject
 {
   Q_OBJECT
@@ -53,34 +56,28 @@ public:
 
   virtual void           initialize( CAM_Application* );
 
+  QString                name() const;
   QString                moduleName() const;
-  QPixmap                moduleIcon() const;
+  virtual QPixmap        moduleIcon() const;
+  virtual QString        iconName() const;
 
   CAM_DataModel*         dataModel() const;
   CAM_Application*       application() const;
 
-  virtual QString        iconName() const;
-
-  virtual void           contextMenuPopup( const QString&, QPopupMenu*, QString& title ) {};
+  virtual void           contextMenuPopup( const QString&, QMenu*, QString& ) {};
   virtual void           updateCommandsStatus() {};
 
   virtual void           putInfo( const QString&, const int = -1 );
 
   bool                   isActiveModule() const;
 
-  /** @name Set Menu Shown*/
-  //@{
   virtual void           setMenuShown( const bool );
   void                   setMenuShown( QAction*, const bool );
   void                   setMenuShown( const int, const bool );
-  //@}
 
-  /** @name Set Tool Shown*/
-  //@{
   virtual void           setToolShown( const bool );
   void                   setToolShown( QAction*, const bool );
   void                   setToolShown( const int, const bool );
-  //@}
 
 public slots:
   virtual bool           activateModule( SUIT_Study* );
@@ -97,55 +94,48 @@ private slots:
   void                   onInfoChanged( QString );
 
 protected: 
+  virtual bool           isSelectionCompatible();
+
   virtual CAM_DataModel* createDataModel();
 
+  void                   setName( const QString& );
   virtual void           setModuleName( const QString& );
-  virtual void           setModuleIcon( const QPixmap& );
 
   QtxActionMenuMgr*      menuMgr() const;
   QtxActionToolMgr*      toolMgr() const;
 
-  /** @name Create tool methods.*/
-  //@{
   int                    createTool( const QString& );
   int                    createTool( const int, const int, const int = -1 );
   int                    createTool( const int, const QString&, const int = -1 );
   int                    createTool( QAction*, const int, const int = -1, const int = -1 );
   int                    createTool( QAction*, const QString&, const int = -1, const int = -1 );
-  //@}
 
-  /** @name Create menu methods.*/
-  //@{
-  int                    createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1, const bool = false );
-  int                    createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1, const bool = false );
+  int                    createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1 );
+  int                    createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1 );
   int                    createMenu( const int, const int, const int = -1, const int = -1 );
   int                    createMenu( const int, const QString&, const int = -1, const int = -1 );
   int                    createMenu( QAction*, const int, const int = -1, const int = -1, const int = -1 );
   int                    createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 );
-  //@}
 
   static QAction*        separator();
 
-  /**Action ids methods.*/
-  //@{
   QAction*               action( const int ) const;
   int                    actionId( const QAction* ) const;
-  //@}
 
   int                    registerAction( const int, QAction* );
   bool                   unregisterAction( const int );
   bool                   unregisterAction( QAction* );
-  QAction*               createAction( const int, const QString&, const QIconSet&, const QString&,
+  QAction*               createAction( const int, const QString&, const QIcon&, const QString&,
                                        const QString&, const int, QObject* = 0,
                                        const bool = false, QObject* = 0, const char* = 0 );
 
 private:
-  CAM_Application*       myApp;
-  QString                myName;
-  QPixmap                myIcon;
-  QString                myInfo;
-  CAM_DataModel*         myDataModel;
-  QMap<int, QAction*>    myActionMap;
+  CAM_Application*       myApp;             //!< parent application object
+  QString                myName;            //!< module title (user name)
+  QPixmap                myIcon;            //!< module icon
+  QString                myInfo;            //!< latest info message
+  CAM_DataModel*         myDataModel;       //!< data model
+  QMap<int, QAction*>    myActionMap;       //!< menu actions
 
   friend class CAM_Application;
 };
diff --git a/src/CAM/CAM_RootObject.cxx b/src/CAM/CAM_RootObject.cxx
deleted file mode 100755 (executable)
index e1d9771..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "CAM_RootObject.h"
-
-#include "CAM_DataModel.h"
-#include "CAM_Module.h"
-
-/*!Constructor. Initialize by \a parent.
- * Set data model to 0.
- */
-CAM_RootObject::CAM_RootObject( SUIT_DataObject* parent )
-: CAM_DataObject( parent ),
-myDataModel( 0 )
-{
-}
-
-/*!Constructor. Initialize by \a parent and \a data - data object
- *\param data - data object
- *\param parent - parent data object
- */
-CAM_RootObject::CAM_RootObject( CAM_DataModel* data, SUIT_DataObject* parent )
-: CAM_DataObject( parent ),
-myDataModel( data )
-{
-}
-
-/*!Destructor. Do nothing.*/
-CAM_RootObject::~CAM_RootObject()
-{
-}
-
-/*!
-    Returns module name
-*/
-QString CAM_RootObject::name() const
-{
-  QString aName = "";
-  if (myDataModel)
-    aName = myDataModel->module()->moduleName();
-  return aName;
-}
-
-/*!Get data model
- *\retval const CAM_DataModel pointer to data model.
- */
-CAM_DataModel* CAM_RootObject::dataModel() const
-{
-  return myDataModel;
-}
-
-/*!Set data model.
- *\param dm - data model to set.
- */
-void CAM_RootObject::setDataModel( CAM_DataModel* dm )
-{
-  myDataModel = dm;
-}
diff --git a/src/CAM/CAM_RootObject.h b/src/CAM/CAM_RootObject.h
deleted file mode 100755 (executable)
index 8456e76..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef CAM_ROOTOBJECT_H
-#define CAM_ROOTOBJECT_H
-
-#include "CAM_DataObject.h"
-
-/*!
-  CAM_RootObject - class intended for optimized access to CAM_DataModel instance
-  from CAM_DataObject instances.
-
-  To take advantage of this class in a specific application, 
-  custom data model root object class should be derived from both CAM_RootObject
-  and application-specific DataObject implementation using virtual inheritance.
- */
-class CAM_EXPORT CAM_RootObject : public virtual CAM_DataObject
-{
-public:
-  CAM_RootObject( SUIT_DataObject* = 0 );
-  CAM_RootObject( CAM_DataModel*, SUIT_DataObject* = 0 );
-  virtual ~CAM_RootObject();
-
-  virtual QString        name() const;
-
-  virtual CAM_DataModel* dataModel() const;
-  virtual void           setDataModel( CAM_DataModel* );
-
-private:
-  CAM_DataModel*         myDataModel; 
-};
-
-#endif
-
-#if _MSC_VER > 1000
-#pragma once
-#endif
index 65ded03258e30ec307ebefe96c29becdd47f492d..95bee0699c8882fa12f4929694542c50ad7abd0d 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "CAM_Study.h"
 
 #include "CAM_DataModel.h"
 #include "CAM_DataObject.h"
-#include "CAM_RootObject.h"
 #include "CAM_Module.h"
 
-/*!Constructor.*/
+/*!
+  \class CAM_Study
+  \brief Represents document object in the CAM application architecture.
+
+  For each loaded module study contains the data model instance reference.
+  Provides all necessary functionality for data models management.
+*/
+
+/*!
+  \brief Constructor.
+  \param app parent application
+*/
 CAM_Study::CAM_Study( SUIT_Application* app )
 : SUIT_Study( app )
 {
 }
 
-/*!Destructor*/
+/*!
+  \brief Destructor.
+*/
 CAM_Study::~CAM_Study()
 {
 }
 
-/*!Closing all data models and close document permanently(if \a permanently = true.)
- * \param permanently - flag
- */
-void CAM_Study::closeDocument(bool permanently)
+/*!
+  \brief Called when study is closed.
+
+  Closes all data models.
+  
+  \param permanently if \c true close study permanently (not used in the base implemetation)
+*/
+void CAM_Study::closeDocument( bool permanently )
 {
-  for ( ModelListIterator it( myDataModels ); it.current(); ++it )
-    it.current()->close();
+  for( QList<CAM_DataModel*>::const_iterator it = myDataModels.begin(); 
+       it != myDataModels.end(); ++it )
+    (*it)->close();
 
-  SUIT_Study::closeDocument(permanently);
+  SUIT_Study::closeDocument( permanently );
 }
 
-/*!Append data model to list.
- * \param dm - data model for adding
- */
+/*!
+  \brief Append data model to the study.
+  \param dm data model being added
+  \return \c true on success and \c false on error
+*/
 bool CAM_Study::appendDataModel( const CAM_DataModel* dm )
 {
   return insertDataModel( dm, myDataModels.count() );
 }
 
-/*!Insert data model \a dm after \a other
- * \param dm - data model for adding
- * \param other - previus data model for \a dm
- */
+/*!
+  \brief Insert data model \a dm after data model \a other
+  
+  If \a other is 0, the data model is added to the end of list.
+
+  \param dm data model being added
+  \param other data model to be previous in the list
+  \return \c true on success and \c false on error
+*/
 bool CAM_Study::insertDataModel( const CAM_DataModel* dm, const CAM_DataModel* other )
 {
-  int idx = myDataModels.findRef( other );
+  int idx = myDataModels.indexOf( (CAM_DataModel*)other );
   return insertDataModel( dm, idx < 0 ? idx : idx + 1 );
 }
 
-/*!Insert data model with index \a idx. \n
- * \param dm - data model
- * \param idx - index for inserting(must be no less zero)
- * \retval true - if model added successful, else false.
- */
+/*!
+  \brief Insert data model \a dm with index \a idx.
+  
+  \param dm data model being added
+  \param idx data model required index
+  \return \c true on success and \c false on error
+*/
 bool CAM_Study::insertDataModel( const CAM_DataModel* dm, const int idx )
 {
-  if ( !dm || myDataModels.findRef( dm ) != -1 )
+  if ( !dm || myDataModels.indexOf( (CAM_DataModel*)dm ) != -1 )
     return false;
 
   int pos = idx < 0 ? myDataModels.count() : idx;
-  myDataModels.insert( QMIN( pos, (int)myDataModels.count() ), dm );
+  myDataModels.insert( qMin( pos, (int)myDataModels.count() ), (CAM_DataModel*)dm );
 
   connect( dm, SIGNAL( rootChanged( const CAM_DataModel* ) ), SLOT( updateModelRoot( const CAM_DataModel* ) ) );
 
@@ -83,42 +112,52 @@ bool CAM_Study::insertDataModel( const CAM_DataModel* dm, const int idx )
   return true;
 }
 
-/*! Remove data model from list
- * \param dm data model
- * \retval true - if all ok, else false.
- */
+/*!
+  \brief Remove data model from the study.
+  \param dm data model being removed
+  \return \c true on success and \c false on error
+*/
 bool CAM_Study::removeDataModel( const CAM_DataModel* dm )
 {
   if ( !dm )
     return true;
 
-  CAM_RootObject* aModelRoot = dynamic_cast<CAM_RootObject*>( dm->root() );
+  CAM_ModuleObject* aModelRoot = dynamic_cast<CAM_ModuleObject*>( dm->root() );
   if ( aModelRoot )
     aModelRoot->setDataModel( 0 );
 
-  return myDataModels.removedm );
+  return myDataModels.removeAll( (CAM_DataModel*)dm );
 }
 
-/*!Check data model contains in list.
- * \param dm - data model
- * \retval true - if data model in list, else false.
- */
+/*!
+  \brief Check if data model is contained in the list.
+  \param dm data model
+  \return \c true if data model is in the list and \c false otherwise.
+*/
 bool CAM_Study::containsDataModel( const CAM_DataModel* dm ) const
 {
-  return myDataModels.contains( dm );
+  return myDataModels.contains( (CAM_DataModel*)dm );
 }
 
-/*!Gets list of all data models.
- * \param lst - output data model list.
- */
+/*!
+  \brief Get all data models.
+  \param lst returning list of data model.
+*/
 void CAM_Study::dataModels( ModelList& lst ) const
 {
   lst.clear();
-  for ( ModelListIterator it( myDataModels ); it.current(); ++it )
-    lst.append( it.current() );
+  for( QList<CAM_DataModel*>::const_iterator it = myDataModels.begin(); 
+       it != myDataModels.end(); ++it )
+    lst.append( *it );
 }
 
-/*! Open data model \a dModel, if it saved*/
+/*!
+  \brief Called when data model is inserted in the study.
+  
+  Open data model \a dModel, if it is saved and update data tree.
+
+  \param dModel data model
+*/
 void CAM_Study::dataModelInserted( const CAM_DataModel* dModel )
 {
   CAM_DataModel* dm = (CAM_DataModel*)dModel;
@@ -131,19 +170,34 @@ void CAM_Study::dataModelInserted( const CAM_DataModel* dModel )
   updateModelRoot( dm );
 }
 
-/*! \retval false*/
+/*!
+  \brief Called when data model is opened.
+
+  Base implementation does nothing and returns \c false.
+  
+  \return \c true on success and \c false on error
+*/
 bool CAM_Study::openDataModel( const QString&, CAM_DataModel* )
 {
   return false;
 }
 
-/*! \retval false*/
+/*!
+  \brief Called when data model is saved.
+
+  Base implementation does nothing and returns \c false.
+  
+  \return \c true on success and \c false on error
+*/
 bool CAM_Study::saveDataModel( const QString&, CAM_DataModel* )
 {
   return false;
 }
 
-/*! Public slot. Update model root.*/
+/*!
+  \brief Update data model root object.
+  \param dm data model being updated.
+*/
 void CAM_Study::updateModelRoot( const CAM_DataModel* dm )
 {
   if ( !root() )
@@ -168,7 +222,7 @@ void CAM_Study::updateModelRoot( const CAM_DataModel* dm )
   if ( curRoot )
     root()->replaceChild( curRoot, dm->root(), true );
   else {
-    int idx = myDataModels.findRef( dm );
+    int idx = myDataModels.indexOf( (CAM_DataModel*)dm );
     if ( idx != -1 )
       root()->insertChild( dm->root(), idx );
   }
index 18839617a2bafeebe297125a571b077cc719c0b4..a90d0e5c5079959b5c5caba81b4accede99a8550 100755 (executable)
@@ -1,62 +1,54 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef CAM_STUDY_H
 #define CAM_STUDY_H
 
 #include "CAM.h"
 
-#include "CAM_DataModel.h"
-
 #include <SUIT_Study.h>
+#include <QList>
 
-#include <qptrlist.h>
+class CAM_DataModel;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
-/*!
-  \class CAM_Study
-  Represents study for using in CAM, contains list of
-  data model references from all modules. Provides
-  necessary functionality for data models management.
-*/
 class CAM_EXPORT CAM_Study : public SUIT_Study
 {
   Q_OBJECT
 
 public:
-  typedef QPtrList<CAM_DataModel>         ModelList;
-  typedef QPtrListIterator<CAM_DataModel> ModelListIterator;
+  typedef QList<CAM_DataModel*> ModelList;
 
 public:
   CAM_Study( SUIT_Application* );
   virtual ~CAM_Study();
 
-  virtual void closeDocument(bool permanently = true);
+  virtual void closeDocument( bool permanently = true );
 
-  /** @name Insert data model methods.*/
-  //@{
   bool         appendDataModel( const CAM_DataModel* );
   virtual bool insertDataModel( const CAM_DataModel*, const int = -1 );
   bool         insertDataModel( const CAM_DataModel*, const CAM_DataModel* );
-  //@}
 
   virtual bool removeDataModel( const CAM_DataModel* );
 
@@ -73,8 +65,7 @@ protected slots:
   virtual void updateModelRoot( const CAM_DataModel* );
 
 private:
-  //! Data model list
-  ModelList    myDataModels;
+  ModelList    myDataModels;   //!< data models list
 };
 
 #ifdef WIN32
index 4e0a1e5f325edf2c04dae66a60dda29fc42f2c61..145a77214271158a63c7df152b5fe49eb147e959 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : CAM
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libCAM.la
 
-salomeinclude_HEADERS= \
-       CAM_Application.h \
-       CAM_DataModel.h \
-       CAM_DataObject.h \
-       CAM.h \
-       CAM_Module.h \
-       CAM_Study.h \
-       CAM_RootObject.h
-
-dist_libCAM_la_SOURCES= \
-       CAM_Application.cxx \
-       CAM_DataModel.cxx \
-       CAM_DataObject.cxx \
-       CAM_Module.cxx \
-       CAM_Study.cxx \
-       CAM_RootObject.cxx
-
-MOC_FILES= \
-       CAM_Application_moc.cxx \
-       CAM_Module_moc.cxx \
-       CAM_Study_moc.cxx \
+salomeinclude_HEADERS =                \
+       CAM.h                   \
+       CAM_Application.h       \
+       CAM_DataModel.h         \
+       CAM_DataObject.h        \
+       CAM_Module.h            \
+       CAM_Study.h
+
+dist_libCAM_la_SOURCES =       \
+       CAM_Application.cxx     \
+       CAM_DataModel.cxx       \
+       CAM_DataObject.cxx      \
+       CAM_Module.cxx          \
+       CAM_Study.cxx
+
+MOC_FILES =                    \
+       CAM_Application_moc.cxx \
+       CAM_Module_moc.cxx      \
+       CAM_Study_moc.cxx       \
        CAM_DataModel_moc.cxx
-nodist_libCAM_la_SOURCES= $(MOC_FILES)
-
-nodist_salomeres_DATA=CAM_msg_en.qm
+nodist_libCAM_la_SOURCES = $(MOC_FILES)
 
-libCAM_la_CPPFLAGS=$(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../STD -I$(srcdir)/../Qtx
-libCAM_la_LDFLAGS=$(QT_MT_LIBS)
-libCAM_la_LIBS=../SUIT/libsuit.la ../STD/libstd.la
+nodist_salomeres_DATA = CAM_msg_en.qm
 
-# what is that?
-#LDFLAGSFORBIN= -lSUITApp
+libCAM_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../STD -I$(srcdir)/../Qtx
+libCAM_la_LDFLAGS  = $(QT_MT_LIBS)
+libCAM_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../STD/libstd.la
index 4377dfc5695b09e25d40f0282e54152a5741d002..e03419f5d7d14e672f06bed5fb9a1bcc2bb2e24d 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
diff --git a/src/CAM/resources/CAM_msg_en.ts b/src/CAM/resources/CAM_msg_en.ts
new file mode 100644 (file)
index 0000000..949dc1e
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>ERROR_TLT</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>ERROR_ACTIVATE_MODULE_MSG</source>
+        <translation>Failed to activate module %1</translation>
+    </message>
+    <message>
+        <source>MODULE_ROOT_OBJECT_TOOLTIP</source>
+        <translation>%1 module root object</translation>
+    </message>
+</context>
+</TS>
index 03541f951db556f93ba65ff4e46ba0ba052d1f44..111e69ff018ff94de22ef59707d23ddc63247c27 100644 (file)
@@ -1,25 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-
-#ifndef _CASCatch_HeaderFile
-#define _CASCatch_HeaderFile
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : CASCatch.hxx
+// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
+//
+#ifndef CASCATCH_HXX
+#define CASCATCH_HXX
 
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx>
        Standard_ErrorHandler _Function; \
        K_SETJMP = 1 ; \
        if(DoesNotAbort(_Function))
-#   else  //If DO_ABORT is not defined
+#   else  // ! DO_ABORT
 #     define CASCatch_TRY \
         Standard_ErrorHandler _Function; \
         if(DoesNotAbort(_Function))
-#   endif //DO_ABORT
+#   endif // DO_ABORT
 #   define CASCatch_CATCH(Error)   \
       else if(_Function.Catches(STANDARD_TYPE(Error)))
-#else
+#else  // ! NO_CXX_EXCEPTION
 #  define CASCatch_TRY try
 #  define CASCatch_CATCH catch
-#endif //NO_CXX_EXCEPTION
+#endif // NO_CXX_EXCEPTION
 
 
-#endif
+#endif // CASCATCH_HXX
index b039baaa2149bac1ef7dd8b68fa4974fab7f9850..90f90d55b2631516fa1d6bbbd7fa4dc628808888 100644 (file)
@@ -1,21 +1,26 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : CASCatch_CatchSignals.cxx
+// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
 //
 #include "CASCatch_CatchSignals.hxx"
 
index a3fc42c3e7566c7ec6e047ea024977f5227f1251..baca0837bf2a3146f8ee39e7f3becb67ab57a1ad 100644 (file)
@@ -1,25 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-
-#ifndef _CASCatch_CatchSignals_HeaderFile
-#define _CASCatch_CatchSignals_HeaderFile
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : CASCatch_CatchSignals.hxx
+// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
+//
+#ifndef CASCATCH_CATCHSIGNALS_HXX
+#define CASCATCH_CATCHSIGNALS_HXX
 
 #include <Standard.hxx>
 
@@ -60,4 +64,4 @@ Standard_Boolean myIsActivated;
 };
 
 
-#endif
+#endif // CASCATCH_CATCHSIGNALS_HXX
index 49af8d356f3b7e9df01dacbeba4049a2c796ae5b..b2843e02c0b6f842897bea05e9c422edc775d2d1 100644 (file)
@@ -1,23 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : CASCatch_ErrorHandler.cxx
+// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
 //
-
 #ifdef NO_CXX_EXCEPTION
 
 #include "CASCatch_ErrorHandler.hxx"
index 05c6b235668cd0757c064a8d8b149fe600565483..7b44dfa03ccfcde198c2fd60075f18b4dc860d4e 100644 (file)
@@ -1,25 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-
-#ifndef _CASCatch_ErrorHandler_HeaderFile
-#define _CASCatch_ErrorHandler_HeaderFile
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : CASCatch_ErrorHandler.hxx
+// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
+//
+#ifndef CASCATCH_ERRORHANDLER_HXX
+#define CASCATCH_ERRORHANDLER_HXX
 
 #include "CASCatch_Failure.hxx"
 
@@ -78,15 +82,15 @@ class CASCatch_ErrorHandler
                                 K_SETJMP_CASCatch = 1 ; \
                                 if(DoesNotAbort_CASCatch(_Function))
 
-# else  //If DO_ABORT is not defined
+# else  // ! DO_ABORT
 #  define DoesNotAbort_CASCatch(aHandler) !setjmp(aHandler.Label)
 
 #  define CASCatch_TRY      CASCatch_ErrorHandler _Function; \
                               if(DoesNotAbort_CASCatch(_Function))
-# endif //DO_ABORT
+# endif // DO_ABORT
 
 
 # define CASCatch_CATCH(Error)   else if(_Function.Catches(STANDARD_TYPE(Error)))
-#endif //NO_CXX_EXCEPTION
+#endif  // NO_CXX_EXCEPTION
 
-#endif //_CASCatch_ErrorHandler_HeaderFile
+#endif  // CASCATCH_ERRORHANDLER_HXX
index 6e5d3d88426b293d4d4c5ae2de400e72ddab0300..a0e2909890b34ea6c9b695bde1cc0f6cf7e4d9a3 100644 (file)
@@ -1,21 +1,26 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : CASCatch_Failure.cxx
+// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
 //
 #include "CASCatch_Failure.hxx"
 #include "CASCatch_ErrorHandler.hxx"
index 102f0ec4e88ee195df17648ec946958702dde204..262a0c836a76023b1fa2c85f95237adc9ba446e2 100644 (file)
@@ -1,24 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#ifndef _CASCATCH_FAILURE_HeaderFile
-#define _CASCATCH_FAILURE_HeaderFile
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : CASCatch_Failure.hxx
+// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
+//
+#ifndef CASCATCH_FAILURE_HXX
+#define CASCATCH_FAILURE_HXX
 
 #include <Standard_Transient.hxx>
 #include <Standard_DefineHandle.hxx>
@@ -52,9 +57,9 @@ private:
 /*!\var myMessage
  * \brief stores an exception message
  */   
-Standard_CString myMessage;
+Standard_Character* myMessage;
 
 };
 
 
-#endif
+#endif // CASCATCH_FAILURE_HXX
index a4b9f7156a4fb0edb708453be5eb499de9804b82..82629d8c81ede928dbb9d9324bcd1a41a0711950 100644 (file)
@@ -1,41 +1,43 @@
-# Copyright (C) 2005  OPEN CASCADE, CEA, EDF R&D, LEG
-#           PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
-# 
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-# 
-#  File   : Makefile.in
-#  Author : Sergey RUIN (OCN)
-#  Module : SALOME
-
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# File   : Makefile.am
+# Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 
-salomeinclude_HEADERS   = CASCatch.hxx \
-                       CASCatch_CatchSignals.hxx \
-                       CASCatch_ErrorHandler.hxx \
+salomeinclude_HEADERS = CASCatch.hxx                   \
+                       CASCatch_CatchSignals.hxx       \
+                       CASCatch_ErrorHandler.hxx       \
                        CASCatch_Failure.hxx
 
-lib_LTLIBRARIES             = libCASCatch.la
-libCASCatch_la_SOURCES  = \
-                       CASCatch_CatchSignals.cxx \
-                       CASCatch_ErrorHandler.cxx \
+lib_LTLIBRARIES         = libCASCatch.la
+libCASCatch_la_SOURCES  =                              \
+                       CASCatch_CatchSignals.cxx       \
+                       CASCatch_ErrorHandler.cxx       \
                        CASCatch_Failure.cxx
 
 COMMON_CPPFLAGS = \
        @CAS_CPPFLAGS@ @CAS_CXXFLAGS@
 
 libCASCatch_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libCASCatch_la_LIBADD  = $(CAS_KERNEL)
+libCASCatch_la_LIBADD   = $(CAS_KERNEL)
index 4e32211d2f8206798732fef50718651d8fbbe36c..7cfb41ec3932423dc4586a75e343eea445a213d5 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef DDS_H
 #define DDS_H
diff --git a/src/DDS/DDS.pro b/src/DDS/DDS.pro
new file mode 100644 (file)
index 0000000..6a5c8d1
--- /dev/null
@@ -0,0 +1,58 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = DDS
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
+
+CAS_OCAF = -L$${CASROOT}/Linux/lib -lPTKernel -lTKernel -lTKCDF -lTKLCAF -lTKPCAF -lTKStdSchema
+
+INCLUDEPATH += ../../include $${CAS_CPPFLAGS}
+LIBS += $${CAS_KERNEL} $${CAS_OCAF}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=2 OCC_VERSION_MAINTENANCE=0 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = DDS.h
+HEADERS += DDS_DicGroup.h
+HEADERS += DDS_DicItem.h
+HEADERS += DDS_Dictionary.h
+HEADERS += DDS_KeyWords.h
+
+SOURCES  = DDS_DicGroup.cxx
+SOURCES += DDS_DicItem.cxx
+SOURCES += DDS_Dictionary.cxx
+SOURCES += DDS_KeyWords.cxx
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+INSTALLS += includes
index 56197a523ef7287e5b20ad17b4a6786854a892fe..1d7d736f1cea860a4eccb07f1dbc16c606e8a85f 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "DDS_DicGroup.h"
 
@@ -25,8 +28,6 @@
 
 #include <UnitsAPI.hxx>
 
-#include <TColStd_SequenceOfAsciiString.hxx>
-
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx>
 
@@ -35,29 +36,33 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_DicGroup, MMgt_TShared)
 
 /*!
   \class DDS_DicGroup
-  
-  This class to provide set of DDS_DicItem objects from one component.
+  \brief This class provides a set of DDS_DicItem objects from one component.
 */
 
 /*!
-  Constructor. Create the group with name \aname.
+  \brief Constructor.
+
+  Create the group with name \a name.
+
+  \param name group name
 */
 DDS_DicGroup::DDS_DicGroup( const TCollection_AsciiString& name )
 : MMgt_TShared(),
-myName( name ),
-myActiveSystem( UNIT_SYSTEM_SI )
+  myName( name ),
+  myActiveSystem( UNIT_SYSTEM_SI )
 {
 }
 
 /*!
-  Copy constructor.
+  \brief Copy constructor (put in private section to prevent object copying).
 */
 DDS_DicGroup::DDS_DicGroup( const DDS_DicGroup& )
 {
 }
 
 /*!
-  Get the name of group (component).
+  \brief Get the name of group (component).
+  \return group name
 */
 TCollection_AsciiString DDS_DicGroup::GetName() const
 {
@@ -65,8 +70,8 @@ TCollection_AsciiString DDS_DicGroup::GetName() const
 }
 
 /*!
-  Returns the names list of defined unit systems.
-  Parameter \atheSystems will contains the sequence of string names.
+  \brief Get the names of all defined units systems.
+  \param theSystemsSeq returning sequence of names
 */
 void DDS_DicGroup::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystemSeq ) const
 {
@@ -81,7 +86,12 @@ void DDS_DicGroup::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystemSeq )
 }
 
 /*!
-  Returns the label of unit system \aname. If unit system not found then empty string returned.
+  \brief Get the label of units system \a name.
+  
+  If units system is not found, empty string is returned.
+
+  \param make units system name
+  \return units system label
 */
 TCollection_ExtendedString DDS_DicGroup::GetUnitSystemLabel( const TCollection_AsciiString& name ) const
 {
@@ -92,7 +102,8 @@ TCollection_ExtendedString DDS_DicGroup::GetUnitSystemLabel( const TCollection_A
 }
 
 /*!
-  Gets the name of active unit system.
+  \brief Get the name of active units system.
+  \return active units system name
 */
 TCollection_AsciiString DDS_DicGroup::GetActiveUnitSystem() const
 {
@@ -100,7 +111,8 @@ TCollection_AsciiString DDS_DicGroup::GetActiveUnitSystem() const
 }
 
 /*!
-  Sets the name of active unit system.
+  \brief Set the active unit system.
+  \param theSystem name of the units system to be made active
 */
 void DDS_DicGroup::SetActiveUnitSystem( const TCollection_AsciiString& theSystem )
 {
@@ -109,14 +121,16 @@ void DDS_DicGroup::SetActiveUnitSystem( const TCollection_AsciiString& theSystem
 }
 
 /*!
-  Assignment operator.
+  \brief Assignment operator (put in private section to prevent object copying).
 */
 void DDS_DicGroup::operator=( const DDS_DicGroup& )
 {
 }
 
 /*!
-  Fill the internal data structures from XML parsed structures. Internal.
+  \brief Fill the internal data structures from XML parsed structures.
+  \param theComponentData component data DOM node
+  \param theDocElement document element DOM node
 */
 void DDS_DicGroup::FillDataMap( const LDOM_Element& theComponentData, const LDOM_Element& theDocElement )
 {
@@ -140,6 +154,8 @@ void DDS_DicGroup::FillDataMap( const LDOM_Element& theComponentData, const LDOM
 
       if ( !myUnitSystem.IsBound( aName ) )
         myUnitSystem.Bind( aName, aLabel );
+
+
     }
   }
 
@@ -170,14 +186,28 @@ void DDS_DicGroup::FillDataMap( const LDOM_Element& theComponentData, const LDOM
     aDicItem->myComponent = this;
     aDicItem->FillDataMap( anID, aQuantity, theComponentData, theDocElement, unitSystems );
     myDataMap.Add( anID, aDicItem );
+
+    bool exist = false;
+    for( int i=1, n=myKeys.Length(); i<=n && !exist; i++ )
+      if( myKeys.Value( i )==anID )
+      {
+        cout << "Doubled key:" << anID << endl;
+        exist = true;
+      }
+    if( !exist )
+      myKeys.Append( anID );
   }
 }
 
 /*!
-  Gets dictionary item with specified identifier \atheID.
-  If dictionary item not found then null handle returned.
+  \brief Get the dictionary item with specified identifier \a theID.
+
+  If dictionary item is not found, null handle is returned.
+
+  \param theID item identifier
+  \return dictionary item
 */
-Handle(DDS_DicItem) DDS_DicGroup::GetDicItem( const TCollection_AsciiString& theID ) const
+Handle_DDS_DicItem DDS_DicGroup::GetDicItem( const TCollection_AsciiString& theID ) const
 {
   Handle(DDS_DicItem) aDicItem;
   // get dictionary item by id
@@ -186,3 +216,12 @@ Handle(DDS_DicItem) DDS_DicGroup::GetDicItem( const TCollection_AsciiString& the
 
   return aDicItem;
 }
+
+/*!
+  \brief Return all keys of the group
+  \param seq - string container to be filled with keys
+*/
+void DDS_DicGroup::GetKeys( TColStd_SequenceOfAsciiString& seq ) const
+{
+  seq = myKeys;
+}
index a804776eaac6d1b3bb550ed0bcaeafea6e002241..1ef6afda7f7c979d9295122d4141dc7c4435ae04 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef DDS_DICGROUP_H
 #define DDS_DICGROUP_H
 #include "DDS_DicItem.h"
 
 #include <MMgt_TShared.hxx>
-
-#include <TCollection_AsciiString.hxx>
-
+#include <TColStd_SequenceOfAsciiString.hxx>
 #include <NCollection_List.hxx>
 
 class LDOM_Element;
-class TColStd_SequenceOfAsciiString;
 
 DEFINE_STANDARD_HANDLE(DDS_DicGroup, MMgt_TShared)
 
@@ -40,6 +40,7 @@ public:
   DDS_DicGroup( const TCollection_AsciiString& );
 
   TCollection_AsciiString                    GetName() const;
+  Standard_EXPORT void                       GetKeys( TColStd_SequenceOfAsciiString& ) const;
 
   Standard_EXPORT Handle(DDS_DicItem)        GetDicItem( const TCollection_AsciiString& ) const;
 
@@ -65,6 +66,7 @@ private:
   DDS_IndexedDataMapOfDicItems               myDataMap;
   UnitSystemMap                              myUnitSystem;
   TCollection_AsciiString                    myActiveSystem;
+  TColStd_SequenceOfAsciiString              myKeys;
 
   friend class DDS_Dictionary;
 
index 48ce715a9c76315bb92f71f77f727bfa4fac6900..6a8954546c2fe97cab83b5d3d50996816d0b6968 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "DDS_DicItem.h"
 #include "DDS_Dictionary.h"
@@ -37,40 +40,42 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_DicItem, MMgt_TShared)
 
 /*!
   \class DDS_DicItem
-
-  This class to provide information about datum (phisical characteristic parameter).
+  \brief This class provides an information about datum (phisical characteristic parameter).
 */
 
 /*!
-  Constructor. Creates the instance of empty dictionary item.
+  \brief Constructor.
+
+  Creates the instance of empty dictionary item.
 */
 DDS_DicItem::DDS_DicItem()
 : myType( 0 ),
-myDefValue( 0 ),
-myMax( 0 ),
-myMin( 0 ),
-myMinZoom( 0.1 ),
-myMaxZoom( 10 ),
-myZoomOrder( 2 )
+  myMax( 0 ),
+  myMin( 0 ),
+  myDefValue( 0 ),
+  myMinZoom( 0.1 ),
+  myMaxZoom( 10 ),
+  myZoomOrder( 2 )
 {
 }
 
 /*!
-  Copy constructor. Internal.
+  \brief Copy constructor (put in private section to prevent object copying).
 */
 DDS_DicItem::DDS_DicItem( const DDS_DicItem& )
 {
 }
 
 /*!
-  Assignment operator. Internal.
+  \brief Assignment operator (put in private section to prevent object copying).
 */
 void DDS_DicItem::operator=( const DDS_DicItem& )
 {
 }
 
 /*!
-  Gets the identifier of parameter.
+  \brief Get the identifier of parameter.
+  \return parameter ID
 */
 TCollection_AsciiString DDS_DicItem::GetId() const
 {
@@ -78,7 +83,8 @@ TCollection_AsciiString DDS_DicItem::GetId() const
 }
 
 /*!
-  Gets the type of parameter.
+  \brief Get the type of parameter.
+  \return parameter type
 */
 DDS_DicItem::Type DDS_DicItem::GetType() const
 {
@@ -86,7 +92,8 @@ DDS_DicItem::Type DDS_DicItem::GetType() const
 }
 
 /*!
-  Gets the label of the parameter.
+  \brief Get the label of the parameter.
+  \return parameter label
 */
 TCollection_ExtendedString DDS_DicItem::GetLabel() const
 {
@@ -94,7 +101,8 @@ TCollection_ExtendedString DDS_DicItem::GetLabel() const
 }
 
 /*!
-  Gets the filter (regular expression) for the parameter values.
+  \brief Get the filter (regular expression) for the parameter values.
+  \return parameter filter
 */
 TCollection_ExtendedString DDS_DicItem::GetFilter() const
 {
@@ -102,7 +110,8 @@ TCollection_ExtendedString DDS_DicItem::GetFilter() const
 }
 
 /*!
-  Gets the Required attribute of the parameter.
+  \brief Get the Required attribute of the parameter.
+  \return Required attribute
 */
 TCollection_ExtendedString DDS_DicItem::GetRequired() const
 {
@@ -110,7 +119,8 @@ TCollection_ExtendedString DDS_DicItem::GetRequired() const
 }
 
 /*!
-  Gets the wrong value warning level of the parameter.
+  \brief Get the wrong value warning level of the parameter.
+  \return warning level
 */
 DDS_MsgType DDS_DicItem::GetWarningLevel() const
 {
@@ -118,7 +128,8 @@ DDS_MsgType DDS_DicItem::GetWarningLevel() const
 }
 
 /*!
-  Gets the long description of the parameter.
+  \brief Get the long description of the parameter.
+  \return long description
 */
 TCollection_ExtendedString DDS_DicItem::GetLongDescription() const
 {
@@ -126,7 +137,8 @@ TCollection_ExtendedString DDS_DicItem::GetLongDescription() const
 }
 
 /*!
-  Gets the short description of the parameter.
+  \brief Get the short description of the parameter.
+  \return short description
 */
 TCollection_ExtendedString DDS_DicItem::GetShortDescription() const
 {
@@ -134,7 +146,8 @@ TCollection_ExtendedString DDS_DicItem::GetShortDescription() const
 }
 
 /*!
-  Gets the name of component - owner of parameter.
+  \brief Get the name of the component (parameter owner).
+  \return component name
 */
 TCollection_AsciiString DDS_DicItem::GetComponent() const
 {
@@ -146,7 +159,8 @@ TCollection_AsciiString DDS_DicItem::GetComponent() const
 }
 
 /*!
-  Gets the parameter unit of measure for active unit system.
+  \brief Get the parameter measure units for active units system.
+  \return parameter units
 */
 TCollection_AsciiString DDS_DicItem::GetUnits() const
 {
@@ -154,8 +168,12 @@ TCollection_AsciiString DDS_DicItem::GetUnits() const
 }
 
 /*!
-  Gets the parameter unit of measure for specified unit system \atheSystem.
-  If specified unit system doesn't exist then empty string returned.
+  \brief Get the parameter measure units for specified units system \a theSystem.
+
+  If specified units system doesn't exist, empty string is returned.
+
+  \param theSystem units system
+  \return parameter units
 */
 TCollection_AsciiString DDS_DicItem::GetUnits( const UnitSystem& theSystem ) const
 {
@@ -167,8 +185,11 @@ TCollection_AsciiString DDS_DicItem::GetUnits( const UnitSystem& theSystem ) con
 }
 
 /*!
-  Gets the minimum value of parameter for active unit system.
-  Returned value converted to SI.
+  \brief Get the minimum value of the parameter for active units system.
+  
+  Returned value is converted to SI.
+  
+  \return minimum value
 */
 Standard_Real DDS_DicItem::GetMinValue() const
 {
@@ -176,8 +197,13 @@ Standard_Real DDS_DicItem::GetMinValue() const
 }
 
 /*!
-  Gets the minimum value of parameter for specified unit system \atheSystem.
-  Returned value converted to SI.
+  \brief Get the minimum value of the parameter for the specified 
+         units system \a theSystem.
+        
+  Returned value is converted to SI.
+
+  \param theUnitsSystem units system
+  \return minimum value
 */
 Standard_Real DDS_DicItem::GetMinValue( const UnitSystem& theUnitsSystem ) const
 {
@@ -185,8 +211,11 @@ Standard_Real DDS_DicItem::GetMinValue( const UnitSystem& theUnitsSystem ) const
 }
 
 /*!
-  Gets the maximum value of parameter for active unit system.
+  \brief Get the maximum value of the parameter for active units system.
+
   Returned value converted to SI.
+  
+  \return maximum value
 */
 Standard_Real DDS_DicItem::GetMaxValue() const
 {
@@ -194,8 +223,13 @@ Standard_Real DDS_DicItem::GetMaxValue() const
 }
 
 /*!
-  Gets the maximum value of parameter for specified unit system \atheSystem.
+  \brief Get the maximum value of the parameter for specified 
+         units system \a theSystem.
   Returned value converted to SI.
+  
+  \param theUnitsSystem units system
+  \return maximum value
 */
 Standard_Real DDS_DicItem::GetMaxValue( const UnitSystem& theUnitsSystem ) const
 {
@@ -203,7 +237,9 @@ Standard_Real DDS_DicItem::GetMaxValue( const UnitSystem& theUnitsSystem ) const
 }
 
 /*!
-  Gets the precision (number of digit after decimal point) of parameter for active unit system.
+  \brief Get the precision (number of digits after decimal point) 
+         of the parameter for active units system.
+  \return parameter precision
 */
 Standard_Integer DDS_DicItem::GetPrecision() const
 {
@@ -211,8 +247,13 @@ Standard_Integer DDS_DicItem::GetPrecision() const
 }
 
 /*!
-  Gets the precision (number of digit after decimal point) of parameter for specified
-  unit system \atheSystem. If specified unit system doesn't exist then zero returned.
+  \brief Get the precision (number of digits after decimal point) of the parameter
+  for specified units system \a theSystem. 
+
+  If specified units system doesn't exist, zero is returned.
+
+  \param theSystem units system
+  \return parameter precision
 */
 Standard_Integer DDS_DicItem::GetPrecision( const UnitSystem& theSystem ) const
 {
@@ -224,9 +265,13 @@ Standard_Integer DDS_DicItem::GetPrecision( const UnitSystem& theSystem ) const
 }
 
 /*!
-  Gets the default value of parameter for active unit system. Default value returned as string.
-  If type of value is numeric (Float or Integer) and default value defined then returned number
-  converted to SI.
+  \brief Get the default value of the parameter for active units system.
+  
+  Default value is returned as string.
+  If type of the value is numerical (Float or Integer) and default value
+  is defined, then the returning value is converted to SI.
+
+  \return default value
 */
 TCollection_ExtendedString DDS_DicItem::GetDefaultValue() const
 {
@@ -234,9 +279,15 @@ TCollection_ExtendedString DDS_DicItem::GetDefaultValue() const
 }
 
 /*!
-  Gets the default value of parameter for specified unit system \atheSystem. Default value returned
-  as string. If type of value is numeric (Float or Integer) and default value defined then returned
-  number converted to SI.
+  \brief Get the default value of the parameter for specified 
+         units system \a theSystem.
+  
+  Default value is returned as string.
+  If type of the value is numerical (Float or Integer) and default value
+  is defined, then the returning value is converted to SI.
+
+  \param theSystem units system
+  \return default value
 */
 TCollection_ExtendedString DDS_DicItem::GetDefaultValue( const UnitSystem& theSystem ) const
 {
@@ -262,9 +313,13 @@ TCollection_ExtendedString DDS_DicItem::GetDefaultValue( const UnitSystem& theSy
 }
 
 /*!
-  Gets the format string of parameter for active unit system. If argument \atheCanonical
-  is true then format string will be reduced to sprintf() specification (without extra
-  non standard qualifiers).
+  \brief Get the format string of the parameter for active units system.
+
+  If argument \a theCanonical is \c true, format string is reduced according
+  to the sprintf() specification (without extra non standard qualifiers).
+
+  \param theCanonical 'canonical form' flag
+  \return format string
 */
 TCollection_AsciiString DDS_DicItem::GetFormat( const Standard_Boolean theCanonical ) const
 {
@@ -272,9 +327,15 @@ TCollection_AsciiString DDS_DicItem::GetFormat( const Standard_Boolean theCanoni
 }
 
 /*!
-  Gets the format string of parameter for specified unit system \atheSystem. If argument
-  \atheCanonical is true then format string will be reduced to sprintf() specification
-  (without extra non standard qualifiers).
+  \brief Get the format string of the parameter for specified 
+         units system \a theSystem.
+
+  If argument \a theCanonical is \c true, format string is reduced according
+  to the sprintf() specification (without extra non standard qualifiers).
+
+  \param theSystem units system
+  \param theCanonical 'canonical form' flag
+  \return format string
 */
 TCollection_AsciiString DDS_DicItem::GetFormat( const UnitSystem& theSystem,
                                                 const Standard_Boolean theCanonical ) const
@@ -304,8 +365,14 @@ TCollection_AsciiString DDS_DicItem::GetFormat( const UnitSystem& theSystem,
 }
 
 /*!
-  Gets name of a list referenced by the parameter. This string is empty if the list
-  refernce is not defined - then use other properties: Type, DefaultValue, MaxValue, MinValue
+  \brief Get the name of a list referenced by the parameter.
+
+  This string is empty if the list reference is not defined.
+  In this case, other properties (Type, DefaultValue, MaxValue, MinValue)
+  should be used.
+  
+  \return referenced list name
+  \sa GetListOfValues()
 */
 TCollection_ExtendedString DDS_DicItem::GetNameOfValues() const
 {
@@ -313,8 +380,17 @@ TCollection_ExtendedString DDS_DicItem::GetNameOfValues() const
 }
 
 /*!
-  Gets item names and item ids of a list referenced by the parameter. This sequences is empty if
-  the list reference is not defined - then use other properties: Type, DefaultValue, MaxValue, MinValue
+  \brief Get item names and item identifiers of a list referenced
+         by the parameter.
+
+  These sequences are empty if the list reference is not defined.
+  In this case, other properties (Type, DefaultValue, MaxValue, MinValue)
+  should be used.
+
+  \param theStrings returning items names
+  \param theIntegers returning items identifiers
+  \return \c true if returning lists are not empty
+  \sa GetNameOfValues()
 */
 Standard_Boolean DDS_DicItem::GetListOfValues( Handle(TColStd_HArray1OfExtendedString)& theStrings,
                                                Handle(TColStd_HArray1OfInteger)& theIntegers ) const
@@ -325,8 +401,20 @@ Standard_Boolean DDS_DicItem::GetListOfValues( Handle(TColStd_HArray1OfExtendedS
 }
 
 /*!
-  Gets item names, item ids and item icons of a list referenced by the parameter. This sequences is empty
-  if the list reference is not defined - then use other properties: Type, DefaultValue, MaxValue, MinValue
+  \brief Get item names, item identifiers and item icons of a list
+         referenced by the parameter.
+
+  \overload
+
+  These sequences are empty if the list reference is not defined.
+  In this case, other properties (Type, DefaultValue, MaxValue, MinValue)
+  should be used.
+
+  \param theStrings returning items names
+  \param theIntegers returning items identifiers
+  \param theIcons returning items icons
+  \return \c true if returning lists are not empty
+  \sa GetNameOfValues()
 */
 Standard_Boolean DDS_DicItem::GetListOfValues( Handle(TColStd_HArray1OfExtendedString)& theStrings,
                                                Handle(TColStd_HArray1OfInteger)& theIntegers,
@@ -340,7 +428,9 @@ Standard_Boolean DDS_DicItem::GetListOfValues( Handle(TColStd_HArray1OfExtendedS
 
 
 /*!
-  Gets special values of the parameter.
+  \brief Get special values of the parameter.
+  \param theMap returning map of the special values
+  \return \c true if returning map is not empty
 */
 Standard_Boolean DDS_DicItem::GetSpecialValues( TColStd_MapOfReal& theMap ) const
 {
@@ -362,7 +452,8 @@ Standard_Boolean DDS_DicItem::GetSpecialValues( TColStd_MapOfReal& theMap ) cons
 }
 
 /*!
-  Gets minimum value of lateral zooming
+  \brief Get minimum value of lateral zooming.
+  \return lateral zooming minimum value
 */
 Standard_Real DDS_DicItem::GetMinZoom() const
 {
@@ -370,7 +461,8 @@ Standard_Real DDS_DicItem::GetMinZoom() const
 }
 
 /*!
-  Gets maximum value of lateral zooming
+  \brief Get maximum value of lateral zooming.
+  \return lateral zooming maximum value
 */
 Standard_Real DDS_DicItem::GetMaxZoom() const
 {
@@ -378,7 +470,8 @@ Standard_Real DDS_DicItem::GetMaxZoom() const
 }
 
 /*!
-  Gets order of lateral zooming
+  \brief Get order of lateral zooming.
+  \return lateral zooming order
 */
 Standard_Real DDS_DicItem::GetZoomOrder() const
 {
@@ -386,7 +479,10 @@ Standard_Real DDS_DicItem::GetZoomOrder() const
 }
 
 /*!
-  Convert value \atheVal to default SI units according to active unit system.
+  \brief Convert value \a theVal to the default SI units
+         according to the active units system.
+  \param theVal value being converted
+  \return value converted to SI
 */
 Standard_Real DDS_DicItem::ToSI( const Standard_Real theVal ) const
 {
@@ -394,7 +490,10 @@ Standard_Real DDS_DicItem::ToSI( const Standard_Real theVal ) const
 }
 
 /*!
-  Convert value \atheVal from default SI units according to active unit system.
+  \brief Convert value \a theVal from the default SI units
+         according to the active units system.
+  \param theVal value being converted
+  \return value converted from SI
 */
 Standard_Real DDS_DicItem::FromSI( const Standard_Real theVal ) const
 {
@@ -402,7 +501,11 @@ Standard_Real DDS_DicItem::FromSI( const Standard_Real theVal ) const
 }
 
 /*!
-  Convert value to default SI units according to unit system \atheUnitsSystem.
+  \brief Convert value to the default SI units according to the 
+         units system \a theUnitsSystem.
+  \param theVal value being converted
+  \param theUnitsSystem units system
+  \return value converted to the specified units system
 */
 Standard_Real DDS_DicItem::ToSI( const Standard_Real theVal, const UnitSystem& theUnitsSystem ) const
 {
@@ -414,7 +517,11 @@ Standard_Real DDS_DicItem::ToSI( const Standard_Real theVal, const UnitSystem& t
 }
 
 /*!
-  Convert value from default SI units according to unit system \atheUnitsSystem.
+  \brief Convert value from the default SI units according to the
+         units system \a theUnitsSystem.
+  \param theVal value being converted
+  \param theUnitsSystem units system
+  \return value converted from the specified units system
 */
 Standard_Real DDS_DicItem::FromSI( const Standard_Real theVal, const UnitSystem& theUnitsSystem ) const
 {
@@ -426,7 +533,9 @@ Standard_Real DDS_DicItem::FromSI( const Standard_Real theVal, const UnitSystem&
 }
 
 /*!
-  Returns 'true' if data specified by \aflag exist.
+  \brief Check data existence.
+  \param flag data flag
+  \return \c true if data specified by \a flag exists
 */
 Standard_Boolean DDS_DicItem::HasData( const Standard_Integer flag ) const
 {
@@ -434,7 +543,12 @@ Standard_Boolean DDS_DicItem::HasData( const Standard_Integer flag ) const
 }
 
 /*!
-  Returns options for specified name \aname. If option not found then empty string returned.
+  \brief Get option for specified name \a name.
+  
+  If option is not found, empty string is returned.
+
+  \param name option name
+  \return option value
 */
 TCollection_ExtendedString DDS_DicItem::GetOption( const TCollection_AsciiString& name ) const
 {
@@ -445,8 +559,9 @@ TCollection_ExtendedString DDS_DicItem::GetOption( const TCollection_AsciiString
 }
 
 /*!
-  Returns names list of existing options in the specified sequence \anames.
-  If list not empty retunrs 'true' otherwise 'false'.
+  \brief Get names of all existing options.
+  \param names returning list of options
+  \return \c true if list is not empty
 */
 Standard_Boolean DDS_DicItem::GetOptionNames( TColStd_SequenceOfAsciiString& names ) const
 {
@@ -460,7 +575,13 @@ Standard_Boolean DDS_DicItem::GetOptionNames( TColStd_SequenceOfAsciiString& nam
 
 
 /*!
-  Parse record in XML file and retrieve information relevant for this dictionary item
+  \brief Parse record from XML file and retrieve information relevant for 
+         the dictionary item.
+  \param theID item identifier
+  \param theDatum datum XML node
+  \param theCompElement component XML node
+  \param theDocElement document XML node
+  \param theSystems units system names
 */
 void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element& theDatum,
                                const LDOM_Element& theCompElement, const LDOM_Element& theDocElement,
@@ -708,21 +829,41 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element
   LDOM_Element anOpt = theDatum.GetChildByTagName( DDS_Dictionary::KeyWord( "OPTIONS" ) );
   if ( !anOpt.isNull() )
   {
-    LDOM_NodeList anOptions = anOpt.getElementsByTagName( DDS_Dictionary::KeyWord( "OPTION" ) );
+    LDOM_NodeList anOptions = anOpt.GetAttributesList();//anOpt.getElementsByTagName( DDS_Dictionary::KeyWord( "OPTION" ) );
     for ( Standard_Integer oi = 0; oi < anOptions.getLength(); oi++ )
     {
       LDOM_Node node = anOptions.item( oi );
-      if ( node.getNodeType() != LDOM_Node::ELEMENT_NODE )
-        continue;
-
-      LDOM_Element& elem = (LDOM_Element&)node;
-      TCollection_AsciiString name = elem.getAttribute( DDS_Dictionary::KeyWord( "OPTION_NAME" ) );
+      LDOM_Node::NodeType t = node.getNodeType();
 
+      TCollection_AsciiString name;
       TCollection_ExtendedString value;
-      const LDOM_Node aNode = elem.getFirstChild();
-      LDOM_Text anOptTxt( (const LDOM_Text&)(aNode) );
-      if ( !anOptTxt.isNull() )
-        value = anOptTxt.getData();
+
+      if( t==LDOM_Node::ELEMENT_NODE )
+      {
+        const LDOM_Element& elem = ( const LDOM_Element& )node;
+        name = elem.getAttribute( DDS_Dictionary::KeyWord( "OPTION_NAME" ) );
+        
+        const LDOM_Node aNode = elem.getFirstChild();
+        LDOM_Text anOptTxt( (const LDOM_Text&)(aNode) );
+        if ( !anOptTxt.isNull() )
+          value = anOptTxt.getData();
+      }
+      else if( t==LDOM_Node::ATTRIBUTE_NODE )
+      {
+        const LDOM_Attr& attr = ( const LDOM_Attr& )node;
+        name = ( Standard_CString )attr.getName().GetString();
+        LDOMString v = attr.getValue();
+        if( v.Type()==LDOMBasicString::LDOM_Integer )
+        {
+               Standard_Integer ival;
+               v.GetInteger( ival );
+               value = TCollection_ExtendedString( ival );
+        }
+        else
+               value = ( Standard_CString )v.GetString();
+      }
+      else
+        continue;
 
       if ( !name.IsEmpty() && value.Length() && !myOptions.IsBound( name ) )
         myOptions.Bind( name, value );
@@ -814,7 +955,7 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element
 }
 
 /*!
-  Returns default formats for each unit systems
+  \brief Restore default formats for all the units systems.
 */
 void DDS_DicItem::GetDefaultFormat()
 {
@@ -839,7 +980,12 @@ void DDS_DicItem::GetDefaultFormat()
 }
 
 /*!
-  Returns format for the string
+  \brief Get format for the string.
+  \param theFlags format flags
+  \param theWidth field width
+  \param thePrecision precision
+  \param theTypePrefix type prefix
+  \param theFormat returning format string
 */
 void DDS_DicItem::GetStringFormat( const TCollection_AsciiString& theFlags,
                                    const TCollection_AsciiString& theWidth,
@@ -862,7 +1008,13 @@ void DDS_DicItem::GetStringFormat( const TCollection_AsciiString& theFlags,
 }
 
 /*!
-  Returns format for the integer
+  \brief Get format for the integer.
+  \param theFlags format flags
+  \param theWidth field width
+  \param thePrecision precision
+  \param theTypePrefix type prefix
+  \param theType integer value type 
+  \param theFormat returning format string
 */
 void DDS_DicItem::GetIntegerFormat( const TCollection_AsciiString& theFlags,
                                     const TCollection_AsciiString& theWidth,
@@ -900,7 +1052,13 @@ void DDS_DicItem::GetIntegerFormat( const TCollection_AsciiString& theFlags,
 }
 
 /*!
-  Returns format for the float
+  \brief Returns format for the float.
+  \param theFlags format flags
+  \param theWidth field width
+  \param thePrecision precision
+  \param theTypePrefix type prefix
+  \param theType floating point value type 
+  \param theFormat returning format string
 */
 void DDS_DicItem::GetFloatFormat( const TCollection_AsciiString& theFlags,
                                   const TCollection_AsciiString& theWidth,
@@ -946,9 +1104,10 @@ void DDS_DicItem::GetFloatFormat( const TCollection_AsciiString& theFlags,
 }
 
 /*!
-  Prepares formats for each unit systems
+  \brief Prepare formats for all units systems.
+  \param theFormat format string
 */
-void DDS_DicItem::PrepareFormats( const TCollection_AsciiString&  theFormat )
+void DDS_DicItem::PrepareFormats( const TCollection_AsciiString& theFormat )
 {
   for ( NCollection_DataMap<UnitSystem, UnitData>::Iterator it( myUnitData ); it.More(); it.Next() )
   {
@@ -1069,7 +1228,9 @@ void DDS_DicItem::PrepareFormats( const TCollection_AsciiString&  theFormat )
 }
 
 /*!
-  Split the string \atheStr by spaces and returns substrings in array \aaRes.
+  \brief Split the string \a theStr separated by spaces.
+  \param theStr source string
+  \param aRes returning  substrings array
 */
 void DDS_DicItem::Split( const TCollection_AsciiString& theStr, Handle(TColStd_HArray1OfExtendedString)& aRes )
 {
@@ -1103,7 +1264,9 @@ void DDS_DicItem::Split( const TCollection_AsciiString& theStr, Handle(TColStd_H
 }
 
 /*!
-  Returns unit structure for given unit system \asys.
+  \brief Get units structure for specified units system \a sys.
+  \param sys units system
+  \return units system information structure
 */
 DDS_DicItem::UnitData* DDS_DicItem::GetUnitData( const UnitSystem& sys ) const
 {
@@ -1116,7 +1279,8 @@ DDS_DicItem::UnitData* DDS_DicItem::GetUnitData( const UnitSystem& sys ) const
 }
 
 /*!
-  Gets the active unit system.
+  \brief Get the active units system.
+  \return active units system
 */
 DDS_DicItem::UnitSystem DDS_DicItem::GetActiveUnitSystem() const
 {
index b326399002c7ed99237cb63f0c69b5ae9d68d58d..d81a5e744ca7575e1ce330701bd5ee1a7c945419 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef DDS_DICITEM_H
 #define DDS_DICITEM_H
index dd741872fb06cee80f2e880d4d1f76cf23cffca4..ff4c516f34c1467ae7f123947cbbf0b00d558f72 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "DDS_Dictionary.h"
 
@@ -39,14 +42,16 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_Dictionary, MMgt_TShared)
 
 /*!
   \class DDS_Dictionary
-  
-  This class to provide information about used datums, reading them from 'xml' file
+  \brief This class provides an information about used datums, 
+         reading them from XML file.
 
-  Datum is the set of parameters described a phisical characteristic. These parameters loaded from
-  special XML which has following format:
+  There is the only instance of the class DDS_Dictionary in the application
+  which can be retrieved by method Get().
 
-  \hr
+  Datum is a set of parameters describing a phisical characteristic.
+  These parameters are loaded from the XML file which has the following format:
 
+  \verbatim
   <D_URI>
   <COMPONENT COMPONENT_NAME="component_name">
     <UNIT_SYSTEMS>
@@ -89,70 +94,87 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_Dictionary, MMgt_TShared)
     </COMPONENT>
   </D_URI>
 
-  \hr
-
-  In description of datum file format used internal keys as XML tag and attributes names.
-  Concrete XML keywords defined by DDS_KeyWords class.
-
-  Describe datum file format more detailed. XML file should have one main tag named as "dictionary" (key "D_URI").
-  This tag should contains one or several components. Component is a independent set of datums and unit systems.
-  Components defined as XML tag named "component" (key "COMPONENT") with attribute "name" (key COMPONENT_NAME).
-  Component name used as component identifier and should be unique. Component tag can contains:
-
-  \li Tag "unit_systems" (key UNIT_SYSTEMS) defines set of used unit systems. Should exist at least one unit
-  system named SI ("System International"). If this system not exist then it will be defined automatically.
-  Each unit system defined by XML tag "unit system" (key UNIT_SYSTEM) under tag "unit_systems" with attributes
-  "name" (key UNIT_SYSTEM_NAME) and "label" (key UNIT_SYSTEM_LABEL). Name is identifier of unit system. Label is
-  human readable description.
-
-  \li One or several tag "datum" (key DATUM). For this tag can be defined following attributes:
-
-      \lo Identifier (key DATUM_ID) specify the unique id string for the datum.
-      \lo Label (key DATUM_LABEL) specify human readable name of the datum.
-      \lo Units of measure (key DATUM_UNITS) for given unit system. Attribute name consist of a name
-          of unit system and a keyword got from DDS_KeyWords by key DATUM_UNITS. For example for unit system
-          named SI and default keyword attribute name will be "SIunits". This attribute should be specified
-          for each deaclared unit system. Value of this attribute should be string describs units of measure.
-          Possible designations for units of measure and their multiple prefixes see in package UnitsAPI of
-          library OpenCascade (files Units.dat and Lexi_Expr.dat). Units of measure will be used for numeric
-          value conversion from one unit system to another one.
-      \lo Format (key DATUM_FORMAT) specify the format string which will be used during initial formatting
-          of value. This string should be specified in sprintf() format.
-      \lo Filter (key DATUM_FILTER) specify the regualr expression. Each user entered string will be checked up
-          on matching to this expression (if it defined). Non matched strings will be rejected.
-      \lo Required value (key DATUM_REQUIRED). If this attributed defined and value is true then user can't
-          leave a input filed blank (parameter must be always entered).
-
-      Tag "description" (key DESCR) can be defined under the tag "datum". This tag contains two sub tags:
-         \lo "short description" (key SHORT_D) specify a brief datum description text
-         \lo "long description" (key LONG_D) specify a detailed description text
-
-      Tag "options" (key OPTIONS) can be defined under the tag "datum". This tag contains one or more sub
-      tags "option" (key OPTION). Each of these XML elements should contain text option value and attribute
-      "name" (key OPTION_NAME) which specified option name.
-
-      Each tag "datum" define most common parameters of phisical characteristic.
-      This parameters placed in two groups:
-      \lo Domain parameters under tag "domain" (key DY_DOMAIN). This tag can contains value description tag
-          (key VALUE_DESCR) for discrete data or list reference tag (key VALUE_LIST_REF) for enumerable data.
-          Discrete data described following parameters:
-            default value (key VD_DEFV)
-            maximum value (key VD_MAXV)
-            minimum value (key VD_MINV)
-            type of value (key VD_TYPE) - possible values: String, Integer, Float, List
-          Enumerable data described by "list reference" attribute (key VLR_LIST) which reference on
-          list (see "list definition" tag) by list id.
-
-  \li One or several tag "list definition" (key VALUE_LIST). This tag define the list of items for enumerable
-      data. Attribute "list id" (key VALUE_LIST_ID) specify the identifier string for the list and attribute
-      "list name" (key VALUE_LIST_NAME) define a list name string. Each list item described by tag "list value"
-      (key VALUE_LIST_VALUE) under tag "list definition". Each this tag contains item string text and have
-      following attributes:
-        \lo "list item id" (key VALUE_LIST_VALUEID) - integer numerical identifier for item
-        \lo "list item icon" (key VALUE_LIST_VALUEICON) - icon file name for item
-
-  Below the example of a XML file with use default keywords.
+  \endverbatim
+
+  In above description of the datum XML file format internal keys are used as XML tags
+  and attributes names. Real XML keywords are defined by DDS_KeyWords class.
 
+  XML file should have one main tag named "dictionary" (key "D_URI"). This tag
+  should contain one or several components. 
+  Component is an independent set of datums and units systems.
+  Components are defined by XML tag named "component" (key "COMPONENT") with 
+  attribute "name" (key COMPONENT_NAME).
+  Component name is used as component identifier and should be unique. 
+  
+  Component tag can contain:
+
+  - Tag "unit_systems" (key UNIT_SYSTEMS) defines a set of used units systems.
+  At least one unit system named SI ("System International") should exist.
+  If this system does not exist, it will be created automatically.
+  Each units system is defined by XML tag "unit system" (key UNIT_SYSTEM) under 
+  the tag "unit_systems" with attributes "name" (key UNIT_SYSTEM_NAME) 
+  and "label" (key UNIT_SYSTEM_LABEL). Name is an identifier of the units system and
+  label is its human readable description.
+
+  - One or several tags "datum" (key DATUM). For this tag the following attributes 
+  can be defined:
+    -# Identifier (key DATUM_ID) specifies the unique id string for the datum.
+    -# Label (key DATUM_LABEL) specifies human readable name of the datum.
+    -# Measure units (key DATUM_UNITS) for the given units system. Attribute name 
+    defines a name of units system and a keyword got from DDS_KeyWords by key DATUM_UNITS.
+    For example, for "SI" units system and default keyword the attribute name is "SIunits".
+    This attribute should be specified for each declared units system. 
+    Value of this attribute should be a string describing measure units.
+    For possible designations for measure units and their multiple prefixes
+    please refer to the UnitsAPI package of the OpenCascade library
+    (files Units.dat and Lexi_Expr.dat). Measure units are used for numerical
+    values conversion from one units system to another one.
+    -# Format (key DATUM_FORMAT) specifies the format string which will be used
+    during initial formatting of the value. This string should be specified 
+    in sprintf() format.
+    -# Filter (key DATUM_FILTER) specifies the regualr expression. The value (string)
+    entered by the user will be checked up to match to this regular expression
+    (if it defined). Non matched strings will be rejected.
+    -# Required value (key DATUM_REQUIRED). If this attributed si defined and its value
+    is \c true then user can't leave an input non-filled - parameter must be explicitly
+    entered by the user).
+
+  - One or several tags "list definition" (key VALUE_LIST). Each such tag defines
+  the list of items for enumerable data. Attribute "list id" (key VALUE_LIST_ID) 
+  specifies the identifier string for the list and attribute "list name"
+  (key VALUE_LIST_NAME) defines a list name string. Each list item is described
+  by tag "list value" (key VALUE_LIST_VALUE) under the tag "list definition". 
+  Each this tag contains item string text and have the following attributes:
+    -# "list item id" (key VALUE_LIST_VALUEID) - integer numerical identifier for 
+    the item
+    -# "list item icon" (key VALUE_LIST_VALUEICON) - icon file name for the item
+
+  Tag "datum" can have child subtags "description" and "options".
+
+  - Tag "description" (key DESCR) contains two sub tags:
+    -# "short description" (key SHORT_D) specifies a brief datum description text
+    -# "long description" (key LONG_D) specifies a detailed description text
+
+  - Tag "options" (key OPTIONS) contains one or more sub tags "option" (key OPTION).
+  Each of these XML elements should contain text option value and attribute
+  "name" (key OPTION_NAME) which specifies option name.
+
+  Each tag "datum" defines most common parameters of phisical characteristic.
+  These parameters are placed in two groups:
+  -# Domain parameters under the tag "domain" (key DY_DOMAIN). This tag can 
+  contain value description tag (key VALUE_DESCR) for descrete data which is
+  described by following parameters:
+    - default value (key VD_DEFV)
+    - maximum value (key VD_MAXV)
+    - minimum value (key VD_MINV)
+    - type of value (key VD_TYPE), possible values are String, Integer, Float, List
+  -# list reference tag (key VALUE_LIST_REF) for enumerable data described by
+  "list reference" attribute (key VLR_LIST) which references to the list
+  (see "list definition" tag) by list id.
+
+  Below is an example of the XML file using default keywords.
+
+  \verbatim
   <datadictionary version="1.0">
     <component name="My Component">
 
@@ -225,12 +247,14 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_Dictionary, MMgt_TShared)
 
     </component>
   </datadictionary>
-
-
+  \endverbatim
 */
 
 /*!
-  Constructor. Creates the instance of dictionary. Private method. Use DDS_Dictionary::Get() instead.
+  \brief Constructor.
+
+  Create an instance of the dictionary. Can not be used directly.
+  Use Get() method instead.
 */
 DDS_Dictionary::DDS_Dictionary()
 : MMgt_TShared()
@@ -238,22 +262,22 @@ DDS_Dictionary::DDS_Dictionary()
 }
 
 /*!
-  Copy constructor. Internal.
+  \brief Copy constructor (put in private section to prevent object copying).
 */
 DDS_Dictionary::DDS_Dictionary( const DDS_Dictionary& )
 {
 }
 
 /*!
-  Assigment operator. Internal.
+  \brief Assignment operator (put in private section to prevent object copying).
 */
 void DDS_Dictionary::operator=( const DDS_Dictionary& )
 {
 }
 
 /*!
-  Returns the names list of defined unit systems from all components.
-  Parameter \atheSystems will contains the sequence of string names.
+  \brief Get the names of defined units systems from all components.
+  \param theSystems returning sequence of units systems names.
 */
 void DDS_Dictionary::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystems ) const
 {
@@ -277,9 +301,13 @@ void DDS_Dictionary::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystems )
 }
 
 /*!
-  Returns the names list of defined unit systems from the specified component \atheComponent.
-  Parameter \atheSystems will contains the sequence of string names. If component not found then
-  empty list returned.
+  \brief Get the names of defined units systems from the specified component
+         \a theComponent.
+
+  If component is not found, empty list is returned.
+
+  \param theSystems returning sequence of units systems names.
+  \param theComponent component name
 */
 void DDS_Dictionary::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystems,
                                      const TCollection_AsciiString& theComponent ) const
@@ -290,8 +318,13 @@ void DDS_Dictionary::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystems,
 }
 
 /*!
-  Returns the label of unit system \atheSystem. Function find the given unit system in
-  all components. If unit system not found in any component then empty string returned.
+  \brief Get the label of the units system \a theSystem.
+
+  Searches the given units system in all components. If units system is not found
+  in any component, empty string is returned.
+
+  \param theSystem units system
+  \return units system label
 */
 TCollection_ExtendedString DDS_Dictionary::GetUnitSystemLabel( const TCollection_AsciiString& theSystem ) const
 {
@@ -302,9 +335,15 @@ TCollection_ExtendedString DDS_Dictionary::GetUnitSystemLabel( const TCollection
 }
 
 /*!
-  Returns the label of unit system \atheSystem from component \atheComponent. Function find
-  the given unit system in the specified component only. If unit system not found in the
-  component then empty string returned.
+  \brief Get the label of the units system \a theSystem from the
+         component \a theComponent.
+
+  Searches the specified units system in the specified component only.
+  If units system is not found, empty string is returned.
+
+  \param theSystem units system
+  \param theComponent component name
+  \return units system label
 */
 TCollection_ExtendedString DDS_Dictionary::GetUnitSystemLabel( const TCollection_AsciiString& theSystem,
                                                                const TCollection_AsciiString& theComponent ) const
@@ -316,8 +355,12 @@ TCollection_ExtendedString DDS_Dictionary::GetUnitSystemLabel( const TCollection
 }
 
 /*!
-  Gets the name of active unit system from first got component. If any component exist then
-  active unit system name returned or empty string otherwise.
+  \brief Get the name of active units system from the first found component. 
+  
+  If at least one component exists, then its active units system name 
+  is returned. Otherwise, empty string is returned.
+
+  \return active units system name
 */
 TCollection_AsciiString DDS_Dictionary::GetActiveUnitSystem() const
 {
@@ -328,8 +371,13 @@ TCollection_AsciiString DDS_Dictionary::GetActiveUnitSystem() const
 }
 
 /*!
-  Gets the name of active unit system from component \atheComponent. If this component exist
-  active unit system name returned or empty string otherwise.
+  \brief Get the name of active units system from the component \a theComponent.
+
+  If this component exists, its active units system name is returned.
+  Otherwise, empty string is returned.
+
+  \param theComponent component name
+  \return active units system name
 */
 TCollection_AsciiString DDS_Dictionary::GetActiveUnitSystem( const TCollection_AsciiString& theComponent ) const
 {
@@ -340,8 +388,12 @@ TCollection_AsciiString DDS_Dictionary::GetActiveUnitSystem( const TCollection_A
 }
 
 /*!
-  Sets the active unit system named \atheSystem. This unit system will be activated in all
-  existing components if component have it.
+  \brief Set the active units system. 
+
+  This units system will be activated in each existing component, 
+  if it component has this units system.
+
+  \param theSystem units system to be made active
 */
 void DDS_Dictionary::SetActiveUnitSystem( const TCollection_AsciiString& theSystem )
 {
@@ -350,8 +402,12 @@ void DDS_Dictionary::SetActiveUnitSystem( const TCollection_AsciiString& theSyst
 }
 
 /*!
-  Sets the active unit system named \atheSystem for component \atheComponent. If specified unit
-  system doesn't exist in the component then function do nothing.
+  \brief Set the active units system for the component \a theComponent. 
+
+  If specified units system doesn't exist in the component, nothing happens.
+
+  \param theSystem units system to be made active
+  \param theComponent component name
 */
 void DDS_Dictionary::SetActiveUnitSystem( const TCollection_AsciiString& theSystem,
                                           const TCollection_AsciiString& theComponent )
@@ -361,9 +417,10 @@ void DDS_Dictionary::SetActiveUnitSystem( const TCollection_AsciiString& theSyst
 }
 
 /*!
-  Returns the instance of dictionary. Create instance if it is NULL.
+  \brief Get the only instance of the data dictionary.
+  \return the only instance of the data dictionary
 */
-Handle(DDS_Dictionary) DDS_Dictionary::Get()
+Handle_DDS_Dictionary DDS_Dictionary::Get()
 {
   static Handle(DDS_Dictionary) sDictionary;
 
@@ -374,8 +431,10 @@ Handle(DDS_Dictionary) DDS_Dictionary::Get()
 }
 
 /*!
-  Load datum definitions in the dictionary from XML file \atheFileName. Returns true if load
-  successed or false otherwise.
+  \brief Load datum definitions in the dictionary from the XML file
+  \a theFileName.
+  \param theFileName XML file name
+  \return \c true if loading is succeded or \c false otherwise.
 */
 Standard_Boolean DDS_Dictionary::Load( const TCollection_AsciiString theFileName )
 {
@@ -404,8 +463,13 @@ Standard_Boolean DDS_Dictionary::Load( const TCollection_AsciiString theFileName
 }
 
 /*!
-  Gets XML keyword as LDOMString by specified \akey. If key doesn't exist then empty string
-  returned. This function provided for convenience.
+  \brief Get XML keyword as LDOMString by specified \a key.
+
+  If key doesn't exist, empty string is returned. 
+  This function is provided for convenience.
+  
+  \param key keyword name
+  \return keyword value
 */
 LDOMString DDS_Dictionary::KeyWord( const TCollection_AsciiString& key )
 {
@@ -421,10 +485,15 @@ LDOMString DDS_Dictionary::KeyWord( const TCollection_AsciiString& key )
 }
 
 /*!
-  Gets dictionary item with specified identifier \atheID from specified component \atheComponent.
-  If component or item not found then null handle returned.
+  \brief Get the data dictionary item by specified identifier \a theID
+  from the component \a theComponent.
+  
+  If the component or item is not found, null handle is returned.
+  \param theID data dictionary item ID
+  \param theComponent component name
+  \return handle to the data dictionary item
 */
-Handle(DDS_DicItem) DDS_Dictionary::GetDicItem( const TCollection_AsciiString& theID,
+Handle_DDS_DicItem DDS_Dictionary::GetDicItem( const TCollection_AsciiString& theID,
                                                 const TCollection_AsciiString& theComponent ) const
 {
   Handle(DDS_DicItem) aDicItem;
@@ -437,10 +506,15 @@ Handle(DDS_DicItem) DDS_Dictionary::GetDicItem( const TCollection_AsciiString& t
 }
 
 /*!
-  Gets dictionary item with specified identifier \atheID. Function find the item in all components.
-  If item not found in any component then null handle returned.
+  \brief Get the data dictionary item by specified identifier \a theID.
+
+  Function searches the item in all components. If item is not found
+  in all components, null handle is returned.
+
+  \param theID data dictionary item ID
+  \return handle to the data dictionary item
 */
-Handle(DDS_DicItem) DDS_Dictionary::GetDicItem( const TCollection_AsciiString& theID ) const
+Handle_DDS_DicItem DDS_Dictionary::GetDicItem( const TCollection_AsciiString& theID ) const
 {
   Handle(DDS_DicItem) aDicItem;
   for ( Standard_Integer i = 1; i <= myGroupMap.Extent() && aDicItem.IsNull(); i++ )
@@ -449,7 +523,9 @@ Handle(DDS_DicItem) DDS_Dictionary::GetDicItem( const TCollection_AsciiString& t
 }
 
 /*!
-  Fill the internal data structures from XML parsed structures. Internal.
+  \brief Fill the internal data structures from the XML node.
+  \param theComponentData component XML node
+  \param theDocElement document XML node
 */
 void DDS_Dictionary::FillDataMap( const LDOM_Element& theComponentData, const LDOM_Element& theDocElement )
 {
@@ -462,8 +538,11 @@ void DDS_Dictionary::FillDataMap( const LDOM_Element& theComponentData, const LD
 }
 
 /*!
-  Convert numeric value \atheValue from specified unit of measure \atheUnits to SI unit of measure
-  (mm for Length, radians for Angles, etc). Converted value returned.
+  \brief Convert numeric value \a theValue from specified measure units
+  \a theUnits to "SI" measure units (mm for Length, radians for Angles, etc).
+  \param theValue value being converted
+  \param theUnits measure units
+  \return converted value
 */
 Standard_Real DDS_Dictionary::ToSI( const Standard_Real theValue, const Standard_CString theUnits )
 {
@@ -486,8 +565,11 @@ Standard_Real DDS_Dictionary::ToSI( const Standard_Real theValue, const Standard
 }
 
 /*!
-  Convert numeric value \atheValue to specified unit of measure \atheUnits from SI unit of measure
-  (mm for Length, radians for Angles, etc). Converted value returned.
+  \brief Convert numeric value \a theValue to specified measure units
+  \a theUnits from "SI" measure units (mm for Length, radians for Angles, etc).
+  \param theValue value being converted
+  \param theUnits measure units
+  \return converted value
 */
 Standard_Real DDS_Dictionary::FromSI( const Standard_Real theValue, const Standard_CString theUnits )
 {
@@ -508,3 +590,18 @@ Standard_Real DDS_Dictionary::FromSI( const Standard_Real theValue, const Standa
 
   return aRetValue;
 }
+
+/*!
+  \brief Fill given string container \a seq with keys belonging to group with name \a theComponent
+  \param theComponent name of group whose keys should be stored in the container
+  \param seq returned string container with keys belonging to group; it is not cleared before filling
+*/
+void DDS_Dictionary::GetKeys( const TCollection_AsciiString& theComponent, TColStd_SequenceOfAsciiString& seq ) const
+{
+  Handle( DDS_DicGroup ) aDicGroup;
+  if( myGroupMap.Contains( theComponent ) )
+    aDicGroup = myGroupMap.FindFromKey( theComponent );
+
+  if( !aDicGroup.IsNull() )
+    aDicGroup->GetKeys( seq );
+}
index 9a5d5a886620a378ac109de2ecb56f415ea4c658..5ecf488da89092988ca20eec52c8b901892199db 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef DDS_DICTIONARY_H
 #define DDS_DICTIONARY_H
@@ -37,6 +40,8 @@ public:
 
   // Return instance of data dictionary. Create instance if it is NULL.
 
+  Standard_EXPORT void                           GetKeys( const TCollection_AsciiString&, TColStd_SequenceOfAsciiString& ) const;
+
   Standard_EXPORT Handle(DDS_DicItem)            GetDicItem( const TCollection_AsciiString& ) const;
   Standard_EXPORT Handle(DDS_DicItem)            GetDicItem( const TCollection_AsciiString&,
                                                              const TCollection_AsciiString& ) const;
index 626bd0fd03e82a14a6defaea4b427617a8b68df5..6eb6215640caa331c6086ae272b497de15330cab 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "DDS_KeyWords.h"
 
@@ -23,60 +26,66 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_KeyWords, MMgt_TShared)
 
 /*!
   \class DDS_KeyWords
+  \brief This class defines the pairs of internal keys and XML tags or 
+  attributes names. 
 
-  This object contains the pairs of internal keys and XML tag or attribute names. This class allow to user
-  define set of XML keywords used in datums definition file.
+  This class allows user to define a set of XML keywords used in the datums
+  definition (XML) file.
 
   Default keywords table:
-  \li D_URI - dictionary
-  \li COMPONENT - component
-  \li COMPONENT_NAME - name
-  \li UNIT_SYSTEMS - unitSystems
-  \li UNIT_SYSTEM - system
-  \li UNIT_SYSTEM_NAME - name
-  \li UNIT_SYSTEM_LABEL - label
-  \li DATUM - datum
-  \li DATUM_ID - id
-  \li DATUM_LABEL - label
-  \li DATUM_UNITS - units
-  \li DATUM_FORMAT - format
-  \li DATUM_FILTER - filter
-  \li DATUM_REQUIRED - required
-  \li VALUE_LIST - valueList
-  \li VALUE_LIST_ID - listid
-  \li VALUE_LIST_NAME - name
-  \li VALUE_LIST_TYPE - type
-  \li VALUE_LIST_VALUE - value
-  \li VALUE_LIST_VALUEID - id
-  \li VALUE_LIST_VALUEICON - icon
-  \li DY_DOMAIN - domain
-  \li WARNING_LEVEL - warningLevel
-  \li WRONG_VALUE - wrongValue
-  \li VALUE_DESCR - valueDescr
-  \li VALUE_LIST_REF - listRef
-  \li DESCR - description
-  \li LONG_D - longDescr
-  \li SHORT_D - shortDescr
-  \li VD_TYPE - type
-  \li VD_DEFV - default
-  \li VD_MAXV - max
-  \li VD_MINV - min
-  \li VD_SPEC - specVal
-  \li VLR_LIST - list
-  \li PRS - presentation
-  \li LATERAL_ZOOM - lateralZoom
-  \li LZ_MINV - min
-  \li LZ_MAXV - max
-  \li LZ_ORDER - order
-  \li OPTIONS - options
-  \li OPTION - option
-  \li OPTION_NAME - name
+  - \c D_URI - dictionary
+  - \c COMPONENT - component
+  - \c COMPONENT_NAME - name
+  - \c UNIT_SYSTEMS - unitSystems
+  - \c UNIT_SYSTEM - system
+  - \c UNIT_SYSTEM_NAME - name
+  - \c UNIT_SYSTEM_LABEL - label
+  - \c DATUM - datum
+  - \c DATUM_ID - id
+  - \c DATUM_LABEL - label
+  - \c DATUM_UNITS - units
+  - \c DATUM_FORMAT - format
+  - \c DATUM_FILTER - filter
+  - \c DATUM_REQUIRED - required
+  - \c VALUE_LIST - valueList
+  - \c VALUE_LIST_ID - listid
+  - \c VALUE_LIST_NAME - name
+  - \c VALUE_LIST_TYPE - type
+  - \c VALUE_LIST_VALUE - value
+  - \c VALUE_LIST_VALUEID - id
+  - \c VALUE_LIST_VALUEICON - icon
+  - \c DY_DOMAIN - domain
+  - \c WARNING_LEVEL - warningLevel
+  - \c WRONG_VALUE - wrongValue
+  - \c VALUE_DESCR - valueDescr
+  - \c VALUE_LIST_REF - listRef
+  - \c DESCR - description
+  - \c LONG_D - longDescr
+  - \c SHORT_D - shortDescr
+  - \c VD_TYPE - type
+  - \c VD_DEFV - default
+  - \c VD_MAXV - max
+  - \c VD_MINV - min
+  - \c VD_SPEC - specVal
+  - \c VLR_LIST - list
+  - \c PRS - presentation
+  - \c LATERAL_ZOOM - lateralZoom
+  - \c LZ_MINV - min
+  - \c LZ_MAXV - max
+  - \c LZ_ORDER - order
+  - \c OPTIONS - options
+  - \c OPTION - option
+  - \c OPTION_NAME - name
+
+  There is the only instance of the class DDS_KeyWords in the application
+  which can be retrieved by method Get().
 */
 
 /*!
-  Constructor
+  \brief Constructor. 
+  Create an instance of the object. Can not be used directly.
+  Use Get() method instead.
 */
-
 DDS_KeyWords::DDS_KeyWords()
 : MMgt_TShared()
 {
@@ -134,10 +143,10 @@ DDS_KeyWords::DDS_KeyWords()
 }
 
 /*!
-  Returns the static instance of the class DDS_KeyWords
+  \brief Get the only instance of the class DDS_KeyWords.
+  \return the only instance of the class
 */
-
-Handle(DDS_KeyWords) DDS_KeyWords::Get()
+Handle_DDS_KeyWords DDS_KeyWords::Get()
 {
   static Handle(DDS_KeyWords) keyWords;
 
@@ -148,10 +157,12 @@ Handle(DDS_KeyWords) DDS_KeyWords::Get()
 }
 
 /*!
-  Returns the XML keyword by specified internal key \a key. If the internal key isn't registered
-  then empty string will be returned.
-*/
+  \brief Get the XML keyword by specified internal key \a key.
 
+  If the internal key is not registered, empty string is returned.
+  \param key internal key
+  \return XML keyword 
+*/
 TCollection_AsciiString DDS_KeyWords::GetKeyWord( const TCollection_AsciiString& key ) const
 {
   TCollection_AsciiString keyWord;
@@ -161,9 +172,10 @@ TCollection_AsciiString DDS_KeyWords::GetKeyWord( const TCollection_AsciiString&
 }
 
 /*!
-  Register the pair of the internal key \a key and XML keyword \a keyWord.
+  \brief Register the pair of the internal key \a key and XML keyword \a keyWord.
+  \param key internal key
+  \param keyWord XML keyword
 */
-
 void DDS_KeyWords::SetKeyWord( const TCollection_AsciiString& key,
                                const TCollection_AsciiString& keyWord )
 {
index 2161f71f3338eba070d98979e6ddb7533408b7d2..4d249b5f3dd7df8ecb9fbdca8a96474858b2c5da 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef DDS_KEYWORDS_H
 #define DDS_KEYWORDS_H
index 508e544e9353d5acd67e5ba384ccb9f8d09b3aef..dd8553b1488203f5c1611b27a32c1bb3928b2ccb 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Alexander SOLOVYOV (OCN)
 #  Module : DDS
 #  $Header: /home/server/cvs/GUI/GUI_SRC/src/DDS/Makefile.in
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libDDS.la
 
-salomeinclude_HEADERS = DDS.h \
-       DDS_DicGroup.h \
-       DDS_DicItem.h \
-       DDS_Dictionary.h \
+salomeinclude_HEADERS =        \
+       DDS.h                   \
+       DDS_DicGroup.h          \
+       DDS_DicItem.h           \
+       DDS_Dictionary.h        \
        DDS_KeyWords.h
 
-dist_libDDS_la_SOURCES = DDS_DicGroup.cxx \
-       DDS_DicItem.cxx \
-       DDS_Dictionary.cxx \
+dist_libDDS_la_SOURCES =       \
+       DDS_DicGroup.cxx        \
+       DDS_DicItem.cxx         \
+       DDS_Dictionary.cxx      \
        DDS_KeyWords.cxx
 
-libDDS_la_CPPFLAGS=$(CAS_CPPFLAGS)
+libDDS_la_CPPFLAGS = $(CAS_CPPFLAGS)
 
-libDDS_la_LDFLAGS= $(CAS_KERNEL) $(CAS_OCAF)
+libDDS_la_LDFLAGS  = $(CAS_KERNEL) $(CAS_OCAF)
 
 
 
index 8df1a71b19fffa1ebb06fbe2324cfe4e967e73e5..d9052d07e3c070957f1b6b4a1506650cfebbe8ab 100755 (executable)
@@ -1,50 +1,39 @@
-//  Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// File:      SalomeApp.h
-// Created:   November, 2004
-// Author:    OCC team
-// Copyright (C) CEA 2004
-
-
-// The following ifdef block is the standard way of creating macros which make exporting 
-// from a DLL simpler. All files within this DLL are compiled with the SalomeApp_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see 
-// SalomeApp_API functions as being imported from a DLL, wheras this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef WNT
-
-#ifdef EVENT_EXPORTS
-#define EVENT_EXPORT __declspec(dllexport)
-#else
-#define EVENT_EXPORT __declspec(dllimport)
-#endif
-
-#else
-#define EVENT_EXPORT
-#endif               //WNT
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#if !defined ( EVENT_H )
+#define EVENT_H
 
-#define APP_VERSION "0.1"
+#ifdef WIN32
+#  ifdef EVENT_EXPORTS
+#    define EVENT_EXPORT __declspec(dllexport)
+#  else
+#    define EVENT_EXPORT __declspec(dllimport)
+#  endif
+#else               //WIN32
+#  define EVENT_EXPORT
+#endif              //WIN32
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
 
+#endif // EVENT_H
diff --git a/src/Event/Event.pro b/src/Event/Event.pro
new file mode 100644 (file)
index 0000000..3b3457b
--- /dev/null
@@ -0,0 +1,47 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = Event
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+INCLUDEPATH += ../../include
+LIBS += 
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += EVENT_EXPORTS
+
+HEADERS  = Event.h
+HEADERS += SALOME_Event.h 
+HEADERS += SALOME_EventFilter.h
+
+SOURCES  = SALOME_Event.cxx 
+SOURCES += SALOME_EventFilter.cxx
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+INSTALLS += includes
index c9948969b401953ba39ba0d093902f2cd16b05cb..49ecd27fae4f88c083f53c5039cb06aca8d9cdea 100755 (executable)
@@ -1,42 +1,44 @@
-#  SALOME Utils : general SALOME's definitions and tools
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOME Utils : general SALOME's definitions and tools
 #  File   : Makefile.in
 #  Author : Marc Tajchman (CEA)
 #  Module : SALOME
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libEvent.la 
 
-salomeinclude_HEADERS= \
-       Event.h \
-       SALOME_Event.hxx 
+salomeinclude_HEADERS =        \
+       Event.h         \
+       SALOME_Event.h  \
+       SALOME_EventFilter.h
 
-dist_libEvent_la_SOURCES = SALOME_Event.cxx 
+dist_libEvent_la_SOURCES = \
+       SALOME_Event.cxx   \
+       SALOME_EventFilter.cxx
 
-libEvent_la_CPPFLAGS=$(QT_INCLUDES) @KERNEL_CXXFLAGS@
-libEvent_la_LDFLAGS=$(QT_MT_LIBS)
+libEvent_la_CPPFLAGS = $(QT_INCLUDES)
+libEvent_la_LDFLAGS  = $(QT_MT_LIBS)
 
 
index 928cd2341c2f5954a344002f85e7e53b3cfac726..60a5dc254ee790643fc37421f624733cfc5abc05 100755 (executable)
-//  KERNEL SALOME_Event : Define event posting mechanism
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  KERNEL SALOME_Event : Define event posting mechanism
 //  File   : SALOME_Event.cxx
 //  Author : Sergey ANIKIN
-//  Module : KERNEL
-//  $Header$
-
-#include "SALOME_Event.hxx"
-
-//#include "utilities.h"
+//
+#include "SALOME_Event.h"
 
-#include <qsemaphore.h>
-#include <qapplication.h>
-#include <qthread.h>
+#include <QSemaphore>
+#include <QApplication>
 
 // asv 21.02.05 : introducing multi-platform approach of thread comparison
-// on Unix using pthread_t type for storing ThreadId
-// on Win32 using integer type for storing ThreadId
+// on Unix using pthread_t type for storing ThreadId
+// on Win32 using integer type for storing ThreadId
 // NOT using integer ThreadId on both Unix and Win32 because (from documentation):
 // "...Do not allow your program to rely on the internal structure or size of the pthread_t..."
 
 #ifdef WIN32
 #include <windows.h>
-
 static DWORD myThread;
 #else
-#include <qthread.h>
 #include <pthread.h>
-
 static pthread_t myThread;
 #endif
 
 /*!
-  \return thread id
+  \class InitEvent
+  \brief Helper event class responsible for initializing SALOME_Event
+  mechanism by the main thread ID
+ */
+class InitEvent : public SALOME_Event
+{
+public:
+  InitEvent();
+  virtual      ~InitEvent();
+  virtual void Execute();
+};
+
+/*!
+  \brief Constructor, initializes the event mechanism by the current thread ID.
+  It is asssumed to be the main thread ID, so be careful!
+*/
+InitEvent::InitEvent()
+{
+  GetSessionThread();
+}
+
+/*!
+  \brief Destructor, does nothing.
+*/
+InitEvent::~InitEvent()
+{
+}
+
+/*!
+  \brief Nothing to be executed for this kind of event.
+*/
+void InitEvent::Execute()
+{
+}
+
+// NOTE: Here the SALOME event mechanism is initalized by the 
+// current thread ID that is always assumed to be the main thread ID.
+// This should be revised as soon as the application library is no longer
+// linked against the Event library (i.e. this static object is not created or created 
+// outside the main thread).
+static InitEvent myInitEvent;
+
+/*!
+  \class SALOME_CustomEvent
+  \brief Generic event class for user-defined events
+  
+  This class contains a generic void* data member that may be used
+  for transferring event-specific data to the receiver.
+
+  \warning The internal data is not destroyed by the class destructor.
+*/
+
+/*!
+  \brief Constructor.
+  \param type event type
+*/
+SALOME_CustomEvent::SALOME_CustomEvent( int type )
+: QEvent( (QEvent::Type)type ), d( 0 )
+{
+}
+
+/*!
+  \brief Constructor.
+  \param type event type
+  \param data custom data
+*/
+SALOME_CustomEvent::SALOME_CustomEvent( QEvent::Type type, void* data )
+: QEvent( type ), d( data )
+{
+}
+
+/*!
+  \brief Get custom data.
+  \return pointer to the internal data
+*/
+void* SALOME_CustomEvent::data() const
+{
+  return d;
+}
+
+/*!
+  \brief Set custom data.
+  \param data pointer to the internal data
+*/
+void SALOME_CustomEvent::setData( void* data )
+{
+  d = data;
+}
+
+/*!
+  \class SALOME_Event
+  \brief The class which encapsulates data and functionality required for 
+         posting component-specific events to perform arbitrary operations 
+        in the main GUI thread. 
+
+  SALOME_Event objects can be posted by any thread belonging to the GUI process.
+  
+  It is necessary to derive a custom event class from SALOME_Event and 
+  re-implement virtual Execute() method. This method should actually perform 
+  the desirable operation. To pass all the required data to Execute() and 
+  store a return value, arbitrary data fields can be added to the custom 
+  event class. There is no need to protect such fields with a mutex, for only
+  one thread working with a SALOME_Event object is active at any moment.
+  
+  Usage:
+  - Create SALOME_Event. Components can derive their own event class from 
+  SALOME_Event in order to pass custom data to the event handler.
+  - Call process() method to post the event. After process() execution
+  it is possible to examine fields of your custom event object.
+  - Perform delete operator on the event to wake up the desktop (you can also 
+  set <autoRelease>  parameter to \c true to automatically wake up desktop after 
+  process().
+  
+  The method processed() is used by the desktop to signal that event processing 
+  has been completed.
+
+  To make all this work, it is necessary to call static method GetSessionThread()
+  during the application initialization, i.e. from main() function.
+  It is important to call this method from the primary application thread.
+
+  Caveats: 
+  - there are no.
+*/
+
+//! Total number of semaphore resources
+const int NumberOfResources = 2;
+
+/*!
+  \brief Initialize event mechanism.
+
+  This function sets up the main application thread. It should be called
+  during the application initialization, i.e. main() function.
 */
 void SALOME_Event::GetSessionThread(){
 #ifdef WIN32
@@ -63,7 +185,8 @@ void SALOME_Event::GetSessionThread(){
 }
 
 /*!
-  \return true if it is session thread
+  \brief Check if the processing is in the main application thread.
+  \return \c true if this method is called from the main application thread
 */
 bool SALOME_Event::IsSessionThread(){
   bool aResult = false;
@@ -72,48 +195,117 @@ bool SALOME_Event::IsSessionThread(){
 #else
   aResult = myThread == pthread_self();
 #endif
-//  if(MYDEBUG) INFOS("IsSessionThread() - "<<aResult);
   return aResult;
 }
 
-
 /*!
-  Constructor
+  \brief Constructor.
 */
 SALOME_Event::SALOME_Event(){
-//  if(MYDEBUG) MESSAGE( "SALOME_Event::SALOME_Event(): this = "<<this );
   // Prepare the semaphore 
-  mySemaphore = new QSemaphore( 2 );
-  *mySemaphore += 2;
+  mySemaphore = new QSemaphore( NumberOfResources );
+  mySemaphore->acquire( NumberOfResources );
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 SALOME_Event::~SALOME_Event(){
-//  if(MYDEBUG) MESSAGE( "SALOME_Event::~SALOME_Event(): this = "<<this );
-  if ( mySemaphore->available() < mySemaphore->total() )
-    *mySemaphore -= mySemaphore->total() - mySemaphore->available();
+  if ( mySemaphore->available() < NumberOfResources )
+    mySemaphore->release( NumberOfResources - mySemaphore->available() );
   delete mySemaphore;
 }
 
 /*!
-  Posts the event and optionally waits for its completion
+  \brief This method should be called by the main GUI thread
+  in order to execute the code specific for this event and finally
+  to inform the calling thread that the event 
+  has been processed waking it up with help of the semaphore .
+ */
+void SALOME_Event::ExecutePostedEvent()
+{
+  // Diagnose incorrect usage of SALOME_Event API
+  if ( !IsSessionThread() ){
+    qWarning( "SALOME_Event::ExecutePostedEvent() is called from a secondary thread that might mean an error in application logic!" );
+  }
+  // Actual execution specific for particular kind of event
+  Execute();
+  // Signal the calling thread that the event has been processed
+  processed();
+}
+
+/*!
+  \brief Post the event and wait for its completion.
+  process() should be called from a secondary thread only. 
+  \sa processed()
 */
 void SALOME_Event::process()
 {
-  QThread::postEvent( qApp, new QCustomEvent( SALOME_EVENT, (void*)this ) );
-//  if(MYDEBUG) MESSAGE( "SALOME_Event::process(): this = "<<this<<", *mySemaphore += 1 " );
-  *mySemaphore += 1;
-//  if(MYDEBUG) MESSAGE( "SALOME_Event::process(): this = "<<this<<" - COMPLETED" );
+  // Diagnose incorrect usage of SALOME_Event API
+  if ( IsSessionThread() ){
+    qWarning( "SALOME_Event::process() is called from the main GUI thread that might mean an error in application logic!" );
+  }
+
+  QApplication::postEvent( qApp, new SALOME_CustomEvent( SALOME_EVENT, (void*)this ) );
+  mySemaphore->acquire( 1 );
 }
 
 /*!
-  Signals that this event has been processed
+  \brief Use this method to signal that this event has been processed.
 */
 void SALOME_Event::processed()
 {
-//  if(MYDEBUG) MESSAGE( "SALOME_Event::processed(): this = "<<this );
-  // process() takes control over mySemaphore after the next line is executed
-  *mySemaphore -= 1;
+  mySemaphore->release( 1 );
 }
+
+/*!
+  \fn virtual void SALOME_Event::Execute();
+  \brief This method should be redefined in the successor classes
+         to do real work.
+*/
+  
+/*!
+  \class TMemFunEvent
+  \brief Template class for event which calls the function
+  without arguments and returning result.
+*/
+
+/*!
+  \class TVoidMemFunEvent
+  \brief Template class for event which calls the function
+  without arguments and without return value.
+*/
+
+/*!
+  \class TMemFun1ArgEvent
+  \brief Template class for event which calls the function
+  with one argument and returning result.
+*/
+
+/*!
+  \class TVoidMemFun1ArgEvent
+  \brief Template class for event which calls the function
+  with one argument and without return value.
+*/
+
+/*!
+  \class TMemFun2ArgEvent
+  \brief Template class for event which calls the function
+  with two arguments and returning result.
+*/
+
+/*!
+  \class TVoidMemFun2ArgEvent
+  \brief Template class for event which calls the function
+  with two arguments and without return value.
+*/
+
+/*!
+  \fn ProcessEvent
+  \brief Template function for processing events with return value.
+*/
+
+/*!
+  \fn ProcessVoidEvent
+  \brief Template function for processing events without return value.
+*/
diff --git a/src/Event/SALOME_Event.h b/src/Event/SALOME_Event.h
new file mode 100644 (file)
index 0000000..8493680
--- /dev/null
@@ -0,0 +1,228 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  KERNEL SALOME_Event : Define event posting mechanism
+//  File   : SALOME_Event.h
+//  Author : Sergey ANIKIN
+//
+#ifndef SALOME_EVENT_H
+#define SALOME_EVENT_H
+
+#include "Event.h"
+
+#include <QEvent>
+
+//! SALOME custom event type
+#define SALOME_EVENT QEvent::Type( QEvent::User + 10000 )
+
+class EVENT_EXPORT SALOME_CustomEvent : public QEvent
+{
+public:
+  SALOME_CustomEvent( int type );
+  SALOME_CustomEvent( QEvent::Type type, void* data );
+
+  void* data() const;
+  void  setData( void* data );
+
+private:
+  void *d;   //!< internal data
+};
+
+class QSemaphore;
+
+class EVENT_EXPORT SALOME_Event
+{
+public:
+  SALOME_Event();
+  virtual ~SALOME_Event();
+
+  void            ExecutePostedEvent();
+  virtual void    Execute() = 0;
+
+  static bool     IsSessionThread();
+  void            process();
+
+protected:
+  void            processed();
+  static void     GetSessionThread();
+
+private:
+  QSemaphore*     mySemaphore;     //!< internal semaphore
+};
+
+template<class TObject, typename TRes> class TMemFunEvent : public SALOME_Event
+{
+public:
+  typedef TRes TResult;
+  TResult myResult;
+  typedef TResult (TObject::* TAction)();
+  TMemFunEvent(TObject* theObject, TAction theAction, 
+              TResult theResult = TResult()):
+    myObject(theObject),
+    myAction(theAction),
+    myResult(theResult)
+  {}
+  virtual void Execute()
+  {
+    myResult = (myObject->*myAction)();
+  }
+private:
+  TObject* myObject;
+  TAction  myAction;
+};
+
+template<class TObject> class TVoidMemFunEvent : public SALOME_Event
+{
+public:
+  typedef void (TObject::* TAction)();
+  TVoidMemFunEvent(TObject* theObject, TAction theAction):
+    myObject(theObject),
+    myAction(theAction)
+  {}
+  virtual void Execute()
+  {
+    (myObject->*myAction)();
+  }
+private:
+  TObject* myObject;
+  TAction myAction;
+};
+
+template<class TObject, typename TRes, typename TArg, typename TStoreArg = TArg> 
+class TMemFun1ArgEvent : public SALOME_Event
+{
+public:
+  typedef TRes TResult;
+  TResult myResult;
+  typedef TResult (TObject::* TAction)(TArg);
+  TMemFun1ArgEvent(TObject* theObject, TAction theAction, TArg theArg, 
+                  TResult theResult = TResult()):
+    myObject(theObject),
+    myAction(theAction),
+    myResult(theResult),
+    myArg(theArg)
+  {}
+  virtual void Execute()
+  {
+    myResult = (myObject->*myAction)(myArg);
+  }
+private:
+  TObject* myObject;
+  TAction myAction;
+  TStoreArg myArg;
+};
+
+template<class TObject, typename TArg, typename TStoreArg = TArg> 
+class TVoidMemFun1ArgEvent : public SALOME_Event
+{
+public:
+  typedef void (TObject::* TAction)(TArg);
+  TVoidMemFun1ArgEvent(TObject* theObject, TAction theAction, TArg theArg):
+    myObject(theObject),
+    myAction(theAction),
+    myArg(theArg)
+  {}
+  virtual void Execute()
+  {
+    (myObject->*myAction)(myArg);
+  }
+private:
+  TObject* myObject;
+  TAction myAction;
+  TStoreArg myArg;
+};
+
+template<class TObject, typename TRes, typename TArg, typename TArg1, typename TStoreArg = TArg, typename TStoreArg1 = TArg1>
+class TMemFun2ArgEvent: public SALOME_Event
+{
+public:
+  typedef TRes TResult;
+  TResult myResult;
+  typedef TResult (TObject::* TAction)(TArg,TArg1);
+  TMemFun2ArgEvent(TObject* theObject, TAction theAction, 
+                  TArg theArg, TArg1 theArg1,
+                  TResult theResult = TResult()):
+    myObject(theObject),
+    myAction(theAction),
+    myResult(theResult),
+    myArg(theArg),
+    myArg1(theArg1)
+  {}
+  virtual void Execute()
+  {
+    myResult = (myObject->*myAction)(myArg,myArg1);
+  }
+private:
+  TObject* myObject;
+  TAction myAction;
+  TStoreArg myArg;
+  TStoreArg1 myArg1;
+};
+
+template<class TObject, typename TArg, typename TArg1, typename TStoreArg = TArg, typename TStoreArg1 = TArg1>
+class TVoidMemFun2ArgEvent : public SALOME_Event
+{
+public:
+  typedef void (TObject::* TAction)(TArg,TArg1);
+  TVoidMemFun2ArgEvent(TObject* theObject, TAction theAction, TArg theArg, TArg1 theArg1):
+    myObject(theObject),
+    myAction(theAction),
+    myArg(theArg),
+    myArg1(theArg1)
+  {}
+  virtual void Execute()
+  {
+    (myObject->*myAction)(myArg,myArg1);
+  }
+private:
+  TObject* myObject;
+  TAction myAction;
+  TStoreArg myArg;
+  TStoreArg1 myArg1;
+};
+
+template<class TEvent> inline typename TEvent::TResult ProcessEvent(TEvent* theEvent)
+{
+  typename TEvent::TResult aResult;
+  if(SALOME_Event::IsSessionThread()) {
+    theEvent->Execute();
+    aResult = theEvent->myResult;
+  }
+  else {
+    theEvent->process();
+    aResult = theEvent->myResult;
+  }
+  delete theEvent;
+  return aResult;
+}
+
+inline void ProcessVoidEvent(SALOME_Event* theEvent)
+{
+  if(SALOME_Event::IsSessionThread()) {
+    theEvent->Execute();
+  }
+  else {
+    theEvent->process();
+  }
+  delete theEvent;
+}
+
+#endif // SALOME_EVENT_H
diff --git a/src/Event/SALOME_Event.hxx b/src/Event/SALOME_Event.hxx
deleted file mode 100755 (executable)
index 91f53d6..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-//  KERNEL SALOME_Event : Define event posting mechanism
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : SALOME_Event.hxx
-//  Author : Sergey ANIKIN
-//  Module : KERNEL
-//  $Header$
-
-
-#ifndef SALOME_Event_HeaderFile
-#define SALOME_Event_HeaderFile
-
-#include <qevent.h>
-
-#define SALOME_EVENT QEvent::Type( QEvent::User + 10000 )
-
-class QSemaphore;
-
-/*!
- *  \class SALOME_Event
- *  Description: 
- *  This class encapsulates data and functionality required for 
- *  posting component-specific events to perform arbitrary operations in main GUI thread. 
- *  SALOME_Event objects can be posted by any thread belonging to the GUI process.
- *
- *  It is necessary to derive a custom event class from SALOME_Event and 
- *  re-implement virtual Execute() method. This method should actually perform 
- *  the desirable operation. To pass all the required data to Execute() and store a return value,
- *  arbitrary data fields can be added to the custom event class. There is 
- *  no need to protect such fields with a mutex, for only one thread working with
- *  a SALOME_Event object is active at any moment.
- *
- *  Usage:
- *  - create SALOME_Event. 
- *    Components can derive their own event class from SALOME_Event
- *    in order to pass custom data to the event handler.
- *  - call process() method to post the event. After process() execution
- *    it is possible to examine fields of your custom event object.
- *  - perform delete operator on the event to wake up the desktop (you can also set <autoRelease>
- *    parameter to TRUE to automatically wake up desktop after process()
- * 
- *  processed() method is used by the desktop to signal that event processing 
- *  has been completed.
- *  
- *  Caveats: 
- *    There is no.
- */
-
-#include <Event.h>
-
-class EVENT_EXPORT SALOME_Event{
-public:
-  SALOME_Event();
-  virtual ~SALOME_Event();
-
-  // To do real work
-  virtual void Execute() = 0;
-
-  static bool IsSessionThread();
-  void process();
-
-protected:
-  void processed();
-  friend class SalomeApp_EventFilter;
-
-  static void GetSessionThread();
-  friend int main(int, char **);
-
-private:
-  QSemaphore* mySemaphore;
-};
-
-
-/*!
-  \class TMemFunEvent
-  \brief Template class for member function
-*/
-template<class TObject, typename TRes> class /*EVENT_EXPORT */TMemFunEvent: public SALOME_Event{
-public:
-  typedef TRes TResult;
-  TResult myResult;
-  typedef TResult (TObject::* TAction)();
-  TMemFunEvent(TObject* theObject, TAction theAction, 
-              TResult theResult = TResult()):
-    myObject(theObject),
-    myAction(theAction),
-    myResult(theResult)
-  {}
-  virtual void Execute(){
-    myResult = (myObject->*myAction)();
-  }
-private:
-  TObject* myObject;
-  TAction myAction;
-};
-
-
-/*!
-  \class TVoidMemFunEvent
-  \brief Template class for member function
-*/
-template<class TObject> class /*EVENT_EXPORT */TVoidMemFunEvent: public SALOME_Event{
-public:
-  typedef void (TObject::* TAction)();
-  TVoidMemFunEvent(TObject* theObject, TAction theAction):
-    myObject(theObject),
-    myAction(theAction)
-  {}
-  virtual void Execute(){
-    (myObject->*myAction)();
-  }
-private:
-  TObject* myObject;
-  TAction myAction;
-};
-
-
-/*!
-  \class TMemFun1ArgEvent
-  \brief Template for member function with one argument
-*/
-template<class TObject, typename TRes, typename TArg, typename TStoreArg = TArg> class/* EVENT_EXPORT */TMemFun1ArgEvent:
-public SALOME_Event{
-public:
-  typedef TRes TResult;
-  TResult myResult;
-  typedef TResult (TObject::* TAction)(TArg);
-  TMemFun1ArgEvent(TObject* theObject, TAction theAction, TArg theArg, 
-                  TResult theResult = TResult()):
-    myObject(theObject),
-    myAction(theAction),
-    myResult(theResult),
-    myArg(theArg)
-  {}
-  virtual void Execute(){
-    myResult = (myObject->*myAction)(myArg);
-  }
-private:
-  TObject* myObject;
-  TAction myAction;
-  TStoreArg myArg;
-};
-
-
-/*!
-  \class TVoidMemFun1ArgEvent
-  \brief Template for member function with one argument
-*/
-template<class TObject, typename TArg, typename TStoreArg = TArg> class /*EVENT_EXPORT */TVoidMemFun1ArgEvent: public SALOME_Event{
-public:
-  typedef void (TObject::* TAction)(TArg);
-  TVoidMemFun1ArgEvent(TObject* theObject, TAction theAction, TArg theArg):
-    myObject(theObject),
-    myAction(theAction),
-    myArg(theArg)
-  {}
-  virtual void Execute(){
-    (myObject->*myAction)(myArg);
-  }
-private:
-  TObject* myObject;
-  TAction myAction;
-  TStoreArg myArg;
-};
-
-
-/*!
-  \class TMemFun2ArgEvent
-  \brief Template for member function with two arguments
-*/
-template<class TObject, typename TRes, typename TArg, typename TArg1, typename TStoreArg = TArg, typename TStoreArg1 = TArg1> class
-/*EVENT_EXPORT */TMemFun2ArgEvent: public SALOME_Event{
-public:
-  typedef TRes TResult;
-  TResult myResult;
-  typedef TResult (TObject::* TAction)(TArg,TArg1);
-  TMemFun2ArgEvent(TObject* theObject, TAction theAction, 
-                  TArg theArg, TArg1 theArg1,
-                  TResult theResult = TResult()):
-    myObject(theObject),
-    myAction(theAction),
-    myResult(theResult),
-    myArg(theArg),
-    myArg1(theArg1)
-  {}
-  virtual void Execute(){
-    myResult = (myObject->*myAction)(myArg,myArg1);
-  }
-private:
-  TObject* myObject;
-  TAction myAction;
-  TStoreArg myArg;
-  TStoreArg1 myArg1;
-};
-
-
-/*!
-  \class TVoidMemFun2ArgEvent
-  \brief Template for member function with two arguments
-*/
-template<class TObject, typename TArg, typename TArg1, typename TStoreArg = TArg, typename TStoreArg1 = TArg1> class
-/*EVENT_EXPORT*/ TVoidMemFun2ArgEvent: public SALOME_Event{
-public:
-  typedef void (TObject::* TAction)(TArg,TArg1);
-  TVoidMemFun2ArgEvent(TObject* theObject, TAction theAction, TArg theArg, TArg1 theArg1):
-    myObject(theObject),
-    myAction(theAction),
-    myArg(theArg),
-    myArg1(theArg1)
-  {}
-  virtual void Execute(){
-    (myObject->*myAction)(myArg,myArg1);
-  }
-private:
-  TObject* myObject;
-  TAction myAction;
-  TStoreArg myArg;
-  TStoreArg1 myArg1;
-};
-
-
-/*!
-  \fn ProcessEvent
-  \brief Template function for processing events with result returing
-*/
-template<class TEvent> inline typename TEvent::TResult ProcessEvent(TEvent* theEvent){
-  typename TEvent::TResult aResult;
-  if(SALOME_Event::IsSessionThread()){
-    theEvent->Execute();
-    aResult = theEvent->myResult;
-  }else{
-    theEvent->process();
-    aResult = theEvent->myResult;
-  }
-  delete theEvent;
-  return aResult;
-}
-
-
-/*!
-  \fn ProcessEvent
-  \brief Template function for processing events without result
-*/
-inline void ProcessVoidEvent(SALOME_Event* theEvent){
-  if(SALOME_Event::IsSessionThread()){
-    theEvent->Execute();
-  }else{
-    theEvent->process();
-  }
-  delete theEvent;
-}
-
-
-#endif
diff --git a/src/Event/SALOME_EventFilter.cxx b/src/Event/SALOME_EventFilter.cxx
new file mode 100755 (executable)
index 0000000..074213c
--- /dev/null
@@ -0,0 +1,80 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "SALOME_EventFilter.h"
+#include "SALOME_Event.h"
+
+#include <QApplication>
+
+SALOME_EventFilter* SALOME_EventFilter::myFilter = NULL;
+
+/*!Constructor.*/
+SALOME_EventFilter::SALOME_EventFilter()
+: QObject()
+{
+  /* VSR 13/01/03 : installing global event filter for the application */
+  qApp->installEventFilter( this );
+}
+
+/*!Destructor.*/
+SALOME_EventFilter::~SALOME_EventFilter()
+{
+  qApp->removeEventFilter( this );
+}
+
+/*!
+  Custom event filter
+*/
+bool SALOME_EventFilter::eventFilter( QObject* o, QEvent* e )
+{
+  if ( e->type() == SALOME_EVENT )
+  { 
+    SALOME_Event* aSE = (SALOME_Event*)((SALOME_CustomEvent*)e)->data();
+    processEvent(aSE);
+    ((SALOME_CustomEvent*)e)->setData( 0 );
+    return true;
+  }
+  return QObject::eventFilter( o, e );
+}
+
+/*!Process event.*/
+void SALOME_EventFilter::processEvent( SALOME_Event* theEvent )
+{
+  if(theEvent)
+    theEvent->ExecutePostedEvent();
+}
+
+/*!Create new instance of SALOME_EventFilter*/
+void SALOME_EventFilter::Init()
+{
+  if( myFilter==NULL )
+    myFilter = new SALOME_EventFilter();
+}
+
+/*!Destroy filter.*/
+void SALOME_EventFilter::Destroy()
+{
+  if( myFilter )
+  {
+    delete myFilter;
+    myFilter = NULL;
+  }
+}
diff --git a/src/Event/SALOME_EventFilter.h b/src/Event/SALOME_EventFilter.h
new file mode 100755 (executable)
index 0000000..3881d6a
--- /dev/null
@@ -0,0 +1,63 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef SALOME_EVENTFILTER_H
+#define SALOME_EVENTFILTER_H
+
+#include "Event.h"
+#include <QObject>
+
+#if defined WIN32
+#pragma warning( disable: 4251 )
+#endif
+
+class SALOME_Event;
+
+/*!
+  Event filter class for QApplication object that handles custom events posted by SALOME_Event objects.
+  It assumes that such custom events are alwys posted, not sent. 
+  This event filter can be installed by any application that intends to use SALOME_Event mechanism asynchronously.
+  This class replaced SalomeApp_EventFilter.
+*/
+class EVENT_EXPORT SALOME_EventFilter: public QObject 
+{
+public:
+  static void Init();
+  static void Destroy();
+
+protected:
+  SALOME_EventFilter();
+  virtual ~SALOME_EventFilter();
+
+private:
+  /*! global event filter for qapplication */
+  virtual bool eventFilter( QObject* o, QEvent* e );
+  void processEvent( SALOME_Event* );
+
+private:
+  static SALOME_EventFilter* myFilter;
+};
+
+#if defined WIN32
+#pragma warning( default: 4251 )
+#endif
+
+#endif
index bf34bae3afd044c105c26d471d47123b4899e916..1748eeaa286131a378284b3ce41900ccd0649a67 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer.h
 // Created:   November, 2004
-
 //! Macro for exports
-#ifdef WNT
+//
+#ifdef WIN32
 
 #ifdef GLVIEWER_EXPORTS
 #define GLVIEWER_API __declspec(dllexport)
@@ -33,5 +34,5 @@
 
 #else
 #define GLVIEWER_API
-#endif // WNT
+#endif // WIN32
 
diff --git a/src/GLViewer/GLViewer.pro b/src/GLViewer/GLViewer.pro
new file mode 100644 (file)
index 0000000..e342254
--- /dev/null
@@ -0,0 +1,107 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = GLViewer
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
+
+GL_LIBS = -L/usr/X11R6/lib$$(LIB_LOCATION_SUFFIX) -lGLU
+
+INCLUDEPATH += $$(QTDIR)/include/QtOpenGL ../../include $${CAS_CPPFLAGS} ../Qtx ../SUIT
+LIBS += -L../../lib -lqtx -lsuit $${GL_LIBS} $${CAS_KERNEL}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += GLVIEWER_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = GLViewer.h
+HEADERS += GLViewer_AspectLine.h
+HEADERS += GLViewer_BaseDrawers.h
+HEADERS += GLViewer_BaseObjects.h
+HEADERS += GLViewer_Compass.h
+HEADERS += GLViewer_Context.h
+HEADERS += GLViewer_CoordSystem.h
+HEADERS += GLViewer_Defs.h
+HEADERS += GLViewer_Drawer.h
+HEADERS += GLViewer_Geom.h
+HEADERS += GLViewer_Grid.h
+HEADERS += GLViewer_Group.h
+HEADERS += GLViewer_MimeData.h
+HEADERS += GLViewer_Object.h
+HEADERS += GLViewer_Selector.h
+HEADERS += GLViewer_Selector2d.h
+HEADERS += GLViewer_Text.h
+HEADERS += GLViewer_Tools.h
+HEADERS += GLViewer_ToolTip.h
+HEADERS += GLViewer_ViewFrame.h
+HEADERS += GLViewer_ViewManager.h
+HEADERS += GLViewer_ViewPort.h
+HEADERS += GLViewer_ViewPort2d.h
+HEADERS += GLViewer_Viewer.h
+HEADERS += GLViewer_Viewer2d.h
+HEADERS += GLViewer_Widget.h
+
+SOURCES  = GLViewer_AspectLine.cxx
+SOURCES += GLViewer_BaseDrawers.cxx
+SOURCES += GLViewer_BaseObjects.cxx
+SOURCES += GLViewer_Compass.cxx
+SOURCES += GLViewer_Context.cxx
+SOURCES += GLViewer_CoordSystem.cxx
+SOURCES += GLViewer_Drawer.cxx
+SOURCES += GLViewer_Geom.cxx
+SOURCES += GLViewer_Grid.cxx
+SOURCES += GLViewer_Group.cxx
+SOURCES += GLViewer_MimeData.cxx
+SOURCES += GLViewer_Object.cxx
+SOURCES += GLViewer_Selector.cxx
+SOURCES += GLViewer_Selector2d.cxx
+SOURCES += GLViewer_Text.cxx
+SOURCES += GLViewer_Tools.cxx
+SOURCES += GLViewer_ToolTip.cxx
+SOURCES += GLViewer_ViewFrame.cxx
+SOURCES += GLViewer_ViewManager.cxx
+SOURCES += GLViewer_ViewPort.cxx
+SOURCES += GLViewer_ViewPort2d.cxx
+SOURCES += GLViewer_Viewer.cxx
+SOURCES += GLViewer_Viewer2d.cxx
+SOURCES += GLViewer_Widget.cxx
+
+TRANSLATIONS = resources/GLViewer_images.ts \
+               resources/GLViewer_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 6a91af84c85739f4aaad587923822e308cbe3550..a3db1329dbdaea283077f2a8a804fc1897512968 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_AspectLine.cxx
 // Created:   26/05/2005 3:17:00 PM
-
+//
 #include "GLViewer_AspectLine.h"
 
 /*!
@@ -127,7 +128,8 @@ QByteArray GLViewer_AspectLine::getByteCopy() const
     int aHR = myHColor.red(), aHG = myHColor.green(), aHB = myHColor.blue();
     int aSR = mySColor.red(), aSG = mySColor.green(), aSB = mySColor.blue();
 
-    QByteArray aResult( anISize * 10 + aFSize );
+    QByteArray aResult;
+    aResult.resize( anISize * 10 + aFSize );
 
     int i = 0;
     
index 99cdbcd97c87c216216e07e7bbf3a823f72331a3..25e25412b81cdbeb75ede7c0fc2358d86425ccdc 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_AspectLine.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_ASPECTLINE_H
 #define GLVIEWER_ASPECTLINE_H
 
 #include "GLViewer.h"
 
-#include <qcolor.h>
+#include <QColor>
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -113,7 +114,7 @@ protected:
   int                   myLineType;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 80dfa1329399b9f08fa596d85d07368a64a5b546..b861c68e18bd9f133a855b92e7866e5a0407321b 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_BaseDrawers.cxx
 // Created:   November, 2004
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_BaseDrawers.h"
 #include "GLViewer_Object.h"
 #include "GLViewer_Text.h"
 #include "GLViewer_AspectLine.h"
 #include "GLViewer_BaseObjects.h"
 
+// Qt includes
+#include <QColor>
+
+
 #ifndef WIN32
 #include <GL/glx.h>
 #endif
@@ -66,10 +71,10 @@ GLViewer_MarkerDrawer::~GLViewer_MarkerDrawer()
 */
 void GLViewer_MarkerDrawer::create( float xScale, float yScale, bool onlyUpdate )
 {
-    QValueList<int>::Iterator it;
-    QValueList<int>::Iterator EndIt;
-    QValueList<GLViewer_Object*>::Iterator anObjectIt = myObjects.begin();
-    QValueList<GLViewer_Object*>::Iterator anEndObjectIt = myObjects.end();
+    QList<int>::Iterator it;
+    QList<int>::Iterator EndIt;
+    QList<GLViewer_Object*>::Iterator anObjectIt = myObjects.begin();
+    QList<GLViewer_Object*>::Iterator anEndObjectIt = myObjects.end();
 
     myXScale = xScale;
     myYScale = yScale;
@@ -89,7 +94,7 @@ void GLViewer_MarkerDrawer::create( float xScale, float yScale, bool onlyUpdate
         float* anYCoord = aMarkerSet->getYCoord();
         float aRadius = aMarkerSet->getMarkerSize();
 
-        QValueList<int> aHNumbers, anUHNumbers, aSelNumbers, anUSelNumbers;
+        QList<int> aHNumbers, anUHNumbers, aSelNumbers, anUSelNumbers;
         aMarkerSet->exportNumbers( aHNumbers, anUHNumbers, aSelNumbers, anUSelNumbers );
 
         if( onlyUpdate )
@@ -189,8 +194,8 @@ GLViewer_PolylineDrawer::~GLViewer_PolylineDrawer()
 */
 void GLViewer_PolylineDrawer::create( float xScale, float yScale, bool onlyUpdate )
 {
-    QValueList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
-    QValueList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
+    QList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
+    QList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
     
     myXScale = xScale;
     myYScale = yScale;
@@ -278,8 +283,8 @@ GLViewer_TextDrawer::~GLViewer_TextDrawer()
 */
 void GLViewer_TextDrawer::create( float xScale, float yScale, bool onlyUpdate )
 {
-    QValueList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
-    QValueList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
+    QList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
+    QList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
     
     myXScale = xScale;
     myYScale = yScale;
@@ -322,8 +327,8 @@ void GLViewer_TextDrawer::create( float xScale, float yScale, bool onlyUpdate )
 */
 void GLViewer_TextDrawer::updateObjects()
 {
-    QValueList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
-    QValueList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
+    QList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
+    QList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
     for( ; aObjectIt != aObjectEndIt; aObjectIt++ )
         (*aObjectIt)->compute();
 }
index d06311cf38dfe9e806b3acd05e9f8854d1013cf0..8c451efbac51641561693a8561fca44e97737ff6 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_BaseDrawers.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_BASEDRAWERS_H
 #define GLVIEWER_BASEDRAWERS_H
 
-#include <qcolor.h>
-#include <qobject.h>
-#include <qfile.h>
-#include <qfont.h>
-#include <qgl.h>
+class QColor;
 
 #include "GLViewer.h"
 #include "GLViewer_Drawer.h"
 
 class GLViewer_AspectLine;
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -91,7 +88,7 @@ public:
   void                      updateObjects();
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 338543ee3b8920c16c544ca433323e52fcffe29f..29bff9d44fdd3df32dee8b889ad43e6753685752 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_BaseObjects.h"
 #include "GLViewer_BaseDrawers.h"
 #include "GLViewer_AspectLine.h"
@@ -29,6 +31,8 @@
 
 #include "GLViewer_Drawer.h"
 
+#include <QFile>
+
 //#include <cmath>
 //using namespace std;
 
@@ -214,7 +218,7 @@ bool GLViewer_MarkerSet::translateToPS( QFile& hFile, GLViewer_CoordSystem* aVie
     }
     aBuffer+="closepath\nstroke\n";
 
-    hFile.writeBlock( aBuffer.ascii(), aBuffer.length() );
+    hFile.write( aBuffer.toAscii() );
 
     return true;
 }
@@ -252,7 +256,7 @@ bool GLViewer_MarkerSet::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aV
         }
         aBuffer+="PU;\n";
 
-        hFile.writeBlock( aBuffer.ascii(), aBuffer.length() );
+        hFile.write( aBuffer.toAscii() );
     }
 
     return true;
@@ -313,10 +317,10 @@ void GLViewer_MarkerSet::compute()
 
   for ( int i = 0; i < myNumber; i++ )  
   {
-    xa = QMIN( xa, myXCoord[i] );
-    xb = QMAX( xb, myXCoord[i] );
-    ya = QMIN( ya, myYCoord[i] );
-    yb = QMAX( yb, myYCoord[i] );
+    xa = qMin( xa, myXCoord[i] );
+    xb = qMax( xb, myXCoord[i] );
+    ya = qMin( ya, myYCoord[i] );
+    yb = qMax( yb, myYCoord[i] );
   }
   
   myXGap = ( xb - xa ) / 10;
@@ -352,8 +356,8 @@ GLboolean GLViewer_MarkerSet::highlight( GLfloat x, GLfloat y, GLfloat tol, GLbo
 //  cout << "GLViewer_MarkerSet::highlight " << x <<" " << y << " " << tol << endl;
   int count = 0;
   GLfloat xdist, ydist, radius;
-  QValueList<int>::Iterator it;
-  QValueList<int> curHNumbers;
+  QList<int>::Iterator it;
+  QList<int> curHNumbers;
   bool isFound;
   GLboolean update;
   int cnt = 0;
@@ -432,10 +436,10 @@ GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewe
 //  cout << "GLViewer_MarkerSet::select " << x << " " << y << endl;
   int count = 0;
   GLfloat xdist, ydist, radius;
-  QValueList<int>::Iterator it;
-  QValueList<int>::Iterator it1;
-  QValueList<int>::Iterator remIt;
-  QValueList<int>::Iterator curIt;
+  QList<int>::Iterator it;
+  QList<int>::Iterator it1;
+  QList<int>::Iterator remIt;
+  QList<int>::Iterator curIt;
 
   radius = tol - myMarkerSize / 2.;
 
@@ -481,35 +485,35 @@ GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewe
             for ( it1 = myHNumbers.begin(); it1 != myHNumbers.end(); ++it1 )
               if( i == *it1 )
               {
-                myHNumbers.remove( it1 );
+                myHNumbers.erase( it1 );
                 break;
               }
       for ( it1 = myUHNumbers.begin(); it1 != myUHNumbers.end(); ++it1 )
         if( i == *it1 )
         {
-          myUHNumbers.remove( it1 );
+          myUHNumbers.erase( it1 );
           break;
         }
         }
     else
         {
-      mySelNumbers.remove( remIt );
+      mySelNumbers.erase( remIt );
       for ( curIt = myCurSelNumbers.begin(); curIt != myCurSelNumbers.end(); ++curIt )
         if( *curIt == *remIt)
         {
-          myCurSelNumbers.remove( curIt );
+          myCurSelNumbers.erase( curIt );
           break;
         }
       for ( it1 = myHNumbers.begin(); it1 != myHNumbers.end(); ++it1 )
         if( i == *it1 )
         {
-          myHNumbers.remove( it1 );
+          myHNumbers.erase( it1 );
           break;
         }
       for ( it1 = myUHNumbers.begin(); it1 != myUHNumbers.end(); ++it1 )
         if( i == *it1 )
         {
-          myUHNumbers.remove( it1 );
+          myUHNumbers.erase( it1 );
           break;
         }
         }
@@ -521,13 +525,13 @@ GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewe
     for ( it1 = myHNumbers.begin(); it1 != myHNumbers.end(); ++it1 )
       if( i == *it1 )
       {
-        myHNumbers.remove( it1 );
+        myHNumbers.erase( it1 );
         break;
       }
     for ( it1 = myUHNumbers.begin(); it1 != myUHNumbers.end(); ++it1 )
       if( i == *it1 )
           {
-        myUHNumbers.remove( it1 );
+        myUHNumbers.erase( it1 );
         break;
       }        
       }     
@@ -538,7 +542,7 @@ GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewe
     for( it1 = myUSelNumbers.begin(); it1 != myUSelNumbers.end(); ++it1 )
       if( *it == *it1 )
       {
-        it1 = myUSelNumbers.remove( it1 );
+        it1 = myUSelNumbers.erase( it1 );
         it1--;
       }
   
@@ -633,10 +637,10 @@ void GLViewer_MarkerSet::setNumMarkers( GLint number )
 /*!
   Export numbers of highlighted/selected lines
 */
-void GLViewer_MarkerSet::exportNumbers( QValueList<int>& highlight,
-                     QValueList<int>& unhighlight,
-                     QValueList<int>& select,
-                     QValueList<int>& unselect )
+void GLViewer_MarkerSet::exportNumbers( QList<int>& highlight,
+                     QList<int>& unhighlight,
+                     QList<int>& select,
+                     QList<int>& unselect )
 {
     highlight = myHNumbers;
     unhighlight = myUHNumbers;
@@ -655,14 +659,12 @@ bool GLViewer_MarkerSet::addOrRemoveSelected( int index )
   if( index < 0 || index > myNumber )
     return FALSE;
 
-  int n = mySelNumbers.findIndex( index );
+  int n = mySelNumbers.indexOf( index );
   if( n == -1 )
     mySelNumbers.append( index );
   else
   {
-    QValueList<int>::Iterator it;
-    it = mySelNumbers.at( n );
-    mySelNumbers.remove( it );
+    mySelNumbers.removeAt(n);
     myUSelNumbers.append( index );
   }
   return TRUE;
@@ -675,7 +677,7 @@ bool GLViewer_MarkerSet::addOrRemoveSelected( int index )
 void GLViewer_MarkerSet::addSelected( const TColStd_SequenceOfInteger& seq )
 {
   for ( int i = 1; i <= seq.Length(); i++ )
-    if( mySelNumbers.findIndex( seq.Value( i ) ) == -1 )
+    if( mySelNumbers.indexOf( seq.Value( i ) ) == -1 )
       mySelNumbers.append( seq.Value( i ) - 1 );
 }
 
@@ -685,7 +687,7 @@ void GLViewer_MarkerSet::addSelected( const TColStd_SequenceOfInteger& seq )
 */
 void GLViewer_MarkerSet::setSelected( const TColStd_SequenceOfInteger& seq )
 {
-//   for( QValueList<int>::Iterator it = mySelNumbers.begin(); it != mySelNumbers.end(); ++it )
+//   for( QList<int>::Iterator it = mySelNumbers.begin(); it != mySelNumbers.end(); ++it )
 //     if( myUSelNumbers.findIndex( *it ) == -1 )
 //       myUSelNumbers.append( *it );
 
@@ -728,7 +730,8 @@ QByteArray GLViewer_MarkerSet::getByteCopy()
     
     QByteArray aObject = GLViewer_Object::getByteCopy();
 
-    QByteArray aResult( anISize + 2*aFSize*myNumber + aFSize + aObject.size());
+    QByteArray aResult;
+    aResult.resize( anISize + 2*aFSize*myNumber + aFSize + aObject.size());
 
     char* aPointer = (char*)&myNumber;
     for( i = 0; i < anISize; i++, aPointer++ )
@@ -784,7 +787,8 @@ bool GLViewer_MarkerSet::initializeFromByteCopy( QByteArray theArray )
          *aPointer = theArray[i];
          
     int aCurIndex = anISize + 2*aFSize*myNumber + aFSize;
-    QByteArray aObject( aSize - aCurIndex );
+    QByteArray aObject;
+    aObject.resize( aSize - aCurIndex );
     for( ; i < aSize; i++ )
         aObject[i - aCurIndex] = theArray[i];
         
@@ -871,7 +875,7 @@ bool GLViewer_Polyline::translateToPS( QFile& hFile, GLViewer_CoordSystem* aView
 
     aBuffer+="closepath\nstroke\n";
     
-    hFile.writeBlock( aBuffer.ascii(), aBuffer.length() );
+    hFile.write( aBuffer.toAscii() );
 
     return true;
 }
@@ -897,7 +901,7 @@ bool GLViewer_Polyline::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aVi
 
     aBuffer+="PU;\n";
     
-    hFile.writeBlock( aBuffer.ascii(), aBuffer.length() );
+    hFile.write( aBuffer.toAscii() );
 
     return true;
 }
@@ -958,10 +962,10 @@ void GLViewer_Polyline::compute()
 
   for ( int i = 0; i < myNumber; i++ )  
   {
-    xa = QMIN( xa, myXCoord[i] );
-    xb = QMAX( xb, myXCoord[i] );
-    ya = QMIN( ya, myYCoord[i] );
-    yb = QMAX( yb, myYCoord[i] );
+    xa = qMin( xa, myXCoord[i] );
+    xb = qMax( xb, myXCoord[i] );
+    ya = qMin( ya, myYCoord[i] );
+    yb = qMax( yb, myYCoord[i] );
   }
 
   GLfloat xGap = ( xb - xa ) / 10;
@@ -1219,10 +1223,10 @@ void GLViewer_Polyline::setNumber( GLint number )
 /*!
   Export numbers of highlighted/selected lines
 */
-void GLViewer_Polyline::exportNumbers( QValueList<int>& highlight,
-                     QValueList<int>& unhighlight,
-                     QValueList<int>& select,
-                     QValueList<int>& unselect )
+void GLViewer_Polyline::exportNumbers( QList<int>& highlight,
+                     QList<int>& unhighlight,
+                     QList<int>& select,
+                     QList<int>& unselect )
 {
   highlight = myHNumbers;
   unhighlight = myUHNumbers;
@@ -1264,7 +1268,8 @@ QByteArray GLViewer_Polyline::getByteCopy()
 
     QByteArray aObject = GLViewer_Object::getByteCopy();
 
-    QByteArray aResult( aFSize*myNumber*2 + anISize + 2*aBSize + aObject.size());
+    QByteArray aResult;
+    aResult.resize( aFSize*myNumber*2 + anISize + 2*aBSize + aObject.size());
 
     char* aPointer = (char*)&myNumber;
     for( i = 0; i < anISize; i++, aPointer++ )
@@ -1327,7 +1332,8 @@ bool GLViewer_Polyline::initializeFromByteCopy( QByteArray theArray )
          *aPointer = theArray[i];
 
     int aCurIndex = anISize + 2*aFSize*myNumber + 2*aBSize;
-    QByteArray aObject( aSize - aCurIndex );
+    QByteArray aObject;
+    aObject.resize( aSize - aCurIndex );
     for( ; i < aSize; i++ )
         aObject[i - aCurIndex] = theArray[i];
 
@@ -1394,7 +1400,7 @@ bool GLViewer_TextObject::translateToPS( QFile& hFile, GLViewer_CoordSystem* aVi
     AddCoordsToPS( aBuffer, "moveto", aViewerCS, aPSCS, double(xPos), double(yPos) );
     aBuffer += "(" + aText + ") show\n";
 
-    hFile.writeBlock( aBuffer.ascii(), aBuffer.length() );
+    hFile.write( aBuffer.toAscii() );
 
     return true;
 }
@@ -1416,7 +1422,7 @@ bool GLViewer_TextObject::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* a
     
     aBuffer = "LB" + aText + "#;";
     
-    hFile.writeBlock( aBuffer.ascii(), aBuffer.length() );
+    hFile.write( aBuffer.toAscii() );
 
     return true;
 }
@@ -1438,7 +1444,7 @@ bool GLViewer_TextObject::translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerC
            y = double( yPos );
 
     aViewerCS->transform( *aEMFCS, x, y );
-    const char* str = aText.ascii();
+    const char* str = aText.toAscii();
 
     int nHeight = 35*14;       // height of font
     int nWidth = 35*12;        // average character width
index c0f45d3287f7ea982cf9abfed6be7720fb71b36f..464c63049634a8ac757eb4d2844c40a6c65183dd 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_BaseObjects.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_BASEOBJECTS_H
 #define GLVIEWER_BASEOBJECTS_H
 
 #include "GLViewer.h"
 #include "GLViewer_Object.h"
 
-#include <qcolor.h>
-#include <qvaluelist.h>
+#include <QColor>
 
 #include <TColStd_SequenceOfInteger.hxx>
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -92,11 +92,11 @@ public:
   float                    getMarkerSize() const { return myMarkerSize; }
   
   //! Export numbers of heghlighted/selected markers
-  void                     exportNumbers( QValueList<int>& high, QValueList<int>& unhigh,
-                                          QValueList<int>& sel, QValueList<int>& unsel );
+  void                     exportNumbers( QList<int>& high, QList<int>& unhigh,
+                                          QList<int>& sel, QList<int>& unsel );
   
   //! Returns selected numbers
-  QValueList<int>          getSelectedElements() { return mySelNumbers; }
+  QList<int>               getSelectedElements() { return mySelNumbers; }
   //! Adds or remove selected number
   bool                     addOrRemoveSelected( int index );
   //! Adds selected numbers
@@ -109,12 +109,12 @@ protected:
   GLfloat*                myXCoord;
   GLfloat*                myYCoord;    
   GLfloat                 myMarkerSize;
-  QValueList<int>         myHNumbers;
-  QValueList<int>         myUHNumbers;
-  QValueList<int>         mySelNumbers;
-  QValueList<int>         myCurSelNumbers;
-  QValueList<int>         myUSelNumbers;
-  QValueList<int>         myPrevHNumbers;
+  QList<int>              myHNumbers;
+  QList<int>              myUHNumbers;
+  QList<int>              mySelNumbers;
+  QList<int>              myCurSelNumbers;
+  QList<int>              myUSelNumbers;
+  QList<int>              myPrevHNumbers;
   TColStd_SequenceOfInteger mySelectedIndexes;
 };
 
@@ -177,11 +177,11 @@ public:
   GLboolean               isHighSelAll() const { return myHighSelAll; }
   
   //! Export numbers of highlighted/selected lines
-  void                     exportNumbers( QValueList<int>& high, QValueList<int>& unhigh,
-                                          QValueList<int>& sel, QValueList<int>& unsel );
+  void                    exportNumbers( QList<int>& high, QList<int>& unhigh,
+                                        QList<int>& sel, QList<int>& unsel );
 
   //! Returns numbers of selected lines
-  QValueList<int>         getSelectedElements() { return mySelNumbers; }
+  QList<int>              getSelectedElements() { return mySelNumbers; }
 
 protected:
   GLfloat*                myXCoord;
@@ -190,12 +190,12 @@ protected:
   GLboolean               myIsClosed;
   GLboolean               myHighSelAll;
   
-  QValueList<int>         myHNumbers;
-  QValueList<int>         myUHNumbers;
-  QValueList<int>         mySelNumbers;
-  QValueList<int>         myUSelNumbers;
-  QValueList<int>         myCurSelNumbers;
-  QValueList<int>         myPrevHNumbers;
+  QList<int>              myHNumbers;
+  QList<int>              myUHNumbers;
+  QList<int>              mySelNumbers;
+  QList<int>              myUSelNumbers;
+  QList<int>              myCurSelNumbers;
+  QList<int>              myPrevHNumbers;
   TColStd_SequenceOfInteger mySelectedIndexes;
   
   GLboolean               myHighFlag;
@@ -248,7 +248,7 @@ protected:
   int                       myHeight;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 00fae1c1f601bdd3d33ca8eb0c4611eb0b78cb0c..9ceee0874d8e83562a71ad59b9e7b9b5ccda2b51 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Compass.cxx
 // Created:   November, 2004
-
+//
 #include "GLViewer_Compass.h"
 #include "GLViewer_Drawer.h"
 
index 62dd4f2573377429c733ae6e963617b1343e6aca..0ace9ae752630f023988406adaed38b4aad717e8 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Compass.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_COMPASS_H
 #define GLVIEWER_COMPASS_H
 
 #include "GLViewer.h"
 
-#include <qcolor.h>
+#include <QColor>
+
+class QFont;
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -142,7 +145,7 @@ protected:
   bool               isGenereted;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 0383b0325519889905878c5c3b1b2052b4326402..c839a22f04d4ccb0977f268a31c9b7b88138452c 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Context.cxx
 // Created:   November, 2004
-
+//
 /*!
   \class GLViewer_AspectLine
   \brief Class for manage of presentations in GLViewer
 #include "GLViewer_Object.h"
 #include "GLViewer_Viewer2d.h"
 #include "GLViewer_ViewPort2d.h"
+#include "GLViewer_ViewFrame.h"
+
+//QT includes
+#include <QRect>
 
 #include <TColStd_SequenceOfInteger.hxx>
 
@@ -222,7 +227,7 @@ int GLViewer_Context::Select( bool Append, bool byCircle )
         } 
         else if( myLastPicked->isSelected() && status != SS_LocalChanged )
         {
-            mySelectedObjects.remove( myLastPicked );
+            mySelectedObjects.removeAll( myLastPicked );
             myLastPicked->unselect();
             myGLViewer2d->updateAll();
 
@@ -233,7 +238,7 @@ int GLViewer_Context::Select( bool Append, bool byCircle )
         }
 
         if ( myLastPicked->select( myXhigh, myYhigh, myTolerance, GLViewer_Rect(), false, byCircle, Append )
-             && mySelectedObjects.findIndex( myLastPicked ) == -1 )
+             && mySelectedObjects.indexOf( myLastPicked ) == -1 )
         {
             mySelectedObjects.append( myLastPicked );
             myGLViewer2d->activateDrawer( myLastPicked, TRUE, TRUE );
@@ -370,7 +375,7 @@ int GLViewer_Context::SelectByRect( const QRect& theRect, bool Append )
             isSel = (*it)->isSelected();
         }
 
-        if( isSel && mySelectedObjects.findIndex( *it ) == -1 )
+        if( isSel && mySelectedObjects.indexOf( *it ) == -1 )
         {
             aList.append( *it );
             mySelectedObjects.append( *it );
@@ -527,14 +532,14 @@ bool GLViewer_Context::replaceObject( GLViewer_Object* oldObject, GLViewer_Objec
 
   if( myActiveObjects.contains( oldObject ) )
   {
-    myActiveObjects.remove( oldObject );
+    myActiveObjects.removeAll( oldObject );
     myActiveObjects.append( newObject );
     return true;
   }
 
   if( myInactiveObjects.contains( oldObject ) )
   {
-    myInactiveObjects.remove( oldObject );
+    myInactiveObjects.removeAll( oldObject );
     myInactiveObjects.append( newObject );
     return true;
   }
@@ -626,7 +631,7 @@ void GLViewer_Context::remSelected( GLViewer_Object* object, bool updateViewer )
   if( !object || !mySelectedObjects.contains( object ) )
     return;
   
-  mySelectedObjects.remove( object );
+  mySelectedObjects.removeAll( object );
   object->unselect();
   
   if( updateViewer )
@@ -661,14 +666,14 @@ void GLViewer_Context::deleteObject( GLViewer_Object* theObject, bool updateView
         return;
 
     if( myActiveObjects.contains( theObject ) )      
-        myActiveObjects.remove( theObject );
+        myActiveObjects.removeAll( theObject );
     else if( myInactiveObjects.contains( theObject ) )
-        myInactiveObjects.remove( theObject );
+        myInactiveObjects.removeAll( theObject );
     else 
         return;
      
     if( mySelectedObjects.contains( theObject ) )
-        mySelectedObjects.remove( theObject );
+        mySelectedObjects.removeAll( theObject );
 
     GLViewer_Group* aGroup = theObject->getGroup();
     if( aGroup )
@@ -690,7 +695,7 @@ bool GLViewer_Context::setActive( GLViewer_Object* theObject )
   if( !theObject || !myInactiveObjects.contains( theObject ) )
     return false;
 
-  myInactiveObjects.remove( theObject );
+  myInactiveObjects.removeAll( theObject );
   myActiveObjects.append( theObject );
   return true;
 }
@@ -704,7 +709,7 @@ bool GLViewer_Context::setInactive( GLViewer_Object* theObject )
   if( !theObject || !myActiveObjects.contains( theObject ) )
     return false;
 
-  myActiveObjects.remove( theObject );
+  myActiveObjects.removeAll( theObject );
   myInactiveObjects.append( theObject );
   return true;
 }
index 5a9df2ceba1aefc49d8b06e2e381dae763067f9a..0090a107a039054d3a478d5941ad5f96bf05478b 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Context.h
 // Created:   November, 2004
-
-
+//
 #ifndef GLVIEWER_CONTEXT_H
 #define GLVIEWER_CONTEXT_H
 
-#ifdef WNT
+#ifdef WIN32
 #include "windows.h"
 #endif
 
 #include "GLViewer_Defs.h"
 #include "GLViewer_Object.h"
 
-#include <qrect.h>
-#include <qobject.h>
-#include <qregion.h>
+class QRect;
 
 #include <Quantity_NameOfColor.hxx>
 #include <Quantity_Color.hxx>
@@ -44,7 +42,7 @@
 
 class GLViewer_Viewer2d;
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -201,7 +199,7 @@ protected:
   int                   myTolerance;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 3889bdfe5aeb3f69bc32db85efd9a580f72d5a99..cc5d11820d35fdef7aef89c52d101aad24db66a8 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Context.cxx
 // Created:   November, 2004
-
+//
 #include "GLViewer_CoordSystem.h"
 #include <math.h>
 
index 6db89583bb3ab702818d15af1ec3db144d10819d..105b64c90adf46ee4c53c0b120103d0834065bdb 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_CoordSystem.h
 // Created:   November, 2004
-
+//
 /*! Class GLViewer_CoordSystem
  *  Class implementing mathematical model of 2D coordinate system 
  */
@@ -31,7 +32,7 @@
 
 #include "GLViewer.h"
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -100,7 +101,7 @@ protected:
   virtual void fromReference( double& x, double& y );
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 411fb4a7af45b349594d778831b272294f16f884..cace175439b982e0545c72eda2dac594411e2dd1 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Defs.h
 // Created:   March, 2005
-
+//
 #ifndef GLVIEWER_DEFS_H
 #define GLVIEWER_DEFS_H
 
-#include <qmap.h>
-#include <qvaluelist.h>
+#include <QMap>
+#include <QList>
 
 class GLViewer_Object;
 //Selection staus 
@@ -57,7 +58,7 @@ enum SelectionStatus
 };
 
 typedef QMap<GLViewer_Object*,int> ObjectMap;
-typedef QValueList<GLViewer_Object*> ObjList;
+typedef QList<GLViewer_Object*> ObjList;
 
 #define SEGMENTS   32
 #define PI         3.14159265359
index d0001a49c18f42ab8c6efd5893e05358f4e056ab..5da2863e2ec499bde93c126e7bbed89e07b399ba 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Drawer.cxx
 // Created:   November, 2004
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_Drawer.h"
 #include "GLViewer_Object.h"
 #include "GLViewer_Text.h"
 #include "GLViewer_ViewFrame.h"
 #include "GLViewer_ViewPort2d.h"
 
+#include <QApplication>
+#include <QImage>
+#include <QPainter>
+#include <QFile>
+
 #ifndef WIN32
 #include <GL/glx.h>
 #endif
 
 #include <gp_Pnt2d.hxx>
 
-#include <qimage.h>
-#include <qpainter.h>
-
 #define TEXT_GAP    5
 // Two texture components for texmapped fonts: luminance and alpha
 #define NB_TEX_COMP 2
@@ -73,7 +76,7 @@ void GLViewer_TexFont::clearTextBases()
 GLViewer_TexFont::GLViewer_TexFont()
 : myMaxRowWidth( 0 ), myFontHeight( 0 )
 {
-    myQFont = QFont::defaultFont();
+    myQFont = QApplication::font();//QFont::defaultFont();
     mySeparator = 2;
     myIsResizeable = false;
     myMinMagFilter = GL_LINEAR;
@@ -204,7 +207,7 @@ bool GLViewer_TexFont::generateTexture()
             aPainter.drawText( myPositions[l], ( row + 1 ) * aRowPixelHeight - aDescent, aLetter );
         }
     
-        QImage aImage = aPixmap.convertToImage();
+        QImage aImage = aPixmap.toImage();
 
         //int qqq = 0;
         //if (qqq)
@@ -308,7 +311,7 @@ void GLViewer_TexFont::drawString( QString theStr, GLdouble theX , GLdouble theY
     int aLettIndex, row;
     for ( int i = 0; i < (int)theStr.length(); i++ )
     {
-        aLetter    = theStr.data()[i];
+        aLetter    = theStr.data()[i].toLatin1();
         aLettIndex = (int)aLetter - FirstSymbolNumber;
         row        = aLettIndex / TEX_ROW_LEN;
 
@@ -340,7 +343,7 @@ int GLViewer_TexFont::getStringWidth( QString theStr )
     int aWidth = 0;
     for ( int i = 0; i < (int)theStr.length(); i ++ )
     {
-        char aLetter = theStr.data()[i];
+        char aLetter = theStr.data()[i].toLatin1();
         int aLettIndex = (int)aLetter - FirstSymbolNumber;
         aWidth += myWidths[aLettIndex] + mySeparator;
     }
@@ -388,8 +391,8 @@ static GLuint displayListBase( QFont* theFont )
     QMap<GLViewer_TexFindId, GLuint>::iterator it = GLViewer_TexFont::BitmapFontCache.begin();
     for ( ; it != GLViewer_TexFont::BitmapFontCache.end(); ++it )
     {
-      if ( it.key().myViewPortId == (int)ctx && it.data() > listBase )
-        listBase = it.data();
+      if ( it.key().myViewPortId == (int)ctx && it.value() > listBase )
+        listBase = it.value();
     }
     listBase += 256;
 
@@ -429,19 +432,19 @@ static GLuint displayListBase( QFont* theFont )
     QMap<GLViewer_TexFindId, GLuint>::iterator it = GLViewer_TexFont::BitmapFontCache.begin();
     for ( ; it != GLViewer_TexFont::BitmapFontCache.end(); ++it )
     {
-      if ( it.key().myViewPortId == size_t(aCont) && it.data() > listBase )
-        listBase = it.data();
+      if ( it.key().myViewPortId == size_t(aCont) && it.value() > listBase )
+        listBase = it.value();
     }
     listBase += 256;
     
     //glXUseXFont( (Font)(theFont->handle()), 0, 256, listBase );
     int aFontCont = 0;
     QString aFontDef = theFont->toString();
-    char** xFontList = XListFonts( aDisp, aFontDef.latin1()/*aFindFont.myFontString.data()*/, 1, &aFontCont  );
+    char** xFontList = XListFonts( aDisp, aFontDef.toLatin1()/*aFindFont.myFontString.data()*/, 1, &aFontCont  );
     if( !theFont->handle() )
     {       
 #ifdef _DEBUG_
-      printf( "Can't load font %s. loading default font....\n", aFontDef.latin1()/*aFindFont.myFontString.data()*/ );
+      printf( "Can't load font %s. loading default font....\n", aFontDef.toLatin1().data()/*aFindFont.myFontString.data()*/ );
 #endif
       QString aFontMask ("-*-*-*-r-*-*-");
       aFontMask += aFontDef/*aFindFont.myFontString*/.section( ',', 1, 1 );
@@ -449,7 +452,7 @@ static GLuint displayListBase( QFont* theFont )
       printf( "Height of Default font: %s\n", aFontDef/*aFindFont.myFontString*/.section( ',', 1, 1 ).data() );
 #endif
       aFontMask += "-*-*-*-m-*-*-*";
-      xFontList = XListFonts( aDisp, aFontMask.data()/*"-*-*-*-r-*-*-12-*-*-*-m-*-*-*"*/, 1, &aFontCont  );
+      xFontList = XListFonts( aDisp, aFontMask.toLatin1().constData()/*"-*-*-*-r-*-*-12-*-*-*-m-*-*-*"*/, 1, &aFontCont  );
       if( aFontCont == 0 )
       {      
 #ifdef _DEBUG_
@@ -504,7 +507,7 @@ void GLViewer_Drawer::destroyAllTextures()
     QMap<GLViewer_TexFindId,GLViewer_TexIdStored>::Iterator anEndIt= GLViewer_TexFont::TexFontBase.end();
 
     for( ; anIt != anEndIt; anIt++ )
-        glDeleteTextures( 1, &(anIt.data().myTexFontId) );
+        glDeleteTextures( 1, &(anIt.value().myTexFontId) );
 }
 
 /*!
@@ -785,7 +788,7 @@ void GLViewer_Drawer::drawText( const QString& text, GLfloat xPos, GLfloat yPos,
   {
     glRasterPos2f( xPos, yPos );
     glListBase( displayListBase( theFont ) );
-    glCallLists( text.length(), GL_UNSIGNED_BYTE, text.local8Bit().data() );
+    glCallLists( text.length(), GL_UNSIGNED_BYTE, text.toLocal8Bit().data() );
   }
 }
 
@@ -996,7 +999,7 @@ void GLViewer_Drawer::drawContour( const GLViewer_PntList& pntList, QColor color
   glLineWidth( lineWidth );
   
   glBegin( GL_LINES );
-  QValueList<GLViewer_Pnt>::const_iterator it = pntList.begin();
+  QList<GLViewer_Pnt>::const_iterator it = pntList.begin();
   for( ; it != pntList.end(); ++it )
     glVertex2f( (*it).x(), (*it).y() );
   glEnd();
@@ -1051,7 +1054,7 @@ void GLViewer_Drawer::drawPolygon( const GLViewer_PntList& pntList, QColor color
     ( GLfloat )color.green() / 255,
     ( GLfloat )color.blue() / 255 );
   glBegin( GL_POLYGON );
-  QValueList<GLViewer_Pnt>::const_iterator it = pntList.begin();
+  QList<GLViewer_Pnt>::const_iterator it = pntList.begin();
   for( ; it != pntList.end(); ++it )
     glVertex2f( (*it).x(), (*it).y() );
   glEnd();
index 21c6386cead663f2b9195bd5ab34701cf9566438..89a3ed58f2d5d8caf407c4a2a0fc8b008239b654 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Drawer.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_DRAWER_H
 #define GLVIEWER_DRAWER_H
 
-#ifdef WNT
+#ifdef WIN32
 #include "windows.h"
 #endif
 
-#include <qcolor.h>
-#include <qobject.h>
-#include <qfile.h>
-#include <qfont.h>
-#include <qgl.h>
+#include <QColor>
+#include <QFont>
+
+class QFile;
 
 #include <GL/gl.h>
 
@@ -45,7 +45,7 @@ class GLViewer_Object;
 class GLViewer_Rect;
 class GLViewer_CoordSystem;
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 /*! 
@@ -424,7 +424,7 @@ protected:
   float                           myYScale;
   
   //! List of objects
-  QValueList<GLViewer_Object*>    myObjects;
+  QList<GLViewer_Object*>    myObjects;
   //! List generated textures
   GLuint                          myTextList;
   
@@ -443,7 +443,7 @@ protected:
   GLfloat                         myTextScale;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index ebd777e22709dc72699a10bcbf128d0ed2de46fc..8ad608cfea59f28a23d50f4ecd3bc6723fcbbc49 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 //#include <GLViewerAfx.h>
-#include <GLViewer_Geom.h>
+//
+#include "GLViewer_Geom.h"
 
 #define FAR_POINT 1e10  // Value used as a "very distant" co-ordinate
 #define TOLERANCE 1e-3
index 7ba4db69fdbce65f63e6bed9e8bf4d9cf6020b97..4b75d3e782b3767db196c8be114f421b5ce4fb44 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Geom.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_GEOM_H
 #define GLVIEWER_GEOM_H
 
 #include "GLViewer.h"
 
-#include <qrect.h>
-#include <qvaluelist.h>
-#include <qgl.h>
+#include <QRect>
+#include <QtOpenGL>
 #include <math.h>
 
+//using namespace QGL;
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -59,7 +60,7 @@ private:
   GLfloat myY;
 };
 
-typedef QValueList<GLViewer_Pnt> GLViewer_PntList;
+typedef QList<GLViewer_Pnt> GLViewer_PntList;
 
 /*! Class  GLViewer_Rect
 *  Substitution of QRect for OpenGL
@@ -191,7 +192,7 @@ private:
   GLViewer_PntList* myPoints;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 13a661cafc6d2d22048630644f0956f3b5b095cf..27b4d7dacef8691e2dd7d55d241e87d3b7759845 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Grid.cxx
 // Created:   November, 2004
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_Grid.h"
 #include "GLViewer_Defs.h"
 
 #include <Precision.hxx>
-#include <qglobal.h>
 
 /*!
   Default constructor
index d4a4567e4a6bf334b847217165def24c5923b134..5d3f15e1d23579926e693ad56a8c73723f481f50 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Grid.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_GRID_H
 #define GLVIEWER_GRID_H
 
-#ifdef WNT
+#ifdef WIN32
 #include "windows.h"
 #endif
 
@@ -34,7 +35,7 @@
 #include <GL/gl.h>
 #include <GL/glu.h>
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -115,7 +116,7 @@ protected:
   GLboolean              myIsUpdate;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 64675049000c32e40a9fdfe00e29e4b02f8c21ad..f04bc8ce884e95d7ce6a448aa1ae40f050b113a4 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Group.xx
 // Created:   March, 2005
-
 //#include "GLViewerAfx.h"
+//
 #include "GLViewer_Group.h"
 #include "GLViewer_Object.h"
 
index 4382b06c93e65e4b06808279f968a9062b7b321b..92c05288847833561e5bcd7a176ccbf7f6c5b449 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Group.h
 // Created:   March, 2005
-
+//
 #ifndef GLVIEWER_GROUP_H
 #define GLVIEWER_GROUP_H
 
 #include <list>
 #include "GLViewer.h"
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
diff --git a/src/GLViewer/GLViewer_MimeData.cxx b/src/GLViewer/GLViewer_MimeData.cxx
new file mode 100644 (file)
index 0000000..1fbe5e9
--- /dev/null
@@ -0,0 +1,250 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  Author : OPEN CASCADE
+//#include <GLViewerAfx.h>
+//
+#include "GLViewer_MimeData.h"
+#include "GLViewer_BaseObjects.h"
+
+//#include <cmath>
+//using namespace std;
+
+/*!
+  Destructor
+*/
+GLViewer_MimeData::~GLViewer_MimeData()
+{
+}
+
+/*!
+  Translate objects to byte array
+  \param theObjects - list of objects
+*/
+bool GLViewer_MimeData::setObjects( QList<GLViewer_Object*> theObjects )
+{
+    if( !theObjects.empty() )
+    {
+        QStringList aObjectsType;
+        QList<QByteArray> aObjects;
+        QList<GLViewer_Object*>::const_iterator anIt = theObjects.begin();
+        QList<GLViewer_Object*>::const_iterator anEndIt = theObjects.end();
+
+        int aObjByteSize = 0;
+        for( ; anIt != anEndIt; anIt++ )
+        {
+            aObjects.append( (*anIt)->getByteCopy() );
+            aObjByteSize += aObjects.last().size();
+            aObjectsType.append( (*anIt)->getObjectType() );
+        }
+
+        int anISize = sizeof( int );
+        QString aTypes = aObjectsType.join("");
+        int aStrByteSize = aTypes.length();
+        int aObjNum = aObjects.count();
+
+        myByteArray.resize( anISize * (1 + 2*aObjNum) + aStrByteSize + aObjByteSize );
+
+        int anIndex = 0, j = 0;
+        char* aPointer = (char*)&aObjNum;
+        for( anIndex = 0; anIndex < anISize; anIndex++, aPointer++ )
+            myByteArray[anIndex] = *aPointer;
+        
+        QStringList::const_iterator aStrIt = aObjectsType.begin();
+        QStringList::const_iterator aEndStrIt = aObjectsType.end();
+        for( j = 1; aStrIt != aEndStrIt; aStrIt++, j++ )
+        {
+            int aStrLen = (*aStrIt).length();
+            aPointer = (char*)&aStrLen;
+            for( ; anIndex < anISize*( 1 + j ); anIndex++, aPointer++ )
+                myByteArray[anIndex] = *aPointer;
+        }
+
+        int aCurIndex = anIndex;
+        const char* aStr = aTypes.toLatin1().constData();
+
+        for( j = 0 ; anIndex < aCurIndex + aStrByteSize; aPointer++, anIndex++, j++ )
+            myByteArray[anIndex] = aStr[j];
+
+        aCurIndex = anIndex;
+        QList<QByteArray>::iterator anObjIt = aObjects.begin();
+        QList<QByteArray>::iterator anEndObjIt = aObjects.end();
+        for( j = 1; anObjIt != anEndObjIt; anObjIt++, j++ )
+        {
+            int aObjLen = (int)((*anObjIt).size());
+            aPointer = (char*)&aObjLen;
+            for( ; anIndex < aCurIndex + anISize*j; anIndex++, aPointer++ )
+                myByteArray[anIndex] = *aPointer;
+        }
+
+        aCurIndex = anIndex;
+        anObjIt = aObjects.begin();
+
+        for( ; anObjIt != anEndObjIt; anObjIt++ )
+        {
+            int aObjLen = (int)((*anObjIt).size());
+            for( j = 0 ; anIndex < aCurIndex + aObjLen; anIndex++, aPointer++, j++ )
+                myByteArray[anIndex] = (*anObjIt)[j];
+            aCurIndex = anIndex;
+        }
+     
+        return true;
+    }
+
+    return false;
+}
+
+/*!
+  Creates object by it's representation (byte array)
+  \param theArray - byte array
+  \param theType - type of object
+*/
+GLViewer_Object* GLViewer_MimeData::getObject( QByteArray theArray, QString theType )
+{
+    if( !theArray.isEmpty() )
+    {
+        if( theType == "GLViewer_MarkerSet" )
+        {
+            GLViewer_MarkerSet* aObject = new GLViewer_MarkerSet(  0, (float)0.0, 0  );
+            if( aObject->initializeFromByteCopy( theArray ) )
+                return aObject;
+        }
+        else if ( theType == "GLViewer_Polyline" )
+        {
+            GLViewer_Polyline* aObject = new GLViewer_Polyline( 0, (float)0.0, 0 );
+            if( aObject->initializeFromByteCopy( theArray ) )
+                return aObject;
+        }
+        else if( theType == "GLViewer_TextObject" )
+        {
+            GLViewer_TextObject* aObject = new GLViewer_TextObject( 0, 0, 0, QColor(255,255,255), 0 );
+            if( aObject->initializeFromByteCopy( theArray ) )
+                return aObject;
+        }
+    }        
+    
+    return NULL;
+}
+
+/*!
+  Creates list of objects by its representation (byte array)
+  \param theArray - byte array
+  \param theType - type of object
+*/
+QList<GLViewer_Object*> GLViewer_MimeData::getObjects( QByteArray theArray, QString theType )
+{
+    if( !theArray.isEmpty() )
+    {
+        int anISize = sizeof( int );
+        if( theType == "GLViewer_Objects" )
+        {
+            QStringList aTypeList;
+            QList<QByteArray> aObjects;
+            QList<GLViewer_Object*> aObjectList;
+
+            QList<int> aTypeSizeList;
+            QList<int> aObjSizeList;
+            int aObjNum = 0;
+            char* aPointer = (char*)&aObjNum;
+
+            int anIndex = 0, j = 0;
+            for( anIndex = 0; anIndex < anISize; anIndex++, aPointer++ )
+                *aPointer = theArray[anIndex];
+            
+            for( j = 0; j < aObjNum; j++ )
+            {
+                int aTempVal = 0;
+                aPointer = (char*)&aTempVal;
+                for( ; anIndex < anISize*(j+2); anIndex++, aPointer++ )
+                    *aPointer = theArray[anIndex];
+                aTypeSizeList.append( aTempVal );
+            }
+            
+            int aCurIndex = anIndex;
+            for( j = 0; j < aObjNum; j++ )
+            {
+                QString aTempStr;
+                for( ; anIndex < aCurIndex + aTypeSizeList[j]; anIndex++ )
+                {    
+                    char aLetter = theArray[anIndex];
+                    aTempStr.append( aLetter );
+                }
+                aTypeList.append( aTempStr );
+                aCurIndex = anIndex;
+            }
+
+            for( j = 0; j < aObjNum; j++ )
+            {
+                int aTempVal = 0;
+                aPointer = (char*)&aTempVal;
+                for( ; anIndex < aCurIndex + anISize*(j+1); anIndex++, aPointer++ )
+                    *aPointer = theArray[anIndex];
+                aObjSizeList.append( aTempVal );
+            }
+
+            aCurIndex = anIndex;
+            for( j = 0; j < aObjNum; j++ )
+            {
+                QByteArray aTempArray;
+               aTempArray.resize(aObjSizeList[j]);
+                for( ; anIndex < aCurIndex + aObjSizeList[j]; anIndex++ )
+                    aTempArray[anIndex-aCurIndex] = theArray[anIndex];
+                aObjects.append( aTempArray );
+                aCurIndex = anIndex;
+            }
+            
+            for( j = 0; j < aObjNum; j++ )
+                aObjectList.append( getObject( aObjects[j], aTypeList[j] ) );
+
+            return aObjectList;
+        }
+    }
+    
+    return QList<GLViewer_Object*>();    
+}
+
+/*!
+  \return format by index
+  \param theIndex - index
+*/
+const char* GLViewer_MimeData::format( int theIndex ) const
+{
+    switch( theIndex )
+    {
+    case 0: return "GLViewer_Objects";
+    //case 1: return "GLViewer_MarkerSet";
+    //case 2: return "GLViewer_Polyline";
+    //case 3: return "GLViewer_TextObject";
+    default: return 0;
+    }
+
+}
+
+/*!
+  \return internal byte array
+*/
+QByteArray GLViewer_MimeData::encodedData( const char* theObjectType ) const
+{
+    if( theObjectType == "GLViewer_Objects" )
+        return myByteArray;
+    
+    return QByteArray();
+}
diff --git a/src/GLViewer/GLViewer_MimeData.h b/src/GLViewer/GLViewer_MimeData.h
new file mode 100644 (file)
index 0000000..9dd6df8
--- /dev/null
@@ -0,0 +1,73 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  Author : OPEN CASCADE
+// File:      GLViewer_MimeData.h
+// Created:   November, 2004
+//
+#ifndef GLVIEWER_MIMEDATA_H
+#define GLVIEWER_MIMEDATA_H
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#include "GLViewer.h"
+
+#include <QMimeData>
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+class GLViewer_Object;
+
+/*! 
+  \class GLViewer_MimeData
+  Needs for a work with QClipboard
+*/
+class GLVIEWER_API GLViewer_MimeData: public QMimeData
+{
+public:
+  GLViewer_MimeData():QMimeData(){};
+  ~GLViewer_MimeData();
+  
+  //! Translate objects to byte array
+  bool                                setObjects( QList<GLViewer_Object*> );
+  //! Gets objects from byte array
+  /*If you want to use new class, following two method must be redefined*/
+  static QList<GLViewer_Object*>      getObjects( QByteArray, QString theType);
+  //! Get object from byte array
+  /*If you want to use new class, following two method must be redefined*/
+  static GLViewer_Object*             getObject( QByteArray, QString theType);
+  
+  const char*                         format( int theIndex = 0 ) const;
+  QByteArray                          encodedData( const char* ) const;
+  
+private:
+  QByteArray                          myByteArray;
+};
+
+#ifdef WIN32
+#pragma warning ( default:4251 )
+#endif
+
+#endif
diff --git a/src/GLViewer/GLViewer_MimeSource.cxx b/src/GLViewer/GLViewer_MimeSource.cxx
deleted file mode 100644 (file)
index ca82fba..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-//  Copyright (C) 2005 OPEN CASCADE
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  Author : OPEN CASCADE
-//
-
-//#include <GLViewerAfx.h>
-#include "GLViewer_MimeSource.h"
-#include "GLViewer_BaseObjects.h"
-
-//#include <cmath>
-//using namespace std;
-
-/*!
-  Destructor
-*/
-GLViewer_MimeSource::~GLViewer_MimeSource()
-{
-}
-
-/*!
-  Translate objects to byte array
-  \param theObjects - list of objects
-*/
-bool GLViewer_MimeSource::setObjects( QValueList<GLViewer_Object*> theObjects )
-{
-    if( !theObjects.empty() )
-    {
-        QStringList aObjectsType;
-        QValueList<QByteArray> aObjects;
-        QValueList<GLViewer_Object*>::const_iterator anIt = theObjects.begin();
-        QValueList<GLViewer_Object*>::const_iterator anEndIt = theObjects.end();
-
-        int aObjByteSize = 0;
-        for( ; anIt != anEndIt; anIt++ )
-        {
-            aObjects.append( (*anIt)->getByteCopy() );
-            aObjByteSize += aObjects.last().size();
-            aObjectsType.append( (*anIt)->getObjectType() );
-        }
-
-        int anISize = sizeof( int );
-        QString aTypes = aObjectsType.join("");
-        int aStrByteSize = aTypes.length();
-        int aObjNum = aObjects.count();
-
-        myByteArray = QByteArray( anISize * (1 + 2*aObjNum) + aStrByteSize + aObjByteSize );
-
-        int anIndex = 0, j = 0;
-        char* aPointer = (char*)&aObjNum;
-        for( anIndex = 0; anIndex < anISize; anIndex++, aPointer++ )
-            myByteArray[anIndex] = *aPointer;
-        
-        QStringList::const_iterator aStrIt = aObjectsType.begin();
-        QStringList::const_iterator aEndStrIt = aObjectsType.end();
-        for( j = 1; aStrIt != aEndStrIt; aStrIt++, j++ )
-        {
-            int aStrLen = (*aStrIt).length();
-            aPointer = (char*)&aStrLen;
-            for( ; anIndex < anISize*( 1 + j ); anIndex++, aPointer++ )
-                myByteArray[anIndex] = *aPointer;
-        }
-
-        int aCurIndex = anIndex;
-        const char* aStr = aTypes.data();
-
-        for( j = 0 ; anIndex < aCurIndex + aStrByteSize; aPointer++, anIndex++, j++ )
-            myByteArray[anIndex] = aStr[j];
-
-        aCurIndex = anIndex;
-        QValueList<QByteArray>::iterator anObjIt = aObjects.begin();
-        QValueList<QByteArray>::iterator anEndObjIt = aObjects.end();
-        for( j = 1; anObjIt != anEndObjIt; anObjIt++, j++ )
-        {
-            int aObjLen = (int)((*anObjIt).size());
-            aPointer = (char*)&aObjLen;
-            for( ; anIndex < aCurIndex + anISize*j; anIndex++, aPointer++ )
-                myByteArray[anIndex] = *aPointer;
-        }
-
-        aCurIndex = anIndex;
-        anObjIt = aObjects.begin();
-
-        for( ; anObjIt != anEndObjIt; anObjIt++ )
-        {
-            int aObjLen = (int)((*anObjIt).size());
-            for( j = 0 ; anIndex < aCurIndex + aObjLen; anIndex++, aPointer++, j++ )
-                myByteArray[anIndex] = (*anObjIt)[j];
-            aCurIndex = anIndex;
-        }
-     
-        return true;
-    }
-
-    return false;
-}
-
-/*!
-  Creates object by it's representation (byte array)
-  \param theArray - byte array
-  \param theType - type of object
-*/
-GLViewer_Object* GLViewer_MimeSource::getObject( QByteArray theArray, QString theType )
-{
-    if( !theArray.isEmpty() )
-    {
-        if( theType == "GLViewer_MarkerSet" )
-        {
-            GLViewer_MarkerSet* aObject = new GLViewer_MarkerSet(  0, (float)0.0, 0  );
-            if( aObject->initializeFromByteCopy( theArray ) )
-                return aObject;
-        }
-        else if ( theType == "GLViewer_Polyline" )
-        {
-            GLViewer_Polyline* aObject = new GLViewer_Polyline( 0, (float)0.0, 0 );
-            if( aObject->initializeFromByteCopy( theArray ) )
-                return aObject;
-        }
-        else if( theType == "GLViewer_TextObject" )
-        {
-            GLViewer_TextObject* aObject = new GLViewer_TextObject( 0, 0, 0, QColor(255,255,255), 0 );
-            if( aObject->initializeFromByteCopy( theArray ) )
-                return aObject;
-        }
-    }        
-    
-    return NULL;
-}
-
-/*!
-  Creates list of objects by its representation (byte array)
-  \param theArray - byte array
-  \param theType - type of object
-*/
-QValueList<GLViewer_Object*> GLViewer_MimeSource::getObjects( QByteArray theArray, QString theType )
-{
-    if( !theArray.isEmpty() )
-    {
-        int anISize = sizeof( int );
-        if( theType == "GLViewer_Objects" )
-        {
-            QStringList aTypeList;
-            QValueList<QByteArray> aObjects;
-            QValueList<GLViewer_Object*> aObjectList;
-
-            QValueList<int> aTypeSizeList;
-            QValueList<int> aObjSizeList;
-            int aObjNum = 0;
-            char* aPointer = (char*)&aObjNum;
-
-            int anIndex = 0, j = 0;
-            for( anIndex = 0; anIndex < anISize; anIndex++, aPointer++ )
-                *aPointer = theArray[anIndex];
-            
-            for( j = 0; j < aObjNum; j++ )
-            {
-                int aTempVal = 0;
-                aPointer = (char*)&aTempVal;
-                for( ; anIndex < anISize*(j+2); anIndex++, aPointer++ )
-                    *aPointer = theArray[anIndex];
-                aTypeSizeList.append( aTempVal );
-            }
-            
-            int aCurIndex = anIndex;
-            for( j = 0; j < aObjNum; j++ )
-            {
-                QString aTempStr;
-                for( ; anIndex < aCurIndex + aTypeSizeList[j]; anIndex++ )
-                {    
-                    char aLetter = theArray[anIndex];
-                    aTempStr.append( aLetter );
-                }
-                aTypeList.append( aTempStr );
-                aCurIndex = anIndex;
-            }
-
-            for( j = 0; j < aObjNum; j++ )
-            {
-                int aTempVal = 0;
-                aPointer = (char*)&aTempVal;
-                for( ; anIndex < aCurIndex + anISize*(j+1); anIndex++, aPointer++ )
-                    *aPointer = theArray[anIndex];
-                aObjSizeList.append( aTempVal );
-            }
-
-            aCurIndex = anIndex;
-            for( j = 0; j < aObjNum; j++ )
-            {
-                QByteArray aTempArray(aObjSizeList[j]);
-                for( ; anIndex < aCurIndex + aObjSizeList[j]; anIndex++ )
-                    aTempArray[anIndex-aCurIndex] = theArray[anIndex];
-                aObjects.append( aTempArray );
-                aCurIndex = anIndex;
-            }
-            
-            for( j = 0; j < aObjNum; j++ )
-                aObjectList.append( getObject( aObjects[j], aTypeList[j] ) );
-
-            return aObjectList;
-        }
-    }
-    
-    return QValueList<GLViewer_Object*>();    
-}
-
-/*!
-  \return format by index
-  \param theIndex - index
-*/
-const char* GLViewer_MimeSource::format( int theIndex ) const
-{
-    switch( theIndex )
-    {
-    case 0: return "GLViewer_Objects";
-    //case 1: return "GLViewer_MarkerSet";
-    //case 2: return "GLViewer_Polyline";
-    //case 3: return "GLViewer_TextObject";
-    default: return 0;
-    }
-
-}
-
-/*!
-  \return internal byte array
-*/
-QByteArray GLViewer_MimeSource::encodedData( const char* theObjectType ) const
-{
-    if( theObjectType == "GLViewer_Objects" )
-        return myByteArray;
-    
-    return QByteArray();
-}
diff --git a/src/GLViewer/GLViewer_MimeSource.h b/src/GLViewer/GLViewer_MimeSource.h
deleted file mode 100644 (file)
index 55262d1..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-//  Copyright (C) 2005 OPEN CASCADE
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  Author : OPEN CASCADE
-//
-
-// File:      GLViewer_MimeSource.h
-// Created:   November, 2004
-
-#ifndef GLVIEWER_MIMESOURCE_H
-#define GLVIEWER_MIMESOURCE_H
-
-#ifdef WNT
-#include <windows.h>
-#endif
-
-#include "GLViewer.h"
-
-#include <qmime.h>
-#include <qvaluelist.h>
-
-#ifdef WNT
-#pragma warning( disable:4251 )
-#endif
-
-class GLViewer_Object;
-
-/*! 
-  \class GLViewer_MimeSource
-  Needs for a work with QClipboard
-*/
-class GLVIEWER_API GLViewer_MimeSource: public QMimeSource
-{
-public:
-  GLViewer_MimeSource():QMimeSource(){};
-  ~GLViewer_MimeSource();
-  
-  //! Translate objects to byte array
-  bool                                setObjects( QValueList<GLViewer_Object*> );
-  //! Gets objects from byte array
-  /*If you want to use new class, following two method must be redefined*/
-  static QValueList<GLViewer_Object*> getObjects( QByteArray, QString theType);
-  //! Get object from byte array
-  /*If you want to use new class, following two method must be redefined*/
-  static GLViewer_Object*             getObject( QByteArray, QString theType);
-  
-  // Redefined methods
-  virtual const char*                 format( int theIndex = 0 ) const;
-  virtual QByteArray                  encodedData( const char* ) const;
-  
-private:
-  QByteArray                          myByteArray;
-};
-
-#ifdef WNT
-#pragma warning ( default:4251 )
-#endif
-
-#endif
index 7de98ed37321db2c9aaf99121c8a95bcc566f9a3..6afe3be259603e258319633ae88afe62bd2d3233 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_Object.h"
 #include "GLViewer_Drawer.h"
 #include "GLViewer_AspectLine.h"
-#include "GLViewer_Geom.h"
 #include "GLViewer_Text.h"
 #include "GLViewer_Group.h"
 
+#include <SUIT_DataOwner.h>
+
 //#include <cmath>
 //using namespace std;
 
@@ -141,8 +144,8 @@ QByteArray GLViewer_Object::getByteCopy()
     int i = 0;
     int anISize = sizeof( int );
 
-    const char* aTypeStr = myType.data();
-    const char* aToolTipStr = myToolTipText.data();
+    const char* aTypeStr = myType.toLatin1().constData();
+    const char* aToolTipStr = myToolTipText.toLatin1().constData();
 
     int aTypeLength = myType.length();
     int aToolTipLength = myToolTipText.length();
@@ -163,9 +166,10 @@ QByteArray GLViewer_Object::getByteCopy()
     
     int sizeOf8Float = sizeof( aRectData );
 
-    QByteArray aResult( 2*anISize + sizeOf8Float + 
-                        aTypeLength + aToolTipLength +
-                        aGLText.size() + aAspect.size() );
+    QByteArray aResult;
+    aResult.resize( 2*anISize + sizeOf8Float + 
+                   aTypeLength + aToolTipLength +
+                   aGLText.size() + aAspect.size() );
     // puts 8 float values into the byte array
     char* aPointer = (char*)&aRectData;
     for( i = 0; i < sizeOf8Float; i++, aPointer++ )
@@ -225,7 +229,9 @@ bool GLViewer_Object::initializeFromByteCopy( QByteArray theArray )
     GLViewer_AspectLine* aAspectLine = new GLViewer_AspectLine();
     int aGLAspLineSize = (aAspectLine->getByteCopy()).size();
 
-    QByteArray aGLTextArray, aAspect( aGLAspLineSize );
+    QByteArray aGLTextArray, aAspect;
+    aGLTextArray.resize( aGLAspLineSize );
+    aAspect.resize( aGLAspLineSize );
 
     if( aSize < 2*anISize + 8*aFSize + aGLTextMinSize + aGLAspLineSize )
         return false;
index 2384bb4408db88e3522320870621435e329c5c48..a694e88b691762421f0112db0c8fbd3108cc287e 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Object.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_OBJECT_H
 #define GLVIEWER_OBJECT_H
 
-#ifdef WNT
+#ifdef WIN32
 #include <windows.h>
 #endif
 
 #include "GLViewer.h"
-#include "GLViewer_Defs.h"
 #include "GLViewer_Geom.h"
 
-#include <SUIT_DataOwner.h>
-
 #include <GL/gl.h>
 
-#include <qfile.h>
-#include <qstring.h>
-#include <qrect.h>
+#include <QString>
+
+class QFile;
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -52,6 +50,8 @@ class GLViewer_CoordSystem;
 class GLViewer_Text;
 //class GLViewer_Owner;
 
+class SUIT_DataOwner;
+
 /*! 
  * Class GLViewer_Object
  * Base Object for all GLViewer objects
@@ -303,7 +303,7 @@ protected:
   GLViewer_Group*           myGroup;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 4e4c91aea3127bc7af36ecbc93241b9c38ade8ec..7700e5c4092916c7c23c2c6b10a552c89864cb94 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Selector.cxx
 // Created:   November, 2004
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_Selector.h"
 
 #include "GLViewer_Viewer.h"
 
-int GLViewer_Selector::apppendKey = Qt::ShiftButton;
+int GLViewer_Selector::apppendKey = Qt::ShiftModifier;
 
 /*!
     Constructor
index 6c0672843f44b5469784c03ce07c5e9a03059560..f5d4c94c229a48344b73fae13d791b115e424edd 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Selector.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_SELECTOR_H
 #define GLVIEWER_SELECTOR_H
 
 #include "GLViewer.h"
 #include "GLViewer_Defs.h"
 
-#include <qsize.h>
-#include <qobject.h>
+#include <QSize>
+#include <QObject>
+
+class QRect;
 
 #include <Quantity_NameOfColor.hxx>
 
index 067b2954156ef7a6f33de4346c093f73c1f52b88..3d925dfff5bc48c76d9bd3967a30bb816b6dc82a 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Selector2d.cxx
 // Created:   November, 2004
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_Selector2d.h"
 #include "GLViewer_Viewer2d.h"
 #include "GLViewer_Context.h"
-#include "GLViewer_ViewPort2d.h"
+#include "GLViewer_ViewPort.h"
+#include "GLViewer_ViewFrame.h"
 
 /*!
   Constructor
index 34da93d590e1cf4f6cc03f5e5eb617c546dcd273..e5cd153106795e755f989e636dcb98e8bca66322 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Selector2d.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_SELECTOR2D_H
 #define GLVIEWER_SELECTOR2D_H
 
-#ifdef WNT
+#ifdef WIN32
 #include "windows.h"
 #endif
 
index f4dba3a4790e0a4b5c2d0b8d8fcce1e9ccf696c7..26e03eb7dc4dbf4322d1851b12ff9626effe8079 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_Text.h"
 
+#include <QApplication>
+#include <QFontMetrics>
+
 /*!
   Constructor
 */
@@ -31,7 +36,7 @@ GLViewer_Text::GLViewer_Text( const QString& text, float xPos, float yPos, const
   myXPos = xPos;
   myYPos = yPos;
   myColor = color;
-  myQFont = QFont::defaultFont();
+  myQFont = QApplication::font();//QFont::defaultFont();
   mySeparator = 2;
   myDTF = DTF_BITMAP;
 }
@@ -90,10 +95,11 @@ QByteArray GLViewer_Text::getByteCopy() const
     int aR = myColor.red();
     int aG = myColor.green();
     int aB = myColor.blue();
-    const char* aStr = myText.data();
+    const char* aStr = myText.toLatin1().constData();
 
     int anISize = sizeof( int );    
-    QByteArray aResult( aSize );
+    QByteArray aResult;
+    aResult.resize( aSize );
 
     char* aPointer = (char*)&myXPos;
     for( i = 0; i < anISize; i++, aPointer++ )
@@ -124,7 +130,7 @@ QByteArray GLViewer_Text::getByteCopy() const
     for( ; i < 7*anISize + aTextSize; i++, aPointer++ )
         aResult[i] = *aPointer;
 
-    const char* aFontStr = myQFont.toString().data();
+    const char* aFontStr = myQFont.toString().toLatin1().constData();
     int aFontSize = myQFont.toString().length();
 
     for( i = 0; i < aFontSize; i++ )
index edf680e7b1245e7150d4e3126d3bcb67ece40bcb..9dc2869f63aae2653f1a2739c85dc69626254fb8 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Text.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_TEXT_H
 #define GLVIEWER_TEXT_H
 
-#ifdef WNT
+#ifdef WIN32
 #include <windows.h>
 #endif
 
 
 #include <GL/gl.h>
 
-#include <qfont.h>
-#include <qstring.h>
-#include <qcolor.h>
-#include <qfontmetrics.h>
+#include <QFont>
+#include <QString>
+#include <QColor>
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -107,7 +107,7 @@ protected:
   DisplayTextFormat  myDTF;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index c4449265c58e94bf4753629419fce9604c12a124..0397cb1224b414df0e2628a02d66efbb8406ff95 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_ToolTip.xx
 // Created:   March, 2005
-
 //#include "GLViewerAfx.h"
+//
 #include "GLViewer_Context.h"
 #include "GLViewer_ToolTip.h"
 #include "GLViewer_Viewer2d.h"
 #include "GLViewer_ViewPort2d.h"
+#include "GLViewer_ViewFrame.h"
 
-#include <qlabel.h>
-#include <qtimer.h>
-#include <qbitmap.h>
-#include <qapplication.h>
-#include <qtooltip.h>
+#include <QLabel>
+#include <QTimer>
+#include <QBitmap>
+#include <QApplication>
+#include <QToolTip>
+#include <QMouseEvent>
 
 /*!
   constructor
@@ -44,15 +47,16 @@ GLViewer_ObjectTip::GLViewer_ObjectTip( GLViewer_ViewPort2d* theParent )
 {
   mypViewPort = theParent;
   //mypLabel = NULL;
-  mypLabel = new QLabel( "Test", NULL, "ObjectTipText",
-            WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM );
-       mypLabel->setMargin( 1 );
-       mypLabel->setAutoMask( FALSE );
+  mypLabel = new QLabel( "Test", NULL, 
+                        Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint );
+  mypLabel->setObjectName("ObjectTipText");
+  mypLabel->setMargin( 1 );
+  //mypLabel->setAutoMask( FALSE );
   mypLabel->setFrameStyle( QFrame::Plain | QFrame::Box );
   mypLabel->setLineWidth( 1 );
-  mypLabel->setAlignment( AlignAuto | AlignTop );
+  mypLabel->setAlignment( Qt::AlignAbsolute | Qt::AlignTop );
   mypLabel->setIndent( 0 );
-  mypLabel->polish();
+  mypLabel->ensurePolished();
   
   //mypLabel->setPalette( QToolTip::palette() );
 
index 508679b6a163eff76b015709ecd7737a910b6160..fc81dfe27a3504dc36f15408a826e669d2e35737 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_ToolTip.h
 // Created:   March, 2005
-
+//
 #ifndef GLVIEWER_TOOLTIP_H
 #define GLVIEWER_TOOLTIP_H
 
 
 //#include <qtooltip.h>
 //#include <QtxToolTip.h>
-#include <qobject.h>
+#include <QObject>
+#include <QPoint>
 
 #define TIP_TIME            1000
 
 class GLViewer_ViewPort2d;
 class QLabel;
+class QTimer;
 /*!
   \class GLViewer_ObjectTip
   ToolTip of GLViewer_Objects
index 1f270a253f9bff75c83d254c7021b4b265eb426e..ffc2098e98dd20d17badd2422b8a9ab003ac0c79 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Tools.cxx
 // Created:   April, 2005
-
+//
 #include "GLViewer_Tools.h"
 
 #include <GL/gl.h>
 
 #include <iostream>
+#include <string.h>
 
 /*!
   Constructor
index b9add1f19fceab755b5bdd572e75f9bef23156c2..222c27052640bc72b437746ee4c3b265b1401bc7 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Tools.h
 // Created:   April, 2005
-
+//
 #ifndef GLVIEWER_TOOLS_H
 #define GLVIEWER_TOOLS_H
 
-#ifdef WNT
+#ifdef WIN32
 #include "windows.h"
 #endif
 
 #include "GLViewer.h"
-#include "GLViewer_Defs.h"
-
-class GLViewer_LineField;
 
 /*!
   \class GLViewer_Tools 
index d89922d48ed8b57249067d13789049393a6e8d1d..b52bdb69f1a7bf5acf51acd3b1c5c14965c5bdea 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_ViewFrame.cxx
 // Created:   November, 2004
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_ViewFrame.h"
 #include "GLViewer_Viewer.h"
-#include "GLViewer_Viewer2d.h"
 #include "GLViewer_ViewPort2d.h"
 
+#include <QtxToolBar.h>
+#include <QtxMultiAction.h>
+#include <QtxActionToolMgr.h>
+
 #include <SUIT_Desktop.h>
 #include <SUIT_Session.h>
-#include <SUIT_ToolButton.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_MessageBox.h>
 
-#include <qcolor.h>
-#include <qfiledialog.h>
-#include <qimage.h>
-#include <qlayout.h>
-#include <qstring.h>
+#include <QColor>
+#include <QFileDialog>
+#include <QImage>
+#include <QHBoxLayout>
+#include <QString>
+#include <QFrame>
+#include <QMouseEvent>
+#include <QKeyEvent>
+#include <QWheelEvent>
+
+#ifdef WIN32
+#include <Standard_Integer.hxx>
+#include <iostream>
+using namespace std;
+#endif
 
 /*!
     Constructor
@@ -48,22 +61,18 @@ GLViewer_ViewFrame::GLViewer_ViewFrame( SUIT_Desktop* d, GLViewer_Viewer* vw )
 myViewer( vw ),
 myVP( 0 )
 {
-    QFrame* client = new QFrame( this );    
+    QFrame* client = new QFrame( this );
     setCentralWidget( client );
 
-    QBoxLayout* layout = new QHBoxLayout( client, 1, 1 );
-    layout->setAutoAdd( true );
+    QBoxLayout* layout = new QHBoxLayout( client );
+    layout->setMargin( 0 );
+    layout->setSpacing( 0 );
 
     GLViewer_ViewPort2d* vp = new GLViewer_ViewPort2d( client, this );
-    //vp->turnGrid( true );
-    //vp->turnCompass( true );
-    //vp->enablePopup( false );
     setViewPort( vp );
     setBackgroundColor( Qt::white );
+    layout->addWidget( vp );
 
-    myToolBar = new QToolBar(this);
-    myToolBar->setCloseMode(QDockWindow::Undocked);
-    myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
     createActions();
     createToolBar();
 }
@@ -80,64 +89,63 @@ GLViewer_ViewFrame::~GLViewer_ViewFrame()
 */
 void GLViewer_ViewFrame::createActions()
 {
-  if (!myActionsMap.isEmpty()) return;
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-  QAction* aAction;
+  QtxAction* aAction;
 
   // Dump view
-  aAction = new QAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_DUMP" ) ),
-                           tr( "MNU_DUMP_VIEW" ), 0, this);
+  aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_DUMP" ) ),
+                         tr( "MNU_DUMP_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_DUMP_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onViewDump()));
-  myActionsMap[ DumpId ] = aAction;
+  connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView()));
+  toolMgr()->registerAction( aAction, DumpId );
 
   // FitAll
-  aAction = new QAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITALL" ) ),
-                           tr( "MNU_FITALL" ), 0, this);
+  aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITALL" ) ),
+                         tr( "MNU_FITALL" ), 0, this);
   aAction->setStatusTip(tr("DSC_FITALL"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitAll()));
-  myActionsMap[ FitAllId ] = aAction;
+  toolMgr()->registerAction( aAction, FitAllId );
 
   // FitRect
-  aAction = new QAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITAREA" ) ),
-                           tr( "MNU_FITRECT" ), 0, this);
+  aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITAREA" ) ),
+                         tr( "MNU_FITRECT" ), 0, this);
   aAction->setStatusTip(tr("DSC_FITRECT"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitArea()));
-  myActionsMap[ FitRectId ] = aAction;
+  toolMgr()->registerAction( aAction, FitRectId );
 
   // FitSelect
-  aAction = new QAction(tr("MNU_FITSELECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITSELECT" ) ),
-                           tr( "MNU_FITSELECT" ), 0, this);
+  aAction = new QtxAction(tr("MNU_FITSELECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITSELECT" ) ),
+                         tr( "MNU_FITSELECT" ), 0, this);
   aAction->setStatusTip(tr("DSC_FITSELECT"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitSelect()));
-  myActionsMap[ FitSelectId ] = aAction;
+  toolMgr()->registerAction( aAction, FitSelectId );
 
   // Zoom
-  aAction = new QAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_ZOOM" ) ),
-                           tr( "MNU_ZOOM_VIEW" ), 0, this);
+  aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_ZOOM" ) ),
+                         tr( "MNU_ZOOM_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewZoom()));
-  myActionsMap[ ZoomId ] = aAction;
+  toolMgr()->registerAction( aAction, ZoomId );
 
   // Panning
-  aAction = new QAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_PAN" ) ),
-                           tr( "MNU_PAN_VIEW" ), 0, this);
+  aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_PAN" ) ),
+                         tr( "MNU_PAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_PAN_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
-  myActionsMap[ PanId ] = aAction;
+  toolMgr()->registerAction( aAction, PanId );
 
   // Global Panning
-  aAction = new QAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_GLOBALPAN" ) ),
-                           tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
+  aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_GLOBALPAN" ) ),
+                         tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewGlobalPan()));
-  myActionsMap[ GlobalPanId ] = aAction;
+  toolMgr()->registerAction( aAction, GlobalPanId );
 
-  aAction = new QAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_RESET" ) ),
-                           tr( "MNU_RESET_VIEW" ), 0, this);
+  aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_RESET" ) ),
+                         tr( "MNU_RESET_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_RESET_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
-  myActionsMap[ ResetId ] = aAction;
+  toolMgr()->registerAction( aAction, ResetId );
 }
 
 /*!
@@ -145,19 +153,22 @@ void GLViewer_ViewFrame::createActions()
 */
 void GLViewer_ViewFrame::createToolBar()
 {
-  myActionsMap[DumpId]->addTo(myToolBar);
-
-  SUIT_ToolButton* aScaleBtn = new SUIT_ToolButton(myToolBar);
-  aScaleBtn->AddAction(myActionsMap[FitAllId]);
-  aScaleBtn->AddAction(myActionsMap[FitRectId]);
-  aScaleBtn->AddAction(myActionsMap[FitSelectId]);
-  aScaleBtn->AddAction(myActionsMap[ZoomId]);
-
-  SUIT_ToolButton* aPanBtn = new SUIT_ToolButton(myToolBar);
-  aPanBtn->AddAction(myActionsMap[PanId]);
-  aPanBtn->AddAction(myActionsMap[GlobalPanId]);
-
-  myActionsMap[ResetId]->addTo(myToolBar);
+  int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL") );
+  toolMgr()->append( DumpId, tid );
+
+  QtxMultiAction* aScaleAction = new QtxMultiAction( this );
+  aScaleAction->insertAction( toolMgr()->action( FitAllId ) );
+  aScaleAction->insertAction( toolMgr()->action( FitRectId ) );
+  aScaleAction->insertAction( toolMgr()->action( FitSelectId ) );
+  aScaleAction->insertAction( toolMgr()->action( ZoomId ) );
+  toolMgr()->append( aScaleAction, tid );
+
+  QtxMultiAction* aPanAction = new QtxMultiAction( this );
+  aPanAction->insertAction( toolMgr()->action( PanId ) );
+  aPanAction->insertAction( toolMgr()->action( GlobalPanId ) );
+  toolMgr()->append( aPanAction, tid );
+
+  toolMgr()->append( toolMgr()->action( ResetId ), tid );
 }
 
 /*!
@@ -213,7 +224,7 @@ QColor GLViewer_ViewFrame::backgroundColor() const
 {
     if ( myVP )
         return myVP->backgroundColor();
-    return QMainWindow::backgroundColor();
+    return palette().color( backgroundRole() );
 }
 
 /*!
@@ -257,189 +268,16 @@ void GLViewer_ViewFrame::onUpdate( int )
 /*!
   SLOT: called on dump view operation is activated, stores scene to raster file
 */
-void GLViewer_ViewFrame::onViewDump()
-{
-    GLViewer_Widget* aWidget = ((GLViewer_ViewPort2d*)myVP)->getGLWidget();
-    int width, height;
-    width = aWidget->width();
-    height = aWidget->height();
-    
-    int imageSize = width*height*3;
-    unsigned char* imageBits = NULL;
-
-    int reserve_bytes = width % 4; //32 bits platform
-    imageSize = (width+reserve_bytes)*height*3;
-    imageBits = new unsigned char[imageSize];
-
-    
-#ifdef WNT
-
-    int num;
-    HBITMAP hBmp;
-    HDC hdc_old, hdc;
-    HGLRC hglrc_old, hglrc;
-
-    BITMAPINFO bi;
-
-    hglrc_old = wglGetCurrentContext();
-    hdc_old = wglGetCurrentDC();
-
-    hdc = CreateCompatibleDC( hdc_old );
-    if( !hdc )
-    {
-        cout << "Can't create compatible DC. Last Error Code: " << GetLastError() << endl;
-        return;
-    }
-
-    int sizeBmi = Standard_Integer( sizeof(BITMAPINFO) + sizeof(RGBQUAD)*3 );
-    PBITMAPINFO pBmi = (PBITMAPINFO)( new char[sizeBmi] );
-    ZeroMemory( pBmi, sizeBmi );
-
-    pBmi->bmiHeader.biSize        = sizeof( BITMAPINFOHEADER ); //sizeBmi
-    pBmi->bmiHeader.biWidth       = width;
-    pBmi->bmiHeader.biHeight      = height;
-    pBmi->bmiHeader.biPlanes      = 1;
-    pBmi->bmiHeader.biBitCount    = 24;
-    pBmi->bmiHeader.biCompression = BI_RGB;
-
-    LPVOID ppvBits;
-    hBmp = CreateDIBSection ( hdc, pBmi, DIB_RGB_COLORS, &ppvBits, NULL, 0 );
-    SelectObject ( hdc, hBmp );
-    delete[] pBmi;
-
-    PIXELFORMATDESCRIPTOR pfd;
-    ZeroMemory( &pfd, sizeof( PIXELFORMATDESCRIPTOR ) );
-    pfd.nSize      = sizeof( PIXELFORMATDESCRIPTOR );
-    pfd.nVersion   = 1;
-    pfd.dwFlags    = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_BITMAP;
-    pfd.iPixelType = PFD_TYPE_RGBA;
-    pfd.cColorBits = 24;
-    pfd.cDepthBits = 32;
-    pfd.iLayerType = PFD_MAIN_PLANE;
-
-    int iPf = ChoosePixelFormat( hdc, &pfd);    
-    if( iPf == 0 )
-    {
-        if ( !DescribePixelFormat ( hdc, iPf, sizeof(PIXELFORMATDESCRIPTOR), &pfd ) )
-        {
-            cout << "Can't describe Pixel Format. Last Error Code: " << GetLastError() << endl;
-        }
-    }
-    if ( !SetPixelFormat(hdc, iPf, &pfd) )
-    {
-        cout << "Can't set Pixel Format. Last Error Code: " << GetLastError() << endl;
-    }
-
-    hglrc = wglCreateContext( hdc );
-    if( !hglrc )
-    {
-        cout << "Can't create new GL Context. Last Error Code: " << GetLastError() << endl;
-        return;
-    }
-    if( !wglMakeCurrent( hdc, hglrc) )
-    {
-        cout << "Can't make current new context!" << endl;
-        return;
-    }
-    
-    glViewport( 0, 0, width, height );
-
-    glMatrixMode( GL_PROJECTION );
-    glLoadIdentity();
-    GLfloat w_c = width / 2., h_c = height / 2.; 
 
-    gluOrtho2D( -w_c, w_c, -h_c, h_c ); 
-
-    glMatrixMode( GL_MODELVIEW );
-    glLoadIdentity();
-
-    //set background
-    QColor aColor = ((GLViewer_ViewPort2d*)myVP)->backgroundColor();
-    glClearColor( ( GLfloat )aColor.red() / 255,
-                  ( GLfloat )aColor.green() / 255,
-                  ( GLfloat )aColor.blue() / 255,
-                  1.0 );
-
-    aWidget->exportRepaint();
-
-      memset(&bi, 0, sizeof(BITMAPINFOHEADER));
-    bi.bmiHeader.biSize        = sizeof(BITMAPINFOHEADER);
-    bi.bmiHeader.biPlanes      = 1;
-    bi.bmiHeader.biBitCount    = 24;
-    bi.bmiHeader.biHeight      = -height;
-    bi.bmiHeader.biWidth       = width;
-    bi.bmiHeader.biCompression = BI_RGB;
-
-    num = GetDIBits(hdc, hBmp, 0, height, imageBits, &bi, DIB_RGB_COLORS);
-
-    wglMakeCurrent( hdc_old, hglrc_old );
-    wglDeleteContext( hglrc );
-    
-
-#else //XWindows
-#endif
-
-    unsigned int* aPix = NULL;
-    QImage  anImage( width, height, 32 );
-    for( int i = 0; i < height; i++ )
-    {
-        memset( anImage.scanLine( i ), 0, sizeof(unsigned int)*width );
-        unsigned char* pos;
-        for( int j = 0; j < width; j++ )
-        {
-            pos = imageBits + i*width*3 + j*3 + reserve_bytes*i;
-            aPix = (unsigned int*)anImage.scanLine(i)+j;
-            *aPix = qRgb( *pos, *(pos+1), *(pos+2) );
-        }
-    }
-
-    delete [] imageBits;
-
-    QString aFilter( "*.bmp\n*.png" );
-
-    QFileDialog aFileDlg( QDir::current().absPath(), aFilter, this );
-    aFileDlg.setCaption( tr( "DUMP_VIEW_SAVE_FILE_DLG_CAPTION" ) );
-    aFileDlg.setMode( QFileDialog::AnyFile );
-
-    if( !aFileDlg.exec() )
-        return;
-
-    QString aFileName = aFileDlg.selectedFile();
-    QString aFileExt = aFileDlg.selectedFilter();
-
-    if( aFileName.isEmpty() )
-    {
-        SUIT_MessageBox::error1( this,
-                                tr( "DUMP_VIEW_ERROR_DLG_CAPTION" ),
-                                tr( "DUMP_VIEW_ERROR_DLG_TEXT" ),
-                                tr( "BUT_OK" ) );
-    }
+QImage GLViewer_ViewFrame::dumpView()
+{
+  QImage img;
 
-    QString aSaveOp = "BMP";
-    QString aTypedFileExt = QFileInfo( aFileName ).extension( false ).lower();
+  GLViewer_Widget* aWidget = ((GLViewer_ViewPort2d*)myVP)->getGLWidget();
+  if ( aWidget )
+    img = aWidget->grabFrameBuffer();
 
-    if( aFileExt == "*.bmp" )
-    {
-        if( aTypedFileExt.isEmpty() )
-            aFileName += ".bmp";
-        aSaveOp = "BMP";
-    }
-    else if( aFileExt == "*.png" )
-        if( aTypedFileExt.isEmpty() )
-            aFileName += ".png";
-        aSaveOp = "PNG";
-
-//#ifdef WNT
-//    if( !anImage.save( aFileName, aSaveOp ) )
-//#else
-    if( !aWidget->grabFrameBuffer().save( aFileName, aSaveOp ) )
-//#endif
-    {
-        SUIT_MessageBox::error1( this,
-                                tr( "DUMP_VIEW_ERROR_DLG_CAPTION" ),
-                                tr( "DUMP_VIEW_ERROR_DLG_TEXT" ),
-                                tr( "BUT_OK" ) );
-    }
+  return img;
 }
 
 /*!
@@ -470,7 +308,7 @@ void GLViewer_ViewFrame::onViewFitAll()
   Start fit area
 */
 void GLViewer_ViewFrame::onViewFitArea()
-{ 
+{
     myViewer->activateTransform( GLViewer_Viewer::FitRect );
 }
 
@@ -478,7 +316,7 @@ void GLViewer_ViewFrame::onViewFitArea()
   Start fit selected
 */
 void GLViewer_ViewFrame::onViewFitSelect()
-{ 
+{
     myViewer->activateTransform( GLViewer_Viewer::FitSelect );
 }
 
@@ -486,7 +324,7 @@ void GLViewer_ViewFrame::onViewFitSelect()
   Start global panning
 */
 void GLViewer_ViewFrame::onViewGlobalPan()
-{ 
+{
     myViewer->activateTransform( GLViewer_Viewer::PanGlobal );
 }
 
@@ -494,7 +332,7 @@ void GLViewer_ViewFrame::onViewGlobalPan()
   Start rotating
 */
 void GLViewer_ViewFrame::onViewRotate()
-{ 
+{
     //myViewer->activateTransform( GLViewer_Viewer::Rotate );
 }
 
@@ -502,11 +340,11 @@ void GLViewer_ViewFrame::onViewRotate()
   Start reset default view aspects
 */
 void GLViewer_ViewFrame::onViewReset()
-{ 
+{
     myViewer->activateTransform( GLViewer_Viewer::Reset );
 }
-/*! 
+
+/*!
   Dispatches mouse events
 */
 void GLViewer_ViewFrame::mouseEvent( QMouseEvent* e )
@@ -584,7 +422,7 @@ QString GLViewer_ViewFrame::getVisualParameters()
 */
 void GLViewer_ViewFrame::setVisualParameters( const QString& parameters )
 {
-  QStringList paramsLst = QStringList::split( '*', parameters, true );
+  QStringList paramsLst = parameters.split( '*' );
   if ( myVP && myVP->inherits( "GLViewer_ViewPort2d" ) && paramsLst.size() == 4) {
     GLViewer_ViewPort2d* vp2d = (GLViewer_ViewPort2d*)myVP;
 
index 76b9fe55b7ff9bdfdb98f7dbc2b070d882349f1e..86cb9ccf73c8384922ad82e7f32d25bbe1031246 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_ViewFrame.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_VIEWFRAME_H
 #define GLVIEWER_VIEWFRAME_H
 
@@ -35,9 +36,9 @@ class SUIT_Desktop;
 class GLViewer_Viewer;
 class GLViewer_ViewPort;
 
-#include <qaction.h>
+#include <QtxAction.h>
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -49,79 +50,75 @@ class GLViewer_ViewPort;
 class GLVIEWER_API GLViewer_ViewFrame: public SUIT_ViewWindow
 {
   Q_OBJECT
-    
+
+public:
+  //! Actions ID
+  enum { DumpId, FitAllId, FitRectId, FitSelectId, ZoomId, PanId, GlobalPanId, ResetId };
+
 public:
   GLViewer_ViewFrame( SUIT_Desktop* , GLViewer_Viewer* );
   ~GLViewer_ViewFrame();
-  
-public:  
+
+public:
   void                    setViewer( GLViewer_Viewer* );
   GLViewer_Viewer*        getViewer() const;
-  
+
   void                    setViewPort( GLViewer_ViewPort* );
   GLViewer_ViewPort*      getViewPort() const;
-  
+
   void                    setBackgroundColor( const QColor& );
   QColor                  backgroundColor() const;
-  
+
   QSize                   sizeHint() const;
-  
+
   virtual void            onUpdate( int );
 
   virtual QString         getVisualParameters();
-  virtual void            setVisualParameters( const QString& parameters );  
-  
+  virtual void            setVisualParameters( const QString& parameters );
+
+  virtual QImage          dumpView();
+
 signals:
   void                    vfDrawExternal( QPainter* );
   void                    vfViewClosing( QCloseEvent* );
-  
+
 protected:
   GLViewer_Viewer*        myViewer;
   GLViewer_ViewPort*      myVP;
-  
+
 public:
-  //ViewType       getTypeView() const { return VIEW_GL; }; 
+  //ViewType       getTypeView() const { return VIEW_GL; };
   QWidget*       getViewWidget() { return ( QWidget* )getViewPort(); };
-  
+
 protected slots:
-  void           onViewDump();
   void           onViewPan();
   void           onViewZoom();
   void           onViewFitAll();
   void           onViewFitArea();
   void           onViewFitSelect();
-  void           onViewGlobalPan(); 
+  void           onViewGlobalPan();
   void           onViewRotate();
   void           onViewReset();
-  void           onViewFront() {}; 
-  void           onViewBack() {}; 
-  void           onViewRight() {}; 
-  void           onViewLeft() {};     
+  void           onViewFront() {};
+  void           onViewBack() {};
+  void           onViewRight() {};
+  void           onViewLeft() {};
   void           onViewBottom() {};
   void           onViewTop() {};
-  void           onViewTrihedron() {}; 
-  
+  void           onViewTrihedron() {};
+
 private slots:
   void           keyEvent( QKeyEvent* );
   void           mouseEvent( QMouseEvent* );
   void           wheelEvent( QWheelEvent* );
-  
+
 private:
   void           createActions();
   void           createToolBar();
-  
-private:
-  //! Actions ID
-  enum { DumpId, FitAllId, FitRectId, FitSelectId, ZoomId, PanId, GlobalPanId, ResetId };
-  typedef QMap<int, QAction*> ActionsMap;
-  
-private:
-  ActionsMap       myActionsMap;
-  QToolBar*        myToolBar;
 };
 
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 8e1f1e860f69d761d704a7db5d0972594b534e88..60ddf0df54743f28156d34d9e7544d383e572da6 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_ViewManager.cxx
 // Created:   November, 2004
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_ViewManager.h"
-#include "GLViewer_ViewFrame.h"
 #include "GLViewer_Viewer2d.h"
 #include "SUIT_Desktop.h"
 
@@ -41,7 +41,7 @@ GLViewer_ViewManager::~GLViewer_ViewManager()
 }
 
 /*!Context menu popup for \a popup.*/
-void GLViewer_ViewManager::contextMenuPopup( QPopupMenu* popup )
+void GLViewer_ViewManager::contextMenuPopup( QMenu* popup )
 {
   SUIT_ViewManager::contextMenuPopup( popup );
   // if it is necessary invoke method CreatePopup of ViewPort
index 3542d63f35cf876df4333af606660068c24c13ec..65652d49dadceea1cbb60a5e15097f69b5e555fc 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_ViewManager.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_VIEWMANAGER_H
 #define GLVIEWER_VIEWMANAGER_H
 
@@ -40,7 +41,7 @@ public:
 
     GLViewer_Viewer* getGLViewer() { return (GLViewer_Viewer*) myViewModel; }
 
-    virtual void     contextMenuPopup( QPopupMenu* );
+    virtual void     contextMenuPopup( QMenu* );
 };
 
 #endif // GLVIEWER_VIEWMANAGER_H
index 07de20242a8ef9fbbe646db28c398f7255aa9c25..699d245a6bd717e4ccacbc02ad2cf2a740e1d499 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_ViewPort.cxx
 // Created:   November, 2004
-
 //#include <GLViewerAfx.h>
-
-#if !(defined WNT) && !(defined QT_CLEAN_NAMESPACE)
-#define QT_CLEAN_NAMESPACE         /* avoid definition of INT32 and INT8 */
-#endif
-
+//
 #include "GLViewer_ViewPort.h"
 
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_Session.h"
 
-#include <qrect.h>
-#include <qcursor.h>
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qintdict.h>
-#include <qpopupmenu.h>
-#include <qcolordialog.h>
+#include <QRect>
+#include <QCursor>
+#include <QPainter>
+#include <QMultiHash>
+//#include <QMenu>
+#include <QColorDialog>
+#include <QColormap>
+#include <QMouseEvent>
+#include <QCoreApplication>
 
 #include <stdlib.h>
 
-#if !defined WNT
+#if !defined WIN32
+#include <QX11Info>
 #include <GL/glx.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -83,17 +82,19 @@ CMapEntry::CMapEntry()
 CMapEntry::~CMapEntry()
 {
     if ( alloc )
-        XFreeColormap( QPaintDevice::x11AppDisplay(), cmap );
+        XFreeColormap( QX11Info::display(), cmap );
 }
 
-static QIntDict<CMapEntry> *cmap_dict = 0;
+static QMultiHash<int,CMapEntry> *cmap_dict = 0;
 static bool mesa_gl = false;
 
 static void cleanup_cmaps()
 {
     if ( !cmap_dict )
         return;
-    cmap_dict->setAutoDelete( true );
+    //while (!cmap_dict->isEmpty())
+    //  cmap_dict->erase(cmap_dict->begin());
+    cmap_dict->clear();
     delete cmap_dict;
     cmap_dict = 0;
 }
@@ -102,17 +103,17 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
 {
     if ( !cmap_dict )
     {
-        cmap_dict = new QIntDict<CMapEntry>;
+        cmap_dict = new QMultiHash<int,CMapEntry>;
         const char *v = glXQueryServerString( dpy, vi->screen, GLX_VERSION );
         mesa_gl = strstr( v,"Mesa" ) != 0;
         qAddPostRoutine( cleanup_cmaps );
     }
 
-    CMapEntry *x = cmap_dict->find( (long)vi->visualid );
-    if ( x )                    // found colormap for visual
-        return x->cmap;
+    QHash<int,CMapEntry>::iterator itH = cmap_dict->find( (long)vi->visualid );
+    if ( itH != cmap_dict->end() )  // found colormap for visual
+        return itH.value().cmap;
 
-    x = new CMapEntry();
+    CMapEntry x;
 
     XStandardColormap *c;
     int n, i;
@@ -121,12 +122,12 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
     cout << "Choosing cmap for vID = " << vi->visualid << endl;
 #endif
 
-    if ( vi->visualid == XVisualIDFromVisual( (Visual*)QPaintDevice::x11AppVisual() ) )
+    if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
     {
 #ifdef DEBUG
         cout << "Using x11AppColormap" << endl;
 #endif
-        return QPaintDevice::x11AppColormap();
+        return QX11Info::appColormap();
     }
 
     if ( mesa_gl )
@@ -137,12 +138,12 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
             if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, hp_cmaps ) )
             {
                 i = 0;
-                while ( i < n && x->cmap == 0 )
+                while ( i < n && x.cmap == 0 )
                 {
                     if ( c[i].visualid == vi->visual->visualid )
                     {
-                        x->cmap = c[i].colormap;
-                        x->scmap = c[i];
+                        x.cmap = c[i].colormap;
+                        x.scmap = c[i];
                     }
                     i++;
                 }
@@ -151,19 +152,19 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
         }
     }
 #if !defined( _OS_SOLARIS_ )
-    if ( !x->cmap )
+    if ( !x.cmap )
     {
         if ( XmuLookupStandardColormap( dpy, vi->screen, vi->visualid, vi->depth, XA_RGB_DEFAULT_MAP, false, true ) )
         {
             if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, XA_RGB_DEFAULT_MAP ) )
             {
                 i = 0;
-                while ( i < n && x->cmap == 0 )
+                while ( i < n && x.cmap == 0 )
                 {
                     if ( c[i].visualid == vi->visualid )
                     {
-                        x->cmap = c[i].colormap;
-                        x->scmap = c[i];
+                        x.cmap = c[i].colormap;
+                        x.scmap = c[i];
                     }
                     i++;
                 }
@@ -172,15 +173,15 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
         }
     }
 #endif
-    if ( !x->cmap )
+    if ( !x.cmap )
     {
         // no shared cmap found
-        x->cmap = XCreateColormap( dpy, RootWindow( dpy, vi->screen ), vi->visual, AllocNone );
-        x->alloc = true;
+        x.cmap = XCreateColormap( dpy, RootWindow( dpy, vi->screen ), vi->visual, AllocNone );
+        x.alloc = true;
     }
 
     cmap_dict->insert( (long)vi->visualid, x ); // associate cmap with visualid
-    return x->cmap;
+    return x.cmap;
 }
 #endif
 
@@ -198,10 +199,10 @@ QCursor* GLViewer_ViewPort::sketchCursor = 0;
 */
 void GLViewer_ViewPort::createCursors ()
 {
-    defCursor   = new QCursor( ArrowCursor );
-    panglCursor = new QCursor( CrossCursor );
-    handCursor  = new QCursor( PointingHandCursor );
-    panCursor   = new QCursor( SizeAllCursor );
+    defCursor   = new QCursor( Qt::ArrowCursor );
+    panglCursor = new QCursor( Qt::CrossCursor );
+    handCursor  = new QCursor( Qt::PointingHandCursor );
+    panCursor   = new QCursor( Qt::SizeAllCursor );
 
     SUIT_ResourceMgr* rmgr = SUIT_Session::session()->resourceMgr();
     zoomCursor   = new QCursor( rmgr->loadPixmap( "GLViewer", tr( "ICON_GL_CURSOR_ZOOM" ) ) );
@@ -297,7 +298,7 @@ void GLViewer_ViewPort::setSketchCursor( const QCursor& newCursor )
     Constructor
 */
 GLViewer_ViewPort::GLViewer_ViewPort( QWidget* parent )
-: QWidget( parent, 0, WRepaintNoErase | WResizeNoErase )
+: QWidget( parent, 0 )
 {
     initialize();
 }
@@ -324,9 +325,9 @@ void GLViewer_ViewPort::initialize()
     myEnableTransform = true;
 
     setMouseTracking( true );
-    setBackgroundMode( NoBackground );
+    setBackgroundRole( QPalette::NoRole );//NoBackground );
 
-    setFocusPolicy( StrongFocus );
+    setFocusPolicy( Qt::StrongFocus );
 }
 
 /*!
@@ -343,9 +344,9 @@ void GLViewer_ViewPort::cleanup()
 */
 void GLViewer_ViewPort::selectVisualId( ViewType type )
 {
-#if !defined WNT
+#if !defined WIN32
     XVisualInfo* pVisualInfo;
-    if ( x11Display() )
+    if ( QX11Info::display() )
     {
         /* Initialization with the default VisualID */
         //Visual *v = DefaultVisual( x11Display(), DefaultScreen( x11Display() ) );
@@ -355,17 +356,17 @@ void GLViewer_ViewPort::selectVisualId( ViewType type )
         int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
                              GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, None };
 
-        pVisualInfo = ::glXChooseVisual( x11Display(), DefaultScreen( x11Display() ), visualAttr );
+        pVisualInfo = ::glXChooseVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ), visualAttr );
 
         if ( isVisible() )
             hide();
 
         XSetWindowAttributes a;
 
-        a.colormap = choose_cmap( x11Display(), pVisualInfo );      /* find best colormap */
-        a.background_pixel = backgroundColor().pixel();
-        a.border_pixel = black.pixel();
-        Window p = RootWindow( x11Display(), DefaultScreen( x11Display() ) );
+        a.colormap = choose_cmap( QX11Info::display(), pVisualInfo );      /* find best colormap */
+        a.background_pixel = QColormap::instance().pixel( backgroundColor() );
+        a.border_pixel = QColormap::instance().pixel( Qt::black );
+        Window p = RootWindow( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
         if ( parentWidget() )
             p = parentWidget()->winId();
 
@@ -373,16 +374,16 @@ void GLViewer_ViewPort::selectVisualId( ViewType type )
         if ( type == Type2D )  // creating simple X window for 2d
         {
             unsigned long xbackground =
-                BlackPixel( x11Display(), DefaultScreen( x11Display() ) );
+                BlackPixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
             unsigned long xforeground =
-                WhitePixel( x11Display(), DefaultScreen( x11Display() ) );
+                WhitePixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
 
-            w = XCreateSimpleWindow ( x11Display(), p, x(), y(), width(),
+            w = XCreateSimpleWindow ( QX11Info::display(), p, x(), y(), width(),
                                       height(), 0, xforeground, xbackground );
         }
         else if ( type == Type3D )
         {
-            w = XCreateWindow( x11Display(), p,  x(), y(), width(), height(),
+            w = XCreateWindow( QX11Info::display(), p,  x(), y(), width(), height(),
                                0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
                                CWBackPixel | CWBorderPixel | CWColormap, &a );
         }
@@ -392,7 +393,7 @@ void GLViewer_ViewPort::selectVisualId( ViewType type )
         Window *cmw;
         Window *cmwret;
         int count;
-        if ( XGetWMColormapWindows( x11Display(), topLevelWidget()->winId(), &cmwret, &count ) )
+        if ( XGetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), &cmwret, &count ) )
         {
             cmw = new Window[count+1];
             memcpy( (char*)cmw, (char*)cmwret, sizeof(Window) * count );
@@ -420,7 +421,7 @@ void GLViewer_ViewPort::selectVisualId( ViewType type )
 
         /* Creating new window (with good VisualID) for this widget */
         create(w);
-        XSetWMColormapWindows( x11Display(), topLevelWidget()->winId(), cmw, count );
+        XSetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), cmw, count );
         delete[] cmw;
 
         if ( isVisible() )
@@ -430,7 +431,7 @@ void GLViewer_ViewPort::selectVisualId( ViewType type )
         {
             XFree( (char *)pVisualInfo );
         }
-        XFlush( x11Display() );
+        XFlush( QX11Info::display() );
     }
 #endif
 }
@@ -441,7 +442,7 @@ void GLViewer_ViewPort::selectVisualId( ViewType type )
 void GLViewer_ViewPort::setBackgroundColor( const QColor& color )
 {
     QPalette pal = palette();
-    pal.setColor( QColorGroup::Background, color );
+    pal.setColor( QPalette::Background, color );
     setPalette( pal );
     repaint();
 }
@@ -451,7 +452,7 @@ void GLViewer_ViewPort::setBackgroundColor( const QColor& color )
 */
 QColor GLViewer_ViewPort::backgroundColor() const
 {
-    return palette().active().background();
+    return palette().color( QPalette::Active, QPalette::Background );
 }
 
 /*!
index b7ceaf2dcf53131a63fe0efe0e8c07d97357ed5e..4ca9525ffb81709072fdda456122a8c47dd5a738 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_ViewPort.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_VIEWPORT_H
 #define GLVIEWER_VIEWPORT_H
 
 #include "GLViewer.h"
 
-#include <qlist.h>
-#include <qcolor.h>
-#include <qaction.h>
-#include <qwidget.h>
+//#include <QList>
+#include <QColor>
+//#include <QAction>
+#include <QWidget>
 
-#include <Aspect_Window.hxx>
+//#include <Aspect_Window.hxx>
 
 class QRect;
 class QCursor;
@@ -40,7 +41,7 @@ class QPainter;
 class GLViewer_ViewSketcher;
 class GLViewer_ViewTransformer;
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -170,7 +171,7 @@ private:
     static QCursor*                  sketchCursor;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 3055726ec0eca88903758397465ce623d648825c..0cd5b9371a988114675d4e6494566f75d505d5b1 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_ViewPort2d.cxx
 // Created:   November, 2004
-
+//
 /* GLViewer_ViewPort2d Source File */
 
 //#include <GLViewerAfx.h>
 #include "GLViewer_ViewPort2d.h"
 #include "GLViewer_Viewer2d.h"
 #include "GLViewer_ViewFrame.h"
-#include "GLViewer_MimeSource.h"
+#include "GLViewer_MimeData.h"
 #include "GLViewer_Context.h"
 #include "GLViewer_Compass.h"
 #include "GLViewer_Grid.h"
-
-#include <QtxToolTip.h>
-
-#include <qlayout.h>
-#include <qevent.h>
-#include <qrect.h>
-#include <qpopupmenu.h>
-#include <qtooltip.h>
-#include <qapplication.h>
-#include <qclipboard.h>
-#include <qpainter.h>
-#include <qbitmap.h>
-#include <qlabel.h>
+#include "GLViewer_Drawer.h"
+
+// TODO: Porting to Qt4
+//#include <QtxToolTip.h>
+
+#include <QHBoxLayout>
+#include <QMouseEvent>
+#include <QRect>
+//#include <QMenu>
+//#include <QToolTip>
+#include <QApplication>
+#include <QClipboard>
+#include <QBitmap>
+#include <QLabel>
+#include <QWidget>
+#include <QRubberBand>
 
 #define WIDTH       640
 #define HEIGHT      480
@@ -66,45 +70,50 @@ void rotate_point( float& theX, float& theY, float theAngle )
 /*!
   Constructor
 */
-GLViewer_ViewPort2d::GLViewer_ViewPort2d( QWidget* parent, GLViewer_ViewFrame* theViewFrame ) :
-       GLViewer_ViewPort( parent ),
-       myMargin( MARGIN ), myWidth( WIDTH ), myHeight( HEIGHT ),
-       myXScale( 1.0 ), myYScale( 1.0 ), myXOldScale( 1.0 ), myYOldScale( 1.0 ),
-       myXPan( 0.0 ), myYPan( 0.0 ),
-       myIsMouseReleaseBlock( false )
+GLViewer_ViewPort2d::GLViewer_ViewPort2d( QWidget* parent, GLViewer_ViewFrame* theViewFrame )
+: GLViewer_ViewPort( parent ),
+  myMargin( MARGIN ), myWidth( WIDTH ), myHeight( HEIGHT ),
+  myXScale( 1.0 ), myYScale( 1.0 ), myXOldScale( 1.0 ), myYOldScale( 1.0 ),
+  myXPan( 0.0 ), myYPan( 0.0 ),
+  myIsMouseReleaseBlock( false ),
+  myRectBand( 0 )
 {
-    if( theViewFrame == NULL )
-        myViewFrame = ( GLViewer_ViewFrame* )parent;
-    else
-        myViewFrame = theViewFrame;
+  if ( !theViewFrame )
+    myViewFrame = (GLViewer_ViewFrame*)parent;
+  else
+    myViewFrame = theViewFrame;
 
-    myGrid = 0;
-    myCompass = 0;
-    myBorder = new GLViewer_Rect();
+  myGrid = 0;
+  myCompass = 0;
+  myBorder = new GLViewer_Rect();
 
-    QBoxLayout* qbl = new QHBoxLayout( this );
-    myGLWidget = new GLViewer_Widget( this, 0 ) ;
-    qbl->addWidget( myGLWidget );
-    myGLWidget->setFocusProxy( this );
-    setMouseTracking( TRUE );
+  QBoxLayout* qbl = new QHBoxLayout( this );
+  qbl->setSpacing( 0 );
+  qbl->setMargin( 0 );
 
-    myIsDragProcess = noDrag;
-    //myCurDragMousePos = QPoint();
-    myCurDragPosX = NULL;
-    myCurDragPosY = NULL;
+  myGLWidget = new GLViewer_Widget( this, 0 ) ;
+  qbl->addWidget( myGLWidget );
+  myGLWidget->setFocusProxy( this );
+  setMouseTracking( TRUE );
 
-    myIsPulling = false;
+  myIsDragProcess = noDrag;
+  //myCurDragMousePos = QPoint();
+  myCurDragPosX = NULL;
+  myCurDragPosY = NULL;
+
+  myIsPulling = false;
 
-    myViewPortId = aLastViewPostId;
-    aLastViewPostId++;
+  myViewPortId = aLastViewPostId;
+  aLastViewPostId++;
 
-    mypFirstPoint = NULL;
-    mypLastPoint = NULL;
+  mypFirstPoint = NULL;
+  mypLastPoint = NULL;
 
-    myObjectTip = new QtxToolTip( myGLWidget );///GLViewer_ObjectTip( this );
+    // TODO: Porting to Qt4
+    /*myObjectTip = new QtxToolTip( myGLWidget );///GLViewer_ObjectTip( this );
     myObjectTip->setShowDelayTime( 60000 );
     connect( myObjectTip, SIGNAL( maybeTip( QPoint, QString&, QFont&, QRect&, QRect& ) ),
-             this, SLOT( onMaybeTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );
+             this, SLOT( onMaybeTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );*/
 //    myGLWidget->installEventFilter( myObjectTip );
 }
 
@@ -121,6 +130,9 @@ GLViewer_ViewPort2d::~GLViewer_ViewPort2d()
 
     delete myBorder;
     delete myGLWidget;
+
+    if ( myRectBand ) myRectBand->hide();
+    delete myRectBand;
 }
 
 /*!
@@ -138,20 +150,20 @@ void GLViewer_ViewPort2d::onStartDragObject( )
         myCurDragPosX = NULL;
         myCurDragPosY = NULL;
         return;
-    } 
+    }
 }
 
 /*!
   SLOT: cuts object to clipboard
 */
 void GLViewer_ViewPort2d::onCutObject()
-{ 
+{
     /*GLViewer_Object* aMovingObject = ((GLViewer_Viewer2d*)getViewFrame()->getViewer())->getGLContext()->getCurrentObject();
-    if( aMovingObject )    
-    {        
+    if( aMovingObject )
+    {
         GLViewer_MimeSource* aMimeSource = new GLViewer_MimeSource();
         aMimeSource->setObject( aMovingObject );
-        
+
         QClipboard *aClipboard = QApplication::clipboard();
         aClipboard->clear();
         aClipboard->setData( aMimeSource );
@@ -162,17 +174,17 @@ void GLViewer_ViewPort2d::onCutObject()
     int aObjNum = aContext->NbSelected();
     if( aObjNum > 0 )
     {
-        QValueList<GLViewer_Object*> aObjects;
-        GLViewer_MimeSource* aMimeSource = new GLViewer_MimeSource();
+        QList<GLViewer_Object*> aObjects;
+        GLViewer_MimeData* aMimeData = new GLViewer_MimeData();
         aContext->InitSelected();
         for( ; aContext->MoreSelected(); aContext->NextSelected() )
             aObjects.append( aContext->SelectedObject() );
 
-        //aMimeSource->setObjects( aObjects ); ouv 6.05.04
+        //aMimeData->setObjects( aObjects ); ouv 6.05.04
 
         QClipboard *aClipboard = QApplication::clipboard();
         aClipboard->clear();
-        aClipboard->setData( aMimeSource );
+        aClipboard->setMimeData( aMimeData );
 
         for( int i = 0; i < aObjNum; i++ )
             aContext->deleteObject( aObjects[i] );
@@ -185,11 +197,11 @@ void GLViewer_ViewPort2d::onCutObject()
 void GLViewer_ViewPort2d::onCopyObject()
 {
     /*GLViewer_Object* aMovingObject = ((GLViewer_Viewer2d*)getViewFrame()->getViewer())->getGLContext()->getCurrentObject();
-    if( aMovingObject )    
-    {        
+    if( aMovingObject )
+    {
         GLViewer_MimeSource* aMimeSource = new GLViewer_MimeSource();
         aMimeSource->setObject( aMovingObject );
-        
+
         QClipboard *aClipboard = QApplication::clipboard();
         aClipboard->clear();
         aClipboard->setData( aMimeSource );
@@ -199,17 +211,17 @@ void GLViewer_ViewPort2d::onCopyObject()
     int aObjNum = aContext->NbSelected();
     if( aObjNum > 0 )
     {
-        QValueList<GLViewer_Object*> aObjects;
-        GLViewer_MimeSource* aMimeSource = new GLViewer_MimeSource();
+        QList<GLViewer_Object*> aObjects;
+        GLViewer_MimeData* aMimeData = new GLViewer_MimeData();
         aContext->InitSelected();
         for( ; aContext->MoreSelected(); aContext->NextSelected() )
             aObjects.append( aContext->SelectedObject() );
 
-        //aMimeSource->setObjects( aObjects ); ouv 6.05.04
+        //aMimeData->setObjects( aObjects ); ouv 6.05.04
 
         QClipboard *aClipboard = QApplication::clipboard();
         aClipboard->clear();
-        aClipboard->setData( aMimeSource );
+        aClipboard->setMimeData( aMimeData );
     }
 }
 
@@ -240,7 +252,7 @@ void GLViewer_ViewPort2d::onPasteObject()
         GLViewer_Object* aObject = GLViewer_MimeSource::getObject( anArray, aType );
         if( !aObject )
             return;
-        
+
         ((GLViewer_Viewer2d*)getViewFrame()->getViewer())->getGLContext()->insertObject( aObject, true );
     }
     */
@@ -251,7 +263,7 @@ void GLViewer_ViewPort2d::onPasteObject()
     if( aMimeSource->provides( "GLViewer_Objects" ) )
     {
         QByteArray anArray = aMimeSource->encodedData( "GLViewer_Objects" );
-        QValueList<GLViewer_Object*> aObjects = GLViewer_MimeSource::getObjects( anArray, "GLViewer_Objects" );
+        QList<GLViewer_Object*> aObjects = GLViewer_MimeSource::getObjects( anArray, "GLViewer_Objects" );
         if( aObjects.empty() )
             return;
         GLViewer_Context* aContext = ((GLViewer_Viewer2d*)getViewFrame()->getViewer())->getGLContext();
@@ -270,14 +282,14 @@ void GLViewer_ViewPort2d::onDragObject( QMouseEvent* e )
   GLViewer_Viewer2d* aViewer = (GLViewer_Viewer2d*)getViewFrame()->getViewer();
   GLViewer_Context* aContext = aViewer->getGLContext();
   GLViewer_Object* anObject = aContext->getCurrentObject();
-  
+
   if( !aContext )
     return;
 
   float aX = e->pos().x();
   float anY = e->pos().y();
   aViewer->transPoint( aX, anY );
-    
+
   if( myCurDragPosX == NULL && myCurDragPosY == NULL )
   {
     myCurDragPosX = new float(aX);
@@ -287,8 +299,8 @@ void GLViewer_ViewPort2d::onDragObject( QMouseEvent* e )
 
   //QPoint aNewPos = e->pos();
   //GLViewer_Viewer2d* aViewer = (GLViewer_Viewer2d*)getViewFrame()->getViewer();
-  
-  if( anObject && (e->state() & LeftButton ) )
+
+  if( anObject && (e->buttons() & Qt::LeftButton ) )
   {
     if( aContext->isSelected( anObject ) )
     {
@@ -302,14 +314,14 @@ void GLViewer_ViewPort2d::onDragObject( QMouseEvent* e )
     else
       anObject->moveObject( aX - *myCurDragPosX, anY - *myCurDragPosY);
   }
-  else if( aContext->NbSelected() && (e->state() & MidButton ) )
+  else if( aContext->NbSelected() && (e->buttons() & Qt::MidButton ) )
     for( aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected() )
         (aContext->SelectedObject())->moveObject( aX - *myCurDragPosX, anY - *myCurDragPosY);
-  
+
   delete myCurDragPosX;
   delete myCurDragPosY;
   myCurDragPosX = new float(aX);
-  myCurDragPosY = new float(anY);    
+  myCurDragPosY = new float(anY);
 
   myGLWidget->updateGL();
 }
@@ -318,20 +330,20 @@ void GLViewer_ViewPort2d::onDragObject( QMouseEvent* e )
     Emits 'mouseEvent' signal. [ virtual protected ]
 */
 void GLViewer_ViewPort2d::mousePressEvent( QMouseEvent* e )
-{    
+{
     emit vpMouseEvent( e );
-    
-    GLViewer_Viewer2d* aViewer = (GLViewer_Viewer2d*)getViewFrame()->getViewer();   
+
+    GLViewer_Viewer2d* aViewer = (GLViewer_Viewer2d*)getViewFrame()->getViewer();
     GLViewer_Context* aContext = aViewer->getGLContext();
 
     GLViewer_Object* anObject = NULL;
     if( aContext )
         anObject = aContext->getCurrentObject();
-    
-    bool accel = e->state() & GLViewer_ViewTransformer::accelKey();
+
+    bool accel = e->modifiers() & GLViewer_ViewTransformer::accelKey();
     if( ( anObject && !( accel || e->button() == Qt::RightButton ) ) ||
         ( aContext->NbSelected() && !accel && e->button() == Qt::MidButton )  )
-    {       
+    {
         myIsDragProcess = inDrag;
     }
 }
@@ -342,11 +354,11 @@ void GLViewer_ViewPort2d::mousePressEvent( QMouseEvent* e )
 void GLViewer_ViewPort2d::mouseMoveEvent( QMouseEvent* e )
 {
     emit vpMouseEvent( e );
-    
+
     if( myIsDragProcess == inDrag )
         onDragObject( e );
 
-    /*GLViewer_Viewer2d* aViewer = (GLViewer_Viewer2d*)getViewFrame()->getViewer();   
+    /*GLViewer_Viewer2d* aViewer = (GLViewer_Viewer2d*)getViewFrame()->getViewer();
     GLViewer_Context* aContext = aViewer->getGLContext();
 
     GLViewer_Object* anObj = aContext->getCurrentObject();
@@ -371,7 +383,7 @@ void GLViewer_ViewPort2d::mouseMoveEvent( QMouseEvent* e )
     Emits 'mouseEvent' signal. [ virtual protected ]
 */
 void GLViewer_ViewPort2d::mouseReleaseEvent( QMouseEvent* e )
-{    
+{
     if ( myIsMouseReleaseBlock )
     {
       // skip mouse release after double click
@@ -388,7 +400,7 @@ void GLViewer_ViewPort2d::mouseReleaseEvent( QMouseEvent* e )
         //destroyPopup( /*popup*/ );
     }
     emit vpMouseEvent( e );
-    
+
     if( myIsDragProcess == inDrag )
     {
       bool isAnyMoved = false;
@@ -401,11 +413,11 @@ void GLViewer_ViewPort2d::mouseReleaseEvent( QMouseEvent* e )
         if( aMovingObject )
           isAnyMoved = aMovingObject->finishMove() || isAnyMoved;
       }
-      
+
       aMovingObject = aContext->getCurrentObject();
       if( aMovingObject )
         isAnyMoved = aMovingObject->finishMove() || isAnyMoved;
-      
+
       myIsDragProcess = noDrag;
       //myCurDragMousePos.setX( 0 );
       //myCurDragMousePos.setY( 0 );
@@ -454,7 +466,7 @@ void GLViewer_ViewPort2d::turnGrid( GLboolean on )
     if( on )
     {
         myGrid = new GLViewer_Grid( 2*WIDTH, 2*HEIGHT,
-                                    2*WIDTH, 2*HEIGHT, 
+                                    2*WIDTH, 2*HEIGHT,
                                     GRID_XSIZE, GRID_YSIZE,
                                     myXPan, myYPan,
                                     myXScale, myYScale );
@@ -519,36 +531,36 @@ void GLViewer_ViewPort2d::initResize( int x, int y )
     GLfloat h = y;
     bool max = FALSE;
 
-    xzoom = (GLfloat)x / myWidth; 
-    yzoom = (GLfloat)y / myHeight; 
+    xzoom = (GLfloat)x / myWidth;
+    yzoom = (GLfloat)y / myHeight;
 
-    if ( ( xzoom < yzoom ) && ( xzoom < 1 ) ) 
-        zoom = xzoom; 
-    else if ( ( yzoom < xzoom ) && ( yzoom < 1 ) ) 
-        zoom = yzoom; 
-    else 
-    { 
-        max = TRUE; 
-        zoom = xzoom > yzoom ? xzoom : yzoom; 
-    } 
+    if ( ( xzoom < yzoom ) && ( xzoom < 1 ) )
+        zoom = xzoom;
+    else if ( ( yzoom < xzoom ) && ( yzoom < 1 ) )
+        zoom = yzoom;
+    else
+    {
+        max = TRUE;
+        zoom = xzoom > yzoom ? xzoom : yzoom;
+    }
 
     if ( !max && ( ! ( ( ( myXPan + w/2 ) < xb * myXScale * zoom ) ||
-             ( ( myXPan - w/2 ) > xa * myXScale * zoom ) || 
+             ( ( myXPan - w/2 ) > xa * myXScale * zoom ) ||
              ( ( myYPan + h/2 ) < yb * myYScale * zoom ) ||
-             ( ( myYPan - h/2 ) > ya * myYScale * zoom ) ) ) ) 
-        zoom = 1; 
+             ( ( myYPan - h/2 ) > ya * myYScale * zoom ) ) ) )
+        zoom = 1;
 
     if ( max && ( ( ( myXPan + w/2 ) < xb * myXScale * zoom ) ||
-            ( ( myXPan - w/2 ) > xa * myXScale * zoom ) || 
-            ( ( myYPan + h/2 ) < yb * myYScale * zoom ) || 
-            ( ( myYPan - h/2 ) > ya * myYScale * zoom ) ) ) 
-        zoom = 1; 
+            ( ( myXPan - w/2 ) > xa * myXScale * zoom ) ||
+            ( ( myYPan + h/2 ) < yb * myYScale * zoom ) ||
+            ( ( myYPan - h/2 ) > ya * myYScale * zoom ) ) )
+        zoom = 1;
+
     myWidth = x;
-    myHeight = y; 
+    myHeight = y;
 
-    myXScale *= zoom; 
-    myYScale = myXScale; 
+    myXScale *= zoom;
+    myYScale = myXScale;
 
     if ( myGrid )
         myGrid->setResize( 2*x, 2*y, zoom );
@@ -582,18 +594,18 @@ void GLViewer_ViewPort2d::reset()
 {
     //cout << "GLViewer_ViewPort2d::reset" << endl;
 
-    GLint val[4]; 
-    GLint vpWidth, vpHeight; 
+    GLint val[4];
+    GLint vpWidth, vpHeight;
 
     myGLWidget->makeCurrent();
     glGetIntegerv( GL_VIEWPORT, val );
-    vpWidth = val[2]; 
-    vpHeight = val[3]; 
+    vpWidth = val[2];
+    vpHeight = val[3];
 
     GLint w = myGLWidget->getWidth();
     GLint h = myGLWidget->getHeight();
-    GLfloat zoom = vpWidth / ( GLfloat )w < vpHeight / ( GLfloat )h ? 
-                 vpWidth / ( GLfloat )w : vpHeight / ( GLfloat )h; 
+    GLfloat zoom = vpWidth / ( GLfloat )w < vpHeight / ( GLfloat )h ?
+                 vpWidth / ( GLfloat )w : vpHeight / ( GLfloat )h;
 
     if( myGrid )
     {
@@ -657,13 +669,13 @@ void GLViewer_ViewPort2d::setCenter( int x, int y )
 {
     //cout << "GLViewer_ViewPort2d::setCenter" << endl;
 
-    GLint val[4]; 
-    GLint vpWidth, vpHeight; 
+    GLint val[4];
+    GLint vpWidth, vpHeight;
 
     myGLWidget->makeCurrent();
     glGetIntegerv( GL_VIEWPORT, val );
-    vpWidth = val[2]; 
-    vpHeight = val[3]; 
+    vpWidth = val[2];
+    vpHeight = val[3];
 
     myXPan -= ( x - vpWidth/2 ) / myXScale;
     myYPan += ( y - vpHeight/2 ) / myYScale;
@@ -688,7 +700,7 @@ void GLViewer_ViewPort2d::setCenter( int x, int y )
 void GLViewer_ViewPort2d::zoom( int x0, int y0, int x, int y )
 {
     //cout << "GLViewer_ViewPort2d::zoom" << endl;
-  
+
     float dx, dy, zm;
     dx = x - x0;
     dy = y - y0;
@@ -696,14 +708,14 @@ void GLViewer_ViewPort2d::zoom( int x0, int y0, int x, int y )
     if ( dx == 0. && dy == 0. )
         return;
 
-    zm = sqrt(dx * dx + dy * dy) / 100. + 1; 
-    zm = (dx > 0.) ?  zm : 1. / zm; 
+    zm = sqrt(dx * dx + dy * dy) / 100. + 1;
+    zm = (dx > 0.) ?  zm : 1. / zm;
 
     //backup values
     float bX = myXScale;
     float bY = myYScale;
-    myXScale *= zm; 
-    myYScale *= zm; 
+    myXScale *= zm;
+    myYScale *= zm;
 
     if( myGrid )
     {
@@ -717,7 +729,7 @@ void GLViewer_ViewPort2d::zoom( int x0, int y0, int x, int y )
         {// undo
             myXScale = bX;
             myYScale = bY;
-        } 
+        }
     }
     else
     {
@@ -734,30 +746,30 @@ void GLViewer_ViewPort2d::zoom( int x0, int y0, int x, int y )
 void GLViewer_ViewPort2d::fitRect( const QRect& rect )
 {
     float x0, x1, y0, y1;
-    float dx, dy, zm, centerX, centerY; 
+    float dx, dy, zm, centerX, centerY;
 
-    GLint val[4]; 
-    GLint vpWidth, vpHeight; 
+    GLint val[4];
+    GLint vpWidth, vpHeight;
 
     myGLWidget->makeCurrent();
     glGetIntegerv( GL_VIEWPORT, val );
-    vpWidth = val[2]; 
-    vpHeight = val[3]; 
+    vpWidth = val[2];
+    vpHeight = val[3];
 
     x0 = rect.left();
     x1 = rect.right();
     y0 = rect.top();
     y1 = rect.bottom();
 
-    dx = fabs( x1 - x0 ); 
-    dy = fabs( y1 - y0 ); 
-    centerX = ( x0 + x1 ) / 2.; 
-    centerY = ( y0 + y1 ) / 2.; 
+    dx = fabs( x1 - x0 );
+    dy = fabs( y1 - y0 );
+    centerX = ( x0 + x1 ) / 2.;
+    centerY = ( y0 + y1 ) / 2.;
 
     if ( dx == 0. || dy == 0. )
         return;
 
-    zm = vpWidth / dx < vpHeight / dy ? vpWidth / dx : vpHeight / dy; 
+    zm = vpWidth / dx < vpHeight / dy ? vpWidth / dx : vpHeight / dy;
 
     float aDX = ( vpWidth / 2. - centerX ) / myXScale;
     float aDY = ( vpHeight / 2. - centerY ) / myYScale;
@@ -792,7 +804,7 @@ void GLViewer_ViewPort2d::fitSelect()
   GLViewer_Context* aContext = aViewer->getGLContext();
   if( !aContext )
     return;
-  
+
   QRect aSelRect;
   for( aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected() )
     aSelRect |= *(aViewer->getWinObjectRect( aContext->SelectedObject() ));
@@ -819,7 +831,7 @@ void GLViewer_ViewPort2d::fitAll( bool keepScale, bool withZ )
     float dx, dy, zm;
     float xScale, yScale;
 
-    myMargin = QMAX( myBorder->width(), myBorder->height() ) / 5;
+    myMargin = qMax( myBorder->width(), myBorder->height() ) / 5;
 
     xa = myBorder->left() - myMargin;
     xb = myBorder->right() + myMargin;
@@ -862,9 +874,9 @@ void GLViewer_ViewPort2d::fitAll( bool keepScale, bool withZ )
     dx = fabs( aBorders[1] - aBorders[0] );
     dy = fabs( aBorders[3] - aBorders[2] );
 
-    myXPan = -( aBorders[0] + aBorders[1] ) / 2; 
+    myXPan = -( aBorders[0] + aBorders[1] ) / 2;
     myYPan = -( aBorders[2] + aBorders[3] ) / 2;
-    
+
 
     if( keepScale )
     {
@@ -875,19 +887,19 @@ void GLViewer_ViewPort2d::fitAll( bool keepScale, bool withZ )
     xScale = myXScale;
     yScale = myYScale;
     if( dx && dy )
-        zm = vpWidth / dx < vpHeight / dy ? vpWidth / dx : vpHeight / dy; 
+        zm = vpWidth / dx < vpHeight / dy ? vpWidth / dx : vpHeight / dy;
     else
         zm = 1.0;
-    myXScale = zm; 
-    myYScale = zm;    
-    
+    myXScale = zm;
+    myYScale = zm;
+
 
     if( myGrid )
     {
         myGrid->setPan( myXPan, myYPan );
         if( dx > dy )
             myGrid->setZoom(  zm / xScale );
-        else  
+        else
             myGrid->setZoom( zm / yScale );
     }
 
@@ -1001,7 +1013,7 @@ void GLViewer_ViewPort2d::drawCompass()
 
     float centerX = (xPos/2 - delX - cSize)/xScale;
     float centerY = (yPos/2 - delY - cSize)/yScale;
-    
+
     switch ( cPos )
     {
     case GLViewer_Compass::TopLeft:
@@ -1016,7 +1028,7 @@ void GLViewer_ViewPort2d::drawCompass()
             break;
         default: break;
     }
-    
+
     float ra, rx, ry, rz;
     myGLWidget->getRotation( ra, rx, ry, rz );
     GLfloat angle = ra * PI / 180.;
@@ -1028,14 +1040,14 @@ void GLViewer_ViewPort2d::drawCompass()
     centerY -= yPan;
 
     glColor3f( colorR, colorG, colorB );
-    glBegin( GL_POLYGON );     
+    glBegin( GL_POLYGON );
     //arrow
-        x = centerX;                      y = centerY + cSize / yScale;    
+        x = centerX;                      y = centerY + cSize / yScale;
         glVertex2f( x, y );
         //point #2
         x = centerX + cWidthTop / xScale; y = centerY + ( cSize - cHeightTop ) / yScale ;
         glVertex2f( x, y );
-        //point #3    
+        //point #3
         x = centerX + cWidthBot / xScale; y = centerY + ( cSize - cHeightTop ) / yScale ;
         glVertex2f( x, y );
         //point #4
@@ -1043,7 +1055,7 @@ void GLViewer_ViewPort2d::drawCompass()
         glVertex2f( x, y );
         //point #5
         x = centerX;                      y = centerY - (cSize - cHeightBot) / yScale ;
-        glVertex2f( x, y ); 
+        glVertex2f( x, y );
         //point #6
         x = centerX - cWidthBot / xScale; y = centerY - cSize/yScale;
         glVertex2f( x, y );
@@ -1063,18 +1075,18 @@ void GLViewer_ViewPort2d::drawCompass()
         {
             x = centerX + cos(aCircAngle) * cSize / xScale;
             y = centerY + sin(aCircAngle) * cSize / yScale;
-            glVertex2f( x, y );    
+            glVertex2f( x, y );
             aCircAngle += float( STEP ) / 2;
-        }        
-    glEnd(); 
-    
+        }
+    glEnd();
+
     GLdouble        modelMatrix[16], projMatrix[16];
     GLint           viewport[4];
     GLdouble        winxN, winyN, winz;
     GLdouble        winxE, winyE;
     GLdouble        winxS, winyS;
     GLdouble        winxW, winyW;
-    GLuint          aTextList;    
+    GLuint          aTextList;
 
     GLViewer_TexFont* aFont = myCompass->getFont();
     float widN = (float)aFont->getStringWidth( "N" );
@@ -1096,13 +1108,13 @@ void GLViewer_ViewPort2d::drawCompass()
     glGetIntegerv (GL_VIEWPORT, viewport);
     glGetDoublev (GL_MODELVIEW_MATRIX, modelMatrix);
     glGetDoublev (GL_PROJECTION_MATRIX, projMatrix);
-    
+
     gluProject (centerX, centerY + cSize / yScale, 0, modelMatrix, projMatrix, viewport, &winxN, &winyN, &winz);
     gluProject (centerX + cSize / xScale, centerY, 0, modelMatrix, projMatrix, viewport, &winxE, &winyE, &winz);
     gluProject (centerX, centerY - cSize / yScale, 0, modelMatrix, projMatrix, viewport, &winxS, &winyS, &winz);
     gluProject (centerX - cSize / xScale, centerY, 0, modelMatrix, projMatrix, viewport, &winxW, &winyW, &winz);
 
-    glColor3f( 1.0, 1.0, 1.0 );    
+    glColor3f( 1.0, 1.0, 1.0 );
 
     aTextList = glGenLists( 1 );
     glNewList( aTextList, GL_COMPILE );
@@ -1113,7 +1125,7 @@ void GLViewer_ViewPort2d::drawCompass()
     glOrtho(0,viewport[2],0,viewport[3],-100,100);
     glMatrixMode(GL_MODELVIEW);
     glPushMatrix();
-    glLoadIdentity();    
+    glLoadIdentity();
 
     aFont->drawString( "N", winxN + xGapN, winyN + yGapN );
     aFont->drawString( "E", winxE + xGapE, winyE + yGapE );
@@ -1127,7 +1139,7 @@ void GLViewer_ViewPort2d::drawCompass()
 
     glEndList();
 
-    if ( aTextList != -1 ) 
+    if ( aTextList != -1 )
         glCallList( aTextList );
 }
 
@@ -1138,10 +1150,10 @@ BlockStatus GLViewer_ViewPort2d::currentBlock()
 {
     if( myIsDragProcess == inDrag && myCurDragPosX != NULL && myCurDragPosY != NULL)
         return BlockStatus(BS_Highlighting | BS_Selection);
-    
+
     if( mypFirstPoint && mypLastPoint )
         return BlockStatus(BS_Highlighting | BS_Selection);
-    
+
     return BS_NoBlock;
 }
 
@@ -1156,6 +1168,14 @@ void GLViewer_ViewPort2d::startSelectByRect( int x, int y )
         mypFirstPoint = new QPoint( x, y );
         mypLastPoint = new QPoint( x, y );
     }
+
+    if ( !myRectBand ) {
+      myRectBand = new QRubberBand( QRubberBand::Rectangle, this );
+      QPalette palette;
+      palette.setColor(myRectBand->foregroundRole(), Qt::white);
+      myRectBand->setPalette(palette);
+    }
+    myRectBand->hide();
 }
 
 /*!
@@ -1166,17 +1186,14 @@ void GLViewer_ViewPort2d::drawSelectByRect( int x, int y )
 {
     if( mypFirstPoint && mypLastPoint )
     {
+        myRectBand->hide();    /* erase */
 
-        QPainter p( getPaintDevice() );
-        p.setPen( Qt::white );
-        p.setRasterOp( Qt::XorROP );
-
-        p.drawRect( selectionRect() );    /* erase */
-
-        mypLastPoint->setX( x );
+       mypLastPoint->setX( x );
         mypLastPoint->setY( y );
-        
-        p.drawRect( selectionRect() );    /* draw */
+
+       QRect aRect = selectionRect();
+       myRectBand->setGeometry( aRect );    /* draw */
+       myRectBand->setVisible( aRect.isValid() );
     }
 
 }
@@ -1189,17 +1206,17 @@ void GLViewer_ViewPort2d::finishSelectByRect()
     if( mypFirstPoint && mypLastPoint )
     {
 
-        QPainter p( getPaintDevice() );
-        p.setPen( Qt::white );
-        p.setRasterOp( Qt::XorROP );
 
-        p.drawRect( selectionRect() );    /* erase */
+        if ( myRectBand ) myRectBand->hide();    /* erase */
 
         delete mypFirstPoint;
         delete mypLastPoint;
 
         mypFirstPoint = NULL;
         mypLastPoint = NULL;
+
+       delete myRectBand;
+       myRectBand = 0;
     }
 }
 
@@ -1211,10 +1228,10 @@ QRect GLViewer_ViewPort2d::selectionRect()
     QRect aRect;
     if( mypFirstPoint && mypLastPoint )
     {
-        aRect.setLeft( QMIN( mypFirstPoint->x(), mypLastPoint->x() ) );
-        aRect.setTop( QMIN( mypFirstPoint->y(), mypLastPoint->y() ) );
-        aRect.setRight( QMAX( mypFirstPoint->x(), mypLastPoint->x() ) );
-        aRect.setBottom( QMAX( mypFirstPoint->y(), mypLastPoint->y() ) );
+        aRect.setLeft( qMin( mypFirstPoint->x(), mypLastPoint->x() ) );
+        aRect.setTop( qMin( mypFirstPoint->y(), mypLastPoint->y() ) );
+        aRect.setRight( qMax( mypFirstPoint->x(), mypLastPoint->x() ) );
+        aRect.setBottom( qMax( mypFirstPoint->y(), mypLastPoint->y() ) );
     }
 
     return aRect;
@@ -1302,7 +1319,7 @@ GLViewer_Rect GLViewer_ViewPort2d::win2GLV( const QRect& theRect ) const
 
   gluUnProject( theRect.left(), viewport[3] - theRect.top(), 0, modelMatrix, projMatrix, viewport, &objx1, &objy1, &objz );
   gluUnProject( theRect.right(), viewport[3] - theRect.bottom(), 0, modelMatrix, projMatrix, viewport, &objx2, &objy2, &objz );
-  
+
   aRect.setLeft( objx1 );
   aRect.setTop( objy1 );
   aRect.setRight( objx2 );
@@ -1332,7 +1349,7 @@ QRect GLViewer_ViewPort2d::GLV2win( const GLViewer_Rect& theRect ) const
 
   gluProject( theRect.left(), theRect.top(), 0, modelMatrix, projMatrix, viewport, &winx1, &winy1, &winz );
   gluProject( theRect.right(), theRect.bottom(), 0, modelMatrix, projMatrix, viewport, &winx2, &winy2, &winz );
-  
+
   aRect.setLeft( (int)winx1 );
   aRect.setTop( viewport[3] - (int)winy1 );
   aRect.setRight( (int)winx2 );
@@ -1357,9 +1374,9 @@ void GLViewer_ViewPort2d::onMaybeTip( QPoint thePoint, QString& theText, QFont&
 
     QStringList aList;
     if( anObj->isTooTipHTML() )
-      aList = QStringList::split( "<br>", theText );
+      aList = theText.split( "<br>", QString::SkipEmptyParts );
     else
-      aList = QStringList::split( "\n", theText );
+      aList = theText.split( "\n", QString::SkipEmptyParts );
 
     if( !aList.isEmpty() )
     {
index 76b59b6d4d08a74b7e43c6d1f4c25a7a5a6e696d..e62616310345d0f1e404dc0f96aebf2ea547481a 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_ViewPort2d.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_VIEWPORT2D_H
 #define GLVIEWER_VIEWPORT2D_H
 
-#ifdef WNT
+#ifdef WIN32
 #include <windows.h>
 #endif
 
 #include "GLViewer_Widget.h"
 #include "GLViewer_Geom.h"
 
-#include <qgl.h>
-#include <qcolor.h>
-#include <qwidget.h>
-#include <qpaintdevice.h>
+#include <QtOpenGL>
+#include <QColor>
+#include <QPaintDevice>
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -51,6 +51,10 @@ class GLViewer_Object;
 class GLViewer_ViewFrame;
 
 class QtxToolTip;
+
+class QWidget;
+class QRubberBand;
+
 /*! 
  * Class GLViewer_ViewPort
  * 2D visualisation canvas of GLViewer
@@ -237,9 +241,11 @@ protected:
   QtxToolTip*            myObjectTip;
   //! flag to block mouse release event just after mouse double-click
   bool                   myIsMouseReleaseBlock;
+
+  QRubberBand*           myRectBand; //!< selection rectangle rubber band
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 3363add169b5160859fbfac273458aba8526fef0..95647f30bf831e3585bb7a35edc9b1de22e44c73 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Viewer.cxx
 // Created:   November, 2004
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_Viewer.h"
 #include "GLViewer_Selector.h"
 #include "GLViewer_ViewPort.h"
 #include "GLViewer_ViewFrame.h"
 
-#include "SUIT_Desktop.h"
+//#include "SUIT_Desktop.h"
 #include "SUIT_ViewWindow.h"
+#include "SUIT_ViewManager.h"
 
-#include <qapplication.h>
-#include <qpainter.h>
-#include <qpopupmenu.h>
-#include <qcolordialog.h>
+#include <QApplication>
+#include <QMenu>
+#include <QColorDialog>
+#include <QMouseEvent>
+#include <QWheelEvent>
+#include <QRect>
+#include <QRubberBand>
 
 /* used for sketching */
 static QEvent* l_mbPressEvent = 0;
@@ -85,12 +90,12 @@ void GLViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
 /*!
   Builds popup for GL viewer
 */
-void GLViewer_Viewer::contextMenuPopup( QPopupMenu* thePopup )
+void GLViewer_Viewer::contextMenuPopup( QMenu* thePopup )
 {
-  if( thePopup->count() > 0 )
-      thePopup->insertSeparator();
+  if( thePopup->actions().count() > 0 )
+      thePopup->addSeparator();
 
-  thePopup->insertItem( tr( "CHANGE_BGCOLOR" ), this, SLOT( onChangeBgColor() ) );
+  thePopup->addAction( tr( "CHANGE_BGCOLOR" ), this, SLOT( onChangeBgColor() ) );
 }
 
 /*!
@@ -389,7 +394,7 @@ void GLViewer_Viewer::onWheelEvent( SUIT_ViewWindow*, QWheelEvent* e )
 void GLViewer_Viewer::onSelectionModeChanged()
 {
     bool enable = ( mySelMode == Multiple );    
-    QPtrVector<SUIT_ViewWindow> views = getViewManager()->getViews();
+    QVector<SUIT_ViewWindow*> views = getViewManager()->getViews();
     for ( int i = 0, n = views.count(); i < n; i++ )
     {
         GLViewer_ViewPort* vp = ((GLViewer_ViewFrame*)views[i])->getViewPort();
@@ -403,7 +408,7 @@ void GLViewer_Viewer::onSelectionModeChanged()
 */
 void GLViewer_Viewer::update( int flags )
 {
-    QPtrVector<SUIT_ViewWindow> views = getViewManager()->getViews();
+    QVector<SUIT_ViewWindow*> views = getViewManager()->getViews();
     for ( int i = 0, n = views.count(); i < n; i++ )
         ((GLViewer_ViewFrame*)views[i])->onUpdate( flags );
 }
@@ -424,9 +429,9 @@ void GLViewer_Viewer::unhilightDetected()
 void GLViewer_Viewer::handleMousePress( QMouseEvent* e )
 {
     /* test accel for transforms */
-    if ( e->state() & GLViewer_ViewTransformer::accelKey() )
+    if ( e->modifiers() & GLViewer_ViewTransformer::accelKey() )
     {
-        ButtonState bs = e->button();
+        Qt::MouseButton bs = e->button();
         if ( bs == GLViewer_ViewTransformer::zoomButton() )
             activateTransform( Zoom );
         else if ( bs == GLViewer_ViewTransformer::panButton() )
@@ -458,7 +463,7 @@ void GLViewer_Viewer::handleMousePress( QMouseEvent* e )
 void GLViewer_Viewer::handleMouseMove( QMouseEvent* e )
 {
     /* Highlight for selection */
-    bool dragged = ( e->state() & ( LeftButton | MidButton | RightButton ) );
+    bool dragged = ( e->buttons() & ( Qt::LeftButton | Qt::MidButton | Qt::RightButton ) );
     if ( !dragged )
     {
         if ( getSelector() )
@@ -466,7 +471,7 @@ void GLViewer_Viewer::handleMouseMove( QMouseEvent* e )
     }
     /* Try to activate default sketching
     */
-    else if ( e->state() == GLViewer_ViewSketcher::sketchButton() )
+    else if ( e->button() == GLViewer_ViewSketcher::sketchButton() )
     {
         activateSketching( Rect );
         if ( mySketcher )
@@ -495,11 +500,11 @@ void GLViewer_Viewer::handleMouseRelease( QMouseEvent* e )
 {
     /* selection */
     /* tmp - in handleMousePress*/  
-    if( e->button() == LeftButton && !(getActiveView()->getViewPort()->currentBlock() & BS_Selection) )
+    if( e->button() == Qt::LeftButton && !(getActiveView()->getViewPort()->currentBlock() & BS_Selection) )
     {
         if ( getSelector() )
         {
-            bool append = bool ( e->state() & GLViewer_Selector::appendKey() );
+            bool append = bool ( e->modifiers() & GLViewer_Selector::appendKey() );
             getSelector()->select( append );
         }
     }
@@ -526,7 +531,7 @@ int GLViewer_ViewTransformer::panBtn = Qt::MidButton;
 int GLViewer_ViewTransformer::zoomBtn = Qt::LeftButton;
 int GLViewer_ViewTransformer::fitRectBtn = Qt::LeftButton;
 int GLViewer_ViewTransformer::panGlobalBtn = Qt::LeftButton;
-int GLViewer_ViewTransformer::acccelKey = Qt::ControlButton;
+int GLViewer_ViewTransformer::acccelKey = Qt::ControlModifier;
 
 /*!
     Constructor
@@ -535,8 +540,9 @@ GLViewer_ViewTransformer::GLViewer_ViewTransformer( GLViewer_Viewer* v, int type
 : QObject( 0 ),
 myViewer( v ),
 myType( type ),
-myMajorBtn( NoButton ),
-myButtonState( 0 )
+myMajorBtn( Qt::NoButton ),
+myButtonState( 0 ),
+myRectBand( 0 )
 {
     if ( myType == GLViewer_Viewer::Pan ||
          myType == GLViewer_Viewer::Zoom ||
@@ -563,6 +569,8 @@ GLViewer_ViewTransformer::~GLViewer_ViewTransformer()
     }
 
     //QAD_Application::getDesktop()->clearInfo();
+
+    endDrawRect();
 }
 
 /*!
@@ -645,11 +653,11 @@ bool GLViewer_ViewTransformer::eventFilter( QObject* o, QEvent* e )
             TransformState state = EnTrain;
             QMouseEvent* me = ( QMouseEvent* )e;
 
-            myButtonState = me->state();
+            myButtonState = me->modifiers();
             if ( e->type() == QEvent::MouseButtonPress )
                 myButtonState |= me->button();  /* add pressed button */
 
-            int mouseOnlyState = ( myButtonState & ( LeftButton | MidButton | RightButton ) );
+            int mouseOnlyState = ( myButtonState & ( Qt::LeftButton | Qt::MidButton | Qt::RightButton ) );
             if ( myStart.isNull() )
             {
                 state = Debut;
@@ -704,8 +712,8 @@ void GLViewer_ViewTransformer::onTransform( TransformState state )
         {
             if ( doTrsf )
             {
-                QRect rect( QMIN( myStart.x(), myCurr.x() ), QMIN( myStart.y(), myCurr.y() ),
-                            QABS( myStart.x() - myCurr.x() ), QABS( myStart.y() - myCurr.y() ) );
+                QRect rect( qMin( myStart.x(), myCurr.x() ), qMin( myStart.y(), myCurr.y() ),
+                            qAbs( myStart.x() - myCurr.x() ), qAbs( myStart.y() - myCurr.y() ) );
                 if ( !rect.isEmpty() )
                 {
                     switch ( state )
@@ -715,13 +723,7 @@ void GLViewer_ViewTransformer::onTransform( TransformState state )
                             break;
                         default:
                         {
-                            QPainter p( avp->getPaintDevice() ); // for QAD_GLWidget
-                            p.setPen( Qt::white );
-                            p.setRasterOp( Qt::XorROP );
-                            if ( !myDrawRect.isEmpty() )
-                                p.drawRect( myDrawRect );    /* erase */
-                            p.drawRect( rect );
-                            myDrawRect = rect;
+                            drawRect( rect );
                             break;
                         }
                     }
@@ -737,6 +739,34 @@ void GLViewer_ViewTransformer::onTransform( TransformState state )
         myViewer->activateTransform( GLViewer_Viewer::NoTransform );
 }
 
+/*!
+  Draws rectangle by starting and current points
+*/
+void GLViewer_ViewTransformer::drawRect(const QRect& theRect)
+{
+  if ( !myRectBand ) {
+    myRectBand = new QRubberBand( QRubberBand::Rectangle, myViewer->getActiveView()->getViewPort() );
+    QPalette palette;
+    palette.setColor(myRectBand->foregroundRole(), Qt::white);
+    myRectBand->setPalette(palette);
+  }
+  myRectBand->hide();
+
+  myRectBand->setGeometry( theRect );
+  myRectBand->setVisible( theRect.isValid() );
+}
+
+/*!
+  \brief Delete rubber band on the end on the dragging operation.
+*/
+void GLViewer_ViewTransformer::endDrawRect()
+{
+  if ( myRectBand ) myRectBand->hide();
+
+  delete myRectBand;
+  myRectBand = 0;
+}
+
 /*!
     Returns the type of the transformer. [ public ]
 */
@@ -746,7 +776,7 @@ int GLViewer_ViewTransformer::type() const
 }
 
 
-int GLViewer_ViewSketcher::sketchBtn = LeftButton;
+int GLViewer_ViewSketcher::sketchBtn = Qt::LeftButton;
 
 /*!
     Constructor
@@ -755,7 +785,8 @@ GLViewer_ViewSketcher::GLViewer_ViewSketcher( GLViewer_Viewer* viewer, int type
 : QObject( 0 ),
 myViewer( viewer ),
 myData( 0 ),
-myType( type )
+myType( type ),
+myRectBand( 0 )
 {
     if( !myViewer )
         return;
@@ -782,6 +813,8 @@ GLViewer_ViewSketcher::~GLViewer_ViewSketcher()
 
     if ( myType == GLViewer_Viewer::Rect )
         delete ( QRect* ) myData;
+
+    endDrawRect();
 }
 
 /*!
@@ -798,7 +831,7 @@ bool GLViewer_ViewSketcher::eventFilter( QObject* o, QEvent* e )
             SketchState state = EnTrain;
             QMouseEvent* me = (QMouseEvent*)e;
 
-            myButtonState = me->state();
+            myButtonState = me->modifiers();
             if ( e->type() == QEvent::MouseButtonPress )
                 myButtonState |= me->button();  /* add pressed button */
 
@@ -808,7 +841,7 @@ bool GLViewer_ViewSketcher::eventFilter( QObject* o, QEvent* e )
                 myStart = me->pos();
             }
 
-            int mouseOnlyState = ( myButtonState & ( LeftButton | MidButton | RightButton ) );
+            int mouseOnlyState = ( myButtonState & ( Qt::LeftButton | Qt::MidButton | Qt::RightButton ) );
             if ( e->type() == QEvent::MouseButtonRelease && mouseOnlyState == sketchButton() )
             {
                 state = Fin;
@@ -836,18 +869,15 @@ void GLViewer_ViewSketcher::onSketch( SketchState state )
         QRect* sketchRect = ( QRect* )data();
         if ( myButtonState & sketchButton() )
         {
-            QRect rect( QMIN( myStart.x(), myCurr.x() ), QMIN( myStart.y(), myCurr.y() ),
-                        QABS( myStart.x() - myCurr.x() ), QABS( myStart.y() - myCurr.y() ) );
+            QRect rect( qMin( myStart.x(), myCurr.x() ), qMin( myStart.y(), myCurr.y() ),
+                        qAbs( myStart.x() - myCurr.x() ), qAbs( myStart.y() - myCurr.y() ) );
             if ( !rect.isEmpty() )
             {
-                QPainter p( avp );
-                p.setPen( Qt::white );
-                p.setRasterOp( Qt::XorROP );
-                if ( !sketchRect->isEmpty() )
-                    p.drawRect( *sketchRect );    /* erase */
+               if ( !sketchRect->isEmpty() && myRectBand )
+                    myRectBand->hide();    /* erase */
                 *sketchRect = rect;
                 if ( state != Fin )
-                    p.drawRect( *sketchRect );
+                    drawRect( *sketchRect );
             }
         }
     }
@@ -858,3 +888,31 @@ void GLViewer_ViewSketcher::onSketch( SketchState state )
         myViewer->activateSketching( GLViewer_Viewer::NoSketching );
     }
 }
+
+/*!
+  Draws rectangle by starting and current points
+*/
+void GLViewer_ViewSketcher::drawRect(const QRect& theRect)
+{
+  if ( !myRectBand ) {
+    myRectBand = new QRubberBand( QRubberBand::Rectangle, myViewer->getActiveView()->getViewPort() );
+    QPalette palette;
+    palette.setColor(myRectBand->foregroundRole(), Qt::white);
+    myRectBand->setPalette(palette);
+  }
+  myRectBand->hide();
+
+  myRectBand->setGeometry( theRect );
+  myRectBand->setVisible( theRect.isValid() );
+}
+
+/*!
+  \brief Delete rubber band on the end on the dragging operation.
+*/
+void GLViewer_ViewSketcher::endDrawRect()
+{
+  if ( myRectBand ) myRectBand->hide();
+
+  delete myRectBand;
+  myRectBand = 0;
+}
index 0d68a450da8fb43ec6e3885adee7cd350340137d..c6626f6228b99c3e9ac007c8208ce1febc94ec93 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Viewer.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_VIEWER_H
 #define GLVIEWER_VIEWER_H
 
+#include "GLViewer.h"
 #include "GLViewer_Defs.h"
-#include "GLViewer_ViewFrame.h"
 #include <SUIT_ViewModel.h>
 
-#include <qlist.h>
-#include <qcursor.h>
-#include <qobject.h>
-#include <qpixmap.h>
+#include <QCursor>
+#include <QObject>
+
+class QMouseEvent;
+class QKeyEvent;
+class QWheelEvent;
+class QRect;
+class QRubberBand;
 
 class GLViewer_Selector;
 class GLViewer_ViewSketcher;
 class GLViewer_ViewTransformer;
+class GLViewer_ViewFrame;
 
-class SUIT_Desktop;
+//class SUIT_Desktop;
 class SUIT_ViewWindow;
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -68,7 +74,7 @@ public:
     virtual QString              getType() const { return Type(); }
     static QString               Type() { return "GLViewer_ViewModel";  }
 
-    virtual void                 contextMenuPopup( QPopupMenu* );
+    virtual void                 contextMenuPopup( QMenu* );
 
 public:
     void                         setSelectionMode( SelectionMode );
@@ -166,6 +172,9 @@ protected:
     virtual void                 onTransform( TransformState );
     void                         initTransform( bool );
 
+    void                         drawRect(const QRect& theRect);
+    void                         endDrawRect();
+
 protected:
     static int                   panBtn;
     static int                   zoomBtn;
@@ -180,8 +189,9 @@ protected:
     bool                         mySavedMouseTrack;
     QPoint                       myStart, myCurr;
     int                          myButtonState;
-    QRect                        myDrawRect;
     int                          myMajorBtn;
+
+    QRubberBand*                 myRectBand; //!< selection rectangle rubber band
 };
 
 class GLVIEWER_API GLViewer_ViewSketcher : public QObject
@@ -210,6 +220,9 @@ protected:
     enum SketchState { Debut, EnTrain, Fin };
     virtual void                 onSketch( SketchState );
 
+    void                         drawRect(const QRect& theRect);
+    void                         endDrawRect();
+
 protected:
     static int                   sketchBtn;
     GLViewer_Viewer*             myViewer;
@@ -218,9 +231,11 @@ protected:
     QCursor                      mySavedCursor;
     QPoint                       myStart, myCurr;
     int                          myButtonState;
+
+    QRubberBand*                 myRectBand; //!< selection rectangle rubber band
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 7d03218ba75fd020f4fddc20baf649323a817ff6..d801cb6425c65a1d3e9bba79a482e0cc953fa6a9 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Viewer2d.cxx
 // Created:   November, 2004
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_Viewer2d.h"
 #include "GLViewer_Object.h"
+#include "GLViewer_ViewFrame.h"
 #include "GLViewer_BaseObjects.h"
 #include "GLViewer_CoordSystem.h"
 #include "GLViewer_Context.h"
 #include "GLViewer_Drawer.h"
 #include "GLViewer_Selector2d.h"
-//#include "GLViewer_Sketcher.h"
 #include "GLViewer_ViewPort2d.h"
 
 #include "SUIT_Desktop.h"
 #include "SUIT_ViewWindow.h"
+#include "SUIT_ViewManager.h"
 
-#include "OSD_Timer.hxx"
-#include <TColStd_MapOfInteger.hxx>
-
-#include <qpopupmenu.h>
-#include <qpointarray.h>
-#include <qcolordialog.h>
+#include <QMenu>
+#include <QRect>
+#include <QFile>
+#include <QPolygon>
+#include <QMouseEvent>
+#include <QColorDialog>
 
 /*!
   Constructor
 GLViewer_Viewer2d::GLViewer_Viewer2d( const QString& title) :
 GLViewer_Viewer( title )
 {
-    myGLContext = new GLViewer_Context( this );
-
-    //myGLSketcher = new GLViewer_Sketcher( this );
+  myGLContext = new GLViewer_Context( this );
 
-    createSelector();
+  createSelector();
 
-    mySelMode = GLViewer_Viewer::Multiple;
+  mySelMode = GLViewer_Viewer::Multiple;
 
-    myDrawers.clear();
+  myDrawers.clear();
 }
 
 /*!
@@ -83,14 +83,14 @@ SUIT_ViewWindow* GLViewer_Viewer2d::createView( SUIT_Desktop* theDesktop )
   Adds item for change background color
   \param thePopup - menu
 */
-void GLViewer_Viewer2d::addPopupItems( QPopupMenu* thePopup )
+void GLViewer_Viewer2d::addPopupItems( QMenu* thePopup )
 {
   // CTH8434. "Change background color" menu item is available if there are no selected objects
   if ( getSelector() == 0 || getSelector()->numSelected() == 0 )
   {
-    if( thePopup->count() > 0 )
-        thePopup->insertSeparator();
-    thePopup->insertItem( tr( "CHANGE_BGCOLOR" ), this, SLOT( onChangeBgColor() ) );
+    if( thePopup->actions().count() > 0 )
+        thePopup->addSeparator();
+    thePopup->addAction( tr( "CHANGE_BGCOLOR" ), this, SLOT( onChangeBgColor() ) );
   }
 }
 
@@ -145,15 +145,15 @@ void GLViewer_Viewer2d::updateColors( QColor colorH, QColor colorS )
 */
 void GLViewer_Viewer2d::updateBorders( GLViewer_Rect* theRect )
 {
-  QPtrVector<SUIT_ViewWindow> views = getViewManager()->getViews();
+  QVector<SUIT_ViewWindow*> views = getViewManager()->getViews();
   for ( int i = 0, n = views.count(); i < n; i++ )
   {
     GLViewer_Rect* border = ( ( GLViewer_ViewPort2d* )((GLViewer_ViewFrame*)views[i])->getViewPort() )->getBorder();
 
-    border->setLeft( QMIN( border->left(), theRect->left() ) );
-    border->setRight( QMAX( border->right(), theRect->right() ) );
-    border->setBottom( QMIN( border->bottom(), theRect->bottom() ) );
-    border->setTop( QMAX( border->top(), theRect->top() ) );
+    border->setLeft( qMin( border->left(), theRect->left() ) );
+    border->setRight( qMax( border->right(), theRect->right() ) );
+    border->setBottom( qMin( border->bottom(), theRect->bottom() ) );
+    border->setTop( qMax( border->top(), theRect->top() ) );
   }
 }
 
@@ -162,7 +162,7 @@ void GLViewer_Viewer2d::updateBorders( GLViewer_Rect* theRect )
 */
 void GLViewer_Viewer2d::updateBorders()
 {
-    QPtrVector<SUIT_ViewWindow> views = getViewManager()->getViews();
+    QVector<SUIT_ViewWindow*> views = getViewManager()->getViews();
 
     ObjList anObjects = myGLContext->getObjects();
     ObjList::Iterator beginIt = anObjects.begin();
@@ -189,10 +189,10 @@ void GLViewer_Viewer2d::updateBorders()
             }
             else
             {
-                border->setLeft( QMIN( border->left(), aRect->left() ) );
-                border->setRight( QMAX( border->right(), aRect->right() ) );
-                border->setBottom( QMIN( border->bottom(), aRect->bottom() ) );
-                border->setTop( QMAX( border->top(), aRect->top() ) );
+                border->setLeft( qMin( border->left(), aRect->left() ) );
+                border->setRight( qMax( border->right(), aRect->right() ) );
+                border->setBottom( qMin( border->bottom(), aRect->bottom() ) );
+                border->setTop( qMax( border->top(), aRect->top() ) );
             }
         }
     }
@@ -206,7 +206,7 @@ void GLViewer_Viewer2d::updateAll()
   if ( !getActiveView() )
     return;
 
-  QPtrVector<SUIT_ViewWindow> views = getViewManager()->getViews();
+  QVector<SUIT_ViewWindow*> views = getViewManager()->getViews();
   for ( int i = 0, n = views.count(); i < n; i++ )
     ( ( GLViewer_ViewPort2d* )( ( GLViewer_ViewFrame* )views[i] )->getViewPort() )->getGLWidget()->updateGL();
 }
@@ -226,18 +226,18 @@ void GLViewer_Viewer2d::updateDrawers( GLboolean update, GLfloat scX, GLfloat sc
 /*!
   Activates drawers for objects from list \param theObjects only
 */
-void GLViewer_Viewer2d::activateDrawers( QValueList<GLViewer_Object*>& theObjects, bool onlyUpdate, GLboolean swap )
+void GLViewer_Viewer2d::activateDrawers( QList<GLViewer_Object*>& theObjects, bool onlyUpdate, GLboolean swap )
 {
     //cout << "GLViewer_Viewer2d::activateDrawers " << (int)onlyUpdate << " " << (int)swap << endl;
-    QValueList<GLViewer_Drawer*>::Iterator anIt = myDrawers.begin();
-    QValueList<GLViewer_Drawer*>::Iterator endDIt = myDrawers.end();
+    QList<GLViewer_Drawer*>::Iterator anIt = myDrawers.begin();
+    QList<GLViewer_Drawer*>::Iterator endDIt = myDrawers.end();
     for( ; anIt != endDIt; anIt++ )
         (*anIt)->clear();
 
-    QValueList<GLViewer_Drawer*> anActiveDrawers;
-    QValueList<GLViewer_Object*>::Iterator endOIt = theObjects.end();
+    QList<GLViewer_Drawer*> anActiveDrawers;
+    QList<GLViewer_Object*>::Iterator endOIt = theObjects.end();
 
-    for( QValueList<GLViewer_Object*>::Iterator oit = theObjects.begin(); oit != endOIt; ++oit )
+    for( QList<GLViewer_Object*>::Iterator oit = theObjects.begin(); oit != endOIt; ++oit )
     {
         GLViewer_Drawer* aDrawer = (*oit)->getDrawer();
         if( !aDrawer )
@@ -265,11 +265,11 @@ void GLViewer_Viewer2d::activateDrawers( QValueList<GLViewer_Object*>& theObject
 
         int aPriority = aDrawer->getPriority();
 
-        if( anActiveDrawers.findIndex( aDrawer ) != -1 )
+        if( anActiveDrawers.indexOf( aDrawer ) != -1 )
             continue;
 
-        QValueList<GLViewer_Drawer*>::Iterator aDIt = anActiveDrawers.begin();
-        QValueList<GLViewer_Drawer*>::Iterator aDEndIt = anActiveDrawers.end();
+        QList<GLViewer_Drawer*>::Iterator aDIt = anActiveDrawers.begin();
+        QList<GLViewer_Drawer*>::Iterator aDEndIt = anActiveDrawers.end();
         for( ; aDIt != aDEndIt; ++aDIt )
             if( (*aDIt)->getPriority() > aPriority )
                 break;
@@ -277,10 +277,10 @@ void GLViewer_Viewer2d::activateDrawers( QValueList<GLViewer_Object*>& theObject
         anActiveDrawers.insert( aDIt, aDrawer );
     } 
 
-    QValueList<GLViewer_Drawer*>::Iterator aDIt = anActiveDrawers.begin();
-    QValueList<GLViewer_Drawer*>::Iterator aDEndIt = anActiveDrawers.end();
+    QList<GLViewer_Drawer*>::Iterator aDIt = anActiveDrawers.begin();
+    QList<GLViewer_Drawer*>::Iterator aDEndIt = anActiveDrawers.end();
 
-    QPtrVector<SUIT_ViewWindow> views = getViewManager()->getViews();
+    QVector<SUIT_ViewWindow*> views = getViewManager()->getViews();
     for ( int i = 0, n = views.count(); i < n; i++ )
     {
         float xScale, yScale;
@@ -523,7 +523,7 @@ QRect* GLViewer_Viewer2d::getWinObjectRect( GLViewer_Object* theObject )
 
     GLfloat anAngle = curvp->getGLWidget()->getRotationAngle() * PI / 180.;
 
-    QPointArray aPointArray(4);
+    QPolygon aPointArray(4);
     aPointArray[0] = QPoint( (int)(aLeft*cos(anAngle) - aTop*sin(anAngle)),
                              (int)(aLeft*sin(anAngle) + aTop*cos(anAngle)) );
     aPointArray[1] = QPoint( (int)(aRight*cos(anAngle) - aTop*sin(anAngle)),
@@ -539,10 +539,10 @@ QRect* GLViewer_Viewer2d::getWinObjectRect( GLViewer_Object* theObject )
     {
         int x = aPointArray[i].x();
         int y = aPointArray[i].y();
-        aMinLeft = QMIN( aMinLeft,x );
-        aMaxRight = QMAX( aMaxRight, x );
-        aMinTop = QMIN( aMinTop, y );
-        aMaxBottom = QMAX( aMaxBottom, y );
+        aMinLeft = qMin( aMinLeft,x );
+        aMaxRight = qMax( aMaxRight, x );
+        aMinTop = qMin( aMinTop, y );
+        aMaxBottom = qMax( aMaxBottom, y );
     }
 
     aLeft = (aMinLeft/* + xPan*/)*xScale + aWidth / 2;
@@ -640,7 +640,7 @@ bool GLViewer_Viewer2d::testRotation( QMouseEvent* e )
 {
     if ( ( e->button() == GLViewer_View2dTransformer::rotateButton() ) &&
          ( e->type() == QEvent::MouseButtonPress ) &&
-         ( e->state() & GLViewer_ViewTransformer::accelKey() ) )
+         ( e->modifiers() & GLViewer_ViewTransformer::accelKey() ) )
     {
         activateTransform( GLViewer_Viewer::Rotate );
         return true;
@@ -667,7 +667,7 @@ void GLViewer_Viewer2d::insertHeader( VectorFileType aType, QFile& hFile )
         header += "%%Pages: 1\n";
         header += "%%Page: 1\n\n";
         
-        hFile.writeBlock( header.ascii(), header.length() );
+        hFile.write( header.toAscii() );
     }
     else if( aType == HPGL )
     {
@@ -681,7 +681,7 @@ void GLViewer_Viewer2d::insertHeader( VectorFileType aType, QFile& hFile )
         header += "LT;\n";
         header += "VS36;\n";
         
-        hFile.writeBlock( header.ascii(), header.length() );
+        hFile.write( header.toAscii() );
     }
 }
 
@@ -695,12 +695,12 @@ void GLViewer_Viewer2d::insertEnding( VectorFileType aType, QFile& hFile )
     if( aType == POST_SCRIPT )
     {
         QString ending = "showpage\n\n%%EOF";
-        hFile.writeBlock( ending.ascii(), ending.length() );
+        hFile.write( ending.toAscii() );
     }
     else if( aType == HPGL )
     {
         QString ending = "PU;PA0,0;SP;EC;PG1;EC1;OE\n"; 
-        hFile.writeBlock( ending.ascii(), ending.length() );
+        hFile.write( ending.toAscii() );
     }
 }
 
@@ -730,7 +730,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap
     if ( !getActiveView() )
       return false;
 
-        QFile hFile( FileName.ascii() );
+        QFile hFile( FileName.toAscii() );
 
 #ifdef WIN32
     HDC hMetaFileDC;
@@ -779,8 +779,8 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap
 
     if( aType==POST_SCRIPT || aType==HPGL )
     {
-        hFile.open( IO_ReadWrite | IO_Truncate );
-        hFile.at( 0 );
+        hFile.open( QIODevice::ReadWrite | QIODevice::Truncate );
+        hFile.seek( 0 );
         insertHeader( aType, hFile );
     }
 #ifdef WIN32
@@ -792,7 +792,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap
         HDC screen_dc = GetDC( 0 ); //The screen device context
         HDC bitDC = CreateCompatibleDC ( screen_dc ); //The context compatible with screen
 
-        hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.ascii(), &r, "" );
+        hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toAscii(), &r, "" );
         SetMapMode( hMetaFileDC, MM_HIMETRIC );
         SetWindowOrgEx( hMetaFileDC, 0, r.bottom, NULL );
         HRGN ClipRgn = CreateRectRgn( 0, 0, AW, AH );
@@ -818,7 +818,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap
                                arg( AW-mmLeft-mmRight ).arg( AH-mmBottom-mmTop );
         //It is set clipping path
 
-        hFile.writeBlock( aBuffer.ascii(), aBuffer.length() );
+        hFile.write( aBuffer.toAscii() );
 
         aCurVP->getGLWidget()->translateBackgroundToPS( hFile, &aViewerCS, &aPaperCS );
     }
@@ -874,15 +874,15 @@ void GLViewer_Viewer2d::repaintView( GLViewer_ViewFrame* theView, bool makeCurre
     float xScale;
     float yScale;
 
-    QValueList<GLViewer_Drawer*>::Iterator anIt = myDrawers.begin();
-    QValueList<GLViewer_Drawer*>::Iterator endDIt = myDrawers.end();
+    QList<GLViewer_Drawer*>::Iterator anIt = myDrawers.begin();
+    QList<GLViewer_Drawer*>::Iterator endDIt = myDrawers.end();
     for( ; anIt != endDIt; anIt++ )
             (*anIt)->clear();
 
-    QValueList<GLViewer_Drawer*> anActiveDrawers;
-    QValueList<GLViewer_Object*>::Iterator endOIt = anActiveObjs.end();
+    QList<GLViewer_Drawer*> anActiveDrawers;
+    QList<GLViewer_Object*>::Iterator endOIt = anActiveObjs.end();
 
-    for( QValueList<GLViewer_Object*>::Iterator oit = anActiveObjs.begin(); oit != endOIt; ++oit )
+    for( QList<GLViewer_Object*>::Iterator oit = anActiveObjs.begin(); oit != endOIt; ++oit )
     {
         GLViewer_Drawer* aDrawer = (*oit)->getDrawer();
         if( !aDrawer )
@@ -904,12 +904,12 @@ void GLViewer_Viewer2d::repaintView( GLViewer_ViewFrame* theView, bool makeCurre
             }
         }
         aDrawer->addObject( (*oit) );
-        if( anActiveDrawers.findIndex( aDrawer ) == -1 )
+        if( anActiveDrawers.indexOf( aDrawer ) == -1 )
             anActiveDrawers.append( aDrawer );
     } 
 
-    QValueList<GLViewer_Drawer*>::Iterator aDIt = anActiveDrawers.begin();
-    QValueList<GLViewer_Drawer*>::Iterator aDEndIt = anActiveDrawers.end();
+    QList<GLViewer_Drawer*>::Iterator aDIt = anActiveDrawers.begin();
+    QList<GLViewer_Drawer*>::Iterator aDEndIt = anActiveDrawers.end();
 
     GLViewer_ViewPort2d* vp = ( GLViewer_ViewPort2d* )aCurView->getViewPort();
     vp->getScale( xScale, yScale );
@@ -991,7 +991,7 @@ void GLViewer_Viewer2d::finishOperations( QMouseEvent* e )
         vp->finishSelectByRect();
         if ( getSelector() && !aSelRect.isNull() )
         {            
-            bool append = bool ( e->state() & GLViewer_Selector::appendKey() );
+            bool append = bool ( e->modifiers() & GLViewer_Selector::appendKey() );
             getSelector()->select( aSelRect, append );
         }
     }
@@ -1017,7 +1017,7 @@ void GLViewer_Viewer2d::startOperations( QWheelEvent* e )
 }
 
 
-int GLViewer_View2dTransformer::rotateBtn = RightButton;
+int GLViewer_View2dTransformer::rotateBtn = Qt::RightButton;
 
 /*!
   Constructor
index 93c9d30f00b1bb604d2bf47492f9023192594ac1..968aef8d390f154e265af4942e1118f834c647bf 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Viewer2d.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_VIEWER2D_H
 #define GLVIEWER_VIEWER2D_H
 
-#ifdef WNT
+#ifdef WIN32
 #include <windows.h>
 #endif
 
-#include <qmap.h>
-#include <qrect.h>
+class QRect;
+class QFile;
 
 #include "GLViewer_Viewer.h"
-#include "GLViewer_Object.h"
-#include "GLViewer_ViewFrame.h"
-#include "GLViewer_Drawer.h"
 
 #include <TColStd_SequenceOfInteger.hxx>
 
 #include <GL/gl.h>
 
 class GLViewer_Object;
+class GLViewer_ViewFrame;
+class GLViewer_Drawer;
 class GLViewer_Context;
-class GLViewer_Selector2d;
+class GLViewer_Rect;
 //class GLViewer_Sketcher;
 
 class SUIT_Desktop;
@@ -58,7 +58,7 @@ const double Sizes[2*5] = {
     /* A5 */ 148.5, 210.0
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -115,12 +115,12 @@ public:
   virtual SUIT_ViewWindow*  createView( SUIT_Desktop* );
   
   //! Adds item for change background color
-  void                 addPopupItems( QPopupMenu* );
+  void                 addPopupItems( QMenu* );
 
   //void                activateGLSketching( int );
 
   //! Returns all drawers
-  const QValueList<GLViewer_Drawer*>& getDrawers() const { return myDrawers; }
+  const QList<GLViewer_Drawer*>& getDrawers() const { return myDrawers; }
   
   //! Returns context
   GLViewer_Context*    getGLContext() const { return myGLContext; }
@@ -138,7 +138,7 @@ public:
   /* \param onlyUpdate is passed to method activateAllDrawersdrawers*/
   void                 updateDrawers( GLboolean onlyUpdate, GLfloat scX = 0.0, GLfloat scY = 0.0 );
   //! Activates drawers for objects from list \param theObjects only
-  void                 activateDrawers( QValueList<GLViewer_Object*>& theObjects, bool onlyUpdate, GLboolean swap = GL_FALSE );
+  void                 activateDrawers( QList<GLViewer_Object*>& theObjects, bool onlyUpdate, GLboolean swap = GL_FALSE );
   //! Activates drawer for \param theObject
   void                 activateDrawer( GLViewer_Object* theObject, bool onlyUpdate, GLboolean swap = GL_FALSE );
   //! Updates all drawers with new scale factor
@@ -224,7 +224,7 @@ protected:
   //! Current context 
   GLViewer_Context*             myGLContext;
   //! Map of active drawers
-  QValueList<GLViewer_Drawer*>  myDrawers;
+  QList<GLViewer_Drawer*>  myDrawers;
   
   //GLViewer_Sketcher*   myGLSketcher;
 };
@@ -247,7 +247,7 @@ protected:
   static  int          rotateBtn;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
 
index 1fc069d204406a7481a7b1eaa4953716c3bf86dc..30e1fa91548a4304b0eadce5c21b6bc4d69b029f 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Widget.cxx
 // Created:   November, 2004
-
+//
 #include "GLViewer_Widget.h"
 #include "GLViewer_ViewPort2d.h"
 #include "GLViewer_Viewer2d.h"
-#include "GLViewer_Compass.h"
+//#include "GLViewer_Compass.h"
 #include "GLViewer_Grid.h"
-#include "GLViewer_Object.h"
+//#include "GLViewer_Object.h"
 #include "GLViewer_CoordSystem.h"
+#include "GLViewer_ViewFrame.h"
 
 #include <cmath>
 using namespace std;
 
-#include <qevent.h>
-#include <qrect.h>
+#include <QEvent>
+#include <QPaintEvent>
+#include <QRect>
 
-#include <qpixmap.h>
-#include <qimage.h>
-#include <qapplication.h>
-#include <qintdict.h>
-#include <qpaintdevicemetrics.h>
-#include <qsize.h>
-#include <qtooltip.h>
+#include <QFile>
+//#include <qpixmap.h>
+#include <QImage>
+#include <QApplication>
+//#include <qintdict.h>
+//#include <qpaintdevicemetrics.h>
+//#include <qsize.h>
+#include <QToolTip>
 
 /*!
   A constructor
@@ -248,7 +252,8 @@ void GLViewer_Widget::setBackground( QString filename )
 void GLViewer_Widget::addToolTip( QString theString, QRect theRect )
 {
     myToolTipRect = theRect;
-    QToolTip::add( this, myToolTipRect, theString );
+    setToolTip(theString);
+    //QToolTip::add( this, myToolTipRect, theString );
 }
 
 /*!
@@ -256,7 +261,8 @@ void GLViewer_Widget::addToolTip( QString theString, QRect theRect )
 */
 void GLViewer_Widget::removeToolTip()
 {
-    QToolTip::remove( this, myToolTipRect );
+    setToolTip("");
+    //QToolTip::remove( this, myToolTipRect );
 }
 
 /*!
@@ -419,6 +425,18 @@ void GLViewer_Widget::leaveEvent( QEvent* e )
   updateGL();
 }
 
+/*!
+  Custom leave event handler
+*/
+bool GLViewer_Widget::event ( QEvent* e )
+{
+  if (e->type() == QEvent::ToolTip) {
+    QHelpEvent *helpEvent = static_cast<QHelpEvent *>(e);
+    if ( myToolTipRect.contains(helpEvent->pos()) )
+      QToolTip::showText(helpEvent->globalPos(), toolTip());
+  }
+  return QGLWidget::event(e);
+}
 
 /*!
   \return the hex code of digit < 16
@@ -488,7 +506,7 @@ void AddImagePart( QFile& hFile, QImage& image, int w1, int w2, int h1, int h2,
     
     aBuffer += "> false 3 colorimage\n\n";
 
-    hFile.writeBlock( aBuffer.ascii(), aBuffer.length() );
+    hFile.write( aBuffer.toAscii() );
   }
 }
 
@@ -548,7 +566,7 @@ void GLViewer_Widget::translateBackgroundToPS( QFile& hFile, GLViewer_CoordSyste
         const int max = 133000; //The maximum length of string in PS
         int dh = int( floor( double( max ) / ( 3.0*2.0*width ) ) );
         for( int k=buf.height()-1; k>=0; k-=dh )
-            AddImagePart( hFile, buf, 0, buf.width()-1, QMAX( k-dh+1, 0 ), k,
+            AddImagePart( hFile, buf, 0, buf.width()-1, qMax( k-dh+1, 0 ), k,
                           aViewerCS, aPSCS, a, b, c, d, dx, dy-(buf.height()-1-k) );
     }
 }
index 637beb5fb58c22654955f8f2ad0ff4b6817781cc..5a4d428e82d924c7de81b79b040e770cf8fa5467 100644 (file)
@@ -1,4 +1,7 @@
-//  Copyright (C) 2005 OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  Author : OPEN CASCADE
-//
-
 // File:      GLViewer_Widget.h
 // Created:   November, 2004
-
+//
 #ifndef GLVIEWER_WIDGET_H
 #define GLVIEWER_WIDGET_H
 
 #include "GLViewer.h"
 
-#include <qgl.h>
-#include <qfile.h>
+#include <QtOpenGL>
+
+class QFile;
 
 class GLViewer_ViewPort2d;
 class GLViewer_CoordSystem;
@@ -153,6 +155,8 @@ protected:
   virtual void           enterEvent( QEvent* );
   /* Needs to redefine because Window must be updated highlight presentation when mouse leave window */
   virtual void           leaveEvent( QEvent* );
+
+  virtual bool           event ( QEvent* );
   
 private:
   //! width of window
index 83fec2f0f43c8e945e84615dcbc1274d5269c103..4c4594a52e825e7bef90c1c3654ade249220f266 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : caf
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libGLViewer.la
 
-salomeinclude_HEADERS= \
-       GLViewer.h \
-       GLViewer_AspectLine.h \
-       GLViewer_BaseDrawers.h \
-       GLViewer_BaseObjects.h \
-       GLViewer_Compass.h \
-       GLViewer_Context.h \
-       GLViewer_CoordSystem.h \
-       GLViewer_Defs.h \
-       GLViewer_Drawer.h \
-       GLViewer_Geom.h \
-       GLViewer_Grid.h \
-       GLViewer_Group.h \
-       GLViewer_MimeSource.h \
-       GLViewer_Object.h \
-       GLViewer_Selector.h \
-       GLViewer_Selector2d.h \
-       GLViewer_Text.h \
-       GLViewer_Tools.h \
-       GLViewer_ToolTip.h \
-       GLViewer_ViewFrame.h \
-       GLViewer_ViewManager.h \
-       GLViewer_ViewPort.h \
-       GLViewer_ViewPort2d.h \
-       GLViewer_Viewer.h \
-       GLViewer_Viewer2d.h \
+salomeinclude_HEADERS =                \
+       GLViewer.h              \
+       GLViewer_AspectLine.h   \
+       GLViewer_BaseDrawers.h  \
+       GLViewer_BaseObjects.h  \
+       GLViewer_Compass.h      \
+       GLViewer_Context.h      \
+       GLViewer_CoordSystem.h  \
+       GLViewer_Defs.h         \
+       GLViewer_Drawer.h       \
+       GLViewer_Geom.h         \
+       GLViewer_Grid.h         \
+       GLViewer_Group.h        \
+       GLViewer_MimeData.h     \
+       GLViewer_Object.h       \
+       GLViewer_Selector.h     \
+       GLViewer_Selector2d.h   \
+       GLViewer_Text.h         \
+       GLViewer_Tools.h        \
+       GLViewer_ToolTip.h      \
+       GLViewer_ViewFrame.h    \
+       GLViewer_ViewManager.h  \
+       GLViewer_ViewPort.h     \
+       GLViewer_ViewPort2d.h   \
+       GLViewer_Viewer.h       \
+       GLViewer_Viewer2d.h     \
        GLViewer_Widget.h
 
-dist_libGLViewer_la_SOURCES= \
-       GLViewer_AspectLine.cxx \
-       GLViewer_BaseDrawers.cxx \
-       GLViewer_BaseObjects.cxx \
-       GLViewer_Compass.cxx \
-       GLViewer_Context.cxx \
-       GLViewer_CoordSystem.cxx \
-       GLViewer_Drawer.cxx \
-       GLViewer_Geom.cxx \
-       GLViewer_Grid.cxx \
-       GLViewer_Group.cxx \
-       GLViewer_MimeSource.cxx \
-       GLViewer_Object.cxx \
-       GLViewer_Selector.cxx \
-       GLViewer_Selector2d.cxx \
-       GLViewer_Text.cxx \
-       GLViewer_Tools.cxx \
-       GLViewer_ToolTip.cxx \
-       GLViewer_ViewFrame.cxx \
-       GLViewer_ViewManager.cxx \
-       GLViewer_ViewPort.cxx \
-       GLViewer_ViewPort2d.cxx \
-       GLViewer_Viewer.cxx \
-       GLViewer_Viewer2d.cxx \
+dist_libGLViewer_la_SOURCES =          \
+       GLViewer_AspectLine.cxx         \
+       GLViewer_BaseDrawers.cxx        \
+       GLViewer_BaseObjects.cxx        \
+       GLViewer_Compass.cxx            \
+       GLViewer_Context.cxx            \
+       GLViewer_CoordSystem.cxx        \
+       GLViewer_Drawer.cxx             \
+       GLViewer_Geom.cxx               \
+       GLViewer_Grid.cxx               \
+       GLViewer_Group.cxx              \
+       GLViewer_MimeData.cxx           \
+       GLViewer_Object.cxx             \
+       GLViewer_Selector.cxx           \
+       GLViewer_Selector2d.cxx         \
+       GLViewer_Text.cxx               \
+       GLViewer_Tools.cxx              \
+       GLViewer_ToolTip.cxx            \
+       GLViewer_ViewFrame.cxx          \
+       GLViewer_ViewManager.cxx        \
+       GLViewer_ViewPort.cxx           \
+       GLViewer_ViewPort2d.cxx         \
+       GLViewer_Viewer.cxx             \
+       GLViewer_Viewer2d.cxx           \
        GLViewer_Widget.cxx
 
-MOC_FILES= \
-       GLViewer_Selector_moc.cxx \
-       GLViewer_Selector2d_moc.cxx \
-       GLViewer_ToolTip_moc.cxx \
-       GLViewer_ViewFrame_moc.cxx \
-       GLViewer_ViewManager_moc.cxx \
-       GLViewer_ViewPort_moc.cxx \
-       GLViewer_ViewPort2d_moc.cxx \
-       GLViewer_Viewer_moc.cxx \
-       GLViewer_Viewer2d_moc.cxx \
+MOC_FILES =                            \
+       GLViewer_Selector_moc.cxx       \
+       GLViewer_Selector2d_moc.cxx     \
+       GLViewer_ToolTip_moc.cxx        \
+       GLViewer_ViewFrame_moc.cxx      \
+       GLViewer_ViewManager_moc.cxx    \
+       GLViewer_ViewPort_moc.cxx       \
+       GLViewer_ViewPort2d_moc.cxx     \
+       GLViewer_Viewer_moc.cxx         \
+       GLViewer_Viewer2d_moc.cxx       \
        GLViewer_Widget_moc.cxx
-nodist_libGLViewer_la_SOURCES= $(MOC_FILES)
+nodist_libGLViewer_la_SOURCES = $(MOC_FILES)
 
-dist_salomeres_DATA= \
-       resources/cursor_rotate.png \
-       resources/cursor_sketch.png \
-       resources/cursor_zoom.png \
-       resources/view_dump.png \
-       resources/view_fitall.png \
-       resources/view_fitarea.png \
-       resources/view_fitselect.png \
-       resources/view_glpan.png \
-       resources/view_pan.png \
-       resources/view_reset.png \
-       resources/view_zoom.png
+dist_salomeres_DATA =                  \
+       resources/gl_cursor_rotate.png  \
+       resources/gl_cursor_sketch.png  \
+       resources/gl_cursor_zoom.png    \
+       resources/gl_view_dump.png      \
+       resources/gl_view_fitall.png    \
+       resources/gl_view_fitarea.png   \
+       resources/gl_view_fitselect.png \
+       resources/gl_view_glpan.png     \
+       resources/gl_view_pan.png       \
+       resources/gl_view_reset.png     \
+       resources/gl_view_zoom.png
 
-nodist_salomeres_DATA= \
-       GLViewer_images.qm \
+nodist_salomeres_DATA =                \
+       GLViewer_images.qm      \
        GLViewer_msg_en.qm
 
-libGLViewer_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
-libGLViewer_la_LDFLAGS=$(QT_MT_LIBS) $(CAS_KERNEL)
-
-libGLViewer_la_LIBADD= ../SUIT/libsuit.la
+libGLViewer_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+libGLViewer_la_LDFLAGS  = $(QT_MT_LIBS) $(CAS_KERNEL) $(OGL_LIBS)
+libGLViewer_la_LIBADD   = ../SUIT/libsuit.la
index 256c033175c8d4c841035b5cc2fd92c7db5bcfd1..d9fb5fffa05e03a7bbb700fc14a1ff7d3e3dfb6b 100644 (file)
@@ -1,25 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      GLViewer_images.po
-// Created:   10/25/2004 12:46:36 PM
-// Author:    Sergey Anikin
-// Copyright (C) CEA 2004
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  File:      GLViewer_images.po
+#  Created:   10/25/2004 12:46:36 PM
+#  Author:    Sergey Anikin
 
 msgid ""
 msgstr ""
diff --git a/src/GLViewer/resources/GLViewer_images.ts b/src/GLViewer/resources/GLViewer_images.ts
new file mode 100644 (file)
index 0000000..5358816
--- /dev/null
@@ -0,0 +1,71 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>ICON_GL_DUMP</source>
+        <translation>gl_view_dump.png</translation>
+    </message>
+    <message>
+        <source>ICON_GL_ZOOM</source>
+        <translation>gl_view_zoom.png</translation>
+    </message>
+    <message>
+        <source>ICON_GL_PAN</source>
+        <translation>gl_view_pan.png</translation>
+    </message>
+    <message>
+        <source>ICON_GL_GLOBALPAN</source>
+        <translation>gl_view_glpan.png</translation>
+    </message>
+    <message>
+        <source>ICON_GL_CURSOR_ROTATE</source>
+        <translation>gl_cursor_rotate.png</translation>
+    </message>
+    <message>
+        <source>ICON_GL_CURSOR_SKETCH</source>
+        <translation>gl_cursor_sketch.png</translation>
+    </message>
+    <message>
+        <source>ICON_GL_CURSOR_ZOOM</source>
+        <translation>gl_cursor_zoom.png</translation>
+    </message>
+    <message>
+        <source>ICON_GL_FITALL</source>
+        <translation>gl_view_fitall.png</translation>
+    </message>
+    <message>
+        <source>ICON_GL_FITSELECT</source>
+        <translation>gl_view_fitselect.png</translation>
+    </message>
+    <message>
+        <source>ICON_GL_RESET</source>
+        <translation>gl_view_reset.png</translation>
+    </message>
+    <message>
+        <source>ICON_GL_FITAREA</source>
+        <translation>gl_view_fitarea.png</translation>
+    </message>
+</context>
+</TS>
index d978408314bc1aef08253fdc63c11a359a3d3dbf..91c6aa01f0e2c631fa52e45199497bd4dcb024fd 100644 (file)
@@ -1,25 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      GLViewer_msg_en.po
-// Created:   10/25/2004 12:46:36 PM
-// Author:    Sergey Anikin
-// Copyright (C) CEA 2004
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  File:      GLViewer_msg_en.po
+#  Created:   10/25/2004 12:46:36 PM
+#  Author:    Sergey Anikin
 
 msgid ""
 msgstr ""
diff --git a/src/GLViewer/resources/GLViewer_msg_en.ts b/src/GLViewer/resources/GLViewer_msg_en.ts
new file mode 100644 (file)
index 0000000..3099db1
--- /dev/null
@@ -0,0 +1,138 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>DSC_FITSELECT</source>
+        <translation>Fit area of selection within the view frame</translation>
+    </message>
+    <message>
+        <source>ERROR</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Dump</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panning</translation>
+    </message>
+    <message>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Selection of a new center of the view</translation>
+    </message>
+    <message>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Panning the view</translation>
+    </message>
+    <message>
+        <source>DSC_FITALL</source>
+        <translation>Fit all objects inside the view frame</translation>
+    </message>
+    <message>
+        <source>MNU_FITALL</source>
+        <translation>Fit All</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Global Panning</translation>
+    </message>
+    <message>
+        <source>INF_APP_DUMP_VIEW</source>
+        <translation>Dump view</translation>
+    </message>
+    <message>
+        <source>GL_IMAGE_FILES</source>
+        <translation>Images Files (*.bmp *.png)</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Reset</translation>
+    </message>
+    <message>
+        <source>DSC_FITRECT</source>
+        <translation>Fit area within the view frame</translation>
+    </message>
+    <message>
+        <source>MNU_FITRECT</source>
+        <translation>Fit Area</translation>
+    </message>
+    <message>
+        <source>CHANGE_BGCOLOR</source>
+        <translation>Change background...</translation>
+    </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Saves the active view in the image file</translation>
+    </message>
+    <message>
+        <source>MNU_FITSELECT</source>
+        <translation>Fit Selection</translation>
+    </message>
+    <message>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoom the view</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Reset View Point</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_CANT_SAVE_FILE</source>
+        <translation>Cannot save file</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>View Operations</translation>
+    </message>
+</context>
+<context>
+    <name>GLViewer_ViewFrame</name>
+    <message>
+        <source>DUMP_VIEW_SAVE_FILE_DLG_CAPTION</source>
+        <translation>Save Dump View in file</translation>
+    </message>
+    <message>
+        <source>DUMP_VIEW_ERROR_DLG_TEXT</source>
+        <translation>Can&apos;t save Dump View in file</translation>
+    </message>
+    <message>
+        <source>DUMP_VIEW_ERROR_DLG_CAPTION</source>
+        <translation>Error</translation>
+    </message>
+</context>
+<context>
+    <name>GLViewer_ViewManager</name>
+    <message>
+        <source>GL_VIEW_TITLE</source>
+        <translation>GL Scene:%M - viewer:%V</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/GLViewer/resources/cursor_rotate.png b/src/GLViewer/resources/cursor_rotate.png
deleted file mode 100755 (executable)
index a3cb0c1..0000000
Binary files a/src/GLViewer/resources/cursor_rotate.png and /dev/null differ
diff --git a/src/GLViewer/resources/cursor_sketch.png b/src/GLViewer/resources/cursor_sketch.png
deleted file mode 100755 (executable)
index 10cb585..0000000
Binary files a/src/GLViewer/resources/cursor_sketch.png and /dev/null differ
diff --git a/src/GLViewer/resources/cursor_zoom.png b/src/GLViewer/resources/cursor_zoom.png
deleted file mode 100755 (executable)
index 0020fea..0000000
Binary files a/src/GLViewer/resources/cursor_zoom.png and /dev/null differ
diff --git a/src/GLViewer/resources/gl_cursor_rotate.png b/src/GLViewer/resources/gl_cursor_rotate.png
new file mode 100755 (executable)
index 0000000..a3cb0c1
Binary files /dev/null and b/src/GLViewer/resources/gl_cursor_rotate.png differ
diff --git a/src/GLViewer/resources/gl_cursor_sketch.png b/src/GLViewer/resources/gl_cursor_sketch.png
new file mode 100755 (executable)
index 0000000..10cb585
Binary files /dev/null and b/src/GLViewer/resources/gl_cursor_sketch.png differ
diff --git a/src/GLViewer/resources/gl_cursor_zoom.png b/src/GLViewer/resources/gl_cursor_zoom.png
new file mode 100755 (executable)
index 0000000..0020fea
Binary files /dev/null and b/src/GLViewer/resources/gl_cursor_zoom.png differ
diff --git a/src/GLViewer/resources/gl_view_dump.png b/src/GLViewer/resources/gl_view_dump.png
new file mode 100644 (file)
index 0000000..b02616f
Binary files /dev/null and b/src/GLViewer/resources/gl_view_dump.png differ
diff --git a/src/GLViewer/resources/gl_view_fitall.png b/src/GLViewer/resources/gl_view_fitall.png
new file mode 100644 (file)
index 0000000..87e001d
Binary files /dev/null and b/src/GLViewer/resources/gl_view_fitall.png differ
diff --git a/src/GLViewer/resources/gl_view_fitarea.png b/src/GLViewer/resources/gl_view_fitarea.png
new file mode 100644 (file)
index 0000000..e83d023
Binary files /dev/null and b/src/GLViewer/resources/gl_view_fitarea.png differ
diff --git a/src/GLViewer/resources/gl_view_fitselect.png b/src/GLViewer/resources/gl_view_fitselect.png
new file mode 100755 (executable)
index 0000000..e52598d
Binary files /dev/null and b/src/GLViewer/resources/gl_view_fitselect.png differ
diff --git a/src/GLViewer/resources/gl_view_glpan.png b/src/GLViewer/resources/gl_view_glpan.png
new file mode 100644 (file)
index 0000000..28ab547
Binary files /dev/null and b/src/GLViewer/resources/gl_view_glpan.png differ
diff --git a/src/GLViewer/resources/gl_view_pan.png b/src/GLViewer/resources/gl_view_pan.png
new file mode 100644 (file)
index 0000000..ec56cac
Binary files /dev/null and b/src/GLViewer/resources/gl_view_pan.png differ
diff --git a/src/GLViewer/resources/gl_view_reset.png b/src/GLViewer/resources/gl_view_reset.png
new file mode 100644 (file)
index 0000000..66f81e6
Binary files /dev/null and b/src/GLViewer/resources/gl_view_reset.png differ
diff --git a/src/GLViewer/resources/gl_view_zoom.png b/src/GLViewer/resources/gl_view_zoom.png
new file mode 100644 (file)
index 0000000..386c966
Binary files /dev/null and b/src/GLViewer/resources/gl_view_zoom.png differ
diff --git a/src/GLViewer/resources/view_dump.png b/src/GLViewer/resources/view_dump.png
deleted file mode 100644 (file)
index 8eb63e0..0000000
Binary files a/src/GLViewer/resources/view_dump.png and /dev/null differ
diff --git a/src/GLViewer/resources/view_fitall.png b/src/GLViewer/resources/view_fitall.png
deleted file mode 100644 (file)
index c09ff94..0000000
Binary files a/src/GLViewer/resources/view_fitall.png and /dev/null differ
diff --git a/src/GLViewer/resources/view_fitarea.png b/src/GLViewer/resources/view_fitarea.png
deleted file mode 100644 (file)
index 5b79594..0000000
Binary files a/src/GLViewer/resources/view_fitarea.png and /dev/null differ
diff --git a/src/GLViewer/resources/view_fitselect.png b/src/GLViewer/resources/view_fitselect.png
deleted file mode 100755 (executable)
index 7ff3e0a..0000000
Binary files a/src/GLViewer/resources/view_fitselect.png and /dev/null differ
diff --git a/src/GLViewer/resources/view_glpan.png b/src/GLViewer/resources/view_glpan.png
deleted file mode 100644 (file)
index c23322a..0000000
Binary files a/src/GLViewer/resources/view_glpan.png and /dev/null differ
diff --git a/src/GLViewer/resources/view_pan.png b/src/GLViewer/resources/view_pan.png
deleted file mode 100644 (file)
index 038fba1..0000000
Binary files a/src/GLViewer/resources/view_pan.png and /dev/null differ
diff --git a/src/GLViewer/resources/view_reset.png b/src/GLViewer/resources/view_reset.png
deleted file mode 100644 (file)
index 1285064..0000000
Binary files a/src/GLViewer/resources/view_reset.png and /dev/null differ
diff --git a/src/GLViewer/resources/view_zoom.png b/src/GLViewer/resources/view_zoom.png
deleted file mode 100644 (file)
index b465739..0000000
Binary files a/src/GLViewer/resources/view_zoom.png and /dev/null differ
index 0fbeb1497b22e1c38c3684baaead94968727d41e..6afaa2b65075975eca048d558ce28e800db1e27a 100644 (file)
@@ -1,46 +1,46 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// File:      LightApp.h
-// Created:   June, 2005
-// Author:    OCC team
-
-
-// The following ifdef block is the standard way of creating macros which make exporting 
-// from a DLL simpler. All files within this DLL are compiled with the LightApp_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see 
-// LightApp_API functions as being imported from a DLL, wheras this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef WNT
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : LightApp.h
+// Author : OCC team
+//
+#ifndef LIGHTAPP_H
+#define LIGHTAPP_H
 
-#ifdef LIGHTAPP_EXPORTS
-#define LIGHTAPP_EXPORT __declspec(dllexport)
+#ifdef WIN32
+#  ifdef LIGHTAPP_EXPORTS
+#    define LIGHTAPP_EXPORT __declspec(dllexport)
+#  else
+#    define LIGHTAPP_EXPORT __declspec(dllimport)
+#  endif
 #else
-#define LIGHTAPP_EXPORT __declspec(dllimport)
-#endif
+#  define LIGHTAPP_EXPORT
+#endif // WIN32
 
+#if defined WNT
 #pragma warning ( disable:4251 )
 #pragma warning ( disable:4786 )
 #pragma warning ( disable:4503 )
-
-#else
-#define LIGHTAPP_EXPORT
-#endif               //WNT
+#endif
 
 #define APP_VERSION "0.1"
+
+#endif  // LIGHTAPP_H
diff --git a/src/LightApp/LightApp.pro b/src/LightApp/LightApp.pro
new file mode 100644 (file)
index 0000000..ffe32e5
--- /dev/null
@@ -0,0 +1,254 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = LightApp
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
+
+QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+HDF5_INCLUDES = $$(HDF5HOME)/include
+
+KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
+
+VTK_INCLUDES = $$(VTKHOME)/include/vtk
+
+QWT_INCLUDES = $$(QWTHOME)/include
+
+PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
+
+INCLUDEPATH += $${PYTHON_INCLUDES} $${QT_INCLUDES} $${CAS_CPPFLAGS} $${HDF5_INCLUDES} $${KERNEL_CXXFLAGS} ../SUIT ../STD ../CAM ../LogWindow ../Prs ../Qtx ../Event #../ObjBrowser
+
+#if ENABLE_VTKVIEWER
+  INCLUDEPATH += $${VTK_INCLUDES} ../VTKViewer
+#else
+#  DEFINES += DISABLE_VTKVIEWER
+#endif
+
+#if ENABLE_PLOT2DVIEWER
+  INCLUDEPATH += $${QWT_INCLUDES} ../Plot2d
+#else
+#  DEFINES += DISABLE_PLOT2DVIEWER
+#endif
+
+#if ENABLE_OCCVIEWER
+  INCLUDEPATH += ../OCCViewer
+#else !ENABLE_OCCVIEWER
+#  DEFINES += DISABLE_OCCVIEWER
+#endif
+
+#if ENABLE_PYCONSOLE
+  INCLUDEPATH += $${PYTHON_INCLUDES} ../PyConsole ../PyInterp
+#else !ENABLE_PYCONSOLE
+#  DEFINES += DISABLE_PYCONSOLE
+#endif
+
+#if ENABLE_GLVIEWER
+  INCLUDEPATH += ../GLViewer
+#else !ENABLE_GLVIEWER
+#  DEFINES += DISABLE_GLVIEWER
+#endif
+
+#if ENABLE_SUPERVGRAPHVIEWER
+  INCLUDEPATH += ../SUPERVGraph
+#else !ENABLE_SUPERVGRAPHVIEWER
+#  DEFINES += DISABLE_SUPERVGRAPHVIEWER
+#endif
+
+#if ENABLE_SALOMEOBJECT
+
+  INCLUDEPATH += ../OBJECT
+#if ENABLE_PLOT2DVIEWER
+  INCLUDEPATH += ../SPlot2d
+#endif
+
+#if ENABLE_OCCVIEWER
+  INCLUDEPATH += ../SOCC
+#endif
+
+#if ENABLE_VTKVIEWER
+  INCLUDEPATH += ../SVTK
+#endif
+
+#else !ENABLE_SALOMEOBJECT
+#  DEFINES += DISABLE_SALOMEOBJECT
+  
+#endif
+
+QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
+
+CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
+
+HDF5_LIBS = -L$$(HDF5HOME)/lib -lhdf5
+
+KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
+
+PYTHON_LIBS = -L$$(PYTHONHOME)/lib/python2.4/config -lpython2.4 -ldl -lutil
+
+LIBS += $${QT_MT_LIBS} -L../../lib -lsuit -lstd -lCAM -lLogWindow $${CAS_KERNEL} -lSalomePrs $${HDF5_LIBS} $${KERNEL_LDFLAGS} -lSalomeHDFPersist #-lObjBrowser
+
+#if ENABLE_PYCONSOLE
+  LIBS += $${PYTHON_LIBS}
+#endif
+
+#if ENABLE_SALOMEOBJECT
+  LIBS += -lSalomeObject
+#endif
+
+#if ENABLE_VTKVIEWER
+  LIBS += -lVTKViewer
+#if ENABLE_SALOMEOBJECT
+  LIBS += -lSVTK
+#endif
+#endif
+
+#if ENABLE_OCCVIEWER
+  LIBS += -lOCCViewer
+#if ENABLE_SALOMEOBJECT
+  LIBS += -lSOCC
+#endif
+#endif
+
+#if ENABLE_GLVIEWER
+  LIBS += -lGLViewer
+#endif
+
+#if ENABLE_PLOT2DVIEWER
+  LIBS += -lPlot2d
+#if ENABLE_SALOMEOBJECT
+  LIBS += -lSPlot2d
+#endif
+#endif
+
+#if ENABLE_PYCONSOLE
+  LIBS += -lPyInterp -lPyConsole
+#endif
+
+#if ENABLE_SUPERVGRAPHVIEWER
+  LIBS += -lSUPERVGraph
+#endif
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += LIGHTAPP_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = LightApp.h
+HEADERS += LightApp_AboutDlg.h
+HEADERS += LightApp_Application.h
+HEADERS += LightApp_DataModel.h
+HEADERS += LightApp_DataObject.h
+HEADERS += LightApp_DataOwner.h
+HEADERS += LightApp_DataSubOwner.h
+HEADERS += LightApp_Dialog.h
+HEADERS += LightApp_Displayer.h
+HEADERS += LightApp_Driver.h
+HEADERS += LightApp_EventFilter.h
+HEADERS += LightApp_HDFDriver.h
+HEADERS += LightApp_Module.h
+HEADERS += LightApp_ModuleAction.h
+HEADERS += LightApp_ModuleDlg.h
+HEADERS += LightApp_NameDlg.h
+#HEADERS += LightApp_OBFilter.h
+HEADERS += LightApp_OBSelector.h
+HEADERS += LightApp_Operation.h
+HEADERS += LightApp_Selection.h
+HEADERS += LightApp_SelectionMgr.h
+HEADERS += LightApp_ShowHideOp.h
+HEADERS += LightApp_Study.h
+HEADERS += LightApp_SwitchOp.h
+HEADERS += LightApp_Preferences.h
+HEADERS += LightApp_PreferencesDlg.h
+HEADERS += LightApp_RootObject.h
+HEADERS += LightApp_UpdateFlags.h
+HEADERS += LightApp_WidgetContainer.h
+
+#if ENABLE_VTKVIEWER
+#if ENABLE_SALOMEOBJECT
+  HEADERS += LightApp_VTKSelector.h
+#endif
+#endif
+#if ENABLE_OCCVIEWER
+  HEADERS += LightApp_OCCSelector.h
+#endif
+#if ENABLE_GLVIEWER
+  HEADERS += LightApp_GLSelector.h
+#endif
+
+SOURCES  = LightApp_AboutDlg.cxx
+SOURCES += LightApp_Application.cxx
+SOURCES += LightApp_DataModel.cxx
+SOURCES += LightApp_DataObject.cxx
+SOURCES += LightApp_DataOwner.cxx
+SOURCES += LightApp_DataSubOwner.cxx
+SOURCES += LightApp_Dialog.cxx
+SOURCES += LightApp_Displayer.cxx
+SOURCES += LightApp_Driver.cxx
+SOURCES += LightApp_EventFilter.cxx
+SOURCES += LightApp_HDFDriver.cxx
+SOURCES += LightApp_Module.cxx
+SOURCES += LightApp_ModuleAction.cxx
+SOURCES += LightApp_ModuleDlg.cxx
+SOURCES += LightApp_NameDlg.cxx
+#SOURCES += LightApp_OBFilter.cxx
+SOURCES += LightApp_OBSelector.cxx
+SOURCES += LightApp_Operation.cxx
+SOURCES += LightApp_Selection.cxx
+SOURCES += LightApp_SelectionMgr.cxx
+SOURCES += LightApp_ShowHideOp.cxx
+SOURCES += LightApp_Study.cxx
+SOURCES += LightApp_SwitchOp.cxx
+SOURCES += LightApp_Preferences.cxx
+SOURCES += LightApp_PreferencesDlg.cxx
+SOURCES += LightApp_WidgetContainer.cxx
+
+#if ENABLE_VTKVIEWER
+#if ENABLE_SALOMEOBJECT
+  SOURCES += LightApp_VTKSelector.cxx
+#endif
+#endif
+#if ENABLE_OCCVIEWER
+  SOURCES += LightApp_OCCSelector.cxx
+#endif
+#if ENABLE_GLVIEWER
+  SOURCES += LightApp_GLSelector.cxx
+#endif
+
+TRANSLATIONS = resources/LightApp_images.ts \
+               resources/LightApp_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 7dc4a48ae8d3f3ae18970b3f9e81f0fcd2a45952..0a48f79612045f511e6a99f3cecea0564e854f7b 100644 (file)
@@ -1,56 +1,68 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_AboutDlg.cxx
 // Created:   03.06.2005 13:52:45
 // Author:    Sergey TELKOV
-// Copyright (C) CEA 2005
-
+//
 #include "LightApp_AboutDlg.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qgroupbox.h>
+#include <QtxGridBox.h>
+
+#include <QLabel>
+#include <QVBoxLayout>
+#include <QPixmap>
+#include <QIcon>
+#include <QGroupBox>
 
 /*!Constructor.*/
 LightApp_AboutDlg::LightApp_AboutDlg( const QString& defName, const QString& defVer, QWidget* parent )
-: QtxDialog( parent, "salome_about_dialog", true, false, None )
+: QtxDialog( parent, true, false, None )
 {
+  setObjectName( "salome_about_dialog" );
+
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
 
   QPixmap ico = resMgr->loadPixmap( "LightApp", tr( "ICO_ABOUT" ), false );
   if ( !ico.isNull() )
-    setIcon( ico );
+    setWindowIcon( ico );
 
   QPalette pal = palette();
-  QColorGroup cg = pal.active();
-  cg.setColor( QColorGroup::Foreground, Qt::darkBlue ); 
-  cg.setColor( QColorGroup::Background, Qt::white );
-  pal.setActive( cg ); pal.setInactive( cg ); pal.setDisabled( cg );
+
+  pal.setBrush( QPalette::Active, QPalette::WindowText, QBrush( Qt::darkBlue ) );
+  pal.setBrush( QPalette::Active, QPalette::Window,     QBrush( Qt::white ) );
+
+  pal.setBrush( QPalette::Inactive, QPalette::WindowText, QBrush( Qt::darkBlue ) );
+  pal.setBrush( QPalette::Inactive, QPalette::Window,     QBrush( Qt::white ) );
+
+  pal.setBrush( QPalette::Disabled, QPalette::WindowText, QBrush( Qt::darkBlue ) );
+  pal.setBrush( QPalette::Disabled, QPalette::Window,     QBrush( Qt::white ) );
+
   setPalette(pal);
 
   QVBoxLayout* main = new QVBoxLayout( mainFrame() );
-  QGroupBox* base = new QGroupBox( 1, Qt::Horizontal, "", mainFrame() );
-  base->setFrameStyle( QFrame::NoFrame );
+  QtxGridBox* base = new QtxGridBox( 1, Qt::Horizontal, mainFrame(), 0, 0 );
   base->setInsideMargin( 0 );
   main->addWidget( base );
 
@@ -99,7 +111,7 @@ LightApp_AboutDlg::LightApp_AboutDlg( const QString& defName, const QString& def
   QString capText = tr( "ABOUT_CAPTION" );
   if ( capText.contains( "%1" ) )
     capText = capText.arg( defName );
-  setCaption( capText );
+  setWindowTitle( capText );
 
   setSizeGripEnabled( false );
 }
@@ -142,7 +154,7 @@ void LightApp_AboutDlg::checkLabel( QLabel* lab ) const
   if ( !lab )
     return;
 
-  bool vis = !lab->text().stripWhiteSpace().isEmpty() ||
+  bool vis = !lab->text().trimmed().isEmpty() ||
              ( lab->pixmap() && !lab->pixmap()->isNull() );
   vis ? lab->show() : lab->hide();
 }
index 8fb3b97f214e71b70c9460cd34380e501846f250..71216a37e5950f09a9f3d563ae7639d850c54532 100644 (file)
@@ -1,26 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_AboutDlg.h
 // Created:   03.06.2005 13:49:25
 // Author:    Sergey TELKOV
-// Copyright (C) CEA 2005
-
+//
 #ifndef LIGHTAPP_ABOUTDLG_H
 #define LIGHTAPP_ABOUTDLG_H
 
index 2e59728d023febeb1f739a63ea596adcb42519fb..2b81c7a0b71f1ba8a724b09b2b445cc205b839dd 100644 (file)
@@ -1,33 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_Application.cxx
 // Created:   6/20/2005 18:39:45 PM
 // Author:    Natalia Donis
-// Copyright (C) CEA 2005
-
+//
 #ifndef DISABLE_PYCONSOLE
-  #include "PythonConsole_PyInterp.h" // WARNING! This include must be the first!
-  #include <PythonConsole_PyConsole.h>
+  #include <PyConsole_Interp.h> // WARNING! This include must be the first!
+  #include <PyConsole_Console.h>
 #endif
 
 #include "LightApp_Application.h"
-#include "LightApp_WidgetContainer.h"
 #include "LightApp_Module.h"
 #include "LightApp_DataModel.h"
 #include "LightApp_Study.h"
 #include "LightApp_PreferencesDlg.h"
 #include "LightApp_ModuleDlg.h"
 #include "LightApp_AboutDlg.h"
-
-#include "LightApp_OBFilter.h"
-
+#include "LightApp_ModuleAction.h"
+// temporary commented
+//#include "LightApp_OBFilter.h"
 #include "LightApp_EventFilter.h"
-
 #include "LightApp_OBSelector.h"
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_DataObject.h"
 
+#include <SALOME_Event.h>
+
+#include <Style_Salome.h>
+#include <Style_PrefDlg.h>
+
 #include <CAM_Module.h>
 #include <CAM_DataModel.h>
 #include <CAM_Study.h>
 #include <STD_TabDesktop.h>
 
+#include <SUIT_DataBrowser.h>
 #include <SUIT_Session.h>
 #include <SUIT_Study.h>
 #include <SUIT_FileDlg.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Tools.h>
 #include <SUIT_Accel.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ViewWindow.h>
 
+#include <Qtx.h>
+#include <QtxToolBar.h>
+#include <QtxTreeView.h>
 #include <QtxMRUAction.h>
 #include <QtxDockAction.h>
-#include <QtxToolBar.h>
-#include <qprocess.h>
+#include <QtxDockWidget.h>
+#include <QtxActionToolMgr.h>
+#include <QtxSearchTool.h>
+#include <QtxWorkstack.h>
 
 #include <LogWindow.h>
-#include <OB_Browser.h>
-#include <OB_ListView.h>
-#include <OB_ObjSearch.h>
 
 #ifndef DISABLE_GLVIEWER
   #include <GLViewer_Viewer.h>
@@ -75,6 +85,7 @@
 #ifndef DISABLE_PLOT2DVIEWER
   #include <Plot2d_ViewManager.h>
   #include <Plot2d_ViewModel.h>
+  #include "LightApp_Plot2dSelector.h"
 #ifndef DISABLE_SALOMEOBJECT
   #include <SPlot2d_ViewModel.h>
 #else
 #endif
 #endif
 
+#include <QxScene_ViewManager.h>
+#include <QxScene_ViewModel.h>
+#include <QxScene_ViewWindow.h>
+
 #ifndef DISABLE_OCCVIEWER
   #include <OCCViewer_ViewManager.h>
 #ifndef DISABLE_SALOMEOBJECT
   #include <QxGraph_ViewManager.h>
 #endif
 
-#include <QtxWorkstack.h>
-
-#include <qdir.h>
-#include <qimage.h>
-#include <qstring.h>
-#include <qwidget.h>
-#include <qstringlist.h>
-#include <qfile.h>
-#include <qapplication.h>
-#include <qmap.h>
-#include <qstatusbar.h>
-#include <qthread.h>
-#include <qobjectlist.h>
-#include <qcombobox.h>
-#include <qinputdialog.h>
-#include <qmessagebox.h>
-#include <qfontdatabase.h>
+#include <QDir>
+#include <QImage>
+#include <QString>
+#include <QWidget>
+#include <QStringList>
+#include <QFile>
+#include <QApplication>
+#include <QMap>
+#include <QStatusBar>
+#include <QThread>
+#include <QObjectList>
+#include <QComboBox>
+#include <QInputDialog>
+#include <QFontDatabase>
+#include <QIcon>
+#include <QByteArray>
+#include <QMenu>
+#include <QProcess>
+
+#include <utilities.h>
 
 #define FIRST_HELP_ID 1000000
 
 #ifndef DISABLE_SALOMEOBJECT
-  #include "SALOME_InteractiveObject.hxx"
-  #include "SALOME_ListIO.hxx"
+  #include <SALOME_InteractiveObject.hxx>
+  #include <SALOME_ListIO.hxx>
 #endif
 
+#define ToolBarMarker    0
+#define DockWidgetMarker 1
+
 static const char* imageEmptyIcon[] = {
 "20 20 1 1",
 ".     c None",
@@ -192,7 +213,7 @@ LightApp_Preferences* LightApp_Application::_prefs_ = 0;
 /*!Constructor.*/
 LightApp_Application::LightApp_Application()
 : CAM_Application( false ),
-myPrefs( 0 )
+  myPrefs( 0 )
 {
   STD_TabDesktop* desk = new STD_TabDesktop();
 
@@ -201,14 +222,14 @@ myPrefs( 0 )
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
   QPixmap aLogo = aResMgr->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false );
 
-  desktop()->setIcon( aLogo );
-  desktop()->setDockableMenuBar( true );
+  desktop()->setWindowIcon( aLogo );
+  desktop()->setDockableMenuBar( false );
   desktop()->setDockableStatusBar( false );
 
   // base logo (salome itself)
-  desktop()->addLogo( "_app_base",  aResMgr->loadPixmap( "LightApp", tr( "APP_BASE_LOGO" ), false ) );
+  desktop()->logoInsert( "_app_base",  aResMgr->loadPixmap( "LightApp", tr( "APP_BASE_LOGO" ), false ) );
   // extra logo (salome-based application)
-  desktop()->addLogo( "_app_extra", aResMgr->loadPixmap( "LightApp", tr( "APP_EXTRA_LOGO" ), false ) );
+  desktop()->logoInsert( "_app_extra", aResMgr->loadPixmap( "LightApp", tr( "APP_EXTRA_LOGO" ), false ) );
 
   clearViewManagers();
 
@@ -217,39 +238,39 @@ myPrefs( 0 )
   myAccel = SUIT_Accel::getAccel();
 
 #ifndef DISABLE_OCCVIEWER
-  myAccel->setActionKey( SUIT_Accel::PanLeft,     CTRL+Key_Left,     OCCViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::PanRight,    CTRL+Key_Right,    OCCViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::PanUp,       CTRL+Key_Up,       OCCViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::PanDown,     CTRL+Key_Down,     OCCViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::ZoomIn,      CTRL+Key_Plus,     OCCViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::ZoomOut,     CTRL+Key_Minus,    OCCViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::ZoomFit,     CTRL+Key_Asterisk, OCCViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::RotateLeft,  ALT+Key_Left,      OCCViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::RotateRight, ALT+Key_Right,     OCCViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::RotateUp,    ALT+Key_Up,        OCCViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::RotateDown,  ALT+Key_Down,      OCCViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanLeft,     Qt::CTRL+Qt::Key_Left,     OCCViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanRight,    Qt::CTRL+Qt::Key_Right,    OCCViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanUp,       Qt::CTRL+Qt::Key_Up,       OCCViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanDown,     Qt::CTRL+Qt::Key_Down,     OCCViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::ZoomIn,      Qt::CTRL+Qt::Key_Plus,     OCCViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::ZoomOut,     Qt::CTRL+Qt::Key_Minus,    OCCViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::ZoomFit,     Qt::CTRL+Qt::Key_Asterisk, OCCViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::RotateLeft,  Qt::ALT+Qt::Key_Left,      OCCViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::RotateRight, Qt::ALT+Qt::Key_Right,     OCCViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::RotateUp,    Qt::ALT+Qt::Key_Up,        OCCViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::RotateDown,  Qt::ALT+Qt::Key_Down,      OCCViewer_Viewer::Type() );
 #endif
 #ifndef DISABLE_VTKVIEWER
-  myAccel->setActionKey( SUIT_Accel::PanLeft,     CTRL+Key_Left,     VTKViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::PanRight,    CTRL+Key_Right,    VTKViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::PanUp,       CTRL+Key_Up,       VTKViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::PanDown,     CTRL+Key_Down,     VTKViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::ZoomIn,      CTRL+Key_Plus,     VTKViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::ZoomOut,     CTRL+Key_Minus,    VTKViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::ZoomFit,     CTRL+Key_Asterisk, VTKViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::RotateLeft,  ALT+Key_Left,      VTKViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::RotateRight, ALT+Key_Right,     VTKViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::RotateUp,    ALT+Key_Up,        VTKViewer_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::RotateDown,  ALT+Key_Down,      VTKViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanLeft,     Qt::CTRL+Qt::Key_Left,     VTKViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanRight,    Qt::CTRL+Qt::Key_Right,    VTKViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanUp,       Qt::CTRL+Qt::Key_Up,       VTKViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanDown,     Qt::CTRL+Qt::Key_Down,     VTKViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::ZoomIn,      Qt::CTRL+Qt::Key_Plus,     VTKViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::ZoomOut,     Qt::CTRL+Qt::Key_Minus,    VTKViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::ZoomFit,     Qt::CTRL+Qt::Key_Asterisk, VTKViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::RotateLeft,  Qt::ALT+Qt::Key_Left,      VTKViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::RotateRight, Qt::ALT+Qt::Key_Right,     VTKViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::RotateUp,    Qt::ALT+Qt::Key_Up,        VTKViewer_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::RotateDown,  Qt::ALT+Qt::Key_Down,      VTKViewer_Viewer::Type() );
 #endif
 #ifndef DISABLE_PLOT2DVIEWER
-  myAccel->setActionKey( SUIT_Accel::PanLeft,     CTRL+Key_Left,     Plot2d_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::PanRight,    CTRL+Key_Right,    Plot2d_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::PanUp,       CTRL+Key_Up,       Plot2d_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::PanDown,     CTRL+Key_Down,     Plot2d_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::ZoomIn,      CTRL+Key_Plus,     Plot2d_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::ZoomOut,     CTRL+Key_Minus,    Plot2d_Viewer::Type() );
-  myAccel->setActionKey( SUIT_Accel::ZoomFit,     CTRL+Key_Asterisk, Plot2d_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanLeft,     Qt::CTRL+Qt::Key_Left,     Plot2d_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanRight,    Qt::CTRL+Qt::Key_Right,    Plot2d_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanUp,       Qt::CTRL+Qt::Key_Up,       Plot2d_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::PanDown,     Qt::CTRL+Qt::Key_Down,     Plot2d_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::ZoomIn,      Qt::CTRL+Qt::Key_Plus,     Plot2d_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::ZoomOut,     Qt::CTRL+Qt::Key_Minus,    Plot2d_Viewer::Type() );
+  myAccel->setActionKey( SUIT_Accel::ZoomFit,     Qt::CTRL+Qt::Key_Asterisk, Plot2d_Viewer::Type() );
 #endif
 
   connect( mySelMgr, SIGNAL( selectionChanged() ), this, SLOT( onSelection() ) );
@@ -257,15 +278,15 @@ myPrefs( 0 )
   // Set existing font for the python console in resources
   if( !aResMgr->hasValue( "PyConsole", "font" ) )
     return;
-  
+
   QFont f = aResMgr->fontValue( "PyConsole", "font" );
   QFontDatabase fdb;
   QStringList famdb = fdb.families();
-  
+
   if ( famdb.contains(f.family()) || !aResMgr->hasValue( "PyConsole", "additional_families" ) )
     return;
-  
-  QStringList anAddFamilies = QStringList::split( ";", aResMgr->stringValue( "PyConsole", "additional_families" ) );
+
+  QStringList anAddFamilies = aResMgr->stringValue( "PyConsole", "additional_families" ).split( ";", QString::SkipEmptyParts );
   QString aFamily;
   for ( QStringList::Iterator it = anAddFamilies.begin(); it != anAddFamilies.end(); ++it )
     {
@@ -293,20 +314,13 @@ LightApp_Application::~LightApp_Application()
 /*!Start application.*/
 void LightApp_Application::start()
 {
-  if ( desktop() )
-    desktop()->loadGeometry( resourceMgr(), "desktop" );
-
   CAM_Application::start();
 
-  QAction* a = action( ViewWindowsId );
-  if ( a && a->inherits( "QtxDockAction" ) )
-    ((QtxDockAction*)a)->setAutoPlace( true );
-
   updateWindows();
   updateViewManagers();
 
   putInfo( "" );
-  desktop()->statusBar()->message( "" );
+  desktop()->statusBar()->showMessage( "" );
 
   LightApp_EventFilter::Init();
 }
@@ -337,10 +351,9 @@ QString LightApp_Application::applicationVersion() const
       path += QString( "bin/salome/VERSION" );
 
       QFile vf( path );
-      if ( vf.open( IO_ReadOnly ) )
+      if ( vf.open( QIODevice::ReadOnly ) )
       {
-        QString line;
-       vf.readLine( line, 1024 );
+        QString line( vf.readLine( 1024 ) );
        vf.close();
 
        if ( !line.isEmpty() )
@@ -348,20 +361,20 @@ QString LightApp_Application::applicationVersion() const
          while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
            line.remove( line.length() - 1, 1 );
 
-         int idx = line.findRev( ":" );
+         int idx = line.lastIndexOf( ":" );
          if ( idx != -1 )
-           _app_version = line.mid( idx + 1 ).stripWhiteSpace();
+           _app_version = line.mid( idx + 1 ).trimmed();
         }
       }
     }
   }
-  return _app_version;  
+  return _app_version;
 }
 
 /*!Load module by \a name.*/
-CAM_Module* LightApp_Application::loadModule( const QString& name )
+CAM_Module* LightApp_Application::loadModule( const QString& name, const bool showMsg )
 {
-  CAM_Module* mod = CAM_Application::loadModule( name );
+  CAM_Module* mod = CAM_Application::loadModule( name, showMsg );
   if ( mod )
   {
     connect( this, SIGNAL( studyOpened() ), mod, SLOT( onModelOpened() ) );
@@ -383,15 +396,15 @@ bool LightApp_Application::activateModule( const QString& modName )
   if ( actName == modName )
     return true;
 
-  putInfo( tr( "ACTIVATING_MODULE" ).arg( modName ) );  
+  putInfo( tr( "ACTIVATING_MODULE" ).arg( modName ) );
 
-  saveWindowsGeometry();
+  saveDockWindowsState();
 
   bool status = CAM_Application::activateModule( modName );
 
   updateModuleActions();
 
-  putInfo( "" );  
+  putInfo( "" );
 
   if ( !status )
     return false;
@@ -402,22 +415,6 @@ bool LightApp_Application::activateModule( const QString& modName )
   return true;
 }
 
-/*!
-  Opens other study into active Study. If Study is empty - creates it.
-  \param theName - name of study
-*/
-bool LightApp_Application::useStudy(const QString& theName)
-{
-  createEmptyStudy();
-  LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
-  bool res = false;
-  if (aStudy)
-    res = aStudy->loadDocument( theName );
-  updateDesktopTitle();
-  updateCommandsStatus();
-  return res;
-}
-
 /*!Gets selection manager.*/
 LightApp_SelectionMgr* LightApp_Application::selectionMgr() const
 {
@@ -430,10 +427,10 @@ void LightApp_Application::createActionForViewer( const int id,
                                                   const QString& suffix,
                                                   const int accel )
 {
-  QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ), QIconSet(),
-                              tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ),
-                              tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ),
-                              accel, desktop(), false, this, SLOT( onNewWindow() ) );
+  QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ), QIcon(),
+                            tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ),
+                            tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ),
+                            accel, desktop(), false, this, SLOT( onNewWindow() ) );
   createMenu( a, parentId, -1 );
 }
 
@@ -446,9 +443,9 @@ void LightApp_Application::createActions()
   SUIT_ResourceMgr* resMgr = resourceMgr();
 
   //! Preferences
-  createAction( PreferencesId, tr( "TOT_DESK_PREFERENCES" ), QIconSet(),
+  createAction( PreferencesId, tr( "TOT_DESK_PREFERENCES" ), QIcon(),
                tr( "MEN_DESK_PREFERENCES" ), tr( "PRP_DESK_PREFERENCES" ),
-               CTRL+Key_F, desk, false, this, SLOT( onPreferences() ) );
+               Qt::CTRL+Qt::Key_R, desk, false, this, SLOT( onPreferences() ) );
 
   //! Help for modules
   int helpMenu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1, 1000 );
@@ -460,32 +457,36 @@ void LightApp_Application::createActions()
 
   int id = LightApp_Application::UserID + FIRST_HELP_ID;
   // help for KERNEL and GUI
-  QCString dir;
+  QString dir;//QByteArray dir;
   QString aFileName = "index.html";
   QString root;
   QAction* a;
-  if (dir = getenv("GUI_ROOT_DIR")) {
+  dir = getenv("GUI_ROOT_DIR");
+  if ( !dir.isEmpty() ) {
     root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") +
                           Qtx::addSlash("salome") + Qtx::addSlash("gui") +  Qtx::addSlash("GUI") );
     if ( QFileInfo( root + aFileName ).exists() ) {
-      a = createAction( id, tr( QString("GUI Help") ), QIconSet(),
-                       tr( QString("GUI Help") ),
-                       tr( QString("GUI Help") ),
+      a = createAction( id, tr( QString("GUI Help").toLatin1().constData() ),
+                       resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
+                       tr( QString("GUI Help").toLatin1().constData() ),
+                       tr( QString("GUI Help").toLatin1().constData() ),
                        0, desk, false, this, SLOT( onHelpContentsModule() ) );
-      a->setName( QString("GUI") );
+      a->setObjectName( QString("GUI") );
       createMenu( a, helpModuleMenu, -1 );
       id++;
     }
   }
-  if (dir = getenv("KERNEL_ROOT_DIR")) {
-    root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") + 
+  dir = getenv("KERNEL_ROOT_DIR");
+  if ( !dir.isEmpty() ) {
+    root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") +
                          Qtx::addSlash("salome") );
     if ( QFileInfo( root + aFileName ).exists() ) {
-      a = createAction( id, tr( QString("KERNEL Help") ), QIconSet(),
-                       tr( QString("KERNEL Help") ),
-                       tr( QString("KERNEL Help") ),
+      a = createAction( id, tr( QString("KERNEL Help").toLatin1().constData() ),
+                       resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
+                       tr( QString("KERNEL Help").toLatin1().constData() ),
+                       tr( QString("KERNEL Help").toLatin1().constData() ),
                        0, desk, false, this, SLOT( onHelpContentsModule() ) );
-      a->setName( QString("KERNEL") );
+      a->setObjectName( QString("KERNEL") );
       createMenu( a, helpModuleMenu, -1 );
       id++;
     }
@@ -498,17 +499,19 @@ void LightApp_Application::createActions()
       continue;
 
     QString modName = moduleName( *it );
-    
-    if (dir = getenv( modName + "_ROOT_DIR")) {
-      root = Qtx::addSlash( Qtx::addSlash(dir) +  Qtx::addSlash("share") + Qtx::addSlash("doc") + 
+
+    dir = getenv( (modName + "_ROOT_DIR").toLatin1().constData() );
+    if ( !dir.isEmpty() ) {
+      root = Qtx::addSlash( Qtx::addSlash(dir) +  Qtx::addSlash("share") + Qtx::addSlash("doc") +
                             Qtx::addSlash("salome") + Qtx::addSlash("gui") +  Qtx::addSlash(modName) );
       if ( QFileInfo( root + aFileName ).exists() ) {
 
-       QAction* a = createAction( id, tr( moduleTitle(modName) + QString(" Help") ), QIconSet(),
-                                  tr( moduleTitle(modName) + QString(" Help") ),
-                                  tr( moduleTitle(modName) + QString(" Help") ),
+       QAction* a = createAction( id, tr( (moduleTitle(modName) + QString(" Help")).toLatin1().constData() ),
+                                  resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
+                                  tr( (moduleTitle(modName) + QString(" Help")).toLatin1().constData() ),
+                                  tr( (moduleTitle(modName) + QString(" Help")).toLatin1().constData() ),
                                   0, desk, false, this, SLOT( onHelpContentsModule() ) );
-       a->setName( modName );
+       a->setObjectName( modName );
        createMenu( a, helpModuleMenu, -1 );
        id++;
       }
@@ -516,8 +519,8 @@ void LightApp_Application::createActions()
   }
 
   //! MRU
-  QtxMRUAction* mru = new QtxMRUAction( tr( "TOT_DESK_MRU" ), tr( "MEN_DESK_MRU" ), desk );
-  connect( mru, SIGNAL( activated( QString ) ), this, SLOT( onMRUActivated( QString ) ) );
+  static QtxMRUAction* mru = new QtxMRUAction( tr( "TOT_DESK_MRU" ), tr( "MEN_DESK_MRU" ), 0 );
+  connect( mru, SIGNAL( activated( const QString& ) ), this, SLOT( onMRUActivated( const QString& ) ) );
   registerAction( MRUId, mru );
 
   // default icon for neutral point ('SALOME' module)
@@ -533,42 +536,21 @@ void LightApp_Application::createActions()
   QStringList modList;
   modules( modList, false );
 
-  if( modList.count()>1 )
+  if ( modList.count() > 1 )
   {
-    QToolBar* modTBar = new QtxToolBar( true, desk );
-    modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) );
-
-    QActionGroup* modGroup = new QActionGroup( this );
-    modGroup->setExclusive( true );
-    modGroup->setUsesDropDown( true );
-
-    a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ),
-                      tr( "PRP_APP_MODULE" ), 0, desk, true );
-    modGroup->add( a );
-    myActions.insert( QString(), a );
+    LightApp_ModuleAction* moduleAction =
+      new LightApp_ModuleAction( tr( "APP_NAME" ), defIcon, desk );
 
     QMap<QString, QString> iconMap;
     moduleIconNames( iconMap );
 
     const int iconSize = 20;
 
-    modGroup->addTo( modTBar );
-    QObjectList *l = modTBar->queryList( "QComboBox" );
-    QObjectListIt oit( *l );
-    while ( QObject* obj = oit.current() ) {
-      QComboBox* cb = (QComboBox*)obj;
-      if ( cb ) cb->setFocusPolicy( QWidget::NoFocus );
-    ++oit;
-    }
-    delete l;
-  
-    modTBar->addSeparator();
-
     for ( it = modList.begin(); it != modList.end(); ++it )
     {
       if ( !isLibExists( *it ) )
         continue;
-    
+
       QString iconName;
       if ( iconMap.contains( *it ) )
         iconName = iconMap[*it];
@@ -579,72 +561,81 @@ void LightApp_Application::createActions()
       if ( icon.isNull() )
       {
        icon = modIcon;
-       printf( "****************************************************************\n" );
-       printf( "*    Icon for %s not found. Using the default one.\n", (*it).latin1() );
-       printf( "****************************************************************\n" );
+       INFOS ( "****************************************************************" << std::endl
+            << "*    Icon for " << (*it).toLatin1().constData() << " not found. Using the default one." << std::endl
+            << "****************************************************************" << std::endl );
       }
 
-      icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) );
-
-      QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true );
-      a->addTo( modTBar );
-      modGroup->add( a );
+      icon = Qtx::scaleIcon( icon, iconSize );
 
-      myActions.insert( *it, a );
+      moduleAction->insertModule( *it, icon );
     }
 
-    SUIT_Tools::simplifySeparators( modTBar );
-    connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) );
+
+    connect( moduleAction, SIGNAL( moduleActivated( const QString& ) ), this, SLOT( onModuleActivation( const QString& ) ) );
+    registerAction( ModulesListId, moduleAction );
   }
 
   // New window
   int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, MenuWindowId, 100 );
   int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
-  createMenu( separator(), windowMenu, -1, 1 );
 
+  createAction( CloseId, tr( "TOT_CLOSE" ), QIcon(), tr( "MEN_DESK_CLOSE" ), tr( "PRP_CLOSE" ),
+                Qt::SHIFT+Qt::Key_C, desk, false, this, SLOT( onCloseWindow() ) );
+  createAction( CloseAllId, tr( "TOT_CLOSE_ALL" ), QIcon(), tr( "MEN_DESK_CLOSE_ALL" ), tr( "PRP_CLOSE_ALL" ),
+                0, desk, false, this, SLOT( onCloseAllWindow() ) );
+  createAction( GroupAllId, tr( "TOT_GROUP_ALL" ), QIcon(), tr( "MEN_DESK_GROUP_ALL" ), tr( "PRP_GROUP_ALL" ),
+                0, desk, false, this, SLOT( onGroupAllWindow() ) );
+
+  createMenu( CloseId,     windowMenu, 0, -1 );
+  createMenu( CloseAllId,  windowMenu, 0, -1 );
+  createMenu( GroupAllId,  windowMenu, 0, -1 );
+  createMenu( separator(), windowMenu, -1, 0 );
 
 #ifndef DISABLE_GLVIEWER
-  createActionForViewer( NewGLViewId, newWinMenu, QString::number( 0 ), ALT+Key_G );
+  createActionForViewer( NewGLViewId, newWinMenu, QString::number( 0 ), Qt::ALT+Qt::Key_G );
 #endif
 #ifndef DISABLE_PLOT2DVIEWER
-  createActionForViewer( NewPlot2dId, newWinMenu, QString::number( 1 ), ALT+Key_P );
+  createActionForViewer( NewPlot2dId, newWinMenu, QString::number( 1 ), Qt::ALT+Qt::Key_P );
 #endif
 #ifndef DISABLE_OCCVIEWER
-  createActionForViewer( NewOCCViewId, newWinMenu, QString::number( 2 ), ALT+Key_O );
+  createActionForViewer( NewOCCViewId, newWinMenu, QString::number( 2 ), Qt::ALT+Qt::Key_O );
 #endif
 #ifndef DISABLE_VTKVIEWER
-  createActionForViewer( NewVTKViewId, newWinMenu, QString::number( 3 ), ALT+Key_K );
+  createActionForViewer( NewVTKViewId, newWinMenu, QString::number( 3 ), Qt::ALT+Qt::Key_K );
 #endif
 #ifndef DISABLE_QXGRAPHVIEWER
-  createActionForViewer( NewQxGraphViewId, newWinMenu, QString::number( 4 ), ALT+Key_C );
+  createActionForViewer( NewQxGraphViewId, newWinMenu, QString::number( 4 ), Qt::ALT+Qt::Key_C );
 #endif
 
+  createActionForViewer( NewQxSceneViewId, newWinMenu, QString::number( 5 ), Qt::ALT+Qt::Key_S );
 
-  createAction( RenameId, tr( "TOT_RENAME" ), QIconSet(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ),
-               SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) );
+  createAction( RenameId, tr( "TOT_RENAME" ), QIcon(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ),
+               Qt::SHIFT+Qt::Key_R, desk, false, this, SLOT( onRenameWindow() ) );
   createMenu( RenameId, windowMenu, -1 );
 
   int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
-  createMenu( PreferencesId, fileMenu, 15, -1 );
-  createMenu( separator(), fileMenu, -1, 15, -1 );
+  createMenu( PreferencesId, fileMenu, 50, -1 );
+  createMenu( separator(), fileMenu, -1, 50, -1 );
 
-  /*
   createMenu( separator(), fileMenu, -1, 100, -1 );
   createMenu( MRUId, fileMenu, 100, -1 );
   createMenu( separator(), fileMenu, -1, 100, -1 );
-  */
+
+  createAction( StyleId, tr( "TOT_THEME" ), QIcon(), tr( "MEN_DESK_THEME" ), tr( "PRP_THEME" ),
+                0, desk, false, this, SLOT( onStylePreferences() ) );
+
+  int viewMenu = createMenu( tr( "MEN_DESK_VIEW" ), -1 );
+  createMenu( separator(), viewMenu, -1, 20, -1 );
+  createMenu( StyleId, viewMenu, 20, -1 );
+
+  int modTBar = createTool( tr( "INF_TOOLBAR_MODULES" ) );
+  createTool( ModulesListId, modTBar );
 }
 
 /*!On module activation action.*/
-void LightApp_Application::onModuleActivation( QAction* a )
+void LightApp_Application::onModuleActivation( const QString& modName )
 {
-  if ( !a )
-    return;
-
-  QString modName = a->menuText();
-  if ( modName == tr( "APP_NAME" ) )
-    modName = QString::null;
-
   // Force user to create/open a study before module activation
   QMap<QString, QString> iconMap;
   moduleIconNames( iconMap );
@@ -653,20 +644,26 @@ void LightApp_Application::onModuleActivation( QAction* a )
     icon = resourceMgr()->loadPixmap( "LightApp", tr( "APP_MODULE_BIG_ICO" ), false ); // default icon for any module
 
   bool cancelled = false;
+
   while ( !modName.isEmpty() && !activeStudy() && !cancelled ){
     LightApp_ModuleDlg aDlg( desktop(), modName, icon );
     QMap<int, QString> opmap = activateModuleActions();
     for ( QMap<int, QString>::ConstIterator it = opmap.begin(); it != opmap.end(); ++it )
-      aDlg.addButton( it.data(), it.key() );
+      aDlg.addButton( it.value(), it.key() );
 
     int res = aDlg.exec();
-    if ( res != QDialog::Rejected ) {
+    if ( res ) {
       // some operation is selected
       moduleActionSelected( res );
     }
     else {
+      // cancelled
       putInfo( tr("INF_CANCELLED") );
-      myActions[QString()]->setOn( true );
+
+      LightApp_ModuleAction* moduleAction =
+       qobject_cast<LightApp_ModuleAction*>( action( ModulesListId ) );
+      if ( moduleAction )
+       moduleAction->setActiveModule( QString() );
       cancelled = true;
     }
   }
@@ -721,6 +718,9 @@ void LightApp_Application::onNewWindow()
     type = QxGraph_Viewer::Type();
     break;
 #endif
+  case NewQxSceneViewId:
+    type = QxScene_Viewer::Type();
+    break;
   }
 
   if ( !type.isEmpty() )
@@ -732,17 +732,9 @@ void LightApp_Application::onNewWindow()
 */
 void LightApp_Application::onNewDoc()
 {
-  SUIT_Study* study = activeStudy();
-
-  saveWindowsGeometry();
+  saveDockWindowsState();
 
   CAM_Application::onNewDoc();
-
-  if ( !study ) // new study will be create in THIS application
-  {
-    updateWindows();
-    updateViewManagers();
-  }
 }
 
 /*!
@@ -751,7 +743,7 @@ void LightApp_Application::onNewDoc()
 void LightApp_Application::onOpenDoc()
 {
   SUIT_Study* study = activeStudy();
-  saveWindowsGeometry();
+  saveDockWindowsState();
 
   CAM_Application::onOpenDoc();
 
@@ -762,70 +754,19 @@ void LightApp_Application::onOpenDoc()
   }
 }
 
-#include "SUIT_MessageBox.h"
-
 /*!
   SLOT: Opens new document.
   \param aName - name of file
 */
 bool LightApp_Application::onOpenDoc( const QString& aName )
 {
-  bool isAlreadyOpen = false;
-
-  // Look among opened studies
-  if (activeStudy()) { // at least one study is opened
-    SUIT_Session* aSession = SUIT_Session::session();
-    QPtrList<SUIT_Application> aAppList = aSession->applications();
-    QPtrListIterator<SUIT_Application> it (aAppList);
-    SUIT_Application* aApp = 0;
-    // iterate on all applications
-    for (; (aApp = it.current()) && !isAlreadyOpen; ++it) {
-      if (aApp->activeStudy()->studyName() == aName) {
-        isAlreadyOpen = true; // Already opened, ask user what to do
-
-        // The document ... is already open.
-        // Do you want to reload it?
-        int aAnswer = SUIT_MessageBox::warn2(desktop(), tr("WRN_WARNING"),
-                                             tr("QUE_DOC_ALREADYOPEN").arg(aName),
-                                             tr("BUT_YES"), tr("BUT_NO"), 1, 2, 2);
-        if (aAnswer == 1) { // reload
-          if (activeStudy()->studyName() == aName && aAppList.count() > 1) {
-            // Opened in THIS (active) application.
-            STD_Application* app1 = (STD_Application*)aAppList.at(0);
-            STD_Application* app2 = (STD_Application*)aAppList.at(1);
-            if (!app1 || !app2) {
-              // Error
-              return false;
-            }
-            if (app1->activeStudy()->studyName() == aName) {
-              // app1 is this application, we need another one
-              app1 = app2;
-            }
-            // Close document of this application. This application will be destroyed.
-            onCloseDoc(/*ask = */false);
-            // Open the file with another application, as this one will be destroyed.
-            return app1->onOpenDoc(aName);
-          } else {
-            // Opened in another application.
-            STD_Application* app = (STD_Application*)aApp;
-            if (app)
-              app->onCloseDoc(/*ask = */false);
-          }
-        } else { // do not reload
-          // OK, the study will not be reloaded, but we call
-          // CAM_Application::onOpenDoc( aName ) all the same.
-          // It will activate a desktop of the study <aName>.
-        }
-      }
-    }
-  }
+  // We should take mru action first because this application instance can be deleted later.
+  QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
 
   bool res = CAM_Application::onOpenDoc( aName );
 
-  QAction* a = action( MRUId );
-  if ( a && a->inherits( "QtxMRUAction" ) )
+  if ( mru )
   {
-    QtxMRUAction* mru = (QtxMRUAction*)a;
     if ( res )
       mru->insert( aName );
     else
@@ -839,29 +780,8 @@ bool LightApp_Application::onOpenDoc( const QString& aName )
 */
 void LightApp_Application::onHelpAbout()
 {
-  LightApp_AboutDlg* dlg = new LightApp_AboutDlg( applicationName(), applicationVersion(), desktop() );
-  dlg->exec();
-  delete dlg;
-}
-
-/*!
-  SLOT: Loads document
-  \param aName - name of document
-*/
-bool LightApp_Application::onLoadDoc( const QString& aName )
-{
-  bool res = CAM_Application::onLoadDoc( aName );
-
-  /*jfa tmp:QAction* a = action( MRUId );
-  if ( a && a->inherits( "QtxMRUAction" ) )
-  {
-    QtxMRUAction* mru = (QtxMRUAction*)a;
-    if ( res )
-      mru->insert( aName );
-    else
-      mru->remove( aName );
-  }*/
-  return res;
+  LightApp_AboutDlg dlg( applicationName(), applicationVersion(), desktop() );
+  dlg.exec();
 }
 
 /*!
@@ -883,8 +803,6 @@ void LightApp_Application::onSelection()
 void LightApp_Application::setActiveStudy( SUIT_Study* study )
 {
   CAM_Application::setActiveStudy( study );
-
-  activateWindows();
 }
 
 /*!
@@ -924,6 +842,9 @@ void LightApp_Application::updateCommandsStatus()
   if( a )
     a->setEnabled( activeStudy() );
 #endif
+  a = action( NewQxSceneViewId );
+  if( a )
+    a->setEnabled( activeStudy() );
 }
 
 /*!
@@ -933,52 +854,49 @@ void LightApp_Application::updateCommandsStatus()
 class RunBrowser: public QThread
 {
 public:
-  RunBrowser (LightApp_Application* app, QString theApp, QString theParams,
-              QString theHelpFile, QString theContext=NULL)
-    : myApp(theApp), myParams(theParams), 
+  RunBrowser( LightApp_Application* app,
+             const QString&        theApp,
+             const QString&        theParams,
+             const QString&        theHelpFile,
+             const QString&        theContext = QString() )
+    : myApp( theApp ),
+      myParams( theParams ),
 #ifdef WIN32
-      myHelpFile("file://" + theHelpFile + theContext), 
+      myHelpFile( "file://" + theHelpFile ),
 #else
-      myHelpFile("file:" + theHelpFile + theContext),
+      myHelpFile( "file:" + theHelpFile ),
 #endif
+      myContext( theContext ),
       myStatus(0),
       myLApp( app )
   {
-  };
+  }
 
   virtual void run()
   {
-    QString aCommand;
-
-    if (!myApp.isEmpty())
-    {
-      //aCommand.sprintf("%s %s %s",myApp.latin1(),myParams.latin1(),myHelpFile.latin1());
-
-      //QProcess* proc = new QProcess();
-      //proc->addArgument( aCommand );
+    if ( !myApp.isEmpty()) {
+      QString aCommand = QString( "%1 %2 %3" ).arg( myApp, myParams, myHelpFile );
+      if ( !myContext.isEmpty() )
+       aCommand += "#" + myContext;
 
       QProcess* proc = new QProcess();
-      proc->addArgument( myApp );
-      if (!myParams.isEmpty()) proc->addArgument( myParams );
-      proc->addArgument( myHelpFile );
-      //myStatus = system(aCommand);
 
-      //if(myStatus != 0)
-      if(!proc->start())
-      {
-        QCustomEvent* ce2000 = new QCustomEvent( 2000 );
-        QString* msg = new QString( QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").arg(myApp).arg(myHelpFile) );
-        ce2000->setData( msg );
-        postEvent( myLApp, ce2000 );
+      proc->start( aCommand );
+      if ( !proc->waitForStarted() ) {
+       SALOME_CustomEvent* ce2000 = new SALOME_CustomEvent( 2000 );
+       QString* msg = new QString( QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).arg( myApp, myHelpFile ) );
+       ce2000->setData( msg );
+       QApplication::postEvent( myLApp, ce2000 );
       }
     }
   }
 
 private:
-  QString myApp;
-  QString myParams;
-  QString myHelpFile;
-  int myStatus;
+  QString               myApp;
+  QString               myParams;
+  QString               myHelpFile;
+  QString               myContext;
+  int                   myStatus;
   LightApp_Application* myLApp;
 };
 
@@ -989,15 +907,15 @@ void LightApp_Application::onHelpContentsModule()
 {
   const QAction* obj = (QAction*) sender();
 
-  QString aComponentName = obj->name();
+  QString aComponentName = obj->objectName();
   QString aFileName = "index.html";
 
-  QCString dir = getenv( aComponentName + "_ROOT_DIR");
-  QString homeDir = !aComponentName.compare(QString("KERNEL")) ? 
-    Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") + Qtx::addSlash("salome") ) : 
+  QString dir = getenv( (aComponentName + "_ROOT_DIR").toLatin1().constData() );
+  QString homeDir = !aComponentName.compare(QString("KERNEL")) ?
+    Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") + Qtx::addSlash("salome") ) :
     Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") + Qtx::addSlash("salome") + Qtx::addSlash("gui") +  Qtx::addSlash(aComponentName) );
-  
-  QString helpFile = QFileInfo( homeDir + aFileName ).absFilePath();
+
+  QString helpFile = QFileInfo( homeDir + aFileName ).absoluteFilePath();
   SUIT_ResourceMgr* resMgr = resourceMgr();
        QString platform;
 #ifdef WIN32
@@ -1007,33 +925,47 @@ void LightApp_Application::onHelpContentsModule()
 #endif
        QString anApp = resMgr->stringValue("ExternalBrowser", platform);
 #ifdef WIN32
-       QString quote("\""); 
-       anApp.prepend( quote ); 
-       anApp.append( quote ); 
+       QString quote("\"");
+       anApp.prepend( quote );
+       anApp.append( quote );
 #endif
   QString aParams = resMgr->stringValue("ExternalBrowser", "parameters");
 
-  if (!anApp.isEmpty()) {
+  if ( !anApp.isEmpty() )
+  {
     RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile );
     rs->start();
   }
-  else {
-    if( SUIT_MessageBox::warn2(desktop(), tr("WRN_WARNING"),
-                           tr("DEFINE_EXTERNAL_BROWSER"),
-                           tr("BUT_OK"),tr("BUT_CANCEL"),0,1,0 )==0 )
-      onPreferences();
+  else
+  {
+    if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ),
+                                   SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                   SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
+
+      showPreferences( tr( "PREF_APP" ) );
   }
 }
 
 /*!
   SLOT: Displays help contents for choosen dialog
 */
-void LightApp_Application::onHelpContextModule(const QString& theComponentName, const QString& theFileName)
-{
-  QCString dir = getenv( theComponentName + "_ROOT_DIR");
-  QString homeDir = Qtx::addSlash(Qtx::addSlash(dir)+Qtx::addSlash("share")+Qtx::addSlash("doc")+Qtx::addSlash("salome")+Qtx::addSlash("gui")+Qtx::addSlash(theComponentName));
+void LightApp_Application::onHelpContextModule( const QString& theComponentName,
+                                               const QString& theFileName,
+                                               const QString& theContext )
+{
+  QString homeDir = "";
+  if ( !theComponentName.isEmpty() ) {
+    QString dir = getenv( ( theComponentName + "_ROOT_DIR" ).toLatin1().constData() );
+    if ( !dir.isEmpty() )
+      homeDir = Qtx::addSlash( Qtx::addSlash( dir )      +
+                              Qtx::addSlash( "share" )  +
+                              Qtx::addSlash( "doc" )    +
+                              Qtx::addSlash( "salome" ) +
+                              Qtx::addSlash( "gui" )    +
+                              Qtx::addSlash( theComponentName ) );
+  }
 
-  QString helpFile = QFileInfo( homeDir + theFileName ).absFilePath();
+  QString helpFile = QFileInfo( homeDir + theFileName ).absoluteFilePath();
   SUIT_ResourceMgr* resMgr = resourceMgr();
        QString platform;
 #ifdef WIN32
@@ -1043,21 +975,23 @@ void LightApp_Application::onHelpContextModule(const QString& theComponentName,
 #endif
        QString anApp = resMgr->stringValue("ExternalBrowser", platform);
 #ifdef WIN32
-       QString quote("\""); 
-       anApp.prepend( quote ); 
-       anApp.append( quote ); 
+       QString quote("\"");
+       anApp.prepend( quote );
+       anApp.append( quote );
 #endif
   QString aParams = resMgr->stringValue("ExternalBrowser", "parameters");
 
-  if (!anApp.isEmpty()) {
-    RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile );
+  if ( !anApp.isEmpty() )
+  {
+    RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile, theContext );
     rs->start();
   }
-  else {
-    if( SUIT_MessageBox::warn2(desktop(), tr("WRN_WARNING"),
-                           tr("DEFINE_EXTERNAL_BROWSER"),
-                           tr("BUT_OK"), tr("BUT_CANCEL"),0,1,0)==0 )
-      onPreferences();
+  else
+  {
+    if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ),
+                                   SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                   SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
+      showPreferences( tr( "PREF_APP" ) );
   }
 }
 
@@ -1068,31 +1002,6 @@ void LightApp_Application::onSelectionChanged()
 {
 }
 
-/*!
-  \return window by key
-  \param flag - key for window
-  \param studyId - study id
-  Flag used how identificator of window in windows list.
-*/
-QWidget* LightApp_Application::window( const int flag, const int studyId ) const
-{
-  QWidget* wid = 0;
-
- int sId = studyId;
-  if ( sId < 0 )
-  {
-    if ( !activeStudy() )
-      return 0;
-    else
-      sId = activeStudy()->id();
-  }
-
-  if ( myWindows.contains( flag ) )
-    wid = myWindows[flag]->widget( sId );
-
-  return wid;
-}
-
 /*!
   Adds window to application.
   \param wid - QWidget
@@ -1100,6 +1009,7 @@ QWidget* LightApp_Application::window( const int flag, const int studyId ) const
   \param studyId - study id
   Flag used how identificator of window in windows list.
 */
+/*
 void LightApp_Application::addWindow( QWidget* wid, const int flag, const int studyId )
 {
   if ( !wid )
@@ -1121,28 +1031,31 @@ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int st
 
     LightApp_WidgetContainer* newWC = new LightApp_WidgetContainer( flag, desktop() );
     connect( newWC, SIGNAL(  destroyed ( QObject* ) ), this, SLOT( onWCDestroyed( QObject* ) ) );
-    // asv: connecting a slot for storing visibility flag of a window 
+    // asv: connecting a slot for storing visibility flag of a window
     connect( newWC, SIGNAL( visibilityChanged ( bool ) ), SLOT( onVisibilityChanged( bool ) ) );
     myWindows.insert( flag, newWC );
-    if ( winMap.contains( flag ) )
-      desktop()->moveDockWindow( myWindows[flag], (Dock)winMap[flag] );
+    if ( winMap.contains( flag ) ) {
+      //desktop()->removeDockWidget( myWindows[flag] );
+      desktop()->addDockWidget( (Qt::DockWidgetArea)winMap[flag], myWindows[flag] );
+    }
 
-    myWindows[flag]->setResizeEnabled( true );
-    myWindows[flag]->setCloseMode( QDockWindow::Always );
-    myWindows[flag]->setName( QString( "dock_window_%1" ).arg( flag ) );
-    myWindows[flag]->setFixedExtentWidth( wid->width() );
-    myWindows[flag]->setFixedExtentHeight( wid->height() );
+    //myWindows[flag]->setResizeEnabled( true );
+    myWindows[flag]->setFeatures( QDockWidget::AllDockWidgetFeatures );
+    myWindows[flag]->setObjectName( QString( "dock_window_%1" ).arg( flag ) );
+    //myWindows[flag]->setFixedExtentWidth( wid->width() );
+    //myWindows[flag]->setFixedExtentHeight( wid->height() );
+    myWindows[flag]->resize( wid->width(), wid->height() );
   }
 
   QFont f;
 #ifndef DISABLE_PYCONSOLE
-  if( wid->inherits( "PythonConsole" ) )
+  if( wid->inherits( "PyConsole_Console" ) )
   {
     if( resourceMgr()->hasValue( "PyConsole", "font" ) )
       f = resourceMgr()->fontValue( "PyConsole", "font" );
     else
       {
-       f = ( ( PythonConsole* )wid )->font();
+       f = ( ( PyConsole_Console* )wid )->font();
        resourceMgr()->setValue( "PyConsole", "font", f );
       }
   }
@@ -1151,101 +1064,105 @@ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int st
     f = wid->font();
 
   myWindows[flag]->insert( sId, wid );
-  wid->setFont(f);
+  wid->setFont( f );
 
   setWindowShown( flag, !myWindows[flag]->isEmpty() );
 }
-
-/*!
-  Removes window from application.
-  \param flag - key for window
-  \param studyId - study id
-  Flag used how identificator of window in windows list.
 */
-void LightApp_Application::removeWindow( const int flag, const int studyId )
+
+QWidget* LightApp_Application::dockWindow( const int id ) const
 {
-  if ( !myWindows.contains( flag ) )
-    return;
+  QWidget* wid = 0;
+  if ( myWin.contains( id ) )
+    wid = myWin[id];
+  return wid;
+}
 
-  int sId = studyId;
-  if ( sId < 0 )
+QDockWidget* LightApp_Application::windowDock( QWidget* wid ) const
+{
+  if ( !wid )
+    return 0;
+
+  QDockWidget* dock = 0;
+  QWidget* w = wid->parentWidget();
+  while ( w && !dock )
   {
-    if ( !activeStudy() )
-      return;
-    else
-      sId = activeStudy()->id();
+    dock = ::qobject_cast<QDockWidget*>( w );
+    w = w->parentWidget();
   }
+  return dock;
+}
+
+void LightApp_Application::insertDockWindow( const int id, QWidget* wid )
+{
+  if ( !wid )
+    return;
 
-  bool anIsEmpty = !myWindows[flag]->isEmpty();
-  QWidget* wid = myWindows[flag]->widget( sId );
-  myWindows[flag]->remove( sId );
-  delete wid;
+  if ( wid != dockWindow( id ) )
+    removeDockWindow( id );
 
-  //setWindowShown( flag, !myWindows[flag]->isEmpty() );
-  setWindowShown( flag, anIsEmpty );
+  myWin.insert( id, wid );
+
+  QtxDockWidget* dock = new QtxDockWidget( true, desktop() );
+  connect( dock, SIGNAL(  destroyed( QObject* ) ), this, SLOT( onWCDestroyed( QObject* ) ) );
+
+  dock->setFeatures( QDockWidget::AllDockWidgetFeatures );
+  dock->setObjectName( QString( "window_%1" ).arg( id ) );
+  dock->setWidget( wid );
+  dock->show();
 }
 
-/*!
-  Gets window.
-  \param flag - key for window
-  \param studyId - study id
-  Flag used how identificator of window in windows list.
-*/
-QWidget* LightApp_Application::getWindow( const int flag, const int studyId )
+void LightApp_Application::removeDockWindow( const int id )
 {
-  QWidget* wid = window( flag, studyId );
+  QWidget* wid = dockWindow( id );
   if ( !wid )
-    addWindow( wid = createWindow( flag ), flag, studyId );
+    return;
 
-  return wid;
+  myWin.remove( id );
+
+  QDockWidget* dock = windowDock( wid );
+  if ( !dock )
+    return;
+
+  dock->setWidget( 0 );
+  wid->setParent( 0 );
+  wid->setVisible( false );
+  delete dock;
 }
 
-/*!
-  \return is window visible
-  \param type - flag of window
-*/
-bool LightApp_Application::isWindowVisible( const int type ) const
+void LightApp_Application::placeDockWindow( const int id, Qt::DockWidgetArea place )
 {
-  bool res = false;
-  if ( myWindows.contains( type ) )
-  {
-    SUIT_Desktop* desk = ((LightApp_Application*)this)->desktop();
-    res = desk && desk->appropriate( myWindows[type] );
-  }
-  return res;
+  QDockWidget* dock = windowDock( dockWindow( id ) );
+  if ( dock && desktop() )
+    desktop()->addDockWidget( place, dock );
 }
 
 /*!
-  Sets window show or hide.
-  \param type - window identificator.
-  \param on   - true/false (window show/hide)
+  Gets window.
+  \param flag - key for window
+  \param studyId - study id
+  Flag used how identificator of window in windows list.
 */
-void LightApp_Application::setWindowShown( const int type, const bool on )
+QWidget* LightApp_Application::getWindow( const int flag, const int )
 {
-  if ( !desktop() || !myWindows.contains( type ) )
-    return;
+  QWidget* wid = dockWindow( flag );
+  if ( !wid )
+    insertDockWindow( flag, wid = createWindow( flag ) );
 
-  QDockWindow* dw = myWindows[type];
-  desktop()->setAppropriate( dw, on );
-  if( on )
-    dw->show();
-  else if( dw->isShown() )
-  {
-    dw->hide();
-    myWindowsVisible[ type ] = true;
-  }
+  QMap<int, int> winMap;
+  currentWindows( winMap );
+  if ( winMap.contains( flag ) )
+    placeDockWindow( flag, (Qt::DockWidgetArea)winMap[flag] );
+
+  return wid;
 }
 
 /*!
   \return Object Browser
 */
-OB_Browser* LightApp_Application::objectBrowser()
+SUIT_DataBrowser* LightApp_Application::objectBrowser()
 {
-  OB_Browser* ob = 0;
-  QWidget* wid = window( WT_ObjectBrowser );
-  if ( wid && wid->inherits( "OB_Browser" ) )
-    ob = (OB_Browser*)wid;
-  return ob;
+  return qobject_cast<SUIT_DataBrowser*>( dockWindow( WT_ObjectBrowser ) );
 }
 
 /*!
@@ -1253,24 +1170,16 @@ OB_Browser* LightApp_Application::objectBrowser()
 */
 LogWindow* LightApp_Application::logWindow()
 {
-  LogWindow* lw = 0;
-  QWidget* wid = getWindow( WT_LogWindow );
-  if ( wid->inherits( "LogWindow" ) )
-    lw = (LogWindow*)wid;
-  return lw;
+  return qobject_cast<LogWindow*>( dockWindow( WT_LogWindow ) );
 }
 
 #ifndef DISABLE_PYCONSOLE
 /*!
   \return Python Console
 */
-PythonConsole* LightApp_Application::pythonConsole()
+PyConsole_Console* LightApp_Application::pythonConsole()
 {
-  PythonConsole* console = 0;
-  QWidget* wid = getWindow( WT_PyConsole );
-  if ( wid->inherits( "PythonConsole" ) )
-    console = (PythonConsole*)wid;
-  return console;
+  return qobject_cast<PyConsole_Console*>( dockWindow( WT_PyConsole ) );
 }
 #endif
 
@@ -1281,18 +1190,19 @@ PythonConsole* LightApp_Application::pythonConsole()
 void LightApp_Application::updateObjectBrowser( const bool updateModels )
 {
   // update existing data models
-  if ( updateModels ) 
+  if ( updateModels )
   {
-    const bool isAutoUpdate = objectBrowser() ? objectBrowser()->isAutoUpdate() : true;
-    if( objectBrowser() )
+    const bool isAutoUpdate = objectBrowser() ? objectBrowser()->autoUpdate() : true;
+    if ( objectBrowser() )
       objectBrowser()->setAutoUpdate( false );
 
     LightApp_Study* study = dynamic_cast<LightApp_Study*>(activeStudy());
     if ( study ) {
       CAM_Study::ModelList dm_list;
       study->dataModels( dm_list );
-      for ( CAM_Study::ModelListIterator it( dm_list ); it.current(); ++it ) {
-        CAM_DataModel* camDM = it.current();
+      QListIterator<CAM_DataModel*> it( dm_list );
+      while ( it.hasNext() ) {
+       CAM_DataModel* camDM = it.next();
         if ( camDM && camDM->inherits( "LightApp_DataModel" ) )
           ((LightApp_DataModel*)camDM)->update();
       }
@@ -1301,8 +1211,8 @@ void LightApp_Application::updateObjectBrowser( const bool updateModels )
     if( objectBrowser() )
       objectBrowser()->setAutoUpdate( isAutoUpdate );
   }
-  if ( objectBrowser() )
-  {
+
+  if ( objectBrowser() ) {
     objectBrowser()->updateGeometry();
     objectBrowser()->updateTree( 0, false );
   }
@@ -1364,11 +1274,13 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
     viewMgr = new Plot2d_ViewManager( activeStudy(), desktop() );
     Plot2d_Viewer* vm;
 #ifndef DISABLE_SALOMEOBJECT
-    vm = new SPlot2d_Viewer();
+    SPlot2d_Viewer* v = new SPlot2d_Viewer();
+    vm = v;
+    new LightApp_Plot2dSelector( v, mySelMgr );
 #else
     vm = new Plot2d_Viewer();
 #endif
-    viewMgr->setViewModel( vm  );// custom view model, which extends SALOME_View interface 
+    viewMgr->setViewModel( vm  );// custom view model, which extends SALOME_View interface
     Plot2d_ViewWindow* wnd = dynamic_cast<Plot2d_ViewWindow*>( viewMgr->getActiveView() );
     if( wnd )
     {
@@ -1377,6 +1289,13 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
     }
   }
 #endif
+  if( vmType == QxScene_Viewer::Type() )
+  {
+    viewMgr = new QxScene_ViewManager( activeStudy(), desktop() );
+    QxScene_Viewer* vm = new QxScene_Viewer();
+    viewMgr->setViewModel( vm  );
+    //QxScene_ViewWindow* wnd = dynamic_cast<QxScene_ViewWindow*>( viewMgr->getActiveView() );
+  }
   //#ifndef DISABLE_SUPERVGRAPHVIEWER
   //  if( vmType == SUPERVGraph_Viewer::Type() )
   //  {
@@ -1397,7 +1316,7 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
 #ifndef DISABLE_SALOMEOBJECT
     vm = new SOCC_Viewer();
 #else
-    vm = new OCCViewer_Viewer();
+    vm = new OCCViewer_Viewer( true, resMgr->booleanValue( "OCCViewer", "static_trihedron", true ) );
 #endif
     vm->setBackgroundColor( resMgr->colorValue( "OCCViewer", "background", vm->backgroundColor() ) );
     vm->setTrihedronSize( resMgr->doubleValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ) );
@@ -1422,9 +1341,16 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
     SVTK_Viewer* vm = dynamic_cast<SVTK_Viewer*>( viewMgr->getViewModel() );
     if( vm )
     {
+      vm->setProjectionMode( resMgr->integerValue( "VTKViewer", "projection_mode", vm->projectionMode() ) );
       vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) );
       vm->setTrihedronSize( resMgr->doubleValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ),
                            resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) );
+      vm->setInteractionStyle( resMgr->integerValue( "VTKViewer", "navigation_mode", vm->interactionStyle() ) );
+      vm->setIncrementalSpeed( resMgr->integerValue( "VTKViewer", "speed_value", vm->incrementalSpeed() ),
+                              resMgr->integerValue( "VTKViewer", "speed_mode", vm->incrementalSpeedMode() ) );
+      vm->setSpacemouseButtons( resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", vm->spacemouseBtn(1) ),
+                               resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", vm->spacemouseBtn(2) ),
+                               resMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", vm->spacemouseBtn(3) ) );
       new LightApp_VTKSelector( vm, mySelMgr );
     }
 #else
@@ -1468,16 +1394,18 @@ void LightApp_Application::onStudyCreated( SUIT_Study* theStudy )
     aRoot = theStudy->root();
     //aRoot->setName( tr( "DATA_MODELS" ) );
   }
+
   getWindow( WT_ObjectBrowser );
-  if ( objectBrowser() != 0 )
-    objectBrowser()->setRootObject( aRoot );
+
+  loadDockWindowsState();
+
+  if ( objectBrowser() )
+    objectBrowser()->setRoot( aRoot );
 
   activateModule( defaultModule() );
 
   if ( objectBrowser() )
     objectBrowser()->openLevels();
-
-  activateWindows();
 }
 
 /*!
@@ -1492,23 +1420,29 @@ void LightApp_Application::onStudyOpened( SUIT_Study* theStudy )
     aRoot = theStudy->root();
     //aRoot->dump();
   }
+
   getWindow( WT_ObjectBrowser );
+
+  loadDockWindowsState();
+
   if ( objectBrowser() )
-    objectBrowser()->setRootObject( aRoot );
+    objectBrowser()->setRoot( aRoot );
 
   activateModule( defaultModule() );
 
   if ( objectBrowser() )
     objectBrowser()->openLevels();
 
-  activateWindows();
-
   emit studyOpened();
 }
 
 /*!Protected SLOT. On study saved.*/
-void LightApp_Application::onStudySaved( SUIT_Study* )
+void LightApp_Application::onStudySaved( SUIT_Study* )
 {
+  QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
+  if ( mru && s )
+      mru->insert( s->studyName() );
+
   emit studySaved();
 }
 
@@ -1522,9 +1456,6 @@ void LightApp_Application::onStudyClosed( SUIT_Study* s )
   emit studyClosed();
 
   activateModule( "" );
-
-  for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr )
-    removeWindow( itr.key(), s->id() );
 }
 
 /*!Protected SLOT.On desktop activated.*/
@@ -1536,6 +1467,22 @@ void LightApp_Application::onDesktopActivated()
     aModule->studyActivated();
 }
 
+void LightApp_Application::studyOpened( SUIT_Study* s )
+{
+  CAM_Application::studyOpened( s );
+
+  updateWindows();
+  updateViewManagers();
+}
+
+void LightApp_Application::studyCreated( SUIT_Study* s )
+{
+  CAM_Application::studyCreated( s );
+
+  updateWindows();
+  updateViewManagers();
+}
+
 /*!Gets file filter.
  *\retval QString "(*.bin)"
  */
@@ -1549,12 +1496,12 @@ QString LightApp_Application::getFileFilter() const
 /*!
   Shows file dialog and return user selected file name
 */
-QString LightApp_Application::getFileName( bool open, const QString& initial, const QString& filters, 
+QString LightApp_Application::getFileName( bool open, const QString& initial, const QString& filters,
                                            const QString& caption, QWidget* parent )
 {
   if ( !parent )
     parent = desktop();
-  QStringList fls = QStringList::split( ";;", filters, false );
+  QStringList fls = filters.split( ";;", QString::SkipEmptyParts );
   return SUIT_FileDlg::getFileName( parent, initial, fls, caption, open, true );
 }
 
@@ -1567,12 +1514,12 @@ QString LightApp_Application::getDirectory( const QString& initial, const QStrin
 }
 
 /*! Get open file names*/
-QStringList LightApp_Application::getOpenFileNames( const QString& initial, const QString& filters, 
+QStringList LightApp_Application::getOpenFileNames( const QString& initial, const QString& filters,
                                                     const QString& caption, QWidget* parent )
 {
   if ( !parent )
     parent = desktop();
-  QStringList fls = QStringList::split( ";;", filters, false );
+  QStringList fls = filters.split( ";;", QString::SkipEmptyParts );
   return SUIT_FileDlg::getOpenFileNames( parent, initial, fls, caption, true );
 }
 
@@ -1585,7 +1532,13 @@ void LightApp_Application::onRefresh()
 /*!Private SLOT. On preferences.*/
 void LightApp_Application::onPreferences()
 {
-  QApplication::setOverrideCursor( Qt::waitCursor );
+  showPreferences( activeModule() ? activeModule()->moduleName() : tr( "PREF_CATEGORY_SALOME" ) );
+}
+
+/*!Private SLOT. On preferences.*/
+void LightApp_Application::showPreferences( const QString& itemText )
+{
+  QApplication::setOverrideCursor( Qt::WaitCursor );
 
   LightApp_PreferencesDlg* prefDlg = new LightApp_PreferencesDlg( preferences( true ), desktop());
 
@@ -1594,9 +1547,12 @@ void LightApp_Application::onPreferences()
   if ( !prefDlg )
     return;
 
-  if ( ( prefDlg->exec() == QDialog::Accepted || prefDlg->isSaved() ) &&  resourceMgr() ) {
+  preferences()->activateItem( itemText );
+
+  if ( ( prefDlg->exec() == QDialog::Accepted || prefDlg->isSaved() ) &&  resourceMgr() )
+  {
     if ( desktop() )
-      desktop()->saveGeometry( resourceMgr(), "desktop" );
+      resourceMgr()->setValue( "desktop", "geometry", desktop()->storeGeometry() );
     resourceMgr()->save();
   }
 
@@ -1619,12 +1575,6 @@ void LightApp_Application::onPreferenceChanged( QString& modName, QString& secti
   emit preferenceChanged( modName, section, param );
 }
 
-/*!Private SLOT. On open document with name \a aName.*/
-void LightApp_Application::onMRUActivated( QString aName )
-{
-  onOpenDoc( aName );
-}
-
 /*!Remove all windows from study.*/
 void LightApp_Application::beforeCloseDoc( SUIT_Study* s )
 {
@@ -1662,20 +1612,29 @@ SUIT_Study* LightApp_Application::createNewStudy()
 QWidget* LightApp_Application::createWindow( const int flag )
 {
   QWidget* wid = 0;
+
+  SUIT_ResourceMgr* resMgr = resourceMgr();
+
   if ( flag == WT_ObjectBrowser )
   {
-    OB_Browser* ob = new OB_Browser( desktop() );
-    ob->setSearch( new OB_ObjSearch( ob ) );
+    SUIT_DataBrowser* ob = new SUIT_DataBrowser( new LightApp_DataObject(), desktop() );
+    ob->setSortMenuEnabled( true );
     ob->setAutoUpdate( true );
+    if ( resMgr->hasValue( "ObjectBrowser", "auto_hide_search_tool" ) )
+      ob->searchTool()->enableAutoHide( resMgr->booleanValue( "ObjectBrowser", "auto_hide_search_tool" ) );
+
     //ob->setAutoOpenLevel( 1 ); // commented by ASV as a fix to bug IPAL10107
-    ob->setCaption( tr( "OBJECT_BROWSER" ) );
+    ob->setWindowTitle( tr( "OBJECT_BROWSER" ) );
+    connect( ob, SIGNAL( requestUpdate() ), this, SLOT( onRefresh() ) );
 
+    // temporary commented
+    /*
     OB_ListView* ob_list = dynamic_cast<OB_ListView*>( const_cast<QListView*>( ob->listView() ) );
     if( ob_list )
       ob_list->setColumnMaxWidth( 0, desktop()->width()/4 );
 
     ob->setFilter( new LightApp_OBFilter( selectionMgr() ) );
-    ob->setNameTitle( tr( "OBJ_BROWSER_NAME" ) );
+    */
 
     // Create OBSelector
     new LightApp_OBSelector( ob, mySelMgr );
@@ -1687,16 +1646,16 @@ QWidget* LightApp_Application::createWindow( const int flag )
 #ifndef DISABLE_PYCONSOLE
   else  if ( flag == WT_PyConsole )
   {
-    PythonConsole* pyCons = new PythonConsole( desktop() );
-    pyCons->setCaption( tr( "PYTHON_CONSOLE" ) );
+    PyConsole_Console* pyCons = new PyConsole_Console( desktop() );
+    pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) );
     wid = pyCons;
-    //    pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
+    pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
   }
 #endif
   else if ( flag == WT_LogWindow )
   {
     LogWindow* logWin = new LogWindow( desktop() );
-    logWin->setCaption( tr( "LOG_WINDOW" ) );
+    logWin->setWindowTitle( tr( "LOG_WINDOW" ) );
     wid = logWin;
     logWin->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
   }
@@ -1708,10 +1667,10 @@ QWidget* LightApp_Application::createWindow( const int flag )
   Adds to map \a aMap.
  */
 void LightApp_Application::defaultWindows( QMap<int, int>& aMap ) const
-{  
-  aMap.insert( WT_ObjectBrowser, Qt::DockLeft );
+{
+  aMap.insert( WT_ObjectBrowser, Qt::LeftDockWidgetArea );
 #ifndef DISABLE_PYCONSOLE
-  aMap.insert( WT_PyConsole, Qt::DockBottom );
+  aMap.insert( WT_PyConsole, Qt::BottomDockWidgetArea );
 #endif
   //  aMap.insert( WT_LogWindow, Qt::DockBottom );
 }
@@ -1734,7 +1693,7 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const
   LightApp_Application* that = (LightApp_Application*)this;
 
   bool toCreate = !_prefs_ && crt;
-  if( toCreate )
+  if ( toCreate )
   {
     _prefs_ = new LightApp_Preferences( resourceMgr() );
     that->createPreferences( _prefs_ );
@@ -1742,39 +1701,54 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const
 
   that->myPrefs = _prefs_;
 
-  QPtrList<SUIT_Application> appList = SUIT_Session::session()->applications();
-  for ( QPtrListIterator<SUIT_Application> appIt ( appList ); appIt.current(); ++appIt )
+  if ( !toCreate )
+    return myPrefs;
+
+  SUIT_ResourceMgr* resMgr = resourceMgr();
+
+  QList<SUIT_Application*> appList = SUIT_Session::session()->applications();
+  for ( QList<SUIT_Application*>::iterator appIt = appList.begin(); appIt != appList.end(); ++appIt )
   {
-    if ( !appIt.current()->inherits( "LightApp_Application" ) )
+    LightApp_Application* app = ::qobject_cast<LightApp_Application*>( *appIt );
+    if ( !app )
       continue;
 
-    LightApp_Application* app = (LightApp_Application*)appIt.current();
-
     QStringList modNameList;
     app->modules( modNameList, false );
+
+    QMap<QString, QString> iconMap;
+    app->moduleIconNames( iconMap );
+
     for ( QStringList::const_iterator it = modNameList.begin(); it != modNameList.end(); ++it )
     {
-      int id = _prefs_->addPreference( *it );
-      _prefs_->setItemProperty( id, "info", tr( "PREFERENCES_NOT_LOADED" ).arg( *it ) );
+      if ( !app->isLibExists( *it ) )
+       continue;
+
+      int modId = _prefs_->addPreference( *it );
+      if ( iconMap.contains( *it ) )
+       _prefs_->setItemIcon( modId, Qtx::scaleIcon( resMgr->loadPixmap( moduleName( *it ), iconMap[*it], false ), 20 ) );
     }
 
     ModuleList modList;
     app->modules( modList );
-    for ( ModuleListIterator itr( modList ); itr.current(); ++itr )
+    QListIterator<CAM_Module*> itr( modList );
+    while ( itr.hasNext() )
     {
       LightApp_Module* mod = 0;
-      if ( itr.current()->inherits( "LightApp_Module" ) )
-       mod = (LightApp_Module*)itr.current();
+
+      CAM_Module* anItem = itr.next();
+      if ( anItem->inherits( "LightApp_Module" ) )
+       mod = (LightApp_Module*)anItem;
 
       if ( mod && !_prefs_->hasModule( mod->moduleName() ) )
       {
-       int modCat = _prefs_->addPreference( mod->moduleName() );
-       _prefs_->setItemProperty( modCat, "info", QString::null );
-       if( toCreate )
-         mod->createPreferences();
+       _prefs_->addPreference( mod->moduleName() );
+       mod->createPreferences();
+       that->emptyPreferences( mod->moduleName() );
       }
     }
   }
+  _prefs_->setItemProperty( "info", tr( "PREFERENCES_NOT_LOADED" ) );
 
   connect( myPrefs, SIGNAL( preferenceChanged( QString&, QString&, QString& ) ),
            this, SLOT( onPreferenceChanged( QString&, QString&, QString& ) ) );
@@ -1795,12 +1769,28 @@ void LightApp_Application::moduleAdded( CAM_Module* mod )
 
   if ( myPrefs && lightMod && !myPrefs->hasModule( lightMod->moduleName() ))
   {
-    int modCat = myPrefs->addPreference( mod->moduleName() );
-    myPrefs->setItemProperty( modCat, "info", QString::null );
+    myPrefs->addPreference( mod->moduleName() );
     lightMod->createPreferences();
+    emptyPreferences( mod->moduleName() );
   }
 }
 
+void LightApp_Application::emptyPreferences( const QString& modName )
+{
+  QtxPreferenceItem* item = myPrefs->findItem( modName, true );
+  if ( !item || !item->isEmpty() )
+    return;
+
+  printf( "---------------------> Modify for empty module.\n" );
+
+  QtxPagePrefFrameItem* frm = new QtxPagePrefFrameItem( item->title(), item->parentItem() );
+  frm->setIcon( item->icon() );
+  frm->setStretch( false );
+  item->parentItem()->insertItem( frm, item );
+  new QtxPagePrefLabelItem( Qt::AlignCenter, tr( "PREFERENCES_NOT_SUPPORTED" ).arg( modName ), frm );
+  delete item;
+}
+
 /*!
   Create preferences
 */
@@ -1809,33 +1799,34 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   if ( !pref )
     return;
 
+  QStringList     aValuesList;
+  QList<QVariant> anIndicesList;
+
   int salomeCat = pref->addPreference( tr( "PREF_CATEGORY_SALOME" ) );
+  pref->setItemIcon( salomeCat, Qtx::scaleIcon( resourceMgr()->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false ), 20 ) );
 
   int genTab = pref->addPreference( tr( "PREF_TAB_GENERAL" ), salomeCat );
   int studyGroup = pref->addPreference( tr( "PREF_GROUP_STUDY" ), genTab );
-  pref->setItemProperty( studyGroup, "columns", 1 );
+
+  pref->setItemProperty( "columns", 2, studyGroup );
 
   pref->addPreference( tr( "PREF_MULTI_FILE" ), studyGroup, LightApp_Preferences::Bool, "Study", "multi_file" );
   pref->addPreference( tr( "PREF_ASCII_FILE" ), studyGroup, LightApp_Preferences::Bool, "Study", "ascii_file" );
-  pref->addPreference( tr( "PREF_STORE_POS" ), studyGroup, LightApp_Preferences::Bool, "Study", "store_positions" );
+  pref->addPreference( tr( "PREF_STORE_POS" ),  studyGroup, LightApp_Preferences::Bool, "Study", "store_positions" );
 
   int extgroup = pref->addPreference( tr( "PREF_GROUP_EXT_BROWSER" ), genTab );
-  pref->setItemProperty( extgroup, "columns", 1 );
-       QString platform;
+  QString platform;
 #ifdef WIN32
-       platform = "winapplication";
+  platform = "winapplication";
 #else
-       platform = "application";
+  platform = "application";
 #endif
   int apppref = pref->addPreference( tr( "PREF_APP" ), extgroup, LightApp_Preferences::File, "ExternalBrowser", platform );
-  pref->setItemProperty( apppref, "existing", true );
-  pref->setItemProperty( apppref, "flags", QFileInfo::ExeUser );
-  pref->setItemProperty( apppref, "readOnly", false );
+  pref->setItemProperty( "mode", Qtx::PT_OpenFile, apppref );
 
   pref->addPreference( tr( "PREF_PARAM" ), extgroup, LightApp_Preferences::String, "ExternalBrowser", "parameters" );
 
   int pythonConsoleGroup = pref->addPreference( tr( "PREF_GROUP_PY_CONSOLE" ), genTab );
-  pref->setItemProperty( pythonConsoleGroup, "columns", 1 );
   pref->addPreference( tr( "PREF_FONT" ), pythonConsoleGroup, LightApp_Preferences::Font, "PyConsole", "font" );
 
   int viewTab = pref->addPreference( tr( "PREF_TAB_VIEWERS" ), salomeCat );
@@ -1848,108 +1839,210 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
 
   int supervGroup = pref->addPreference( tr( "PREF_GROUP_SUPERV" ), viewTab );
 
-  pref->setItemProperty( occGroup, "columns", 1 );
-  pref->setItemProperty( vtkGroup, "columns", 1 );
-  pref->setItemProperty( plot2dGroup, "columns", 1 );
+  pref->setItemProperty( "columns", 2, occGroup );
+  pref->setItemProperty( "columns", 1, vtkGroup );
+  pref->setItemProperty( "columns", 2, plot2dGroup );
 
+  // OCC Viewer
   int occTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), occGroup,
                                   LightApp_Preferences::DblSpin, "OCCViewer", "trihedron_size" );
-  pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup,
-                      LightApp_Preferences::Color, "OCCViewer", "background" );
+  pref->setItemProperty( "min", 1.0E-06, occTS );
+  pref->setItemProperty( "max", 1000, occTS );
 
-  pref->setItemProperty( occTS, "min", 1.0E-06 );
-  pref->setItemProperty( occTS, "max", 1000 );
 
   int isoU = pref->addPreference( tr( "PREF_ISOS_U" ), occGroup,
                                  LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_u" );
+  pref->setItemProperty( "min", 0, isoU );
+  pref->setItemProperty( "max", 100000, isoU );
+
+  pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup,
+                      LightApp_Preferences::Color, "OCCViewer", "background" );
+
   int isoV = pref->addPreference( tr( "PREF_ISOS_V" ), occGroup,
                                  LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_v" );
+  pref->setItemProperty( "min", 0, isoV );
+  pref->setItemProperty( "max", 100000, isoV );
 
-  pref->setItemProperty( isoU, "min", 0 );
-  pref->setItemProperty( isoU, "max", 100000 );
+  // VTK Viewer
+  int vtkGen = pref->addPreference( "", vtkGroup, LightApp_Preferences::Frame );
+  pref->setItemProperty( "columns", 2, vtkGen );
 
-  pref->setItemProperty( isoV, "min", 0 );
-  pref->setItemProperty( isoV, "max", 100000 );
+  int vtkProjMode = pref->addPreference( tr( "PREF_PROJECTION_MODE" ), vtkGen,
+                                        LightApp_Preferences::Selector, "VTKViewer", "projection_mode" );
+  QStringList aProjModeList;
+  aProjModeList.append( tr("PREF_ORTHOGRAPHIC") );
+  aProjModeList.append( tr("PREF_PERSPECTIVE") );
 
-  int vtkTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), vtkGroup,
-                                  LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" );
-  pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), vtkGroup, LightApp_Preferences::Bool, "VTKViewer", "relative_size" );
-  pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGroup,
+  QList<QVariant> aModeIndexesList;
+  aModeIndexesList.append(0);
+  aModeIndexesList.append(1);
+
+  pref->setItemProperty( "strings", aProjModeList, vtkProjMode );
+  pref->setItemProperty( "indexes", aModeIndexesList, vtkProjMode );
+
+  pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGen,
                       LightApp_Preferences::Color, "VTKViewer", "background" );
 
-  pref->setItemProperty( vtkTS, "min", 1.0E-06 );
-  pref->setItemProperty( vtkTS, "max", 150 );
+  int vtkTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), vtkGen,
+                                  LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" );
 
+  pref->setItemProperty( "min", 1.0E-06, vtkTS );
+  pref->setItemProperty( "max", 150, vtkTS );
+
+  pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), vtkGen, LightApp_Preferences::Bool, "VTKViewer", "relative_size" );
+
+  int vtkStyleMode = pref->addPreference( tr( "PREF_NAVIGATION" ), vtkGen,
+                                         LightApp_Preferences::Selector, "VTKViewer", "navigation_mode" );
+  QStringList aStyleModeList;
+  aStyleModeList.append( tr("PREF_STANDARD_STYLE") );
+  aStyleModeList.append( tr("PREF_KEYFREE_STYLE") );
+
+  pref->setItemProperty( "strings", aStyleModeList, vtkStyleMode );
+  pref->setItemProperty( "indexes", aModeIndexesList, vtkStyleMode );
+
+  pref->addPreference( "", vtkGroup, LightApp_Preferences::Space );
+
+  int vtkSpeed = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED" ), vtkGen,
+                                     LightApp_Preferences::IntSpin, "VTKViewer", "speed_value" );
+
+  pref->setItemProperty( "min", 1, vtkSpeed );
+  pref->setItemProperty( "max", 1000, vtkSpeed );
+
+  int vtkSpeedMode = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED_MODE" ), vtkGen,
+                                         LightApp_Preferences::Selector, "VTKViewer", "speed_mode" );
+  QStringList aSpeedModeList;
+  aSpeedModeList.append( tr("PREF_ARITHMETIC") );
+  aSpeedModeList.append( tr("PREF_GEOMETRICAL") );
+
+  pref->setItemProperty( "strings", aSpeedModeList, vtkSpeedMode );
+  pref->setItemProperty( "indexes", aModeIndexesList, vtkSpeedMode );
+
+  int vtkSM = pref->addPreference( tr( "PREF_FRAME_SPACEMOUSE" ), vtkGroup, LightApp_Preferences::GroupBox );
+  pref->setItemProperty( "columns", 2, vtkSM );
+  int spacemousePref1 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_1" ), vtkSM,
+                                            LightApp_Preferences::Selector, "VTKViewer",
+                                            "spacemouse_func1_btn" ); //decrease_speed_increment
+  int spacemousePref2 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_2" ), vtkSM,
+                                            LightApp_Preferences::Selector, "VTKViewer",
+                                            "spacemouse_func2_btn" ); //increase_speed_increment
+  int spacemousePref3 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_3" ), vtkSM,
+                                            LightApp_Preferences::Selector, "VTKViewer",
+                                            "spacemouse_func5_btn" ); //dominant_combined_switch
+
+  QStringList values;
+  values.append( tr( "PREF_SPACEMOUSE_BTN_1" ) );
+  values.append( tr( "PREF_SPACEMOUSE_BTN_2" ) );
+  values.append( tr( "PREF_SPACEMOUSE_BTN_3" ) );
+  values.append( tr( "PREF_SPACEMOUSE_BTN_4" ) );
+  values.append( tr( "PREF_SPACEMOUSE_BTN_5" ) );
+  values.append( tr( "PREF_SPACEMOUSE_BTN_6" ) );
+  values.append( tr( "PREF_SPACEMOUSE_BTN_7" ) );
+  values.append( tr( "PREF_SPACEMOUSE_BTN_8" ) );
+  values.append( tr( "PREF_SPACEMOUSE_BTN_*" ) );
+  values.append( tr( "PREF_SPACEMOUSE_BTN_10" ) );
+  values.append( tr( "PREF_SPACEMOUSE_BTN_11" ) );
+  QList<QVariant> indices;
+  indices.append( 1 );
+  indices.append( 2 );
+  indices.append( 3 );
+  indices.append( 4 );
+  indices.append( 5 );
+  indices.append( 6 );
+  indices.append( 7 );
+  indices.append( 8 );
+  indices.append( 9 ); // == button_*
+  indices.append( 10 );
+  indices.append( 11 );
+  pref->setItemProperty( "strings", values, spacemousePref1 );
+  pref->setItemProperty( "indexes", indices, spacemousePref1 );
+  pref->setItemProperty( "strings", values, spacemousePref2 );
+  pref->setItemProperty( "indexes", indices, spacemousePref2 );
+  pref->setItemProperty( "strings", values, spacemousePref3 );
+  pref->setItemProperty( "indexes", indices, spacemousePref3 );
+
+  int vtkRec = pref->addPreference( tr( "PREF_FRAME_RECORDING" ), vtkGroup, LightApp_Preferences::GroupBox );
+  pref->setItemProperty( "columns", 2, vtkRec );
+
+  int modePref = pref->addPreference( tr( "PREF_RECORDING_MODE" ), vtkRec,
+                                     LightApp_Preferences::Selector, "VTKViewer", "recorder_mode" );
+  values.clear();
+  values.append( tr( "PREF_SKIPPED_FRAMES" ) );
+  values.append( tr( "PREF_ALL_DISLPAYED_FRAMES" ) );
+  indices.clear();
+  indices.append( 0 );
+  indices.append( 1 );
+  pref->setItemProperty( "strings", values, modePref );
+  pref->setItemProperty( "indexes", indices, modePref );
+
+  int fpsPref = pref->addPreference( tr( "PREF_FPS" ), vtkRec,
+                                    LightApp_Preferences::DblSpin, "VTKViewer", "recorder_fps" );
+  pref->setItemProperty( "min", 0.1, fpsPref );
+  pref->setItemProperty( "max", 100, fpsPref );
+
+  int qualityPref = pref->addPreference( tr( "PREF_QUALITY" ), vtkRec,
+                                        LightApp_Preferences::IntSpin, "VTKViewer", "recorder_quality" );
+  pref->setItemProperty( "min", 1, qualityPref );
+  pref->setItemProperty( "max", 100, qualityPref );
+
+  pref->addPreference( tr( "PREF_PROGRESSIVE" ), vtkRec,
+                      LightApp_Preferences::Bool, "VTKViewer", "recorder_progressive" );
+
+  // Plot2d
   pref->addPreference( tr( "PREF_SHOW_LEGEND" ), plot2dGroup,
                       LightApp_Preferences::Bool, "Plot2d", "ShowLegend" );
 
   int legendPosition = pref->addPreference( tr( "PREF_LEGEND_POSITION" ), plot2dGroup,
                                            LightApp_Preferences::Selector, "Plot2d", "LegendPos" );
-  QStringList aLegendPosList;
-  aLegendPosList.append( tr("PREF_LEFT") );
-  aLegendPosList.append( tr("PREF_RIGHT") );
-  aLegendPosList.append( tr("PREF_TOP") );
-  aLegendPosList.append( tr("PREF_BOTTOM") );
-
-  QValueList<QVariant> anIndexesList;
-  anIndexesList.append(0);
-  anIndexesList.append(1);
-  anIndexesList.append(2);
-  anIndexesList.append(3);
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_LEFT") << tr("PREF_RIGHT") << tr("PREF_TOP") << tr("PREF_BOTTOM");
+  anIndicesList << 0               << 1                << 2              << 3                ;
 
-  pref->setItemProperty( legendPosition, "strings", aLegendPosList );
-  pref->setItemProperty( legendPosition, "indexes", anIndexesList );
+  pref->setItemProperty( "strings", aValuesList,   legendPosition );
+  pref->setItemProperty( "indexes", anIndicesList, legendPosition );
 
   int curveType = pref->addPreference( tr( "PREF_CURVE_TYPE" ), plot2dGroup,
                                       LightApp_Preferences::Selector, "Plot2d", "CurveType" );
-  QStringList aCurveTypesList;
-  aCurveTypesList.append( tr("PREF_POINTS") );
-  aCurveTypesList.append( tr("PREF_LINES") );
-  aCurveTypesList.append( tr("PREF_SPLINE") );
-
-  anIndexesList.clear();
-  anIndexesList.append(0);
-  anIndexesList.append(1);
-  anIndexesList.append(2);
-  
-  pref->setItemProperty( curveType, "strings", aCurveTypesList );
-  pref->setItemProperty( curveType, "indexes", anIndexesList );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_POINTS") << tr("PREF_LINES") << tr("PREF_SPLINE");
+  anIndicesList << 0                 << 1                << 2                ;
+
+  pref->setItemProperty( "strings", aValuesList,   curveType );
+  pref->setItemProperty( "indexes", anIndicesList, curveType );
 
   int markerSize = pref->addPreference( tr( "PREF_MARKER_SIZE" ), plot2dGroup,
                                        LightApp_Preferences::IntSpin, "Plot2d", "MarkerSize" );
 
-  pref->setItemProperty( markerSize, "min", 0 );
-  pref->setItemProperty( markerSize, "max", 100 );
-  
-  QStringList aScaleModesList;
-  aScaleModesList.append( tr("PREF_LINEAR") );
-  aScaleModesList.append( tr("PREF_LOGARITHMIC") );
-  
-  anIndexesList.clear();
-  anIndexesList.append(0);
-  anIndexesList.append(1);
+  pref->setItemProperty( "min", 0, markerSize );
+  pref->setItemProperty( "max", 100, markerSize );
+
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_LINEAR") << tr("PREF_LOGARITHMIC");
+  anIndicesList << 0                 << 1                     ;
 
   int horScale = pref->addPreference( tr( "PREF_HOR_AXIS_SCALE" ), plot2dGroup,
                                      LightApp_Preferences::Selector, "Plot2d", "HorScaleMode" );
 
-  pref->setItemProperty( horScale, "strings", aScaleModesList );
-  pref->setItemProperty( horScale, "indexes", anIndexesList );
+  pref->setItemProperty( "strings", aValuesList,   horScale );
+  pref->setItemProperty( "indexes", anIndicesList, horScale );
 
   int verScale = pref->addPreference( tr( "PREF_VERT_AXIS_SCALE" ), plot2dGroup,
                                      LightApp_Preferences::Selector, "Plot2d", "VerScaleMode" );
 
-  pref->setItemProperty( verScale, "strings", aScaleModesList );
-  pref->setItemProperty( verScale, "indexes", anIndexesList );
+  pref->setItemProperty( "strings", aValuesList,   verScale );
+  pref->setItemProperty( "indexes", anIndicesList, verScale );
 
   pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), plot2dGroup,
                       LightApp_Preferences::Color, "Plot2d", "Background" );
 
   int dirTab = pref->addPreference( tr( "PREF_TAB_DIRECTORIES" ), salomeCat );
   int dirGroup = pref->addPreference( tr( "PREF_GROUP_DIRECTORIES" ), dirTab );
-  pref->setItemProperty( dirGroup, "columns", 1 );
   pref->addPreference( tr( "" ), dirGroup,
                       LightApp_Preferences::DirList, "FileDlg", "QuickDirList" );
 
+  pref->setItemProperty( "columns", 4, supervGroup );
   pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), supervGroup,
                       LightApp_Preferences::Color, "SUPERVGraph", "Background" );
   pref->addPreference( tr( "PREF_SUPERV_TITLE_COLOR" ), supervGroup,
@@ -1958,11 +2051,36 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
 //                    LightApp_Preferences::Color, "SUPERVGraph", "Ctrl" );
 
   int obTab = pref->addPreference( tr( "PREF_TAB_OBJBROWSER" ), salomeCat );
+  int stGroup = pref->addPreference( tr( "PREF_OBJ_BROWSER_SEARCH_TOOL" ), obTab );
+  pref->addPreference( tr( "PREF_AUTO_HIDE_SEARCH_TOOL" ), stGroup, LightApp_Preferences::Bool,
+                      "ObjectBrowser", "auto_hide_search_tool" );
+
   int objSetGroup = pref->addPreference( tr( "PREF_OBJ_BROWSER_SETTINGS" ), obTab );
+  pref->setItemProperty( "columns", 2, objSetGroup );
   pref->addPreference( tr( "PREF_AUTO_SIZE_FIRST" ), objSetGroup, LightApp_Preferences::Bool,
                       "ObjectBrowser", "auto_size_first" );
   pref->addPreference( tr( "PREF_AUTO_SIZE" ), objSetGroup, LightApp_Preferences::Bool,
                       "ObjectBrowser", "auto_size" );
+  pref->addPreference( tr( "PREF_RESIZE_ON_EXPAND_ITEM" ), objSetGroup, LightApp_Preferences::Bool,
+                      "ObjectBrowser", "resize_on_expand_item" );
+
+  // MRU preferences
+  int mruGroup = pref->addPreference( tr( "PREF_GROUP_MRU" ), genTab, LightApp_Preferences::Auto, "MRU", "show_mru" );
+  pref->setItemProperty( "columns", 4, mruGroup );
+  int mruVisCount = pref->addPreference( tr( "PREF_MRU_VISIBLE_COUNT" ), mruGroup, LightApp_Preferences::IntSpin,
+                                        "MRU", "visible_count" );
+  pref->setItemProperty( "min", 0,   mruVisCount );
+  pref->setItemProperty( "max", 100, mruVisCount );
+  int mruLinkType = pref->addPreference( tr( "PREF_MRU_LINK_TYPE" ), mruGroup, LightApp_Preferences::Selector,
+                                        "MRU", "link_type" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_MRU_LINK_AUTO") << tr("PREF_MRU_LINK_SHORT") << tr("PREF_MRU_LINK_FULL");
+  anIndicesList << 0                        << 1                         << 2                       ;
+  pref->setItemProperty( "strings", aValuesList,   mruLinkType );
+  pref->setItemProperty( "indexes", anIndicesList, mruLinkType );
+
+  pref->retrieve();
 }
 
 /*!
@@ -1980,11 +2098,12 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
   if ( sec == QString( "OCCViewer" ) && param == QString( "trihedron_size" ) )
   {
     double sz = resMgr->doubleValue( sec, param, -1 );
-    QPtrList<SUIT_ViewManager> lst;
+    QList<SUIT_ViewManager*> lst;
     viewManagers( OCCViewer_Viewer::Type(), lst );
-    for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current() && sz >= 0; ++it )
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() && sz >= 0 )
     {
-      SUIT_ViewModel* vm = it.current()->getViewModel();
+      SUIT_ViewModel* vm = it.next()->getViewModel();
       if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
        continue;
 
@@ -2000,12 +2119,13 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
   {
     double sz = resMgr->doubleValue( "VTKViewer", "trihedron_size", -1 );
     bool isRelative = resMgr->booleanValue( "VTKViewer", "relative_size", true );
-    QPtrList<SUIT_ViewManager> lst;
+    QList<SUIT_ViewManager*> lst;
 #ifndef DISABLE_SALOMEOBJECT
     viewManagers( SVTK_Viewer::Type(), lst );
-    for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current() && sz >= 0; ++it )
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() && sz >= 0 )
     {
-      SUIT_ViewModel* vm = it.current()->getViewModel();
+      SUIT_ViewModel* vm = it.next()->getViewModel();
       if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
        continue;
 
@@ -2020,16 +2140,106 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
   }
 #endif
 
+#ifndef DISABLE_VTKVIEWER
+  if ( sec == QString( "VTKViewer" ) && (param == QString( "speed_value" ) || param == QString( "speed_mode" )) )
+  {
+    int speed = resMgr->integerValue( "VTKViewer", "speed_value", 10 );
+    int mode = resMgr->integerValue( "VTKViewer", "speed_mode", 0 );
+    QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+    viewManagers( SVTK_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+       continue;
+
+      SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+      if( vtkVM ) vtkVM->setIncrementalSpeed( speed, mode );
+    }
+#endif
+  }
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+  if ( sec == QString( "VTKViewer" ) && param == QString( "projection_mode" ) )
+  {
+    int mode = resMgr->integerValue( "VTKViewer", "projection_mode", 0 );
+    QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+    viewManagers( SVTK_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+       continue;
+
+      SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+      if( vtkVM ) vtkVM->setProjectionMode( mode );
+    }
+#endif
+  }
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+  if ( sec == QString( "VTKViewer" ) && param == QString( "navigation_mode" ) )
+  {
+    int mode = resMgr->integerValue( "VTKViewer", "navigation_mode", 0 );
+    QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+    viewManagers( SVTK_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+       continue;
+
+      SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+      if( vtkVM ) vtkVM->setInteractionStyle( mode );
+    }
+#endif
+  }
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+  if ( sec == QString( "VTKViewer" ) && (param == QString( "spacemouse_func1_btn" ) ||
+                                        param == QString( "spacemouse_func2_btn" ) ||
+                                        param == QString( "spacemouse_func5_btn" ) ) )
+  {
+    int btn1 = resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", 1 );
+    int btn2 = resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", 2 );
+    int btn3 = resMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", 9 );
+    QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+    viewManagers( SVTK_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+       continue;
+
+      SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+      if( vtkVM ) vtkVM->setSpacemouseButtons( btn1, btn2, btn3 );
+    }
+#endif
+  }
+#endif
+
 #ifndef DISABLE_OCCVIEWER
   if ( sec == QString( "OCCViewer" ) && ( param == QString( "iso_number_u" ) || param == QString( "iso_number_v" ) ) )
   {
-    QPtrList<SUIT_ViewManager> lst;
+    QList<SUIT_ViewManager*> lst;
     viewManagers( OCCViewer_Viewer::Type(), lst );
     int u = resMgr->integerValue( sec, "iso_number_u" );
     int v = resMgr->integerValue( sec, "iso_number_v" );
-    for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it )
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
     {
-      OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>( it.current() );
+      OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>( it.next() );
       if( mgr && mgr->getOCCViewer() )
        mgr->getOCCViewer()->setIsos( u, v );
     }
@@ -2038,26 +2248,34 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
 
   if( sec=="ObjectBrowser" )
   {
-    if( param=="auto_size" || param=="auto_size_first" )
+    SUIT_DataBrowser* ob = objectBrowser();
+    if ( !ob )
+      return;
+
+    if ( param=="auto_size_first" )
     {
-      OB_Browser* ob = objectBrowser();
-      if( !ob )
-       return;
-
-      bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false ),
-           autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true );
-      ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual );
-      ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual );
-      if( autoSize )
-       for( int i=1; i<ob->listView()->columns(); i++ )
-         if( ob->listView()->columnWidth( i )>0 )
-           ob->listView()->adjustColumn( i );
-      updateObjectBrowser( false );
+      bool autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true );
+      ob->setAutoSizeFirstColumn( autoSizeFirst );
+      if ( autoSizeFirst )
+       ob->adjustFirstColumnWidth();
+    }
+    else if ( param=="auto_size" ) {
+      bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false );
+      ob->setAutoSizeColumns(autoSize);
+      if ( autoSize )
+       ob->adjustColumnsWidth();
+    }
+    else if ( param=="resize_on_expand_item" ) {
+      bool resizeOnExpandItem = resMgr->booleanValue( "ObjectBrowser", "resize_on_expand_item", false );
+      ob->setResizeOnExpandItem(resizeOnExpandItem);
+    }
+    else if ( param == "auto_hide_search_tool" ) {
+      ob->searchTool()->enableAutoHide( resMgr->booleanValue( "ObjectBrowser", "auto_hide_search_tool" ) );
     }
   }
 
   if( sec=="Study" )
-  { 
+  {
     if( param=="store_positions" )
       updateWindows();
   }
@@ -2070,6 +2288,75 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
        pythonConsole()->setFont( resMgr->fontValue( "PyConsole", "font" ) );
   }
 #endif
+
+  if( sec=="MRU" )
+  {
+    QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
+    if ( mru ) {
+      if ( param == "visible_count" )
+       mru->setVisibleCount( resMgr->integerValue( "MRU", "visible_count", 5 ) );    // 5 MRU items by default
+      else if ( param == "max_count" )
+       mru->setHistoryCount( resMgr->integerValue( "MRU", "max_count", -1 ) );       // unlimited history by default
+      else if ( param == "insert_mode" )
+       mru->setInsertMode( resMgr->integerValue( "MRU", "insert_mode", 0 ) );        // QtxMRUAction::MoveFirst by default
+      else if ( param == "link_type" )
+       mru->setLinkType( resMgr->integerValue( "MRU", "link_type", 0 ) );            // QtxMRUAction::LinkAuto by default
+      else if ( param == "show_clear" )
+       mru->setClearPossible( resMgr->booleanValue( "MRU", "show_clear", false ) );  // do not show "Clear" item by default
+      else if ( param == "show_mru" )
+       mru->setVisible( resMgr->booleanValue( "MRU", "show_mru", false ) );          // do not show MRU menu item by default
+    }
+  }
+}
+
+/*!
+  Loads preferences
+*/
+void LightApp_Application::loadPreferences()
+{
+  CAM_Application::loadPreferences();
+
+  SUIT_ResourceMgr* aResMgr = resourceMgr();
+
+  if ( !aResMgr )
+    return;
+
+  static bool mru_load = true;
+  if ( mru_load )
+  {
+    QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
+    if ( mru ) {
+      mru->setVisible( aResMgr->booleanValue( "MRU", "show_mru", false ) );         // do not show MRU menu item by default
+      mru->setVisibleCount( aResMgr->integerValue( "MRU", "visible_count", 5 ) );   // 5 MRU items by default
+      mru->setHistoryCount( aResMgr->integerValue( "MRU", "max_count", -1 ) );      // unlimited history by default
+      mru->setInsertMode( aResMgr->integerValue( "MRU", "insert_mode", 0 ) );       // QtxMRUAction::MoveFirst by default
+      mru->setLinkType( aResMgr->integerValue( "MRU", "link_type", 0 ) );           // QtxMRUAction::LinkAuto by default
+      mru->setClearPossible( aResMgr->booleanValue( "MRU", "show_clear", false ) ); // do not show "Clear" item by default
+      mru->loadLinks( aResMgr, "MRU" );
+    }
+    mru_load = false;
+  }
+
+  myWinGeom.clear();
+  QStringList mods = aResMgr->parameters( "windows_geometry" );
+  for ( QStringList::const_iterator it = mods.begin(); it != mods.end(); ++it )
+  {
+    QByteArray arr;
+    if ( aResMgr->value( "windows_geometry", *it, arr ) )
+      myWinGeom.insert( *it, arr );
+  }
+
+  myWinVis.clear();
+  mods = aResMgr->parameters( "windows_visibility" );
+  for ( QStringList::const_iterator itr = mods.begin(); itr != mods.end(); ++itr )
+  {
+    QByteArray arr;
+    if ( aResMgr->value( "windows_visibility", *itr, arr ) )
+      myWinVis.insert( *itr, arr );
+  }
+
+  if ( desktop() )
+    desktop()->retrieveGeometry( aResMgr->stringValue( "desktop", "geometry" ) );
 }
 
 /*!
@@ -2077,38 +2364,62 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
 */
 void LightApp_Application::savePreferences()
 {
-  saveWindowsGeometry();
-  
-  if ( resourceMgr() )
-    {
-      if ( desktop() )
-       desktop()->saveGeometry( resourceMgr(), "desktop" );
-      resourceMgr()->save();
-    }
+  CAM_Application::savePreferences();
+
+  saveDockWindowsState();
+
+  SUIT_ResourceMgr* aResMgr = resourceMgr();
+
+  if ( !aResMgr )
+    return;
+
+  QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
+  if ( mru )
+    mru->saveLinks( aResMgr, "MRU" );
+
+  for ( WinGeom::const_iterator it = myWinGeom.begin(); it != myWinGeom.end(); ++it )
+    aResMgr->setValue( "windows_geometry", it.key(), it.value() );
+
+  for ( WinVis::const_iterator itr = myWinVis.begin(); itr != myWinVis.end(); ++itr )
+    aResMgr->setValue( "windows_visibility", itr.key(), itr.value() );
+
+  if ( desktop() )
+    aResMgr->setValue( "desktop", "geometry", desktop()->storeGeometry() );
+
+  aResMgr->save();
 }
 
 /*!
   Updates desktop title
 */
-void LightApp_Application::updateDesktopTitle() {
+void LightApp_Application::updateDesktopTitle()
+{
   QString aTitle = applicationName();
   QString aVer = applicationVersion();
   if ( !aVer.isEmpty() )
     aTitle += QString( " " ) + aVer;
 
   if ( activeStudy() ) {
-    QString sName = SUIT_Tools::file( activeStudy()->studyName().stripWhiteSpace(), false );
+    QString sName = SUIT_Tools::file( activeStudy()->studyName().trimmed(), false );
     aTitle += QString( " - [%1]" ).arg( sName );
   }
 
-  desktop()->setCaption( aTitle );
+  desktop()->setWindowTitle( aTitle );
 }
 
 /*!
-  \brief Get module activation actions
-  \return map <action_id><action_name> where
-  - action_id is unique non-zero action identifier
-  - action_name is action title
+  \brief Get map of the operations which can be performed
+  on the module activation.
+
+  The method should return the map of the kind \c {<id>:<name>}
+  where \c <id> is an integer identifier of the operation and
+  \c <name> is a title for the button to be added to the
+  dialog box. After user selects the required operation by the
+  clicking the corresponding button in the dialog box, its identifier
+  is passed to the moduleActionSelected() method to process
+  the made choice.
+
+  \return map of the operations
   \sa moduleActionSelected()
 */
 QMap<int, QString> LightApp_Application::activateModuleActions() const
@@ -2120,8 +2431,12 @@ QMap<int, QString> LightApp_Application::activateModuleActions() const
 }
 
 /*!
-  \brief Process module activation action.
-  \param id action identifier
+  \brief Called when the used selectes required operation chosen
+  from "Activate module" dialog box.
+
+  Performs the required operation according to the user choice.
+
+  \param id operation identifier
   \sa activateModuleActions()
 */
 void LightApp_Application::moduleActionSelected( const int id )
@@ -2137,6 +2452,7 @@ void LightApp_Application::moduleActionSelected( const int id )
     break;
   }
 }
+
 /*!
   Updates windows after close document
 */
@@ -2156,8 +2472,10 @@ void LightApp_Application::updateModuleActions()
   if ( activeModule() )
     modName = activeModule()->moduleName();
 
-  if ( myActions.contains( modName ) )
-    myActions[modName]->setOn( true );
+  LightApp_ModuleAction* moduleAction =
+    qobject_cast<LightApp_ModuleAction*>( action( ModulesListId ) );
+  if ( moduleAction )
+    moduleAction->setActiveModule( modName );
 }
 
 /*!
@@ -2200,30 +2518,28 @@ void LightApp_Application::updateWindows()
   QMap<int, int> winMap;
   currentWindows( winMap );
 
-  if ( activeStudy() ) {
-    for ( QMap<int, int>::ConstIterator it = winMap.begin(); it != winMap.end(); ++it ) {
-      getWindow( it.key() ); 
-      
-      Dock dock; int index, extraOffset; bool nl;
-      if ( desktop()->getLocation( myWindows[it.key()], dock, index, nl, extraOffset )
-          &&
-          dock != (Dock)it.data() )
-       desktop()->moveDockWindow( myWindows[it.key()], (Dock)it.data() );
+  if ( activeStudy() )
+  {
+    for ( QMap<int, int>::ConstIterator it = winMap.begin(); it != winMap.end(); ++it )
+    {
+      if ( !dockWindow( it.key() ) )
+       getWindow( it.key() );
     }
-
-    loadWindowsGeometry();
   }
 
-  // setWindowShown should be done even if no study is active (open). in this case all open windows
-  // will be hidden, which is neccessary in this case.
-  for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr ) {
-    
-    if ( myWindowsVisible.contains( itr.key() ) && 
-        !myWindowsVisible[ itr.key() ] )
-      continue;
-
-    setWindowShown( itr.key(), !itr.data()->isEmpty() && winMap.contains( itr.key() ) );
+  for ( WinMap::ConstIterator it = myWin.begin(); it != myWin.end(); ++it )
+  {
+    QWidget* wid = it.value();
+    if ( activeStudy() )
+      wid->setVisible( winMap.contains( it.key() ) );
+    else
+      delete wid;
   }
+
+  if ( activeStudy() )
+    loadDockWindowsState();
+  else
+    myWin.clear();
 }
 
 /*!
@@ -2241,72 +2557,159 @@ void LightApp_Application::updateViewManagers()
 /*!
   Loads windows geometry
 */
-void LightApp_Application::loadWindowsGeometry()
+void LightApp_Application::loadDockWindowsState()
 {
+  if ( !desktop() )
+    return;
+
   bool store = resourceMgr()->booleanValue( "Study", "store_positions", true );
   if( !store )
     return;
 
-  QtxDockAction* dockMgr = 0;
+  QString modName;
+  if ( activeModule() )
+    modName = activeModule()->name();
 
-  QAction* a = action( ViewWindowsId );
-  if ( a && a->inherits( "QtxDockAction" ) )
-    dockMgr = (QtxDockAction*)a;
+  if ( myWinGeom.contains( modName ) )
+    desktop()->restoreState( myWinGeom[modName] );
 
-  if ( !dockMgr )
+  if ( !myWinVis.contains( modName ) )
     return;
 
-  QString modName;
-  if ( activeModule() )
-    modName = activeModule()->name("");
+  QMap<QString, bool> tbMap, dwMap;
+  dockWindowsState( myWinVis[modName], tbMap, dwMap );
+
+  QList<QToolBar*> tbList = qFindChildren<QToolBar*>( desktop() );
+  for ( QList<QToolBar*>::iterator tit = tbList.begin(); tit != tbList.end(); ++tit )
+  {
+    QToolBar* tb = *tit;
+
+    QObject* po = Qtx::findParent( tb, "QMainWindow" );
+    if ( po != desktop() )
+      continue;
+
+    if ( tbMap.contains( tb->objectName() ) )
+      tb->setVisible( tbMap[tb->objectName()] );
+  }
+
+  QList<QDockWidget*> dwList = qFindChildren<QDockWidget*>( desktop() );
+  for ( QList<QDockWidget*>::iterator dit = dwList.begin(); dit != dwList.end(); ++dit )
+  {
+    QDockWidget* dw = *dit;
 
-  QString section = QString( "windows_geometry" );
-  if ( !modName.isEmpty() )
-    section += QString( "." ) + modName;
+    QObject* po = Qtx::findParent( dw, "QMainWindow" );
+    if ( po != desktop() )
+      continue;
 
-  dockMgr->loadGeometry( resourceMgr(), section, false );
-  dockMgr->restoreGeometry();
+    if ( dwMap.contains( dw->objectName() ) )
+      dw->setVisible( dwMap[dw->objectName()] );
+  }
 }
 
 /*!
   Saves windows geometry
 */
-void LightApp_Application::saveWindowsGeometry()
+void LightApp_Application::saveDockWindowsState()
 {
+  if ( !desktop() )
+    return;
+
   bool store = resourceMgr()->booleanValue( "Study", "store_positions", true );
   if( !store )
     return;
 
-  QtxDockAction* dockMgr = 0;
+  QString modName;
+  if ( activeModule() )
+    modName = activeModule()->name();
 
-  QAction* a = action( ViewWindowsId );
-  if ( a && a->inherits( "QtxDockAction" ) )
-    dockMgr = (QtxDockAction*)a;
+  myWinGeom.insert( modName, desktop()->saveState() );
 
-  if ( !dockMgr )
-    return;
+  QByteArray visArr;
+  if ( myWinVis.contains( modName ) )
+    visArr = myWinVis[modName];
 
-  QString modName;
-  if ( activeModule() )
-    modName = activeModule()->name("");
+  QMap<QString, bool> tbMap, dwMap;
+  dockWindowsState( visArr, tbMap, dwMap );
+
+  QList<QToolBar*> tbList = qFindChildren<QToolBar*>( desktop() );
+  for ( QList<QToolBar*>::iterator it = tbList.begin(); it != tbList.end(); ++it )
+  {
+    QToolBar* tb = *it;
+    tbMap.insert( tb->objectName(), tb->toggleViewAction()->isChecked() );
+  }
+
+  QList<QDockWidget*> dwList = qFindChildren<QDockWidget*>( desktop() );
+  for ( QList<QDockWidget*>::iterator it = dwList.begin(); it != dwList.end(); ++it )
+  {
+    QDockWidget* wid = *it;
+    dwMap.insert( wid->objectName(), wid->toggleViewAction()->isChecked() );
+  }
 
-  QString section = QString( "windows_geometry" );
-  if ( !modName.isEmpty() )
-    section += QString( "." ) + modName;
+  visArr = dockWindowsState( tbMap, dwMap );
 
-  dockMgr->storeGeometry();
-  dockMgr->saveGeometry( resourceMgr(), section, false );
+  myWinVis.insert( modName, visArr );
 }
 
-/*!
-  Activates windows
-*/
-void LightApp_Application::activateWindows()
+QByteArray LightApp_Application::dockWindowsState( const QMap<QString, bool>& tb, const QMap<QString, bool>& dw ) const
 {
-  if ( activeStudy() )
+  QByteArray visArr;
+  QDataStream stream( &visArr, QIODevice::WriteOnly );
+
+  stream << (uchar)ToolBarMarker;
+  stream << tb.size();
+  for ( QMap<QString, bool>::const_iterator tit = tb.begin(); tit != tb.end(); ++tit )
+  {
+    stream << tit.key();
+    stream << (uchar)( tit.value() ? 1 : 0 );
+  }
+
+  stream << (uchar)DockWidgetMarker;
+  stream << dw.size();
+  for ( QMap<QString, bool>::const_iterator wit = dw.begin(); wit != dw.end(); ++wit )
   {
-    for ( WindowMap::Iterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
-      itr.data()->activate( activeStudy()->id() );
+    stream << wit.key();
+    stream << (uchar)( wit.value() ? 1 : 0 );
+  }
+
+  return visArr;
+}
+
+void LightApp_Application::dockWindowsState( const QByteArray& arr, QMap<QString, bool>& tb, QMap<QString, bool>& dw ) const
+{
+  tb.clear();
+  dw.clear();
+
+  QByteArray visArr = arr;
+  QDataStream stream( &visArr, QIODevice::ReadOnly );
+
+  uchar marker;
+  stream >> marker;
+  if ( marker != ToolBarMarker )
+    return;
+
+  int lines;
+  stream >> lines;
+  for ( int i = 0; i < lines; ++i )
+  {
+    QString objectName;
+    stream >> objectName;
+    uchar shown;
+    stream >> shown;
+    tb.insert( objectName, shown );
+  }
+
+  stream >> marker;
+  if ( marker != DockWidgetMarker )
+    return;
+
+  stream >> lines;
+  for ( int j = 0; j < lines; ++j )
+  {
+    QString objectName;
+    stream >> objectName;
+    uchar shown;
+    stream >> shown;
+    dw.insert( objectName, shown );
   }
 }
 
@@ -2328,7 +2731,7 @@ void LightApp_Application::moduleIconNames( QMap<QString, QString>& iconMap ) co
   {
     QString modName = *it;
     QString modIntr = moduleName( modName );
-    QString modIcon = resMgr->stringValue( modIntr, "icon", QString::null );
+    QString modIcon = resMgr->stringValue( modIntr, "icon", QString() );
 
     if ( modIcon.isEmpty() )
       continue;
@@ -2343,17 +2746,17 @@ void LightApp_Application::moduleIconNames( QMap<QString, QString>& iconMap ) co
 /*!
   Inserts items in popup, which necessary for current application
 */
-void LightApp_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopup, QString& title )
+void LightApp_Application::contextMenuPopup( const QString& type, QMenu* thePopup, QString& title )
 {
   CAM_Application::contextMenuPopup( type, thePopup, title );
 
-  OB_Browser* ob = objectBrowser();
-  if ( !ob || type != ob->popupClientType() )
-    return;
-
-  thePopup->insertSeparator();
-  thePopup->insertItem( tr( "MEN_REFRESH" ), this, SLOT( onRefresh() ) );
-  thePopup->insertItem( tr( "MEN_FIND" ), this, SLOT( onFind() ) );
+  SUIT_DataBrowser* ob = objectBrowser();
+  if ( ob && type == ob->popupClientType() ) {
+    thePopup->addSeparator();
+    QAction* a = thePopup->addAction( tr( "MEN_REFRESH" ), this, SLOT( onRefresh() ) );
+    if ( ob->updateKey() )
+      a->setShortcut( ob->updateKey() );
+  }
 }
 
 /*!
@@ -2362,6 +2765,7 @@ void LightApp_Application::contextMenuPopup( const QString& type, QPopupMenu* th
 void LightApp_Application::createEmptyStudy()
 {
   CAM_Application::createEmptyStudy();
+
   if ( objectBrowser() )
     objectBrowser()->updateTree();
 }
@@ -2373,8 +2777,10 @@ void LightApp_Application::createEmptyStudy()
 bool LightApp_Application::activateModule( CAM_Module* mod )
 {
   bool res = CAM_Application::activateModule( mod );
+
   if ( objectBrowser() )
     objectBrowser()->updateTree();
+
   return res;
 }
 
@@ -2392,17 +2798,32 @@ SUIT_Accel* LightApp_Application::accel() const
 void LightApp_Application::onWCDestroyed( QObject* ob )
 {
   // remove destroyed widget container from windows map
-  for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
+  for ( WinMap::ConstIterator itr = myWin.begin(); itr != myWin.end(); ++itr )
   {
-    if ( itr.data() != ob )
+    if ( itr.value() != ob )
       continue;
 
     int key = itr.key();
-    myWindows.remove( key );
+    myWin.remove( key );
     break;
   }
 }
 
+void LightApp_Application::onMRUActivated( const QString& name )
+{
+  SUIT_Session* s = SUIT_Session::session();
+  if ( s && s->activeApplication() == this )
+    onOpenDoc( name );
+}
+
+void LightApp_Application::onStylePreferences()
+{
+  Style_PrefDlg dlg( desktop() );
+  dlg.exec();
+
+  resourceMgr()->setValue( "Style", "use_salome_style", Style_Salome::isActive() );
+}
+
 /*!
   Connects just added view manager
 */
@@ -2437,9 +2858,56 @@ void LightApp_Application::onRenameWindow()
     return;
 
   bool ok;
-  QString name = QInputDialog::getText( tr( "TOT_RENAME" ), tr( "PRP_RENAME" ), QLineEdit::Normal, w->caption(), &ok, w );
+  QString name = QInputDialog::getText( w, tr( "TOT_RENAME" ), tr( "PRP_RENAME" ), QLineEdit::Normal, w->windowTitle(), &ok );
   if( ok && !name.isEmpty() )
-    w->setCaption( name );
+    w->setWindowTitle( name );
+}
+
+/*!
+  Closes active window of desktop
+*/
+void LightApp_Application::onCloseWindow()
+{
+  if( !desktop() )
+    return;
+
+  QWidget* w = desktop()->activeWindow();
+  if( !w )
+    return;
+
+  w->close();
+}
+
+/*!
+  Closes all windows of desktop
+*/
+void LightApp_Application::onCloseAllWindow()
+{
+  STD_TabDesktop* desk = dynamic_cast<STD_TabDesktop*>( desktop() );
+  if( !desk )
+    return;
+
+  QList<SUIT_ViewWindow*> wndList = desk->windows();
+  SUIT_ViewWindow* wnd;
+  foreach( wnd, wndList )
+  {
+    if ( wnd )
+      wnd->close();
+  }
+}
+
+/*!
+  Groups all windows of desktop
+*/
+void LightApp_Application::onGroupAllWindow()
+{
+  STD_TabDesktop* desk = dynamic_cast<STD_TabDesktop*>( desktop() );
+  if( !desk )
+    return;
+
+  QtxWorkstack* wgStack = desk->workstack();
+  if ( wgStack )
+    wgStack->stack();
 }
 
 /*!
@@ -2452,15 +2920,15 @@ bool LightApp_Application::isLibExists( const QString& moduleTitle ) const
     return false;
 
   QString lib = moduleLibrary( moduleTitle );
-  
+
   //abd: changed libSalomePyQtGUI to SalomePyQtGUI for WIN32
   bool isPythonModule = lib.contains("SalomePyQtGUI");
 
   QStringList paths;
 #ifdef WIN32
-  paths = QStringList::split( ";", ::getenv( "PATH" ) );
+  paths = QString(::getenv( "PATH" )).split( ";", QString::SkipEmptyParts );
 #else
-  paths = QStringList::split( ":", ::getenv( "LD_LIBRARY_PATH" ) );
+  paths = QString(::getenv( "LD_LIBRARY_PATH" )).split( ":", QString::SkipEmptyParts );
 #endif
 
   bool isLibFound = false;
@@ -2468,20 +2936,20 @@ bool LightApp_Application::isLibExists( const QString& moduleTitle ) const
   for( ; anIt!=aLast; anIt++ )
   {
     QFileInfo inf( Qtx::addSlash( *anIt ) + lib );
-    
+
     if( inf.exists() )
       {
        isLibFound = true;
        break;
       }
   }
-  
+
   if ( !isLibFound )
     {
-      printf( "****************************************************************\n" );
-      printf( "*    Warning: library %s cannot be found\n", lib.latin1() );
-      printf( "*    Module %s will not be available in GUI mode\n", moduleTitle.latin1() );
-      printf( "****************************************************************\n" );
+      INFOS( "****************************************************************" << std::endl
+          << "*    Warning: library " << lib.toLatin1().constData() << " cannot be found" << std::endl
+          << "*    Module " << moduleTitle.toLatin1().constData() << " will not be available in GUI mode" << std::endl
+          << "****************************************************************" << std::endl );
     }
   else if ( !isPythonModule )
     return true;
@@ -2493,9 +2961,9 @@ bool LightApp_Application::isLibExists( const QString& moduleTitle ) const
 
       // Check the python library
 #ifdef WIN32
-      paths = QStringList::split( ";", ::getenv( "PATH" ) );
+      paths = QString(::getenv( "PATH" )).split( ";", QString::SkipEmptyParts );
 #else
-      paths = QStringList::split( ":", ::getenv( "PYTHONPATH" ) );
+      paths = QString(::getenv( "PYTHONPATH" )).split( ":", QString::SkipEmptyParts );
 #endif
       bool isPyLib = false, isPyGuiLib = false;
       QStringList::const_iterator anIt = paths.begin(), aLast = paths.end();
@@ -2503,23 +2971,23 @@ bool LightApp_Application::isLibExists( const QString& moduleTitle ) const
        {
          QFileInfo inf( Qtx::addSlash( *anIt ) + pylib );
          QFileInfo infgui( Qtx::addSlash( *anIt ) + pylibgui );
-    
+
          if( !isPyLib && inf.exists() )
            isPyLib = true;
-         
+
          if( !isPyGuiLib && infgui.exists() )
            isPyGuiLib = true;
-         
+
          if ( isPyLib && isPyGuiLib && isLibFound)
            return true;
        }
-      
+
       printf( "****************************************************************\n" );
-      printf( "*    Warning: python library for %s cannot be found:\n", moduleTitle.latin1() );
+      printf( "*    Warning: python library for %s cannot be found:\n", moduleTitle.toLatin1().constData() );
       if (!isPyLib)
-       printf( "*    No module named %s\n", moduleName( moduleTitle ).latin1() );
+       printf( "*    No module named %s\n", moduleName( moduleTitle ).toLatin1().constData() );
       if (!isPyGuiLib)
-       printf( "*    No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).latin1() );
+       printf( "*    No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).toLatin1().constData() );
       printf( "****************************************************************\n" );
       return true;
   }
@@ -2543,19 +3011,6 @@ void LightApp_Application::setDefaultStudyName( const QString& theName )
   }
 }
 
-/*! slot, called on show/hide of a dock window */
-void LightApp_Application::onVisibilityChanged( bool visible )
-{
-  const QObject* win = sender();
-  for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
-    if ( itr.data() == win ) 
-    {
-      myWindowsVisible[ itr.key() ] = visible;
-      return;
-    }
-}
-
 /*!
   Custom event handler
 */
@@ -2563,12 +3018,13 @@ bool LightApp_Application::event( QEvent* e )
 {
   if( e && e->type()==2000 )
   {
-    QCustomEvent* ce = ( QCustomEvent* )e;
+    SALOME_CustomEvent* ce = ( SALOME_CustomEvent* )e;
     QString* d = ( QString* )ce->data();
-    if( SUIT_MessageBox::warn2(0, tr("WRN_WARNING"),
-                          d ? *d : "",
-                          tr("BUT_OK"), tr("BUT_CANCEL"), 0, 1, 0 )==0 )
-       onPreferences();
+    if( SUIT_MessageBox::question(0, tr("WRN_WARNING"),
+                                 d ? *d : "",
+                                 SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                 SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
+      showPreferences( tr( "PREF_APP" ) );
     if( d )
       delete d;
     return true;
@@ -2581,8 +3037,8 @@ bool LightApp_Application::checkDataObject(LightApp_DataObject* theObj)
 {
   if (theObj)
     {
-      bool isSuitable =        !theObj->entry().isEmpty() && 
-                       !theObj->componentDataType().isEmpty() && 
+      bool isSuitable =        !theObj->entry().isEmpty() &&
+                       !theObj->componentDataType().isEmpty() &&
                        !theObj->name().isEmpty();
       return isSuitable;
     }
@@ -2590,7 +3046,54 @@ bool LightApp_Application::checkDataObject(LightApp_DataObject* theObj)
   return false;
 }
 
-void LightApp_Application::onFind()
+int LightApp_Application::openChoice( const QString& aName )
+{
+  int choice = CAM_Application::openChoice( aName );
+
+  if ( choice == OpenExist ) // The document is already open.
+  {
+    // Do you want to reload it?
+    if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_DOC_ALREADYOPEN" ).arg( aName ),
+                                   SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No ) == SUIT_MessageBox::Yes )
+      choice = OpenReload;
+  }
+
+  return choice;
+}
+
+bool LightApp_Application::openAction( const int choice, const QString& aName )
 {
-  objectBrowser()->enableSearch( true );
+  bool res = false;
+  switch ( choice )
+  {
+  case OpenReload:
+    {
+      STD_Application* app = 0;
+      SUIT_Session* session = SUIT_Session::session();
+      QList<SUIT_Application*> appList = session->applications();
+      for ( QList<SUIT_Application*>::iterator it = appList.begin(); it != appList.end() && !app; ++it )
+      {
+       if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName )
+         app = ::qobject_cast<STD_Application*>( *it );
+      }
+
+      if ( app )
+      {
+       app->onCloseDoc( false );
+       appList = session->applications();
+       STD_Application* other = 0;
+       for ( QList<SUIT_Application*>::iterator it = appList.begin(); it != appList.end() && !other; ++it )
+         other = ::qobject_cast<STD_Application*>( *it );
+
+       if ( other )
+         res = other->onOpenDoc( aName );
+      }
+    }
+    break;
+  default:
+    res = CAM_Application::openAction( choice, aName );
+    break;
+  }
+
+  return res;
 }
index e83e3c2fdbec22c56e005441bcf8bd26932f4145..7f17879092ff70efc975cf05008fd2bc8c3ccaa9 100644 (file)
@@ -1,26 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_Application.h
 // Created:   6/20/2005 18:39:25 PM
 // Author:    OCC team
-// Copyright (C) CEA 2005
-
+//
 #ifndef LIGHTAPP_APPLICATION_H
 #define LIGHTAPP_APPLICATION_H
 
 #include "LightApp.h"
 #include <CAM_Application.h>
 
+#include <QPointer>
+
 class LogWindow;
-class OB_Browser;
 #ifndef DISABLE_PYCONSOLE
-  class PythonConsole;
+class PyConsole_Console;
 #endif
-class STD_Application;
 class LightApp_WidgetContainer;
 class LightApp_Preferences;
 class LightApp_SelectionMgr;
 class LightApp_DataObject;
+class SUIT_DataBrowser;
 class SUIT_Study;
 class SUIT_Accel;
 class CAM_Module;
@@ -48,7 +51,7 @@ class CAM_Module;
 class QString;
 class QWidget;
 class QStringList;
-class QPixmap;
+class QDockWidget;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -63,7 +66,7 @@ class LIGHTAPP_EXPORT LightApp_Application : public CAM_Application
   Q_OBJECT
 
 public:
-  typedef enum { WT_ObjectBrowser, 
+  typedef enum { WT_ObjectBrowser,
 #ifndef DISABLE_PYCONSOLE
                  WT_PyConsole,
 #endif
@@ -74,28 +77,11 @@ public:
   enum { MenuWindowId = 6 };
 
   enum { RenameId = CAM_Application::UserID,
-
-#ifndef DISABLE_GLVIEWER
-         NewGLViewId ,
-#endif
-
-#ifndef DISABLE_PLOT2DVIEWER
-         NewPlot2dId,
-#endif
-
-#ifndef DISABLE_OCCVIEWER
-         NewOCCViewId,
-#endif
-
-#ifndef DISABLE_VTKVIEWER
-         NewVTKViewId,
-#endif
-
-#ifndef DISABLE_QXGRAPHVIEWER
-         NewQxGraphViewId,
-#endif
-
-         PreferencesId, MRUId, UserID };
+        CloseId, CloseAllId, GroupAllId,
+        PreferencesId, MRUId, ModulesListId,
+         NewGLViewId, NewPlot2dId, NewOCCViewId, NewVTKViewId, NewQxGraphViewId,
+        NewQxSceneViewId, StyleId,
+        UserID };
 
 protected:
   enum { NewStudyId = 1, OpenStudyId };
@@ -107,17 +93,15 @@ public:
   virtual QString                     applicationName() const;
   virtual QString                     applicationVersion() const;
 
-  virtual CAM_Module*                 loadModule( const QString& );
+  virtual CAM_Module*                 loadModule( const QString&, const bool = true );
   virtual bool                        activateModule( const QString& );
 
-  virtual bool                        useStudy( const QString& );
-
   LightApp_SelectionMgr*              selectionMgr() const;
-  
+
   LogWindow*                          logWindow();
-  OB_Browser*                         objectBrowser();
+  SUIT_DataBrowser*                   objectBrowser();
 #ifndef DISABLE_PYCONSOLE
-  PythonConsole*                      pythonConsole(); 
+  PyConsole_Console*                  pythonConsole();
 #endif
 
   virtual void                        updateObjectBrowser( const bool = true );
@@ -126,10 +110,10 @@ public:
 
   virtual QString                     getFileFilter() const;
 
-  virtual QString                     getFileName( bool open, const QString& initial, const QString& filters, 
+  virtual QString                     getFileName( bool open, const QString& initial, const QString& filters,
                                                   const QString& caption, QWidget* parent );
   virtual QString                     getDirectory( const QString& initial, const QString& caption, QWidget* parent );
-  virtual QStringList                 getOpenFileNames( const QString& initial, const QString& filters, 
+  virtual QStringList                 getOpenFileNames( const QString& initial, const QString& filters,
                                                        const QString& caption, QWidget* parent );
 
   void                                updateActions();
@@ -140,16 +124,14 @@ public:
   virtual SUIT_ViewManager*           createViewManager( const QString& vmType );
 
   QWidget*                            getWindow( const int, const int = -1 );
-  QWidget*                            window( const int, const int = -1 ) const;
-  void                                addWindow( QWidget*, const int, const int = -1 );
-  void                                removeWindow( const int, const int = -1 );
-
-  bool                                isWindowVisible( const int ) const;
-  void                                setWindowShown( const int, const bool );
+  QWidget*                            dockWindow( const int ) const;
+  void                                removeDockWindow( const int );
+  void                                insertDockWindow( const int, QWidget* );
+  void                                placeDockWindow( const int, Qt::DockWidgetArea );
 
   virtual void                        start();
 
-  virtual void                        contextMenuPopup( const QString&, QPopupMenu*, QString& );
+  virtual void                        contextMenuPopup( const QString&, QMenu*, QString& );
 
   virtual void                        createEmptyStudy();
 
@@ -160,9 +142,11 @@ public:
   static int                          studyId();
 
   virtual bool                        event( QEvent* );
-  
+
   virtual bool                        checkDataObject( LightApp_DataObject* theObj );
 
+  virtual void                        updateDesktopTitle();
+
 signals:
   void                                studyOpened();
   void                                studySaved();
@@ -171,12 +155,11 @@ signals:
 
 public slots:
   virtual void                        onHelpContentsModule();
-  virtual void                        onHelpContextModule( const QString&, const QString& );
+  virtual void                        onHelpContextModule( const QString&, const QString&, const QString& = QString() );
   virtual void                        onNewDoc();
   virtual void                        onOpenDoc();
   virtual void                        onHelpAbout();
   virtual bool                        onOpenDoc( const QString& );
-  virtual bool                        onLoadDoc( const QString& );
 
 protected:
   virtual void                        createActions();
@@ -201,9 +184,10 @@ protected:
   LightApp_Preferences*               preferences( const bool ) const;
   virtual void                        createPreferences( LightApp_Preferences* );
   virtual void                        preferencesChanged( const QString&, const QString& );
+
+  virtual void                        loadPreferences();
   virtual void                        savePreferences();
-  virtual void                        updateDesktopTitle();
-  
+
   virtual QMap<int, QString>          activateModuleActions() const;
   virtual void                        moduleActionSelected( const int );
 
@@ -211,7 +195,7 @@ protected slots:
   virtual void                        onDesktopActivated();
 
   void                                onNewWindow();
-  void                                onModuleActivation( QAction* );
+  void                                onModuleActivation( const QString& );
   void                                onCloseView( SUIT_ViewManager* );
 
   void                                onStudyCreated( SUIT_Study* );
@@ -221,23 +205,30 @@ protected slots:
 
   void                                onWCDestroyed( QObject* );
 
+  void                                onMRUActivated( const QString& );
+
+  void                                onStylePreferences();
+
 private slots:
   void                                onSelection();
   void                                onRefresh();
-  void                                onFind();
   void                                onPreferences();
-  void                                onMRUActivated( QString );
   void                                onPreferenceChanged( QString&, QString&, QString& );
   void                                onRenameWindow();
-  void                                onVisibilityChanged( bool );
+  void                                onCloseWindow();
+  void                                onCloseAllWindow();
+  void                                onGroupAllWindow();
 
 protected:
   void                                updateWindows();
   void                                updateViewManagers();
   void                                updateModuleActions();
 
-  void                                loadWindowsGeometry();
-  void                                saveWindowsGeometry();
+  void                                loadDockWindowsState();
+  void                                saveDockWindowsState();
+
+  virtual void                        studyOpened( SUIT_Study* );
+  virtual void                        studyCreated( SUIT_Study* );
 
   void                                updatePreference( const QString&, const QString&, const QString& );
 
@@ -246,20 +237,35 @@ protected:
   void                                currentViewManagers( QStringList& ) const;
   void                                moduleIconNames( QMap<QString, QString>& ) const;
 
-  void                                activateWindows();
   bool                                isLibExists( const QString& ) const;
 
+  QDockWidget*                        windowDock( QWidget* ) const;
+  QByteArray                          dockWindowsState( const QMap<QString, bool>&, const QMap<QString, bool>& ) const;
+  void                                dockWindowsState( const QByteArray&, QMap<QString, bool>&, QMap<QString, bool>& ) const;
+
+  virtual int                         openChoice( const QString& );
+  virtual bool                        openAction( const int, const QString& );
+
+  void                                showPreferences( const QString& = QString() );
+
+private:
+  void                                emptyPreferences( const QString& );
+
 protected:
-  typedef QMap<QString, QAction*>              ActionMap;
-  typedef QMap<int, LightApp_WidgetContainer*> WindowMap;
-  typedef QMap<int, bool>                      WindowVisibilityMap;
+  typedef QPointer<QWidget>         WinPtr;
+  typedef QMap<int, WinPtr>         WinMap;
+  typedef QMap<QString, QByteArray> WinVis;
+  typedef QMap<QString, QByteArray> WinGeom;
+
+  enum { OpenReload = CAM_Application::OpenExist + 1 };
 
 protected:
   LightApp_Preferences*               myPrefs;
   LightApp_SelectionMgr*              mySelMgr;
-  ActionMap                           myActions;
-  WindowMap                           myWindows;
-  WindowVisibilityMap                 myWindowsVisible;
+
+  WinMap                              myWin;
+  WinVis                              myWinVis;
+  WinGeom                             myWinGeom;
 
   SUIT_Accel*                         myAccel;
 
index 702ef7b335b767c327bee3ee850ffa897052c710..653256f95f5bfa7257e0785fe88ef897ac348d5b 100644 (file)
@@ -1,38 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_DataModel.cxx
 // Created:   10/25/2004 10:36:06 AM
 // Author:    Sergey LITONIN
-// Copyright (C) CEA 2004
-
+//
 #include "LightApp_DataModel.h"
 #include "LightApp_Study.h"
-#include "LightApp_RootObject.h"
 #include "LightApp_DataObject.h"
 #include "LightApp_Module.h"
 #include "LightApp_Application.h"
 
-#include <OB_Browser.h>
-
-#include <SUIT_Application.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
+#include <SUIT_TreeModel.h>
+#include <SUIT_DataBrowser.h>
 #include <SUIT_DataObject.h>
 
 /*!
@@ -41,6 +39,9 @@
 LightApp_DataModel::LightApp_DataModel( CAM_Module* theModule )
 : CAM_DataModel( theModule )
 {
+  myGroupId = 0;
+  if( module() )
+       myGroupId = qHash( module()->name() );
 }
 
 /*!
@@ -99,7 +100,7 @@ void LightApp_DataModel::build()
 void LightApp_DataModel::updateWidgets()
 {
   LightApp_Application* app = dynamic_cast<LightApp_Application*>( module()->application() );
-  if( app )
+  if ( app )
     app->objectBrowser()->updateTree( 0, false );
 }
 
@@ -114,8 +115,9 @@ void LightApp_DataModel::update( LightApp_DataObject*, LightApp_Study* )
   if( modelRoot )
   {
     ch = modelRoot->children();
-    for ( DataObjectListIterator it( ch ); it.current(); ++it )
-      it.current()->setParent( 0 );
+    QListIterator<SUIT_DataObject*> it( ch );
+    while ( it.hasNext() )
+      it.next()->setParent( 0 );
   }
 
   build();
@@ -124,15 +126,19 @@ void LightApp_DataModel::update( LightApp_DataObject*, LightApp_Study* )
   if( modelRoot )
   {
     DataObjectList new_ch = modelRoot->children();
-    for ( DataObjectListIterator it1( new_ch ); it1.current(); ++it1 )
-      aMap.insert( it1.current(), 0 );
+    QListIterator<SUIT_DataObject*> it1( new_ch );
+    while ( it1.hasNext() )
+      aMap.insert( it1.next(), 0 );
   }
 
   updateWidgets();
 
-  for( DataObjectListIterator it( ch ); it.current(); ++it )
-    if( !aMap.contains( it.current() ) )
-      delete it.current();
+  QListIterator<SUIT_DataObject*> it( ch );
+  while ( it.hasNext() ) {
+    SUIT_DataObject* aDO = it.next();
+    if( !aMap.contains( aDO ) )
+      delete aDO;
+  }
 }
 
 /*!
@@ -169,3 +175,36 @@ bool LightApp_DataModel::isSaved() const
 {
   return true;
 }
+
+/*!
+  \return data model group id used for custom columns creation
+*/
+int LightApp_DataModel::groupId() const
+{
+  return myGroupId;
+}
+
+/*!
+  Register custom column in the object browser
+  \param browser - object browser where new column should be created
+  \param name - translated column name
+  \param custom_id - custom column identificator passed into data object's methods text(), icon() etc
+*/
+void LightApp_DataModel::registerColumn( SUIT_DataBrowser* browser, const QString& name, const int custom_id )
+{
+  SUIT_AbstractModel* m = dynamic_cast<SUIT_AbstractModel*>( browser ? browser->model() : 0 );
+  if( m )
+    m->registerColumn( groupId(), name, custom_id );
+}
+
+/*!
+  Remove registered custom column from the object browser
+  \param browser - object browser where new column should be created
+  \param name - translated column name
+*/
+void LightApp_DataModel::unregisterColumn( SUIT_DataBrowser* browser, const QString& name )
+{
+  SUIT_AbstractModel* m = dynamic_cast<SUIT_AbstractModel*>( browser ? browser->model() : 0 );
+  if( m )
+       m->unregisterColumn( groupId(), name );
+}
index c2eb2d6e703e414b7950bf37efa5e1b007548007..e7c0f40a641af4954948bb55db41c34b91e235e6 100644 (file)
@@ -1,26 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_DataModel.h
 // Created:   10/25/2004 10:32:33 AM
 // Author:    Sergey LITONIN
-// Copyright (C) CEA 2004
-
+//
 #ifndef LIGHTAPP_DATAMODEL_H
 #define LIGHTAPP_DATAMODEL_H
 
@@ -34,6 +36,7 @@
 class LightApp_Module;
 class LightApp_Study;
 class LightApp_DataObject;
+class SUIT_DataBrowser;
 
 /*!
   Description : Base class of data model
@@ -58,6 +61,10 @@ public:
 
   LightApp_Module*                    getModule() const;
 
+  int  groupId() const;
+  void registerColumn( SUIT_DataBrowser*, const QString&, const int );
+  void unregisterColumn( SUIT_DataBrowser*, const QString& );
+
 signals:
   void                                opened();
   void                                saved();
@@ -67,6 +74,9 @@ protected:
   LightApp_Study*                     getStudy() const;
   virtual void                        build();
   virtual void                        updateWidgets();
+
+private:
+  int myGroupId;
 };
 
 #endif 
index a4df6dfa84351391b9a62aa2028cd1fbfbfa9c5a..504ae52f342658a9735a419b9713728100450a5a 100644 (file)
@@ -1,39 +1,43 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : LightApp_DataObject.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #include "LightApp_DataObject.h"
-
 #include "LightApp_Study.h"
-#include "LightApp_RootObject.h"
-
-#include "CAM_DataModel.h"
-#include "CAM_Module.h"
+#include "LightApp_DataModel.h"
 
-#include <SUIT_Application.h>
-#include <SUIT_ResourceMgr.h>
+#include <CAM_Module.h>
 #include <SUIT_DataObjectKey.h>
 
-#include <qobject.h>
+#include <QVariant>
 
 /*!
-       Class: LightApp_DataObject::Key
-       Level: Internal
+  \class LightApp_DataObject::Key
+  \brief Represents unique data object key for the LightApp_DataObject
+  class instances.
+  \internal
 */
+
 class LightApp_DataObject::Key : public SUIT_DataObjectKey
 {
 public:
@@ -47,73 +51,128 @@ private:
   QString myEntry;
 };
 
-/*!Constructor. Initialize by \a entry.*/
+/*!
+  \brief Constructor.
+  \internal
+  \param entry data object entry
+*/
 LightApp_DataObject::Key::Key( const QString& entry )
 : SUIT_DataObjectKey(),
   myEntry( entry )
 {
 }
 
-/*!Destructor. Do nothing.*/
+/*!
+  \brief Destructor.
+  \internal
+*/
 LightApp_DataObject::Key::~Key()
 {
 }
 
-/*!Checks: Is current key less than \a other.*/
+/*!
+  \brief Compares this key with the another one.
+  \internal
+  \param other another data object key
+  \return \c true if this key is less than \a other.
+*/
 bool LightApp_DataObject::Key::isLess( const SUIT_DataObjectKey* other ) const
 {
   Key* that = (Key*)other;
   return myEntry < that->myEntry;
 }
 
-/*!Checks: Is current key equal with \a other.*/
+/*!
+  \brief Compares this key with the another one.
+  \internal
+  \param other another data object key
+  \return \c true if this key is equal to the \a other.
+*/
 bool LightApp_DataObject::Key::isEqual( const SUIT_DataObjectKey* other ) const
 {
   Key* that = (Key*)other;
   return myEntry == that->myEntry;
 }
 
-/*!Constructor. Initialize by \a parent*/
+/*!
+  \class LightApp_DataObject
+  \brief Base data object class to build the data model for all the SALOME modules.
+*/
+
+/*!
+  \brief Constructor. 
+  \param parent parent data object
+*/
 LightApp_DataObject::LightApp_DataObject( SUIT_DataObject* parent )
-: CAM_DataObject( parent ), myCompObject( 0 ), myCompDataType( "" )
+: CAM_DataObject( parent ), 
+  myCompObject( 0 ), 
+  myCompDataType( "" )
 {
 }
 
-/*!Destructor. Do nothing.*/
+/*!
+  \brief Destructor.
+*/
 LightApp_DataObject::~LightApp_DataObject()
 {
 }
 
-/*!Gets object ID.
- *\retval QString
- */
+int LightApp_DataObject::groupId() const
+{
+  LightApp_DataModel* m = dynamic_cast<LightApp_DataModel*>( dataModel() );
+  return m ? m->groupId() : CAM_DataObject::groupId();
+}
+
+/*!
+  \brief Get object string identifier.
+
+  This method should be reimplemented in the subclasses.
+  Default implementation returns null string.
+
+  \return object ID
+*/
 QString LightApp_DataObject::entry() const
 {
-  return QString::null;
+  return QString();
 }
 
-/*!Create and return new key object.*/
+/*!
+  \brief Get the data object unique key.
+  \return data object key
+*/
 SUIT_DataObjectKey* LightApp_DataObject::key() const
 {
   QString str = entry();
   return new Key( str );
 }
 
-/*!Gets component object.
- *\retval SUIT_DataObject.
- */
+/*!
+  \brief Get object text data for the specified column.
+
+  Column with \a id = 0 (NameId) is supposed to be used
+  to get the object name.
+  Column with \a id = 1 (EntryId) is supposed to be used
+  to get the object entry.
+
+  \param id column id
+  \return object text data
+*/
+QString LightApp_DataObject::text( const int id ) const
+{
+  return id == EntryId ? entry() : CAM_DataObject::text( id );
+}
+
+/*!
+  \brief Get the component object.
+  \return component data object
+*/
 SUIT_DataObject* LightApp_DataObject::componentObject() const
 {
   if ( !myCompObject ) {
-  SUIT_DataObject* compObj = 0; // for root object
-
-    if ( parent() && parent() == root() ) 
-      compObj = (SUIT_DataObject*)this; // for component-level objects
-    else 
-    {
-      compObj = parent(); // for lower level objects
-      while ( compObj && compObj->parent() != root() )
-        compObj = compObj->parent();
+    SUIT_DataObject* compObj = (SUIT_DataObject*)this;
+
+    while ( compObj && compObj->parent() && compObj->parent() != root() ) {
+      compObj = compObj->parent();
     }
     LightApp_DataObject* that = (LightApp_DataObject*)this;
     that->myCompObject = compObj;
@@ -121,11 +180,14 @@ SUIT_DataObject* LightApp_DataObject::componentObject() const
   return myCompObject;
 }
 
-/*!Get component type.*/
+/*!
+  \brief Get component type.
+  \return component type
+*/
 QString LightApp_DataObject::componentDataType() const
 {
   if ( myCompDataType.isEmpty() ) {
-  SUIT_DataObject* aCompObj = componentObject();
+    SUIT_DataObject* aCompObj = componentObject();
     LightApp_ModuleObject* anObj = dynamic_cast<LightApp_ModuleObject*>( aCompObj );
     if ( anObj ) {
       CAM_DataModel* aModel = anObj->dataModel();
@@ -138,45 +200,201 @@ QString LightApp_DataObject::componentDataType() const
   return myCompDataType;
 }
 
+/*!
+  \brief Check if the specified column supports custom sorting.
+  \param id column id
+  \return \c true if column sorting should be customized
+  \sa compare()
+*/
+bool LightApp_DataObject::customSorting( const int id ) const
+{
+  // perform custom sorting for the "Entry" column
+  return id == EntryId ? true : CAM_DataObject::customSorting( id );
+}
 
+/*!
+  \brief Compares data from two items for sorting purposes.
+
+  This method is called only for those columns for which customSorting()
+  method returns \c true.
+
+  \param left first data to compare
+  \param right second data to compare
+  \param id column id
+  \return result of the comparison
+  \sa customSorting()
+*/
+bool LightApp_DataObject::compare( const QVariant& left, const QVariant& right, const int id ) const
+{
+  if ( id == EntryId )
+  {
+    // perform custom sorting for the "Entry" column
+    QString leftStr  = left.toString();
+    QString rightStr = right.toString();
+    QStringList idsLeft  = leftStr.split( ":", QString::SkipEmptyParts );
+    QStringList idsRight = rightStr.split( ":", QString::SkipEmptyParts );
+    if ( idsLeft.count() > 1 || idsRight.count() > 1 ) {
+      bool result = true;
+      bool calculated = false;
+      for ( int i = 0; i < idsLeft.count() || i < idsRight.count(); i++ ) {
+       bool okLeft = true, okRight = true;
+       int lid = 0, rid = 0;
+       if ( i < idsLeft.count() )
+         lid = idsLeft[i].toInt( &okLeft );
+       if ( i < idsRight.count() )
+         rid = idsRight[i].toInt( &okRight );
+       if ( okLeft && okRight ) {
+         // both seem to be correct integer ID
+         return lid < rid;
+       }
+       else if ( okLeft || okRight ) {
+         // objects with correct (int) ID have higher priority
+         return okLeft;
+       }
+       else {
+         // both not integer ID
+         int r = QString::localeAwareCompare( idsLeft[i], idsRight[i] ); 
+         if ( !calculated && r != 0 ) {
+           result = r < 0;
+           calculated = true;
+         }
+       }
+      }
+      // we should reach this if the entries are exactly equal
+      return result; 
+    }
+    return QString::localeAwareCompare( leftStr, rightStr ) < 0;
+  }
+  return CAM_DataObject::compare( left, right, id );
+}
+
+/*!
+  \class LightApp_ModuleObject
+  \brief Used for optimized access to the data model from the data objects.
+  \sa CAM_ModuleObject class
+*/
 
-/*!Constructor.Initialize by \a parent.*/
+/*!
+  \brief Constructor.
+  \param parent parent data object
+*/
 LightApp_ModuleObject::LightApp_ModuleObject( SUIT_DataObject* parent )
-: CAM_RootObject( parent ),
-  CAM_DataObject( parent )
+: CAM_DataObject( parent ),
+  LightApp_DataObject( parent ),
+  CAM_ModuleObject( parent )
 {
 }
 
-/*!Constructor.Initialize by \a module and parent.*/
+/*!
+  \brief Constructor.
+  \param dm data model
+  \param parent parent data object
+*/
 LightApp_ModuleObject::LightApp_ModuleObject( CAM_DataModel* dm, SUIT_DataObject* parent )
-: CAM_RootObject( dm, parent ),
-  CAM_DataObject( parent )
+: CAM_DataObject( parent ),
+  LightApp_DataObject( parent ),
+  CAM_ModuleObject( dm, parent )
 {
 }
 
-/*!Destructor. Do nothing.*/
+/*
+  \brief Destructor.
+*/
 LightApp_ModuleObject::~LightApp_ModuleObject()
 {
 }
 
-/*!Returns module name */
+/*!
+  \brief Get module name.
+  \return module name
+*/
 QString LightApp_ModuleObject::name() const
 {
-  return CAM_RootObject::name();
+  return CAM_ModuleObject::name();
+}
+
+/*!
+  \brief Get data object icon for the specified column.
+  \param id column id
+  \return object icon for the specified column
+*/
+QPixmap LightApp_ModuleObject::icon( const int id ) const
+{
+  return CAM_ModuleObject::icon( id );
+}
+
+/*!
+  \brief Get data object tooltip for the specified column.
+  \param id column id
+  \return object tooltip for the specified column
+*/
+QString LightApp_ModuleObject::toolTip( const int id ) const
+{
+  return CAM_ModuleObject::toolTip( id );
 }
 
-/*!Insert new child object to the children list at specified position
- *\add component in Study for this module object if it necessary*/
-void LightApp_ModuleObject::insertChild( SUIT_DataObject* theObj, int thePosition )
+/*!
+  \brief Insert new child object to the children list at specified position.
+  
+  Adds component in the study for this module object if it is not done yet.
+  
+  \param obj object to be inserted
+  \param pos position at which data object should be inserted
+*/
+void LightApp_ModuleObject::insertChild( SUIT_DataObject* obj, int pos )
 {
-  CAM_RootObject::insertChild(theObj, thePosition);
+  LightApp_DataObject::insertChild( obj, pos );
 
   CAM_DataModel* aModel = dataModel();
 
-  LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>(parent());
+  LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( parent() );
+
+  if ( aRoot )
+    aRoot->study()->addComponent( aModel );
+}
 
-  if (aRoot)
-    aRoot->study()->addComponent(aModel);
+/*!
+  \class LightApp_RootObject
+  \brief Root data object for the light (without CORBA) SALOME application.
 
+  This class is to be instanciated by only one object - the root object
+  of the LightApp data object tree. This object is not shown in the object browser.
+  The goal of this class is to provide a unified access to LightApp_Study
+  object from LightApp_DataObject instances.
+*/
 
+/*
+  \brief Constructor.
+  \param study study
+*/
+LightApp_RootObject::LightApp_RootObject( LightApp_Study* study )
+: CAM_DataObject( 0 ),
+  LightApp_DataObject( 0 ), 
+  myStudy( study ) 
+{
+}
+
+/*
+  \brief Destructor.
+*/
+LightApp_RootObject::~LightApp_RootObject()
+{
 }
+
+/*
+  \brief Set study.
+  \param study pointer to the study
+*/
+void LightApp_RootObject::setStudy( LightApp_Study* study )
+{ 
+  myStudy = study; 
+}
+
+/*
+  \brief Get study
+  \return pointer to the study
+*/
+LightApp_Study* LightApp_RootObject::study() const
+{ 
+  return myStudy;  
+} 
index 4d3613dad736369fd8bb02f1e7de238598fdd6b6..94b4b838bbe7e9a77be92b974c87fa82773203f9 100644 (file)
@@ -1,40 +1,45 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : LightApp_DataObject.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #ifndef LIGHTAPP_DATAOBJECT_H
 #define LIGHTAPP_DATAOBJECT_H
 
 #include "LightApp.h"
+#include <CAM_DataObject.h>
 
-#include "CAM_DataObject.h"
-#include "CAM_DataModel.h"
-#include "CAM_RootObject.h"
-
+class CAM_DataModel;
 class LightApp_Study;
 
-/*!Description : Data Object has empty entry so it's children must redefine metod entry() and return some unique string*/
-// to do : decomment virtual inheritance 
 class LIGHTAPP_EXPORT LightApp_DataObject : public virtual CAM_DataObject
 {
   class Key;
 
 public:
-  enum { CT_Value, CT_Entry, CT_IOR, CT_RefEntry };
+  //! Column id
+  enum { 
+    EntryId = NameId + 1    //!< entry column
+  };
 
 public:
   LightApp_DataObject( SUIT_DataObject* = 0 );
@@ -43,30 +48,48 @@ public:
   virtual SUIT_DataObjectKey*     key() const;
   virtual QString                 entry() const;
 
+  virtual QString                 text( const int = NameId ) const;
+
   virtual SUIT_DataObject*        componentObject() const;
   virtual QString                 componentDataType() const;
 
+  virtual bool                    customSorting( const int = NameId ) const;
+  virtual bool                    compare( const QVariant&, const QVariant&, const int = NameId ) const;
+  virtual int                     groupId() const;
+
 protected:
   QString                         myCompDataType;
   SUIT_DataObject*                myCompObject;
 };
 
-/*!
- * LightApp_ModuleObject - class for optimized access to DataModel from
- * CAM_RootObject.h.
- * In modules which will be redefine LightApp_DataObject, LightApp_ModuleObject must be children from rederined DataObject for having necessary properties and children from LightApp_ModuleObject.
- */
-
-class LIGHTAPP_EXPORT LightApp_ModuleObject : public CAM_RootObject
+class LIGHTAPP_EXPORT LightApp_ModuleObject
+: public virtual LightApp_DataObject, public CAM_ModuleObject
 {
 public:
   LightApp_ModuleObject( SUIT_DataObject* = 0 );
-  LightApp_ModuleObject ( CAM_DataModel*, SUIT_DataObject* = 0 );
+  LightApp_ModuleObject( CAM_DataModel*, SUIT_DataObject* = 0 );
 
   virtual ~LightApp_ModuleObject();
 
   virtual QString        name() const;
-  virtual void           insertChild( SUIT_DataObject*, int thePosition );
+  QPixmap                icon( const int = NameId ) const;
+  QString                toolTip( const int = NameId ) const;
+
+  virtual void           insertChild( SUIT_DataObject*, int );
+};
+
+class LIGHTAPP_EXPORT LightApp_RootObject : public virtual LightApp_DataObject
+{
+public:
+  LightApp_RootObject( LightApp_Study* );
+
+  virtual ~LightApp_RootObject();
+    
+  void                   setStudy( LightApp_Study* );
+  LightApp_Study*        study() const;
+  
+private:
+  LightApp_Study*        myStudy;
 };
 
-#endif
+#endif  // LIGHTAPP_DATAOBJECT_H
index dd3c22f1622e6dc55248c3f1a9fa77c1485bfecf..be594b0557473553fb348e3c8337726fdefee8c9 100644 (file)
@@ -1,28 +1,26 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "LightApp_DataOwner.h"
 
-#include "LightApp_DataObject.h"
-
-#include <iostream>
-
 /*!Constructor. Initialize by \a theEntry.*/
 LightApp_DataOwner::LightApp_DataOwner( const QString& theEntry )
 : myEntry( theEntry )
index e2df564ef25fb110c50a5c699970d88b440a2e98..c04f1823017cc333f599415a8847ce2dca2618f0 100644 (file)
@@ -1,22 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef LIGHTAPP_DATAOWNER_H
 #define LIGHTAPP_DATAOWNER_H
 
index c64c739ebf48dfa1c2f85484627db7f2047113cd..8f8a71bf74c7e58c604454f948d9684b2b4fddfa 100644 (file)
@@ -1,25 +1,26 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "LightApp_DataSubOwner.h"
 
-#include "LightApp_DataObject.h"
-
 /*!Constructor.Initialize by \a entry and \a index*/
 LightApp_DataSubOwner::LightApp_DataSubOwner( const QString& entry, const int index )
 : LightApp_DataOwner( entry ),
index 7e8e7f3ea6b87bc78073fe363f33c8ef49bb9c85..6753d8c0f608dd58b6b414c3c9fac9543c5e7cc0 100644 (file)
@@ -1,27 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef LIGHTAPP_DATASUBOWNER_H
 #define LIGHTAPP_DATASUBOWNER_H
 
-#include <LightApp.h>
-#include <LightApp_DataOwner.h>
+#include "LightApp.h"
+#include "LightApp_DataOwner.h"
 
 /*!
   Class provide sub owner.
index 27219f5f1d8f7a7c7159c3e1d183e47640428986..3aed9fe5d6cdeee4a6987e23fc3ff7343cd2d18c 100644 (file)
@@ -1,40 +1,46 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_Dialog.cxx
 // Author:    Alexander SOLOVYOV
-
-#include <LightApp_Dialog.h>
+//
+#include "LightApp_Dialog.h"
 #include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
 
-#include <qtoolbutton.h>
-#include <qlineedit.h>
-#include <qlabel.h>
+#include <QAbstractButton>
+#include <QToolButton>
+#include <QLineEdit>
+#include <QLabel>
 
 /*!
   Constructor
 */
 LightApp_Dialog::LightApp_Dialog( QWidget* parent, const char* name, bool modal,
-                                  bool allowResize, const int f, WFlags wf )
-: QtxDialog( parent, name, modal, allowResize, f, wf ),
+                                  bool allowResize, const int f, Qt::WindowFlags wf )
+: QtxDialog( parent, modal, allowResize, f, wf ),
   myIsExclusive( true ),
   myIsBusy( false )
 {
+  setObjectName( name );
   setObjectPixmap( "LightApp", tr( "ICON_SELECT" ) );
 }
 
@@ -76,14 +82,14 @@ void LightApp_Dialog::updateButtons( const int _id )
                             aLast = myObjects.end();
   for( ; anIt!=aLast; anIt++ )
   {
-    QToolButton* but = (QToolButton*)anIt.data().myBtn;
-    if( but && but->isOn() )
+    QToolButton* but = (QToolButton*)anIt.value().myBtn;
+    if( but && but->isChecked() )
     {
       if( id==-1 )
         id = anIt.key();
 
       if( anIt.key()!=id )
-        but->setOn( false );
+        but->setChecked( false );
     }
   }
 }
@@ -130,7 +136,7 @@ void LightApp_Dialog::setObjectShown( const int id, const bool shown )
     obj.myBtn->setShown( shown );
     obj.myLabel->setShown( shown );
     if( !shown )
-      ( ( QToolButton* )obj.myBtn )->setOn( false );
+      ( ( QToolButton* )obj.myBtn )->setChecked( false );
   }
 }
 
@@ -140,7 +146,9 @@ void LightApp_Dialog::setObjectShown( const int id, const bool shown )
 */
 bool LightApp_Dialog::isObjectShown( const int id ) const
 {
-  return myObjects.contains( id ) && myObjects[ id ].myEdit->isShown();
+  return myObjects.contains( id ) &&
+         ( myObjects[ id ].myEdit->isVisible() ||
+          myObjects[ id ].myEdit->isVisibleTo( myObjects[ id ].myEdit->parentWidget() ) );
 }
 
 /*!
@@ -157,7 +165,7 @@ void LightApp_Dialog::setObjectEnabled( const int id, const bool en )
     obj.myBtn->setEnabled( en );
 //    obj.myLabel->setEnabled( en );
     if( !en )
-      ( ( QToolButton* )obj.myBtn )->setOn( false );
+      ( ( QToolButton* )obj.myBtn )->setChecked( false );
   } 
 }
 
@@ -200,7 +208,7 @@ void LightApp_Dialog::selectObject( const QStringList& _names,
   ObjectMap::iterator anIt = myObjects.begin(),
                       aLast = myObjects.end();
   for( ; anIt!=aLast; anIt++ )
-    if( anIt.data().myBtn->isOn() )
+    if( anIt.value().myBtn->isChecked() )
       selectObject( anIt.key(), _names, _types, _ids, update );
 }
 
@@ -233,7 +241,7 @@ void LightApp_Dialog::clearSelection( const int id )
     myObjects[ id ].myTypes.clear();
     myObjects[ id ].myNames.clear();
     
-    myObjects[ id ].myEdit->setText( QString::null );
+    myObjects[ id ].myEdit->setText( QString() );
     emit selectionChanged( id );
   }
 }
@@ -338,8 +346,8 @@ int LightApp_Dialog::createObject( const QString& label, QWidget* parent, const
     myObjects[ nid ].myLabel = lab;
     
     QToolButton* but = new QToolButton( parent );
-    but->setIconSet( QIconSet( myPixmap ) );
-    but->setToggleButton( true );
+    but->setIcon( QIcon( myPixmap ) );
+    but->setCheckable( true );
     but->setMaximumWidth( but->height() );
     but->setMinimumWidth( but->height() );    
     connect( but, SIGNAL( toggled( bool ) ), this, SLOT( onToggled( bool ) ) );
@@ -542,7 +550,7 @@ void LightApp_Dialog::objectTypes( const int id, TypesList& list ) const
 */
 void LightApp_Dialog::onToggled( bool on )
 {
-  QButton* but = ( QButton* )sender();
+  QAbstractButton* but = ( QAbstractButton* )sender();
   int id = -1;
 
   if( !but )
@@ -551,7 +559,7 @@ void LightApp_Dialog::onToggled( bool on )
   ObjectMap::const_iterator anIt = myObjects.begin(),
                             aLast = myObjects.end();
   for( ; anIt!=aLast && id==-1; anIt++ )
-    if( anIt.data().myBtn==but )
+    if( anIt.value().myBtn==but )
       id = anIt.key();
 
   if( id!=-1 )
@@ -637,7 +645,7 @@ void LightApp_Dialog::setObjectPixmap( const QPixmap& p )
   ObjectMap::const_iterator anIt = myObjects.begin(),
                             aLast = myObjects.end();
   for( ; anIt!=aLast; anIt++ )
-    ( ( QToolButton* )anIt.data().myBtn )->setIconSet( p );
+    ( ( QToolButton* )anIt.value().myBtn )->setIcon( p );
 }                        
 
 /*!
@@ -687,7 +695,7 @@ void LightApp_Dialog::setNameIndication( const int id, const NameIndication ni )
                         aLast = myObjects.end();
     for( ; anIt!=aLast; anIt++ )
     {
-      anIt.data().myNI = ni;
+      anIt.value().myNI = ni;
       setReadOnly( anIt.key(), isReadOnly( anIt.key() ) );
       aNext = anIt; aNext++;
       updateObject( anIt.key(), aNext==aLast );
@@ -713,7 +721,7 @@ QString LightApp_Dialog::selectionDescription( const QStringList& names, const T
     return "LightApp_Dialog::selectionDescription(): Error!!!";
     
   if( names.isEmpty() )
-    return QString::null;
+    return QString();
     
   switch( ni )
   {
@@ -736,7 +744,7 @@ QString LightApp_Dialog::selectionDescription( const QStringList& names, const T
       return countOfTypes( types );
       break;
   };
-  return QString::null;
+  return QString();
 }
 
 /*!
@@ -759,7 +767,7 @@ QString LightApp_Dialog::countOfTypes( const TypesList& types ) const
   QMap<int,int>::const_iterator aMIt = typesCount.begin(),
                                 aMLast = typesCount.end();
   for( ; aMIt!=aMLast; aMIt++ )
-    typeCount.append( QString( "%1 %2" ).arg( aMIt.data() ).arg( typeName( aMIt.key() ) ) );
+    typeCount.append( QString( "%1 %2" ).arg( aMIt.value() ).arg( typeName( aMIt.key() ) ) );
 
   return typeCount.join( ", " );
 }
@@ -777,7 +785,7 @@ QString& LightApp_Dialog::typeName( const int type )
   \return const reference to type name
   \param type - integer id of type
 */
-const QString& LightApp_Dialog::typeName( const int type ) const
+const QString LightApp_Dialog::typeName( const int type ) const
 {
   return myTypeNames[ type ];
 }
@@ -789,7 +797,7 @@ const QString& LightApp_Dialog::typeName( const int type ) const
 */
 void LightApp_Dialog::activateObject( const int theId )
 {
-  if ( myObjects.contains( theId ) && !myObjects[ theId ].myBtn->isOn() )
+  if ( myObjects.contains( theId ) && !myObjects[ theId ].myBtn->isChecked() )
     myObjects[ theId ].myBtn->toggle();
 }
 
@@ -802,8 +810,8 @@ void LightApp_Dialog::deactivateAll()
                       aLast = myObjects.end();
   for( ; anIt!=aLast; anIt++ )
   {
-    QToolButton* btn = ( QToolButton* )anIt.data().myBtn;
-    btn->setOn( false );
+    QToolButton* btn = ( QToolButton* )anIt.value().myBtn;
+    btn->setChecked( false );
   }
 }
 
@@ -892,12 +900,12 @@ void LightApp_Dialog::onTextChanged( const QString& text )
     ObjectMap::const_iterator anIt = myObjects.begin(),
                               aLast = myObjects.end();
     for( ; anIt!=aLast; anIt++ )
-      if( anIt.data().myEdit == edit )
+      if( anIt.value().myEdit == edit )
         id = anIt.key();
 
     if( id>=0 && !isReadOnly( id ) )
     {
-      QStringList list = QStringList::split( " ", text );
+      QStringList list = text.split( " ", QString::SkipEmptyParts );
       emit objectChanged( id, list );
     }
   }
index 6e3b3b8a027f200e108857851c6116fb3d60b18d..e7bd0db0d08fb90db21c9ec7d7f86f3d57f11b93 100644 (file)
@@ -1,36 +1,39 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_Dialog.h
 // Author:    Alexander SOLOVYOV
-
+//
 #ifndef LIGHTAPP_DIALOG_H
 #define LIGHTAPP_DIALOG_H
 
 #include "LightApp.h"
 #include <QtxDialog.h>
 
-#include <qvaluelist.h>
-#include <qmap.h>
-#include <qpixmap.h>
+#include <QList>
+#include <QMap>
+#include <QPixmap>
 
 class QLineEdit;
-class QButton;
+class QAbstractButton;
 class QLabel;
 
 class SUIT_ResourceMgr;
@@ -52,7 +55,7 @@ class LIGHTAPP_EXPORT LightApp_Dialog : public QtxDialog
   Q_OBJECT
   
 public:
-  typedef QValueList<int>        TypesList;
+  typedef QList<int>             TypesList;
   typedef QMap<int,QStringList>  SelectedObjects;
 
   enum ObjectWg
@@ -76,7 +79,7 @@ public:
 
 public:
   LightApp_Dialog( QWidget* = 0, const char* = 0, bool = false,
-                    bool = false, const int = Standard, WFlags = 0 );
+                    bool = false, const int = Standard, Qt::WindowFlags = 0 );
   virtual ~LightApp_Dialog();
   
   virtual void    show();
@@ -224,7 +227,7 @@ protected:
   
   //!Change and get type name for indicating in selection widget
   QString& typeName( const int );
-  const QString& typeName( const int ) const;
+  const QString typeName( const int ) const;
   
   //! Create string contains selection list by list of names, list of types and current name indication state
   virtual QString selectionDescription( const QStringList&, const TypesList&, const NameIndication ) const;
@@ -272,12 +275,12 @@ private:
 private:
   typedef struct
   {
-    QLineEdit*      myEdit;
-    QButton*        myBtn;
-    QLabel*         myLabel;
-    QStringList     myNames, myIds;
-    TypesList       myTypes, myPossibleTypes;
-    NameIndication  myNI;
+    QLineEdit*       myEdit;
+    QAbstractButton* myBtn;
+    QLabel*          myLabel;
+    QStringList      myNames, myIds;
+    TypesList        myTypes, myPossibleTypes;
+    NameIndication   myNI;
     
   } Object;
   
index 0845d5cc9c3c9743255aada72a3ad1f5b30c12e5..c050811d1ebf4b85e96cf79d881bb30f6fe81f08 100644 (file)
@@ -1,22 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "LightApp_Displayer.h"
 #include "LightApp_Application.h"
 #include "LightApp_Module.h"
@@ -29,7 +31,7 @@
 #include <SUIT_ViewModel.h>
 #include <SUIT_ViewWindow.h>
 
-#include <qstring.h>
+#include <QString>
 #ifndef DISABLE_SALOMEOBJECT
   #include "SALOME_InteractiveObject.hxx"
 #endif
@@ -56,12 +58,11 @@ LightApp_Displayer::~LightApp_Displayer()
 */
 void LightApp_Displayer::Display( const QString& entry, const bool updateViewer, SALOME_View* theViewFrame )
 {
-  SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
-  if ( vf )
+  SALOME_Prs* prs = buildPresentation( entry, theViewFrame );
+  if ( prs )
   {
-    SALOME_Prs* prs = buildPresentation( entry, vf );
-
-    if ( prs )
+    SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
+    if ( vf )
     {
       vf->BeforeDisplay( this );
       vf->Display( prs );
@@ -88,11 +89,10 @@ void LightApp_Displayer::Redisplay( const QString& entry, const bool updateViewe
   if ( app )
   {
     SUIT_Desktop* desk = app->desktop();
-    QPtrList<SUIT_ViewWindow> wnds = desk->windows();
-    SUIT_ViewWindow* wnd;
-    for ( wnd = wnds.first(); wnd; wnd = wnds.next() )
+    QListIterator<SUIT_ViewWindow*> itWnds( desk->windows() );
+    while ( itWnds.hasNext() )
     {
-      SUIT_ViewManager* vman = wnd->getViewManager();
+      SUIT_ViewManager* vman = itWnds.next()->getViewManager();
       if( !vman )
         continue;
 
@@ -123,7 +123,7 @@ void LightApp_Displayer::Erase( const QString& entry, const bool forced,
   SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
 
   if ( vf ) {
-    SALOME_Prs* prs = vf->CreatePrs( entry.latin1() );
+    SALOME_Prs* prs = vf->CreatePrs( entry.toLatin1() );
     if ( prs ) {
       vf->Erase( prs, forced );
       if ( updateViewer )
@@ -163,7 +163,7 @@ bool LightApp_Displayer::IsDisplayed( const QString& entry, SALOME_View* theView
   {
 #ifndef DISABLE_SALOMEOBJECT
     Handle( SALOME_InteractiveObject ) temp = new SALOME_InteractiveObject();
-    temp->setEntry( entry.latin1() );
+    temp->setEntry( entry.toLatin1() );
     res = vf->isVisible( temp );
 #endif
   }
@@ -193,7 +193,7 @@ SALOME_Prs* LightApp_Displayer::buildPresentation( const QString& entry, SALOME_
   SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
 
   if ( vf )
-    prs = vf->CreatePrs( entry.latin1() );
+    prs = vf->CreatePrs( entry.toLatin1() );
 
   return prs;
 }
@@ -238,7 +238,7 @@ bool LightApp_Displayer::canBeDisplayed( const QString& entry ) const
       if( SUIT_ViewManager* vman = sApp->activeViewManager() )
        if( SUIT_ViewModel* vmod = vman->getViewModel() )
          viewerType = vmod->getType();
-  return !viewerType.isNull() && canBeDisplayed( entry, viewerType );
+  return canBeDisplayed( entry, viewerType );
 }
 
 /*!
@@ -257,7 +257,7 @@ LightApp_Displayer* LightApp_Displayer::FindDisplayer( const QString& mod_name,
   LightApp_Module* m = dynamic_cast<LightApp_Module*>( app ? app->module( mod_name ) : 0 );
   if( !m && load )
   {
-    m = dynamic_cast<LightApp_Module*>( app->loadModule( mod_name ) );
+    m = dynamic_cast<LightApp_Module*>( app->loadModule( mod_name, false ) );
     if( m )
       app->addModule( m );
   }
index 5b4318965931b21d727f29949daa60a5ec25b43b..4e3544f2a6fceb1bb042946d02115ec170c2659b 100644 (file)
@@ -1,22 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef LIGHTAPP_DISPLAYER_HEADER
 #define LIGHTAPP_DISPLAYER_HEADER
 
index e8e161dc589871db13c8262c2d99786a890989f0..e856607781ed9e41fdb6c171af2700379650cb6d 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "LightApp_Driver.h"
 
 #include <OSD_Path.hxx>
 #include <OSD_File.hxx>
 #include <OSD_Directory.hxx>
-#include <OSD_Process.hxx>
-#include <OSD_Directory.hxx>
 #include <OSD_Protection.hxx>
-#include <OSD_SingleProtection.hxx>
 #include <OSD_FileIterator.hxx>
 
-#include <qfileinfo.h>
-#include <qdir.h>
+#include <QFileInfo>
+#include <QDir>
 
 #ifdef WIN32
 #include <time.h>
@@ -84,7 +84,7 @@ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile
   if(aFileBuffer == NULL)
     return false;
 
-  myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).dirPath( true ) + "/" ).latin1() ;
+  myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
 
   int aCurrentPos = 0;
 
@@ -116,7 +116,7 @@ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile
     aCurrentPos += aBufferSize[i];
   }
 
-#ifdef WNT  
+#ifdef WIN32
   ofstream aFile(theFileName, ios::out | ios::binary);
 #else
   ofstream aFile(theFileName);
@@ -137,13 +137,13 @@ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile
 */
 bool LightApp_Driver::ReadDatasFromFile( const char* theFileName, bool isMultiFile )
 {
-#ifdef WNT
+#ifdef WIN32
   ifstream aFile(theFileName, ios::binary);
 #else
   ifstream aFile(theFileName);
 #endif  
 
-  myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).dirPath( true ) + "/" ).latin1() ;
+  myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
 
   aFile.seekg(0, ios::end);
   int aFileBufferSize = aFile.tellg();
@@ -261,7 +261,7 @@ void LightApp_Driver::PutFilesToStream( const std::string& theModuleName, unsign
       OSD_Path anOSDPath(aFullPath);
       OSD_File anOSDFile(anOSDPath);
       if(!anOSDFile.Exists()) continue;
-#ifdef WNT
+#ifdef WIN32
       ifstream aFile(aFullPath.ToCString(), ios::binary);
 #else
       ifstream aFile(aFullPath.ToCString());
@@ -299,7 +299,7 @@ void LightApp_Driver::PutFilesToStream( const std::string& theModuleName, unsign
       OSD_Path anOSDPath(aFullPath);
       OSD_File anOSDFile(anOSDPath);
       if(!anOSDFile.Exists()) continue;
-#ifdef WNT
+#ifdef WIN32
       aFile = new ifstream(aFullPath.ToCString(), ios::binary);
 #else
       aFile = new ifstream(aFullPath.ToCString());
@@ -382,7 +382,7 @@ LightApp_Driver::ListOfFiles LightApp_Driver::PutStreamToFiles( const unsigned c
       
       TCollection_AsciiString aFullPath = aTmpDir + aFileName;
       
-#ifdef WNT  
+#ifdef WIN32
   ofstream aFile(aFullPath.ToCString(), ios::out | ios::binary);
 #else
   ofstream aFile(aFullPath.ToCString());
index e130b86dae6ed683ba999d9922981e570fe1e693..5148426c5cc4d55dd65ed24f570def3711832672 100644 (file)
@@ -1,25 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef LIGHTAPP_DRIVER_H
 #define LIGHTAPP_DRIVER_H
 
-#include <LightApp.h>
+#include "LightApp.h"
 
 #include "string"
 #include "vector"
index 77ab42c9f37bbacdb876c001643d8e0915616fd0..b452b018b09c4d5fe69b3038372b40c6a97a6bd5 100644 (file)
@@ -1,27 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "LightApp_EventFilter.h"
 
 #include <SUIT_Desktop.h>
 
-#include <qapplication.h>
+#include <QApplication>
 
 LightApp_EventFilter* LightApp_EventFilter::myFilter = NULL;
 
index 836db4476817845ef1fd319cb2bf3c18b85c8f1d..3b98fbc58fb64acefe5ba04a59656006b1d24dea 100644 (file)
@@ -1,30 +1,32 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef LIGHTAPP_EVENTFILTER_H
 #define LIGHTAPP_EVENTFILTER_H
 
 #include "LightApp.h"
 
-#include <qobject.h>
+#include <QObject>
 
-#if defined WNT
+#if defined WIN32
 #pragma warning( disable: 4251 )
 #endif
 
@@ -49,7 +51,7 @@ private:
   static LightApp_EventFilter* myFilter;
 };
 
-#if defined WNT
+#if defined WIN32
 #pragma warning( default: 4251 )
 #endif
 
index d7c14c59b186ac0d81ea0770a187c43e59932d9c..15a2dab9042cad5b9f307c0d381da6f8bf980347 100644 (file)
@@ -1,27 +1,30 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "LightApp_GLSelector.h"
 
 #include "LightApp_DataOwner.h"
-#include "LightApp_DataObject.h"
 
 #include <GLViewer_Context.h>
+#include <GLViewer_Object.h>
 
 /*!Constructor. Initialize by GLViewer_Viewer2d and SUIT_SelectionMgr.*/
 LightApp_GLSelector::LightApp_GLSelector( GLViewer_Viewer2d* viewer, SUIT_SelectionMgr* mgr )
index b6360160497bc134a4a0d9b0d68b7ee3567e4f66..45260e314de6fc4b8cb886f77c23e9c0d95b0e48 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef LIGHTAPP_GLSELECTOR_H
 #define LIGHTAPP_GLSELECTOR_H
@@ -25,8 +28,7 @@
 
 #include <GLViewer_Viewer2d.h>
 
-#include <string>
-#include <GLViewer_Object.h>
+#include <QObject>
 
 class LightApp_DataObject;
 
@@ -34,7 +36,7 @@ class LightApp_DataObject;
   \class LightApp_GLSelector
   Custom selector to get/set selection from GL viewer
 */
-class LIGHTAPP_EXPORT LightApp_GLSelector : public SUIT_Selector
+class LIGHTAPP_EXPORT LightApp_GLSelector : public QObject, public SUIT_Selector
 {
   Q_OBJECT
 
index 292cdd88b99c7c44890045c5b8b56a67b57b628b..168f18013bbd19a20549aa1a6fe0b0117309f5a9 100644 (file)
@@ -1,24 +1,26 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "LightApp_HDFDriver.h"
 
-#include "HDFexplorer.hxx"
 #include "HDFOI.hxx"
 
 // OCCT Includes
index 6f3b2c339b20e0e40c51f1970642ceaadc33cc6b..2a7fd3c9c423fbe914745251bc087a01c5875d90 100644 (file)
@@ -1,26 +1,29 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef LIGHTAPP_HDFDRIVER_H
 #define LIGHTAPP_HDFDRIVER_H
 
-#include <LightApp.h>
-#include <LightApp_Driver.h>
+#include "LightApp.h"
+#include "LightApp_Driver.h"
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
index 437a4724f01a60f6cbefb3d03726fa245c806603..8bd88c4ea3f0a00d9836ec0a9ca3d85610d6ffd7 100644 (file)
@@ -1,26 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_Module.cxx
 // Created:   6/20/2005 16:30:56 AM
 // Author:    OCC team
-// Copyright (C) CEA 2005
-
+//
 #include "LightApp_Module.h"
 
 #include "CAM_Application.h"
 #include "LightApp_SwitchOp.h"
 #include "LightApp_UpdateFlags.h"
 #include "LightApp_ShowHideOp.h"
+#include "LightApp_SelectionMgr.h"
 
-#include "SUIT_Operation.h"
 #include <SUIT_Study.h>
 #include <SUIT_DataObject.h>
+#include <SUIT_DataBrowser.h>
+#include <SUIT_Operation.h>
+#include <SUIT_ViewManager.h>
 #include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_TreeModel.h>
+
+#ifndef DISABLE_SALOMEOBJECT
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
+#endif
 
 #ifndef DISABLE_VTKVIEWER
 #ifndef DISABLE_SALOMEOBJECT
 #endif
 #endif
 
-#include <OB_Browser.h>
-
 #include <QtxPopupMgr.h>
 
-#include <qvariant.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <QVariant>
+#include <QString>
+#include <QStringList>
+
 
 /*!Constructor.*/
 LightApp_Module::LightApp_Module( const QString& name )
@@ -121,12 +132,13 @@ void LightApp_Module::viewManagers( QStringList& ) const
 }
 
 /*!Context menu popup.*/
-void LightApp_Module::contextMenuPopup( const QString& client, QPopupMenu* menu, QString& /*title*/ )
+void LightApp_Module::contextMenuPopup( const QString& client, QMenu* menu, QString& /*title*/ )
 {
   LightApp_Selection* sel = createSelection();
   sel->init( client, getApp()->selectionMgr() );
-  popupMgr()->updatePopup( menu, sel );
-  delete sel;
+  popupMgr()->setSelection( sel );
+  popupMgr()->setMenu( menu );
+  popupMgr()->updateMenu();
 }
 
 /*!Update object browser.
@@ -135,7 +147,7 @@ void LightApp_Module::contextMenuPopup( const QString& client, QPopupMenu* menu,
 void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel, 
                                        SUIT_DataObject* theDataObject )
 {
-  bool upd = getApp()->objectBrowser()->isAutoUpdate();
+  bool upd = getApp()->objectBrowser()->autoUpdate();
   getApp()->objectBrowser()->setAutoUpdate( false );
 
   if( theIsUpdateDataModel ){
@@ -151,6 +163,7 @@ void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel,
       }
     }
   }
+
   getApp()->objectBrowser()->setAutoUpdate( upd );
   getApp()->objectBrowser()->updateTree( 0, false );
 }
@@ -160,11 +173,41 @@ void LightApp_Module::selectionChanged()
 {
 }
 
+/*! \brief If return false, selection will be cleared at module activation
+ */
+bool LightApp_Module::isSelectionCompatible()
+{
+  // return true if selected objects belong to this module
+  bool isCompatible = true;
+#ifndef DISABLE_SALOMEOBJECT
+  SALOME_ListIO selected;
+  if ( LightApp_SelectionMgr *Sel = getApp()->selectionMgr() )
+    Sel->selectedObjects( selected );
+
+  LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( getApp()->activeStudy() );
+  LightApp_DataObject* aRoot = dynamic_cast<LightApp_DataObject*>( dataModel()->root() );
+  if ( aStudy && aRoot ) {
+    // my data type
+    QString moduleDataType = aRoot->componentDataType();
+    // check data type of selection
+    SALOME_ListIteratorOfListIO It( selected );
+    for ( ; isCompatible && It.More(); It.Next()) {
+      Handle(SALOME_InteractiveObject)& io = It.Value();
+      isCompatible = ( aStudy->componentDataType( io->getEntry() ) == moduleDataType );
+    }
+  }
+#endif
+  return isCompatible;
+}
+
 /*!Activate module.*/
 bool LightApp_Module::activateModule( SUIT_Study* study )
 {
   bool res = CAM_Module::activateModule( study );
 
+  if ( !isSelectionCompatible() )// PAL19290, PAL18352
+    getApp()->selectionMgr()->clearSelected();
+
   if ( res && application() && application()->resourceMgr() )
     application()->resourceMgr()->raiseTranslators( name() );
 
@@ -176,6 +219,14 @@ bool LightApp_Module::activateModule( SUIT_Study* study )
   if ( mySwitchOp == 0 )
     mySwitchOp = new LightApp_SwitchOp( this );
 
+  QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
+  LightApp_DataModel* m = dynamic_cast<LightApp_DataModel*>( dataModel() );
+  if( m )
+  {
+    SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( getApp()->objectBrowser()->model() );
+    m->registerColumn( getApp()->objectBrowser(), EntryCol, LightApp_DataObject::EntryId );
+    treeModel->setAppropriate( EntryCol, Qtx::Toggled );
+  }
   return res;
 }
 
@@ -193,10 +244,19 @@ bool LightApp_Module::deactivateModule( SUIT_Study* study )
   // abort all operations
   MapOfOperation::const_iterator anIt;
   for( anIt = myOperations.begin(); anIt != myOperations.end(); anIt++ ) {
-    anIt.data()->abort();
+    anIt.value()->abort();
   }
 
-  return CAM_Module::activateModule( study );
+  QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
+  LightApp_DataModel* m = dynamic_cast<LightApp_DataModel*>( dataModel() );
+  if( m )
+  {
+    SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( getApp()->objectBrowser()->model() );
+
+    treeModel->setAppropriate( EntryCol, Qtx::Shown );
+    m->unregisterColumn( getApp()->objectBrowser(), EntryCol );
+  }
+  return CAM_Module::deactivateModule( study );
 }
 
 /*!NOT IMPLEMENTED*/
@@ -236,8 +296,10 @@ void LightApp_Module::update( const int theFlags )
       if( LightApp_DataModel* aModel = dynamic_cast<LightApp_DataModel*>( aDataModel ) )
         aModel->update( 0, dynamic_cast<LightApp_Study*>( getApp()->activeStudy() ) );
   }
+
   if ( theFlags & UF_ObjBrowser )
     getApp()->objectBrowser()->updateTree( 0 );
+
   if ( theFlags & UF_Controls )
     updateControls();
   if ( theFlags & UF_Viewer )
@@ -282,7 +344,7 @@ void LightApp_Module::updateControls()
 /*!Create new instance of data model and return it.*/
 CAM_DataModel* LightApp_Module::createDataModel()
 {
-  return new LightApp_DataModel(this);
+  return new LightApp_DataModel( this );
 }
 
 /*!Create and return instance of LightApp_Selection.*/
@@ -339,9 +401,9 @@ QtxPopupMgr* LightApp_Module::popupMgr()
     QString oneAndNotActive = "( count( $component ) = 1 ) and ( not( activeModule in $component ) )";
     QString uniform = "true in $canBeDisplayed and %1 and ( activeModule = '%2' )";
     uniform = uniform.arg( oneAndNotActive ).arg( name() );
-    myPopupMgr->setRule( disp, /*QString( "( not isVisible ) and " ) + */ uniform, true );
-    myPopupMgr->setRule( erase, /*QString( "( isVisible ) and " ) + */ uniform, true );
-    myPopupMgr->setRule( dispOnly, uniform, true );
+    myPopupMgr->setRule( disp, /*QString( "( not isVisible ) and " ) + */ uniform, QtxPopupMgr::VisibleRule );
+    myPopupMgr->setRule( erase, /*QString( "( isVisible ) and " ) + */ uniform, QtxPopupMgr::VisibleRule );
+    myPopupMgr->setRule( dispOnly, uniform, QtxPopupMgr::VisibleRule );
 
     QStringList viewers;
 
@@ -374,7 +436,7 @@ QtxPopupMgr* LightApp_Module::popupMgr()
       for( ; anIt!=aLast; anIt++ )
         strViewers+=temp.arg( *anIt );
       strViewers+="}";
-      myPopupMgr->setRule( eraseAll, QString( "client in %1" ).arg( strViewers ), true );
+      myPopupMgr->setRule( eraseAll, QString( "client in %1" ).arg( strViewers ), QtxPopupMgr::VisibleRule );
     }
   }
   return myPopupMgr;
@@ -420,7 +482,7 @@ QVariant LightApp_Module::preferenceProperty( const int id, const QString& prop
   QVariant var;
   LightApp_Preferences* pref = preferences();
   if ( pref )
-    var = pref->itemProperty( id, prop );
+    var = pref->itemProperty( prop, id );
   return var;
 }
 
@@ -429,7 +491,7 @@ void LightApp_Module::setPreferenceProperty( const int id, const QString& prop,
 {
   LightApp_Preferences* pref = preferences();
   if ( pref )
-    pref->setItemProperty( id, prop, var );
+    pref->setItemProperty( prop, var, id );
 }
 
 /*!
@@ -519,7 +581,7 @@ void LightApp_Module::onOperationDestroyed()
     MapOfOperation::const_iterator anIt = myOperations.begin(),
                                    aLast = myOperations.end();
     for( ; anIt!=aLast; anIt++ )
-      if( anIt.data()==op )
+      if( anIt.value()==op )
       {
         myOperations.remove( anIt.key() );
         break;
@@ -563,3 +625,14 @@ void LightApp_Module::onViewManagerAdded( SUIT_ViewManager* )
 void LightApp_Module::onViewManagerRemoved( SUIT_ViewManager* )
 {
 }
+
+/*!
+  \brief Returns instance of operation by its id; if there is no operation
+  corresponding to this id, null pointer is returned
+  \param id - operation id 
+  \return operation instance
+*/
+LightApp_Operation* LightApp_Module::operation( const int id ) const
+{
+  return myOperations.contains( id ) ? myOperations[id] : 0;
+}
index dbfed0b70f9c7b3e194e0128c95840b9d1425c6f..88ed1b44e119006c037ef546a8049677cc2415c9 100644 (file)
@@ -1,39 +1,41 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_Module.h
 // Created:   6/20/2005 16:25:06 AM
 // Author:    OCC team
-// Copyright (C) CEA 2005
-
+//
 #ifndef LIGHTAPP_MODULE_H
 #define LIGHTAPP_MODULE_H
 
 #include "LightApp.h"
+#include "LightApp_Preferences.h"
 #include <CAM_Module.h>
 
 class LightApp_Application;
-class LightApp_Preferences;
 class LightApp_Selection;
 class LightApp_Operation;
 class LightApp_SwitchOp;
-class LightApp_ShowHideOp;
 class LightApp_Displayer;
+class LightApp_SelectionMgr;
 
 class SUIT_Study;
 class SUIT_DataObject;
@@ -67,7 +69,7 @@ public:
   virtual void                        windows( QMap<int, int>& ) const;
   virtual void                        viewManagers( QStringList& ) const;
 
-  virtual void                        contextMenuPopup( const QString&, QPopupMenu*, QString& );
+  virtual void                        contextMenuPopup( const QString&, QMenu*, QString& );
 
   virtual void                        createPreferences();
 
@@ -114,9 +116,9 @@ protected:
   virtual CAM_DataModel*              createDataModel();
 
   int                                 addPreference( const QString& label );
-  int                                 addPreference( const QString& label, const int pId, const int = -1,
-                                                    const QString& section = QString::null,
-                                                    const QString& param = QString::null );
+  int                                 addPreference( const QString& label, const int pId, const int = LightApp_Preferences::Auto,
+                                                    const QString& section = QString(),
+                                                    const QString& param = QString() );
   QVariant                            preferenceProperty( const int, const QString& ) const;
   void                                setPreferenceProperty( const int, const QString&, const QVariant& );
 
@@ -132,6 +134,10 @@ protected:
 
   virtual void                        updateControls();
 
+  virtual bool                        isSelectionCompatible();
+
+  LightApp_Operation*                 operation( const int ) const;
+
 private:
   typedef QMap<int,LightApp_Operation*> MapOfOperation;
 
diff --git a/src/LightApp/LightApp_ModuleAction.cxx b/src/LightApp/LightApp_ModuleAction.cxx
new file mode 100755 (executable)
index 0000000..36c6fa7
--- /dev/null
@@ -0,0 +1,572 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : LightApp_ModuleAction.cxx
+// Author : Sergey TELKOV, Vadim SANDLER
+//
+#include "LightApp_ModuleAction.h"
+
+#include <QtxComboBox.h>
+#include <QtxActionSet.h>
+#include <QVBoxLayout>
+
+/*!
+  \class LightApp_ModuleAction::ActionSet
+  \brief Internal class to represent list of modules buttons.
+  \internal
+*/
+
+class LightApp_ModuleAction::ActionSet : public QtxActionSet
+{
+public:
+  ActionSet( QObject* );
+  QAction* moduleAction( const QString& ) const;
+  int      moduleId( const QString& ) const;
+  int      moduleId( QAction* ) const;
+  void     setVisible( bool );
+};
+
+/*!
+  \brief Constructor.
+  \internal
+  \param parent parent object
+*/
+LightApp_ModuleAction::ActionSet::ActionSet( QObject* parent )
+: QtxActionSet( parent ) 
+{
+}
+
+/*!
+  \brief Get action corresponding to the specified module.
+  \internal
+  \param name module name
+  \return module action or 0 if \a name is invalid
+*/
+QAction* LightApp_ModuleAction::ActionSet::moduleAction( const QString& name ) const
+{
+  QAction* a = 0;
+
+  QList<QAction*> alist = actions();
+  for ( QList<QAction*>::const_iterator it = alist.begin(); it != alist.end() && !a; ++it )
+  {
+    if ( (*it)->text() == name )
+      a = *it;
+  }
+
+  return a;
+}
+
+/*!
+  \brief Get module action identifier.
+  \internal
+  \param name module name
+  \return module action ID or -1 if \a name is invalid
+*/
+int LightApp_ModuleAction::ActionSet::moduleId( const QString& name ) const
+{
+  int id = -1;
+
+  QList<QAction*> alist = actions();
+  for ( QList<QAction*>::const_iterator it = alist.begin(); it != alist.end() && id == -1; ++it )
+  {
+    if ( (*it)->text() == name )
+      id = actionId( *it );
+  }
+
+  return id;
+}
+
+/*!
+  \brief Get module action identifier.
+  \internal
+  \param a module action
+  \return module action ID or -1 if \a a is null or invalid
+*/
+int LightApp_ModuleAction::ActionSet::moduleId( QAction* a ) const
+{
+  return actionId( a );
+}
+
+/*!
+  \brief Show/hide modules actions.
+  \internal
+  \param on new visibility state
+*/
+void LightApp_ModuleAction::ActionSet::setVisible( bool on )
+{
+  QList<QAction*> alist = actions();
+  for ( QList<QAction*>::const_iterator it = alist.begin(); it != alist.end(); ++it )
+    (*it)->setVisible( on );
+
+  QtxActionSet::setVisible( on );
+}
+
+/*!
+  \class LightApp_ModuleAction::ComboAction
+  \brief Internal class to represent combo box with the list of modules in the toolbar.
+  \internal
+*/
+
+/*!
+  \brief Constructor.
+  \internal
+  \param parent parent object
+*/
+LightApp_ModuleAction::ComboAction::ComboAction( QObject* parent )
+: QtxAction( parent )
+{
+}
+
+/*!
+  \brief Get list of associated widgets.
+  \internal
+  \return list of created widgets (QtxComboBox)
+*/
+QList<QtxComboBox*> LightApp_ModuleAction::ComboAction::widgets() const
+{
+  QList<QtxComboBox*> lst;
+
+  QList<QWidget*> wlist = createdWidgets();
+  for ( QList<QWidget*>::const_iterator wit = wlist.begin(); wit != wlist.end(); ++wit )
+    lst += qFindChildren<QtxComboBox *>(*wit);
+
+  return lst;
+}
+
+/*!
+  \brief Create combo box widget by request from the toolbar.
+  \internal
+  \param parent parent widget (should be QToolBar or its successor)
+  \return new custom widget, containing combo box
+*/
+QWidget* LightApp_ModuleAction::ComboAction::createWidget( QWidget* parent )
+{
+  if ( !parent->inherits( "QToolBar" ) )
+    return 0;
+
+  QWidget* dumb = new QWidget( parent );
+  QVBoxLayout* l = new QVBoxLayout( dumb );
+  l->setSpacing( 0 ); l->setMargin( 0 );
+  QtxComboBox* cb = new QtxComboBox( dumb );
+  cb->setSizeAdjustPolicy( QComboBox::AdjustToContents );
+  cb->setFocusPolicy( Qt::NoFocus );
+  l->addWidget( cb );
+  l->addSpacing( 3 );
+
+  connect( cb, SIGNAL( activatedId( int ) ), this, SIGNAL( activatedId( int ) ) );
+
+  return dumb;
+}
+
+/*!
+  \fn void LightApp_ModuleAction::ComboAction::activatedId( int id );
+  \internal
+  \brief Emitted when the combo box item is activated
+  \param item identifier
+*/
+
+/*!
+  \class LightApp_ModuleAction
+  \brief An action, representing the list of modules to be inserted to the
+  toolbar.
+
+  This action is represented in the toolbar as combo box and a set of buttons 
+  for each module. In addition to the modules items, the combo box contains 
+  an item corresponding to the "neutral point" of the application 
+  (when there is no active module).
+  
+  The action can be constructed with up to two parameters, defining the text
+  and icon to be displayed for the "neutral point".
+
+  Only one module can be active at the moment. It can be set programmatically 
+  with setActiveModule() function. Use this method with empty string to turn
+  to the "neutral point". To get active module, use activeModule() function.
+
+  When user activates/deactivates any module, the signal moduleActivated() 
+  is emitted.
+
+  The action can be represented in the toolbar in different modes:
+  * as combo box only (Qtx::ComboItem)
+  * as set of modules buttons only (Qtx::Buttons)
+  * as combo box followed by the set of modules buttons (Qtx::All)
+  * as none (Qtx::None)
+  By default, both combo box and buttons set are shown. Use method 
+  setMode() to change this behavior.
+
+  An action can be also added to the popup menu, but combo box is never shown
+  in this case, only modules buttons.
+*/
+
+/*!
+  \brief Constructor
+
+  Creates an module action with "neutral point" item described by \a text.
+
+  \param text "neutral point" item's text
+  \param parent parent object
+*/
+LightApp_ModuleAction::LightApp_ModuleAction( const QString& text, QObject* parent )
+: QtxAction( parent )
+{
+  setText( text );
+  init();
+}
+
+/*!
+  \brief Constructor
+
+  Creates an module action with "neutral point" item described by \a text and \a ico.
+
+  \param text "neutral point" item's text
+  \param ico "neutral point" item's icon
+  \param parent parent object
+*/
+LightApp_ModuleAction::LightApp_ModuleAction( const QString& text, const QIcon& ico, QObject* parent )
+: QtxAction( parent )
+{
+  setText( text );
+  setIcon( ico );
+  init();
+}
+
+/*!
+  \brief Destructor
+*/
+LightApp_ModuleAction::~LightApp_ModuleAction()
+{
+}
+
+/*!
+  \brief Get list of modules.
+  \return modules names list
+*/
+QStringList LightApp_ModuleAction::modules() const
+{
+  QStringList lst;
+
+  QList<QAction*> alist = mySet->actions();
+  for ( QList<QAction*>::const_iterator it = alist.begin(); it != alist.end(); ++it )
+    lst.append( (*it)->text() );
+
+  return lst;
+}
+
+/*!
+  \brief Get module icon.
+  \param name module name
+  \return module icon
+  \sa setModuleIcon()
+*/
+QIcon LightApp_ModuleAction::moduleIcon( const QString& name ) const
+{
+  QAction* a = mySet->moduleAction( name );
+  return a ? a->icon() : QIcon();
+}
+
+/*!
+  \brief Set module icon.
+  \param name module name
+  \param ico new module icon
+  \sa moduleIcon()
+*/
+void LightApp_ModuleAction::setModuleIcon( const QString& name, const QIcon& ico )
+{
+  QAction* a = mySet->moduleAction( name );
+  if ( !a )
+    return;
+
+  a->setIcon( ico );
+  update();
+}
+
+/*!
+  \brief Add module into the list.
+  \param name module name
+  \param ico module icon
+  \param idx position in the module list (if -1, the module is added to the end of list)
+  \sa removeModule()
+*/
+void LightApp_ModuleAction::insertModule( const QString& name, const QIcon& ico,
+                                          const int idx )
+{
+  QtxAction* a = new QtxAction( name, ico, name, 0, this, true );
+  a->setStatusTip( tr( "Activate/deactivate %1 module" ).arg( name ) );
+
+  mySet->insertAction( a, -1, idx );
+  update();
+}
+
+/*!
+  \brief Remove module from the list.
+  \param name module name
+  \sa insertModule()
+*/
+void LightApp_ModuleAction::removeModule( const QString& name )
+{
+  int id = mySet->moduleId( name );
+  if ( id == -1 )
+    return;
+
+  mySet->removeAction( id );
+  update();
+}
+
+/*!
+  \brief Get active module.
+
+  If there is no active module ("neutral point"), then the null string 
+  is returned.
+
+  \return active module name
+  \sa setActiveModule()
+*/
+QString LightApp_ModuleAction::activeModule() const
+{
+  QAction* a = active();
+  return a ? a->text() : QString();
+}
+
+/*!
+  \brief Set active module.
+
+  To turn to the "neutral point" (no active module), pass empty string.
+
+  \param name new active module name
+  \sa activeModule()
+*/
+void LightApp_ModuleAction::setActiveModule( const QString& name )
+{
+  if ( name == activeModule() )
+    return;
+
+  int id = mySet->moduleId( name );
+  if ( name.isEmpty() || id != -1 )
+    activate( id, false );
+}
+
+/*!
+  \brief Set action display mode.
+
+  Action can be represented in the toolbar as
+  * combo box only (Qtx::ComboItem)
+  * set of modules buttons only (Qtx::Buttons)
+  * combo box followed by the set of modules buttons (Qtx::All)
+  * none (Qtx::None)
+
+  \param mode action display mode
+  \sa mode()
+*/
+void LightApp_ModuleAction::setMode( const int mode )
+{
+  myMode = mode;
+  update();
+}
+
+/*!
+  \brief Get action display mode.
+  \param mode action display mode
+  \sa setMode()
+*/
+int LightApp_ModuleAction::mode() const
+{
+  return myMode;
+}
+
+/*!
+  \brief Called when the action is added to the widget.
+  \param w widget (not used)
+*/
+void LightApp_ModuleAction::addedTo( QWidget* w )
+{
+  if ( w->inherits( "QToolBar" ) )
+    w->insertAction( this, myCombo );
+  w->insertAction( this, mySet );
+  update();
+}
+
+/*!
+  \brief Remove action from widget.
+  \param w widget (menu or toolbar)
+  \return \c true if the action is removed successfully and \c false otherwise.
+  \sa addTo()
+*/
+void LightApp_ModuleAction::removedFrom( QWidget* w )
+{
+  if ( w->inherits( "QToolBar" ) )
+    w->removeAction( myCombo );
+  w->removeAction( mySet );
+}
+
+/*!
+  \fn void LightApp_ModuleAction::moduleActivated( const QString& name );
+  \brief Emitted when the module is activated
+  \param name module name (empty string for neutral point)
+*/
+
+/*!
+  \brief Initialize an action,
+  \internal
+*/
+void LightApp_ModuleAction::init()
+{
+  setVisible( false );
+
+  myMode = All;
+  myCombo = new ComboAction( this );
+  mySet = new ActionSet( this );
+
+  connect( this,    SIGNAL( changed() ),          this, SLOT( onChanged() ) );
+  connect( mySet,   SIGNAL( triggered( int ) ),   this, SLOT( onTriggered( int ) ) );
+  connect( myCombo, SIGNAL( activatedId( int ) ), this, SLOT( onComboActivated( int ) ) );
+}
+
+/*!
+  \brief Update an action.
+  \internal
+*/
+void LightApp_ModuleAction::update()
+{
+  QList<QtxComboBox*> lst = myCombo->widgets();
+  for ( QList<QtxComboBox*>::const_iterator it = lst.begin(); it != lst.end(); ++it )
+    update( *it );
+
+  myCombo->setVisible( myMode & ComboItem );
+  mySet->setVisible( myMode & Buttons );
+}
+
+/*!
+  \brief Update combo box.
+  \internal
+  \param cb combo box
+*/
+void LightApp_ModuleAction::update( QtxComboBox* cb )
+{
+  if ( !cb )
+    return;
+
+  int curId = mySet->moduleId( active() );
+  QList<QAction*> alist = mySet->actions();
+  cb->clear();
+  
+  cb->addItem( icon(), text() );
+  cb->setId( 0, -1 );
+
+  for ( QList<QAction*>::const_iterator it = alist.begin(); it != alist.end(); ++it )
+  {
+    QAction* a = *it;
+    int id = mySet->moduleId( a );
+    cb->addItem( a->icon(), a->text() );
+    cb->setId( cb->count() - 1, id );
+  }
+
+  cb->setCurrentId( curId );
+}
+
+/*!
+  \brief Get an action corresponding to the active module.
+  \internal
+  \return active module action or 0 if there is no active module
+*/
+QAction* LightApp_ModuleAction::active() const
+{
+  QAction* a = 0;
+
+  QList<QAction*> alist = mySet->actions();
+  for ( QList<QAction*>::const_iterator it = alist.begin(); it != alist.end() && !a; ++it )
+  {
+    if ( (*it)->isChecked() )
+      a = *it;
+  }
+
+  return a;
+}
+
+/*!
+  \brief Activate a module item.
+  \internal
+  \param id module identifier
+  \param fromAction \c true if function is called from the module button
+*/
+void LightApp_ModuleAction::activate( int id, bool fromAction )
+{
+  bool checked = false;
+
+  QList<QAction*> alist = mySet->actions();
+  for ( QList<QAction*>::const_iterator it = alist.begin(); it != alist.end(); ++it )
+  {
+    if ( mySet->moduleId( *it ) != id ) {
+      (*it)->setChecked( false );
+    }
+    else {
+      if ( !fromAction )
+        (*it)->setChecked( true );
+      checked = (*it)->isChecked();
+    }
+  }
+
+  QList<QtxComboBox*> widgets = myCombo->widgets();
+  for ( QList<QtxComboBox*>::const_iterator wit = widgets.begin(); wit != widgets.end(); ++wit )
+  {
+    QtxComboBox* cb = *wit;
+    bool blocked = cb->signalsBlocked();
+    cb->blockSignals( true );
+    cb->setCurrentId( checked ? id : -1 );
+    cb->blockSignals( blocked );
+  }
+
+  emit moduleActivated( activeModule() );
+}
+
+/*!
+  \brief Called when module button is triggered.
+  \internal
+  \param id module identifier
+*/
+void LightApp_ModuleAction::onTriggered( int id )
+{
+  activate( id );
+}
+
+/*!
+  \brief Called when action state is changed.
+  \internal
+  
+  This slot is used to prevent making the parent action visible.
+*/
+void LightApp_ModuleAction::onChanged()
+{
+  if ( !isVisible() )
+    return;
+
+  bool block = signalsBlocked();
+  blockSignals( true );
+  setVisible( false );
+  blockSignals( block );
+}
+
+/*!
+  \brief Called when combo box item is activated.
+  \param id module identifier
+*/
+void LightApp_ModuleAction::onComboActivated( int id )
+{
+  activate( id, false );
+} 
diff --git a/src/LightApp/LightApp_ModuleAction.h b/src/LightApp/LightApp_ModuleAction.h
new file mode 100755 (executable)
index 0000000..4be268d
--- /dev/null
@@ -0,0 +1,111 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : LightApp_ModuleAction.h
+// Author : Sergey TELKOV, Vadim SANDLER
+//
+#ifndef LIGHTAPP_MODULEACTION_H
+#define LIGHTAPP_MODULEACTION_H
+
+#include "LightApp.h"
+
+#include <QtxAction.h>
+
+#ifdef WIN32
+#pragma warning ( disable:4251 )
+#endif
+
+class QtxComboBox;
+
+class LIGHTAPP_EXPORT LightApp_ModuleAction : public QtxAction
+{
+  Q_OBJECT
+
+private:
+  class ActionSet;
+  class ComboAction;
+
+public:
+  enum { None = 0x00, Buttons = 0x01, ComboItem = 0x02, All = Buttons | ComboItem };
+
+public:
+  LightApp_ModuleAction( const QString&, QObject* = 0 );
+  LightApp_ModuleAction( const QString&, const QIcon&, QObject* = 0 );
+  virtual ~LightApp_ModuleAction();
+
+  QStringList      modules() const;
+
+  QIcon            moduleIcon( const QString& ) const;
+  void             setModuleIcon( const QString&, const QIcon& );
+
+  void             insertModule( const QString&, const QIcon&, const int = -1 );
+  void             removeModule( const QString& );
+
+  QString          activeModule() const;
+  void             setActiveModule( const QString& );
+
+  void             setMode( const int );
+  int              mode() const;
+
+protected:
+  virtual void     addedTo( QWidget* );
+  virtual void     removedFrom( QWidget* );
+
+signals:
+  void             moduleActivated( const QString& );
+
+private:
+  void             init();
+
+  void             update();
+  void             update( QtxComboBox* );
+
+  QAction*         active() const;
+  void             activate( int, bool = true );
+
+private slots:
+  void             onChanged();
+  void             onTriggered( int );
+  void             onComboActivated( int );
+
+private:
+  ComboAction*     myCombo;
+  ActionSet*       mySet;
+  int              myMode;
+};
+
+class LightApp_ModuleAction::ComboAction : public QtxAction
+{
+  Q_OBJECT
+
+public:
+  ComboAction( QObject* parent );
+
+  QList<QtxComboBox*> widgets() const;
+
+protected:
+  virtual QWidget*    createWidget( QWidget* );
+
+signals:
+  void                activatedId( int );
+};
+
+#endif // LIGHTAPP_MODULEACTION_H
index 3fcaf5112f92afd917c0de0239b47d625c736f25..a675d7a8b3b860157192fdb031ed793866ec57cc 100644 (file)
@@ -1,30 +1,39 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  File   : LightApp_ModuleDlg.cxx
-//  Author : Michael Zorin (mzn)
-//  Module : LightApp
-
-#include <LightApp_ModuleDlg.h>
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : LightApp_ModuleDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#include "LightApp_ModuleDlg.h"
 
-#include <qlabel.h>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QHBoxLayout>
 
-static const char* default_icon[] = { 
+/*!
+  \brief Pixmap used as default icon for the module.
+  \internal
+*/
+static const char* const default_icon[] = { 
 "48 48 17 1",
 ". c None",
 "# c #161e4c",
@@ -92,15 +101,163 @@ static const char* default_icon[] = {
 "................................................",
 "................................................"};
 
+/*!
+  \class LightApp_ModuleDlg
+  \brief A dialog box allowing to select study operation to be performed
+  on the module activating.
+
+  The dialog box is shown when the user tries to activate any module
+  while there is no opened study. The dialog box proposes user to select
+  one of the possible operations which should be done before module activating,
+  for example, create new study or open study from the file.
+  The available operations are assigned by adding the buttons with the unique
+  identifier to the dialog box. When the user clicks any operation button,
+  the dialog box sets its identifier as the return code and closes.
+
+  The typical usage of the dialog box:
+  \code
+  LightApp_ModuleDlg dlg( desktop() );
+  dlg.addButton( "New study", NewStudyId );
+  dlg.addButton( "Open study...", OpenStudyId );
+  int ret = dlg.exec();
+  switch( ret ) {
+  case NewStudyId:
+    // create new study
+    createNewStudy();
+    break;
+  case OpenStudyId:
+    // open study from the file
+    // ... show dialog box to choose the file
+    QString fileName = QFileDialog::getOpenFileName( desktop(), "Open File" );
+    if ( !fileName.isEmpty() )
+      openStudy( fileName );
+    break;
+  default:
+    // operation is cancelled
+    break;
+  }
+  \endcode
+
+  \sa addButton()
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+  \param component module name
+  \param icon module icon
+*/
 LightApp_ModuleDlg::LightApp_ModuleDlg( QWidget*       parent, 
-                                       const QString& component,
+                                       const QString& component, 
                                        const QPixmap& icon )
-: SUIT_MsgDlg( parent, tr( "CAPTION" ), tr ( "DESCRIPTION" ).arg( component ), !icon.isNull() ? icon : QPixmap( default_icon ) )
+: QDialog ( parent )
 {
-  iconLabel()->setFrameStyle( QFrame::Box | QFrame::Sunken );
-  iconLabel()->setMinimumSize( 70, 70 );
+  setModal( true );
+
+  QPixmap defaultIcon( default_icon );
+  setWindowTitle( tr( "CAPTION" ) );
+  
+  // icon
+  QLabel* iconLab = new QLabel( this );
+  iconLab->setFrameStyle( QFrame::Box | QFrame::Sunken );
+  iconLab->setMinimumSize( 70, 70 );
+  iconLab->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
+  iconLab->setPixmap( !icon.isNull() ? icon : defaultIcon );
+  iconLab->setScaledContents( false );
+  iconLab->setAlignment( Qt::AlignCenter );
+
+  // info message
+  QLabel* infoLab = new QLabel( tr ( "DESCRIPTION" ).arg( component ), this );
+  infoLab->setTextFormat( Qt::RichText );
+  infoLab->setAlignment( Qt::AlignCenter );
+  
+  // Buttons
+  myButtonLayout = new QHBoxLayout(); 
+  myButtonLayout->setMargin( 0 ); 
+  myButtonLayout->setSpacing( 6 );
+
+  // <Cancel>
+  QPushButton* cancelBtn = new QPushButton( tr( "CANCEL" ), this );
+  myButtonLayout->addSpacing( 70 );
+  myButtonLayout->addStretch();
+  myButtonLayout->addWidget( cancelBtn );
+
+  QGridLayout* layout = new QGridLayout( this ); 
+  layout->setMargin( 11 );
+  layout->setSpacing( 6 );
+
+  layout->addWidget( iconLab, 0, 0 );
+  layout->addWidget( infoLab, 0, 1 );
+  layout->addLayout( myButtonLayout, 1, 0, 1, 2 );
+
+  // signals and slots connections
+  connect( cancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
 }
 
+/*!
+  \brief Destructor.
+*/
 LightApp_ModuleDlg::~LightApp_ModuleDlg()
 {
 }
+
+/*!
+  \brief Add operation button to the dialog box.
+
+  If the parameter \a id is equal to -1, then the 
+  button identifier is generated automatically.
+
+  \param button button text
+  \param id button identifier
+  \return button identifier
+*/
+int LightApp_ModuleDlg::addButton( const QString& button, const int id )
+{
+  static int lastId = 0;
+  int bid = id == -1 ? --lastId : id;
+
+  QPushButton* b = findButton( bid );
+  if ( b ) {
+    myButtons.remove( b );
+    delete b;
+  }
+
+  QPushButton* newButton = new QPushButton( button, this );
+
+  if ( myButtons.empty() ) newButton->setDefault( true );
+
+  myButtons.insert( newButton, bid );
+  myButtonLayout->insertWidget( myButtonLayout->count()-3, newButton );
+  connect( newButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
+
+  return bid;
+}
+
+/*!
+  \brief Search button with the specified identifier.
+  \param id button identifier
+  \return button or 0 if \a id is invalid
+*/
+QPushButton* LightApp_ModuleDlg::findButton( const int id ) const
+{
+  QPushButton* btn = 0;
+  for ( ButtonMap::ConstIterator it = myButtons.begin(); 
+       it != myButtons.end() && !btn; ++it ) {
+    if ( it.value() == id )
+      btn = it.key();
+  }
+  return btn;
+}
+
+/*!
+  \brief Called when any dialog button (except \c Cancel) 
+  is clicked.
+  
+  Closes the dialog and sets its result code to the identifier
+  of the button clicked by the user.
+*/
+void LightApp_ModuleDlg::accept()
+{
+  QPushButton* btn = ( QPushButton* )sender();
+  done( myButtons[ btn ] );
+}
index 0f2dd79a9073d14d2b9d8ef22ac04e7f119b9a53..90211f5313972dfd83f1ecaa6e82b78b15985305 100644 (file)
@@ -1,39 +1,61 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File   : LightApp_ModuleDlg.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-
 #ifndef LIGHTAPP_MODULEDLG_H
 #define LIGHTAPP_MODULEDLG_H
 
 #include "LightApp.h"
 
-#include <SUIT_MsgDlg.h> 
+#include <QDialog> 
+#include <QPixmap>
+#include <QMap>
+
+class QPushButton;
+class QHBoxLayout;
 
-class LIGHTAPP_EXPORT LightApp_ModuleDlg : public SUIT_MsgDlg
+class LIGHTAPP_EXPORT LightApp_ModuleDlg : public QDialog
 {
   Q_OBJECT
 
 public:
-  LightApp_ModuleDlg( QWidget*, const QString&, const QPixmap& = QPixmap() );
+  LightApp_ModuleDlg( QWidget*, const QString&, const QPixmap& = QPixmap() ) ;
   ~LightApp_ModuleDlg();
+
+  int addButton( const QString&, const int = -1);
+
+public slots:
+  void accept();
+
+private:
+  QPushButton* findButton( const int ) const;
+
+private:
+  typedef QMap<QPushButton*,int> ButtonMap;
+
+private:
+  ButtonMap    myButtons;
+  QHBoxLayout* myButtonLayout;
 };
 
 #endif // LIGHTAPP_MODULEDLG_H
index e1bca58ce061033a15e794fa930828c4cc2ac1b1..b6ead7cdc7e3a4ae26925520b0bbda85b6ed9611 100644 (file)
@@ -1,35 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  File   : LightApp_NameDlg.cxx
-//  Author : Vadim SANDLER
-//  $Header$
-
-#include <LightApp_NameDlg.h>
-#include <SUIT_Application.h>
-#include <SUIT_Desktop.h>
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : LightApp_NameDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#include "LightApp_NameDlg.h"
 #include <SUIT_Tools.h>
 
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
 
 #ifndef WIN32
 using namespace std;
@@ -40,48 +41,51 @@ using namespace std;
 */
 LightApp_NameDlg::LightApp_NameDlg( QWidget* parent )
 : QDialog( parent ? parent : NULL,//application()->desktop(), 
-"LightApp_NameDlg",
-true,
-WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
 {
-  setCaption( tr("TLT_RENAME") );
+  setObjectName( "LightApp_NameDlg" );
+  setModal( true );
+
+  setWindowTitle( 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() );
+  QGroupBox* GroupC1 = new QGroupBox( this );
+  GroupC1->setObjectName( "GroupC1" );
+  QHBoxLayout* GroupC1Layout = new QHBoxLayout( GroupC1 );
   GroupC1Layout->setAlignment( Qt::AlignTop );
   GroupC1Layout->setMargin( 11 ); GroupC1Layout->setSpacing( 6 );
   
-  QLabel* TextLabel = new QLabel( GroupC1, "TextLabel1" );
+  QLabel* TextLabel = new QLabel( GroupC1 );
+  TextLabel->setObjectName( "TextLabel1" );
   TextLabel->setText( tr( "NAME_LBL" ) );
   GroupC1Layout->addWidget( TextLabel );
   
-  myLineEdit = new QLineEdit( GroupC1, "LineEdit1" );
+  myLineEdit = new QLineEdit( GroupC1 );
+  myLineEdit->setObjectName( "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() );
+  QGroupBox* GroupButtons = new QGroupBox( this );
+  GroupButtons->setObjectName( "GroupButtons" );
+  QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
   GroupButtonsLayout->setAlignment( Qt::AlignTop );
   GroupButtonsLayout->setMargin( 11 ); GroupButtonsLayout->setSpacing( 6 );
   
-  myButtonOk = new QPushButton( GroupButtons, "buttonOk" );
+  myButtonOk = new QPushButton( GroupButtons );
+  myButtonOk->setObjectName( "buttonOk" );
   myButtonOk->setText( tr( "BUT_OK"  ) );
   myButtonOk->setAutoDefault( TRUE ); myButtonOk->setDefault( TRUE );
   GroupButtonsLayout->addWidget( myButtonOk );
 
   GroupButtonsLayout->addStretch();
   
-  myButtonCancel = new QPushButton( GroupButtons, "buttonCancel" );
+  myButtonCancel = new QPushButton( GroupButtons );
+  myButtonCancel->setObjectName( "buttonCancel" );
   myButtonCancel->setText( tr( "BUT_CANCEL"  ) );
   myButtonCancel->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( myButtonCancel );
@@ -128,7 +132,7 @@ QString LightApp_NameDlg::name()
 */
 void LightApp_NameDlg::accept()
 {
-  if ( name().stripWhiteSpace().isEmpty() )
+  if ( name().trimmed().isEmpty() )
     return;
   QDialog::accept();
 }
index 45f64c15bf382284d712884cf8ddd07fc6ffd052..7a6262d574229413110e0fa63381752ae3bbcf16 100644 (file)
@@ -1,33 +1,32 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  SALOME SalomeApp : implementation of desktop and GUI kernel
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : LightApp_NameDlg.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : LightApp_NameDlg.h
-//  Author : Vadim SANDLER
-//  Module : SALOME
-//  $Header$
-
 #ifndef LIGHTAPP_NAMEDLG_H
 #define LIGHTAPP_NAMEDLG_H
 
 #include "LightApp.h"
-#include <qdialog.h>
+#include <QDialog>
 
 class QLineEdit;
 class QPushButton;
@@ -47,7 +46,7 @@ public:
   void            setName( const QString& name );
   QString         name();
     
-  static QString  getName( QWidget* parent = 0, const QString& oldName = QString::null );
+  static QString  getName( QWidget* parent = 0, const QString& oldName = QString() );
     
 protected slots:
   void accept();
index b157202718687b152fd1d44b51c5c67b908ef9db..20c347ecde2c181213e720f6d20acf63970867b9 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "LightApp_OBFilter.h"
 
index 79e010c14cc82c9664aa1ed646f4f7497264bd54..8788919f5745fa86d1cfe567a6b6f7cfb99f4d97 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef LIGHTAPP_OBFILTER_H
 #define LIGHTAPP_OBFILTER_H
index 175356d91055531231907238bc4a7c9d631056dd..ede0e004c088ba36e5e91609b5dddbe20326069c 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : LightApp_OBSelector.cxx
+// Author :
 //
 #include "LightApp_OBSelector.h"
 
 #include "LightApp_DataOwner.h"
 #include "LightApp_DataObject.h"
 #include "LightApp_Application.h"
-
-#include <OB_Browser.h>
-
+#include <SUIT_DataBrowser.h>
 #include <SUIT_Session.h>
 #include <SUIT_DataObjectIterator.h>
-
-#include <qdatetime.h>
-
+#include <QTime>
 #include <time.h>
 
 /*!
-  Constructor
+  \class LightApp_OBSelector
+  \brief Object browser selection handler class.
+*/
+
+/*!
+  \brief Constructor.
+  \param ob object browser
+  \param mgr selection manager
 */
-LightApp_OBSelector::LightApp_OBSelector( OB_Browser* ob, SUIT_SelectionMgr* mgr )
+LightApp_OBSelector::LightApp_OBSelector( SUIT_DataBrowser* ob, SUIT_SelectionMgr* mgr )
 : SUIT_Selector( mgr, ob ),
   myBrowser( ob )
 {
   if ( myBrowser ) {
     connect( myBrowser, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );
-  }    
-
+  }
   setModified();
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 LightApp_OBSelector::~LightApp_OBSelector()
 {
 }
 
 /*!
-  Gets browser.
+  \brief Get object browser.
+  \return a pointer to the object browser
 */
-OB_Browser* LightApp_OBSelector::browser() const
+SUIT_DataBrowser* LightApp_OBSelector::browser() const
 {
   return myBrowser;
 }
 
 /*!
-  Gets selection.
+  \brief Get selector type.
+  \return selector type
+*/
+QString LightApp_OBSelector::type() const
+{ 
+  return "ObjectBrowser"; 
+}
+
+/*!
+  \brief Get the time of the last selection changing.
+  \return latest selection changing time
+*/
+unsigned long LightApp_OBSelector::getModifiedTime() const
+{
+  return myModifiedTime;
+}
+
+/*!
+  \brief Update the time of the latest selection changing.
+*/
+void LightApp_OBSelector::setModified()
+{
+  myModifiedTime = clock();
+}
+
+/*!
+  \brief Called when the Object browser selection is changed.
+*/
+void LightApp_OBSelector::onSelectionChanged()
+{
+  QTime t1 = QTime::currentTime();
+  mySelectedList.clear();
+  selectionChanged();
+  QTime t2 = QTime::currentTime();
+  qDebug( QString( "selection time = %1 msecs" ).arg( t1.msecsTo( t2 ) ).toLatin1().constData() );
+}
+
+/*!
+  \brief Get list of currently selected objects.
+  \param theList list to be filled with the selected objects owners
 */
 void LightApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
 {
-  if (mySelectedList.count() == 0 ) {
+  if ( mySelectedList.count() == 0 ) {
     SUIT_Session* session = SUIT_Session::session();
     SUIT_Application* sapp = session ? session->activeApplication() : 0;
     LightApp_Application* app = dynamic_cast<LightApp_Application*>( sapp );
-    if( !app )
+    if( !app || !myBrowser )
       return;
 
-    if ( !myBrowser )
-      return;
     DataObjectList objlist;
     myBrowser->getSelected( objlist );
     LightApp_OBSelector* that = (LightApp_OBSelector*)this;
-    for ( DataObjectListIterator it( objlist ); it.current(); ++it )
-    {
-      LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( it.current() );
-      if ( obj && app->checkDataObject(obj) )
-      {
+    QListIterator<SUIT_DataObject*> it( objlist );
+    while ( it.hasNext() ) {
+      LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( it.next() );
+      if ( obj && app->checkDataObject( obj) ) {
 #ifndef DISABLE_SALOMEOBJECT
         Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject
-          ( obj->entry(), obj->componentDataType(), obj->name() );
+          ( obj->entry().toLatin1().constData(),
+           obj->componentDataType().toLatin1().constData(),
+           obj->name().toLatin1().constData() );
         LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj  );
 #else
         LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() );
@@ -96,19 +143,21 @@ void LightApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
   theList = mySelectedList;
 }
 
-/*!Sets selection.*/
+/*!
+  \brief Set selection.
+  \param theList list of the object owners to be set selected
+*/
 void LightApp_OBSelector::setSelection( const SUIT_DataOwnerPtrList& theList )
 {
   if ( !myBrowser )
     return;
 
-  if( myEntries.count() == 0 ||
-      myModifiedTime < myBrowser->getModifiedTime() )
+  if( myEntries.count() == 0 ||        myModifiedTime < myBrowser->getModifiedTime() )
     fillEntries( myEntries );
 
   DataObjectList objList;
-  for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin(); it != theList.end(); ++it )
-  {
+  for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin(); 
+       it != theList.end(); ++it ) {
     const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*it).operator->() );
     if ( owner && myEntries.contains( owner->entry() ) )
       objList.append( myEntries[owner->entry()] );
@@ -118,37 +167,24 @@ void LightApp_OBSelector::setSelection( const SUIT_DataOwnerPtrList& theList )
   mySelectedList.clear();
 }
 
-/*!On selection changed.*/
-void LightApp_OBSelector::onSelectionChanged()
-{
-  QTime t1 = QTime::currentTime();
-  mySelectedList.clear();
-  selectionChanged();
-  QTime t2 = QTime::currentTime();
-  qDebug( QString( "selection time = %1 msecs" ).arg( t1.msecsTo( t2 ) ) );
-}
-
-/*!Fill entries.*/
-void LightApp_OBSelector::fillEntries( QMap<QString, LightApp_DataObject*>& entires )
+/*!
+  \brief Fill map of the data objects currently shown in the Object Browser.
+  \param entries map to be filled
+*/
+void LightApp_OBSelector::fillEntries( QMap<QString, LightApp_DataObject*>& entries )
 {
-  entires.clear();
+  entries.clear();
 
   if ( !myBrowser )
     return;
 
-  for ( SUIT_DataObjectIterator it( myBrowser->getRootObject(),
-                                    SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it )
-  {
+  for ( SUIT_DataObjectIterator it( myBrowser->root(),
+                                    SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) {
     LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( it.current() );
     if ( obj )
-      entires.insert( obj->entry(), obj );
+      entries.insert( obj->entry(), obj );
   }
 
   setModified();
 }
 
-/*!Update modified time.*/
-void LightApp_OBSelector::setModified()
-{
-  myModifiedTime = clock();
-}
index f6811946c67092dc170e9b2e6bc2c98ddcbd76cc..7426335656d0da67e8fb396641ebfa93193010e0 100644 (file)
@@ -1,20 +1,26 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : LightApp_OBSelector.h
+// Author :
 //
 #ifndef LIGHTAPP_OBSELECTOR_H
 #define LIGHTAPP_OBSELECTOR_H
 #include <SUIT_Selector.h>
 #include <SUIT_DataOwner.h>
 
-class OB_Browser;
+#include <QObject>
+
+class SUIT_DataBrowser;
 class LightApp_DataObject;
 
-/*!
-  \class LightApp_OBSelector
-  Custom selector to get/set selection from object browser
-*/
-class LIGHTAPP_EXPORT LightApp_OBSelector : public SUIT_Selector
+class LIGHTAPP_EXPORT LightApp_OBSelector : public QObject, public SUIT_Selector
 {
   Q_OBJECT
 
 public:
-  LightApp_OBSelector( OB_Browser*, SUIT_SelectionMgr* );
+  LightApp_OBSelector( SUIT_DataBrowser*, SUIT_SelectionMgr* );
   virtual ~LightApp_OBSelector();
 
-  OB_Browser*  browser() const;
+  SUIT_DataBrowser*  browser() const;
 
-  /*!Return "ObjectBrowser"*/
-  virtual QString type() const { return "ObjectBrowser"; }
+  virtual QString    type() const;
 
-  void         setModified();
-  unsigned long getModifiedTime() { return myModifiedTime; }
+  unsigned long      getModifiedTime() const;
+  void               setModified();
 
 private slots:
-  void         onSelectionChanged();
+  void               onSelectionChanged();
 
 protected:
-  virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
-  virtual void setSelection( const SUIT_DataOwnerPtrList& );
+  virtual void       getSelection( SUIT_DataOwnerPtrList& ) const;
+  virtual void       setSelection( const SUIT_DataOwnerPtrList& );
 
 private:
-  void         fillEntries( QMap<QString, LightApp_DataObject*>& );
+  void               fillEntries( QMap<QString, LightApp_DataObject*>& );
 
 private:
-  OB_Browser*  myBrowser;
-  SUIT_DataOwnerPtrList  mySelectedList;
-
+  SUIT_DataBrowser*                   myBrowser;
+  SUIT_DataOwnerPtrList               mySelectedList;
   QMap<QString, LightApp_DataObject*> myEntries;
-
-  unsigned long myModifiedTime;
+  unsigned long                       myModifiedTime;
 };
 
 #endif
index 534cad26e9befc79573487d5a17352aad076e88d..1ccbeecbc8af7822497891e7f87a691e3811f2ea 100644 (file)
@@ -1,22 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "LightApp_DataOwner.h"
 #include "LightApp_OCCSelector.h"
 
@@ -29,6 +31,7 @@
 /*!
   Constructor
 */
+#ifndef DISABLE_OCCVIEWER
 LightApp_OCCSelector::LightApp_OCCSelector( OCCViewer_Viewer* viewer, SUIT_SelectionMgr* mgr )
 : SUIT_Selector( mgr, viewer ),
   myViewer( viewer )
@@ -38,6 +41,11 @@ LightApp_OCCSelector::LightApp_OCCSelector( OCCViewer_Viewer* viewer, SUIT_Selec
     connect( myViewer, SIGNAL( deselection() ), this, SLOT( onDeselection() ) );
   }
 }
+#else
+LightApp_OCCSelector::LightApp_OCCSelector(  SUIT_SelectionMgr* mgr )
+: SUIT_Selector( mgr )
+{}
+#endif
 
 /*!
   Destructor.
@@ -49,10 +57,12 @@ LightApp_OCCSelector::~LightApp_OCCSelector()
 /*!
   Gets viewer.
 */
+#ifndef DISABLE_OCCVIEWER
 OCCViewer_Viewer* LightApp_OCCSelector::viewer() const
 {
   return myViewer;
 }
+#endif
 
 
 /*!On selection changed.*/
@@ -70,6 +80,7 @@ void LightApp_OCCSelector::onDeselection()
 /*!Gets selection list.*/
 void LightApp_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
 {
+#ifndef DISABLE_OCCVIEWER
   if ( !myViewer )
     return;
 
@@ -91,11 +102,13 @@ void LightApp_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
   for(anExtIter = mySelectedExternals.begin(); anExtIter != mySelectedExternals.end(); anExtIter++) {
     aList.append(*anExtIter);
   }
+#endif
 }
 
 /*!Sets selection list.*/
 void LightApp_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
 {
+#ifndef DISABLE_OCCVIEWER
   if ( !myViewer )
     return;
 
@@ -127,13 +140,15 @@ void LightApp_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
 
   myViewer->unHighlightAll( false );
   myViewer->setObjectsSelected( aSelList );
+#endif
 }
 
+#ifndef DISABLE_OCCVIEWER
 /*!Gets entry ob object.*/
 QString LightApp_OCCSelector::entry( const Handle(AIS_InteractiveObject)& anAIS ) const
 {
   if ( anAIS.IsNull() || !anAIS->HasOwner() )
-    return QString::null;
+    return QString();
 
   QString res;
 
@@ -145,3 +160,4 @@ QString LightApp_OCCSelector::entry( const Handle(AIS_InteractiveObject)& anAIS
 
   return res;
 }
+#endif
index 905267435f9bda0d66800af793789594f20fcb48..d266c7f5045443dfe3ccd320b41359babfac2ada 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef LIGHTAPP_OCCSELECTOR_H
 #define LIGHTAPP_OCCSELECTOR_H
 #include <SUIT_Selector.h>
 #include <SUIT_DataOwner.h>
 
+#include <QObject>
+
+#ifndef DISABLE_OCCVIEWER
 #include <OCCViewer_ViewModel.h>
 
 class Handle_AIS_InteractiveObject;
+#endif
 
 /*!
   \class LightApp_OCCSelector
   Custom selector to get/set selection from OCC viewer
 */
-class LIGHTAPP_EXPORT LightApp_OCCSelector : public SUIT_Selector
+class LIGHTAPP_EXPORT LightApp_OCCSelector : public QObject, public SUIT_Selector
 {
   Q_OBJECT
 
 public:
+#ifndef DISABLE_OCCVIEWER
   LightApp_OCCSelector( OCCViewer_Viewer*, SUIT_SelectionMgr* );
+#else
+  LightApp_OCCSelector( SUIT_SelectionMgr* );
+#endif
   virtual ~LightApp_OCCSelector();
 
+#ifndef DISABLE_OCCVIEWER
   OCCViewer_Viewer* viewer() const;
 
   virtual QString   type() const { return OCCViewer_Viewer::Type(); }
+#endif
 
 private slots:
   virtual void      onSelectionChanged();
@@ -52,12 +65,16 @@ protected:
   virtual void      getSelection( SUIT_DataOwnerPtrList& ) const;
   virtual void      setSelection( const SUIT_DataOwnerPtrList& );
 
+#ifndef DISABLE_OCCVIEWER
   QString           entry( const Handle_AIS_InteractiveObject& ) const;
+#endif
 
   SUIT_DataOwnerPtrList mySelectedExternals;
 
 private:
+#ifndef DISABLE_OCCVIEWER
   OCCViewer_Viewer*     myViewer;
+#endif
 };
 
 #endif
index 86450eb81e0ff19308b49dd49e52c1095313574b..a80d54bf736a3e3887b2cd7b25a3d3207fbfb7ba 100755 (executable)
@@ -1,36 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : LightApp_Operation.h
 //  Author : Sergey LITONIN
 //  Module : LightApp
-
-#include <LightApp_Operation.h>
-#include <LightApp_Module.h>
-#include <LightApp_Application.h>
-#include <LightApp_Operation.h>
-#include <LightApp_SelectionMgr.h>
-#include <LightApp_Dialog.h>
+//
+#include "LightApp_Operation.h"
+#include "LightApp_Module.h"
+#include "LightApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+#include "LightApp_Dialog.h"
 
 #include <SUIT_Desktop.h>
-
-#include <qapplication.h>
-
+#include <SUIT_Study.h>
 
 /*!
  * \brief Constructor
@@ -265,7 +265,7 @@ void LightApp_Operation::setDialogActive( const bool active )
     if( active )
     {
       activateSelection();
-      dlg()->setActiveWindow();
+      dlg()->activateWindow();
     }
   }
 }
index 8afcda91a0c8fe0cd78785a6017c50343fd3ad42..c48787502dfe65e8bf51242d03ad6f19ad0725e9 100755 (executable)
@@ -1,26 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : LightApp_Operation.h
 //  Author : Sergey LITONIN
 //  Module : LIGHT
-
-
+//
 #ifndef LightApp_Operation_H
 #define LightApp_Operation_H
 
@@ -28,8 +30,6 @@
 #include <SUIT_Operation.h>
 
 class LightApp_Module;
-class LightApp_Application;
-class LightApp_Operation;
 class LightApp_SelectionMgr;
 class LightApp_Dialog;
 class SUIT_Desktop;
diff --git a/src/LightApp/LightApp_Plot2dSelector.cxx b/src/LightApp/LightApp_Plot2dSelector.cxx
new file mode 100755 (executable)
index 0000000..9efc836
--- /dev/null
@@ -0,0 +1,68 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "LightApp_Plot2dSelector.h"
+
+#include "LightApp_DataOwner.h"
+#include "LightApp_DataObject.h"
+#include "LightApp_Application.h"
+
+/*!
+  Constructor
+*/
+LightApp_Plot2dSelector::LightApp_Plot2dSelector( SPlot2d_Viewer* v, SUIT_SelectionMgr* mgr )
+: SUIT_Selector( mgr, v )
+{
+  if ( v )
+    connect( v, SIGNAL( legendSelected( const QString& ) ), this, SLOT( onSelectionChanged( const QString& ) ) );
+}
+
+/*!
+  Destructor
+*/
+LightApp_Plot2dSelector::~LightApp_Plot2dSelector()
+{
+}
+
+/*!
+  Gets selection.
+*/
+void LightApp_Plot2dSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
+{
+  if( !myCurEntry.isNull() )
+    theList.append( new LightApp_DataOwner( myCurEntry ) );
+}
+
+/*!Sets selection.*/
+void LightApp_Plot2dSelector::setSelection( const SUIT_DataOwnerPtrList& theList )
+{
+  /*  if( theList.count()>0 )
+    myCurEntry = theList.first()->getEntry();
+  else*/
+  myCurEntry = QString::null;
+}
+
+/*!On selection changed.*/
+void LightApp_Plot2dSelector::onSelectionChanged( const QString& entry )
+{
+  myCurEntry = entry;
+  selectionChanged();
+}
diff --git a/src/LightApp/LightApp_Plot2dSelector.h b/src/LightApp/LightApp_Plot2dSelector.h
new file mode 100755 (executable)
index 0000000..b9ba299
--- /dev/null
@@ -0,0 +1,59 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef LIGHTAPP_PLOT2DSELECTOR_H
+#define LIGHTAPP_PLOT2DSELECTOR_H
+
+#include "LightApp.h"
+
+#include <SUIT_Selector.h>
+#include <SUIT_DataOwner.h>
+#include <SPlot2d_ViewModel.h>
+
+class LightApp_DataObject;
+
+/*!
+  \class LightApp_Plot2dSelector
+  Custom selector to get/set selection from object browser
+*/
+class LIGHTAPP_EXPORT LightApp_Plot2dSelector : public QObject, public SUIT_Selector
+{
+  Q_OBJECT
+
+public:
+  LightApp_Plot2dSelector( SPlot2d_Viewer*, SUIT_SelectionMgr* );
+  virtual ~LightApp_Plot2dSelector();
+
+  /*!Return "ObjectBrowser"*/
+  virtual QString type() const { return "PLot2dViewer"; }
+
+private slots:
+  void         onSelectionChanged( const QString& );
+
+protected:
+  virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
+  virtual void setSelection( const SUIT_DataOwnerPtrList& );
+
+private:
+  QString myCurEntry;
+};
+
+#endif
index 65a7ef490f1b8c8d9e747cbc51d88eaf8ae30d02..c97e2d6de68d2cc5d5c35fb90ac11304bfdd8309 100644 (file)
@@ -1,35 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_Preferences.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "LightApp_Preferences.h"
 
-#include <QtxListResourceEdit.h>
-
-#include <qlayout.h>
-
 /*!
   Constructor.Initialize by resource manager and parent QWidget.
 */
 LightApp_Preferences::LightApp_Preferences( QtxResourceMgr* resMgr, QWidget* parent )
-: QtxListResourceEdit( resMgr, parent )
+: SUIT_PreferenceMgr( resMgr, parent )
 {
 }
 
@@ -46,7 +45,7 @@ LightApp_Preferences::~LightApp_Preferences()
 int LightApp_Preferences::addPreference( const QString& label, const int pId, const int type,
                                          const QString& section, const QString& param )
 {
-  return addItem( label, pId, type, section, param );
+  return addItem( label, pId, (SUIT_PreferenceMgr::PrefItemType)type, section, param );
 }
 
 /*!
@@ -55,7 +54,7 @@ int LightApp_Preferences::addPreference( const QString& label, const int pId, co
 int LightApp_Preferences::addPreference( const QString& mod, const QString& label, const int pId,
                                          const int type, const QString& section, const QString& param )
 {
-  int id = addItem( label, pId, type, section, param );
+  int id = addItem( label, pId, (SUIT_PreferenceMgr::PrefItemType)type, section, param );
   if ( id != -1 && !mod.isEmpty() )
     myPrefMod.insert( id, mod );
   return id;
@@ -68,10 +67,21 @@ bool LightApp_Preferences::hasModule( const QString& mod ) const
 {
   bool res = false;
   for ( PrefModuleMap::ConstIterator it = myPrefMod.begin(); it != myPrefMod.end() && !res; ++it )
-    res = it.data() == mod;
+    res = it.value() == mod;
   return res;
 }
 
+void LightApp_Preferences::activateItem( const QString& mod ) const
+{
+  QtxPreferenceItem* item = findItem( mod, true );
+
+  if ( !item )
+    return;
+
+  item->ensureVisible();
+  item->activate();
+}
+
 /*!Do nothing.*/
 void LightApp_Preferences::onHelp()
 {
@@ -84,9 +94,10 @@ void LightApp_Preferences::onApply()
 }
 
 /*!Emit preference changed.*/
-void LightApp_Preferences::changedResources( const QMap<Item*, QString>& map )
+void LightApp_Preferences::changedResources( const ResourceMap& map )
 {
-  for ( QMap<Item*, QString>::ConstIterator it = map.begin(); it != map.end(); ++it )
+  for ( ResourceMap::ConstIterator it = map.begin(); 
+       it != map.end(); ++it )
   {
     QString sec, param;
     it.key()->resource( sec, param );
index f3d791986fed729525f384f3018c00f625c7e161..8ab8fbd82a0c58c9dd5274e4d961329d316abe25 100644 (file)
@@ -1,33 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_Preferences.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef LIGHTAPP_PREFERENCES_H
 #define LIGHTAPP_PREFERENCES_H
 
-#include <LightApp.h>
-
-#include <QtxDialog.h>
-#include <QtxListResourceEdit.h>
+#include "LightApp.h"
+#include <SUIT_PreferenceMgr.h>
 
-#include <qmap.h>
+#include <QMap>
 
 class QtxResourceMgr;
 
@@ -36,7 +37,7 @@ class QtxResourceMgr;
   Custom preference container. Assign each preference category with module.
   Emits signal on preference changing
 */
-class LIGHTAPP_EXPORT LightApp_Preferences : public QtxListResourceEdit
+class LIGHTAPP_EXPORT LightApp_Preferences : public SUIT_PreferenceMgr
 {
   Q_OBJECT
 
@@ -44,20 +45,24 @@ public:
   LightApp_Preferences( QtxResourceMgr*, QWidget* = 0 );
   virtual ~LightApp_Preferences();
 
-  int                  addPreference( const QString& label, const int pId = -1, const int = -1,
-                                      const QString& section = QString::null, const QString& param = QString::null );
-  int                  addPreference( const QString& modName, const QString& label, const int pId = -1, const int = -1,
-                                      const QString& section = QString::null, const QString& param = QString::null );
+  int                  addPreference( const QString& label,const int pId = -1, const int = Auto,
+                                      const QString& section = QString(), const QString& param = QString() );
+  int                  addPreference( const QString& modName, const QString& label, const int pId = -1, const int = Auto,
+                                      const QString& section = QString(), const QString& param = QString() );
 
   bool                 hasModule( const QString& ) const;
 
+  void                 activateItem( const QString& ) const;
+
+protected:
+  void                 changedResources( const ResourceMap& );
+
 signals:
   void                 preferenceChanged( QString&, QString&, QString& );
 
 private slots:
   void                 onHelp();
   void                 onApply();
-  virtual void         changedResources( const QMap<Item*, QString>& );
 
 private:
   QString              module( const int ) const;
index b691eb459d2246572520efbf658791aec1624e15..748d42b54bbf60b000aa6ca35d5fcdb7f3feedaa 100644 (file)
@@ -1,52 +1,55 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_PreferencesDlg.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "LightApp_PreferencesDlg.h"
 #include "LightApp_Preferences.h"
 
 #include "QtxResourceMgr.h"
 
-#include <qbutton.h>
-#include <qlayout.h>
-#include <qmessagebox.h>
-#include <qvbox.h>
-#include <qfiledialog.h>
+#include <SUIT_MessageBox.h>
+
+#include <QAbstractButton>
+#include <QVBoxLayout>
+#include <QFileDialog>
 
 /*!
   Constructor.
 */
 LightApp_PreferencesDlg::LightApp_PreferencesDlg( LightApp_Preferences* prefs, QWidget* parent )
-: QtxDialog( parent, 0, true, true, OK | Close | Apply ),
+: QtxDialog( parent, true, true, OK | Close | Apply ),
 myPrefs( prefs ), mySaved ( false )
 {
-  setCaption( tr( "CAPTION" ) );
-
-  QVBoxLayout* main = new QVBoxLayout( mainFrame(), 5 );
-
-  QVBox* base = new QVBox( mainFrame() );
-  main->addWidget( base );
+  setWindowTitle( tr( "CAPTION" ) );
 
-  myPrefs->reparent( base, QPoint( 0, 0 ), true );
+  QVBoxLayout* main = new QVBoxLayout( mainFrame() );
+  main->setMargin( 0 );
+  main->setSpacing( 5 );
+  main->addWidget( myPrefs );
 
   setFocusProxy( myPrefs );
+  myPrefs->setFrameStyle( QFrame::Box | QFrame::Sunken );
+  myPrefs->show();
 
   setButtonPosition( Right, Close );
 
@@ -55,10 +58,10 @@ myPrefs( prefs ), mySaved ( false )
   connect( this, SIGNAL( dlgHelp() ),  this, SLOT( onHelp() ) );
   connect( this, SIGNAL( dlgApply() ), this, SLOT( onApply() ) );
 
-  QButton* defBtn = userButton( insertButton( tr( "DEFAULT_BTN_TEXT" ) ) );
+  QAbstractButton* defBtn = userButton( insertButton( tr( "DEFAULT_BTN_TEXT" ) ) );
   if ( defBtn )
     connect( defBtn, SIGNAL( clicked() ), this, SLOT( onDefault() ) );
-  QButton* impBtn = userButton( insertButton( tr( "IMPORT_BTN_TEXT" ) ) );
+  QAbstractButton* impBtn = userButton( insertButton( tr( "IMPORT_BTN_TEXT" ) ) );
   if( impBtn )
     connect( impBtn, SIGNAL( clicked() ), this, SLOT( onImportPref() ) );
 }
@@ -71,17 +74,21 @@ LightApp_PreferencesDlg::~LightApp_PreferencesDlg()
   if ( !myPrefs )
     return;
 
-  myPrefs->reparent( 0, QPoint( 0, 0 ), false );
+  mainFrame()->layout()->removeWidget( myPrefs );
+  myPrefs->setParent( 0 );
+  myPrefs->hide();
   myPrefs = 0;
 }
 
-/*!Show dialog.*/
-void LightApp_PreferencesDlg::show()
+/*!Show/hide dialog.*/
+void LightApp_PreferencesDlg::setVisible(bool visible)
 {
-  myPrefs->retrieve();
-  myPrefs->toBackup();
+  if ( visible ) {
+    myPrefs->retrieve();
+    myPrefs->toBackup();
+  }
 
-  QtxDialog::show();
+  QtxDialog::setVisible(visible);
 }
 
 /*!Store preferences on accept.*/
@@ -110,13 +117,13 @@ void LightApp_PreferencesDlg::onHelp()
 void LightApp_PreferencesDlg::onApply()
 {
   myPrefs->store();
-  
+
   // Fix for Bug PAL11197: Restoring the corrected values from resource manager.
   // (Correcting in VisuGUI.cxx and SMESHGUI.cxx in methods
   // ::preferencesChanged( const QString& sect, const QString& name ))
   myPrefs->retrieve();
   //
-  
+
   myPrefs->toBackup();
   mySaved = true;
 }
@@ -124,15 +131,17 @@ void LightApp_PreferencesDlg::onApply()
 /*! Restore default preferences*/
 void LightApp_PreferencesDlg::onDefault()
 {
-  if( QMessageBox::Ok == QMessageBox::information( this, tr( "WARNING" ), tr( "DEFAULT_QUESTION" ), QMessageBox::Ok, QMessageBox::Cancel ) )
+  if( SUIT_MessageBox::Ok == SUIT_MessageBox::question( this, tr( "WARNING" ), tr( "DEFAULT_QUESTION" ),
+                                                       SUIT_MessageBox::Ok | SUIT_MessageBox::Cancel,
+                                                       SUIT_MessageBox::Ok ) )
     {
       if ( myPrefs && myPrefs->resourceMgr() )
        {
-          bool prev = myPrefs->resourceMgr()->ignoreUserValues();
-         myPrefs->resourceMgr()->setIgnoreUserValues( true ); 
+          QtxResourceMgr::WorkingMode prev = myPrefs->resourceMgr()->workingMode();
+         myPrefs->resourceMgr()->setWorkingMode( QtxResourceMgr::IgnoreUserValues );
          myPrefs->retrieve();
-          myPrefs->resourceMgr()->setIgnoreUserValues( prev );
-       }      
+          myPrefs->resourceMgr()->setWorkingMode( prev );
+       }
     }
 }
 
@@ -143,14 +152,16 @@ void LightApp_PreferencesDlg::onImportPref()
   if( !mgr )
     return;
 
-  QFileDialog dlg( ".", "*", this, "" );
-  dlg.setCaption( tr("IMPORT_PREFERENCES") );
-  dlg.setShowHiddenFiles( true );
+  QFileDialog dlg( this, tr("IMPORT_PREFERENCES"), ".", "*" );
+  dlg.setObjectName( "" );
+  //dlg.setShowHiddenFiles( true );
   dlg.exec();
-  QString fname = dlg.selectedFile();
-  if( fname.isEmpty() )
+
+  QStringList files = dlg.selectedFiles();
+  if ( files.isEmpty() )
     return;
 
+  QString fname = files[0];
   if( mgr->import( fname ) )
   {
     myPrefs->retrieve();
index 4c7f20f305ddc50d5a334e74b5c7b55db8bfd4de..64299c97210927ed1ea2bee21ae784a4a941308e 100644 (file)
@@ -1,28 +1,31 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      LightApp_PreferencesDlg.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef LIGHTAPP_PREFERENCESDLG_H
 #define LIGHTAPP_PREFERENCESDLG_H
 
-#include <LightApp.h>
+#include "LightApp.h"
 
 #include <QtxDialog.h>
 
@@ -40,7 +43,7 @@ public:
   LightApp_PreferencesDlg( LightApp_Preferences*, QWidget* = 0 );
   virtual ~LightApp_PreferencesDlg();
 
-  virtual void          show();
+  virtual void          setVisible(bool visible);
   virtual void          accept();
   virtual void          reject();
 
diff --git a/src/LightApp/LightApp_RootObject.h b/src/LightApp/LightApp_RootObject.h
deleted file mode 100644 (file)
index 1c1543a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef LIGHTAPP_ROOTOBJECT_H
-#define LIGHTAPP_ROOTOBJECT_H
-
-#include "LightApp.h"
-#include "SUIT_DataObject.h"
-
-class LightApp_Study;
-
-/*!
-  LightApp_RootObject - class to be instanciated by only one object - 
-  root object of LightApp data object tree.  This object is not shown
-  in object browser (invisible), so it has no re-definition of name(), icon(),
-  etc. methods.  The goal of this class is to provide a unified access
-  to LightApp_Study object from LightApp_DataObject instances.
-*/
-class LIGHTAPP_EXPORT LightApp_RootObject : public SUIT_DataObject
-{
-public:
-  LightApp_RootObject( LightApp_Study* study )
-   : myStudy( study ) 
-  {}
-
-  virtual ~LightApp_RootObject() {}
-    
-  void                   setStudy( LightApp_Study* study ) { myStudy = study; }
-  LightApp_Study*        study() const                     { return myStudy;  } 
-  
-private:
-  LightApp_Study*            myStudy;
-
-};
-
-#endif
index 4b7e58ae5b76ff40fe25c1edce183fdf147137ea..09fab94d7b1f69f99ea10dbddd34eb319a0fafa1 100644 (file)
@@ -1,22 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "LightApp_Selection.h"
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_DataOwner.h"
 #include "LightApp_Application.h"
 #include "LightApp_Displayer.h"
 
+#include "CAM_Module.h"
+
 #include "SUIT_Session.h"
 #include "SUIT_ViewWindow.h"
+#include "SUIT_ViewManager.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_Selector.h"
 
 /*!
   Constructor
@@ -48,7 +55,6 @@ LightApp_Selection::~LightApp_Selection()
 void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr)
 {
   myPopupClient = client;
-  myStudy = 0;
   
   if( mgr )
   {
@@ -62,11 +68,12 @@ void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr
     mgr->selected( sel, client );
 
     //2) to take such owners from other popup clients that it's entry is different with every entry from current list
-    QPtrList<SUIT_Selector> aSelectors;
+    QList<SUIT_Selector*> aSelectors;
     mgr->selectors( aSelectors );
-    for( SUIT_Selector* selector = aSelectors.first(); selector; selector = aSelectors.next() )
+    QListIterator<SUIT_Selector*> it( aSelectors );
+    while ( it.hasNext() )
     {
-      qDebug( selector->type() );
+      SUIT_Selector* selector = it.next();
       if( selector->type() != client && selector->isEnabled() )
       {
        //mgr->selected( cur_sel, selector->type() );
@@ -115,17 +122,17 @@ int LightApp_Selection::count() const
 }
 
 /*!
-  Gets QtxValue();
+  Gets QVariant();
 */
-QtxValue LightApp_Selection::param( const int ind, const QString& p ) const
+QVariant LightApp_Selection::parameter( const int ind, const QString& p ) const
 {
   LightApp_Application* app = dynamic_cast<LightApp_Application*>( myStudy ? myStudy->application() : 0 );
   if( !( ind>=0 && ind<count() ) || !app )
-    return QtxValue();
+    return QVariant();
 
   if( p=="isVisible" )
   {
-    QString mod_name = app->moduleTitle( param( ind, "component" ).toString() );
+    QString mod_name = app->moduleTitle( parameter( ind, "component" ).toString() );
     LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, false );
     // false in last parameter means that now we doesn't load module, if it isn't loaded
 
@@ -137,7 +144,7 @@ QtxValue LightApp_Selection::param( const int ind, const QString& p ) const
       LightApp_Displayer local_d;
       vis = local_d.IsDisplayed( myEntries[ ind ] );
     }
-    return QtxValue( vis, 0 );
+    return QVariant( vis );
   }
 
   else if( p=="component" )
@@ -147,18 +154,18 @@ QtxValue LightApp_Selection::param( const int ind, const QString& p ) const
   
   else if( p=="isComponent" )
   {
-    return QtxValue( myStudy->isComponent( myEntries[ ind ] ), 0 );
+    return QVariant( myStudy->isComponent( myEntries[ ind ] ) );
   }
 
   else if( p=="isReference" )
-    return QtxValue( isReference( ind ), false );
+    return QVariant( isReference( ind ) );
 
   else if( p=="displayer" )
-    return param( ind, "component" );
+    return parameter( ind, "component" );
 
   else if( p=="canBeDisplayed" )
   {
-    QString mod_name = app->moduleTitle( param( ind, "component" ).toString() );
+    QString mod_name = app->moduleTitle( parameter( ind, "component" ).toString() );
     LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, false );
     // false in last parameter means that now we doesn't load module, if it isn't loaded
 
@@ -172,32 +179,28 @@ QtxValue LightApp_Selection::param( const int ind, const QString& p ) const
     //operations under object
   }
 
-  return QtxValue();
+  return QVariant();
 }
 
 /*!
   Gets global parameters. client, isActiveView, activeView etc.
 */
-QtxValue LightApp_Selection::globalParam( const QString& p ) const
+QVariant LightApp_Selection::parameter( const QString& p ) const
 {
-  if      ( p == "client" )        return QtxValue( myPopupClient );
+  if      ( p == "client" )        return QVariant( myPopupClient );
   else if ( p == "activeModule" )
   {
     LightApp_Application* app = dynamic_cast<LightApp_Application*>( myStudy->application() );
-    QString mod_name = app ? QString( app->activeModule()->name() ) : QString::null;
+    QString mod_name = app ? QString( app->activeModule()->name() ) : QString();
     //cout << "activeModule : " << mod_name.latin1() << endl;
     if( !mod_name.isEmpty() )
       return mod_name;
     else
-      return QtxValue();
+      return QVariant();
   }
-  else if ( p == "isActiveView" )  return QtxValue( (bool)activeVW() );
-  else if ( p == "activeView" )    return QtxValue( activeViewType() );
-#ifndef WNT
-  else                             return QtxPopupMgr::Selection::globalParam( p );
-#else
-  else                             return Selection::globalParam( p );
-#endif
+  else if ( p == "isActiveView" )  return QVariant( (bool)activeVW() );
+  else if ( p == "activeView" )    return QVariant( activeViewType() );
+  else                             return QtxPopupSelection::parameter( p );
 }
 
 /*!
@@ -239,7 +242,7 @@ QString LightApp_Selection::activeViewType() const
     if ( vm )
       return vm->getType();
   }
-  return QString::null;
+  return QString();
 }
 
 /*!
index 7756a767dac82409fb1fef835018febf4e55981f..4642a87935d363bf48dd5c44eb84cba25b591416 100644 (file)
@@ -1,6 +1,6 @@
-//  LightApp_Selection
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  LightApp_Selection
 //  File   : LightApp_Selection.h
 //  Author : Alexander SOLOVYOV
 //  Module : GUI
 //  $Header$
-
+//
 #ifndef LIGHTAPP_SELECTION_HeaderFile
 #define LIGHTAPP_SELECTION_HeaderFile
 
@@ -44,7 +43,7 @@ class SUIT_ViewWindow;
   It is able to return values of standard object properties
   (isVisible,isComponent,canBeDisplayed,isReference, etc)
 */
-class LIGHTAPP_EXPORT LightApp_Selection : public QtxPopupMgr::Selection
+class LIGHTAPP_EXPORT LightApp_Selection : public QtxPopupSelection
 {
 public:
   LightApp_Selection();
@@ -54,8 +53,8 @@ public:
   virtual void                   processOwner( const LightApp_DataOwner* );
 
   virtual int                    count() const;
-  virtual QtxValue               param( const int, const QString& ) const;
-  virtual QtxValue               globalParam( const QString& ) const;
+  virtual QVariant               parameter( const int, const QString& ) const;
+  virtual QVariant               parameter( const QString& ) const;
   void                           setModuleName( const QString );
 
 protected:
index 1c9e38b863014c129327abe176660f6d2a9de163..1c389db587140e717e61193094b40908e9a6ca5c 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "LightApp_SelectionMgr.h"
 
@@ -33,6 +36,7 @@
   #include <TColStd_MapOfInteger.hxx>
   #include <TColStd_MapIteratorOfMapOfInteger.hxx>
   #include <TColStd_IndexedMapOfInteger.hxx>
+  #include <TCollection_AsciiString.hxx>
 #endif
 
 /*!
@@ -95,7 +99,7 @@ void LightApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, const QStri
       if ( !entryMap.contains( checkEntry ) ) {
         if ( refEntry != entry ) {
           QString component = study->componentDataType( refEntry );
-          theList.Append( new SALOME_InteractiveObject( refEntry, component, ""/*refobj->Name().c_str()*/ ) );
+          theList.Append( new SALOME_InteractiveObject( refEntry.toLatin1().constData(), component.toLatin1().constData(), ""/*refobj->Name().c_str()*/ ) );
         }
         else if( !owner->IO().IsNull() )
           theList.Append( owner->IO() );
@@ -218,12 +222,12 @@ void LightApp_SelectionMgr::AddOrRemoveIndex( const Handle(SALOME_InteractiveObj
                                               bool modeShift)
 {
   SUIT_DataOwnerPtrList remainsOwners;
-
+  
   SUIT_DataOwnerPtrList aList;
   selected( aList );
-
+  
   QString ioEntry (IObject->getEntry());
-
+  
   if ( !modeShift ) {
     for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
     {
@@ -248,7 +252,7 @@ void LightApp_SelectionMgr::AddOrRemoveIndex( const Handle(SALOME_InteractiveObj
   It.Initialize(theIndexes);
   for(;It.More();It.Next())
     remainsOwners.append( new LightApp_DataSubOwner( ioEntry, It.Key() ) );
-
+  
   bool append = false;
   setSelected( remainsOwners, append );
 
@@ -288,16 +292,16 @@ void LightApp_SelectionMgr::selectObjects( MapIOOfMapOfInteger theMapIO, bool ap
 {
   SUIT_DataOwnerPtrList aList;
 
-  MapIOOfMapOfInteger::Iterator it;
-  for ( it = theMapIO.begin(); it != theMapIO.end(); ++it ) 
+  MapIOOfMapOfInteger::Iterator it(theMapIO);
+  for ( ; it.More(); it.Next() ) 
     {
-      if ( it.data().IsEmpty() )
-       aList.append( new LightApp_DataOwner( QString(it.key()->getEntry()) ) );
+      if ( it.Value().IsEmpty() )
+       aList.append( new LightApp_DataOwner( QString(it.Key()->getEntry()) ) );
       else
        {
          int i;
-         for ( i = 1; i <= it.data().Extent(); i++ )
-           aList.append( new LightApp_DataSubOwner( QString(it.key()->getEntry()), it.data()( i ) ) );
+         for ( i = 1; i <= it.Value().Extent(); i++ )
+           aList.append( new LightApp_DataSubOwner( QString(it.Key()->getEntry()), it.Value()( i ) ) );
        }
     }
   
@@ -310,7 +314,7 @@ void LightApp_SelectionMgr::selectObjects( MapIOOfMapOfInteger theMapIO, bool ap
 */
 void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap )
 {
-  theMap.clear();
+  theMap.Clear();
 
   TColStd_IndexedMapOfInteger anIndexes;
 
@@ -323,7 +327,11 @@ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap )
       dynamic_cast<const LightApp_DataSubOwner*>( (*itr).operator->() );
     if ( subOwner ) 
     {
-      if ( !theMap.contains( subOwner->entry() ) )
+#ifndef WNT
+      if ( !theMap.IsBound( TCollection_AsciiString(subOwner->entry().toLatin1().data()) ) )
+#else
+      if ( !theMap.IsBound( subOwner->entry().toLatin1().data() ) )
+#endif
       {
        anIndexes.Clear();
        //Bug 17269: GetIndexes( subOwner->entry(), anIndexes );
@@ -337,7 +345,7 @@ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap )
               anIndexes.Add( subOwner2->index() );
         }
         //
-        theMap.insert( subOwner->entry(), anIndexes );
+       theMap.Bind( subOwner->entry().toLatin1().data(), anIndexes );
       }
     }
   }
index d865cac156ba7b4feafd40b41d5b99a898e8f1d9..57a4efbe79654d96932fe80f6171d543f9b44cab 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef LIGHTAPP_SELECTIONMGR_H
 #define LIGHTAPP_SELECTIONMGR_H
 
 #ifndef DISABLE_SALOMEOBJECT
   #include <SALOME_InteractiveObject.hxx>
-  #include <qmap.h>
+  #include <QMap>
+  #include <NCollection_DataMap.hxx>
 
   class SALOME_ListIO;
   class TColStd_IndexedMapOfInteger;
   class TColStd_MapOfInteger;
+  class TCollection_AsciiString;
 #else
-#include <qstringlist.h>
+#include <QStringList>
 #endif
 
 class LightApp_Application;
@@ -51,10 +56,10 @@ public:
   LightApp_Application* application() const;
 
 #ifndef DISABLE_SALOMEOBJECT
-  typedef QMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
-  typedef QMap< QString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
+  typedef NCollection_DataMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
+  typedef NCollection_DataMap< TCollection_AsciiString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
 
-  void                   selectedObjects( SALOME_ListIO&, const QString& = QString::null, const bool = true ) const;
+  void                   selectedObjects( SALOME_ListIO&, const QString& = QString(), const bool = true ) const;
   void                   setSelectedObjects( const SALOME_ListIO&, const bool = false );
 
   void                   GetIndexes( const Handle(SALOME_InteractiveObject)& IObject, 
@@ -73,7 +78,7 @@ public:
 
   void                   selectedSubOwners( MapEntryOfMapOfInteger& theMap );
 #else
-  void                   selectedObjects( QStringList&, const QString& = QString::null, const bool = true ) const;
+  void                   selectedObjects( QStringList&, const QString& = QString(), const bool = true ) const;
 #endif
 
 signals:
index 657e30d9d16f9beef26f253f8a642b371a81f377..e6cefd5c01bc2c85172685669a80a40091634b05 100644 (file)
@@ -1,29 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "LightApp_ShowHideOp.h"
 #include "LightApp_Application.h"
-#include "LightApp_DataOwner.h"
 #include "LightApp_Module.h"
 #include "LightApp_Study.h"
 #include "LightApp_Displayer.h"
-#include "CAM_Study.h"
 
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_Selection.h"
@@ -81,7 +81,7 @@ void LightApp_ShowHideOp::startOperation()
   QString mod_name;
   if( sel->count()>0 )
   {
-    QString aStr =  sel->param( 0, "displayer" ).toString();
+    QString aStr =  sel->parameter( 0, "displayer" ).toString();
     mod_name = app->moduleTitle( aStr );
   }
   else if( app->activeModule() )
@@ -152,6 +152,4 @@ void LightApp_ShowHideOp::startOperation()
   }
   d->UpdateViewer();
   commit();
-
-  delete sel;
 }
index 687c16dd244193beca20fe66ae57a9d44edc048a..3e4958115628216232a0cee0997ac43e050cc80b 100644 (file)
@@ -1,29 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef LIGHTAPP_SHOW_HIDE_OPERATION_HEADER
 #define LIGHTAPP_SHOW_HIDE_OPERATION_HEADER
 
 #include "LightApp_Operation.h"
 
-class LightApp_Displayer;
-
 /*!
   \class LightApp_ShowHideOp
   Standard operation allowing to show/hide selected objects
index a37df3ba78954f0eeea3dc5bab8f9a29561a8cbe..e0356bcf83becda5914da2d56ad362c1ce6b092d 100644 (file)
@@ -1,48 +1,38 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "LightApp_Study.h"
 
 #include "CAM_DataModel.h"
+#include "CAM_Module.h"
 #include "LightApp_Application.h"
 #include "LightApp_DataModel.h"
 #include "LightApp_DataObject.h"
-#include "LightApp_RootObject.h"
 #include "LightApp_HDFDriver.h"
 
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_DataObjectIterator.h"
 
-#include <OB_Browser.h>
-
-#include <TCollection_AsciiString.hxx> 
-
-#include <OSD_Path.hxx>
-#include <OSD_File.hxx>
-#include <OSD_Directory.hxx>
-#include <OSD_Process.hxx>
-#include <OSD_Directory.hxx>
-#include <OSD_Protection.hxx>
-#include <OSD_SingleProtection.hxx>
-#include <OSD_FileIterator.hxx>
-
 #include <set>
-#include <qstring.h>
+#include <QString>
 
 /*!
   Constructor.
@@ -65,16 +55,18 @@ LightApp_Study::~LightApp_Study()
 /*!
   Create document.
 */
-void LightApp_Study::createDocument()
+bool LightApp_Study::createDocument( const QString& theStr )
 {
   setStudyName( QString( "Study%1" ).arg( LightApp_Application::studyId() ) );
 
   // create myRoot
   setRoot( new LightApp_RootObject( this ) );
 
-  CAM_Study::createDocument();
+  bool aRet = CAM_Study::createDocument( theStr );
 
   emit created( this );
+
+  return aRet;
 }
 
 /*!
@@ -92,8 +84,9 @@ bool LightApp_Study::openDocument( const QString& theFileName )
   // update loaded data models: call open() and update() on them.
   ModelList dm_s;
   dataModels( dm_s );
-  for ( ModelListIterator it( dm_s ); it.current(); ++it )
-    openDataModel( studyName(), it.current() );
+  QListIterator<CAM_DataModel*> it( dm_s );
+  while ( it.hasNext() )
+    openDataModel( studyName(), it.next() );
   // this will build a SUIT_DataObject-s tree under myRoot member field
   // passing "false" in order NOT to rebuild existing data models' trees - it was done in previous step
   // but tree that corresponds to not-loaded data models will be updated any way. 
@@ -122,8 +115,9 @@ bool LightApp_Study::loadDocument( const QString& theStudyName )
   ModelList dm_s;
   dataModels( dm_s );
 
-  for ( ModelListIterator it( dm_s ); it.current(); ++it )
-    openDataModel( studyName(), it.current() );
+  QListIterator<CAM_DataModel*> it( dm_s );
+  while ( it.hasNext() )
+    openDataModel( studyName(), it.next() );
 
   // this will build a SUIT_DataObject-s tree under myRoot member field
   // passing "false" in order NOT to rebuild existing data models' trees - it was done in previous step
@@ -148,13 +142,15 @@ bool LightApp_Study::saveDocumentAs( const QString& theFileName )
   ModelList list; 
   dataModels( list );
 
-  LightApp_DataModel* aModel = (LightApp_DataModel*)list.first();
-
   QStringList listOfFiles;
   bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
-  for ( ; aModel; aModel = (LightApp_DataModel*)list.next() ) 
+  QListIterator<CAM_DataModel*> itList( list );
+  while ( itList.hasNext() )
   {
-    std::vector<std::string> anOldList = myDriver->GetListOfFiles( aModel->module()->name() );
+    LightApp_DataModel* aModel = (LightApp_DataModel*)itList.next();
+    if ( !aModel ) continue;
+
+    std::vector<std::string> anOldList = myDriver->GetListOfFiles( aModel->module()->name().toLatin1().constData() );
     listOfFiles.clear();
     aModel->saveAs( theFileName, this, listOfFiles );
     if ( !listOfFiles.isEmpty() )
@@ -165,7 +161,7 @@ bool LightApp_Study::saveDocumentAs( const QString& theFileName )
     // removing previous temporary files. These files are not removed before saving
     // because they may be required for it.
 
-    std::vector<std::string> aNewList = myDriver->GetListOfFiles( aModel->module()->name() );
+    std::vector<std::string> aNewList = myDriver->GetListOfFiles( aModel->module()->name().toLatin1().constData() );
     
     std::set<std::string> aNewNames;
     std::set<std::string> toRemove;
@@ -205,11 +201,13 @@ bool LightApp_Study::saveDocument()
 {
   ModelList list; dataModels( list );
 
-  LightApp_DataModel* aModel = (LightApp_DataModel*)list.first();
-
   myDriver->ClearDriverContents();
   QStringList listOfFiles;
-  for ( ; aModel; aModel = (LightApp_DataModel*)list.next() ) {
+  QListIterator<CAM_DataModel*> itList( list );
+  while ( itList.hasNext() ) {
+    LightApp_DataModel* aModel = (LightApp_DataModel*)itList.next();
+    if ( !aModel ) continue;
+
     listOfFiles.clear();
     aModel->save( listOfFiles );
     saveModuleData(aModel->module()->name(), listOfFiles);
@@ -298,8 +296,9 @@ bool LightApp_Study::isModified() const
   ModelList list; dataModels( list );
 
   LightApp_DataModel* aModel = 0;
-  for ( QPtrListIterator<CAM_DataModel> it( list ); it.current() && !isAnyChanged; ++it ){
-    aModel = dynamic_cast<LightApp_DataModel*>( it.current() );
+  QListIterator<CAM_DataModel*> it( list );
+  while ( it.hasNext() && !isAnyChanged ) {
+    aModel = dynamic_cast<LightApp_DataModel*>( it.next() );
     if ( aModel )
       isAnyChanged = aModel->isModified();
   }
@@ -335,10 +334,10 @@ void LightApp_Study::saveModuleData(QString theModuleName, QStringList theListOf
   for ( QStringList::Iterator it = theListOfFiles.begin(); it != theListOfFiles.end(); ++it ) {
     if ( (*it).isEmpty() )
       continue;
-    aListOfFiles[anIndex] = (*it).latin1();
+    aListOfFiles[anIndex] = (*it).toLatin1().constData();
     anIndex++;
   }
-  myDriver->SetListOfFiles(theModuleName, aListOfFiles);
+  myDriver->SetListOfFiles(theModuleName.toLatin1().constData(), aListOfFiles);
 }
 
 /*!
@@ -346,7 +345,7 @@ void LightApp_Study::saveModuleData(QString theModuleName, QStringList theListOf
 */
 void LightApp_Study::openModuleData(QString theModuleName, QStringList& theListOfFiles)
 {
-  std::vector<std::string> aListOfFiles =  myDriver->GetListOfFiles(theModuleName);
+  std::vector<std::string> aListOfFiles =  myDriver->GetListOfFiles(theModuleName.toLatin1().constData());
   int i, aLength = aListOfFiles.size() - 1;
   if (aLength < 0)
     return;
@@ -368,7 +367,7 @@ bool LightApp_Study::saveStudyData( const QString& theFileName )
     return false;
   bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
 
-  bool aRes = myDriver->SaveDatasInFile(theFileName.latin1(), isMultiFile);
+  bool aRes = myDriver->SaveDatasInFile(theFileName.toLatin1(), isMultiFile);
   return aRes;
 }
 
@@ -382,7 +381,7 @@ bool LightApp_Study::openStudyData( const QString& theFileName )
     return false;
   bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
 
-  bool aRes = myDriver->ReadDatasFromFile(theFileName.latin1(), isMultiFile);
+  bool aRes = myDriver->ReadDatasFromFile(theFileName.toLatin1(), isMultiFile);
   return aRes;
 }
 
index b9de680b812bf56e0ca6e0cd656b4c04a7c89e48..d47e7c0549a93db1274ce95b5ee0a529b2dda1b7 100644 (file)
@@ -1,34 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef LIGHTAPP_STUDY_H
 #define LIGHTAPP_STUDY_H
 
-#include <LightApp.h>
-#include <LightApp_Driver.h>
+#include "LightApp.h"
+#include "LightApp_Driver.h"
 
 #include <CAM_Study.h>
-#include <CAM_DataModel.h>
-#include <SUIT_Study.h>
 
 #include "string"
 #include "vector"
 
+class SUIT_Study;
 class SUIT_Application;
 class CAM_DataModel;
 
@@ -45,7 +47,7 @@ public:
   LightApp_Study( SUIT_Application* );
   virtual ~LightApp_Study();
 
-  virtual void        createDocument();
+  virtual bool        createDocument( const QString& );
   virtual bool        openDocument( const QString& );
   virtual bool        loadDocument( const QString& ); 
 
index 67283f365c1b8b1c017b634d69b693683831e192..69fcb3282fb62ec5b1b8439d50c6ca5d324f64a8 100755 (executable)
@@ -1,22 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "LightApp_SwitchOp.h"
 #include "LightApp_Module.h"
 #include "LightApp_Operation.h"
 #include <CAM_Application.h>
 #include <SUIT_Operation.h>
 #include <SUIT_Study.h>
-#include <qevent.h>
-#include <qwidget.h>
-#include <qptrlist.h>
-#include <qapplication.h>
+
+#include <QEvent>
+#include <QWidget>
+#include <QList>
+#include <QApplication>
 
 /*!
  * \brief Constructor
@@ -93,14 +96,16 @@ LightApp_Operation* LightApp_SwitchOp::operation( QWidget* theWg ) const
   // try to find operation corresponding to the dialog
   if ( aDlg != 0 && study() != 0 )
   {
-    QPtrListIterator<SUIT_Operation> anIter( study()->operations() );
-    while( SUIT_Operation* anOp = anIter.current() )
+    QListIterator<SUIT_Operation*> anIter( study()->operations() );
+    while( anIter.hasNext() )
     {
-      if ( anOp->inherits( "LightApp_Operation" ) &&
+      SUIT_Operation* anOp = anIter.next();
+          
+      if ( anOp &&
+          anOp->inherits( "LightApp_Operation" ) &&
            ((LightApp_Operation*)anOp)->dlg() == aDlg )
         return ((LightApp_Operation*)anOp);
-      ++anIter;
-   }
+    }
   }
 
   return 0;
index a85d2e3da01cea9452c4b799a0f751ee8bb645a0..004831d597f5ce14eef9af52d2d8f86b74278882 100755 (executable)
@@ -1,27 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef LightApp_SwitchOp_H
 #define LightApp_SwitchOp_H
 
 #include "LightApp.h"
-#include <qobject.h>
+#include <QObject>
 
 class LightApp_Module;
 class LightApp_Operation;
index b11103f76cdf64e94607e7e20cf4f3f385753785..d42e103811933bae4bcd9871cf4439873565ee87 100755 (executable)
@@ -1,26 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : LightApp_UpdateFlags.h
 //  Author : Sergey LITONIN
 //  Module : LIGHT
-
-
+//
 #ifndef LightApp_UpdateFlags_H
 #define LightApp_UpdateFlags_H
 
index 99214fb9f2dbfa3e0a892ca24837bdddf67442fc..3556c08123ee997fd3384aa3f41b5fc2b992c05b 100644 (file)
@@ -1,24 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "LightApp_VTKSelector.h"
 #include "LightApp_DataOwner.h"
 
+#include "SUIT_Desktop.h"
+
 #ifndef DISABLE_VTKVIEWER
   #include "SVTK_ViewModelBase.h"
   #include "SVTK_ViewManager.h"
@@ -224,7 +229,7 @@ LightApp_VTKSelector
              aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false);
            }else if(const LightApp_DataOwner* anOwner = dynamic_cast<const LightApp_DataOwner*>(aDataOwner)){
              Handle(SALOME_InteractiveObject) anIO = 
-               new SALOME_InteractiveObject(anOwner->entry().latin1(),"");
+               new SALOME_InteractiveObject(anOwner->entry().toLatin1(),"");
              aSelector->AddIObject(anIO);
              anAppendList.Append(anIO);
            }
@@ -243,7 +248,7 @@ LightApp_VTKSelector
          QMap< QString, Handle( SALOME_InteractiveObject )>::const_iterator RIt = toRemove.begin(),
                                                                             REnd = toRemove.end();
          for( ; RIt!=REnd; RIt++ )
-           aSelector->RemoveIObject( RIt.data() );
+           aSelector->RemoveIObject( RIt.value() );
          
          aView->onSelectionChanged();
        }
index 0f185cc53a6aa96fcad70337421c5d2d9c262c32..a9cc2b47591371218faef4fe2a17e4893be9fe54 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef LIGHTAPP_VTKSELECTOR_H
 #define LIGHTAPP_VTKSELECTOR_H
 #include "LightApp.h"
 #include "LightApp_DataOwner.h"
 
+#include <QObject>
+
 class SUIT_Desktop;
 
 #ifndef DISABLE_VTKVIEWER
-  #include <vtkSmartPointer.h>
   #include <TColStd_IndexedMapOfInteger.hxx>
   #include "SVTK_Selection.h"
 #ifndef DISABLE_SALOMEOBJECT
@@ -73,7 +77,7 @@ class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner
   \class LightApp_VTKSelector
   Custom selector to get/set selection from object browser
 */
-class LIGHTAPP_EXPORT LightApp_VTKSelector : public SUIT_Selector
+class LIGHTAPP_EXPORT LightApp_VTKSelector : public QObject, public SUIT_Selector
 {
   Q_OBJECT;
 
diff --git a/src/LightApp/LightApp_WidgetContainer.cxx b/src/LightApp/LightApp_WidgetContainer.cxx
deleted file mode 100644 (file)
index aa6f831..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "LightApp_WidgetContainer.h"
-
-#include <qobjectlist.h>
-#include <qwidgetstack.h>
-
-/*!
-  Constructor.
-*/
-LightApp_WidgetContainer::LightApp_WidgetContainer( const int type, QWidget* parent )
-: QDockWindow( QDockWindow::InDock, parent ),
-myType( type )
-{
-  setWidget( myStack = new QWidgetStack( this ) );
-  myStack->show();
-}
-
-/*!
-  Destructor.
-*/
-LightApp_WidgetContainer::~LightApp_WidgetContainer()
-{
-}
-
-/*!
-  Checks: is widget container is empty?
-*/
-bool LightApp_WidgetContainer::isEmpty() const
-{
-  const QObjectList* lst = myStack->children();
-  if ( !lst )
-    return true;
-
-  bool res = true;
-  for ( QObjectListIt it( *lst ); it.current() && res; ++it )
-  {
-    if ( it.current()->isWidgetType() && myStack->id( (QWidget*)it.current() ) != -1 )
-      res = false;
-  }
-  return res;
-}
-
-/*!
-  Gets type of widget container.
-*/
-int LightApp_WidgetContainer::type() const
-{
-  return myType;
-}
-
-/*!
-  Checks: is container contains widget with id \a id.
-*/
-bool LightApp_WidgetContainer::contains( const int id ) const
-{
-  return myStack->widget( id ) != 0;
-}
-
-/*!
- * Insert widget(\a wid with id \a id) to container.And return id of widget in stack.
- *\warning remove widget with id = \a id , if it was in container.
- */
-int LightApp_WidgetContainer::insert( const int id, QWidget* wid )
-{
-  if ( id == -1 || !wid )
-    return -1;
-
-  if ( contains( id ) )
-    remove( id );
-
-  int stackId = myStack->addWidget( wid, id );
-  if ( !myStack->visibleWidget() )
-    myStack->raiseWidget( wid );
-
-  setCaption( myStack->visibleWidget() ? myStack->visibleWidget()->caption() : QString::null );
-
-  return stackId;
-}
-
-/*!
-  Remove widget(\a wid) from stack.
-*/
-void LightApp_WidgetContainer::remove( const int id )
-{
-  remove( myStack->widget( id ) );
-
-  setCaption( myStack->visibleWidget() ? myStack->visibleWidget()->caption() : QString::null );
-}
-
-/*!
-  Remove widget(\a wid) from stack.
-*/
-void LightApp_WidgetContainer::remove( QWidget* wid )
-{
-  myStack->removeWidget( wid );
-
-  setCaption( myStack->visibleWidget() ? myStack->visibleWidget()->caption() : QString::null );
-}
-
-/*!
-  Raise widget with id = \a id.
-*/
-void LightApp_WidgetContainer::activate( const int id )
-{
-  myStack->raiseWidget( id );
-
-  setCaption( myStack->visibleWidget() ? myStack->visibleWidget()->caption() : QString::null );
-}
-
-/*!
-  Raise widget (\a wid).
-*/
-void LightApp_WidgetContainer::activate( QWidget* wid )
-{
-  myStack->raiseWidget( wid );
-
-  setCaption( myStack->visibleWidget() ? myStack->visibleWidget()->caption() : QString::null );
-}
-
-/*!
-  Gets widget from container list(stack) by id = \a id.
-*/
-QWidget* LightApp_WidgetContainer::widget( const int id ) const
-{
-  return myStack->widget( id );
-}
-
-/*!
-  Gets visible widget.
-*/
-QWidget* LightApp_WidgetContainer::active() const
-{
-  return myStack->visibleWidget();
-}
diff --git a/src/LightApp/LightApp_WidgetContainer.h b/src/LightApp/LightApp_WidgetContainer.h
deleted file mode 100644 (file)
index 1679ec0..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef LIGHTAPP_WIDGETCONTAINER_H
-#define LIGHTAPP_WIDGETCONTAINER_H
-
-#include "LightApp.h"
-
-#include <qdockwindow.h>
-
-class QWidget;
-class QWidgetStack;
-
-/*!
-  Class which privade widget container.
-*/
-class LIGHTAPP_EXPORT LightApp_WidgetContainer : public QDockWindow
-{
-    Q_OBJECT
-
-public:
-  LightApp_WidgetContainer( const int, QWidget* = 0 );
-  virtual ~LightApp_WidgetContainer();
-
-  bool         isEmpty() const;
-
-  int          type() const;
-
-  int          insert( const int, QWidget* );
-  void         remove( QWidget* );
-  void         remove( const int );
-  bool         contains( const int ) const;
-
-  void         activate( QWidget* );
-  void         activate( const int );
-
-  QWidget*     active() const;
-  QWidget*     widget( const int ) const;
-
-private:
-  int            myType;
-  QWidgetStack*  myStack;
-};
-
-#endif
index f59c4bd09b88ea3ef1d04c9af702643af726285d..1d3892a19e73753b3c610880385cde91cc42d172 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : OCC team (OCN)
 #  Module : LightApp
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libLightApp.la
 
-salomeinclude_HEADERS= \
-       LightApp.h \
-       LightApp_AboutDlg.h \
-       LightApp_Application.h \
-       LightApp_DataModel.h \
-       LightApp_DataObject.h \
-       LightApp_DataOwner.h \
-       LightApp_DataSubOwner.h \
-       LightApp_Dialog.h \
-       LightApp_Displayer.h \
-       LightApp_Driver.h \
-       LightApp_EventFilter.h \
-       LightApp_HDFDriver.h \
-       LightApp_Module.h \
-       LightApp_ModuleDlg.h \
-       LightApp_NameDlg.h \
-       LightApp_OBFilter.h \
-       LightApp_OBSelector.h \
-       LightApp_Operation.h \
-       LightApp_Selection.h \
-       LightApp_SelectionMgr.h \
-       LightApp_ShowHideOp.h \
-       LightApp_Study.h \
-       LightApp_SwitchOp.h \
-       LightApp_Preferences.h \
-       LightApp_PreferencesDlg.h \
-       LightApp_RootObject.h \
-       LightApp_UpdateFlags.h \
-       LightApp_WidgetContainer.h
+salomeinclude_HEADERS =                        \
+       LightApp.h                      \
+       LightApp_AboutDlg.h             \
+       LightApp_Application.h          \
+       LightApp_DataModel.h            \
+       LightApp_DataObject.h           \
+       LightApp_DataOwner.h            \
+       LightApp_DataSubOwner.h         \
+       LightApp_Dialog.h               \
+       LightApp_Displayer.h            \
+       LightApp_Driver.h               \
+       LightApp_EventFilter.h          \
+       LightApp_HDFDriver.h            \
+       LightApp_Module.h               \
+       LightApp_ModuleAction.h         \
+       LightApp_ModuleDlg.h            \
+       LightApp_NameDlg.h              \
+       LightApp_OBSelector.h           \
+       LightApp_Operation.h            \
+       LightApp_Selection.h            \
+       LightApp_SelectionMgr.h         \
+       LightApp_ShowHideOp.h           \
+       LightApp_Study.h                \
+       LightApp_SwitchOp.h             \
+       LightApp_Preferences.h          \
+       LightApp_PreferencesDlg.h       \
+       LightApp_UpdateFlags.h
+
+#      LightApp_OBFilter.h
 
 if ENABLE_VTKVIEWER
 if ENABLE_SALOMEOBJECT
-  salomeinclude_HEADERS+= LightApp_VTKSelector.h
+  salomeinclude_HEADERS += LightApp_VTKSelector.h
 endif
 endif
 if ENABLE_OCCVIEWER
-  salomeinclude_HEADERS+= LightApp_OCCSelector.h
+  salomeinclude_HEADERS += LightApp_OCCSelector.h
 endif
 if ENABLE_GLVIEWER
-  salomeinclude_HEADERS+= LightApp_GLSelector.h
-endif
-
-dist_libLightApp_la_SOURCES= \
-       LightApp_AboutDlg.cxx \
-       LightApp_Application.cxx \
-       LightApp_DataModel.cxx \
-       LightApp_DataObject.cxx \
-       LightApp_DataOwner.cxx \
-       LightApp_DataSubOwner.cxx \
-       LightApp_Dialog.cxx \
-       LightApp_Displayer.cxx \
-       LightApp_Driver.cxx \
-       LightApp_EventFilter.cxx \
-       LightApp_HDFDriver.cxx \
-       LightApp_Module.cxx \
-       LightApp_ModuleDlg.cxx \
-       LightApp_NameDlg.cxx \
-       LightApp_OBFilter.cxx \
-       LightApp_OBSelector.cxx \
-       LightApp_Operation.cxx \
-       LightApp_Selection.cxx \
-       LightApp_SelectionMgr.cxx \
-       LightApp_ShowHideOp.cxx \
-       LightApp_Study.cxx \
-       LightApp_SwitchOp.cxx \
-       LightApp_Preferences.cxx \
-       LightApp_PreferencesDlg.cxx \
-       LightApp_WidgetContainer.cxx
+  salomeinclude_HEADERS += LightApp_GLSelector.h
+endif
+if ENABLE_PLOT2DVIEWER
+  salomeinclude_HEADERS += LightApp_Plot2dSelector.h
+endif
+
+dist_libLightApp_la_SOURCES =          \
+       LightApp_AboutDlg.cxx           \
+       LightApp_Application.cxx        \
+       LightApp_DataModel.cxx          \
+       LightApp_DataObject.cxx         \
+       LightApp_DataOwner.cxx          \
+       LightApp_DataSubOwner.cxx       \
+       LightApp_Dialog.cxx             \
+       LightApp_Displayer.cxx          \
+       LightApp_Driver.cxx             \
+       LightApp_EventFilter.cxx        \
+       LightApp_HDFDriver.cxx          \
+       LightApp_Module.cxx             \
+       LightApp_ModuleAction.cxx       \
+       LightApp_ModuleDlg.cxx          \
+       LightApp_NameDlg.cxx            \
+       LightApp_OBSelector.cxx         \
+       LightApp_Operation.cxx          \
+       LightApp_Selection.cxx          \
+       LightApp_SelectionMgr.cxx       \
+       LightApp_ShowHideOp.cxx         \
+       LightApp_Study.cxx              \
+       LightApp_SwitchOp.cxx           \
+       LightApp_Preferences.cxx        \
+       LightApp_PreferencesDlg.cxx
+
+#      LightApp_OBFilter.cxx
 
 if ENABLE_VTKVIEWER
 if ENABLE_SALOMEOBJECT
-  dist_libLightApp_la_SOURCES+= LightApp_VTKSelector.cxx
+  dist_libLightApp_la_SOURCES += LightApp_VTKSelector.cxx
 endif
 endif
 if ENABLE_OCCVIEWER
-  dist_libLightApp_la_SOURCES+= LightApp_OCCSelector.cxx
+  dist_libLightApp_la_SOURCES += LightApp_OCCSelector.cxx
 endif
 if ENABLE_GLVIEWER
-  dist_libLightApp_la_SOURCES+= LightApp_GLSelector.cxx
-endif
-
-MOC_FILES= \
-       LightApp_AboutDlg_moc.cxx \
-       LightApp_Application_moc.cxx \
-       LightApp_DataModel_moc.cxx \
-       LightApp_Dialog_moc.cxx \
-       LightApp_OBSelector_moc.cxx \
-       LightApp_Operation_moc.cxx \
-       LightApp_Module_moc.cxx \
-       LightApp_ModuleDlg_moc.cxx \
-       LightApp_NameDlg_moc.cxx \
-       LightApp_SelectionMgr_moc.cxx \
-       LightApp_ShowHideOp_moc.cxx \
-       LightApp_Study_moc.cxx \
-       LightApp_SwitchOp_moc.cxx \
-       LightApp_Preferences_moc.cxx \
-       LightApp_PreferencesDlg_moc.cxx \
-       LightApp_WidgetContainer_moc.cxx
+  dist_libLightApp_la_SOURCES += LightApp_GLSelector.cxx
+endif
+if ENABLE_PLOT2DVIEWER
+  dist_libLightApp_la_SOURCES += LightApp_Plot2dSelector.cxx
+endif
+
+MOC_FILES =                            \
+       LightApp_AboutDlg_moc.cxx       \
+       LightApp_Application_moc.cxx    \
+       LightApp_DataModel_moc.cxx      \
+       LightApp_Dialog_moc.cxx         \
+       LightApp_OBSelector_moc.cxx     \
+       LightApp_Operation_moc.cxx      \
+       LightApp_Module_moc.cxx         \
+       LightApp_ModuleAction_moc.cxx   \
+       LightApp_ModuleDlg_moc.cxx      \
+       LightApp_NameDlg_moc.cxx        \
+       LightApp_SelectionMgr_moc.cxx   \
+       LightApp_ShowHideOp_moc.cxx     \
+       LightApp_Study_moc.cxx          \
+       LightApp_SwitchOp_moc.cxx       \
+       LightApp_Preferences_moc.cxx    \
+       LightApp_PreferencesDlg_moc.cxx
 
 if ENABLE_VTKVIEWER
 if ENABLE_SALOMEOBJECT
-  MOC_FILES+= LightApp_VTKSelector_moc.cxx
+  MOC_FILES += LightApp_VTKSelector_moc.cxx
 endif
 endif
 if ENABLE_OCCVIEWER
-  MOC_FILES+= LightApp_OCCSelector_moc.cxx
+  MOC_FILES += LightApp_OCCSelector_moc.cxx
 endif
 if ENABLE_GLVIEWER
-  MOC_FILES+= LightApp_GLSelector_moc.cxx
-endif
-nodist_libLightApp_la_SOURCES= $(MOC_FILES)
-
-dist_salomeres_DATA= \
-       resources/icon_about.png \
-       resources/icon_applogo.png \
-       resources/icon_default.png \
-       resources/icon_module.png \
-       resources/icon_module_big.png \
-       resources/icon_select.png \
-       resources/LightApp.ini \
+  MOC_FILES += LightApp_GLSelector_moc.cxx
+endif
+if ENABLE_PLOT2DVIEWER
+  MOC_FILES += LightApp_Plot2dSelector_moc.cxx
+endif
+nodist_libLightApp_la_SOURCES = $(MOC_FILES)
+
+dist_salomeres_DATA =                  \
+       resources/icon_about.png        \
+       resources/icon_applogo.png      \
+       resources/icon_default.png      \
+       resources/icon_module.png       \
+       resources/icon_module_big.png   \
+       resources/icon_select.png       \
+       resources/LightApp.ini          \
        resources/LightApp.xml
 
-nodist_salomeres_DATA= \
-       LightApp_images.qm \
+nodist_salomeres_DATA =                \
+       LightApp_images.qm      \
        LightApp_msg_en.qm
 
-libLightApp_la_CPPFLAGS=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(CAS_CPPFLAGS) \
-       $(HDF5_INCLUDES) @KERNEL_CXXFLAGS@ -I$(srcdir)/../SUIT -I$(srcdir)/../STD \
-       -I$(srcdir)/../CAM -I$(srcdir)/../ObjBrowser -I$(srcdir)/../LogWindow \
-       -I$(srcdir)/../Prs -I$(srcdir)/../Qtx
-libLightApp_la_LDFLAGS=$(QT_MT_LIBS)
+libLightApp_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) $(CAS_CPPFLAGS)            \
+       $(HDF5_INCLUDES) @KERNEL_CXXFLAGS@ -I$(srcdir)/../SUIT -I$(srcdir)/../STD       \
+       -I$(srcdir)/../CAM -I$(srcdir)/../ObjBrowser -I$(srcdir)/../LogWindow           \
+       -I$(srcdir)/../Prs -I$(srcdir)/../Qtx -I$(srcdir)/../Event -I$(srcdir)/../Style
+libLightApp_la_LDFLAGS = $(QT_MT_LIBS)
 
 if ENABLE_VTKVIEWER
-  libLightApp_la_CPPFLAGS+= $(VTK_INCLUDES) -I$(srcdir)/../VTKViewer
+  libLightApp_la_CPPFLAGS += $(VTK_INCLUDES) -I$(srcdir)/../VTKViewer
 else
-  libLightApp_la_CPPFLAGS+= -DDISABLE_VTKVIEWER
+  libLightApp_la_CPPFLAGS += -DDISABLE_VTKVIEWER
 endif
 if ENABLE_PLOT2DVIEWER
-  libLightApp_la_CPPFLAGS+= $(QWT_INCLUDES) -I$(srcdir)/../Plot2d
+  libLightApp_la_CPPFLAGS += $(QWT_INCLUDES) -I$(srcdir)/../Plot2d
 else
-  libLightApp_la_CPPFLAGS+= -DDISABLE_PLOT2DVIEWER
+  libLightApp_la_CPPFLAGS += -DDISABLE_PLOT2DVIEWER
 endif
+libLightApp_la_CPPFLAGS+= -I$(srcdir)/../QxScene
+
 if ENABLE_OCCVIEWER
-  libLightApp_la_CPPFLAGS+= -I$(srcdir)/../OCCViewer
+  libLightApp_la_CPPFLAGS += -I$(srcdir)/../OCCViewer
 else !ENABLE_OCCVIEWER
-  libLightApp_la_CPPFLAGS+= -DDISABLE_OCCVIEWER
+  libLightApp_la_CPPFLAGS += -DDISABLE_OCCVIEWER
 endif
 if ENABLE_PYCONSOLE
-  libLightApp_la_CPPFLAGS+= $(PYTHON_INCLUDES) -I$(srcdir)/../PythonConsole -I$(srcdir)/../PyInterp
-  libLightApp_la_LDFLAGS+= $(PYTHON_LIBS)
+  libLightApp_la_CPPFLAGS += $(PYTHON_INCLUDES) -I$(srcdir)/../PyConsole -I$(srcdir)/../PyInterp
+  libLightApp_la_LDFLAGS += $(PYTHON_LIBS)
 else !ENABLE_PYCONSOLE
-  libLightApp_la_CPPFLAGS+= -DDISABLE_PYCONSOLE
+  libLightApp_la_CPPFLAGS += -DDISABLE_PYCONSOLE
 endif
 if ENABLE_GLVIEWER
-  libLightApp_la_CPPFLAGS+= -I$(srcdir)/../GLViewer
+  libLightApp_la_CPPFLAGS += -I$(srcdir)/../GLViewer
 else !ENABLE_GLVIEWER
-  libLightApp_la_CPPFLAGS+= -DDISABLE_GLVIEWER
+  libLightApp_la_CPPFLAGS += -DDISABLE_GLVIEWER
 endif
 if ENABLE_SUPERVGRAPHVIEWER
-  libLightApp_la_CPPFLAGS+= -I$(srcdir)/../SUPERVGraph
+  libLightApp_la_CPPFLAGS += -I$(srcdir)/../SUPERVGraph
 else !ENABLE_SUPERVGRAPHVIEWER
-  libLightApp_la_CPPFLAGS+= -DDISABLE_SUPERVGRAPHVIEWER
+  libLightApp_la_CPPFLAGS += -DDISABLE_SUPERVGRAPHVIEWER
 endif
 if ENABLE_QXGRAPHVIEWER
-  libLightApp_la_CPPFLAGS+= -I$(srcdir)/../QxGraph
+  libLightApp_la_CPPFLAGS += -I$(srcdir)/../QxGraph
 else !ENABLE_QXGRAPHVIEWER
-  libLightApp_la_CPPFLAGS+= -DDISABLE_QXGRAPHVIEWER
+  libLightApp_la_CPPFLAGS += -DDISABLE_QXGRAPHVIEWER
 endif
 
 if ENABLE_SALOMEOBJECT
 
-  libLightApp_la_CPPFLAGS+= -I$(srcdir)/../OBJECT
+  libLightApp_la_CPPFLAGS += -I$(srcdir)/../OBJECT
 if ENABLE_PLOT2DVIEWER
-  libLightApp_la_CPPFLAGS+= -I$(srcdir)/../SPlot2d
+  libLightApp_la_CPPFLAGS += -I$(srcdir)/../SPlot2d
 endif
 if ENABLE_OCCVIEWER
-  libLightApp_la_CPPFLAGS+= -I$(srcdir)/../SOCC
+  libLightApp_la_CPPFLAGS += -I$(srcdir)/../SOCC
 endif
 if ENABLE_VTKVIEWER
-  libLightApp_la_CPPFLAGS+= -I$(srcdir)/../SVTK
+  libLightApp_la_CPPFLAGS += -I$(srcdir)/../SVTK
 endif
 else !ENABLE_SALOMEOBJECT
-  libLightApp_la_CPPFLAGS+= -DDISABLE_SALOMEOBJECT
+  libLightApp_la_CPPFLAGS += -DDISABLE_SALOMEOBJECT
   
 endif
 
-libLightApp_la_LIBADD= ../SUIT/libsuit.la ../STD/libstd.la ../CAM/libCAM.la \
-       ../ObjBrowser/libObjBrowser.la ../LogWindow/libLogWindow.la $(CAS_KERNEL) \
-       ../Prs/libSalomePrs.la $(HDF5_LIBS) $(KERNEL_LDFLAGS) -lSalomeHDFPersist
+libLightApp_la_LIBADD = ../SUIT/libsuit.la ../STD/libstd.la ../CAM/libCAM.la                   \
+       ../LogWindow/libLogWindow.la $(CAS_KERNEL)                                              \
+       ../Prs/libSalomePrs.la ../ObjBrowser/libObjBrowser.la ../Style/libSalomeStyle.la        \
+       ../Event/libEvent.la                                                                    \
+       $(HDF5_LIBS) $(KERNEL_LDFLAGS) -lSalomeHDFPersist -lSALOMELocalTrace
 
 if ENABLE_SALOMEOBJECT
-  libLightApp_la_LIBADD+= ../OBJECT/libSalomeObject.la
+  libLightApp_la_LIBADD += ../OBJECT/libSalomeObject.la
 endif
 if ENABLE_VTKVIEWER
-  libLightApp_la_LIBADD+= ../VTKViewer/libVTKViewer.la
+  libLightApp_la_LIBADD +=  $(VTK_LIBS) ../VTKViewer/libVTKViewer.la
 if ENABLE_SALOMEOBJECT
-  libLightApp_la_LIBADD+= ../SVTK/libSVTK.la
+  libLightApp_la_LIBADD += ../SVTK/libSVTK.la
 endif
 endif
 if ENABLE_OCCVIEWER
-  libLightApp_la_LIBADD+= ../OCCViewer/libOCCViewer.la
+  libLightApp_la_LIBADD += ../OCCViewer/libOCCViewer.la
 if ENABLE_SALOMEOBJECT
-  libLightApp_la_LIBADD+= ../SOCC/libSOCC.la
+  libLightApp_la_LIBADD += ../SOCC/libSOCC.la
 endif
 endif
 if ENABLE_GLVIEWER
-  libLightApp_la_LIBADD+= ../GLViewer/libGLViewer.la
+  libLightApp_la_LIBADD += ../GLViewer/libGLViewer.la
 endif
 if ENABLE_PLOT2DVIEWER
-  libLightApp_la_LIBADD+= ../Plot2d/libPlot2d.la
+  libLightApp_la_LIBADD += ../Plot2d/libPlot2d.la
 if ENABLE_SALOMEOBJECT
-  libLightApp_la_LIBADD+= ../SPlot2d/libSPlot2d.la
+  libLightApp_la_LIBADD += ../SPlot2d/libSPlot2d.la
 endif
 endif
 if ENABLE_PYCONSOLE
-  libLightApp_la_LIBADD+= ../PyInterp/libPyInterp.la ../PythonConsole/libPythonConsole.la
+  libLightApp_la_LIBADD += ../PyInterp/libPyInterp.la ../PyConsole/libPyConsole.la
 endif
 if ENABLE_SUPERVGRAPHVIEWER
-  libLightApp_la_LIBADD+= ../SUPERVGraph/libSUPERVGraph.la
+  libLightApp_la_LIBADD += ../SUPERVGraph/libSUPERVGraph.la
 endif
 if ENABLE_QXGRAPHVIEWER
-  libLightApp_la_LIBADD+= ../QxGraph/libQxGraph.la
+  libLightApp_la_LIBADD += ../QxGraph/libQxGraph.la
 endif
+  libLightApp_la_LIBADD+= ../QxScene/libQxScene.la
index fb5a7018a5da3871f937bed83b3bb29f0aadeedc..d88c794097b4136222d93a12c0f2922b23e47e07 100755 (executable)
@@ -14,8 +14,3 @@ Plot2d = $(GUI_ROOT_DIR)/share/salome/resources/gui
 GLViewer = $(GUI_ROOT_DIR)/share/salome/resources/gui
 OCCViewer = $(GUI_ROOT_DIR)/share/salome/resources/gui
 VTKViewer = $(GUI_ROOT_DIR)/share/salome/resources/gui
-LIGHT = $(LIGHT_ROOT_DIR)/share/salome/resources/light
-
-[LIGHT]
-name = Light
-icon = LIGHT
index 0c2f9ee0c8af820c79929167ecdeb6edc15e49e2..d4e62d9efe68af55e147d1ff74b110f6b9d58164 100644 (file)
@@ -1,3 +1,26 @@
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
 <document>
   <section name="launch">
     <!-- SALOME launching parameters -->
   </section>
   <section name="splash" >
     <!-- Splash screen settings -->
-    <parameter name="image"       value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
-    <parameter name="info"        value="%A : %V" />
-    <parameter name="text_colors" value="#FFFFFF" />
-    <parameter name="margin"      value="10" />
+    <parameter name="image"             value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
+    <parameter name="constant_info"     value="%A [ %V ]" />
+    <parameter name="text_colors"       value="#eeeeff|#555555" />
+    <parameter name="hide_on_click"     value="no" />
+    <parameter name="show_progress"     value="yes" />
+    <parameter name="show_message"      value="yes" />
+    <parameter name="show_percents"     value="yes" />
+    <parameter name="margin"            value="40" />
+    <parameter name="progress_width"    value="20" />
+    <parameter name="progress_flags"    value="bottom,left_to_right" />
+    <parameter name="opacity"           value="0.70" />
+    <parameter name="font"              value="Tahoma,12,normal" />
+    <parameter name="alignment"         value="top,left" />
+    <parameter name="progress_colors"   value="#3b3e5d|#d14949|v" />
   </section>
   <section name="resources">
     <!-- Resource directories (resource manager)-->
     <parameter name="GLViewer"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="OCCViewer"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="VTKViewer"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+    <parameter name="QxSceneViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+    <parameter name="PyConsole"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="SalomeApp"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="OB"           value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="CAM"          value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="LightApp"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="SVTK"         value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="ToolsGUI"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="LIGHT"        value="${LIGHT_ROOT_DIR}/share/salome/resources/light"/>
   </section>
   <section name="desktop" >
     <!-- Default GUI desktop state, position, size -->
-    <parameter name="state"  value="normal"/>
-    <parameter name="pos_x"  value="center"/>
-    <parameter name="pos_y"  value="center"/>
-    <parameter name="width"  value="800"/>
-    <parameter name="height" value="600"/>
-  </section>
-  <section name="LIGHT">
-    <!-- LIGHT module settings -->
-    <parameter name="name"       value="Light"/>
-    <parameter name="icon"       value="LIGHT.png"/>
+    <parameter name="geometry"  value="80%x80%+10%+10%"/>
   </section>
   <section name="PyConsole">
     <!-- Python console preferences -->
     <parameter name="font"                value="Helvetic,12" />
     <parameter name="additional_families" value="Helvetic;Helvetica;Helvetica[Adobe];Times;Times[Adobe];Sans Serif;Serif;Monospace;Lucida"/>
   </section>
+  <section name="Style">
+    <!-- Style and theme preferences -->
+    <parameter name="use_salome_style" value="true" />
+  </section>
+  <section name="ObjectBrowser" >
+    <!-- Object Browser preferences -->
+    <parameter name="auto_hide_search_tool" value="true" />
+  </section>
   <section name="FileDlg">
     <!-- "Open/Save File" dialog box preferences-->
     <parameter name="QuickDirList" value=""/>
   </section>
+  <section name="MRU" >
+    <!-- Show "Most recently used" studies-->
+    <parameter name="show_mru" value="true"/>
+    <!-- Max number of stored "Most recently used" studies-->
+    <parameter name="max_count" value="50"/>
+    <!-- Max visible number of "Most recently used" studies-->
+    <parameter name="visible_count" value="7"/>
+    <!-- Insert mode-->
+    <parameter name="insert_mode" value="0"/>
+    <!-- Link type-->
+    <parameter name="link_type" value="0"/>
+    <!-- Show "Clear" item-->
+    <parameter name="show_clear" value="true"/>
+  </section>
   <section name="Study">
     <!-- General study settings -->
     <parameter name="store_positions" value="true" />
     <parameter name="trihedron_size" value="100" />
  </section>
  <section name="VTKViewer" >
-    <!-- OCC viewer preferences -->
+    <!-- VTK viewer preferences -->
     <parameter name="background"     value="0, 0, 0"/>
+    <parameter name="projection_mode" value="0" />
     <parameter name="trihedron_size" value="100" />
+    <parameter name="relative_size"  value="true" />
+    <parameter name="use_advanced_selection_algorithm" value="true" />
+    <parameter name="navigation_mode" value="0" />
+    <parameter name="speed_value" value="10" />
+    <parameter name="speed_mode" value="0" />
+    <parameter name="spacemouse_func1_btn" value="1" />
+    <parameter name="spacemouse_func2_btn" value="2" />
+    <parameter name="spacemouse_func5_btn" value="9" />
  </section>
  <section name="Plot2d" >
     <!-- Plot2d viewer preferences -->
     <parameter name="Background" value="144, 208, 211" />
     <parameter name="Title"      value="63, 213, 255"  />
   </section>
+  <section name="QxSceneViewer" >
+    <!-- QxGraph viewer preferences -->
+    <parameter name="Background" value="144, 208, 211" />
+    <parameter name="Title"      value="63, 213, 255"  />
+    <parameter name="NodeBody"   value="255, 249, 147" />
+  </section>
 </document>
index 9149d196d40fc3ccc0cadc0aafdaa9b8c03425d7..950e1c638898789bd7e202b152fc344f8e5b818c 100644 (file)
@@ -1,25 +1,26 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      LightApp_images.po
-// Created:   May, 2005
-// Author:    OCC team
-// Copyright (C) CEA 2005
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  File:      LightApp_images.po
+#  Created:   May, 2005
 
 msgid ""
 msgstr ""
diff --git a/src/LightApp/resources/LightApp_images.ts b/src/LightApp/resources/LightApp_images.ts
new file mode 100644 (file)
index 0000000..ef56640
--- /dev/null
@@ -0,0 +1,56 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>APP_DEFAULT_ICO</source>
+        <translation>icon_default.png</translation>
+    </message>
+    <message>
+        <source>ABOUT</source>
+        <translation>icon_about.png</translation>
+    </message>
+    <message>
+        <source>ABOUT_SPLASH</source>
+        <translation>icon_about.png</translation>
+    </message>
+    <message>
+        <source>APP_MODULE_BIG_ICO</source>
+        <translation>icon_module_big.png</translation>
+    </message>
+    <message>
+        <source>APP_BASE_LOGO</source>
+        <translation>icon_applogo.png</translation>
+    </message>
+    <message>
+        <source>ICON_SELECT</source>
+        <translation>icon_select.png</translation>
+    </message>
+    <message>
+        <source>APP_MODULE_ICO</source>
+        <translation>icon_module.png</translation>
+    </message>
+</context>
+</TS>
index c138bb49fedecad27fdf5afe6fafbcfcea2d6ba8..c4a0aeadc533a0d02539611effc6c98dc072332a 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
@@ -40,7 +44,7 @@ msgid "ABOUT_VERSION"
 msgstr "Version %1"
 
 msgid "ABOUT_COPYRIGHT"
-msgstr "Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6,\nCEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS"
+msgstr "Copyright (C) 2003-2006 OPEN CASCADE, EADS/CCR, LIP6,\nCEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS"
 
 msgid "ABOUT_LICENSE"
 msgstr "GNU LGPL"
@@ -84,19 +88,22 @@ msgid "LightApp_Application::PRP_MODULE"
 msgstr "Switch to the module \"%1\""
 
 msgid "LightApp_Application::NEW_WINDOW_0"
-msgstr "&GL view"
+msgstr "&GL View"
 
 msgid "LightApp_Application::NEW_WINDOW_1"
-msgstr "&Plot2d view"
+msgstr "&Plot2d View"
 
 msgid "LightApp_Application::NEW_WINDOW_2"
-msgstr "&OCC view"
+msgstr "&OCC View"
 
 msgid "LightApp_Application::NEW_WINDOW_3"
-msgstr "VT&K view"
+msgstr "VT&K View"
 
 msgid "LightApp_Application::NEW_WINDOW_4"
-msgstr "&QxGraph view"
+msgstr "&QxGraph View"
+
+msgid "LightApp_Application::NEW_WINDOW_5"
+msgstr "Qx&Scene View"
 
 msgid "LightApp_Application::INF_CANCELLED"
 msgstr "Module activation cancelled"
@@ -122,7 +129,7 @@ msgstr "Message Window"
 //=======================================================================================
 
 msgid "LightApp_Application::MEN_DESK_MODULE_HELP"
-msgstr "Module help"
+msgstr "Module Help"
 
 //=======================================================================================
 
@@ -162,6 +169,12 @@ msgstr "Python console properties"
 msgid "LightApp_Application::PREF_FONT"
 msgstr "Font"
 
+msgid "LightApp_Application::PREF_GROUP_STYLE"
+msgstr "Salome style"
+
+msgid "LightApp_Application::PREF_USE_SALOME_STYLE"
+msgstr "Use Salome style"
+
 msgid "LightApp_Application::PREF_TAB_OBJBROWSER"
 msgstr "Object browser"
 
@@ -254,9 +267,6 @@ msgstr "Quick directory list"
 msgid "LightApp_Application::MEN_REFRESH"
 msgstr "Refresh"
 
-msgid "LightApp_Application::MEN_FIND"
-msgstr "Find"
-
 msgid "LightApp_Application::PREF_GROUP_SUPERV"
 msgstr "Graph Supervisor"
 
@@ -294,49 +304,61 @@ msgstr "Import"
 
 //=======================================================================================
 
-msgid "LightApp_Module::TOP_SHOW"
-msgstr "Show"
+msgid "LightApp_Module::TOP_DISPLAY"
+msgstr "Display"
 
-msgid "LightApp_Module::MEN_SHOW"
-msgstr "Show"
+msgid "LightApp_Module::MEN_DISPLAY"
+msgstr "Display"
 
-msgid "LightApp_Module::STB_SHOW"
-msgstr "Show"
+msgid "LightApp_Module::STB_DISPLAY"
+msgstr "Display"
 
-msgid "LightApp_Module::TOP_HIDE"
-msgstr "Hide"
+msgid "LightApp_Module::TOP_ERASE"
+msgstr "Erase"
 
-msgid "LightApp_Module::MEN_HIDE"
-msgstr "Hide"
+msgid "LightApp_Module::MEN_ERASE"
+msgstr "Erase"
 
-msgid "LightApp_Module::STB_HIDE"
-msgstr "Hide"
+msgid "LightApp_Module::STB_ERASE"
+msgstr "Erase"
 
 msgid "LightApp_Module::TOP_DISPLAY_ONLY"
-msgstr "Show only"
+msgstr "Display only"
 
 msgid "LightApp_Module::MEN_DISPLAY_ONLY"
-msgstr "Show only"
+msgstr "Display only"
 
 msgid "LightApp_Module::STB_DISPLAY_ONLY"
-msgstr "Show only"
+msgstr "Display only"
 
 msgid "LightApp_Module::TOP_ERASE_ALL"
-msgstr "Hide all"
+msgstr "Erase all"
 
 msgid "LightApp_Module::MEN_ERASE_ALL"
-msgstr "Hide all"
+msgstr "Erase all"
 
 msgid "LightApp_Module::STB_ERASE_ALL"
-msgstr "Hide all"
+msgstr "Erase all"
 //=======================================================================================
 
 
 msgid "LightApp_ModuleDlg::CAPTION"
 msgstr "Activate module"
 
-msgid "LightApp_ModuleDlg::DESCRIPTION"
-msgstr "You're activating module <b>%1</b>.<br>Please, select required action by pressing the corresponding button below."
+msgid "LightApp_ModuleDlg::NEW"
+msgstr "&New"
+
+msgid "LightApp_ModuleDlg::OPEN"
+msgstr "&Open"
+
+msgid "LightApp_ModuleDlg::LOAD"
+msgstr "&Load"
+
+msgid "LightApp_ModuleDlg::CANCEL"
+msgstr "&Cancel"
+
+msgid "LightApp_ModuleDlg::ActivateComponent_DESCRIPTION"
+msgstr "Create, open or load study."
 
 msgid "LightApp_NameDlg::TLT_RENAME"
 msgstr "Rename"
@@ -344,9 +366,3 @@ msgstr "Rename"
 msgid "LightApp_NameDlg::NAME_LBL"
 msgstr "Name: "
 
-msgid "LightApp_Application::ACTIVATE_MODULE_OP_OPEN"
-msgstr "&Open..."
-
-msgid "LightApp_Application::ACTIVATE_MODULE_OP_NEW"
-msgstr "&New"
-
diff --git a/src/LightApp/resources/LightApp_msg_en.ts b/src/LightApp/resources/LightApp_msg_en.ts
new file mode 100644 (file)
index 0000000..b91990d
--- /dev/null
@@ -0,0 +1,728 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>EXTERNAL_BROWSER_CANNOT_SHOW_PAGE</source>
+        <translation>External browser &quot;%1&quot; can not show help page &quot;%2&quot;. Do you want to change it in preferences?</translation>
+    </message>
+    <message>
+        <source>ABOUT_COPYRIGHT</source>
+        <translation>Copyright (C) 2007-2008 CEA/DEN, EDF R&amp;D, OPEN CASCADE
+
+Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6,
+CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translation>
+    </message>
+    <message>
+        <source>ABOUT_CAPTION</source>
+        <translation>About %1</translation>
+    </message>
+    <message>
+        <source>APP_NAME</source>
+        <translation>SALOME</translation>
+    </message>
+    <message>
+        <source>ABOUT_LICENSE</source>
+        <translation>GNU LGPL</translation>
+    </message>
+    <message>
+        <source>ABOUT_VERSION</source>
+        <translation>Version %1</translation>
+    </message>
+    <message>
+        <source>ENTRY_COLUMN</source>
+        <translation>Entry</translation>
+    </message>
+</context>
+<context>
+    <name>LightApp_Application</name>
+    <message>
+        <source>MEN_DESK_THEME</source>
+        <translation>Theme</translation>
+    </message>
+    <message>
+        <source>TOT_THEME</source>
+        <translation>Theme</translation>
+    </message>
+    <message>
+        <source>PRP_THEME</source>
+        <translation>Change style properties</translation>
+    </message>
+    <message>
+        <source>INF_TOOLBAR_MODULES</source>
+        <translation>Modules</translation>
+    </message>
+    <message>
+        <source>PREF_SHOW_LEGEND</source>
+        <translation>Show legend</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_RENAME</source>
+        <translation>&amp;Rename</translation>
+    </message>
+    <message>
+        <source>PREF_MULTI_FILE</source>
+        <translation>Multi file save</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_PREFERENCES</source>
+        <translation>Pre&amp;ferences...</translation>
+    </message>
+    <message>
+        <source>PREF_TRIHEDRON_SHOW</source>
+        <translation>Show trihedron</translation>
+    </message>
+    <message>
+        <source>PREF_TRIHEDRON_SIZE</source>
+        <translation>Trihedron size</translation>
+    </message>
+    <message>
+        <source>OBJECT_BROWSER</source>
+        <translation>Object Browser</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_PREFERENCES</source>
+        <translation>Allow to change the preferences</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_DIRECTORIES</source>
+        <translation>Quick directory list</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_VTKVIEWER</source>
+        <translation>VTK Viewer 3d</translation>
+    </message>
+    <message>
+        <source>PREF_STORE_POS</source>
+        <translation>Store positions of windows</translation>
+    </message>
+    <message>
+        <source>PREF_PROJECTION_MODE</source>
+        <translation>Projection mode:</translation>
+    </message>
+    <message>
+        <source>PREF_ORTHOGRAPHIC</source>
+        <translation>Orthogonal</translation>
+    </message>
+    <message>
+        <source>PREF_PERSPECTIVE</source>
+        <translation>Perspective</translation>
+    </message>
+    <message>
+        <source>PREF_NAVIGATION</source>
+        <translation>Navigation:</translation>
+    </message>
+    <message>
+        <source>PREF_STANDARD_STYLE</source>
+        <translation>Salome standard controls</translation>
+    </message>
+    <message>
+        <source>PREF_KEYFREE_STYLE</source>
+        <translation>Keyboard free style</translation>
+    </message>
+    <message>
+        <source>PREF_INCREMENTAL_SPEED</source>
+        <translation>Speed increment:</translation>
+    </message>
+    <message>
+        <source>PREF_INCREMENTAL_SPEED_MODE</source>
+        <translation>Modification mode:</translation>
+    </message>
+    <message>
+        <source>PREF_ARITHMETIC</source>
+        <translation>Arithmetic progression</translation>
+    </message>
+    <message>
+        <source>PREF_GEOMETRICAL</source>
+        <translation>Geometrical progression</translation>
+    </message>
+    <message>
+        <source>PREF_FRAME_SPACEMOUSE</source>
+        <translation>Spacemouse</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_FUNC_1</source>
+        <translation>Decrease speed increment</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_FUNC_2</source>
+        <translation>Increase speed increment</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_FUNC_3</source>
+        <translation>Dominant / combined switch</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_1</source>
+        <translation>Button 1</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_2</source>
+        <translation>Button 2</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_3</source>
+        <translation>Button 3</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_4</source>
+        <translation>Button 4</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_5</source>
+        <translation>Button 5</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_6</source>
+        <translation>Button 6</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_7</source>
+        <translation>Button 7</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_8</source>
+        <translation>Button 8</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_*</source>
+        <translation>Button *</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_10</source>
+        <translation>Button 10</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_11</source>
+        <translation>Button 11</translation>
+    </message>
+    <message>
+        <source>PREF_FRAME_RECORDING</source>
+        <translation>AVI Recording</translation>
+    </message>
+    <message>
+        <source>PREF_ALL_DISLPAYED_FRAMES</source>
+        <translation>Recording all displayed frames</translation>
+    </message>
+    <message>
+        <source>PREF_FPS</source>
+        <translation>FPS</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_TTL</source>
+        <translation>Settings</translation>
+    </message>
+    <message>
+        <source>PREF_PROGRESSIVE</source>
+        <translation>Progressive</translation>
+    </message>
+    <message>
+        <source>PREF_QUALITY</source>
+        <translation>Quality</translation>
+    </message>
+    <message>
+        <source>PREF_RECORDING_MODE</source>
+        <translation>Mode</translation>
+    </message>
+    <message>
+        <source>PREF_SKIPPED_FRAMES</source>
+        <translation>Recording at a given FPS</translation>
+    </message>
+    <message>
+        <source>PREF_BOTTOM</source>
+        <translation>Bottom</translation>
+    </message>
+    <message>
+        <source>PREF_CURVE_TYPE</source>
+        <translation>Curve type:</translation>
+    </message>
+    <message>
+        <source>PREF_ISOS_U</source>
+        <translation>Number of isolines along U</translation>
+    </message>
+    <message>
+        <source>PREF_ISOS_V</source>
+        <translation>Number of isolines along V</translation>
+    </message>
+    <message>
+        <source>PREF_POINTS</source>
+        <translation>Points</translation>
+    </message>
+    <message>
+        <source>PRP_MODULE</source>
+        <translation>Switch to the module &quot;%1&quot;</translation>
+    </message>
+    <message>
+        <source>PREF_ASCII_FILE</source>
+        <translation>ASCII save</translation>
+    </message>
+    <message>
+        <source>PREFERENCES_NOT_LOADED</source>
+        <translation>Preferences for module &quot;&lt;b&gt;%N&lt;/b&gt;&quot; will be available when the module is loaded</translation>
+    </message>
+    <message>
+        <source>PREF_LINEAR</source>
+        <translation>Linear</translation>
+    </message>
+    <message>
+        <source>DATA_MODELS</source>
+        <translation>Data models</translation>
+    </message>
+    <message>
+        <source>PRP_RENAME</source>
+        <translation>Rename active window</translation>
+    </message>
+    <message>
+        <source>TOT_RENAME</source>
+        <translation>Rename</translation>
+    </message>
+    <message>
+        <source>LOG_WINDOW</source>
+        <translation>Message Window</translation>
+    </message>
+    <message>
+        <source>PREF_SPLINE</source>
+        <translation>Spline</translation>
+    </message>
+    <message>
+        <source>PREF_OBJ_BROWSER_SEARCH_TOOL</source>
+        <translation>Search Tool</translation>
+    </message>
+    <message>
+        <source>PREF_AUTO_HIDE_SEARCH_TOOL</source>
+        <translation>Enable auto-hiding</translation>
+    </message>
+    <message>
+        <source>PREF_OBJ_BROWSER_SETTINGS</source>
+        <translation>Object browser settings</translation>
+    </message>
+    <message>
+        <source>PRP_APP_MODULE</source>
+        <translation>Switch to SALOME platform neutral point</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_PY_CONSOLE</source>
+        <translation>Python console properties</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_STYLE</source>
+        <translation>Salome style</translation>
+    </message>
+    <message>
+        <source>PREF_USE_SALOME_STYLE</source>
+        <translation>Use Salome style</translation>
+    </message>
+    <message>
+        <source>PREF_MARKER_SIZE</source>
+        <translation>Marker size:</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_VIEWERS</source>
+        <translation>Viewers</translation>
+    </message>
+    <message>
+        <source>PREF_APP</source>
+        <translation>Application</translation>
+    </message>
+    <message>
+        <source>PREF_TOP</source>
+        <translation>Top</translation>
+    </message>
+    <message>
+        <source>MEN_REFRESH</source>
+        <translation>Refresh</translation>
+    </message>
+    <message>
+        <source>PREF_AUTO_SIZE_FIRST</source>
+        <translation>Auto size for first column</translation>
+    </message>
+    <message>
+        <source>PREF_RESIZE_ON_EXPAND_ITEM</source>
+        <translation>Resize columns on expand item</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_SUPERV</source>
+        <translation>Graph Supervisor</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_OBJBROWSER</source>
+        <translation>Object browser</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_GENERAL</source>
+        <translation>General</translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_0</source>
+        <translation>&amp;GL view</translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_1</source>
+        <translation>&amp;Plot2d view</translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_2</source>
+        <translation>&amp;OCC view</translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_3</source>
+        <translation>VT&amp;K view</translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_4</source>
+        <translation>&amp;QxGraph view</translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_5</source>
+        <translation>Qx&amp;Scene view</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_NAME</source>
+        <translation>Object</translation>
+    </message>
+    <message>
+        <source>PREF_LEGEND_POSITION</source>
+        <translation>Legend position:</translation>
+    </message>
+    <message>
+        <source>PREF_RELATIVE_SIZE</source>
+        <translation>Relative size</translation>
+    </message>
+    <message>
+        <source>PREF_VIEWER_BACKGROUND</source>
+        <translation>Background color</translation>
+    </message>
+    <message>
+        <source>PREF_FONT</source>
+        <translation>Font</translation>
+    </message>
+    <message>
+        <source>PREF_LEFT</source>
+        <translation>Left</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_DIRECTORIES</source>
+        <translation>Directories</translation>
+    </message>
+    <message>
+        <source>ACTIVATING_MODULE</source>
+        <translation>Trying to activate module &quot;%1&quot;</translation>
+    </message>
+    <message>
+        <source>PREF_VERT_AXIS_SCALE</source>
+        <translation>Vertical axis scale:</translation>
+    </message>
+    <message>
+        <source>PREF_HOR_AXIS_SCALE</source>
+        <translation>Horizontal axis scale:</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_STUDY</source>
+        <translation>Study properties</translation>
+    </message>
+    <message>
+        <source>PREF_CATEGORY_SALOME</source>
+        <translation>SALOME</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_OCCVIEWER</source>
+        <translation>OCC Viewer 3d</translation>
+    </message>
+    <message>
+        <source>PREF_LOGARITHMIC</source>
+        <translation>Logarithmic</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_MODULE_HELP</source>
+        <translation>Module Help</translation>
+    </message>
+    <message>
+        <source>PREF_SUPERV_TITLE_COLOR</source>
+        <translation>Title color</translation>
+    </message>
+    <message>
+        <source>PREF_PARAM</source>
+        <translation>Parameters</translation>
+    </message>
+    <message>
+        <source>PREF_RIGHT</source>
+        <translation>Right</translation>
+    </message>
+    <message>
+        <source>PREF_LINES</source>
+        <translation>Lines</translation>
+    </message>
+    <message>
+        <source>INF_CANCELLED</source>
+        <translation>Module activation cancelled</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_EXT_BROWSER</source>
+        <translation>External browser</translation>
+    </message>
+    <message>
+        <source>PREF_SUPERV_CTRL_COLOR</source>
+        <translation>Ctrl color</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_DEF_COLUMNS</source>
+        <translation>Default columns</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_PLOT2DVIEWER</source>
+        <translation>Plot2d Viewer</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_MRU</source>
+        <translation>Most Recently Used</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_PREFERENCES</source>
+        <translation>Preferences</translation>
+    </message>
+    <message>
+        <source>DEFINE_EXTERNAL_BROWSER</source>
+        <translation>External browser is not found. Do you want to define it in preferences?</translation>
+    </message>
+    <message>
+        <source>PREF_AUTO_SIZE</source>
+        <translation>Auto size for other columns</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_MRU</source>
+        <translation>Most recently used</translation>
+    </message>
+    <message>
+        <source>ACTIVATE_MODULE_OP_NEW</source>
+        <translation>&amp;New</translation>
+    </message>
+    <message>
+        <source>ACTIVATE_MODULE_OP_OPEN</source>
+        <translation>&amp;Open...</translation>
+    </message>
+    <message>
+        <source>PYTHON_CONSOLE</source>
+        <translation>Python Console</translation>
+    </message>
+    <message>
+        <source>PREF_USE_ADVANCED_SELECTION_ALGORITHM</source>
+        <translation>Use Advanced Selection Algorithm</translation>
+    </message>
+    <message>
+        <source>TOT_CLOSE</source>
+        <translation>Close</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_CLOSE</source>
+        <translation>&amp;Close</translation>
+    </message>
+    <message>
+        <source>PRP_CLOSE</source>
+        <translation>Close active window</translation>
+    </message>
+    <message>
+        <source>TOT_CLOSE_ALL</source>
+        <translation>Close all</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_CLOSE_ALL</source>
+        <translation>Close All</translation>
+    </message>
+    <message>
+        <source>PRP_CLOSE_ALL</source>
+        <translation>Close all windows</translation>
+    </message>
+    <message>
+        <source>TOT_GROUP_ALL</source>
+        <translation>Group all</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_GROUP_ALL</source>
+        <translation>&amp;Group All</translation>
+    </message>
+    <message>
+        <source>PRP_GROUP_ALL</source>
+        <translation>Group all windows</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_NOT_EXISTS</source>
+        <translation>Can not open %1.
+File does not exist</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_MRU</source>
+        <translation>Show MRU items</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_VISIBLE_COUNT</source>
+        <translation>Number of MRU items</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_INSERT_MODE</source>
+        <translation>Insert mode</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_MOVE_FIRST</source>
+        <translation>Move to the beginning</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_MOVE_LAST</source>
+        <translation>Move to the end</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_ADD_FIRST</source>
+        <translation>Add to the beginning</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_ADD_LAST</source>
+        <translation>Add to the end</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_LINK_TYPE</source>
+        <translation>Link type</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_LINK_AUTO</source>
+        <translation>Auto</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_LINK_SHORT</source>
+        <translation>Short</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_LINK_FULL</source>
+        <translation>Full</translation>
+    </message>
+    <message>
+        <source>PREFERENCES_NOT_SUPPORTED</source>
+        <translation>Preferences for module "%1" not supported</translation>
+    </message>
+</context>
+<context>
+    <name>LightApp_Module</name>
+    <message>
+        <source>MEN_HIDE</source>
+        <translation>Hide</translation>
+    </message>
+    <message>
+        <source>TOP_DISPLAY_ONLY</source>
+        <translation>Show only</translation>
+    </message>
+    <message>
+        <source>STB_DISPLAY_ONLY</source>
+        <translation>Show only</translation>
+    </message>
+    <message>
+        <source>MEN_DISPLAY_ONLY</source>
+        <translation>Show Only</translation>
+    </message>
+    <message>
+        <source>TOP_HIDE</source>
+        <translation>HIde</translation>
+    </message>
+    <message>
+        <source>MEN_ERASE_ALL</source>
+        <translation>Hide All</translation>
+    </message>
+    <message>
+        <source>STB_HIDE</source>
+        <translation>Hide</translation>
+    </message>
+    <message>
+        <source>STB_SHOW</source>
+        <translation>Show</translation>
+    </message>
+    <message>
+        <source>TOP_SHOW</source>
+        <translation>Show</translation>
+    </message>
+    <message>
+        <source>MEN_SHOW</source>
+        <translation>Show</translation>
+    </message>
+    <message>
+        <source>STB_ERASE_ALL</source>
+        <translation>Hide all</translation>
+    </message>
+    <message>
+        <source>TOP_ERASE_ALL</source>
+        <translation>Hide all</translation>
+    </message>
+</context>
+<context>
+    <name>LightApp_ModuleDlg</name>
+    <message>
+        <source>DESCRIPTION</source>
+        <translation>You're activating module
+       &lt;b&gt;%1&lt;/b&gt;.&lt;br&gt;Please, select required action by pressing the corresponding button below.</translation>
+    </message>
+    <message>
+        <source>CANCEL</source>
+        <translation>&amp;Cancel</translation>
+    </message>
+    <message>
+        <source>CAPTION</source>
+        <translation>Activate module</translation>
+    </message>
+</context>
+<context>
+    <name>LightApp_NameDlg</name>
+    <message>
+        <source>TLT_RENAME</source>
+        <translation>Rename</translation>
+    </message>
+    <message>
+        <source>NAME_LBL</source>
+        <translation>Name: </translation>
+    </message>
+</context>
+<context>
+    <name>LightApp_PreferencesDlg</name>
+    <message>
+        <source>IMPORT_PREFERENCES</source>
+        <translation>Import preferences</translation>
+    </message>
+    <message>
+        <source>CAPTION</source>
+        <translation>Preferences</translation>
+    </message>
+    <message>
+        <source>WARNING</source>
+        <translation>Warning</translation>
+    </message>
+    <message>
+        <source>IMPORT_BTN_TEXT</source>
+        <translation>Import</translation>
+    </message>
+    <message>
+        <source>DEFAULT_QUESTION</source>
+        <translation>Do you want to retrieve default preferences?</translation>
+    </message>
+    <message>
+        <source>DEFAULT_BTN_TEXT</source>
+        <translation>Defaults</translation>
+    </message>
+</context>
+</TS>
index 0cfa37ae050a1c9a07e31e61a0c072c9fe048e8b..bbbc7a931919d52bf27c6f563daefb1ad2349237 100755 (executable)
Binary files a/src/LightApp/resources/icon_about.png and b/src/LightApp/resources/icon_about.png differ
index 7be65180ada6ab17be0313beb31306bcecd57bf0..9c6470b1bbe5e80428c1a263f1d731bf8ab999c5 100755 (executable)
Binary files a/src/LightApp/resources/icon_applogo.png and b/src/LightApp/resources/icon_applogo.png differ
index 9fdd5fb01222465f14b6dd39a8607b0486bda000..298e581b069a441b92cfbade7cdf1b91262bce0d 100644 (file)
Binary files a/src/LightApp/resources/icon_module.png and b/src/LightApp/resources/icon_module.png differ
index 99e10b1ff7802e5652aea93f3d535506b198ed92..c303e3bc3b8eeee5de09a1908018875f3391c96d 100755 (executable)
Binary files a/src/LightApp/resources/icon_module_big.png and b/src/LightApp/resources/icon_module_big.png differ
index 99ebde65e86ffe25badbb1507f0286abbabd99ec..4af5214ebf8dfd3245c9cbe7a2aeabb963af42ce 100644 (file)
Binary files a/src/LightApp/resources/icon_select.png and b/src/LightApp/resources/icon_select.png differ
index 161011c450bd343cd45bfab00d0b533dc9618220..4a15cdaba3f49693ec8e9ce2ca4a3b18c0fddaae 100755 (executable)
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 //  KERNEL SALOME_Event : Define event posting mechanism
+// File   : LogWindow.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
 #include "LogWindow.h"
 
-#include <qfile.h>
-#include <qlayout.h>
-#include <qaction.h>
-#include <qpopupmenu.h>
-#include <qtextbrowser.h>
-#include <qapplication.h>
-#include <qdatetime.h>
+#include <QAction>
+#include <QApplication>
+#include <QDate>
+#include <QFile>
+#include <QMenu>
+#include <QTextEdit>
+#include <QTextStream>
+#include <QTime>
+#include <QVBoxLayout>
 
-#include <SUIT_Tools.h>
-#include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_Tools.h>
 
 #define DEFAULT_SEPARATOR "***"
 
 /*!
-  Converts rich text to plain text
+  \brief Convert rich text to plain text.
+  \internal
+  \param richText rich text string
+  \return converted plain text string
 */
 static QString plainText( const QString& richText )
 {
   QString aText = richText;
-  int startTag = aText.find('<');
-  while ( 1 ) {
+  int startTag = aText.indexOf( '<' );
+  while ( true )
+  {
     if ( startTag < 0 )
       break;
-    int finishTag = aText.find('>',startTag);
-    if (finishTag < 0)
+
+    int finishTag = aText.indexOf( '>', startTag );
+    if ( finishTag < 0 )
       break;
-    aText = aText.remove(startTag, finishTag-startTag+1);
-    startTag = aText.find('<');
+
+    aText = aText.remove( startTag, finishTag - startTag + 1 );
+    startTag = aText.indexOf( '<' );
   }
   return aText;
 }
 
 /*!
-  Default constructor
+  \class LogWindow
+  \brief Widget, displaying log messages.
+
+  The log messages window provides operations like:
+  - show messages
+  - display timestamps at the message beginning
+  - color messages according to their purposes (e.g., errors/warning)
+  - clear log output
+  - copy messages to clipvoard
+  - save message log to to the text file
+*/
+
+/*!
+  \brief Constructor.
+
+  Creates new messages log window widget.
+  \param parent parent widget
 */
 LogWindow::LogWindow( QWidget* parent )
-: QFrame( parent ),
-SUIT_PopupClient()
+: QWidget( parent ),
+  SUIT_PopupClient()
 {
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
 
-  QString fntSet = resMgr ? resMgr->stringValue( "Log Window", "font", QString::null ) : QString::null;
+  QString fntSet = resMgr ? resMgr->stringValue( "Log Window", "font", QString() ) : QString();
 
   setFont( SUIT_Tools::stringToFont( fntSet ) );
 
-  myView = new QTextBrowser(this,"myView");
-#if QT_VERSION>0x030007
-  myView->setTextFormat( Qt::LogText );
-#endif
+  myView = new QTextEdit( this );
+  myView->setReadOnly( true );
   myView->viewport()->installEventFilter( this );
 
   QVBoxLayout* main = new QVBoxLayout( this );
+  main->setMargin( 0 );
   main->addWidget( myView );
 
   myBannerSize = 0;
@@ -87,28 +114,35 @@ SUIT_PopupClient()
 }
 
 /*!
-  Destructor
+  \brief Destructor.
+
+  Does nothing for the moment.
 */
 LogWindow::~LogWindow()
 {
 }
 
 /*!
-  Custom event handler
+  \brief Get current banner (message log window header text).
+  \return string representing the current banner
 */
-bool LogWindow::eventFilter( QObject* o, QEvent* e )
+QString LogWindow::banner() const
 {
-  if ( o == myView->viewport() && e->type() == QEvent::ContextMenu )
-  {
-    contextMenuRequest( (QContextMenuEvent*)e );
-    return true;
-  }
-  return QFrame::eventFilter( o, e );
+  return myBanner;
 }
 
 /*!
-  Sets banner (title of message log)
-  \param banner - new title
+  \brief Get current separator (text which is printed between messages).
+  \return string representing the current separator
+*/
+QString LogWindow::separator() const
+{
+  return mySeparator;
+}
+
+/*!
+  \brief Set current banner (message log window header text).
+  \param banner new banner
 */
 void LogWindow::setBanner( const QString& banner )
 {
@@ -118,8 +152,8 @@ void LogWindow::setBanner( const QString& banner )
 }
 
 /*!
-  Set separator (line printing between messages)
-  \param separator new separator
+  Set current separator (text which is printed between messages).
+  \param separator new separator
 */
 void LogWindow::setSeparator( const QString& separator )
 {
@@ -129,26 +163,85 @@ void LogWindow::setSeparator( const QString& separator )
 }
 
 /*!
-  Puts message to log window
-  \param message - text of message
-  \addSeparator - if it is true, then separator is added to tail of message log
+  \brief Custom event handler.
+
+  Process context popup menu request event.
+  
+  \param o object
+  \param e event
+  \return True if the event is processed and further processing should be stopped
 */
-void LogWindow::putMessage( const QString& message, bool addSeparator )
+bool LogWindow::eventFilter( QObject* o, QEvent* e )
 {
-  myView->append( message );
+  if ( o == myView->viewport() && e->type() == QEvent::ContextMenu )
+  {
+    contextMenuRequest( (QContextMenuEvent*)e );
+    return true;
+  }
+  return QWidget::eventFilter( o, e );
+}
+
+/*!
+  \brief Put new message to the log window.
+  \param message text of the message
+  \param flags ORed flags which define how the message should be printed
+*/
+void LogWindow::putMessage( const QString& message, const int flags )
+{
+  putMessage( message, QColor(), flags );
+}
+
+/*!
+  \brief Put new message to the log window.
+  \param message text of the message
+  \param color text color of the message
+  \param flags ORed flags which define how the message should be printed
+*/
+void LogWindow::putMessage( const QString& message, const QColor& color, const int flags )
+{
+  QString msg = message;
+  if ( msg.isEmpty() )
+    return;
+
+  bool noColor = flags & DisplayNoColor;
+
+  if ( color.isValid() )
+    msg = QString( "<font color=\"%1\">%2</font>" ).arg( color.name() ).arg( msg );
+
+  QString dStr;
+  if ( flags & DisplayDate )
+  {
+    dStr = QDate::currentDate().toString( Qt::SystemLocaleDate );
+    if ( !noColor )
+      dStr = QString( "<font color=\"#003380\">%1</font>" ).arg( dStr );
+  }
+
+  QString tStr;
+  if ( flags & DisplayTime )
+  {
+    tStr = QTime::currentTime().toString( Qt::SystemLocaleDate );
+    if ( !noColor )
+      tStr = QString( "<font color=\"#008033\">%1</font>" ).arg( tStr );
+  }
+
+  QString dateTime = QString( "%1 %2" ).arg( dStr ).arg( tStr ).trimmed();
+  if ( !dateTime.isEmpty() )
+    msg = QString( "[%1] %2" ).arg( dateTime ).arg( msg );
+
+  myView->append( msg );
   myHistory.append( plainText( message ) );
 
-  if ( addSeparator && !mySeparator.isNull() )
+  if ( flags & DisplaySeparator && !mySeparator.isEmpty() )
   {
     myView->append( mySeparator );   // add separator
     myHistory.append( plainText( mySeparator ) );
   }
-  myView->scrollToBottom();
+  myView->moveCursor( QTextCursor::End );
 }
 
 /*!
-  Clears message log
-  \param clearHistory - if it is true, then also history is cleared
+  \brief Clear message log.
+  \param clearHistory if True, clear also the messages history
 */
 void LogWindow::clear( bool clearHistory )
 {
@@ -159,20 +252,21 @@ void LogWindow::clear( bool clearHistory )
   if ( !myBanner.isEmpty() )
   {
     myView->append( myBanner );
-    myBannerSize = myView->paragraphs();
+    myBannerSize = myView->document()->blockCount();
   }
   else
     myBannerSize = 0;
 }
 
 /*!
-  Saves log to file
-  \param fileName - name of file
+  \brief Save messages log to the file.
+  \param fileName name of the file
+  \return \c true on success and \c false on error
 */
 bool LogWindow::saveLog( const QString& fileName )
 {
   QFile file( fileName );
-  if ( !file.open( IO_WriteOnly ) )
+  if ( !file.open( QFile::WriteOnly ) )
     return false;
 
   QTextStream stream( &file );
@@ -183,7 +277,7 @@ bool LogWindow::saveLog( const QString& fileName )
   stream << QTime::currentTime().toString( "hh:mm:ss" )   << endl;
   stream << "*****************************************"   << endl;
 
-  for ( uint i = 0; i < myHistory.count(); i++ )
+  for ( int i = 0; i < myHistory.count(); i++ )
     stream << myHistory[ i ] << endl;
 
   file.close();
@@ -191,68 +285,67 @@ bool LogWindow::saveLog( const QString& fileName )
 }
 
 /*!
-  Creates actions
+  \brief Create context popup menu actions.
 */
 void LogWindow::createActions()
 {
-  QAction* a = new QAction( "", tr( "&Copy" ), 0, this );
-  a->setStatusTip( tr( "&Copy" ) );
-  connect( a, SIGNAL( activated() ), SLOT( onCopy()));
+  QAction* a = new QAction( tr( "EDIT_COPY_CMD" ), this );
+  a->setStatusTip( tr( "EDIT_COPY_CMD" ) );
+  connect( a, SIGNAL( triggered( bool ) ), SLOT( onCopy() ) );
   myActions.insert( CopyId, a );
 
-  a = new QAction( "", tr( "Clea&r" ), 0, this );
-  a->setStatusTip( tr( "Clea&r" ) );
-  connect( a, SIGNAL( activated() ), SLOT( onClear()));
+  a = new QAction( tr( "EDIT_CLEAR_CMD" ), this );
+  a->setStatusTip( tr( "EDIT_CLEAR_CMD" ) );
+  connect( a, SIGNAL( triggered( bool ) ), SLOT( onClear() ) );
   myActions.insert( ClearId, a );
 
-  a = new QAction( "", tr( "Select &All" ), 0, this );
-  a->setStatusTip( tr( "Select &All" ) );
-  connect( a, SIGNAL( activated() ), SLOT( onSelectAll()));
+  a = new QAction( tr( "EDIT_SELECTALL_CMD" ), this );
+  a->setStatusTip( tr( "EDIT_SELECTALL_CMD" ) );
+  connect( a, SIGNAL( triggered( bool ) ), SLOT( onSelectAll() ) );
   myActions.insert( SelectAllId, a );
 
-  a = new QAction( "", tr( "&Save log to file..." ), 0, this );
-  a->setStatusTip( tr( "&Save log to file..." ) );
-  connect( a, SIGNAL( activated() ), SLOT( onSaveToFile()));
+  a = new QAction( tr( "EDIT_SAVETOFILE_CMD" ), this );
+  a->setStatusTip( tr( "EDIT_SAVETOFILE_CMD" ) );
+  connect( a, SIGNAL( triggered( bool ) ), SLOT( onSaveToFile() ) );
   myActions.insert( SaveToFileId, a );
 }
 
 /*!
-  Redefined virtual method for popup filling
+  \brief Create the context popup menu.
+
+  Fill in the popup menu with the commands.
+
+  \param menu context popup menu
 */
-void LogWindow::contextMenuPopup( QPopupMenu* popup )
+void LogWindow::contextMenuPopup( QMenu* popup )
 {
-  myActions[ CopyId ]->addTo( popup );
-  myActions[ ClearId ]->addTo( popup );
-  
-  popup->insertSeparator();
-  
-  myActions[ SelectAllId ]->addTo( popup );
-  
-  popup->insertSeparator();
-  
-  myActions[ SaveToFileId ]->addTo( popup );
+  popup->addAction( myActions[ CopyId ] );
+  popup->addAction( myActions[ ClearId ] );
+  popup->addSeparator();
+  popup->addAction( myActions[ SelectAllId ] );
+  popup->addSeparator();
+  popup->addAction( myActions[ SaveToFileId ] );
+
+  Qtx::simplifySeparators( popup );
 
   updateActions();
 }
 
 /*!
-  Updates enable status of actions
+  \brief Update menu actions.
+
+  Update context popup menu action state.
 */
 void LogWindow::updateActions()
 {
-  int paraFrom, paraTo, indexFrom, indexTo;
-  myView->getSelection( &paraFrom, &indexFrom, &paraTo, &indexTo );
-  bool allSelected = myView->hasSelectedText() &&
-                     !paraFrom && paraTo == myView->paragraphs() - 1 && 
-                     !indexFrom && indexTo == myView->paragraphLength( paraTo );
-  myActions[ CopyId ]->setEnabled( myView->hasSelectedText() );
-  myActions[ ClearId ]->setEnabled( myView->paragraphs() > myBannerSize );
-  myActions[ SelectAllId ]->setEnabled( !allSelected );
+  myActions[CopyId]->setEnabled( myView->textCursor().hasSelection() );
+  myActions[ ClearId ]->setEnabled( myView->document()->blockCount() > myBannerSize );
+  myActions[SelectAllId]->setEnabled( !myView->document()->isEmpty() );
   myActions[ SaveToFileId ]->setEnabled( myHistory.count() > 0 );
 }
 
 /*!
-  SLOT: called if user click "Save" in popup
+  \brief Called when user selects "Save To File" command in the popup menu.
 */
 void LogWindow::onSaveToFile()
 {
@@ -261,22 +354,22 @@ void LogWindow::onSaveToFile()
     return;
 
   // call application-specific "Save file" dialog box
-  QString aName = app->getFileName( false, QString::null, QString( "*.log" ), QString::null, 0 );
+  QString aName = app->getFileName( false, QString(), QString( "*.log" ), QString(), 0 );
   if ( aName.isNull() )
     return;
 
-  QApplication::setOverrideCursor( Qt::waitCursor );
-    
+  QApplication::setOverrideCursor( Qt::WaitCursor );
+
   bool bOk = saveLog( aName );
 
   QApplication::restoreOverrideCursor();
 
   if ( !bOk )
-    SUIT_MessageBox::error1( this, tr( "Error" ), tr( "Can't save file" ), tr( "OK" ) );
+    SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "ERR_CANT_SAVE_FILE" ) );
 }
 
 /*!
-  SLOT: called if user click "Select all" in popup
+  \brief Called when user selects "Select all" command in the popup menu.
 */
 void LogWindow::onSelectAll()
 {
@@ -285,7 +378,7 @@ void LogWindow::onSelectAll()
 }
 
 /*!
-  SLOT: called if user click "Clear" in popup
+  \brief Called when user click "Clear" command in the popup menu.
 */
 void LogWindow::onClear()
 {
@@ -293,10 +386,47 @@ void LogWindow::onClear()
 }
 
 /*!
-  SLOT: called if user click "Copy" in popup
+  \brief Called when user click "Copy" command in the popup menu.
 */
 void LogWindow::onCopy()
 {
   if ( myView )
     myView->copy();
 }
+
+/*!
+  \brief Set actions to be visible in the context popup menu.
+  
+  Actions, which IDs are set in \a flags parameter, will be shown in the 
+  context popup menu. Other actions will not be shown.
+
+  \param flags ORed together actions flags
+*/
+void LogWindow::setMenuActions( const int flags )
+{
+  myActions[CopyId]->setVisible( flags & CopyId );
+  myActions[ClearId]->setVisible( flags & ClearId );
+  myActions[SelectAllId]->setVisible( flags & SelectAllId );
+  myActions[SaveToFileId]->setVisible( flags & SaveToFileId );
+}
+
+/*!
+  \brief Get menu actions which are currently visible in the context popup menu.
+  \return ORed together actions flags
+  \sa setMenuActions()
+*/
+int LogWindow::menuActions() const
+{
+  int ret = 0;
+  ret = ret | ( myActions[CopyId]->isVisible() ? CopyId : 0 );
+  ret = ret | ( myActions[ClearId]->isVisible() ? ClearId : 0 );
+  ret = ret | ( myActions[SelectAllId]->isVisible() ? SelectAllId : 0 );
+  ret = ret | ( myActions[SaveToFileId]->isVisible() ? SaveToFileId : 0 );
+  return ret;
+}
+
+/*!
+  \fn virtual QString LogWindow::popupClientType() const;
+  \brief Get popup client symbolic name, used in popup menu management system.
+  \return symbolic name
+*/
index 0b8b39e98c7f1af5063f4a35f923350d176e3b81..cdcb86da3728d1a7d83529ad167831482ff606f1 100755 (executable)
-//  KERNEL SALOME_Event : Define event posting mechanism
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  File   : LogWindow.h
-//  Author : 
-//  Module : KERNEL
-
-#ifndef LogWindow_HeaderFile
-#define LogWindow_HeaderFile
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  KERNEL SALOME_Event : Define event posting mechanism
+// File   : LogWindow.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef LOGWINDOW_H
+#define LOGWINDOW_H
 
-#if defined LOGWINDOW_EXPORTS
 #if defined WIN32
-#define LOGWINDOW_EXPORT __declspec( dllexport )
+#  if defined LOGWINDOW_EXPORTS
+#    define LOGWINDOW_EXPORT __declspec( dllexport )
+#  else
+#    define LOGWINDOW_EXPORT __declspec( dllimport )
+#  endif
 #else
-#define LOGWINDOW_EXPORT
-#endif
-#else
-#if defined WIN32
-#define LOGWINDOW_EXPORT __declspec( dllimport )
-#else
-#define LOGWINDOW_EXPORT
-#endif
+#  define LOGWINDOW_EXPORT
 #endif
 
 #include <SUIT_PopupClient.h>
 
-#include <qframe.h>
-#include <qstringlist.h>
+#include <QWidget>
+#include <QMap>
+#include <QStringList>
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
 class QAction;
-class QTextBrowser;
+class QTextEdit;
 
-/*!
-  \class LogWindow
-  Widget, showing logs message. Allows to show, to clear, to copy messages and to save then to file
-*/
-class LOGWINDOW_EXPORT LogWindow : public QFrame, public SUIT_PopupClient
+class LOGWINDOW_EXPORT LogWindow : public QWidget, public SUIT_PopupClient
 {
   Q_OBJECT
 
-  enum { CopyId, ClearId, SelectAllId, SaveToFileId };
+public:
+  //! Context popup menu actions flags
+  enum
+  {
+    CopyId       = 0x01,                                //!< "Copy" menu action
+    ClearId      = 0x02,                                //!< "Clear" menu action
+    SelectAllId  = 0x04,                                //!< "Select All" menu action
+    SaveToFileId = 0x08,                                //!< "Save To File" menu action
+    All = CopyId | ClearId | SelectAllId | SaveToFileId //!< all menu actions
+  };
+
+  //! Display messages flags
+  enum
+  {
+    DisplayNormal    = 0x00,                     //!< do not display extra data
+    DisplayDate      = 0x01,                     //!< display message date
+    DisplayTime      = 0x02,                     //!< display message time
+    DisplaySeparator = 0x04,                     //!< display separator between messages
+    DisplayNoColor   = 0x08,                     //!< display non-colored message
+    DisplayDateTime  = DisplayDate | DisplayTime //!< display date & time
+  };
 
 public:
-       LogWindow( QWidget* theParent );
-       virtual ~LogWindow();
+  LogWindow( QWidget* theParent );
+  virtual ~LogWindow();
 
   virtual             QString popupClientType() const { return QString( "LogWindow" ); }
-  virtual void        contextMenuPopup( QPopupMenu* );
+  virtual void        contextMenuPopup( QMenu* );
+
+  virtual bool        eventFilter( QObject*, QEvent* );
 
-  bool                eventFilter( QObject* o, QEvent* e );
+  QString             banner() const;
+  QString             separator() const;
 
-  void                setBanner( const QString& banner );
-  void                setSeparator( const QString& separator );
+  void                setBanner( const QString& );
+  void                setSeparator( const QString& );
 
-  virtual void        putMessage( const QString& message, bool addSeparator = true );
-  void                clear( bool clearHistory = false );
+  void                putMessage( const QString&, const int = DisplayNormal );
+  virtual void        putMessage( const QString&, const QColor&, const int = DisplayNormal );
+  void                clear( const bool = false );
 
-  bool                saveLog( const QString& fileName );
+  bool                saveLog( const QString& );
+
+  void                setMenuActions( const int );
+  int                 menuActions() const;
 
 protected slots:
   void                onSaveToFile();
@@ -90,16 +110,16 @@ private:
   void                updateActions();
 
 private:
-  QTextBrowser*       myView;
-  QString             myBanner;
-  QString             mySeparator;
-  QStringList         myHistory;
-  int                 myBannerSize;
-  QMap<int, QAction*> myActions;
+  QTextEdit*          myView;           //!< internal view window
+  QString             myBanner;         //!< current banner
+  QStringList         myHistory;        //!< messages history
+  QString             mySeparator;      //!< current separator
+  int                 myBannerSize;     //!< current banner's size
+  QMap<int, QAction*> myActions;        //!< popup menu actions
 };
 
 #ifdef WIN32
 #pragma warning( default:4251 )
 #endif
 
-#endif
+#endif // LOGWINDOW_H
diff --git a/src/LogWindow/LogWindow.pro b/src/LogWindow/LogWindow.pro
new file mode 100644 (file)
index 0000000..69eacdb
--- /dev/null
@@ -0,0 +1,49 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = LogWindow
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+INCLUDEPATH += ../../include ../Qtx ../SUIT
+LIBS += -L../../lib -lqtx -lsuit
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += LOGWINDOW_EXPORTS
+
+HEADERS = LogWindow.h
+
+SOURCES = LogWindow.cxx
+
+TRANSLATIONS = resources/LogWindow_msg_en.ts
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 83dcacd4309263ae8b508dfed93c0caa51df150a..391b5cd1153ac9f0b9f9f18753d4e6faaa6ee964 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : LogWindow
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libLogWindow.la
 
-salomeinclude_HEADERS= LogWindow.h
+salomeinclude_HEADERS = LogWindow.h
 
-dist_libLogWindow_la_SOURCES= LogWindow.cxx            
+dist_libLogWindow_la_SOURCES = LogWindow.cxx           
 
-MOC_FILES= LogWindow_moc.cxx
+MOC_FILES = LogWindow_moc.cxx
 nodist_libLogWindow_la_SOURCES = $(MOC_FILES)
 
-libLogWindow_la_CPPFLAGS=$(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+nodist_salomeres_DATA = \
+       LogWindow_msg_en.qm
 
-libLogWindow_la_LDFLAGS=$(QT_MT_LIBS) ../SUIT/libsuit.la ../Qtx/libqtx.la 
+libLogWindow_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+libLogWindow_la_LDFLAGS  = $(QT_MT_LIBS)
+libLogWindow_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la
 
 
diff --git a/src/LogWindow/resources/LogWindow_msg_en.ts b/src/LogWindow/resources/LogWindow_msg_en.ts
new file mode 100644 (file)
index 0000000..1154409
--- /dev/null
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS><TS version="1.1">
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+-->
+<context>
+    <name>LogWindow</name>
+    <message>
+        <location filename="../LogWindow.cxx" line="293"/>
+        <source>EDIT_COPY_CMD</source>
+        <translation>&amp;Copy</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="298"/>
+        <source>EDIT_CLEAR_CMD</source>
+        <translation>Clea&amp;r</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="303"/>
+        <source>EDIT_SELECTALL_CMD</source>
+        <translation>Select &amp;All</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="308"/>
+        <source>EDIT_SAVETOFILE_CMD</source>
+        <translation>&amp;Save log to file...</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="368"/>
+        <source>ERR_ERROR</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="368"/>
+        <source>ERR_CANT_SAVE_FILE</source>
+        <translation>Can&apos;t save file</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="368"/>
+        <source>BUT_OK</source>
+        <translation>&amp;OK</translation>
+    </message>
+</context>
+</TS>
index 1524bcbac7efa68e84f578099e808f85c07ab00c..e49a83136d84a6c3a1c7053116fdf0f39cbca20a 100755 (executable)
@@ -1,4 +1,6 @@
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Patrick GOLDBRONN (CEA)
 #  Module : SALOME
 # $Header$
-
-SUBDIRS = CASCatch Qtx Style DDS QDS SUIT STD CAF CAM SUITApp LogWindow ObjBrowser Prs
+#
+SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event
 
 if ENABLE_SALOMEOBJECT
   SUBDIRS += OBJECT
@@ -37,22 +37,22 @@ endif
 if ENABLE_VTKVIEWER
   SUBDIRS += VTKViewer
 if ENABLE_SALOMEOBJECT
-  SUBDIRS += SVTK
+    SUBDIRS += SVTK
 endif
 endif
 if ENABLE_OCCVIEWER
- SUBDIRS += OCCViewer
 SUBDIRS += OCCViewer
 if ENABLE_SALOMEOBJECT
-  SUBDIRS += SOCC
+    SUBDIRS += SOCC
 endif
 endif
 if ENABLE_PYCONSOLE
-  SUBDIRS += PyInterp PythonConsole
+  SUBDIRS += PyInterp PyConsole
 endif
 if ENABLE_PLOT2DVIEWER
   SUBDIRS += Plot2d
 if ENABLE_SALOMEOBJECT
-  SUBDIRS += SPlot2d
+    SUBDIRS += SPlot2d
 endif
 endif
 if ENABLE_SUPERVGRAPHVIEWER
@@ -61,9 +61,12 @@ endif
 if ENABLE_QXGRAPHVIEWER
   SUBDIRS += QxGraph
 endif
-SUBDIRS += LightApp ResExporter
+SUBDIRS += QxScene LightApp ResExporter
 
 if GUI_ENABLE_CORBA
-  SUBDIRS +=  RegistryDisplay TOOLSGUI \
-          Event Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
+  SUBDIRS += TOOLSGUI Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
 endif
+
+DIST_SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event \
+               OBJECT GLViewer VTKViewer SVTK OCCViewer SOCC PyInterp PyConsole Plot2d SPlot2d SUPERVGraph \
+               QxGraph QxScene LightApp ResExporter TOOLSGUI Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
index 342cf62217df60e2b8844d47e012d8fe4384d366..916806879f1b6333dc517382553c2bf660123c68 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : Handle_SALOME_AISObject.hxx
 //  Module : SALOME
-
+//
 #ifndef _Handle_SALOME_AISObject_HeaderFile
 #define _Handle_SALOME_AISObject_HeaderFile
 
index b987b929ad99e20536d32cd78ffb2cbc77f69582..a7e434013454dd270e25e17ec7aabfc1f79188e2 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : Handle_SALOME_AISShape.hxx
 //  Module : SALOME
-
+//
 #ifndef _Handle_SALOME_AISShape_HeaderFile
 #define _Handle_SALOME_AISShape_HeaderFile
 
index b94e60d004781f3b37d1d8948d90a4636dd075df..30b5d05979e2a70fcea1744039264484e9200c18 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
 //  Module : SALOME
-
+//
 #ifndef _Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_HeaderFile
 #define _Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_HeaderFile
 
index 8c229400619fc90d23bfa9a5cecf0a16d6ecd374..bb2345d08d2a19f959c0b475539c8e4cbb41419d 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : Handle_SALOME_Filter.hxx
 //  Module : SALOME
-
+//
 #ifndef _Handle_SALOME_Filter_HeaderFile
 #define _Handle_SALOME_Filter_HeaderFile
 
index 9bc3776c946cce8af9b99d2ea9fd097e116b5a6b..07423d80adf18ee2fad48ab5f2f70a9ff03180c8 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : Handle_SALOME_InteractiveObject.hxx
 //  Module : SALOME
-
+//
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
 #define _Handle_SALOME_InteractiveObject_HeaderFile
 
index e78995482fbba7f68bb1a6f84dfaa25e0f043b9a..5d1533399a5d72c76ca48f4b12db9fd53425851b 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : Handle_SALOME_ListNodeOfListIO.hxx
 //  Module : SALOME
-
+//
 #ifndef _Handle_SALOME_ListNodeOfListIO_HeaderFile
 #define _Handle_SALOME_ListNodeOfListIO_HeaderFile
 
index 4ca800e0415f38e2c916b99c973ff36427bf8cf6..464e4c51d5a7d922745a32aee7b9997f44874a4e 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : Handle_SALOME_TypeFilter.hxx
 //  Module : SALOME
-
+//
 #ifndef _Handle_SALOME_TypeFilter_HeaderFile
 #define _Handle_SALOME_TypeFilter_HeaderFile
 
@@ -35,7 +34,7 @@
 #endif
 
 #ifndef _Handle_SALOME_Filter_HeaderFile
-#include <Handle_SALOME_Filter.hxx>
+#include "Handle_SALOME_Filter.hxx"
 #endif
 
 class Standard_Transient;
index 106033a71d7297859524e02ed3aadcf720beeff1..b553128dd2db24236967a735063a2f523a1a56c7 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSalomeObject.la
 
-salomeinclude_HEADERS= \
-       SALOME_InteractiveObject.hxx \
-       Handle_SALOME_InteractiveObject.hxx \
-       SALOME_AISShape.hxx \
-       Handle_SALOME_AISShape.hxx \
-       SALOME_AISObject.hxx \
-       Handle_SALOME_AISObject.hxx \
-       SALOME_ListIO.hxx \
-       SALOME_ListIteratorOfListIO.hxx \
-       Handle_SALOME_ListNodeOfListIO.hxx \
-       SALOME_ListNodeOfListIO.hxx \
-       Handle_SALOME_Filter.hxx \
-       SALOME_Filter.hxx \
-       Handle_SALOME_TypeFilter.hxx \
-       SALOME_TypeFilter.hxx \
-       SALOME_DataMapOfIOMapOfInteger.hxx \
-       SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx \
-       Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx \
+salomeinclude_HEADERS =                                                \
+       SALOME_InteractiveObject.hxx                            \
+       Handle_SALOME_InteractiveObject.hxx                     \
+       SALOME_AISShape.hxx                                     \
+       Handle_SALOME_AISShape.hxx                              \
+       SALOME_AISObject.hxx                                    \
+       Handle_SALOME_AISObject.hxx                             \
+       SALOME_ListIO.hxx                                       \
+       SALOME_ListIteratorOfListIO.hxx                         \
+       Handle_SALOME_ListNodeOfListIO.hxx                      \
+       SALOME_ListNodeOfListIO.hxx                             \
+       Handle_SALOME_Filter.hxx                                \
+       SALOME_Filter.hxx                                       \
+       Handle_SALOME_TypeFilter.hxx                            \
+       SALOME_TypeFilter.hxx                                   \
+       SALOME_DataMapOfIOMapOfInteger.hxx                      \
+       SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx     \
+       SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx         \
+       Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx  \
        SALOME_Selection.h
 
-dist_libSalomeObject_la_SOURCES= \
-       SALOME_InteractiveObject.cxx \
-       SALOME_AISShape.cxx\
-       SALOME_AISObject.cxx\
-       SALOME_ListIO_0.cxx \
-       SALOME_ListIteratorOfListIO_0.cxx \
-       SALOME_ListNodeOfListIO_0.cxx \
-       SALOME_Filter.cxx \
-       SALOME_TypeFilter.cxx \
-       SALOME_DataMapOfIOMapOfInteger_0.cxx \
-       SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx \
+dist_libSalomeObject_la_SOURCES =                              \
+       SALOME_InteractiveObject.cxx                            \
+       SALOME_AISShape.cxx                                     \
+       SALOME_AISObject.cxx                                    \
+       SALOME_ListIO_0.cxx                                     \
+       SALOME_ListIteratorOfListIO_0.cxx                       \
+       SALOME_ListNodeOfListIO_0.cxx                           \
+       SALOME_Filter.cxx                                       \
+       SALOME_TypeFilter.cxx                                   \
+       SALOME_DataMapOfIOMapOfInteger_0.cxx                    \
+       SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx       \
        SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
 
-libSalomeObject_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS)
-libSalomeObject_la_LDFLAGS=$(QT_LIBS) $(CAS_LDPATH) -lTKV3d
+libSalomeObject_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS)
+libSalomeObject_la_LDFLAGS  = $(QT_LIBS) $(CAS_LDPATH) -lTKV3d
 
-EXTRA_DIST+= \
-       SALOME_AISObject.ixx \
-       SALOME_AISObject.jxx \
-       SALOME_AISShape.ixx \
-       SALOME_AISShape.jxx \
-       SALOME_Filter.ixx \
-       SALOME_Filter.jxx \
-       SALOME_InteractiveObject.ixx \
-       SALOME_InteractiveObject.jxx \
-       SALOME_TypeFilter.ixx \
-       SALOME_TypeFilter.jxx \
-       SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
+# internal (non-distributed) headers
+EXTRA_DIST +=                          \
+       SALOME_AISObject.ixx            \
+       SALOME_AISObject.jxx            \
+       SALOME_AISShape.ixx             \
+       SALOME_AISShape.jxx             \
+       SALOME_Filter.ixx               \
+       SALOME_Filter.jxx               \
+       SALOME_InteractiveObject.ixx    \
+       SALOME_InteractiveObject.jxx    \
+       SALOME_TypeFilter.ixx           \
+       SALOME_TypeFilter.jxx
diff --git a/src/OBJECT/OBJECT.pro b/src/OBJECT/OBJECT.pro
new file mode 100644 (file)
index 0000000..4f3f219
--- /dev/null
@@ -0,0 +1,87 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = SalomeObject
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+CAS_LDPATH = -L$${CASROOT}/Linux/lib -lTKV3d
+
+INCLUDEPATH += ../../include $${CAS_CPPFLAGS}
+LIBS += $${CAS_LDPATH}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = SALOME_InteractiveObject.hxx
+HEADERS += Handle_SALOME_InteractiveObject.hxx
+HEADERS += SALOME_AISShape.hxx
+HEADERS += Handle_SALOME_AISShape.hxx
+HEADERS += SALOME_AISObject.hxx
+HEADERS += Handle_SALOME_AISObject.hxx
+HEADERS += SALOME_ListIO.hxx
+HEADERS += SALOME_ListIteratorOfListIO.hxx
+HEADERS += Handle_SALOME_ListNodeOfListIO.hxx
+HEADERS += SALOME_ListNodeOfListIO.hxx
+HEADERS += Handle_SALOME_Filter.hxx
+HEADERS += SALOME_Filter.hxx
+HEADERS += Handle_SALOME_TypeFilter.hxx
+HEADERS += SALOME_TypeFilter.hxx
+HEADERS += SALOME_DataMapOfIOMapOfInteger.hxx
+HEADERS += SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx
+HEADERS += Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
+HEADERS += SALOME_Selection.h
+HEADERS += SALOME_AISObject.ixx
+HEADERS += SALOME_AISObject.jxx
+HEADERS += SALOME_AISShape.ixx
+HEADERS += SALOME_AISShape.jxx
+HEADERS += SALOME_Filter.ixx
+HEADERS += SALOME_Filter.jxx
+HEADERS += SALOME_InteractiveObject.ixx
+HEADERS += SALOME_InteractiveObject.jxx
+HEADERS += SALOME_TypeFilter.ixx
+HEADERS += SALOME_TypeFilter.jxx
+HEADERS += SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
+
+SOURCES  = SALOME_InteractiveObject.cxx
+SOURCES += SALOME_AISShape.cxx
+SOURCES += SALOME_AISObject.cxx
+SOURCES += SALOME_ListIO_0.cxx
+SOURCES += SALOME_ListIteratorOfListIO_0.cxx
+SOURCES += SALOME_ListNodeOfListIO_0.cxx
+SOURCES += SALOME_Filter.cxx
+SOURCES += SALOME_TypeFilter.cxx
+SOURCES += SALOME_DataMapOfIOMapOfInteger_0.cxx
+SOURCES += SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx
+SOURCES += SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+INSTALLS += includes
index c50184989b4ee0e15f9562ec54b211d16fe502a5..d7a0d9b04088b4f0b6839c2900c29ea004eb0db9 100755 (executable)
@@ -1,30 +1,29 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISObject.hxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
 //using namespace std;
+//
 #include "SALOME_AISObject.ixx"
index b89716f4c6044b6da5f93ab795f4c7cc95d75a17..56455d7adefd9c6df2a2c1a7dc50b261fb14ecfb 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISObject.hxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_AISObject_HeaderFile
 #define _SALOME_AISObject_HeaderFile
 
@@ -31,7 +30,7 @@
 #include <Standard.hxx>
 #endif
 #ifndef _Handle_SALOME_AISObject_HeaderFile
-#include <Handle_SALOME_AISObject.hxx>
+#include "Handle_SALOME_AISObject.hxx"
 #endif
 
 #ifndef _AIS_InteractiveObject_HeaderFile
index 11980b967363e287a9eb06eb36fe887d0e69cfab..df38078059118445d3b3e78b5570c32f4f87caaa 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISObject.ixx
 //  Module : SALOME
-
+//
 #include "SALOME_AISObject.jxx"
 
 #ifndef _Standard_TypeMismatch_HeaderFile
index 95635ee72453eb9aef498efaee905527299d4165..2284b4acd3a40f38b292a606cff52cef22c93e35 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISObject.jxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_InteractiveObject_HeaderFile
 #include "SALOME_InteractiveObject.hxx"
 #endif
index 52afc406d2770a67da6bc417a7465f470bfa62c0..3fa0c47b5c43f69479442a271b59bdc279c51f9e 100755 (executable)
@@ -1,32 +1,31 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISShape.hxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
 //using namespace std;
+//
 #include "SALOME_AISShape.ixx"
 
 /*!
index 4a8b87d98f3425f7b18e929aeddfdd24ed3075b2..ae878704b6b736242a9303c8d57c9a20a5ca6f08 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISShape.hxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_AISShape_HeaderFile
 #define _SALOME_AISShape_HeaderFile
 
@@ -31,7 +30,7 @@
 #include <Standard.hxx>
 #endif
 #ifndef _Handle_SALOME_AISShape_HeaderFile
-#include <Handle_SALOME_AISShape.hxx>
+#include "Handle_SALOME_AISShape.hxx"
 #endif
 
 #ifndef _Standard_CString_HeaderFile
index 11909336ec40a58b6367c6556ba9eec326dcb778..e67417c06793faf0fe4fc1ce622bd6c5547049ec 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISShape.ixx
 //  Module : SALOME
-
+//
 #include "SALOME_AISShape.jxx"
 
 #ifndef _Standard_TypeMismatch_HeaderFile
index cae6c5f545069f75d8b26421bba8e430a80c4e05..546cc63778f04beda038107c6b270782654389a7 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISShape.jxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_InteractiveObject_HeaderFile
 #include "SALOME_InteractiveObject.hxx"
 #endif
index 34ebe62d63b1d388ac787934de046fc0b89d779c..85441bfa3a0cdda834aa5d8c26baff46617a3fd0 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_HeaderFile
 #define _SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_HeaderFile
 
 #include <TCollection_BasicMapIterator.hxx>
 #endif
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include <Handle_SALOME_InteractiveObject.hxx>
+#include "Handle_SALOME_InteractiveObject.hxx"
 #endif
 #ifndef _Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_HeaderFile
-#include <Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx>
+#include "Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx"
 #endif
 class Standard_NoSuchObject;
 class SALOME_InteractiveObject;
index f24caa367e24a91d092ef10ef39bfd974a6bd0ad..57f6c3c6827c5ee61592a27a0097ceea99135ee0 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
 //  Module : SALOME
-
+//
 #include "SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx"
 
 #ifndef _Standard_NoSuchObject_HeaderFile
index 3c100b02e40d40a306dc4bf7faedb2fc98498a9f..4a97001888bbe3dfb32d0f1b89d67f239d2cf5bc 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_HeaderFile
 #define _SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_HeaderFile
 
 #include <Standard.hxx>
 #endif
 #ifndef _Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_HeaderFile
-#include <Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx>
+#include "Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx"
 #endif
 
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include <Handle_SALOME_InteractiveObject.hxx>
+#include "Handle_SALOME_InteractiveObject.hxx"
 #endif
 #ifndef _TColStd_IndexedMapOfInteger_HeaderFile
 #include <TColStd_IndexedMapOfInteger.hxx>
index b1a4c95fa131e5098696cd3efede42030fadd645..68dc7cad665caea2bc23d9bada83c0195798bf42 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx
 //  Module : SALOME
-
+//
 #include "SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx"
 
 #ifndef _Standard_TypeMismatch_HeaderFile
index f3aa034f7a0ccafa167c5a497bf926a907b0e9e8..74e65e737d9900fc8356f72e65dc5a26780e92ef 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapOfIOMapOfInteger.hxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_DataMapOfIOMapOfInteger_HeaderFile
 #define _SALOME_DataMapOfIOMapOfInteger_HeaderFile
 
 #include <TCollection_BasicMap.hxx>
 #endif
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include <Handle_SALOME_InteractiveObject.hxx>
+#include "Handle_SALOME_InteractiveObject.hxx"
 #endif
 #ifndef _Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_HeaderFile
-#include <Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx>
+#include "Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx"
 #endif
 #ifndef _Standard_Integer_HeaderFile
 #include <Standard_Integer.hxx>
index bf8f767945087da75d0b42aa840dee82c5e0570f..e07f3c2ae1ac4e501ff9fea47c4180e072157ee0 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapOfIOMapOfInteger_0.cxx
 //  Module : SALOME
-
+//
 #include "SALOME_DataMapOfIOMapOfInteger.hxx"
 
 #ifndef _Standard_DomainError_HeaderFile
index 79ba21691c6f5f930e6d8bc703bc8afa7e5a5684..78626c23ae09d7dd2aedcac807c26f5a5f21f036 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Filter.cxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SALOME_Filter.ixx"
 using namespace std;
 
index 4386503a5f7b26b71d2f758b0c15477f8d88d3e0..29735f5da0b25854cc788a82bba251a6b72f0d8d 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Filter.hxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_Filter_HeaderFile
 #define _SALOME_Filter_HeaderFile
 
@@ -31,7 +30,7 @@
 #include <Standard.hxx>
 #endif
 #ifndef _Handle_SALOME_Filter_HeaderFile
-#include <Handle_SALOME_Filter.hxx>
+#include "Handle_SALOME_Filter.hxx"
 #endif
 
 #ifndef _MMgt_TShared_HeaderFile
@@ -41,7 +40,7 @@
 #include <Standard_Boolean.hxx>
 #endif
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include <Handle_SALOME_InteractiveObject.hxx>
+#include "Handle_SALOME_InteractiveObject.hxx"
 #endif
 
 class SALOME_Filter : public MMgt_TShared {
index c872cef3f62384336dca013b2b1ba61c5cf3d65e..1745ba8c43866467474d512532af83dd28e384e0 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Filter.ixx
 //  Module : SALOME
-
+//
 #include "SALOME_Filter.jxx"
 
 #ifndef _Standard_TypeMismatch_HeaderFile
index db8562e5a021a1c82912b9337948b5b9d3fe2762..21f56047da0e1db44cc586b73679df7c93d9eca7 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Filter.jxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_Filter_HeaderFile
 #include "SALOME_Filter.hxx"
 #endif
index 53d93c062d7091820c9a5c716c0e1ddce8e18a6f..e65c01f6ba1d93ac0055d214deaaf69ee6ac845e 100755 (executable)
@@ -1,32 +1,31 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_InteractiveObject.cxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
 //using namespace std;
+//
 /*!
   \class SALOME_InteractiveObject SALOME_InteractiveObject.hxx
   \brief ...
index 712d96d3ba6077594cd303445bf78b8a62053d0b..fb2ff43001ab7cae30b928f0941dbd06023e2f36 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_InteractiveObject.hxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_InteractiveObject_HeaderFile
 #define _SALOME_InteractiveObject_HeaderFile
 
@@ -31,7 +30,7 @@
 #include <Standard.hxx>
 #endif
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include <Handle_SALOME_InteractiveObject.hxx>
+#include "Handle_SALOME_InteractiveObject.hxx"
 #endif
 
 #ifndef _Standard_CString_HeaderFile
index ef92c07c6f7d64ee6f7012c02a51ed7d68d9e1aa..31b640c7d62221283006836e6e14cb640c4d2bee 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_InteractiveObject.ixx
 //  Module : SALOME
-
+//
 #include "SALOME_InteractiveObject.jxx"
 
 #ifndef _Standard_TypeMismatch_HeaderFile
index 0c3fc7db5a2790f8be6db7d6a34fad4a8e9e5562..215d3d2f48c4f9618579f7743d2b4ea9a2a0ecbc 100755 (executable)
@@ -1,29 +1,28 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_InteractiveObject.jxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_InteractiveObject_HeaderFile
 #include "SALOME_InteractiveObject.hxx"
 #endif
index 7f52828d4f54afc0619e9d36a4a7be26340d1d01..4b2e81255d7f4ab5ffa6916b78ed38f66a38749d 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListIO.hxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_ListIO_HeaderFile
 #define _SALOME_ListIO_HeaderFile
 
 #include <Standard_Address.hxx>
 #endif
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include <Handle_SALOME_InteractiveObject.hxx>
+#include "Handle_SALOME_InteractiveObject.hxx"
 #endif
 #ifndef _Handle_SALOME_ListNodeOfListIO_HeaderFile
-#include <Handle_SALOME_ListNodeOfListIO.hxx>
+#include "Handle_SALOME_ListNodeOfListIO.hxx"
 #endif
 #ifndef _Standard_Integer_HeaderFile
 #include <Standard_Integer.hxx>
index 7538c4744edf183c904b5a6ce01d12bef211e89b..97af181b5430869105ab157c577a5c807db1c57c 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListIO_0.cxx
 //  Module : SALOME
-
+//
 #include "SALOME_ListIO.hxx"
 
 #ifndef _Standard_NoSuchObject_HeaderFile
index e69f42d5ce6538a62ca843473211119297d29e6a..eb355c7f99e411bdc27e000a0b88721583c96466 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListIteratorOfListIO.hxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_ListIteratorOfListIO_HeaderFile
 #define _SALOME_ListIteratorOfListIO_HeaderFile
 
 #include <Standard_Address.hxx>
 #endif
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include <Handle_SALOME_InteractiveObject.hxx>
+#include "Handle_SALOME_InteractiveObject.hxx"
 #endif
 #ifndef _Handle_SALOME_ListNodeOfListIO_HeaderFile
-#include <Handle_SALOME_ListNodeOfListIO.hxx>
+#include "Handle_SALOME_ListNodeOfListIO.hxx"
 #endif
 #ifndef _Standard_Boolean_HeaderFile
 #include <Standard_Boolean.hxx>
index 6f5fb7f85d523e76e13ac0b4daf88bb42936db66..54dc233bd7f626bac714743cfc6ff0703adf5f3b 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListIteratorOfListIO_0.cxx
 //  Module : SALOME
-
+//
 #include "SALOME_ListIteratorOfListIO.hxx"
 
 #ifndef _Standard_NoMoreObject_HeaderFile
index 6d288bcab656eff742212d23d9b938e814aed05a..e3579c28ead25a07994731bfec9f050a958da878 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListNodeOfListIO.hxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_ListNodeOfListIO_HeaderFile
 #define _SALOME_ListNodeOfListIO_HeaderFile
 
 #include <Standard.hxx>
 #endif
 #ifndef _Handle_SALOME_ListNodeOfListIO_HeaderFile
-#include <Handle_SALOME_ListNodeOfListIO.hxx>
+#include "Handle_SALOME_ListNodeOfListIO.hxx"
 #endif
 
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include <Handle_SALOME_InteractiveObject.hxx>
+#include "Handle_SALOME_InteractiveObject.hxx"
 #endif
 #ifndef _TCollection_MapNode_HeaderFile
 #include <TCollection_MapNode.hxx>
index 63fda117c103c8c7be265ad9181eda61b5bf9457..f69e501e7efcf5a5fd26fa4e7531c5ec82d661fa 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListNodeOfListIO_0.cxx
 //  Module : SALOME
-
+//
 #include "SALOME_ListNodeOfListIO.hxx"
 
 #ifndef _Standard_TypeMismatch_HeaderFile
index 696f68f5531d9aeb2a07bf3ac0032782c3ad21e3..0e5fb270596b6d242cfc7218a3d218a8c9f94826 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME Selection : description of enumeration Selection_Mode
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME Selection : description of enumeration Selection_Mode
 //  File   : SALOME_Selection.h
 //  Author :
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SALOME_SELECTION_H
 #define SALOME_SELECTION_H
 
index 57d6390a2391e5f345e96f2d77ed336a0a50e26f..62db81b46c67ed16a80dde05e04d9f567fe27328 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_TypeFilter.cxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SALOME_TypeFilter.ixx"
 #include "SALOME_InteractiveObject.hxx"
 using namespace std;
index 5a32301fe3dc714a219e4697b076cda4174dc230..178618c30322a6fa49d97da86d9cba0df4d24062 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_TypeFilter.hxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_TypeFilter_HeaderFile
 #define _SALOME_TypeFilter_HeaderFile
 
@@ -31,7 +30,7 @@
 #include <Standard.hxx>
 #endif
 #ifndef _Handle_SALOME_TypeFilter_HeaderFile
-#include <Handle_SALOME_TypeFilter.hxx>
+#include "Handle_SALOME_TypeFilter.hxx"
 #endif
 
 #ifndef _Standard_CString_HeaderFile
index 13e1a3ec1d3128d06a756d1142606128000bfca7..6e2350a0d7759eba4d788183e61486e2c6f59907 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_TypeFilter.ixx
 //  Module : SALOME
-
+//
 #include "SALOME_TypeFilter.jxx"
 
 #ifndef _Standard_TypeMismatch_HeaderFile
index d519586d78b7e85887fe2fab571ea1f49f7a9490..58d9312fcca86c7b5de6f384b8c07b4fd4fb82d3 100644 (file)
@@ -1,29 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_TypeFilter.jxx
 //  Module : SALOME
-
+//
 #ifndef _SALOME_TypeFilter_HeaderFile
 #include "SALOME_TypeFilter.hxx"
 #endif
index 2bfc88875c944a25c531834f447e6d200a309e58..7e77377e21edd18ade767dbbccecd39a8b4bbeda 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : OCCViewer
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libOCCViewer.la
 
-salomeinclude_HEADERS= \
-       OCCViewer_AISSelector.h \
-       OCCViewer_ViewManager.h \
-       OCCViewer_ViewModel.h \
-       OCCViewer_ViewPort3d.h \
-       OCCViewer_ViewPort.h \
-       OCCViewer_ViewSketcher.h \
-       OCCViewer_ViewWindow.h \
-       OCCViewer_VService.h \
-       OCCViewer_CreateRestoreViewDlg.h \
-       OCCViewer.h \
-       OCCViewer_ClippingDlg.h \
-       OCCViewer_SetRotationPointDlg.h
+salomeinclude_HEADERS =                                \
+       OCCViewer_AISSelector.h                 \
+       OCCViewer_ViewManager.h                 \
+       OCCViewer_ViewModel.h                   \
+       OCCViewer_ViewPort3d.h                  \
+       OCCViewer_ViewPort.h                    \
+       OCCViewer_ViewSketcher.h                \
+       OCCViewer_ViewWindow.h                  \
+       OCCViewer_VService.h                    \
+       OCCViewer_CreateRestoreViewDlg.h        \
+       OCCViewer.h                             \
+       OCCViewer_ClippingDlg.h                 \
+       OCCViewer_AxialScaleDlg.h               \
+       OCCViewer_SetRotationPointDlg.h         \
+       OCCViewer_Trihedron.h
 
-dist_libOCCViewer_la_SOURCES= \
-       OCCViewer_AISSelector.cxx \
-       OCCViewer_ViewManager.cxx \
-       OCCViewer_ViewModel.cxx \
-       OCCViewer_ViewPort3d.cxx \
-       OCCViewer_ViewPort.cxx \
-       OCCViewer_ViewSketcher.cxx \
-       OCCViewer_ViewWindow.cxx \
-       OCCViewer_VService.cxx \
-       OCCViewer_CreateRestoreViewDlg.cxx \
-       OCCViewer_SetRotationPointDlg.cxx \
-       OCCViewer_ClippingDlg.cxx
+dist_libOCCViewer_la_SOURCES =                 \
+       OCCViewer_AISSelector.cxx               \
+       OCCViewer_ViewManager.cxx               \
+       OCCViewer_ViewModel.cxx                 \
+       OCCViewer_ViewPort3d.cxx                \
+       OCCViewer_ViewPort.cxx                  \
+       OCCViewer_ViewSketcher.cxx              \
+       OCCViewer_ViewWindow.cxx                \
+       OCCViewer_VService.cxx                  \
+       OCCViewer_CreateRestoreViewDlg.cxx      \
+       OCCViewer_SetRotationPointDlg.cxx       \
+       OCCViewer_ClippingDlg.cxx               \
+       OCCViewer_AxialScaleDlg.cxx             \
+       OCCViewer_Trihedron.cxx                 \
+       OCCViewer_ToolTip.cxx
 
-MOC_FILES= \
-       OCCViewer_AISSelector_moc.cxx \
-       OCCViewer_ViewModel_moc.cxx \
-       OCCViewer_ViewPort3d_moc.cxx \
-       OCCViewer_ViewPort_moc.cxx \
-       OCCViewer_ViewSketcher_moc.cxx \
-       OCCViewer_ViewWindow_moc.cxx \
-       OCCViewer_ViewManager_moc.cxx \
-       OCCViewer_CreateRestoreViewDlg_moc.cxx \
-       OCCViewer_SetRotationPointDlg_moc.cxx \
-       OCCViewer_ClippingDlg_moc.cxx
-nodist_libOCCViewer_la_SOURCES= $(MOC_FILES)
+MOC_FILES =                                    \
+       OCCViewer_AISSelector_moc.cxx           \
+       OCCViewer_ViewModel_moc.cxx             \
+       OCCViewer_ViewPort3d_moc.cxx            \
+       OCCViewer_ViewPort_moc.cxx              \
+       OCCViewer_ViewSketcher_moc.cxx          \
+       OCCViewer_ViewWindow_moc.cxx            \
+       OCCViewer_ViewManager_moc.cxx           \
+       OCCViewer_CreateRestoreViewDlg_moc.cxx  \
+       OCCViewer_SetRotationPointDlg_moc.cxx   \
+       OCCViewer_ClippingDlg_moc.cxx           \
+       OCCViewer_AxialScaleDlg_moc.cxx         \
+       OCCViewer_ToolTip_moc.cxx
+       
+nodist_libOCCViewer_la_SOURCES = $(MOC_FILES)
 
-dist_salomeres_DATA = \
-       resources/view_back.png \
-       resources/view_bottom.png \
-       resources/view_camera_dump.png \
-       resources/view_clone.png \
-       resources/view_clipping.png \
-       resources/view_clipping_pressed.png \
-       resources/view_fitall.png \
-       resources/view_fitarea.png \
-       resources/view_front.png \
-       resources/view_glpan.png \
-       resources/view_left.png \
-       resources/view_pan.png \
-       resources/view_presets.png \
-       resources/view_reset.png \
-       resources/view_right.png \
-       resources/view_rotate.png \
-       resources/view_shoot.png \
-       resources/view_top.png \
-       resources/view_triedre.png \
-       resources/view_zoom.png \
-       resources/view_rotation_point.png
+dist_salomeres_DATA =                          \
+       resources/occ_view_back.png             \
+       resources/occ_view_bottom.png           \
+       resources/occ_view_camera_dump.png      \
+       resources/occ_view_clone.png            \
+       resources/occ_view_clipping.png         \
+       resources/occ_view_clipping_pressed.png \
+       resources/occ_view_scaling.png          \
+       resources/occ_view_fitall.png           \
+       resources/occ_view_fitarea.png          \
+       resources/occ_view_front.png            \
+       resources/occ_view_glpan.png            \
+       resources/occ_view_left.png             \
+       resources/occ_view_pan.png              \
+       resources/occ_view_presets.png          \
+       resources/occ_view_reset.png            \
+       resources/occ_view_right.png            \
+       resources/occ_view_rotate.png           \
+       resources/occ_view_shoot.png            \
+       resources/occ_view_top.png              \
+       resources/occ_view_triedre.png          \
+       resources/occ_view_zoom.png             \
+       resources/occ_view_rotation_point.png
 
-nodist_salomeres_DATA = \
-       OCCViewer_images.qm \
+nodist_salomeres_DATA =                \
+       OCCViewer_images.qm     \
        OCCViewer_msg_en.qm 
 
-libOCCViewer_la_CPPFLAGS=$(QT_INCLUDES) $(OGL_INCLUDES) $(CAS_CPPFLAGS) \
+libOCCViewer_la_CPPFLAGS = $(QT_INCLUDES) $(OGL_INCLUDES) $(CAS_CPPFLAGS) \
        -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
 
-libOCCViewer_la_LDFLAGS=$(OGL_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) $(CAS_VIEWER) ../SUIT/libsuit.la
+libOCCViewer_la_LDFLAGS  = $(OGL_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) $(CAS_VIEWER)
+libOCCViewer_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la
index 724486cb9ad7ed3cd31cfb721059e1e1111344b0..6f2948d8e7cbd43aeaba905b15324ff5c17d680f 100755 (executable)
@@ -1,22 +1,25 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#ifdef WNT
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifdef WIN32
 #ifdef OCCVIEWER_EXPORTS
 #define OCCVIEWER_EXPORT __declspec(dllexport)
 #else
@@ -26,6 +29,6 @@
 #define OCCVIEWER_EXPORT
 #endif
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
diff --git a/src/OCCViewer/OCCViewer.pro b/src/OCCViewer/OCCViewer.pro
new file mode 100644 (file)
index 0000000..b5560bb
--- /dev/null
@@ -0,0 +1,82 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = OCCViewer
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+OGL_INCLUDES = 
+
+OGL_LIBS = -lGL -L/usr/X11R6/lib -lGLU
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
+
+CAS_VIEWER = -L$${CASROOT}/Linux/lib -lTKV3d -lTKService
+
+INCLUDEPATH += ../../include $${OGL_INCLUDES} $${CAS_CPPFLAGS} ../Qtx ../SUIT
+LIBS += -L../../lib -lqtx -lsuit $${OGL_LIBS} $${CAS_KERNEL} $${CAS_VIEWER}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += OCCVIEWER_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = OCCViewer_AISSelector.h
+HEADERS += OCCViewer_ViewManager.h
+HEADERS += OCCViewer_ViewModel.h
+HEADERS += OCCViewer_ViewPort3d.h
+HEADERS += OCCViewer_ViewPort.h
+HEADERS += OCCViewer_ViewWindow.h
+HEADERS += OCCViewer_VService.h
+HEADERS += OCCViewer_CreateRestoreViewDlg.h
+HEADERS += OCCViewer.h
+HEADERS += OCCViewer_ClippingDlg.h
+HEADERS += OCCViewer_SetRotationPointDlg.h
+
+SOURCES  = OCCViewer_AISSelector.cxx
+SOURCES += OCCViewer_ViewManager.cxx
+SOURCES += OCCViewer_ViewModel.cxx
+SOURCES += OCCViewer_ViewPort3d.cxx
+SOURCES += OCCViewer_ViewPort.cxx
+SOURCES += OCCViewer_ViewWindow.cxx
+SOURCES += OCCViewer_VService.cxx
+SOURCES += OCCViewer_CreateRestoreViewDlg.cxx
+SOURCES += OCCViewer_SetRotationPointDlg.cxx
+SOURCES += OCCViewer_ClippingDlg.cxx
+
+TRANSLATIONS = resources/OCCViewer_images.ts \
+               resources/OCCViewer_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 43dca4567fd814d9961b58c85f1383a29e008c37..44b55e471281af7c3102f216b12c5a3e0094b1f6 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "OCCViewer_AISSelector.h"
 
index 740c8f01322207e21159533d8d1e4eb911e33c70..a311b47d41605ce5e84ff1b52760005b39e7627c 100755 (executable)
@@ -1,26 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #if !defined( OCCVIEWER_AISSELECTOR_H )
 #define OCCVIEWER_AISSELECTOR_H
 
 #include "OCCViewer.h"
-#include <qobject.h>
+#include <QObject>
 
 #include <Quantity_NameOfColor.hxx>
 #include <AIS_InteractiveContext.hxx>
diff --git a/src/OCCViewer/OCCViewer_AxialScaleDlg.cxx b/src/OCCViewer/OCCViewer_AxialScaleDlg.cxx
new file mode 100644 (file)
index 0000000..d670db0
--- /dev/null
@@ -0,0 +1,180 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "OCCViewer_AxialScaleDlg.h"
+#include "OCCViewer_ViewWindow.h"
+#include "OCCViewer_ViewPort3d.h"
+
+#include <QtxDoubleSpinBox.h>
+
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+
+/*!
+  \class OCCViewer_AxialScaleDlg
+  \brief Dialog allowing to assign parameters of axes scaling
+*/
+
+/*!
+  \brief Constructor
+  \param view - view window
+  \param parent - parent widget
+*/
+OCCViewer_AxialScaleDlg::OCCViewer_AxialScaleDlg( OCCViewer_ViewWindow* view, QWidget* parent )
+  : QDialog( parent ),
+    myView( view )
+{
+  setWindowTitle( tr( "DLG_SCALING" ) );
+  setModal( false );
+  setSizeGripEnabled( true );
+
+  // Create layout for this dialog
+  QVBoxLayout* layoutDlg = new QVBoxLayout( this );
+  layoutDlg->setSpacing( 6 );
+  layoutDlg->setMargin( 11 );
+
+  // Create croup box with grid layout
+  QGroupBox* aGroupBox = new QGroupBox( this );
+  QHBoxLayout* aHBoxLayout = new QHBoxLayout( aGroupBox );
+  aHBoxLayout->setMargin( 11 );
+  aHBoxLayout->setSpacing( 6 );
+
+  // "X" scaling
+  QLabel* TextLabelX = new QLabel( tr( "LBL_X" ), aGroupBox );
+  m_sbXcoeff = new QtxDoubleSpinBox( 1e-7, RealLast(), 0.1, aGroupBox );
+  m_sbXcoeff->setMinimumWidth( 80 );
+  m_sbXcoeff->setValue( 1.0 );
+
+  // "Y" scaling
+  QLabel* TextLabelY = new QLabel( tr( "LBL_Y" ), aGroupBox );
+  m_sbYcoeff = new QtxDoubleSpinBox( 1e-7, RealLast(), 0.1, aGroupBox );
+  m_sbYcoeff->setMinimumWidth( 80 );
+  m_sbYcoeff->setValue( 1.0 );
+
+  // "Z" scaling
+  QLabel* TextLabelZ = new QLabel( tr( "LBL_Z" ), aGroupBox );
+  m_sbZcoeff = new QtxDoubleSpinBox( 1e-7, RealLast(), 0.1, aGroupBox );
+  m_sbZcoeff->setMinimumWidth( 80 );
+  m_sbZcoeff->setValue( 1.0 );
+
+  // Create <Reset> button
+  m_bReset = new QPushButton( tr( "&Reset" ), aGroupBox );
+
+  // Layout widgets in the group box
+  aHBoxLayout->addWidget( TextLabelX );
+  aHBoxLayout->addWidget( m_sbXcoeff );
+  aHBoxLayout->addWidget( TextLabelY );
+  aHBoxLayout->addWidget( m_sbYcoeff );
+  aHBoxLayout->addWidget( TextLabelZ );
+  aHBoxLayout->addWidget( m_sbZcoeff );
+  aHBoxLayout->addSpacing( 10 );
+  aHBoxLayout->addWidget( m_bReset );
+
+  // OK, CANCEL, Apply button
+  QGroupBox* aGroupBox2 = new QGroupBox( this );
+  QHBoxLayout* aHBoxLayout2 = new QHBoxLayout( aGroupBox2 );
+  aHBoxLayout2->setMargin( 11 );
+  aHBoxLayout2->setSpacing( 6 );
+  // Create <OK> button
+  QPushButton* m_bOk = new QPushButton( tr( "O&K" ), aGroupBox2 );
+  m_bOk->setDefault( true );
+  m_bOk->setAutoDefault( true );
+  // Create <Apply> button
+  QPushButton* m_bApply = new QPushButton( tr( "&Apply" ), aGroupBox2 );
+  m_bApply->setAutoDefault( true );
+  // Create <Cancel> button
+  QPushButton* m_bCancel = new QPushButton( tr( "&Cancel" ), aGroupBox2 );
+  m_bCancel->setAutoDefault( true );
+
+  // Layout buttons
+  aHBoxLayout2->addWidget( m_bOk );
+  aHBoxLayout2->addWidget( m_bApply );
+  aHBoxLayout2->addSpacing( 10 );
+  aHBoxLayout2->addStretch();
+  aHBoxLayout2->addWidget( m_bCancel );
+
+  // Layout top level widgets
+  layoutDlg->addWidget( aGroupBox );
+  layoutDlg->addWidget( aGroupBox2 );
+
+  // signals and slots connections
+  connect( m_bCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( m_bOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
+  connect( m_bApply,  SIGNAL( clicked() ), this, SLOT( apply() ) );
+  connect( m_bReset,  SIGNAL( clicked() ), this, SLOT( reset() ) );
+
+  connect( view,      SIGNAL( Hide( QHideEvent* ) ), this, SLOT( hide() ) );
+
+  resize( minimumSizeHint() );
+}
+
+/*!
+  \brief Destructor
+*/
+OCCViewer_AxialScaleDlg::~OCCViewer_AxialScaleDlg()
+{
+}
+
+/*!
+  \brief Update widgets values from the view
+*/
+void OCCViewer_AxialScaleDlg::Update()
+{
+  // Get values from the OCC view
+  double aScaleFactor[3];
+  myView->getViewPort()->getView()->AxialScale( aScaleFactor[0], aScaleFactor[1], aScaleFactor[2] );
+  m_sbXcoeff->setValue( aScaleFactor[0] );
+  m_sbYcoeff->setValue( aScaleFactor[1] );
+  m_sbZcoeff->setValue( aScaleFactor[2] );
+}
+
+/*!
+  \brief Called when <OK> button is pressed
+*/
+void OCCViewer_AxialScaleDlg::accept()
+{
+  if ( apply() )
+    QDialog::accept();
+}
+
+/*!
+  \brief Called when <Apply> button is pressed
+*/
+bool OCCViewer_AxialScaleDlg::apply()
+{
+  double aScaleFactor[3] = { m_sbXcoeff->value(), m_sbYcoeff->value(), m_sbZcoeff->value() };
+  myView->getViewPort()->getView()->SetAxialScale( aScaleFactor[0], aScaleFactor[1], aScaleFactor[2] );
+  return true;
+}
+
+/*!
+  \brief Called when <Reset> button is pressed
+*/
+void OCCViewer_AxialScaleDlg::reset()
+{
+  m_bReset->setFocus();
+  m_sbXcoeff->setValue( 1.0 );
+  m_sbYcoeff->setValue( 1.0 );
+  m_sbZcoeff->setValue( 1.0 );
+}
diff --git a/src/OCCViewer/OCCViewer_AxialScaleDlg.h b/src/OCCViewer/OCCViewer_AxialScaleDlg.h
new file mode 100644 (file)
index 0000000..5bb7080
--- /dev/null
@@ -0,0 +1,56 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef OCCVIEWER_AXIALSCALEDLG_H
+#define OCCVIEWER_AXIALSCALEDLG_H
+
+#include "OCCViewer.h"
+
+#include <QDialog>
+
+class OCCViewer_ViewWindow;
+class QtxDoubleSpinBox;
+class QPushButton;
+
+class OCCVIEWER_EXPORT OCCViewer_AxialScaleDlg : public QDialog
+{
+  Q_OBJECT
+
+public:
+  OCCViewer_AxialScaleDlg( OCCViewer_ViewWindow*, QWidget* = 0 );
+  ~OCCViewer_AxialScaleDlg();
+
+  void Update();
+
+protected slots:
+  bool apply();
+  void reset();
+  void accept();
+
+private:
+  OCCViewer_ViewWindow* myView;
+  QtxDoubleSpinBox*     m_sbXcoeff;
+  QtxDoubleSpinBox*     m_sbYcoeff;
+  QtxDoubleSpinBox*     m_sbZcoeff;
+  QPushButton*          m_bReset;
+};
+
+#endif // OCCVIEWER_AXIALSCALEDLG_H
index 106e28b8f936830b36ecdabc02cf7ed7b8e78423..11213fd3898dab5d2ef9af9049d13ab652c42ed8 100644 (file)
@@ -1,33 +1,37 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "OCCViewer_ClippingDlg.h"
 
-#include <QtxDblSpinBox.h>
+#include <QtxDoubleSpinBox.h>
 #include <QtxAction.h>
 
 #include "SUIT_Session.h"
 #include "SUIT_ViewWindow.h"
+#include "SUIT_ViewManager.h"
 #include "OCCViewer_ViewWindow.h"
 #include "OCCViewer_ViewPort3d.h"
+#include "OCCViewer_ViewModel.h"
 
 #include <V3d_View.hxx>
-//#include <V3d.hxx>
 #include <Geom_Plane.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 #include <gp_Pln.hxx>
 
 // QT Includes
-#include <qapplication.h>
-#include <qgroupbox.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
+#include <QApplication>
+#include <QGroupBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QLabel>
+#include <QPushButton>
+#include <QComboBox>
+#include <QCheckBox>
 
 /*!
   Constructor
   \param modal - is this dialog modal
   \param fl - flags
 */
-OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidget* parent, const char* name, bool modal, WFlags fl )
-: QDialog( parent, "OCCViewer_ClippingDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
+OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl )
+: QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
   myView( view )
 {
-  setCaption( tr( "Clipping" ) );
+  setObjectName( "OCCViewer_ClippingDlg" );
+  setModal( modal );
+
+  setWindowTitle( tr( "Clipping" ) );
   
   QVBoxLayout* topLayout = new QVBoxLayout( this );
   topLayout->setMargin( 11 ); topLayout->setSpacing( 6 );
   
   /***************************************************************/
-  GroupPoint = new QGroupBox( this, "GroupPoint" );
+  GroupPoint = new QGroupBox( this );
+  GroupPoint->setObjectName( "GroupPoint" );
   GroupPoint->setTitle( tr("Base point") );
-  GroupPoint->setColumnLayout(0, Qt::Vertical );
-  GroupPoint->layout()->setSpacing( 0 );
-  GroupPoint->layout()->setMargin( 0 );
-  QGridLayout* GroupPointLayout = new QGridLayout( GroupPoint->layout() );
+  QGridLayout* GroupPointLayout = new QGridLayout( GroupPoint );
   GroupPointLayout->setAlignment( Qt::AlignTop );
   GroupPointLayout->setSpacing( 6 );
   GroupPointLayout->setMargin( 11 );
   
   // Controls
-  const double min = -1e+16;
-  const double max =  1e+16;
+  const double min = -1e+7;
+  const double max =  1e+7;
   const double step = 5;
-  const int precision = -6; // PAL12789. Minus is for using 'g' double->string conversion specifier,
-  //                          see QtxDblSpinBox::mapValueToText( double v )
+  const int precision = 3;
 
-  TextLabelX = new QLabel( GroupPoint, "TextLabelX" );
+  TextLabelX = new QLabel( GroupPoint );
+  TextLabelX->setObjectName( "TextLabelX" );
   TextLabelX->setText( tr("X:") );
   GroupPointLayout->addWidget( TextLabelX, 0, 0 );
   
-  SpinBox_X = new QtxDblSpinBox( min, max, step, GroupPoint, "SpinBox_X" );
-  SpinBox_X->setPrecision( precision );
+  SpinBox_X = new QtxDoubleSpinBox( min, max, step, GroupPoint );
+  SpinBox_X->setObjectName("SpinBox_X" );
+  SpinBox_X->setDecimals( precision );
   GroupPointLayout->addWidget( SpinBox_X, 0, 1 );
 
-  TextLabelY = new QLabel( GroupPoint, "TextLabelY" );
+  TextLabelY = new QLabel( GroupPoint );
+  TextLabelY->setObjectName( "TextLabelY" );
   TextLabelY->setText( tr("Y:") );
   GroupPointLayout->addWidget( TextLabelY, 0, 2 );
 
-  SpinBox_Y = new QtxDblSpinBox( min, max, step, GroupPoint, "SpinBox_Y" );
-  SpinBox_Y->setPrecision( precision );
+  SpinBox_Y = new QtxDoubleSpinBox( min, max, step, GroupPoint );
+  SpinBox_Y->setObjectName("SpinBox_Y" );
+  SpinBox_Y->setDecimals( precision );
   GroupPointLayout->addWidget( SpinBox_Y, 0, 3 );
 
-  TextLabelZ = new QLabel( GroupPoint, "TextLabelZ" );
+  TextLabelZ = new QLabel( GroupPoint );
+  TextLabelZ->setObjectName( "TextLabelZ" );
   TextLabelZ->setText( tr("Z:") );
   GroupPointLayout->addWidget( TextLabelZ, 0, 4 );
 
-  SpinBox_Z = new QtxDblSpinBox( min, max, step, GroupPoint, "SpinBox_Z" );
-  SpinBox_Z->setPrecision( precision );
+  SpinBox_Z = new QtxDoubleSpinBox( min, max, step, GroupPoint );
+  SpinBox_Z->setObjectName("SpinBox_Z" );
+  SpinBox_Z->setDecimals( precision );
   GroupPointLayout->addWidget( SpinBox_Z, 0, 5 );
 
-  resetButton  = new QPushButton( GroupPoint, "resetButton" );
+  resetButton  = new QPushButton( GroupPoint );
+  resetButton->setObjectName( "resetButton" );
   resetButton->setText( tr( "Reset"  ) );
   GroupPointLayout->addWidget( resetButton, 0, 6 );
 
   /***************************************************************/
-  GroupDirection = new QGroupBox( this, "GroupDirection" );
+  GroupDirection = new QGroupBox( this );
+  GroupDirection->setObjectName( "GroupDirection" );
   GroupDirection->setTitle( tr("Direction") );
-  GroupDirection->setColumnLayout(0, Qt::Vertical );
-  GroupDirection->layout()->setSpacing( 0 );
-  GroupDirection->layout()->setMargin( 0 );
-  QGridLayout* GroupDirectionLayout = new QGridLayout( GroupDirection->layout() );
+  QGridLayout* GroupDirectionLayout = new QGridLayout( GroupDirection );
   GroupDirectionLayout->setAlignment( Qt::AlignTop );
   GroupDirectionLayout->setSpacing( 6 );
   GroupDirectionLayout->setMargin( 11 );
   
   // Controls
-  TextLabelDx = new QLabel( GroupDirection, "TextLabelDx" );
+  TextLabelDx = new QLabel( GroupDirection );
+  TextLabelDx->setObjectName( "TextLabelDx" );
   TextLabelDx->setText( tr("Dx:") );
   GroupDirectionLayout->addWidget( TextLabelDx, 0, 0 );
   
-  SpinBox_Dx = new QtxDblSpinBox( min, max, step, GroupDirection, "SpinBox_Dx" );
-  SpinBox_Dx->setPrecision( precision );
+  SpinBox_Dx = new QtxDoubleSpinBox( min, max, step, GroupDirection );
+  SpinBox_Dx->setObjectName("SpinBox_Dx" );
+  SpinBox_Dx->setDecimals( precision );
   GroupDirectionLayout->addWidget( SpinBox_Dx, 0, 1 );
 
-  TextLabelDy = new QLabel( GroupDirection, "TextLabelDy" );
+  TextLabelDy = new QLabel( GroupDirection );
+  TextLabelDy->setObjectName( "TextLabelDy" );
   TextLabelDy->setText( tr("Dy:") );
   GroupDirectionLayout->addWidget( TextLabelDy, 0, 2 );
   
-  SpinBox_Dy = new QtxDblSpinBox( min, max, step, GroupDirection, "SpinBox_Dy" );
-  SpinBox_Dy->setPrecision( precision );
+  SpinBox_Dy = new QtxDoubleSpinBox( min, max, step, GroupDirection );
+  SpinBox_Dy->setObjectName("SpinBox_Dy" );
+  SpinBox_Dy->setDecimals( precision );
   GroupDirectionLayout->addWidget( SpinBox_Dy, 0, 3 );
 
-  TextLabelDz = new QLabel( GroupDirection, "TextLabelDz" );
+  TextLabelDz = new QLabel( GroupDirection );
+  TextLabelDz->setObjectName( "TextLabelDz" );
   TextLabelDz->setText( tr("Dz:") );
   GroupDirectionLayout->addWidget( TextLabelDz, 0, 4 );
   
-  SpinBox_Dz = new QtxDblSpinBox( min, max, step, GroupDirection, "SpinBox_Dz" );
-  SpinBox_Dz->setPrecision( precision );
+  SpinBox_Dz = new QtxDoubleSpinBox( min, max, step, GroupDirection );
+  SpinBox_Dz->setObjectName("SpinBox_Dz" );
+  SpinBox_Dz->setDecimals( precision );
   GroupDirectionLayout->addWidget( SpinBox_Dz, 0, 5 );
 
-  invertButton  = new QPushButton( GroupDirection, "invertButton" );
+  invertButton  = new QPushButton( GroupDirection );
+  invertButton->setObjectName( "invertButton" );
   invertButton->setText( tr( "Invert"  ) );
   GroupDirectionLayout->addWidget( invertButton, 0, 6 );
  
-  DirectionCB = new QComboBox( GroupDirection, "DirectionCB" );
-  DirectionCB->insertItem(tr("CUSTOM"));
-  DirectionCB->insertItem(tr("||X-Y"));
-  DirectionCB->insertItem(tr("||Y-Z"));
-  DirectionCB->insertItem(tr("||Z-X"));
-  GroupDirectionLayout->addMultiCellWidget( DirectionCB, 1, 1, 0, 5 );
+  DirectionCB = new QComboBox( GroupDirection );
+  DirectionCB->setObjectName( "DirectionCB" );
+  DirectionCB->insertItem(DirectionCB->count(),tr("CUSTOM"));
+  DirectionCB->insertItem(DirectionCB->count(),tr("||X-Y"));
+  DirectionCB->insertItem(DirectionCB->count(),tr("||Y-Z"));
+  DirectionCB->insertItem(DirectionCB->count(),tr("||Z-X"));
+  GroupDirectionLayout->addWidget( DirectionCB, 1, 0, 1, 6 );
   
   /***************************************************************/
   
-  PreviewChB = new QCheckBox( tr("Preview") ,this, "PreviewChB" );
+  PreviewChB = new QCheckBox( tr("Preview") ,this );
+  PreviewChB->setObjectName( "PreviewChB" );
   PreviewChB->setChecked( true );
   
   /***************************************************************/
-  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() );
+  QGroupBox* GroupButtons = new QGroupBox( this );
+  GroupButtons->setObjectName( "GroupButtons" );
+  QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
   GroupButtonsLayout->setAlignment( Qt::AlignTop );
   GroupButtonsLayout->setMargin( 11 ); GroupButtonsLayout->setSpacing( 6 );
   
-  buttonApply = new QPushButton( GroupButtons, "buttonApply" );
+  buttonApply = new QPushButton( GroupButtons );
+  buttonApply->setObjectName( "buttonApply" );
   buttonApply->setText( tr( "BUT_APPLY"  ) );
   buttonApply->setAutoDefault( TRUE ); 
   buttonApply->setDefault( TRUE );
@@ -178,10 +198,12 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidge
   
   GroupButtonsLayout->addStretch();
   
-  buttonClose = new QPushButton( GroupButtons, "buttonClose" );
+  buttonClose = new QPushButton( GroupButtons );
+  buttonClose->setObjectName( "buttonClose" );
   buttonClose->setText( tr( "BUT_CLOSE"  ) );
   buttonClose->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonClose );
+
   /***************************************************************/
   
   topLayout->addWidget( GroupPoint );
@@ -247,8 +269,7 @@ void OCCViewer_ClippingDlg::closeEvent( QCloseEvent* e )
   if ( !aView3d.IsNull() && !myClippingPlane.IsNull() )
     aView3d->SetPlaneOn( myClippingPlane );
   
-  if (!myView->isCuttingPlane())
-    myAction->setOn( false );
+  myAction->setChecked( false );
   
   QDialog::closeEvent( e );
 }
@@ -288,8 +309,7 @@ void OCCViewer_ClippingDlg::ClickOnClose()
   if ( !aView3d.IsNull() && !myClippingPlane.IsNull() )
     aView3d->SetPlaneOn( myClippingPlane );
 
-  if (!myView->isCuttingPlane())
-    myAction->setOn( false );
+  myAction->setChecked( false );
   
   reject();
 }
@@ -451,9 +471,9 @@ void OCCViewer_ClippingDlg::displayPreview()
         isFound = true;
         double xmin, ymin, zmin, xmax, ymax, zmax;
         aPrs->MinMaxValues( xmin, ymin, zmin, xmax, ymax, zmax );
-        aXMin = QMIN( aXMin, xmin );  aXMax = QMAX( aXMax, xmax );
-        aYMin = QMIN( aYMin, ymin );  aYMax = QMAX( aYMax, ymax );
-        aZMin = QMIN( aZMin, zmin );  aZMax = QMAX( aZMax, zmax );
+        aXMin = qMin( aXMin, xmin );  aXMax = qMax( aXMax, xmax );
+        aYMin = qMin( aYMin, ymin );  aYMax = qMax( aYMax, ymax );
+        aZMin = qMin( aZMin, zmin );  aZMax = qMax( aZMax, zmax );
       }
     }
   }
@@ -565,7 +585,7 @@ void OCCViewer_ClippingDlg::ReserveClippingPlane()
 
 void OCCViewer_ClippingDlg::onViewShow()
 {
-  if(myAction->isOn())
+  if(myAction->isChecked())
     show();
   else
     hide();
index bed795811b7b16abdb380a6c5bcc2b40b54f8300..760115595f0dec99efb7ac1f117ca0b090c288ea 100644 (file)
@@ -1,27 +1,30 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OCCVIEWER_CLIPPINGDLG_H
 #define OCCVIEWER_CLIPPINGDLG_H
 
 #include "OCCViewer.h"
 
-#include <qdialog.h>
+#include <QDialog>
 
 #include <AIS_Plane.hxx>
 #include <V3d_Plane.hxx>
@@ -31,7 +34,7 @@ class QLabel;
 class QPushButton;
 class QComboBox;
 class QCheckBox;
-class QtxDblSpinBox;
+class QtxDoubleSpinBox;
 class QtxAction;
 
 class OCCViewer_ViewWindow;
@@ -46,7 +49,7 @@ class OCCViewer_ClippingDlg : public QDialog
     Q_OBJECT
     
     public:
-    OCCViewer_ClippingDlg(OCCViewer_ViewWindow* , QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
+    OCCViewer_ClippingDlg(OCCViewer_ViewWindow* , QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
     ~OCCViewer_ClippingDlg();
 
     void SetAction( QtxAction* theAction ) { myAction = theAction; }
@@ -66,18 +69,18 @@ private :
     QLabel* TextLabelX;
     QLabel* TextLabelY;
     QLabel* TextLabelZ;
-    QtxDblSpinBox* SpinBox_X;
-    QtxDblSpinBox* SpinBox_Y;
-    QtxDblSpinBox* SpinBox_Z;
+    QtxDoubleSpinBox* SpinBox_X;
+    QtxDoubleSpinBox* SpinBox_Y;
+    QtxDoubleSpinBox* SpinBox_Z;
     QPushButton* resetButton;
     
     QGroupBox* GroupDirection;
     QLabel* TextLabelDx;
     QLabel* TextLabelDy;
     QLabel* TextLabelDz;
-    QtxDblSpinBox* SpinBox_Dx;
-    QtxDblSpinBox* SpinBox_Dy;
-    QtxDblSpinBox* SpinBox_Dz;
+    QtxDoubleSpinBox* SpinBox_Dx;
+    QtxDoubleSpinBox* SpinBox_Dy;
+    QtxDoubleSpinBox* SpinBox_Dz;
     QPushButton* invertButton;
     
     QComboBox* DirectionCB;
index e97cde8b9a9bbffcf3e3eb82050dfcf37bbcfab1..f1980d61d2411958800b55b2ed173a48e1cc9d21 100755 (executable)
@@ -1,29 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "OCCViewer_CreateRestoreViewDlg.h"
 #include "OCCViewer_ViewModel.h"
 #include "OCCViewer_ViewPort3d.h"
 
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qimage.h>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QHBoxLayout>
+#include <QListWidgetItem>
+#include <QEvent>
+#include <QKeyEvent>
 
 /*!
   Constructor
@@ -31,7 +36,7 @@
 OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, OCCViewer_Viewer* curModel )
 : QDialog( aWin )
 {
-  setCaption( tr( "CAPTION" ) );
+  setWindowTitle( tr( "CAPTION" ) );
 
   myParametersMap = curModel->getViewAspects();
 
@@ -41,43 +46,48 @@ OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, O
        
   setFixedSize( 400, 300 );
 
-  QGridLayout* aGrid = new QGridLayout( this, 2, 1, 5, 10 ); 
+  QGridLayout* aGrid = new QGridLayout( this );
+  aGrid->setMargin( 5 );
+  aGrid->setSpacing( 10 );
 
   QWidget* aWidget1 = new QWidget( this );
   QWidget* aWidget2 = new QWidget( this );
        
   QHBoxLayout* aLayout = new QHBoxLayout( aWidget1 );
        
-  myListBox = new QtxListBox( aWidget1 );
+  myListBox = new QListWidget( aWidget1 );
   myListBox->installEventFilter( this );
 
   myCurViewPort = new OCCViewer_ViewPort3d( aWidget1, curModel->getViewer3d(), V3d_ORTHOGRAPHIC );
   myCurViewPort->getView()->SetBackgroundColor( Quantity_NOC_BLACK );
 
-  myListBox->setEditEnabled( 1 );
+  myListBox->setEditTriggers( QAbstractItemView::DoubleClicked );
        
   if ( aQuantityOfItems )
   {
     myListBox->clear();
-    for( int i = 0; i < aQuantityOfItems; i++ )
-      myListBox->insertItem( myParametersMap[ i ].name );
+    for( int i = 0; i < aQuantityOfItems; i++ ) {
+      myListBox->insertItem( i, myParametersMap[ i ].name );
+      myListBox->item( i )->setFlags( myListBox->item( i )->flags() | Qt::ItemIsEditable );
+    }
     
     changeImage( myListBox->item( 0 ) );
   }
   else
   {
     myListBox->clear();
-    myListBox->insertItem( "No Items", 0 );
-    myListBox->setEditEnabled( 0 );
+    myListBox->insertItem( 0, "No Items" );
   }
 
-  connect( myListBox, SIGNAL( clicked( QListBoxItem* ) ), this, SLOT( changeImage( QListBoxItem* ) ) );
-  connect( myListBox, SIGNAL( itemEdited( QListBoxItem* ) ), this, SLOT( editItemText( QListBoxItem* ) ) );
+  connect( myListBox, SIGNAL( itemClicked( QListWidgetItem* ) ), this, SLOT( changeImage( QListWidgetItem* ) ) );
+  connect( myListBox, SIGNAL( itemChanged( QListWidgetItem* ) ), this, SLOT( editItemText( QListWidgetItem* ) ) );
        
   aLayout->addWidget( myListBox );
   aLayout->addWidget( myCurViewPort, 30 );
 
-  QHBoxLayout* aButtonLayout = new QHBoxLayout( aWidget2, 0, 5 );
+  QHBoxLayout* aButtonLayout = new QHBoxLayout( aWidget2 );
+  aButtonLayout->setMargin( 0 );
+  aButtonLayout->setSpacing( 5 );
 
   QPushButton* theOk     = new QPushButton( tr( "Ok" ), aWidget2 );            theOk->setAutoDefault( false );
   QPushButton* theCancel = new QPushButton( tr( "Cancel" ), aWidget2 );                 theCancel->setAutoDefault( false );
@@ -109,51 +119,52 @@ OCCViewer_CreateRestoreViewDlg::~OCCViewer_CreateRestoreViewDlg()
   Changes image in accordance with item
   \param curItem - item contains info about view parameters
 */
-void OCCViewer_CreateRestoreViewDlg::changeImage( QListBoxItem* curItem )
+void OCCViewer_CreateRestoreViewDlg::changeImage( QListWidgetItem* curItem )
 {
-       if( curItem && myListBox->isEditEnabled() )
+  if( curItem && ( curItem->flags() & Qt::ItemIsEditable ) )
+  {
+    int lowLevel  = -1;
+    int highLevel = -1;
+    int index = curItem->listWidget()->row( curItem );
+    if( myKeyFlag == 2 )
+    {
+      for( int i = 0; i < (int)myListBox->count(); i++ )
+      {
+       if( myListBox->item( i )->isSelected() && i != index )
        {
-               int lowLevel  = -1;
-               int highLevel = -1;
-               int index = curItem->listBox()->index( curItem );
-               if( myKeyFlag == 2 )
-               {
-                       for( int i = 0; i < (int)myListBox->count(); i++ )
-                       {
-                               if( myListBox->isSelected( i ) && i != index )
-                               {
-                                       myListBox->clearSelection();
-                                       if( i > index )
-                                       {
-                                               lowLevel  = index;
-                                               highLevel = i;
-                                       }
-                                       else
-                                       {
-                                               lowLevel  = i;
-                                               highLevel = index;
-                                       }
-                                       for( int j = lowLevel; j <= highLevel; j++ )
-                                               myListBox->setSelected( j, TRUE );
-                                       break;
-                               }
-                               if( myListBox->isSelected( i ) && i == index )
-                                       myListBox->setSelected( i, TRUE );
-                       }
-               }
-
-               Handle(V3d_View) aView3d = myCurViewPort->getView();
-               myCurrentItem = myParametersMap[ index ];
-
-               Standard_Boolean prev = aView3d->SetImmediateUpdate( Standard_False );
-               aView3d->SetScale( myCurrentItem.scale );
-               aView3d->SetCenter( myCurrentItem.centerX, myCurrentItem.centerY );
-               aView3d->SetProj( myCurrentItem.projX, myCurrentItem.projY, myCurrentItem.projZ );
-               aView3d->SetTwist( myCurrentItem.twist );
-               aView3d->SetAt( myCurrentItem.atX, myCurrentItem.atY, myCurrentItem.atZ );
-               aView3d->SetImmediateUpdate( prev );
-               aView3d->SetEye( myCurrentItem.eyeX, myCurrentItem.eyeY, myCurrentItem.eyeZ );
-        }
+         myListBox->clearSelection();
+         if( i > index )
+         {
+           lowLevel  = index;
+           highLevel = i;
+         }
+         else
+         {
+           lowLevel  = i;
+           highLevel = index;
+         }
+         for( int j = lowLevel; j <= highLevel; j++ )
+           myListBox->item( j )->setSelected( TRUE );
+         break;
+       }
+       if( myListBox->item( i )->isSelected() && i == index )
+         myListBox->item( i )->setSelected( TRUE );
+      }
+    }
+    
+    Handle(V3d_View) aView3d = myCurViewPort->getView();
+    myCurrentItem = myParametersMap[ index ];
+    
+    Standard_Boolean prev = aView3d->SetImmediateUpdate( Standard_False );
+    aView3d->SetScale( myCurrentItem.scale );
+    aView3d->SetCenter( myCurrentItem.centerX, myCurrentItem.centerY );
+    aView3d->SetProj( myCurrentItem.projX, myCurrentItem.projY, myCurrentItem.projZ );
+    aView3d->SetTwist( myCurrentItem.twist );
+    aView3d->SetAt( myCurrentItem.atX, myCurrentItem.atY, myCurrentItem.atZ );
+    aView3d->SetImmediateUpdate( prev );
+    aView3d->SetEye( myCurrentItem.eyeX, myCurrentItem.eyeY, myCurrentItem.eyeZ );
+    aView3d->SetAxialScale( myCurrentItem.scaleX, myCurrentItem.scaleY, myCurrentItem.scaleZ );
+  }
 }
 
 /*!
@@ -161,7 +172,7 @@ void OCCViewer_CreateRestoreViewDlg::changeImage( QListBoxItem* curItem )
 */
 viewAspect OCCViewer_CreateRestoreViewDlg::currentItem() const
 {
-       return myCurrentItem;
+  return myCurrentItem;
 }
 
 /*!
@@ -169,36 +180,36 @@ viewAspect OCCViewer_CreateRestoreViewDlg::currentItem() const
 */
 void OCCViewer_CreateRestoreViewDlg::deleteSelectedItems()
 {
-       if( myListBox->count() && myListBox->isEditEnabled() )
-       {
-               int curIndex = -1;
-               for( int i = 0; i < (int)myListBox->count(); i++ )
-                       if( myListBox->isSelected( i ) )
-                       {
-                               myListBox->removeItem( i );
-                               for( int j = i; j < (int)myParametersMap.count(); j++ )
-                                       if( j != myParametersMap.count() - 1 )
-                                               myParametersMap[ j ] = myParametersMap[ j + 1 ];
-                                       else
-                                               myParametersMap.remove( myParametersMap.at(j) );
-                               if( i != myListBox->count() )
-                                       curIndex = i;
-                               else
-                                       curIndex = i - 1;
-                               i--;
-                       }
-               if( curIndex >= 0 )
-               {
-                       myListBox->setCurrentItem( curIndex );
-                       changeImage( myListBox->item( curIndex ) );
-               }
-       }
-       if( !myListBox->count() )
-       {
-               myListBox->clear();
-               myListBox->insertItem( "No Items", 0 );
-               myListBox->setEditEnabled( 0 );
-       }
+  if( myListBox->count() )
+  {
+    int curIndex = -1;
+    for( int i = 0; i < (int)myListBox->count(); i++ )
+      if( myListBox->item( i )->isSelected() && ( myListBox->item( i )->flags() & Qt::ItemIsEditable ) )
+      {
+       QListWidgetItem* anItemToDelete = myListBox->takeItem( i );
+       delete anItemToDelete;
+       for( int j = i; j < (int)myParametersMap.count(); j++ )
+         if( j != myParametersMap.count() - 1 )
+           myParametersMap[ j ] = myParametersMap[ j + 1 ];
+         else
+           myParametersMap.removeAt( j );
+       if( i != myListBox->count() )
+         curIndex = i;
+       else
+         curIndex = i - 1;
+       i--;
+      }
+    if( curIndex >= 0 )
+    {
+      myListBox->setCurrentItem( myListBox->item( curIndex ) );
+      changeImage( myListBox->item( curIndex ) );
+    }
+  }
+  if( !myListBox->count() )
+  {
+    myListBox->clear();
+    myListBox->insertItem( 0, "No Items" );
+  }
 }
 
 /*!
@@ -206,11 +217,10 @@ void OCCViewer_CreateRestoreViewDlg::deleteSelectedItems()
 */
 void OCCViewer_CreateRestoreViewDlg::clearList()
 {
-       myListBox->clear();
-       myListBox->insertItem( "No Items", 0 );
-       myListBox->setEditEnabled( 0 );
-
-       myParametersMap.clear();
+  myListBox->clear();
+  myListBox->insertItem( 0, "No Items" );
+  
+  myParametersMap.clear();
 }
 
 /*!
@@ -218,17 +228,17 @@ void OCCViewer_CreateRestoreViewDlg::clearList()
 */
 const viewAspectList& OCCViewer_CreateRestoreViewDlg::parameters() const
 {
-       return myParametersMap;
+  return myParametersMap;
 }
 
 /*!
   Renames key of view aspect map in accordance with item name
   \param anItem - item
 */
-void OCCViewer_CreateRestoreViewDlg::editItemText( QListBoxItem* anItem )
+void OCCViewer_CreateRestoreViewDlg::editItemText( QListWidgetItem* anItem )
 {
-       int index = anItem->listBox()->index( anItem );
-       myParametersMap[ index ].name = anItem->text().latin1();
+  int index = anItem->listWidget()->row( anItem );
+  myParametersMap[ index ].name = anItem->text().toLatin1();
 }
 
 /*!
@@ -236,31 +246,31 @@ void OCCViewer_CreateRestoreViewDlg::editItemText( QListBoxItem* anItem )
 */
 bool OCCViewer_CreateRestoreViewDlg::eventFilter( QObject* anObj, QEvent* anEv )
 {
-       if( anEv->type() == QEvent::KeyPress )
-       {
-               QKeyEvent* aKeyEv = ( QKeyEvent* )anEv;
-               if( aKeyEv->key() == Qt::Key_Control )
-               {
-                       myKeyFlag = 1;
-                       myListBox->setSelectionMode( QListBox::Multi ); 
-               }
-               else if( aKeyEv->key() == Qt::Key_Shift )
-               {
-                       myKeyFlag = 2;
-                       myListBox->setSelectionMode( QListBox::Multi ); 
-               }
-               else
-                       myListBox->setSelectionMode( QListBox::Single );
-       }
-       if( anEv->type() == QEvent::KeyRelease )
-               myKeyFlag = 0;
-       
-       if( !myKeyFlag )
-       {
-               if( anEv->type() == QEvent::KeyPress || anEv->type() == QEvent::MouseButtonPress )
-                       myListBox->setSelectionMode( QListBox::Single );
-       }
-       return QWidget::eventFilter( anObj, anEv );
+  if( anEv->type() == QEvent::KeyPress )
+  {
+    QKeyEvent* aKeyEv = ( QKeyEvent* )anEv;
+    if( aKeyEv->key() == Qt::Key_Control )
+    {
+      myKeyFlag = 1;
+      myListBox->setSelectionMode( QAbstractItemView::MultiSelection );        
+    }
+    else if( aKeyEv->key() == Qt::Key_Shift )
+    {
+      myKeyFlag = 2;
+      myListBox->setSelectionMode( QAbstractItemView::MultiSelection );        
+    }
+    else
+      myListBox->setSelectionMode( QAbstractItemView::SingleSelection );
+  }
+  if( anEv->type() == QEvent::KeyRelease )
+    myKeyFlag = 0;
+  
+  if( !myKeyFlag )
+  {
+    if( anEv->type() == QEvent::KeyPress || anEv->type() == QEvent::MouseButtonPress )
+      myListBox->setSelectionMode( QAbstractItemView::SingleSelection );
+  }
+  return QWidget::eventFilter( anObj, anEv );
 }
 
 /*!
@@ -268,7 +278,7 @@ bool OCCViewer_CreateRestoreViewDlg::eventFilter( QObject* anObj, QEvent* anEv )
 */
 void OCCViewer_CreateRestoreViewDlg::OKpressed()
 {
-       emit dlgOk();
-       accept();
+  emit dlgOk();
+  accept();
 }
 
index fc1579ae6de261e538db8b0cea5279b1f12b4241..1a08d04eaaa96b1b185d922e0c3476c2413530c2 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OCCVIEWER_CREATERESTOREVIEWDLG_H
 #define OCCVIEWER_CREATERESTOREVIEWDLG_H
 #include "OCCViewer_ViewWindow.h"
 
 #include <QtxDialog.h>
-#include <QtxListBox.h> 
 #include <SUIT_Application.h>
 
-#include <qmap.h>
-#include <qvbox.h>
-#include <qdialog.h>
-#include <qlistbox.h>
-#include <qstringlist.h>
+#include <QDialog>
+#include <QListWidget>
 
 class OCCViewer_ViewPort3d;
 
+class QListWidgetItem;
+
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
@@ -48,26 +49,26 @@ public:
        OCCViewer_CreateRestoreViewDlg( QWidget*, OCCViewer_Viewer* );
        virtual ~OCCViewer_CreateRestoreViewDlg();
 
-       const viewAspectList&       parameters() const;
-       viewAspect                  currentItem() const;
-       virtual bool                                                eventFilter( QObject*, QEvent* );
+       const viewAspectList&         parameters() const;
+       viewAspect                    currentItem() const;
+       virtual bool                  eventFilter( QObject*, QEvent* );
 
 public slots:
        void                          OKpressed();
        void                          clearList();
-       void                        editItemText( QListBoxItem* );
-       void                          changeImage( QListBoxItem* );
+       void                          editItemText( QListWidgetItem* );
+       void                          changeImage( QListWidgetItem* );
        void                          deleteSelectedItems();
 
 signals:
        void                          dlgOk();
 
 private:
-       int                                                                       myKeyFlag;
-       QtxListBox*                                                   myListBox;
+       int                           myKeyFlag;
+       QListWidget*                  myListBox;
        OCCViewer_ViewPort3d*         myCurViewPort;
-       viewAspect                  myCurrentItem;
-       viewAspectList              myParametersMap;
+       viewAspect                    myCurrentItem;
+       viewAspectList                myParametersMap;
 };
 
 #ifdef WIN32
index 0aed2c230fd9a64bd963ae236085d65edb686f6b..8d8b6b6966bab59ef641c4093bac9df844f7dee5 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "OCCViewer_SetRotationPointDlg.h"
 
 
 #include "OCCViewer_ViewWindow.h"
 
-#include <qlineedit.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qvalidator.h>
-#include <qbuttongroup.h>
-#include <qobjectlist.h>
-#include <qcheckbox.h>
-#include <qhbox.h>
+#include <QLineEdit>
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QDoubleValidator>
+#include <QCheckBox>
+#include <QHBoxLayout>
 
 /*!
   Constructor
   \param modal - is this dialog modal
   \param fl - flags
 */
-OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWindow* view, QWidget* parent, const char* name, bool modal, WFlags fl )
-: QDialog( parent, "OCCViewer_SetRotationPointDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
+OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWindow* view, QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl )
+: QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
   myView( view )
 {
-  setCaption(tr("CAPTION"));
+  setObjectName( "OCCViewer_SetRotationPointDlg" );
+  setModal( modal );
+
+  setWindowTitle(tr("CAPTION"));
   setSizeGripEnabled(TRUE);
 
   // Create layout for this dialog
@@ -54,35 +58,42 @@ OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWind
   layoutDlg->setMargin(11);
 
   // Create check box "Use Bounding Box Center"
-  QHBox* aCheckBox = new QHBox(this);
+  QHBoxLayout* aCheckBox = new QHBoxLayout;
 
-  myIsBBCenter = new QCheckBox(tr("USE_BBCENTER"), aCheckBox);
+  myIsBBCenter = new QCheckBox(tr("USE_BBCENTER"));
   myIsBBCenter->setChecked(true);
+  aCheckBox->addWidget(myIsBBCenter);
   connect(myIsBBCenter, SIGNAL(stateChanged(int)), SLOT(onBBCenterChecked()));
 
   // Create croup button with radio buttons
-  myGroupSelButton = new QButtonGroup(2,Qt::Vertical,"",this);
-  myGroupSelButton->setMargin(11);
+  myGroupBoxSel = new QGroupBox( "", this );
+  QVBoxLayout *vbox = new QVBoxLayout;
+  vbox->setMargin(11);
+  vbox->addStretch(1);
   
   // Create "Set to Origin" button
-  myToOrigin = new QPushButton(myGroupSelButton);
-  myToOrigin->setText(tr("LBL_TOORIGIN"));
+  myToOrigin = new QPushButton(tr("LBL_TOORIGIN"));
+  vbox->addWidget(myToOrigin);
   connect(myToOrigin, SIGNAL(clicked()), this, SLOT(onToOrigin()));
 
   // Create "Select Point from View" button
-  mySelectPoint = new QPushButton(myGroupSelButton);
-  mySelectPoint->setText(tr("LBL_SELECTPOINT"));
-  mySelectPoint->setToggleButton(true);
+  mySelectPoint = new QPushButton(tr("LBL_SELECTPOINT"));
+  mySelectPoint->setCheckable(true);
+  vbox->addWidget(mySelectPoint);
   connect(mySelectPoint, SIGNAL(clicked()), this, SLOT(onSelectPoint()));
 
+  myGroupBoxSel->setLayout(vbox);
+
   // Create croup box with grid layout
-  myGroupBoxCoord = new QGroupBox(this, "GroupBox");
+  myGroupBoxCoord = new QGroupBox(this);
+  myGroupBoxCoord->setObjectName("GroupBox");
   QHBoxLayout* aHBoxLayout = new QHBoxLayout(myGroupBoxCoord);
   aHBoxLayout->setMargin(11);
   aHBoxLayout->setSpacing(6);
 
   // "X" coordinate
-  QLabel* TextLabelX = new QLabel (tr("LBL_X"), myGroupBoxCoord, "TextLabelX");
+  QLabel* TextLabelX = new QLabel (tr("LBL_X"), myGroupBoxCoord );
+  TextLabelX->setObjectName("TextLabelX");
   TextLabelX->setFixedWidth(15);
   myX = new QLineEdit(myGroupBoxCoord);
   myX->setValidator(new QDoubleValidator(myX));
@@ -90,7 +101,8 @@ OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWind
   connect(myX, SIGNAL(textChanged(const QString&)), this, SLOT(onCoordChanged()));
 
   // "Y" coordinate
-  QLabel* TextLabelY = new QLabel (tr("LBL_Y"), myGroupBoxCoord, "TextLabelY");
+  QLabel* TextLabelY = new QLabel (tr("LBL_Y"), myGroupBoxCoord );
+  TextLabelY->setObjectName("TextLabelY");
   TextLabelY->setFixedWidth(15);
   myY = new QLineEdit(myGroupBoxCoord);
   myY->setValidator(new QDoubleValidator(myY));
@@ -98,7 +110,8 @@ OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWind
   connect(myY, SIGNAL(textChanged(const QString&)), this, SLOT(onCoordChanged()));
 
   // "Z" coordinate
-  QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), myGroupBoxCoord, "TextLabelZ");
+  QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), myGroupBoxCoord );
+  TextLabelZ->setObjectName("TextLabelZ");
   TextLabelZ->setFixedWidth(15);
   myZ = new QLineEdit(myGroupBoxCoord);
   myZ->setValidator(new QDoubleValidator(myZ));
@@ -119,7 +132,8 @@ OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWind
   aHBoxLayout2->setMargin(11);
   aHBoxLayout2->setSpacing(6);
 
-  QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox, "m_bClose");
+  QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox );
+  m_bClose->setObjectName("m_bClose");
   m_bClose->setAutoDefault(TRUE);
   m_bClose->setFixedSize(m_bClose->sizeHint());
   connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose()));
@@ -128,12 +142,12 @@ OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWind
   aHBoxLayout2->addWidget(m_bClose);
 
   // Layout top level widgets
-  layoutDlg->addWidget(aCheckBox,0,0);
-  layoutDlg->addWidget(myGroupSelButton,1,0);
+  layoutDlg->addLayout(aCheckBox,0,0);
+  layoutDlg->addWidget(myGroupBoxSel,1,0);
   layoutDlg->addWidget(myGroupBoxCoord,2,0);
   layoutDlg->addWidget(aGroupBox,3,0);
   
-  setEnabled(myGroupSelButton,!myIsBBCenter->isChecked());
+  setEnabled(myGroupBoxSel,!myIsBBCenter->isChecked());
   setEnabled(myGroupBoxCoord,!myIsBBCenter->isChecked());
 
   this->resize(400, this->sizeHint().height());
@@ -166,10 +180,11 @@ void
 OCCViewer_SetRotationPointDlg
 ::setEnabled(QGroupBox* theGrp, const bool theState)
 {
-  QObjectList aChildren(*theGrp->children());
+  QObjectList aChildren(theGrp->children());
   QObject* anObj;
-  for(anObj = aChildren.first(); anObj !=0; anObj = aChildren.next())
+  for(int i = 0; i < aChildren.size(); i++)
   {
+    anObj = aChildren.at(i);
     if (anObj !=0 && anObj->inherits("QLineEdit"))
       ((QLineEdit*)anObj)->setReadOnly(!theState);
     if (anObj !=0 && anObj->inherits("QPushButton"))
@@ -182,12 +197,12 @@ void
 OCCViewer_SetRotationPointDlg
 ::onBBCenterChecked()
 {
-  setEnabled(myGroupSelButton,!myIsBBCenter->isChecked());
+  setEnabled(myGroupBoxSel,!myIsBBCenter->isChecked());
   setEnabled(myGroupBoxCoord,!myIsBBCenter->isChecked());
   
   if ( myIsBBCenter->isChecked() )
   {
-    if ( mySelectPoint->state() == QButton::On )
+    if ( mySelectPoint->isChecked() )
       mySelectPoint->toggle();
     myView->activateSetRotationGravity();
   }
@@ -201,7 +216,7 @@ void
 OCCViewer_SetRotationPointDlg
 ::onToOrigin()
 {
-  if ( mySelectPoint->state() == QButton::On )
+  if ( mySelectPoint->isChecked() )
     mySelectPoint->toggle();
   setCoords();
   myView->activateSetRotationSelected(myX->text().toDouble(), 
@@ -213,7 +228,7 @@ void
 OCCViewer_SetRotationPointDlg
 ::onSelectPoint()
 {
-  if ( mySelectPoint->state() == QButton::On )
+  if ( mySelectPoint->isChecked() )
     myView->activateStartPointSelection();
   else
     mySelectPoint->toggle();
@@ -225,7 +240,7 @@ OCCViewer_SetRotationPointDlg
 {
   if ( !myIsBBCenter->isChecked() )
   {
-    if ( mySelectPoint->state() == QButton::On
+    if ( mySelectPoint->isChecked()
         &&
         ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
       mySelectPoint->toggle();
@@ -256,7 +271,7 @@ void
 OCCViewer_SetRotationPointDlg
 ::onClickClose()
 {
-  myAction->setOn( false );
+  myAction->setChecked( false );
   reject();
 }
 
@@ -264,7 +279,7 @@ void
 OCCViewer_SetRotationPointDlg
 ::onViewShow()
 {
-  if(myAction->isOn())
+  if(myAction->isChecked())
     show();
   else
     hide();
@@ -276,3 +291,14 @@ OCCViewer_SetRotationPointDlg
 {
   hide();
 }
+
+/*!
+  Custom handling of close event: toggle action
+*/
+void
+OCCViewer_SetRotationPointDlg
+::closeEvent( QCloseEvent* e )
+{
+  myAction->setChecked( false );
+  QDialog::closeEvent( e );
+}
index 18c1f654e1a386edc254e9458c4a63a8b55952b6..03651d66c9ee174ad4366ead8ddc47a5b4569f7d 100644 (file)
@@ -1,34 +1,36 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OCCVIEWER_SETROTATIONPOINTDLG_H
 #define OCCVIEWER_SETROTATIONPOINTDLG_H
 
 #include "OCCViewer.h"
 
-#include <qdialog.h>
+#include <QDialog>
 
 class QtxAction;
 
 class QLineEdit;
 class QPushButton;
 class QGroupBox;
-class QButtonGroup;
 class QCheckBox;
 
 class OCCViewer_ViewWindow;
@@ -39,7 +41,7 @@ class OCCVIEWER_EXPORT OCCViewer_SetRotationPointDlg : public QDialog
 
 public:
   OCCViewer_SetRotationPointDlg(OCCViewer_ViewWindow* , QWidget* parent = 0, 
-                               const char* name = 0, bool modal = FALSE, WFlags fl = 0);
+                               const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
   ~OCCViewer_SetRotationPointDlg();
 
   void SetAction( QtxAction* theAction ) { myAction = theAction; }
@@ -54,7 +56,7 @@ protected:
 
   QCheckBox*    myIsBBCenter;
 
-  QButtonGroup* myGroupSelButton;
+  QGroupBox   * myGroupBoxSel;
   QPushButton*  myToOrigin;
   QPushButton*  mySelectPoint;
 
@@ -77,6 +79,9 @@ protected slots:
 
   void onViewShow();
   void onViewHide();
+
+protected:
+  void closeEvent( QCloseEvent* );
 };
 
 #endif // OCCVIEWER_SETROTATIONPOINTDLG_H
diff --git a/src/OCCViewer/OCCViewer_ToolTip.cxx b/src/OCCViewer/OCCViewer_ToolTip.cxx
new file mode 100644 (file)
index 0000000..3efef8d
--- /dev/null
@@ -0,0 +1,106 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      OCCViewer_ToolTip.cxx
+// Author:    Alexandre SOLOVYOV
+//
+#include "OCCViewer_ToolTip.h"
+#include "OCCViewer_ViewWindow.h"
+#include "OCCViewer_ViewPort3d.h"
+#include "OCCViewer_ViewModel.h"
+
+#include <SUIT_ViewManager.h>
+
+#include <SelectMgr_EntityOwner.hxx>
+
+/*!
+  Constructor
+
+  \param wnd - window where the tooltip should be assigned
+*/
+OCCViewer_ToolTip::OCCViewer_ToolTip( OCCViewer_ViewWindow* wnd )
+: QtxToolTip( wnd->getViewPort() ),
+  myWnd( wnd )
+{
+  connect( this, SIGNAL( maybeTip( QPoint, QString&, QFont&, QRect&, QRect& ) ),
+          this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );
+}
+
+/*!
+  Destructor
+ */
+OCCViewer_ToolTip::~OCCViewer_ToolTip()
+{
+}
+
+/*!
+  \return font of the tooltip
+ */
+QFont OCCViewer_ToolTip::font() const
+{
+  return myFont;
+}
+
+/*!
+  Change font of the tooltip
+
+  \param f - new font
+ */
+void OCCViewer_ToolTip::setFont( const QFont& f )
+{
+  myFont = f;
+}
+
+/*!
+  Tooltip handler
+
+  \param p - current point
+  \param str - returned tooltip text
+  \param f - returned tooltip font
+  \param txtRect - returned tooltip text rectangle
+  \param rect - returned tooltip rectangle
+ */
+void OCCViewer_ToolTip::onToolTip( QPoint p, QString& str, QFont& f, QRect& txtRect, QRect& rect )
+{
+  OCCViewer_Viewer* v = dynamic_cast<OCCViewer_Viewer*>( myWnd->getViewManager()->getViewModel() );
+  Handle( AIS_InteractiveContext ) aCont = v->getAISContext();
+  if( aCont.IsNull() )
+    return;
+
+  QString txt;
+  Handle( SelectMgr_EntityOwner ) owner = aCont->DetectedOwner();
+  if( !owner.IsNull() )
+    emit toolTipFor( owner, txt );
+
+  Handle_AIS_InteractiveObject obj = aCont->DetectedInteractive();
+  if( txt.isEmpty() && !obj.IsNull() )
+    emit toolTipFor( obj, txt );
+
+  if( txt.isEmpty() )
+    return;
+
+  str = txt;
+  QFontMetrics m( myFont );
+  int w = m.width( str ), h = m.height();
+
+  txtRect = QRect( p.x()+4, p.y()-h, w, h );
+  rect = txtRect;
+}
diff --git a/src/OCCViewer/OCCViewer_ToolTip.h b/src/OCCViewer/OCCViewer_ToolTip.h
new file mode 100644 (file)
index 0000000..5ff60c8
--- /dev/null
@@ -0,0 +1,66 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef OCCVIEWER_TOOLTIP_H
+#define OCCVIEWER_TOOLTIP_H
+
+#include "OCCViewer.h"
+#include <QtxToolTip.h>
+#include <QFont>
+
+class OCCViewer_ViewWindow;
+class Handle_SelectMgr_EntityOwner;
+class Handle_AIS_InteractiveObject;
+
+/*!
+  \class OCCViewer_ToolTip
+  \brief Custom tooltip for AIS_InteractiveObjects and SelectMgr_EntityOwners in the OCC Viewer
+*/
+class OCCVIEWER_EXPORT OCCViewer_ToolTip : public QtxToolTip
+{
+  Q_OBJECT
+
+public:
+  OCCViewer_ToolTip( OCCViewer_ViewWindow* );
+  virtual ~OCCViewer_ToolTip();
+
+  QFont font() const;
+  void  setFont( const QFont& );
+
+signals:
+  /*!
+    Called when owner is detected; allows to redefine tooltip text for owner
+   */
+  void toolTipFor( const Handle_SelectMgr_EntityOwner&, QString& );
+  /*!
+    Called when object is detected; allows to redefine tooltip text for object
+   */
+  void toolTipFor( const Handle_AIS_InteractiveObject&, QString& );
+
+public slots:
+  void onToolTip( QPoint, QString&, QFont&, QRect&, QRect& );
+
+private:
+  OCCViewer_ViewWindow*  myWnd;
+  QFont                  myFont;
+};
+
+#endif
diff --git a/src/OCCViewer/OCCViewer_Trihedron.cxx b/src/OCCViewer/OCCViewer_Trihedron.cxx
new file mode 100755 (executable)
index 0000000..e875d9a
--- /dev/null
@@ -0,0 +1,308 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#include <GL/gl.h>
+
+#include "OCCViewer_Trihedron.h"
+
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+#include <Graphic3d_AspectFillArea3d.hxx>
+#include <Graphic3d_Group.hxx>
+#include <Graphic3d_MaterialAspect.hxx>
+#include <Prs3d_Presentation.hxx>
+#include <Prs3d_Root.hxx>
+#include <PrsMgr_PresentationManager3d.hxx>
+
+
+#ifndef WIN32
+# include <GL/glx.h>
+#endif
+
+
+
+#define PI   3.14159265359
+
+IMPLEMENT_STANDARD_HANDLE( OCCViewer_Trihedron, AIS_InteractiveObject )
+IMPLEMENT_STANDARD_RTTIEXT( OCCViewer_Trihedron, AIS_InteractiveObject )
+
+/*!
+ * Constructor
+ */
+OCCViewer_Trihedron::OCCViewer_Trihedron( const PrsMgr_TypeOfPresentation3d t )
+  : AIS_InteractiveObject( t ),
+    myTextList( 0 )
+{
+}
+
+/*!
+ * Destructor
+ */
+OCCViewer_Trihedron::~OCCViewer_Trihedron()
+{
+  if( myTextList )
+    glDeleteLists( myTextList, 256 );
+}
+
+/*!
+ * Sets the bounding box (MinMax values).
+ */
+void OCCViewer_Trihedron::bounds( Graphic3d_CBounds& aMinMax ) const
+{
+  Standard_Real aXMin = -1, aYMin = -1, aZMin = -1;
+  Standard_Real aXMax =  1, aYMax =  1, aZMax =  1;
+  
+  if( aMinMax.XMin > aXMin ) aMinMax.XMin = aXMin;
+  if( aMinMax.YMin > aYMin ) aMinMax.YMin = aYMin;
+  if( aMinMax.ZMin > aZMin ) aMinMax.ZMin = aZMin;
+  if( aMinMax.XMax < aXMax ) aMinMax.XMax = aXMax;
+  if( aMinMax.YMax < aYMax ) aMinMax.YMax = aYMax;
+  if( aMinMax.ZMax < aZMax ) aMinMax.ZMax = aZMax;
+}
+
+/*!
+ * Redefined method. Calculates the object presentation.
+ */
+void OCCViewer_Trihedron::Compute( const Handle( PrsMgr_PresentationManager3d )&,
+                                  const Handle( Prs3d_Presentation )& aPrs,
+                                  const Standard_Integer aMode )
+{
+  if( aPrs.IsNull() )
+    return;
+
+  Handle( Graphic3d_Group ) aGroup = Prs3d_Root::CurrentGroup( aPrs );
+  aGroup->UserDraw( this );
+}
+
+/*!
+ * Redefined method. Does nothing.
+ */
+void OCCViewer_Trihedron::ComputeSelection( const Handle( SelectMgr_Selection )& theSelection,
+                                           const Standard_Integer theMode )
+{
+}
+
+/*!
+ * Generates text list.
+ */
+GLuint generateTextList()
+{
+  bool ok = false;
+  GLuint aList = glGenLists( 256 );
+
+#ifdef WIN32
+  HGLRC hglrc = wglGetCurrentContext();
+  if( hglrc )
+  {
+    HDC hdc = ::wglGetCurrentDC();
+    HFONT font = CreateFont( -12, 0, 0, 0, 
+                             FW_BOLD,
+                             0, 0, 0,
+                             ANSI_CHARSET,
+                             OUT_TT_PRECIS,
+                             CLIP_DEFAULT_PRECIS,
+                             ANTIALIASED_QUALITY,
+                             FF_DONTCARE | DEFAULT_PITCH,
+                             "Courier New" );
+    HFONT oldFont = (HFONT)SelectObject( hdc, font );
+
+    ok = ::wglUseFontBitmaps( hdc, 0, 256, aList );
+    SelectObject( hdc, oldFont );
+    DeleteObject( font );
+  }
+#else // X Window
+  Display* dpy = glXGetCurrentDisplay();
+  if( dpy )
+  {
+    int aFontCount = 0;
+    char** aFontList = XListFonts( dpy, "*-courier-*", 1, &aFontCount  );
+    if( aFontCount > 0 )
+    {
+      //XFontStruct* fontInfo = XLoadQueryFont( dpy, "-*-courier-*-r-*-*-14-*-*-*-m-*-*-*" );
+      Font aFont = XLoadFont( dpy, aFontList[0] );
+      glXUseXFont( aFont, 0, 256, aList );
+      XUnloadFont( dpy, aFont );
+      ok = true;
+    }
+    XFreeFontNames( aFontList );
+  }
+#endif
+
+  if( !ok )
+    glDeleteLists( aList, 256 );
+
+  return aList;
+}
+
+/*!
+ * Draws text string.
+ */
+void drawText( GLuint theTextList, const char* theText, GLdouble thePosition[3], GLfloat theColor[3] )
+{
+  glColor3fv( theColor );
+  glRasterPos3dv( thePosition );
+  glListBase( theTextList );
+  glCallLists( strlen( theText ), GL_UNSIGNED_BYTE, (GLubyte*)theText );
+}
+
+/*!
+ * Displays trihedron.
+ */
+void OCCViewer_Trihedron::display()
+{
+  GLdouble TriedronOrigin[3] = { 0.0, 0.0, 0.0 };
+
+  GLdouble TriedronAxeX[3] = { 1.0, 0.0, 0.0 };
+  GLdouble TriedronAxeY[3] = { 0.0, 1.0, 0.0 };
+  GLdouble TriedronAxeZ[3] = { 0.0, 0.0, 1.0 };
+
+  GLfloat TriedronColorX[3] = { 1.0, 0.0, 0.0 };
+  GLfloat TriedronColorY[3] = { 0.0, 1.0, 0.0 };
+  GLfloat TriedronColorZ[3] = { 0.0, 0.0, 1.0 };
+
+  GLfloat TriedronLetterColorX[3] = { 1.0, 1.0, 1.0 };
+  GLfloat TriedronLetterColorY[3] = { 1.0, 1.0, 1.0 };
+  GLfloat TriedronLetterColorZ[3] = { 1.0, 1.0, 1.0 };
+
+  GLfloat TriedronLineWidth = 2.0;
+  GLdouble TriedronScale = 0.15;
+
+  GLdouble U, V, minUV;
+  GLint aViewPort[4];
+  glGetIntegerv(GL_VIEWPORT, aViewPort);
+  U = aViewPort[2];
+  V = aViewPort[3];
+
+  if( U < V )
+    minUV = U;
+  else
+    minUV = V;
+
+  GLdouble L = minUV * TriedronScale;
+
+  TriedronOrigin[0]= 0.0; 
+  TriedronOrigin[1]= 0.0;
+  TriedronOrigin[2]= 0.0; 
+
+  TriedronAxeX[0] = TriedronOrigin[0] + L;
+  TriedronAxeX[1] = TriedronOrigin[1] + 0.0;
+  TriedronAxeX[2] = TriedronOrigin[2] + 0.0;
+
+  TriedronAxeY[0] = TriedronOrigin[0] + 0.0;
+  TriedronAxeY[1] = TriedronOrigin[1] + L;
+  TriedronAxeY[2] = TriedronOrigin[2] + 0.0;
+
+  TriedronAxeZ[0] = TriedronOrigin[0] + 0.0;
+  TriedronAxeZ[1] = TriedronOrigin[1] + 0.0;
+  TriedronAxeZ[2] = TriedronOrigin[2] + L;
+
+  glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT | GL_LIGHTING_BIT | GL_LINE_BIT | GL_VIEWPORT_BIT );
+
+  glDepthRange( 0, 0 );
+  glDisable( GL_LIGHTING );
+  glDisable( GL_COLOR_MATERIAL );
+  for( int i = 0; i < GL_MAX_CLIP_PLANES; i++ )
+    glDisable( GL_CLIP_PLANE0 + i  );
+
+  glLineWidth( TriedronLineWidth );
+
+  glColor3fv( TriedronColorX );
+  glBegin( GL_LINES );
+  glVertex3dv( TriedronOrigin );
+  glVertex3dv( TriedronAxeX );
+  glEnd();
+
+  glColor3fv( TriedronColorY );
+  glBegin( GL_LINES );
+  glVertex3dv( TriedronOrigin );
+  glVertex3dv( TriedronAxeY );
+  glEnd();
+
+  glColor3fv( TriedronColorZ );
+  glBegin( GL_LINES );
+  glVertex3dv( TriedronOrigin );
+  glVertex3dv( TriedronAxeZ );
+  glEnd();
+
+  GLdouble l = L - L/4.;
+  GLdouble rayon = L/20.;
+  GLint ii, NbFacettes = 12;
+  GLdouble Angle = 2. * PI / NbFacettes;
+  GLdouble TriedronCoord[3] = { 1.0, 0.0, 0.0 };
+
+  if( myTextList == 0 )
+    myTextList = generateTextList();
+
+  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+
+  glColor3fv( TriedronColorX );
+  glBegin( GL_TRIANGLE_FAN );
+  glVertex3dv( TriedronAxeX );
+  TriedronCoord[0] = TriedronOrigin[0] + l ;
+  ii = NbFacettes;
+  while (ii >= 0 ) {
+    TriedronCoord[1] = TriedronOrigin[1] + ( rayon * sin(ii * Angle) );
+    TriedronCoord[2] = TriedronOrigin[2] + ( rayon * cos(ii * Angle) );
+    glVertex3dv( TriedronCoord );
+    ii--;
+  }
+  glEnd();
+
+  drawText( myTextList, "X", TriedronAxeX, TriedronLetterColorX );
+
+  glColor3fv( TriedronColorY );
+  glBegin( GL_TRIANGLE_FAN );
+  glVertex3dv( TriedronAxeY );
+  TriedronCoord[1] = TriedronOrigin[1] + l ;
+  ii = NbFacettes;
+  while (ii >= 0 ) {
+    TriedronCoord[0] = TriedronOrigin[0] + (rayon * cos(ii * Angle) );
+    TriedronCoord[2] = TriedronOrigin[2] + (rayon * sin(ii * Angle) );
+    glVertex3dv( TriedronCoord );
+    ii--;
+  }
+  glEnd();
+
+  drawText( myTextList, "Y", TriedronAxeY, TriedronLetterColorY );
+
+  glColor3fv( TriedronColorZ );
+  glBegin( GL_TRIANGLE_FAN );
+  glVertex3dv( TriedronAxeZ );
+  TriedronCoord[2] = TriedronOrigin[2] + l ;
+  ii = NbFacettes;
+  while (ii >= 0 ) {
+    TriedronCoord[0] = TriedronOrigin[0] + ( rayon * sin(ii * Angle) );
+    TriedronCoord[1] = TriedronOrigin[1] + ( rayon * cos(ii * Angle) );
+    glVertex3dv( TriedronCoord );
+    ii--;
+  }
+  glEnd();
+
+  drawText( myTextList, "Z", TriedronAxeZ, TriedronLetterColorZ );
+
+  glPopAttrib();
+}
diff --git a/src/OCCViewer/OCCViewer_Trihedron.h b/src/OCCViewer/OCCViewer_Trihedron.h
new file mode 100644 (file)
index 0000000..549e592
--- /dev/null
@@ -0,0 +1,60 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef OCCVIEWER_TRIHEDRON_H
+#define OCCVIEWER_TRIHEDRON_H
+
+#include "OCCViewer.h"
+
+#include <AIS_InteractiveObject.hxx>
+#include <Graphic3d_CBounds.hxx>
+#include <Standard_DefineHandle.hxx>
+
+/*!
+ * \class OCCViewer_Trihedron
+ * The class for the presentation of the UserDraw object. 
+*/
+class OCCViewer_Trihedron : public AIS_InteractiveObject
+{
+public:
+  OCCViewer_Trihedron( const PrsMgr_TypeOfPresentation3d = PrsMgr_TOP_AllView );
+  virtual ~OCCViewer_Trihedron();
+
+  virtual void           Compute( const Handle(PrsMgr_PresentationManager3d)&,
+                                 const Handle(Prs3d_Presentation)&,
+                                 const Standard_Integer );
+
+  virtual void           ComputeSelection( const Handle( SelectMgr_Selection )&,
+                                          const Standard_Integer );
+
+  virtual void           bounds( Graphic3d_CBounds& ) const;
+
+  virtual void           display();
+
+  DEFINE_STANDARD_RTTI( OCCViewer_Trihedron )
+
+private:
+  unsigned int           myTextList;
+};
+
+DEFINE_STANDARD_HANDLE( OCCViewer_Trihedron, AIS_InteractiveObject )
+
+#endif
index 77ef0acede346334acca6a3c7926466e588147bc..e7ba5ea8fffc3417f39a95e16e0db77b9920e1ab 100755 (executable)
@@ -1,22 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "OCCViewer_VService.h"
 #include <V3d_Viewer.hxx>
 #include <V3d_View.hxx>
@@ -32,6 +34,7 @@
 #include <WNT_GraphicDevice.hxx>
 #include <WNT_GraphicDevice.hxx>
 #include <WNT_WDriver.hxx>
+#include <InterfaceGraphic_WNT.hxx>
 #else
 #include <Xw_Window.hxx>
 #include <Graphic3d_GraphicDevice.hxx>
@@ -89,6 +92,8 @@ void OCCViewer_VService::SetWindow( const Handle(V3d_View)& view,
 #ifdef WNT
   Handle(WNT_Window) w =
       new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin );
+  // Prevent flicker
+  w->SetFlags( WDF_NOERASEBKGRND );
 #else
   Handle(Xw_Window) w =
       new Xw_Window( Handle(Graphic3d_GraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin, quality );
index b15ab5564975e15ce5e4cb02055a1ead81ef1b1d..43298b1f366850d2d18b94c34b497abd4717f043 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OCCVIEWER_VSERVICE_H
 #define OCCVIEWER_VSERVICE_H
index 3d799109ff37646d6494ca4585f7c64cbfeb204d..52a8813f08a1a8a4e505e2c7a102a9deef874aec 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "OCCViewer_ViewManager.h"
 #include "OCCViewer_ViewWindow.h"
@@ -24,7 +27,7 @@
   Constructor
 */
 OCCViewer_ViewManager::OCCViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop, bool DisplayTrihedron )
-: SUIT_ViewManager( study, theDesktop, new OCCViewer_Viewer( DisplayTrihedron ) )
+: SUIT_ViewManager( study, theDesktop, new OCCViewer_Viewer( DisplayTrihedron, false ) )
 {
   setTitle( tr( "OCC_VIEW_TITLE" ) );
 }
@@ -40,7 +43,7 @@ OCCViewer_ViewManager::~OCCViewer_ViewManager()
   Fills popup menu with custom actions
  \param popup - popup menu to be filled with
 */
-void OCCViewer_ViewManager::contextMenuPopup( QPopupMenu* popup )
+void OCCViewer_ViewManager::contextMenuPopup( QMenu* popup )
 {
   SUIT_ViewManager::contextMenuPopup( popup );
   // if it is necessary invoke method CreatePopup of ViewPort
index ea88d3577790a60217be9a48ff6883391cd1a2b6..ba44d017e87a9d30bb7a1ed836871bd75fb9821b 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OCCVIEWER_VIEWMANAGER_H
 #define OCCVIEWER_VIEWMANAGER_H
@@ -35,7 +38,7 @@ public:
 
   OCCViewer_Viewer* getOCCViewer() { return (OCCViewer_Viewer*) myViewModel; }
 
-  virtual void      contextMenuPopup( QPopupMenu* );
+  virtual void      contextMenuPopup( QMenu* );
 };
 
 #endif
index 5e64aafb371914ef13e06cded138e3adf315bb0e..8f8e8fabf1e8d3f5ea70004a16f920f3f31dc7b5 100755 (executable)
@@ -1,52 +1,66 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "OCCViewer_ViewModel.h"
 #include "OCCViewer_ViewWindow.h"
 #include "OCCViewer_VService.h"
 #include "OCCViewer_ViewPort3d.h"
 
 #include "SUIT_ViewWindow.h"
+#include "SUIT_ViewManager.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_Session.h"
 
-#include <qpainter.h>
-#include <qapplication.h>
-#include <qcolordialog.h>
-#include <qpalette.h>
-#include <qpopupmenu.h>
+#include "QtxActionToolMgr.h"
+
+#include <QPainter>
+#include <QApplication>
+#include <QColorDialog>
+#include <QPalette>
+#include <QMenu>
+#include <QMouseEvent>
+#include <QToolBar>
+#include <QDesktopWidget>
 
 #include <AIS_Axis.hxx>
 #include <AIS_Drawer.hxx>
+#include <AIS_ListOfInteractive.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 
 #include <Geom_Axis2Placement.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_DatumAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
+#include <Prs3d_LengthAspect.hxx>
+#include <Prs3d_AngleAspect.hxx>
+#include <Prs3d_TextAspect.hxx>
 
 /*!
   Constructor
   \param DisplayTrihedron - is trihedron displayed
 */
-OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron )
+OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron, bool DisplayStaticTrihedron )
 : SUIT_ViewModel(),
-myBgColor( Qt::black )
+  myBgColor( Qt::black ),
+  myShowStaticTrihedron( DisplayStaticTrihedron )
 {
   // init CasCade viewers
   myV3dViewer = OCCViewer_VService::Viewer3d( "", (short*) "Viewer3d", "", 1000.,
@@ -66,6 +80,15 @@ myBgColor( Qt::black )
   // display isoline on planar faces (box for ex.)
   myAISContext->IsoOnPlane( true );
 
+  double h = QApplication::desktop()->screenGeometry( QApplication::desktop()->primaryScreen() ).height() / 300. ;
+  Handle(Prs3d_Drawer) drawer = myAISContext->DefaultDrawer();
+  Handle(Prs3d_TextAspect) ta = drawer->TextAspect();
+  ta->SetHeight(100); // VSR: workaround for CAS.CADE bug (is it really needed ???)
+  ta->SetHeight(h);
+  drawer->SetTextAspect(ta);
+  drawer->AngleAspect()->SetTextAspect(ta);
+  drawer->LengthAspect()->SetTextAspect(ta);
+  
   clearViewAspects();
 
   /* create trihedron */
@@ -157,7 +180,7 @@ void OCCViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
   SUIT_ViewModel::setViewManager(theViewManager);
   if (theViewManager) {
     connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)), 
-            this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
+           this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
 
     connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)), 
             this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*)));
@@ -184,8 +207,15 @@ void OCCViewer_Viewer::onMouseMove(SUIT_ViewWindow* theWindow, QMouseEvent* theE
   if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
 
   OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
-  if ( isSelectionEnabled() )
-    myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView->getViewPort()->getView());
+
+  if ( isSelectionEnabled() ) {
+    if (aView->getViewPort()->isBusy()) return; // Check that the ViewPort initialization completed
+                                                // To Prevent call move event if the View port is not initialized
+                                                // IPAL 20883
+    Handle(V3d_View) aView3d = aView->getViewPort()->getView();
+    if ( !aView3d.IsNull() )
+      myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d);
+  }
 }
 
 
@@ -201,7 +231,7 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t
 
   myEndPnt.setX(theEvent->x()); myEndPnt.setY(theEvent->y());
   OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
-  bool aHasShift = (theEvent->state() & Qt::ShiftButton);
+  bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier);
   
   if (!aHasShift) emit deselection();
 
@@ -252,10 +282,10 @@ void OCCViewer_Viewer::enableSelection(bool isEnabled)
   if ( !myViewManager )
     return;
 
-  QPtrVector<SUIT_ViewWindow> wins = myViewManager->getViews();
+  QVector<SUIT_ViewWindow*> wins = myViewManager->getViews();
   for ( int i = 0; i < (int)wins.count(); i++ )
   {
-    OCCViewer_ViewWindow* win = ::qt_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
+    OCCViewer_ViewWindow* win = ::qobject_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
     if ( win )
       win->updateEnabledDrawMode();
   }
@@ -272,10 +302,10 @@ void OCCViewer_Viewer::enableMultiselection(bool isEnable)
   if ( !myViewManager )
     return;
 
-  QPtrVector<SUIT_ViewWindow> wins = myViewManager->getViews();
+  QVector<SUIT_ViewWindow*> wins = myViewManager->getViews();
   for ( int i = 0; i < (int)wins.count(); i++ )
   {
-    OCCViewer_ViewWindow* win = ::qt_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
+    OCCViewer_ViewWindow* win = ::qobject_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
     if ( win )
       win->updateEnabledDrawMode();
   }
@@ -284,16 +314,20 @@ void OCCViewer_Viewer::enableMultiselection(bool isEnable)
 /*!
   Builds popup for occ viewer
 */
-void OCCViewer_Viewer::contextMenuPopup(QPopupMenu* thePopup)
+void OCCViewer_Viewer::contextMenuPopup(QMenu* thePopup)
 {
-  thePopup->insertItem( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
-  thePopup->insertItem( tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+  thePopup->addAction( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
+  thePopup->addAction( tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
 
-  thePopup->insertSeparator();
+  thePopup->addSeparator();
 
   OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView());
-  if ( aView && !aView->getToolBar()->isVisible() )
-    thePopup->insertItem( tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
+
+  //Support of several toolbars in the popup menu
+  QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
+  QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
+  for( ; it!=last; it++ )
+    thePopup->addAction( (*it)->toggleViewAction() );
 }
 
 /*!
@@ -324,15 +358,6 @@ void OCCViewer_Viewer::onChangeBgColor()
     aViewPort3d->setBackgroundColor(selColor);
 }
 
-/*!
-  SLOT: called when popup item "Show toolbar" is activated, shows toolbar of active view window
-*/
-void OCCViewer_Viewer::onShowToolbar() {
-  OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView());
-  if ( aView )
-    aView->getToolBar()->show();    
-}
-
 /*!
   Updates OCC 3D viewer
 */
index 654dec238b0a2f1a34b32ab0734876042a3b18c4..dbddfa2391307b6d3fc63e97dfa5f5b83bd066fb 100755 (executable)
@@ -1,26 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OCCVIEWER_VIEWMODEL_H
 #define OCCVIEWER_VIEWMODEL_H
 
-#include <qcolor.h>
-#include <qcursor.h>
+#include <QColor>
+#include <QPoint>
 
 #include "OCCViewer.h"
 
 
 #include <V3d_View.hxx>
 #include <AIS_Trihedron.hxx>
-#include <AIS_ListOfInteractive.hxx>
 #include <AIS_InteractiveContext.hxx>
 
+class QMouseEvent;
+
 class SUIT_ViewWindow;
 class SUIT_Desktop;
 class OCCViewer_ViewWindow;
 
+class AIS_ListOfInteractive;
+
 struct viewAspect
 {
 public:
@@ -51,10 +57,15 @@ public:
        double     eyeX;
        double     eyeY;
        double     eyeZ;
+        double   scaleX;
+        double   scaleY;
+        double   scaleZ;
        QString    name;
+       bool     isVisible;
+       double   size;
 };
 
-typedef QValueList<viewAspect> viewAspectList;
+typedef QList<viewAspect> viewAspectList;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -67,22 +78,21 @@ class OCCVIEWER_EXPORT OCCViewer_Viewer: public SUIT_ViewModel
 public:
   static QString Type() { return "OCCViewer"; }
 
-  OCCViewer_Viewer( bool DisplayTrihedron = true );
+  OCCViewer_Viewer( bool DisplayTrihedron = true, bool DisplayStaticTrihedron = true );
   virtual ~OCCViewer_Viewer();
 
   void update();
 
-       virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
-
-       virtual void                    setViewManager(SUIT_ViewManager* theViewManager);
+  virtual SUIT_ViewWindow*        createView(SUIT_Desktop* theDesktop);
+  
+  virtual void                    setViewManager(SUIT_ViewManager* theViewManager);
   virtual QString                 getType() const { return Type(); }
 
-  virtual void                    contextMenuPopup(QPopupMenu*);
+  virtual void                    contextMenuPopup(QMenu*);
   
   void                            getSelectedObjects(AIS_ListOfInteractive& theList);
   void                            setObjectsSelected(const AIS_ListOfInteractive& theList);
-  void                            setSelected(const Handle(AIS_InteractiveObject)& theIO)
-  { myAISContext->SetSelected(theIO);}
+  void                            setSelected(const Handle(AIS_InteractiveObject)& theIO) { myAISContext->SetSelected(theIO);}
 
   void                            performSelectionChanged();
   // emit signal selectionChanged
@@ -115,19 +125,17 @@ public:
   Handle(AIS_Trihedron)           getTrihedron()   const { return myTrihedron; }
 
   void                            enableSelection(bool isEnabled);
-  bool                            isSelectionEnabled() const 
-  { return mySelectionEnabled; }
+  bool                            isSelectionEnabled() const { return mySelectionEnabled; }
 
   void                            enableMultiselection(bool isEnable);
-  bool                            isMultiSelectionEnabled() const 
-  { return myMultiSelectionEnabled; }
+  bool                            isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
 
-  int                             getSelectionCount() const 
-  { return (!myAISContext.IsNull())? myAISContext->NbSelected():0; }
+  int                             getSelectionCount() const { return (!myAISContext.IsNull())? myAISContext->NbSelected():0; }
+  bool                            isStaticTrihedronDisplayed() { return myShowStaticTrihedron; }
 
   /* Selection management */
-  bool         highlight( const Handle(AIS_InteractiveObject)&, bool, bool=true );
-  bool         unHighlightAll( bool=true ); 
+  bool    highlight( const Handle(AIS_InteractiveObject)&, bool, bool=true );
+  bool   unHighlightAll( bool=true ); 
   bool    isInViewer( const Handle(AIS_InteractiveObject)&, bool=false );
   bool    isVisible( const Handle(AIS_InteractiveObject)& );
 
@@ -150,7 +158,6 @@ protected slots:
   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
 
   void onDumpView();
-  void onShowToolbar();
   void onChangeBgColor();
 
 private:
@@ -167,6 +174,8 @@ private:
 
   QColor                          myBgColor;
   QPoint                          myStartPnt, myEndPnt;
+
+  bool                            myShowStaticTrihedron;
 };
 
 #ifdef WIN32
index b0c6e617e92ee5ae0df3f86438e64ef90403adb6..a975fe049a0c651d32b558e906e76dc4833fa8a9 100755 (executable)
@@ -1,22 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #if !defined WNT
 #define QT_CLEAN_NAMESPACE         /* avoid definition of INT32 and INT8 */
 #endif
 
 #include "SUIT_Session.h"
 
-#include <qrect.h>
-#include <qcursor.h>
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qintdict.h>
-#include <qpopupmenu.h>
-#include <qcolordialog.h>
+#include <QColor>
+#include <QRect>
+#include <QPixmap>
+#include <QPainter>
+#include <QMultiHash>
+#include <QMenu>
+#include <QColorDialog>
+#include <QColormap>
+#include <QCoreApplication>
 
 #include <stdlib.h>
 
 #if !defined WNT
+#include <QX11Info>
 #include <GL/glx.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -70,104 +75,106 @@ CMapEntry::CMapEntry()
 CMapEntry::~CMapEntry()
 {
        if ( alloc )
-        XFreeColormap( QPaintDevice::x11AppDisplay(), cmap );
+         XFreeColormap( QX11Info::display(), cmap );
 }
 
-static QIntDict<CMapEntry> *cmap_dict = 0;
+static QMultiHash<int,CMapEntry> *cmap_dict = 0;
 static bool mesa_gl = false;
 
 static void cleanup_cmaps()
 {
        if ( !cmap_dict )
                return;
-       cmap_dict->setAutoDelete( true );
+       //while (!cmap_dict->isEmpty())
+       //  cmap_dict->erase(cmap_dict->begin());
+       cmap_dict->clear();
        delete cmap_dict;
        cmap_dict = 0;
 }
 
 static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
 {
-       if ( !cmap_dict )
-       {
-               cmap_dict = new QIntDict<CMapEntry>;
-               const char *v = glXQueryServerString( dpy, vi->screen, GLX_VERSION );
-               mesa_gl = strstr( v,"Mesa" ) != 0;
-               qAddPostRoutine( cleanup_cmaps );
-       }
-
-       CMapEntry *x = cmap_dict->find( (long)vi->visualid );
-    if ( x )                                   // found colormap for visual
-        return x->cmap;
-
-    x = new CMapEntry();
-
-    XStandardColormap *c;
-    int n, i;
+  if ( !cmap_dict )
+  {
+    cmap_dict = new QMultiHash<int,CMapEntry>;
+    const char *v = glXQueryServerString( dpy, vi->screen, GLX_VERSION );
+    mesa_gl = strstr( v,"Mesa" ) != 0;
+    qAddPostRoutine( cleanup_cmaps );
+  }
+
+  QHash<int,CMapEntry>::iterator itH = cmap_dict->find( (long)vi->visualid );
+  if ( itH != cmap_dict->end() )  // found colormap for visual
+    return itH.value().cmap;
+  
+  CMapEntry x;
+  
+  XStandardColormap *c;
+  int n, i;
 
-    //#ifdef DEBUG
-    //cout << "Choosing cmap for vID = " << vi->visualid << endl;
-    //#endif
+  //#ifdef DEBUG
+  //cout << "Choosing cmap for vID = " << vi->visualid << endl;
+  //#endif
 
-    if ( vi->visualid == XVisualIDFromVisual( (Visual*)QPaintDevice::x11AppVisual() ) )
-       {
+  if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
+  {
 #ifdef DEBUG
-               cout << "Using x11AppColormap" << endl;
+    cout << "Using x11AppColormap" << endl;
 #endif
-               return QPaintDevice::x11AppColormap();
-    }
+    return QX11Info::appColormap();
+  }
 
-    if ( mesa_gl )
+  if ( mesa_gl )
+  {
+    Atom hp_cmaps = XInternAtom( dpy, "_HP_RGB_SMOOTH_MAP_LIST", true );
+    if ( hp_cmaps && vi->visual->c_class == TrueColor && vi->depth == 8 )
+    {
+      if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, hp_cmaps ) )
+      {
+       i = 0;
+       while ( i < n && x.cmap == 0 )
        {
-               Atom hp_cmaps = XInternAtom( dpy, "_HP_RGB_SMOOTH_MAP_LIST", true );
-               if ( hp_cmaps && vi->visual->c_class == TrueColor && vi->depth == 8 )
-               {
-               if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, hp_cmaps ) )
-            {
-                       i = 0;
-                           while ( i < n && x->cmap == 0 )
-                {
-                               if ( c[i].visualid == vi->visual->visualid )
-                                   {
-                                       x->cmap = c[i].colormap;
-                                           x->scmap = c[i];
-                               }
-                                   i++;
-                }
-                           XFree( (char*)c );
-               }
-        }
+         if ( c[i].visualid == vi->visual->visualid )
+         {
+           x.cmap = c[i].colormap;
+           x.scmap = c[i];
+         }
+         i++;
        }
+       XFree( (char*)c );
+      }
+    }
+  }
 #if !defined( _OS_SOLARIS_ )
-    if ( !x->cmap )
+  if ( !x.cmap )
+  {
+    if ( XmuLookupStandardColormap( dpy, vi->screen, vi->visualid, vi->depth, XA_RGB_DEFAULT_MAP, false, true ) )
     {
-           if ( XmuLookupStandardColormap( dpy, vi->screen, vi->visualid, vi->depth, XA_RGB_DEFAULT_MAP, false, true ) )
-        {
-                   if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, XA_RGB_DEFAULT_MAP ) )
-            {
-                           i = 0;
-                               while ( i < n && x->cmap == 0 )
-                               {
-                                   if ( c[i].visualid == vi->visualid )
-                    {
-                                           x->cmap = c[i].colormap;
-                                               x->scmap = c[i];
-                                   }
-                                       i++;
-                }
-                               XFree( (char *)c );
-            }
-        }
-    }
-#endif
-       if ( !x->cmap )
+      if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, XA_RGB_DEFAULT_MAP ) )
+      {
+       i = 0;
+       while ( i < n && x.cmap == 0 )
        {
-               // no shared cmap found
-               x->cmap = XCreateColormap( dpy, RootWindow( dpy, vi->screen ), vi->visual, AllocNone );
-               x->alloc = true;
+         if ( c[i].visualid == vi->visualid )
+         {
+           x.cmap = c[i].colormap;
+           x.scmap = c[i];
+         }
+         i++;
        }
-
-       cmap_dict->insert( (long)vi->visualid, x ); // associate cmap with visualid
-       return x->cmap;
+       XFree( (char *)c );
+      }
+    }
+  }
+#endif
+  if ( !x.cmap )
+  {
+    // no shared cmap found
+    x.cmap = XCreateColormap( dpy, RootWindow( dpy, vi->screen ), vi->visual, AllocNone );
+    x.alloc = true;
+  }
+
+  cmap_dict->insert( (long)vi->visualid, x ); // associate cmap with visualid
+  return x.cmap;
 }
 #endif
 
@@ -176,7 +183,7 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
     Constructor
 */
 OCCViewer_ViewPort::OCCViewer_ViewPort( QWidget* parent )
-: QWidget( parent, 0, WRepaintNoErase | WResizeNoErase )
+: QWidget( parent )
 {
        initialize();
 }
@@ -194,15 +201,16 @@ OCCViewer_ViewPort::~OCCViewer_ViewPort()
 */
 void OCCViewer_ViewPort::initialize()
 {
-  myPopupActions.setAutoDelete( true );
   myPaintersRedrawing = false;
   myEnableSketching = true;
   myEnableTransform = true;
   
   setMouseTracking( true );
-  setBackgroundMode( NoBackground );
+  setBackgroundRole( QPalette::NoRole );//NoBackground );
   // set focus policy to threat QContextMenuEvent from keyboard  
-  setFocusPolicy( StrongFocus );
+  setFocusPolicy( Qt::StrongFocus );
+  setAttribute( Qt::WA_PaintOnScreen );
+  setAttribute( Qt::WA_NoSystemBackground );
 }
 
 /*!
@@ -219,57 +227,57 @@ void OCCViewer_ViewPort::selectVisualId()
 {
 #if !defined WNT
        XVisualInfo* pVisualInfo;
-       if ( x11Display() )
+       if ( QX11Info::display() )
        {
                /* Initialization with the default VisualID */
-               Visual *v = DefaultVisual( x11Display(), DefaultScreen( x11Display() ) );
+               Visual *v = DefaultVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
                int visualID = XVisualIDFromVisual( v );
 
                /*  Here we use the settings from Optimizer_ViewInfo::TxglCreateWindow() */
                int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
                                                         GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, None };
 
-               pVisualInfo = ::glXChooseVisual( x11Display(), DefaultScreen( x11Display() ), visualAttr );
+               pVisualInfo = ::glXChooseVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ), visualAttr );
 
                if ( isVisible() )
-            hide();
+                 hide();
 
                XSetWindowAttributes a;
 
-               a.colormap = choose_cmap( x11Display(), pVisualInfo );      /* find best colormap */
-               a.background_pixel = backgroundColor().pixel();
-               a.border_pixel = black.pixel();
-               Window p = RootWindow( x11Display(), DefaultScreen( x11Display() ) );
+               a.colormap = choose_cmap( QX11Info::display(), pVisualInfo );       /* find best colormap */
+               a.background_pixel = QColormap::instance().pixel( backgroundColor() );
+               a.border_pixel = QColormap::instance().pixel( Qt::black );
+               Window p = RootWindow( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
                if ( parentWidget() )
-            p = parentWidget()->winId();
+                 p = parentWidget()->winId();
 
-        Window w;
+               Window w;
        /*        if ( type == Type2D )  // creating simple X window for 2d
         {
             unsigned long xbackground =
-                BlackPixel( x11Display(), DefaultScreen( x11Display() ) );
+                BlackPixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
             unsigned long xforeground =
-                WhitePixel( x11Display(), DefaultScreen( x11Display() ) );
+                WhitePixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
 
-            w = XCreateSimpleWindow ( x11Display(), p, x(), y(), width(),
+            w = XCreateSimpleWindow ( QX11Info::display(), p, x(), y(), width(),
                                       height(), 0, xforeground, xbackground );
         }
         else if ( type == Type3D )
         {
-                   w = XCreateWindow( x11Display(), p,  x(), y(), width(), height(),
+                   w = XCreateWindow( QX11Info::display(), p,  x(), y(), width(), height(),
                                0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
                                CWBackPixel | CWBorderPixel | CWColormap, &a );
                }
                else
                return;*/
-       w = XCreateWindow( x11Display(), p,  x(), y(), width(), height(),
+       w = XCreateWindow( QX11Info::display(), p,  x(), y(), width(), height(),
                           0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
                           CWBackPixel | CWBorderPixel | CWColormap, &a );
        
                Window *cmw;
                Window *cmwret;
                int count;
-               if ( XGetWMColormapWindows( x11Display(), topLevelWidget()->winId(), &cmwret, &count ) )
+               if ( XGetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), &cmwret, &count ) )
                {
                        cmw = new Window[count+1];
                        memcpy( (char*)cmw, (char*)cmwret, sizeof(Window) * count );
@@ -297,7 +305,7 @@ void OCCViewer_ViewPort::selectVisualId()
 
                /* Creating new window (with good VisualID) for this widget */
                create(w);
-               XSetWMColormapWindows( x11Display(), topLevelWidget()->winId(), cmw, count );
+               XSetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), cmw, count );
                delete[] cmw;
 
                if ( isVisible() )
@@ -307,7 +315,7 @@ void OCCViewer_ViewPort::selectVisualId()
         {
                        XFree( (char *)pVisualInfo );
                }
-               XFlush( x11Display() );
+               XFlush( QX11Info::display() );
        }
 #endif
 }
@@ -318,7 +326,7 @@ void OCCViewer_ViewPort::selectVisualId()
 void OCCViewer_ViewPort::setBackgroundColor( const QColor& color )
 {
     QPalette pal = palette();
-    pal.setColor( QColorGroup::Background, color );
+    pal.setColor( QPalette::Background, color );
     setPalette( pal );
     repaint();
     emit vpChangeBGColor( color );
@@ -329,7 +337,7 @@ void OCCViewer_ViewPort::setBackgroundColor( const QColor& color )
 */
 QColor OCCViewer_ViewPort::backgroundColor() const
 {
-    return palette().active().background();
+    return palette().color( QPalette::Active, QPalette::Background );
 }
 
 /*!
@@ -466,6 +474,8 @@ void OCCViewer_ViewPort::onUpdate()
        {
                for ( QtxAction* a = myPopupActions.first(); a; a = myPopupActions.next() )
                        a->removeFrom( popup );
+               //while (!myPopupActions.isEmpty())
+               //  delete myPopupActions.takeFirst();
                myPopupActions.clear();
        }
 }*/
index b4742b2930dcd7acfa8605f7a84e5759813478e3..48e4dccb0033f1ae317093d7d4694a2e7fbbe95e 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OCCVIEWER_VIEWPORT_H
 #define OCCVIEWER_VIEWPORT_H
 
 #include "QtxAction.h"
 
-#include <qlist.h>
-#include <qcolor.h>
-#include <qwidget.h>
+#include <QList>
+#include <QWidget>
 
 #include <Aspect_Window.hxx>
 
+class QColor;
 class QRect;
-class QCursor;
 class QPainter;
 class OCCViewer_ViewSketcher;
-class OCCViewer_ViewTransformer;
 
 #ifdef WIN32
 #pragma warning ( disable:4251 )
@@ -45,74 +46,74 @@ class OCCViewer_ViewTransformer;
 */
 class OCCVIEWER_EXPORT OCCViewer_ViewPort : public QWidget
 {
-       Q_OBJECT
+  Q_OBJECT
 
   friend class OCCViewer_ViewSketcher;
 
 public:
   OCCViewer_ViewPort( QWidget* parent );
-       virtual ~OCCViewer_ViewPort();
+  virtual ~OCCViewer_ViewPort();
 
 public:
-       void                             setSketchingEnabled( bool );
+  void                          setSketchingEnabled( bool );
   bool                           isSketchingEnabled() const;
   void                          setTransformEnabled( bool );
   bool                           isTransformEnabled() const;
 
-  virtual QColor                        backgroundColor() const;
-  virtual void                     setBackgroundColor( const QColor& );
+  virtual QColor                 backgroundColor() const;
+  virtual void                   setBackgroundColor( const QColor& );
 
   void                          redrawPainters();
 
-  virtual void                     onUpdate();
+  virtual void                   onUpdate();
 
 protected:
 //     enum ViewType { Type2D, Type3D };
-       void                                     selectVisualId();
+  void                          selectVisualId();
 
 // EVENTS
-       virtual void                   paintEvent( QPaintEvent *);
-       virtual void                     mouseMoveEvent( QMouseEvent *);
-       virtual void                     mouseReleaseEvent( QMouseEvent *);
-       virtual void                     mousePressEvent( QMouseEvent *);
-       virtual void                     mouseDoubleClickEvent( QMouseEvent *);
-  virtual void                     keyPressEvent( QKeyEvent *);
-  virtual void                     keyReleaseEvent( QKeyEvent *);
+  virtual void                   paintEvent( QPaintEvent *);
+  virtual void                  mouseMoveEvent( QMouseEvent *);
+  virtual void                  mouseReleaseEvent( QMouseEvent *);
+  virtual void                  mousePressEvent( QMouseEvent *);
+  virtual void                  mouseDoubleClickEvent( QMouseEvent *);
+  virtual void                   keyPressEvent( QKeyEvent *);
+  virtual void                   keyReleaseEvent( QKeyEvent *);
 
 // TO BE REDEFINED
   virtual void                  reset() = 0;
   virtual void                  pan( int, int ) = 0;
-       virtual void                     setCenter( int, int ) = 0;
-       virtual void                     fitRect( const QRect& ) = 0;
+  virtual void                  setCenter( int, int ) = 0;
+  virtual void                  fitRect( const QRect& ) = 0;
   virtual void                  zoom( int, int, int, int ) = 0;
   virtual void                  fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0;
 
 // POPUP
 //  void                             onCreatePopup( QPopupMenu* );
-//     void                             onDestroyPopup( QPopupMenu* );
+//  void                             onDestroyPopup( QPopupMenu* );
 
 protected slots:
   virtual void                  onChangeBgColor();
 
 signals:
-  void                                  vpKeyEvent( QKeyEvent* );
-  void                                  vpMouseEvent( QMouseEvent* );
-       void                                 vpDrawExternal( QPainter* );
+  void                          vpKeyEvent( QKeyEvent* );
+  void                          vpMouseEvent( QMouseEvent* );
+  void                          vpDrawExternal( QPainter* );
   void                           vpChangeBGColor( QColor );
 
 private:
-       void                             initialize();
-       void                             cleanup();
+  void                          initialize();
+  void                          cleanup();
 
 protected:
-  Handle(Aspect_Window)         myWindow;
-  bool                                     myEnableSketching;
-  bool                                     myEnableTransform;
-  bool                                     myPaintersRedrawing;        /* set to draw externally */
-  QPtrList<QtxAction>           myPopupActions;
+  Handle(Aspect_Window)          myWindow;
+  bool                          myEnableSketching;
+  bool                          myEnableTransform;
+  bool                          myPaintersRedrawing; /* set to draw externally */
+  QList<QtxAction*>              myPopupActions;
 
 private:
-       static int                               nCounter;                              /* objects counter */
+  static int                    nCounter; /* objects counter */
 };
 
 #ifdef WIN32
index cbeb3ce9c3a61f9b6a084eeeeaa455c9d9f20a83..7fc204ddd3a1e489df889386d10da86c93c4ac02 100755 (executable)
@@ -1,32 +1,40 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "OCCViewer_ViewPort3d.h"
 
 #include "OCCViewer_VService.h"
 #include "OCCViewer_ViewWindow.h"
+#include "OCCViewer_ViewModel.h"
 
-#include <qrect.h>
-#include <qevent.h>
-#include <qapplication.h>
+#include <SUIT_ViewManager.h>
+
+#include <QColor>
+#include <QRect>
+#include <QPaintEvent>
+#include <QResizeEvent>
+#include <QApplication>
 
 #include <Visual3d_View.hxx>
+#include <V3d_Viewer.hxx>
 #include <V3d_PerspectiveView.hxx>
 #include <V3d_OrthographicView.hxx>
 
@@ -49,7 +57,8 @@ OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_V
 : OCCViewer_ViewPort( parent ),
 myScale( 1.0 ),
 myDegenerated( true ),
-myAnimate( false )
+myAnimate( false ),
+myBusy( true )
 {
   selectVisualId();
 
@@ -107,6 +116,16 @@ bool OCCViewer_ViewPort3d::mapView( const Handle(V3d_View)& view )
                if ( view != activeView() )
            view->View()->Deactivate();
        }
+
+  /* create static trihedron (16551: EDF PAL 501) */
+  OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget() );
+  if ( aVW ){
+    OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
+    if ( aViewModel && aViewModel->isStaticTrihedronDisplayed() ){
+      view->ZBufferTriedronSetup();
+      view->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.05, V3d_ZBUFFER );
+    }
+  }
   return true;
 }
 
@@ -253,10 +272,10 @@ void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color )
 {
        if ( !activeView().IsNull() )
        {
-               activeView()->SetBackgroundColor( Quantity_TOC_RGB, color.red()/255.,
-                                                                                                 color.green()/255., color.blue()/255.);
-               activeView()->Update();
-    emit vpChangeBGColor( color );
+         activeView()->SetBackgroundColor( Quantity_TOC_RGB, color.red()/255.,
+                                           color.green()/255., color.blue()/255.);
+         activeView()->Update();
+         emit vpChangeBGColor( color );
        }
 }
 
@@ -441,6 +460,7 @@ void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e )
                    activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
        }
        OCCViewer_ViewPort::paintEvent( e );
+       myBusy = false;
 }
 
 /*!
@@ -463,7 +483,7 @@ void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e )
 */
 void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
 {
-       if ( activeView().IsNull() )
+  if ( activeView().IsNull() )
     return;
 
 
index 4f840bd02f8a23a1759ffcfcca726078115c4a73..efa011d4b5e408dcfd24ddf2ec86fbf17719213c 100755 (executable)
@@ -1,55 +1,58 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OCCVIEWER_VIEWPORT3D_H
 #define OCCVIEWER_VIEWPORT3D_H
 
 #include "OCCViewer_ViewPort.h"
 
-#include <qcolor.h>
-
 #include <V3d_View.hxx>
-#include <V3d_Viewer.hxx>
 
+class QColor;
 class QRect;
 
+class Handle(V3d_Viewer);
+
 #ifdef WIN32
 #pragma warning ( disable:4251 )
 #endif
 
 class OCCVIEWER_EXPORT OCCViewer_ViewPort3d: public OCCViewer_ViewPort
 {
-       Q_OBJECT
+  Q_OBJECT
 
   friend class OCCViewer_ViewTransformer;
 
 public:
-       OCCViewer_ViewPort3d( QWidget*, const Handle(V3d_Viewer)&, V3d_TypeOfView = V3d_ORTHOGRAPHIC );
-       virtual ~OCCViewer_ViewPort3d();
+  OCCViewer_ViewPort3d( QWidget*, const Handle(V3d_Viewer)&, V3d_TypeOfView = V3d_ORTHOGRAPHIC );
+  virtual ~OCCViewer_ViewPort3d();
 
 public:
-       Handle(V3d_View)        getView() const;
-  Handle(V3d_View)                 setView( const Handle(V3d_View)& );
-       Handle(V3d_Viewer)      getViewer() const;
+  Handle(V3d_View)        getView() const;
+  Handle(V3d_View)       setView( const Handle(V3d_View)& );
+  Handle(V3d_Viewer)      getViewer() const;
 
   void setAnimationMode(bool theDegenerated);
 
-       virtual void                    setBackgroundColor( const QColor& color);
+  virtual void         setBackgroundColor( const QColor& color);
   virtual QColor       backgroundColor() const;
 
 //   void         setActive( V3d_TypeOfView );
@@ -63,34 +66,36 @@ public:
   // TRANSFORMATIONS
   virtual void         reset();
   virtual void         pan( int , int );
-       virtual void            setCenter( int , int );
-       virtual void            fitRect( const QRect& );
-       virtual void            zoom( int, int, int, int );
+  virtual void         setCenter( int , int );
+  virtual void         fitRect( const QRect& );
+  virtual void         zoom( int, int, int, int );
   virtual void         fitAll( bool keepScale = false, bool withZ = true, bool upd = true );
 
-       void                    startRotation( int, int, int, const gp_Pnt& );
-       void                    rotate( int, int, int, const gp_Pnt& );
-       void                    endRotation();
+  void                 startRotation( int, int, int, const gp_Pnt& );
+  void                 rotate( int, int, int, const gp_Pnt& );
+  void                 endRotation();
+  bool                  isBusy() {return myBusy;} // check that View Port is fully initialized
 
 protected:
     // EVENTS
-       virtual void                    paintEvent( QPaintEvent* );
-  virtual void      resizeEvent( QResizeEvent* );
+  virtual void         paintEvent( QPaintEvent* );
+  virtual void          resizeEvent( QResizeEvent* );
 
 private:
-       Handle(V3d_View) activeView() const;
-       Handle(V3d_View) inactiveView() const;
-       bool             mapView( const Handle(V3d_View)& );
-       bool               setWindow( const Handle(V3d_View)& );
-       bool                                       mapped( const Handle(V3d_View)& ) const;
+  Handle(V3d_View) activeView() const;
+  Handle(V3d_View) inactiveView() const;
+  bool             mapView( const Handle(V3d_View)& );
+  bool            setWindow( const Handle(V3d_View)& );
+  bool            mapped( const Handle(V3d_View)& ) const;
 
 private:
-  Handle(V3d_View)             myOrthoView;
-  Handle(V3d_View)             myPerspView;
-  Handle(V3d_View)             myActiveView;
-       bool            myDegenerated;
-  bool    myAnimate;
-       double  myScale;
+  Handle(V3d_View)     myOrthoView;
+  Handle(V3d_View)     myPerspView;
+  Handle(V3d_View)     myActiveView;
+  bool                 myDegenerated;
+  bool                  myAnimate;
+  bool                  myBusy;
+  double               myScale;
 };
 
 #ifdef WIN32
index a6e8d8e30d49d5c44371013391f2c98834efd07b..eec828a81dc587dab09435cb6231c293525f816b 100755 (executable)
@@ -1,29 +1,35 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "OCCViewer_ViewSketcher.h"
 #include "OCCViewer_ViewWindow.h"
 #include "OCCViewer_ViewPort3d.h"
 
-#include <qapplication.h>
-#include <qpainter.h>
-#include <qpointarray.h>
+#include "QtxRubberBand.h"
+
+#include <QApplication>
+#include <QPainter>
+#include <QPolygon>
+#include <QMouseEvent>
+#include <QKeyEvent>
 
 /****************************************************************
 **  Class: OCCViewer_ViewSketcher
@@ -125,7 +131,7 @@ bool OCCViewer_ViewSketcher::eventFilter( QObject* o, QEvent* e )
       {
         QMouseEvent* me = (QMouseEvent*)e;
 
-        myButtonState = me->state();
+        myButtonState = me->buttons();
         if ( e->type() == QEvent::MouseButtonPress )
           myButtonState |= me->button();
 
@@ -199,13 +205,18 @@ void OCCViewer_ViewSketcher::setSketchButton( int b )
 *****************************************************************/
 
 OCCViewer_RectSketcher::OCCViewer_RectSketcher( OCCViewer_ViewWindow* vw, int typ )
-: OCCViewer_ViewSketcher( vw, typ )
+  : OCCViewer_ViewSketcher( vw, typ )
 {
+  if ( vw )
+    {
+      OCCViewer_ViewPort3d* avp = mypViewWindow->getViewPort();
+      mypRectRB = new QtxRectRubberBand( avp );
+    }
 }
 
 OCCViewer_RectSketcher::~OCCViewer_RectSketcher()
 {
-  delete mypData;
+  delete (QRect*)mypData;
 }
 
 void OCCViewer_RectSketcher::onActivate()
@@ -215,8 +226,9 @@ void OCCViewer_RectSketcher::onActivate()
 
 void OCCViewer_RectSketcher::onDeactivate()
 {
-  delete mypData;
+  delete (QRect*)mypData;
   mypData = 0;
+  mypRectRB->clearGeometry();
 }
 
 bool OCCViewer_RectSketcher::onKey( QKeyEvent* e )
@@ -242,28 +254,42 @@ void OCCViewer_RectSketcher::onMouse( QMouseEvent* e )
   {
     myResult = Accept;
     QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(),
-                                                   e->globalPos(), e->state(), e->button() ) );
+                                                   e->globalPos(), e->button(), 
+                                                  e->buttons(), e->modifiers() ) );
   }
 }
 
 void OCCViewer_RectSketcher::onSketch( SketchState state )
 {
-  OCCViewer_ViewPort3d* avp = mypViewWindow->getViewPort();
-
-  QRect* sketchRect = (QRect*)data();
-  if ( myButtonState & sketchButton() )
-  {
-    QRect rect( QMIN( myStart.x(), myCurr.x() ), QMIN( myStart.y(), myCurr.y() ),
-                QABS( myStart.x() - myCurr.x() ), QABS( myStart.y() - myCurr.y() ) );
-    QPainter p( avp );
-    p.setPen( Qt::white );
-    p.setRasterOp( Qt::XorROP );
-    if ( state != Debut && !sketchRect->isEmpty() )
-      p.drawRect( *sketchRect );
-    *sketchRect = rect;
-    if ( !rect.isEmpty() && state != Fin )
-      p.drawRect( *sketchRect );
-  }
+  //OCCViewer_ViewPort3d* avp = mypViewWindow->getViewPort();
+
+  if ( mypRectRB )
+    {      
+      QRect* sketchRect = (QRect*)data();
+      if ( myButtonState & sketchButton() )
+        {   
+          QRect rect = QRect( myStart, myCurr ).normalized();
+          /*QRect rect( qMin( myStart.x(), myCurr.x() ), qMin( myStart.y(), myCurr.y() ),
+                      qAbs( myStart.x() - myCurr.x() ), qAbs( myStart.y() - myCurr.y() ) );
+          QPainter p( avp );
+          p.setPen( Qt::white );
+          p.setCompositionMode( QPainter::CompositionMode_Xor );
+          */
+          
+          //if ( state != Debut && !sketchRect->isEmpty() )
+          //  p.drawRect( *sketchRect );
+
+          *sketchRect = rect;
+          if ( !rect.isEmpty() && state != Fin )
+            {
+              //p.drawRect( *sketchRect );            
+              mypRectRB->initGeometry( rect );
+              mypRectRB->show();
+            }          
+          else
+            mypRectRB->hide();
+        }
+    }
 
   if ( state == Fin )
   {
@@ -281,24 +307,29 @@ OCCViewer_PolygonSketcher::OCCViewer_PolygonSketcher( OCCViewer_ViewWindow* vw,
 : OCCViewer_ViewSketcher( vw, typ ),
   myDbl           ( false ),
   myToler         ( 5, 5 ),
-  mypPoints        ( 0L ),
+  //mypPoints        ( 0L ),
   myAddButton     ( 0 ),
   myDelButton     ( 0 )
 {
   mySketchButton = Qt::RightButton;
+  if ( vw )
+    {
+      OCCViewer_ViewPort3d* avp = mypViewWindow->getViewPort();
+      mypPolyRB = new QtxPolyRubberBand( avp );
+    }
 }
 
 OCCViewer_PolygonSketcher::~OCCViewer_PolygonSketcher()
 {
-  delete mypPoints;
-  delete mypData;
+  //delete mypPoints;
+  delete (QPolygon*)mypData;
 }
 
 void OCCViewer_PolygonSketcher::onActivate()
 {
   myDbl = false;
-  mypData = new QPointArray( 0 );
-  mypPoints = new QPointArray( 0 );
+  mypData = new QPolygon( 0 );
+  //mypPoints = new QPolygon( 0 );
 
   switch ( sketchButton() )
   {
@@ -320,10 +351,13 @@ void OCCViewer_PolygonSketcher::onActivate()
 
 void OCCViewer_PolygonSketcher::onDeactivate()
 {
-  delete mypPoints;
-  mypPoints = 0;
-  delete mypData;
+  //delete mypPoints;
+  //mypPoints = 0;
+  delete (QPolygon*)mypData;
   mypData = 0;
+
+  if ( mypPolyRB )
+    mypPolyRB->clearGeometry();  
 }
 
 bool OCCViewer_PolygonSketcher::onKey( QKeyEvent* e )
@@ -335,7 +369,7 @@ bool OCCViewer_PolygonSketcher::onKey( QKeyEvent* e )
   }
   else if ( e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return )
   {
-    QPointArray* points = (QPointArray*)data();
+    QPolygon* points = (QPolygon*)data();
     if ( points->count() )
     {
       QPoint last = points->point( points->count() - 1 );
@@ -350,7 +384,7 @@ bool OCCViewer_PolygonSketcher::onKey( QKeyEvent* e )
   }
   else if ( e->key() == Qt::Key_Backspace && e->type() == QEvent::KeyRelease )
   {
-    QPointArray* points = (QPointArray*)data();
+    QPolygon* points = (QPolygon*)data();
     if ( points->count() > 1 )
       points->resize( points->count() - 1 );
     onMouse( 0 );
@@ -364,7 +398,7 @@ void OCCViewer_PolygonSketcher::onMouse( QMouseEvent* e )
 {
   OCCViewer_ViewPort3d* avp = mypViewWindow->getViewPort();
 
-  QPointArray* points = (QPointArray*)data();
+  QPolygon* points = (QPolygon*)data();
   if ( !points->count() && !myStart.isNull() )
   {
     points->resize( points->count() + 1 );
@@ -397,7 +431,8 @@ void OCCViewer_PolygonSketcher::onMouse( QMouseEvent* e )
   {
     myResult = Reject;
     QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(),
-                                                   e->globalPos(), e->state(), e->button() ) );
+                                                   e->globalPos(), e->button(), 
+                                                  e->buttons(), e->modifiers() ) );
   }
   else if ( e->type() == QEvent::MouseButtonRelease && ( e->button() & myAddButton ) )
   {
@@ -432,12 +467,12 @@ void OCCViewer_PolygonSketcher::onMouse( QMouseEvent* e )
 
 void OCCViewer_PolygonSketcher::onSketch( SketchState state )
 {
-  OCCViewer_ViewPort3d* avp = mypViewWindow->getViewPort();
+  //OCCViewer_ViewPort3d* avp = mypViewWindow->getViewPort();
 
-  QPointArray* points = (QPointArray*)data();
-  QPainter p( avp );
+  QPolygon* points = (QPolygon*)data();
+  /*QPainter p( avp );
   p.setPen( Qt::white );
-  p.setRasterOp( Qt::XorROP );
+  p.setCompositionMode( QPainter::CompositionMode_Xor );
   if ( state != Debut )
     p.drawPolyline( *mypPoints );
 
@@ -449,16 +484,38 @@ void OCCViewer_PolygonSketcher::onSketch( SketchState state )
     mypPoints->setPoint( points->count(), myCurr );
     if ( state != Fin )
       p.drawPolyline( *mypPoints );
-  }
-
+      }*/
+  if ( mypPolyRB )
+    {
+      mypPolyRB->setUpdatesEnabled ( false );
+      if ( !mypPolyRB->isVisible() )
+        mypPolyRB->show();
+      //if ( state != Debut )
+      //  mypPolyRB->repaint();
+
+      if ( state != Fin && points->count() )
+        mypPolyRB->initGeometry( QPolygon(*points) << myCurr );
+      //mypPolyRB->addNode( myCurr );
+
+      //if ( state != Fin )
+      //  mypPolyRB->repaint();
+      mypPolyRB->setUpdatesEnabled ( true );
+      //mypPolyRB->repaint();
+    }
+      
   if ( state == Fin )
   {
+    if ( mypPolyRB )
+      {
+        mypPolyRB->clearGeometry();
+        mypPolyRB->hide();
+      }
     QApplication::syncX();
     mypViewWindow->activateSketching( OCCViewer_ViewWindow::NoSketching );
   }
 }
 
-bool OCCViewer_PolygonSketcher::isValid( const QPointArray* aPoints, const QPoint& aCur ) const
+bool OCCViewer_PolygonSketcher::isValid( const QPolygon* aPoints, const QPoint& aCur ) const
 {
   if ( !aPoints->count() )
     return true;
@@ -514,20 +571,20 @@ bool OCCViewer_PolygonSketcher::isIntersect( const QPoint& aStart1, const QPoint
     if ( b1 != b2 )
       return false;
     else
-      return !( ( QMAX( x11, x12 ) <= QMIN( x21, x22 ) ||
-                  QMIN( x11, x12 ) >= QMAX( x21, x22 ) ) &&
-                ( QMAX( y11, y12 ) <= QMIN( y21, y22 ) ||
-                  QMIN( y11, y12 ) >= QMAX( y21, y22 ) ) );
+      return !( ( qMax( x11, x12 ) <= qMin( x21, x22 ) ||
+                  qMin( x11, x12 ) >= qMax( x21, x22 ) ) &&
+                ( qMax( y11, y12 ) <= qMin( y21, y22 ) ||
+                  qMin( y11, y12 ) >= qMax( y21, y22 ) ) );
   }
   else
   {
     double x0 = ( b2 - b1 ) / ( k1 - k2 );
     double y0 = ( k1 * b2 - k2 * b1 ) / ( k1 - k2 );
 
-    if ( QMIN( x11, x12 ) < x0 && x0 < QMAX( x11, x12 ) &&
-         QMIN( y11, y12 ) < y0 && y0 < QMAX( y11, y12 ) &&
-         QMIN( x21, x22 ) < x0 && x0 < QMAX( x21, x22 ) &&
-         QMIN( y21, y22 ) < y0 && y0 < QMAX( y21, y22 ) )
+    if ( qMin( x11, x12 ) < x0 && x0 < qMax( x11, x12 ) &&
+         qMin( y11, y12 ) < y0 && y0 < qMax( y11, y12 ) &&
+         qMin( x21, x22 ) < x0 && x0 < qMax( x21, x22 ) &&
+         qMin( y21, y22 ) < y0 && y0 < qMax( y21, y22 ) )
       return true;
   }
   return false;
index 367ece1042b3ffb142a7256685874911edc09e1b..b33b0690d10afc457f590471dd4d6dfc401dca9f 100755 (executable)
@@ -1,30 +1,40 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OCCVIEWER_VIEWSKETCHER_H
 #define OCCVIEWER_VIEWSKETCHER_H
 
 #include "OCCViewer.h"
 
-#include <qobject.h>
-#include <qcursor.h>
+#include <QObject>
+#include <QCursor>
+#include <QSize>
 
 class OCCViewer_ViewWindow;
+class QKeyEvent;
+class QMouseEvent;
+class QPolygon;
+
+class QtxRectRubberBand;
+class QtxPolyRubberBand;
 
 #ifdef WNT
 #pragma warning ( disable:4251 )
@@ -98,6 +108,8 @@ protected:
   virtual void                 onSketch( SketchState );
   virtual void                 onActivate();
   virtual void                 onDeactivate();
+ private:
+  QtxRectRubberBand*           mypRectRB;
 };
 
 /*!
@@ -118,16 +130,18 @@ protected:
   virtual void                 onDeactivate();
 
 private:
-  bool                         isValid( const QPointArray*, const QPoint& ) const;
+  bool                         isValid( const QPolygon*, const QPoint& ) const;
   bool                         isIntersect( const QPoint&, const QPoint&,
                                             const QPoint&, const QPoint& ) const;
 
 private:
   bool                         myDbl;
   QSize                        myToler;
-  QPointArray*                 mypPoints;
+  QPolygon*                    mypPoints;
   int                          myAddButton;
   int                          myDelButton;
+  
+  QtxPolyRubberBand*           mypPolyRB;
 };
 
 #ifdef WNT
index 78bd7147e870c31cda7a521668d7c1fd5b761668..a366dfbb5e52ba24cb8b1adf1ef6942e9c8e9be0 100755 (executable)
@@ -1,24 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : OCCViewer_ViewWindow.cxx
+// Author :
 //
-// OCCViewer_ViewWindow.cxx: implementation of the OCCViewer_ViewWindow class.
-
-
 #include "OCCViewer_ViewWindow.h"
 #include "OCCViewer_ViewModel.h"
 #include "OCCViewer_ViewPort3d.h"
 #include "OCCViewer_CreateRestoreViewDlg.h"
 #include "OCCViewer_ClippingDlg.h"
 #include "OCCViewer_SetRotationPointDlg.h"
+#include "OCCViewer_AxialScaleDlg.h"
 
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_ToolButton.h"
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_Tools.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_MessageBox.h>
 
-#include "SUIT_Tools.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_MessageBox.h"
+#include <QtxActionToolMgr.h>
+#include <QtxMultiAction.h>
+#include <QtxRubberBand.h>
 
-#include <qptrlist.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qcolor.h>
-#include <qpainter.h>
-#include <qapplication.h>
-#include <qdatetime.h>
-#include <qimage.h>
+#include <QPainter>
+#include <QTime>
+#include <QImage>
+#include <QMouseEvent>
+#include <QApplication>
 
 #include <V3d_Plane.hxx>
 #include <gp_Dir.hxx>
 #include <gp_Pln.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
 
+#include <AIS_ListOfInteractive.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 #include <AIS_Shape.hxx>
 
 #include <Visual3d_View.hxx>
 #include <Graphic3d_MapOfStructure.hxx>
 #include <Graphic3d_Structure.hxx>
+#include <Graphic3d_ExportFormat.hxx>
 
 static QEvent* l_mbPressEvent = 0;
 
-const char* imageZoomCursor[] = { 
+#ifdef WIN32
+# include <QWindowsStyle>
+#endif
+
+const char* imageZoomCursor[] = {
 "32 32 3 1",
 ". c None",
 "a c #000000",
@@ -102,7 +112,7 @@ const char* imageZoomCursor[] = {
 "................................",
 "................................"};
 
-const char* imageRotateCursor[] = { 
+const char* imageRotateCursor[] = {
 "32 32 3 1",
 ". c None",
 "a c #000000",
@@ -140,7 +150,7 @@ const char* imageRotateCursor[] = {
 "................................",
 "................................"};
 
-const char* imageCrossCursor[] = { 
+const char* imageCrossCursor[] = {
   "32 32 3 1",
   ". c None",
   "a c #000000",
@@ -180,31 +190,43 @@ const char* imageCrossCursor[] = {
 
 
 /*!
-  Constructor
-  \param theDesktop main window of application
-  \param theModel OCC 3D viewer
+  \brief Constructor
+  \param theDesktop main window of application
+  \param theModel OCC 3D viewer
 */
-OCCViewer_ViewWindow::OCCViewer_ViewWindow(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel)
-: SUIT_ViewWindow(theDesktop)
+OCCViewer_ViewWindow::OCCViewer_ViewWindow( SUIT_Desktop*     theDesktop,
+                                           OCCViewer_Viewer* theModel )
+: SUIT_ViewWindow( theDesktop )
 {
   myModel = theModel;
   myRestoreFlag = 0;
   myEnableDrawMode = false;
   updateEnabledDrawMode();
   myClippingDlg = 0;
+  myScalingDlg = 0;
   mySetRotationPointDlg = 0;
+  myRectBand = 0;
 
   mypSketcher = 0;
   myCurSketch = -1;
 }
 
 /*!
-  Initialization of view window
+  \brief Destructor.
+*/
+OCCViewer_ViewWindow::~OCCViewer_ViewWindow()
+{
+  endDrawRect();
+  qDeleteAll( mySketchers );
+}
+
+/*!
+  \brief Internal initialization.
 */
 void OCCViewer_ViewWindow::initLayout()
 {
   myViewPort = new OCCViewer_ViewPort3d( this, myModel->getViewer3d(), V3d_ORTHOGRAPHIC );
-  myViewPort->setBackgroundColor(black);
+  myViewPort->setBackgroundColor(Qt::black);
   myViewPort->installEventFilter(this);
   setCentralWidget(myViewPort);
   myOperation = NOTHING;
@@ -217,28 +239,27 @@ void OCCViewer_ViewWindow::initLayout()
   setTransformRequested ( NOTHING );
   setTransformInProcess ( false );
 
-  myToolBar = new QToolBar(this);
-  myToolBar->setCloseMode(QDockWindow::Undocked);
-  myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
-
   createActions();
   createToolBar();
 }
 
 /*!
-  \return type of operation by states of mouse and keyboard buttons
-  \param theEvent - mouse event
+  \brief Detect viewer operation according the the mouse button pressed
+  and key modifiers used.
+  \param theEvent mouse event
+  \return type of the operation
 */
-OCCViewer_ViewWindow::OperationType OCCViewer_ViewWindow::getButtonState(QMouseEvent* theEvent)
+OCCViewer_ViewWindow::OperationType
+OCCViewer_ViewWindow::getButtonState( QMouseEvent* theEvent )
 {
   OperationType aOp = NOTHING;
-  if( (theEvent->state() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::ZOOM]) &&
+  if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::ZOOM]) &&
       (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::ZOOM]) )
     aOp = ZOOMVIEW;
-  else if( (theEvent->state() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::PAN]) && 
+  else if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::PAN]) &&
            (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::PAN]) )
     aOp = PANVIEW;
-  else if( (theEvent->state()  == SUIT_ViewModel::myStateMap[SUIT_ViewModel::ROTATE]) &&
+  else if( (theEvent->modifiers()  == SUIT_ViewModel::myStateMap[SUIT_ViewModel::ROTATE]) &&
            (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::ROTATE]) )
     aOp = ROTATE;
 
@@ -246,9 +267,12 @@ OCCViewer_ViewWindow::OperationType OCCViewer_ViewWindow::getButtonState(QMouseE
 }
 
 /*!
-  Custom event handler
+  \brief Customize event handling
+  \param watched event receiver object
+  \param e event
+  \return \c true if the event processing should be stopped
 */
-bool OCCViewer_ViewWindow::eventFilter(QObject* watched, QEvent* e)
+bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e )
 {
   if ( watched == myViewPort ) {
     int aType = e->type();
@@ -273,7 +297,7 @@ bool OCCViewer_ViewWindow::eventFilter(QObject* watched, QEvent* e)
       {
         QWheelEvent* aEvent = (QWheelEvent*) e;
         double aDelta = aEvent->delta();
-        double aScale = (aDelta < 0) ? 100./(-aDelta) : aDelta/100.; 
+        double aScale = (aDelta < 0) ? 100./(-aDelta) : aDelta/100.;
         myViewPort->getView()->SetZoom(aScale);
       }
       return true;
@@ -294,7 +318,7 @@ bool OCCViewer_ViewWindow::eventFilter(QObject* watched, QEvent* e)
 }
 
 /*!
-  Updates state of enable draw mode state
+  \brief Update state of enable draw mode state.
 */
 void OCCViewer_ViewWindow::updateEnabledDrawMode()
 {
@@ -303,9 +327,10 @@ void OCCViewer_ViewWindow::updateEnabledDrawMode()
 }
 
 /*!
-  Handler of mouse press event
+  \brief Handle mouse press event
+  \param theEvent mouse event
 */
-void OCCViewer_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
+void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent )
 {
   myStartX = theEvent->x();
   myStartY = theEvent->y();
@@ -313,18 +338,18 @@ void OCCViewer_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
   case WINDOWFIT:
     if ( theEvent->button() == Qt::LeftButton )
       emit vpTransformationStarted ( WINDOWFIT );
-    break;    
-   
+    break;
+
   case PANGLOBAL:
     if ( theEvent->button() == Qt::LeftButton )
       emit vpTransformationStarted ( PANGLOBAL );
-    break;    
-    
+    break;
+
   case ZOOMVIEW:
     if ( theEvent->button() == Qt::LeftButton )
       emit vpTransformationStarted ( ZOOMVIEW );
     break;
-    
+
   case PANVIEW:
     if ( theEvent->button() == Qt::LeftButton )
       emit vpTransformationStarted ( PANVIEW );
@@ -336,7 +361,7 @@ void OCCViewer_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
            emit vpTransformationStarted ( ROTATE );
          }
     break;
-      
+
   default:
   /*  Try to activate a transformation */
     switch ( getButtonState(theEvent) ) {
@@ -362,14 +387,14 @@ void OCCViewer_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
            TopoDS_Shape aShape = ic->SelectedShape();
            if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
            {
-             gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) ); 
+             gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
              if ( mySetRotationPointDlg )
              {
                myRotationPointSelection = false;
                mySetRotationPointDlg->setCoords(aPnt.X(), aPnt.Y(), aPnt.Z());
              }
-           }    
-           else 
+           }
+           else
            {
              myCurrPointType = myPrevPointType;
              break;
@@ -378,8 +403,8 @@ void OCCViewer_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
          if ( ic->NbSelected() == 0 ) myCurrPointType = myPrevPointType;
          if ( mySetRotationPointDlg ) mySetRotationPointDlg->toggleChange();
          ic->CloseAllContexts();
-         myOperation = NOTHING; 
-         setCursor( myCursor );
+         myOperation = NOTHING;
+         myViewPort->setCursor( myCursor );
          myCursorIsHand = false;
          myRotationPointSelection = false;
        }
@@ -389,11 +414,11 @@ void OCCViewer_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
       break;
     }
     /* notify that we start a transformation */
-    if ( transformRequested() ) 
+    if ( transformRequested() )
            emit vpTransformationStarted ( myOperation );
   }
-  if ( transformRequested() ) 
-    setTransformInProcess( true );              
+  if ( transformRequested() )
+    setTransformInProcess( true );
 
   /* we may need it for sketching... */
   if ( l_mbPressEvent )
@@ -403,55 +428,65 @@ void OCCViewer_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
 
 
 /*!
-  Starts zoom operation, sets corresponding cursor
+  \brief Start zooming operation.
+
+  Sets the corresponding cursor for the widget.
 */
 void OCCViewer_ViewWindow::activateZoom()
 {
   if ( !transformRequested() && !myCursorIsHand )
     myCursor = cursor();               /* save old cursor */
-  
+
   if ( myOperation != ZOOMVIEW ) {
     QPixmap zoomPixmap (imageZoomCursor);
     QCursor zoomCursor (zoomPixmap);
-    setTransformRequested ( ZOOMVIEW );                
-    setCursor( zoomCursor );
+    setTransformRequested ( ZOOMVIEW );
+    myViewPort->setCursor( zoomCursor );
   }
 }
 
 
 /*!
-  Starts panning operation, sets corresponding cursor
+  \brief Start panning operation.
+
+  Sets the corresponding cursor for the widget.
 */
 void OCCViewer_ViewWindow::activatePanning()
 {
   if ( !transformRequested() && !myCursorIsHand )
-    myCursor = cursor();               // save old cursor 
-  
+    myCursor = cursor();               // save old cursor
+
   if ( myOperation != PANVIEW ) {
     QCursor panCursor (Qt::SizeAllCursor);
     setTransformRequested ( PANVIEW );
-    setCursor( panCursor );
+    myViewPort->setCursor( panCursor );
   }
 }
 
 /*!
-  Starts rotation operation, sets corresponding cursor
+  \brief Start rotation operation
+
+  Sets the corresponding cursor for the widget.
 */
 void OCCViewer_ViewWindow::activateRotation()
 {
   if ( !transformRequested() && !myCursorIsHand )
-    myCursor = cursor();               // save old cursor 
-  
+    myCursor = cursor();               // save old cursor
+
   if ( myOperation != ROTATE ) {
     QPixmap rotatePixmap (imageRotateCursor);
     QCursor rotCursor (rotatePixmap);
     setTransformRequested ( ROTATE );
-    setCursor( rotCursor );    
+    myViewPort->setCursor( rotCursor );
   }
 }
 
 /*!
-  Compute the gravity center
+  \brief Compute the gravity center.
+  \param theX used to return X coordinate of the gravity center
+  \param theY used to return Y coordinate of the gravity center
+  \param theZ used to return Z coordinate of the gravity center
+  \return \c true if the gravity center is computed
 */
 bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, double& theZ )
 {
@@ -461,10 +496,10 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou
   Standard_Real Umin,Vmin,Umax,Vmax ;
   Standard_Integer Nstruct,Npoint ;
   Graphic3d_MapOfStructure MySetOfStructures;
-  
+
   aView->DisplayedStructures (MySetOfStructures);
   Nstruct = MySetOfStructures.Extent() ;
-  
+
   Graphic3d_MapIteratorOfMapOfStructure MyIterator(MySetOfStructures) ;
   aView->ViewMapping().WindowLimit(Umin,Vmin,Umax,Vmax) ;
   Npoint = 0 ; theX = theY = theZ = 0. ;
@@ -472,11 +507,11 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou
     if (!(MyIterator.Key())->IsEmpty()) {
       (MyIterator.Key())->MinMaxValues(Xmin,Ymin,Zmin,
                                          Xmax,Ymax,Zmax) ;
-    
+
       Standard_Real LIM = ShortRealLast() -1.;
-      if (!    (fabs(Xmin) > LIM || fabs(Ymin) > LIM || fabs(Zmin) > LIM 
+      if (!    (fabs(Xmin) > LIM || fabs(Ymin) > LIM || fabs(Zmin) > LIM
                 ||  fabs(Xmax) > LIM || fabs(Ymax) > LIM || fabs(Zmax) > LIM )) {
-        
+
         aView->Projects(Xmin,Ymin,Zmin,U,V,W) ;
         if( U >= Umin && U <= Umax && V >= Vmin && V <= Vmax ) {
           Npoint++ ; theX += Xmin ; theY += Ymin ; theZ += Zmin ;
@@ -519,7 +554,7 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou
 }
 
 /*!
-  Set the gravity center as a rotation point
+  \brief Set the gravity center as a rotation point.
 */
 void OCCViewer_ViewWindow::activateSetRotationGravity()
 {
@@ -527,8 +562,8 @@ void OCCViewer_ViewWindow::activateSetRotationGravity()
   {
     Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
     ic->CloseAllContexts();
-    myOperation = NOTHING; 
-    setCursor( myCursor );
+    myOperation = NOTHING;
+    myViewPort->setCursor( myCursor );
     myCursorIsHand = false;
     myRotationPointSelection = false;
   }
@@ -542,11 +577,12 @@ void OCCViewer_ViewWindow::activateSetRotationGravity()
 }
 
 /*!
-  Update gravity center in the SetRotationPointDlg
+  \brief Update gravity center in the "Set Rotation Point" dialog box.
+  \sa OCCViewer_SetRotationPointDlg class
 */
 void OCCViewer_ViewWindow::updateGravityCoords()
 {
-  if ( mySetRotationPointDlg && mySetRotationPointDlg->isShown() && myCurrPointType == GRAVITY )
+  if ( mySetRotationPointDlg && mySetRotationPointDlg->isVisible() && myCurrPointType == GRAVITY )
   {
     Standard_Real Xcenter, Ycenter, Zcenter;
     if ( computeGravityCenter( Xcenter, Ycenter, Zcenter ) )
@@ -555,16 +591,19 @@ void OCCViewer_ViewWindow::updateGravityCoords()
 }
 
 /*!
-  Set the point selected by user as a rotation point
+  \brief Set the point selected by the user as a rotation point.
+  \param theX X coordinate of the rotation point
+  \param theY Y coordinate of the rotation point
+  \param theZ Z coordinate of the rotation point
 */
-void OCCViewer_ViewWindow::activateSetRotationSelected(double theX, double theY, double theZ)
+void OCCViewer_ViewWindow::activateSetRotationSelected( double theX, double theY, double theZ )
 {
   if ( myRotationPointSelection )
   {
     Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
     ic->CloseAllContexts();
-    myOperation = NOTHING; 
-    setCursor( myCursor );
+    myOperation = NOTHING;
+    myViewPort->setCursor( myCursor );
     myCursorIsHand = false;
     myRotationPointSelection = false;
   }
@@ -575,7 +614,7 @@ void OCCViewer_ViewWindow::activateSetRotationSelected(double theX, double theY,
 }
 
 /*!
-  Start the point selection process
+  \brief Start the point selection process.
 */
 void OCCViewer_ViewWindow::activateStartPointSelection()
 {
@@ -589,7 +628,7 @@ void OCCViewer_ViewWindow::activateStartPointSelection()
 
   AIS_ListOfInteractive aList;
   ic->DisplayedObjects( aList );
-  for ( AIS_ListIteratorOfListOfInteractive it( aList ); it.More(); it.Next() ) 
+  for ( AIS_ListIteratorOfListOfInteractive it( aList ); it.More(); it.Next() )
   {
     Handle(AIS_InteractiveObject) anObj = it.Value();
     if ( !anObj.IsNull() && anObj->HasPresentation() &&
@@ -598,21 +637,23 @@ void OCCViewer_ViewWindow::activateStartPointSelection()
       ic->Load(anObj,-1);
       ic->Activate(anObj,AIS_Shape::SelectionMode(TopAbs_VERTEX));
      }
-  }  
+  }
   // activate selection <------
 
   if ( !myCursorIsHand )
   {
     QCursor handCursor (Qt::PointingHandCursor);
-    myCursorIsHand = true;             
+    myCursorIsHand = true;
     myCursor = cursor();
-    setCursor( handCursor );
+    myViewPort->setCursor( handCursor );
   }
   myRotationPointSelection = true;
 }
 
 /*!
-  Starts global panning operation, sets corresponding cursor
+  \brief Start global panning operation
+
+  Sets the corresponding cursor for the widget.
 */
 void OCCViewer_ViewWindow::activateGlobalPanning()
 {
@@ -622,15 +663,17 @@ void OCCViewer_ViewWindow::activateGlobalPanning()
     QCursor glPanCursor (globalPanPixmap);
     myCurScale = aView3d->Scale();
     aView3d->FitAll(0.01, false);
-    myCursor = cursor();               // save old cursor 
-    myViewPort->fitAll(); // fits view before selecting a new scene center 
+    myCursor = cursor();               // save old cursor
+    myViewPort->fitAll(); // fits view before selecting a new scene center
     setTransformRequested( PANGLOBAL );
-    setCursor( glPanCursor );
+    myViewPort->setCursor( glPanCursor );
   }
 }
 
 /*!
-  Starts fit operation, sets corresponding cursor
+  \brief Starts fit operation.
+
+  Sets the corresponding cursor for the widget.
 */
 void OCCViewer_ViewWindow::activateWindowFit()
 {
@@ -639,26 +682,27 @@ void OCCViewer_ViewWindow::activateWindowFit()
 
   if ( myOperation != WINDOWFIT ) {
     QCursor handCursor (Qt::PointingHandCursor);
-    setTransformRequested ( WINDOWFIT );               
-    setCursor ( handCursor );
+    setTransformRequested ( WINDOWFIT );
+    myViewPort->setCursor ( handCursor );
     myCursorIsHand = true;
   }
 }
 
 /*!
-  Stores which viewer operation is requesting
+  \brief Start delayed viewer operation.
 */
-void OCCViewer_ViewWindow::setTransformRequested ( OperationType op )
-{    
+void OCCViewer_ViewWindow::setTransformRequested( OperationType op )
+{
   myOperation = op;
   myViewPort->setMouseTracking( myOperation == NOTHING );
 }
 
 
 /*!
-  Handler of mouse move event
+  \brief Handle mouse move event.
+  \param theEvent mouse event
 */
-void OCCViewer_ViewWindow::vpMouseMoveEvent(QMouseEvent* theEvent)
+void OCCViewer_ViewWindow::vpMouseMoveEvent( QMouseEvent* theEvent )
 {
   myCurrX = theEvent->x();
   myCurrY = theEvent->y();
@@ -666,53 +710,53 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent(QMouseEvent* theEvent)
   case ROTATE:
     myViewPort->rotate(myCurrX, myCurrY, myCurrPointType, mySelectedPoint);
     break;
-    
+
   case ZOOMVIEW:
     myViewPort->zoom(myStartX, myStartY, myCurrX, myCurrY);
     myStartX = myCurrX;
     myStartY = myCurrY;
     break;
-    
+
   case PANVIEW:
     myViewPort->pan(myCurrX - myStartX, myStartY - myCurrY);
     myStartX = myCurrX;
     myStartY = myCurrY;
     break;
-    
+
 /*    case WINDOWFIT:
     myDrawRect = true;
     repaint();
     break;
-*/      
+*/
   case PANGLOBAL:
     break;
-    
+
   default:
     if ( myRotationPointSelection )
-      emit mouseMoving( this, theEvent ); 
+      emit mouseMoving( this, theEvent );
     else
     {
-      int aState = theEvent->state();
-      if ( aState == Qt::LeftButton ||
-          aState == ( Qt::LeftButton | Qt::ShiftButton) ) {
+      int aState = theEvent->modifiers();
+      int aButton = theEvent->buttons();
+      if ( aButton == Qt::LeftButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) {
        myDrawRect = myEnableDrawMode;
        if ( myDrawRect ) {
          drawRect();
          if ( !myCursorIsHand )        {   // we are going to sketch a rectangle
            QCursor handCursor (Qt::PointingHandCursor);
-           myCursorIsHand = true;              
+           myCursorIsHand = true;
            myCursor = cursor();
-           setCursor( handCursor );
+           myViewPort->setCursor( handCursor );
          }
        }
-      } 
-      else if ( aState == Qt::RightButton || 
-               aState == ( Qt::RightButton | Qt::ShiftButton ) ) {
+      }
+      else if ( aButton == Qt::RightButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) {
        OCCViewer_ViewSketcher* sketcher = 0;
-       for ( OCCViewer_ViewSketcher* sk = mySketchers.first();
-             sk && !sketcher; sk = mySketchers.next() )
+       QList<OCCViewer_ViewSketcher*>::Iterator it;
+       for ( it = mySketchers.begin(); it != mySketchers.end() && !sketcher; ++it )
        {
-         if( sk->isDefault() && sk->sketchButton() & ( aState & Qt::MouseButtonMask ) )
+         OCCViewer_ViewSketcher* sk = (*it);
+         if( sk->isDefault() && sk->sketchButton() == aButton )
            sketcher = sk;
        }
        if ( sketcher && myCurSketch == -1 )
@@ -732,15 +776,15 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent(QMouseEvent* theEvent)
          }
        }
       }
-      else {
-       emit mouseMoving( this, theEvent ); 
-      }        
-    }  
+      else
+       emit mouseMoving( this, theEvent );
+    }
   }
 }
 
 /*!
-  Handler of mouse release event
+  \brief Handle mouse release event.
+  \param theEvent mouse event
 */
 void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
 {
@@ -748,23 +792,23 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
   case NOTHING:
     {
       int prevState = myCurSketch;
-      if(theEvent->state() == RightButton)
+      if(theEvent->button() == Qt::RightButton)
       {
-       for ( OCCViewer_ViewSketcher* sk = mySketchers.first();
-             sk && myCurSketch != -1; sk = mySketchers.next() )
+       QList<OCCViewer_ViewSketcher*>::Iterator it;
+       for ( it = mySketchers.begin(); it != mySketchers.end() && myCurSketch != -1; ++it )
        {
-         if( ( sk->sketchButton() & theEvent->state() ) && sk->sketchButton() == myCurSketch )
+         OCCViewer_ViewSketcher* sk = (*it);
+         if( ( sk->sketchButton() & theEvent->button() ) && sk->sketchButton() == myCurSketch )
            myCurSketch = -1;
        }
       }
 
       emit mouseReleased(this, theEvent);
-      if(theEvent->button() == RightButton && prevState == -1)
+      if(theEvent->button() == Qt::RightButton && prevState == -1)
       {
-       QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
-                                 theEvent->pos(), theEvent->globalPos(),
-                                 theEvent->state() );
-       emit contextMenuRequested( &aEvent );
+        QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
+                                  theEvent->pos(), theEvent->globalPos() );
+        emit contextMenuRequested( &aEvent );
       }
     }
     break;
@@ -772,38 +816,40 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
     myViewPort->endRotation();
     resetState();
     break;
-    
+
   case PANVIEW:
   case ZOOMVIEW:
     resetState();
     break;
-    
+
   case PANGLOBAL:
     if ( theEvent->button() == Qt::LeftButton ) {
-           myViewPort->setCenter( theEvent->x(), theEvent->y() );
+      myViewPort->setCenter( theEvent->x(), theEvent->y() );
       myViewPort->getView()->SetScale(myCurScale);
-           resetState();
-         }
+      resetState();
+    }
     break;
-      
+
   case WINDOWFIT:
-    if ( theEvent->state() == Qt::LeftButton ) {
-           myCurrX = theEvent->x();
-           myCurrY = theEvent->y();
-           QRect rect = SUIT_Tools::makeRect(myStartX, myStartY, myCurrX, myCurrY);
-           if ( !rect.isEmpty() ) myViewPort->fitRect(rect);
-           resetState();
-         }
+    if ( theEvent->button() == Qt::LeftButton ) {
+      myCurrX = theEvent->x();
+      myCurrY = theEvent->y();
+      drawRect();
+      QRect rect = SUIT_Tools::makeRect(myStartX, myStartY, myCurrX, myCurrY);
+      if ( !rect.isEmpty() ) myViewPort->fitRect(rect);
+      endDrawRect();
+      resetState();
+    }
     break;
   }
-  
+
   // NOTE: viewer 3D detects a rectangle of selection using this event
   // so we must emit it BEFORE resetting the selection rectangle
-  
+
   if ( theEvent->button() == Qt::LeftButton && myDrawRect ) {
-    myDrawRect = false;
     drawRect();
-    resetState(); 
+    endDrawRect();
+    resetState();
     myViewPort->update();
   }
 
@@ -815,244 +861,284 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
 }
 
 /*!
-  Sets the viewport to its initial state
+  \brief Reset the viewport to its initial state
   ( no transformations in process etc. )
 */
 void OCCViewer_ViewWindow::resetState()
 {
   myDrawRect = false;
-  
-  /* make rectangle empty (left > right) */
-  myRect.setLeft(2);
-  myRect.setRight(0);
-  
+
   if ( myRotationPointSelection )
   {
     QCursor handCursor (Qt::PointingHandCursor);
-    setCursor( handCursor );
+    myViewPort->setCursor( handCursor );
   }
   else
-  { 
-    if ( transformRequested() || myCursorIsHand ) 
-      setCursor( myCursor );
+  {
+    if ( transformRequested() || myCursorIsHand )
+      myViewPort->setCursor( myCursor );
     myCursorIsHand = false;
   }
-  
-  if ( transformRequested() ) 
+
+  if ( transformRequested() )
     emit vpTransformationFinished (myOperation);
-  
-  setTransformInProcess( false );              
-  setTransformRequested( NOTHING );    
+
+  setTransformInProcess( false );
+  setTransformRequested( NOTHING );
 }
 
 
 /*!
-  Draws rectangle by starting and current points
+  \brief Draw rubber band rectangle.
 */
 void OCCViewer_ViewWindow::drawRect()
 {
-  QPainter aPainter(myViewPort);
-  aPainter.setRasterOp(Qt::XorROP);
-  aPainter.setPen(Qt::white);
+  if ( !myRectBand ) {
+    myRectBand = new QtxRectRubberBand( myViewPort );
+    //QPalette palette;
+    //palette.setColor(myRectBand->foregroundRole(), Qt::white);
+    //myRectBand->setPalette(palette);
+  }
+  //myRectBand->hide();
+  
+  myRectBand->setUpdatesEnabled ( false );
   QRect aRect = SUIT_Tools::makeRect(myStartX, myStartY, myCurrX, myCurrY);
-  if ( !myRect.isEmpty() )
-         aPainter.drawRect( myRect );
-  aPainter.drawRect(aRect);
-  myRect = aRect;
+  myRectBand->initGeometry( aRect );
+
+  if ( !myRectBand->isVisible() )
+    myRectBand->show();
+
+  myRectBand->setUpdatesEnabled ( true );
+  //myRectBand->repaint();
+
+  //myRectBand->setVisible( aRect.isValid() );
+  //if ( myRectBand->isVisible() )
+  //  myRectBand->repaint();
+  //else
+  //  myRectBand->show();
+  //myRectBand->repaint();
 }
 
 /*!
-  Creates actions of OCC view window
+  \brief Clear rubber band rectangle on the end on the dragging operation.
+*/
+void OCCViewer_ViewWindow::endDrawRect()
+{
+  //delete myRectBand;
+  //myRectBand = 0;
+  if ( myRectBand )
+    {
+      myRectBand->clearGeometry();
+      myRectBand->hide();
+    }
+}
+
+/*!
+  \brief Create actions.
 */
 void OCCViewer_ViewWindow::createActions()
 {
-  if (!myActionsMap.isEmpty()) return;
+  if( !toolMgr()->isEmpty() )
+    return;
   
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-  
+
   QtxAction* aAction;
 
   // Dump view
   aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_DUMP" ) ),
                            tr( "MNU_DUMP_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_DUMP_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView()));
-       myActionsMap[ DumpId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onDumpView()));
+  toolMgr()->registerAction( aAction, DumpId );
 
   // FitAll
   aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_FITALL" ) ),
                            tr( "MNU_FITALL" ), 0, this);
   aAction->setStatusTip(tr("DSC_FITALL"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onFitAll()));
-       myActionsMap[ FitAllId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onFitAll()));
+  toolMgr()->registerAction( aAction, FitAllId );
 
   // FitRect
   aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_FITAREA" ) ),
                            tr( "MNU_FITRECT" ), 0, this);
   aAction->setStatusTip(tr("DSC_FITRECT"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(activateWindowFit()));
-       myActionsMap[ FitRectId ] = aAction;
-
+  connect(aAction, SIGNAL(triggered()), this, SLOT(activateWindowFit()));
+  toolMgr()->registerAction( aAction, FitRectId );
+  
   // Zoom
   aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_ZOOM" ) ),
                            tr( "MNU_ZOOM_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(activateZoom()));
-       myActionsMap[ ZoomId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(activateZoom()));
+  toolMgr()->registerAction( aAction, ZoomId );
 
   // Panning
   aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_PAN" ) ),
                            tr( "MNU_PAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_PAN_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(activatePanning()));
-       myActionsMap[ PanId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(activatePanning()));
+  toolMgr()->registerAction( aAction, PanId );
 
   // Global Panning
   aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_GLOBALPAN" ) ),
                            tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning()));
-  myActionsMap[ GlobalPanId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(activateGlobalPanning()));
+  toolMgr()->registerAction( aAction, GlobalPanId );
 
   // Rotation Point
   mySetRotationPointAction = new QtxAction(tr("MNU_CHANGINGROTATIONPOINT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_ROTATION_POINT" ) ),
                            tr( "MNU_CHANGINGROTATIONPOINT_VIEW" ), 0, this);
   mySetRotationPointAction->setStatusTip(tr("DSC_CHANGINGROTATIONPOINT_VIEW"));
-  mySetRotationPointAction->setToggleAction( true );
+  mySetRotationPointAction->setCheckable( true );
   connect(mySetRotationPointAction, SIGNAL(toggled( bool )), this, SLOT(onSetRotationPoint( bool )));
-  myActionsMap[ ChangeRotationPointId ] = mySetRotationPointAction;
+  toolMgr()->registerAction( mySetRotationPointAction, ChangeRotationPointId );
 
   // Rotation
   aAction = new QtxAction(tr("MNU_ROTATE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_ROTATE" ) ),
                            tr( "MNU_ROTATE_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(activateRotation()));
-       myActionsMap[ RotationId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(activateRotation()));
+  toolMgr()->registerAction( aAction, RotationId );
 
   // Projections
   aAction = new QtxAction(tr("MNU_FRONT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_FRONT" ) ),
                            tr( "MNU_FRONT_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_FRONT_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onFrontView()));
-       myActionsMap[ FrontId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onFrontView()));
+  toolMgr()->registerAction( aAction, FrontId );
 
   aAction = new QtxAction(tr("MNU_BACK_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_BACK" ) ),
                            tr( "MNU_BACK_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_BACK_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onBackView()));
-       myActionsMap[ BackId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onBackView()));
+  toolMgr()->registerAction( aAction, BackId );
 
   aAction = new QtxAction(tr("MNU_TOP_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_TOP" ) ),
                            tr( "MNU_TOP_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_TOP_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onTopView()));
-       myActionsMap[ TopId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onTopView()));
+  toolMgr()->registerAction( aAction, TopId );
 
   aAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_BOTTOM" ) ),
                            tr( "MNU_BOTTOM_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onBottomView()));
-       myActionsMap[ BottomId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onBottomView()));
+  toolMgr()->registerAction( aAction, BottomId );
 
   aAction = new QtxAction(tr("MNU_LEFT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_LEFT" ) ),
                            tr( "MNU_LEFT_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_LEFT_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onLeftView()));
-       myActionsMap[ LeftId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onLeftView()));
+  toolMgr()->registerAction( aAction, LeftId );
 
   aAction = new QtxAction(tr("MNU_RIGHT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_RIGHT" ) ),
                            tr( "MNU_RIGHT_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onRightView()));
-       myActionsMap[ RightId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onRightView()));
+  toolMgr()->registerAction( aAction, RightId );
 
   // Reset
   aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_RESET" ) ),
                            tr( "MNU_RESET_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_RESET_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onResetView()));
-       myActionsMap[ ResetId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onResetView()));
+  toolMgr()->registerAction( aAction, ResetId );
 
   // Reset
   aAction = new QtxAction(tr("MNU_CLONE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLONE_VIEW" ) ),
                            tr( "MNU_CLONE_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_CLONE_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onCloneView()));
-       myActionsMap[ CloneId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onCloneView()));
+  toolMgr()->registerAction( aAction, CloneId );
 
   myClippingAction = new QtxAction(tr("MNU_CLIPPING"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLIPPING" ) ),
                            tr( "MNU_CLIPPING" ), 0, this);
   myClippingAction->setStatusTip(tr("DSC_CLIPPING"));
-  myClippingAction->setToggleAction( true );
+  myClippingAction->setCheckable( true );
   connect(myClippingAction, SIGNAL(toggled( bool )), this, SLOT(onClipping( bool )));
-  myActionsMap[ ClippingId ] = myClippingAction;
+  toolMgr()->registerAction( myClippingAction, ClippingId );
 
   aAction = new QtxAction(tr("MNU_SHOOT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_SHOOT_VIEW" ) ),
                            tr( "MNU_SHOOT_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_SHOOT_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onMemorizeView()));
-       myActionsMap[ MemId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onMemorizeView()));
+  toolMgr()->registerAction( aAction, MemId );
 
   aAction = new QtxAction(tr("MNU_PRESETS_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_PRESETS_VIEW" ) ),
                            tr( "MNU_PRESETS_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_PRESETS_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onRestoreView()));
-       myActionsMap[ RestoreId ] = aAction;
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onRestoreView()));
+  toolMgr()->registerAction( aAction, RestoreId );
 
   if (myModel->trihedronActivated()) {
     aAction = new QtxAction(tr("MNU_SHOW_TRIHEDRE"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_TRIHEDRON" ) ),
                              tr( "MNU_SHOW_TRIHEDRE" ), 0, this);
     aAction->setStatusTip(tr("DSC_SHOW_TRIHEDRE"));
-    connect(aAction, SIGNAL(activated()), this, SLOT(onTrihedronShow()));
-         myActionsMap[ TrihedronShowId ] = aAction;
+    connect(aAction, SIGNAL(triggered()), this, SLOT(onTrihedronShow()));
+    toolMgr()->registerAction( aAction, TrihedronShowId );
   }
+
+  // Scale
+  aAction = new QtxAction(tr("MNU_SCALING"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_SCALING" ) ),
+                           tr( "MNU_SCALING" ), 0, this);
+  aAction->setStatusTip(tr("DSC_SCALING"));
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onAxialScale()));
+  toolMgr()->registerAction( aAction, AxialScaleId );
 }
 
 /*!
-  Creates toolbar of OCC view window
+  \brief Create toolbar.
 */
 void OCCViewer_ViewWindow::createToolBar()
 {
-  myActionsMap[DumpId]->addTo(myToolBar);  
-  if ( myModel->trihedronActivated() ) 
-    myActionsMap[TrihedronShowId]->addTo(myToolBar);
-
-  SUIT_ToolButton* aScaleBtn = new SUIT_ToolButton(myToolBar, "scale");
-  aScaleBtn->AddAction(myActionsMap[FitAllId]);
-  aScaleBtn->AddAction(myActionsMap[FitRectId]);
-  aScaleBtn->AddAction(myActionsMap[ZoomId]);
-
-  SUIT_ToolButton* aPanningBtn = new SUIT_ToolButton(myToolBar, "pan");
-  aPanningBtn->AddAction(myActionsMap[PanId]);
-  aPanningBtn->AddAction(myActionsMap[GlobalPanId]);
-
-  myActionsMap[ChangeRotationPointId]->addTo(myToolBar);
-
-  myActionsMap[RotationId]->addTo(myToolBar);
-
-  SUIT_ToolButton* aViewsBtn = new SUIT_ToolButton(myToolBar, "projection");
-  aViewsBtn->AddAction(myActionsMap[FrontId]);
-  aViewsBtn->AddAction(myActionsMap[BackId]);
-  aViewsBtn->AddAction(myActionsMap[TopId]);
-  aViewsBtn->AddAction(myActionsMap[BottomId]);
-  aViewsBtn->AddAction(myActionsMap[LeftId]);
-  aViewsBtn->AddAction(myActionsMap[RightId]);
-
-  myActionsMap[ResetId]->addTo(myToolBar);
-
-  SUIT_ToolButton* aMemBtn = new SUIT_ToolButton(myToolBar, "view");
-  aMemBtn->AddAction(myActionsMap[MemId]);
-  aMemBtn->AddAction(myActionsMap[RestoreId]);
-
-  myToolBar->addSeparator();
-  myActionsMap[CloneId]->addTo(myToolBar);
+  int tid = toolMgr()->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+
+  toolMgr()->append( DumpId, tid );
+  if( myModel->trihedronActivated() ) 
+    toolMgr()->append( TrihedronShowId, tid );
+
+  QtxMultiAction* aScaleAction = new QtxMultiAction( this );
+  aScaleAction->insertAction( toolMgr()->action( FitAllId ) );
+  aScaleAction->insertAction( toolMgr()->action( FitRectId ) );
+  aScaleAction->insertAction( toolMgr()->action( ZoomId ) );
+  toolMgr()->append( aScaleAction, tid );
+
+  QtxMultiAction* aPanningAction = new QtxMultiAction( this );
+  aPanningAction->insertAction( toolMgr()->action( PanId ) );
+  aPanningAction->insertAction( toolMgr()->action( GlobalPanId ) );
+  toolMgr()->append( aPanningAction, tid );
+
+  toolMgr()->append( ChangeRotationPointId, tid );
+  toolMgr()->append( RotationId, tid );
+
+  QtxMultiAction* aViewsAction = new QtxMultiAction( this );
+  aViewsAction->insertAction( toolMgr()->action( FrontId ) );
+  aViewsAction->insertAction( toolMgr()->action( BackId ) );
+  aViewsAction->insertAction( toolMgr()->action( TopId ) );
+  aViewsAction->insertAction( toolMgr()->action( BottomId ) );
+  aViewsAction->insertAction( toolMgr()->action( LeftId ) );
+  aViewsAction->insertAction( toolMgr()->action( RightId ) );
+  toolMgr()->append( aViewsAction, tid );
+
+  toolMgr()->append( ResetId, tid );
+
+  QtxMultiAction* aMemAction = new QtxMultiAction( this );
+  aMemAction->insertAction( toolMgr()->action( MemId ) );
+  aMemAction->insertAction( toolMgr()->action( RestoreId ) );
+  toolMgr()->append( aMemAction, tid );
+
+  toolMgr()->append( toolMgr()->separator(), tid );
+  toolMgr()->append( CloneId, tid );
   
-  myToolBar->addSeparator();
-  myActionsMap[ClippingId]->addTo(myToolBar);
+  toolMgr()->append( toolMgr()->separator(), tid );
+  toolMgr()->append( ClippingId, tid );
+  toolMgr()->append( AxialScaleId, tid );
 }
 
 /*!
-  Processes operation fit all
+  \brief Perform 'fit all' operation.
 */
 void OCCViewer_ViewWindow::onViewFitAll()
 {
@@ -1060,7 +1146,7 @@ void OCCViewer_ViewWindow::onViewFitAll()
 }
 
 /*!
-  Processes transformation "front view"
+  \brief Perform "front view" transformation.
 */
 void OCCViewer_ViewWindow::onFrontView()
 {
@@ -1071,7 +1157,7 @@ void OCCViewer_ViewWindow::onFrontView()
 }
 
 /*!
-  Processes transformation "back view"
+  \brief Perform "back view" transformation.
 */
 void OCCViewer_ViewWindow::onBackView()
 {
@@ -1082,7 +1168,7 @@ void OCCViewer_ViewWindow::onBackView()
 }
 
 /*!
-  Processes transformation "top view"
+  \brief Perform "top view" transformation.
 */
 void OCCViewer_ViewWindow::onTopView()
 {
@@ -1093,7 +1179,7 @@ void OCCViewer_ViewWindow::onTopView()
 }
 
 /*!
-  Processes transformation "bottom view"
+  \brief Perform "bottom view" transformation.
 */
 void OCCViewer_ViewWindow::onBottomView()
 {
@@ -1104,7 +1190,7 @@ void OCCViewer_ViewWindow::onBottomView()
 }
 
 /*!
-  Processes transformation "left view"
+  \brief Perform "left view" transformation.
 */
 void OCCViewer_ViewWindow::onLeftView()
 {
@@ -1115,7 +1201,7 @@ void OCCViewer_ViewWindow::onLeftView()
 }
 
 /*!
-  Processes transformation "right view"
+  \brief Perform "right view" transformation.
 */
 void OCCViewer_ViewWindow::onRightView()
 {
@@ -1126,7 +1212,9 @@ void OCCViewer_ViewWindow::onRightView()
 }
 
 /*!
-  Processes transformation "reset view": sets default orientation of viewport camera
+  \brief Perform "reset view" transformation.
+
+  Sets default orientation of the viewport camera.
 */
 void OCCViewer_ViewWindow::onResetView()
 {
@@ -1139,7 +1227,7 @@ void OCCViewer_ViewWindow::onResetView()
 }
 
 /*!
-  Processes transformation "fit all"
+  \brief Perform "fit all" transformation.
 */
 void OCCViewer_ViewWindow::onFitAll()
 {
@@ -1148,7 +1236,8 @@ void OCCViewer_ViewWindow::onFitAll()
 }
 
 /*!
-  SLOT: called if change rotation point operation is activated
+  \brief Called if 'change rotation point' operation is activated.
+  \param on action state
 */
 void OCCViewer_ViewWindow::onSetRotationPoint( bool on )
 {
@@ -1160,10 +1249,10 @@ void OCCViewer_ViewWindow::onSetRotationPoint( bool on )
          mySetRotationPointDlg->SetAction( mySetRotationPointAction );
        }
 
-      if ( !mySetRotationPointDlg->isShown() )
+      if ( !mySetRotationPointDlg->isVisible() )
       {
        if ( mySetRotationPointDlg->IsFirstShown() )
-       { 
+       {
          Standard_Real Xcenter, Ycenter, Zcenter;
          if ( computeGravityCenter( Xcenter, Ycenter, Zcenter ) )
            mySetRotationPointDlg->setCoords( Xcenter, Ycenter, Zcenter );
@@ -1173,52 +1262,70 @@ void OCCViewer_ViewWindow::onSetRotationPoint( bool on )
     }
   else
     {
-      if ( mySetRotationPointDlg->isShown() )
+      if ( mySetRotationPointDlg->isVisible() )
        mySetRotationPointDlg->hide();
     }
 }
 
 /*!
-  Creates one more window with same content
+   \brief Create one more window with same content.
 */
 void OCCViewer_ViewWindow::onCloneView()
 {
   SUIT_ViewWindow* vw = myManager->createViewWindow();
-  vw->show();
+  //vw->show();
+  emit viewCloned( vw );
 }
 
 /*!
-  SLOT: called if clipping operation is activated, enables/disables of clipping plane
+  \brief called if clipping operation is activated.
+
+  Enables/disables clipping plane displaying.
+
+  \parma on action state
 */
 void OCCViewer_ViewWindow::onClipping( bool on )
 {
+  /*
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
   if ( on )
-    myActionsMap[ ClippingId ]->setIconSet(aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLIPPING_PRESSED" )));
+    myActionsMap[ ClippingId ]->setIcon(aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLIPPING_PRESSED" )));
   else
-    myActionsMap[ ClippingId ]->setIconSet(aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLIPPING" )));
-  
+    myActionsMap[ ClippingId ]->setIcon(aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLIPPING" )));
+  */
   if ( on )
+  {
+    if ( !myClippingDlg )
     {
-      if ( !myClippingDlg )
-       {
-         myClippingDlg = new OCCViewer_ClippingDlg( this, myDesktop );
-         myClippingDlg->SetAction( myClippingAction );
-       }
-
-      if ( !myClippingDlg->isShown() )
-       myClippingDlg->show();
+      myClippingDlg = new OCCViewer_ClippingDlg( this, myDesktop );
+      myClippingDlg->SetAction( myClippingAction );
     }
+    
+    if ( !myClippingDlg->isVisible() )
+      myClippingDlg->show();
+  }
   else
-    {
-      if ( myClippingDlg->isShown() )
-       myClippingDlg->hide();
-      setCuttingPlane(false);
-    }
+  {
+    if ( myClippingDlg->isVisible() )
+      myClippingDlg->hide();
+    setCuttingPlane(false);
+  }
+}
+
+/*!
+  Creates one more window with same content
+*/
+void OCCViewer_ViewWindow::onAxialScale()
+{
+  if ( !myScalingDlg )
+    myScalingDlg = new OCCViewer_AxialScaleDlg( this, myDesktop );
+  
+  if ( !myScalingDlg->isVisible() )
+    myScalingDlg->show();
 }
 
 /*!
-  Stores view parameters
+  \brief Store view parameters.
 */
 void OCCViewer_ViewWindow::onMemorizeView()
 {
@@ -1226,47 +1333,51 @@ void OCCViewer_ViewWindow::onMemorizeView()
 }
 
 /*!
-  Restores view parameters
+  \brief Restore view parameters.
 */
 void OCCViewer_ViewWindow::onRestoreView()
 {
-       OCCViewer_CreateRestoreViewDlg* aDlg = new OCCViewer_CreateRestoreViewDlg( centralWidget(), myModel );
-       connect( aDlg, SIGNAL( dlgOk() ), this, SLOT( setRestoreFlag() ) );
-       aDlg->exec();
-       myModel->updateViewAspects( aDlg->parameters() );
-       if( myRestoreFlag && aDlg->parameters().count() )
-               performRestoring( aDlg->currentItem() );
+  OCCViewer_CreateRestoreViewDlg* aDlg = new OCCViewer_CreateRestoreViewDlg( centralWidget(), myModel );
+  connect( aDlg, SIGNAL( dlgOk() ), this, SLOT( setRestoreFlag() ) );
+  aDlg->exec();
+  myModel->updateViewAspects( aDlg->parameters() );
+  if( myRestoreFlag && aDlg->parameters().count() )
+    performRestoring( aDlg->currentItem() );
 }
 
 /*!
-  Restores view parameters from structure viewAspect
+  \brief Restore view parameters.
+  \param anItem view parameters
 */
 void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem )
 {
-       Handle(V3d_View) aView3d = myViewPort->getView();
-
-       Standard_Boolean prev = aView3d->SetImmediateUpdate( Standard_False );
-       aView3d->SetScale( anItem.scale );
-       aView3d->SetCenter( anItem.centerX, anItem.centerY );
-       aView3d->SetTwist( anItem.twist );
-       aView3d->SetAt( anItem.atX, anItem.atY, anItem.atZ );
-       aView3d->SetImmediateUpdate( prev );
-       aView3d->SetEye( anItem.eyeX, anItem.eyeY, anItem.eyeZ );
-       aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ );
-               
-       myRestoreFlag = 0;
+  Handle(V3d_View) aView3d = myViewPort->getView();
+
+  Standard_Boolean prev = aView3d->SetImmediateUpdate( Standard_False );
+  aView3d->SetScale( anItem.scale );
+  aView3d->SetCenter( anItem.centerX, anItem.centerY );
+  aView3d->SetTwist( anItem.twist );
+  aView3d->SetAt( anItem.atX, anItem.atY, anItem.atZ );
+  aView3d->SetImmediateUpdate( prev );
+  aView3d->SetEye( anItem.eyeX, anItem.eyeY, anItem.eyeZ );
+  aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ );
+  aView3d->SetAxialScale( anItem.scaleX, anItem.scaleY, anItem.scaleZ );
+  myModel->setTrihedronShown( anItem.isVisible );
+  myModel->setTrihedronSize( anItem.size );
+       
+  myRestoreFlag = 0;
 }
 
 /*!
-  Sets restore flag
+  \brief Set restore flag.
 */
 void OCCViewer_ViewWindow::setRestoreFlag()
 {
-       myRestoreFlag = 1;
+  myRestoreFlag = 1;
 }
 
 /*!
-  SLOT: called when action "show/hide" trihedron is activated
+  \brief Called when action "show/hide trihedron" is activated.
 */
 void OCCViewer_ViewWindow::onTrihedronShow()
 {
@@ -1274,26 +1385,51 @@ void OCCViewer_ViewWindow::onTrihedronShow()
 }
 
 /*!
-  \return QImage, containing all scene rendering in window
+  \brief Dump view window contents to the pixmap.
+  \return pixmap containing all scene rendered in the window
 */
 QImage OCCViewer_ViewWindow::dumpView()
 {
   QPixmap px = QPixmap::grabWindow( myViewPort->winId() );
-  return px.convertToImage();
+  return px.toImage();
 }
 
+bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img, 
+                                            const QString& fileName, 
+                                            const QString& format )
+{
+  if ( format != "PS" && format != "EPS")
+    return SUIT_ViewWindow::dumpViewToFormat( img, fileName, format );
+
+  Handle(Visual3d_View) a3dView = myViewPort->getView()->View();
+
+  if (format == "PS")
+    a3dView->Export(qPrintable(fileName), Graphic3d_EF_PostScript);
+  else if (format == "EPS")
+    a3dView->Export(qPrintable(fileName), Graphic3d_EF_EnhPostScript);
+
+  return true;
+}
+
+
+QString OCCViewer_ViewWindow::filter() const
+{
+  return tr( "OCC_IMAGE_FILES" );
+}
+
+
 /*!
-  Sets parameters of cutting plane
-  \param on - is cutting plane enabled
-  \param x - x-position of plane point 
-  \param y - y-position of plane point 
-  \param z - z-position of plane point 
-  \param dx - x-coordinate of plane normal
-  \param dy - y-coordinate of plane normal
-  \param dz - z-coordinate of plane normal
+  \brief Set parameters of the cutting plane
+  \param on if \c true, cutting plane is enabled
+  \param x X position of plane point
+  \param y Y position of plane point
+  \param z Z position of plane point
+  \param dx coordinate of plane normal
+  \param dy coordinate of plane normal
+  \param dz coordinate of plane normal
 */
-void  OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x,  const double y,  const double z,
-                                                     const double dx, const double dy, const double dz )
+void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x,  const double y,  const double z,
+                                           const double dx, const double dy, const double dz )
 {
   Handle(V3d_View) view = myViewPort->getView();
   if ( view.IsNull() )
@@ -1301,7 +1437,7 @@ void  OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x,  const dou
 
   if ( on ) {
     Handle(V3d_Viewer) viewer = myViewPort->getViewer();
-    
+
     // try to use already existing plane or create a new one
     Handle(V3d_Plane) clipPlane;
     view->InitActivePlanes();
@@ -1309,24 +1445,25 @@ void  OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x,  const dou
       clipPlane = view->ActivePlane();
     else
       clipPlane = new V3d_Plane( viewer );
-    
+
     // set new a,b,c,d values for the plane
     gp_Pln pln( gp_Pnt( x, y, z ), gp_Dir( dx, dy, dz ) );
     double a, b, c, d;
     pln.Coefficients( a, b, c, d );
     clipPlane->SetPlane( a, b, c, d );
-    
+
     view->SetPlaneOn( clipPlane );
-  } 
+  }
   else
     view->SetPlaneOff();
-  
+
   view->Update();
   view->Redraw();
 }
 
 /*!
-  \return true if there is at least one cutting plane
+  \brief Check if any cutting plane is enabled
+  \return \c true if at least one cutting plane is enabled
 */
 bool OCCViewer_ViewWindow::isCuttingPlane()
 {
@@ -1336,12 +1473,14 @@ bool OCCViewer_ViewWindow::isCuttingPlane()
 }
 
 /*!
-  The method returns the visual parameters of this view as a viewAspect object
+  \brief Get the visual parameters of the view window.
+  \return visual parameters of view window
 */
 viewAspect OCCViewer_ViewWindow::getViewParams() const
 {
   double centerX, centerY, projX, projY, projZ, twist;
   double atX, atY, atZ, eyeX, eyeY, eyeZ;
+  double aScaleX, aScaleY, aScaleZ;
 
   Handle(V3d_View) aView3d = myViewPort->getView();
 
@@ -1351,6 +1490,11 @@ viewAspect OCCViewer_ViewWindow::getViewParams() const
   aView3d->Eye( eyeX, eyeY, eyeZ );
   twist = aView3d->Twist();
 
+  aView3d->AxialScale(aScaleX,aScaleY,aScaleZ);
+
+  bool isShown = myModel->isTrihedronVisible();
+  double size = myModel->trihedronSize();
+
   QString aName = QTime::currentTime().toString() + QString::fromLatin1( " h:m:s" );
 
   viewAspect params;
@@ -1367,32 +1511,41 @@ viewAspect OCCViewer_ViewWindow::getViewParams() const
   params.eyeX     = eyeX;
   params.eyeY     = eyeY;
   params.eyeZ     = eyeZ;
+  params.scaleX   = aScaleX;
+  params.scaleY   = aScaleY;
+  params.scaleZ   = aScaleZ;
   params.name    = aName;
+  params.isVisible= isShown;
+  params.size     = size;
 
   return params;
 }
 
 
 /*!
-  The method returns the visual parameters of this view as a formated string
+  \brief Get visual parameters of this view window.
+  \return visual parameters of view window
 */
 QString OCCViewer_ViewWindow::getVisualParameters()
 {
   viewAspect params = getViewParams();
   QString retStr;
-  retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", params.scale,
+  retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", params.scale,
                  params.centerX, params.centerY, params.projX, params.projY, params.projZ, params.twist,
-                 params.atX, params.atY, params.atZ, params.eyeX, params.eyeY, params.eyeZ );
+                 params.atX, params.atY, params.atZ, params.eyeX, params.eyeY, params.eyeZ,
+                 params.scaleX, params.scaleY, params.scaleZ );
+  retStr += QString().sprintf("*%u*%.2f", params.isVisible, params.size );
   return retStr;
 }
 
 /*!
-  The method restors visual parameters of this view from a formated string
+  \brief Restore visual parameters of the view window.
+  \param parameters visual parameters of view window
 */
 void OCCViewer_ViewWindow::setVisualParameters( const QString& parameters )
 {
-  QStringList paramsLst = QStringList::split( '*', parameters, true );
-  if ( paramsLst.size() == 13 ) {
+  QStringList paramsLst = parameters.split( '*' );
+  if ( paramsLst.size() >= 15 ) {
     viewAspect params;
     params.scale    = paramsLst[0].toDouble();
     params.centerX  = paramsLst[1].toDouble();
@@ -1407,23 +1560,42 @@ void OCCViewer_ViewWindow::setVisualParameters( const QString& parameters )
     params.eyeX     = paramsLst[10].toDouble();
     params.eyeY     = paramsLst[11].toDouble();
     params.eyeZ     = paramsLst[12].toDouble();
-
+    if ( paramsLst.size() == 18 ) {
+      params.scaleX    = paramsLst[13].toDouble();
+      params.scaleY    = paramsLst[14].toDouble();
+      params.scaleZ    = paramsLst[15].toDouble();
+      params.isVisible = paramsLst[16].toDouble();
+      params.size      = paramsLst[17].toDouble();
+    } 
+    else {
+      params.scaleX    = 1.;
+      params.scaleY    = 1.;
+      params.scaleZ    = 1.;
+    }
     performRestoring( params );
   }
 }
 
 /*!
-  Custom show event handler
+  \brief Handle show event.
+
+  Emits Show() signal.
+
+  \param theEvent show event
 */
-void OCCViewer_ViewWindow::showEvent( QShowEvent * theEvent ) 
+void OCCViewer_ViewWindow::showEvent( QShowEvent* theEvent )
 {
   emit Show( theEvent );
 }
 
 /*!
-  Custom hide event handler
+  \brief Handle hide event.
+
+  Emits Hide() signal.
+
+  \param theEvent hide event
 */
-void OCCViewer_ViewWindow::hideEvent( QHideEvent * theEvent ) 
+void OCCViewer_ViewWindow::hideEvent( QHideEvent* theEvent )
 {
   emit Hide( theEvent );
 }
@@ -1453,9 +1625,10 @@ void OCCViewer_ViewWindow::initSketchers()
 OCCViewer_ViewSketcher* OCCViewer_ViewWindow::getSketcher( const int typ )
 {
   OCCViewer_ViewSketcher* sketcher = 0;
-  for ( OCCViewer_ViewSketcher* sk = mySketchers.first();
-        sk && !sketcher; sk = mySketchers.next() )
+  QList<OCCViewer_ViewSketcher*>::Iterator it;
+  for ( it = mySketchers.begin(); it != mySketchers.end() && !sketcher; ++it )
   {
+    OCCViewer_ViewSketcher* sk = (*it);
     if ( sk->type() == typ )
       sketcher = sk;
   }
@@ -1512,7 +1685,7 @@ void OCCViewer_ViewWindow::onSketchingFinished()
   if ( mypSketcher && mypSketcher->result() == OCCViewer_ViewSketcher::Accept )
   {
     Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
-    bool append = bool( mypSketcher->buttonState() & Qt::ShiftButton );
+    bool append = bool( mypSketcher->buttonState() & Qt::ShiftModifier );
     switch( mypSketcher->type() )
     {
     case Rect:
@@ -1534,14 +1707,14 @@ void OCCViewer_ViewWindow::onSketchingFinished()
       break;
     case Polygon:
       {
-        QPointArray* aPolygon = (QPointArray*)mypSketcher->data();
+        QPolygon* aPolygon = (QPolygon*)mypSketcher->data();
         if( aPolygon )
         {
          int size = aPolygon->size();
          TColgp_Array1OfPnt2d anArray( 1, size );
 
-         QPointArray::Iterator it = aPolygon->begin();
-         QPointArray::Iterator itEnd = aPolygon->end();
+         QPolygon::Iterator it = aPolygon->begin();
+         QPolygon::Iterator itEnd = aPolygon->end();
          for( int index = 1; it != itEnd; ++it, index++ )
          {
            QPoint aPoint = *it;
@@ -1563,3 +1736,23 @@ void OCCViewer_ViewWindow::onSketchingFinished()
     aViewMgr->getOCCViewer()->performSelectionChanged();
   }
 }
+
+OCCViewer_ViewPort3d* OCCViewer_ViewWindow::getViewPort()
+{
+  return myViewPort;
+}
+
+bool OCCViewer_ViewWindow::transformRequested() const
+{
+  return ( myOperation != NOTHING );
+}
+
+bool OCCViewer_ViewWindow::transformInProcess() const
+{
+  return myEventStarted;
+}
+
+void OCCViewer_ViewWindow::setTransformInProcess( bool bOn )
+{
+  myEventStarted = bOn;
+}
index c3e7ca9f48390079725cea2cee9e05ac215daa6c..180e66c1975e09fb4274cb9846579ba7093bf07e 100755 (executable)
@@ -1,39 +1,41 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OCCVIEWER_VIEWWINDOW_H
 #define OCCVIEWER_VIEWWINDOW_H
 
-#include "OCCViewer_ViewModel.h"
-#include "OCCViewer_ViewSketcher.h"
-
+#include "OCCViewer.h"
 #include "SUIT_ViewWindow.h"
+#include <gp_Pnt.hxx>
 
-#include "QtxAction.h"
-
-#include <qcursor.h>
-#include <qvaluelist.h>
-
+class QtxRectRubberBand;
 class SUIT_Desktop;
 class OCCViewer_ViewPort3d;
-
+class OCCViewer_ViewSketcher;
 class OCCViewer_ClippingDlg;
+class OCCViewer_AxialScaleDlg;
 class OCCViewer_SetRotationPointDlg;
+class OCCViewer_Viewer;
+class viewAspect;
+class QtxAction;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -44,6 +46,11 @@ class OCCVIEWER_EXPORT OCCViewer_ViewWindow : public SUIT_ViewWindow
   Q_OBJECT
 
 public:
+  enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId,
+        ChangeRotationPointId, RotationId,
+         FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, ClippingId, MemId, RestoreId,
+         TrihedronShowId, AxialScaleId };
+
   enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE, 
                      PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW,
                       FRONTVIEW, BACKVIEW, TOPVIEW, BOTTOMVIEW, LEFTVIEW, RIGHTVIEW };
@@ -53,14 +60,12 @@ public:
   enum SketchingType { NoSketching, Rect, Polygon };
 
   OCCViewer_ViewWindow(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel);
-       virtual ~OCCViewer_ViewWindow() {};
+  virtual ~OCCViewer_ViewWindow();
 
-  OCCViewer_ViewPort3d* getViewPort() { return myViewPort; }
+  OCCViewer_ViewPort3d* getViewPort();
 
   bool eventFilter(QObject* watched, QEvent* e);
 
-  QToolBar* getToolBar() { return myToolBar; }
-
   void performRestoring( const viewAspect& );
   
   virtual void initLayout();
@@ -98,6 +103,7 @@ public slots:
   void onSetRotationPoint( bool on );
   void onCloneView();
   void onClipping( bool on );
+  void onAxialScale();
   void onMemorizeView();
   void onRestoreView();
   void onTrihedronShow();
@@ -111,31 +117,27 @@ public slots:
   virtual void showEvent( QShowEvent * );
   virtual void hideEvent( QHideEvent * );
 
+
 signals:
   void vpTransformationStarted(OCCViewer_ViewWindow::OperationType type);
   void vpTransformationFinished(OCCViewer_ViewWindow::OperationType type);
-  void cloneView();
+  void viewCloned( SUIT_ViewWindow* );
 
   void Show( QShowEvent * );
   void Hide( QHideEvent * );
 
 protected:
-  enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId,
-        ChangeRotationPointId, RotationId,
-         FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, ClippingId, MemId, RestoreId,
-         TrihedronShowId };
-
-  typedef QMap<int, QtxAction*> ActionsMap;
-
-  QImage dumpView();
+  virtual QImage dumpView();
+  virtual bool   dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
+  virtual QString  filter() const;
 
   /* Transformation selected but not started yet */
-  bool transformRequested() const { return ( myOperation != NOTHING ); }
-  void setTransformRequested ( OperationType op );
+  bool transformRequested() const;
+  void setTransformRequested ( OperationType );
 
   /* Transformation is selected and already started */
-  bool         transformInProcess() const { return myEventStarted; }
-  void         setTransformInProcess( bool bOn ) { myEventStarted = bOn; }
+  bool         transformInProcess() const;
+  void         setTransformInProcess( bool );
 
   void vpMousePressEvent(QMouseEvent* theEvent);
   void vpMouseReleaseEvent(QMouseEvent* theEvent);
@@ -143,6 +145,7 @@ protected:
 
   void resetState();
   void drawRect();
+  void endDrawRect();
 
   void createActions();
   void createToolBar();
@@ -159,7 +162,7 @@ protected:
   virtual OCCViewer_ViewSketcher*       createSketcher( int );
 
   OCCViewer_ViewSketcher*               mypSketcher;
-  QList<OCCViewer_ViewSketcher        mySketchers;
+  QList<OCCViewer_ViewSketcher*>        mySketchers;
 
   int                                   myCurSketch;
 
@@ -185,21 +188,20 @@ protected:
   bool                 myEnableDrawMode;
   bool                 myPaintersRedrawing;  // set to draw with external painters 
  
-  QRect                        myRect;                         
   QCursor              myCursor;
 
-  QToolBar*  myToolBar;
-  ActionsMap myActionsMap;
-
   double myCurScale;
 
 private:
   OCCViewer_ClippingDlg* myClippingDlg;
   QtxAction* myClippingAction;
 
+  OCCViewer_AxialScaleDlg* myScalingDlg;
+
   OCCViewer_SetRotationPointDlg* mySetRotationPointDlg;
   QtxAction* mySetRotationPointAction;
-  
+
+  QtxRectRubberBand* myRectBand; //!< selection rectangle rubber band
 };
 
 #ifdef WIN32
index 4ab78a38d3f3a9953f24e99107717e6470c4a535..46123fe5c06b8f1a65b9420b92a4182ba311d8d2 100755 (executable)
@@ -1,29 +1,28 @@
-#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 #  File   : SALOMEGUI_icons.po
 #  Module : SALOME
-
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
diff --git a/src/OCCViewer/resources/OCCViewer_images.ts b/src/OCCViewer/resources/OCCViewer_images.ts
new file mode 100644 (file)
index 0000000..11d0f34
--- /dev/null
@@ -0,0 +1,116 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_GLOBALPAN</source>
+        <translation>occ_view_glpan.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_CLIPPING_PRESSED</source>
+        <translation>occ_view_clipping_pressed.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_FITAREA</source>
+        <translation>occ_view_fitarea.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_CLONE_VIEW</source>
+        <translation>occ_view_clone.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_PRESETS_VIEW</source>
+        <translation>occ_view_presets.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_TOP</source>
+        <translation>occ_view_top.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_PAN</source>
+        <translation>occ_view_pan.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_SHOOT_VIEW</source>
+        <translation>occ_view_shoot.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_ROTATION_POINT</source>
+        <translation>occ_view_rotation_point.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_DUMP</source>
+        <translation>occ_view_camera_dump.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_BACK</source>
+        <translation>occ_view_back.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_ZOOM</source>
+        <translation>occ_view_zoom.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_LEFT</source>
+        <translation>occ_view_left.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_FITALL</source>
+        <translation>occ_view_fitall.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_BOTTOM</source>
+        <translation>occ_view_bottom.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_ROTATE</source>
+        <translation>occ_view_rotate.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_FRONT</source>
+        <translation>occ_view_front.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_RESET</source>
+        <translation>occ_view_reset.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_RIGHT</source>
+        <translation>occ_view_right.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_CLIPPING</source>
+        <translation>occ_view_clipping.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_TRIHEDRON</source>
+        <translation>occ_view_triedre.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_SCALING</source>
+        <translation>occ_view_scaling.png</translation>
+    </message>
+</context>
+</TS>
index 71689709e2598921bad867f688f6aee6749b8c4e..f67099fcec2f7eca933935c19e948ea7c17c9c36 100755 (executable)
@@ -1,29 +1,28 @@
-#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 #  File   : SALOMEGUI_msg_en.po
 #  Module : SALOME
-
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
diff --git a/src/OCCViewer/resources/OCCViewer_msg_en.ts b/src/OCCViewer/resources/OCCViewer_msg_en.ts
new file mode 100644 (file)
index 0000000..e48ac13
--- /dev/null
@@ -0,0 +1,319 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>MNU_FRONT_VIEW</source>
+        <translation>Front</translation>
+    </message>
+    <message>
+        <source>ERROR</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Dump view</translation>
+    </message>
+    <message>
+        <source>DSC_TOP_VIEW</source>
+        <translation>Top View</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panning</translation>
+    </message>
+    <message>
+        <source>MNU_CLONE_VIEW</source>
+        <translation>Clone View</translation>
+    </message>
+    <message>
+        <source>DSC_SHOW_TRIHEDRE</source>
+        <translation>Show/Hide trihedron in the current view</translation>
+    </message>
+    <message>
+        <source>MNU_SHOW_TRIHEDRE</source>
+        <translation>Show/Hide trihedron</translation>
+    </message>
+    <message>
+        <source>MNU_TOP_VIEW</source>
+        <translation>Top</translation>
+    </message>
+    <message>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Selection of a new center of the view</translation>
+    </message>
+    <message>
+        <source>DSC_ROTATE_VIEW</source>
+        <translation>Rotation of the point of view around the scene center</translation>
+    </message>
+    <message>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Panning the view</translation>
+    </message>
+    <message>
+        <source>DSC_LEFT_VIEW</source>
+        <translation>Left View</translation>
+    </message>
+    <message>
+        <source>DSC_SHOOT_VIEW</source>
+        <translation>Memorizes the state of the active view and adds it to the list</translation>
+    </message>
+    <message>
+        <source>DSC_FITALL</source>
+        <translation>Fit all objects inside the view frame</translation>
+    </message>
+    <message>
+        <source>MNU_FITALL</source>
+        <translation>Fit All</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATE_VIEW</source>
+        <translation>Rotation</translation>
+    </message>
+    <message>
+        <source>OCC_IMAGE_FILES</source>
+        <translation>Images Files (*.bmp *.png *.jpg *.jpeg)</translation>
+    </message>
+    <message>
+        <source>DSC_FRONT_VIEW</source>
+        <translation>Front View</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATIONPOINTGRAVITY_VIEW</source>
+        <translation>Rotation Point : the gravity center</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Global Panning</translation>
+    </message>
+    <message>
+        <source>INF_APP_DUMP_VIEW</source>
+        <translation>Dump view</translation>
+    </message>
+    <message>
+        <source>DSC_CLIPPING</source>
+        <translation>Set clipping plane</translation>
+    </message>
+    <message>
+        <source>DSC_CLONE_VIEW</source>
+        <translation>Create new OCC viewer for the active scene</translation>
+    </message>
+    <message>
+        <source>INF_APP_SHOOT_VIEW</source>
+        <translation>Memorize view</translation>
+    </message>
+    <message>
+        <source>MNU_CLIPPING</source>
+        <translation>Clipping</translation>
+    </message>
+    <message>
+        <source>MNU_BACK_VIEW</source>
+        <translation>Back</translation>
+    </message>
+    <message>
+        <source>MNU_SHOOT_VIEW</source>
+        <translation>Memorize View</translation>
+    </message>
+    <message>
+        <source>DSC_CHANGINGROTATIONPOINT_VIEW</source>
+        <translation>Change the point, around which the rotation is performed</translation>
+    </message>
+    <message>
+        <source>MNU_BOTTOM_VIEW</source>
+        <translation>Bottom</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Reset</translation>
+    </message>
+    <message>
+        <source>MNU_LEFT_VIEW</source>
+        <translation>Left</translation>
+    </message>
+    <message>
+        <source>DSC_RIGHT_VIEW</source>
+        <translation>Right View</translation>
+    </message>
+    <message>
+        <source>MNU_CHANGINGROTATIONPOINT_VIEW</source>
+        <translation>Change Rotation Point</translation>
+    </message>
+    <message>
+        <source>DSC_FITRECT</source>
+        <translation>Fit area within the view frame</translation>
+    </message>
+    <message>
+        <source>MNU_FITRECT</source>
+        <translation>Fit Area</translation>
+    </message>
+    <message>
+        <source>DSC_BOTTOM_VIEW</source>
+        <translation>Bottom View</translation>
+    </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Saves the active view in the image file</translation>
+    </message>
+    <message>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoom the view</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATIONPOINT000_VIEW</source>
+        <translation>Rotation Point : (0,0,0)</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATIONPOINTSELECTED_VIEW</source>
+        <translation>Rotation Point : the point selected by the user</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Reset View Point</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_CANT_SAVE_FILE</source>
+        <translation>Cannot save file</translation>
+    </message>
+    <message>
+        <source>DSC_PRESETS_VIEW</source>
+        <translation>Selection of the memorized state of the active view</translation>
+    </message>
+    <message>
+        <source>MNU_PRESETS_VIEW</source>
+        <translation>Restore View</translation>
+    </message>
+    <message>
+        <source>MNU_RIGHT_VIEW</source>
+        <translation>Right</translation>
+    </message>
+    <message>
+        <source>INF_APP_PRESETS_VIEW</source>
+        <translation>Restore view</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>View Operations</translation>
+    </message>
+    <message>
+        <source>DSC_BACK_VIEW</source>
+        <translation>Back View</translation>
+    </message>
+    <message>
+        <source>DSC_SCALING</source>
+        <translation>Change scale of axes</translation>
+    </message>
+    <message>
+        <source>MNU_SCALING</source>
+        <translation>Scaling</translation>
+    </message>
+    <message>
+        <source>OCC_IMAGE_FILES</source>
+        <translation>Images Files (*.bmp *.png *.jpg *.jpeg *.eps *.ps)</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_CreateRestoreViewDlg</name>
+    <message>
+        <source>CAPTION</source>
+        <translation>Restore view</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_SetRotationPointDlg</name>
+    <message>
+        <source>LBL_X</source>
+        <translation>X:</translation>
+    </message>
+    <message>
+        <source>LBL_Y</source>
+        <translation>Y:</translation>
+    </message>
+    <message>
+        <source>LBL_Z</source>
+        <translation>Z:</translation>
+    </message>
+    <message>
+        <source>USE_BBCENTER</source>
+        <translation>Use Bounding Box Center</translation>
+    </message>
+    <message>
+        <source>LBL_TOORIGIN</source>
+        <translation>Set to Origin</translation>
+    </message>
+    <message>
+        <source>CAPTION</source>
+        <translation>Set Rotation Point</translation>
+    </message>
+    <message>
+        <source>LBL_SELECTPOINT</source>
+        <translation>Select Point from View</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_ViewManager</name>
+    <message>
+        <source>OCC_VIEW_TITLE</source>
+        <translation>OCC scene:%M - viewer:%V</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_Viewer</name>
+    <message>
+        <source>MEN_DUMP_VIEW</source>
+        <translation>Dump View...</translation>
+    </message>
+    <message>
+        <source>MEN_SHOW_TOOLBAR</source>
+        <translation>Show Toolbar</translation>
+    </message>
+    <message>
+        <source>MEN_CHANGE_BACKGROUD</source>
+        <translation>Change Background...</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_AxialScaleDlg</name>
+    <message>
+        <source>DLG_SCALING</source>
+        <translation>Axes scaling</translation>
+    </message>
+    <message>
+        <source>LBL_X</source>
+        <translation>X:</translation>
+    </message>
+    <message>
+        <source>LBL_Y</source>
+        <translation>Y:</translation>
+    </message>
+    <message>
+        <source>LBL_Z</source>
+        <translation>Z:</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/OCCViewer/resources/occ_view_back.png b/src/OCCViewer/resources/occ_view_back.png
new file mode 100755 (executable)
index 0000000..51beb0c
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_back.png differ
diff --git a/src/OCCViewer/resources/occ_view_bottom.png b/src/OCCViewer/resources/occ_view_bottom.png
new file mode 100755 (executable)
index 0000000..fa558e2
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_bottom.png differ
diff --git a/src/OCCViewer/resources/occ_view_camera_dump.png b/src/OCCViewer/resources/occ_view_camera_dump.png
new file mode 100755 (executable)
index 0000000..b02616f
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_camera_dump.png differ
diff --git a/src/OCCViewer/resources/occ_view_clipping.png b/src/OCCViewer/resources/occ_view_clipping.png
new file mode 100644 (file)
index 0000000..0356a9a
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_clipping.png differ
diff --git a/src/OCCViewer/resources/occ_view_clipping_pressed.png b/src/OCCViewer/resources/occ_view_clipping_pressed.png
new file mode 100644 (file)
index 0000000..e38a8aa
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_clipping_pressed.png differ
diff --git a/src/OCCViewer/resources/occ_view_clone.png b/src/OCCViewer/resources/occ_view_clone.png
new file mode 100755 (executable)
index 0000000..441482d
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_clone.png differ
diff --git a/src/OCCViewer/resources/occ_view_fitall.png b/src/OCCViewer/resources/occ_view_fitall.png
new file mode 100755 (executable)
index 0000000..87e001d
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_fitall.png differ
diff --git a/src/OCCViewer/resources/occ_view_fitarea.png b/src/OCCViewer/resources/occ_view_fitarea.png
new file mode 100755 (executable)
index 0000000..450dc56
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_fitarea.png differ
diff --git a/src/OCCViewer/resources/occ_view_front.png b/src/OCCViewer/resources/occ_view_front.png
new file mode 100755 (executable)
index 0000000..d917960
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_front.png differ
diff --git a/src/OCCViewer/resources/occ_view_glpan.png b/src/OCCViewer/resources/occ_view_glpan.png
new file mode 100755 (executable)
index 0000000..28ab547
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_glpan.png differ
diff --git a/src/OCCViewer/resources/occ_view_left.png b/src/OCCViewer/resources/occ_view_left.png
new file mode 100755 (executable)
index 0000000..1b787b0
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_left.png differ
diff --git a/src/OCCViewer/resources/occ_view_pan.png b/src/OCCViewer/resources/occ_view_pan.png
new file mode 100755 (executable)
index 0000000..ec56cac
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_pan.png differ
diff --git a/src/OCCViewer/resources/occ_view_presets.png b/src/OCCViewer/resources/occ_view_presets.png
new file mode 100755 (executable)
index 0000000..b436f94
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_presets.png differ
diff --git a/src/OCCViewer/resources/occ_view_reset.png b/src/OCCViewer/resources/occ_view_reset.png
new file mode 100755 (executable)
index 0000000..66f81e6
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_reset.png differ
diff --git a/src/OCCViewer/resources/occ_view_right.png b/src/OCCViewer/resources/occ_view_right.png
new file mode 100755 (executable)
index 0000000..5c6e161
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_right.png differ
diff --git a/src/OCCViewer/resources/occ_view_rotate.png b/src/OCCViewer/resources/occ_view_rotate.png
new file mode 100755 (executable)
index 0000000..28ec89f
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_rotate.png differ
diff --git a/src/OCCViewer/resources/occ_view_rotation_point.png b/src/OCCViewer/resources/occ_view_rotation_point.png
new file mode 100755 (executable)
index 0000000..fc303e3
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_rotation_point.png differ
diff --git a/src/OCCViewer/resources/occ_view_scaling.png b/src/OCCViewer/resources/occ_view_scaling.png
new file mode 100644 (file)
index 0000000..fa8cbbc
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_scaling.png differ
diff --git a/src/OCCViewer/resources/occ_view_shoot.png b/src/OCCViewer/resources/occ_view_shoot.png
new file mode 100755 (executable)
index 0000000..fa5ba75
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_shoot.png differ
diff --git a/src/OCCViewer/resources/occ_view_top.png b/src/OCCViewer/resources/occ_view_top.png
new file mode 100755 (executable)
index 0000000..cef9504
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_top.png differ
diff --git a/src/OCCViewer/resources/occ_view_triedre.png b/src/OCCViewer/resources/occ_view_triedre.png
new file mode 100755 (executable)
index 0000000..bc5894d
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_triedre.png differ
diff --git a/src/OCCViewer/resources/occ_view_zoom.png b/src/OCCViewer/resources/occ_view_zoom.png
new file mode 100755 (executable)
index 0000000..386c966
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_zoom.png differ
diff --git a/src/OCCViewer/resources/view_back.png b/src/OCCViewer/resources/view_back.png
deleted file mode 100755 (executable)
index 436f2da..0000000
Binary files a/src/OCCViewer/resources/view_back.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_bottom.png b/src/OCCViewer/resources/view_bottom.png
deleted file mode 100755 (executable)
index a18011c..0000000
Binary files a/src/OCCViewer/resources/view_bottom.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_camera_dump.png b/src/OCCViewer/resources/view_camera_dump.png
deleted file mode 100755 (executable)
index 8eb63e0..0000000
Binary files a/src/OCCViewer/resources/view_camera_dump.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_clipping.png b/src/OCCViewer/resources/view_clipping.png
deleted file mode 100644 (file)
index dce8bd5..0000000
Binary files a/src/OCCViewer/resources/view_clipping.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_clipping_pressed.png b/src/OCCViewer/resources/view_clipping_pressed.png
deleted file mode 100644 (file)
index 7895f65..0000000
Binary files a/src/OCCViewer/resources/view_clipping_pressed.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_clone.png b/src/OCCViewer/resources/view_clone.png
deleted file mode 100755 (executable)
index 5b5a8ec..0000000
Binary files a/src/OCCViewer/resources/view_clone.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_fitall.png b/src/OCCViewer/resources/view_fitall.png
deleted file mode 100755 (executable)
index c09ff94..0000000
Binary files a/src/OCCViewer/resources/view_fitall.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_fitarea.png b/src/OCCViewer/resources/view_fitarea.png
deleted file mode 100755 (executable)
index 5b79594..0000000
Binary files a/src/OCCViewer/resources/view_fitarea.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_front.png b/src/OCCViewer/resources/view_front.png
deleted file mode 100755 (executable)
index c5dfc00..0000000
Binary files a/src/OCCViewer/resources/view_front.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_glpan.png b/src/OCCViewer/resources/view_glpan.png
deleted file mode 100755 (executable)
index c23322a..0000000
Binary files a/src/OCCViewer/resources/view_glpan.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_left.png b/src/OCCViewer/resources/view_left.png
deleted file mode 100755 (executable)
index dbc06cc..0000000
Binary files a/src/OCCViewer/resources/view_left.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_pan.png b/src/OCCViewer/resources/view_pan.png
deleted file mode 100755 (executable)
index 038fba1..0000000
Binary files a/src/OCCViewer/resources/view_pan.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_presets.png b/src/OCCViewer/resources/view_presets.png
deleted file mode 100755 (executable)
index b436f94..0000000
Binary files a/src/OCCViewer/resources/view_presets.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_reset.png b/src/OCCViewer/resources/view_reset.png
deleted file mode 100755 (executable)
index 1285064..0000000
Binary files a/src/OCCViewer/resources/view_reset.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_right.png b/src/OCCViewer/resources/view_right.png
deleted file mode 100755 (executable)
index 598def4..0000000
Binary files a/src/OCCViewer/resources/view_right.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_rotate.png b/src/OCCViewer/resources/view_rotate.png
deleted file mode 100755 (executable)
index 80926c5..0000000
Binary files a/src/OCCViewer/resources/view_rotate.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_rotation_point.png b/src/OCCViewer/resources/view_rotation_point.png
deleted file mode 100755 (executable)
index 59f5931..0000000
Binary files a/src/OCCViewer/resources/view_rotation_point.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_shoot.png b/src/OCCViewer/resources/view_shoot.png
deleted file mode 100755 (executable)
index a80477b..0000000
Binary files a/src/OCCViewer/resources/view_shoot.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_top.png b/src/OCCViewer/resources/view_top.png
deleted file mode 100755 (executable)
index ebbf34d..0000000
Binary files a/src/OCCViewer/resources/view_top.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_triedre.png b/src/OCCViewer/resources/view_triedre.png
deleted file mode 100755 (executable)
index 3eed48d..0000000
Binary files a/src/OCCViewer/resources/view_triedre.png and /dev/null differ
diff --git a/src/OCCViewer/resources/view_zoom.png b/src/OCCViewer/resources/view_zoom.png
deleted file mode 100755 (executable)
index b465739..0000000
Binary files a/src/OCCViewer/resources/view_zoom.png and /dev/null differ
index ba4e735b3c8b22ed22da5b2136402152d587ab87..de6ed12b08de21e9964f21f572c372dbf9a7d0eb 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : ObjectBrowser
 # $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libObjBrowser.la
 
-salomeinclude_HEADERS=\
-       OB.h \
-       OB_Browser.h \
-       OB_ListItem.h \
-       OB_ListView.h \
-       OB_Filter.h \
-       OB_FindDlg.h \
-       OB_ObjSearch.h
-
-dist_libObjBrowser_la_SOURCES= \
-       OB_Browser.cxx \
-       OB_ListItem.cxx \
-       OB_ListView.cxx \
-       OB_Filter.cxx \
-       OB_FindDlg.cxx \
-       OB_ObjSearch.cxx
-
-MOC_FILES= \
-       OB_Browser_moc.cxx \
-       OB_ListView_moc.cxx \
-       OB_FindDlg_moc.cxx
-nodist_libObjBrowser_la_SOURCES= $(MOC_FILES)
+salomeinclude_HEADERS =                \
+       OB.h                    \
+       OB_Browser.h
 
-nodist_salomeres_DATA = OB_msg_en.qm
+#      OB_Filter.h
+
+dist_libObjBrowser_la_SOURCES =        \
+       OB_Browser.cxx
 
-libObjBrowser_la_CPPFLAGS=$(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+#      OB_Filter.cxx
+
+MOC_FILES =                    \
+       OB_Browser_moc.cxx
+
+nodist_libObjBrowser_la_SOURCES = $(MOC_FILES)
+
+nodist_salomeres_DATA = OB_msg_en.qm
 
-libObjBrowser_la_LDFLAGS=$(QT_MT_LIBS)
-libObjBrowser_la_LIBADD= ../SUIT/libsuit.la ../Qtx/libqtx.la
+libObjBrowser_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../Qtx
+libObjBrowser_la_LDFLAGS  = $(QT_MT_LIBS)
+libObjBrowser_la_LIBADD   = ../Qtx/libqtx.la
index 8b243affe5f7642e24fb9472552777c062076be2..a72acf7bb408fae8c91c5cbb1983a7e115077dfa 100755 (executable)
@@ -1,37 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OB_H
 #define OB_H
 
-#if defined OB_EXPORTS
-#if defined WNT
-#define OB_EXPORT __declspec( dllexport )
-#else
-#define OB_EXPORT
-#endif
-#else
-#if defined WNT
-#define OB_EXPORT __declspec( dllimport )
-#else
-#define OB_EXPORT
-#endif
-#endif
+#if defined WIN32
+#  if defined OB_EXPORTS || defined OBJBROWSER_EXPORTS
+#    define OB_EXPORT __declspec( dllexport )
+#  else
+#    define OB_EXPORT __declspec( dllimport )
+#  endif
+#else    // WIN32
+#  define OB_EXPORT
+#endif   // WIN32
 
 #if defined SOLARIS
 #define bool  int
@@ -39,7 +38,7 @@
 #define true  1
 #endif
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
 
index 41232b9a29e95585995e49a6b2f7886b1f6d2530..4fd97c7c0cc23c694a4472b9e1a2edb547613383 100755 (executable)
@@ -1,47 +1,56 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : OB_Browser.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #include "OB_Browser.h"
 
-#include "OB_Filter.h"
-#include "OB_ListItem.h"
-#include "OB_ListView.h"
-#include "OB_FindDlg.h"
+//#include "OB_Filter.h"
+//#include "OB_ListItem.h"
+//#include "OB_ListView.h"
 
-#include <SUIT_DataObjectIterator.h>
-#include <SUIT_TreeSync.h>
+#include <QtxTreeView.h>
+#include <QtxSearchTool.h>
+//#include <SUIT_DataObjectIterator.h>
 
-#include <qcursor.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qpainter.h>
-#include <qwmatrix.h>
-#include <qlistview.h>
-#include <qpopupmenu.h>
-#include <qdatetime.h>
+#include <QAction>
+#include <QMenu>
+#include <QItemSelection>
+#include <QKeyEvent>
+#include <QVBoxLayout>
+#include <QAbstractItemModel>
+#include <QAbstractItemDelegate>
+#include <QHeaderView>
 
 #include <time.h>
 
+
 /*!
   \class  OB_Browser::ToolTip
   Tool tip for OB_Browser.
 */
 
+//TODO: ToolTip commented - to be removed or revised
+/*
 class OB_Browser::ToolTip : public QToolTip
 {
 public:
@@ -53,29 +62,32 @@ public:
 private:
   OB_Browser* myBrowser;
 };
-
+*/
 /*!
   Constructor
 */
+/*
 OB_Browser::ToolTip::ToolTip( OB_Browser* b, QWidget* p )
 : QToolTip( p ),
 myBrowser( b )
 {
 }
-
+*/
 /*!
   Destructor
 */
+/*
 OB_Browser::ToolTip::~ToolTip()
 {
 }
-
+*/
 /*!
   It is called when there is a possibility that a tool tip
   should be shown and must decide whether there is a tool tip for the point
   in the widget that this QToolTip object relates to.
   \param pos - point co-ordinates
 */
+/*
 void OB_Browser::ToolTip::maybeTip( const QPoint& pos )
 {
   if ( !parentWidget() || !myBrowser || !myBrowser->isShowToolTips() )
@@ -97,270 +109,197 @@ void OB_Browser::ToolTip::maybeTip( const QPoint& pos )
 
   tip( aRect, aText );
 }
+*/
 
 
-typedef SUIT_DataObject*   ObjPtr;
-typedef OB_ListItem*       ItemPtr;
-
 /*!
-   \class  OB_BrowserSync
-   Auxiliary class for synchronizing tree of SUIT_DataObjects and list view items
-*/
-class OB_BrowserSync
-{
-public:
-  OB_BrowserSync( OB_Browser* );
-  bool     isEqual( const ObjPtr&, const ItemPtr& ) const;
-  ObjPtr   nullSrc() const;
-  ItemPtr  nullTrg() const;
-  ItemPtr  createItem( const ObjPtr&, const ItemPtr&, const ItemPtr&, const bool ) const;
-  void     updateItem( const ObjPtr& , const ItemPtr& ) const;
-  void     deleteItemWithChildren( const ItemPtr& ) const;
-  void     children( const ObjPtr&, QValueList<ObjPtr>& ) const;
-  void     children( const ItemPtr&, QValueList<ItemPtr>& ) const;
-  ItemPtr  parent( const ItemPtr& ) const;
-private:
-  bool     needUpdate( const ItemPtr& ) const;
-  OB_Browser*   myBrowser;
-};
+  \class OB_Browser
+  \brief Object browser widget which can be used to handle tree-like data model.
 
+  The class OB_Browser implements public API of an object browser widget
+  that can be used to display arbitrary application data in a hierarchical form.
+  It is based on Qt4 model/view architecture. 
 
-/*!
-  Constructor
-*/
-OB_BrowserSync::OB_BrowserSync( OB_Browser* ob )
-: myBrowser( ob )
-{
-}
+  Object browser can be used with conjuction of any custom item model inherited
+  from QAbstractItemModel class (see Qt 4 reference manual).
 
-/*!
-  \return true if item must be updated
-  \param item - item to be checked
+  The class provides a functionality get/modify selection, drag-n-drop of the
+  objects, etc.
 */
-bool OB_BrowserSync::needUpdate( const ItemPtr& item ) const
-{
-  bool update = false;
-  if ( item ) {
-    SUIT_DataObject* obj = item->dataObject();
-    if ( obj ) {
-      // 1. check text
-      update = ( item->text( 0 ) != obj->name() ) || myBrowser->needToUpdateTexts( item );
-
-      if ( !update ) { 
-       // 2. check pixmap (compare serialNumber()-s)
-       QPixmap objPix = obj->icon();
-       const QPixmap* itemPix = item->pixmap( 0 );
-       update = (  objPix.isNull() && (  itemPix && !itemPix->isNull() ) ) || 
-                ( !objPix.isNull() && ( !itemPix ||  itemPix->isNull() ) ); 
-       if ( !update && !objPix.isNull() && itemPix && !itemPix->isNull() ) {
-         int aIconW = objPix.width();
-         if( aIconW > 20 ) {
-           QWMatrix aM;
-           double aScale = 20.0 / aIconW;
-           aM.scale( aScale, aScale );
-           objPix = objPix.xForm( aM );
-         }
-         update = ( objPix.serialNumber() != itemPix->serialNumber() );
-       }
-      }
-    }
-  }
-  return update;
-}
 
 /*!
-  Updates item
-  \param p - item
+  \brief Constructor
+  \param parent paren widget
+  \param model data model
 */
-void OB_BrowserSync::updateItem( const ObjPtr& o, const ItemPtr& p ) const
+OB_Browser::OB_Browser( QWidget* parent, QAbstractItemModel* model )
+: QWidget( parent ),
+  myAutoOpenLevel( 0 )
 {
-  if ( p && needUpdate( p ) ) { 
-    //    printf( "--- needUpdate for %s = true ---\n", p->text( 0 ).latin1() );
-    myBrowser->updateText( p );
-    p->update();
-  }
-  if( o && myBrowser->getUpdater() )
-    {
-      myBrowser->getUpdater()->update( o, p );
-    }
+  myView = new QtxTreeView( this );
+  myView->setRootIsDecorated( true );
+  myView->setSelectionMode( QAbstractItemView::ExtendedSelection );
+  myView->setAllColumnsShowFocus( true );
+
+  mySearchTool = new QtxSearchTool( this, myView );
+  mySearchTool->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
+  mySearchTool->setActivators( QtxSearchTool::StandardKey | QtxSearchTool::SlashKey );
+  mySearchTool->setSearcher( new QtxTreeViewSearcher( myView ) );
+  
+  QVBoxLayout* main = new QVBoxLayout( this );
+  main->addWidget( myView );
+  main->addWidget( mySearchTool );
+  main->setMargin( 0 );
+  main->setSpacing( 3 );
+
+  // TODO: decide what to do with tooltip
+  //myShowToolTips = true;
+  //myTooltip = new ToolTip( this, myView->viewport() );
+
+  // TODO: drag-n-drop works differently - SUIT_TreeModel to be updated
+  // and QTreeView needs some setup
+  //connect( myView, SIGNAL( dropped( QPtrList<QListViewItem>, QListViewItem*, int ) ),
+  //         this, SLOT( onDropped( QPtrList<QListViewItem>, QListViewItem*, int ) ) );
+  setModel( model );
+
+  connect( myView, SIGNAL( selectionChanged() ),
+          this,   SIGNAL( selectionChanged() ) );
+
 }
 
 /*!
-  Creates item by SUIT object
-  \param src - corresponding SUIT object
-  \param parent - parent for item
-  \param after - previous sibling for item
-  \param prepend - item must be added to start of children list
+  \brief Destructor.
 */
-ItemPtr OB_BrowserSync::createItem( const ObjPtr& src,
-                                   const ItemPtr& parent, const ItemPtr& after,
-                                   const bool prepend ) const
+OB_Browser::~OB_Browser()
 {
-  ItemPtr i = myBrowser ? dynamic_cast<ItemPtr>( myBrowser->createItem( src, parent, after, prepend ) ) : 0;
-  if( i )
-    i->setOpen( src->isOpen() );
-  return i;
+  //delete myTooltip;
+  //setUpdater( 0 );
 }
 
 /*!
-  Deletes object with all children
-  \param i - item
+  \brief Get data model.
+  \return data model
+  \sa setModel()
 */
-void OB_BrowserSync::deleteItemWithChildren( const ItemPtr& i ) const
+QAbstractItemModel* OB_Browser::model() const
 {
-  if( myBrowser && myBrowser->myItems.contains( i->dataObject() ) )
-  {
-    myBrowser->removeReferences( i );
-    delete i;
-  }
+  return myView->model();
 }
 
 /*!
-  \return true if objects correspond each other at all
-  \param p - suit object
-  \param q - object browser item
+  \brief Set data model.
+  \param model data model
+  \sa model()
 */
-bool OB_BrowserSync::isEqual( const ObjPtr& p, const ItemPtr& q ) const
+void OB_Browser::setModel( QAbstractItemModel* model )
 {
-  bool isRoot = p==myBrowser->getRootObject() && !q,
-       isEq = p && q && q->dataObject()==p;
-  return isRoot || ( !p && !q ) || isEq;
+  myView->setModel( model );
+  myView->update();
+  setModified();
 }
 
 /*!
-  \return null suit object
+  \brief Get current item delegate (items renderer).
+  \return currently used item delegate
+  \sa setItemDelegate()
 */
-ObjPtr OB_BrowserSync::nullSrc() const
+QAbstractItemDelegate* OB_Browser::itemDelegate() const
 {
-  return 0;
+  return myView->itemDelegate();
 }
 
 /*!
-  \return null item
+  \brief Set item delegate (items renderer).
+  \param d custom item delegate
+  \sa itemDelegate()
 */
-ItemPtr OB_BrowserSync::nullTrg() const
+void OB_Browser::setItemDelegate( QAbstractItemDelegate* d )
 {
-  return 0;
+  myView->setItemDelegate( d );
 }
 
 /*!
-  Fills list with children of SUIT object
-  \param p - SUIT object
-  \param ch - list to be filled
+  \brief Check if controls for expanding and collapsing top-level items are shown.
+  \return \c true if top-level items are decorated
+  \sa setRootIsDecorated()
 */
-void OB_BrowserSync::children( const ObjPtr& p, QValueList<ObjPtr>& ch ) const
+bool OB_Browser::rootIsDecorated() const
 {
-  DataObjectList l;
-  if( p )
-  {
-    p->children( l );
-    ch.clear();
-    for( SUIT_DataObject* o = l.first(); o; o = l.next() )
-      ch.append( o );
-  }
+  return myView->rootIsDecorated();
 }
 
 /*!
-  Fills list with children of item
-  \param p - item
-  \param ch - list to be filled
+  \brief Show/hide controls for expanding and collapsing top-level items.
+  \param decor if \c true, top-level items are decorated
+  \sa rootIsDecorated()
 */
-void OB_BrowserSync::children( const ItemPtr& p, QValueList<ItemPtr>& ch ) const
+void OB_Browser::setRootIsDecorated( const bool decor )
 {
-  for( QListViewItem* item = p ? p->firstChild() : myBrowser->listView()->firstChild(); item; item = item->nextSibling() )
-  {
-    ItemPtr p = dynamic_cast<ItemPtr>( item );
-    if( p )
-      ch.append( p );
-  }
+  if ( decor != rootIsDecorated() )
+    myView->setRootIsDecorated( decor );
 }
 
-/*!
-  \return parent of item
-  \param p - item
+/*
+  \brief Check if "Sorting" popup menu command for the header is enabled.
+  \return \c true if "Sorting" menu command is enabled
+  \sa setSortMenuEnabled()
 */
-ItemPtr OB_BrowserSync::parent( const ItemPtr& p ) const
+bool OB_Browser::sortMenuEnabled() const
 {
-  return p ? dynamic_cast<ItemPtr>( p->parent() ) : 0;
+  return myView->sortMenuEnabled();
 }
 
-
-/*!
-  Constructor
+/*
+  \brief Enable/disable "Sorting" popup menu command for the header.
+  \param enableSortMenu if \c true, enable "Sorting" menu command
+  \sa sortMenuEnabled()
 */
-OB_Browser::OB_Browser( QWidget* parent, SUIT_DataObject* root )
-: QFrame( parent ),
-
-myRoot( 0 ),
-myTooltip( 0 ),
-myUpdater( 0 ),
-myAutoOpenLevel( 0 ),
-myAutoUpdate( false ),
-myAutoDelObjs( false ),
-myRootDecorated( true )
+void OB_Browser::setSortMenuEnabled( const bool enabled )
 {
-  myView = new OB_ListView( QtxListView::HeaderAuto, this );
-  myView->setAppropriate( myView->addColumn( "Data" ), false );
-  myView->setSorting( -1 );
-  myView->setRootIsDecorated( true );
-  myView->setSelectionMode( QListView::Extended );
-  myView->installEventFilter( this );
-  myView->viewport()->installEventFilter( this );
-
-  myFindDlg = new OB_FindDlg( this );
-  myFindDlg->hide();
-
-  QVBoxLayout* main = new QVBoxLayout( this );
-  main->addWidget( myView, 1 );
-  main->addWidget( myFindDlg, 0 );
-
-  myShowToolTips = true;
-  myTooltip = new ToolTip( this, myView->viewport() );
-
-  connect( myView, SIGNAL( dropped( QPtrList<QListViewItem>, QListViewItem*, int ) ),
-           this, SLOT( onDropped( QPtrList<QListViewItem>, QListViewItem*, int ) ) );
-  connect( myView, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
-  connect( myView, SIGNAL( doubleClicked( QListViewItem* ) ),
-           this, SLOT( onDoubleClicked( QListViewItem* ) ) );
-
-  setRootObject( root );
-
-  setModified();
+  if ( enabled != sortMenuEnabled() )
+    myView->setSortMenuEnabled( enabled );
 }
 
 /*!
-  Destructor
+  \brief Get search tool widget.
+  \return search tool widget
+  \sa isSearchToolEnabled(), setSearchToolEnabled()
 */
-OB_Browser::~OB_Browser()
+QtxSearchTool* OB_Browser::searchTool() const
 {
-  myItems.clear();
-  delete myTooltip;
-  setUpdater( 0 );
+  return mySearchTool;
 }
 
 /*!
-  \return true if root is decorated by +
+  \brief Check if search tool is enabled.
+  \return \c true if search tool is enabled
+  \sa setSearchToolEnabled(), searchTool()
 */
-bool OB_Browser::rootIsDecorated() const
+bool OB_Browser::isSearchToolEnabled() const
 {
-  return myRootDecorated;
+  return mySearchTool->isEnabled();
 }
 
 /*!
-  Sets state "root is recorated"
-  \param decor - new value of state
+  \brief Enable/disable search tool.
+  \param enable pass \c true to enable search tool
+  \sa isSearchToolEnabled(), searchTool()
 */
-void OB_Browser::setRootIsDecorated( const bool decor )
+void OB_Browser::setSearchToolEnabled( const bool enable )
 {
-  if ( decor == rootIsDecorated() ) 
+  if ( mySearchTool->isEnabled() == enable )
     return;
 
-  myRootDecorated = decor;
-  updateTree( 0, false );
+  mySearchTool->setEnabled( enable );
+  if ( !mySearchTool->isEnabled() )
+    mySearchTool->hide();
 }
 
 /*!
-  \return number of levels to be auto opened on update tree
+  \brief Get number of levels which should be automatically expanded
+  when updating the data tree.
+  \return number of levels to be auto-opened on tree updating
+  \sa setAutoOpenLevel()
 */
 int OB_Browser::autoOpenLevel() const
 {
@@ -368,306 +307,183 @@ int OB_Browser::autoOpenLevel() const
 }
 
 /*!
-  Changes number of levels to be auto opened on update tree
-  \param level - new number of levels
+  \brief Set number of levels which should be automatically expanded
+  when updating the data tree.
+  \param levels number of levels to be auto-opened on tree updating
+  \sa autoOpenLevel()
 */
-void OB_Browser::setAutoOpenLevel( const int level )
+void OB_Browser::setAutoOpenLevel( const int levels )
 {
-  if ( myAutoOpenLevel == level )
-    return;
-
-  myAutoOpenLevel = level;
+  if ( myAutoOpenLevel != levels )
+    myAutoOpenLevel = levels;
 }
 
 /*!
-  Opens branches from 1 to \alevels. If parameter value negative then autoOpenLevel() value will be used.
+  \brief Expand all branches to the specified number of levels.
+
+  If \a levels value is negative, then autoOpenLevel() value is used instead.
+  
+  \param levels number of levels to be expanded
   \sa autoOpenLevel()
 */
 void OB_Browser::openLevels( const int levels )
 {
-  int level = levels < 0 ? autoOpenLevel() : levels;
-  QListView* lv = listView();
-  if ( !lv || level < 1 )
-    return;
-
-  QListViewItem* item = lv->firstChild();
-  while ( item )
-  {
-    openBranch( item, level );
-    item = item->nextSibling();
-  }
+  myView->expandLevels( levels < 0 ? autoOpenLevel() : levels );
 }
 
 /*!
   \return state "are tooltips shown"
 */
+/*
 bool OB_Browser::isShowToolTips()
 {
   return myShowToolTips;
 }
-
+*/
 /*!
   Sets new value of state "are tooltips shown"
   \param theDisplay - new value
 */
+/*
 void OB_Browser::setShowToolTips( const bool theDisplay )
 {
   myShowToolTips = theDisplay;
 }
-
-/*!
-  \return true if object browser automatically updates tree after SUIT object removing
-*/
-bool OB_Browser::isAutoUpdate() const
-{
-  return myAutoUpdate;
-}
-
-/*!
-  Sets new value of "auto update": whether object browser automatically updates tree after SUIT object removing
 */
-void OB_Browser::setAutoUpdate( const bool on )
-{
-  myAutoUpdate = on;
-}
 
 /*!
-  \return true if object browser must delete old tree on setRootObject(), replaceTree()
-  \sa setRootObject(), replaceTree()
+  \brief Get number of selected items.
+  \return number of selected items
 */
-bool OB_Browser::isAutoDeleteObjects() const
+int OB_Browser::numberOfSelected() const
 {
-  return myAutoDelObjs;
+  return myView->selectionModel() ? myView->selectionModel()->selectedIndexes().count() : 0;
 }
 
 /*!
-  Sets whether object browser must delete old tree on setRootObject(), replaceTree()
-  \sa setRootObject(), replaceTree()
+  \brief Get all selected items.
+  \return unsorted list of selected indexes with no duplicates
 */
-void OB_Browser::setAutoDeleteObjects( const bool on )
+QModelIndexList OB_Browser::selectedIndexes() const
 {
-  myAutoDelObjs = on;
+  return myView->selectionModel() ? myView->selectionModel()->selectedIndexes() : QModelIndexList();
 }
 
 /*!
-  \return updater of browser
+  \brief Get selection containing information about selected ranges.
+  \return QItemSelection instance
 */
-OB_Updater* OB_Browser::getUpdater() const
+const QItemSelection OB_Browser::selection() const
 {
-  return myUpdater;
+  static QItemSelection emptySel;
+  QItemSelection sel = emptySel;
+  if ( myView->selectionModel() )
+    sel = myView->selectionModel()->selection();
+  return sel;
 }
 
 /*!
-  \sets new updater of browser
+  \brief Select/deselect specified model index.
+  \param index model index to be selected/deselected
+  \param on if \c true, the index will be selected, otherwise - deselected
+  \param keepSelection if \c true (default) the previous selection is kept, 
+  otherwise it is first cleared
 */
-void OB_Browser::setUpdater( OB_Updater* theUpdate )
+void OB_Browser::select( const QModelIndex& index, const bool on, const bool keepSelection )
 {
-  if( myUpdater )
-    delete myUpdater;
-  myUpdater = theUpdate;
-}
+  if ( myView->selectionModel() ) {
+    QItemSelectionModel::SelectionFlags f = on ? QItemSelectionModel::Select : QItemSelectionModel::Deselect;
+    f = f | QItemSelectionModel::Rows;
+    if ( !keepSelection )
+      f = f | QItemSelectionModel::Clear;
 
-/*!
-  \return root SUIT object of browser
-*/
-SUIT_DataObject* OB_Browser::getRootObject() const
-{
-  return myRoot;
+    myView->selectionModel()->select( index, f );
+  }
 }
 
 /*!
-  Sets new root SUIT object of browser
-  \param theRoot - new root object
+  \brief Select/deselect specified model indices.
+  \param indexes model indices to be selected/deselected
+  \param on if \c true, the indices will be selected, otherwise - deselected
+  \param keepSelection if \c true (default) the previous selection is kept, 
+  otherwise it is first cleared
 */
-void OB_Browser::setRootObject( SUIT_DataObject* theRoot )
+void OB_Browser::select( const QModelIndexList& indexes, const bool on, const bool keepSelection )
 {
-  DataObjectKey curKey;
-  DataObjectMap selObjs, openObjs;
-  DataObjectKeyMap selKeys, openKeys;
-
-  int selNum = numberOfSelected();
-
-  SUIT_DataObject* curObj = 0;
-  if ( theRoot )
-    curObj = storeState( selObjs, openObjs, selKeys, openKeys, curKey );
+  bool blocked = myView->signalsBlocked();
+  myView->blockSignals( true );
 
-  removeConnections( myRoot );
-  if ( myRoot != theRoot && isAutoDeleteObjects() )
-    delete myRoot;
+  QModelIndex idx;
+  bool first = true;
 
-  myRoot = theRoot;
-
-  createConnections( myRoot );
-
-  if ( myRoot )
-    updateView( myRoot );
-  else if ( listView() )
-  {
-    myItems.clear();
-    listView()->clear();
+  if ( !indexes.isEmpty() ) {
+    foreach( idx, indexes ) {
+      select( idx, on, first ? keepSelection : true );
+      first = false;
+    }
   }
-
-  restoreState( selObjs, openObjs, curObj, selKeys, openKeys, curKey );
-
-  autoOpenBranches();
-
-  setModified();
-
-  if ( selNum != numberOfSelected() )
-    emit selectionChanged();
-}
-
-/*!
-  \return number of selected items
-*/
-int OB_Browser::numberOfSelected() const
-{
-  int count = 0;
-  if ( listView() )
-  {
-    for ( QListViewItemIterator it( listView() ); it.current(); ++it )
-      if ( it.current()->isSelected() ) 
-        count++;
+  else if ( !keepSelection ) {
+    myView->clearSelection();
   }
-  return count;
-}
 
-/*!
-  \return list of selected objects
-*/
-DataObjectList OB_Browser::getSelected() const
-{
-  DataObjectList lst;
-  getSelected( lst );
-  return lst;
+  myView->blockSignals( blocked );
+  emit( selectionChanged() );
 }
 
 /*!
-  Fills list with selected objects
+  \brief Check if specified model index is expanded or collapsed.
+  \param index model index
+  \return \c true if model index is expanded
+  \sa setOpen()
 */
-void OB_Browser::getSelected( DataObjectList& theObjList ) const
+bool OB_Browser::isOpen( const QModelIndex& index ) const
 {
-  theObjList.clear();
-
-  if ( !listView() )
-    return;
-
-  for ( QListViewItemIterator it( listView() ); it.current(); ++it )
-  {
-    if ( it.current()->isSelected() ) 
-    {
-      SUIT_DataObject* obj = dataObject( it.current() );
-      if ( obj )
-       theObjList.append( obj );
-    }
-  }
+  return index.isValid() && model() && model()->hasChildren( index ) && myView->isExpanded( index );
 }
 
 /*!
-  Sets selected object
-  \param theObject - new selected object
-  \param append - if it is true, then other selected objects are left as selected,
-  otherwise only 'theObject' will be selected
+  \brief Expand/collapse the specified model index.
+  \param index model index
+  \param open if \c true, the index will be expanded, otherwse - collapsed
+  \sa isOpen()
 */
-void OB_Browser::setSelected( const SUIT_DataObject* theObject, const bool append )
+void OB_Browser::setOpen( const QModelIndex& index, const bool open )
 {
-  DataObjectList lst;
-  lst.append( theObject );
-  setSelected( lst, append );
+  myView->setExpanded( index, open );  // hasChildren() ???
 }
 
 /*!
-  Sets selected objects
-  \param theObjLst - new selected objects
-  \param append - if it is true, then other selected objects are left as selected,
-  otherwise only 'theObjLst' will be selected
+  \brief Adjust first column width to its contents.
 */
-void OB_Browser::setSelected( const DataObjectList& theObjLst, const bool append )
+void OB_Browser::adjustWidth()
 {
-  QListView* lv = listView();
-
-  if ( !lv )
-    return;
-
-  bool changed = false;
-  bool block = lv->signalsBlocked();
-  lv->blockSignals( true );
-
-  QMap<QListViewItem*, int> map;
-  for ( DataObjectListIterator itr( theObjLst ); itr.current(); ++itr )
-    map.insert( listViewItem( itr.current() ), 0 );
-
-  for ( QListViewItemIterator it( lv ); it.current(); ++it )
-  {
-    QListViewItem* item = it.current();
-    if ( map.contains( item ) && !lv->isSelected( item ) )
-    {
-      changed = true;
-      lv->setSelected( item, true );
-    }
-    if ( !append && !map.contains( item ) && lv->isSelected( item ) )
-    {
-      changed = true;
-      lv->setSelected( item, false );
-    }
-  }
-
-  lv->blockSignals( block );
-
-  if ( changed )
-  {
-    int count = 0;
-    QListViewItem* sel = 0;
-    QListViewItem* cur = lv->currentItem();
-    for ( QListViewItemIterator iter( lv ); iter.current() && !sel; ++iter, count++ )
-    {
-      if ( iter.current()->isSelected() && cur == iter.current() )
-        sel = iter.current();
-    }
-
-    for ( QListViewItemIterator itr( lv ); itr.current() && !sel; ++itr )
-    {
-      if ( itr.current()->isSelected() )
-             sel = itr.current();
-    }
-
-    if ( sel )
-      lv->setCurrentItem( sel );
-
-    if ( sel && count == 1 )
-      lv->ensureItemVisible( sel );
-
-    emit selectionChanged();
-  }
+  myView->resizeColumnToEncloseContents( 0 );
 }
 
 /*!
-  \return true if item corresponding to object is opened
-  \param theObject - object to be checked
+  \brief Adjust first column width to its contents.
 */
-bool OB_Browser::isOpen( SUIT_DataObject* theObject ) const
+void OB_Browser::adjustFirstColumnWidth()
 {
-  bool res = false;
-  if ( listView() )
-    res = listView()->isOpen( listViewItem( theObject ) );
-  return res;
+  myView->resizeColumnToEncloseContents( 0 );
 }
 
 /*!
-  Sets opened state of item
-  \param theObject - object corresponding to item
-  \param theOpen - new opened state
+  \brief Adjust all columns width to its contents except the first column.
 */
-void OB_Browser::setOpen( SUIT_DataObject* theObject, const bool theOpen )
+void OB_Browser::adjustColumnsWidth()
 {
-  if ( listView() )
-    listView()->setOpen( listViewItem( theObject ), theOpen );
+  for ( int aCol = 1; aCol < myView->header()->count(); aCol++ ) {
+    if ( myView->columnWidth( aCol ) > 0 )
+      myView->resizeColumnToEncloseContents( aCol );
+  }
 }
 
 /*!
   \return SUIT object correspondint to item at position 'pos'
   \param pos - position
 */
+/* TODO: removed - QTreeView::indexAt() should be used
 SUIT_DataObject* OB_Browser::dataObjectAt( const QPoint& pos ) const
 {
   SUIT_DataObject* obj = 0;
@@ -678,247 +494,45 @@ SUIT_DataObject* OB_Browser::dataObjectAt( const QPoint& pos ) const
 
   return obj;
 }
-
+*/
 /*!
   \return filter of list view
 */
+/* TODO: removed
 OB_Filter* OB_Browser::filter() const
 {
   return myView->filter();
 }
-
+*/
 /*!
   Changes filter of list view
   \param f - new filter
 */
+/* TODO: removed
 void OB_Browser::setFilter( OB_Filter* f )
 {
   myView->setFilter( f );
 }
-
-/*!
-  Adds new column to list view
-  \param label - title of column
-  \param id - id of column
-  \param width - width of column
-*/
-int OB_Browser::addColumn( const QString& label, const int id, const int width )
-{
-  return addColumn( QIconSet(), label, id, width );
-}
-
-/*!
-  Adds new column to list view
-  \param icon - icon of column
-  \param label - title of column
-  \param id - id of column
-  \param width - width of column
-*/
-int OB_Browser::addColumn( const QIconSet& icon, const QString& label, const int id, const int width )
-{
-  QListView* lv = listView();
-  if ( !lv )
-    return -1;
-
-  int theId = id;
-  if ( theId < 0 )
-  {
-    while ( myColumnIds.contains( theId ) )
-      theId++;
-  }
-
-  if ( myColumnIds.contains( theId ) )
-    return -1; // can not reuse id
-
-  int sec = -1;
-  if ( icon.isNull() )
-    sec = lv->addColumn( label, width );
-  else
-    sec = lv->addColumn( icon, label, width );
-
-  if ( sec == -1 )
-    return -1;
-
-  myColumnIds.insert( theId, sec );
-  updateText();
-
-  return theId;
-}
-
-/*!
-  Removes column
-  \param id - id of column
-*/
-void OB_Browser::removeColumn( const int id )
-{
-  QListView* lv = listView();
-  if ( !lv || !myColumnIds.contains( id ) )
-    return;
-
-  int sec = myColumnIds[id];
-  lv->removeColumn( sec );
-
-  // update map of column indeces
-  myColumnIds.remove( id );
-  for ( QMap<int, int>::iterator it = myColumnIds.begin(); it != myColumnIds.end(); ++it )
-  {
-    if ( it.key() > id )
-      it.data()--;
-  }
-  updateText();
-}
-
-/*!
-  Sets title of first column (name column)
-  \param label - new title
-*/
-void OB_Browser::setNameTitle( const QString& label )
-{
-  setNameTitle( QIconSet(), label );
-}
-
-/*!
-  Sets title and icon of first column (name column)
-  \param icon - new icon
-  \param label - new title
-*/
-void OB_Browser::setNameTitle( const QIconSet& icon, const QString& label )
-{
-  QListView* lv = listView();
-  if ( !lv )
-    return;
-
-  if ( icon.isNull() )
-    lv->setColumnText( 0, label );
-  else
-    lv->setColumnText( 0, icon, label );
-}
-
-/*!
-  Sets title of column
-  \param id - column id
-  \param label - new column title
 */
-void OB_Browser::setColumnTitle( const int id, const QString& label )
-{
-  setColumnTitle( id, QIconSet(), label );
-}
-
-/*!
-  Sets title and icon of column
-  \param id - column id
-  \param icon - new column icon
-  \param label - new column title
-*/
-void OB_Browser::setColumnTitle( const int id, const QIconSet& icon, const QString& label )
-{
-  QListView* lv = listView();
-  if ( !lv || !myColumnIds.contains( id ) )
-    return;
-
-  if ( icon.isNull() )
-    lv->setColumnText( myColumnIds[id], label );
-  else
-    lv->setColumnText( myColumnIds[id], icon, label );
-}
-
-/*!
-  \return title of first column (name column)
-*/
-QString OB_Browser::nameTitle() const
-{
-  return myView->columnText( 0 );
-}
-
-/*!
-  \return title of first column (name column)
-  \param id - column id
-*/
-QString OB_Browser::columnTitle( const int id ) const
-{
-  QString txt;
-  if ( myColumnIds.contains( id ) )
-    txt = myView->columnText( myColumnIds[id] );
-  return txt;
-}
-
-/*!
-  \return true if column is visible
-  \param id - column id
-*/
-bool OB_Browser::isColumnVisible( const int id ) const
-{
-  return myColumnIds.contains( id ) && myView->isShown( myColumnIds[id] );
-}
-
-/*!
-  Sets visibility of column
-  \param id - column id
-  \param on - new visibility state
-*/
-void OB_Browser::setColumnShown( const int id, const bool on )
-{
-  if ( !myColumnIds.contains( id ) )
-    return;
-
-  myView->setShown( myColumnIds[id], on );
-  if( !on )
-    myView->setColumnWidthMode( myColumnIds[id], QListView::Manual );
-}
-
 /*!
   Sets global width mode
   \param mode - new width mode
 */
+/* TODO: removed
 void OB_Browser::setWidthMode( QListView::WidthMode mode )
 {
   for ( int i = 0, n = myView->columns(); i < n; i++ )
     if( mode!=QListView::Maximum || myView->columnWidth( i )>0 )
       myView->setColumnWidthMode( i, mode );
 }
-
-/*!
-  \return list of columns ids
-*/
-QValueList<int> OB_Browser::columns() const
-{
-  QValueList<int> lst;
-  for ( QMap<int, int>::ConstIterator it = myColumnIds.begin(); it != myColumnIds.end(); ++it )
-    lst.append( it.key() );
-  return lst;
-}
-
-/*!
-  \return true if it is possible to show/hide column by popup
-  \param id - column id
-*/
-bool OB_Browser::appropriateColumn( const int id ) const
-{
-  bool res = false;
-  if ( myColumnIds.contains( id ) )
-    res = myView->appropriate( myColumnIds[id] );
-  return res;
-}
-
-/*!
-  Sets "appropriate state": is it possible to show/hide column by popup
-  \param id - column id
-  \param on - new state
 */
-void OB_Browser::setAppropriateColumn( const int id, const bool on )
-{
-  if ( !myColumnIds.contains( id ) )
-    return;
-
-  myView->setAppropriate( myColumnIds[id], on );
-}
-
 /*!
   Updates tree
   \param obj - start object
   \param autoOpen - to open automatically branches of autoOpenLevel()
   \sa autoOpenLevel()
 */
+/* TODO: removed
 void OB_Browser::updateTree( SUIT_DataObject* obj, const bool autoOpen )
 {
 //  QTime t1 = QTime::currentTime();
@@ -949,10 +563,11 @@ void OB_Browser::updateTree( SUIT_DataObject* obj, const bool autoOpen )
 //  QTime t2 = QTime::currentTime();
 //  qDebug( QString( "update tree time = %1 msecs" ).arg( t1.msecsTo( t2 ) ) );
 }
-
+*/
 /*!
   Replaces part of tree starting at object 'src' by tree starting at object 'trg'
 */
+/* TODO: removed
 void OB_Browser::replaceTree( SUIT_DataObject* src, SUIT_DataObject* trg )
 {
   if ( !src || !trg || src == trg || src->root() != getRootObject() )
@@ -990,146 +605,12 @@ void OB_Browser::replaceTree( SUIT_DataObject* src, SUIT_DataObject* trg )
   if ( selNum != numberOfSelected() )
     emit selectionChanged();
 }
-
-/*!
-  Updates view
-  \param startObj - start object
-*/
-void OB_Browser::updateView( SUIT_DataObject* startObj )
-{
-  QListView* lv = listView();
-  if ( !lv )
-    return;
-
-  if ( !startObj || startObj->root() != getRootObject() )
-    return;
-
-  //qDebug( "updateView:" );
-  //startObj->dump();
-
-  if ( startObj == myRoot )
-  {
-    OB_BrowserSync sync( this );
-    synchronize<ObjPtr,ItemPtr,OB_BrowserSync>( myRoot, 0, sync );
-  }
-  else
-  {
-    OB_BrowserSync sync( this );
-    OB_ListItem* startItem = dynamic_cast<OB_ListItem*>( listViewItem( startObj ) );
-    synchronize<ObjPtr,ItemPtr,OB_BrowserSync>( startObj, startItem, sync );
-  }
-}
-
-/*!
-  Creates new list item
-  \return new item
-  \param o - corresponding SUIT object
-  \param parent - parent item
-  \param after - item after that new item must be added
-  \param prepend - new item must be added as first
-*/
-QListViewItem* OB_Browser::createItem( const SUIT_DataObject* o, QListViewItem* parent,
-                                      QListViewItem* after, const bool prepend )
-{
-  QListView* lv = listView();
-
-  if ( !lv || !o )
-    return 0;
-
-  QListViewItem* item = 0;
-  SUIT_DataObject* obj = (SUIT_DataObject*)o;
-
-  int type = -1;
-
-  switch ( obj->checkType() )
-  {
-  case SUIT_DataObject::CheckBox:
-    type = QCheckListItem::CheckBox;
-    break;
-  case SUIT_DataObject::RadioButton:
-    type = QCheckListItem::RadioButton;
-    break;
-  }
-
-  if ( parent )
-  {
-    if ( after ) 
-    {
-      if ( type == -1 )
-       item = new OB_ListItem( obj, parent, after );
-      else
-       item = new OB_CheckListItem( obj, parent, after, (QCheckListItem::Type)type );
-    }
-    else if ( prepend )
-    {
-      if ( type == -1 )
-       item = new OB_ListItem( obj, parent );
-      else
-       item = new OB_CheckListItem( obj, parent,  (QCheckListItem::Type)type );
-    }
-    else // append
-    {
-      after = parent->firstChild();
-      while ( after && after->nextSibling() )
-       after = after->nextSibling();
-      if ( type == -1 )
-       item = new OB_ListItem( obj, parent, after );
-      else
-       item = new OB_CheckListItem( obj, parent, after, (QCheckListItem::Type)type );
-    }
-  }
-  else
-  {
-    if ( after ) 
-    {
-      if ( type == -1 )
-       item = new OB_ListItem( obj, lv, after );
-      else
-       item = new OB_CheckListItem( obj, lv, after, (QCheckListItem::Type)type );
-    }
-    else if ( prepend )
-    {
-      if ( type == -1 )
-       item = new OB_ListItem( obj, lv );
-      else
-       item = new OB_CheckListItem( obj, lv,  (QCheckListItem::Type)type );
-    }
-    else // append
-    {
-      after = lv->firstChild();
-      while ( after && after->nextSibling() )
-       after = after->nextSibling();
-      if ( type == -1 )
-       item = new OB_ListItem( obj, lv, after );
-      else
-       item = new OB_CheckListItem( obj, lv, after, (QCheckListItem::Type)type );
-    }
-  }
-
-  myItems.insert( obj, item );
-  obj->connect( this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
-  updateText( item );
-
-  return item;
-}
-
-/*!
-  Adjusts width by root item
 */
-void OB_Browser::adjustWidth()
-{
-  if ( !listView() )
-    return;
-
-  listView()->setColumnWidth( 0, 0 );
-  if ( listView()->firstChild() )
-    adjustWidth( listView()->firstChild() );
-}
-
 /*!
   Adjusts width by item
   \param item
 */
+/*
 void OB_Browser::adjustWidth( QListViewItem* item )
 {
   while ( item )
@@ -1140,48 +621,12 @@ void OB_Browser::adjustWidth( QListViewItem* item )
     item = item->nextSibling();
   }
 }
-
-/*!
-  \return SUIT object corresponding to item
-  \param item
 */
-SUIT_DataObject* OB_Browser::dataObject( const QListViewItem* item ) const
-{
-  SUIT_DataObject* obj = 0;
-
-  if ( item && item->rtti() == OB_ListItem::RTTI() )
-    obj = ((OB_ListItem*)item)->dataObject();
-  else if ( item && item->rtti() == OB_CheckListItem::RTTI() )
-    obj = ((OB_CheckListItem*)item)->dataObject();
-
-  return obj;
-}
-
-/*!
-  \return item corresponding to SUIT object
-  \param obj - SUIT object
-*/
-QListViewItem* OB_Browser::listViewItem( const SUIT_DataObject* obj ) const
-{
-  QListViewItem* item = 0;
-
-  if ( myItems.contains( (SUIT_DataObject*)obj ) )
-    item = myItems[(SUIT_DataObject*)obj];
-
-  return item;
-}
-
-/*!
-  \return list view of object browser
-*/
-QListView* OB_Browser::listView() const
-{
-  return myView;
-}
 
 /*!
   \remove all items referencing current (through data objects)
 */
+/* TODO:
 void OB_Browser::removeReferences( QListViewItem* item )
 {
   if ( !item )
@@ -1198,10 +643,11 @@ void OB_Browser::removeReferences( QListViewItem* item )
     i = i->nextSibling();
   }
 }
-
+*/
 /*!
   Connects all children to SLOT onDestroyed
 */
+/* TODO: move to SUIT_TreeModel
 void OB_Browser::createConnections( SUIT_DataObject* obj )
 {
   if ( !obj )
@@ -1215,10 +661,11 @@ void OB_Browser::createConnections( SUIT_DataObject* obj )
   for ( DataObjectListIterator it( childList ); it.current(); ++it )
     it.current()->connect( this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
 }
-
+*/
 /*!
   Disconnects all children from SLOT onDestroyed
 */
+/* TODO: move to SUIT_TreeModel
 void OB_Browser::removeConnections( SUIT_DataObject* obj )
 {
   if ( !obj )
@@ -1232,7 +679,7 @@ void OB_Browser::removeConnections( SUIT_DataObject* obj )
   for ( DataObjectListIterator it( childList ); it.current(); ++it )
     it.current()->disconnect( this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
 }
-
+*/
 /*!
   Stores states (opened, selected) of current tree items
   \return current item
@@ -1240,6 +687,7 @@ void OB_Browser::removeConnections( SUIT_DataObject* obj )
   \param openObjs, openKeys - maps of opened objects
   \param curKey - map of current objects
 */
+/* TODO: to be revised
 SUIT_DataObject* OB_Browser::storeState( DataObjectMap& selObjs, DataObjectMap& openObjs,
                                          DataObjectKeyMap& selKeys, DataObjectKeyMap& openKeys,
                                          DataObjectKey& curKey ) const
@@ -1268,13 +716,14 @@ SUIT_DataObject* OB_Browser::storeState( DataObjectMap& selObjs, DataObjectMap&
 
   return curObj;
 }
-
+*/
 /*!
   Restores states (opened, selected) of current tree items
   \param selObjs, selKeys - maps of selected objects
   \param openObjs, openKeys - maps of opened objects
   \param curKey - map of current objects
 */
+/* TODO: to be revised
 void OB_Browser::restoreState( const DataObjectMap& selObjs, const DataObjectMap& openObjs,
                                const SUIT_DataObject* curObj, const DataObjectKeyMap& selKeys,
                                const DataObjectKeyMap& openKeys, const DataObjectKey& curKey )
@@ -1310,7 +759,7 @@ void OB_Browser::restoreState( const DataObjectMap& selObjs, const DataObjectMap
       bool parentOpen = true;
       if( item && item->parent() )
        parentOpen = item->parent()->isOpen();
-       
+
       if ( openObjs[obj] && parentOpen )
         lv->setOpen( item, true );
     }
@@ -1333,18 +782,20 @@ void OB_Browser::restoreState( const DataObjectMap& selObjs, const DataObjectMap
 
   lv->blockSignals( block );
 }
-
+*/
 /*!
   Creates object key by tree item
 */
+/* TODO: move to SUIT_TreeModel
 OB_Browser::DataObjectKey OB_Browser::objectKey( QListViewItem* i ) const
 {
   return objectKey( dataObject( i ) );
 }
-
+*/
 /*!
   Creates object key by SUIT object
 */
+/* TODO: move to SUIT_TreeModel
 OB_Browser::DataObjectKey OB_Browser::objectKey( SUIT_DataObject* obj ) const
 {
   if ( !obj )
@@ -1352,51 +803,99 @@ OB_Browser::DataObjectKey OB_Browser::objectKey( SUIT_DataObject* obj ) const
 
   return DataObjectKey( obj->key() );
 }
+*/
+
+/*!
+  \brief Get tree view widget.
+  \return tree view widget of the object browser
+*/
+QtxTreeView* OB_Browser::treeView() const
+{
+  return myView;
+}
 
 /*!
-  Custom key press event handler, updates tree by F5
+  \brief Process context menu request event.
+  \param e context menu event
 */
-void OB_Browser::keyPressEvent( QKeyEvent* e )
+void OB_Browser::contextMenuEvent( QContextMenuEvent* e )
 {
-  if ( e->key() == Qt::Key_F5 )
-    updateTree( 0, false );
+  QMenu* popup = new QMenu();
+  
+  createPopupMenu( popup );
+
+  Qtx::simplifySeparators( popup );
 
-  QFrame::keyPressEvent( e );
+  if ( !popup->actions().isEmpty() )
+    popup->exec( e->globalPos() );
+  delete popup;
+}
+
+/*!
+  \brief Get the time of the latest updating.
+  \return latest updating time
+*/
+unsigned long OB_Browser::getModifiedTime() const
+{ 
+  return myModifiedTime; 
+}
+
+/*!
+  \brief Update the time of the latest updating.
+*/
+void OB_Browser::setModified()
+{
+  myModifiedTime = clock();
 }
 
 /*!
-  SLOT: called if action "Expand all" is activated
+  \brief Called when "Expand all" popup menu command is activated.
+  
+  Expands all selected items recursively.
 */
-void OB_Browser::onExpand()
+void OB_Browser::onExpandAll()
 {
-  DataObjectList selected;
-  getSelected( selected );
-  for ( DataObjectListIterator itr( selected ); itr.current(); ++itr )
-    expand( listViewItem( itr.current() ) );
+  QModelIndexList indexes = selectedIndexes();
+  QModelIndex index;
+
+  foreach ( index, indexes ) {
+    myView->expandAll( index );
+  }
 }
 
 /*!
-  SLOT: called if action "Show/hide column" is activated by popup
+  \brief Called when "Collapse all" popup menu command is activated.
+  
+  Collapse all selected items recursively.
 */
-void OB_Browser::onColumnVisible( int id )
+void OB_Browser::onCollapseAll()
 {
-  setColumnShown( id, !isColumnVisible( id ) );
+  QModelIndexList indexes = selectedIndexes();
+  QModelIndex index;
+
+  foreach ( index, indexes ) {
+    myView->collapseAll( index );
+  }
 }
 
 /*!
   SLOT: called if SUIT object is destroyed
 */
+/* TODO: moved to SUIT_TreeModel
 void OB_Browser::onDestroyed( SUIT_DataObject* obj )
 {
   removeObject( obj );
 }
-
+*/
 /*!
   SLOT: called on finish of drag-n-drop operation
   \param items - dragged items
   \param item - destination (item on that they were dropped)
   \param action - QDropEvent::Action
 */
+  // TODO: drag-n-drop works differently - SUIT_TreeModel to be updated
+  // and QTreeView needs some setup
+/*
 void OB_Browser::onDropped( QPtrList<QListViewItem> items, QListViewItem* item, int action )
 {
   SUIT_DataObject* obj = dataObject( item );
@@ -1414,10 +913,11 @@ void OB_Browser::onDropped( QPtrList<QListViewItem> items, QListViewItem* item,
   if ( !lst.isEmpty() )
     emit dropped( lst, obj, action );
 }
-
+*/
 /*!
   Updates texts of items
 */
+/* TODO: to be removed
 void OB_Browser::updateText()
 {
   if ( myColumnIds.isEmpty() )
@@ -1437,11 +937,12 @@ void OB_Browser::updateText()
       it.current()->setText( itr.data(), obj->text( itr.key() ) );
   }
 }
-
+*/
 /*!
   \return true if item must be updated
   \param item - item to be checked
 */
+/* TODO: to be revised
 bool OB_Browser::needToUpdateTexts( QListViewItem* item ) const
 {
   SUIT_DataObject* obj = dataObject( item );
@@ -1453,11 +954,12 @@ bool OB_Browser::needToUpdateTexts( QListViewItem* item ) const
       return true;
   return false;
 }
-
+*/
 /*!
   Updates texts of item
   \param item - item to be updated
 */
+/* TODO: to be revised
 void OB_Browser::updateText( QListViewItem* item )
 {
   SUIT_DataObject* obj = dataObject( item );
@@ -1467,78 +969,46 @@ void OB_Browser::updateText( QListViewItem* item )
   for( QMap<int, int>::iterator it = myColumnIds.begin(); it != myColumnIds.end(); ++it )
     item->setText( it.data(), obj->text( it.key() ) );
 }
-
-/*!
-  Custom event filter
 */
-bool OB_Browser::eventFilter( QObject* o, QEvent* e )
-{
-  if ( o == myView && e->type() == QEvent::ContextMenu )
-  {
-    QContextMenuEvent* ce = (QContextMenuEvent*)e;
-    if ( ce->reason() != QContextMenuEvent::Mouse )
-      contextMenuRequest( ce );
-    return true;
-  }
-  if ( o == myView->viewport() && e->type() == QEvent::MouseButtonRelease )
-  {
-    QMouseEvent* me = (QMouseEvent*)e;
-    if ( me->button() == RightButton )
-    {
-      QContextMenuEvent ce( QContextMenuEvent::Mouse, me->pos(), me->globalPos(), me->state() );
-      contextMenuRequest( &ce );
-      return true;
-    }
-  }
-
-  return QFrame::eventFilter( o, e );
-}
 
 /*!
-  Adds custom actions to popup
-  \param menu popup menu
+  \brief Add custom actions to the popup menu.
+  \param menu popup menu
 */
-void OB_Browser::contextMenuPopup( QPopupMenu* menu )
+void OB_Browser::createPopupMenu( QMenu* menu )
 {
-/*  QValueList<int> cols;
-  for ( QMap<int, int>::ConstIterator it = myColumnIds.begin(); it != myColumnIds.end(); ++it )
-  {
-    if ( appropriateColumn( it.key() ) )
-      cols.append( it.key() );
-  }
+  menu->addSeparator();
 
-  uint num = menu->count();
-  menu->setCheckable( true );
-  for ( QValueList<int>::const_iterator iter = cols.begin(); iter != cols.end(); ++iter )
-  {
-    QString name = columnTitle( *iter );
-    if ( name.isEmpty() )
-      continue;
+  QModelIndexList indexes = selectedIndexes();
 
-    int id = menu->insertItem( name, this, SLOT( onColumnVisible( int ) ) );
-    menu->setItemChecked( id, isColumnVisible( *iter ) );
-    menu->setItemParameter( id, *iter );
+  bool closed = false, opened = false;
+  
+  for ( QModelIndexList::Iterator it = indexes.begin(); 
+       it != indexes.end() && !closed; ++it ) {
+    closed = hasCollased( *it );
   }
-  if ( menu->count() != num )
-    menu->insertSeparator();*/
 
-  DataObjectList selected;
-  getSelected( selected );
-
-  bool closed = false;
-  for ( DataObjectListIterator itr( selected ); itr.current() && !closed; ++itr )
-    closed = hasClosed( listViewItem( itr.current() ) );
+  for ( QModelIndexList::Iterator it = indexes.begin(); 
+       it != indexes.end() && !opened; ++it ) {
+    opened = hasExpanded( *it );
+  }
 
   if ( closed )
-  {
-    menu->insertItem( tr( "MEN_EXPAND_ALL" ), this, SLOT( onExpand() ) );
-    menu->insertSeparator();
+    menu->addAction( tr( "MEN_EXPAND_ALL" ), this, SLOT( onExpandAll() ) );
+  if ( opened )
+    menu->addAction( tr( "MEN_COLLAPSE_ALL" ), this, SLOT( onCollapseAll() ) );
+
+  if ( isSearchToolEnabled() ) {
+    menu->addSeparator();
+    menu->addAction( tr( "MEN_FIND" ), searchTool(), SLOT( find() ), QKeySequence(Qt::CTRL + Qt::Key_F) );
+    menu->addSeparator();
   }
 }
 
 /*!
   Expands item with all it's children
 */
+/* TODO: to be revised
 void OB_Browser::expand( QListViewItem* item )
 {
   if ( !item )
@@ -1548,23 +1018,49 @@ void OB_Browser::expand( QListViewItem* item )
   for ( QListViewItem* child = item->firstChild(); child; child = child->nextSibling() )
     expand( child );
 }
-
+*/
 /*!
-  \return true if item or one of it's children isn't opened
+  \brief Check if model index is collapsed or has collapsed children.
+  \return \c true if item or one of its children is collapsed
 */
-bool OB_Browser::hasClosed( QListViewItem* item ) const
+bool OB_Browser::hasCollased( const QModelIndex& index ) const
 {
-  if ( !item )
-    return false;
+  bool result = false;
 
-  if ( item->childCount() && !item->isOpen() )
-    return true;
+  if ( index.isValid() && model() ) {
+    bool hasChildren = model()->hasChildren( index );
+    result = hasChildren && !myView->isExpanded( index );
+    if ( !result && hasChildren ) {
+      int rows = model()->rowCount( index );
+      for ( int i = 0; i < rows && !result; i ++ ) {
+       QModelIndex child = model()->index( i, 0, index );
+       result = hasCollased( child );
+      }
+    }
+  }
+  return result;
+}
 
-  bool has = false;
-  for ( QListViewItem* child = item->firstChild(); child && !has; child = child->nextSibling() )
-    has = hasClosed( child );
+/*!
+  \brief Check if model index is expanded or has expanded children.
+  \return \c true if item or one of its children is expanded
+*/
+bool OB_Browser::hasExpanded( const QModelIndex& index ) const
+{
+  bool result = false;
 
-  return has;
+  if ( index.isValid() && model() ) {
+    bool hasChildren = model()->hasChildren( index );
+    result = hasChildren && myView->isExpanded( index );
+    if ( !result && hasChildren ) {
+      int rows = model()->rowCount( index );
+      for ( int i = 0; i < rows && !result; i ++ ) {
+       QModelIndex child = model()->index( i, 0, index );
+       result = hasExpanded( child );
+      }
+    }
+  }
+  return result;
 }
 
 /*!
@@ -1572,6 +1068,7 @@ bool OB_Browser::hasClosed( QListViewItem* item ) const
   \param obj - SUIT object to be removed
   \param autoUpd - auto tree updating
 */
+/* TODO: moved to SUIT_TreeModel
 void OB_Browser::removeObject( SUIT_DataObject* obj, const bool autoUpd )
 {
   if ( !obj )
@@ -1611,21 +1108,23 @@ void OB_Browser::removeObject( SUIT_DataObject* obj, const bool autoUpd )
 
   delete item;
 }
-
+*/
 /*!
   Opens branches from 1 to autoOpenLevel()
   \sa autoOpenLevel()
 */
+/* TODO: to be revised
 void OB_Browser::autoOpenBranches()
 {
   openLevels();
 }
-
+*/
 /*!
   Opens branch
   \param item
   \param level
 */
+/* TODO: to be revised
 void OB_Browser::openBranch( QListViewItem* item, const int level )
 {
   if ( level < 1 )
@@ -1638,35 +1137,19 @@ void OB_Browser::openBranch( QListViewItem* item, const int level )
     item = item->nextSibling();
   }
 }
-
+*/
 /*!
   SLOT: called on double click on item, emits signal
 */
+/* TODO: to be revised
 void OB_Browser::onDoubleClicked( QListViewItem* item )
 {
   if ( item )
     emit doubleClicked( dataObject( item ) );
 }
+*/
 
 /*!
-  Stores time of last modification
+  \fn void OB_Browser::selectionChanged();
+  \brief Emitted when selection is changed in the Object Browser.
 */
-void OB_Browser::setModified()
-{
-  myModifiedTime = clock();
-}
-
-OB_ObjSearch* OB_Browser::getSearch() const
-{
-  return myFindDlg->getSearch();
-}
-
-void OB_Browser::setSearch( OB_ObjSearch* s )
-{
-  myFindDlg->setSearch( s );
-}
-
-void OB_Browser::enableSearch( const bool on )
-{
-  myFindDlg->setShown( on );
-}
index e7524fb688ecfea314009c2bc5e2543ab66085a9..378900ce8cb1c2f7ded6bf58e9935300da4d674b 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : OB_Browser.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #ifndef OB_BROWSER_H
 #define OB_BROWSER_H
 
 #include "OB.h"
 
-#include <qframe.h>
+#include <QWidget>
+#include <QMap>
+#include <QModelIndex>
+#include <QItemSelection>
 
-#include <qmap.h>
-#include <qlistview.h>
-
-#include <SUIT_DataObject.h>
-#include <SUIT_DataObjectKey.h>
-#include <SUIT_PopupClient.h>
-
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
+class QAbstractItemModel;
+class QAbstractItemDelegate;
 class QToolTip;
-class OB_Filter;
-class OB_ListView;
-class OB_ListItem;
-class OB_ObjSearch;
-class OB_FindDlg;
-
-class OB_Updater 
-{
-public:
-  OB_Updater(){};
-  virtual ~OB_Updater(){};
-  virtual void update( SUIT_DataObject* theObj, OB_ListItem* theLI ) = 0;
-};
+class QMenu;
+class QtxTreeView;
+class QtxSearchTool;
 
-/*!
-  \class OB_Browser
-  Represents object browser. Allows to get/set selection, 
-  to drag-n-drop of objects, to determine item by SUIT object and 
-  vice versa
-*/
-class OB_EXPORT OB_Browser : public QFrame, public SUIT_PopupClient
+class OB_EXPORT OB_Browser : public QWidget
 {
-       Q_OBJECT
+  Q_OBJECT
 
-  class ToolTip;
+  // TODO: commented - to be removed or revised
+  //class ToolTip;
 
 public:
-  OB_Browser( QWidget* = 0, SUIT_DataObject* theRoot = 0 );
+  OB_Browser( QWidget* = 0, QAbstractItemModel* = 0 );
   virtual ~OB_Browser();
 
-  virtual QString   popupClientType() const { return QString( "ObjectBrowser" ); }
-
-  SUIT_DataObject*  getRootObject() const;
-  virtual void      setRootObject( SUIT_DataObject* theRoot = 0 );
-
-  int               numberOfSelected() const;
-
-  DataObjectList    getSelected() const;
-  void              getSelected( DataObjectList& ) const;
-
-  virtual void      setSelected( const SUIT_DataObject* theObject, const bool = false );
-  virtual void      setSelected( const DataObjectList& theObjLst, const bool = false );
+  QAbstractItemModel*    model() const;
+  void                   setModel( QAbstractItemModel* );
 
-  bool              isOpen( SUIT_DataObject* theObject ) const;
-  virtual void      setOpen( SUIT_DataObject* theObject, const bool theOpen = true );
+  QAbstractItemDelegate* itemDelegate() const;
+  void                   setItemDelegate( QAbstractItemDelegate* );
 
-  bool              isAutoUpdate() const;
-  virtual void      setAutoUpdate( const bool );
+  bool                   rootIsDecorated() const;
+  void                   setRootIsDecorated( const bool );
 
-  bool              isAutoDeleteObjects() const;
-  virtual void      setAutoDeleteObjects( const bool );
+  bool                   sortMenuEnabled() const;
+  void                   setSortMenuEnabled( const bool );
 
-  virtual void      updateTree( SUIT_DataObject* = 0, const bool = false );
-  virtual void      replaceTree( SUIT_DataObject*, SUIT_DataObject* );
-
-  bool              isShowToolTips();
-  void              setShowToolTips( const bool theDisplay );
-
-  void              adjustWidth();
-
-  SUIT_DataObject*  dataObjectAt( const QPoint& ) const;
-
-  OB_Filter*        filter() const;
-  void              setFilter( OB_Filter* );
-
-  bool              rootIsDecorated() const;
-  void              setRootIsDecorated( const bool );
-
-  int               autoOpenLevel() const;
-  void              setAutoOpenLevel( const int );
-  void              openLevels( const int = -1 );
-
-  virtual int       addColumn( const QString&, const int id = -1, const int width = -1 );
-  virtual int       addColumn( const QIconSet&, const QString&, const int id = -1, const int width = -1 );
-  virtual void      removeColumn( const int id );
-
-  void              setNameTitle( const QString& );
-  virtual void      setNameTitle( const QIconSet&, const QString& );
-  void              setColumnTitle( const int id, const QString& );
-  virtual void      setColumnTitle( const int id, const QIconSet&, const QString& );
+  QtxSearchTool*         searchTool() const;
+  bool                   isSearchToolEnabled() const;
+  void                   setSearchToolEnabled( const bool );
+  
+  int                    autoOpenLevel() const;
+  void                   setAutoOpenLevel( const int );
+  void                   openLevels( const int = -1 );
 
-  QString           nameTitle() const;
-  QString           columnTitle( const int ) const;
+  //bool                 isShowToolTips();
+  //void                 setShowToolTips( const bool theDisplay );
 
-  bool              isColumnVisible( const int ) const;
-  virtual void      setColumnShown( const int, const bool );
+  int                    numberOfSelected() const;
+  QModelIndexList        selectedIndexes() const;
+  const QItemSelection   selection() const;
 
-  virtual void      setWidthMode( QListView::WidthMode );
+  virtual void           select( const QModelIndex&, const bool, const bool = true );
+  virtual void           select( const QModelIndexList&, const bool, const bool = true );
 
-  QValueList<int>   columns() const;
+  bool                   isOpen( const QModelIndex& ) const;
+  virtual void           setOpen( const QModelIndex& theObject, const bool theOpen = true );
 
-  bool              appropriateColumn( const int ) const;
-  virtual void      setAppropriateColumn( const int, const bool );
+  void                   adjustWidth();
+  void                   adjustFirstColumnWidth();
+  void                   adjustColumnsWidth();
 
-  virtual bool      eventFilter(QObject* watched, QEvent* e);
+  // san - To be revised or removed
+  // QTreeView::indexAt() should be used
+  //SUIT_DataObject*  dataObjectAt( const QPoint& ) const;
 
-  QListView*        listView() const;
+  // san - Removed
+  //OB_Filter*          filter() const;
+  //void                setFilter( OB_Filter* );
 
-  virtual void      contextMenuPopup( QPopupMenu* );
+  // TODO: QTreeView::resizeColumnToContents() can be used instead
+  //virtual void      setWidthMode( QListView::WidthMode );
 
-  void              setModified();
-  unsigned long     getModifiedTime() { return myModifiedTime; }
+  unsigned long          getModifiedTime() const;
+  void                   setModified();
   
-  OB_Updater*       getUpdater() const;
-  virtual void      setUpdater( OB_Updater* theUpdate = 0 );
+  // san - moved to SUIT_TreeModel
+  //OB_Updater*       getUpdater() const;
+  //virtual void      setUpdater( OB_Updater* theUpdate = 0 );
 
-  OB_ObjSearch*     getSearch() const;
-  void              setSearch( OB_ObjSearch* );
-  void              enableSearch( const bool );
+  QtxTreeView*           treeView() const;
 
 signals:
-  void              selectionChanged();
-  void              doubleClicked( SUIT_DataObject* );
-  void              dropped( DataObjectList, SUIT_DataObject*, int );
+  void                   selectionChanged();
+  //void                   doubleClicked( SUIT_DataObject* );
+  //void                   dropped( DataObjectList, SUIT_DataObject*, int );
 
 private slots:
-  void              onExpand();
-  void              onColumnVisible( int );
-  void              onDestroyed( SUIT_DataObject* );
-  void              onDoubleClicked ( QListViewItem* );
-  void              onDropped( QPtrList<QListViewItem>, QListViewItem*, int );
-
+  void                   onExpandAll();
+  void                   onCollapseAll();
+  //void              onDestroyed( SUIT_DataObject* );
+  //void              onDoubleClicked ( QListViewItem* );
+  //void              onDropped( QPtrList<QListViewItem>, QListViewItem*, int );
+  
 protected:
-  void              adjustWidth( QListViewItem* );
-  virtual void      updateView( SUIT_DataObject* = 0 );
-  virtual void      updateText();
-
-  virtual void      keyPressEvent( QKeyEvent* );
+  //void              adjustWidth( QListViewItem* );
+  //virtual void      updateText();
 
-  SUIT_DataObject*  dataObject( const QListViewItem* ) const;
-  QListViewItem*    listViewItem( const SUIT_DataObject* ) const;
+  virtual void           contextMenuEvent( QContextMenuEvent* );
+  virtual void           createPopupMenu( QMenu* );
 
 private:
-  typedef QMap<SUIT_DataObject*, QListViewItem*> ItemMap;
-  typedef SUIT_DataObjectKeyHandle               DataObjectKey;
-  typedef QMap<SUIT_DataObject*, int>            DataObjectMap;
-  typedef QMap<DataObjectKey, int>               DataObjectKeyMap;
+  //typedef QMap<SUIT_DataObject*, QListViewItem*> ItemMap;
+  //typedef SUIT_DataObjectKeyHandle               DataObjectKey;
+  //typedef QMap<SUIT_DataObject*, int>            DataObjectMap;
+  //typedef QMap<DataObjectKey, int>               DataObjectKeyMap;
 
 private:
-  void              expand( QListViewItem* );
-  bool              hasClosed( QListViewItem* ) const;
+  bool                   hasCollased( const QModelIndex& ) const;
+  bool                   hasExpanded( const QModelIndex& ) const;
 
-  void              autoOpenBranches();
-  void              openBranch( QListViewItem*, const int );
+  //void              autoOpenBranches();
+  //void              openBranch( QListViewItem*, const int );
 
-  void              removeReferences( QListViewItem* );
-  void              removeConnections( SUIT_DataObject* );
-  void              createConnections( SUIT_DataObject* );
-  void              removeObject( SUIT_DataObject*, const bool = true );
+  //void              removeReferences( QListViewItem* );
+  //void              removeConnections( SUIT_DataObject* );
+  //void              createConnections( SUIT_DataObject* );
+  //void              removeObject( SUIT_DataObject*, const bool = true );
 
-  void              updateText( QListViewItem* );
-  bool              needToUpdateTexts( QListViewItem* ) const;
+  //void              updateText( QListViewItem* );
+  //bool              needToUpdateTexts( QListViewItem* ) const;
 
-  DataObjectKey     objectKey( QListViewItem* ) const;
-  DataObjectKey     objectKey( SUIT_DataObject* ) const;
+  //DataObjectKey     objectKey( QListViewItem* ) const;
+  //DataObjectKey     objectKey( SUIT_DataObject* ) const;
 
-  QListViewItem*    createTree( const SUIT_DataObject*, QListViewItem*, QListViewItem* = 0, const bool = false );
-  QListViewItem*    createItem( const SUIT_DataObject*, QListViewItem*, QListViewItem* = 0, const bool = false );
+  //QListViewItem*    createTree( const SUIT_DataObject*, QListViewItem*, QListViewItem* = 0, const bool = false );
+  //QListViewItem*    createItem( const SUIT_DataObject*, QListViewItem*, QListViewItem* = 0, const bool = false );
 
-  SUIT_DataObject*  storeState( DataObjectMap&, DataObjectMap&,
-                                DataObjectKeyMap&, DataObjectKeyMap&, DataObjectKey& ) const;
-  void              restoreState( const DataObjectMap&, const DataObjectMap&, const SUIT_DataObject*,
-                                  const DataObjectKeyMap&, const DataObjectKeyMap&, const DataObjectKey& );
+  //SUIT_DataObject*  storeState( DataObjectMap&, DataObjectMap&,
+  //                              DataObjectKeyMap&, DataObjectKeyMap&, DataObjectKey& ) const;
+  //void              restoreState( const DataObjectMap&, const DataObjectMap&, const SUIT_DataObject*,
+  //                                const DataObjectKeyMap&, const DataObjectKeyMap&, const DataObjectKey& );
 
 private:
-  friend class OB_BrowserSync;
-
-  OB_ListView*      myView;
-  SUIT_DataObject*  myRoot;
-  ItemMap           myItems;
-  QToolTip*         myTooltip;
-  OB_Updater*       myUpdater;
-  QMap<int, int>    myColumnIds;
-  bool              myAutoUpdate;
-  bool              myAutoDelObjs;
-  bool              myShowToolTips;
-  bool              myRootDecorated;
-  int               myAutoOpenLevel;
-  OB_FindDlg       *myFindDlg;
-
-  friend class OB_Browser::ToolTip;
-
-  unsigned long     myModifiedTime;
+  QtxTreeView*           myView;
+  QtxSearchTool*         mySearchTool;
+  // TODO: decide what to do with tooltip
+  //QToolTip*           myTooltip;
+  //QMap<int, int>      myColumnIds;
+  // TODO: decide what to do with tooltip
+  //bool                myShowToolTips;
+  int                    myAutoOpenLevel;
+  unsigned long          myModifiedTime;
+
+  // TODO: decide what to do with tooltip
+  //friend class OB_Browser::ToolTip;
 };
 
-#endif
+#endif  // OB_BROWSER_H
index 99b0e3049bf098afde58fc07149836f70f2ea80e..edc1816af93e25d38d39741aee26615966497d39 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "OB_Filter.h"
 
index a75698d9669e77ff11eeb0b6590ee9ad5a6b2bbb..ee10e8fdb73ebc941ea656af8702945971ce483b 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef OB_FILTER_H
 #define OB_FILTER_H
diff --git a/src/ObjBrowser/OB_FindDlg.cxx b/src/ObjBrowser/OB_FindDlg.cxx
deleted file mode 100644 (file)
index 07ed30d..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-
-#include <OB_FindDlg.h>
-#include <OB_ObjSearch.h>
-#include <OB_Browser.h>
-#include <OB_ListItem.h>
-
-#include <SUIT_DataObject.h>
-#include <SUIT_MessageBox.h>
-
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qcheckbox.h>
-
-OB_FindDlg::OB_FindDlg( QWidget* parent )
-: QGroupBox( 1, Qt::Horizontal, tr( "FIND" ), parent ),
-  mySearch( 0 )
-{
-  QFrame *btns = new QFrame( this ), *checks = new QFrame( this );
-  
-  myData = new QLineEdit( btns );
-  myToFirst = new QPushButton( "|<<", btns );
-  myToLast = new QPushButton( ">>|", btns );
-  myNext = new QPushButton( ">>", btns );
-  myPrev = new QPushButton( "<<", btns );
-  myClose = new QPushButton( tr( "CLOSE" ), checks );
-  myIsCaseSens = new QCheckBox( tr( "CASE_SENSITIVE" ), checks );
-  myIsRegExp = new QCheckBox( tr( "IS_REG_EXP" ), checks );
-  int w = 30, h = myToFirst->height();
-  myToFirst->setMaximumSize( w, h );
-  myToLast->setMaximumSize( w, h );
-  myNext->setMaximumSize( w, h );
-  myPrev->setMaximumSize( w, h );
-
-  QHBoxLayout* l = new QHBoxLayout( btns, 5, 5 );
-  l->addWidget( myToFirst, 0 );
-  l->addWidget( myPrev, 0 );
-  l->addWidget( myData, 1 );
-  l->addWidget( myNext, 0 );
-  l->addWidget( myToLast, 0 );
-
-  QHBoxLayout* c = new QHBoxLayout( checks, 5, 5 );
-  c->addWidget( myIsCaseSens, 0 );
-  c->addWidget( myIsRegExp, 0 );
-  c->addWidget( myClose, 0 );
-
-  connect( myToFirst, SIGNAL( clicked() ), this, SLOT( onFind() ) );
-  connect( myToLast, SIGNAL( clicked() ), this, SLOT( onFind() ) );
-  connect( myNext, SIGNAL( clicked() ), this, SLOT( onFind() ) );
-  connect( myPrev, SIGNAL( clicked() ), this, SLOT( onFind() ) );
-  connect( myClose, SIGNAL( clicked() ), this, SLOT( onClose() ) );
-}
-
-OB_FindDlg::~OB_FindDlg()
-{
-}
-
-void OB_FindDlg::onClose()
-{
-  hide();
-}
-
-void OB_FindDlg::onFind()
-{
-  OB_ListItem* it = 0;
-  mySearch->setPattern( myData->text(), myIsRegExp->isChecked(), myIsCaseSens->isChecked() );
-  if( sender()==myToFirst )
-    it = mySearch->findFirst();
-  else if( sender()==myNext )
-    it = mySearch->findNext();
-  else if( sender()==myPrev )
-    it = mySearch->findPrev();
-  else if( sender()==myToLast )
-    it = mySearch->findLast();
-  if( it )
-  {
-    mySearch->browser()->setSelected( it->dataObject(), false );
-    mySearch->browser()->listView()->ensureItemVisible( it );
-  }
-  else
-    SUIT_MessageBox::info1( this, tr( "FIND" ), tr( "NOT_FOUND" ), tr( "OK" ) );
-}
-
-OB_ObjSearch* OB_FindDlg::getSearch() const
-{
-  return mySearch;
-}
-
-void OB_FindDlg::setSearch( OB_ObjSearch* s )
-{
-  mySearch = s;
-}
diff --git a/src/ObjBrowser/OB_FindDlg.h b/src/ObjBrowser/OB_FindDlg.h
deleted file mode 100644 (file)
index 4c8230d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-
-#ifndef OBJECT_BROWSER_FIND_DIALOG_HEADER
-#define OBJECT_BROWSER_FIND_DIALOG_HEADER
-
-#include <qgroupbox.h>
-
-class OB_ObjSearch;
-class QLineEdit;
-class QPushButton;
-class QCheckBox;
-
-class OB_FindDlg : public QGroupBox
-{
-  Q_OBJECT
-
-public:
-  OB_FindDlg( QWidget* = 0 );
-  virtual ~OB_FindDlg();
-
-  OB_ObjSearch* getSearch() const;
-  void setSearch( OB_ObjSearch* );
-
-private slots:
-  void onFind();
-  void onClose();
-
-private:
-  QLineEdit* myData;
-  QPushButton *myToFirst, *myToLast, *myNext, *myPrev, *myClose;
-  QCheckBox *myIsCaseSens, *myIsRegExp;
-  OB_ObjSearch* mySearch;
-};
-
-#endif
diff --git a/src/ObjBrowser/OB_ListItem.cxx b/src/ObjBrowser/OB_ListItem.cxx
deleted file mode 100755 (executable)
index f5fb6cb..0000000
+++ /dev/null
@@ -1,393 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "OB_ListItem.h"
-
-#include "OB_ListView.h"
-
-#include <SUIT_DataObject.h>
-
-#include <qpainter.h>
-#include <qwmatrix.h>
-
-#include <iostream>
-using namespace std;
-
-#ifdef WNT
-#define min(a, b)  (((a) < (b)) ? (a) : (b))
-#endif
-
-/*!
-  Constructor
-*/
-template<class T>
-ListItemF<T>::ListItemF( T* theT, SUIT_DataObject* obj ) :
-myT( theT ),
-myObject( obj )
-{
-}
-
-/*!
-  Paints item
-*/
-template<class T>
-void ListItemF<T>::paintC( QPainter* p, QColorGroup& cg, int c, int w, int align )
-{ 
-//  QColorGroup colorGrp( cg );
-  if ( myObject )
-  {
-    if ( myObject->color( SUIT_DataObject::Text ).isValid() )
-      cg.setColor( QColorGroup::Text, myObject->color( SUIT_DataObject::Text ) );
-    if ( myObject->color( SUIT_DataObject::Base ).isValid() )
-      cg.setColor( QColorGroup::Base, myObject->color( SUIT_DataObject::Base ) );
-    if ( myObject->color( SUIT_DataObject::Foreground ).isValid() )
-      cg.setColor( QColorGroup::Foreground, myObject->color( SUIT_DataObject::Foreground ) );
-    if ( myObject->color( SUIT_DataObject::Background ).isValid() )
-      cg.setColor( QColorGroup::Background, myObject->color( SUIT_DataObject::Background ) );
-    if ( myObject->color( SUIT_DataObject::Highlight ).isValid() )
-      cg.setColor( QColorGroup::Highlight, myObject->color( SUIT_DataObject::Highlight ) );
-    if ( myObject->color( SUIT_DataObject::HighlightedText ).isValid() )
-      cg.setColor( QColorGroup::HighlightedText, myObject->color( SUIT_DataObject::HighlightedText ) );
-  }
-
-  
-  p->fillRect( 0, 0, w, myT->height(), cg.brush( QColorGroup::Base ) );
-  //int itemW = myT.width( p->fontMetrics(), myT.listView(), c );
-    
-  //myT.paintCell( p, colorGrp, c, itemW,  align );
-}
-
-/*!
-  Paints focused item
-*/
-template<class T>
-void ListItemF<T>::paintFoc( QPainter* p, QColorGroup& cg, const QRect& r )
-{
-  QRect rect = r;
-  rect.setWidth( myT->width( p->fontMetrics(), myT->listView(), 0 ) );
-  //myT.paintFocus( p, cg, rect );
-}
-
-/*!
-  Set selection of item
-  \param s - selected state
-*/
-template<class T>
-void ListItemF<T>::setSel( bool s )
-{
-  QListView* lv = myT->listView();
-  if ( s && lv && lv->inherits( "OB_ListView" ) )
-  {
-    OB_ListView* objlv = (OB_ListView*)lv;
-    s = s && objlv->isOk( myT );
-  }
-
-  //myT.setSelected( s );
-}
-
-/*!
-  Updates name and pixmap of item
-*/
-template<class T>
-void ListItemF<T>::update()
-{
-  SUIT_DataObject* obj = dataObject();
-  if ( !obj )
-    return;
-
-  QString n = obj->name();
-  if( myT->text( 0 )!=n )
-    myT->setText( 0, n );
-
-  QPixmap p = obj->icon();
-  int aIconW = p.width();
-  if( aIconW > 0 )
-  {
-    if( aIconW > 20 )
-    {
-      QWMatrix aM;
-      double aScale = 20.0 / aIconW;
-      aM.scale( aScale, aScale );
-      myT->setPixmap( 0, p.xForm( aM ) );
-    }
-    else
-      myT->setPixmap( 0, p );
-  }
-  else if ( p.isNull() )
-    myT->setPixmap( 0, p );
-
-  myT->setDragEnabled( obj->isDragable() );
-  myT->setDropEnabled( true );
-}
-
-/*!
-  Constructor
-*/
-OB_ListItem::OB_ListItem( SUIT_DataObject* obj, QListView* parent )
-: ListItemF<QListViewItem>( this, obj ),
- QListViewItem(parent)
-{
-  update();
-}
-
-/*!
-  Constructor
-*/
-OB_ListItem::OB_ListItem( SUIT_DataObject* obj, QListViewItem* parent )
-: ListItemF<QListViewItem>( this, obj ),
- QListViewItem(parent)
-{
-  update();
-}
-
-/*!
-  Constructor
-*/
-OB_ListItem::OB_ListItem( SUIT_DataObject* obj, QListView* parent, QListViewItem* after )
-: ListItemF<QListViewItem>( this, obj),
-QListViewItem(parent, after )
-{
-  update();
-}
-
-/*!
-  Constructor
-*/
-OB_ListItem::OB_ListItem( SUIT_DataObject* obj, QListViewItem* parent, QListViewItem* after )
-: ListItemF<QListViewItem>( this,obj),
-QListViewItem(parent, after )
-{
-  update();
-}
-
-/*!
-  Destructor
-*/
-OB_ListItem::~OB_ListItem()
-{
-}
-
-/*!
-  Sets selection state of item
-  \param s - new state
-*/
-void OB_ListItem::setSelected( bool s )
-{
-  setSel( s );
-  QListViewItem::setSelected( s );
-}
-
-/*!
-  Paints focus
-  \param p - painter
-  \param cg - color group
-  \param r - focus rectangle 
-*/
-void OB_ListItem::paintFocus( QPainter* p, const QColorGroup& cg, const QRect& r )
-{
-  QColorGroup col_group( cg );
-       paintFoc( p, col_group, r );
-
-  QRect R( r );
-  if ( listView() && !listView()->allColumnsShowFocus() )
-    R.setWidth( width( p->fontMetrics(), listView(), 0 ) );
-
-  QListViewItem::paintFocus( p, col_group, R );
-}
-
-/*!
-  Paints item
-  \param p - painter
-  \param cg - color group
-  \param c - not used
-  \param w - width of item
-  \param align - alignment
-*/
-void OB_ListItem::paintCell( QPainter* p, const QColorGroup& cg, int c, int w, int align )
-{
-  QColorGroup col_group( cg );
-       paintC( p, col_group, c ,w, align );
-
-  int W = w;
-  if ( listView() && !listView()->allColumnsShowFocus() )
-    W = width( p->fontMetrics(), listView(), c );
-
-       QListViewItem::paintCell( p, col_group, c, min( W, w ), align );
-}
-
-/*!
-  \return custom RTTI info
-*/
-int OB_ListItem::RTTI()
-{
-  return 1000;
-}
-
-/*!
-  \return custom RTTI info
-*/
-int OB_ListItem::rtti() const
-{
-  return RTTI();
-}
-
-/*!
-  Sets item text
-  \param column - column index
-  \param text - new text
-*/
-void OB_ListItem::setText( int column, const QString& text )
-{
-  QListViewItem::setText( column, text );
-  QFontMetrics fm = listView()->fontMetrics();
-  int necessary = width( fm, listView(), column ),
-      current = listView()->columnWidth( column );
-
-  if( listView()->columnWidthMode( column )==QListView::Maximum && necessary>current )
-    listView()->setColumnWidth( column, necessary );
-}
-
-/*!
-  Constructor
-*/
-OB_CheckListItem::OB_CheckListItem( SUIT_DataObject* obj, QListView* parent, Type type )
-: ListItemF<QCheckListItem>( this, obj),
-QCheckListItem( parent, "", type )
-{
-  update();
-}
-
-/*!
-  Constructor
-*/
-OB_CheckListItem::OB_CheckListItem( SUIT_DataObject* obj, QListViewItem* parent, Type type )
-: ListItemF<QCheckListItem>( this, obj),
-QCheckListItem( parent, "", type )
-{
-  update();
-}
-
-/*!
-  Constructor
-*/
-OB_CheckListItem::OB_CheckListItem( SUIT_DataObject* obj, QListView* parent, QListViewItem* after, Type type )
-: ListItemF<QCheckListItem>( this, obj),
-#if defined(QT_VERSION) && QT_VERSION >= 0x030101
- QCheckListItem( parent, after, "", type )
-#else
- QCheckListItem( parent, "", type )
-#endif
-{
-  update();
-}
-
-/*!
-  Constructor
-*/
-OB_CheckListItem::OB_CheckListItem( SUIT_DataObject* obj, QListViewItem* parent, QListViewItem* after, Type type )
-: ListItemF<QCheckListItem>( this, obj),
-#if defined(QT_VERSION) && QT_VERSION >= 0x030101
- QCheckListItem( parent, after, "", type )
-#else
- QCheckListItem( parent, "", type )
-#endif
-{
-  update();
-}
-
-/*!
-  Destructor
-*/
-OB_CheckListItem::~OB_CheckListItem()
-{
-}
-
-/*!
-  Sets selection state of item
-  \param s - new state
-*/
-void OB_CheckListItem::setSelected( bool s )
-{
-       setSel( s );
-       QCheckListItem::setSelected( s );
-}
-
-/*!
-  Paints focus
-  \param p - painter
-  \param cg - color group
-  \param r - focus rectangle 
-*/
-void OB_CheckListItem::paintFocus( QPainter* p, const QColorGroup& cg, const QRect& r )
-{
-  QColorGroup col_group( cg );
-       paintFoc( p, col_group, r );
-
-  QRect R( r );
-  if ( listView() && !listView()->allColumnsShowFocus() )
-    R.setWidth( width( p->fontMetrics(), listView(), 0 ) );
-
-       QCheckListItem::paintFocus( p, col_group, R );
-}
-
-/*!
-  Paints item
-  \param p - painter
-  \param cg - color group
-  \param c - not used
-  \param w - width of item
-  \param align - alignment
-*/
-void OB_CheckListItem::paintCell( QPainter* p, const QColorGroup& cg, int c, int w, int align )
-{
-  QColorGroup col_group( cg );
-       paintC( p, col_group, c ,w, align );
-
-  int W = w;
-  if ( listView() && !listView()->allColumnsShowFocus() )
-    W = width( p->fontMetrics(), listView(), c );
-
-  QCheckListItem::paintCell( p, col_group, c, min( W, w ), align );
-}
-
-/*!
-  \return custom RTTI info
-*/
-int OB_CheckListItem::RTTI()
-{
-  return OB_ListItem::RTTI() + 1;
-}
-
-/*!
-  \return custom RTTI info
-*/
-int OB_CheckListItem::rtti() const
-{
-  return RTTI();
-}
-
-/*!
-  SLOT: called if checked state is changed, changes corresponding state of SUIT object
-*/
-void OB_CheckListItem::stateChange( bool on )
-{
-  QCheckListItem::stateChange( on );
-
-  if ( dataObject() )
-    dataObject()->setOn( on );
-}
diff --git a/src/ObjBrowser/OB_ListItem.h b/src/ObjBrowser/OB_ListItem.h
deleted file mode 100755 (executable)
index 40f7259..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef OB_LISTITEM_H
-#define OB_LISTITEM_H
-
-#include "OB.h"
-
-#include <qlistview.h>
-
-class SUIT_DataObject;
-
-/*!
-  \class ListItemF
-  Base template class for ListViewItems and CheckListItems
-*/
-template<class T> class ListItemF
-{
-public:
-       ListItemF( T*, SUIT_DataObject* );
-  /*ListItem( SUIT_DataObject*, QListView* );
-  ListItem( SUIT_DataObject*, QListViewItem* );
-  ListItem( SUIT_DataObject*, QListView*, QListViewItem* );
-  ListItem( SUIT_DataObject*, QListViewItem*, QListViewItem* );
-
-  ListItem( SUIT_DataObject*, QListView*, int );
-  ListItem( SUIT_DataObject*, QListViewItem*, int );
-  ListItem( SUIT_DataObject*, QListView*, QListViewItem*, int );
-  ListItem( SUIT_DataObject*, QListViewItem*, QListViewItem*, int );*/
-
-  void            setSel( bool s );
-  inline SUIT_DataObject* dataObject() const { return myObject; }
-  void            paintFoc( QPainter* p, QColorGroup& cg, const QRect& r );
-  void            paintC( QPainter* p, QColorGroup& cg, int c, int w, int align );
-
-//protected:
-  void                     update();
-
-protected:
-  SUIT_DataObject* myObject;
-  T*  myT;
-};
-
-/*!
-  \class OB_ListItem
-  Provides custom list item for Object Browser tree
-*/
-class OB_EXPORT OB_ListItem : public ListItemF<QListViewItem>, public QListViewItem
-{
-public:
-       OB_ListItem( SUIT_DataObject*, QListView* );
-       OB_ListItem( SUIT_DataObject*, QListViewItem* );
-       OB_ListItem( SUIT_DataObject*, QListView*, QListViewItem* );
-       OB_ListItem( SUIT_DataObject*, QListViewItem*, QListViewItem* );
-
-       virtual ~OB_ListItem();
-
-  virtual void            setSelected( bool s );
-  virtual void            paintFocus( QPainter* p, const QColorGroup& cg, const QRect& r );
-  virtual void            paintCell( QPainter* p, const QColorGroup& cg, int c, int w, int align );
-
-  virtual void setText ( int column, const QString & text );
-
-  virtual int      rtti() const;
-
-  static int       RTTI();
-};
-
-/*!
-  \class OB_CheckListItem
-  Provides custom list item with check box
-*/
-class OB_EXPORT OB_CheckListItem : public ListItemF<QCheckListItem>, public QCheckListItem
-{
-public:
-  OB_CheckListItem( SUIT_DataObject*, QListView*, Type = CheckBox );
-  OB_CheckListItem( SUIT_DataObject*, QListViewItem*, Type = CheckBox );
-  OB_CheckListItem( SUIT_DataObject*, QListView*, QListViewItem*, Type = CheckBox );
-  OB_CheckListItem( SUIT_DataObject*, QListViewItem*, QListViewItem*, Type = CheckBox );
-
-  virtual ~OB_CheckListItem();
-
-  virtual void            setSelected( bool s );
-  virtual void            paintFocus( QPainter* p, const QColorGroup& cg, const QRect& r );
-  virtual void            paintCell( QPainter* p, const QColorGroup& cg, int c, int w, int align );
-
-
-  virtual int      rtti() const;
-
-  static int       RTTI();
-
-protected:
-  void             stateChange( bool );
-
-//private:
-//  void             update();
-};
-
-#endif
diff --git a/src/ObjBrowser/OB_ListView.cxx b/src/ObjBrowser/OB_ListView.cxx
deleted file mode 100755 (executable)
index 728e12c..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "OB_ListView.h"
-
-#include "OB_Filter.h"
-#include "OB_ListItem.h"
-
-#include <SUIT_DataObject.h>
-
-#include <qdragobject.h>
-
-/*!
-  Constructor
-*/
-OB_ListView::OB_ListView( QWidget* parent, const char* name, WFlags f )
-: QtxListView( parent, name, f ),
-myFilter( 0 )
-{
-}
-
-/*!
-  Constructor
-*/
-OB_ListView::OB_ListView( const int state, QWidget* parent, const char* name, WFlags f )
-: QtxListView( state, parent, name, f ),
-myFilter( 0 )
-{
-}
-
-/*!
-  Destructor
-*/
-OB_ListView::~OB_ListView()
-{
-  delete myFilter;
-}
-
-/*!
-  \return filter
-*/
-OB_Filter* OB_ListView::filter() const
-{
-  return myFilter;
-}
-
-/*!
-  Changes filter
-  \param f - new filter
-*/
-void OB_ListView::setFilter( OB_Filter* f )
-{
-  if ( myFilter == f )
-    return;
-
-  delete myFilter;
-  myFilter = f;
-}
-
-/*!
-  \return true if item passes filter
-*/
-bool OB_ListView::isOk( QListViewItem* item ) const
-{
-  bool ok = true;
-  SUIT_DataObject* obj = dataObject( item );
-  if ( obj && filter() )
-    ok = filter()->isOk( obj );
-  return ok;
-}
-
-/*!
-  Creates new drag object
-*/
-QDragObject* OB_ListView::dragObject()
-{
-  myItems.clear();
-
-  for ( QListViewItemIterator it( this ); it.current(); ++it )
-    if ( it.current()->isSelected() )
-      myItems.append( it.current() );
-
-  return new QTextDrag( "", this );
-}
-
-/*!
-  Custom drag enter event filter
-*/
-void OB_ListView::dragEnterEvent( QDragEnterEvent* e )
-{
-  e->accept();
-}
-
-/*!
-  Custom drag move event filter
-*/
-void OB_ListView::dragMoveEvent( QDragMoveEvent* e )
-{
-  QListViewItem* item = dropItem( e );
-
-  if ( isDropAccepted( item ) )
-  {
-    setCurrentItem( item );
-    e->accept( true );
-  }
-  else
-    e->accept( false );
-}
-
-/*!
-  Custom drop event filter
-*/
-void OB_ListView::dropEvent( QDropEvent* e )
-{
-  QListViewItem* item = dropItem( e );
-  if ( isDropAccepted( item ) )
-  {
-    e->accept();
-    emit dropped( myItems, item, e->action() );
-  }
-  myItems.clear();
-}
-
-/*!
-  Custom key press event filter
-*/
-void OB_ListView::keyPressEvent( QKeyEvent* ke )
-{
-  if ( ( ke->key() == Qt::Key_Plus || ke->key() == Qt::Key_Minus ) && ke->state() & ControlButton )
-  {
-    bool isOpen = ke->key() == Qt::Key_Plus;
-    for ( QListViewItemIterator it( this ); it.current(); ++it )
-      if ( it.current()->childCount() )
-        it.current()->setOpen( isOpen );
-  }
-  else
-    QtxListView::keyPressEvent( ke );
-}
-
-/*!
-  Finds item, in that dragged objects are dropped by QDropEvent
-  \return tree item
-*/
-QListViewItem* OB_ListView::dropItem( QDropEvent* e ) const
-{
-  QListViewItem* item = 0;
-  if ( e )
-    item = itemAt( QPoint( e->pos().x() - viewport()->x(), e->pos().y() - viewport()->y() ) );
-
-  return item;
-}
-
-/*!
-  \return SUIT object by tree item
-  \param item - tree item
-*/
-SUIT_DataObject* OB_ListView::dataObject( QListViewItem* item ) const
-{
-  if ( !item )
-    return 0;
-
-  SUIT_DataObject* obj = 0;
-
-  if ( dynamic_cast<OB_ListItem*>( item ) )
-    obj = dynamic_cast<OB_ListItem*>( item )->dataObject();
-  else if ( dynamic_cast<OB_CheckListItem*>( item ) )
-    obj = dynamic_cast<OB_CheckListItem*>( item )->dataObject();
-
-  return obj;
-}
-
-/*!
-  \return true if it is possible to drop into item
-  \param item - tree item to be checked
-*/
-bool OB_ListView::isDropAccepted( QListViewItem* item ) const
-{
-  bool res = true;
-
-  for ( QPtrListIterator<QListViewItem> it( myItems ); it.current() && res; ++it )
-    res = res && isDropAccepted( it.current(), item );
-
-  return res;
-}
-
-/*!
-  \return true if it is possible to drop one item into other
-  \param drag - dragged item
-  \param drop - destination item
-*/
-bool OB_ListView::isDropAccepted( QListViewItem* drag, QListViewItem* drop ) const
-{
-  SUIT_DataObject* dragObj = dataObject( drag );
-  SUIT_DataObject* dropObj = dataObject( drop );
-
-  if ( !dragObj || !dropObj )
-    return false;
-
-  return dropObj->isDropAccepted( dragObj );
-}
-
-/*!
-  Sets column width
-  \param col - column index
-  \param width - column width
-*/ 
-void OB_ListView::setColumnWidth( int col, int width )
-{
-  int max = columnMaxWidth( col );
-  if ( max>0 && width>max )
-    width = max;
-
-  QtxListView::setColumnWidth( col, width );
-}
-
-/*!
-  \return column max width
-  \param col - column index
-*/ 
-int OB_ListView::columnMaxWidth( const int col ) const
-{
-  int res = -1;
-  if( myMaxColWidth.contains( col ) )
-    res = myMaxColWidth[col];
-  else if( myMaxColRatio.contains( col ) )
-    res = int( myMaxColRatio[col]*height() );
-  return res;
-}
-
-/*!
-  Changes column max width
-  \param col - column index
-  \param w - column max width
-*/ 
-void OB_ListView::setColumnMaxWidth( const int col, const int w )
-{
-  myMaxColWidth.insert( col, w );
-}
-
-/*!
-  \return column max ratio
-  \param col - column index
-*/ 
-double OB_ListView::columnMaxRatio( const int col ) const
-{
-  double res = 0.0;
-  if( myMaxColRatio.contains( col ) )
-    res = myMaxColRatio[col];
-  return res;
-}
-
-/*!
-  Changes column max ratio
-  \param col - column index
-  \param w - column max ratio
-*/ 
-void OB_ListView::setColumnMaxRatio( const int col, const double r )
-{
-  myMaxColRatio.insert( col, r );
-}
diff --git a/src/ObjBrowser/OB_ListView.h b/src/ObjBrowser/OB_ListView.h
deleted file mode 100755 (executable)
index 7a591e5..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef OB_LISTVIEW_H
-#define OB_LISTVIEW_H
-
-#include "OB.h"
-
-
-#include <QtxListView.h>
-
-#ifdef WIN32
-#pragma warning( disable:4251 )
-#endif
-
-#include <qptrlist.h>
-
-class OB_Filter;
-class QListViewItem;
-class SUIT_DataObject;
-
-/*!
-  \class OB_ListView
-  Special list view for ObjectBrowser.
-  Allows drag-n-drop, filtering of selected objects, column management.
-*/
-class OB_EXPORT OB_ListView : public QtxListView
-{
-  Q_OBJECT
-
-public:
-  OB_ListView( QWidget* = 0, const char* = 0, WFlags = 0 );
-  OB_ListView( const int, QWidget* = 0, const char* = 0, WFlags = 0 );
-  virtual ~OB_ListView();
-
-  OB_Filter*              filter() const;
-  void                    setFilter( OB_Filter* );
-
-  bool                    isOk( QListViewItem* ) const;
-  virtual void            setColumnWidth( int, int );
-  int                     columnMaxWidth( const int ) const;
-  void                    setColumnMaxWidth( const int, const int );
-  double                  columnMaxRatio( const int ) const;
-  void                    setColumnMaxRatio( const int, const double );
-
-signals:
-  void                    dropped( QPtrList<QListViewItem>, QListViewItem*, int );
-
-protected:
-  virtual QDragObject*    dragObject();
-  virtual void            dropEvent( QDropEvent* );
-  virtual void            dragMoveEvent( QDragMoveEvent* );
-  virtual void            dragEnterEvent( QDragEnterEvent* );
-
-  virtual void            keyPressEvent( QKeyEvent* );
-
-private:
-  void                    updateHeader();
-  QListViewItem*          dropItem( QDropEvent* ) const;
-  SUIT_DataObject*        dataObject( QListViewItem* ) const;
-  bool                    isDropAccepted( QListViewItem* ) const;
-  bool                    isDropAccepted( QListViewItem*, QListViewItem* ) const;
-
-protected:
-  QPtrList<QListViewItem> myItems;
-  OB_Filter*              myFilter;
-  QMap<int,int>           myMaxColWidth;
-  QMap<int,double>        myMaxColRatio;
-};
-
-#ifdef WIN32
-#pragma warning( default:4251 )
-#endif
-
-#endif
diff --git a/src/ObjBrowser/OB_ObjSearch.cxx b/src/ObjBrowser/OB_ObjSearch.cxx
deleted file mode 100644 (file)
index 84d9c2c..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-
-#include <OB_ObjSearch.h>
-#include <OB_ListItem.h>
-#include <OB_Browser.h>
-
-#include <qregexp.h>
-
-OB_ObjSearch::OB_ObjSearch( OB_Browser* b )
-: myBrowser( b )
-{
-}
-
-OB_ObjSearch::~OB_ObjSearch()
-{
-}
-
-OB_ListItem* OB_ObjSearch::tail( const bool first ) const
-{
-  QListView* lv = myBrowser->listView();
-  return dynamic_cast<OB_ListItem*>( first ? lv->firstChild() : lv->lastItem() );
-}
-
-OB_ListItem* OB_ObjSearch::next( OB_ListItem* i, const bool forward ) const
-{
-  QListViewItemIterator it( i );
-  if( forward )
-    it++;
-  else
-    it--;
-  return dynamic_cast<OB_ListItem*>( *it );
-}
-
-SUIT_DataObject* OB_ObjSearch::data( OB_ListItem* i ) const
-{
-  return i ? i->dataObject() : 0;
-}
-
-void OB_ObjSearch::setPattern( const QString& data, const bool is_reg_exp, const bool is_case_sens )
-{
-  myData = data;
-  myIsRegExp = is_reg_exp;
-  myIsCaseSens = is_case_sens;
-}
-
-bool OB_ObjSearch::matches( SUIT_DataObject* obj ) const
-{
-  if( !obj )
-    return false;
-
-  QString txt = obj->name();
-  if( myIsRegExp )
-  {
-    QRegExp re( myData );
-    re.setCaseSensitive( myIsCaseSens );
-    return txt.contains( re );
-  }
-  else
-    return txt.contains( myData, myIsCaseSens );
-}
-
-OB_Browser* OB_ObjSearch::browser() const
-{
-  return myBrowser;
-}
-
-OB_ListItem* OB_ObjSearch::findFirst() const
-{
-  return find( tail( true ), true, false, false );
-}
-
-OB_ListItem* OB_ObjSearch::findLast() const
-{
-  return find( tail( false ), false, false, false );
-}
-
-OB_ListItem* OB_ObjSearch::findNext() const
-{
-  return find( current(), true, true, true );
-}
-
-OB_ListItem* OB_ObjSearch::findPrev() const
-{
-  return find( current(), false, true, true );
-}
-
-OB_ListItem* OB_ObjSearch::find( OB_ListItem* i, const bool forward,
-                                 const bool ignore_first, const bool cyclic ) const
-{
-  if( !i )
-    i = tail( forward );
-
-  if( ignore_first )
-    i = next( i, forward );
-
-  while( i && !matches( data( i ) ) )
-    i = next( i, forward );
-
-  if( !i && cyclic )
-    return find( tail( forward ), forward, false, false );
-
-  return i;
-}
-
-OB_ListItem* OB_ObjSearch::current() const
-{
-  return dynamic_cast<OB_ListItem*>( myBrowser->listView()->currentItem() );
-}
diff --git a/src/ObjBrowser/OB_ObjSearch.h b/src/ObjBrowser/OB_ObjSearch.h
deleted file mode 100644 (file)
index 6106d9f..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-
-#ifndef OBJECT_BROWSER_OBJECT_SEARCH_HEADER
-#define OBJECT_BROWSER_OBJECT_SEARCH_HEADER
-
-#include <qstring.h>
-
-class OB_ListItem;
-class OB_Browser;
-class SUIT_DataObject;
-
-class OB_ObjSearch
-{
-public:
-  OB_ObjSearch( OB_Browser* );
-  virtual ~OB_ObjSearch();
-
-  void setPattern( const QString&, const bool, const bool );
-  OB_Browser* browser() const;
-
-  OB_ListItem* findFirst() const;
-  OB_ListItem* findLast() const;
-  OB_ListItem* findNext() const;
-  OB_ListItem* findPrev() const;
-
-protected:
-  virtual OB_ListItem* current() const;
-  virtual OB_ListItem* tail( const bool ) const;
-  virtual OB_ListItem* next( OB_ListItem*, const bool ) const;
-  virtual SUIT_DataObject* data( OB_ListItem* ) const;
-  virtual bool matches( SUIT_DataObject* ) const;
-  OB_ListItem* find( OB_ListItem*, const bool, const bool, const bool ) const;
-
-private:
-  OB_Browser* myBrowser;
-  QString myData;
-  bool myIsRegExp, myIsCaseSens;
-};
-
-#endif
index 2209af5a6bdd01989a7a35fd8482d3a48d6e4481..ad3289b0176bbdcd08741562c63932ff15315990 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
@@ -30,17 +34,3 @@ msgstr ""
 msgid "MEN_EXPAND_ALL"
 msgstr "Expand All"
 
-msgid "OB_FindDlg::FIND"
-msgstr "Find"
-
-msgid "OB_FindDlg::CLOSE"
-msgstr "Close"
-
-msgid "OB_FindDlg::CASE_SENSITIVE"
-msgstr "Case sensitive"
-
-msgid "OB_FindDlg::IS_REG_EXP"
-msgstr "Regular expression"
-
-msgid "OB_FindDlg::NOT_FOUND"
-msgstr "There is no object is found"
diff --git a/src/ObjBrowser/resources/OB_msg_en.ts b/src/ObjBrowser/resources/OB_msg_en.ts
new file mode 100644 (file)
index 0000000..560c0b9
--- /dev/null
@@ -0,0 +1,58 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+-->
+<context>
+    <name>OB_Browser</name>
+    <message>
+        <source>MEN_EXPAND_ALL</source>
+        <translation>Expand All</translation>
+    </message>
+    <message>
+        <source>MEN_COLLAPSE_ALL</source>
+        <translation>Collapse All</translation>
+    </message>
+    <message>
+        <source>MEN_FIND</source>
+        <translation>Find</translation>
+    </message>
+</context>
+<context>
+    <name>OB_FindDlg</name>
+    <message>
+        <source>FIND</source>
+        <translation>Find</translation>
+    </message>
+    <message>
+        <source>CLOSE</source>
+        <translation>Close</translation>
+    </message>
+    <message>
+        <source>CASE_SENSITIVE</source>
+        <translation>Case sensitive</translation>
+    </message>
+    <message>
+        <source>IS_REG_EXP</source>
+        <translation>Regular expression</translation>
+    </message>
+</context>
+</TS>
index b2fd5cfbfe9d8c7e0f36eca5e4a459e2da9aae2c..c68c582b461f41dde53ab8b59aabde179811cc90 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : Plot2d
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-lib_LTLIBRARIES= libPlot2d.la
+lib_LTLIBRARIES = libPlot2d.la
 
 # header files 
-salomeinclude_HEADERS= \
-       Plot2d.h \
-       Plot2d_Curve.h \
-       Plot2d_FitDataDlg.h \
-       Plot2d_Prs.h \
-       Plot2d_SetupViewDlg.h \
-       Plot2d_ViewFrame.h \
-       Plot2d_ViewManager.h \
-       Plot2d_ViewModel.h \
-       Plot2d_ViewWindow.h \
-       Plot2d_SetupCurveDlg.h \
+salomeinclude_HEADERS =                \
+       Plot2d.h                \
+       Plot2d_Curve.h          \
+       Plot2d_FitDataDlg.h     \
+       Plot2d_Prs.h            \
+       Plot2d_SetupViewDlg.h   \
+       Plot2d_ViewFrame.h      \
+       Plot2d_ViewManager.h    \
+       Plot2d_ViewModel.h      \
+       Plot2d_ViewWindow.h     \
+       Plot2d_SetupCurveDlg.h  \
        Plot2d_ToolTip.h
 
-dist_libPlot2d_la_SOURCES= \
-       Plot2d_Curve.cxx \
-       Plot2d_FitDataDlg.cxx \
-       Plot2d_Prs.cxx \
-       Plot2d_SetupViewDlg.cxx \
-       Plot2d_ViewFrame.cxx \
-       Plot2d_ViewManager.cxx \
-       Plot2d_ViewModel.cxx \
-       Plot2d_ViewWindow.cxx \
-       Plot2d_SetupCurveDlg.cxx \
+dist_libPlot2d_la_SOURCES =            \
+       Plot2d.cxx                      \
+       Plot2d_Curve.cxx                \
+       Plot2d_FitDataDlg.cxx           \
+       Plot2d_Prs.cxx                  \
+       Plot2d_SetupViewDlg.cxx         \
+       Plot2d_ViewFrame.cxx            \
+       Plot2d_ViewManager.cxx          \
+       Plot2d_ViewModel.cxx            \
+       Plot2d_ViewWindow.cxx           \
+       Plot2d_SetupCurveDlg.cxx        \
        Plot2d_ToolTip.cxx
 
-MOC_FILES = \
-       Plot2d_FitDataDlg_moc.cxx \
-       Plot2d_SetupViewDlg_moc.cxx \
-       Plot2d_ViewFrame_moc.cxx \
-       Plot2d_ViewManager_moc.cxx \
-       Plot2d_ViewModel_moc.cxx \
-       Plot2d_ViewWindow_moc.cxx \
-       Plot2d_SetupCurveDlg_moc.cxx \
+MOC_FILES =                            \
+       Plot2d_FitDataDlg_moc.cxx       \
+       Plot2d_SetupViewDlg_moc.cxx     \
+       Plot2d_ViewFrame_moc.cxx        \
+       Plot2d_ViewManager_moc.cxx      \
+       Plot2d_ViewModel_moc.cxx        \
+       Plot2d_ViewWindow_moc.cxx       \
+       Plot2d_SetupCurveDlg_moc.cxx    \
        Plot2d_ToolTip_moc.cxx
-nodist_libPlot2d_la_SOURCES= $(MOC_FILES)
+nodist_libPlot2d_la_SOURCES = $(MOC_FILES)
 
-dist_salomeres_DATA = \
-       resources/plot2d_clone.png \
-       resources/plot2d_camera_dump.png \
-       resources/plot2d_fitall.png \
-       resources/plot2d_fitarea.png \
-       resources/plot2d_glpan.png \
-       resources/plot2d_legend.png \
-       resources/plot2d_linear.png \
-       resources/plot2d_linear_y.png \
-       resources/plot2d_lines.png \
-       resources/plot2d_log.png \
-       resources/plot2d_log_y.png \
-       resources/plot2d_pan.png \
-       resources/plot2d_points.png \
-       resources/plot2d_settings.png \
-       resources/plot2d_splines.png \
+dist_salomeres_DATA =                          \
+       resources/plot2d_clone.png              \
+       resources/plot2d_camera_dump.png        \
+       resources/plot2d_fitall.png             \
+       resources/plot2d_fitarea.png            \
+       resources/plot2d_glpan.png              \
+       resources/plot2d_legend.png             \
+       resources/plot2d_linear.png             \
+       resources/plot2d_linear_y.png           \
+       resources/plot2d_lines.png              \
+       resources/plot2d_log.png                \
+       resources/plot2d_log_y.png              \
+       resources/plot2d_pan.png                \
+       resources/plot2d_points.png             \
+       resources/plot2d_settings.png           \
+       resources/plot2d_splines.png            \
        resources/plot2d_zoom.png
 
-nodist_salomeres_DATA= \
-       Plot2d_images.qm \
+nodist_salomeres_DATA =                \
+       Plot2d_images.qm        \
        Plot2d_msg_en.qm 
 
-libPlot2d_la_CPPFLAGS=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(QWT_INCLUDES) \
+libPlot2d_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) $(QWT_INCLUDES) \
        -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
 
-libPlot2d_la_LDFLAGS=$(QWT_LIBS) $(QT_MT_LIBS) ../SUIT/libsuit.la
+libPlot2d_la_LDFLAGS  = $(QWT_LIBS) $(QT_MT_LIBS) ../SUIT/libsuit.la
 
 
diff --git a/src/Plot2d/Plot2d.cxx b/src/Plot2d/Plot2d.cxx
new file mode 100755 (executable)
index 0000000..2be404b
--- /dev/null
@@ -0,0 +1,352 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#include "Plot2d.h"
+
+#include <QPainter>
+
+/*!
+  \brief Convert Plot2d marker type to Qwt marker type.
+  \param m Plot2d marker type
+  \return Qwt marker type
+*/
+QwtSymbol::Style Plot2d::plot2qwtMarker( Plot2d::MarkerType m )
+{
+  QwtSymbol::Style ms = QwtSymbol::NoSymbol;  
+  switch ( m ) {
+  case Plot2d::Circle:
+    ms = QwtSymbol::Ellipse;   break;
+  case Plot2d::Rectangle:
+    ms = QwtSymbol::Rect;      break;
+  case Plot2d::Diamond:
+    ms = QwtSymbol::Diamond;   break;
+  case Plot2d::DTriangle:
+    ms = QwtSymbol::DTriangle; break;
+  case Plot2d::UTriangle:
+    ms = QwtSymbol::UTriangle; break;
+  case Plot2d::LTriangle:
+    ms = QwtSymbol::LTriangle; break;
+  case Plot2d::RTriangle:
+    ms = QwtSymbol::RTriangle; break;
+  case Plot2d::Cross:
+    ms = QwtSymbol::Cross;     break;
+  case Plot2d::XCross:
+    ms = QwtSymbol::XCross;    break;
+  case Plot2d::None:
+  default:
+    ms = QwtSymbol::NoSymbol;  break;
+  }
+  return ms;
+}
+
+/*!
+  \brief Convert Qwt marker type to Plot2d marker type.
+  \param m Qwt marker type
+  \return Plot2d marker type
+*/
+Plot2d::MarkerType Plot2d::qwt2plotMarker( QwtSymbol::Style m )
+{
+  Plot2d::MarkerType ms = Plot2d::None;  
+  switch ( m ) {
+  case QwtSymbol::Ellipse:
+    ms = Plot2d::Circle;    break;
+  case QwtSymbol::Rect:
+    ms = Plot2d::Rectangle; break;
+  case QwtSymbol::Diamond:
+    ms = Plot2d::Diamond;   break;
+  case QwtSymbol::DTriangle:
+    ms = Plot2d::DTriangle; break;
+  case QwtSymbol::UTriangle:
+    ms = Plot2d::UTriangle; break;
+  case QwtSymbol::RTriangle:
+    ms = Plot2d::RTriangle; break;
+  case QwtSymbol::LTriangle:
+    ms = Plot2d::LTriangle; break;
+  case QwtSymbol::Cross:
+    ms = Plot2d::Cross;     break;
+  case QwtSymbol::XCross:
+    ms = Plot2d::XCross;    break;
+  case QwtSymbol::NoSymbol:
+  default:
+    ms = Plot2d::None;      break;
+  }
+  return ms;
+}
+
+/*!
+  \brief Convert Plot2d line type to Qt/Qwt line type.
+  \param p Plot2d line type
+  \return Qt/Qwt line type
+*/
+Qt::PenStyle Plot2d::plot2qwtLine( Plot2d::LineType p )
+{
+  Qt::PenStyle ps = Qt::NoPen;
+  switch ( p ) {
+  case Plot2d::Solid:
+    ps = Qt::SolidLine;      break;
+  case Plot2d::Dash:
+    ps = Qt::DashLine;       break;
+  case Plot2d::Dot:
+    ps = Qt::DotLine;        break;
+  case Plot2d::DashDot:
+    ps = Qt::DashDotLine;    break;
+  case Plot2d::DashDotDot:
+    ps = Qt::DashDotDotLine; break;
+  case Plot2d::NoPen:
+  default:
+    ps = Qt::NoPen;          break;
+  }
+  return ps;
+}
+
+/*!
+  \brief Convert Qt/Qwt line type to Plot2d line type.
+  \param p Qt/Qwt line type
+  \return Plot2d line type
+*/
+Plot2d::LineType Plot2d::qwt2plotLine( Qt::PenStyle p )
+{
+  Plot2d::LineType ps = Plot2d::NoPen;
+  switch ( p ) {
+  case Qt::SolidLine:
+    ps = Plot2d::Solid;      break;
+  case Qt::DashLine:
+    ps = Plot2d::Dash;       break;
+  case Qt::DotLine:
+    ps = Plot2d::Dot;        break;
+  case Qt::DashDotLine:
+    ps = Plot2d::DashDot;    break;
+  case Qt::DashDotDotLine:
+    ps = Plot2d::DashDotDot; break;
+  case Qt::NoPen:
+  default:
+    ps = Plot2d::NoPen;      break;
+  }
+  return ps;
+}
+
+/*!
+  \brief Draw line.
+  \param painter painter
+  \param p1 starting point
+  \param p2 ending point
+  \param type line type
+  \param color line color
+  \param width line width
+*/
+void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2, 
+                      Qt::PenStyle type, const QColor& color, int width )
+{
+  painter->save();
+  QPen pen( type );
+  pen.setColor( color );
+  pen.setWidth( width );
+  painter->setPen( pen );
+  painter->drawLine( p1, p2 );
+  painter->restore();
+}
+
+/*!
+  \brief Draw line.
+  \param painter painter
+  \param p1 starting point
+  \param p2 ending point
+  \param type line type
+  \param color line color
+  \param width line width
+*/
+void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2, 
+                      Plot2d::LineType type, const QColor& color, int width )
+{
+  drawLine( painter, p1, p2, plot2qwtLine( type ), color, width );
+}
+
+/*!
+  \brief Draw line.
+  \param painter painter
+  \param x1 X coordinate of the starting point
+  \param y1 Y coordinate of the starting point
+  \param x2 X coordinate of the ending point
+  \param y2 Y coordinate of the ending point
+  \param type line type
+  \param color line color
+  \param width line width
+*/
+void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2,
+                      Qt::PenStyle type, const QColor& color, int width )
+{
+  drawLine( painter, QPoint( x1, y1 ), QPoint( x2, y2 ), type, color, width );
+}
+
+/*!
+  \brief Draw line.
+  \param painter painter
+  \param x1 X coordinate of the starting point
+  \param y1 Y coordinate of the starting point
+  \param x2 X coordinate of the ending point
+  \param y2 Y coordinate of the ending point
+  \param type line type
+  \param color line color
+  \param width line width
+*/
+void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2,
+                      Plot2d::LineType type, const QColor& color, int width )
+{
+  drawLine( painter, QPoint( x1, y1 ), QPoint( x2, y2 ), 
+           plot2qwtLine( type), color, width );
+}
+
+/*!
+  \brief Draw marker.
+  \param painter painter
+  \param p central point
+  \param r marker rectangle
+  \param type marker type
+  \param color marker color
+*/
+void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r,
+                        QwtSymbol::Style type, const QColor& color )
+{
+  painter->save();
+  painter->setPen( color );
+  painter->setBrush( color );
+  
+  QRect ar = r;
+  ar.moveCenter( p );
+  const int w2 = ar.width()  / 2;
+  const int h2 = ar.height() / 2;
+
+  switch( type ) {
+  case QwtSymbol::Ellipse:
+    painter->drawEllipse( ar );
+    break;
+  case QwtSymbol::Rect:
+    painter->drawRect( ar );
+    painter->fillRect( ar, QBrush( color ) );
+    break;
+  case QwtSymbol::Diamond:
+    {
+      QPolygon polygon;
+      polygon << QPoint( ar.x() + w2, ar.y() );
+      polygon << QPoint( ar.right(), ar.y() + h2 );
+      polygon << QPoint( ar.x() + w2, ar.bottom() );
+      polygon << QPoint( ar.x(), ar.y() + h2 );
+      painter->drawPolygon( polygon );
+      break;
+    }
+  case QwtSymbol::Cross:
+    painter->drawLine( ar.left() + w2, ar.top(), ar.left() + w2, ar.bottom() );
+    painter->drawLine( ar.left(), ar.top() + h2, ar.right(), ar.top() + h2 );
+    break;
+  case QwtSymbol::XCross:
+    painter->drawLine( ar.left(), ar.top(), ar.right(), ar.bottom() );
+    painter->drawLine( ar.left(), ar.bottom(), ar.right(), ar.top() );
+    break;
+  case QwtSymbol::UTriangle:
+    {
+      QPolygon polygon;
+      polygon << QPoint( ar.left() + w2, ar.top() );
+      polygon << QPoint( ar.right(), ar.bottom() );
+      polygon << QPoint( ar.left(), ar.bottom() );
+      painter->drawPolygon( polygon );
+      break;
+    }
+  case QwtSymbol::DTriangle:
+    {
+      QPolygon polygon;
+      polygon << QPoint( ar.left() + w2, ar.bottom() );
+      polygon << QPoint( ar.right(), ar.top() );
+      polygon << QPoint( ar.left(), ar.top() );
+      painter->drawPolygon( polygon );
+      break;
+    }
+  case QwtSymbol::RTriangle:
+    {
+      QPolygon polygon;
+      polygon << QPoint( ar.left(), ar.top() );
+      polygon << QPoint( ar.right(), ar.top() + h2 );
+      polygon << QPoint( ar.left(), ar.bottom() );
+      painter->drawPolygon( polygon );
+      break;
+    }
+  case QwtSymbol::LTriangle:
+    {
+      QPolygon polygon;
+      polygon << QPoint( ar.left(), ar.top() + h2 );
+      polygon << QPoint( ar.right(), ar.top() );
+      polygon << QPoint( ar.right(), ar.bottom() );
+      painter->drawPolygon( polygon );
+      break;
+    }
+  default:
+    break;
+  }
+  painter->restore();
+}
+
+/*!
+  \brief Draw marker.
+  \param painter painter
+  \param p central point
+  \param r marker rectangle
+  \param type marker type
+  \param color marker color
+*/
+void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r,
+                        Plot2d::MarkerType type, const QColor& color )
+{
+  drawMarker( painter, p, r, plot2qwtMarker( type ), color ); 
+}
+
+/*!
+  \brief Draw marker.
+  \param painter painter
+  \param x X coordinate of the central point
+  \param y Y coordinate of the central point
+  \param w marker rectangle width
+  \param h marker rectangle height
+  \param type marker type
+  \param color marker color
+*/
+void Plot2d::drawMarker( QPainter* painter, int x, int y, int w, int h,
+                        QwtSymbol::Style type, const QColor& color )
+{
+  drawMarker( painter, QPoint( x, y ), QRect( 0, 0, w, h ), type, color ); 
+}
+
+/*!
+  \brief Draw marker.
+  \param painter painter
+  \param x X coordinate of the central point
+  \param y Y coordinate of the central point
+  \param w marker rectangle width
+  \param h marker rectangle height
+  \param type marker type
+  \param color marker color
+*/
+void Plot2d::drawMarker( QPainter* painter, int x, int y, int w, int h,
+                        Plot2d::MarkerType type, const QColor& color )
+{
+  drawMarker( painter, QPoint( x, y ), QRect( 0, 0, w, h ), plot2qwtMarker( type ), color ); 
+}
index 20deb6ec1fdfcc7cd3502058afd17b59207dc65c..ed34a8ba0785b6e36135f29d1de04e928bf90a96 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#ifdef WNT
-#ifdef PLOT2D_EXPORTS
-#define PLOT2D_EXPORT __declspec(dllexport)
-#else
-#define PLOT2D_EXPORT __declspec(dllimport)
-#endif
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef PLOT2D_H
+#define PLOT2D_H
+
+#ifdef WIN32
+#  ifdef PLOT2D_EXPORTS
+#    define PLOT2D_EXPORT __declspec(dllexport)
+#  else
+#    define PLOT2D_EXPORT __declspec(dllimport)
+#  endif
 #else
-#define PLOT2D_EXPORT
+#  define PLOT2D_EXPORT
 #endif
 
-#if defined WNT
-#pragma warning ( disable: 4251 )
+#include <qwt_symbol.h>
+#include <Qt>
+
+class QPainter;
+
+namespace Plot2d
+{
+  typedef enum { None, 
+                Circle,  
+                Rectangle,
+                Diamond,
+                DTriangle,
+                UTriangle,
+                LTriangle,
+                RTriangle,
+                Cross,
+                XCross
+  } MarkerType;
+
+  typedef enum {
+    NoPen,
+    Solid, 
+    Dash, 
+    Dot, 
+    DashDot, 
+    DashDotDot
+  } LineType;
+
+  QwtSymbol::Style         plot2qwtMarker( MarkerType );
+  MarkerType qwt2plotMarker( QwtSymbol::Style );
+
+  Qt::PenStyle             plot2qwtLine( LineType );
+  LineType                 qwt2plotLine( Qt::PenStyle );
+
+  void                     drawLine( QPainter*, const QPoint&, const QPoint&, 
+                                    Qt::PenStyle = Qt::SolidLine, 
+                                    const QColor& = Qt::black, int = 0 );
+  void                     drawLine( QPainter*, const QPoint&, const QPoint&, 
+                                    LineType = Solid, 
+                                    const QColor& = Qt::black, int = 0 );
+  void                     drawLine( QPainter*, int, int, int, int,
+                                    Qt::PenStyle = Qt::SolidLine, 
+                                    const QColor& = Qt::black, int = 0 );
+  void                     drawLine( QPainter*, int, int, int, int,
+                                    LineType = Solid, 
+                                    const QColor& = Qt::black, int = 0 );
+
+  void                     drawMarker( QPainter*, const QPoint&, const QRect&,
+                                      QwtSymbol::Style = QwtSymbol::Ellipse,
+                                      const QColor& = Qt::black );
+  void                     drawMarker( QPainter*, const QPoint&, const QRect&,
+                                      MarkerType = Circle,
+                                      const QColor& = Qt::black );
+  void                     drawMarker( QPainter*, int, int, int, int,
+                                      QwtSymbol::Style = QwtSymbol::Ellipse,
+                                      const QColor& = Qt::black );
+  void                     drawMarker( QPainter*, int, int, int, int,
+                                      MarkerType = Circle,
+                                      const QColor& = Qt::black );
+}
+
+#if defined WIN32
+#  pragma warning ( disable: 4251 )
 #endif
+
+#endif // PLOT2D_H
diff --git a/src/Plot2d/Plot2d.pro b/src/Plot2d/Plot2d.pro
new file mode 100644 (file)
index 0000000..684083b
--- /dev/null
@@ -0,0 +1,82 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = Plot2d
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+PYTHONVER=2.4
+PYTHONHOME=$$(PYTHONHOME)
+PYTHONINC=$${PYTHONHOME}/include/python$${PYTHONVER}
+
+QWTHOME=$$(QWTHOME)
+QWTINC=$${QWTHOME}/include
+QWTLIB=$${QWTHOME}/lib
+
+INCLUDEPATH += ../../include $${QWTINC} $${PYTHONINC}
+INCLUDEPATH += ../Qtx ../SUIT
+unix:LIBS  += -L$${QWTLIB} -lqwt
+win32:LIBS += /LIBPATH:$$(QWTLIB)
+LIBS += -L../../lib -lqtx -lsuit
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += PLOT2D_EXPORTS
+
+HEADERS  = Plot2d.h
+HEADERS += Plot2d_Curve.h
+HEADERS += Plot2d_FitDataDlg.h
+HEADERS += Plot2d_Prs.h
+HEADERS += Plot2d_SetupViewDlg.h
+HEADERS += Plot2d_ViewFrame.h
+HEADERS += Plot2d_ViewManager.h
+HEADERS += Plot2d_ViewModel.h
+HEADERS += Plot2d_ViewWindow.h
+HEADERS += Plot2d_SetupCurveDlg.h
+HEADERS += Plot2d_ToolTip.h
+
+SOURCES  = Plot2d_Curve.cxx
+SOURCES += Plot2d_FitDataDlg.cxx
+SOURCES += Plot2d_Prs.cxx
+SOURCES += Plot2d_SetupViewDlg.cxx
+SOURCES += Plot2d_ViewFrame.cxx
+SOURCES += Plot2d_ViewManager.cxx
+SOURCES += Plot2d_ViewModel.cxx
+SOURCES += Plot2d_ViewWindow.cxx
+SOURCES += Plot2d_SetupCurveDlg.cxx
+SOURCES += Plot2d_ToolTip.cxx
+
+TRANSLATIONS = resources/Plot2d_msg_en.ts \
+               resources/Plot2d_images.ts
+
+ICONS = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index bec633fdce725a59172f9ea564ace328a5ae835b..4232eff2b5a3fb67ae967ffaa50e9ea1da3bb3ed 100755 (executable)
@@ -1,32 +1,42 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d_Curve.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #include "Plot2d_Curve.h"
-#include <qcolor.h>
+#include <QColor>
 
 /*!
   Constructor
 */
 Plot2d_Curve::Plot2d_Curve()
 : myHorTitle( "" ), myVerTitle( "" ), 
-myHorUnits( "" ), myVerUnits( "" ), 
-myAutoAssign( true ), myColor( 0,0,0 ), myMarker( Circle ), myLine( Solid ), myLineWidth( 0 ),
-myYAxis( QwtPlot::yLeft )
+  myHorUnits( "" ), myVerUnits( "" ), 
+  myAutoAssign( true ), 
+  myColor( 0,0,0 ), 
+  myMarker( Plot2d::Circle ), 
+  myLine( Plot2d::Solid ), 
+  myLineWidth( 0 ),
+  myYAxis( QwtPlot::yLeft )
 {
 }
 
@@ -166,7 +176,7 @@ void Plot2d_Curve::insertPoint(int thePos, double theX, double theY, const QStri
   aPoint.y = theY;
   aPoint.text = txt;
 
-  QValueList<Plot2d_Point>::iterator aIt;
+  pointList::iterator aIt;
   int aCurrent = 0;
   for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
     if (thePos == aCurrent) {
@@ -183,15 +193,8 @@ void Plot2d_Curve::insertPoint(int thePos, double theX, double theY, const QStri
 */
 void Plot2d_Curve::deletePoint(int thePos)
 {
-  QValueList<Plot2d_Point>::iterator aIt;
-  int aCurrent = 0;
-  for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
-    if (thePos == aCurrent) {
-      myPoints.remove(aIt);
-      return;
-    }
-    aCurrent++;  
-  }
+  if ( thePos >= 0 && thePos < myPoints.count() )
+    myPoints.removeAt( thePos );
 }
 
 /*!
@@ -218,7 +221,7 @@ void Plot2d_Curve::setData( const double* hData, const double* vData, long size,
   clearAllPoints();
   QStringList::const_iterator anIt = lst.begin(), aLast = lst.end(); 
   for( long i = 0; i < size; i++, anIt++ )
-    addPoint( hData[i], vData[i], anIt==aLast ? QString::null : *anIt );
+    addPoint( hData[i], vData[i], anIt==aLast ? QString() : *anIt );
 }
 
 /*!
@@ -299,7 +302,7 @@ QColor Plot2d_Curve::getColor() const
 /*!
   Sets curve's marker ( and resets AutoAssign flag )
 */
-void Plot2d_Curve::setMarker( MarkerType marker )
+void Plot2d_Curve::setMarker( Plot2d::MarkerType marker )
 {
   myMarker = marker;
   myAutoAssign = false;
@@ -308,7 +311,7 @@ void Plot2d_Curve::setMarker( MarkerType marker )
 /*!
   Gets curve's marker
 */
-Plot2d_Curve::MarkerType Plot2d_Curve::getMarker() const
+Plot2d::MarkerType Plot2d_Curve::getMarker() const
 {
   return myMarker;
 }
@@ -320,7 +323,7 @@ Plot2d_Curve::MarkerType Plot2d_Curve::getMarker() const
          algorithm for diagonals. 
          For horizontal and vertical lines a line width of 0 is the same as a line width of 1.
 */
-void Plot2d_Curve::setLine( LineType line, const int lineWidth )
+void Plot2d_Curve::setLine( Plot2d::LineType line, const int lineWidth )
 {
   myLine = line;
   myLineWidth = lineWidth;
@@ -331,7 +334,7 @@ void Plot2d_Curve::setLine( LineType line, const int lineWidth )
 /*!
   Gets curve's line type
 */
-Plot2d_Curve::LineType Plot2d_Curve::getLine() const
+Plot2d::LineType Plot2d_Curve::getLine() const
 {
   return myLine;
 }
@@ -366,7 +369,7 @@ QwtPlot::Axis Plot2d_Curve::getYAxis() const
 */
 double Plot2d_Curve::getMinX() const
 {
-  QValueList<Plot2d_Point>::const_iterator aIt;
+  pointList::const_iterator aIt;
   double aMinX = 1e150;
   //int aCurrent = 0;
   for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
@@ -381,7 +384,7 @@ double Plot2d_Curve::getMinX() const
 */
 double Plot2d_Curve::getMinY() const
 {
-  QValueList<Plot2d_Point>::const_iterator aIt;
+  pointList::const_iterator aIt;
   double aMinY = 1e150;
   //int aCurrent = 0;
   for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
@@ -411,7 +414,7 @@ void Plot2d_Curve::setText( const int ind, const QString& txt )
 QString Plot2d_Curve::text( const int ind ) const
 {
   if( ind<0 || ind>=myPoints.count() )
-    return QString::null;
+    return QString();
   else
     return myPoints[ind].text;
 }
index bd3be97bdd2fd6c5f0150e32827be3a235f3039c..8cf390d8032f20a1119f079d2ba8c640b0c70188 100755 (executable)
@@ -1,27 +1,33 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d_Curve.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #ifndef PLOT2D_CURVE_H
 #define PLOT2D_CURVE_H
 
 #include "Plot2d.h"
-#include <qvaluelist.h>
-#include <qptrlist.h>
+
+#include <QList>
 #include <qwt_plot.h>
 
 class QColor;
@@ -33,80 +39,82 @@ typedef struct
   QString text;
 } Plot2d_Point;
 
-typedef QValueList<Plot2d_Point> pointList;
+typedef QList<Plot2d_Point> pointList;
 
 class PLOT2D_EXPORT Plot2d_Curve
 {
 public:
-  enum MarkerType { None,      Circle,    Rectangle, Diamond,
-        DTriangle, UTriangle, LTriangle, RTriangle,
-        Cross, XCross };
-  enum LineType { NoPen, Solid, Dash, Dot, DashDot, DashDotDot };
-
   Plot2d_Curve();
   virtual ~Plot2d_Curve();
-  Plot2d_Curve( const Plot2d_Curve& curve );
-  Plot2d_Curve& operator= ( const Plot2d_Curve& curve );
+  Plot2d_Curve( const Plot2d_Curve& );
+  Plot2d_Curve& operator= ( const Plot2d_Curve& );
 
-  virtual QString getTableTitle() const;
+  virtual QString    getTableTitle() const;
   
-  void        setHorTitle( const QString& title );
-  QString     getHorTitle() const;
-  void        setVerTitle( const QString& title );
-  QString     getVerTitle() const;
-  void        setHorUnits( const QString& units );
-  QString     getHorUnits() const;
-  void        setVerUnits( const QString& units );
-  QString     getVerUnits() const;
-  void        addPoint(double theX, double theY, const QString& = QString::null );
-  void        insertPoint(int thePos, double theX, double theY, const QString& = QString::null );
-  void        deletePoint(int thePos);
-  void        clearAllPoints();
-  pointList   getPointList() const;
-
-  void        setData( const double* hData, const double* vData, long size, const QStringList& = QStringList() );
-  double*     horData() const;
-  double*     verData() const;
-
-  void        setText( const int, const QString& );
-  QString     text( const int ) const;
-
-  int         nbPoints() const;
-  bool        isEmpty() const;
-
-  void        setAutoAssign( bool on );
-  bool        isAutoAssign() const;
-  void        setColor( const QColor& color );
-  QColor      getColor() const;
-  void        setMarker( MarkerType marker );
-  MarkerType  getMarker() const;
-  void        setLine( LineType line, const int lineWidth = 0 );
-  LineType    getLine() const;
-  int         getLineWidth() const;
-  void        setYAxis(QwtPlot::Axis theYAxis);
-  QwtPlot::Axis getYAxis() const;
+  void               setHorTitle( const QString& );
+  QString            getHorTitle() const;
+  void               setVerTitle( const QString& );
+  QString            getVerTitle() const;
+
+  void               setHorUnits( const QString& );
+  QString            getHorUnits() const;
+  void               setVerUnits( const QString& );
+  QString            getVerUnits() const;
+
+  void               addPoint( double, double, const QString& = QString() );
+  void               insertPoint( int, double, double, const QString& = QString() );
+  void               deletePoint( int );
+  void               clearAllPoints();
+  pointList          getPointList() const;
+
+  void               setData( const double*, const double*, 
+                             long, const QStringList& = QStringList() );
+  double*            horData() const;
+  double*            verData() const;
+
+  void               setText( const int, const QString& );
+  QString            text( const int ) const;
+
+  int                nbPoints() const;
+  bool               isEmpty() const;
+
+  void               setAutoAssign( bool );
+  bool               isAutoAssign() const;
+
+  void               setColor( const QColor& );
+  QColor             getColor() const;
+
+  void               setMarker( Plot2d::MarkerType );
+  Plot2d::MarkerType getMarker() const;
+
+  void               setLine( Plot2d::LineType, const int = 0 );
+  Plot2d::LineType   getLine() const;
+  int                getLineWidth() const;
+
+  void               setYAxis( QwtPlot::Axis );
+  QwtPlot::Axis      getYAxis() const;
 
   // Protection against QwtCurve::drawLines() bug in Qwt 0.4.x: 
   // it crashes if switched to X/Y logarithmic mode, when one or more points have
   // non-positive X/Y coordinate
-  double      getMinX() const;
-  double      getMinY() const;
+  double             getMinX() const;
+  double             getMinY() const;
 
 protected:
-  bool        myAutoAssign;
-  QString     myHorTitle;
-  QString     myVerTitle;
-  QString     myHorUnits;
-  QString     myVerUnits;
-  QColor      myColor;
-  MarkerType  myMarker;
-  LineType    myLine;
-  int         myLineWidth;
-  QwtPlot::Axis myYAxis;
-
-  pointList   myPoints;
+  bool               myAutoAssign;
+  QString            myHorTitle;
+  QString            myVerTitle;
+  QString            myHorUnits;
+  QString            myVerUnits;
+  QColor             myColor;
+  Plot2d::MarkerType myMarker;
+  Plot2d::LineType   myLine;
+  int                myLineWidth;
+  QwtPlot::Axis      myYAxis;
+
+  pointList          myPoints;
 };
 
-typedef QPtrList<Plot2d_Curve> curveList;
+typedef QList<Plot2d_Curve*> curveList;
 
 #endif
index 9ff544a07de019c164ab9fb35f6d10cc9f4b1fee..500c4c658ff23a08d4cdeb03737c989f74d2594e 100755 (executable)
@@ -1,34 +1,35 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d_FitDataDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : Plot2d_FitDataDlg.cxx
-//  Author : Vadim SANDLER
-//  Module : SALOME
-//  $Header$
-
 #include "Plot2d_FitDataDlg.h"
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qvalidator.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
-#include <qlineedit.h>
+#include <QLabel>
+#include <QLayout>
+#include <QValidator>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QGroupBox>
+#include <QLineEdit>
 
 #define SPACING_SIZE      6
 #define MARGIN_SIZE       11
 */
 Plot2d_FitDataDlg::Plot2d_FitDataDlg( QWidget* parent, bool secondAxisY )
      : QDialog( parent ? parent : 0,
-         "Plot2d_FitDataDlg", 
-         true, 
-         WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
-         myY2MinEdit( 0 ), myY2MaxEdit( 0 ), mySecondAxisY( secondAxisY )
+         Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+       myY2MinEdit( 0 ), myY2MaxEdit( 0 ), mySecondAxisY( secondAxisY )
 
 {
-  setCaption( tr( "FIT_DATA_TLT" ) );
+  setObjectName( "Plot2d_FitDataDlg" );
+  setModal( true );
+  setWindowTitle( tr( "FIT_DATA_TLT" ) );
   setSizeGripEnabled( TRUE );
   QGridLayout* topLayout = new QGridLayout( this ); 
   topLayout->setSpacing( SPACING_SIZE );
   topLayout->setMargin( MARGIN_SIZE );
 
   // 'Range' group
-  myRangeGrp = new QButtonGroup( this );
-  myRangeGrp->setColumnLayout( 0, Qt::Vertical );
-  myRangeGrp->layout()->setSpacing( 0 );
-  myRangeGrp->layout()->setMargin( 0 );
-  QGridLayout* aGridLayout = new QGridLayout( myRangeGrp->layout() );
+  myRangeGrp = new QGroupBox( this );
+  QGridLayout* aGridLayout = new QGridLayout( myRangeGrp );
+  myRangeGrp->setLayout( aGridLayout );
   aGridLayout->setAlignment( Qt::AlignTop );
   aGridLayout->setMargin( MARGIN_SIZE );
   aGridLayout->setSpacing( SPACING_SIZE );
@@ -122,45 +121,47 @@ Plot2d_FitDataDlg::Plot2d_FitDataDlg( QWidget* parent, bool secondAxisY )
   QFont font = horLab->font(); font.setBold( true );
   horLab->setFont( font ); verLab->setFont( font );
 
-  aGridLayout->addMultiCellLayout( aModeLayout,    0, 0, 0, 4 );
-  aGridLayout->addMultiCellWidget( aHLine,         1, 1, 0, 4 );
-  aGridLayout->addWidget         ( horLab,         2,    0 );
-  aGridLayout->addWidget         ( new QLabel( tr( "MIN_VALUE_LAB" ), myRangeGrp ), 
-                                                   2,    1 );
-  aGridLayout->addWidget         ( myXMinEdit,     2,    2 );
-  aGridLayout->addWidget         ( new QLabel( tr( "MAX_VALUE_LAB" ), myRangeGrp ), 
-                                                   2,    3 );
-  aGridLayout->addWidget         ( myXMaxEdit,     2,    4 );
-  aGridLayout->addWidget         ( verLab,         3,    0 );
-  aGridLayout->addWidget         ( new QLabel( tr( "MIN_VALUE_LAB" ), myRangeGrp ), 
-                                                   3,    1 );
-  aGridLayout->addWidget         ( myYMinEdit,     3,    2 );
-  aGridLayout->addWidget         ( new QLabel( tr( "MAX_VALUE_LAB" ), myRangeGrp ), 
-                                                   3,    3 );
-  aGridLayout->addWidget         ( myYMaxEdit,     3,    4 );
+  aGridLayout->addLayout( aModeLayout,    0, 0, 1, 5 );
+  aGridLayout->addWidget( aHLine,         1, 0, 1, 5 );
+  aGridLayout->addWidget( horLab,         2,    0 );
+  aGridLayout->addWidget( new QLabel( tr( "MIN_VALUE_LAB" ), myRangeGrp ), 
+                                          2,    1 );
+  aGridLayout->addWidget( myXMinEdit,     2,    2 );
+  aGridLayout->addWidget( new QLabel( tr( "MAX_VALUE_LAB" ), myRangeGrp ), 
+                                          2,    3 );
+  aGridLayout->addWidget( myXMaxEdit,     2,    4 );
+  aGridLayout->addWidget( verLab,         3,    0 );
+  aGridLayout->addWidget( new QLabel( tr( "MIN_VALUE_LAB" ), myRangeGrp ), 
+                                          3,    1 );
+  aGridLayout->addWidget( myYMinEdit,     3,    2 );
+  aGridLayout->addWidget( new QLabel( tr( "MAX_VALUE_LAB" ), myRangeGrp ), 
+                                          3,    3 );
+  aGridLayout->addWidget( myYMaxEdit,     3,    4 );
 
   if (mySecondAxisY) {
     QLabel* ver2Lab = new QLabel(tr( "VERTICAL_RIGHT_AXIS" ), myRangeGrp );
     ver2Lab->setFont( font );
-    aGridLayout->addWidget       ( ver2Lab,        4,    0 );
-    aGridLayout->addWidget       ( new QLabel( tr( "MIN_VALUE_LAB" ), myRangeGrp ), 
-                                                   4,    1 );
-    aGridLayout->addWidget       ( myY2MinEdit,    4,    2 );
-    aGridLayout->addWidget       ( new QLabel( tr( "MAX_VALUE_LAB" ), myRangeGrp ), 
-                                                   4,    3 );
-    aGridLayout->addWidget       ( myY2MaxEdit,    4,    4 );
+    aGridLayout->addWidget( ver2Lab,        4,    0 );
+    aGridLayout->addWidget( new QLabel( tr( "MIN_VALUE_LAB" ), myRangeGrp ), 
+                                            4,    1 );
+    aGridLayout->addWidget( myY2MinEdit,    4,    2 );
+    aGridLayout->addWidget( new QLabel( tr( "MAX_VALUE_LAB" ), myRangeGrp ), 
+                                            4,    3 );
+    aGridLayout->addWidget( myY2MaxEdit,    4,    4 );
   }
 
   // OK/Cancel buttons
-  myOkBtn = new QPushButton( tr( "BUT_OK" ), this, "buttonOk" );
+  myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
+  myOkBtn->setObjectName( "buttonOk" );
   myOkBtn->setAutoDefault( TRUE );
   myOkBtn->setDefault( TRUE );
-  myCancelBtn = new QPushButton(  tr( "BUT_CANCEL" ), this, "buttonCancel" );
+  myCancelBtn = new QPushButton(  tr( "BUT_CANCEL" ), this );
+  myCancelBtn->setObjectName( "buttonCancel" );
   myCancelBtn->setAutoDefault( TRUE );
 
-  topLayout->addMultiCellWidget( myRangeGrp, 0, 0, 0, 2 );
+  topLayout->addWidget( myRangeGrp, 0, 0, 1, 3 );
   topLayout->addWidget( myOkBtn, 1, 0 );
-  topLayout->setColStretch( 1, 5 );
+  topLayout->setColumnStretch( 1, 5 );
   topLayout->addWidget( myCancelBtn, 1, 2 );
 
   // connect signals
index ccecaaa32013f8287c8a2255be8f51d7fb845daf..177a504ba57b796546b5f26cf76e5e7c66e877a6 100755 (executable)
@@ -1,28 +1,31 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef PLOT2D_FITDATADLG_H
 #define PLOT2D_FITDATADLG_H
 
 #include "Plot2d.h"
-#include <qdialog.h>
+#include <QDialog>
 
-class QButtonGroup;
+class QGroupBox;
 class QRadioButton;
 class QLineEdit;
 class QPushButton;
@@ -57,7 +60,7 @@ protected slots:
   void onModeChanged(int);
 
 private:
-  QButtonGroup*           myRangeGrp;
+  QGroupBox*              myRangeGrp;
   QRadioButton*           myModeAllRB;
   QRadioButton*           myModeHorRB;
   QRadioButton*           myModeVerRB;
index 7c3bd03720cf5f7a52d9a473bb6566b8deca97ad..db316b5a2c229fbf5fb2daf7707a8eaeb88e9e8e 100755 (executable)
@@ -1,31 +1,30 @@
-//  SALOME OCCViewer : build OCC Viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2004  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OCCViewer : build OCC Viewer into Salome desktop
 //  File   : Plot2d_Prs.cxx
 //  Author : Sergey ANIKIN
 //  Module : SALOME
 //  $Header$
-
+//
 #include <qwt_plot.h>
 #include "Plot2d_Prs.h"
 
   Default constructor
 */
 Plot2d_Prs::Plot2d_Prs( bool theDelete )
-: mySecondY( false)
+: mySecondY( false), myIsAutoDel( theDelete )
 {
-  setAutoDel(theDelete);
 }
 
 /*!
   Standard constructor
 */
 Plot2d_Prs::Plot2d_Prs( const Plot2d_Curve* obj, bool theDelete )
-: mySecondY( false)
+: mySecondY( false), myIsAutoDel( theDelete )
 {
-  setAutoDel(theDelete);
   AddObject( obj ); 
 }
 
@@ -53,6 +50,8 @@ Plot2d_Prs::Plot2d_Prs( const Plot2d_Curve* obj, bool theDelete )
 */
 Plot2d_Prs::~Plot2d_Prs()
 { 
+  if ( myIsAutoDel )
+    qDeleteAll( myCurves );
 }
 
 /*!
@@ -95,5 +94,5 @@ bool Plot2d_Prs::isSecondY() const
 */
 void Plot2d_Prs::setAutoDel(bool theDel)
 {
-  myCurves.setAutoDelete(theDel);
+  myIsAutoDel = theDel;
 }
index 2f98aadeba0422734a4604e33a7c554cf920481e..70e6d5fbb2c1d37d8ee5f19098766b10a881ed3d 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef PLOT2D_PRS_H
 #define PLOT2D_PRS_H
@@ -41,6 +44,7 @@ public:
 protected:
   curveList myCurves;
   bool      mySecondY;
+  bool      myIsAutoDel;
 };
 
 #endif
index 4873db496141dbb5e72af896972f77a0a29f4ea3..fd8f700532157b8f712807356f021d95ac762a63 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  SALOME Plot2d : implementation of desktop and GUI kernel
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d_SetupCurveDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : Plot2d_SetupCurveDlg.cxx
-//  Author : Vadim SANDLER
-//  Module : SALOME
-//  $Header$
-
 #include "Plot2d_SetupCurveDlg.h"
-#include "SUIT_Tools.h"
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qcombobox.h>
-#include <qspinbox.h>
-#include <qtoolbutton.h>
-#include <qgroupbox.h>
-#include <qcolordialog.h>
-
-#ifndef WNT
-using namespace std;
-#endif
-
-#define MARGIN_SIZE      11
-#define SPACING_SIZE     6
-#define MIN_COMBO_WIDTH  100
-#define MIN_SPIN_WIDTH   50
-#define MAX_LINE_WIDTH   100
+
+#include <QtxColorButton.h>
+#include <SUIT_Tools.h>
+
+#include <QGridLayout>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QPushButton>
+#include <QComboBox>
+#include <QSpinBox>
+#include <QPainter>
+
+const int MARGIN_SIZE     = 11;
+const int SPACING_SIZE    = 6;
+const int MIN_COMBO_WIDTH = 100;
+const int MIN_SPIN_WIDTH  = 50;
+const int MAX_LINE_WIDTH  = 10;
+const int MSIZE           = 9;
 
 /*!
-  Constructor
+  \class Plot2d_SetupCurveDlg
+  \brief Dialog box for modifying 2d curve settings.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
 */
 Plot2d_SetupCurveDlg::Plot2d_SetupCurveDlg( QWidget* parent )
-     : QDialog( parent, "Plot2d_SetupCurveDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+: QDialog( parent )
 {
-  setCaption( tr("TLT_SETUP_CURVE") );
-  setSizeGripEnabled( TRUE );
-  QGridLayout* topLayout = new QGridLayout( this ); 
-  topLayout->setSpacing( SPACING_SIZE );
-  topLayout->setMargin( MARGIN_SIZE );
-
-  QGroupBox* TopGroup = new QGroupBox( this );
-  TopGroup->setColumnLayout( 0, Qt::Vertical );
-  TopGroup->layout()->setSpacing( 0 ); TopGroup->layout()->setMargin( 0 );
-  QGridLayout* TopGroupLayout = new QGridLayout( TopGroup->layout() );
-  TopGroupLayout->setAlignment( Qt::AlignTop );
-  TopGroupLayout->setSpacing( SPACING_SIZE ); TopGroupLayout->setMargin( MARGIN_SIZE );
+  setModal( true );
+  setWindowTitle( tr("TLT_SETUP_CURVE") );
+  setSizeGripEnabled( true );
 
-  QLabel* aLineTypeLab = new QLabel( tr( "CURVE_LINE_TYPE_LAB" ), TopGroup );
-  myLineCombo = new QComboBox( false, TopGroup );
+  // curve type
+  QLabel* aLineTypeLab = new QLabel( tr( "CURVE_LINE_TYPE_LAB" ), this );
+  myLineCombo = new QComboBox( this );
   myLineCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myLineCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myLineCombo->insertItem( tr( "NONE_LINE_LBL" ) );
-  myLineCombo->insertItem( tr( "SOLID_LINE_LBL" ) );
-  myLineCombo->insertItem( tr( "DASH_LINE_LBL" ) );
-  myLineCombo->insertItem( tr( "DOT_LINE_LBL" ) );
-  myLineCombo->insertItem( tr( "DASHDOT_LINE_LBL" ) );
-  myLineCombo->insertItem( tr( "DAHSDOTDOT_LINE_LBL" ) );
-  myLineCombo->setCurrentItem( 1 ); // SOLID by default
-
-  QLabel* aLineWidthLab = new QLabel( tr( "CURVE_LINE_WIDTH_LAB" ), TopGroup );
-  myLineSpin = new QSpinBox( 0, MAX_LINE_WIDTH, 1, TopGroup );
+  myLineCombo->setIconSize( QSize( 40, 16 ) );
+
+  // curve width
+  QLabel* aLineWidthLab = new QLabel( tr( "CURVE_LINE_WIDTH_LAB" ), this );
+  myLineSpin = new QSpinBox( this );
+  myLineSpin->setMinimum( 0 );
+  myLineSpin->setMaximum( MAX_LINE_WIDTH );
+  myLineSpin->setSingleStep( 1 );
   myLineSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myLineSpin->setMinimumWidth( MIN_SPIN_WIDTH );
-  myLineSpin->setValue( 0 );        // default width is 0
 
-  QLabel* aMarkerLab = new QLabel( tr( "CURVE_MARKER_TYPE_LAB" ), TopGroup );
-  myMarkerCombo = new QComboBox( false, TopGroup );
+  // marker type
+  QLabel* aMarkerLab = new QLabel( tr( "CURVE_MARKER_TYPE_LAB" ), this );
+  myMarkerCombo = new QComboBox( this );
   myMarkerCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myMarkerCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myMarkerCombo->insertItem( tr( "NONE_MARKER_LBL" ) );
-  myMarkerCombo->insertItem( tr( "CIRCLE_MARKER_LBL" ) );
-  myMarkerCombo->insertItem( tr( "RECTANGLE_MARKER_LBL" ) );
-  myMarkerCombo->insertItem( tr( "DIAMOND_MARKER_LBL" ) );
-  myMarkerCombo->insertItem( tr( "DTRIANGLE_MARKER_LBL" ) );
-  myMarkerCombo->insertItem( tr( "UTRIANGLE_MARKER_LBL" ) );
-  myMarkerCombo->insertItem( tr( "LTRIANGLE_MARKER_LBL" ) );
-  myMarkerCombo->insertItem( tr( "RTRIANGLE_MARKER_LBL" ) );
-  myMarkerCombo->insertItem( tr( "CROSS_MARKER_LBL" ) );
-  myMarkerCombo->insertItem( tr( "XCROSS_MARKER_LBL" ) );
-  myMarkerCombo->setCurrentItem( 1 ); // CIRCLE by default
-
-  QLabel* aColorLab = new QLabel( tr( "CURVE_COLOR_LAB" ), TopGroup );
-  myColorBtn = new QToolButton( TopGroup );
-  myColorBtn->setMinimumSize(25, 25);
-
-  TopGroupLayout->addWidget( aLineTypeLab, 0, 0 );
-  TopGroupLayout->addMultiCellWidget( myLineCombo, 0, 0, 1, 2 );
-  TopGroupLayout->addWidget( aLineWidthLab, 1, 0 );
-  TopGroupLayout->addMultiCellWidget( myLineSpin, 1, 1, 1, 2 );
-  TopGroupLayout->addWidget( aMarkerLab, 2, 0 );
-  TopGroupLayout->addMultiCellWidget( myMarkerCombo, 2, 2, 1, 2 );
-  TopGroupLayout->addWidget( aColorLab, 3, 0 );
-  TopGroupLayout->addWidget( myColorBtn, 3, 1 );
-  TopGroupLayout->setColStretch( 2, 5 );
-
-  QGroupBox* GroupButtons = new QGroupBox( this );
-  GroupButtons->setColumnLayout( 0, Qt::Vertical );
-  GroupButtons->layout()->setSpacing( 0 ); GroupButtons->layout()->setMargin( 0 );
-  QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() );
-  GroupButtonsLayout->setAlignment( Qt::AlignTop );
-  GroupButtonsLayout->setSpacing( SPACING_SIZE ); GroupButtonsLayout->setMargin( MARGIN_SIZE );
-
-  myOkBtn = new QPushButton( tr( "BUT_OK" ), GroupButtons );
-  myOkBtn->setAutoDefault( true ); myOkBtn->setDefault( true );
-  myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ) , GroupButtons );
-  myCancelBtn->setAutoDefault( true );
-
-  GroupButtonsLayout->addWidget( myOkBtn );
-  GroupButtonsLayout->addStretch();
-  GroupButtonsLayout->addWidget( myCancelBtn );
-
-  connect( myColorBtn,  SIGNAL( clicked() ), this, SLOT( onColorChanged() ) );
-  connect( myOkBtn,     SIGNAL( clicked() ), this, SLOT( accept() ) );
-  connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
-  setColor( QColor( 0, 0, 0 ) );
-
-  topLayout->addWidget( TopGroup,     0, 0 );
-  topLayout->addWidget( GroupButtons, 1, 0 );
+  myMarkerCombo->setIconSize( QSize( 16, 16 ) );
+
+  // curve color
+  QLabel* aColorLab = new QLabel( tr( "CURVE_COLOR_LAB" ), this );
+  myColorBtn = new QtxColorButton( this );
+
+  // preview
+  QLabel* aPreviewLab = new QLabel( tr( "CURVE_PREVIEW_LAB" ), this );
+  myPreview = new QLabel( this );
+  myPreview->setFrameStyle( QLabel::Box | QLabel::Sunken );
+  myPreview->setAlignment( Qt::AlignCenter );
+  myPreview->setScaledContents( false );
+
+  myOkBtn     = new QPushButton( tr( "BUT_OK" ),     this );
+  myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
+
+  // layouting widgets
+  QGridLayout* topLayout = new QGridLayout( this );
+  topLayout->setSpacing( SPACING_SIZE );
+  topLayout->setMargin( MARGIN_SIZE );
+
+  topLayout->addWidget( aLineTypeLab,  0, 0 );
+  topLayout->addWidget( myLineCombo,   0, 1, 1, 2 );
+  topLayout->addWidget( aLineWidthLab, 1, 0 );
+  topLayout->addWidget( myLineSpin,    1, 1, 1, 2 );
+  topLayout->addWidget( aMarkerLab,    2, 0 );
+  topLayout->addWidget( myMarkerCombo, 2, 1, 1, 2 );
+  topLayout->addWidget( aColorLab,     3, 0 );
+  topLayout->addWidget( myColorBtn,    3, 1 );
+  topLayout->addWidget( aPreviewLab,   4, 0 );
+  topLayout->addWidget( myPreview,     4, 1, 1, 2 );
+  topLayout->setColumnStretch( 2, 5 );
+
+  QHBoxLayout* btnLayout = new QHBoxLayout;
+  btnLayout->setSpacing( SPACING_SIZE );
+  btnLayout->setMargin( 0 );
+
+  btnLayout->addWidget( myOkBtn );
+  btnLayout->addSpacing( 20 );
+  btnLayout->addStretch();
+  btnLayout->addWidget( myCancelBtn );
+
+  topLayout->addLayout( btnLayout, 5, 0, 1, 3 );
+
+  // fill then combo boxes
+  myLineCombo->addItem( lineIcon( Plot2d::NoPen ),      tr( "NONE_LINE_LBL" ) );
+  myLineCombo->addItem( lineIcon( Plot2d::Solid ),      tr( "SOLID_LINE_LBL" ) );
+  myLineCombo->addItem( lineIcon( Plot2d::Dash ),       tr( "DASH_LINE_LBL" ) );
+  myLineCombo->addItem( lineIcon( Plot2d::Dot ),        tr( "DOT_LINE_LBL" ) );
+  myLineCombo->addItem( lineIcon( Plot2d::DashDot ),    tr( "DASHDOT_LINE_LBL" ) );
+  myLineCombo->addItem( lineIcon( Plot2d::DashDotDot ), tr( "DAHSDOTDOT_LINE_LBL" ) );
+
+  myMarkerCombo->addItem( markerIcon( Plot2d::None ),      tr( "NONE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( markerIcon( Plot2d::Circle ),    tr( "CIRCLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( markerIcon( Plot2d::Rectangle ), tr( "RECTANGLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( markerIcon( Plot2d::Diamond ),   tr( "DIAMOND_MARKER_LBL" ) );
+  myMarkerCombo->addItem( markerIcon( Plot2d::DTriangle ), tr( "DTRIANGLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( markerIcon( Plot2d::UTriangle ), tr( "UTRIANGLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( markerIcon( Plot2d::LTriangle ), tr( "LTRIANGLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( markerIcon( Plot2d::RTriangle ), tr( "RTRIANGLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( markerIcon( Plot2d::Cross ),     tr( "CROSS_MARKER_LBL" ) );
+  myMarkerCombo->addItem( markerIcon( Plot2d::XCross ),    tr( "XCROSS_MARKER_LBL" ) );
+
+  // default settings
+  setLine( Plot2d::Solid, 0 );   // solid line, width = 0
+  setMarker( Plot2d::Circle );   // circle
+  setColor( QColor( 0, 0, 0 ) ); // black
+
+  // connections
+  connect( myLineCombo,   SIGNAL( activated( int ) ),    this, SLOT( updatePreview() ) );
+  connect( myLineSpin,    SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ) );
+  connect( myMarkerCombo, SIGNAL( activated( int ) ),    this, SLOT( updatePreview() ) );
+  connect( myColorBtn,    SIGNAL( changed( QColor ) ),   this, SLOT( updatePreview() ) );
+  connect( myOkBtn,       SIGNAL( clicked() ),           this, SLOT( accept() ) );
+  connect( myCancelBtn,   SIGNAL( clicked() ),           this, SLOT( reject() ) );
 
   SUIT_Tools::centerWidget( this, parent );
+  updatePreview();
 }
+
 /*!
-  Destructor
+  \brief Destructor.
 */
 Plot2d_SetupCurveDlg::~Plot2d_SetupCurveDlg()
 {
 }
+
 /*!
-  Sets line style and width
+  \brief Set curve line type and width.
+  \param type curve line type
+  \param width curve line width
+  \sa getLine(), getLineWidth()
 */
-void Plot2d_SetupCurveDlg::setLine( const int line, const int width )
+void Plot2d_SetupCurveDlg::setLine( Plot2d::LineType type, const int width )
 {
-  myLineCombo->setCurrentItem( line );
+  myLineCombo->setCurrentIndex( (int)type );
+  if ( width > myLineSpin->maximum() )
+    myLineSpin->setMaximum( width );
   myLineSpin->setValue( width );
+  updatePreview();
 }
+
 /*!
-  Gets line style
+  \brief Get curve line type.
+  \return chosen curve line type
+  \sa setLine(), getLineWidth()
 */
-int Plot2d_SetupCurveDlg::getLine() const
+Plot2d::LineType Plot2d_SetupCurveDlg::getLine() const
 {
-  return myLineCombo->currentItem();
+  return (Plot2d::LineType)myLineCombo->currentIndex();
 }
+
 /*!
-  Gets line width
+  \brief Get curve line width.
+  \return chosen curve line width
+  \sa setLine(), getLine()
 */
 int Plot2d_SetupCurveDlg::getLineWidth() const
 {
   return myLineSpin->value();
 }
+
 /*!
-  Sets marker style
+  \brief Set curve marker type.
+  \param type curve marker type
+  \sa getMarker()
 */
-void Plot2d_SetupCurveDlg::setMarker( const int marker )
+void Plot2d_SetupCurveDlg::setMarker( Plot2d::MarkerType type )
 {
-  myMarkerCombo->setCurrentItem( marker );
+  myMarkerCombo->setCurrentIndex( (int)type );
+  updatePreview();
 }
+
 /*!
-  Gets marker style
+  \brief Get curve marker type.
+  \return chosen curve marker type
+  \sa setMarker()
 */
-int Plot2d_SetupCurveDlg::getMarker() const 
+Plot2d::MarkerType Plot2d_SetupCurveDlg::getMarker() const
 {
-  return myMarkerCombo->currentItem();
+  return (Plot2d::MarkerType)myMarkerCombo->currentIndex();
 }
+
 /*!
-  Sets color
+  \brief Set curve color.
+  \param color curve color
+  \sa getColor()
 */
 void Plot2d_SetupCurveDlg::setColor( const QColor& color )
 {
-  QPalette pal = myColorBtn->palette();
-  QColorGroup ca = pal.active();
-  ca.setColor( QColorGroup::Button, color );
-  QColorGroup ci = pal.inactive();
-  ci.setColor( QColorGroup::Button, color );
-  pal.setActive( ca );
-  pal.setInactive( ci );
-  myColorBtn->setPalette( pal );
+  myColorBtn->setColor( color );
+  updatePreview();
 }
+
 /*!
-  Gets color
+  \brief Get curve color.
+  \return curve color
+  \sa setColor()
 */
-QColor Plot2d_SetupCurveDlg::getColor() const 
+QColor Plot2d_SetupCurveDlg::getColor() const
 {
-  return myColorBtn->palette().active().button();
+  return myColorBtn->color();
 }
+
 /*!
-  <Color> button slot, invokes color selection dialog box
+  \brief Create icon pixmap according to the line type.
+  \param type line type
+  \return icon
 */
-void Plot2d_SetupCurveDlg::onColorChanged()
+QPixmap Plot2d_SetupCurveDlg::lineIcon( Plot2d::LineType type ) const
 {
-  QColor color = QColorDialog::getColor( getColor() );
-  if ( color.isValid() ) {
-    setColor( color );
-  }
+  QSize sz = myLineCombo->iconSize();
+  QPixmap px( sz );
+  px.fill( QColor( 255, 255, 255, 0 ) );
+  QPainter p( &px );
+  Plot2d::drawLine( &p, 5, sz.height()/2, sz.width()-5, sz.height()/2, type,
+                   myLineCombo->palette().color( QPalette::Text ), 1 );
+  return px;
 }
 
+/*!
+  \brief Create icon pixmap according to the marker type.
+  \param type marker type
+  \return icon
+*/
+QPixmap Plot2d_SetupCurveDlg::markerIcon( Plot2d::MarkerType type ) const
+{
+  QSize sz = myMarkerCombo->iconSize();
+  QPixmap px( sz );
+  px.fill( QColor( 255, 255, 255, 0 ) );
+  QPainter p( &px );
+  Plot2d::drawMarker( &p, sz.width()/2, sz.height()/2, MSIZE, MSIZE, type,
+                     myMarkerCombo->palette().color( QPalette::Text ) );
+  return px;
+}
 
+/*
+  \brief Update preview widget.
+*/
+void Plot2d_SetupCurveDlg::updatePreview()
+{
+  QSize sz( 150, 20 );
+  QPixmap px( sz );
+  px.fill( palette().color( QPalette::Background ) );
 
+  QPainter p( &px );
 
+  Plot2d::drawLine( &p, 5+MSIZE/2, sz.height()/2, sz.width()-5-MSIZE/2, sz.height()/2,
+                   getLine(), getColor(), getLineWidth() );
+  Plot2d::drawMarker( &p, 5+MSIZE/2, sz.height()/2, MSIZE, MSIZE,
+                     getMarker(), getColor() );
+  Plot2d::drawMarker( &p, sz.width()-5-MSIZE/2, sz.height()/2, MSIZE, MSIZE,
+                     getMarker(), getColor() );
 
+  myPreview->setPixmap( px );
+}
index 84d530aa6b07a3061b862e502adbcad2b3322e58..1c178a4a7c592a3aa30712ecf19d79079679925a 100644 (file)
@@ -1,72 +1,75 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  SALOME Plot2d : implementation of desktop and GUI kernel
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-//  File   : Plot2d_SetupCurveDlg.h
-//  Author : Vadim SANDLER
-//  Module : SALOME
-
-#ifndef Plot2d_SetupCurveDlg_H
-#define Plot2d_SetupCurveDlg_H
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d_SetupCurveDlg.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef PLOT2D_SETUPCURVEDLG_H
+#define PLOT2D_SETUPCURVEDLG_H
 
 #include "Plot2d.h"
 
-#include <qdialog.h>
-
-/*!
-  \class Plot2d_SetupCurveDlg
-  Dialog box for setup Plot2d curve
-*/
+#include <QDialog>
 
 class QPushButton;
 class QComboBox;
 class QSpinBox;
-class QToolButton;
+class QLabel;
+class QtxColorButton;
 
 class PLOT2D_EXPORT Plot2d_SetupCurveDlg : public QDialog
 { 
   Q_OBJECT
 
 public:
-  Plot2d_SetupCurveDlg( QWidget* parent = 0 );
+  Plot2d_SetupCurveDlg( QWidget* = 0 );
   ~Plot2d_SetupCurveDlg();
 
 public:
-  void   setLine( const int line, const int width );
-  int    getLine() const;
-  int    getLineWidth() const;
-  void   setMarker( const int marker );
-  int    getMarker() const ;
-  void   setColor( const QColor& color );
-  QColor getColor() const;
-  
-protected slots:
-  void   onColorChanged();
+  void               setLine( Plot2d::LineType, const int );
+  Plot2d::LineType   getLine() const;
+  int                getLineWidth() const;
+
+  void               setMarker( Plot2d::MarkerType );
+  Plot2d::MarkerType getMarker() const ;
+
+  void               setColor( const QColor& );
+  QColor             getColor() const;
+
+private:
+  QPixmap            lineIcon( Plot2d::LineType ) const;
+  QPixmap            markerIcon( Plot2d::MarkerType ) const;
+
+private slots:
+  void               updatePreview();
 
 private:
-  QPushButton* myOkBtn;
-  QPushButton* myCancelBtn;
-  QComboBox*   myLineCombo;
-  QSpinBox*    myLineSpin;
-  QComboBox*   myMarkerCombo;
-  QToolButton* myColorBtn;
+  QPushButton*       myOkBtn;
+  QPushButton*       myCancelBtn;
+  QComboBox*         myLineCombo;
+  QSpinBox*          myLineSpin;
+  QComboBox*         myMarkerCombo;
+  QtxColorButton*    myColorBtn;
+  QLabel*            myPreview;
 };
 
-#endif // Plot2d_SetupCurveDlg_H
+#endif // PLOT2D_SETUPCURVEDLG_H
 
index e8c8b54c10ce16f92d9d9c705a88cb2382d9d542..211a2faea272afd4631045b7d45a4182a57a7f82 100755 (executable)
@@ -1,59 +1,71 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d_SetupViewDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : Plot2d_SetupViewDlg.cxx
-//  Author : Vadim SANDLER
-//  Module : SALOME
-//  $Header$
-
 #include "Plot2d_SetupViewDlg.h"
 
-#include "SUIT_Session.h"
-#include "SUIT_Application.h"
+#include <SUIT_Session.h>
+#include <SUIT_Application.h>
+#include <QtxColorButton.h>
 
-#include <qcheckbox.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qspinbox.h>
-#include <qtoolbutton.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qcolordialog.h>
-#include <qtabwidget.h>
+#include <QCheckBox>
+#include <QLineEdit>
+#include <QComboBox>
+#include <QSpinBox>
+#include <QGridLayout>
+#include <QHBoxLayout>
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QTabWidget>
 
-#define MARGIN_SIZE          11
-#define SPACING_SIZE         6
-#define MIN_EDIT_WIDTH       200
-#define MIN_COMBO_WIDTH      100
-#define MIN_SPIN_WIDTH       70
+const int MARGIN_SIZE     = 11;
+const int SPACING_SIZE    = 6;
+const int MIN_EDIT_WIDTH  = 200;
+const int MIN_COMBO_WIDTH = 100;
+const int MIN_SPIN_WIDTH  = 70;
 
 /*!
-  Constructor
+  \class Plot2d_SetupViewDlg
+  \brief Dialog box to setup Plot2d view window.
 */
-Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bool secondAxisY )
-    : QDialog( parent, "Plot2d_SetupViewDlg", true, 
-         WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+  \param showDefCheck if \c true, show "Set settings as default" check box
+  \param secondAxisY if \c true, show widgets for the second (right) vertical axis
+*/
+Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, 
+                                         bool showDefCheck, 
+                                         bool secondAxisY )
+: QDialog( parent ), 
+  mySecondAxisY( secondAxisY )
 {
-  mySecondAxisY = secondAxisY;
-  setCaption( tr("TLT_SETUP_PLOT2D_VIEW") );
+  setModal( true );
+  setWindowTitle( tr("TLT_SETUP_PLOT2D_VIEW") );
   setSizeGripEnabled( TRUE );
+
   QGridLayout* topLayout = new QGridLayout( this ); 
   topLayout->setSpacing( SPACING_SIZE );
   topLayout->setMargin( MARGIN_SIZE );
@@ -63,53 +75,58 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   myTitleEdit  = new QLineEdit( this );
   myTitleEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myTitleEdit->setMinimumWidth( MIN_EDIT_WIDTH );
+
   // curve type : points, lines, spline
   QLabel* aCurveLab = new QLabel( tr( "PLOT2D_CURVE_TYPE_LBL" ), this );
-  myCurveCombo      = new QComboBox( false, this );
+  myCurveCombo      = new QComboBox( this );
   myCurveCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myCurveCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myCurveCombo->insertItem( tr( "PLOT2D_CURVE_TYPE_POINTS" ) );
-  myCurveCombo->insertItem( tr( "PLOT2D_CURVE_TYPE_LINES" ) );
-  myCurveCombo->insertItem( tr( "PLOT2D_CURVE_TYPE_SPLINE" ) );
+  myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_POINTS" ) );
+  myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_LINES" ) );
+  myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_SPLINE" ) );
+
   // legend
   myLegendCheck = new QCheckBox( tr( "PLOT2D_ENABLE_LEGEND" ), this );
-  myLegendCombo = new QComboBox( false, this );
+  myLegendCombo = new QComboBox( this );
   myLegendCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myLegendCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_LEFT" ) );
-  myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_RIGHT" ) );
-  myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_TOP" ) );
-  myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_BOTTOM" ) );
+  myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_LEFT" ) );
+  myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_RIGHT" ) );
+  myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_TOP" ) );
+  myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_BOTTOM" ) );
+
   // marker size
   QLabel* aMarkerLab  = new QLabel( tr( "PLOT2D_MARKER_SIZE_LBL" ), this );
-  myMarkerSpin = new QSpinBox( 0, 100, 1, this );
+  myMarkerSpin = new QSpinBox( this );
+  myMarkerSpin->setMinimum( 0 );
+  myMarkerSpin->setMaximum( 100 );
+  myMarkerSpin->setSingleStep( 1 );
   myMarkerSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myMarkerSpin->setMinimumWidth( MIN_SPIN_WIDTH );
 
   // background color
   QLabel* aBGLab  = new QLabel( tr( "PLOT2D_BACKGROUND_COLOR_LBL" ), this );
-  myBackgroundBtn = new QToolButton( this );
-  myBackgroundBtn->setMinimumWidth(20);
+  myBackgroundBtn = new QtxColorButton( this );
 
   // scale mode
   QGroupBox* aScaleGrp = new QGroupBox( tr( "PLOT2D_SCALE_TLT" ), this );
-  aScaleGrp->setColumnLayout(0, Qt::Vertical );
-  aScaleGrp->layout()->setSpacing( 0 );  aScaleGrp->layout()->setMargin( 0 );
-  QGridLayout* aScaleLayout = new QGridLayout( aScaleGrp->layout() );
+  QGridLayout* aScaleLayout = new QGridLayout( aScaleGrp );
   aScaleLayout->setMargin( MARGIN_SIZE ); aScaleLayout->setSpacing( SPACING_SIZE );
+  aScaleGrp->setLayout( aScaleLayout );
 
   QLabel* xScaleLab = new QLabel( tr( "PLOT2D_SCALE_MODE_HOR" ), aScaleGrp );
-  myXModeCombo = new QComboBox( false, aScaleGrp );
+  myXModeCombo = new QComboBox( aScaleGrp );
   myXModeCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myXModeCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myXModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
-  myXModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
+  myXModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
+  myXModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
+
   QLabel* yScaleLab = new QLabel( tr( "PLOT2D_SCALE_MODE_VER" ), aScaleGrp );
-  myYModeCombo = new QComboBox( false, aScaleGrp );
+  myYModeCombo = new QComboBox( aScaleGrp );
   myYModeCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myYModeCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myYModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
-  myYModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
+  myYModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
+  myYModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
 
   aScaleLayout->addWidget( xScaleLab,    0, 0 );
   aScaleLayout->addWidget( myXModeCombo, 0, 1 );
@@ -117,34 +134,45 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   aScaleLayout->addWidget( myYModeCombo, 0, 3 );
 
   // tab widget for choose properties of axis 
-  QTabWidget* aTabWidget = new QTabWidget( this, "tabWidget" );
+  QTabWidget* aTabWidget = new QTabWidget( this );
 
   // widget for parameters on Ox
   QWidget* aXWidget = new QWidget(aTabWidget);
   QGridLayout* aXLayout = new QGridLayout( aXWidget ); 
   aXLayout->setSpacing( SPACING_SIZE );
   aXLayout->setMargin( MARGIN_SIZE );
+
   // axis title
   myTitleXCheck = new QCheckBox( tr( "PLOT2D_ENABLE_HOR_TITLE" ), aXWidget );
   myTitleXEdit  = new QLineEdit( aXWidget );
   myTitleXEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myTitleXEdit->setMinimumWidth( MIN_EDIT_WIDTH );
-  aXLayout->addWidget( myTitleXCheck,         1,    0    );
-  aXLayout->addMultiCellWidget( myTitleXEdit, 1, 1, 1, 3 );
+  aXLayout->addWidget( myTitleXCheck,1,    0    );
+  aXLayout->addWidget( myTitleXEdit, 1, 1, 1, 3 );
+
   // grid
   QGroupBox* aGridGrpX = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aXWidget );
-  aGridGrpX->setColumnLayout(0, Qt::Vertical );
-  aGridGrpX->layout()->setSpacing( 0 );  aGridGrpX->layout()->setMargin( 0 );
-  QGridLayout* aGridLayoutX = new QGridLayout( aGridGrpX->layout() );
-  aGridLayoutX->setMargin( MARGIN_SIZE ); aGridLayoutX->setSpacing( SPACING_SIZE );
+  QGridLayout* aGridLayoutX = new QGridLayout( aGridGrpX );
+  aGridLayoutX->setMargin( MARGIN_SIZE ); 
+  aGridLayoutX->setSpacing( SPACING_SIZE );
+
   myXGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_HOR_MAJOR" ), aGridGrpX );
+
   QLabel* aXMajLbl  = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpX);
-  myXGridSpin       = new QSpinBox( 1, 100, 1, aGridGrpX );
+  myXGridSpin       = new QSpinBox( aGridGrpX );
+  myXGridSpin->setMinimum( 1 );
+  myXGridSpin->setMaximum( 100 );
+  myXGridSpin->setSingleStep( 1 );
   myXGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myXGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
+  
   myXMinGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_HOR_MINOR" ), aGridGrpX );
+  
   QLabel* aXMinLbl     = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpX);
-  myXMinGridSpin       = new QSpinBox( 1, 100, 1, aGridGrpX );
+  myXMinGridSpin       = new QSpinBox( aGridGrpX );
+  myXMinGridSpin->setMinimum( 1 );
+  myXMinGridSpin->setMaximum( 100 );
+  myXMinGridSpin->setSingleStep( 1 );
   myXMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myXMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
 
@@ -154,7 +182,7 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   aGridLayoutX->addWidget( myXMinGridCheck, 1, 0 );
   aGridLayoutX->addWidget( aXMinLbl,        1, 1 );
   aGridLayoutX->addWidget( myXMinGridSpin,  1, 2 );
-  aXLayout->addMultiCellWidget( aGridGrpX, 3, 3, 0, 3 );
+  aXLayout->addWidget( aGridGrpX, 3, 0, 1, 4 );
 
   aTabWidget->addTab( aXWidget, tr( "INF_AXES_X" ) );
 
@@ -163,27 +191,38 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   QGridLayout* aYLayout = new QGridLayout( aYWidget ); 
   aYLayout->setSpacing( SPACING_SIZE );
   aYLayout->setMargin( MARGIN_SIZE );
+
   // axis title
   myTitleYCheck = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget );
   myTitleYEdit  = new QLineEdit( aYWidget );
   myTitleYEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myTitleYEdit->setMinimumWidth( MIN_EDIT_WIDTH );
-  aYLayout->addWidget( myTitleYCheck,         1,    0    );
-  aYLayout->addMultiCellWidget( myTitleYEdit, 1, 1, 1, 3 );
+  aYLayout->addWidget( myTitleYCheck,1,    0    );
+  aYLayout->addWidget( myTitleYEdit, 1, 1, 1, 3 );
+
   // grid
   QGroupBox* aGridGrpY = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget );
-  aGridGrpY->setColumnLayout(0, Qt::Vertical );
-  aGridGrpY->layout()->setSpacing( 0 );  aGridGrpY->layout()->setMargin( 0 );
-  QGridLayout* aGridLayoutY = new QGridLayout( aGridGrpY->layout() );
+  QGridLayout* aGridLayoutY = new QGridLayout( aGridGrpY );
+  aGridGrpY->setLayout( aGridLayoutY );
   aGridLayoutY->setMargin( MARGIN_SIZE ); aGridLayoutY->setSpacing( SPACING_SIZE );
+
   myYGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY );
+
   QLabel* aYMajLbl  = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY);
-  myYGridSpin       = new QSpinBox( 1, 100, 1, aGridGrpY );
+  myYGridSpin       = new QSpinBox( aGridGrpY );
+  myYGridSpin->setMinimum( 1 );
+  myYGridSpin->setMaximum( 100 );
+  myYGridSpin->setSingleStep( 1 );
   myYGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myYGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
+
   myYMinGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY );
+
   QLabel* aYMinLbl     = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY);
-  myYMinGridSpin       = new QSpinBox( 1, 100, 1, aGridGrpY );
+  myYMinGridSpin       = new QSpinBox( aGridGrpY );
+  myYMinGridSpin->setMinimum( 1 );
+  myYMinGridSpin->setMaximum( 100 );
+  myYMinGridSpin->setSingleStep( 1 );
   myYMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myYMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
 
@@ -193,38 +232,49 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   aGridLayoutY->addWidget( myYMinGridCheck, 1, 0 );
   aGridLayoutY->addWidget( aYMinLbl,        1, 1 );
   aGridLayoutY->addWidget( myYMinGridSpin,  1, 2 );
-  aYLayout->addMultiCellWidget( aGridGrpY, 3, 3, 0, 3 );
+  aYLayout->addWidget( aGridGrpY, 3, 0, 1, 4 );
 
   aTabWidget->addTab( aYWidget, tr( "INF_AXES_Y_LEFT" ) );
 
   // if exist second axis Oy, addition new tab widget for right axis
-  if (mySecondAxisY) {
+  if ( mySecondAxisY ) {
     // widget for parameters on Oy
-    QWidget* aYWidget2 = new QWidget(aTabWidget);
+    QWidget* aYWidget2 = new QWidget( aTabWidget );
     QGridLayout* aYLayout2 = new QGridLayout( aYWidget2 );
     aYLayout2->setSpacing( SPACING_SIZE );
     aYLayout2->setMargin( MARGIN_SIZE );
+
     // axis title
     myTitleY2Check = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget2 );
     myTitleY2Edit  = new QLineEdit( aYWidget2 );
     myTitleY2Edit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
     myTitleY2Edit->setMinimumWidth( MIN_EDIT_WIDTH );
-    aYLayout2->addWidget( myTitleY2Check,         1,    0    );
-    aYLayout2->addMultiCellWidget( myTitleY2Edit, 1, 1, 1, 3 );
+    aYLayout2->addWidget( myTitleY2Check,1,    0    );
+    aYLayout2->addWidget( myTitleY2Edit, 1, 1, 1, 3 );
+
     // grid
     QGroupBox* aGridGrpY2 = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget2 );
-    aGridGrpY2->setColumnLayout(0, Qt::Vertical );
-    aGridGrpY2->layout()->setSpacing( 0 );  aGridGrpY2->layout()->setMargin( 0 );
-    QGridLayout* aGridLayoutY2 = new QGridLayout( aGridGrpY2->layout() );
+    QGridLayout* aGridLayoutY2 = new QGridLayout( aGridGrpY2 );
+    aGridGrpY2->setLayout( aGridLayoutY2 );
     aGridLayoutY2->setMargin( MARGIN_SIZE ); aGridLayoutY2->setSpacing( SPACING_SIZE );
+
     myY2GridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY2 );
+
     QLabel* aY2MajLbl  = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY2);
-    myY2GridSpin       = new QSpinBox( 1, 100, 1, aGridGrpY2 );
+    myY2GridSpin       = new QSpinBox( aGridGrpY2 );
+    myY2GridSpin->setMinimum( 1 );
+    myY2GridSpin->setMaximum( 100 );
+    myY2GridSpin->setSingleStep( 1 );
     myY2GridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
     myY2GridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
+
     myY2MinGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY2 );
+
     QLabel* aY2MinLbl     = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY2);
-    myY2MinGridSpin       = new QSpinBox( 1, 100, 1, aGridGrpY2 );
+    myY2MinGridSpin       = new QSpinBox( aGridGrpY2 );
+    myY2MinGridSpin->setMinimum( 1 );
+    myY2MinGridSpin->setMaximum( 100 );
+    myY2MinGridSpin->setSingleStep( 1 );
     myY2MinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
     myY2MinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
 
@@ -234,7 +284,7 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
     aGridLayoutY2->addWidget( myY2MinGridCheck, 1, 0 );
     aGridLayoutY2->addWidget( aY2MinLbl,        1, 1 );
     aGridLayoutY2->addWidget( myY2MinGridSpin,  1, 2 );
-    aYLayout2->addMultiCellWidget( aGridGrpY2, 3, 3, 0, 3 );
+    aYLayout2->addWidget( aGridGrpY2, 3, 0, 1, 4 );
 
     aTabWidget->addTab( aYWidget2, tr( "INF_AXES_Y_RIGHT" ) );
   }
@@ -247,11 +297,13 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
     myY2MinGridSpin  = 0;
     myY2ModeCombo    = 0;
   }
-  aTabWidget->setCurrentPage( 0 );
+
+  aTabWidget->setCurrentIndex( 0 );
   /* "Set as default" check box */
+
   myDefCheck = new QCheckBox( tr( "PLOT2D_SET_AS_DEFAULT_CHECK" ), this );
 
-  /* OK/Cancel/Help buttons */
+  /* OK/Cancel buttons */
   myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
   myOkBtn->setAutoDefault( TRUE );
   myOkBtn->setDefault( TRUE );
@@ -266,24 +318,24 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   btnLayout->addWidget( myHelpBtn );
   
   // layout widgets
-  topLayout->addWidget( myTitleCheck,          0,    0    );
-  topLayout->addMultiCellWidget( myTitleEdit,  0, 0, 1, 3 );
-  topLayout->addWidget( aCurveLab,             1,    0    );
-  topLayout->addWidget( myCurveCombo,          1,    1    );
-  topLayout->addWidget( myLegendCheck,         1,    2    );
-  topLayout->addWidget( myLegendCombo,         1,    3    );
-  topLayout->addWidget( aMarkerLab,            2,    0    );
-  topLayout->addWidget( myMarkerSpin,          2,    1    );
+  topLayout->addWidget( myTitleCheck,  0,    0    );
+  topLayout->addWidget( myTitleEdit,   0, 1, 1, 3 );
+  topLayout->addWidget( aCurveLab,     1,    0    );
+  topLayout->addWidget( myCurveCombo,  1,    1    );
+  topLayout->addWidget( myLegendCheck, 1,    2    );
+  topLayout->addWidget( myLegendCombo, 1,    3    );
+  topLayout->addWidget( aMarkerLab,    2,    0    );
+  topLayout->addWidget( myMarkerSpin,  2,    1    );
   QHBoxLayout* bgLayout = new QHBoxLayout;
   bgLayout->addWidget( myBackgroundBtn ); bgLayout->addStretch();
-  topLayout->addWidget( aBGLab,                2,    2    );
-  topLayout->addLayout( bgLayout,              2,    3    );
-  topLayout->addMultiCellWidget( aScaleGrp,    3, 3, 0, 3 );
-  topLayout->addMultiCellWidget( aTabWidget,   4, 4, 0, 3 );
-  topLayout->addMultiCellWidget( myDefCheck,   5, 5, 0, 3 );
+  topLayout->addWidget( aBGLab,        2,    2    );
+  topLayout->addLayout( bgLayout,      2,    3    );
+  topLayout->addWidget( aScaleGrp,     3, 0, 1, 4 );
+  topLayout->addWidget( aTabWidget,    4, 0, 1, 4 );
+  topLayout->addWidget( myDefCheck,    5, 0, 1, 4 );
   topLayout->setRowStretch( 5, 5 );
 
-  topLayout->addMultiCellLayout( btnLayout,    6, 6, 0, 3 );
+  topLayout->addLayout( btnLayout,     6, 0, 1, 4 );
   
   if ( !showDefCheck )
     myDefCheck->hide();
@@ -291,7 +343,6 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   connect( myTitleCheck,    SIGNAL( clicked() ), this, SLOT( onMainTitleChecked() ) );
   connect( myTitleXCheck,   SIGNAL( clicked() ), this, SLOT( onXTitleChecked() ) );
   connect( myTitleYCheck,   SIGNAL( clicked() ), this, SLOT( onYTitleChecked() ) );
-  connect( myBackgroundBtn, SIGNAL( clicked() ), this, SLOT( onBackgroundClicked() ) );
   connect( myLegendCheck,   SIGNAL( clicked() ), this, SLOT( onLegendChecked() ) );
   connect( myXGridCheck,    SIGNAL( clicked() ), this, SLOT( onXGridMajorChecked() ) );
   connect( myYGridCheck,    SIGNAL( clicked() ), this, SLOT( onYGridMajorChecked() ) );
@@ -302,7 +353,7 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   connect( myCancelBtn,     SIGNAL( clicked() ), this, SLOT( reject() ) );
   connect( myHelpBtn,       SIGNAL( clicked() ), this, SLOT( onHelp() ) );
   
-  if (mySecondAxisY) {
+  if ( mySecondAxisY ) {
     connect( myTitleY2Check,   SIGNAL( clicked() ), this, SLOT( onY2TitleChecked() ) );
     connect( myY2GridCheck,    SIGNAL( clicked() ), this, SLOT( onY2GridMajorChecked() ) );
     connect( myY2MinGridCheck, SIGNAL( clicked() ), this, SLOT( onY2GridMinorChecked() ) );
@@ -317,7 +368,7 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   onXGridMajorChecked();
   onYGridMajorChecked();
   onXGridMinorChecked();
-  if (mySecondAxisY) {
+  if ( mySecondAxisY ) {
     onY2TitleChecked();
     onY2GridMajorChecked();
     onY2GridMinorChecked();
@@ -325,13 +376,17 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 Plot2d_SetupViewDlg::~Plot2d_SetupViewDlg()
 {
 }
+
 /*!
-  Sets main title attributes
+  \brief Set main title attributes.
+  \param enable if \c true main title is enabled
+  \param title main title
+  \sa isMainTitleEnabled(), getMainTitle()
 */
 void Plot2d_SetupViewDlg::setMainTitle( bool enable, const QString& title )
 {
@@ -340,22 +395,32 @@ void Plot2d_SetupViewDlg::setMainTitle( bool enable, const QString& title )
     myTitleEdit->setText( title );
   onMainTitleChecked();
 }
+
 /*!
-  Returns TRUE if main title is enabled
+  \brief Check if main title is enabled.
+  \return \c true if main title is enabled
+  \sa setMainTitle()
 */
 bool Plot2d_SetupViewDlg::isMainTitleEnabled()
 {
   return myTitleCheck->isChecked();
 }
+
 /*!
-  Gets main title
+  \brief Get main title.
+  \return main title
+  \sa setMainTitle()
 */
 QString Plot2d_SetupViewDlg::getMainTitle()
 {
   return myTitleEdit->text();
 }
+
 /*!
-  Sets horizontal axis title attributes
+  \brief Set horizontal axis title attributes.
+  \param enable if \c true horizontal axis title is enabled
+  \param title horizontal axis title
+  \sa isXTitleEnabled(), getXTitle()
 */
 void Plot2d_SetupViewDlg::setXTitle( bool enable, const QString& title )
 {
@@ -364,22 +429,32 @@ void Plot2d_SetupViewDlg::setXTitle( bool enable, const QString& title )
     myTitleXEdit->setText( title );
   onXTitleChecked();
 }
+
 /*!
-  Returns TRUE if horizontal axis title is enabled
+  \brief Check if main title is enabled.
+  \return \c true if horizontal axis title is enabled
+  \sa setXTitle()
 */
 bool Plot2d_SetupViewDlg::isXTitleEnabled()
 {
   return myTitleXCheck->isChecked();
 }
+
 /*!
-  Gets horizontal axis title
+  \brief Get horizontal axis title.
+  \return horizontal axis title
+  \sa setXTitle()
 */
 QString Plot2d_SetupViewDlg::getXTitle()
 {
   return myTitleXEdit->text();
 }
+
 /*!
-  Sets vertical left axis title attributes
+  \brief Set left vertical axis title attributes.
+  \param enable if \c true left vertical axis title is enabled
+  \param title left vertical axis title
+  \sa setY2Title(), isYTitleEnabled(), getYTitle()
 */
 void Plot2d_SetupViewDlg::setYTitle( bool enable, const QString& title )
 {
@@ -388,8 +463,12 @@ void Plot2d_SetupViewDlg::setYTitle( bool enable, const QString& title )
     myTitleYEdit->setText( title );
   onYTitleChecked();
 }
+
 /*!
-  Sets vertical right axis title attributes
+  \brief Set right vertical axis title attributes.
+  \param enable if \c true right vertical axis title is enabled
+  \param title right vertical axis title
+  \sa setYTitle(), isY2TitleEnabled(), getY2Title()
 */
 void Plot2d_SetupViewDlg::setY2Title( bool enable, const QString& title )
 {
@@ -398,112 +477,153 @@ void Plot2d_SetupViewDlg::setY2Title( bool enable, const QString& title )
     myTitleY2Edit->setText( title );
   onY2TitleChecked();
 }
+
 /*!
-  Returns TRUE if vertical left axis title is enabled
+  \brief Check if left vertical axis title is enabled.
+  \return \c true if right vertical axis title is enabled
+  \sa setYTitle()
 */
 bool Plot2d_SetupViewDlg::isYTitleEnabled()
 {
   return myTitleYCheck->isChecked();
 }
+
 /*!
-  Returns TRUE if vertical right axis title is enabled
+  \brief Check if right vertical axis title is enabled.
+  \return \c true if right vertical axis title is enabled
+  \sa setY2Title()
 */
 bool Plot2d_SetupViewDlg::isY2TitleEnabled()
 {
   return myTitleY2Check->isChecked();
 }
+
 /*!
-  Gets vertical left axis title
+  \brief Get left vertical axis title.
+  \return left vertical axis title
+  \sa setYTitle()
 */
 QString Plot2d_SetupViewDlg::getYTitle()
 {
   return myTitleYEdit->text();
 }
+
 /*!
-  Gets vertical right axis title
+  \brief Get right vertical axis title.
+  \return right vertical axis title
+  \sa setY2Title()
 */
 QString Plot2d_SetupViewDlg::getY2Title()
 {
   return myTitleY2Edit->text();
 }
+
 /*!
-  Sets curve type : 0 - points, 1 - lines, 2 - splines
+  \brief Set curve type.
+  \param type curve type: 0 (points), 1 (lines) or 2 (splines)
+  \sa getCurveType()
 */
 void Plot2d_SetupViewDlg::setCurveType( const int type )
 {
-  myCurveCombo->setCurrentItem( type );
+  myCurveCombo->setCurrentIndex( type );
 }
+
 /*!
-  Gets curve type : 0 - points, 1 - lines, 2 - splines
+  \brief Get curve type.
+  \return curve type: 0 (points), 1 (lines) or 2 (splines)
+  \sa setCurveType()
 */
 int Plot2d_SetupViewDlg::getCurveType()
 {
-  return myCurveCombo->currentItem();
+  return myCurveCombo->currentIndex();
 }
+
 /*!
-  Sets legend attributes : pos = 0 - left, 1 - right, 2 - top, 3 - bottom
+  \brief Set legend attribute.
+  \param if \c true legend is shown
+  \param pos legend position: 0 (left), 1 (right), 2 (top), 3 (bottom)
+  \sa isLegendEnabled(), getLegendPos()
 */
 void Plot2d_SetupViewDlg::setLegend( bool enable, int pos )
 {
   myLegendCheck->setChecked( enable );
-  myLegendCombo->setCurrentItem( pos );
+  myLegendCombo->setCurrentIndex( pos );
   onLegendChecked();
 }
+
 /*!
-  Returns TRUE if legend is enabled
+  \brief Check if legend is enabled.
+  \return \c true if legend is enabled
+  \sa setLegend()
 */
 bool Plot2d_SetupViewDlg::isLegendEnabled()
 {
   return myLegendCheck->isChecked();
 }
+
 /*!
-  Returns legend position
+  \brief Get legend position.
+  \return legend position: 0 (left), 1 (right), 2 (top), 3 (bottom)
+  \sa setLegend()
 */
 int Plot2d_SetupViewDlg::getLegendPos()
 {
-  return myLegendCombo->currentItem();
+  return myLegendCombo->currentIndex();
 }
+
 /*!
-  Sets marker size
+  \brief Set marker size.
+  \param size marker size
+  \sa getMarkerSize()
 */
 void Plot2d_SetupViewDlg::setMarkerSize( const int size )
 {
   myMarkerSpin->setValue( size );
 }
+
 /*!
-  Gets marker size
+  \brief Get marker size.
+  \return marker size
+  \sa setMarkerSize()
 */
 int Plot2d_SetupViewDlg::getMarkerSize()
 {
   return myMarkerSpin->value();
 }
+
 /*!
-  Sets background color
+  \brief Set background color.
+  \param color background color
+  \sa getBackgroundColor()
 */
 void Plot2d_SetupViewDlg::setBackgroundColor( const QColor& color )
 {
-  QPalette pal = myBackgroundBtn->palette();
-  QColorGroup ca = pal.active();
-  ca.setColor( QColorGroup::Button, color );
-  QColorGroup ci = pal.inactive();
-  ci.setColor( QColorGroup::Button, color );
-  pal.setActive( ca );
-  pal.setInactive( ci );
-  myBackgroundBtn->setPalette( pal );
+  myBackgroundBtn->setColor( color );
 }
+
 /*!
-  Gets background color
+  \brief Get background color.
+  \return background color
+  \sa setBackgroundColor()
 */
 QColor Plot2d_SetupViewDlg::getBackgroundColor()
 {
-  return myBackgroundBtn->palette().active().button();
+  return myBackgroundBtn->color();
 }
+
 /*!
-  Sets major grid parameters
+  \brief Set major grid parameters.
+  \param enableX if \c true, horizontal major grid is enabled
+  \param divX maximum number of ticks for horizontal major grid
+  \param enableY if \c true, left vertical major grid is enabled
+  \param divY maximum number of ticks for left vertical major grid
+  \param enableY2 if \c true, right vertical major grid is enabled
+  \param divY2 maximum number of ticks for right vertical major grid
+  \sa getMajorGrid()
 */
 void Plot2d_SetupViewDlg::setMajorGrid( bool enableX, const int divX,
                                         bool enableY, const int divY,
-                                        bool enableY2, const int divY2  )
+                                        bool enableY2, const int divY2 )
 {
   myXGridCheck->setChecked( enableX );
   myXGridSpin->setValue( divX );
@@ -517,12 +637,20 @@ void Plot2d_SetupViewDlg::setMajorGrid( bool enableX, const int divX,
     onY2GridMajorChecked();
   }
 }
+
 /*!
-  Gets major grid parameters
+  \brief Get major grid parameters.
+  \param enableX \c true if horizontal major grid is enabled
+  \param divX maximum number of ticks for horizontal major grid
+  \param enableY \c true if left vertical major grid is enabled
+  \param divY maximum number of ticks for left vertical major grid
+  \param enableY2 \c true if right vertical major grid is enabled
+  \param divY2 maximum number of ticks for right vertical major grid
+  \sa setMajorGrid()
 */
 void Plot2d_SetupViewDlg::getMajorGrid( bool& enableX, int& divX,
                                         bool& enableY, int& divY,
-                                        bool& enableY2, int& divY2)
+                                        bool& enableY2, int& divY2 )
 {
   enableX  = myXGridCheck->isChecked();
   divX     = myXGridSpin->value();
@@ -537,12 +665,20 @@ void Plot2d_SetupViewDlg::getMajorGrid( bool& enableX, int& divX,
     divY2    = 1;
   }
 }
+
 /*!
-  Sets minor grid parameters
+  \brief Set minor grid parameters.
+  \param enableX if \c true, horizontal minor grid is enabled
+  \param divX maximum number of ticks for horizontal minor grid
+  \param enableY if \c true, left vertical minor grid is enabled
+  \param divY maximum number of ticks for left vertical minor grid
+  \param enableY2 if \c true, right vertical minor grid is enabled
+  \param divY2 maximum number of ticks for right vertical minor grid
+  \sa getMinorGrid()
 */
 void Plot2d_SetupViewDlg::setMinorGrid( bool enableX, const int divX,
                                         bool enableY, const int divY,
-                                        bool enableY2, const int divY2)
+                                        bool enableY2, const int divY2 )
 {
   myXMinGridCheck->setChecked( enableX );
   myXMinGridSpin->setValue( divX );
@@ -556,18 +692,26 @@ void Plot2d_SetupViewDlg::setMinorGrid( bool enableX, const int divX,
     onY2GridMinorChecked();
   }
 }
+
 /*!
-  Gets minor grid parameters
+  \brief Get minor grid parameters.
+  \param enableX \c true if horizontal minor grid is enabled
+  \param divX maximum number of ticks for horizontal minor grid
+  \param enableY \c true if left vertical minor grid is enabled
+  \param divY maximum number of ticks for left vertical minor grid
+  \param enableY2 \c true if right vertical minor grid is enabled
+  \param divY2 maximum number of ticks for right vertical minor grid
+  \sa setMinorGrid()
 */
 void Plot2d_SetupViewDlg::getMinorGrid( bool& enableX, int& divX,
                                         bool& enableY, int& divY,
-                                        bool& enableY2, int& divY2)
+                                        bool& enableY2, int& divY2 )
 {
   enableX  = myXMinGridCheck->isChecked();
   divX     = myXMinGridSpin->value();
   enableY  = myYMinGridCheck->isChecked();
   divY     = myYMinGridSpin->value();
-  if (mySecondAxisY) {
+  if ( mySecondAxisY ) {
     enableY2 = myY2MinGridCheck->isChecked();
     divY2    = myY2MinGridSpin->value();
   }
@@ -576,114 +720,127 @@ void Plot2d_SetupViewDlg::getMinorGrid( bool& enableX, int& divX,
     divY2    = 1;
   }
 }
+
 /*!
-  Sets scale mode for hor. and ver. axes : 0 - linear, 1 - logarithmic
+  \brief Set scale mode for horizontal and vertical axes.
+  \param xMode horizontal axis scale mode: 0 (linear), 1 (logarithmic)
+  \param yMode vertical axis scale mode: 0 (linear), 1 (logarithmic)
+  \sa getXScaleMode(), getYScaleMode()
 */
 void Plot2d_SetupViewDlg::setScaleMode( const int xMode, const int yMode )
 {
-  myXModeCombo->setCurrentItem( xMode );
-  myYModeCombo->setCurrentItem( yMode );
+  myXModeCombo->setCurrentIndex( xMode );
+  myYModeCombo->setCurrentIndex( yMode );
 }
+
 /*!
-  Gets scale mode for hor. axis : 0 - linear, 1 - logarithmic
+  \brief Get scale mode for horizontal axis.
+  \return horizontal axis scale mode: 0 (linear), 1 (logarithmic)
+  \sa setScaleMode()
 */
-int  Plot2d_SetupViewDlg::getXScaleMode()
+int Plot2d_SetupViewDlg::getXScaleMode()
 {
-  return myXModeCombo->currentItem();
+  return myXModeCombo->currentIndex();
 }
+
 /*!
-  Gets scale mode for hor. axis : 0 - linear, 1 - logarithmic
+  \brief Get scale mode for vertical axis.
+  \return vertical axis scale mode: 0 (linear), 1 (logarithmic)
+  \sa setScaleMode()
 */
 int  Plot2d_SetupViewDlg::getYScaleMode()
 {
-  return myYModeCombo->currentItem();
+  return myYModeCombo->currentIndex();
 }
+
 /*!
-  Slot, called when user clicks "Show main title" check box
+  \brief Called when user clicks "Show main title" check box.
 */
 void Plot2d_SetupViewDlg::onMainTitleChecked()
 {
   myTitleEdit->setEnabled( myTitleCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks "Show horizontal axis title" check box
+  \brief Called when user clicks "Show horizontal axis title" check box.
 */
 void Plot2d_SetupViewDlg::onXTitleChecked()
 {
   myTitleXEdit->setEnabled( myTitleXCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks "Show vertical left axis title" check box
+  \brief Called when user clicks "Show vertical left axis title" check box.
 */
 void Plot2d_SetupViewDlg::onYTitleChecked()
 {
   myTitleYEdit->setEnabled( myTitleYCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks "Show vertical right axis title" check box
+  \brief Called when user clicks "Show vertical right axis title" check box.
 */
 void Plot2d_SetupViewDlg::onY2TitleChecked()
 {
   myTitleY2Edit->setEnabled( myTitleY2Check->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks "Change bacground color" button
-*/
-void Plot2d_SetupViewDlg::onBackgroundClicked()
-{
-  QColor color = QColorDialog::getColor( getBackgroundColor() );
-  if ( color.isValid() ) {
-    setBackgroundColor( color );
-  }
-}
-/*!
-  Slot, called when user clicks "Show Legend" check box
+  \brief Called when user clicks "Show Legend" check box.
 */
 void Plot2d_SetupViewDlg::onLegendChecked()
 {
   myLegendCombo->setEnabled( myLegendCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks "Enable hor. major grid" check box
+  \brief Called when user clicks "Enable horizontal major grid" check box.
 */
 void Plot2d_SetupViewDlg::onXGridMajorChecked()
 {
   myXMinGridCheck->setEnabled( myXGridCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks  "Enable ver. major grid" check box
+  \brief Called when user clicks "Enable left vertical major grid" check box.
 */
 void Plot2d_SetupViewDlg::onYGridMajorChecked()
 {
   myYMinGridCheck->setEnabled( myYGridCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks  "Enable ver. major grid" check box
+  \brief Called when user clicks "Enable right vertical major grid" check box.
 */
 void Plot2d_SetupViewDlg::onY2GridMajorChecked()
 {
   myY2MinGridCheck->setEnabled( myY2GridCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks  "Enable hor. minor grid" check box
+  \brief Called when user clicks "Enable horizontal minor grid" check box.
 */
 void Plot2d_SetupViewDlg::onXGridMinorChecked()
 {
 }
+
 /*!
-  Slot, called when user clicks  "Enable ver. minor grid" check box
+  \brief Called when user clicks "Enable left vertical minor grid" check box.
 */
 void Plot2d_SetupViewDlg::onYGridMinorChecked()
 {
 }
+
 /*!
-  Slot, called when user clicks  "Enable ver. minor grid" check box
+  \brief Called when user clicks "Enable right vertical minor grid" check box.
 */
 void Plot2d_SetupViewDlg::onY2GridMinorChecked()
 {
 }
+
 /*!
-  Retursns true if "Set as default" check box is on
+  \brief Get "Set settings as default" check box value.
+  \return \c true if "Set settings as default" check box is on
 */
 bool Plot2d_SetupViewDlg::isSetAsDefault()
 {
@@ -696,6 +853,6 @@ bool Plot2d_SetupViewDlg::isSetAsDefault()
 void Plot2d_SetupViewDlg::onHelp()
 {
   SUIT_Application* app = SUIT_Session::session()->activeApplication();
-  if (app)
-    app->onHelpContextModule("GUI", "plot2d_viewer_page.html#settings");
+  if ( app )
+    app->onHelpContextModule( "GUI", "plot2d_viewer_page.html", "settings" );
 }
index d04623a8b37e814e4441fe24462f0ef62806ff23..6de74752b3eb6eeef7e416d46f9bf86735d13a85 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d_SetupViewDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #ifndef PLOT2D_SETUPVIEWDLG_H
 #define PLOT2D_SETUPVIEWDLG_H
 
 #include "Plot2d.h"
-#include <qdialog.h>
+
+#include <QDialog>
 
 class QSpinBox;
 class QCheckBox;
 class QLineEdit;
 class QComboBox;
-class QToolButton;
 class QPushButton;
+class QtxColorButton;
 
 class PLOT2D_EXPORT Plot2d_SetupViewDlg : public QDialog
 { 
   Q_OBJECT
 
 public:
-  Plot2d_SetupViewDlg( QWidget* parent = 0, bool showDefCheck = false, bool secondAxisY = false );
+  Plot2d_SetupViewDlg( QWidget* = 0, bool = false, bool = false );
   ~Plot2d_SetupViewDlg();
 
-  void    setMainTitle( bool enable, const QString& title = QString::null );
-  bool    isMainTitleEnabled();
-  QString getMainTitle();
-  void    setXTitle( bool enable, const QString& title = QString::null );
-  bool    isXTitleEnabled();
-  QString getXTitle();
-  void    setYTitle( bool enable, const QString& title = QString::null );
-  void    setY2Title( bool enable, const QString& title = QString::null );
-  bool    isYTitleEnabled();
-  bool    isY2TitleEnabled();
-  QString getYTitle();
-  QString getY2Title();
-  void    setCurveType( const int type );
-  int     getCurveType();
-  void    setLegend( bool enable, int pos );
-  bool    isLegendEnabled();
-  int     getLegendPos();
-  void    setMarkerSize( const int size );
-  int     getMarkerSize();
-  void    setBackgroundColor( const QColor& color );
-  QColor  getBackgroundColor();
-  void    setMajorGrid( bool enableX, const int xdiv, bool enableY, const int divY,
-                        bool enableY2, const int divY2 );
-  void    getMajorGrid( bool& enableX, int& xdiv, bool& enableY, int& divY,
-                        bool& enableY2, int& divY2);
-  void    setMinorGrid( bool enableX, const int xdiv, bool enableY, const int divY,
-                        bool enableY2, const int divY2);
-  void    getMinorGrid( bool& enableX, int& xdiv, bool& enableY, int& divY,
-                        bool& enableY2, int& divY2);
-  void    setScaleMode( const int xMode, const int yMode );
-  int     getXScaleMode();
-  int     getYScaleMode();
-  bool    isSetAsDefault();
+  void            setMainTitle( bool, const QString& = QString() );
+  bool            isMainTitleEnabled();
+  QString         getMainTitle();
+
+  void            setXTitle( bool, const QString& = QString() );
+  bool            isXTitleEnabled();
+  QString         getXTitle();
+
+  void            setYTitle( bool, const QString& = QString() );
+  void            setY2Title( bool, const QString& = QString() );
+  bool            isYTitleEnabled();
+  bool            isY2TitleEnabled();
+  QString         getYTitle();
+  QString         getY2Title();
+
+  void            setCurveType( const int );
+  int             getCurveType();
+
+  void            setLegend( bool, int );
+  bool            isLegendEnabled();
+  int             getLegendPos();
+  
+  void            setMarkerSize( const int );
+  int             getMarkerSize();
+
+  void            setBackgroundColor( const QColor& );
+  QColor          getBackgroundColor();
+
+  void            setMajorGrid( bool, const int, bool, const int, bool, const int );
+  void            getMajorGrid( bool&, int&, bool&, int&, bool&, int& );
+  void            setMinorGrid( bool, const int, bool, const int, bool, const int );
+  void            getMinorGrid( bool&, int&, bool&, int&, bool&, int& );
+
+  void            setScaleMode( const int, const int );
+  int             getXScaleMode();
+  int             getYScaleMode();
+
+  bool            isSetAsDefault();
 
 protected slots:
-  void   onMainTitleChecked();
-  void   onXTitleChecked();
-  void   onYTitleChecked();
-  void   onY2TitleChecked();
-  void   onBackgroundClicked();
-  void   onLegendChecked();
-  void   onXGridMajorChecked();
-  void   onYGridMajorChecked();
-  void   onY2GridMajorChecked();
-  void   onXGridMinorChecked();
-  void   onYGridMinorChecked();
-  void   onY2GridMinorChecked();
-  void   onHelp();
+  void            onMainTitleChecked();
+  void            onXTitleChecked();
+  void            onYTitleChecked();
+  void            onY2TitleChecked();
+  void            onLegendChecked();
+  void            onXGridMajorChecked();
+  void            onYGridMajorChecked();
+  void            onY2GridMajorChecked();
+  void            onXGridMinorChecked();
+  void            onYGridMinorChecked();
+  void            onY2GridMinorChecked();
+  void            onHelp();
 
 private:
-  QCheckBox*     myTitleCheck;
-  QLineEdit*     myTitleEdit;
-  QCheckBox*     myTitleXCheck;
-  QLineEdit*     myTitleXEdit;
-  QCheckBox*     myTitleYCheck;
-  QCheckBox*     myTitleY2Check;
-  QLineEdit*     myTitleYEdit;
-  QLineEdit*     myTitleY2Edit;
-  QToolButton*   myBackgroundBtn;
-  QCheckBox*     myXGridCheck;
-  QSpinBox*      myXGridSpin;
-  QCheckBox*     myYGridCheck;
-  QCheckBox*     myY2GridCheck;
-  QSpinBox*      myYGridSpin;
-  QSpinBox*      myY2GridSpin;
-  QCheckBox*     myXMinGridCheck;
-  QSpinBox*      myXMinGridSpin;
-  QCheckBox*     myYMinGridCheck;
-  QCheckBox*     myY2MinGridCheck;
-  QSpinBox*      myYMinGridSpin;
-  QSpinBox*      myY2MinGridSpin;
-  QComboBox*     myCurveCombo;
-  QCheckBox*     myLegendCheck;
-  QComboBox*     myLegendCombo;
-  QSpinBox*      myMarkerSpin;
-  QComboBox*     myXModeCombo;
-  QComboBox*     myYModeCombo;
-  QComboBox*     myY2ModeCombo;
-  QCheckBox*     myDefCheck;
-
-  QPushButton*   myOkBtn;
-  QPushButton*   myCancelBtn;
-  QPushButton*   myHelpBtn;
-  bool           mySecondAxisY;
+  QCheckBox*      myTitleCheck;
+  QLineEdit*      myTitleEdit;
+  QCheckBox*      myTitleXCheck;
+  QLineEdit*      myTitleXEdit;
+  QCheckBox*      myTitleYCheck;
+  QCheckBox*      myTitleY2Check;
+  QLineEdit*      myTitleYEdit;
+  QLineEdit*      myTitleY2Edit;
+  QtxColorButton* myBackgroundBtn;
+  QCheckBox*      myXGridCheck;
+  QSpinBox*       myXGridSpin;
+  QCheckBox*      myYGridCheck;
+  QCheckBox*      myY2GridCheck;
+  QSpinBox*       myYGridSpin;
+  QSpinBox*       myY2GridSpin;
+  QCheckBox*      myXMinGridCheck;
+  QSpinBox*       myXMinGridSpin;
+  QCheckBox*      myYMinGridCheck;
+  QCheckBox*      myY2MinGridCheck;
+  QSpinBox*       myYMinGridSpin;
+  QSpinBox*       myY2MinGridSpin;
+  QComboBox*      myCurveCombo;
+  QCheckBox*      myLegendCheck;
+  QComboBox*      myLegendCombo;
+  QSpinBox*       myMarkerSpin;
+  QComboBox*      myXModeCombo;
+  QComboBox*      myYModeCombo;
+  QComboBox*      myY2ModeCombo;
+  QCheckBox*      myDefCheck;
+  QPushButton*    myOkBtn;
+  QPushButton*    myCancelBtn;
+  QPushButton*    myHelpBtn;
+  bool            mySecondAxisY;
 };
 
-#endif
+#endif // PLOT2D_SETUPVIEWDLG_H
index 3cdb1ba8adc6ef9555f878a437b696935804e9ab..ba44643f7dae1edafb1e1767081c05f6199f4966 100644 (file)
@@ -1,29 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      Plot2d_ToolTip.cxx
 // Author:    Alexandre SOLOVYOV
+//
+#include "Plot2d_ToolTip.h"
+#include "Plot2d_ViewFrame.h"
+#include "Plot2d_Curve.h"
 
-#include <Plot2d_ToolTip.h>
-#include <Plot2d_ViewFrame.h>
-#include <Plot2d_Curve.h>
-
-#include <qfontmetrics.h>
+#include <QFontMetrics>
+#include <QEvent>
+#include <QMouseEvent>
 
 #include <qwt_plot.h>
 #include <qwt_plot_canvas.h>
@@ -46,23 +51,19 @@ Plot2d_ToolTip::~Plot2d_ToolTip()
 
 void Plot2d_ToolTip::onToolTip( QPoint p, QString& str, QFont& f, QRect& txtRect, QRect& rect )
 {
-  int curInd, pInd, dist;
-  double x, y;
-  curInd = myPlot->closestCurve( p.x(), p.y(), dist, x, y, pInd );
+  int pInd;
+  double dist;
 
-  if( dist>maxDist )
-    return;
-  
-  Plot2d_Curve* c = myFrame->getCurves().find( curInd );
-  if( !c )
+  Plot2d_Curve* c = myPlot->getClosestCurve( p, dist, pInd );
+  if( !c || dist>maxDist )
     return;
 
   str = c->text( pInd );
-  if( !str )
+  if( str.isEmpty() )
     return;
 
   QFontMetrics m( f );
-  QStringList lst = QStringList::split( "\n", str );
+  QStringList lst = str.split( "\n", QString::SkipEmptyParts );
   QStringList::const_iterator anIt = lst.begin(), aLast = lst.end();
   int w = 0, h = 0;
   for( ; anIt!=aLast; anIt++ )
@@ -86,7 +87,7 @@ bool Plot2d_ToolTip::eventFilter( QObject* o, QEvent* e )
   if( e && e->type() == QEvent::MouseMove )
   {
     QMouseEvent* me = ( QMouseEvent* )e;
-    if( me->state()==0 )
+    if( me->modifiers()==0 )
       return true;
   }
   return res;
index a26c46a834bb2bacd1f6ea70d62a4aefe300912f..95afdf43226c38522f4241296114ec0cb9c05784 100644 (file)
@@ -1,28 +1,31 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      Plot2d_ToolTip.h
 // Author:    Alexandre SOLOVYOV
-
+//
 #ifndef PLOT2D_TOOLTIP_H
 #define PLOT2D_TOOLTIP_H
 
-#include <Plot2d.h>
+#include "Plot2d.h"
 #include <QtxToolTip.h>
 
 class Plot2d_ViewFrame;
@@ -36,12 +39,11 @@ public:
   Plot2d_ToolTip( Plot2d_ViewFrame*, Plot2d_Plot2d* );
   virtual ~Plot2d_ToolTip();
 
+  virtual bool eventFilter( QObject*, QEvent* );
+
 public slots:
   void onToolTip( QPoint, QString&, QFont&, QRect&, QRect& );
 
-protected:
-  virtual bool eventFilter( QObject*, QEvent* );
-
 private:
   Plot2d_ViewFrame* myFrame;
   Plot2d_Plot2d*    myPlot;
index 55b805bfce768b014d076d1f43efe764735aca3c..d57f3e94deee1ea1c44b95eeb264a43449d96e84 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "Plot2d_ViewFrame.h"
 
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_Application.h"
 
-#include "qapplication.h"
-#include <qtoolbar.h>
-#include <qtoolbutton.h>
-#include <qcursor.h>
-#include <qcolordialog.h>
-#include <qptrlist.h>
-#include <qlayout.h>
-#include <qmap.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
-#include <qevent.h>
+#include <QApplication>
+#include <QToolBar>
+#include <QToolButton>
+#include <QCursor>
+#include <QColorDialog>
+#include <QLayout>
+#include <QMap>
+#include <QPainter>
+#include <QPaintDevice>
+#include <QEvent>
+#include <QMouseEvent>
+#include <QContextMenuEvent>
+#include <QPrinter>
+#include <QPalette>
+#include <QLocale>
 
 #include <qwt_math.h>
 #include <qwt_plot_canvas.h>
+#include <qwt_scale_div.h>
+#include <qwt_plot_curve.h>
+#include <qwt_plot_grid.h>
+#include <qwt_scale_engine.h>
+#include <qwt_plot_zoomer.h>
+#include <qwt_curve_fitter.h>
+
 #include <iostream>
 #include <stdlib.h>
 #include <qprinter.h>
 
 #include <qwt_legend.h>
+#include <qwt_scale_widget.h>
 
 #define DEFAULT_LINE_WIDTH     0     // (default) line width
 #define DEFAULT_MARKER_SIZE    9     // default marker size
@@ -138,13 +153,13 @@ const char* imageCrossCursor[] = {
   Constructor
 */
 Plot2d_ViewFrame::Plot2d_ViewFrame( QWidget* parent, const QString& title )
-     : QWidget (parent, title, 0),
+     : QWidget (parent, 0),
        myOperation( NoOpId ), 
        myCurveType( 1 ), 
        myShowLegend( true ), myLegendPos( 1 ),
        myMarkerSize( DEFAULT_MARKER_SIZE ),
        myTitle( "" ), myXTitle( "" ), myYTitle( "" ), myY2Title( "" ),
-       myBackground( white ),
+       myBackground( Qt::white ),
        myTitleEnabled( true ), myXTitleEnabled( true ),
        myYTitleEnabled( true ), myY2TitleEnabled (true),
        myXGridMajorEnabled( true ), myYGridMajorEnabled( true ), myY2GridMajorEnabled( true ), 
@@ -153,6 +168,7 @@ Plot2d_ViewFrame::Plot2d_ViewFrame( QWidget* parent, const QString& title )
        myXGridMaxMinor( 5 ), myYGridMaxMinor( 5 ), myY2GridMaxMinor( 5 ),
        myXMode( 0 ), myYMode( 0 ), mySecondY( false )
 {
+  setObjectName( title );
   /* Plot 2d View */
   QVBoxLayout* aLayout = new QVBoxLayout( this ); 
   myPlot = new Plot2d_Plot2d( this );
@@ -160,16 +176,18 @@ Plot2d_ViewFrame::Plot2d_ViewFrame( QWidget* parent, const QString& title )
 
   aLayout->addWidget( myPlot );
 
-//  createActions();
+  //  createActions();
+  connect( myPlot, SIGNAL( legendClicked( QwtPlotItem* ) ), 
+          this, SIGNAL( legendClicked( QwtPlotItem* ) ) );
+
+  connect( myPlot->axisWidget( QwtPlot::xBottom ), SIGNAL( scaleDivChanged() ),
+          myPlot, SLOT( onScaleDivChanged() ) );
+  connect( myPlot->axisWidget( QwtPlot::yLeft ), SIGNAL( scaleDivChanged() ),
+          myPlot, SLOT( onScaleDivChanged() ) );
+  if (mySecondY)
+    connect( myPlot->axisWidget( QwtPlot::yRight ), SIGNAL( scaleDivChanged() ),
+            myPlot, SLOT( onScaleDivChanged() ) );
 
-  connect( myPlot, SIGNAL( plotMouseMoved( const QMouseEvent& ) ),
-     this,   SLOT( plotMouseMoved( const QMouseEvent& ) ) );
-  connect( myPlot, SIGNAL( plotMousePressed( const QMouseEvent& ) ),
-     this,   SLOT( plotMousePressed( const QMouseEvent& ) ) );
-  connect( myPlot, SIGNAL( plotMouseReleased( const QMouseEvent& ) ),
-     this,   SLOT( plotMouseReleased( const QMouseEvent& ) ) );
-  //connect( myPlot, SIGNAL( legendClicked( long ) ),
-  //   this,   SLOT( onLegendClicked( long ) ) );
 
   /* Initial Setup - get from the preferences */
   readPreferences();
@@ -186,8 +204,6 @@ Plot2d_ViewFrame::Plot2d_ViewFrame( QWidget* parent, const QString& title )
 
   if (mySecondY)
     setTitle( myY2TitleEnabled, myY2Title, Y2Title, false );
-  setHorScaleMode( myXMode, false );
-  setVerScaleMode( myYMode, false );
   setBackgroundColor( myBackground );
   setLegendPos( myLegendPos );
   showLegend( myShowLegend, false );
@@ -196,15 +212,16 @@ Plot2d_ViewFrame::Plot2d_ViewFrame( QWidget* parent, const QString& title )
   if ( parent ) {
     resize( (int)(0.8 * parent->width()), (int)(0.8 * parent->height()) );
   }
-  QwtDiMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
-  QwtDiMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
-  myXDistance = xMap.d2() - xMap.d1();
-  myYDistance = yMap.d2() - yMap.d1();
+  QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
+  QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
+  myXDistance = xMap.s2() - xMap.s1();
+  myYDistance = yMap.s2() - yMap.s1();
   myYDistance2 = 0;
   if (mySecondY) {
-    QwtDiMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
-    myYDistance2 = yMap2.d2() - yMap2.d1();
+    QwtScaleMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
+    myYDistance2 = yMap2.s2() - yMap2.s1();
   }
+  myPlot->canvas()->installEventFilter( this );
 }
 /*!
   Destructor
@@ -224,7 +241,7 @@ QWidget* Plot2d_ViewFrame::getViewWidget()
 */
 void Plot2d_ViewFrame::DisplayAll()
 {
-  QList<Plot2d_Curve> clist;
+  curveList clist;
   getCurves( clist );
   for ( int i = 0; i < (int)clist.count(); i++ ) {
     updateCurve( clist.at( i ), false );
@@ -237,7 +254,7 @@ void Plot2d_ViewFrame::DisplayAll()
 void Plot2d_ViewFrame::EraseAll() 
 {
   myPlot->clear();
-  myCurves.clear();
+  myPlot->getCurves().clear();
   myPlot->replot();
 }
 /*!
@@ -285,6 +302,44 @@ void Plot2d_ViewFrame::Erase( const Plot2d_Prs* prs, const bool )
   eraseCurves( aCurves );
 }
 
+bool Plot2d_ViewFrame::eventFilter( QObject* watched, QEvent* e )
+{
+  if ( watched == myPlot->canvas() ) {
+    int aType = e->type();
+    switch( aType ) {
+      case QEvent::MouseMove: {
+        QMouseEvent* me = (QMouseEvent*)e;
+        if ( me && ( me->buttons() != 0 || me->button() != 0 ) ) {
+          QMouseEvent m( QEvent::MouseMove, me->pos(), me->button(),
+                         me->buttons(), me->modifiers() );
+          if ( plotMouseMoved( m ) )
+            return true;
+        }
+       break;
+      }
+      case QEvent::MouseButtonPress: {
+        QMouseEvent* me = (QMouseEvent*)e;
+        if ( me && ( me->buttons() != 0 || me->button() != 0 ) ) {
+          QMouseEvent m( QEvent::MouseButtonPress, me->pos(), me->button(),
+                          me->buttons(), me->modifiers() );
+          plotMousePressed( m );
+        }
+        break;
+      }
+      case QEvent::MouseButtonRelease: {
+        QMouseEvent* me = (QMouseEvent*)e;
+        if ( me && ( me->buttons() != 0 || me->button() != 0 ) ) {
+          QMouseEvent m( QEvent::MouseButtonRelease, me->pos(), me->button(),
+                         me->buttons(), me->modifiers() );
+          plotMouseReleased( m );
+        }
+        break;
+      }
+    }
+  }
+  return QWidget::eventFilter( watched, e );
+}
+
 /*!
   Sets title
 */
@@ -331,11 +386,13 @@ void Plot2d_ViewFrame::readPreferences()
   if ( mySecondY )
     myY2GridMaxMinor = resMgr->integerValue( "Plot2d", "VerMinorGridMax", myY2GridMaxMinor );
 
-  myXMode = resMgr->integerValue( "Plot2d", "HorScaleMode", myXMode );
-  myXMode = QMAX( 0, QMIN( 1, myXMode ) );
+  int newXMode = resMgr->integerValue( "Plot2d", "HorScaleMode", myXMode );
+  newXMode = qMax( 0, qMin( 1, newXMode ) );
+  setHorScaleMode( newXMode, false );
 
-  myYMode = resMgr->integerValue( "Plot2d", "VerScaleMode", myYMode );
-  myYMode = QMAX( 0, QMIN( 1, myYMode ) );
+  int newYMode = resMgr->integerValue( "Plot2d", "VerScaleMode", myYMode );
+  newYMode = qMax( 0, qMin( 1, newYMode ) );
+  setVerScaleMode( newYMode, false );
 }
 
 /*!
@@ -386,11 +443,13 @@ void Plot2d_ViewFrame::writePreferences()
 QString Plot2d_ViewFrame::getInfo( const QPoint& pnt ) 
 {
   int i;
+  QwtValueList aTicks;
   bool xFound = false, yFound = false;
   double xCoord, yCoord;
-  const QwtScaleDiv* aXscale = myPlot->axisScale( QwtPlot::xBottom );
-  for ( i = 0; i < aXscale->majCnt(); i++ ) {
-    double majXmark = aXscale->majMark( i );
+  const QwtScaleDiv* aXscale = myPlot->axisScaleDiv( QwtPlot::xBottom );
+  aTicks = aXscale->ticks( QwtScaleDiv::MajorTick );
+  for ( i = 0; i < aTicks.count(); i++ ) {
+    double majXmark = aTicks[i];
     int xmark = myPlot->transform( QwtPlot::xBottom, majXmark );
     if ( xmark-2 == pnt.x() ) {
       xCoord = majXmark; 
@@ -399,8 +458,9 @@ QString Plot2d_ViewFrame::getInfo( const QPoint& pnt )
     }
   }
   if ( !xFound ) {
-    for ( i = 0; i < aXscale->minCnt(); i++ ) {
-      double minXmark = aXscale->minMark( i );
+    aTicks = aXscale->ticks( QwtScaleDiv::MinorTick );
+    for ( i = 0; i < aTicks.count(); i++ ) {
+      double minXmark = aTicks[i];
       int xmark = myPlot->transform( QwtPlot::xBottom, minXmark );
       if ( xmark-2 == pnt.x() ) {
         xCoord = minXmark; 
@@ -409,9 +469,10 @@ QString Plot2d_ViewFrame::getInfo( const QPoint& pnt )
       }
     }
   }  
-  const QwtScaleDiv* aYscale = myPlot->axisScale( QwtPlot::yLeft );
-  for ( i = 0; i < aYscale->majCnt(); i++ ) {
-    double majYmark = aYscale->majMark( i );
+  const QwtScaleDiv* aYscale = myPlot->axisScaleDiv( QwtPlot::yLeft );
+  aTicks = aYscale->ticks( QwtScaleDiv::MajorTick );
+  for ( i = 0; i < aTicks.count(); i++ ) {
+    double majYmark = aTicks[i];
     int ymark = myPlot->transform( QwtPlot::yLeft, majYmark );
     if ( ymark-2 == pnt.y() ) {
       yCoord = majYmark; 
@@ -420,8 +481,9 @@ QString Plot2d_ViewFrame::getInfo( const QPoint& pnt )
     }
   }
   if ( !yFound ) {
-    for ( i = 0; i < aYscale->minCnt(); i++ ) {
-      double minYmark = aYscale->minMark( i );
+    aTicks = aYscale->ticks( QwtScaleDiv::MinorTick );
+    for ( i = 0; i < aTicks.count(); i++ ) {
+      double minYmark = aTicks[i];
       int ymark = myPlot->transform( QwtPlot::yLeft, minYmark );
       if ( ymark-2 == pnt.y() ) {
         yCoord = minYmark; 
@@ -431,10 +493,10 @@ QString Plot2d_ViewFrame::getInfo( const QPoint& pnt )
     }
   }  
 
-  QString strX = QString::number( xFound ? xCoord : myPlot->invTransform( QwtPlot::xBottom, pnt.x() ) ).stripWhiteSpace();
+  QString strX = QString::number( xFound ? xCoord : myPlot->invTransform( QwtPlot::xBottom, pnt.x() ) ).trimmed();
   if ( strX == "-0" )
     strX = "0";
-  QString strY = QString::number( yFound ? yCoord : myPlot->invTransform( QwtPlot::yLeft, pnt.y() ) ).stripWhiteSpace();
+  QString strY = QString::number( yFound ? yCoord : myPlot->invTransform( QwtPlot::yLeft, pnt.y() ) ).trimmed();
   if ( strY == "-0" )
     strY = "0";
   QString info = "";
@@ -443,9 +505,10 @@ QString Plot2d_ViewFrame::getInfo( const QPoint& pnt )
     bool yFound2 = false;
     double yCoord2;
 
-    const QwtScaleDiv* aYscale2 = myPlot->axisScale( QwtPlot::yRight );
-    for ( i = 0; i < aYscale2->majCnt(); i++ ) {
-      double majYmark = aYscale2->majMark( i );
+    const QwtScaleDiv* aYscale2 = myPlot->axisScaleDiv( QwtPlot::yRight );
+    aTicks = aYscale2->ticks( QwtScaleDiv::MajorTick );
+    for ( i = 0; i < aTicks.count(); i++ ) {
+      double majYmark = aTicks[i];
       int ymark = myPlot->transform( QwtPlot::yRight, majYmark );
       if ( ymark-2 == pnt.y() ) {
         yCoord2 = majYmark; 
@@ -454,8 +517,9 @@ QString Plot2d_ViewFrame::getInfo( const QPoint& pnt )
       }
     }
     if ( !yFound2 ) {
-      for ( i = 0; i < aYscale2->minCnt(); i++ ) {
-        double minYmark = aYscale2->minMark( i );
+      aTicks = aYscale2->ticks( QwtScaleDiv::MinorTick );
+      for ( i = 0; i < aTicks.count(); i++ ) {
+        double minYmark = aTicks[i];
         int ymark = myPlot->transform( QwtPlot::yRight, minYmark );
         if ( ymark-2 == pnt.y() ) {
           yCoord2 = minYmark; 
@@ -465,7 +529,7 @@ QString Plot2d_ViewFrame::getInfo( const QPoint& pnt )
       }
     }
     QString strY2 = QString::number( yFound2 ? yCoord2 : 
-                      myPlot->invTransform( QwtPlot::yRight, pnt.y() ) ).stripWhiteSpace();
+                      myPlot->invTransform( QwtPlot::yRight, pnt.y() ) ).trimmed();
     if ( strY2 == "-0" )
     strY2 = "0";
     info = tr("INF_COORDINATES_SOME_Y").arg( strX ).arg( strY ).arg( strY2 );
@@ -476,118 +540,6 @@ QString Plot2d_ViewFrame::getInfo( const QPoint& pnt )
   return info;
 }
 
-/*!
-  Converts Plot2d_Curve's marker style to Qwt marker style [ static ]
-*/
-static QwtSymbol::Style plot2qwtMarker( Plot2d_Curve::MarkerType m )
-{
-  QwtSymbol::Style ms = QwtSymbol::None;  
-  switch ( m ) {
-  case Plot2d_Curve::Circle:
-    ms = QwtSymbol::Ellipse;   break;
-  case Plot2d_Curve::Rectangle:
-    ms = QwtSymbol::Rect;      break;
-  case Plot2d_Curve::Diamond:
-    ms = QwtSymbol::Diamond;   break;
-  case Plot2d_Curve::DTriangle:
-    ms = QwtSymbol::DTriangle; break;
-  case Plot2d_Curve::UTriangle:
-    ms = QwtSymbol::UTriangle; break;
-  case Plot2d_Curve::LTriangle: // Qwt confuses LTriangle and RTriangle :(((
-    ms = QwtSymbol::RTriangle; break;
-  case Plot2d_Curve::RTriangle: // Qwt confuses LTriangle and RTriangle :(((
-    ms = QwtSymbol::LTriangle; break;
-  case Plot2d_Curve::Cross:
-    ms = QwtSymbol::Cross;     break;
-  case Plot2d_Curve::XCross:
-    ms = QwtSymbol::XCross;    break;
-  case Plot2d_Curve::None:
-  default:
-    ms = QwtSymbol::None;      break;
-  }
-  return ms;
-}
-
-/*!
-  Converts Qwt marker style to Plot2d_Curve's marker style [ static ]
-*/
-static Plot2d_Curve::MarkerType qwt2plotMarker( QwtSymbol::Style m )
-{
-  Plot2d_Curve::MarkerType ms = Plot2d_Curve::None;  
-  switch ( m ) {
-  case QwtSymbol::Ellipse:
-    ms = Plot2d_Curve::Circle;    break;
-  case QwtSymbol::Rect:
-    ms = Plot2d_Curve::Rectangle; break;
-  case QwtSymbol::Diamond:
-    ms = Plot2d_Curve::Diamond;   break;
-  case QwtSymbol::DTriangle:
-    ms = Plot2d_Curve::DTriangle; break;
-  case QwtSymbol::UTriangle:
-    ms = Plot2d_Curve::UTriangle; break;
-  case QwtSymbol::RTriangle: // Qwt confuses LTriangle and RTriangle :(((
-    ms = Plot2d_Curve::LTriangle; break;
-  case QwtSymbol::LTriangle: // Qwt confuses LTriangle and RTriangle :(((
-    ms = Plot2d_Curve::RTriangle; break;
-  case QwtSymbol::Cross:
-    ms = Plot2d_Curve::Cross;     break;
-  case QwtSymbol::XCross:
-    ms = Plot2d_Curve::XCross;    break;
-  case QwtSymbol::None:
-  default:
-    ms = Plot2d_Curve::None;      break;
-  }
-  return ms;
-}
-
-/*!
-  Converts Plot2d_Curve's line style to Qwt line style [ static ]
-*/
-static Qt::PenStyle plot2qwtLine( Plot2d_Curve::LineType p )
-{
-  Qt::PenStyle ps = Qt::NoPen;
-  switch ( p ) {
-  case Plot2d_Curve::Solid:
-    ps = Qt::SolidLine;      break;
-  case Plot2d_Curve::Dash:
-    ps = Qt::DashLine;       break;
-  case Plot2d_Curve::Dot:
-    ps = Qt::DotLine;        break;
-  case Plot2d_Curve::DashDot:
-    ps = Qt::DashDotLine;    break;
-  case Plot2d_Curve::DashDotDot:
-    ps = Qt::DashDotDotLine; break;
-  case Plot2d_Curve::NoPen:
-  default:
-    ps = Qt::NoPen;          break;
-  }
-  return ps;
-}
-
-/*!
-  Converts Qwt line style to Plot2d_Curve's line style [ static ]
-*/
-static Plot2d_Curve::LineType qwt2plotLine( Qt::PenStyle p )
-{
-  Plot2d_Curve::LineType ps = Plot2d_Curve::NoPen;
-  switch ( p ) {
-  case Qt::SolidLine:
-    ps = Plot2d_Curve::Solid;      break;
-  case Qt::DashLine:
-    ps = Plot2d_Curve::Dash;       break;
-  case Qt::DotLine:
-    ps = Plot2d_Curve::Dot;        break;
-  case Qt::DashDotLine:
-    ps = Plot2d_Curve::DashDot;    break;
-  case Qt::DashDotDotLine:
-    ps = Plot2d_Curve::DashDotDot; break;
-  case Qt::NoPen:
-  default:
-    ps = Plot2d_Curve::NoPen;      break;
-  }
-  return ps;
-}
-
 /*!
   Adds curve into view
 */
@@ -604,44 +556,41 @@ void Plot2d_ViewFrame::displayCurve( Plot2d_Curve* curve, bool update )
   if ( myYMode && curve->getMinY() <= 0. )
     setVerScaleMode( 0, false );
 
-  if ( hasCurve( curve ) ) {
+  if ( hasPlotCurve( curve ) ) {
     updateCurve( curve, update );
   }
   else {
-    long curveKey = myPlot->insertCurve( curve->getVerTitle() );
-    myPlot->setCurveYAxis(curveKey, curve->getYAxis());
+    QwtPlotCurve* aPCurve = new QwtPlotCurve( curve->getVerTitle() );
+    aPCurve->attach( myPlot );
+    //myPlot->setCurveYAxis(curveKey, curve->getYAxis());
 
-    myCurves.insert( curveKey, curve );
+    myPlot->getCurves().insert( aPCurve, curve );
     if ( curve->isAutoAssign() ) {
       QwtSymbol::Style typeMarker;
       QColor           color;
       Qt::PenStyle     typeLine;
+
       myPlot->getNextMarker( typeMarker, color, typeLine );
-      myPlot->setCurvePen( curveKey, QPen( color, DEFAULT_LINE_WIDTH, typeLine ) );
-      myPlot->setCurveSymbol( curveKey, QwtSymbol( typeMarker, 
+      aPCurve->setPen( QPen( color, DEFAULT_LINE_WIDTH, typeLine ) );
+      aPCurve->setSymbol( QwtSymbol( typeMarker, 
                QBrush( color ), 
                QPen( color ), 
                QSize( myMarkerSize, myMarkerSize ) ) );
       curve->setColor( color );
-      curve->setLine( qwt2plotLine( typeLine ) );
-      curve->setMarker( qwt2plotMarker( typeMarker ) );
+      curve->setLine( Plot2d::qwt2plotLine( typeLine ) );
+      curve->setMarker( Plot2d::qwt2plotMarker( typeMarker ) );
     }
     else {
-      Qt::PenStyle     ps = plot2qwtLine( curve->getLine() );
-      QwtSymbol::Style ms = plot2qwtMarker( curve->getMarker() );
-      myPlot->setCurvePen( curveKey, QPen( curve->getColor(), curve->getLineWidth(), ps ) );
-      myPlot->setCurveSymbol( curveKey, QwtSymbol( ms, 
+      Qt::PenStyle     ps = Plot2d::plot2qwtLine( curve->getLine() );
+      QwtSymbol::Style ms = Plot2d::plot2qwtMarker( curve->getMarker() );
+      aPCurve->setPen( QPen( curve->getColor(), curve->getLineWidth(), ps ) );
+      aPCurve->setSymbol( QwtSymbol( ms, 
                QBrush( curve->getColor() ), 
                QPen( curve->getColor() ), 
                QSize( myMarkerSize, myMarkerSize ) ) );
     }
-    if ( myCurveType == 0 )
-      myPlot->setCurveStyle( curveKey, QwtCurve::NoCurve );
-    else if ( myCurveType == 1 )
-      myPlot->setCurveStyle( curveKey, QwtCurve::Lines );
-    else if ( myCurveType == 2 )
-      myPlot->setCurveStyle( curveKey, QwtCurve::Spline );
-    myPlot->setCurveData( curveKey, curve->horData(), curve->verData(), curve->nbPoints() );
+    setCurveType( aPCurve, myCurveType );
+    aPCurve->setData( curve->horData(), curve->verData(), curve->nbPoints() );
   }
   updateTitles();
   if ( update )
@@ -653,16 +602,16 @@ void Plot2d_ViewFrame::displayCurve( Plot2d_Curve* curve, bool update )
 */
 void Plot2d_ViewFrame::displayCurves( const curveList& curves, bool update )
 {
-  myPlot->setUpdatesEnabled( false );
-  QPtrListIterator<Plot2d_Curve> it(curves);
+  //myPlot->setUpdatesEnabled( false ); // call this function deprecate update of legend
+  curveList::const_iterator it = curves.begin();
   Plot2d_Curve* aCurve;
-  while( (aCurve = it.current()) ) {
+  for (; it != curves.end(); ++it ) {
+    aCurve = *it;
     displayCurve( aCurve, false );
-    ++it;
   }
-
   fitAll();
-  myPlot->setUpdatesEnabled( true );
+  //myPlot->setUpdatesEnabled( true );
+// update legend
   if ( update )
     myPlot->replot();
 }
@@ -674,10 +623,11 @@ void Plot2d_ViewFrame::eraseCurve( Plot2d_Curve* curve, bool update )
 {
   if ( !curve )
     return;
-  int curveKey = hasCurve( curve );
-  if ( curveKey ) {
-    myPlot->removeCurve( curveKey );
-    myCurves.remove( curveKey );
+  if ( hasPlotCurve( curve ) ) {
+    QwtPlotCurve* aPCurve = getPlotCurve( curve );
+    aPCurve->hide();
+    aPCurve->detach();
+    myPlot->getCurves().remove( aPCurve );
     updateTitles();
     if ( update )
       myPlot->replot();
@@ -689,11 +639,11 @@ void Plot2d_ViewFrame::eraseCurve( Plot2d_Curve* curve, bool update )
 */
 void Plot2d_ViewFrame::eraseCurves( const curveList& curves, bool update )
 {
-  QPtrListIterator<Plot2d_Curve> it(curves);
+  curveList::const_iterator it = curves.begin();
   Plot2d_Curve* aCurve;
-  while( (aCurve = it.current()) ) {
+  for (; it != curves.end(); ++it ) {
+    aCurve = *it;
     eraseCurve( aCurve, false );
-    ++it;
   }
 //  fitAll();
   if ( update )
@@ -707,61 +657,52 @@ void Plot2d_ViewFrame::updateCurve( Plot2d_Curve* curve, bool update )
 {
   if ( !curve )
     return;
-  int curveKey = hasCurve( curve );
-  if ( curveKey ) {
+  if ( hasPlotCurve( curve ) ) {
+  QwtPlotCurve* aPCurve = getPlotCurve( curve );
     if ( !curve->isAutoAssign() ) {
-      Qt::PenStyle     ps = plot2qwtLine( curve->getLine() );
-      QwtSymbol::Style ms = plot2qwtMarker( curve->getMarker() );
-      myPlot->setCurvePen( curveKey, QPen( curve->getColor(), curve->getLineWidth(), ps ) );
-      myPlot->setCurveSymbol( curveKey, QwtSymbol( ms, 
+      Qt::PenStyle     ps = Plot2d::plot2qwtLine( curve->getLine() );
+      QwtSymbol::Style ms = Plot2d::plot2qwtMarker( curve->getMarker() );
+      aPCurve->setPen ( QPen( curve->getColor(), curve->getLineWidth(), ps ) );
+      aPCurve->setSymbol( QwtSymbol( ms, 
                QBrush( curve->getColor() ), 
                QPen( curve->getColor() ), 
                QSize( myMarkerSize, myMarkerSize ) ) );
-      myPlot->setCurveData( curveKey, curve->horData(), curve->verData(), curve->nbPoints() );
+      aPCurve->setData( curve->horData(), curve->verData(), curve->nbPoints() );
     }
-    myPlot->setCurveTitle( curveKey, curve->getVerTitle() );
-    myPlot->curve( curveKey )->setEnabled( true );
+    aPCurve->setTitle( curve->getVerTitle() );
+    aPCurve->setVisible( true );
     if ( update )
       myPlot->replot();
   }
 }
 
-/*!
-  Returns curve key if is is displayed in the viewer and 0 otherwise
-*/
-int Plot2d_ViewFrame::hasCurve( Plot2d_Curve* curve )
-{
-  QIntDictIterator<Plot2d_Curve> it( myCurves );
-  for ( ; it.current(); ++it ) {
-    if ( it.current() == curve )
-      return it.currentKey();
-  }
-  return 0;
-}
-
 /*!
   Gets lsit of displayed curves
 */
-int Plot2d_ViewFrame::getCurves( QList<Plot2d_Curve>& clist )
+int Plot2d_ViewFrame::getCurves( curveList& clist )
 {
   clist.clear();
-  clist.setAutoDelete( false );
-  QIntDictIterator<Plot2d_Curve> it( myCurves );
-  for ( ; it.current(); ++it ) {
-    clist.append( it.current() );
-  }
+
+  CurveDict::iterator it = myPlot->getCurves().begin();
+  for ( ; it != myPlot->getCurves().end(); it++ )
+    clist.append( it.value() );
   return clist.count();
 }
 
+const CurveDict& Plot2d_ViewFrame::getCurves()
+{
+  return myPlot->getCurves();
+}
+
 /*!
   Returns true if the curve is visible
 */
 bool Plot2d_ViewFrame::isVisible( Plot2d_Curve* curve )
 {
   if(curve) {
-    int key = hasCurve( curve );
-    if ( key )
-      return myPlot->curve( key )->enabled();
+    if ( hasPlotCurve( curve ) ) {
+      return getPlotCurve( curve )->isVisible();
+    }
   }
   return false;
 } 
@@ -775,13 +716,12 @@ void Plot2d_ViewFrame::updateLegend( const Plot2d_Prs* prs )
     return;
   curveList aCurves = prs->getCurves();
 
-  QPtrListIterator<Plot2d_Curve> it(aCurves);
+  curveList::iterator it = aCurves.begin();
   Plot2d_Curve* aCurve;
-  while( (aCurve = it.current()) ) {
-    int curveKey = hasCurve( aCurve );
-    if ( curveKey )
-      myPlot->setCurveTitle( curveKey, aCurve->getVerTitle() );
-    ++it;
+  for (; it != aCurves.end(); ++it ) {
+    aCurve = *it;
+    if ( hasPlotCurve( aCurve ) )
+      getPlotCurve( aCurve )->setTitle( aCurve->getVerTitle() );
   }
 }
 
@@ -793,34 +733,26 @@ void Plot2d_ViewFrame::fitAll()
   // Postpone fitAll operation until QwtPlot geometry
   // has been fully defined
   if ( !myPlot->polished() ){
-    QApplication::postEvent( this, new QCustomEvent( FITALL_EVENT ) );
+    QApplication::postEvent( this, new QEvent( (QEvent::Type)FITALL_EVENT ) );
     return;
   }
 
-  QwtDiMap xMap1 = myPlot->canvasMap( QwtPlot::xBottom );
-
   myPlot->setAxisAutoScale( QwtPlot::yLeft );
   myPlot->setAxisAutoScale( QwtPlot::xBottom );
   myPlot->replot();
 
   // for existing grid
-  QwtDiMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
-  QwtDiMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
+  QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
+  QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
 
-  myPlot->setAxisScale( QwtPlot::xBottom, 
-      myPlot->invTransform( QwtPlot::xBottom, xMap.i1() ), 
-      myPlot->invTransform( QwtPlot::xBottom, xMap.i2() ) );
-  myPlot->setAxisScale( QwtPlot::yLeft, 
-      myPlot->invTransform( QwtPlot::yLeft, yMap.i1() ), 
-      myPlot->invTransform( QwtPlot::yLeft, yMap.i2() ) );
+  myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), xMap.s2() );
+  myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), yMap.s2() );
 
   if (mySecondY) {
     myPlot->setAxisAutoScale( QwtPlot::yRight );
     myPlot->replot();
-    QwtDiMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
-    myPlot->setAxisScale( QwtPlot::yRight, 
-        myPlot->invTransform( QwtPlot::yRight, yMap2.i1() ), 
-        myPlot->invTransform( QwtPlot::yRight, yMap2.i2() ) );
+    QwtScaleMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
+    myPlot->setAxisScale( QwtPlot::yRight, yMap2.s1(), yMap2.s2() );
   }
   myPlot->replot();
 }
@@ -830,7 +762,7 @@ void Plot2d_ViewFrame::fitAll()
 */
 void Plot2d_ViewFrame::fitArea( const QRect& area )
 {
-  QRect rect = area.normalize();
+  QRect rect = area.normalized();
   if ( rect.width() < MIN_RECT_SIZE ) {
     rect.setWidth( MIN_RECT_SIZE );
     rect.setLeft( rect.left() - MIN_RECT_SIZE/2 );
@@ -861,9 +793,9 @@ void Plot2d_ViewFrame::fitData(const int mode,
                               double y2Min, double y2Max)
 {
   if ( mode == 0 || mode == 2 ) {
-    myPlot->setAxisScale( QwtPlot::yLeft, yMax, yMin );
+    myPlot->setAxisScale( QwtPlot::yLeft, yMin, yMax );
     if (mySecondY)
-      myPlot->setAxisScale( QwtPlot::yRight, y2Max, y2Min );
+      myPlot->setAxisScale( QwtPlot::yRight, y2Min, y2Max );
   }
   if ( mode == 0 || mode == 1 ) 
     myPlot->setAxisScale( QwtPlot::xBottom, xMin, xMax ); 
@@ -877,10 +809,10 @@ void Plot2d_ViewFrame::getFitRanges(double& xMin,double& xMax,
                                    double& yMin, double& yMax,
                                    double& y2Min, double& y2Max)
 {
-  int ixMin = myPlot->canvasMap( QwtPlot::xBottom ).i1();
-  int ixMax = myPlot->canvasMap( QwtPlot::xBottom ).i2();
-  int iyMin = myPlot->canvasMap( QwtPlot::yLeft ).i1();
-  int iyMax = myPlot->canvasMap( QwtPlot::yLeft ).i2();
+  int ixMin = myPlot->canvasMap( QwtPlot::xBottom ).transform( myPlot->canvasMap( QwtPlot::xBottom ).s1() );
+  int ixMax = myPlot->canvasMap( QwtPlot::xBottom ).transform( myPlot->canvasMap( QwtPlot::xBottom ).s2() );
+  int iyMin = myPlot->canvasMap( QwtPlot::yLeft ).transform( myPlot->canvasMap( QwtPlot::yLeft ).s1() );
+  int iyMax = myPlot->canvasMap( QwtPlot::yLeft ).transform( myPlot->canvasMap( QwtPlot::yLeft ).s2() );
   xMin = myPlot->invTransform(QwtPlot::xBottom, ixMin);
   xMax = myPlot->invTransform(QwtPlot::xBottom, ixMax);
   yMin = myPlot->invTransform(QwtPlot::yLeft, iyMin);
@@ -888,8 +820,8 @@ void Plot2d_ViewFrame::getFitRanges(double& xMin,double& xMax,
   y2Min = 0;
   y2Max = 0;
   if (mySecondY) {
-    int iyMin = myPlot->canvasMap( QwtPlot::yRight ).i1();
-    int iyMax = myPlot->canvasMap( QwtPlot::yRight ).i2();
+    int iyMin = myPlot->canvasMap( QwtPlot::yRight ).transform( myPlot->canvasMap( QwtPlot::yRight ).s1() );
+    int iyMax = myPlot->canvasMap( QwtPlot::yRight ).transform( myPlot->canvasMap( QwtPlot::yRight ).s2() );
     y2Min = myPlot->invTransform(QwtPlot::yRight, iyMin);
     y2Max = myPlot->invTransform(QwtPlot::yRight, iyMax);
   }
@@ -900,10 +832,10 @@ void Plot2d_ViewFrame::getFitRanges(double& xMin,double& xMax,
 */
 int Plot2d_ViewFrame::testOperation( const QMouseEvent& me )
 {
-  int btn = me.button() | me.state();
-  const int zoomBtn = ControlButton | LeftButton;
-  const int panBtn  = ControlButton | MidButton;
-  const int fitBtn  = ControlButton | RightButton;
+  int btn = me.button() | me.modifiers();
+  const int zoomBtn = Qt::ControlModifier | Qt::LeftButton;
+  const int panBtn  = Qt::ControlModifier | Qt::MidButton;
+  const int fitBtn  = Qt::ControlModifier | Qt::RightButton;
 
   switch (btn)
   {
@@ -1077,14 +1009,11 @@ void Plot2d_ViewFrame::onChangeBackground()
 void Plot2d_ViewFrame::setCurveType( int curveType, bool update )
 {
   myCurveType = curveType;
-  QArray<long> keys = myPlot->curveKeys();
-  for ( int i = 0; i < (int)keys.count(); i++ ) {
-    if ( myCurveType == 0 )
-      myPlot->setCurveStyle( keys[i], QwtCurve::Dots );//QwtCurve::NoCurve
-    else if ( myCurveType == 1 )
-      myPlot->setCurveStyle( keys[i], QwtCurve::Lines );
-    else if ( myCurveType == 2 )
-      myPlot->setCurveStyle( keys[i], QwtCurve::Spline );
+  CurveDict::iterator it = myPlot->getCurves().begin();
+  for ( ; it != myPlot->getCurves().end(); it++ ) {
+    QwtPlotCurve* crv = it.key();
+    if ( crv )
+      setCurveType( crv, myCurveType );
   }
   if ( update )
     myPlot->replot();
@@ -1096,9 +1025,10 @@ void Plot2d_ViewFrame::setCurveType( int curveType, bool update )
   \param curveKey - curve id
   \param title - new title
 */
-void Plot2d_ViewFrame::setCurveTitle( int curveKey, const QString& title ) 
+void Plot2d_ViewFrame::setCurveTitle( Plot2d_Curve* curve, const QString& title ) 
 { 
-  if(myPlot) myPlot->setCurveTitle(curveKey, title); 
+  if ( curve && hasPlotCurve( curve ) )
+    getPlotCurve( curve )->setTitle( title );
 }   
 
 /*!
@@ -1107,8 +1037,18 @@ void Plot2d_ViewFrame::setCurveTitle( int curveKey, const QString& title )
 void Plot2d_ViewFrame::showLegend( bool show, bool update )
 {
   myShowLegend = show;
-  myPlot->setAutoLegend( myShowLegend );
-  myPlot->enableLegend( myShowLegend );
+  if ( myShowLegend ) {
+    QwtLegend* legend = myPlot->legend();
+    if ( !legend ) {
+      legend = new QwtLegend( myPlot );
+      legend->setFrameStyle( QFrame::Box | QFrame::Sunken );
+    }
+    legend->setItemMode( QwtLegend::ClickableItem );
+    myPlot->insertLegend( legend );
+    setLegendPos( myLegendPos );
+  }
+  else
+    myPlot->insertLegend( 0 );
   if ( update )
     myPlot->replot();
 }
@@ -1119,18 +1059,19 @@ void Plot2d_ViewFrame::showLegend( bool show, bool update )
 void Plot2d_ViewFrame::setLegendPos( int pos )
 {
   myLegendPos = pos;
+  QwtLegend* legend = myPlot->legend();
   switch( pos ) {
   case 0:
-    myPlot->setLegendPos( Qwt::Left );
+    myPlot->insertLegend( legend, QwtPlot::LeftLegend );
     break;
   case 1:
-    myPlot->setLegendPos( Qwt::Right );
+    myPlot->insertLegend( legend, QwtPlot::RightLegend );
     break;
   case 2:
-    myPlot->setLegendPos( Qwt::Top );
+    myPlot->insertLegend( legend, QwtPlot::TopLegend );
     break;
   case 3:
-    myPlot->setLegendPos( Qwt::Bottom );
+    myPlot->insertLegend( legend, QwtPlot::BottomLegend );
     break;
   }
 }
@@ -1143,15 +1084,14 @@ void Plot2d_ViewFrame::setMarkerSize( const int size, bool update )
   if ( myMarkerSize != size )
   {
     myMarkerSize = size;
-    QArray<long> keys = myPlot->curveKeys();
-    for ( int i = 0; i < (int)keys.count(); i++ )
-    {
-      QwtPlotCurve* crv = myPlot->curve( keys[i] );
+    CurveDict::iterator it = myPlot->getCurves().begin();
+    for ( ; it != myPlot->getCurves().end(); it++ ) {
+      QwtPlotCurve* crv = it.key();
       if ( crv )
       {
         QwtSymbol aSymbol = crv->symbol();
         aSymbol.setSize( myMarkerSize, myMarkerSize );
-        myPlot->setCurveSymbol( keys[i], aSymbol );
+        crv->setSymbol( aSymbol );
       }
     }
     if ( update )
@@ -1165,16 +1105,16 @@ void Plot2d_ViewFrame::setMarkerSize( const int size, bool update )
 void Plot2d_ViewFrame::setBackgroundColor( const QColor& color )
 {
   myBackground = color;
-  //myPlot->setCanvasBackground( myBackground );
   myPlot->canvas()->setPalette( myBackground );
   myPlot->setPalette( myBackground );
-  QPalette aPal = myPlot->getLegend()->palette();
-  for ( int i = 0; i < QPalette::NColorGroups; i++ ) {
-    QPalette::ColorGroup cg = (QPalette::ColorGroup)i;
-    aPal.setColor( cg, QColorGroup::Base, myBackground );
-    aPal.setColor( cg, QColorGroup::Background, myBackground );
+  if ( myPlot->getLegend() ) {
+    QPalette aPal = myPlot->getLegend()->palette();
+    for ( int i = 0; i < QPalette::NColorGroups; i++ ) {
+      aPal.setColor( QPalette::Base, myBackground );
+      aPal.setColor( QPalette::Background, myBackground );
+    }
+    myPlot->getLegend()->setPalette( aPal );
   }
-  myPlot->getLegend()->setPalette( aPal );
   Repaint();
 }
 /*!
@@ -1195,11 +1135,16 @@ void Plot2d_ViewFrame::setXGrid( bool xMajorEnabled, const int xMajorMax,
   myXGridMinorEnabled = xMinorEnabled;
   myXGridMaxMajor = xMajorMax;
   myXGridMaxMinor = xMinorMax;
+
   myPlot->setAxisMaxMajor( QwtPlot::xBottom, myXGridMaxMajor );
   myPlot->setAxisMaxMinor( QwtPlot::xBottom, myXGridMaxMinor );
-  myPlot->setGridXAxis(QwtPlot::xBottom);
-  myPlot->enableGridX( myXGridMajorEnabled );
-  myPlot->enableGridXMin( myXGridMinorEnabled );
+
+  QwtPlotGrid* grid = myPlot->grid();
+  if ( myPlot->axisScaleDiv( QwtPlot::xBottom ) )
+    grid->setXDiv( *myPlot->axisScaleDiv( QwtPlot::xBottom ) );
+  grid->enableX( myXGridMajorEnabled );
+  grid->enableXMin( myXGridMinorEnabled );
+
   if ( update )
     myPlot->replot();
 }
@@ -1231,26 +1176,29 @@ void Plot2d_ViewFrame::setYGrid( bool yMajorEnabled, const int yMajorMax,
     myPlot->setAxisMaxMinor( QwtPlot::yRight, myY2GridMaxMinor );
   }
 
-  myPlot->setGridYAxis(QwtPlot::yLeft);
+  QwtPlotGrid* grid = myPlot->grid();
+  if ( myPlot->axisScaleDiv( QwtPlot::yLeft ) )
+    grid->setYDiv( *myPlot->axisScaleDiv( QwtPlot::yLeft ) );
 
   if (mySecondY) {
     if (myYGridMajorEnabled) {
-      myPlot->enableGridYMin(myYGridMinorEnabled);
-      myPlot->enableGridY( myYGridMajorEnabled);
+      grid->enableY( myYGridMajorEnabled );
+      grid->enableYMin( myYGridMinorEnabled );
     }
     else if (myY2GridMajorEnabled) {
-      myPlot->setGridYAxis(QwtPlot::yRight);
-      myPlot->enableGridYMin(myY2GridMinorEnabled);
-      myPlot->enableGridY(myY2GridMajorEnabled);
+      if ( myPlot->axisScaleDiv( QwtPlot::yRight ) )
+        grid->setYDiv( *myPlot->axisScaleDiv( QwtPlot::yRight ) );
+      grid->enableY( myY2GridMajorEnabled );
+      grid->enableYMin( myY2GridMinorEnabled );
     }
     else {
-      myPlot->enableGridYMin(false);
-      myPlot->enableGridY(false);
+      grid->enableY( false );
+      grid->enableYMin( false );
     }
   }
   else {
-    myPlot->enableGridY( myYGridMajorEnabled );
-    myPlot->enableGridYMin( myYGridMinorEnabled );
+    grid->enableY( myYGridMajorEnabled );
+    grid->enableYMin( myYGridMinorEnabled );
   }
   if ( update )
     myPlot->replot();
@@ -1266,22 +1214,22 @@ void Plot2d_ViewFrame::setTitle( bool enabled, const QString& title,
     case MainTitle:
       myTitleEnabled = enabled;
       myTitle = title;
-      myPlot->setTitle( myTitleEnabled ? myTitle : QString::null );
+      myPlot->setTitle( myTitleEnabled ? myTitle : QString() );
       break;
     case XTitle:
       myXTitleEnabled = enabled;
       myXTitle = title;
-      myPlot->setAxisTitle( QwtPlot::xBottom, myXTitleEnabled ? myXTitle : QString::null );
+      myPlot->setAxisTitle( QwtPlot::xBottom, myXTitleEnabled ? myXTitle : QString() );
       break;
     case YTitle:
       myYTitleEnabled = enabled;
       myYTitle = title;
-      myPlot->setAxisTitle( QwtPlot::yLeft, myYTitleEnabled ? myYTitle : QString::null );
+      myPlot->setAxisTitle( QwtPlot::yLeft, myYTitleEnabled ? myYTitle : QString() );
       break;
     case Y2Title:
       myY2TitleEnabled = enabled;
       myY2Title = title;
-      myPlot->setAxisTitle( QwtPlot::yRight, myY2TitleEnabled ? myY2Title : QString::null );
+      myPlot->setAxisTitle( QwtPlot::yRight, myY2TitleEnabled ? myY2Title : QString() );
       break;
   }
   if ( update )
@@ -1312,20 +1260,20 @@ void Plot2d_ViewFrame::setFont( const QFont& font, ObjectType type, bool update)
 {
   switch (type) {
     case MainTitle:
-      myPlot->setTitleFont(font);
+      myPlot->title().setFont(font);
       break;
     case XTitle:
-      myPlot->setAxisTitleFont(QwtPlot::xBottom, font); break;
+       myPlot->axisTitle(QwtPlot::xBottom).setFont(font); break;
     case YTitle:
-      myPlot->setAxisTitleFont(QwtPlot::yLeft, font);   break;
+      myPlot->axisTitle(QwtPlot::yLeft).setFont(font);    break;
     case Y2Title:
-      myPlot->setAxisTitleFont(QwtPlot::yRight, font);  break;
+      myPlot->axisTitle(QwtPlot::yRight).setFont(font);   break;
     case XAxis:
-      myPlot->setAxisFont(QwtPlot::xBottom, font);      break;
+      myPlot->setAxisFont(QwtPlot::xBottom, font);        break;
     case YAxis:
-      myPlot->setAxisFont(QwtPlot::yLeft, font);        break;
+      myPlot->setAxisFont(QwtPlot::yLeft, font);          break;
     case Y2Axis:
-      myPlot->setAxisFont(QwtPlot::yRight, font);       break;
+      myPlot->setAxisFont(QwtPlot::yRight, font);         break;
   }
   if ( update )
     myPlot->replot();
@@ -1335,17 +1283,20 @@ void Plot2d_ViewFrame::setFont( const QFont& font, ObjectType type, bool update)
 */
 void Plot2d_ViewFrame::setHorScaleMode( const int mode, bool update )
 {
+  if ( myXMode == mode )
+    return;
+
   // san -- Protection against QwtCurve bug in Qwt 0.4.x: 
   // it crashes if switched to X/Y logarithmic mode, when one or more points have
   // non-positive X/Y coordinate
   if ( mode && !isXLogEnabled() ){
-    SUIT_MessageBox::warn1(this, tr("WARNING"), tr("WRN_XLOG_NOT_ALLOWED"), tr("BUT_OK"));
+    SUIT_MessageBox::warning(this, tr("WARNING"), tr("WRN_XLOG_NOT_ALLOWED"));
     return;
   }
 
   myXMode = mode;
 
-  myPlot->changeAxisOptions( QwtPlot::xBottom, QwtAutoScale::Logarithmic, myXMode != 0 );
+  myPlot->setLogScale(QwtPlot::xBottom, myXMode != 0);
 
   if ( update )
     fitAll();
@@ -1356,18 +1307,21 @@ void Plot2d_ViewFrame::setHorScaleMode( const int mode, bool update )
 */
 void Plot2d_ViewFrame::setVerScaleMode( const int mode, bool update )
 {
+  if ( myYMode == mode )
+    return;
+
   // san -- Protection against QwtCurve bug in Qwt 0.4.x: 
   // it crashes if switched to X/Y logarithmic mode, when one or more points have
   // non-positive X/Y coordinate
   if ( mode && !isYLogEnabled() ){
-    SUIT_MessageBox::warn1(this, tr("WARNING"), tr("WRN_YLOG_NOT_ALLOWED"), tr("BUT_OK"));
+    SUIT_MessageBox::warning(this, tr("WARNING"), tr("WRN_YLOG_NOT_ALLOWED"));
     return;
   }
 
   myYMode = mode;
-  myPlot->changeAxisOptions( QwtPlot::yLeft, QwtAutoScale::Logarithmic, myYMode != 0 );
+  myPlot->setLogScale(QwtPlot::yLeft, myYMode != 0);
   if (mySecondY)
-    myPlot->changeAxisOptions( QwtPlot::yRight, QwtAutoScale::Logarithmic, myYMode != 0 );
+    myPlot->setLogScale( QwtPlot::yRight, myYMode != 0 );
 
   if ( update )
     fitAll();
@@ -1392,37 +1346,34 @@ bool Plot2d_ViewFrame::isModeVerLinear()
 /*!
   Slot, called when user presses mouse button
 */
-void Plot2d_ViewFrame::plotMousePressed(const QMouseEvent& me )
+void Plot2d_ViewFrame::plotMousePressed( const QMouseEvent& me )
 {
   Plot2d_ViewWindow* aParent = dynamic_cast<Plot2d_ViewWindow*>(parent());
-   if (aParent)
+  if (aParent)
      aParent->putInfo(getInfo(me.pos()));
   if ( myOperation == NoOpId )
     myOperation = testOperation( me );
   if ( myOperation != NoOpId ) {
     myPnt = me.pos();
-    if ( myOperation == FitAreaId ) {
-      myPlot->setOutlineStyle( Qwt::Rect );
-    }
-    else if ( myOperation == GlPanId ) {
+    if ( myOperation == GlPanId ) {
       myPlot->setAxisScale( QwtPlot::yLeft,
-          myPlot->invTransform( QwtPlot::yLeft, myPnt.y() ) + myYDistance/2, 
-          myPlot->invTransform( QwtPlot::yLeft, myPnt.y() ) - myYDistance/2 );
+          myPlot->invTransform( QwtPlot::yLeft, myPnt.y() ) - myYDistance/2, 
+          myPlot->invTransform( QwtPlot::yLeft, myPnt.y() ) + myYDistance/2 );
       myPlot->setAxisScale( QwtPlot::xBottom, 
           myPlot->invTransform( QwtPlot::xBottom, myPnt.x() ) - myXDistance/2, 
           myPlot->invTransform( QwtPlot::xBottom, myPnt.x() ) + myXDistance/2 );
       if (mySecondY)
         myPlot->setAxisScale( QwtPlot::yRight,
-          myPlot->invTransform( QwtPlot::yRight, myPnt.y() ) + myYDistance2/2, 
-          myPlot->invTransform( QwtPlot::yRight, myPnt.y() ) - myYDistance2/2 );
+          myPlot->invTransform( QwtPlot::yRight, myPnt.y() ) - myYDistance2/2, 
+          myPlot->invTransform( QwtPlot::yRight, myPnt.y() ) + myYDistance2/2 );
       myPlot->replot();
     }
   }
   else {
-    int btn = me.button() | me.state();
-    if (btn == RightButton) {
+    int btn = me.button() | me.modifiers();
+    if (btn == Qt::RightButton) {
       QMouseEvent* aEvent = new QMouseEvent(QEvent::MouseButtonPress,
-                                            me.pos(), btn, me.state());
+                                            me.pos(), me.button(), me.buttons(), me.modifiers() );
       // QMouseEvent 'me' has the 'MouseButtonDblClick' type. In this case we create new event 'aEvent'.
       parent()->eventFilter(this, aEvent);
     }
@@ -1432,19 +1383,22 @@ void Plot2d_ViewFrame::plotMousePressed(const QMouseEvent& me )
 /*!
   Slot, called when user moves mouse
 */
-void Plot2d_ViewFrame::plotMouseMoved( const QMouseEvent& me )
+bool Plot2d_ViewFrame::plotMouseMoved( const QMouseEvent& me )
 {
   int    dx = me.pos().x() - myPnt.x();
   int    dy = me.pos().y() - myPnt.y();
 
+  bool aRes = false;
   if ( myOperation != NoOpId) {
     if ( myOperation == ZoomId ) {
       this->incrementalZoom( dx, dy ); 
       myPnt = me.pos();
+      aRes = true;
     }
     else if ( myOperation == PanId ) {
       this->incrementalPan( dx, dy );
       myPnt = me.pos();
+      aRes = true;
     }
   }
   else {
@@ -1452,25 +1406,21 @@ void Plot2d_ViewFrame::plotMouseMoved( const QMouseEvent& me )
      if (aParent)
        aParent->putInfo(getInfo(me.pos()));
   }
+  return aRes;
 }
 /*!
   Slot, called when user releases mouse
 */
 void Plot2d_ViewFrame::plotMouseReleased( const QMouseEvent& me )
 {
-  if ( myOperation == NoOpId && me.button() == RightButton )
+  if ( myOperation == NoOpId && me.button() == Qt::RightButton && me.modifiers() != Qt::ControlModifier )
   {
     QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
-                              me.pos(), me.globalPos(),
-                              me.state() );
+                              me.pos(), me.globalPos() );
     emit contextMenuRequested( &aEvent );
   }
-  if ( myOperation == FitAreaId ) {
-    QRect rect( myPnt, me.pos() );
-    fitArea( rect );
-  }
   myPlot->canvas()->setCursor( QCursor( Qt::CrossCursor ) );
-  myPlot->setOutlineStyle( Qwt::Triangle );
+  myPlot->defaultPicker();
 
   Plot2d_ViewWindow* aParent = dynamic_cast<Plot2d_ViewWindow*>(parent());
    if (aParent)
@@ -1485,24 +1435,66 @@ void Plot2d_ViewFrame::wheelEvent(QWheelEvent* event)
   double aDelta = event->delta();
   double aScale = (aDelta < 0) ? 100./(-aDelta) : aDelta/100.; 
 
-  QwtDiMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
-  QwtDiMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
+  QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
+  QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
 
-  myPlot->setAxisScale( QwtPlot::yLeft,
-    myPlot->invTransform( QwtPlot::yLeft, yMap.i1() ), 
-    myPlot->invTransform( QwtPlot::yLeft, yMap.i2() )*aScale );
-  myPlot->setAxisScale( QwtPlot::xBottom, 
-    myPlot->invTransform( QwtPlot::xBottom, xMap.i1() ),
-    myPlot->invTransform( QwtPlot::xBottom, xMap.i2() )*aScale );
+  myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), yMap.s2()*aScale );
+  myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), xMap.s2()*aScale );
   if (mySecondY) {
-    QwtDiMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
-    myPlot->setAxisScale( QwtPlot::yRight,
-      myPlot->invTransform( QwtPlot::yRight, y2Map.i1() ), 
-      myPlot->invTransform( QwtPlot::yRight, y2Map.i2() )*aScale );
+    QwtScaleMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
+    myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(), y2Map.s2()*aScale );
   }
   myPlot->replot();
   myPnt = event->pos();
 }
+
+/*!
+  Returns qwt plot curve if it is existed in map of curves and 0 otherwise
+*/
+QwtPlotCurve* Plot2d_ViewFrame::getPlotCurve( Plot2d_Curve* curve )
+{
+  CurveDict::iterator it = myPlot->getCurves().begin();
+  for ( ; it != myPlot->getCurves().end(); it++ ) {
+    if ( it.value() == curve )
+      return it.key();
+  }
+  return 0;
+}
+/*!
+  Returns true if qwt plot curve is existed in map of curves and false otherwise
+*/
+bool Plot2d_ViewFrame::hasPlotCurve( Plot2d_Curve* curve )
+{
+  CurveDict::iterator it = myPlot->getCurves().begin();
+  for ( ; it != myPlot->getCurves().end(); it++ ) {
+    if ( it.value() == curve )
+      return true;
+  }
+  return false;
+}
+
+/*!
+  Sets curve type
+*/
+void Plot2d_ViewFrame::setCurveType( QwtPlotCurve* curve, int curveType )
+{
+  if ( !curve )
+    return;
+  if ( myCurveType == 0 )
+    curve->setStyle( QwtPlotCurve::Dots );//QwtCurve::NoCurve
+  else if ( myCurveType == 1 ) {
+    curve->setStyle( QwtPlotCurve::Lines );
+    curve->setCurveAttribute( QwtPlotCurve::Fitted, false );
+  }
+  else if ( myCurveType == 2 ) {
+    curve->setStyle( QwtPlotCurve::Lines );
+    QwtSplineCurveFitter* fitter = new QwtSplineCurveFitter();
+    fitter->setSplineSize( 250 );
+    curve->setCurveAttribute( QwtPlotCurve::Fitted, true );
+    curve->setCurveFitter( fitter );
+  }
+}
+
 /*!
   View operations : Pan view
 */
@@ -1511,7 +1503,6 @@ void Plot2d_ViewFrame::onViewPan()
   QCursor panCursor (Qt::SizeAllCursor);
   myPlot->canvas()->setCursor( panCursor );
   myOperation = PanId;
-  qApp->installEventFilter( this );
 }
 /*!
   View operations : Zoom view
@@ -1522,7 +1513,6 @@ void Plot2d_ViewFrame::onViewZoom()
   QCursor zoomCursor (zoomPixmap);
   myPlot->canvas()->setCursor( zoomCursor );
   myOperation = ZoomId;
-  qApp->installEventFilter( this );
 }
 /*!
   View operations : Fot All
@@ -1538,7 +1528,7 @@ void Plot2d_ViewFrame::onViewFitArea()
 {
   myPlot->canvas()->setCursor( QCursor( Qt::PointingHandCursor ) );
   myOperation = FitAreaId;
-  qApp->installEventFilter( this );
+  myPlot->setPickerMousePattern( Qt::LeftButton );
 }
 /*!
   View operations : Global panning
@@ -1548,24 +1538,23 @@ void Plot2d_ViewFrame::onViewGlobalPan()
   QPixmap globalPanPixmap (imageCrossCursor);
   QCursor glPanCursor (globalPanPixmap);
   myPlot->canvas()->setCursor( glPanCursor );
-  myPlot->changeAxisOptions( QwtPlot::xBottom, QwtAutoScale::Logarithmic, false );
-  myPlot->changeAxisOptions( QwtPlot::yLeft, QwtAutoScale::Logarithmic, false );
+  myPlot->setLogScale(QwtPlot::xBottom, false);
+  myPlot->setLogScale(QwtPlot::yLeft, false);
   if (mySecondY)
-    myPlot->changeAxisOptions( QwtPlot::yRight, QwtAutoScale::Logarithmic, false );
+    myPlot->setLogScale(QwtPlot::yRight, false);
   myPlot->replot();
-  QwtDiMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
-  QwtDiMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
+  QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
+  QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
 
-  myXDistance = xMap.d2() - xMap.d1();
-  myYDistance = yMap.d2() - yMap.d1();
+  myXDistance = xMap.s2() - xMap.s1();
+  myYDistance = yMap.s2() - yMap.s1();
 
   if (mySecondY) {
-    QwtDiMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
-    myYDistance2 = yMap2.d2() - yMap2.d1();
+    QwtScaleMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
+    myYDistance2 = yMap2.s2() - yMap2.s1();
   }
   fitAll();
   myOperation = GlPanId;
-  qApp->installEventFilter( this );
 }
 
 /*!
@@ -1574,10 +1563,9 @@ void Plot2d_ViewFrame::onViewGlobalPan()
 bool Plot2d_ViewFrame::isXLogEnabled() const
 {
   bool allPositive = true;
-  QIntDictIterator<Plot2d_Curve> it( myCurves );
-  for ( ; allPositive && it.current(); ++it ) {
-    allPositive = ( it.current()->getMinX() > 0. );
-  }
+  CurveDict::const_iterator it = myPlot->getCurves().begin();
+  for ( ; allPositive && it != myPlot->getCurves().end(); it++ )
+    allPositive = ( it.value()->getMinX() > 0. );
   return allPositive;
 }
 
@@ -1587,13 +1575,25 @@ bool Plot2d_ViewFrame::isXLogEnabled() const
 bool Plot2d_ViewFrame::isYLogEnabled() const
 {
   bool allPositive = true;
-  QIntDictIterator<Plot2d_Curve> it( myCurves );
-  for ( ; allPositive && it.current(); ++it ) {
-    allPositive = ( it.current()->getMinY() > 0. );
-  }
+  CurveDict::const_iterator it = myPlot->getCurves().begin();
+  for ( ; allPositive && it != myPlot->getCurves().end(); it++ )
+    allPositive = ( it.value()->getMinY() > 0. );
   return allPositive;
 }
 
+class Plot2d_QwtPlotZoomer : public QwtPlotZoomer
+{
+public:
+  Plot2d_QwtPlotZoomer( int xAxis, int yAxis, QwtPlotCanvas* canvas )
+  : QwtPlotZoomer( xAxis, yAxis, canvas )
+  {
+    qApp->installEventFilter( this );
+    // now picker working after only a button pick.
+    // after click on button FitArea in toolbar of the ViewFrame.
+  };
+  ~Plot2d_QwtPlotZoomer() {};
+};
+
 /*!
   Constructor
 */
@@ -1601,24 +1601,49 @@ Plot2d_Plot2d::Plot2d_Plot2d( QWidget* parent )
   : QwtPlot( parent ),
     myIsPolished( false )
 {
-  // outline
-  enableOutline( true );
-  setOutlineStyle( Qwt::Triangle );
-  setOutlinePen( green );
-  // legend
-  setAutoLegend( false );
-  setLegendFrameStyle( QFrame::Box | QFrame::Sunken );
-  enableLegend( false );
-  // grid
-  enableGridX( false );
-  enableGridXMin( false );
-  enableGridY( false );
-  enableGridYMin( false );
+  myPlotZoomer = new Plot2d_QwtPlotZoomer( QwtPlot::xBottom, QwtPlot::yLeft, canvas() );
+  myPlotZoomer->setSelectionFlags( QwtPicker::DragSelection | QwtPicker::CornerToCorner );
+  myPlotZoomer->setTrackerMode( QwtPicker::AlwaysOff );
+  myPlotZoomer->setRubberBand( QwtPicker::RectRubberBand );
+  myPlotZoomer->setRubberBandPen( QColor( Qt::green ) );
+
+  defaultPicker();
+
   // auto scaling by default
   setAxisAutoScale( QwtPlot::yLeft );
   setAxisAutoScale( QwtPlot::yRight );
   setAxisAutoScale( QwtPlot::xBottom );
+
+// grid
+  myGrid = new QwtPlotGrid();
+  QPen aMajPen = myGrid->majPen();
+  aMajPen.setStyle( Qt::DashLine );
+  myGrid->setPen( aMajPen );
+
+  myGrid->enableX( false );
+  myGrid->enableXMin( false );
+  myGrid->enableY( false );
+  myGrid->enableYMin( false );
+
+  myGrid->attach( this );
+
+  setMouseTracking( false );
+  canvas()->setMouseTracking( true );
+
+  myPlotZoomer->setEnabled( true );
+}
+
+/*!
+  \set axis scale engine - linear or log10
+*/
+void Plot2d_Plot2d::setLogScale( int axisId, bool log10 )
+{
+  if ( log10 )
+    setAxisScaleEngine( axisId, new QwtLog10ScaleEngine() );
+  else
+    setAxisScaleEngine( axisId, new QwtLinearScaleEngine() );
 }
+
 /*!
   Recalculates and redraws Plot 2d view 
 */
@@ -1753,32 +1778,100 @@ QSize Plot2d_Plot2d::minimumSizeHint() const
 //  QSize aSize = QwtPlot::minimumSizeHint();
 //  return QSize(aSize.width()*3/4, aSize.height());
 }
+
+void Plot2d_Plot2d::defaultPicker()
+{
+  myPlotZoomer->setMousePattern( QwtEventPattern::MouseSelect1,
+                                 Qt::RightButton, Qt::ControlModifier ); // zooming button
+  for ( int i = QwtEventPattern::MouseSelect2; i < QwtEventPattern::MouseSelect6; i++ )
+    myPlotZoomer->setMousePattern( i, Qt::NoButton, Qt::NoButton );
+}
+
+void Plot2d_Plot2d::setPickerMousePattern( int button, int state )
+{
+  myPlotZoomer->setMousePattern( QwtEventPattern::MouseSelect1, button, state );
+}
+
+/*!
+  return closest curve if it exist, else 0
+*/
+Plot2d_Curve* Plot2d_Plot2d::getClosestCurve( QPoint p, double& distance, int& index )
+{
+  CurveDict::iterator it = getCurves().begin();
+  QwtPlotCurve* aCurve;
+  for ( ; it != getCurves().end(); it++ ) {
+    aCurve = it.key();
+    if ( !aCurve )
+      continue;
+    index = aCurve->closestPoint( p, &distance );
+    if ( index > -1 )
+      return it.value();
+  }
+  return 0;
+}
+
 /*!
   Checks if marker belongs to any enitity
 */
 bool Plot2d_Plot2d::existMarker( const QwtSymbol::Style typeMarker, const QColor& color, const Qt::PenStyle typeLine ) 
 {
-  // getting all curves
-  QArray<long> keys = curveKeys();
-  //QColor aRgbColor;
-
-  if ( closeColors( color, backgroundColor() ) )
+  QColor aColor = palette().color( QPalette::Background );
+  if ( closeColors( color, aColor ) )
       return true;
-  for ( int i = 0; i < (int)keys.count(); i++ )
-  {
-    QwtPlotCurve* crv = curve( keys[i] );
+
+  CurveDict::iterator it = myCurves.begin();
+  for ( ; it != myCurves.end(); it++ ) {
+    QwtPlotCurve* crv = it.key();
     if ( crv ) {
       QwtSymbol::Style aStyle = crv->symbol().style();
       QColor           aColor = crv->pen().color();
       Qt::PenStyle     aLine  = crv->pen().style();
 //      if ( aStyle == typeMarker && aColor == color && aLine == typeLine )
       if ( aStyle == typeMarker && closeColors( aColor,color ) && aLine == typeLine )
-  return true;
+        return true;
     }
   }
   return false;
 }
 
+/*!
+  Slot: checks the current labels format and change it if needed
+*/
+void Plot2d_Plot2d::onScaleDivChanged()
+{
+  QwtScaleWidget* aSW = 0;
+  if ( ( aSW = dynamic_cast<QwtScaleWidget*>(sender()) ) ) {
+    int axisId = -1;
+    switch ( aSW->alignment() ) {
+    case QwtScaleDraw::BottomScale:
+      axisId = QwtPlot::xBottom;
+      break;
+    case QwtScaleDraw::LeftScale:
+      axisId = QwtPlot::yLeft;
+      break;
+    case QwtScaleDraw::RightScale:
+      axisId = QwtPlot::yRight;
+      break;
+    default:
+      break;
+    }
+      
+    if ( axisId >= 0 ) {
+      QwtScaleMap map = canvasMap(axisId);
+      double aDist = fabs(map.s2()-map.s1()) / (axisMaxMajor(axisId)*axisMaxMinor(axisId));
+
+      QString aDistStr;
+      aDistStr.sprintf("%e",aDist);
+      int aPrecision = aDistStr.right(aDistStr.length()-aDistStr.indexOf('e')-2).toInt();
+
+      QwtScaleDraw* aQwtSD = axisScaleDraw(axisId);
+      Plot2d_ScaleDraw* aPlot2dSD = dynamic_cast<Plot2d_ScaleDraw*>(aQwtSD);
+      if ( !aPlot2dSD && aPrecision > 6 || aPlot2dSD && aPlot2dSD->precision() != aPrecision )
+       setAxisScaleDraw( axisId, new Plot2d_ScaleDraw(*aQwtSD, 'f', aPrecision) );
+    }
+  }
+}
+
 /*!
   Sets the flag saying that QwtPlot geometry has been fully defined.
 */
@@ -1843,33 +1936,35 @@ void Plot2d_ViewFrame::copyPreferences( Plot2d_ViewFrame* vf )
 #define BRACKETIZE(x) QString( "[ " ) + x + QString( " ]" )
 void Plot2d_ViewFrame::updateTitles() 
 {
-  QIntDictIterator<Plot2d_Curve> it( myCurves );
+  CurveDict::iterator it = myPlot->getCurves().begin();
+  //QIntDictIterator<Plot2d_Curve> it( myCurves );
   QStringList aXTitles;
   QStringList aYTitles;
   QStringList aXUnits;
   QStringList aYUnits;
   QStringList aTables;
   int i = 0;
-  while ( it.current() ) {
+
+  Plot2d_Curve* aCurve;
+  for ( ; it != myPlot->getCurves().end(); it++ ) {
     // collect titles and units from all curves...
-    QString xTitle = it.current()->getHorTitle().stripWhiteSpace();
-    QString yTitle = it.current()->getVerTitle().stripWhiteSpace();
-    QString xUnits = it.current()->getHorUnits().stripWhiteSpace();
-    QString yUnits = it.current()->getVerUnits().stripWhiteSpace();
+    aCurve = it.value();
+    QString xTitle = aCurve->getHorTitle().trimmed();
+    QString yTitle = aCurve->getVerTitle().trimmed();
+    QString xUnits = aCurve->getHorUnits().trimmed();
+    QString yUnits = aCurve->getVerUnits().trimmed();
     
     aYTitles.append( yTitle );
-    if ( aXTitles.find( xTitle ) == aXTitles.end() )
+    if ( !aXTitles.contains( xTitle ) )
       aXTitles.append( xTitle );
-    if ( aXUnits.find( xUnits ) == aXUnits.end() )
+    if ( !aXUnits.contains( xUnits ) )
       aXUnits.append( xUnits );
-    if ( aYUnits.find( yUnits ) == aYUnits.end() )
+    if ( !aYUnits.contains( yUnits ) )
       aYUnits.append( yUnits );
 
-    QString aName = it.current()->getTableTitle();
-    if( !aName.isEmpty() && aTables.find( aName ) == aTables.end() )
+    QString aName = aCurve->getTableTitle();
+    if( !aName.isEmpty() && !aTables.contains( aName ) )
       aTables.append( aName );
-
-    ++it;
     ++i;
   }
   // ... and update plot 2d view
@@ -1909,11 +2004,10 @@ bool Plot2d_ViewFrame::print( const QString& file, const QString& format ) const
   if( myPlot )
   {
     QPaintDevice* pd = 0;
-    if( format=="PS" )
+    if( format=="PS" || format=="EPS" )
     {
       QPrinter* pr = new QPrinter( QPrinter::HighResolution );
       pr->setPageSize( QPrinter::A4 );
-      pr->setOutputToFile( true );
       pr->setOutputFileName( file );
       pr->setPrintProgram( "" );
       pd = pr;
@@ -1948,7 +2042,7 @@ QString Plot2d_ViewFrame::getVisualParameters()
 */
 void Plot2d_ViewFrame::setVisualParameters( const QString& parameters )
 {
-  QStringList paramsLst = QStringList::split( '*', parameters, true );
+  QStringList paramsLst = parameters.split( '*' );
   if ( paramsLst.size() == 9 ) {
     double xmin, xmax, ymin, ymax, y2min, y2max;
     myXMode = paramsLst[0].toInt();
@@ -1967,8 +2061,8 @@ void Plot2d_ViewFrame::setVisualParameters( const QString& parameters )
     setVerScaleMode( myYMode, /*update=*/false );
     
     if (mySecondY) {
-      QwtDiMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
-      myYDistance2 = yMap2.d2() - yMap2.d1();
+      QwtScaleMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
+      myYDistance2 = yMap2.s2() - yMap2.s1();
     }
 
     fitData( 0, xmin, xmax, ymin, ymax, y2min, y2max );
@@ -1980,20 +2074,20 @@ void Plot2d_ViewFrame::setVisualParameters( const QString& parameters )
   Incremental zooming operation
 */
 void Plot2d_ViewFrame::incrementalPan( const int incrX, const int incrY ) {
-  QwtDiMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
-  QwtDiMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
+  QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
+  QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
   
   myPlot->setAxisScale( QwtPlot::yLeft, 
-                       myPlot->invTransform( QwtPlot::yLeft, yMap.i1()-incrY ), 
-                       myPlot->invTransform( QwtPlot::yLeft, yMap.i2()-incrY ) );
+                       myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s1() )-incrY ), 
+                       myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() )-incrY ) );
   myPlot->setAxisScale( QwtPlot::xBottom, 
-                       myPlot->invTransform( QwtPlot::xBottom, xMap.i1()-incrX ),
-                       myPlot->invTransform( QwtPlot::xBottom, xMap.i2()-incrX ) ); 
+                       myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s1() )-incrX ),
+                       myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() )-incrX ) ); 
   if (mySecondY) {
-    QwtDiMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
+    QwtScaleMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
     myPlot->setAxisScale( QwtPlot::yRight,
-                         myPlot->invTransform( QwtPlot::yRight, y2Map.i1()-incrY ), 
-                         myPlot->invTransform( QwtPlot::yRight, y2Map.i2()-incrY ) );
+                         myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s1() )-incrY ), 
+                         myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() )-incrY ) );
   }
   myPlot->replot();
 }
@@ -2002,20 +2096,17 @@ void Plot2d_ViewFrame::incrementalPan( const int incrX, const int incrY ) {
   Incremental panning operation
 */
 void Plot2d_ViewFrame::incrementalZoom( const int incrX, const int incrY ) {
-  QwtDiMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
-  QwtDiMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
+  QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
+  QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
   
-  myPlot->setAxisScale( QwtPlot::yLeft, 
-                       myPlot->invTransform( QwtPlot::yLeft, yMap.i1() ), 
-                       myPlot->invTransform( QwtPlot::yLeft, yMap.i2() + incrY ) );
-  myPlot->setAxisScale( QwtPlot::xBottom, 
-                       myPlot->invTransform( QwtPlot::xBottom, xMap.i1() ), 
-                       myPlot->invTransform( QwtPlot::xBottom, xMap.i2() - incrX ) );
+  myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), 
+                       myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() ) + incrY ) );
+  myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), 
+                       myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() ) - incrX ) );
   if (mySecondY) {
-    QwtDiMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
-    myPlot->setAxisScale( QwtPlot::yRight, 
-                         myPlot->invTransform( QwtPlot::yRight, y2Map.i1() ), 
-                         myPlot->invTransform( QwtPlot::yRight, y2Map.i2() + incrY ) );
+    QwtScaleMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
+    myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(),
+                         myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() ) + incrY ) );
   }
   myPlot->replot();
 }
@@ -2075,8 +2166,29 @@ void Plot2d_ViewFrame::onZoomOut()
   event queue. This ensures that other important events (show, resize, etc.)
   are processed first.
 */
-void Plot2d_ViewFrame::customEvent( QCustomEvent* ce )
+void Plot2d_ViewFrame::customEvent( QEvent* ce )
 {
   if ( ce->type() == FITALL_EVENT )
     fitAll();
 }
+
+Plot2d_ScaleDraw::Plot2d_ScaleDraw( char f, int prec )
+  : QwtScaleDraw(),
+    myFormat(f),
+    myPrecision(prec)
+{
+  invalidateCache();
+}
+
+Plot2d_ScaleDraw::Plot2d_ScaleDraw( const QwtScaleDraw& scaleDraw, char f, int prec )
+  : QwtScaleDraw(scaleDraw),
+    myFormat(f),
+    myPrecision(prec)
+{
+  invalidateCache();
+}
+
+QwtText Plot2d_ScaleDraw::label( double value ) const
+{
+  return QLocale::system().toString(value,myFormat,myPrecision);
+}
index 108cbd9573cf42cfce02593947365b170cfcc3c1..e2e99e9e2b6c62b84d7a6470f2a67c57fe3116ce 100755 (executable)
@@ -1,33 +1,42 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef PLOT2D_VIEWFRAME_H
 #define PLOT2D_VIEWFRAME_H
 
 #include "Plot2d_Curve.h"
-#include <qwidget.h>
-#include <qintdict.h>
+#include <QWidget>
+#include <QMultiHash>
+#include <QList>
+#include <qwt_symbol.h>
+#include <qwt_scale_draw.h>
 
 class Plot2d_Plot2d;
 class Plot2d_Prs;
 class QCustomEvent;
+class QwtPlotCurve;
+class QwtPlotGrid;
+class QwtPlotZoomer;
 
-typedef QIntDict<Plot2d_Curve> CurveDict;
+typedef QMultiHash<QwtPlotCurve*, Plot2d_Curve*> CurveDict;
 
 class PLOT2D_EXPORT Plot2d_ViewFrame : public QWidget
 { 
@@ -55,6 +64,8 @@ public:
   void    Erase( const Plot2d_Prs*, const bool = false );
   Plot2d_Prs* CreatePrs( const char* entry = 0 );
 
+  virtual bool eventFilter(QObject* watched, QEvent* e);
+
   /* operations */
   void    updateTitles();
   void    setTitle( const QString& title );
@@ -64,8 +75,7 @@ public:
   void    eraseCurve( Plot2d_Curve* curve, bool update = false );
   void    eraseCurves( const curveList& curves, bool update = false );
   int     getCurves( curveList& clist );
-  const   CurveDict& getCurves() { return myCurves; }
-  int     hasCurve( Plot2d_Curve* curve );
+  const   CurveDict& getCurves();
   bool    isVisible( Plot2d_Curve* curve );
   void    updateCurve( Plot2d_Curve* curve, bool update = false );
   void    updateLegend( const Plot2d_Prs* prs );
@@ -84,7 +94,7 @@ public:
   void    copyPreferences( Plot2d_ViewFrame* );
   void    setCurveType( int curveType, bool update = true );
   int     getCurveType() const { return myCurveType; }
-  void    setCurveTitle( int curveKey, const QString& title );
+  void    setCurveTitle( Plot2d_Curve* curve, const QString& title );
   void    showLegend( bool show, bool update = true );
   void    setLegendPos( int pos );
   int     getLegendPos() const { return myLegendPos; }
@@ -131,6 +141,9 @@ protected:
   void    writePreferences();
   QString getInfo( const QPoint& pnt );
   virtual void wheelEvent( QWheelEvent* );
+  QwtPlotCurve* getPlotCurve( Plot2d_Curve* curve );
+  bool    hasPlotCurve( Plot2d_Curve* curve );
+  void    setCurveType( QwtPlotCurve* curve, int curveType );
 
 public slots:
   void    onViewPan(); 
@@ -141,7 +154,6 @@ public slots:
   void    onSettings();
   void    onFitData();
   void    onChangeBackground();
-
   void    onPanLeft();
   void    onPanRight();
   void    onPanUp();
@@ -150,11 +162,9 @@ public slots:
   void    onZoomOut();
 
 protected:
-  virtual void customEvent( QCustomEvent* );
-
-protected slots:
+  virtual void customEvent( QEvent* );
   void    plotMousePressed( const QMouseEvent& );
-  void    plotMouseMoved( const QMouseEvent& );
+  bool    plotMouseMoved( const QMouseEvent& );
   void    plotMouseReleased( const QMouseEvent& );
 
 signals:
@@ -162,12 +172,12 @@ signals:
   void    vpModeVerChanged();
   void    vpCurveChanged();
   void    contextMenuRequested( QContextMenuEvent *e );
+  void    legendClicked( QwtPlotItem* );
 
 protected:
   Plot2d_Plot2d* myPlot;
   int            myOperation;
   QPoint         myPnt;
-  CurveDict      myCurves;
 
   int            myCurveType;
   bool           myShowLegend;
@@ -191,6 +201,8 @@ class Plot2d_Plot2d : public QwtPlot
 public:
   Plot2d_Plot2d( QWidget* parent );
 
+  void       setLogScale( int axisId, bool log10 );
+
   void       replot();
   void       getNextMarker( QwtSymbol::Style& typeMarker, QColor& color, Qt::PenStyle& typeLine );
   QwtLegend* getLegend() {
@@ -203,8 +215,13 @@ public:
   virtual QSize       sizeHint() const;
   virtual QSizePolicy sizePolicy() const;
   virtual QSize       minimumSizeHint() const;
+  void                defaultPicker();
+  void                setPickerMousePattern( int button, int state = Qt::NoButton );
 
   bool                polished() const { return myIsPolished; }
+  QwtPlotGrid*        grid() { return myGrid; };
+  CurveDict& getCurves() { return myCurves; }
+  Plot2d_Curve*       getClosestCurve( QPoint p, double& distance, int& index );
 
 public slots:
   virtual void polish();
@@ -212,9 +229,30 @@ public slots:
 protected:
   bool       existMarker( const QwtSymbol::Style typeMarker, const QColor& color, const Qt::PenStyle typeLine );
 
+protected slots:
+  void onScaleDivChanged();
+
 protected:
-  QValueList<QColor> myColors;
+  CurveDict          myCurves;
+  QwtPlotGrid*       myGrid;
+  QList<QColor>      myColors;
   bool               myIsPolished;
+  QwtPlotZoomer*     myPlotZoomer;
+};
+
+class Plot2d_ScaleDraw: public QwtScaleDraw
+{
+public:
+  Plot2d_ScaleDraw( char f = 'g', int prec = 6 );
+  Plot2d_ScaleDraw( const QwtScaleDraw& scaleDraw, char f = 'g', int prec = 6 );
+
+  virtual QwtText label( double value ) const;
+
+  int precision() const { return myPrecision; }
+
+private:
+  char myFormat;
+  int  myPrecision;
 };
 
 #endif
index 7681bd3f2b4eeba76076ef263cb5581d7f7d6cc4..25280c5c94201bb4f1345d37cc334f412e29e7ce 100755 (executable)
@@ -1,24 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "Plot2d_ViewManager.h"
 #include "Plot2d_ViewModel.h"
 #include "Plot2d_ViewWindow.h"
+#include "Plot2d_ViewFrame.h"
 
 /*!
   Constructor
@@ -55,6 +59,11 @@ bool Plot2d_ViewManager::insertView( SUIT_ViewWindow* theView )
   {
     Plot2d_ViewWindow* view = (Plot2d_ViewWindow*)theView;
     connect( view, SIGNAL( cloneView() ), this, SLOT( onCloneView() ) );
+
+    Plot2d_ViewFrame* aViewFrame = view->getViewFrame();
+    Plot2d_Viewer* aViewer = getPlot2dModel();
+    connect( aViewFrame, SIGNAL( legendClicked( QwtPlotItem* ) ), 
+            aViewer, SLOT( onLegendClicked( QwtPlotItem* ) ) );
   }
   return res;
 }
@@ -71,15 +80,30 @@ void Plot2d_ViewManager::createView()
   SLOT: called if action "Clone view" is activated, emits signal cloneView()
 */
 void Plot2d_ViewManager::onCloneView()
+{
+  if( sender() && sender()->inherits( "Plot2d_ViewWindow" ) )
+  {
+    Plot2d_ViewWindow* srcWnd = ( Plot2d_ViewWindow* )sender();
+    cloneView( srcWnd );
+  }
+}
+
+/*!
+  \brief Creates clone of source window
+  \param srcWnd source window
+  \return Pointer on the new window
+  \sa onCloneView()
+*/
+Plot2d_ViewWindow* Plot2d_ViewManager::cloneView( Plot2d_ViewWindow* srcWnd )
 {
   SUIT_ViewWindow* vw = createViewWindow();
 
-  Plot2d_ViewWindow  *newWnd = 0, *clonedWnd = 0;
+  Plot2d_ViewWindow* newWnd = 0;
   if( vw && vw->inherits( "Plot2d_ViewWindow" ) )
     newWnd = ( Plot2d_ViewWindow* )vw;
-  if( sender() && sender()->inherits( "Plot2d_ViewWindow" ) )
-    clonedWnd = ( Plot2d_ViewWindow* )sender();
   
-  if( newWnd && clonedWnd )
-    emit cloneView( clonedWnd->getViewFrame(), newWnd->getViewFrame() );
+  if( newWnd && srcWnd )
+    emit cloneView( srcWnd->getViewFrame(), newWnd->getViewFrame() );
+
+  return newWnd;
 }
index a26b01cb69406c7a2eb6582dff135c9d4e1bda7b..da494a26c8f062f3c657a036499dcd232cbb265c 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef PLOT2D_VIEWMANAGER_H
 #define PLOT2D_VIEWMANAGER_H
@@ -23,6 +26,7 @@
 #include "SUIT_ViewManager.h"
 
 class SUIT_Desktop;
+class Plot2d_ViewWindow;
 class Plot2d_Viewer;
 class Plot2d_ViewFrame;
 
@@ -35,6 +39,7 @@ public:
   ~Plot2d_ViewManager();
 
   Plot2d_Viewer*     getPlot2dModel() const;
+  Plot2d_ViewWindow* cloneView( Plot2d_ViewWindow* srcWnd );
 
 protected:
   bool         insertView(SUIT_ViewWindow* theView);
index e689f6ef5870081c84097aced17c3923972b5185..0786c6fa484822f1ab5f004ad66497e0bf8d9257 100755 (executable)
@@ -1,30 +1,35 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // Plot2d_ViewModel.cxx: implementation of the Plot2d_ViewModel class.
-
+//
 #include "Plot2d_ViewModel.h"
 #include "Plot2d_ViewWindow.h"
 #include "Plot2d_ViewManager.h"
 #include "Plot2d_ViewFrame.h"
 #include "Plot2d_Prs.h"
 
-#include <qpopupmenu.h>
+#include <QMenu>
+#include <QToolBar>
+#include <QVector>
 
 /*!
   Constructor
@@ -61,20 +66,22 @@ SUIT_ViewWindow* Plot2d_Viewer::createView(SUIT_Desktop* theDesktop)
   Adds custom items to popup menu
   \param thePopup - popup menu
 */
-void Plot2d_Viewer::contextMenuPopup(QPopupMenu* thePopup)
+void Plot2d_Viewer::contextMenuPopup(QMenu* thePopup)
 {
   Plot2d_ViewWindow* aView = (Plot2d_ViewWindow*)(myViewManager->getActiveView());
   if ( aView )
     aView->contextMenuPopup(thePopup);
 
-  if (thePopup->count() > 0) thePopup->insertSeparator();
-  thePopup->insertItem( tr( "MNU_DUMP_VIEW" ),                this, SLOT(onDumpView()));
-  thePopup->insertItem( tr( "MEN_PLOT2D_CHANGE_BACKGROUND" ), this, SLOT(onChangeBgColor()));
+  if (!thePopup->isEmpty())
+    thePopup->addSeparator();
+  thePopup->addAction( tr( "MNU_DUMP_VIEW" ),                this, SLOT(onDumpView()));
+  thePopup->addAction( tr( "MEN_PLOT2D_CHANGE_BACKGROUND" ), this, SLOT(onChangeBgColor()));
 
   if ( aView ) {
     if ( !aView->getToolBar()->isVisible() ) {
-      if (thePopup->count() > 0) thePopup->insertSeparator();
-        thePopup->insertItem("Show toolbar", this, SLOT(onShowToolbar()));
+      if (!thePopup->isEmpty())
+        thePopup->addSeparator();
+      thePopup->addAction("Show toolbar", this, SLOT(onShowToolbar()));
     }
     aView->RefreshDumpImage();
   }
@@ -98,7 +105,7 @@ void Plot2d_Viewer::setPrs(Plot2d_Prs* thePrs)
 void Plot2d_Viewer::update()
 {
   SUIT_ViewManager* aMgr = getViewManager();
-  QPtrVector<SUIT_ViewWindow> aViews = aMgr->getViews();
+  QVector<SUIT_ViewWindow*> aViews = aMgr->getViews();
   unsigned int aSize = aViews.size();
   for (uint i = 0; i < aSize; i++) {
     Plot2d_ViewWindow* aView = (Plot2d_ViewWindow*)aViews[i];
@@ -113,7 +120,7 @@ void Plot2d_Viewer::update()
 void Plot2d_Viewer::clearPrs()
 {
   SUIT_ViewManager* aMgr = getViewManager();
-  QPtrVector<SUIT_ViewWindow> aViews = aMgr->getViews();
+  QVector<SUIT_ViewWindow*> aViews = aMgr->getViews();
   unsigned int aSize = aViews.size();
   for (uint i = 0; i < aSize; i++) {
     Plot2d_ViewWindow* aView = (Plot2d_ViewWindow*)aViews[i];
@@ -171,7 +178,43 @@ void Plot2d_Viewer::onDumpView()
 /*!
   SLOT: called when action "Clone view" is activated
 */
-void Plot2d_Viewer::onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* )
+void Plot2d_Viewer::onCloneView( Plot2d_ViewFrame* clonedVF, Plot2d_ViewFrame* newVF )
+{
+  if( !clonedVF || !newVF )
+    return;
+
+  // 1) Copy all properties of view
+
+  newVF->copyPreferences( clonedVF );
+
+  // 2) Display all curves displayed in cloned view
+
+  curveList aCurves;
+  clonedVF->getCurves( aCurves );
+  curveList::const_iterator anIt = aCurves.begin(), aLast = aCurves.end();
+
+  for( ; anIt!=aLast; anIt++ )
+    if( clonedVF->isVisible( *anIt ) )
+      newVF->displayCurve( *anIt, false );
+  newVF->Repaint();
+  
+  if ( newVF )
+  {
+    // find view window corresponding to the frame 
+    QWidget* p = newVF->parentWidget();
+    while( p && !p->inherits( "SUIT_ViewWindow" ) )
+      p = p->parentWidget();
+    
+    // emits signal
+    if ( p && p->inherits( "SUIT_ViewWindow" ) )
+      emit viewCloned( (SUIT_ViewWindow*)p );
+  }
+}
+
+/*
+  SLOT: called when clicked item in the legend from Plot2d_ViewManager
+ */
+void Plot2d_Viewer::onLegendClicked( QwtPlotItem* plotItem )
 {
 }
 
index 75445ff9bc14a28f2e693be77c8e7290fb6d7225..ddb8ad35371ad4b26adc06a1aa5dd1902942c245 100755 (executable)
@@ -1,33 +1,37 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #if !defined(_PLOT2D_VIEWMODEL_H)
 #define _PLOT2D_VIEWMODEL_H
 
 #include "Plot2d.h"
 #include "SUIT_ViewModel.h"
+#include "qwt_plot.h"
 
 class SUIT_ViewWindow;
 class SUIT_Desktop;
 class Plot2d_ViewFrame;
 class Plot2d_Prs;
 class QString;
-class QPopupMenu;
+class QMenu;
 
 class PLOT2D_EXPORT Plot2d_Viewer: public SUIT_ViewModel
 {
@@ -42,18 +46,22 @@ public:
   virtual void             setViewManager( SUIT_ViewManager* );
   virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
   virtual QString getType() const { return Type(); }
-  virtual void contextMenuPopup(QPopupMenu*);
+  virtual void contextMenuPopup(QMenu*);
   Plot2d_Prs*  getPrs() const { return myPrs; };
   void         setPrs(Plot2d_Prs* thePrs);
   void         update();
   void         clearPrs();
   void         setAutoDel(bool theDel);
+  
+signals:
+  void         viewCloned( SUIT_ViewWindow* );
 
 protected slots:
-  void onChangeBgColor();
-  void onDumpView();
-  void onShowToolbar();
+  void         onChangeBgColor();
+  void         onDumpView();
+  void         onShowToolbar();
   virtual void onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* );
+  virtual void onLegendClicked( QwtPlotItem* );
 
 private:
   Plot2d_Prs* myPrs;
index 1fdf78431df0be57fd216580e09897533ce5debf..6fcdd26427612c1fb6fae3e3dce38fa7536eba1e 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d_ViewWindow.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-// Plot2d_ViewWindow.cxx: implementation of the Plot2d_ViewWindow class.
-
 #include "Plot2d_ViewWindow.h"
 #include "Plot2d_ViewFrame.h"
 
-#include "SUIT_ViewManager.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_ToolButton.h"
-#include "SUIT_Desktop.h"
+#include <SUIT_ViewManager.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_Desktop.h>
+
+#include <QtxAction.h>
+#include <QtxMultiAction.h>
+#include <QtxActionToolMgr.h>
 
-#include "QtxAction.h"
+#include <QStatusBar>
+#include <QLayout>
+#include <QApplication>
+#include <QMenu>
+#include <QImage>
+#include <QToolBar>
+#include <QPaintEvent>
+#include <QActionGroup>
 
-#include <qstatusbar.h>
-#include <qlayout.h>
-#include <qapplication.h>
-#include <qpopupmenu.h>
+/*!
+  \class Plot2d_ViewWindow
+  \brief Plot2d view window.
+*/
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param theDesktop parent desktop window
+  \param theModel plt2d view model
 */
-Plot2d_ViewWindow::Plot2d_ViewWindow(SUIT_Desktop* theDesktop, Plot2d_Viewer* theModel)
-: SUIT_ViewWindow(theDesktop)
+Plot2d_ViewWindow::Plot2d_ViewWindow( SUIT_Desktop* theDesktop, Plot2d_Viewer* theModel )
+: SUIT_ViewWindow( theDesktop )
 {
   myModel = theModel;
-
   myDumpImage = QImage();
 
-  myViewFrame = new Plot2d_ViewFrame(this, "plotView");
-  setCentralWidget(myViewFrame);
+  myViewFrame = new Plot2d_ViewFrame( this, "plotView" );
+  setCentralWidget( myViewFrame );
 
-  myToolBar = new QToolBar(this);
-  myToolBar->setCloseMode(QDockWindow::Undocked);
-  myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
   createActions();
   createToolBar();
 
-  connect(myViewFrame, SIGNAL(vpModeHorChanged()), this, SLOT(onChangeHorMode()));
-  connect(myViewFrame, SIGNAL(vpModeVerChanged()), this, SLOT(onChangeVerMode()));
-  connect(myViewFrame, SIGNAL(vpCurveChanged()),   this, SLOT(onChangeCurveMode()));
-  connect(myViewFrame, SIGNAL(contextMenuRequested( QContextMenuEvent * )),
-          this,        SIGNAL(contextMenuRequested( QContextMenuEvent * )) );
+  connect( myViewFrame, SIGNAL( vpModeHorChanged() ), this, SLOT( onChangeHorMode() ) );
+  connect( myViewFrame, SIGNAL( vpModeVerChanged() ), this, SLOT( onChangeVerMode() ) );
+  connect( myViewFrame, SIGNAL( vpCurveChanged() ),   this, SLOT( onChangeCurveMode() ) );
+  connect( myViewFrame, SIGNAL( contextMenuRequested( QContextMenuEvent* ) ),
+          this,        SIGNAL( contextMenuRequested( QContextMenuEvent* ) ) );
 
+  myViewFrame->installEventFilter( this );
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 Plot2d_ViewWindow::~Plot2d_ViewWindow()
 {
 }
 
 /*!
-  Puts message to status bar
-  \param theMsg - message text
+  \brief Get view model.
+  \return Plot2d view model
+*/
+Plot2d_Viewer* Plot2d_ViewWindow::getModel()
+{
+  return myModel;
+}
+
+/*!
+  \brief Put message to the status bar.
+  \param theMsg message text
+*/
+void Plot2d_ViewWindow::putInfo( const QString& theMsg )
+{
+  QStatusBar* aStatusBar = myDesktop->statusBar();
+  aStatusBar->showMessage( theMsg/*, 3000*/ );
+}
+
+/*!
+  \brief Get view frame window.
+  \return view frame window
+*/
+Plot2d_ViewFrame* Plot2d_ViewWindow::getViewFrame()
+{ 
+  return myViewFrame;
+}
+
+/*!
+  \brief Get view window's toolbar.
+  \return toolbar
 */
-void Plot2d_ViewWindow::putInfo(QString theMsg)
+QToolBar* Plot2d_ViewWindow::getToolBar()
 {
-  QStatusBar*  aStatusBar = myDesktop->statusBar();
-  aStatusBar->message(theMsg/*, 3000*/);
+  return toolMgr()->toolBar( myToolBar );
 }
 
 /*!
-  Fills popup menu with custom actions
- \param popup - popup menu to be filled with
+  \brief Fill popup menu with the actions,
+  \param thePopup popup menu
 */
-void Plot2d_ViewWindow::contextMenuPopup( QPopupMenu* thePopup )
+void Plot2d_ViewWindow::contextMenuPopup( QMenu* thePopup )
 {
+  QtxActionToolMgr* mgr = toolMgr();
   // scaling
-  QPopupMenu* scalingPopup = new QPopupMenu( thePopup );
-  myActionsMap[ PModeXLinearId ]->addTo( scalingPopup );
-  myActionsMap[ PModeXLogarithmicId ]->addTo( scalingPopup );
-  onChangeHorMode();
-  scalingPopup->insertSeparator();
-  myActionsMap[ PModeYLinearId ]->addTo( scalingPopup );
-  myActionsMap[ PModeYLogarithmicId ]->addTo( scalingPopup );
-  thePopup->insertItem( tr( "SCALING_POPUP" ), scalingPopup );
-  onChangeVerMode();
+  QMenu* scalingPopup = thePopup->addMenu( tr( "SCALING_POPUP" ) );
+  scalingPopup->addAction( mgr->action( PModeXLinearId ) );
+  scalingPopup->addAction( mgr->action( PModeXLogarithmicId ) );
+  scalingPopup->addSeparator();
+  scalingPopup->addAction( mgr->action( PModeYLinearId ) );
+  scalingPopup->addAction( mgr->action( PModeYLogarithmicId ) );
+
+  // fit data
+  thePopup->addAction( tr( "TOT_PLOT2D_FITDATA" ), myViewFrame, SLOT( onFitData() ) );
 
-  thePopup->insertItem(tr("TOT_PLOT2D_FITDATA"), myViewFrame, SLOT(onFitData()));
   // curve type
-  QPopupMenu* curTypePopup = new QPopupMenu( thePopup );
-  myActionsMap[ CurvPointsId ]->addTo( curTypePopup );
-  myActionsMap[ CurvLinesId ]->addTo( curTypePopup );
-  myActionsMap[ CurvSplinesId ]->addTo( curTypePopup );
-  thePopup->insertItem( tr( "CURVE_TYPE_POPUP" ), curTypePopup );
+  QMenu* curTypePopup = thePopup->addMenu( tr( "CURVE_TYPE_POPUP" ) );
+  curTypePopup->addAction( mgr->action( CurvPointsId ) );
+  curTypePopup->addAction( mgr->action( CurvLinesId ) );
+  curTypePopup->addAction( mgr->action( CurvSplinesId ) );
 
   // legend
-  myActionsMap[ LegendId ]->addTo(thePopup);
+  thePopup->addAction( mgr->action( LegendId ) );
+
   // settings
-  myActionsMap[ CurvSettingsId ]->addTo(thePopup);
+  thePopup->addAction( mgr->action( CurvSettingsId ) );
 }
 
 /*!
-  Custom event filter
+  \brief Custom event filter.
+  \param watched event receiver object
+  \param e event
+  \return \c true if further event processing should be stopped
 */
-bool Plot2d_ViewWindow::eventFilter(QObject* watched, QEvent* e)
+bool Plot2d_ViewWindow::eventFilter( QObject* watched, QEvent* e )
 {
-  if (watched == myViewFrame) {
-    int aType = e->type();
-    switch(aType) {
+  if ( watched == myViewFrame ) {
+    switch( e->type() ) {
     case QEvent::MouseButtonPress:
-      emit mousePressed(this, (QMouseEvent*) e);
+      emit mousePressed( this, (QMouseEvent*)e );
       return true;
-
     case QEvent::MouseButtonRelease:
-      emit mouseReleased(this, (QMouseEvent*) e);
+      emit mouseReleased( this, (QMouseEvent*)e );
       return true;
-
     case QEvent::MouseMove:
-      emit mouseMoving(this, (QMouseEvent*) e);
+      emit mouseMoving( this, (QMouseEvent*)e );
       return true;
-
     default:
       break;
     }
   }
-  return SUIT_ViewWindow::eventFilter(watched, e);
+  return SUIT_ViewWindow::eventFilter( watched, e );
 }
 
 /*!
-  Create actions for Plot2d view window
+  \brief Create actions for the view window.
 */
 void Plot2d_ViewWindow::createActions()
 {
-  if ( !myActionsMap.isEmpty() )
-    return;
-
+  QtxActionToolMgr* mgr = toolMgr();
   QtxAction* aAction;
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
 
-  // Dump view
-  aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_DUMP" ) ),
-                           tr( "MNU_DUMP_VIEW" ), 0, this);
-  aAction->setStatusTip(tr("DSC_DUMP_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView()));
-  myActionsMap[ DumpId ] = aAction;
-
-  // FitAll
-  aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_ALL" ) ),
-                           tr( "MNU_FITALL" ), 0, this);
-  aAction->setStatusTip(tr("DSC_FITALL"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onFitAll()));
-  myActionsMap[ FitAllId ] = aAction;
-
-  // FitRect
-  aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_AREA" ) ),
-                           tr( "MNU_FITRECT" ), 0, this);
-  aAction->setStatusTip(tr("DSC_FITRECT"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onFitRect()));
-  myActionsMap[ FitRectId ] = aAction;
-
-  // Zoom
-  aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ZOOM" ) ),
-                           tr( "MNU_ZOOM_VIEW" ), 0, this);
-  aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onZoom()));
-  myActionsMap[ ZoomId ] = aAction;
-
-  // Panning
-  aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_PAN" ) ),
-                           tr( "MNU_PAN_VIEW" ), 0, this);
-  aAction->setStatusTip(tr("DSC_PAN_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onPanning()));
-  myActionsMap[ PanId ] = aAction;
-
-  // Global Panning
-  aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_GLOBALPAN" ) ),
-                           tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
-  aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onGlobalPanning()));
-  myActionsMap[ GlobalPanId ] = aAction;
-
-  // Curve type - points
-  aAction = new QtxAction(tr("TOT_PLOT2D_CURVES_POINTS"),
-                aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_CURVES_POINTS")),
-                tr("MEN_PLOT2D_CURVES_POINTS"), 0, this);
-  aAction->setStatusTip(tr("PRP_PLOT2D_CURVES_POINTS"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onCurves()));
-  aAction->setToggleAction(true);
-  myActionsMap[ CurvPointsId ] = aAction;
-
-  // Curve type - lines
-  aAction = new QtxAction(tr("TOT_PLOT2D_CURVES_LINES"),
-               aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_CURVES_LINES")),
-               tr("MEN_PLOT2D_CURVES_LINES"), 0, this);
-  aAction->setStatusTip(tr("PRP_PLOT2D_CURVES_LINES"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onCurves()));
-  aAction->setToggleAction(true);
-  myActionsMap[ CurvLinesId ] = aAction;
-
-  // Curve type - splines
-  aAction = new QtxAction(tr("TOT_PLOT2D_CURVES_SPLINES"),
-                 aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_CURVES_SPLINES")),
-                 tr("MEN_PLOT2D_CURVES_SPLINES"), 0, this);
-  aAction->setStatusTip(tr("PRP_PLOT2D_CURVES_SPLINES"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onCurves()));
-  aAction->setToggleAction(true);
-  myActionsMap[ CurvSplinesId ] = aAction;
-
-  // Mode for X (linear or logarithmic)
-  aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LINEAR_HOR"),
-                 aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LINEAR_HOR")),
-                 tr("MEN_PLOT2D_MODE_LINEAR_HOR"), 0, this);
-  aAction->setStatusTip (tr("PRP_PLOT2D_MODE_LINEAR_HOR"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onViewHorMode()));
-  myActionsMap[ HorId ] = aAction;
-
-  // Mode for Y (linear or logarithmic)
-  aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LINEAR_VER"),
-                 aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LINEAR_VER")),
-                 tr("MEN_PLOT2D_MODE_LINEAR_VER" ), 0, this);
-  aAction->setStatusTip(tr("PRP_PLOT2D_MODE_LINEAR_VER"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onViewVerMode()));
-  myActionsMap[ VerId ] = aAction;
-
-  // Legend
-  aAction = new QtxAction(tr("TOT_PLOT2D_SHOW_LEGEND"),
-                aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_SHOW_LEGEND")),
-                tr("MEN_PLOT2D_SHOW_LEGEND"), 0, this);
-  aAction->setStatusTip(tr("PRP_PLOT2D_SHOW_LEGEND"));
-  connect(aAction, SIGNAL(activated()), this, SLOT(onLegend()));
-  aAction->setToggleAction(true);
-  myActionsMap[ LegendId ] = aAction;
-
-  // Settings
-  aAction = new QtxAction(tr( "TOT_PLOT2D_SETTINGS"),
-                aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_SETTINGS")),
-                tr("MEN_PLOT2D_SETTINGS"), 0, this);
-  aAction->setStatusTip(tr( "PRP_PLOT2D_SETTINGS"));
-  connect(aAction, SIGNAL(activated()), myViewFrame, SLOT(onSettings()));
-  myActionsMap[ CurvSettingsId ] = aAction;
-
-  // Clone
-  aAction = new QtxAction(tr("MNU_CLONE_VIEW"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CLONE_VIEW" ) ),
-                           tr( "MNU_CLONE_VIEW" ), 0, this);
-  aAction->setStatusTip(tr("DSC_CLONE_VIEW"));
-  connect(aAction, SIGNAL(activated()), this, SIGNAL(cloneView()));
-  myActionsMap[ CloneId ] = aAction;
-
-  /* Popup Actions */
-  /* Linear/logarithmic mode */
-  // Horizontal axis
-  aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LINEAR_HOR"),
-                 aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LINEAR_HOR")),
-                 tr("MEN_PLOT2D_MODE_LINEAR_HOR"), 0, this);
-  aAction->setStatusTip (tr("PRP_PLOT2D_MODE_LINEAR_HOR"));
-  aAction->setToggleAction(true);
-  myActionsMap[PModeXLinearId] = aAction;
-  connect(aAction, SIGNAL(activated()), this, SLOT(onViewHorMode()));
-
-  aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LOGARITHMIC_HOR"),
-              aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LOGARITHMIC_HOR")),
-              tr("MEN_PLOT2D_MODE_LOGARITHMIC_HOR"), 0, this);
-  aAction->setStatusTip(tr("PRP_PLOT2D_MODE_LOGARITHMIC_HOR"));
-  aAction->setToggleAction(true);
-  myActionsMap[PModeXLogarithmicId] = aAction;
-  connect(aAction, SIGNAL(activated()), this, SLOT(onViewHorMode()));
-
-  // Vertical axis
-  aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LINEAR_VER"),
-                 aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LINEAR_VER")),
-                 tr("MEN_PLOT2D_MODE_LINEAR_VER" ), 0, this);
-  aAction->setStatusTip(tr("PRP_PLOT2D_MODE_LINEAR_VER"));
-  aAction->setToggleAction(true);
-  myActionsMap[PModeYLinearId] = aAction;
-  connect(aAction, SIGNAL(activated()), this, SLOT(onViewVerMode()));
-
-  aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LOGARITHMIC_VER"),
-                 aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LOGARITHMIC_VER")),
-                 tr("MEN_PLOT2D_MODE_LOGARITHMIC_VER" ), 0, this);
-  aAction->setStatusTip(tr("PRP_PLOT2D_MODE_LOGARITHMIC_VER"));
-  aAction->setToggleAction(true);
-  myActionsMap[PModeYLogarithmicId] = aAction;
-  connect(aAction, SIGNAL(activated()), this, SLOT(onViewVerMode()));
-
+  // 1. Dump View
+  aAction = new QtxAction( tr( "MNU_DUMP_VIEW" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_DUMP" ) ),
+                           tr( "MNU_DUMP_VIEW" ),
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_DUMP_VIEW" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onDumpView() ) );
+  mgr->registerAction( aAction, DumpId );
+
+  // 2. Scaling operations
+
+  // 2.1. Fit All
+  aAction = new QtxAction( tr( "MNU_FITALL" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_ALL" ) ),
+                           tr( "MNU_FITALL" ),
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_FITALL" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onFitAll() ) );
+  mgr->registerAction( aAction, FitAllId );
+
+  // 2.2. Fit Rect
+  aAction = new QtxAction( tr( "MNU_FITRECT" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_AREA" ) ),
+                           tr( "MNU_FITRECT" ),
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_FITRECT" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onFitRect() ) );
+  mgr->registerAction( aAction, FitRectId );
+
+  // 2.3. Zoom
+  aAction = new QtxAction( tr( "MNU_ZOOM_VIEW" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ZOOM" ) ),
+                           tr( "MNU_ZOOM_VIEW" ),
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_ZOOM_VIEW" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onZoom() ) );
+  mgr->registerAction( aAction, ZoomId );
+
+  // 2.4. Create multi-action for scaling operations
+  QtxMultiAction* aScaleAction = new QtxMultiAction( this );
+  aScaleAction->insertAction( mgr->action( FitAllId  ) );
+  aScaleAction->insertAction( mgr->action( FitRectId ) );
+  aScaleAction->insertAction( mgr->action( ZoomId    ) );
+  mgr->registerAction( aScaleAction, ScaleOpId );
+
+  // 3. Moving operations
+
+  // 3.1. Panning
+  aAction = new QtxAction( tr( "MNU_PAN_VIEW" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_PAN" ) ),
+                          tr( "MNU_PAN_VIEW" ), 
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_PAN_VIEW" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onPanning() ) );
+  mgr->registerAction( aAction, PanId );
+
+  // 3.2. Global Panning
+  aAction = new QtxAction( tr( "MNU_GLOBALPAN_VIEW" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_GLOBALPAN" ) ),
+                           tr( "MNU_GLOBALPAN_VIEW" ),
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_GLOBALPAN_VIEW" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onGlobalPanning() ) );
+  mgr->registerAction( aAction, GlobalPanId );
+
+  // 3.3. Create multi-action for moving operations
+  QtxMultiAction* aPanAction = new QtxMultiAction( this );
+  aPanAction->insertAction( mgr->action( PanId ) );
+  aPanAction->insertAction( mgr->action( GlobalPanId ) );
+  mgr->registerAction( aPanAction, MoveOpId );
+
+  // 4. Curve type operations
+  
+  // 4.1. Points
+  aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_POINTS" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_POINTS" ) ),
+                          tr( "MEN_PLOT2D_CURVES_POINTS" ),
+                          0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_POINTS" ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, CurvPointsId );
+
+  // 4.2. Lines
+  aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_LINES" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_LINES" ) ),
+                          tr( "MEN_PLOT2D_CURVES_LINES" ),
+                          0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_LINES" ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, CurvLinesId );
+
+  // 4.3. Splines
+  aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_SPLINES" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_SPLINES" ) ),
+                          tr( "MEN_PLOT2D_CURVES_SPLINES" ),
+                          0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_SPLINES" ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, CurvSplinesId );
+
+  // 4.4. Create action group for curve type operations
+  QActionGroup* aCurveGroup = new QActionGroup( this );
+  aCurveGroup->addAction( mgr->action( CurvPointsId ) );
+  aCurveGroup->addAction( mgr->action( CurvLinesId ) );
+  aCurveGroup->addAction( mgr->action( CurvSplinesId ) );
+  connect( aCurveGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( onCurves() ) );
+
+  // 5. Horizontal scaling mode operations
+
+  // 5.1. Linear
+  aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LINEAR_HOR" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_HOR" ) ),
+                          tr( "MEN_PLOT2D_MODE_LINEAR_HOR" ),
+                          0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LINEAR_HOR" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewHorMode() ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, PModeXLinearId );
+  
+  // 5.2. Logarithmic
+  aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LOGARITHMIC_HOR" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_HOR" ) ),
+                          tr( "MEN_PLOT2D_MODE_LOGARITHMIC_HOR" ),
+                          0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_HOR" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewHorMode() ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, PModeXLogarithmicId );
+
+  // 5.3. Create action group for horizontal scaling mode operations
+  QActionGroup* aHorGroup = new QActionGroup( this );
+  aHorGroup->addAction( mgr->action( PModeXLinearId ) );
+  aHorGroup->addAction( mgr->action( PModeXLogarithmicId ) );
+
+  // 6. Vertical scaling mode operations
+
+  // 6.1. Linear
+  aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LINEAR_VER" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_VER" ) ),
+                          tr( "MEN_PLOT2D_MODE_LINEAR_VER" ),
+                          0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LINEAR_VER" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewVerMode() ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, PModeYLinearId );
+
+  // 6.2. Logarithmic
+  aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LOGARITHMIC_VER" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_VER" ) ),
+                          tr( "MEN_PLOT2D_MODE_LOGARITHMIC_VER" ),
+                          0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_VER" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewVerMode() ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, PModeYLogarithmicId );
+
+  // 6.3. Create action group for vertical scaling mode operations
+  QActionGroup* aVerGroup = new QActionGroup( this );
+  aVerGroup->addAction( mgr->action( PModeYLinearId ) );
+  aVerGroup->addAction( mgr->action( PModeYLogarithmicId ) );
+
+  // 7. Legend
+  aAction = new QtxAction( tr( "TOT_PLOT2D_SHOW_LEGEND" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SHOW_LEGEND" ) ),
+                          tr( "MEN_PLOT2D_SHOW_LEGEND" ),
+                          0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_SHOW_LEGEND" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onLegend() ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, LegendId );
+
+  // 8. Settings
+  aAction = new QtxAction( tr( "TOT_PLOT2D_SETTINGS" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SETTINGS" ) ),
+                          tr( "MEN_PLOT2D_SETTINGS" ),
+                          0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_SETTINGS" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), myViewFrame, SLOT( onSettings() ) );
+  mgr->registerAction( aAction, CurvSettingsId );
+
+  // 9. Clone
+  aAction = new QtxAction( tr( "MNU_CLONE_VIEW" ),
+                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CLONE_VIEW" ) ),
+                           tr( "MNU_CLONE_VIEW" ),
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_CLONE_VIEW" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SIGNAL( cloneView() ) );
+  mgr->registerAction( aAction, CloneId );
+
+  // Set initial values
+  onChangeCurveMode();
+  onChangeHorMode();
+  onChangeVerMode();
+  onChangeLegendMode();
 }
 
 /*!
-  Create toolbar for Plot2d view window
+  \brief Create toolbar for the view window.
 */
 void Plot2d_ViewWindow::createToolBar()
 {
-  myActionsMap[DumpId]->addTo(myToolBar);
-
-  SUIT_ToolButton* aScaleBtn = new SUIT_ToolButton(myToolBar);
-  aScaleBtn->AddAction(myActionsMap[FitAllId]);
-  aScaleBtn->AddAction(myActionsMap[FitRectId]);
-  aScaleBtn->AddAction(myActionsMap[ZoomId]);
-
-  SUIT_ToolButton* aPanBtn = new SUIT_ToolButton(myToolBar);
-  aPanBtn->AddAction(myActionsMap[PanId]);
-  aPanBtn->AddAction(myActionsMap[GlobalPanId]);
-
-  myCurveBtn = new SUIT_ToolButton(myToolBar);
-  myCurveBtn->AddAction(myActionsMap[CurvPointsId]);
-  myCurveBtn->AddAction(myActionsMap[CurvLinesId]);
-  myCurveBtn->AddAction(myActionsMap[CurvSplinesId]);
-  myActionsMap[CurvLinesId]->setOn(true);
-  onChangeCurveMode();
+  QtxActionToolMgr* mgr = toolMgr();
+  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+  mgr->append( DumpId, myToolBar );
+  mgr->append( ScaleOpId, myToolBar );
+  mgr->append( MoveOpId, myToolBar );
+  mgr->append( toolMgr()->separator(), myToolBar );
+  mgr->append( CurvPointsId, myToolBar );
+  mgr->append( CurvLinesId, myToolBar );
+  mgr->append( CurvSplinesId, myToolBar );
+  mgr->append( toolMgr()->separator(), myToolBar );
+  mgr->append( PModeXLinearId, myToolBar );
+  mgr->append( PModeXLogarithmicId, myToolBar );
+  mgr->append( toolMgr()->separator(), myToolBar );
+  mgr->append( PModeYLinearId, myToolBar );
+  mgr->append( PModeYLogarithmicId, myToolBar );
+  mgr->append( toolMgr()->separator(), myToolBar );
+  mgr->append( LegendId, myToolBar );
+  mgr->append( CurvSettingsId, myToolBar );
+  mgr->append( CloneId, myToolBar );
+}
 
-  myActionsMap[HorId]->addTo(myToolBar);
-  onChangeHorMode();
-  myActionsMap[VerId]->addTo(myToolBar);
-  onChangeVerMode();
+/*!
+  \brief Get the visual parameters of the view window.
+  \return visual parameters of this view window formatted to the string
+*/
+QString Plot2d_ViewWindow::getVisualParameters()
+{
+  return myViewFrame->getVisualParameters();
+}
 
-  myActionsMap[LegendId]->addTo(myToolBar);
-  myActionsMap[CurvSettingsId]->addTo(myToolBar);
-  myActionsMap[CloneId]->addTo(myToolBar);
-  onChangeLegendMode();
+/*!
+  \brief Restore visual parameters of the view window from the formated string
+  \param parameters view window visual parameters
+*/
+void Plot2d_ViewWindow::setVisualParameters( const QString& parameters )
+{
+  myViewFrame->setVisualParameters( parameters );
 }
 
 /*!
-  SLOT: called if scale mode for horizontal axis is changed
+  \brief Grab the view window to the internal image.
 */
-void Plot2d_ViewWindow::onChangeHorMode()
+void Plot2d_ViewWindow::RefreshDumpImage()
 {
-  bool aLinear = myViewFrame->isModeHorLinear();
-  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+  myDumpImage = px.toImage();
+}
 
-  myActionsMap[PModeXLinearId]->setOn( aLinear );
-  myActionsMap[PModeXLogarithmicId]->setOn( !aLinear );
+/*!
+  \brief Called when the scale mode for the horizontal axis is changed.
+*/
+void Plot2d_ViewWindow::onChangeHorMode()
+{
+  bool aHorLinear = myViewFrame->isModeHorLinear();
+  bool aVerLinear = myViewFrame->isModeVerLinear();
 
-  QPixmap pix = aResMgr->loadPixmap( "Plot2d", tr( aLinear ? "ICON_PLOT2D_MODE_LOGARITHMIC_HOR" :
-                                                             "ICON_PLOT2D_MODE_LINEAR_HOR" ) );
-  myActionsMap[HorId]->setIconSet( pix );
-  myActionsMap[HorId]->setToolTip( tr( aLinear ? "TOT_PLOT2D_MODE_LOGARITHMIC_HOR" :
-                                                 "TOT_PLOT2D_MODE_LINEAR_HOR" ) );
-  myActionsMap[HorId]->setStatusTip( tr( aLinear ? "PRP_PLOT2D_MODE_LOGARITHMIC_HOR" :
-                                                   "PRP_PLOT2D_MODE_LINEAR_HOR" ) );
+  if ( aHorLinear )
+    toolMgr()->action( PModeXLinearId )->setChecked( true );
+  else
+    toolMgr()->action( PModeXLogarithmicId )->setChecked( true );
 
-  myActionsMap[GlobalPanId]->setEnabled( myViewFrame->isModeVerLinear() && myViewFrame->isModeHorLinear() );
+  toolMgr()->action( GlobalPanId )->setEnabled( aHorLinear && aVerLinear );
 }
 
 /*!
-  SLOT: called if scale mode for vertical axis is changed
+  \brief Called when the scale mode for the vertical axis is changed.
 */
 void Plot2d_ViewWindow::onChangeVerMode()
 {
-  bool aLinear = myViewFrame->isModeVerLinear();
-  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-
-  myActionsMap[PModeYLinearId]->setOn( aLinear );
-  myActionsMap[PModeYLogarithmicId]->setOn( !aLinear );
+  bool aHorLinear = myViewFrame->isModeHorLinear();
+  bool aVerLinear = myViewFrame->isModeVerLinear();
 
-  QPixmap pix = aResMgr->loadPixmap( "Plot2d", tr( aLinear ? "ICON_PLOT2D_MODE_LOGARITHMIC_VER" :
-                                                             "ICON_PLOT2D_MODE_LINEAR_VER" ) );
-  myActionsMap[VerId]->setIconSet( pix );
-  myActionsMap[VerId]->setToolTip( tr( aLinear ? "TOT_PLOT2D_MODE_LOGARITHMIC_VER" :
-                                                 "TOT_PLOT2D_MODE_LINEAR_VER" ) );
-  myActionsMap[VerId]->setStatusTip( tr( aLinear ? "PRP_PLOT2D_MODE_LOGARITHMIC_VER" :
-                                                   "PRP_PLOT2D_MODE_LINEAR_VER" ) );
+  if ( aVerLinear )
+    toolMgr()->action( PModeYLinearId )->setChecked( true );
+  else
+    toolMgr()->action( PModeYLogarithmicId )->setChecked( true );
 
-  myActionsMap[GlobalPanId]->setEnabled( myViewFrame->isModeVerLinear() && myViewFrame->isModeHorLinear() );
+  toolMgr()->action( GlobalPanId )->setEnabled( aHorLinear && aVerLinear );
 }
 
 /*!
-  SLOT: called if curve type is changed
+  \brief Called when the curve type is changed.
 */
 void Plot2d_ViewWindow::onChangeCurveMode()
 {
-  int aCurveType = myViewFrame->getCurveType();
-  myCurveBtn->SetItem(aCurveType);
-
-  myActionsMap[CurvPointsId]->setOn(aCurveType == 0);
-  myActionsMap[CurvLinesId]->setOn(aCurveType == 1);
-  myActionsMap[CurvSplinesId]->setOn(aCurveType == 2);
+  switch ( myViewFrame->getCurveType() ) {
+  case 0:
+    toolMgr()->action( CurvPointsId )->setChecked( true );
+    break;
+  case 1:
+    toolMgr()->action( CurvLinesId )->setChecked( true );
+    break;
+  case 2:
+    toolMgr()->action( CurvSplinesId )->setChecked( true );
+    break;
+  default:
+    break;
+  }
 }
 
 /*!
-  SLOT: called if legend mode is changed
+  \brief Called when the legend mode is changed.
 */
 void Plot2d_ViewWindow::onChangeLegendMode()
 {
-  myActionsMap[ LegendId ]->setOn(myViewFrame->isLegendShow());
+  toolMgr()->action( LegendId )->setChecked( myViewFrame->isLegendShow() );
 }
 
 /*!
-  SLOT: called if action "Fit all" is activated
+  \brief Called when the "Fit all" action is activated.
 */
 void Plot2d_ViewWindow::onFitAll()
 {
@@ -402,7 +502,7 @@ void Plot2d_ViewWindow::onFitAll()
 }
 
 /*!
-  SLOT: called if action "Fit rect" is activated
+  \brief Called when the "Fit rect" action is activated.
 */
 void Plot2d_ViewWindow::onFitRect()
 {
@@ -410,7 +510,7 @@ void Plot2d_ViewWindow::onFitRect()
 }
 
 /*!
-  SLOT: called if action "Zoom" is activated
+  \brief Called when the "Zoom" action is activated.
 */
 void Plot2d_ViewWindow::onZoom()
 {
@@ -418,7 +518,7 @@ void Plot2d_ViewWindow::onZoom()
 }
 
 /*!
-  SLOT: called if action "Panning" is activated
+  \brief Called when the "Panning" action is activated.
 */
 void Plot2d_ViewWindow::onPanning()
 {
@@ -426,7 +526,7 @@ void Plot2d_ViewWindow::onPanning()
 }
 
 /*!
-  SLOT: called if action "Global panning" is activated
+  \brief Called when the "Global panning" action is activated.
 */
 void Plot2d_ViewWindow::onGlobalPanning()
 {
@@ -434,79 +534,75 @@ void Plot2d_ViewWindow::onGlobalPanning()
 }
 
 /*!
-  SLOT: called if action of scale mode for horizontal axis changing is activated
+  \brief Called when horizontal axis scale mode action is activated.
 */
 void Plot2d_ViewWindow::onViewHorMode()
 {
-  if (myViewFrame->isModeHorLinear())
-    myViewFrame->setHorScaleMode(1);
-  else
-    myViewFrame->setHorScaleMode(0);
+  myViewFrame->setHorScaleMode( toolMgr()->action( PModeXLinearId )->isChecked() ? 0 : 1 );
 }
 
 /*!
-  SLOT: called if action of scale mode for vertical axis changing is activated
+  \brief Called when vertical axis scale mode action is activated.
 */
 void Plot2d_ViewWindow::onViewVerMode()
 {
-  if (myViewFrame->isModeVerLinear())
-    myViewFrame->setVerScaleMode(1);
-  else
-    myViewFrame->setVerScaleMode(0);
+  myViewFrame->setVerScaleMode( toolMgr()->action( PModeYLinearId )->isChecked() ? 0 : 1 );
 }
 
 /*!
-  SLOT: called if action "Show legend" is activated
+  \brief Called when the "Show legend" action is activated.
 */
 void Plot2d_ViewWindow::onLegend()
 {
-  myViewFrame->showLegend(!myViewFrame->isLegendShow());
+  myViewFrame->showLegend( !myViewFrame->isLegendShow() );
   onChangeLegendMode();
 }
 
 /*!
-  SLOT: called if action "Change curve type" is activated
+  \brief Called when the "Change curve type" action is activated.
 */
 void Plot2d_ViewWindow::onCurves()
 {
-  QtxAction* aSender = (QtxAction*) sender();
-  if(aSender == myActionsMap[CurvPointsId])
-    myViewFrame->setCurveType(0);
-  else if(aSender == myActionsMap[CurvLinesId])
-    myViewFrame->setCurveType(1);
-  else if(aSender == myActionsMap[CurvSplinesId])
-    myViewFrame->setCurveType(2);
+  if( toolMgr()->action( CurvPointsId )->isChecked() )
+    myViewFrame->setCurveType( 0 );
+  else if ( toolMgr()->action( CurvLinesId )->isChecked() )
+    myViewFrame->setCurveType( 1 );
+  else if ( toolMgr()->action( CurvSplinesId )->isChecked() )
+    myViewFrame->setCurveType( 2 );
 }
  
 /*!
-  SLOT: called if action "Dump view" is activated
+  \brief Called when the "Dump view" action is activated.
 */
 void Plot2d_ViewWindow::onDumpView()
 {
-  qApp->postEvent( myViewFrame, new QPaintEvent( QRect( 0, 0, myViewFrame->width(), myViewFrame->height() ), TRUE ) );
+  qApp->postEvent( myViewFrame, new QPaintEvent( QRect( 0, 0, myViewFrame->width(), myViewFrame->height() ) ) );
   SUIT_ViewWindow::onDumpView();
 }
 
 /*!
-  \return QImage, containing all scene rendering in window
+  \brief Dump the contents of the view window to the image.
+  \return image, containing all scene rendered in the window
 */
 QImage Plot2d_ViewWindow::dumpView()
 {
-  if ( getToolBar()->hasMouse() || myDumpImage.isNull() )
-    {
-      QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
-      return px.convertToImage();
-    }
+  if ( getToolBar()->underMouse() || myDumpImage.isNull() ) {
+    QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+    return px.toImage();
+  }
   
   return myDumpImage;
 }
 
 /*!
-  Saves scene rendering in window to file
-  \param fileName - name of file
-  \param format - string contains name of format (for example, "BMP"(default) or "JPEG", "JPG")
+  \brief Dump scene rendered in the view window to the file.
+  \param img image
+  \param fileName name of file
+  \param format image format ("BMP" [default], "JPEG", "JPG", "PNG")
 */
-bool Plot2d_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileName, const QString& format )
+bool Plot2d_ViewWindow::dumpViewToFormat( const QImage&  img,
+                                         const QString& fileName, 
+                                         const QString& format )
 {
   bool res = myViewFrame ? myViewFrame->print( fileName, format ) : false;
   if( !res )
@@ -516,34 +612,18 @@ bool Plot2d_ViewWindow::dumpViewToFormat( const QImage& img, const QString& file
 }
 
 /*!
-  \return filter of image files
+  \brief Get supported image files wildcards.
+  \return image files wildcards (list of wildcards, separated by ";;")
 */
 QString Plot2d_ViewWindow::filter() const
 {
-  return SUIT_ViewWindow::filter() + ";;" + tr( "POSTSCRIPT_FILES" );
-}
-
-/*!
-  \return the visual parameters of this view as a formated string
- */
-QString Plot2d_ViewWindow::getVisualParameters()
-{
-  return myViewFrame->getVisualParameters();
-}
-
-/*!
-  The method restors visual parameters of this view from a formated string
-*/
-void Plot2d_ViewWindow::setVisualParameters( const QString& parameters )
-{
-  myViewFrame->setVisualParameters( parameters );
+  QStringList filters = SUIT_ViewWindow::filter().split( ";;", QString::SkipEmptyParts );
+  filters << tr( "POSTSCRIPT_FILES" );
+  filters << tr( "ENCAPSULATED_POSTSCRIPT_FILES" );
+  return filters.join( ";;" );
 }
 
 /*!
-  \refresh QImage, containing all scene rendering in window
+  \fn void Plot2d_ViewWindow::cloneView();
+  \brief Emitted when the "Clone View" action is activated.
 */
-void Plot2d_ViewWindow::RefreshDumpImage()
-{
-  QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
-  myDumpImage = px.convertToImage();
-}
index aa1d4dd6227c77d6de0f4fb51b634e36a0f5ee2b..9ddd4c664214b978063467404b7434e40f46ff5d 100755 (executable)
@@ -1,28 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d_ViewWindow.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #ifndef PLOT2D_VIEWWINDOW_H
 #define PLOT2D_VIEWWINDOW_H
 
 #include "Plot2d.h"
 #include <SUIT_ViewWindow.h>
+#include <QMap>
 
-#include <qimage.h>
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -32,78 +38,82 @@ class SUIT_Desktop;
 class Plot2d_Viewer;
 class Plot2d_ViewFrame;
 class QtxAction;
-class SUIT_ToolButton;
+class QImage;
+class QMenu;
+class QToolBar;
 
 class PLOT2D_EXPORT Plot2d_ViewWindow : public SUIT_ViewWindow  
 {
   Q_OBJECT
 
 public:
-  Plot2d_ViewWindow( SUIT_Desktop* theDesktop, Plot2d_Viewer* theModel );
+  enum { DumpId, 
+        ScaleOpId, FitAllId, FitRectId, ZoomId,
+        MoveOpId, PanId, GlobalPanId,
+        PModeXLinearId, PModeXLogarithmicId, 
+         PModeYLinearId, PModeYLogarithmicId,
+        CurvPointsId, CurvLinesId, CurvSplinesId, 
+        LegendId,
+        CurvSettingsId,
+        CloneId };
+
+public:
+  Plot2d_ViewWindow( SUIT_Desktop*, Plot2d_Viewer* );
   virtual ~Plot2d_ViewWindow();
 
-  Plot2d_Viewer*    getModel() { return myModel; }
-  void              putInfo(QString theMsg);
-  Plot2d_ViewFrame* getViewFrame() { return myViewFrame; };
-  QToolBar*         getToolBar() { return myToolBar; };
-  void              contextMenuPopup( QPopupMenu* thePopup );
+  Plot2d_Viewer*    getModel();
+  void              putInfo( const QString&);
+  Plot2d_ViewFrame* getViewFrame();
+  QToolBar*         getToolBar();
+  void              contextMenuPopup( QMenu* );
+
+  virtual bool      eventFilter( QObject*, QEvent* );
+
+  void              createActions();
+  void              createToolBar();
 
   virtual QString   getVisualParameters();
-  virtual void      setVisualParameters( const QString& parameters );
+  virtual void      setVisualParameters( const QString& );
   
   virtual void      RefreshDumpImage();
 
+public slots:
+  void              onChangeHorMode();
+  void              onChangeVerMode();
+  void              onChangeCurveMode();
+  void              onChangeLegendMode();
+  
+  void              onFitAll();
+  void              onFitRect();
+  void              onZoom();
+  void              onPanning();
+  void              onGlobalPanning();
+  void              onViewHorMode();
+  void              onViewVerMode();
+  void              onLegend();
+  void              onCurves();
+
+  void              onDumpView();
+
 protected:
   virtual QImage    dumpView();
+  virtual bool      dumpViewToFormat( const QImage&, 
+                                     const QString&, 
+                                     const QString& );
   virtual QString   filter() const;
-  virtual bool      dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
-
-private:
-  bool eventFilter(QObject* watched, QEvent* e);
-
-  void createActions();
-  void createToolBar();
-
-public slots:
-  void onChangeHorMode();
-  void onChangeVerMode();
-  void onChangeCurveMode();
-  void onChangeLegendMode();
-  
-  void onFitAll();
-  void onFitRect();
-  void onZoom();
-  void onPanning();
-  void onGlobalPanning();
-  void onViewHorMode();
-  void onViewVerMode();
-  void onLegend();
-  void onCurves();
-
-  void onDumpView();
 
 signals:
-  void cloneView();
-
-protected:
-  enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, HorId,
-         VerId, LegendId, CurvPointsId, CurvLinesId, CurvSplinesId, CurvSettingsId, CloneId,
-         PModeXLinearId, PModeXLogarithmicId, PModeYLinearId, PModeYLogarithmicId };
-  typedef QMap<int, QtxAction*> ActionsMap;
-  ActionsMap        myActionsMap;
+  void              cloneView();
 
 private:
   Plot2d_Viewer*    myModel;
   Plot2d_ViewFrame* myViewFrame;
-  QToolBar*         myToolBar;
-
-  SUIT_ToolButton*  myCurveBtn;
-
-  QImage myDumpImage;
+  int               myToolBar;
+  QImage            myDumpImage;
 };
 
 #ifdef WIN32
 #pragma warning( default:4251 )
 #endif
 
-#endif
+#endif // PLOT2D_VIEWWINDOW_H
index 59c1090330f6e09f414b676c23a146b0ced12b75..03b863e4f2e68859078c38c9f8dae5c78379c83f 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
diff --git a/src/Plot2d/resources/Plot2d_images.ts b/src/Plot2d/resources/Plot2d_images.ts
new file mode 100644 (file)
index 0000000..41d9904
--- /dev/null
@@ -0,0 +1,92 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>ICON_PLOT2D_GLOBALPAN</source>
+        <translation>plot2d_glpan.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_CLONE_VIEW</source>
+        <translation>plot2d_clone.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_CURVES_POINTS</source>
+        <translation>plot2d_points.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_FIT_AREA</source>
+        <translation>plot2d_fitarea.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_DUMP</source>
+        <translation>plot2d_camera_dump.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_ZOOM</source>
+        <translation>plot2d_zoom.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>plot2d_linear_y.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>plot2d_linear.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_PAN</source>
+        <translation>plot2d_pan.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_FIT_ALL</source>
+        <translation>plot2d_fitall.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>plot2d_log.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>plot2d_log_y.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_SETTINGS</source>
+        <translation>plot2d_settings.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_CURVES_LINES</source>
+        <translation>plot2d_lines.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_CURVES_SPLINES</source>
+        <translation>plot2d_splines.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_SHOW_LEGEND</source>
+        <translation>plot2d_legend.png</translation>
+    </message>
+</context>
+</TS>
index e0d764da7b31e25c828ee10071f9ab02914e0ed2..2962b0c774b3da0c7d976d2be999734a8cdd0de3 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
diff --git a/src/Plot2d/resources/Plot2d_msg_en.ts b/src/Plot2d/resources/Plot2d_msg_en.ts
new file mode 100644 (file)
index 0000000..c1a7aad
--- /dev/null
@@ -0,0 +1,532 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>PLOT2D_CURVE_TYPE_LBL</source>
+        <translation>Curve type:</translation>
+    </message>
+    <message>
+        <source>ERROR</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SET_AS_DEFAULT_CHECK</source>
+        <translation>Save settings as default</translation>
+    </message>
+    <message>
+        <source>TLT_SETUP_CURVE</source>
+        <translation>Setup Curve</translation>
+    </message>
+    <message>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Dump view...</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SCALE_MODE_HOR</source>
+        <translation>Horizontal axis:</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SCALE_MODE_VER</source>
+        <translation>Vertical axis:</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panning</translation>
+    </message>
+    <message>
+        <source>MNU_CLONE_VIEW</source>
+        <translation>Clone View</translation>
+    </message>
+    <message>
+        <source>POSTSCRIPT_FILES</source>
+        <translation>PostScript files (*.ps)</translation>
+    </message>
+    <message>
+        <source>ENCAPSULATED_POSTSCRIPT_FILES</source>
+        <translation>Encapsulated PostScript files (*.eps)</translation>
+    </message>
+    <message>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Selection of a new center of the view</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Switches view to linear scaling mode along vertical axis</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Switches view to linear scaling mode along horizontal axis</translation>
+    </message>
+    <message>
+        <source>CURVE_LINE_WIDTH_LAB</source>
+        <translation>Line width:</translation>
+    </message>
+    <message>
+        <source>CURVE_TYPE_POPUP</source>
+        <translation>Curve type</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Vertical axis: linear</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Horizontal axis: linear</translation>
+    </message>
+    <message>
+        <source>FIT_DATA_TLT</source>
+        <translation>Fit Data Range</translation>
+    </message>
+    <message>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
+    </message>
+    <message>
+        <source>PLOT2D_GRID_TLT</source>
+        <translation>Grid / Axes marks</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Panning the view</translation>
+    </message>
+    <message>
+        <source>DASHDOT_LINE_LBL</source>
+        <translation>DashDot</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_CURVES_SPLINES</source>
+        <translation>Switches view to splines mode</translation>
+    </message>
+    <message>
+        <source>INF_AXES_X</source>
+        <translation>Axis X</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SCALE_TLT</source>
+        <translation>Scale mode</translation>
+    </message>
+    <message>
+        <source>DSC_FITALL</source>
+        <translation>Fit all objects inside the view frame</translation>
+    </message>
+    <message>
+        <source>MNU_FITALL</source>
+        <translation>Fit All</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Horizontal axis: logarithmic</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Vertical axis: logarithmic</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Global Panning</translation>
+    </message>
+    <message>
+        <source>INF_APP_DUMP_VIEW</source>
+        <translation>Dump view</translation>
+    </message>
+    <message>
+        <source>PLOT2D_LEGEND_POSITION_BOTTOM</source>
+        <translation>Bottom</translation>
+    </message>
+    <message>
+        <source>INF_COORDINATES</source>
+        <translation>Coordinates: X : %1, Y : %2</translation>
+    </message>
+    <message>
+        <source>DSC_CLONE_VIEW</source>
+        <translation>Create new OCC viewer for the active scene</translation>
+    </message>
+    <message>
+        <source>DASH_LINE_LBL</source>
+        <translation>Dash</translation>
+    </message>
+    <message>
+        <source>DTRIANGLE_MARKER_LBL</source>
+        <translation>Downward triangle</translation>
+    </message>
+    <message>
+        <source>UTRIANGLE_MARKER_LBL</source>
+        <translation>Upward triangle</translation>
+    </message>
+    <message>
+        <source>LTRIANGLE_MARKER_LBL</source>
+        <translation>Leftward triangle</translation>
+    </message>
+    <message>
+        <source>RTRIANGLE_MARKER_LBL</source>
+        <translation>Rightward triangle</translation>
+    </message>
+    <message>
+        <source>RECTANGLE_MARKER_LBL</source>
+        <translation>Rectangle</translation>
+    </message>
+    <message>
+        <source>TLT_SETUP_PLOT2D_VIEW</source>
+        <translation>Plot 2d View Settings</translation>
+    </message>
+    <message>
+        <source>CURVE_LINE_TYPE_LAB</source>
+        <translation>Line type:</translation>
+    </message>
+    <message>
+        <source>CROSS_MARKER_LBL</source>
+        <translation>Cross</translation>
+    </message>
+    <message>
+        <source>XCROSS_MARKER_LBL</source>
+        <translation>Diagonal cross</translation>
+    </message>
+    <message>
+        <source>PLOT2D_ENABLE_VER_TITLE</source>
+        <translation>Vertical axis title</translation>
+    </message>
+    <message>
+        <source>PLOT2D_ENABLE_HOR_TITLE</source>
+        <translation>Horizontal axis title</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_SETTINGS</source>
+        <translation>Settings</translation>
+    </message>
+    <message>
+        <source>PLOT2D_CURVE_TYPE_LINES</source>
+        <translation>Lines</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_CURVES_SPLINES</source>
+        <translation>Draw Splines</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Switches view to logarithmic scaling mode along horizontal axis</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Switches view to logarithmic scaling mode along vertical axis</translation>
+    </message>
+    <message>
+        <source>PLOT2D_IMAGE_FILES</source>
+        <translation>Images Files (*.bmp *.png *.jpg *.jpeg)</translation>
+    </message>
+    <message>
+        <source>PLOT2D_MAX_INTERVALS</source>
+        <translation>Max intervals</translation>
+    </message>
+    <message>
+        <source>INF_AXES_Y_LEFT</source>
+        <translation>Axis Y Left</translation>
+    </message>
+    <message>
+        <source>CURVE_COLOR_LAB</source>
+        <translation>Color:</translation>
+    </message>
+    <message>
+        <source>CURVE_PREVIEW_LAB</source>
+        <translation>Preview:</translation>
+    </message>
+    <message>
+        <source>DIAMOND_MARKER_LBL</source>
+        <translation>Diamond</translation>
+    </message>
+    <message>
+        <source>PLOT2D_LEGEND_POSITION_TOP</source>
+        <translation>Top</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_CHANGE_BACKGROUND</source>
+        <translation>Change background</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_CHANGE_BACKGROUND</source>
+        <translation>Change Background...</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_CHANGE_BACKGROUND</source>
+        <translation>Change background color</translation>
+    </message>
+    <message>
+        <source>SOLID_LINE_LBL</source>
+        <translation>Solid</translation>
+    </message>
+    <message>
+        <source>PLOT2D_GRID_ENABLE_VER_MAJOR</source>
+        <translation>Vertical major</translation>
+    </message>
+    <message>
+        <source>PLOT2D_GRID_ENABLE_HOR_MAJOR</source>
+        <translation>Horizontal major</translation>
+    </message>
+    <message>
+        <source>PLOT2D_GRID_ENABLE_VER_MINOR</source>
+        <translation>Vertical minor</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_CURVES_POINTS</source>
+        <translation>Draw points</translation>
+    </message>
+    <message>
+        <source>PLOT2D_GRID_ENABLE_HOR_MINOR</source>
+        <translation>Horizontal minor</translation>
+    </message>
+    <message>
+        <source>PLOT2D_BACKGROUND_COLOR_LBL</source>
+        <translation>Background color:</translation>
+    </message>
+    <message>
+        <source>WRN_XLOG_NOT_ALLOWED</source>
+        <translation>Some points with non-positive abscissa values have been detected.
+Logarithmic scale for abscissa axis is not allowed.</translation>
+    </message>
+    <message>
+        <source>WRN_YLOG_NOT_ALLOWED</source>
+        <translation>Some points with non-positive ordinate values have been detected.
+Logarithmic scale for ordinate axis is not allowed.</translation>
+    </message>
+    <message>
+        <source>DSC_FITRECT</source>
+        <translation>Fit area within the view frame</translation>
+    </message>
+    <message>
+        <source>PLOT2D_LEGEND_POSITION_LEFT</source>
+        <translation>Left</translation>
+    </message>
+    <message>
+        <source>MNU_FITRECT</source>
+        <translation>Fit Area</translation>
+    </message>
+    <message>
+        <source>DOT_LINE_LBL</source>
+        <translation>Dot</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_CURVES_POINTS</source>
+        <translation>Draw Points</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_CURVES_POINTS</source>
+        <translation>Switches view to points mode</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SCALE_MODE_LOGARITHMIC</source>
+        <translation>Logarithmic</translation>
+    </message>
+    <message>
+        <source>PLOT2D_LEGEND_POSITION_RIGHT</source>
+        <translation>Right</translation>
+    </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Saves the active view in the image file</translation>
+    </message>
+    <message>
+        <source>WARNING</source>
+        <translation>Warning</translation>
+    </message>
+    <message>
+        <source>PLOT2D_ENABLE_LEGEND</source>
+        <translation>Show legend</translation>
+    </message>
+    <message>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoom the view</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_SETTINGS</source>
+        <translation>Setups view properties</translation>
+    </message>
+    <message>
+        <source>INF_COORDINATES_SOME_Y</source>
+        <translation>Coordinates: X : %1, Y : %2 ( %3 )</translation>
+    </message>
+    <message>
+        <source>SCALING_POPUP</source>
+        <translation>Scaling</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SCALE_MODE_LINEAR</source>
+        <translation>Linear</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_FITDATA</source>
+        <translation>Fit range</translation>
+    </message>
+    <message>
+        <source>PLOT2D_CURVE_TYPE_POINTS</source>
+        <translation>Points</translation>
+    </message>
+    <message>
+        <source>PLOT2D_CURVE_TYPE_SPLINE</source>
+        <translation>Spline</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_FITDATA</source>
+        <translation>Fit &amp;Range</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Horizontal Axis: Logarithmic</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Vertical Axis: Logarithmic</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_FITDATA</source>
+        <translation>Fits view to the given data range</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Vertical Axis: Linear</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Horizontal Axis: Linear</translation>
+    </message>
+    <message>
+        <source>NONE_MARKER_LBL</source>
+        <translation>None</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_CANT_SAVE_FILE</source>
+        <translation>Cannot save file</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_SHOW_LEGEND</source>
+        <translation>Show &amp;Legend</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_SHOW_LEGEND</source>
+        <translation>Enables/disables legend</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_SHOW_LEGEND</source>
+        <translation>Show Legend</translation>
+    </message>
+    <message>
+        <source>INF_AXES_Y_RIGHT</source>
+        <translation>Axis Y Right</translation>
+    </message>
+    <message>
+        <source>DAHSDOTDOT_LINE_LBL</source>
+        <translation>DashDotDot</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_CURVES_SPLINES</source>
+        <translation>Draw splines</translation>
+    </message>
+    <message>
+        <source>CURVE_MARKER_TYPE_LAB</source>
+        <translation>Marker type:</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_SETTINGS</source>
+        <translation>&amp;Settings</translation>
+    </message>
+    <message>
+        <source>CIRCLE_MARKER_LBL</source>
+        <translation>Circle</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>View Operations</translation>
+    </message>
+    <message>
+        <source>NONE_LINE_LBL</source>
+        <translation>None</translation>
+    </message>
+    <message>
+        <source>PLOT2D_MARKER_SIZE_LBL</source>
+        <translation>Marker size:</translation>
+    </message>
+    <message>
+        <source>PLOT2D_ENABLE_MAIN_TITLE</source>
+        <translation>Main title</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_CURVES_LINES</source>
+        <translation>Draw lines</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_CURVES_LINES</source>
+        <translation>Switches view to lines mode</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_CURVES_LINES</source>
+        <translation>Draw Lines</translation>
+    </message>
+</context>
+<context>
+    <name>Plot2d_FitDataDlg</name>
+    <message>
+        <source>FIT_HORIZONTAL</source>
+        <translation>Fit horizontally</translation>
+    </message>
+    <message>
+        <source>MIN_VALUE_LAB</source>
+        <translation>Min:</translation>
+    </message>
+    <message>
+        <source>VERTICAL_AXIS</source>
+        <translation>Vertical axis</translation>
+    </message>
+    <message>
+        <source>MAX_VALUE_LAB</source>
+        <translation>Max:</translation>
+    </message>
+    <message>
+        <source>HORIZONTAL_AXIS</source>
+        <translation>Horizontal axis</translation>
+    </message>
+    <message>
+        <source>VERTICAL_LEFT_AXIS</source>
+        <translation>Vertical left axis</translation>
+    </message>
+    <message>
+        <source>FIT_ALL</source>
+        <translation>Fit both</translation>
+    </message>
+    <message>
+        <source>VERTICAL_RIGHT_AXIS</source>
+        <translation>Vertical right axis</translation>
+    </message>
+    <message>
+        <source>FIT_VERTICAL</source>
+        <translation>Fit vertically</translation>
+    </message>
+</context>
+<context>
+    <name>Plot2d_ViewManager</name>
+    <message>
+        <source>PLOT2D_VIEW_TITLE</source>
+        <translation>Plot2d scene:%M - viewer:%V</translation>
+    </message>
+</context>
+</TS>
index 8eb63e09be9919e21d4c8e54482127881dfb5d29..b02616f2975e7a3865a236ee75380bdae5ce59f7 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_camera_dump.png and b/src/Plot2d/resources/plot2d_camera_dump.png differ
index 5b5a8ecc19d058fe30f73531f7764c5dfd04ae38..441482d205ef6e04cff83702e3dffa48cad36280 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_clone.png and b/src/Plot2d/resources/plot2d_clone.png differ
index c09ff94ad89b32483194de03275ece8844f985da..87e001dd80b2755858d4599857106a0c9c0b3500 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_fitall.png and b/src/Plot2d/resources/plot2d_fitall.png differ
index 5b79594e709379eb5835258d8afaf6dd36951a02..450dc56c6ce722c040b4e5b77459207e8256cd58 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_fitarea.png and b/src/Plot2d/resources/plot2d_fitarea.png differ
index c23322a4ae4dc6ffdbbac6af7b397fc35554d750..28ab547eab2e4614b8061252f5cbb4da079c7666 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_glpan.png and b/src/Plot2d/resources/plot2d_glpan.png differ
index cdcc1e0d858a1fa5dd62c11d6b8df2344f8b873e..81c06277b4f1d65c661c16b6209c9cbd2c700de4 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_legend.png and b/src/Plot2d/resources/plot2d_legend.png differ
index d79f2142684f74bccf2b7a8f4e19a0d834088660..0140fcc9874aa12603941a4600f0555929d097d6 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_linear.png and b/src/Plot2d/resources/plot2d_linear.png differ
index e396eac2e9baacda61f181a7e73b19d376353025..7acc8fe79ed852c978baf3e7af4c62501c3e269c 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_linear_y.png and b/src/Plot2d/resources/plot2d_linear_y.png differ
index 6baf57344cacc7fd22a5e42fa8c5eff44313ecef..9789452845376333452f55f398bcc3f9e4124bc4 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_lines.png and b/src/Plot2d/resources/plot2d_lines.png differ
index aecca8c13acab4ff9fe724bdd0532f858b60e84e..fb62cd77242c43e92c8dd638560f0ce535fae6fb 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_log.png and b/src/Plot2d/resources/plot2d_log.png differ
index 4e1e21147730b76ee0a07b6d9296c2ff63cac672..825d59edbabe2880137e8a8f6537a7124335edef 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_log_y.png and b/src/Plot2d/resources/plot2d_log_y.png differ
index 038fba118736ff3732a97e0e62ea4420022560ff..ec56cacc779342a978f183ecf747860c8b6dafb4 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_pan.png and b/src/Plot2d/resources/plot2d_pan.png differ
index 4847c4e8bcfeb4a2c47651887634307cc9d1b6c0..3cdea33dde6e749d0c718bc4f2c640d5fccad1c1 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_points.png and b/src/Plot2d/resources/plot2d_points.png differ
index d291da9dcbeee3eae6c68fbb3cce59d107ae8d28..64df2460b754730b6147340d542bd8906eeb292b 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_settings.png and b/src/Plot2d/resources/plot2d_settings.png differ
index c39d4321c35c26f3792db5fbdcc42d7a272e36a1..06a95572db8bb67fe21ae249da802c8da1091026 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_splines.png and b/src/Plot2d/resources/plot2d_splines.png differ
index b46573914ded57ddbdbd0fdfdeca02dbe772beca..386c966d156f0a6f53e780aed211b78aa473a11b 100755 (executable)
Binary files a/src/Plot2d/resources/plot2d_zoom.png and b/src/Plot2d/resources/plot2d_zoom.png differ
index 7f5d31a29ce9f3ce385aa174cc74c7ce846574b0..06a0502045463569443a8039fdf982f455cfb8b3 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
@@ -14,9 +17,8 @@
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSalomePrs.la
diff --git a/src/Prs/Prs.pro b/src/Prs/Prs.pro
new file mode 100644 (file)
index 0000000..a22aad1
--- /dev/null
@@ -0,0 +1,41 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = SalomePrs
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += PRS_EXPORTS
+
+HEADERS  = SALOME_Prs.h
+
+SOURCES  = SALOME_Prs.cxx
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+INSTALLS += includes
index b022d25730f11350229caf0345dc9d4f1b57674a..693c6e6d36812850d4309e28aecd95add87495ec 100755 (executable)
@@ -1,27 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:       SALOME_Prs.cxx
 // Created:    Wed Apr 28 15:03:43 2004
 // Author:     Sergey ANIKIN
 //             <san@startrex.nnov.opencascade.com>
-
-
+//
 #include "SALOME_Prs.h"
 
 //#include "utilities.h"
@@ -209,7 +211,7 @@ void SALOME_View::EraseAll( const bool )
 */
 void SALOME_View::LocalSelection( const SALOME_OCCPrs*, const int )
 {
-//  MESSAGE( "SALOME_View::LocalSelection( const SALOME_OCCPrs* ) called! \
+//  MESSAGE( "SALOME_View::LocalSelection( const SALOME_OCCPrs* ) called!
 //   Probably, selection is being activated in uncompatible viewframe." );
 }
 
@@ -218,7 +220,7 @@ void SALOME_View::LocalSelection( const SALOME_OCCPrs*, const int )
 */
 void SALOME_View::LocalSelection( const SALOME_VTKPrs*, const int )
 {
-//  MESSAGE( "SALOME_View::LocalSelection( const SALOME_VTKPrs* ) called! \
+//  MESSAGE( "SALOME_View::LocalSelection( const SALOME_VTKPrs* ) called!
 //   Probably, selection is being activated in uncompatible viewframe." );
 }
 
@@ -227,7 +229,7 @@ void SALOME_View::LocalSelection( const SALOME_VTKPrs*, const int )
 */
 void SALOME_View::LocalSelection( const SALOME_Prs2d*, const int )
 {
-//  MESSAGE( "SALOME_View::LocalSelection( const SALOME_Prs2d* ) called! \
+//  MESSAGE( "SALOME_View::LocalSelection( const SALOME_Prs2d* ) called!
 //   Probably, selection is being activated in uncompatible viewframe." );
 }
 
@@ -236,7 +238,7 @@ void SALOME_View::LocalSelection( const SALOME_Prs2d*, const int )
 */
 void SALOME_View::GlobalSelection( const bool ) const
 {
-//  MESSAGE( "SALOME_View::GlobalSelection() called! \
+//  MESSAGE( "SALOME_View::GlobalSelection() called!
 //   Probably, selection is being activated in uncompatible viewframe." );
 }
 
index fa7c62369e0d351ff598980a01573ebbda1abd20..05aeb50bbc889bbfe3746fdd610472b3cb280813 100755 (executable)
@@ -1,25 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SALOME_PRS_H
 #define SALOME_PRS_H
 
-#ifdef WNT
+#ifdef WIN32
 #ifdef PRS_EXPORTS
 #define PRS_EXPORT __declspec(dllexport)
 #else
@@ -185,11 +188,11 @@ public:
   virtual void GlobalSelection( const bool = false ) const;
 
   //! Creates empty presenation of corresponding type
-  virtual SALOME_Prs* CreatePrs( const char* entry = 0 ) { return 0; }
+  virtual SALOME_Prs* CreatePrs( const char* /*entry*/ = 0 ) { return 0; }
 
   // Axiluary methods called before and after displaying of objects
-  virtual void BeforeDisplay( SALOME_Displayer* ) {} //!< Null body here
-  virtual void AfterDisplay ( SALOME_Displayer* ) {} //!< Null body here
+  virtual void BeforeDisplay( SALOME_Displayer* ) {} //!< Null body here
+  virtual void AfterDisplay ( SALOME_Displayer* ) {} //!< Null body here
 
   // New methods (asv)
   //! \retval Return false.
diff --git a/src/PyConsole/Makefile.am b/src/PyConsole/Makefile.am
new file mode 100755 (executable)
index 0000000..d6a0fc4
--- /dev/null
@@ -0,0 +1,55 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  File   : Makefile.in
+#  Author : Vladimir Klyachin (OCN)
+#  Module : PyConsole
+#  $Header$
+#
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+lib_LTLIBRARIES = libPyConsole.la
+
+salomeinclude_HEADERS =                \
+       PyConsole.h             \
+       PyConsole_Console.h     \
+       PyConsole_Editor.h      \
+       PyConsole_Interp.h
+
+dist_libPyConsole_la_SOURCES = \
+       PyConsole_Console.cxx   \
+       PyConsole_Editor.cxx    \
+       PyConsole_Interp.cxx            
+
+MOC_FILES =                            \
+       PyConsole_Editor_moc.cxx        \
+       PyConsole_Console_moc.cxx
+
+nodist_libPyConsole_la_SOURCES = $(MOC_FILES)
+
+nodist_salomeres_DATA = \
+       PyConsole_msg_en.qm
+
+libPyConsole_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) \
+       -I$(srcdir)/../PyInterp -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+
+libPyConsole_la_LDFLAGS  = $(PYTHON_LIBS) $(QT_MT_LIBS)
+libPyConsole_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../PyInterp/libPyInterp.la
diff --git a/src/PyConsole/PyConsole.h b/src/PyConsole/PyConsole.h
new file mode 100644 (file)
index 0000000..c2af748
--- /dev/null
@@ -0,0 +1,47 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : PyConsole.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#if !defined ( PYCONSOLE_H )
+#define PYCONSOLE_H
+
+// ========================================================
+// set dllexport type for Win platform 
+#ifdef WIN32
+#  ifdef PYCONSOLE_EXPORTS
+#    define PYCONSOLE_EXPORT __declspec(dllexport)
+#  else
+#    define PYCONSOLE_EXPORT __declspec(dllimport)
+#  endif
+#else   // WIN32
+#  define PYCONSOLE_EXPORT
+#endif  // WIN32
+
+// ========================================================
+// avoid warning messages
+#ifdef WIN32
+#pragma warning (disable : 4786)
+#pragma warning (disable : 4251)
+#endif
+
+#endif // PYCONSOLE_H
diff --git a/src/PyConsole/PyConsole.pro b/src/PyConsole/PyConsole.pro
new file mode 100644 (file)
index 0000000..aee086e
--- /dev/null
@@ -0,0 +1,62 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = PyConsole
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+PYTHONVER=2.4
+PYTHONHOME=$$(PYTHONHOME)
+PYTHONINC=$${PYTHONHOME}/include/python$${PYTHONVER}
+PYTHONLIB=$${PYTHONHOME}/lib
+
+INCLUDEPATH += ../../include $${PYTHONINC}
+INCLUDEPATH += ../Qtx ../SUIT ../PyInterp
+unix:LIBS  += -L$${PYTHONLIB} -lpython$${PYTHONVER}
+win32:LIBS += /LIBPATH:$$(PYTHONLIB)
+LIBS += -L../../lib -lqtx -lsuit -lPyInterp
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += PYCONSOLE_EXPORTS
+
+HEADERS  = PyConsole.h
+HEADERS += PyConsole_Console.h
+HEADERS += PyConsole_Editor.h
+HEADERS += PyConsole_Interp.h
+
+SOURCES  = PyConsole_Console.cxx
+SOURCES += PyConsole_Editor.cxx
+SOURCES += PyConsole_Interp.cxx
+
+TRANSLATIONS = resources/PyConsole_msg_en.ts
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
diff --git a/src/PyConsole/PyConsole_Console.cxx b/src/PyConsole/PyConsole_Console.cxx
new file mode 100644 (file)
index 0000000..ccb7b83
--- /dev/null
@@ -0,0 +1,263 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : PyConsole_Console.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+/*!
+  \class PyConsole_Console
+  \brief Python console widget.
+*/  
+
+#include "PyConsole_Interp.h"   /// !!! WARNING !!! THIS INCLUDE MUST BE VERY FIRST !!!
+#include "PyConsole_Console.h"
+#include "PyConsole_Editor.h"
+
+#include <Qtx.h>
+
+#include <QAction>
+#include <QApplication>
+#include <QClipboard>
+#include <QEvent>
+#include <QMenu>
+#include <QVBoxLayout>
+
+/*!
+  \brief Constructor.
+
+  Creates new python console widget.
+  \param parent parent widget
+  \param interp python interpreter
+*/
+PyConsole_Console::PyConsole_Console( QWidget* parent, PyConsole_Interp* interp )
+: QWidget( parent ),
+  myEditor( 0 )
+{
+  // create python interpreter
+  myInterp = interp;
+  if ( !myInterp )
+    myInterp = new PyConsole_Interp();
+  
+  // initialize Python interpretator
+  myInterp->initialize();
+  
+  // create editor console
+  QVBoxLayout* lay = new QVBoxLayout( this );
+  lay->setMargin( 0 );
+  myEditor = new PyConsole_Editor( myInterp, this );
+  myEditor->viewport()->installEventFilter( this );
+  lay->addWidget( myEditor );
+
+  createActions();
+}
+
+/*!
+  \brief Destructor.
+
+  Does nothing for the moment.
+*/
+PyConsole_Console::~PyConsole_Console()
+{
+}
+
+/*!
+  \brief Execute python command in the interpreter.
+  \param command string with command and arguments
+*/
+void PyConsole_Console::exec( const QString& command )
+{
+  if ( myEditor )
+    myEditor->exec( command );
+}
+
+/*!
+  \brief Execute python command in the interpreter 
+         and wait until it is finished.
+  
+  Block execution of main application until the python command is executed.
+  \param command string with command and arguments
+*/
+void PyConsole_Console::execAndWait( const QString& command )
+{
+  if ( myEditor )
+    myEditor->execAndWait( command );
+}
+
+/*!
+  \brief Get synchronous mode flag value.
+  
+  \sa setIsSync()
+  \return True if python console works in synchronous mode
+*/
+bool PyConsole_Console::isSync() const
+{
+  return myEditor->isSync();
+}
+
+/*!
+  \brief Set synchronous mode flag value.
+
+  In synhronous mode the Python commands are executed in the GUI thread
+  and the GUI is blocked until the command is finished. In the asynchronous
+  mode each Python command is executed in the separate thread that does not
+  block the main GUI loop.
+
+  \param on synhronous mode flag
+*/
+void PyConsole_Console::setIsSync( const bool on )
+{
+  myEditor->setIsSync( on );
+}
+
+/*!
+  \brief Change the python console's font.
+  \param f new font
+*/
+void PyConsole_Console::setFont( const QFont& f )
+{
+  if( myEditor )
+    myEditor->setFont( f );
+}
+
+/*!
+  \brief Get python console font.
+  \return current python console's font
+*/
+QFont PyConsole_Console::font() const
+{
+  QFont res;
+  if( myEditor )
+    res = myEditor->font();
+  return res;
+}
+
+/*!
+  \brief Event handler.
+
+  Handles context menu request event.
+
+  \param o object
+  \param e event
+  \return True if the event is processed and further processing should be stopped
+*/
+bool PyConsole_Console::eventFilter( QObject* o, QEvent* e )
+{
+  if ( o == myEditor->viewport() && e->type() == QEvent::ContextMenu )
+  {
+    contextMenuRequest( (QContextMenuEvent*)e );
+    return true;
+  }
+  return QWidget::eventFilter( o, e );
+}
+
+/*!
+  \brief Create the context popup menu.
+
+  Fill in the popup menu with the commands.
+
+  \param menu context popup menu
+*/
+void PyConsole_Console::contextMenuPopup( QMenu* menu )
+{
+  if ( myEditor->isReadOnly() )
+    return;
+
+  menu->addAction( myActions[CopyId] );
+  menu->addAction( myActions[PasteId] );
+  menu->addAction( myActions[ClearId] );
+  menu->addSeparator();
+  menu->addAction( myActions[SelectAllId] );
+
+  Qtx::simplifySeparators( menu );
+
+  updateActions();
+}
+
+/*!
+  \brief Set actions to be visible in the context popup menu.
+  
+  Actions, which IDs are set in \a flags parameter, will be shown in the 
+  context popup menu. Other actions will not be shown.
+
+  \param flags ORed together actions flags
+*/
+void PyConsole_Console::setMenuActions( const int flags )
+{
+  myActions[CopyId]->setVisible( flags & CopyId );
+  myActions[PasteId]->setVisible( flags & PasteId );
+  myActions[ClearId]->setVisible( flags & ClearId );
+  myActions[SelectAllId]->setVisible( flags & SelectAllId );
+}
+
+/*!
+  \brief Get menu actions which are currently visible in the context popup menu.
+  \return ORed together actions flags
+  \sa setMenuActions()
+*/
+int PyConsole_Console::menuActions() const
+{
+  int ret = 0;
+  ret = ret | ( myActions[CopyId]->isVisible() ? CopyId : 0 );
+  ret = ret | ( myActions[PasteId]->isVisible() ? PasteId : 0 );
+  ret = ret | ( myActions[ClearId]->isVisible() ? ClearId : 0 );
+  ret = ret | ( myActions[SelectAllId]->isVisible() ? SelectAllId : 0 );
+  return ret;
+}
+
+/*!
+  \brief Create menu actions.
+
+  Create context popup menu actions.
+*/
+void PyConsole_Console::createActions()
+{
+  QAction* a = new QAction( tr( "EDIT_COPY_CMD" ), this );
+  a->setStatusTip( tr( "EDIT_COPY_CMD" ) );
+  connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( copy() ) );
+  myActions.insert( CopyId, a );
+
+  a = new QAction( tr( "EDIT_PASTE_CMD" ), this );
+  a->setStatusTip( tr( "EDIT_PASTE_CMD" ) );
+  connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( paste() ) );
+  myActions.insert( PasteId, a );
+
+  a = new QAction( tr( "EDIT_CLEAR_CMD" ), this );
+  a->setStatusTip( tr( "EDIT_CLEAR_CMD" ) );
+  connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( clear() ) );
+  myActions.insert( ClearId, a );
+
+  a = new QAction( tr( "EDIT_SELECTALL_CMD" ), this );
+  a->setStatusTip( tr( "EDIT_SELECTALL_CMD" ) );
+  connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( selectAll() ) );
+  myActions.insert( SelectAllId, a );
+}
+
+/*!
+  \brief Update menu actions.
+
+  Update context popup menu action state.
+*/
+void PyConsole_Console::updateActions()
+{
+  myActions[CopyId]->setEnabled( myEditor->textCursor().hasSelection() );
+  myActions[PasteId]->setEnabled( !myEditor->isReadOnly() && !QApplication::clipboard()->text().isEmpty() );
+  myActions[SelectAllId]->setEnabled( !myEditor->document()->isEmpty() );
+}
diff --git a/src/PyConsole/PyConsole_Console.h b/src/PyConsole/PyConsole_Console.h
new file mode 100644 (file)
index 0000000..790450c
--- /dev/null
@@ -0,0 +1,86 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : PyConsole_Console.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef PYCONSOLE_CONSOLE_H
+#define PYCONSOLE_CONSOLE_H
+
+#include "PyConsole.h"
+
+#include <SUIT_PopupClient.h>
+#include <QWidget>
+#include <QMap>
+
+class PyConsole_Interp;
+class PyConsole_Editor;
+
+class PYCONSOLE_EXPORT PyConsole_Console : public QWidget, public SUIT_PopupClient
+{
+  Q_OBJECT
+
+public:
+  //! Context popup menu actions flags
+  enum
+  {
+    CopyId      = 0x01,                            //!< "Copy" menu action
+    PasteId     = 0x02,                            //!< "Paste" menu action
+    ClearId     = 0x04,                            //!< "Clear" menu action
+    SelectAllId = 0x08,                            //!< "Select All" menu action
+    All = CopyId | PasteId | ClearId | SelectAllId //!< all menu actions
+  };
+
+public:
+  PyConsole_Console( QWidget* parent, PyConsole_Interp* interp = 0 );
+  virtual ~PyConsole_Console();
+
+  //! \brief Get python interperter
+  PyConsole_Interp*   getInterp() { return myInterp; } 
+  QFont               font() const;
+  virtual void        setFont( const QFont& );
+
+  bool                isSync() const;
+  void                setIsSync( const bool );
+
+  void                exec( const QString& );
+  void                execAndWait( const QString& );
+
+  virtual bool        eventFilter( QObject*, QEvent* );
+
+  //! \brief Get popup client symbolic name
+  virtual QString     popupClientType() const { return QString( "PyConsole" ); }
+  virtual void        contextMenuPopup( QMenu* );
+
+  void                setMenuActions( const int );
+  int                 menuActions() const;
+
+private:
+  void                createActions();
+  void                updateActions();
+
+private:
+  PyConsole_Interp*   myInterp;    //!< python interpreter
+  PyConsole_Editor*   myEditor;    //!< python console editor widget
+  QMap<int, QAction*> myActions;   //!< menu actions list
+};
+
+#endif // PYCONSOLE_CONSOLE_H
diff --git a/src/PyConsole/PyConsole_Editor.cxx b/src/PyConsole/PyConsole_Editor.cxx
new file mode 100644 (file)
index 0000000..ae6563b
--- /dev/null
@@ -0,0 +1,1077 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+// File   : PyConsole_Editor.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+/*!
+  \class PyConsole_Editor
+  \brief Python command line interpreter front-end GUI widget.
+  
+  This class provides simple GUI interface to the Python interpreter, including basic 
+  navigation operations, executing commands (both interactively and programmatically), 
+  copy-paste operations, history of the commands and so on.
+
+  Here below is the shortcut keyboard boundings used for navigation and other operations:
+  - <Enter>              : execute current command
+  - <Ctrl><Break>        : clear current command
+  - <Escape>             : clear current command
+  - <Up>                 : previous command in the history
+  - <Shift><Up>          : move cursor one row up with selection
+  - <Ctrl><Up>           : move cursor one row up without selection
+  - <Ctrl><Shift><Up>    : move cursor one row up with selection
+  - <Down>               : next command in the history
+  - <Shift><Down>        : move cursor one row down with selection
+  - <Ctrl><Down>         : move cursor one row down without selection
+  - <Ctrl><Shift><Down>  : move cursor one row down with selection
+  - <Left>               : move one symbol left without selection
+  - <Shift><Left>        : move one symbol left with selection
+  - <Ctrl><Left>         : move one word left without selection
+  - <Ctrl><Shift><Left>  : move one word left with selection
+  - <Right>              : move one symbol right without selection
+  - <Shift><Right>       : move one symbol right with selection
+  - <Ctrl><Right>        : move one word right without selection
+  - <Ctrl><Shift><Right> : move one word right with selection
+  - <PgUp>               : first command in the history
+  - <Shift><PgUp>        : move one page up with selection
+  - <Ctrl><PgUp>         : move one page up without selection
+  - <Ctrl><Shift><PgUp>  : scroll one page up
+  - <PgDn>               : last command in the history
+  - <Shift><PgDn>        : move one page down with selection
+  - <Ctrl><PgDn>         : move one page down without selection
+  - <Ctrl><Shift><PgDn>  : scroll one page down
+  - <Home>               : move to the beginning of the line without selection
+  - <Shift><Home>        : move to the beginning of the line with selection
+  - <Ctrl><Home>         : move to the very first symbol without selection
+  - <Ctrl><Shift><Home>  : move to the very first symbol with selection
+  - <End>                : move to the end of the line without selection
+  - <Shift><End>         : move to the end of the line with selection
+  - <Ctrl><End>          : move to the very last symbol without selection
+  - <Ctrl><Shift><End>   : move to the very last symbol with selection
+  - <Backspace>          : delete symbol before the cursor
+                           / remove selected text and put it to the clipboard (cut)
+  - <Shift><Backspace>   : delete previous word
+                           / remove selected text and put it to the clipboard (cut)
+  - <Ctrl><Backspace>    : delete text from the cursor to the beginning of the line 
+                           / remove selected text and put it to the clipboard (cut)
+  - <Delete>             : delete symbol after the cursor 
+                           / remove selected text and put it to the clipboard (cut)
+  - <Shift><Delete>      : delete next word
+                           / remove selected text and put it to the clipboard (cut)
+  - <Ctrl><Delete>       : delete text from the cursor to the end of the line
+                           / remove selected text and put it to the clipboard (cut)
+  - <Ctrl><Insert>       : copy
+  - <Shift><Insert>      : paste
+  - <Ctrl><V>            : paste
+  - <Ctrl><C>            : copy
+  - <Ctrl><X>            : cut
+  - <Ctrl><V>            : paste
+
+  TODO:
+  - paste multiline text: process each line as separate command
+    (including mouse middle-button click pasting)
+  - the same for drag-n-drop of multiline text
+*/
+
+#include "PyConsole_Interp.h"   // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
+#include "PyConsole_Editor.h"
+#include <PyInterp_Dispatcher.h>
+
+#include <SUIT_Tools.h>
+
+#include <QApplication>
+#include <QClipboard>
+#include <QDropEvent>
+#include <QEvent>
+#include <QKeyEvent>
+#include <QMouseEvent>
+#include <QScrollBar>
+#include <QTextBlock>
+#include <QTextCursor>
+#include <QTextDocument>
+
+static QString READY_PROMPT = ">>> ";
+static QString DOTS_PROMPT  = "... ";
+#define PROMPT_SIZE myPrompt.length()
+
+#define PRINT_EVENT 65432
+
+/*!
+  \class ExecCommand
+  \brief Python command execution request.
+  \internal
+*/
+
+class ExecCommand : public PyInterp_LockRequest
+{
+public:
+  /*!
+    \brief Constructor.
+    
+    Creates new python command execution request.
+    \param theInterp   python interpreter
+    \param theCommand  python command
+    \param theListener widget to get the notification messages
+    \param sync        if True the request is processed synchronously 
+  */
+  ExecCommand( PyInterp_Interp*        theInterp, 
+              const QString&          theCommand,
+              PyConsole_Editor*       theListener, 
+              bool                    sync = false )
+    : PyInterp_LockRequest( theInterp, theListener, sync ),
+      myCommand( theCommand ), myState( PyInterp_Event::ES_OK )
+  {}
+
+protected:
+  /*!
+    \brief Execute the python command in the interpreter and 
+           get its execution status.
+  */
+  virtual void execute()
+  {
+    if ( myCommand != "" )
+    {
+      int ret = getInterp()->run( myCommand.toLatin1() );
+      if ( ret < 0 )
+       myState = PyInterp_Event::ES_ERROR;
+      else if ( ret > 0 )
+       myState = PyInterp_Event::ES_INCOMPLETE;
+    } 
+  }
+
+  /*!
+    \brief Create and return a notification event.
+    \return new notification event
+  */
+  virtual QEvent* createEvent() const
+  {
+    if ( IsSync() )
+      QCoreApplication::sendPostedEvents( listener(), PRINT_EVENT );
+    return new PyInterp_Event( myState, (PyInterp_Request*)this );    
+  }
+
+private:
+  QString myCommand;   //!< Python command
+  int     myState;     //!< Python command execution status
+};
+
+/*!
+  \class PrintEvent
+  \brief Python command output backend event.
+  \internal
+*/
+
+class PrintEvent : public QEvent
+{
+public:
+  /*!
+    \brief Constructor
+    \param c message text (python trace)
+  */
+  PrintEvent( const char* c ) : QEvent( (QEvent::Type)PRINT_EVENT ), myText( c ) {}
+  /*!
+    \brief Get message
+    \return message text (python trace)
+  */
+  QString text() const { return myText; }
+
+private:
+  QString myText; //!< Event message (python trace)
+};
+
+void staticCallback( void* data, char* c )
+{
+  QApplication::postEvent( (PyConsole_Editor*)data, new PrintEvent( c ) ); 
+}
+
+/*!
+  \brief Constructor. 
+  
+  Creates python editor window.
+  \param theInterp python interper
+  \param theParent parent widget
+*/
+PyConsole_Editor::PyConsole_Editor( PyConsole_Interp* theInterp, 
+                                   QWidget*          theParent )
+: QTextEdit( theParent ),
+  myInterp( 0 ),
+  myCmdInHistory( -1 ),
+  myEventLoop( 0 ),
+  myIsSync( false )
+{
+  QString fntSet( "" );
+  QFont aFont = SUIT_Tools::stringToFont( fntSet );
+  setFont( aFont );
+  setUndoRedoEnabled( false );
+
+  myPrompt = READY_PROMPT;
+  setLineWrapMode( QTextEdit::WidgetWidth );
+  setWordWrapMode( QTextOption::WrapAnywhere );
+  setAcceptRichText( false );
+
+  theInterp->setvoutcb( staticCallback, this );
+  theInterp->setverrcb( staticCallback, this );
+
+  // san - This is necessary for troubleless initialization
+  onPyInterpChanged( theInterp );
+}
+
+/*!
+  \brief Destructor.
+
+  Does nothing for the moment.
+*/
+PyConsole_Editor::~PyConsole_Editor()
+{
+}
+
+/*!
+  \brief Get synchronous mode flag value.
+  
+  \sa setIsSync()
+  \return True if python console works in synchronous mode
+*/
+bool PyConsole_Editor::isSync() const
+{
+  return myIsSync;
+}
+
+/*!
+  \brief Set synchronous mode flag value.
+
+  In synhronous mode the Python commands are executed in the GUI thread
+  and the GUI is blocked until the command is finished. In the asynchronous
+  mode each Python command is executed in the separate thread that does not
+  block the main GUI loop.
+
+  \param on synhronous mode flag
+*/
+void PyConsole_Editor::setIsSync( const bool on )
+{
+  myIsSync = on;
+}
+
+/*!
+  \brief Put the string \a str to the python editor.
+  \param str string to be put in the command line of the editor
+  \param newBlock if True, then the string is printed on a new line
+*/
+void PyConsole_Editor::addText( const QString& str, 
+                               const bool     newBlock )
+{
+  moveCursor( QTextCursor::End );
+  if ( newBlock )
+    textCursor().insertBlock();
+  textCursor().insertText( str );
+  moveCursor( QTextCursor::End );
+  ensureCursorVisible();
+}
+
+/*!
+  \brief Convenient method for executing a Python command,
+  as if the user typed it manually.
+  \param command python command to be executed
+*/
+void PyConsole_Editor::exec( const QString& command )
+{
+  if ( isReadOnly() ) {
+    // some interactive command is being executed in this editor...
+    // shedule the command to the queue
+    myQueue.push_back( command );
+    return;
+  }
+  // remove last line
+  moveCursor( QTextCursor::End );
+  moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+  textCursor().removeSelectedText();
+  // set "ready" prompt
+  myPrompt = READY_PROMPT;
+  // clear command buffer
+  myCommandBuffer.truncate( 0 );
+  // unset history browsing mode
+  myCmdInHistory = -1;
+  // print command line by line
+  QString cmd = command;
+  if ( !cmd.endsWith( "\n" ) ) cmd += "\n";
+  QStringList lines = command.split( "\n" );
+  for ( int i = 0; i < lines.size(); i++ ) {
+    if ( !lines[i].trimmed().isEmpty() )
+      myHistory.push_back( lines[i] );
+    addText( ( i == 0 ? READY_PROMPT : DOTS_PROMPT ) + lines[i], i != 0 );
+  }
+  // IPAL20182
+  addText( "", true );
+  // set read-only mode
+  setReadOnly( true );
+  // set busy cursor
+  setCursor( Qt::BusyCursor );
+  
+  // post a request to execute Python command;
+  // editor will be informed via a custom event that execution has been completed
+  PyInterp_Dispatcher::Get()->Exec( createRequest( cmd ) );
+}
+
+/*!
+  \brief Create request to the python dispatcher for the command execution.
+
+  \param command python command to be executed
+ */
+PyInterp_Request* PyConsole_Editor::createRequest( const QString& command )
+{
+  return new ExecCommand( myInterp, command, this, isSync() );
+}
+
+/*!
+  \brief Execute command in the python interpreter
+  and wait until it is finished.
+
+  \param command python command to be executed
+ */
+void PyConsole_Editor::execAndWait( const QString& command )
+{
+  // already running ?
+  if( myEventLoop )
+    return;
+
+  // create new event loop
+  myEventLoop = new QEventLoop( this );
+  // execute command
+  exec( command );
+  // run event loop
+  myEventLoop->exec();
+  // delete event loop after command is processed
+  delete myEventLoop;
+  myEventLoop = 0;
+}
+
+/*!
+  \brief Process "Enter" key press event. 
+  
+  Execute the command entered by the user.
+*/
+void PyConsole_Editor::handleReturn()
+{
+  // get last line
+  QTextBlock par = document()->end().previous();
+  if ( !par.isValid() ) return;
+
+  // get command
+  QString cmd = par.text().remove( 0, PROMPT_SIZE );
+  // extend the command buffer with the current command 
+  myCommandBuffer.append( cmd );
+  // add command to the history
+  if ( !cmd.trimmed().isEmpty() )
+    myHistory.push_back( cmd );
+
+  // IPAL19397
+  addText( "", true ); 
+  
+  // set read-only mode
+  setReadOnly( true );
+  // set busy cursor
+  setCursor( Qt::BusyCursor );
+  
+  // post a request to execute Python command;
+  // editor will be informed via a custom event that execution has been completed
+  PyInterp_Dispatcher::Get()->Exec( createRequest( myCommandBuffer ) );
+}
+
+/*!
+  \brief Process drop event.
+
+  Paste dragged text.
+  \param event drop event
+*/
+void PyConsole_Editor::dropEvent( QDropEvent* event )
+{
+  // get the initial drop position
+  QPoint pos = event->pos();
+  QTextCursor cur = cursorForPosition( event->pos() );
+  // if the position is not in the last line move it to the end of the command line
+  if ( cur.position() < document()->end().previous().position() + PROMPT_SIZE ) {
+    moveCursor( QTextCursor::End );
+    pos = cursorRect().center();
+  }
+  // create new drop event and use it instead of the original
+  QDropEvent de( pos,
+                event->possibleActions(),
+                event->mimeData(),
+                event->mouseButtons(),
+                event->keyboardModifiers(),
+                event->type() );
+  QTextEdit::dropEvent( &de );
+  // accept the original event
+  event->acceptProposedAction();
+}
+
+/*!
+  \brief Process mouse button release event.
+
+  Left mouse button: copy selection to the clipboard.
+  Middle mouse button: paste clipboard's contents.
+  \param event mouse event
+*/
+void PyConsole_Editor::mouseReleaseEvent( QMouseEvent* event )
+{
+  if ( event->button() == Qt::LeftButton ) {
+    QTextEdit::mouseReleaseEvent( event );
+    copy();
+  }
+  else if ( event->button() == Qt::MidButton ) {
+    QString text;
+    if ( QApplication::clipboard()->supportsSelection() )
+      text = QApplication::clipboard()->text( QClipboard::Selection );
+    if ( text.isEmpty() )
+      text = QApplication::clipboard()->text( QClipboard::Clipboard );
+    QTextCursor cur = cursorForPosition( event->pos() );
+    // if the position is not in the last line move it to the end of the command line
+    if ( cur.position() < document()->end().previous().position() + PROMPT_SIZE ) {
+      moveCursor( QTextCursor::End );
+    }
+    else {
+      setTextCursor( cur );
+    }
+    textCursor().clearSelection();
+    textCursor().insertText( text );
+  }
+  else {
+    QTextEdit::mouseReleaseEvent( event );
+  }
+}
+
+/*!
+  \brief Check if the string is command.
+  
+  Return True if the string \a str is likely to be the command
+  (i.e. it is started from the '>>>' or '...').
+  \param str string to be checked
+*/
+bool PyConsole_Editor::isCommand( const QString& str ) const
+{
+  return str.startsWith( READY_PROMPT ) || str.startsWith( DOTS_PROMPT );
+}
+
+/*!
+  \brief Handle keyboard event.
+
+  Implement navigation, history browsing, copy/paste and other common
+  operations.
+  \param event keyboard event
+*/
+void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
+{
+  // get cursor position
+  QTextCursor cur = textCursor();
+  int curLine = cur.blockNumber();
+  int curCol  = cur.columnNumber();
+
+  // get last edited line
+  int endLine = document()->blockCount()-1;
+
+  // get pressed key code
+  int aKey = event->key();
+
+  // check if <Ctrl> is pressed
+  bool ctrlPressed = event->modifiers() & Qt::ControlModifier;
+  // check if <Shift> is pressed
+  bool shftPressed = event->modifiers() & Qt::ShiftModifier;
+
+  if ( aKey == Qt::Key_Escape || ctrlPressed && aKey == -1 ) {
+    // process <Ctrl>+<Break> key-binding and <Escape> key: clear current command
+    myCommandBuffer.truncate( 0 );
+    myPrompt = READY_PROMPT;
+    addText( myPrompt, true );
+    horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+    return;
+  }
+  else if ( ctrlPressed && aKey == Qt::Key_C ) {
+    // process <Ctrl>+<C> key-binding : copy
+    copy();
+    return;
+  }
+  else if ( ctrlPressed && aKey == Qt::Key_X ) {
+    // process <Ctrl>+<X> key-binding : cut
+    cut();
+    return;
+  }
+  else if ( ctrlPressed && aKey == Qt::Key_V ) {
+    // process <Ctrl>+<V> key-binding : paste
+    paste();
+    return;
+  }
+
+  // check for printed key
+  aKey = ( aKey < Qt::Key_Space || aKey > Qt::Key_ydiaeresis ) ? aKey : 0;
+
+  switch ( aKey ) {
+  case 0 :
+    // any printed key: just print it
+    {
+      if ( curLine < endLine || curCol < PROMPT_SIZE ) {
+       moveCursor( QTextCursor::End );
+      }
+      QTextEdit::keyPressEvent( event );
+      break;
+    }
+  case Qt::Key_Return:
+  case Qt::Key_Enter:
+    // <Enter> key: process the current command
+    {
+      handleReturn();
+      break;
+    }
+  case Qt::Key_Up:
+    // <Up> arrow key: process as follows:
+    // - without <Ctrl>, <Shift> modifiers: previous command in history
+    // - with <Ctrl> modifier key pressed:  move cursor one row up without selection
+    // - with <Shift> modifier key pressed: move cursor one row up with selection
+    // - with <Ctrl>+<Shift> modifier keys pressed: scroll one row up
+    {
+      if ( ctrlPressed && shftPressed ) {
+       int value   = verticalScrollBar()->value();
+       int spacing = fontMetrics().lineSpacing();
+       verticalScrollBar()->setValue( value > spacing ? value-spacing : 0 );
+      }
+      else if ( shftPressed || ctrlPressed ) {
+       if ( curLine > 0 )
+         moveCursor( QTextCursor::Up, 
+                     shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+      }
+      else { 
+       if ( myCmdInHistory < 0 && myHistory.count() > 0 ) {
+         // set history browsing mode
+         myCmdInHistory = myHistory.count();
+         // remember current command
+         QTextBlock par = document()->end().previous();
+         myCurrentCommand = par.text().remove( 0, PROMPT_SIZE );
+       }
+       if ( myCmdInHistory > 0 ) {
+         myCmdInHistory--;
+         // get previous command in the history
+         QString previousCommand = myHistory.at( myCmdInHistory );
+         // print previous command
+         moveCursor( QTextCursor::End );
+         moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+         textCursor().removeSelectedText();
+         addText( myPrompt + previousCommand ); 
+         // move cursor to the end
+         moveCursor( QTextCursor::End );
+       }
+      }
+      break;
+    }
+  case Qt::Key_Down:
+    // <Down> arrow key: process as follows:
+    // - without <Ctrl>, <Shift> modifiers: next command in history
+    // - with <Ctrl> modifier key pressed:  move cursor one row down without selection
+    // - with <Shift> modifier key pressed: move cursor one row down with selection
+    // - with <Ctrl>+<Shift> modifier keys pressed: scroll one row down
+    {
+      if ( ctrlPressed && shftPressed ) {
+       int value   = verticalScrollBar()->value();
+       int maxval  = verticalScrollBar()->maximum();
+       int spacing = fontMetrics().lineSpacing();
+       verticalScrollBar()->setValue( value+spacing < maxval ? value+spacing : maxval );
+      }
+      else if ( shftPressed || ctrlPressed) {
+       if ( curLine < endLine )
+         moveCursor( QTextCursor::Down, 
+                     shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+      }
+      else { 
+       if ( myCmdInHistory >= 0 ) {
+         // get next command in the history
+         myCmdInHistory++;
+         QString nextCommand;
+         if ( myCmdInHistory < myHistory.count() ) {
+           // next command in history
+           nextCommand = myHistory.at( myCmdInHistory );
+         }
+         else {
+           // end of history is reached
+           // last printed command
+           nextCommand = myCurrentCommand;
+           // unset history browsing mode
+           myCmdInHistory = -1;
+         }
+         // print next or current command
+         moveCursor( QTextCursor::End );
+         moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+         textCursor().removeSelectedText();
+         addText( myPrompt + nextCommand );
+         // move cursor to the end
+         moveCursor( QTextCursor::End );
+       }
+      }
+      break;
+    }
+  case Qt::Key_Left:
+    // <Left> arrow key: process as follows:
+    // - without <Ctrl>, <Shift> modifiers: move one symbol left (taking into account prompt)
+    // - with <Ctrl> modifier key pressed:  move one word left (taking into account prompt)
+    // - with <Shift> modifier key pressed: move one symbol left with selection
+    // - with <Ctrl>+<Shift> modifier keys pressed: move one word left with selection
+    {
+      QString txt = textCursor().block().text();
+      if ( !shftPressed && isCommand( txt ) && curCol <= PROMPT_SIZE ) {
+       moveCursor( QTextCursor::Up );
+       moveCursor( QTextCursor::EndOfBlock );
+      }
+      else {
+       QTextEdit::keyPressEvent( event );
+      }
+      break;
+    }
+  case Qt::Key_Right:
+    // <Right> arrow key: process as follows:
+    // - without <Ctrl>, <Shift> modifiers: move one symbol right (taking into account prompt)
+    // - with <Ctrl> modifier key pressed:  move one word right (taking into account prompt)
+    // - with <Shift> modifier key pressed: move one symbol right with selection
+    // - with <Ctrl>+<Shift> modifier keys pressed: move one word right with selection
+    {
+      QString txt = textCursor().block().text();
+      if ( !shftPressed ) {
+       if ( curCol < txt.length() ) {
+         if ( isCommand( txt ) && curCol < PROMPT_SIZE ) {
+           cur.setPosition( cur.block().position() + PROMPT_SIZE );
+           setTextCursor( cur );
+           break;
+         }
+       }
+       else {
+         if ( curLine < endLine && isCommand( textCursor().block().next().text() ) ) {
+           cur.setPosition( cur.position() + PROMPT_SIZE+1 );
+           setTextCursor( cur );
+           horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+           break;
+         }
+       }
+      }
+      QTextEdit::keyPressEvent( event );
+      break;
+    }
+  case Qt::Key_PageUp:
+    // <PageUp> key: process as follows:
+    // - without <Ctrl>, <Shift> modifiers: first command in history
+    // - with <Ctrl> modifier key pressed:  move cursor one page up without selection
+    // - with <Shift> modifier key pressed: move cursor one page up with selection
+    // - with <Ctrl>+<Shift> modifier keys pressed: scroll one page up
+    {
+      if ( ctrlPressed && shftPressed ) {
+       verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepSub);
+      }
+      else if ( shftPressed || ctrlPressed ) {
+       bool moved = false;
+       qreal lastY = cursorRect( cur ).top();
+       qreal distance = 0;
+       // move using movePosition to keep the cursor's x
+       do {
+         qreal y = cursorRect( cur ).top();
+         distance += qAbs( y - lastY );
+         lastY = y;
+         moved = cur.movePosition( QTextCursor::Up, 
+                                   shftPressed ? QTextCursor::KeepAnchor : 
+                                                 QTextCursor::MoveAnchor );
+       } while ( moved && distance < viewport()->height() );
+       if ( moved ) {
+         cur.movePosition( QTextCursor::Down, 
+                           shftPressed ? QTextCursor::KeepAnchor : 
+                                         QTextCursor::MoveAnchor );
+         verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub );
+       }
+       setTextCursor( cur );
+      }
+      else { 
+       if ( myCmdInHistory < 0 && myHistory.count() > 0 ) {
+         // set history browsing mode
+         myCmdInHistory = myHistory.count();
+         // remember current command
+         QTextBlock par = document()->end().previous();
+         myCurrentCommand = par.text().remove( 0, PROMPT_SIZE );
+       }
+       if ( myCmdInHistory > 0 ) {
+         myCmdInHistory = 0;
+         // get very first command in the history
+         QString firstCommand = myHistory.at( myCmdInHistory );
+         // print first command
+         moveCursor( QTextCursor::End );
+         moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+         textCursor().removeSelectedText();
+         addText( myPrompt + firstCommand ); 
+         // move cursor to the end
+         moveCursor( QTextCursor::End );
+       }
+      }
+      break;
+    }
+  case Qt::Key_PageDown:
+    // <PageDown> key: process as follows:
+    // - without <Ctrl>, <Shift> modifiers: last command in history
+    // - with <Ctrl> modifier key pressed:  move cursor one page down without selection
+    // - with <Shift> modifier key pressed: move cursor one page down with selection
+    // - with <Ctrl>+<Shift> modifier keys pressed: scroll one page down
+    {
+      if ( ctrlPressed && shftPressed ) {
+       verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepAdd);
+      }
+      else if ( shftPressed || ctrlPressed ) {
+       bool moved = false;
+       qreal lastY = cursorRect( cur ).top();
+       qreal distance = 0;
+       // move using movePosition to keep the cursor's x
+       do {
+         qreal y = cursorRect( cur ).top();
+         distance += qAbs( y - lastY );
+         lastY = y;
+         moved = cur.movePosition( QTextCursor::Down, 
+                                   shftPressed ? QTextCursor::KeepAnchor : 
+                                                 QTextCursor::MoveAnchor );
+       } while ( moved && distance < viewport()->height() );
+       if ( moved ) {
+         cur.movePosition( QTextCursor::Up, 
+                           shftPressed ? QTextCursor::KeepAnchor : 
+                                         QTextCursor::MoveAnchor );
+         verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub );
+       }
+       setTextCursor( cur );
+      }
+      else { 
+       if ( myCmdInHistory >= 0 ) {
+         // unset history browsing mode
+         myCmdInHistory = -1;
+         // print current command
+         moveCursor( QTextCursor::End );
+         moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+         textCursor().removeSelectedText();
+         addText( myPrompt + myCurrentCommand ); 
+         // move cursor to the end
+         moveCursor( QTextCursor::End );
+       }
+      }
+      break;
+    }
+  case Qt::Key_Home: 
+    // <Home> key: process as follows:
+    // - without <Ctrl>, <Shift> modifiers: move cursor to the beginning of the current line without selection
+    // - with <Ctrl> modifier key pressed:  move cursor to the very first symbol without selection
+    // - with <Shift> modifier key pressed: move cursor to the beginning of the current line with selection
+    // - with <Ctrl>+<Shift> modifier keys pressed: move cursor to the very first symbol with selection
+    {
+      if ( ctrlPressed ) { 
+       moveCursor( QTextCursor::Start, 
+                   shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+      }
+      else {
+       QString txt = textCursor().block().text();
+       if ( isCommand( txt ) ) {
+         if ( shftPressed ) {
+           if ( curCol > PROMPT_SIZE ) {
+             cur.movePosition( QTextCursor::StartOfLine, QTextCursor::KeepAnchor );
+             cur.movePosition( QTextCursor::Right, QTextCursor::KeepAnchor, PROMPT_SIZE );
+           }
+         }
+         else {
+           cur.movePosition( QTextCursor::StartOfLine );
+           cur.movePosition( QTextCursor::Right, QTextCursor::MoveAnchor, PROMPT_SIZE );
+         }
+         setTextCursor( cur );
+       }
+       else {
+         moveCursor( QTextCursor::StartOfBlock, 
+                     shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+       }
+       horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+      }
+      break;
+    }
+  case Qt::Key_End:
+    // <End> key: process as follows:
+    // - without <Ctrl>, <Shift> modifiers: move cursor to the end of the current line without selection
+    // - with <Ctrl> modifier key pressed:  move cursor to the very last symbol without selection
+    // - with <Shift> modifier key pressed: move cursor to the end of the current line with selection
+    // - with <Ctrl>+<Shift> modifier keys pressed: move cursor to the very last symbol with selection
+    {
+      moveCursor( ctrlPressed ? QTextCursor::End : QTextCursor::EndOfBlock, 
+                 shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+      break;
+    }  
+  case Qt::Key_Backspace :
+    // <Backspace> key: process as follows
+    // - without any modifiers : delete symbol before the cursor / selection (taking into account prompt)
+    // - with <Shift> modifier key pressed: delete previous word
+    // - with <Ctrl> modifier key pressed: delete text from the cursor to the line beginning
+    // works only for last (command) line
+    {
+      if ( cur.hasSelection() ) {
+       cut();
+      }
+      else if ( cur.position() > document()->end().previous().position() + PROMPT_SIZE ) {
+       if ( shftPressed ) {
+         moveCursor( QTextCursor::PreviousWord, QTextCursor::KeepAnchor );
+         textCursor().removeSelectedText();
+       }
+       else if ( ctrlPressed ) {
+         cur.setPosition( document()->end().previous().position() + PROMPT_SIZE, 
+                          QTextCursor::KeepAnchor );
+         setTextCursor( cur );
+         textCursor().removeSelectedText();
+       }
+       else {
+         QTextEdit::keyPressEvent( event );
+       }
+      }
+      else {
+       cur.setPosition( document()->end().previous().position() + PROMPT_SIZE );
+       setTextCursor( cur );
+       horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+      }
+      break;
+    }
+  case Qt::Key_Delete :
+    // <Delete> key: process as follows
+    // - without any modifiers : delete symbol after the cursor / selection (taking into account prompt)
+    // - with <Shift> modifier key pressed: delete next word
+    // - with <Ctrl> modifier key pressed: delete text from the cursor to the end of line
+    // works only for last (command) line
+    {
+      if ( cur.hasSelection() ) {
+       cut();
+      }
+      else if ( cur.position() > document()->end().previous().position() + PROMPT_SIZE-1 ) {
+       if ( shftPressed ) {
+         moveCursor( QTextCursor::NextWord, QTextCursor::KeepAnchor );
+         textCursor().removeSelectedText();
+       }
+       else if ( ctrlPressed ) {
+         moveCursor( QTextCursor::EndOfBlock, QTextCursor::KeepAnchor );
+         textCursor().removeSelectedText();
+       }
+       else {
+         QTextEdit::keyPressEvent( event );
+       }
+      }
+      else {
+       cur.setPosition( document()->end().previous().position() + PROMPT_SIZE );
+       setTextCursor( cur );
+       horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+      }
+      break;
+    }
+  case Qt::Key_Insert :
+    // <Insert> key: process as follows
+    // - with <Ctrl> modifier key pressed:  copy()
+    // - with <Shift> modifier key pressed: paste() to the command line
+    {
+      if ( ctrlPressed ) {
+       copy();
+      }
+      else if ( shftPressed ) {
+       paste();
+      }
+      else
+       QTextEdit::keyPressEvent( event );
+      break;
+    }
+  }
+}
+
+/*!
+  \brief Handle notification event coming from Python dispatcher.
+  \param event notification event
+*/
+void PyConsole_Editor::customEvent( QEvent* event )
+{
+  switch( event->type() )
+  {
+  case PRINT_EVENT:
+    {
+      PrintEvent* pe=(PrintEvent*)event;
+      addText( pe->text() );
+      return;
+    }
+  case PyInterp_Event::ES_OK:
+  case PyInterp_Event::ES_ERROR:
+  {
+    // clear command buffer
+    myCommandBuffer.truncate( 0 );
+    // add caret return line if necessary
+    QTextBlock par = document()->end().previous();
+    QString txt = par.text();
+    txt.truncate( txt.length() - 1 );
+    // IPAL19397 : addText moved to handleReturn() method
+    //if ( !txt.isEmpty() )
+    //  addText( "", true );
+    // set "ready" prompt
+    myPrompt = READY_PROMPT;
+    addText( myPrompt );
+    // unset busy cursor
+    unsetCursor();
+    // stop event loop (if running)
+    if ( myEventLoop )
+      myEventLoop->exit();
+    break;
+  }
+  case PyInterp_Event::ES_INCOMPLETE:
+  {
+    // extend command buffer (multi-line command)
+    myCommandBuffer.append( "\n" );
+    // add caret return line if necessary
+    QTextBlock par = document()->end().previous();
+    QString txt = par.text();
+    txt.truncate( txt.length() - 1 );
+    // IPAL19397 : addText moved to handleReturn() method
+    //if ( !txt.isEmpty() )
+    //  addText( "", true );
+    // set "dot" prompt
+    myPrompt = DOTS_PROMPT;
+    addText( myPrompt/*, true*/ ); // IPAL19397
+    // unset busy cursor
+    unsetCursor();
+    // stop event loop (if running)
+    if ( myEventLoop )
+      myEventLoop->exit();
+    break;
+  }
+  default:
+    QTextEdit::customEvent( event );
+  }
+  
+  // unset read-only state
+  setReadOnly( false );
+  // unset history browsing mode
+  myCmdInHistory = -1;
+
+  if ( (int)event->type() == (int)PyInterp_Event::ES_OK && myQueue.count() > 0 )
+  {
+    // process the next sheduled command from the queue (if there is any)
+    QString nextcmd = myQueue[0];
+    myQueue.pop_front();
+    exec( nextcmd );
+  }
+}
+
+/*!
+  \brief Handle Python interpreter change.
+
+  Perform initialization actions if the interpreter is changed.
+  \param interp python interpreter is being set
+*/
+void PyConsole_Editor::onPyInterpChanged( PyConsole_Interp* interp )
+{
+  if ( myInterp != interp 
+       // Force read-only state and wait cursor when myInterp is NULL
+      || !myInterp ) {
+    myInterp = interp;
+    if ( myInterp ) {
+      // print banner
+      myBanner = myInterp->getbanner().c_str();
+      addText( myBanner );
+      // clear command buffer
+      myCommandBuffer.truncate(0);
+      // unset read-only state
+      setReadOnly( false );
+      // unset history browsing mode
+      myCmdInHistory = -1;
+      // add prompt
+      addText( myPrompt );
+      // unset busy cursor
+      viewport()->unsetCursor();
+      // stop event loop (if running)
+      if( myEventLoop)
+       myEventLoop->exit();
+    }
+    else {
+      // clear contents
+      clear();
+      // set read-only state
+      setReadOnly( true );
+      // set busy cursor
+      setCursor( Qt::WaitCursor );
+    }
+  }
+}
+
+/*!
+  \brief "Copy" operation.
+  
+  Reimplemented from Qt.
+  Warning! In Qt4 this method is not virtual.
+ */
+void PyConsole_Editor::cut()
+{
+  QTextCursor cur = textCursor();
+  if ( cur.hasSelection() ) {
+    QApplication::clipboard()->setText( cur.selectedText() );
+    int startSelection = cur.selectionStart();
+    if ( startSelection < document()->end().previous().position() + PROMPT_SIZE )
+      startSelection = document()->end().previous().position() + PROMPT_SIZE;
+    int endSelection = cur.selectionEnd();
+    if ( endSelection < document()->end().previous().position() + PROMPT_SIZE )
+      endSelection = document()->end().previous().position() + PROMPT_SIZE;
+    cur.setPosition( startSelection );
+    cur.setPosition( endSelection, QTextCursor::KeepAnchor );
+    horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+    setTextCursor( cur );
+    textCursor().removeSelectedText();
+  }
+}
+
+/*!
+  \brief "Paste" operation.
+
+  Reimplemented from Qt.
+  Warning! In Qt4 this method is not virtual.
+ */
+void PyConsole_Editor::paste()
+{
+  QTextCursor cur = textCursor();
+  if ( cur.hasSelection() ) {
+    int startSelection = cur.selectionStart();
+    if ( startSelection < document()->end().previous().position() + PROMPT_SIZE )
+      startSelection = document()->end().previous().position() + PROMPT_SIZE;
+    int endSelection = cur.selectionEnd();
+    if ( endSelection < document()->end().previous().position() + PROMPT_SIZE )
+      endSelection = document()->end().previous().position() + PROMPT_SIZE;
+    cur.setPosition( startSelection );
+    cur.setPosition( endSelection, QTextCursor::KeepAnchor );
+    horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+    setTextCursor( cur );
+    textCursor().removeSelectedText();
+  }
+  if ( textCursor().position() < document()->end().previous().position() + PROMPT_SIZE )
+    moveCursor( QTextCursor::End );
+  QTextEdit::paste();
+}
+
+/*!
+  \brief "Clear" operation.
+
+  Reimplemented from Qt.
+  Warning! In Qt4 this method is not virtual.
+ */
+void PyConsole_Editor::clear()
+{
+  QTextEdit::clear();
+  addText( myBanner );
+  myPrompt = READY_PROMPT;
+  addText( myPrompt );
+}
diff --git a/src/PyConsole/PyConsole_Editor.h b/src/PyConsole/PyConsole_Editor.h
new file mode 100644 (file)
index 0000000..2f21fab
--- /dev/null
@@ -0,0 +1,83 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+// File   : PyConsole_Editor.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef PYCONSOLE_EDITOR_H
+#define PYCONSOLE_EDITOR_H
+
+#include "PyConsole.h"
+
+#include <QTextEdit>
+
+class PyConsole_Interp;
+class PyInterp_Request;
+class QEventLoop;
+
+class PYCONSOLE_EXPORT PyConsole_Editor : public QTextEdit
+{
+  Q_OBJECT;
+
+public:
+  PyConsole_Editor( PyConsole_Interp* theInterp, QWidget *theParent = 0 );
+  ~PyConsole_Editor();
+  
+  virtual void   addText( const QString& str, const bool newBlock = false ); 
+  bool           isCommand( const QString& str ) const;
+
+  virtual void   exec( const QString& command );
+  void           execAndWait( const QString& command );
+
+  bool           isSync() const;
+  void           setIsSync( const bool );
+
+protected:
+  virtual void   dropEvent( QDropEvent* event );
+  virtual void   mouseReleaseEvent( QMouseEvent* event );
+  virtual void   keyPressEvent ( QKeyEvent* event);
+  virtual void   customEvent( QEvent* event);
+
+  virtual PyInterp_Request* createRequest( const QString& );
+
+public slots:
+  void           cut();
+  void           paste();
+  void           clear();
+  void           handleReturn();
+  void           onPyInterpChanged( PyConsole_Interp* );
+  
+private:
+  PyConsole_Interp* myInterp;           //!< python interpreter
+
+  QString           myCommandBuffer;    //!< python comman buffer
+  QString           myCurrentCommand;   //!< currently being printed command
+  QString           myPrompt;           //!< current command line prompt
+  int               myCmdInHistory;     //!< current history command index
+  QStringList       myHistory;          //!< commands history buffer
+  QEventLoop*       myEventLoop;        //!< internal event loop
+  QString           myBanner;           //!< current banner
+  QStringList       myQueue;            //!< python commands queue
+  bool              myIsSync;           //!< synchronous mode flag
+};
+
+#endif // PYCONSOLE_EDITOR_H
diff --git a/src/PyConsole/PyConsole_Interp.cxx b/src/PyConsole/PyConsole_Interp.cxx
new file mode 100644 (file)
index 0000000..e915c18
--- /dev/null
@@ -0,0 +1,141 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  File   : PyConsole_Interp.cxx
+//  Author : Nicolas REJNERI
+//  Module : SALOME
+//
+#include "PyConsole_Interp.h"
+
+/*!
+  \class PyConsole_Interp
+  \brief Python interpreter to be embedded to the SALOME study's GUI.
+
+  Python interpreter is created one per SALOME study.
+
+  Call initialize method defined in the base class PyInterp_Interp,
+  to intialize interpreter after instance creation.
+
+  The method initialize() calls virtuals methods
+  - initPython()  to initialize global Python interpreter
+  - initState()   to initialize embedded interpreter state
+  - initContext() to initialize interpreter internal context
+  - initRun()     to prepare interpreter for running commands
+
+  /EDF-CCAR/
+  When SALOME uses multi Python interpreter feature, 
+  every study has its own interpreter and thread state (_tstate = Py_NewInterpreter()).
+  This is fine because every study has its own modules (sys.modules) stdout and stderr.
+
+  <b>But</b> some Python modules must be imported only once. In multi interpreter 
+  context Python modules (*.py) are imported several times.
+  For example, the PyQt module must be imported only once because 
+  it registers classes in a C module.
+
+  It's quite the same with omniorb modules (internals and generated with omniidl).
+
+  This problem is handled with "shared modules" defined in salome_shared_modules.py.
+  These "shared modules" are imported only once and only copied in all 
+  the other interpreters.
+
+  <b>But</b> it's not the only problem. Every interpreter has its own 
+  __builtin__ module. That's fine but if we have copied some modules 
+  and imported others problems may arise with operations that are not allowed
+  in restricted execution environment. So we must impose that all interpreters
+  have identical __builtin__ module.
+*/
+
+/*!
+  \brief Constructor.
+
+  Creates new python interpreter.
+*/
+PyConsole_Interp::PyConsole_Interp(): PyInterp_Interp()
+{
+}
+
+/*!
+  \brief Destructor.
+
+  Does nothing for the moment.
+*/
+PyConsole_Interp::~PyConsole_Interp()
+{
+}
+/*!
+  \brief Initialize internal Python interpreter state.
+  \return \c true on success
+*/
+bool PyConsole_Interp::initState()
+{
+  // The GIL is acquired and will be held on initState output
+  // It is the caller responsability to release the lock if needed
+  PyEval_AcquireLock();
+  _tstate = Py_NewInterpreter(); // create an interpreter and save current state
+  PySys_SetArgv(PyInterp_Interp::_argc,PyInterp_Interp::_argv); // initialize sys.argv
+  
+  if(!builtinmodule) // PAL18041: deepcopy function don't work in Salome
+  {
+    //builtinmodule is static member of PyInterp class
+    //If it is not NULL (initialized to the builtin module of the main interpreter
+    //all the sub interpreters will have the same builtin
+    //_interp is a static member and is the main interpreter
+    //The first time we initialized it to the builtin of main interpreter
+    builtinmodule=PyDict_GetItemString(_interp->modules, "__builtin__");
+  }
+
+  //If builtinmodule has been initialized all the sub interpreters
+  // will have the same __builtin__ module
+  if(builtinmodule){ 
+    PyObject *m = PyImport_GetModuleDict();
+    PyDict_SetItemString(m, "__builtin__", builtinmodule);
+    _tstate->interp->builtins = PyModule_GetDict(builtinmodule);
+    Py_INCREF(_tstate->interp->builtins);
+  }
+  PyEval_ReleaseThread(_tstate);
+  return true;
+}
+
+/*!
+  \brief Initialize python interpeter context.
+
+  The GIL is assumed to be held.
+  It is the caller responsability caller to acquire the GIL.
+  It will still be held on initContext() exit.
+
+  \return \c true on success
+*/
+bool PyConsole_Interp::initContext()
+{
+  PyObject *m = PyImport_AddModule("__main__");  // interpreter main module (module context)
+  if(!m){
+    PyErr_Print();
+    return false;
+  }  
+  _g = PyModule_GetDict(m);          // get interpreter dictionnary context
+
+  if(builtinmodule){
+    PyDict_SetItemString(_g, "__builtins__", builtinmodule); // assign singleton __builtin__ module
+  }
+  return true;
+}
diff --git a/src/PyConsole/PyConsole_Interp.h b/src/PyConsole/PyConsole_Interp.h
new file mode 100644 (file)
index 0000000..ec07b64
--- /dev/null
@@ -0,0 +1,45 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  File   : PyConsole_Interp.h
+//  Author : Nicolas REJNERI
+//  Module : SALOME
+//
+#ifndef PYCONSOLE_INTERP_H
+#define PYCONSOLE_INTERP_H
+
+#include "PyConsole.h"
+
+#include <PyInterp_Interp.h>   /// !!! WARNING !!! THIS INCLUDE MUST BE VERY FIRST !!!
+
+class PYCONSOLE_EXPORT PyConsole_Interp : public PyInterp_Interp
+{
+public:
+  PyConsole_Interp();
+  ~PyConsole_Interp();
+
+protected:
+  virtual bool initState();
+  virtual bool initContext();  
+};
+
+#endif // PYCONSOLE_INTERP_H
diff --git a/src/PyConsole/resources/PyConsole_msg_en.ts b/src/PyConsole/resources/PyConsole_msg_en.ts
new file mode 100644 (file)
index 0000000..3082168
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS><TS version="1.1">
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>PyConsole_Console</name>
+    <message>
+        <location filename="../PyConsole_Console.cxx" line="216"/>
+        <source>EDIT_COPY_CMD</source>
+        <translation>&amp;Copy</translation>
+    </message>
+    <message>
+        <location filename="../PyConsole_Console.cxx" line="221"/>
+        <source>EDIT_PASTE_CMD</source>
+        <translation>&amp;Paste</translation>
+    </message>
+    <message>
+        <location filename="../PyConsole_Console.cxx" line="226"/>
+        <source>EDIT_CLEAR_CMD</source>
+        <translation>Clea&amp;r</translation>
+    </message>
+    <message>
+        <location filename="../PyConsole_Console.cxx" line="231"/>
+        <source>EDIT_SELECTALL_CMD</source>
+        <translation>Select &amp;All</translation>
+    </message>
+</context>
+</TS>
index 9a783f209a1b7a9a091b3c1248cb1b4f06113105..0adfaf36488ec1c6842a218a6e6f0d7356f03747 100755 (executable)
@@ -1,43 +1,44 @@
-#  SALOME PyInterp : implementation of base thread-safe Python services
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOME PyInterp : implementation of base thread-safe Python services
 #  File   : Makefile.in
 #  Module : SALOME
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libPyInterp.la
 
-salomeinclude_HEADERS= \
-       PyInterp.h \
-       PyInterp_base.h \
+salomeinclude_HEADERS =                \
+       PyInterp.h              \
+       PyInterp_Interp.h       \
        PyInterp_Dispatcher.h
 
-dist_libPyInterp_la_SOURCES= \
-       PyInterp_base.cxx \
+dist_libPyInterp_la_SOURCES =  \
+       PyInterp_Interp.cxx     \
        PyInterp_Dispatcher.cxx
 
-MOC_FILES= PyInterp_Watcher_moc.cxx
-nodist_libPyInterp_la_SOURCES= $(MOC_FILES)
+MOC_FILES = PyInterp_Watcher_moc.cxx
+nodist_libPyInterp_la_SOURCES = $(MOC_FILES)
 
-libPyInterp_la_CPPFLAGS= $(PYTHON_INCLUDES) $(QT_INCLUDES)
-libPyInterp_la_LDFLAGS= $(PYTHON_LIBS) $(QT_MT_LIBS)
+libPyInterp_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) \
+       -I$(srcdir)/../Event
+libPyInterp_la_LDFLAGS  = $(PYTHON_LIBS) $(QT_MT_LIBS) ../Event/libEvent.la
index af9536fd88e7e9c2caafeca55e30800b27b9dfdb..f75022fc84e013de97953af3678971c06c448238 100755 (executable)
@@ -1,39 +1,41 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#if !defined ( _PYINTERP_H )
-#define _PYINTERP_H
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : PyInterp.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#if !defined ( PYINTERP_H )
+#define PYINTERP_H
 
 // ========================================================
 // set dllexport type for Win platform 
-#ifdef WNT
-
-#ifdef PYINTERP_EXPORTS
-#define PYINTERP_EXPORT __declspec(dllexport)
-#else
-#define PYINTERP_EXPORT __declspec(dllimport)
-#endif
-
-#else   // WNT
-
-#define PYINTERP_EXPORT
-
-#endif  // WNT
+#ifdef WIN32
+# ifdef PYINTERP_EXPORTS
+#  define PYINTERP_EXPORT __declspec(dllexport)
+# else
+#  define PYINTERP_EXPORT __declspec(dllimport)
+# endif
+#else   // WIN32
+# define PYINTERP_EXPORT
+#endif  // WIN32
 
 // ========================================================
 // little trick - if we do not have debug python libraries
@@ -53,9 +55,9 @@
 
 // ========================================================
 // avoid warning messages
-#ifdef WNT
+#ifdef WIN32
 #pragma warning (disable : 4786)
 #pragma warning (disable : 4251)
 #endif
 
-#endif // _PYINTERP_H
+#endif // PYINTERP_H
diff --git a/src/PyInterp/PyInterp.pro b/src/PyInterp/PyInterp.pro
new file mode 100644 (file)
index 0000000..eb36ba2
--- /dev/null
@@ -0,0 +1,54 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = PyInterp
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+PYTHONVER=2.4
+PYTHONHOME=$$(PYTHONHOME)
+PYTHONINC=$${PYTHONHOME}/include/python$${PYTHONVER}
+PYTHONLIB=$${PYTHONHOME}/lib
+
+INCLUDEPATH += ../../include $${PYTHONINC}
+unix:LIBS  += -L$${PYTHONLIB} -lpython$${PYTHONVER}
+win32:LIBS += /LIBPATH:$${PYTHONLIB}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += PYINTERP_EXPORTS
+
+HEADERS  = PyInterp.h
+HEADERS += PyInterp_Dispatcher.h
+HEADERS += PyInterp_Watcher.h
+HEADERS += PyInterp_Interp.h
+
+SOURCES  = PyInterp_Dispatcher.cxx
+SOURCES += PyInterp_Interp.cxx
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+INSTALLS += includes
index dd029a25bd64a04e6086e128134b982267c980a6..ff7881ee18f62c2a5dc9d0b170c778367ec31e18 100755 (executable)
@@ -1,37 +1,48 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : PyInterp_Dispatcher.cxx
 //  Author : Sergey ANIKIN, OCC
 //  Module : GUI
-//  $Header$
-
-
-#include <PyInterp_base.h>
-#include <PyInterp_Dispatcher.h>
-#include <PyInterp_Watcher.h>
-
-#include <qapplication.h>
-#include <qobject.h>
+//
+#include "PyInterp_Dispatcher.h"   // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
+#include "PyInterp_Interp.h"
+#include "PyInterp_Watcher.h"
+#include <SALOME_Event.h>
+
+#include <QObject>
+#include <QCoreApplication>
+
+class PyInterp_ExecuteEvent: public SALOME_Event
+{
+public:
+  PyInterp_Request* myRequest;
+  PyInterp_ExecuteEvent( PyInterp_Request* r )
+    : myRequest( r ) {}
+  virtual void Execute()
+  {
+    myRequest->execute();
+  }
+};
 
-//#include <utilities.h>
 using namespace std;
 
 PyInterp_Dispatcher* PyInterp_Dispatcher::myInstance = 0;
@@ -40,15 +51,21 @@ void PyInterp_Request::process()
 {
   safeExecute();
 
-  myMutex.lock();
-  //if ( !IsSync() && getListener() && getEvent() )
-  if ( getListener() && getEvent() )
-    postEvent();
-  myMutex.unlock();
+  bool isSync = IsSync();
+
+  if ( !isSync )
+    myMutex.lock();
+
+  if ( listener() )
+    processEvent( listener() );
+
+  if ( !isSync )
+    myMutex.unlock();
 }
 
 void PyInterp_Request::safeExecute()
 {
+  //ProcessVoidEvent( new PyInterp_ExecuteEvent( this ) );
   execute();
 }
 
@@ -62,26 +79,25 @@ void PyInterp_Request::Destroy( PyInterp_Request* request )
 
 QEvent* PyInterp_Request::createEvent() const
 {
-  return new PyInterp_Event( PyInterp_Event::NOTIFY, (PyInterp_Request*)this );
+  return new PyInterp_Event( PyInterp_Event::ES_NOTIFY, (PyInterp_Request*)this );
 }
 
-QEvent* PyInterp_Request::getEvent()
+void PyInterp_Request::processEvent( QObject* o )
 {
-  //if ( !myEvent && !IsSync() )
-  if ( !myEvent )
-    myEvent = createEvent();
-  return myEvent;
-}
+  if ( !o )
+    return;
 
-void PyInterp_Request::postEvent()
-{
-#if QT_VERSION >= 0x030303
-//  MESSAGE("*** PyInterp_Request::postEvent(): for Qt 3.3.3")
-  QApplication::postEvent( getListener(), getEvent() );
-#else
-//  MESSAGE("*** PyInterp_Request::postEvent(): for Qt 3.0.5")
-  QThread::postEvent( getListener(), getEvent() );
-#endif
+  QEvent* e = createEvent();
+  if ( !e )
+    return;
+
+  if ( !IsSync() )
+    QCoreApplication::postEvent( o, e );
+  else
+  {
+    QCoreApplication::sendEvent( o, e );
+    delete e;
+  }
 }
 
 void PyInterp_Request::setListener( QObject* o )
@@ -95,6 +111,7 @@ void PyInterp_LockRequest::safeExecute()
 {
   if ( getInterp() ){
     PyLockWrapper aLock = getInterp()->GetLockWrapper();
+    //ProcessVoidEvent( new PyInterp_ExecuteEvent( this ) );
     execute();
   }
 }
@@ -123,8 +140,9 @@ PyInterp_Dispatcher::~PyInterp_Dispatcher()
   // Clear the request queue
   myQueueMutex.lock();
 
-  for ( std::list<PyInterp_Request*>::iterator it = myQueue.begin(); it != myQueue.end(); ++it )
-    PyInterp_Request::Destroy( *it );
+  QListIterator<RequestPtr> it( myQueue );
+  while ( it.hasNext() )
+    PyInterp_Request::Destroy( it.next() );
   myQueue.clear();
 
   myQueueMutex.unlock();
@@ -138,7 +156,7 @@ PyInterp_Dispatcher::~PyInterp_Dispatcher()
 
 bool PyInterp_Dispatcher::IsBusy() const
 {
-  return running();
+  return isRunning();
 }
 
 void PyInterp_Dispatcher::Exec( PyInterp_Request* theRequest )
@@ -149,11 +167,12 @@ void PyInterp_Dispatcher::Exec( PyInterp_Request* theRequest )
   //if ( theRequest->IsSync() && !IsBusy() ) // synchronous processing - nothing is done if dispatcher is busy!
   if ( theRequest->IsSync() ) // synchronous processing - nothing is done if dispatcher is busy!
     processRequest( theRequest );
-  else { // asynchronous processing
+  else // asynchronous processing
+  {
     myQueueMutex.lock();
-    myQueue.push_back( theRequest );
-    if ( theRequest->getListener() )
-      QObject::connect( theRequest->getListener(), SIGNAL( destroyed( QObject* ) ), myWatcher, SLOT( onDestroyed( QObject* ) ) );
+    myQueue.enqueue( theRequest );
+    if ( theRequest->listener() )
+      QObject::connect( theRequest->listener(), SIGNAL( destroyed( QObject* ) ), myWatcher, SLOT( onDestroyed( QObject* ) ) );
     myQueueMutex.unlock();  
 
     if ( !IsBusy() )
@@ -171,7 +190,7 @@ void PyInterp_Dispatcher::run()
 
   while( myQueue.size() ) {
 //    MESSAGE("*** PyInterp_Dispatcher::run(): next request taken from the queue")
-    aRequest = myQueue.front();
+    aRequest = myQueue.head();
 
     // let other threads append their requests to the end of the queue
     myQueueMutex.unlock();
@@ -183,8 +202,8 @@ void PyInterp_Dispatcher::run()
     // prepare for removal of the first request in the queue
     myQueueMutex.lock();
     // IMPORTANT: the first item could have been removed by objectDestroyed() --> we have to check it
-    if ( myQueue.front() == aRequest ) // It's still here --> remove it
-      myQueue.pop_front();
+    if ( myQueue.head() == aRequest ) // It's still here --> remove it
+      myQueue.dequeue();
 
 //    MESSAGE("*** PyInterp_Dispatcher::run(): request processed")
   }
@@ -203,13 +222,16 @@ void PyInterp_Dispatcher::objectDestroyed( const QObject* o )
   // prepare for modification of the queue
   myQueueMutex.lock();
 
-  for ( std::list<RequestPtr>::iterator it = myQueue.begin(); it != myQueue.end(); ++it ){
-    if ( o == (*it)->getListener() ){
-      (*it)->setListener( 0 ); // to prevent event posting
-      it = myQueue.erase( it );
+  QMutableListIterator<RequestPtr> it( myQueue );
+  while ( it.hasNext() )
+  {
+    RequestPtr r = it.next();
+    if ( o == r->listener() )
+    {
+      r->setListener( 0 ); // to prevent event posting
+      it.remove();
     }
   }
 
   myQueueMutex.unlock();
 }
-
index 311c9e66f70499cd95bdfecd73662c27e92f5e32..cd970dd0fc025c9ddcd5f458c4e2eff5b4bf7ba0 100755 (executable)
@@ -1,57 +1,60 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : PyInterp_Dispatcher.h
 //  Author : Sergey Anikin, OCC
 //  Module : SALOME
+//
+#ifndef PYINTERP_DISPATCHER_H
+#define PYINTERP_DISPATCHER_H
 
-#ifndef _PYINTERP_DISPATCHER_H_
-#define _PYINTERP_DISPATCHER_H_
-
-#include "PyInterp.h"
-
-#include <qthread.h>
-#include <qevent.h>
+#include "PyInterp.h"   // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
 
-#include <list>
+#include <QMutex>
+#include <QThread>
+#include <QEvent>
+#include <QQueue>
 
 class QObject;
 
-class PyInterp_base;
+class PyInterp_Interp;
 class PyInterp_Watcher;
 class PyInterp_Dispatcher;
+class PyInterp_ExecuteEvent;
 
 class PYINTERP_EXPORT PyInterp_Request
 {
   friend class PyInterp_Dispatcher;
+  friend class PyInterp_ExecuteEvent;
 
   PyInterp_Request();
   PyInterp_Request( const PyInterp_Request& );
 
 protected:
-  virtual         ~PyInterp_Request() {}; 
+  virtual ~PyInterp_Request() {};
   // protected destructor - to control deletion of requests
 
 public:
   PyInterp_Request( QObject* listener, bool sync = false )
-    : myIsSync( sync ), myListener( listener ), myEvent( 0 ) {};
+    : myIsSync( sync ), myListener( listener ) {};
 
   static void     Destroy( PyInterp_Request* );
   // Deletes a request
@@ -69,45 +72,46 @@ protected:
   virtual QEvent* createEvent() const;
   // This method can be overridden to customize notification event creation
 
+  virtual void    processEvent( QObject* );
+
+  QObject*        listener() const { return myListener; }
+  void            setListener( QObject* );
+
 private:
   void            process();
-  QObject*        getListener() const { return myListener; }
-  void            setListener( QObject* );
-  QEvent*         getEvent();
-  void            postEvent();
 
 private:
+  QMutex          myMutex;
   bool            myIsSync;
   QObject*        myListener;
-  QEvent*         myEvent;
-  QMutex          myMutex;
 };
 
 class PYINTERP_EXPORT PyInterp_LockRequest : public PyInterp_Request
 {
 public:
-  PyInterp_LockRequest( PyInterp_base* interp, QObject* listener = 0, bool sync = false )
+  PyInterp_LockRequest( PyInterp_Interp* interp, QObject* listener = 0, bool sync = false )
     : PyInterp_Request( listener, sync ), myInterp( interp ) {}
 
 protected:
-  PyInterp_base*  getInterp() const { return myInterp; }
+  PyInterp_Interp*  getInterp() const { return myInterp; }
 
-  virtual void    safeExecute();
+  virtual void      safeExecute();
 
 private:
-  PyInterp_base*  myInterp;
+  PyInterp_Interp*  myInterp;
 };
 
-class PYINTERP_EXPORT PyInterp_Event : public QCustomEvent
+class PYINTERP_EXPORT PyInterp_Event : public QEvent
 {
   PyInterp_Event();
   PyInterp_Event( const PyInterp_Event& );
 
 public:
-  enum { NOTIFY = QEvent::User + 5000, OK, ERROR, INCOMPLETE, LAST };
+  //Execution state
+  enum { ES_NOTIFY = QEvent::User + 5000, ES_OK, ES_ERROR, ES_INCOMPLETE, ES_LAST };
 
   PyInterp_Event( int type, PyInterp_Request* request )
-    : QCustomEvent( (QEvent::Type)type ), myRequest( request ) {}
+    : QEvent( (QEvent::Type)type ), myRequest( request ) {}
 
   virtual ~PyInterp_Event();
 
@@ -138,7 +142,7 @@ private:
 private:
   typedef PyInterp_Request*   RequestPtr;
 
-  std::list<RequestPtr>       myQueue;
+  QQueue<RequestPtr>          myQueue;
   QMutex                      myQueueMutex;
   PyInterp_Watcher*           myWatcher;
 
@@ -147,4 +151,4 @@ private:
   friend class PyInterp_Watcher;
 };
 
-#endif
+#endif // PYINTERP_DISPATCHER_H
diff --git a/src/PyInterp/PyInterp_Interp.cxx b/src/PyInterp/PyInterp_Interp.cxx
new file mode 100644 (file)
index 0000000..3960bb8
--- /dev/null
@@ -0,0 +1,457 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  File   : PyInterp_Interp.cxx
+//  Author : Christian CAREMOLI, Paul RASCLE, EDF
+//  Module : SALOME
+//
+#include "PyInterp_Interp.h"  // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
+
+#include <cStringIO.h>
+#include <structmember.h>
+
+#include <string>
+#include <vector>
+#include <iostream>
+
+#define TOP_HISTORY_PY   "--- top of history ---"
+#define BEGIN_HISTORY_PY "--- begin of history ---"
+
+/*!
+  \class PyLockWrapper
+  \brief Python GIL wrapper.
+*/
+
+/*!
+  \brief Constructor. Automatically acquires GIL.
+  \param theThreadState python thread state
+*/
+PyLockWrapper::PyLockWrapper(PyThreadState* theThreadState): 
+  myThreadState(theThreadState),
+  mySaveThreadState(0)
+{
+  if (myThreadState->interp == PyInterp_Interp::_interp)
+    _savestate = PyGILState_Ensure();
+  else
+    PyEval_AcquireThread(myThreadState);
+}
+
+/*!
+  \brief Desstructor. Automatically releases GIL.
+*/
+PyLockWrapper::~PyLockWrapper()
+{
+  if (myThreadState->interp == PyInterp_Interp::_interp)
+    PyGILState_Release(_savestate);
+  else
+    PyEval_ReleaseThread(myThreadState);
+}
+
+/*!
+  \brief Get Python GIL wrapper.
+  \return GIL lock wrapper (GIL is automatically acquired here)
+*/
+PyLockWrapper PyInterp_Interp::GetLockWrapper()
+{
+  return _tstate;
+}
+
+/*
+  The following functions are used to hook the Python 
+  interpreter output.
+*/
+
+static void
+PyStdOut_dealloc(PyStdOut *self)
+{
+  PyObject_Del(self);
+}
+
+static PyObject*
+PyStdOut_write(PyStdOut *self, PyObject *args)
+{
+  char *c;
+  int l;
+  if (!PyArg_ParseTuple(args, "t#:write",&c, &l))
+    return NULL;
+  if(self->_cb==NULL) {
+    if ( self->_iscerr )
+      std::cerr << c ;
+    else
+      std::cout << c ;
+  }
+  else {
+    self->_cb(self->_data,c);
+  }
+  Py_INCREF(Py_None);
+  return Py_None;
+}
+
+static PyMethodDef PyStdOut_methods[] = {
+  {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS,
+    PyDoc_STR("write(string) -> None")},
+  {NULL,    NULL}   /* sentinel */
+};
+
+static PyMemberDef PyStdOut_memberlist[] = {
+  {"softspace", T_INT,  offsetof(PyStdOut, softspace), 0,
+   "flag indicating that a space needs to be printed; used by print"},
+  {NULL} /* Sentinel */
+};
+
+static PyTypeObject PyStdOut_Type = {
+  /* The ob_type field must be initialized in the module init function
+   * to be portable to Windows without using C++. */
+  PyObject_HEAD_INIT(NULL)
+  0,                            /*ob_size*/
+  "PyOut",                      /*tp_name*/
+  sizeof(PyStdOut),             /*tp_basicsize*/
+  0,                            /*tp_itemsize*/
+  /* methods */
+  (destructor)PyStdOut_dealloc, /*tp_dealloc*/
+  0,                            /*tp_print*/
+  0,                            /*tp_getattr*/
+  0,                            /*tp_setattr*/
+  0,                            /*tp_compare*/
+  0,                            /*tp_repr*/
+  0,                            /*tp_as_number*/
+  0,                            /*tp_as_sequence*/
+  0,                            /*tp_as_mapping*/
+  0,                            /*tp_hash*/
+  0,                            /*tp_call*/
+  0,                            /*tp_str*/
+  PyObject_GenericGetAttr,      /*tp_getattro*/
+  /* softspace is writable:  we must supply tp_setattro */
+  PyObject_GenericSetAttr,      /* tp_setattro */
+  0,                            /*tp_as_buffer*/
+  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
+  0,                            /*tp_doc*/
+  0,                            /*tp_traverse*/
+  0,                            /*tp_clear*/
+  0,                            /*tp_richcompare*/
+  0,                            /*tp_weaklistoffset*/
+  0,                            /*tp_iter*/
+  0,                            /*tp_iternext*/
+  PyStdOut_methods,             /*tp_methods*/
+  PyStdOut_memberlist,          /*tp_members*/
+  0,                            /*tp_getset*/
+  0,                            /*tp_base*/
+  0,                            /*tp_dict*/
+  0,                            /*tp_descr_get*/
+  0,                            /*tp_descr_set*/
+  0,                            /*tp_dictoffset*/
+  0,                            /*tp_init*/
+  0,                            /*tp_alloc*/
+  0,                            /*tp_new*/
+  0,                            /*tp_free*/
+  0,                            /*tp_is_gc*/
+};
+
+#define PyStdOut_Check(v)  ((v)->ob_type == &PyStdOut_Type)
+
+static PyStdOut* newPyStdOut( bool iscerr )
+{
+  PyStdOut *self;
+  self = PyObject_New(PyStdOut, &PyStdOut_Type);
+  if (self == NULL)
+    return NULL;
+  self->softspace = 0;
+  self->_cb = NULL;
+  self->_iscerr = iscerr;
+  return self;
+}
+
+/*!
+  \class PyInterp_Interp
+  \brief Generic embedded Python interpreter.
+*/
+
+int   PyInterp_Interp::_argc   = 1;
+char* PyInterp_Interp::_argv[] = {""};
+PyObject*           PyInterp_Interp::builtinmodule = NULL;
+PyThreadState*      PyInterp_Interp::_gtstate      = NULL;
+PyInterpreterState* PyInterp_Interp::_interp       = NULL;
+
+/*!
+  \brief Basic constructor.
+  
+  After construction the interpreter instance successor classes 
+  must call virtual method initalize().
+*/
+PyInterp_Interp::PyInterp_Interp(): 
+  _tstate(0), _vout(0), _verr(0), _g(0)
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+PyInterp_Interp::~PyInterp_Interp()
+{
+}
+
+/*!
+  \brief Initialize embedded interpreter.
+  
+  This method shoud be called after construction of the interpreter.
+  The method initialize() calls virtuals methods
+  - initPython()  to initialize global Python interpreter
+  - initState()   to initialize embedded interpreter state
+  - initContext() to initialize interpreter internal context
+  - initRun()     to prepare interpreter for running commands
+  which should be implemented in the successor classes, according to the
+  embedded Python interpreter policy (mono or multi interpreter, etc).
+*/
+void PyInterp_Interp::initialize()
+{
+  _history.clear();       // start a new list of user's commands 
+  _ith = _history.begin();
+
+  initPython();
+  // Here the global lock is released
+
+  initState();
+
+  PyLockWrapper aLock = GetLockWrapper();
+
+  initContext();
+
+  // used to interpret & compile commands
+  PyObjWrapper m(PyImport_ImportModule("codeop"));
+  if(!m) {
+    PyErr_Print();
+    return;
+  }
+
+  // Create python objects to capture stdout and stderr
+  _vout=(PyObject*)newPyStdOut( false ); // stdout 
+  _verr=(PyObject*)newPyStdOut( true );  // stderr
+
+  // All the initRun outputs are redirected to the standard output (console)
+  initRun();
+}
+
+/*!
+  \brief Initialize Python interpreter.
+
+  In case if Python is not initialized, it sets program name, initializes the interpreter, sets program arguments,
+  initializes threads. 
+  Otherwise, it just obtains the global interpreter and thread states. This is important for light SALOME configuration, 
+  as in full SALOME this is done at SalomeApp level.
+  \sa SalomeApp_PyInterp class
+ */
+void PyInterp_Interp::initPython()
+{
+  if (!Py_IsInitialized()){
+    // Python is not initialized
+    Py_SetProgramName(_argv[0]);
+    Py_Initialize(); // Initialize the interpreter
+    PySys_SetArgv(_argc, _argv);
+    PyEval_InitThreads(); // Create (and acquire) the interpreter lock
+  }
+
+  if ( _interp == NULL )
+    _interp = PyThreadState_Get()->interp;
+  if (PyType_Ready(&PyStdOut_Type) < 0) {
+    PyErr_Print();
+  }
+  if ( _gtstate == NULL )
+    _gtstate = PyEval_SaveThread(); // Release global thread state
+}
+
+/*!
+  \brief Get embedded Python interpreter banner.
+  \return banner string
+ */
+std::string PyInterp_Interp::getbanner()
+{
+ // Should we take the lock ?
+ // PyEval_RestoreThread(_tstate);
+  std::string aBanner("Python ");
+  aBanner = aBanner + Py_GetVersion() + " on " + Py_GetPlatform() ;
+  aBanner = aBanner + "\ntype help to get general information on environment\n";
+  //PyEval_SaveThread();
+  return aBanner;
+}
+
+/*!
+  \brief Initialize run command.
+  This method is used to prepare interpreter for running 
+  Python commands.
+  
+  \return \c true on success and \c false on error
+*/
+bool PyInterp_Interp::initRun()
+{
+  // 
+  // probably all below code isn't required
+  //
+  /*
+  PySys_SetObject("stderr",_verr);
+  PySys_SetObject("stdout",_vout);
+
+  //PyObject *m = PyImport_GetModuleDict();
+  
+  PySys_SetObject("stdout",PySys_GetObject("__stdout__"));
+  PySys_SetObject("stderr",PySys_GetObject("__stderr__"));
+  */
+  return true;
+}
+
+/*!
+  \brief Compile Python command and evaluate it in the 
+         python dictionary context if possible.
+  \internal
+  \param command Python command string
+  \param context Python context (dictionary)
+  \return -1 on fatal error, 1 if command is incomplete and 0
+         if command is executed successfully
+ */
+static int compile_command(const char *command,PyObject *context)
+{
+  PyObject *m = PyImport_AddModule("codeop");
+  if(!m) { // Fatal error. No way to go on.
+    PyErr_Print();
+    return -1;
+  }
+  PyObjWrapper v(PyObject_CallMethod(m,"compile_command","s",command));
+  if(!v) {
+    // Error encountered. It should be SyntaxError,
+    //so we don't write out traceback
+    PyObjWrapper exception, value, tb;
+    PyErr_Fetch(&exception, &value, &tb);
+    PyErr_NormalizeException(&exception, &value, &tb);
+    PyErr_Display(exception, value, NULL);
+    return -1;
+  }
+  else if (v == Py_None) {
+    // Incomplete text we return 1 : we need a complete text to execute
+    return 1;
+  }
+  else {
+    // Complete and correct text. We evaluate it.
+    //#if PY_VERSION_HEX < 0x02040000 // python version earlier than 2.4.0
+    //    PyObjWrapper r(PyEval_EvalCode(v,context,context));
+    //#else
+    PyObjWrapper r(PyEval_EvalCode((PyCodeObject *)(void *)v,context,context));
+    //#endif
+    if(!r) {
+      // Execution error. We return -1
+      PyErr_Print();
+      return -1;
+    }
+    // The command has been successfully executed. Return 0
+    return 0;
+  }
+}
+
+/*!
+  \brief Run Python command.
+  \param command Python command
+  \return command status
+*/
+int PyInterp_Interp::run(const char *command)
+{
+  beforeRun();
+  return simpleRun(command);
+}
+
+/*!
+  \brief Run Python command (used internally).
+  \param command Python command
+  \param addToHistory if \c true (default), the command is added to the commands history
+  \return command status
+*/
+int PyInterp_Interp::simpleRun(const char *command, const bool addToHistory)
+{
+  if( addToHistory && strcmp(command,"") != 0 ) {
+    _history.push_back(command);
+    _ith = _history.end();
+  }
+
+  // We come from C++ to enter Python world
+  // We need to acquire the Python global lock
+  //PyLockWrapper aLock(_tstate); // san - lock is centralized now
+
+  // Reset redirected outputs before treatment
+  PySys_SetObject("stderr",_verr);
+  PySys_SetObject("stdout",_vout);
+
+  int ier = compile_command(command,_g);
+
+  // Outputs are redirected on standards outputs (console)
+  PySys_SetObject("stdout",PySys_GetObject("__stdout__"));
+  PySys_SetObject("stderr",PySys_GetObject("__stderr__"));
+
+  return ier;
+}
+
+/*!
+  \brief Get previous command in the commands history.
+  \return previous command
+*/
+const char * PyInterp_Interp::getPrevious()
+{
+  if(_ith != _history.begin()){
+    _ith--;
+    return (*_ith).c_str();
+  }
+  else
+    return BEGIN_HISTORY_PY;
+}
+
+/*!
+  \brief Get next command in the commands history.
+  \return next command
+*/
+const char * PyInterp_Interp::getNext()
+{
+  if(_ith != _history.end()){
+    _ith++;
+  }
+  if (_ith == _history.end())
+    return TOP_HISTORY_PY;
+  else
+    return (*_ith).c_str();
+}
+
+/*!
+  \brief Set Python standard output device hook.
+  \param cb callback function
+  \param data callback function parameters
+*/
+void PyInterp_Interp::setvoutcb(PyOutChanged* cb, void* data)
+{  
+  ((PyStdOut*)_vout)->_cb=cb;
+  ((PyStdOut*)_vout)->_data=data;
+}
+
+/*!
+  \brief Set Python standard error device hook.
+  \param cb callback function
+  \param data callback function parameters
+*/
+void PyInterp_Interp::setverrcb(PyOutChanged* cb, void* data)
+{  
+  ((PyStdOut*)_verr)->_cb=cb;
+  ((PyStdOut*)_verr)->_data=data;
+}
diff --git a/src/PyInterp/PyInterp_Interp.h b/src/PyInterp/PyInterp_Interp.h
new file mode 100644 (file)
index 0000000..32fadb6
--- /dev/null
@@ -0,0 +1,119 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  File   : PyInterp_Interp.h
+//  Author : Christian CAREMOLI, Paul RASCLE, EDF
+//  Module : SALOME
+//
+#ifndef PYINTERP_INTERP_H
+#define PYINTERP_INTERP_H
+
+#include "PyInterp.h"   // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
+
+#include <list>
+#include <string>
+
+class PYINTERP_EXPORT PyLockWrapper
+{
+  PyThreadState* myThreadState;
+  PyThreadState* mySaveThreadState;
+  PyGILState_STATE _savestate;
+public:
+  PyLockWrapper(PyThreadState* theThreadState);
+  ~PyLockWrapper();
+};
+
+typedef void PyOutChanged(void* data,char * c);
+
+class PYINTERP_EXPORT PyInterp_Interp
+{
+public:
+  static int _argc;
+  static char* _argv[];
+  static PyObject *builtinmodule;
+  static PyThreadState *_gtstate;
+  static PyInterpreterState *_interp;
+  
+  PyInterp_Interp();
+  virtual ~PyInterp_Interp();
+  
+  void initialize();
+
+  virtual int run(const char *command); 
+
+  PyLockWrapper GetLockWrapper();
+
+  std::string getbanner(); 
+  void setverrcb(PyOutChanged*,void*);
+  void setvoutcb(PyOutChanged*,void*);
+
+  const char * getPrevious();
+  const char * getNext();    
+
+protected:
+  PyThreadState * _tstate;
+  PyObject * _vout;
+  PyObject * _verr;
+  PyObject * _g;
+  PyObject * _codeop;
+  std::list<std::string> _history;
+  std::list<std::string>::iterator _ith;
+
+  virtual int beforeRun() { return 0; }
+  int simpleRun(const char* command, const bool addToHistory = true);
+
+  virtual bool initRun();
+  virtual void initPython();
+  virtual bool initState() = 0;
+  virtual bool initContext() = 0;  
+};
+
+class PYINTERP_EXPORT PyObjWrapper
+{
+  PyObject* myObject;
+public:
+  PyObjWrapper(PyObject* theObject) : myObject(theObject) {}
+  PyObjWrapper() : myObject(0) {}
+  virtual ~PyObjWrapper() { Py_XDECREF(myObject); }
+
+  operator PyObject*()    { return myObject;  }
+  PyObject* operator->()  { return myObject;  }
+  PyObject* get()         { return myObject;  }
+  bool operator!()        { return !myObject; }
+  bool operator==(PyObject* theObject) { return myObject == theObject; }
+  PyObject** operator&()  { return &myObject; }
+  PyObjWrapper& operator=(PyObjWrapper* theObjWrapper)
+  {
+    Py_XDECREF(myObject);
+    myObject = theObjWrapper->myObject;
+    return *this;
+  }
+};
+
+typedef struct {
+  PyObject_HEAD
+  int softspace;
+  PyOutChanged* _cb;
+  void* _data;
+  bool _iscerr;
+} PyStdOut;
+
+#endif // PYINTERP_INTERP_H
index 551eca7d023738a7086cc7b9761ecd4f959f2bb5..ffa8d8e9afd7c02ed789cb1a88bc137e38811e21 100755 (executable)
@@ -1,29 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#ifndef _PYINTERP_WATCHER_H_
-#define _PYINTERP_WATCHER_H_
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  File   : PyInterp_Watcher.h
+//  Author : Sergey Anikin, OCC
+//  Module : SALOME
+//
+#ifndef PYINTERP_WATCHER_H
+#define PYINTERP_WATCHER_H
 
-#include <PyInterp.h>
+#include "PyInterp.h"   // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
 
-#include <PyInterp_Dispatcher.h>
+#include "PyInterp_Dispatcher.h"
 
-#include <qobject.h>
+#include <QObject>
 
 // Private class that keeps track of destructions of request listeners
 class PYINTERP_EXPORT PyInterp_Watcher : public QObject
@@ -38,4 +45,4 @@ public slots:
   void onDestroyed( QObject* o ) { PyInterp_Dispatcher::Get()->objectDestroyed( o ); }
 };
 
-#endif // _PYINTERP_WATCHER_H_
+#endif // PYINTERP_WATCHER_H
diff --git a/src/PyInterp/PyInterp_base.cxx b/src/PyInterp/PyInterp_base.cxx
deleted file mode 100644 (file)
index d2a8557..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-//
-//  File   : PyInterp_base.cxx
-//  Author : Christian CAREMOLI, Paul RASCLE, EDF
-//  Module : SALOME
-//  $Header$
-
-
-#include <string>
-#include <vector>
-
-#include "PyInterp_base.h" // this include must be first (see PyInterp_base.h)!
-#include <cStringIO.h>
-#include <structmember.h>
-
-using namespace std;
-
-PyLockWrapper::PyLockWrapper(PyThreadState* theThreadState): 
-  myThreadState(theThreadState),
-  mySaveThreadState(0)
-{
-#if defined(USE_GILSTATE)
-  if (myThreadState->interp == PyInterp_base::_interp) {
-    _savestate = PyGILState_Ensure();
-  } else {
-    PyEval_AcquireThread(myThreadState);
-  }
-#else 
-  PyEval_AcquireThread(myThreadState);
-#endif
-}
-
-PyLockWrapper::~PyLockWrapper()
-{
-#if defined(USE_GILSTATE)
-  if (myThreadState->interp == PyInterp_base::_interp) {
-    PyGILState_Release(_savestate);
-  } else {
-    PyEval_ReleaseThread(myThreadState);
-  }
-#else 
-  PyEval_ReleaseThread(myThreadState);
-#endif
-}
-
-class PyReleaseLock{
-public:
-  ~PyReleaseLock(){
-    PyEval_ReleaseLock();
-  }
-};
-
-
-PyLockWrapper PyInterp_base::GetLockWrapper(){
-  return _tstate;
-}
-
-static void
-PyStdOut_dealloc(PyStdOut *self)
-{
-  PyObject_Del(self);
-}
-
-static PyObject *
-PyStdOut_write(PyStdOut *self, PyObject *args)
-{
-  char *c;
-  int l;
-  if (!PyArg_ParseTuple(args, "t#:write",&c, &l))
-    return NULL;
-  if(self->_cb==NULL) {
-    if ( self->_iscerr )
-      std::cerr << c ;
-    else
-      std::cout << c ;
-  }
-  else {
-    self->_cb(self->_data,c);
-  }
-  Py_INCREF(Py_None);
-  return Py_None;
-}
-
-static PyMethodDef PyStdOut_methods[] = {
-  {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS,
-    PyDoc_STR("write(string) -> None")},
-  {NULL,    NULL}   /* sentinel */
-};
-
-static PyMemberDef PyStdOut_memberlist[] = {
-  {"softspace", T_INT,  offsetof(PyStdOut, softspace), 0,
-   "flag indicating that a space needs to be printed; used by print"},
-  {NULL} /* Sentinel */
-};
-
-
-
-static PyTypeObject PyStdOut_Type = {
-  /* The ob_type field must be initialized in the module init function
-   * to be portable to Windows without using C++. */
-  PyObject_HEAD_INIT(NULL)
-  0,      /*ob_size*/
-  "PyOut",   /*tp_name*/
-  sizeof(PyStdOut),  /*tp_basicsize*/
-  0,      /*tp_itemsize*/
-  /* methods */
-  (destructor)PyStdOut_dealloc, /*tp_dealloc*/
-  0,      /*tp_print*/
-  0, /*tp_getattr*/
-  0, /*tp_setattr*/
-  0,      /*tp_compare*/
-  0,      /*tp_repr*/
-  0,      /*tp_as_number*/
-  0,      /*tp_as_sequence*/
-  0,      /*tp_as_mapping*/
-  0,      /*tp_hash*/
-        0,                      /*tp_call*/
-        0,                      /*tp_str*/
-        PyObject_GenericGetAttr,                      /*tp_getattro*/
-        /* softspace is writable:  we must supply tp_setattro */
-        PyObject_GenericSetAttr,    /* tp_setattro */
-        0,                      /*tp_as_buffer*/
-        Py_TPFLAGS_DEFAULT,     /*tp_flags*/
-        0,                      /*tp_doc*/
-        0,                      /*tp_traverse*/
-        0,                      /*tp_clear*/
-        0,                      /*tp_richcompare*/
-        0,                      /*tp_weaklistoffset*/
-        0,                      /*tp_iter*/
-        0,                      /*tp_iternext*/
-        PyStdOut_methods,                      /*tp_methods*/
-        PyStdOut_memberlist,                      /*tp_members*/
-        0,                      /*tp_getset*/
-        0,                      /*tp_base*/
-        0,                      /*tp_dict*/
-        0,                      /*tp_descr_get*/
-        0,                      /*tp_descr_set*/
-        0,                      /*tp_dictoffset*/
-        0,                      /*tp_init*/
-        0,                      /*tp_alloc*/
-        0,                      /*tp_new*/
-        0,                      /*tp_free*/
-        0,                      /*tp_is_gc*/
-};
-
-
-#define PyStdOut_Check(v)  ((v)->ob_type == &PyStdOut_Type)
-
-static PyStdOut * newPyStdOut( bool iscerr )
-{
-  PyStdOut *self;
-  self = PyObject_New(PyStdOut, &PyStdOut_Type);
-  if (self == NULL)
-    return NULL;
-  self->softspace = 0;
-  self->_cb = NULL;
-  self->_iscerr = iscerr;
-  return self;
-}
-
-// main python interpreter (static attributes)
-
-int PyInterp_base::_argc = 1;
-char* PyInterp_base::_argv[] = {""};
-
-PyObject *PyInterp_base::builtinmodule = NULL;
-
-PyThreadState *PyInterp_base::_gtstate = NULL;
-PyInterpreterState *PyInterp_base::_interp = NULL;
-
-
-/*!
- * basic constructor here : herited classes constructors must call initalize() method
- * defined here.
- */
-PyInterp_base::PyInterp_base(): _tstate(0), _vout(0), _verr(0), _g(0), _atFirst(true)
-{
-}
-
-PyInterp_base::~PyInterp_base()
-{
-}
-
-
-/*!
- * Must be called by herited classes constructors. initialize() calls virtuals methods
- * initstate & initcontext, not defined here in base class. initstate & initcontext methods
- * must be implemented in herited classes, following the Python interpreter policy
- * (mono or multi interpreter...).
- */
-void PyInterp_base::initialize()
-{
-  _history.clear();       // start a new list of user's commands 
-  _ith = _history.begin();
-
-  init_python();
-  // Here the global lock is released
-
-  initState();
-
-  PyLockWrapper aLock= GetLockWrapper();
-
-  initContext();
-
-  // used to interpret & compile commands
-  PyObjWrapper m(PyImport_ImportModule("codeop"));
-  if(!m){
-    PyErr_Print();
-    return;
-  }
-
-  // Create python objects to capture stdout and stderr
-  _vout=(PyObject*)newPyStdOut( false ); // stdout 
-  _verr=(PyObject*)newPyStdOut( true );  // stderr
-
-  // All the initRun outputs are redirected to the standard output (console)
-  initRun();
-}
-
-void PyInterp_base::init_python()
-{
-  _atFirst = false;
-  if (Py_IsInitialized())
-    return;
-
-  // Python is not initialized
-  Py_SetProgramName(_argv[0]);
-  Py_Initialize(); // Initialize the interpreter
-  PySys_SetArgv(_argc, _argv);
-  PyEval_InitThreads(); // Create (and acquire) the interpreter lock
-  _interp = PyThreadState_Get()->interp;
-  if (PyType_Ready(&PyStdOut_Type) < 0)
-    {
-      PyErr_Print();
-    }
-  _gtstate = PyEval_SaveThread(); // Release global thread state
-}
-
-string PyInterp_base::getbanner()
-{
- // Should we take the lock ?
- // PyEval_RestoreThread(_tstate);
-  string aBanner("Python ");
-  aBanner = aBanner + Py_GetVersion() + " on " + Py_GetPlatform() ;
-  aBanner = aBanner + "\ntype help to get general information on environment\n";
-  //PyEval_SaveThread();
-  return aBanner;
-}
-
-
-int PyInterp_base::initRun()
-{
-  // 
-  // probably all below code isn't required
-  //
-  /*
-  PySys_SetObject("stderr",_verr);
-  PySys_SetObject("stdout",_vout);
-
-  //PyObject *m = PyImport_GetModuleDict();
-  
-  PySys_SetObject("stdout",PySys_GetObject("__stdout__"));
-  PySys_SetObject("stderr",PySys_GetObject("__stderr__"));
-  */
-  return 0;
-}
-
-
-/*!
- * This function compiles a string (command) and then evaluates it in the dictionnary
- * context if possible.
- * Returns :
- * -1 : fatal error 
- *  1 : incomplete text
- *  0 : complete text executed with success
- */
-int compile_command(const char *command,PyObject *context)
-{
-  PyObject *m = PyImport_AddModule("codeop");
-  if(!m){ // Fatal error. No way to go on.
-    PyErr_Print();
-    return -1;
-  }
-  PyObjWrapper v(PyObject_CallMethod(m,"compile_command","s",command));
-  if(!v){
-    // Error encountered. It should be SyntaxError,
-    //so we don't write out traceback
-    PyObjWrapper exception, value, tb;
-    PyErr_Fetch(&exception, &value, &tb);
-    PyErr_NormalizeException(&exception, &value, &tb);
-    PyErr_Display(exception, value, NULL);
-    return -1;
-  }else if (v == Py_None){
-    // Incomplete text we return 1 : we need a complete text to execute
-    return 1;
-  }else{
-    // Complete and correct text. We evaluate it.
-    //#if PY_VERSION_HEX < 0x02040000 // python version earlier than 2.4.0
-    //    PyObjWrapper r(PyEval_EvalCode(v,context,context));
-    //#else
-    PyObjWrapper r(PyEval_EvalCode((PyCodeObject *)(void *)v,context,context));
-    //#endif
-    if(!r){
-      // Execution error. We return -1
-      PyErr_Print();
-      return -1;
-    }
-    // The command has been successfully executed. Return 0
-    return 0;
-  }
-}
-
-
-int PyInterp_base::run(const char *command)
-{
-  if(_atFirst){
-    int ret = 0;
-    ret = simpleRun("from Help import *");
-    if (ret) { 
-      _atFirst = false;
-      return ret;
-    }
-    ret = simpleRun("import salome");
-    if (ret) { 
-      _atFirst = false;
-      return ret;
-    }
-    ret = simpleRun("salome.salome_init(0,1)");
-    if (ret) { 
-      _atFirst = false;
-      return ret;
-    }
-    _atFirst = false;
-  }
-  return simpleRun(command);
-}
-
-
-int PyInterp_base::simpleRun(const char *command)
-{
-  if( !_atFirst && strcmp(command,"") != 0 ) {
-    _history.push_back(command);
-    _ith = _history.end();
-  }
-
-  // We come from C++ to enter Python world
-  // We need to acquire the Python global lock
-  //PyLockWrapper aLock(_tstate); // san - lock is centralized now
-
-  // Reset redirected outputs before treatment
-  PySys_SetObject("stderr",_verr);
-  PySys_SetObject("stdout",_vout);
-
-  int ier = compile_command(command,_g);
-
-  // Outputs are redirected on standards outputs (console)
-  PySys_SetObject("stdout",PySys_GetObject("__stdout__"));
-  PySys_SetObject("stderr",PySys_GetObject("__stderr__"));
-
-  return ier;
-}
-
-
-const char * PyInterp_base::getPrevious()
-{
-  if(_ith != _history.begin()){
-    _ith--;
-    return (*_ith).c_str();
-  }
-  else
-    return BEGIN_HISTORY_PY;
-}
-
-
-const char * PyInterp_base::getNext()
-{
-  if(_ith != _history.end()){
-    _ith++;
-  }
-  if (_ith == _history.end())
-    return TOP_HISTORY_PY;
-  else
-    return (*_ith).c_str();
-}
-
-
-void PyInterp_base::setvoutcb(PyOutChanged* cb, void* data)
-{  
-  ((PyStdOut*)_vout)->_cb=cb;
-  ((PyStdOut*)_vout)->_data=data;
-}
-
-
-void PyInterp_base::setverrcb(PyOutChanged* cb, void* data)
-{  
-  ((PyStdOut*)_verr)->_cb=cb;
-  ((PyStdOut*)_verr)->_data=data;
-}
diff --git a/src/PyInterp/PyInterp_base.h b/src/PyInterp/PyInterp_base.h
deleted file mode 100644 (file)
index 298b1c5..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-//
-//  File   : PyInterp_base.h
-//  Author : Christian CAREMOLI, Paul RASCLE, EDF
-//  Module : SALOME
-
-#ifndef _PYINTERP_BASE_H_
-#define _PYINTERP_BASE_H_
-
-#include "PyInterp.h"
-
-#include <list>
-#include <string>
-#include <iostream>
-
-// include order important!
-// pthread then python then qt
-//#include <pthread.h>  // must be before Python.h !
-
-#include <Python.h>   // must be before qt includes ...
-#include <compile.h>   // Python include needed for versions before 2.4. Included in Python.h now.
-#include <eval.h>   // Python include needed for versions before 2.4. Included in Python.h now.
-
-//#if PY_VERSION_HEX < 0x02040000 // python version earlier than 2.4.0
-//extern "C" PyObject * PyEval_EvalCode(PyObject *co, PyObject *g, PyObject *l);
-//#endif
-
-/* For 2.3, use the PyGILState_ calls */
-#if (PY_VERSION_HEX >= 0x02030000)
-#define USE_GILSTATE
-#endif
-
-#define TOP_HISTORY_PY "--- top of history ---"
-#define BEGIN_HISTORY_PY "--- begin of history ---"
-
-class PYINTERP_EXPORT PyLockWrapper
-{
-  PyThreadState* myThreadState;
-  PyThreadState* mySaveThreadState;
-#if defined(USE_GILSTATE)
-  PyGILState_STATE _savestate ;
-#endif
- public:
-  PyLockWrapper(PyThreadState* theThreadState);
-  ~PyLockWrapper();
-};
-
-typedef void PyOutChanged(void* data,char * c);
-
-class PYINTERP_EXPORT PyInterp_base{
- public:
-  static int _argc;
-  static char* _argv[];
-  static PyObject *builtinmodule;
-  static PyThreadState *_gtstate;
-  static PyInterpreterState *_interp;
-  
-  PyInterp_base();
-  ~PyInterp_base();
-  
-  virtual void initialize();
-  virtual void init_python();
-  // init_python() made virtual to:
-  // 1. Remove dependency on KERNEL in light SALOME configuration
-  // 2. Allow redefinition of this method in SalomeApp_PyInterp class (it should be empty there and rely on KERNEL_PYTHON)
-
-  virtual int run(const char *command); 
-
-  PyLockWrapper GetLockWrapper();
-
-  std::string getbanner(); 
-  void setverrcb(PyOutChanged*,void*);
-  void setvoutcb(PyOutChanged*,void*);
-
-  const char * getPrevious();
-  const char * getNext();    
-
- protected:
-  PyThreadState * _tstate;
-  PyObject * _vout;
-  PyObject * _verr;
-  PyObject * _g;
-  PyObject * _codeop;
-  std::list<std::string> _history;
-  std::list<std::string>::iterator _ith;
-  bool _atFirst;
-
-  int simpleRun(const char* command);
-  int initRun();
-
-  virtual bool initState() = 0;
-  virtual bool initContext() = 0;  
-};
-
-
-class PYINTERP_EXPORT PyObjWrapper{
-  PyObject* myObject;
-public:
-  PyObjWrapper(PyObject* theObject): myObject(theObject) {}
-  PyObjWrapper(): myObject(0) {}
-  operator PyObject*(){
-    return myObject;
-  }
-  PyObject* operator->(){
-    return myObject;
-  }
-  PyObject* get(){
-    return myObject;
-  }
-  bool operator!(){
-    return !myObject;
-  }
-  bool operator==(PyObject* theObject){
-    return myObject == theObject;
-  }
-  PyObject** operator&(){
-    return &myObject;
-  }
-  PyObjWrapper& operator=(PyObjWrapper* theObjWrapper){
-    Py_XDECREF(myObject);
-    myObject = theObjWrapper->myObject;
-    return *this;
-  }
-  virtual ~PyObjWrapper(){ 
-    Py_XDECREF(myObject);
-  }
-};
-
-
-typedef struct {
-  PyObject_HEAD
-  int softspace;
-  PyOutChanged* _cb;
-  void* _data;
-  bool _iscerr;
-} PyStdOut;
-
-#endif
diff --git a/src/PythonConsole/Makefile.am b/src/PythonConsole/Makefile.am
deleted file mode 100755 (executable)
index 8884cfa..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
-#
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
-#
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File   : Makefile.in
-#  Author : Vladimir Klyachin (OCN)
-#  Module : PythonConsole
-#  $Header$
-
-include $(top_srcdir)/adm_local/unix/make_common_starter.am
-
-lib_LTLIBRARIES = libPythonConsole.la
-
-salomeinclude_HEADERS= \
-       PythonConsole.h \
-       PythonConsole_PyConsole.h \
-       PythonConsole_PyEditor.h \
-       PythonConsole_PyInterp.h
-
-dist_libPythonConsole_la_SOURCES= \
-       PythonConsole_PyConsole.cxx \
-       PythonConsole_PyEditor.cxx \
-       PythonConsole_PyInterp.cxx              
-
-MOC_FILES= \
-       PythonConsole_PyEditor_moc.cxx \
-       PythonConsole_PyConsole_moc.cxx
-nodist_libPythonConsole_la_SOURCES= $(MOC_FILES)
-
-
-libPythonConsole_la_CPPFLAGS= $(PYTHON_INCLUDES) $(QT_INCLUDES) \
-       -I$(srcdir)/../PyInterp -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
-
-libPythonConsole_la_LDFLAGS= $(PYTHON_LIBS) $(QT_MT_LIBS)
-
-
diff --git a/src/PythonConsole/PythonConsole.h b/src/PythonConsole/PythonConsole.h
deleted file mode 100755 (executable)
index 8e1db39..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#if !defined ( _PYTHONCONSOLE_H )
-#define _PYTHONCONSOLE_H
-
-// ========================================================
-// set dllexport type for Win platform 
-#ifdef WNT
-
-#ifdef PYTHONCONSOLE_EXPORTS
-#define PYCONSOLE_EXPORT __declspec(dllexport)
-#else
-#define PYCONSOLE_EXPORT __declspec(dllimport)
-#endif
-
-#else   // WNT
-
-#define PYCONSOLE_EXPORT
-
-#endif  // WNT
-
-// ========================================================
-// little trick - if we do not have debug python libraries
-#ifdef _DEBUG
-#ifndef HAVE_DEBUG_PYTHON
-#undef _DEBUG
-#endif
-#endif
-
-//#include <Python.h>
-
-#ifdef _DEBUG
-#ifndef HAVE_DEBUG_PYTHON
-#define _DEBUG
-#endif
-#endif
-
-// ========================================================
-// avoid warning messages
-#ifdef WNT
-#pragma warning (disable : 4786)
-#pragma warning (disable : 4251)
-#endif
-
-#endif // _PYTHONCONSOLE_H
diff --git a/src/PythonConsole/PythonConsole_PyConsole.cxx b/src/PythonConsole/PythonConsole_PyConsole.cxx
deleted file mode 100755 (executable)
index 9c8f852..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <Python.h>
-#include "PythonConsole_PyConsole.h"
-#include "PythonConsole_PyEditor.h"
-#include "PyInterp_base.h"
-
-#include "SUIT_Desktop.h"
-
-#include <qlayout.h>
-
-using namespace std;
-
-/*!
-  Constructor
-*/
-PythonConsole::PythonConsole(QWidget* parent, PyInterp_base* interp)
-: QWidget(parent), myEditor( 0 )
-{
-  // create python interpreter
-  myInterp = interp;
-  if ( !myInterp )
-    myInterp = new PythonConsole_PyInterp();
-  
-  // initialize Python interpretator
-  myInterp->initialize();
-
-  // create editor console
-  QVBoxLayout* lay = new QVBoxLayout( this );
-  myEditor = new PythonConsole_PyEditor(myInterp, this,"Python Interpreter");
-  lay->addWidget( myEditor );
-}
-
-/*!
-  Destructor
-*/
-PythonConsole::~PythonConsole()
-{
-}
-
-/*!
-  Executes command
-  \param command - string with command and arguments
-*/
-void PythonConsole::exec( const QString& command )
-{
-  if ( myEditor )
-    myEditor->exec( command );
-}
-
-/*!
-  Blocks execution of main application until command is executed
-  \param command - string with command and arguments
-*/
-void PythonConsole::execAndWait( const QString& command )
-{
-  if ( myEditor )
-    myEditor->execAndWait( command );
-}
-
-/*!
-  Changes font of python console
-  \param f - new font
-*/
-void PythonConsole::setFont( const QFont& f )
-{
-  if( myEditor )
-    myEditor->setFont( f );
-}
-
-/*!
-  \return font of python console
-*/
-QFont PythonConsole::font() const
-{
-  QFont res;
-  if( myEditor )
-    res = myEditor->font();
-  return res;
-}
diff --git a/src/PythonConsole/PythonConsole_PyConsole.h b/src/PythonConsole/PythonConsole_PyConsole.h
deleted file mode 100755 (executable)
index b3364e5..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef PythonConsole_PyConsole_H
-#define PythonConsole_PyConsole_H
-
-#include "PythonConsole.h"
-
-#include <qwidget.h>
-
-class PythonConsole_PyEditor;
-class PyInterp_base;
-
-class PYCONSOLE_EXPORT PythonConsole: public QWidget
-{
-  Q_OBJECT;
-
-public:
-  PythonConsole(QWidget* parent, PyInterp_base* interp = 0 );
-  virtual ~PythonConsole();
-
-  PyInterp_base* getInterp() { return myInterp; } 
-  QFont          font() const;
-  virtual void   setFont( const QFont& );
-
-  void           exec( const QString& command );
-  void           execAndWait( const QString& command );
-protected:
-  PyInterp_base*          myInterp;
-  PythonConsole_PyEditor* myEditor;
-};
-
-
-#endif
diff --git a/src/PythonConsole/PythonConsole_PyEditor.cxx b/src/PythonConsole/PythonConsole_PyEditor.cxx
deleted file mode 100755 (executable)
index deecd64..0000000
+++ /dev/null
@@ -1,853 +0,0 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : PythonConsole_PyEditor.cxx
-//  Author : Nicolas REJNERI
-//  Module : SALOME
-
-#include <PythonConsole_PyEditor.h> // this include must be first (see PyInterp_base.h)!
-
-#include <PyInterp_Dispatcher.h>
-
-#include <SUIT_Tools.h>
-#include <SUIT_Session.h>
-
-#include <qmap.h>
-#include <qclipboard.h>
-#include <qdragobject.h>
-#include <qapplication.h>
-#include <qpopupmenu.h>
-#include <qfontmetrics.h>
-#include <iostream>
-
-using namespace std;
-
-//#ifdef _DEBUG_
-//static int MYDEBUG = 1;
-//#else
-//static int MYDEBUG = 0;
-//#endif
-
-
-enum { IdCopy, IdPaste, IdClear, IdSelectAll };
-
-
-static QString READY_PROMPT = ">>> ";
-static QString DOTS_PROMPT  = "... ";
-
-#define PROMPT_SIZE (int)_currentPrompt.length()
-
-class ExecCommand : public PyInterp_LockRequest
-{
-public:
-  ExecCommand(PyInterp_base* theInterp, const QString& theCommand,
-              PythonConsole_PyEditor* theListener, bool sync = false)
-    : PyInterp_LockRequest( theInterp, theListener, sync ),
-      myCommand( theCommand ), myState( PyInterp_Event::OK )
-  {}
-
-protected:
-  virtual void execute(){
-    if( !myCommand.stripWhiteSpace().isEmpty() ) {
-//      if(MYDEBUG) MESSAGE("*** ExecCommand::execute() started");
-      SUIT_Session::SetPythonExecuted(true); // disable GUI user actions
-      int ret = getInterp()->run( myCommand.latin1() );
-      SUIT_Session::SetPythonExecuted(false); // enable GUI user actions
-//      if(MYDEBUG) MESSAGE("ExecCommand::execute() - myInterp = "<<getInterp()<<"; myCommand = '"<<myCommand.latin1()<<"' - "<<ret);
-      if( ret < 0 )
-       myState = PyInterp_Event::ERROR;
-      else if( ret > 0 )
-       myState = PyInterp_Event::INCOMPLETE;
-//      if(MYDEBUG) MESSAGE("*** ExecCommand::execute() finished");
-    }
-  }
-
-  virtual QEvent* createEvent() const
-  {
-    return new PyInterp_Event( myState, (PyInterp_Request*)this );    
-  }
-
-private:
-  QString myCommand;
-  int myState;
-};
-
-#define PRINT_EVENT 65432
-
-class PrintEvent : public QCustomEvent
-{
-public:
-  PrintEvent( const char* c ) : QCustomEvent( PRINT_EVENT ), myText( c ) {}
-  QString text() const { return myText; }
-private:
-  QString myText;
-};
-
-void staticCallback( void* data, char* c )
-{
-  QApplication::postEvent( (PythonConsole_PyEditor*)data, new PrintEvent( c ) ); 
-}
-
-/*!
-    Constructor
-*/
-PythonConsole_PyEditor::PythonConsole_PyEditor(PyInterp_base* theInterp, QWidget *theParent, const char* theName): 
-  QTextEdit(theParent,theName),
-  myInterp( 0 ),
-  myIsInLoop( false )
-{
-  QString fntSet( "" );
-  QFont aFont = SUIT_Tools::stringToFont( fntSet );
-  setFont(aFont);
-  //setTextFormat(QTextEdit::PlainText);
-  setUndoRedoEnabled( false );
-
-  _currentPrompt = READY_PROMPT;
-  setWordWrap( WidgetWidth );
-  setWrapPolicy( Anywhere );
-
-  theInterp->setvoutcb( staticCallback, this );
-  theInterp->setverrcb( staticCallback, this );
-
-  connect(this,SIGNAL(returnPressed()),this,SLOT(handleReturn()) );
-
-  // san - This is necessary for troubleless initialization
-  onPyInterpChanged( theInterp );
-}
-
-/*!
-    Destructor
-*/
-PythonConsole_PyEditor::~PythonConsole_PyEditor()
-{
-//  if(MYDEBUG) MESSAGE("PythonConsole_PyEditor::~PythonConsole_PyEditor()");
-}
-
-/*!
-    Called to insert a string s 
-*/
-void PythonConsole_PyEditor::setText(QString s)
-{
-  int para=paragraphs()-1;
-  int col=paragraphLength(para);
-
-  // Limit length of the string because exception may occur if string too long (NPAL16033)
-  // Exception occurs if  one of paragraphs of the input string "s" is too long.  Now long 
-  // paragraph is limited with threshold numbers of characters and finished by " ..." string. 
-  // Note that first paragraph of the string is checked only because it is enough for bug fixing. 
-  // If it will be insufficient for other cases then more complicated check should be implemented.
-  // At present it is not done because of possible performance problem.
-
-  static int threshold = 50000;
-  long strLength = s.length();
-  if ( col + strLength <= threshold || s.find( '\n' ) < threshold )
-    insertAt(s,para,col);
-  else
-  {
-    if ( col >= threshold )
-    {
-      if ( text( para ).right( 5 )  != QString( " ...\n" ) )
-        insertAt(" ...\n",para,col);
-    }
-    else
-    {
-      long n = threshold - col; 
-      s.truncate( n );
-      if ( n >= 5 )
-      {
-        s.at( n - 5 ) = QChar( ' ' );
-        s.at( n - 4 ) = QChar( '.' );
-        s.at( n - 3 ) = QChar( '.' );
-        s.at( n - 2 ) = QChar( '.' );
-        s.at( n - 1 ) = QChar( '\n' );
-      }
-      else 
-        s = " ...\n";
-      insertAt(s,para,col);
-    }
-  }
-
-  int n = paragraphs()-1;  
-  setCursorPosition( n, paragraphLength(n)); 
-}
-
-/*!
-    Convenient method for executing a Python command,
-    as if the user typed it manually
-*/
-void PythonConsole_PyEditor::exec( const QString& command )
-{
-  // Some interactive command is being executed in this editor -> do nothing
-  if ( isReadOnly() ) {
-    myQueue.push_back( command );
-    return;
-  }
-  int para=paragraphs()-1;
-  removeParagraph( para );
-  _currentPrompt = READY_PROMPT;
-  _buf.truncate(0);
-  _isInHistory = false;
-  setText( "\n" + _currentPrompt);
-  // PAL15963 (Problem with option -u (--execute) of runSalome).
-  // Let events creating a study end before script execution starts
-  setText( command /*+ "\n"*/ );
-  //handleReturn();
-  qApp->postEvent( this, new QKeyEvent(QEvent::KeyPress,Key_Return,13,Qt::NoButton ));
-}
-
-void PythonConsole_PyEditor::execAndWait( const QString& command )
-{
-  if( myIsInLoop )
-    return;
-
-  myIsInLoop = true;
-  exec( command );
-  qApp->enter_loop();
-  myIsInLoop = false;
-}
-
-/*!
-    Called when an handleReturn
-*/
-void PythonConsole_PyEditor::handleReturn()
-{
-  int para=paragraphs()-2;
-  _buf.append(text(para).remove(0,PROMPT_SIZE));
-  _buf.truncate( _buf.length() - 1 );
-  setReadOnly( true );
-  viewport()->setCursor( waitCursor );
-  
-  // Post a request to execute Python command
-  // Editor will be informed via a custom event that execution has been completed
-  PyInterp_Dispatcher::Get()->Exec( new ExecCommand( myInterp, _buf, this ) );
-}
-
-/*!
-   Processes drop event: paste dragged text
-*/
-void PythonConsole_PyEditor::contentsDropEvent( QDropEvent* event )
-{
-  event->acceptAction();
-  QString text;
-  if ( QTextDrag::decode( event, text ) ) {
-    int par, col;
-    int endLine = paragraphs() -1;
-    col = charAt( event->pos(), &par );
-    
-    if ( col >= 0 && par >= 0 ) {
-      if ( par != endLine || col < PROMPT_SIZE ) {
-       par = endLine;
-       col = paragraphLength( endLine );
-      }
-      setCursorPosition( par, col );
-      insertAt( text, par, col );
-      removeSelection();
-    }
-  }
-}
-
-/*!
-   Processes middle button release event - paste clipboard's contents
-*/
-void PythonConsole_PyEditor::contentsMouseReleaseEvent( QMouseEvent* event )
-{
-  if ( event->button() == LeftButton ) {
-    QTextEdit::contentsMouseReleaseEvent(event);
-    copy();
-  }
-  if ( event->button() == MidButton ) {
-    if (QApplication::clipboard()->supportsSelection()) {
-      int par, col;
-      int endLine = paragraphs() -1;
-      col = charAt( event->pos(), &par );
-      if ( col >= 0 && par >= 0 ) {
-       // PAL12896 -->
-       if ( par != endLine || col < PROMPT_SIZE ) {
-         QPoint aPos = paragraphRect(endLine).bottomRight();
-         QMouseEvent* e = new QMouseEvent(event->type(),aPos,event->button(),event->state());
-         QTextEdit::contentsMouseReleaseEvent(e);
-       }
-       else
-         QTextEdit::contentsMouseReleaseEvent(event);
-       // PAL12896 <--
-      }
-    }
-  }
-  else {
-    QTextEdit::contentsMouseReleaseEvent(event);
-  }
-}
-
-/*
-   Processes own popup menu
-*/
-void PythonConsole_PyEditor::mousePressEvent (QMouseEvent* event)
-{
-  if ( event->button() == RightButton ) {
-    QPopupMenu *popup = new QPopupMenu( this );
-    QMap<int, int> idMap;
-
-    int para1, col1, para2, col2;
-    getSelection(&para1, &col1, &para2, &col2);
-    bool allSelected = hasSelectedText() &&
-      para1 == 0 && para2 == paragraphs()-1 && col1 == 0 && para2 == paragraphLength(para2);
-    int id;
-    id = popup->insertItem( tr( "EDIT_COPY_CMD" ) );
-    idMap.insert(IdCopy, id);
-    id = popup->insertItem( tr( "EDIT_PASTE_CMD" ) );
-    idMap.insert(IdPaste, id);
-    id = popup->insertItem( tr( "EDIT_CLEAR_CMD" ) );
-    idMap.insert(IdClear, id);
-    popup->insertSeparator();
-    id = popup->insertItem( tr( "EDIT_SELECTALL_CMD" ) );
-    idMap.insert(IdSelectAll, id);
-    popup->setItemEnabled( idMap[ IdCopy ],  hasSelectedText() );
-    popup->setItemEnabled( idMap[ IdPaste ],
-                         !isReadOnly() && (bool)QApplication::clipboard()->text().length() );
-    popup->setItemEnabled( idMap[ IdSelectAll ],
-                         (bool)text().length() && !allSelected );
-    
-    int r = popup->exec( event->globalPos() );
-    delete popup;
-    
-    if ( r == idMap[ IdCopy ] ) {
-      copy();
-    }
-    else if ( r == idMap[ IdPaste ] ) {
-      paste();
-    }
-    else if ( r == idMap[ IdClear ] ) {
-      clear();
-      setText(myBanner);
-      _currentPrompt = READY_PROMPT;
-      setText(_currentPrompt);
-    }
-    else if ( r == idMap[ IdSelectAll ] ) {
-      selectAll();
-    }
-  }
-  else {
-    QTextEdit::mousePressEvent(event);
-  }
-}
-
-/*!
-   Checks, is the string a command line or not.
-*/
-
-bool PythonConsole_PyEditor::isCommand( const QString& str) const
-{
-  // prompt may be '>>> ' or for '... '
-  return ( str.find( READY_PROMPT ) == 0 || str.find( DOTS_PROMPT ) == 0 );
-}
-
-
-/*!
-    Called when a keyPress event
-*/
-void PythonConsole_PyEditor::keyPressEvent( QKeyEvent* e )
-{
-  // get cursor position
-  int curLine, curCol;
-  getCursorPosition(&curLine, &curCol);
-
-  // get last edited line
-  int endLine = paragraphs() -1;
-
-  // get pressed key code
-  int aKey = e->key();
-
-  // check if <Ctrl> is pressed
-  bool ctrlPressed = e->state() & ControlButton;
-  // check if <Shift> is pressed
-  bool shftPressed = e->state() & ShiftButton;
-
-  // process <Ctrl>+<C> key-bindings
-  if ( aKey == Key_C && ctrlPressed ) {
-    _buf.truncate(0);
-    setText("\n");
-    _currentPrompt = READY_PROMPT;
-    setText(_currentPrompt);
-    return;
-  }
-
-  // check for printed key
-  aKey = ( aKey < Key_Space || aKey > Key_ydiaeresis ) ? aKey : 0;
-
-  switch ( aKey ) {
-  case 0 :
-    // any printed key
-    {
-      if ( curLine < endLine || curCol < PROMPT_SIZE )
-       moveCursor( QTextEdit::MoveEnd, false );
-      QTextEdit::keyPressEvent( e );
-      break;
-    }
-  case Key_Return:
-  case Key_Enter:
-    // <Enter> key
-    {
-      moveCursor( QTextEdit::MoveEnd, false );
-      QTextEdit::keyPressEvent( e );
-      break;
-    }
-  case Key_Up:
-    // <Up> arrow key: process as follows:
-    // - without <Ctrl>, <Shift> modifiers: previous command in history
-    // - with <Ctrl> modifier key pressed:  move cursor one row up without selection
-    // - with <Shift> modifier key pressed: move cursor one row up with selection
-    // - with <Ctrl>+<Shift> modifier keys pressed: scroll one row up
-    {
-      if ( ctrlPressed && shftPressed ) {
-       scrollBy( 0, -QFontMetrics( font() ).lineSpacing() );
-      }
-      else if ( shftPressed ) {
-       if ( curLine > 0 )
-         moveCursor( QTextEdit::MoveUp, true );
-      }
-      else if ( ctrlPressed ) {
-       moveCursor( QTextEdit::MoveUp, false );
-      }
-      else {
-        QString histLine = _currentPrompt;
-        if ( ! _isInHistory ) {
-          _isInHistory = true;
-          _currentCommand = text( endLine ).remove( 0, PROMPT_SIZE );
-          _currentCommand.truncate( _currentCommand.length() - 1 );
-        }
-        QString previousCommand = myInterp->getPrevious();
-        if ( previousCommand.compare( BEGIN_HISTORY_PY ) != 0 )
-        {
-          removeParagraph( endLine );
-          histLine.append( previousCommand );
-          append( histLine );
-        }
-        moveCursor( QTextEdit::MoveEnd, false );
-        scrollViewAfterHistoryUsing( previousCommand ); // NPAL16035
-      }
-      break;
-    }
-  case Key_Down:
-    // <Down> arrow key: process as follows:
-    // - without <Ctrl>, <Shift> modifiers: next command in history
-    // - with <Ctrl> modifier key pressed:  move cursor one row down without selection
-    // - with <Shift> modifier key pressed: move cursor one row down with selection
-    // - with <Ctrl>+<Shift> modifier keys pressed: scroll one row down
-    {
-      if ( ctrlPressed && shftPressed ) {
-       scrollBy( 0, QFontMetrics( font() ).lineSpacing() );
-      }
-      else if ( shftPressed ) {
-       if ( curLine < endLine )
-         moveCursor( QTextEdit::MoveDown, true );
-      }
-      else if ( ctrlPressed ) {
-       moveCursor( QTextEdit::MoveDown, false );
-      }
-      else { 
-       QString histLine = _currentPrompt;
-       QString nextCommand = myInterp->getNext();
-       if ( nextCommand.compare( TOP_HISTORY_PY ) != 0 ) {
-         removeParagraph( endLine );
-         histLine.append( nextCommand );
-         append( histLine );
-       }
-       else {
-         if (_isInHistory) {
-           _isInHistory = false;
-           removeParagraph( endLine );
-           histLine.append( _currentCommand );
-           append( histLine );
-         }
-       }
-       moveCursor( QTextEdit::MoveEnd, false );
-        scrollViewAfterHistoryUsing( nextCommand ); // NPAL16035
-      }
-      break;
-    }
-  case Key_Left:
-    // <Left> arrow key: process as follows:
-    // - without <Ctrl>, <Shift> modifiers: move one symbol left (taking into account prompt)
-    // - with <Ctrl> modifier key pressed:  move one word left (taking into account prompt)
-    // - with <Shift> modifier key pressed: move one symbol left with selection
-    // - with <Ctrl>+<Shift> modifier keys pressed: move one word left with selection
-    {
-      if ( !shftPressed && isCommand( text( curLine ) ) && curCol <= PROMPT_SIZE ) {
-       setCursorPosition( curLine-1, 0 );
-       moveCursor( QTextEdit::MoveLineEnd, false );
-      }
-      else {
-       QTextEdit::keyPressEvent( e );
-      }
-      break;
-    }
-  case Key_Right:
-    // <Right> arrow key: process as follows:
-    // - without <Ctrl>, <Shift> modifiers: move one symbol right (taking into account prompt)
-    // - with <Ctrl> modifier key pressed:  move one word right (taking into account prompt)
-    // - with <Shift> modifier key pressed: move one symbol right with selection
-    // - with <Ctrl>+<Shift> modifier keys pressed: move one word right with selection
-    {
-      if ( !shftPressed ) {
-       if ( curCol < paragraphLength( curLine ) ) {
-         if ( isCommand( text( curLine ) ) && curCol < PROMPT_SIZE ) {
-           setCursorPosition( curLine, PROMPT_SIZE );
-           break;
-         }
-       }
-       else {
-         if ( curLine < endLine && isCommand( text( curLine+1 ) ) ) {
-           setCursorPosition( curLine+1, PROMPT_SIZE );
-           break;
-         }
-       }
-      }
-      QTextEdit::keyPressEvent( e );
-      break;
-    }
-  case Key_PageUp:
-    // <PageUp> key: process as follows:
-    // - without <Ctrl>, <Shift> modifiers: first command in history
-    // - with <Ctrl> modifier key pressed:  move cursor one page up without selection
-    // - with <Shift> modifier key pressed: move cursor one page up with selection
-    // - with <Ctrl>+<Shift> modifier keys pressed: scroll one page up
-    {
-      if ( ctrlPressed && shftPressed ) {
-       scrollBy( 0, -visibleHeight() );
-      }
-      else if ( shftPressed ) {
-       if ( curLine > 0 )
-         moveCursor( QTextEdit::MovePgUp, true );
-      }
-      else if ( ctrlPressed ) {
-       moveCursor( QTextEdit::MovePgUp, false );
-      }
-      else { 
-       QString histLine = _currentPrompt;
-       if ( ! _isInHistory ) {
-         _isInHistory = true;
-         _currentCommand = text( endLine ).remove( 0, PROMPT_SIZE );
-         _currentCommand.truncate( _currentCommand.length() - 1 );
-       }
-       QString firstCommand = myInterp->getPrevious();
-       QString pcmd;
-       while ( ( pcmd = QString( myInterp->getPrevious() ) ).compare( BEGIN_HISTORY_PY ) != 0 )
-         firstCommand = pcmd;
-       if ( firstCommand.compare( BEGIN_HISTORY_PY ) != 0 ) {
-         removeParagraph( endLine );
-         histLine.append( firstCommand );
-         insertParagraph( histLine, -1 );
-       }
-       moveCursor( QTextEdit::MoveEnd, false );
-      }
-      break;
-    }
-  case Key_PageDown:
-    // <PageDown> key: process as follows:
-    // - without <Ctrl>, <Shift> modifiers: last command in history
-    // - with <Ctrl> modifier key pressed:  move cursor one page down without selection
-    // - with <Shift> modifier key pressed: move cursor one page down with selection
-    // - with <Ctrl>+<Shift> modifier keys pressed: scroll one page down
-    {
-      if ( ctrlPressed && shftPressed ) {
-       scrollBy( 0, visibleHeight() );
-      }
-      else if ( shftPressed ) {
-       if ( curLine < endLine )
-         moveCursor( QTextEdit::MovePgDown, true );
-      }
-      else if ( ctrlPressed ) {
-       moveCursor( QTextEdit::MovePgDown, false );
-      }
-      else { 
-       if ( _isInHistory ) {
-         QString histLine = _currentPrompt;
-         while ( QString( myInterp->getNext() ).compare( TOP_HISTORY_PY ) != 0 );
-         _isInHistory = false;
-         removeParagraph( endLine );
-         histLine.append( _currentCommand );
-         insertParagraph( histLine, -1 );
-       }
-       moveCursor( QTextEdit::MoveEnd, false );
-      }
-      break;
-    }
-  case Key_Home: 
-    // <Home> key: process as follows:
-    // - without <Ctrl>, <Shift> modifiers: move cursor to the beginning of the current line without selection
-    // - with <Ctrl> modifier key pressed:  move cursor to the very first symbol without selection
-    // - with <Shift> modifier key pressed: move cursor to the beginning of the current line with selection
-    // - with <Ctrl>+<Shift> modifier keys pressed: move cursor to the very first symbol with selection
-    {
-      if ( ctrlPressed ) { 
-       moveCursor( QTextEdit::MoveHome, shftPressed );
-      }
-      else {
-       if ( isCommand( text( curLine ) ) ) {
-         int ps1, ps2, cs1, cs2;
-         bool hasSelection = hasSelectedText();
-         if ( hasSelection )
-           getSelection( &ps1, &cs1, &ps2, &cs2 );
-         removeSelection();
-         horizontalScrollBar()->setValue( horizontalScrollBar()->minValue() );
-         if ( curCol > PROMPT_SIZE && shftPressed ) 
-           setSelection( curLine, PROMPT_SIZE, curLine, ( hasSelection && ps1 == ps2 && ps1 == curLine && cs2 > PROMPT_SIZE ) ? cs2 : curCol );
-         setCursorPosition( curLine, PROMPT_SIZE );
-       }
-       else {
-         moveCursor( QTextEdit::MoveLineStart, shftPressed );
-       }
-      }
-      break;
-    }
-  case Key_End:
-    // <End> key: process as follows:
-    // - without <Ctrl>, <Shift> modifiers: move cursor to the end of the current line without selection
-    // - with <Ctrl> modifier key pressed:  move cursor to the very last symbol without selection
-    // - with <Shift> modifier key pressed: move cursor to the end of the current line with selection
-    // - with <Ctrl>+<Shift> modifier keys pressed: move cursor to the very last symbol with selection
-    {
-      if ( ctrlPressed ) { 
-       moveCursor( QTextEdit::MoveEnd, shftPressed );
-      }
-      else {
-       moveCursor( QTextEdit::MoveLineEnd, shftPressed );
-      }
-      break;
-    }  
-  case Key_Backspace :
-    // <Backspace> key: process as follows
-    // - without any modifiers : delete symbol before the cursor / selection (taking into account prompt)
-    // - with <Ctrl> modifier key pressed: delete previous word
-    // works only for last (command) line
-    {
-      if ( curLine == endLine && ( curCol > PROMPT_SIZE || curCol >= PROMPT_SIZE && hasSelectedText() ) ) {
-       if ( ctrlPressed && !hasSelectedText() ) {
-         QString txt = text( curLine );
-         int ind = curCol-1;
-         while ( ind > 0 && txt[ ind ] == ' ' ) ind--;
-         ind = txt.findRev( ' ', ind ) + 1;
-         if ( ind > PROMPT_SIZE-1 ) {
-           setSelection( curLine, ind, curLine, curCol );
-           removeSelectedText();
-         }
-         else {
-           QTextEdit::keyPressEvent( e );
-         }
-       }
-       else {
-         QTextEdit::keyPressEvent( e );
-       }
-      }
-      break;
-    }
-  case Key_Delete :
-    // <Delete> key: process as follows
-    // - without any modifiers : delete symbol after the cursor / selection (taking into account prompt)
-    // - with <Ctrl> modifier key pressed: delete next word
-    // works only for last (command) line
-    {
-      if ( curLine == endLine && curCol > PROMPT_SIZE-1 ) {
-       if ( ctrlPressed && !hasSelectedText() ) {
-         QString txt = text( curLine );
-         int ind = curCol;
-         while ( ind < (int)( txt.length() - 1 ) && txt[ind] == ' ' ) ind++;
-         ind = txt.find( ' ', ind );
-         while ( ind < (int)( txt.length() - 1 ) && txt[ ind ] == ' ' ) ind++;
-         if ( ind > PROMPT_SIZE-1 ) {
-           setSelection( curLine, curCol, curLine, ind );
-           removeSelectedText();
-         }
-         else {
-           QTextEdit::keyPressEvent( e );
-         }
-       }
-       else {
-         QTextEdit::keyPressEvent( e );
-       }
-      }
-      break;
-    }
-  case Key_Insert :
-    // <Insert> key: process as follows
-    // - with <Ctrl> modifier key pressed:  copy()
-    // - with <Shift> modifier key pressed: paste() to the command line
-    {
-      if ( ctrlPressed ) {
-       copy();
-      }
-      else if ( shftPressed ) {
-       if ( curLine != endLine || curCol < PROMPT_SIZE )
-         moveCursor( QTextEdit::MoveEnd, false );
-       paste();
-      }
-      else
-       QTextEdit::keyPressEvent( e );
-      break;
-    }
-  }
-}
-
-/*!
-    Handles notifications coming from Python dispatcher
-*/
-void PythonConsole_PyEditor::customEvent(QCustomEvent* e)
-{
-  switch( e->type() ) {
-  case PRINT_EVENT:
-    {
-      PrintEvent* pe=(PrintEvent*)e;
-      setText( pe->text() );
-      return;
-    }
-  case PyInterp_Event::OK:
-  case PyInterp_Event::ERROR:
-    {
-      _buf.truncate(0);
-      _currentPrompt = READY_PROMPT;
-      QString txt = text( paragraphs()-1 );
-      txt.truncate( txt.length()-1 );
-      if ( !txt.isEmpty() )
-       setText("\n");
-      setText(_currentPrompt);
-      viewport()->unsetCursor();
-      if( myIsInLoop )
-       qApp->exit_loop();
-      break;
-    }
-  case PyInterp_Event::INCOMPLETE:
-    {
-      _buf.append("\n");
-      _currentPrompt = DOTS_PROMPT;
-      QString txt = text( paragraphs()-1 );
-      txt.truncate( txt.length()-1 );
-      if ( !txt.isEmpty() )
-       setText("\n");
-      setText(_currentPrompt);
-      viewport()->unsetCursor();
-      if( myIsInLoop )
-       qApp->exit_loop();
-      break;
-    }
-  default:
-    QTextEdit::customEvent( e );
-  }
-
-  setReadOnly( false );
-  _isInHistory = false;
-
-  if ( e->type() == PyInterp_Event::OK && myQueue.count() > 0 ) {
-    QString nextcmd = myQueue[0];
-    myQueue.pop_front();
-    exec( nextcmd );
-  }
-}
-
-/*!
-   Handles Python interpreter change
-*/
-void PythonConsole_PyEditor::onPyInterpChanged( PyInterp_base* interp )
-{
-  if ( myInterp != interp 
-       // Force read-only state and wait cursor when myInterp is NULL
-      || !myInterp ){
-    myInterp = interp;
-    if ( myInterp ){
-      myBanner = myInterp->getbanner().c_str();
-      setText(myBanner);
-      _buf.truncate(0);
-      setReadOnly( false );
-      _isInHistory = false;
-      setText(_currentPrompt);
-      viewport()->unsetCursor();
-      if( myIsInLoop )
-       qApp->exit_loop();
-    }
-    else {
-      clear();
-      setReadOnly( true );
-      viewport()->setCursor( waitCursor );
-    }
-  }
-}
-
-/*!
-  Creates popup menu
-*/
-QPopupMenu* PythonConsole_PyEditor::createPopupMenu( const QPoint& pos )
-{
-  QPopupMenu* popup = QTextEdit::createPopupMenu( pos );
-
-  QValueList<int> ids;
-  for ( int i = 0; popup && i < (int)popup->count(); i++ )
-  {
-    if ( !popup->isItemEnabled( popup->idAt( i ) ) )
-      ids.append( popup->idAt( i ) );
-  }
-
-  for ( QValueList<int>::const_iterator it = ids.begin(); it != ids.end(); ++it )
-    popup->removeItem( *it );
-
-  SUIT_Tools::simplifySeparators( popup );
-
-  if ( !popup->count() )
-  {
-    delete popup;
-    popup = 0;
-  }
-
-  return popup;
-}
-
-/*!
-  Scrolls view after use of history (Up/Down keys)to the left position if length
-  of command less than visible width of the view
-*/
-void PythonConsole_PyEditor::scrollViewAfterHistoryUsing( const QString& command )
-{
-  if ( !command.isEmpty() )
-  {
-    if ( command == QString( BEGIN_HISTORY_PY ) )
-    {
-      ensureCursorVisible();
-      return;
-    }
-
-    QFontMetrics aFM( currentFont() );
-    int aCommandLength = aFM.width( command ) + aFM.width( READY_PROMPT ) + 5;
-    int aVisibleWidth = visibleWidth();
-    QScrollBar* aBar = horizontalScrollBar();
-    if ( aBar )
-    {
-      if ( aCommandLength <= aVisibleWidth )
-        aBar->setValue( aBar->minValue() );
-      else  if ( aVisibleWidth > 0 )
-      {
-        double aRatio = aCommandLength / contentsWidth();
-        double aPos = ( aBar->maxValue() - aBar->minValue() ) * aRatio;
-        aBar->setValue( (int)aPos );
-        ensureCursorVisible();
-      }
-    }
-  }
-}
diff --git a/src/PythonConsole/PythonConsole_PyEditor.h b/src/PythonConsole/PythonConsole_PyEditor.h
deleted file mode 100755 (executable)
index d8a2acb..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : PythonConsole_PyEditor.h
-//  Author : Nicolas REJNERI
-//  Module : SALOME
-
-#ifndef PythonConsole_PyEditor_H
-#define PythonConsole_PyEditor_H
-
-#include "PythonConsole_PyInterp.h" // this include must be first (see PyInterp_base.h)!
-
-#include <qevent.h>
-#include <qtextedit.h>
-
-class PythonConsole_PyInterp;
-
-class PYCONSOLE_EXPORT PythonConsole_PyEditor : public QTextEdit
-{
-  Q_OBJECT;
-
-public:
-  PythonConsole_PyEditor(PyInterp_base* theInterp, QWidget *theParent = 0, const char* theName = "");
-  ~PythonConsole_PyEditor();
-  
-  virtual void setText(QString s); 
-  bool isCommand(const QString& str) const;
-
-  virtual void exec( const QString& command );
-  void execAndWait( const QString& command );
-  
-protected:
-  virtual void contentsDropEvent( QDropEvent* event );
-  virtual void contentsMouseReleaseEvent( QMouseEvent* event );
-  virtual void keyPressEvent (QKeyEvent* event);
-  virtual void mousePressEvent (QMouseEvent* event);
-  virtual void customEvent (QCustomEvent* event);
-
-public slots:
-  void handleReturn();
-  void onPyInterpChanged( PyInterp_base* );
-
-  virtual QPopupMenu* createPopupMenu( const QPoint& );
-
-private:
-
-  void scrollViewAfterHistoryUsing( const QString& command );
-
-private:
-  QString        _buf;
-  QString        _currentCommand;
-  QString        _currentPrompt;
-  bool           _isInHistory, myIsInLoop;
-
-  PyInterp_base* myInterp;
-
-  QString        myBanner;
-  QString        myOutput;
-  QString        myError;
-  QStringList    myQueue;
-};
-
-#endif
diff --git a/src/PythonConsole/PythonConsole_PyInterp.cxx b/src/PythonConsole/PythonConsole_PyInterp.cxx
deleted file mode 100755 (executable)
index e540237..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : PythonConsole_PyInterp.cxx
-//  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-
-#include "PythonConsole_PyInterp.h"
-//#include "utilities.h"
-
-using namespace std;
-
-
-//#ifdef _DEBUG_
-//static int MYDEBUG = 0;
-//#else
-//static int MYDEBUG = 0;
-//#endif
-
-
-/*!
- * constructor : multi Python interpreter, one per SALOME study.
- * calls initialize method defined in base class, which calls virtual methods
- * initstate & initcontext redefined here.
- */
-PythonConsole_PyInterp::PythonConsole_PyInterp(): PyInterp_base()
-{
-}
-
-/*!
-  Destructor
-*/
-PythonConsole_PyInterp::~PythonConsole_PyInterp()
-{
-}
-/*!
- * EDF-CCAR
- * When SALOME uses multi Python interpreter feature,
- * Every study has its own interpreter and thread state (_tstate = Py_NewInterpreter())
- * This is fine because every study has its own modules (sys.modules) stdout and stderr
- * BUT some Python modules must be imported only once. In multi interpreter context Python
- * modules (*.py) are imported several times.
- * The pyqt module must be imported only once because it registers classes in a C module.
- * It's quite the same with omniorb modules (internals and generated with omniidl)
- * This problem is handled with "shared modules" defined in salome_shared_modules.py
- * These "shared modules" are imported only once and only copied in all the other interpreters
- * BUT it's not the only problem. Every interpreter has its own __builtin__ module. That's fine
- * but if we have copied some modules and imported others problems may arise with operations that
- * are not allowed in restricted execution environment. So we must impose that all interpreters
- * have identical __builtin__ module.
- * That's all, for the moment ...
- */
-
-bool PythonConsole_PyInterp::initState()
-{
-  /*
-   * The GIL is acquired on input and released on output
-   */
-    /*PyEval_AcquireLock();
-#ifdef WNT 
-  _tstate = PyGILState_GetThisThreadState();
-  // if no thread state defined
-  if ( _tstate )
-    PyThreadState_Swap(_tstate);
-  else
-#endif
-  {
-    _tstate = Py_NewInterpreter(); // create an interpreter and save current state
-    PySys_SetArgv(PyInterp_base::_argc,PyInterp_base::_argv); // initialize sys.argv
-    //if(MYDEBUG) MESSAGE("PythonConsole_PyInterp::initState - this = "<<this<<"; _tstate = "<<_tstate);
-  }*/
-
-  /*
-   * The GIL is acquired and will be held on initState output
-   * It is the caller responsability to release the lock if needed
-   */
-  PyEval_AcquireLock();
-
-  _tstate = Py_NewInterpreter(); // create an interpreter and save current state
-  PySys_SetArgv(PyInterp_base::_argc,PyInterp_base::_argv); // initialize sys.argv
-//  if(MYDEBUG) MESSAGE("PythonConsole_PyInterp::initState - this = "<<this<<"; _tstate = "<<_tstate);
-
-
-  /*
-   * If builtinmodule has been initialized all the sub interpreters
-   * will have the same __builtin__ module
-   */
-  if(!builtinmodule) // PAL18041: deepcopy function don't work in Salome
-  {
-    //builtinmodule is static member of PyInterp class
-    //If it is not NULL (initialized to the builtin module of the main interpreter
-    //all the sub interpreters will have the same builtin
-    //_interp is a static member and is the main interpreter
-    //The first time we initialized it to the builtin of main interpreter
-    builtinmodule=PyDict_GetItemString(_interp->modules, "__builtin__");
-  }
-
-  if(builtinmodule)
-    { 
-    PyObject *m = PyImport_GetModuleDict();
-    PyDict_SetItemString(m, "__builtin__", builtinmodule);
-//    SCRUTE(builtinmodule->ob_refcnt); // builtinmodule reference counter
-    _tstate->interp->builtins = PyModule_GetDict(builtinmodule);
-    Py_INCREF(_tstate->interp->builtins);
-  }    
-  PyEval_ReleaseThread(_tstate);
-  return true;
-}
-
-/*!
-   The GIL is assumed to be held
-   It is the caller responsability caller to acquire the GIL
-   It will still be held on initContext output
-*/
-bool PythonConsole_PyInterp::initContext()
-{
-  PyObject *m = PyImport_AddModule("__main__");  // interpreter main module (module context)
-  if(!m){
-//    if(MYDEBUG) MESSAGE("problem...");
-    PyErr_Print();
-//    ASSERT(0);
-    return false;
-  }  
-  _g = PyModule_GetDict(m);          // get interpreter dictionnary context
-//  if(MYDEBUG) MESSAGE("PythonConsole_PyInterp::initContext - this = "<<this<<"; _g = "<<_g);
-
-  if(builtinmodule){
-    PyDict_SetItemString(_g, "__builtins__", builtinmodule); // assign singleton __builtin__ module
-  }
-  return true;
-}
diff --git a/src/PythonConsole/PythonConsole_PyInterp.h b/src/PythonConsole/PythonConsole_PyInterp.h
deleted file mode 100755 (executable)
index fce0563..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : PythonConsole_PyInterp.h
-//  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-
-#ifndef _PythonConsole_PYINTERP_H_
-#define _PythonConsole_PYINTERP_H_
-
-#include "PythonConsole.h"
-
-#include <PyInterp_base.h> // this include must be first (see PyInterp_base.h)!
-
-class PYCONSOLE_EXPORT PythonConsole_PyInterp : public PyInterp_base
-{
-public:
-  PythonConsole_PyInterp();
-  ~PythonConsole_PyInterp();
-
-protected:
-  virtual bool initState();
-  virtual bool initContext();  
-};
-
-#endif
index 03513ac3c629d77308ef56e3215ede5bfba90d94..c16f89d75989500ce52257dd54a1fca9c147fc2a 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Alexander SOLOVYOV (OCN)
 #  Module : QDS
 #  $Header: /home/server/cvs/GUI/GUI_SRC/src/QDS/Makefile.in
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libQDS.la
 
 # header files 
-salomeinclude_HEADERS= QDS.h \
-       QDS_CheckBox.h \
-       QDS_ComboBox.h \
-       QDS_Datum.h \
-       QDS_LineEdit.h \
-       QDS_SpinBox.h \
-       QDS_SpinBoxDbl.h \
-       QDS_TextEdit.h \
-       QDS_Validator.h
 
-dist_libQDS_la_SOURCES= \
-       QDS.cxx \
-       QDS_CheckBox.cxx \
-       QDS_ComboBox.cxx \
-       QDS_Datum.cxx \
-       QDS_LineEdit.cxx \
-       QDS_SpinBox.cxx \
-       QDS_SpinBoxDbl.cxx \
-       QDS_TextEdit.cxx \
-       QDS_Validator.cxx
-MOC_FILES= \
-       QDS_CheckBox_moc.cxx \
-       QDS_ComboBox_moc.cxx \
-       QDS_Datum_moc.cxx \
-       QDS_LineEdit_moc.cxx \
-       QDS_SpinBox_moc.cxx \
-       QDS_SpinBoxDbl_moc.cxx \
-       QDS_TextEdit_moc.cxx
-nodist_libQDS_la_SOURCES= $(MOC_FILES)
+#MKR: already migrated to Qt4 files
+salomeinclude_HEADERS =                \
+       QDS.h                   \
+       QDS_CheckBox.h          \
+       QDS_ComboBox.h          \
+       QDS_Datum.h             \
+       QDS_LineEdit.h          \
+       QDS_SpinBox.h           \
+       QDS_SpinBoxDbl.h        \
+       QDS_TextEdit.h          \
+       QDS_Validator.h         \
+       QDS_RadioBox.h
+
+#MKR: not yet migrated to Qt4 files
+#                              \
+       QDS_Table.h
+
+#MKR: already migrated to Qt4 files
+dist_libQDS_la_SOURCES =       \
+       QDS.cxx                 \
+       QDS_CheckBox.cxx        \
+       QDS_ComboBox.cxx        \
+       QDS_Datum.cxx           \
+       QDS_LineEdit.cxx        \
+       QDS_SpinBox.cxx         \
+       QDS_SpinBoxDbl.cxx      \
+       QDS_TextEdit.cxx        \
+       QDS_Validator.cxx       \
+       QDS_RadioBox.cxx
+
+#MKR: not yet migrated to Qt4 files
+#                              \
+       QDS_Table.cxx
+
+#MKR: already migrated to Qt4 files
+MOC_FILES =                    \
+       QDS_CheckBox_moc.cxx    \
+       QDS_ComboBox_moc.cxx    \
+       QDS_Datum_moc.cxx       \
+       QDS_LineEdit_moc.cxx    \
+       QDS_SpinBox_moc.cxx     \
+       QDS_SpinBoxDbl_moc.cxx  \
+       QDS_TextEdit_moc.cxx    \
+       QDS_RadioBox_moc.cxx
+
+#MKR: not yet migrated to Qt4 files
+#                              \
+       QDS_Table_moc.cxx
+
+nodist_libQDS_la_SOURCES = $(MOC_FILES)
 
-# may be neccessary for the external projects or future improvements
-EXTRA_DIST+= QDS_RadioBox.cxx QDS_RadioBox.h resources/QDS_msg_en.po
+nodist_salomeres_DATA = QDS_msg_en.qm
 
-libQDS_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) \
+libQDS_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) \
                    -I$(srcdir)/../Qtx -I$(srcdir)/../DDS
 
-libQDS_la_LDFLAGS=$(QT_MT_LIBS) $(CAS_KERNEL)
-libQDS_la_LIBADD=../DDS/libDDS.la ../Qtx/libqtx.la
+libQDS_la_LDFLAGS  = $(QT_MT_LIBS) $(CAS_KERNEL)
+libQDS_la_LIBADD   = ../DDS/libDDS.la ../Qtx/libqtx.la
 
index fb1cdae2448ec31ca1181cfee38d4c587d2517d2..052e4a287f8e891883801428b2b09d4ee84fabef 100644 (file)
@@ -1,26 +1,29 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QDS.h"
 
 #include "QDS_Datum.h"
 
-#include <qtextcodec.h>
+#include <QTextCodec>
 
 #include <DDS_DicItem.h>
 #include <DDS_Dictionary.h>
 #include <TCollection_HAsciiString.hxx>
 #include <TCollection_HExtendedString.hxx>
 
-QValueList<QDS_Datum*> QDS::_datumList;
+QList<QDS_Datum*> QDS::_datumList;
 
 /*!
-  Convert the OpenCascade ascii string to Qt string.
+  \class QDS
+  \brief A set of usefull static functions.
+*/
+
+/*!
+  \brief Convert the OpenCascade ASCII string to Qt string.
+  \param src OCC ASCII string
+  \return Qt string
 */
 QString QDS::toQString( const TCollection_AsciiString& src )
 {
@@ -44,7 +54,9 @@ QString QDS::toQString( const TCollection_AsciiString& src )
 }
 
 /*!
-  Convert the OpenCascade unicode string to Qt string.
+  \brief Convert the OpenCascade Unicode string to Qt string.
+  \param src OCC Unicode string
+  \return Qt string
 */
 QString QDS::toQString( const TCollection_ExtendedString& src )
 {
@@ -55,50 +67,57 @@ QString QDS::toQString( const TCollection_ExtendedString& src )
 }
 
 /*!
-  Convert the OpenCascade ascii string to Qt string.
+  \brief Convert the OpenCascade ASCII string to Qt string.
+  \param src handle to OCC ASCII string
+  \return Qt string
 */
 QString QDS::toQString( const Handle(TCollection_HAsciiString)& src )
 {
   if ( src.IsNull() )
-    return QString::null;
+    return QString();
   else
     return toQString( src->String() );
 }
 
 /*!
-  Convert the OpenCascade unicode string to Qt string.
+  \brief Convert the OpenCascade Unicode string to Qt string.
+  \param src handle to OCC Unicode string
+  \return Qt string
 */
 QString QDS::toQString( const Handle(TCollection_HExtendedString)& src )
 {
   if ( src.IsNull() )
-    return QString::null;
+    return QString();
   else
     return toQString( src->String() );
 }
 
 /*!
-  Convert the Qt string to OpenCascade ascii string.
+  \brief Convert the Qt string to OpenCascade ASCII string.
+  \param src Qt string
+  \return OCC ASCII string
 */
 TCollection_AsciiString QDS::toAsciiString( const QString& src )
 {
   TCollection_AsciiString res;
-  if ( src.latin1() )
+  if ( src.toLatin1().constData() )
   {
     QTextCodec* codec = QTextCodec::codecForLocale();
     if ( codec )
     {
-      int len = -1;
-      QCString str = codec->fromUnicode( src, len );
-      res = TCollection_AsciiString( (Standard_CString)(const char*)str, len );
+      QByteArray str = codec->fromUnicode( src );
+      res = TCollection_AsciiString( (Standard_CString)(const char*)str, str.size() );
     }
     else
-      res = TCollection_AsciiString( (char*)src.latin1() );
+      res = TCollection_AsciiString( (char*)src.toLatin1().constData() );
   }
   return res;
 }
 
 /*!
-  Convert the OpenCascade unicode string to OpenCascade ascii string.
+  \brief Convert the OpenCascade Unicode string to OpenCascade ASCII string.
+  \param src OCC Unicode string
+  \return OCC ASCII string
 */
 TCollection_AsciiString QDS::toAsciiString( const TCollection_ExtendedString& src )
 {
@@ -106,7 +125,9 @@ TCollection_AsciiString QDS::toAsciiString( const TCollection_ExtendedString& sr
 }
 
 /*!
-  Convert the OpenCascade unicode string to OpenCascade ascii string.
+  \brief Convert the OpenCascade Unicode string to OpenCascade ASCII string.
+  \param src handle to OCC Unicode string
+  \return OCC ASCII string
 */
 TCollection_AsciiString QDS::toAsciiString( const Handle(TCollection_HExtendedString)& src )
 {
@@ -117,7 +138,9 @@ TCollection_AsciiString QDS::toAsciiString( const Handle(TCollection_HExtendedSt
 }
 
 /*!
-  Convert the Qt string to OpenCascade unicode string.
+  \brief Convert the Qt string to OpenCascade Unicode string.
+  \param src Qt string
+  \return OCC Unicode string
 */
 TCollection_ExtendedString QDS::toExtString( const QString& src )
 {
@@ -125,7 +148,7 @@ TCollection_ExtendedString QDS::toExtString( const QString& src )
     return TCollection_ExtendedString();
 
   Standard_Integer len = src.length();
-  Standard_ExtString extStr = new Standard_ExtCharacter[( len + 1 ) * 2];
+  Standard_ExtCharacter* extStr = new Standard_ExtCharacter[( len + 1 ) * 2];
   memcpy( extStr, src.unicode(), len * 2 );
   extStr[len] = 0;
 
@@ -137,7 +160,9 @@ TCollection_ExtendedString QDS::toExtString( const QString& src )
 }
 
 /*!
-  Convert the OpenCascade ascii string to OpenCascade unicode string.
+  \brief Convert the OpenCascade ASCII string to OpenCascade Unicode string.
+  \param src OCC ASCII string
+  \return OCC Unicode string
 */
 TCollection_ExtendedString QDS::toExtString( const TCollection_AsciiString& src )
 {
@@ -145,8 +170,8 @@ TCollection_ExtendedString QDS::toExtString( const TCollection_AsciiString& src
 }
 
 /*!
-  Load datum definitions in the dictionary from XML file \adictPath.
-  Returns true if load successed or false otherwise.
+  \brief Load datum definitions from XML file \a dictPath to the dictionary.
+  \return \c true if loading is successed or \c false otherwise.
 */
 bool QDS::load( const QString& dictPath )
 {
@@ -157,9 +182,15 @@ bool QDS::load( const QString& dictPath )
 }
 
 /*!
-  Returns the label of unit system \asys. If component \acomp specified and not empty then
-  function find the given unit system in the given component otherwise all components will be searched.
-  If unit system not found then empty string returned.
+  \brief Get the label of unit system \a sys.
+
+  If component \a comp is specified and not empty then the function 
+  searches the given unit system in the specified component, otherwise 
+  all components will be searched.
+
+  \param sys unit system
+  \param comp component
+  \return unit system lavel or empty string if unit system is not found
 */
 QString QDS::unitSystemLabel( const QString& sys, const QString& comp )
 {
@@ -173,9 +204,16 @@ QString QDS::unitSystemLabel( const QString& sys, const QString& comp )
 }
 
 /*!
-  Gets the name of active unit system from the specified component \acomp.
-  If component not specified or component is empty string then first got component will be used.
-  If component exist then active unit system name returned or empty string otherwise.
+  \brief Get the name of active unit system from the specified component \a comp.
+
+  If component is not specified or empty string, then the first found 
+  component will be used.
+  
+  If component exists, then active unit system name is returned. Otherwise, 
+  empty string is returned.
+  
+  \param comp component
+  \return name of the active unit system
 */
 QString QDS::activeUnitSystem( const QString& comp )
 {
@@ -188,11 +226,18 @@ QString QDS::activeUnitSystem( const QString& comp )
 }
 
 /*!
-  Sets the active unit system named \asys. If not empty component name \acomp specified then
-  unit system will be activated in the given component otherwise all components will be processed.
+  \brief Set the active unit system.
+
+  If not empty component name \a comp is specified, then the unit system
+  will be activated in the given component, otherwise all components 
+  will be processed.
+
+  After the changing of active unit system function notifies about it all
+  registered datums from processed components using method 
+  QDS_Datum::unitSystemChanged()
 
-  After the changing of active unit system function notify about it to all registered datums
-  from processed components using method QDS_Datum::unitSystemChanged();
+  \param unit system to be set active
+  \param comp component
 */
 void QDS::setActiveUnitSystem( const QString& sys, const QString& comp )
 {
@@ -209,7 +254,7 @@ void QDS::setActiveUnitSystem( const QString& sys, const QString& comp )
     return;
 
   TCollection_AsciiString aComp = toAsciiString( comp );
-  for ( QValueList<QDS_Datum*>::iterator it = _datumList.begin(); it != _datumList.end(); ++it )
+  for ( QList<QDS_Datum*>::iterator it = _datumList.begin(); it != _datumList.end(); ++it )
   {
     QDS_Datum* datum = *it;
     if ( !datum )
@@ -228,8 +273,11 @@ void QDS::setActiveUnitSystem( const QString& sys, const QString& comp )
 }
 
 /*!
-  Register given datum \adatum in the static list.
-  This function invoked by QDS_Datum constructor.
+  \brief Register given datum \a datum in the global list.
+  
+  This function is invoked automatically by QDS_Datum constructor.
+  
+  \param datum datum being registered
 */
 void QDS::insertDatum( QDS_Datum* datum )
 {
@@ -240,13 +288,16 @@ void QDS::insertDatum( QDS_Datum* datum )
 }
 
 /*!
-  Remove given datum \adatum from the static list.
-  This function invoked by QDS_Datum destructor.
+  \brief Remove given datum \a datum from the global list.
+
+  This function is invoked automatically by QDS_Datum destructor.
+
+  \param datum datum being unregistered
 */
 void QDS::removeDatum( QDS_Datum* datum )
 {
   if ( !datum )
     return;
 
-  _datumList.remove( datum );
+  _datumList.removeAt( _datumList.indexOf(datum) );
 }
index 6f3fecd85a79ce471daa8b7c692e27e912363078..9472e53233e6a7b8cb335ff7991577822cf97529 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QDS_H
 #define QDS_H
 #pragma warning ( disable:4786 )
 #endif
 
-#include <qstring.h>
-#include <qvaluelist.h>
-
-#include <TCollection_AsciiString.hxx>
+#include <QString>
+#include <QList>
 
 #include <TCollection_ExtendedString.hxx>
 
@@ -48,7 +49,7 @@ class Handle(TCollection_HExtendedString);
 class QDS_EXPORT QDS
 {
 public:
-   /*! Enum describes bit flags of the Qt datum view and behaviour */
+  //! Enum describes bit flags of the Qt datum view and behaviour
   typedef enum
   {
     None = 0x00,                   //!< Non specified any flags (Default behaviour)
@@ -65,10 +66,10 @@ public:
   static bool                       load( const QString& );
 
   static QString                    unitSystemLabel( const QString&,
-                                                     const QString& = QString::null );
-  static QString                    activeUnitSystem( const QString& = QString::null );
+                                                     const QString& = QString() );
+  static QString                    activeUnitSystem( const QString& = QString() );
   static void                       setActiveUnitSystem( const QString&,
-                                                         const QString& = QString::null );
+                                                         const QString& = QString() );
 
   static QString                    toQString( const TCollection_AsciiString& );
   static QString                    toQString( const TCollection_ExtendedString& );
@@ -87,7 +88,7 @@ protected:
   static void                       removeDatum( QDS_Datum* );
 
 private:
-  static QValueList<QDS_Datum*>     _datumList;
+  static QList<QDS_Datum*>          _datumList;
 };
 
 #endif
diff --git a/src/QDS/QDS.pro b/src/QDS/QDS.pro
new file mode 100644 (file)
index 0000000..fa9b02c
--- /dev/null
@@ -0,0 +1,76 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = QDS
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
+
+INCLUDEPATH += ../../include $${CAS_CPPFLAGS} ../Qtx ../DDS
+LIBS += -L../../lib -lqtx -lDDS $${CAS_KERNEL}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += QDS_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = QDS.h
+HEADERS += QDS_CheckBox.h
+HEADERS += QDS_ComboBox.h
+HEADERS += QDS_Datum.h
+HEADERS += QDS_LineEdit.h
+HEADERS += QDS_SpinBox.h
+HEADERS += QDS_SpinBoxDbl.h
+HEADERS += QDS_TextEdit.h
+HEADERS += QDS_Validator.h
+HEADERS += QDS_RadioBox.h
+#HEADERS += QDS_Table.h
+
+SOURCES  = QDS.cxx
+SOURCES += QDS_CheckBox.cxx
+SOURCES += QDS_ComboBox.cxx
+SOURCES += QDS_Datum.cxx
+SOURCES += QDS_LineEdit.cxx
+SOURCES += QDS_SpinBox.cxx
+SOURCES += QDS_SpinBoxDbl.cxx
+SOURCES += QDS_TextEdit.cxx
+SOURCES += QDS_Validator.cxx
+SOURCES += QDS_RadioBox.cxx
+#SOURCES += QDS_Table.cxx
+
+TRANSLATIONS = resources/QDS_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 9713ca5e487fb495a27c0f5a4ca19928d1c2f497..862e7876ae38c3715e6ab90b06030af29b82fb4b 100644 (file)
@@ -1,46 +1,65 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QDS_CheckBox.h"
 
-#include <qcheckbox.h>
+#include <QCheckBox>
 
 /*
   \class QDS_CheckBox
-  
-  Datum with control corresponding to check box. This control can have only two states:
-  1 (on/true) or 0 (off/false). QDS_CheckBox don't take into account standard parameter
-  properties (minimum, maximum, filter, etc).
+  \brief Datum with control corresponding to check box.
+
+  This control can have only two states:
+  - 1 (on/true)
+  - 0 (off/false).
+
+  QDS_CheckBox don't take into account standard parameter properties
+  (minimum, maximum, filter, etc).
 
   QDS_CheckBox can set and get following values for access methods (setStringValue(),
   setIntegerValue(), setDoubleValue(), stringValue(), integerValue(), doubleValue()):
-    \li "1"  - check box state is setted as on.
-    \li "0"  - check box state is setted as off.
-    \li "-1" - check box state is setted as "NoChage" (undefined).
+  - "1"  - check box state is switched on.
+  - "0"  - check box state is switched off.
+  - "-1" - check box state is "PartiallyChecked" (undefined).
 
-  User can set and check a state "NoChange" using methods clear() and isEmpty() accordingly.
+  User can set and test "PartiallyChecked" check using methods clear() 
+  and isEmpty() correspondingly.
 */
 
 /*!
-  Constructor. Create check box datum object with datum identifier \aid under widget \aparent.
-  Parameter \aflags define behaviour of datum and set of created subwidgets. Default value of
-  this parameter is QDS::All. Parameter \acomp specify the component name which will be used
-  during search of dictionary item.
+  \brief Constructor. 
+
+  Create check box datum object with datum identifier \a id 
+  and parent widget \a parent.
+
+  Parameter \a flags defines behaviour of datum and set of created
+  subwidgets. Default value of this parameter is QDS::All. 
+  
+  Parameter \a comp specifies the component name which will be used
+  when searching the dictionary item.
+
+  \param id datum identifier
+  \param parent parent widget
+  \param flags datum flags
+  \param comp component
 */
 QDS_CheckBox::QDS_CheckBox( const QString& id, QWidget* parent, const int flags, const QString& comp )
 : QDS_Datum( id, parent, flags, comp )
@@ -48,14 +67,14 @@ QDS_CheckBox::QDS_CheckBox( const QString& id, QWidget* parent, const int flags,
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QDS_CheckBox::~QDS_CheckBox()
 {
 }
 
 /*!
-  Sets the state "NoChange" for checkbox.
+  \brief Set the state "PartiallyChecked" (undefined) for checkbox.
 */
 void QDS_CheckBox::clear()
 {
@@ -63,20 +82,26 @@ void QDS_CheckBox::clear()
 }
 
 /*!
-  Returns string from QCheckBox widget. If the check box state is on then 1 returned otherwise 0.
+  \brief Get string value from the widget.
+  \return "1" if check box is checked on and "0" otherwise
 */
 QString QDS_CheckBox::getString() const
 {
   QString val;
-  if ( checkBox() && checkBox()->state() != QButton::NoChange )
+  if ( checkBox() && checkBox()->checkState() != Qt::PartiallyChecked )
     val = checkBox()->isChecked() ? "1" : "0";
   return val;
 }
 
 /*!
-  Sets the string into QCheckBox widget. If argument \atxt is string with number "1" then check box
-  state is setted as on. If argument \atxt is string with number "0" then state is setted as off.
-  If argument \atxt is string with number "-1" then state is setted as "NoChage" (undefined).
+  \brief Set the string value into the widget.
+
+  If string \a txt contains "1", then check box state is switched on.
+  If string \a txt contains "0", then check box state is switched on.
+  If string \a txt contains "-1", then check box is reset to 
+  "PartiallyChecked" (undefined) state.
+
+  \param txt string value
 */
 void QDS_CheckBox::setString( const QString& txt )
 {
@@ -88,22 +113,25 @@ void QDS_CheckBox::setString( const QString& txt )
   if ( isOk && val < 0 )
   {
     checkBox()->setTristate();
-    checkBox()->setNoChange();
+    checkBox()->setCheckState(Qt::PartiallyChecked);
   }
   else
     checkBox()->setChecked( isOk && val != 0 );
 }
 
 /*!
-  Returns pointer to QCheckBox widget.
+  \brief Get internal check box.
+  \return pointer to QCheckBox widget
 */
 QCheckBox* QDS_CheckBox::checkBox() const
 {
-  return ::qt_cast<QCheckBox*>( controlWidget() );
+  return ::qobject_cast<QCheckBox*>( controlWidget() );
 }
 
 /*!
-  Create QCheckBox widget as control subwidget.
+  \brief Create internal check box as control widget.
+  \param parent parent widget
+  \return created check box widget
 */
 QWidget* QDS_CheckBox::createControl( QWidget* parent )
 {
@@ -115,7 +143,9 @@ QWidget* QDS_CheckBox::createControl( QWidget* parent )
 }
 
 /*!
-  Notify about Ã±hanging of control state
+  \brief Called when check box is switched.
+
+  Emits signal paramChanged() to notify about changing of the control state.
 */
 void QDS_CheckBox::onParamChanged()
 {
@@ -123,17 +153,21 @@ void QDS_CheckBox::onParamChanged()
 }
 
 /*!
-  Notify about Ã±hanging of control state. Switch off check box property "tristate" when
-  state changed by user.
+  \brief Called when check box is switched.
+
+  Switch off check box property "tristate" when state is changed by the user.
+
+  \param state new check box state
 */
 void QDS_CheckBox::onStateChanged( int state )
 {
-  if ( state != QButton::NoChange && checkBox() )
+  if ( state != Qt::PartiallyChecked && checkBox() )
     checkBox()->setTristate( false );
 }
 
 /*!
-  Sets the check box state \atheState.
+  \brief Set the check box state to \a theState.
+  \param theState new check box state
 */
 void QDS_CheckBox::setChecked( const bool theState )
 {
@@ -142,9 +176,16 @@ void QDS_CheckBox::setChecked( const bool theState )
 }
 
 /*!
-  Returns current check box state.
+  \brief Get current check box state.
+  \return check box state
 */
 bool QDS_CheckBox::isChecked() const
 {
   return checkBox() ? checkBox()->isChecked() : false;
 }
+
+/*!
+  \fn void QDS_CheckBox::toggled( bool on );
+  \brief Emitted when the check box state is toggled.
+  \param on new check box state
+*/
index 9be0dde19f4d7ef7a38fe6da34509df46836efd3..d5bd69543e18d8fa7aeac3f488df3275451a886f 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QDS_CHECKBOX_H
 #define QDS_CHECKBOX_H
@@ -28,7 +31,7 @@ class QDS_EXPORT QDS_CheckBox : public QDS_Datum
   Q_OBJECT
 
 public:
-  QDS_CheckBox( const QString&, QWidget* = 0, const int = All, const QString& = QString::null );
+  QDS_CheckBox( const QString&, QWidget* = 0, const int = All, const QString& = QString() );
   virtual ~QDS_CheckBox();
 
   bool                 isChecked() const;
index ac068735e4edddb9660a29596bc254c5519bcaf3..e7c2890272e98192e327af81eae9a4b527247e8f 100644 (file)
@@ -1,43 +1,61 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QDS_ComboBox.h"
 
-#include <DDS_Dictionary.h>
+#include <QtxComboBox.h>
 
-#include <TCollection_AsciiString.hxx>
 #include <TColStd_HArray1OfInteger.hxx>
 #include <TColStd_HArray1OfExtendedString.hxx>
 
-#include <qlineedit.h>
+#include <QLineEdit>
 
 /*
   \class QDS_ComboBox
   
-  Datum with control corresponding to combo box. This control used for datum with enumerable values.
-  It can be used for datum which has type of value 'List'. Each item of combobox defined two properties:
-  integer identifier and string name. All operations on items performed via identifier.
+  \brief Datum with control corresponding to the combo box. 
+
+  This control is used for datum with enumerable values.
+  It can be used for datum which has type of value 'List'. 
+
+  Each item of the combobox is defined by two properties: integer identifier 
+  and string name. All operations on items are performed via identifier.
 */
 
 /*!
-  Constructor. Create combobox datum object with datum identifier \aid under widget \aparent. Parameter \aflags
-  define behaviour of datum and set of created subwidgets. Default value of this parameter is QDS::All.
-  Parameter \acomp specify the component name which will be used during search of dictionary item.
+  \brief Constructor. 
+
+  Create combobox datum object with datum identifier \a id 
+  and parent widget \a parent. 
+
+  Parameter \a flags defines behaviour of datum and set of created
+  subwidgets. Default value of this parameter is QDS::All.
+
+  Parameter \a comp specifies the component name which will be used
+  when searching the dictionary item.
+
+  \param id datum identifier
+  \param parent parent widget
+  \param flags datum flags
+  \param comp component
 */
 QDS_ComboBox::QDS_ComboBox( const QString& id, QWidget* parent, const int flags, const QString& comp )
 : QDS_Datum( id, parent, flags, comp )
@@ -45,14 +63,15 @@ QDS_ComboBox::QDS_ComboBox( const QString& id, QWidget* parent, const int flags,
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QDS_ComboBox::~QDS_ComboBox()
 {
 }
 
 /*!
-  Returns true if ComboBox allow to edit current text.
+  \brief Check if combo box allows text editing.
+  \return \c true if combo box is editable
 */
 bool QDS_ComboBox::editable() const
 {
@@ -63,7 +82,8 @@ bool QDS_ComboBox::editable() const
 }
 
 /*!
-  Sets the possibily of current text editing.
+  \brief Enable/disable text editing.
+  \param on if \c true, combo box is made editable
 */
 void QDS_ComboBox::setEditable( const bool on )
 {
@@ -73,15 +93,18 @@ void QDS_ComboBox::setEditable( const bool on )
   if ( aCombo && aCombo->lineEdit() )
   {
     aCombo->lineEdit()->setReadOnly( !on );
-    aCombo->clearValidator();
+    aCombo->setValidator(0);
     if ( on )
       aCombo->setValidator( validator() );
   }
 }
 
 /*!
-  Returns number of items in ComboBox. If \atotal is 'false' then only
-  visible items are taken into account otherwise all items.
+  \brief Get number of items in the combo box.
+
+  \param total if \c false, only visible items are taken into account, 
+        otherwise get total number of items
+  \return number of items
 */
 int QDS_ComboBox::count( bool total ) const
 {
@@ -94,10 +117,13 @@ int QDS_ComboBox::count( bool total ) const
 }
 
 /*!
-  Returns list of list item identifiers \aids. If \atotal is 'false' then only visible items
-  are taken into account otherwise all items.
+  \brief Get items identifiers.
+
+  \param ids returned list of items IDs
+  \param total if \c false, only visible items are taken into account, 
+        otherwise get total number of items
 */
-void QDS_ComboBox::values( QValueList<int>& ids, bool total ) const
+void QDS_ComboBox::values( QList<int>& ids, bool total ) const
 {
   ids.clear();
   for ( QIntList::const_iterator it = myDataIds.begin(); it != myDataIds.end(); ++it )
@@ -106,23 +132,25 @@ void QDS_ComboBox::values( QValueList<int>& ids, bool total ) const
 }
 
 /*!
-  Returns the current id as integer. Reimplemented.
+  \brief Get the current item ID as integer value.
+  \return current item ID converted to integer
 */
 int QDS_ComboBox::integerValue() const
 {
   QComboBox* cb = comboBox();
   QString cur = getString();
-  if ( cb && cb->count() > 0 && cb->currentItem() >= 0 )
-    cur = cb->text( cb->currentItem() );
+  if ( cb && cb->count() > 0 && cb->currentIndex() >= 0 )
+    cur = cb->itemText( cb->currentIndex() );
 
   if ( cb && cur == getString() )
-    return getId( cb->currentItem() );
+    return getId( cb->currentIndex() );
   else
     return getId( getString() );
 }
 
 /*!
-  Returns the current id as double. Reimplemented.
+  \brief Get the current item ID as double value.
+  \return current item ID converted to double
 */
 double QDS_ComboBox::doubleValue() const
 {
@@ -130,17 +158,18 @@ double QDS_ComboBox::doubleValue() const
 
   QComboBox* cb = comboBox();
   QString cur = getString();
-  if ( cb && cb->count() > 0 && cb->currentItem() >= 0 )
-    cur = cb->text( cb->currentItem() );
+  if ( cb && cb->count() > 0 && cb->currentIndex() >= 0 )
+    cur = cb->itemText( cb->currentIndex() );
 
   if ( cb && cur == getString() )
-    return getId( cb->currentItem() );
+    return getId( cb->currentIndex() );
   else
     return getId( getString() );
 }
 
 /*!
-  Set the current item acording to specified id. Reimplemented.
+  \brief Set the current item acording to the specified \a id.
+  \param id item ID
 */
 void QDS_ComboBox::setIntegerValue( const int id )
 {
@@ -153,7 +182,12 @@ void QDS_ComboBox::setIntegerValue( const int id )
 }
 
 /*!
-  Get the integer part of specified value and use it as new current identifier. Reimplemented.
+  \brief Set the current item acording to the specified \a id.
+  \overload
+
+  Integer part of \a val is used as new current ID.
+  
+  \param val item ID
 */
 void QDS_ComboBox::setDoubleValue( const double val )
 {
@@ -167,7 +201,9 @@ void QDS_ComboBox::setDoubleValue( const double val )
 }
 
 /*!
-  Returns visible state of item specified by \aid.
+  \brief Get visibility state of the item specified by \a id.
+  \param id item ID
+  \return item visibility state
 */
 bool QDS_ComboBox::state( const int id ) const
 {
@@ -178,13 +214,20 @@ bool QDS_ComboBox::state( const int id ) const
 }
 
 /*!
-  Sets the visible state of item specified by \aid. If \aid is -1 then specified
-  state will be set to all items. If \aappend is set then keep status for other items
-  otherwise status of other items will be cleared.
+  \brief Set the visibility state of the item specified by \a id.
+
+  If \a id is -1 then specified state will be set to all items.
+
+  If \a append is set to \c true, keep current status for other items,
+  otherwise status of other items is cleared.
+
+  \param on new visibility state
+  \param id item ID
+  \param append if \c true, keep original status for other items
 */
 void QDS_ComboBox::setState( const bool on, const int id, const bool append )
 {
-  QValueList<int> lst;
+  QList<int> lst;
   if ( id < 0 )
   {
     for ( IdStateMap::Iterator it = myState.begin(); it != myState.end(); ++it )
@@ -197,11 +240,16 @@ void QDS_ComboBox::setState( const bool on, const int id, const bool append )
 }
 
 /*!
-  Sets the visible state of items specified by list of identifiers \aids.
-  If \aappend is set then keep status for other items otherwise status of other
-  items will be cleared.
+  \brief Set the visibility state of items specified by \a ids.
+
+  If \a append is set to \c true, keep current status for other items,
+  otherwise status of other items is cleared.
+
+  \param on new visibility state
+  \param ids items IDs list
+  \param append if \c true, keep original status for other items
 */
-void QDS_ComboBox::setState( const bool on, const QValueList<int>& ids, const bool append )
+void QDS_ComboBox::setState( const bool on, const QList<int>& ids, const bool append )
 {
   initDatum();
 
@@ -212,21 +260,21 @@ void QDS_ComboBox::setState( const bool on, const QValueList<int>& ids, const bo
 
   QMap<int, int> aMap;
   for ( uint i = 0; i < ids.count(); i++ )
-    aMap.insert( *ids.at( i ), 0 );
+    aMap.insert( ids.at( i ), 0 );
 
   for ( IdStateMap::Iterator it = myState.begin(); it != myState.end(); ++it )
   {
     if ( aMap.contains( it.key() ) )
     {
-      if ( it.data() != on )
+      if ( it.value() != on )
       {
-        it.data() = on;
+        it.value() = on;
         changed = true;
       }
     }
-    else if ( !append && it.data() == on )
+    else if ( !append && it.value() == on )
     {
-      it.data() = !on;
+      it.value() = !on;
       changed = true;
     }
   }
@@ -235,11 +283,16 @@ void QDS_ComboBox::setState( const bool on, const QValueList<int>& ids, const bo
 }
 
 /*!
-  Sets the custom user items into the combo box. User items like standard dictionary
-  list items will be added into the combobox. This functionality allow to user override
+  \brief Set the custom user items into the combo box.
+
+  User items like standard dictionary list items will be added
+  into the combobox. This function allows user to override
   items.
+
+  \param ids items IDs
+  \param names items names
 */
-void QDS_ComboBox::setValues( const QValueList<int>& ids, const QStringList& names )
+void QDS_ComboBox::setValues( const QList<int>& ids, const QStringList& names )
 {
   initDatum();
 
@@ -248,42 +301,52 @@ void QDS_ComboBox::setValues( const QValueList<int>& ids, const QStringList& nam
 
   myUserIds = ids;
   myUserNames = names;
+
+  unitSystemChanged( "" );
 }
 
 /*!
-  This is an overloaded member function, provided for convenience.
-  It behaves essentially like the above function. It creates
-  QValueList (0, 1, 2 ... ) and call previous method.
+  \brief Set the custom user items into the combo box.
+  \overload
+
+  User items like standard dictionary list items will be added
+  into the combobox. This function allows user to override
+  items.
+
+  Uses (0, 1, 2 ... ) as items IDs.
+
+  \param names items names
 */
 void QDS_ComboBox::setValues( const QStringList& names )
 {
   initDatum();
 
-  QValueList< int > ids;
+  QList< int > ids;
   for ( int i = 0, n = names.count(); i < n; i++ )
     ids.append( i );
   setValues( ids, names );
 }
 
 /*!
-  Sets the active item as item with default id. If default
-  not defined then first item will be used.
+  \brief Reset the datum.
+
+  Set the active item as item with default ID. If default ID is not defined
+  then the first item is used.
 */
 void QDS_ComboBox::reset()
 {
   int id = -1;
   QString aDefValue = defaultValue();
   if ( !aDefValue.isEmpty() )
-    id = aDefValue.toInt();
-
-  if ( id == -1 )
-    id = getId( 0 );
-
-  setIntegerValue( id );
+    setString( aDefValue );
+  else
+    setIntegerValue( getId( 0 ) );
 }
 
 /*!
-  Returns identifier from given ComboBox string item.
+  \brief Convert string to integer value.
+  \param str item
+  \return item ID or -1 if not found
 */
 int QDS_ComboBox::stringToValue( const QString& str ) const
 {
@@ -291,7 +354,9 @@ int QDS_ComboBox::stringToValue( const QString& str ) const
 }
 
 /*!
-  Returns ComboBox string item from given identifier.
+  \brief Convert integer to string value.
+  \param val item ID 
+  \return item value or empty string if \c val is invalid
 */
 QString QDS_ComboBox::valueToString( const int val ) const
 {
@@ -302,7 +367,8 @@ QString QDS_ComboBox::valueToString( const int val ) const
 }
 
 /*!
-  Returns string from QComboBox widget. Reimplemented.
+  \brief Get string from the combo box.
+  \return string value
 */
 QString QDS_ComboBox::getString() const
 {
@@ -310,7 +376,7 @@ QString QDS_ComboBox::getString() const
   QtxComboBox* cb = comboBox();
   if ( cb )
   {
-    if ( !cb->editable() )
+    if ( !cb->isEditable() )
     {
       if ( !cb->isCleared() )
         res = cb->currentText(); 
@@ -322,7 +388,8 @@ QString QDS_ComboBox::getString() const
 }
 
 /*!
-  Sets the string into QComboBox widget. Reimplemented.
+  \brief Set the string value to the combo box widget.
+  \param txt string value
 */
 void QDS_ComboBox::setString( const QString& txt )
 {
@@ -334,20 +401,20 @@ void QDS_ComboBox::setString( const QString& txt )
   
   int idx = -1;
   for ( int i = 0; i < cb->count() && idx == -1; i++ )
-    if ( cb->text( i ) == txt )
+    if ( cb->itemText( i ) == txt )
       idx = i;
 
-  int old = cb->currentItem();
+  int old = cb->currentIndex();
   if ( idx != -1 )
-    cb->setCurrentItem( idx );
+    cb->setCurrentIndex( idx );
   else if ( txt.isEmpty() )
   {
-    if ( !cb->editable() )
-      cb->setCurrentText( txt );
+    if ( !cb->isEditable() )
+      cb->setItemText( cb->currentIndex(), txt );
     else
       cb->lineEdit()->setText( txt );
   }
-  if ( isClear != txt.isEmpty() || ( !isClear && old != cb->currentItem() ) )
+  if ( isClear != txt.isEmpty() || ( !isClear && old != cb->currentIndex() ) )
   {
     onParamChanged();
     QString str = getString();
@@ -359,15 +426,18 @@ void QDS_ComboBox::setString( const QString& txt )
 }
 
 /*!
-  Returns pointer to QtxComboBox widget.
+  \brief Get combo box widget.
+  \return internal combo box widget
 */
 QtxComboBox* QDS_ComboBox::comboBox() const
 {
-  return ::qt_cast<QtxComboBox*>( controlWidget() );
+  return ::qobject_cast<QtxComboBox*>( controlWidget() );
 }
 
 /*!
-  Create QComboBox widget as control subwidget. Reimplemented.
+  \brief Create internal combo box as control widget.
+  \param parent parent widget
+  \return created combo box widget
 */
 QWidget* QDS_ComboBox::createControl( QWidget* parent )
 {
@@ -380,8 +450,11 @@ QWidget* QDS_ComboBox::createControl( QWidget* parent )
 }
 
 /*!
-  Notification about active unit system changing. Reimplemented from QDS_Datum.
-  Update combobox content.
+  \brief Process notification about active units system changing.
+
+  Update combobox contents.
+  
+  \param system new active units system
 */
 void QDS_ComboBox::unitSystemChanged( const QString& system )
 {
@@ -462,9 +535,10 @@ void QDS_ComboBox::unitSystemChanged( const QString& system )
 }
 
 /*!
-  Notify about text changing in line edit of ComboBox.
+  \brief Called when text in the combo box (editable) is modified by the user.
+  \param txt current text in the combo box editor (not used)
 */
-void QDS_ComboBox::onTextChanged( const QString& )
+void QDS_ComboBox::onTextChanged( const QString& /*txt*/ )
 {
   onParamChanged();
   emit paramChanged();
@@ -473,12 +547,13 @@ void QDS_ComboBox::onTextChanged( const QString& )
 }
 
 /*!
-  Notify about activation combobox item.
+  \brief Called when combo box item is activated.
+  \param idx index of teh item being activated
 */
 void QDS_ComboBox::onActivated( int idx )
 {
   if ( comboBox() )
-    comboBox()->setCurrentItem( comboBox()->currentItem() );
+    comboBox()->setCurrentIndex( comboBox()->currentIndex() );
 
   int id = getId( idx );
   if ( id != -1 )
@@ -493,7 +568,7 @@ void QDS_ComboBox::onActivated( int idx )
 }
 
 /*!
-  Updates ComboBox after have change of visible state or items have been inserted/removed.
+  \brief Update combo box.
 */
 void QDS_ComboBox::updateComboBox()
 {
@@ -507,7 +582,7 @@ void QDS_ComboBox::updateComboBox()
   {
     isClear = cb->isCleared();
 
-    curId = getId( cb->currentItem() );
+    curId = getId( cb->currentIndex() );
     cb->clear();
   }
 
@@ -524,9 +599,9 @@ void QDS_ComboBox::updateComboBox()
     if ( cb )
     {
       if ( myIcons.contains( id ) )
-        cb->insertItem( myIcons[id], myValue[id] );
+        cb->addItem( QIcon(myIcons[id]), myValue[id] );
       else
-        cb->insertItem( myValue[id] );
+        cb->addItem( myValue[id] );
     }
   }
 
@@ -536,19 +611,21 @@ void QDS_ComboBox::updateComboBox()
     cb->updateGeometry();
 
     if ( isClear )
-      cb->setCurrentText( "" );
+      cb->setItemText( cb->currentIndex(), "" );
     else
     {
       if ( getIndex( curId ) != -1 )
-        cb->setCurrentItem( getIndex( curId ) );
-      if ( curId != getId( cb->currentItem() ) )
-        onActivated( cb->currentItem() );
+        cb->setCurrentIndex( getIndex( curId ) );
+      if ( curId != getId( cb->currentIndex() ) )
+        onActivated( cb->currentIndex() );
     }
   }
 }
 
 /*!
-  Returns index of ComboBox item according to id.
+  \brief Get index of the combo box item according to its identifier.
+  \param id item ID
+  \return item index or -1 if not found
 */
 int QDS_ComboBox::getIndex( const int id ) const
 {
@@ -559,7 +636,9 @@ int QDS_ComboBox::getIndex( const int id ) const
 }
 
 /*!
-  Returns index of ComboBox item according to string.
+  \brief Get index of the combo box item.
+  \param str combo box item
+  \return item index or -1 if not found
 */
 int QDS_ComboBox::getIndex( const QString& str ) const
 {
@@ -568,27 +647,31 @@ int QDS_ComboBox::getIndex( const QString& str ) const
   if ( cb )
   {
     for ( int i = 0; i < cb->count() && idx == -1; i++ )
-      if ( cb->text( i ) == str )
+      if ( cb->itemText( i ) == str )
         idx = i;
   }
   return idx;
 }
 
 /*!
-  Returns id according to ComboBox item index.
+  \brief Get item identifier according to the specified index.
+  \param idx item index
+  \return item ID or -1 if index is out of range
 */
 int QDS_ComboBox::getId( const int idx ) const
 {
   int id = -1;
   IdIndexMap::ConstIterator it = myIndex.begin();
   for (; it != myIndex.end() && id == -1; ++it )
-    if ( it.data() == idx )
+    if ( it.value() == idx )
       id = it.key();
   return id;
 }
 
 /*!
-  Returns id according to ComboBox item string.
+  \brief Get item identifier.
+  \param str combo box item
+  \return item ID or -1 if not found
 */
 int QDS_ComboBox::getId( const QString& str ) const
 {
@@ -597,7 +680,7 @@ int QDS_ComboBox::getId( const QString& str ) const
   IdValueMap::ConstIterator it = myValue.begin();
   for (; it != myValue.end() && id == -1; ++it )
   {
-    if ( it.data() == str )
+    if ( it.value() == str )
     {
       if ( state( it.key() ) )
         id = it.key();
@@ -610,3 +693,15 @@ int QDS_ComboBox::getId( const QString& str ) const
 
   return id;
 }
+
+/*!
+  \fn void QDS_ComboBox::activated( int id );
+  \brief Emitted when the current item in the combo box is changed.
+  \param id current item ID
+*/
+
+/*!
+  \fn void QDS_ComboBox::activated( const QString& txt );
+  \brief Emitted when the current item in the combo box is changed.
+  \param txt current item text
+*/
index 2a8791702fac0c0a6fb95e4a528e988ba2a36917..8bc0f1c58a69225d7a82b1560551f4fa7f981e26 100644 (file)
@@ -1,33 +1,38 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QDS_COMBOBOX_H
 #define QDS_COMBOBOX_H
 
 #include "QDS_Datum.h"
 
-#include <qmap.h>
-#include <qpixmap.h>
-#include <qstringlist.h>
+#include <QMap>
+#include <QPixmap>
+#include <QStringList>
+
+#include <Qtx.h>
 
-#include <QtxComboBox.h>
+class QtxComboBox;
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
@@ -36,14 +41,14 @@ class QDS_EXPORT QDS_ComboBox : public QDS_Datum
   Q_OBJECT
 
 public:
-  QDS_ComboBox( const QString&, QWidget* = 0, const int = All, const QString& = QString::null );
+  QDS_ComboBox( const QString&, QWidget* = 0, const int = All, const QString& = QString() );
   virtual ~QDS_ComboBox();
 
   bool                       editable() const;
   void                       setEditable( const bool );
 
   int                        count( bool = false ) const;
-  void                       values( QValueList<int>&, bool = false ) const;
+  void                       values( QList<int>&, bool = false ) const;
 
   virtual int                integerValue() const;
   virtual double             doubleValue() const;
@@ -52,8 +57,8 @@ public:
 
   bool                       state( const int ) const;
   void                       setState( const bool, const int, const bool = true );
-  void                       setState( const bool, const QValueList<int>&, const bool = true );
-  void                       setValues( const QValueList<int>&, const QStringList& );
+  void                       setState( const bool, const QList<int>&, const bool = true );
+  void                       setValues( const QList<int>&, const QStringList& );
   void                       setValues( const QStringList& );
 
   virtual void               reset();
@@ -103,7 +108,7 @@ private:
   QStringList                myUserNames;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( default:4251 )
 #endif
 
index a542a19b40812925a21e09d4db3bea9099201eed..4394119f5e8f0cf4d9062a00da2d0e4d758810a3 100644 (file)
@@ -1,41 +1,40 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QDS_Datum.h"
 
-#include "QDS_Validator.h"
+#include <QLayout>
+#include <QVariant>
+#include <QTimer>
+#include <QEvent>
+#include <QMessageBox>
+#include <QApplication>
 
+#include "QDS_Validator.h"
 #include <DDS_Dictionary.h>
 
-#include <qtimer.h>
-#include <qlabel.h>
-#include <qwidget.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qvalidator.h>
-#include <qmessagebox.h>
-
-#include <TColStd_SequenceOfAsciiString.hxx>
-
 /*!
-  class: QDS_Datum::Wrapper
-  descr: Wrapper widget for sub widgets. [internal]
+  \class QDS_Datum::Wrapper
+  \internal
+  \brief Wrapper for sub widgets.
 */
 
 class QDS_Datum::Wrapper : public QWidget
@@ -44,47 +43,62 @@ public:
   Wrapper( QWidget* = 0 );
   virtual ~Wrapper();
 
-  QWidget*      widget() const;
-  void          setWidget( QWidget* );
+  QWidget* widget() const;
+  void     setWidget( QWidget* );
 
   virtual void  setGeometry( int x, int y, int w, int h );
   virtual void  setSizePolicy( QSizePolicy );
 
 private:
-  QWidget*      myWid;
+  QWidget* myWid;
 };
 
+/*!
+  \brief Constructor.
+  \param parent parent widget
+*/
 QDS_Datum::Wrapper::Wrapper( QWidget* parent )
 : QWidget( parent ),
-myWid( 0 )
+  myWid( 0 )
 {
-  QHBoxLayout* base = new QHBoxLayout( this );
-  base->setAutoAdd( true );
-  setFocusPolicy( StrongFocus );
+  setLayout( new QHBoxLayout() );
+  layout()->setSpacing( 0 );
+  layout()->setMargin( 0 );
+  setFocusPolicy( Qt::StrongFocus );
 }
 
+/*!
+  \brief Destructor.
+*/
 QDS_Datum::Wrapper::~Wrapper()
 {
 }
 
+/*!
+  \brief Get widget.
+  \return widget
+*/
 QWidget* QDS_Datum::Wrapper::widget() const
 {
   return myWid;
 }
 
+/*!
+  \brief Set widget.
+  \param wid widget
+*/
 void QDS_Datum::Wrapper::setWidget( QWidget* wid )
 {
-  if ( myWid == wid )
+  if ( myWid == wid || !wid )
     return;
 
+  wid->setParent( this );
+  QHBoxLayout* hl = qobject_cast<QHBoxLayout*>( layout() );
+  if( myWid )
+    hl->removeWidget( myWid );
+  hl->addWidget( wid );
   myWid = wid;
 
-  if ( !myWid )
-    return;
-
-  if ( myWid->parent() != this )
-    myWid->reparent( this, QPoint( 0, 0 ) );
-
   setTabOrder( this, myWid );
   setFocusProxy( myWid );
 
@@ -92,6 +106,10 @@ void QDS_Datum::Wrapper::setWidget( QWidget* wid )
   updateGeometry();
 }
 
+/*!
+  \brief Set size policy of the widget.
+  \param sp new size policy
+*/
 void QDS_Datum::Wrapper::setSizePolicy( QSizePolicy sp )
 {
   QWidget::setSizePolicy( sp );
@@ -100,6 +118,13 @@ void QDS_Datum::Wrapper::setSizePolicy( QSizePolicy sp )
     widget()->setSizePolicy( sp );
 }
 
+/*!
+  \brief Set widget geometry.
+  \param x horizontal position
+  \param y vertical position
+  \param w widget width
+  \param h widget height
+*/
 void QDS_Datum::Wrapper::setGeometry( int x, int y, int w, int h )
 {
   QWidget::setGeometry( x, y, w, h );
@@ -110,55 +135,76 @@ void QDS_Datum::Wrapper::setGeometry( int x, int y, int w, int h )
 
 /*!
   \class QDS_Datum
-
-  This is a base class for control using the data dictionary. Datum is successor of QObject (not QWidget).
-  This object can have three sub widgets named as Label, Control and Units. User can skip creation of
-  some of them manipulate by parameter \aflags. Label widget display label of datum, Control widget allow
-  to input value, Units widget display units of measure in the active system.
+  \brief Base class for all controls using the data dictionary. 
+
+  Datum is successor of QObject (not QWidget). This object can have up to three
+  sub widgets named as QDS::Label, QDS::Control and QDS::Units. 
+  User can prevent creation of any of them by setting corresponding subwidgets IDs
+  in the parameter \a flags of the constructor.
+  QDS::Label widget displays label of datum, QDS::Control widget allows 
+  entering the value and QDS::Units widget displays measure units in the active 
+  units system.
   
-  These widgets constructs under parent of datum. If this parent has layout which can automaticaly add child
-  widgets (see QLayout::setAutoAdd()) then these subwidgets will be placed in following order: first widget
-  is Label, second - Control, third - Unints. User can add these widgets to layout manually using methods
-  QDS_Datum::addTo() or QDS_Datum::widget(). In last case User can retrieve desired widget and place it into
-  layout.
+  These widgets are constructed under the parent widget of the datum. 
+  The sub widgets are layouted in the parent widget in the following order: first widget
+  is QDS::Label, it is followed by QDS::Control, and in the end is QDS::Units.
+  User can add these widgets to layout manually using method addTo().
+  Method widget() can be used to retrieve desired widget and place it into layout.
 
-  If use QGroupBox as parent widget for datum object then all subwidgets will be arranged automatically by
-  group box according to column and orientation properties of QGroupBox.
+  When QGroupBox is used as parent widget for datum object, all subwidgets are 
+  arranged automatically by the group box according to the column and orientation
+  properties of the QGroupBox.
 
-  For example:
-    QGroupBox* box = new QGroupBox( 3, Qt::Horizontal, "datum box" );
-    QDS_Datum* d1  = new QDS_Datum( "datum_1", box, All );
-    QDS_Datum* d2  = new QDS_Datum( "datum_2", box, All );
-    QDS_Datum* d3  = new QDS_Datum( "datum_3", box, All );
+  Example:
+  \code
+  QGroupBox* box = new QGroupBox( 3, Qt::Horizontal, "datum box" );
+  QDS_Datum* d1  = new QDS_Datum( "datum_1", box, All );
+  QDS_Datum* d2  = new QDS_Datum( "datum_2", box, All );
+  QDS_Datum* d3  = new QDS_Datum( "datum_3", box, All );
+  \endcode
 
-  In this example we create the QGroupBox with 3 horizontal columns. All created datum widgets will be
-  placed automatically three widgets in a row. Each datum will be placed from up to bottom one by one.
+  In this example we create the QGroupBox with 3 horizontal columns. 
+  All the created datum widgets will be placed automatically in 3 rows.
+  Datums will be placed from top to bottom one by one and aligned in he grid.
 
-  Datum value is stored as string. User can get/set this value in different kinds:
-    \liAs string  - methods stringValue()/setStringValue().
-    \liAs integer - methods integerValue()/setIntegerValue(). Given value converted to/from SI.
-    \liAs double  - methods doubleValue()/setDoubleValue(). Given value converted to/from SI.
-    \liAs variant - methods value()/setValue().
+  Datum value is stored as string. User can get/set this value:
+  - As string : stringValue()/setStringValue().
+  - As integer : integerValue()/setIntegerValue(). Value is converted to/from SI.
+  - As double : doubleValue()/setDoubleValue(). Value is converted to/from SI.
+  - As variant : value()/setValue().
 
-  User can perform some actions on datum subwidgets using following methods: isEnabled(),
-  setEnabled(), show(), hide(), setShown(), setFocus(), setAlignment().
+  User can enable/disable datum subwidgets with setEnabled() method, show/hide them
+  with show()/hide() methods, set input focus to datum with setFocus(), set widgets 
+  alignment with setAlignment(), etc.
 */
 
 /*!
-  Constructor. Create datum object with datum identifier \aid under widget \aparent. Parameter \aflags
-  define behaviour of datum and set of created subwidgets. Default value of this parameter is QDS::All.
-  Parameter \acomp specify the component name which will be used during search of dictionary item.
+  \brief Constructor. 
+
+  Create datum object with datum identifier \a id and parent widget \a parent.
+
+  Parameter \a flags defines behaviour of datum and set of created
+  subwidgets. Default value of this parameter is QDS::All.
 
-  Datum register self in the static list by QDS::insertDatum().
+  Parameter \a comp specifies the component name which will be used
+  when searching the dictionary item.
+
+  Datum is self-registered in the global list by QDS::insertDatum().
+
+  \param id datum identifier
+  \param parent parent widget
+  \param flags datum flags
+  \param comp component
 */
 QDS_Datum::QDS_Datum( const QString& id, QWidget* parent, const int flags, const QString& comp )
 : QObject( parent ),
-myId( id ),
-myLabel( 0 ),
-myUnits( 0 ),
-myControl( 0 ),
-myFlags( flags ),
-myInitialised( false )
+  myId( id ),
+  myLabel( 0 ),
+  myUnits( 0 ),
+  myControl( 0 ),
+  myFlags( flags ),
+  myInitialised( false ),
+  myTr( false )
 {
   if ( myFlags & Label )
     myWrapper.insert( Label, new Wrapper( parent ) );
@@ -168,7 +214,7 @@ myInitialised( false )
     myWrapper.insert( Units, new Wrapper( parent ) );
 
   for ( QMap<int, Wrapper*>::Iterator it = myWrapper.begin(); it != myWrapper.end(); ++it )
-    connect( it.data(), SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+    connect( it.value(), SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
 
   Handle(DDS_Dictionary) aDict = DDS_Dictionary::Get();
   if ( aDict.IsNull() )
@@ -191,8 +237,10 @@ myInitialised( false )
 }
 
 /*!
-  Destructor. Destroy all subwidget.
-  Datum unregister self from the static list by QDS::removeDatum().
+  \brief Destructor. 
+
+  Destroy all subwidget. Datum is unregistered from the global list
+  by QDS::removeDatum().
 */
 QDS_Datum::~QDS_Datum()
 {
@@ -208,7 +256,8 @@ QDS_Datum::~QDS_Datum()
 }
 
 /*!
-  Overloaded operator allow to retrieve main subwidget named Control.
+  \brief Overloaded operator used to retrieve main subwidget named QDS::Control.
+  \return QDS::Control subwidget
 */
 QDS_Datum::operator QWidget*() const
 {
@@ -216,7 +265,8 @@ QDS_Datum::operator QWidget*() const
 }
 
 /*!
-  Returns the datum id.
+  \brief Get the datum ID.
+  \return datum ID
 */
 QString QDS_Datum::id() const
 {
@@ -226,7 +276,8 @@ QString QDS_Datum::id() const
 }
 
 /*!
-  Returns the datum type of value.
+  \brief Get the datum value type.
+  \return datum value type
 */
 int QDS_Datum::type() const
 {
@@ -239,7 +290,46 @@ int QDS_Datum::type() const
 }
 
 /*!
-  Returns the datum label string.
+  \brief Return state of custom translation.
+  \return true if custom translation is enabled
+*/
+bool QDS_Datum::isCustomTr() const
+{
+  return myTr;
+}
+
+/*!
+  \brief Change state of custom translation.
+
+  Custom translation means that text labels of datums are translated
+  with help of standard Qt mechanism of internationalization. In this
+  case special records should be placed into *.ts files under context "QDS".
+  For example, if label has name "myLabel", the corresponding translation
+  should be written:
+  <context>
+    <name>QDS</name>
+    <message>
+        <source>myLabel</source>
+        <translation>myLabel translation</translation>
+    </message>
+    ...
+
+  If custom translation mechanism is deactivated, then labels will be shown
+  with text got from xml data dictionary file
+
+  By default, the custom translation is deactivated
+
+  \param on - if it is true, custom translation is activated, otherwise, deactivated 
+*/
+void QDS_Datum::enableCustomTr( const bool on )
+{
+  myTr = on;
+  labelWidget()->setText( label() );
+}
+
+/*!
+  \brief Get the datum label text.
+  \return label text
 */
 QString QDS_Datum::label() const
 {
@@ -247,16 +337,25 @@ QString QDS_Datum::label() const
 
   QString labStr;
   if ( !myDicItem.IsNull() )
+  {
     labStr = toQString( myDicItem->GetLabel() );
-
+    if( labStr.isNull() )
+      labStr = toQString( myDicItem->GetId() );
+  }
+  if( myTr )
+  {
+    QString dest = QApplication::translate( "QDS", labStr.toLatin1().constData() );
+    if( labStr != dest )
+      labStr = dest;
+  }
   if ( flags() & NotAccel )
     labStr = removeAccel( labStr );
-
   return labStr;
 }
 
 /*!
-  Returns the datum units string.
+  \brief Get the datum units text.
+  \return units text
 */
 QString QDS_Datum::units() const
 {
@@ -269,7 +368,8 @@ QString QDS_Datum::units() const
 }
 
 /*!
-  Returns the datum value filter string.
+  \brief Get the datum filter string.
+  \return filter string
 */
 QString QDS_Datum::filter() const
 {
@@ -282,7 +382,8 @@ QString QDS_Datum::filter() const
 }
 
 /*!
-  Returns the datum value format string.
+  \brief Get the datum format string
+  \return format string
 */
 QString QDS_Datum::format() const
 {
@@ -295,7 +396,8 @@ QString QDS_Datum::format() const
 }
 
 /*!
-  Returns the datum default value string.
+  \brief Get the datum default value
+  \return default value
 */
 QString QDS_Datum::defaultValue() const
 {
@@ -308,7 +410,7 @@ QString QDS_Datum::defaultValue() const
   if ( !myDicItem.IsNull() )
     def = toQString( myDicItem->GetDefaultValue() );
 
-  QString aDef = def.stripWhiteSpace();
+  QString aDef = def.trimmed();
   if ( !pref.isEmpty() && aDef.left( pref.length() ) == pref )
     aDef = aDef.mid( pref.length() );
 
@@ -319,7 +421,8 @@ QString QDS_Datum::defaultValue() const
 }
 
 /*!
-  Returns the datum minimum value string.
+  \brief Get the datum minimum value.
+  \return minimum value
 */
 QString QDS_Datum::minimumValue() const
 {
@@ -332,7 +435,8 @@ QString QDS_Datum::minimumValue() const
 }
 
 /*!
-  Returns the datum maximum value string.
+  \brief Get the datum maximum value.
+  \return maximum value
 */
 QString QDS_Datum::maximumValue() const
 {
@@ -345,7 +449,8 @@ QString QDS_Datum::maximumValue() const
 }
 
 /*!
-  Returns the datum long description.
+  \brief Get the datum long description.
+  \return datum long description
 */
 QString QDS_Datum::longDescription() const
 {
@@ -358,7 +463,8 @@ QString QDS_Datum::longDescription() const
 }
 
 /*!
-  Returns the datum short description.
+  \brief Get the datum short description.
+  \return datum short description
 */
 QString QDS_Datum::shortDescription() const
 {
@@ -371,7 +477,8 @@ QString QDS_Datum::shortDescription() const
 }
 
 /*!
-  Returns the list of option names.
+  \brief Get the datum options names.
+  \return datum options
 */
 QStringList QDS_Datum::options() const
 {
@@ -387,8 +494,8 @@ QStringList QDS_Datum::options() const
 }
 
 /*!
-  Returns the option specified by \aname as QVariant.
-  If option not exist then not valid QVariant returned.
+  \brief Get datum option specified by \a name as QVariant.
+  \return the option value or invalid QVariant if the option does not exist
 */
 QVariant QDS_Datum::option( const QString& name ) const
 {
@@ -399,8 +506,8 @@ QVariant QDS_Datum::option( const QString& name ) const
 }
 
 /*!
-  Returns the option specified by \aname as QString.
-  If option not exist then empty string returned.
+  \brief Get datum option specified by \a name as string.
+  \return the option value or null QString if the option does not exist
 */
 QString QDS_Datum::optionString( const QString& name ) const
 {
@@ -411,33 +518,34 @@ QString QDS_Datum::optionString( const QString& name ) const
 }
 
 /*!
-  Returns the option specified by \aname as double.
-  If option not exist then 0 returned.
+  \brief Get datum option specified by \a name as double.
+  \return the option value or 0 if the option does not exist
 */
 double QDS_Datum::optionDouble( const QString& name ) const
 {
   double res = 0;
   QVariant opt = option( name );
-  if ( opt.isValid() && opt.canCast( QVariant::Double ) )
+  if ( opt.isValid() && opt.canConvert( QVariant::Double ) )
     res = opt.toDouble();
   return res;
 }
 
 /*!
-  Returns the option specified by \aname as integer.
-  If option not exist then 0 returned.
+  \brief Get datum option specified by \a name as integer.
+  \return the option value or 0 if the option does not exist
 */
 int QDS_Datum::optionInteger( const QString& name ) const
 {
   int res = 0;
   QVariant opt = option( name );
-  if ( opt.isValid() && opt.canCast( QVariant::Int ) )
+  if ( opt.isValid() && opt.canConvert( QVariant::Int ) )
     res = opt.toInt();
   return res;
 }
 
 /*!
-  Returns the datum value as variant (QVariant object).
+  \brief Get the datum value as QVariant.
+  \return datum value
 */
 QVariant QDS_Datum::value() const
 {
@@ -448,7 +556,8 @@ QVariant QDS_Datum::value() const
 }
 
 /*!
-  Returns the datum value as string (QString object).
+  \brief Get the datum value as string.
+  \return datum value converted to string
 */
 QString QDS_Datum::stringValue() const
 {
@@ -461,8 +570,12 @@ QString QDS_Datum::stringValue() const
 }
 
 /*!
-  Returns the datum value as double. This value converted from units of measure in active unit system
-  to units of measure in unit system "SI".
+  \brief Get the datum value as double.
+
+  The value is converted according to the measure units in the active units system
+  to measure units in "SI" units system.
+
+  \return datum value converted to double
 */
 double QDS_Datum::doubleValue() const
 {
@@ -482,8 +595,12 @@ double QDS_Datum::doubleValue() const
 }
 
 /*!
-  Returns the datum value as integer. This value converted from units of measure in active unit system
-  to units of measure in unit system "SI".
+  \brief Get the datum value as integer.
+
+  The value is converted according to the measure units in the active units system
+  to measure units in "SI" units system.
+
+  \return datum value converted to integer
 */
 int QDS_Datum::integerValue() const
 {
@@ -503,7 +620,11 @@ int QDS_Datum::integerValue() const
 }
 
 /*!
-  Returns the text from datum. Text consist of label, string value and units.
+  \brief Get the text data from datum.
+
+  Text consists of label, string value and units.
+
+  \return datum text data
 */
 QString QDS_Datum::text() const
 {
@@ -525,7 +646,8 @@ QString QDS_Datum::text() const
 }
 
 /*!
-  Returns false if datum control has inputted value.
+  \brief Check if the datum is empty.
+  \return \c false if datum control has value entered
 */
 bool QDS_Datum::isEmpty() const
 {
@@ -533,7 +655,7 @@ bool QDS_Datum::isEmpty() const
 }
 
 /*!
-  Reset datum state and set default value as current.
+  \brief Reset datum state and set default value as current.
 */
 void QDS_Datum::reset()
 {
@@ -550,7 +672,7 @@ void QDS_Datum::reset()
 }
 
 /*!
-  Clear the control.
+  \brief Clear the control.
 */
 void QDS_Datum::clear()
 {
@@ -570,18 +692,20 @@ void QDS_Datum::clear()
 }
 
 /*!
-  Set varian value (QVariant object) into datum.
+  \brief Set datum value from QVariant object.
+  \param val new value
 */
 void QDS_Datum::setValue( const QVariant& val )
 {
-  if ( val.isValid() && val.canCast( QVariant::String ) )
+  if ( val.isValid() && val.canConvert( QVariant::String ) )
     setStringValue( val.toString() );
   else
     clear();
 }
 
 /*!
-  Set string value (QString object) into datum.
+  \brief Set datum value from string data.
+  \param txt new value
 */
 void QDS_Datum::setStringValue( const QString& txt )
 {
@@ -599,8 +723,13 @@ void QDS_Datum::setStringValue( const QString& txt )
 }
 
 /*!
-  Set double value into datum. This value converted from units of measure in unit system "SI"
-  to units of measure in active unit system. Format the value using datum format if it required.
+  \brief Set datum value from double data.
+
+  The value is converted from measure units in "SI" units system
+  to the measure units in the active units system.
+  Format the value using datum format internal if it is required.
+  
+  \param num new value
 */
 void QDS_Datum::setDoubleValue( const double num )
 {
@@ -622,8 +751,13 @@ void QDS_Datum::setDoubleValue( const double num )
 }
 
 /*!
-  Set integer value into datum. This value converted from units of measure in unit system "SI"
-  to units of measure in active unit system. Format the value using datum format if it required.
+  \brief Set datum value from integer data.
+
+  The value is converted from measure units in "SI" units system
+  to the measure units in the active units system.
+  Format the value using datum format if it is required.
+  
+  \param num new value
 */
 void QDS_Datum::setIntegerValue( const int num )
 {
@@ -645,7 +779,10 @@ void QDS_Datum::setIntegerValue( const int num )
 }
 
 /*!
-  Returns true if all subwidgets specified by \aelement enabled.
+  \brief Get 'enabled' state of the specified subwidget.
+  \param element ORed subwidget flags (QDS::DatumFlags)
+  \return \c true if all subwidgets specified by \a element are enabled
+  \sa setEnabled()
 */
 bool QDS_Datum::isEnabled( const int element ) const
 {
@@ -662,8 +799,14 @@ bool QDS_Datum::isEnabled( const int element ) const
 }
 
 /*!
-  Enable/Disable subwidgets specified by \aelement.
-  Possible values of \aelement: Label, Control, Units or their combinations.
+  \brief Enable/disable subwidgets specified by \a element.
+
+  Possible values of \a element: QDS::Label, QDS::Control, QDS::Units
+  or their ORed combinations.
+
+  \param on new 'enabled' state
+  \param element ORed subwidget flags (QDS::DatumFlags)
+  \sa isEnabled()
 */
 void QDS_Datum::setEnabled( const bool on, const int element )
 {
@@ -678,7 +821,8 @@ void QDS_Datum::setEnabled( const bool on, const int element )
 }
 
 /*!
-  Enable/Disable control.
+  \brief Enable/disable main control subwidget (QDS::Control).
+  \param on new 'enabled' state
 */
 void QDS_Datum::setEnabled( bool on )
 {
@@ -686,8 +830,14 @@ void QDS_Datum::setEnabled( bool on )
 }
 
 /*!
-  Show/hide subwidgets specified by \aelement.
-  Possible values of \aelement: Label, Control, Units or their combinations.
+  \brief Show/hide subwidgets specified by \a flags.
+
+  Possible values of \a flags: QDS::Label, QDS::Control, QDS::Units
+  or their ORed combinations.
+
+  \param visible new 'visibility' state
+  \param flags ORed subwidget flags (QDS::DatumFlags)
+  \sa show(), hide()
 */
 void QDS_Datum::setShown( const bool visible, const int flags )
 {
@@ -703,8 +853,13 @@ void QDS_Datum::setShown( const bool visible, const int flags )
 }
 
 /*!
-  Show subwidgets specified by \aelement.
-  Possible values of \aelement: Label, Control, Units or their combinations.
+  \brief Show subwidgets specified by \a element.
+
+  Possible values of \a element: QDS::Label, QDS::Control, QDS::Units
+  or their ORed combinations.
+
+  \param element ORed subwidget flags (QDS::DatumFlags)
+  \sa hide(), setShown()
 */
 void QDS_Datum::show( const int element )
 {
@@ -712,8 +867,13 @@ void QDS_Datum::show( const int element )
 }
 
 /*!
-  Hide subwidgets specified by \aelement.
-  Possible values of \aelement: Label, Control, Units or their combinations.
+  \brief Hide subwidgets specified by \a element.
+
+  Possible values of \a element: QDS::Label, QDS::Control, QDS::Units
+  or their ORed combinations.
+
+  \param element ORed subwidget flags (QDS::DatumFlags)
+  \sa show(), setShown()
 */
 void QDS_Datum::hide( const int element )
 {
@@ -721,8 +881,12 @@ void QDS_Datum::hide( const int element )
 }
 
 /*!
-  Returns subwidget specified by \aelement.
-  Possible values of \aelement: Label, Control, Units.
+  \brief Get subwidget specified by \a element.
+
+  Possible values of \a element: QDS::Label, QDS::Control, QDS::Units.
+  
+  \param element subwidget
+  \return widget
 */
 QWidget* QDS_Datum::widget( const int element ) const
 {
@@ -731,7 +895,7 @@ QWidget* QDS_Datum::widget( const int element ) const
 }
 
 /*!
-  Set the input focus on the control widget.
+  \brief Set the input focus to the control widget.
 */
 void QDS_Datum::setFocus()
 {
@@ -742,8 +906,14 @@ void QDS_Datum::setFocus()
 }
 
 /*!
-  Returns true if control contains valid value otherwise returns false
-  and display warning message box if parameter \amsgBox is set.
+  \brief Check if input data is valid.
+
+  If data is invalid and \a msgBox is \c true, the warning message box is shown.
+
+  \param msgBox if \c true, show warning message box if input is invalid
+  \param extMsg warning message
+  \param extLabel optional name of the variable (if QDS::Label control is not used) 
+  \return \c true if input data is valid
 */
 bool QDS_Datum::isValid( const bool msgBox, const QString& extMsg, const QString& extLabel ) const
 {
@@ -811,7 +981,7 @@ bool QDS_Datum::isValid( const bool msgBox, const QString& extMsg, const QString
       info += QString( "\n" ) + extMsg;
 
     QString msg;
-    for ( uint i = 0; i < info.length(); i++ )
+    for ( int i = 0; i < info.length(); i++ )
       if ( info.at( i ) == '\n' )
         msg += QString( "<br>" );
       else
@@ -828,7 +998,8 @@ bool QDS_Datum::isValid( const bool msgBox, const QString& extMsg, const QString
 }
 
 /*!
-  Add widgets to the vertical box layout.
+  \brief Add widgets to the vertical box layout.
+  \param l layout
 */
 void QDS_Datum::addTo( QVBoxLayout* l )
 {
@@ -846,7 +1017,8 @@ void QDS_Datum::addTo( QVBoxLayout* l )
 }
 
 /*!
-  Add widgets to the horizaontal box layout.
+  \brief Add widgets to the horizontal box layout.
+  \param l layout
 */
 void QDS_Datum::addTo( QHBoxLayout* l )
 {
@@ -864,7 +1036,11 @@ void QDS_Datum::addTo( QHBoxLayout* l )
 }
 
 /*!
-  Add widgets to the grid layout.
+  \brief Add widgets to the grid layout.
+  \param theLay layout
+  \param theRow layout row index
+  \param theCol layout column index
+  \param vertical if \c true subwidgets are layouted vertically, otherwise - horizontally
 */
 void QDS_Datum::addTo( QGridLayout* theLay, const int theRow, const int theCol, bool vertical )
 {
@@ -890,41 +1066,49 @@ void QDS_Datum::addTo( QGridLayout* theLay, const int theRow, const int theCol,
 }
 
 /*!
-  Set the aligment of Label or Units. For Control nothing happens.
+  \brief Set the aligment for QDS::Label and/or QDS::Units subwidgets.
+  \param align alignment type (Qt::Alignment)
+  \param type ORed subwidget flags
 */
 void QDS_Datum::setAlignment( const int align, const int type )
 {
   initDatum();
 
   if ( ( type & Label ) && labelWidget() )
-    labelWidget()->setAlignment( align );
+    labelWidget()->setAlignment( Qt::Alignment(align) );
   if ( ( type & Units ) && unitsWidget() )
-    unitsWidget()->setAlignment( align );
+    unitsWidget()->setAlignment( Qt::Alignment(align) );
 }
 
 /*!
+  \brief Event filter.
+
   Perform delayed initialisation. Reimplemented for internal reasons.
+  
+  \param o event reciever object
+  \param e event
+  \return \c true if event should be filtered
 */
 bool QDS_Datum::eventFilter( QObject* o, QEvent* e )
 {
   if ( o == parent() )
   {
     if ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ||
-         ( e->type() == QEvent::ChildInserted && ((QChildEvent*)e)->child() == this ) )
+         ( e->type() == QEvent::ChildAdded && ((QChildEvent*)e)->child() == this ) )
       initDatum();
   }
   return QObject::eventFilter( o, e );
 }
 
 /*!
-  Notify about parameter value changing.
+  \brief Called when datum value is changed.
 */
 void QDS_Datum::onParamChanged()
 {
 }
 
 /*!
-  Perform delayed initialization.
+  \brief Perform delayed initialization.
 */
 void QDS_Datum::onInitDatum()
 {
@@ -932,7 +1116,11 @@ void QDS_Datum::onInitDatum()
 }
 
 /*!
-  Notify about subwidgets destroying. Allow to avoid repeated deleting in destructor.
+  \brief Called when child subwidget is destroued.
+
+  Allows avoiding crash of extra calling of the child subwidget destructor.
+
+  \param obj object being destroyed
 */
 void QDS_Datum::onDestroyed( QObject* obj )
 {
@@ -940,7 +1128,8 @@ void QDS_Datum::onDestroyed( QObject* obj )
 }
 
 /*!
-  Returns QLabel widget which contains dictionary item label.
+  \brief Get QDS::Label widget.
+  \return label widget
 */
 QLabel* QDS_Datum::labelWidget() const
 {
@@ -949,7 +1138,8 @@ QLabel* QDS_Datum::labelWidget() const
 }
 
 /*!
-  Returns QLabel widget which contains dictionary item units.
+  \brief Get QDS::Units widget.
+  \return units widget
 */
 QLabel* QDS_Datum::unitsWidget() const
 {
@@ -958,7 +1148,8 @@ QLabel* QDS_Datum::unitsWidget() const
 }
 
 /*!
-  Returns QWidget which contains user input data.
+  \brief Get QDS::Control widget.
+  \return control widget
 */
 QWidget* QDS_Datum::controlWidget() const
 {
@@ -967,7 +1158,8 @@ QWidget* QDS_Datum::controlWidget() const
 }
 
 /*!
-  Returns the dictionary item from the datum.
+  \brief Get the dictionary item from the datum.
+  \return handle to data dictionary item
 */
 Handle(DDS_DicItem) QDS_Datum::dicItem() const
 {
@@ -975,7 +1167,8 @@ Handle(DDS_DicItem) QDS_Datum::dicItem() const
 }
 
 /*!
-  Set the dictionary item in to the datum.
+  \brief Set the dictionary item to the datum.
+  \param item handle to data dictionary item
 */
 void QDS_Datum::setDicItem( const Handle(DDS_DicItem)& item )
 {
@@ -983,7 +1176,9 @@ void QDS_Datum::setDicItem( const Handle(DDS_DicItem)& item )
 }
 
 /*!
-  Creates QLabel widget for dictionary item label.
+  \brief Create QDS::Label widget.
+  \param parent parent widget
+  \return label widget
 */
 QLabel* QDS_Datum::createLabel( QWidget* parent )
 {
@@ -991,7 +1186,9 @@ QLabel* QDS_Datum::createLabel( QWidget* parent )
 }
 
 /*!
-  Creates QLabel widget for dictionary item units.
+  \brief Create QDS::Units widget.
+  \param parent parent widget
+  \return units widget
 */
 QLabel* QDS_Datum::createUnits( QWidget* parent )
 {
@@ -999,7 +1196,37 @@ QLabel* QDS_Datum::createUnits( QWidget* parent )
 }
 
 /*!
-  Creates and returns validator accordance to datum type of value.
+  \fn QWidget* QDS_Datum::createControl( QWidget* parent );
+  \brief Create QDS::Control widget.
+
+  This method should be implemented in the successor classes.
+
+  \param parent parent widget
+  \return control widget
+*/
+
+/*!
+  \fn QString QDS_Datum::getString() const;
+  \brief Get string value from datum.
+  
+  This method should be implemented in the successor classes.
+  
+  \return datum string value
+*/
+
+/*
+  \fn void QDS_Datum::setString( const QString& txt );
+  \brief Set string value to datum.
+  
+  This method should be implemented in the successor classes.
+  
+  \param txt new datum string value
+*/
+
+/*!
+  \brief Create validator according to the datum type of value.
+  \param limits if \c true use minimum and maximum value limits
+  \return validator
 */
 QValidator* QDS_Datum::validator( const bool limits ) const
 {
@@ -1013,7 +1240,7 @@ QValidator* QDS_Datum::validator( const bool limits ) const
     QString aFormat = canonicalFormat( format(), aFlags );
 
     int len = -1;
-    int pos = aFormat.find( "." );
+    int pos = aFormat.indexOf( "." );
     if ( pos != -1 )
     {
       QString numStr = aFormat.mid( pos + 1, aFormat.length() - pos - 2 );
@@ -1063,7 +1290,9 @@ QValidator* QDS_Datum::validator( const bool limits ) const
 }
 
 /*!
-  Checks the given string are valid or not.
+  \brief Validate the specified string.
+  \param txt string to be validated
+  \return \c true if string contains valid data
 */
 bool QDS_Datum::validate( const QString& txt ) const
 {
@@ -1086,8 +1315,12 @@ bool QDS_Datum::validate( const QString& txt ) const
 }
 
 /*!
-  Retrieves information from dictionary and create subwidgets using virtual mechanism.
-  Virtual mechanism doesn't work in constructor and destructor, therefore this method should
+  \brief Initialize datum.
+  
+  Retrieve information from data dictionary and create subwidgets
+  using virtual mechanism.
+
+  Virtual mechanism doesn't work in the constructor, therefore this method should
   be called outside the constructor.
 */
 void QDS_Datum::initialize()
@@ -1118,9 +1351,9 @@ void QDS_Datum::initialize()
     QString lDescr = longDescription();
     QString sDescr = shortDescription();
     if ( !sDescr.isEmpty() )
-      QToolTip::add( ctrl, sDescr );
+      ctrl->setToolTip( sDescr );
     if ( !lDescr.isEmpty() )
-      QWhatsThis::add( ctrl, lDescr );
+      ctrl->setWhatsThis( lDescr );
   }
 
   if ( labelWidget() && ctrl && !( flags() & NotAccel ) )
@@ -1128,7 +1361,11 @@ void QDS_Datum::initialize()
 }
 
 /*!
-  Notification about active unit system changing. Update label and units texts.
+  \brief Process notification about active units system changing.
+  
+  Update label and units widgets.
+
+  \param unitSystem new active units system
 */
 void QDS_Datum::unitSystemChanged( const QString& unitSystem )
 {
@@ -1141,7 +1378,7 @@ void QDS_Datum::unitSystemChanged( const QString& unitSystem )
       labText = unitText;
     else if ( !unitText.isEmpty() )
       labText = QString( "%1 (%2)" ).arg( labText ).arg( unitText );
-    unitText = QString::null;
+    unitText = QString();
   }
 
   if ( labelWidget() )
@@ -1154,13 +1391,15 @@ void QDS_Datum::unitSystemChanged( const QString& unitSystem )
 }
 
 /*!
-  Covert units into text presentation.
+  \brief Convert units into text presentation.
+  \param uni units to be converted
+  \return text presentation of units (rich-text)
 */
 QString QDS_Datum::unitsToText( const QString& uni )
 {
   int pos = -1;
   QString aUnits = uni;
-  while ( ( pos = aUnits.find( "**" ) ) != -1 )
+  while ( ( pos = aUnits.indexOf( "**" ) ) != -1 )
   {
     aUnits = aUnits.mid( 0, pos ) + QString( "<tt><font size=+2><sup>" ) +
              aUnits.mid( pos + 2, 1 ) + QString( "</sup></font></tt>" ) +
@@ -1170,24 +1409,30 @@ QString QDS_Datum::unitsToText( const QString& uni )
 }
 
 /*!
-  Covert text presentation into internal units format.
+  \brief Convert text presentation into internal units format.
+  \param txt text presentation of units (rich-text)
+  \return units value
 */
 QString QDS_Datum::textToUnits( const QString& txt )
 {
   int pos = -1;
   QString aUnits = txt;
-  while ( ( pos = aUnits.find( "<sup>" ) ) != -1 )
+  while ( ( pos = aUnits.indexOf( "<sup>" ) ) != -1 )
   {
     aUnits.remove( pos, 5 );
     aUnits.insert( pos, "**" );
   }
-  while ( ( pos = aUnits.find( "</sup>" ) ) != -1 )
+  while ( ( pos = aUnits.indexOf( "</sup>" ) ) != -1 )
     aUnits.remove( pos, 6 );
   return aUnits;
 }
 
 /*!
-  Format the specified integer as dictionary item value.
+  \brief Format the specified integer as dictionary item value.
+  \param num integer value being formatted
+  \param id data dictionary ID
+  \param convert if \c true, perform conversion from "SI" units system
+  \return formatted value
 */
 QString QDS_Datum::format( const int num, const QString& id, const bool convert )
 {
@@ -1214,7 +1459,11 @@ QString QDS_Datum::format( const int num, const QString& id, const bool convert
 }
 
 /*!
-  Format the specified double as dictionary item value.
+  \brief Format the specified double as dictionary item value.
+  \param num double value being formatted
+  \param id data dictionary ID
+  \param convert if \c true, perform conversion from "SI" units system
+  \return formatted value
 */
 QString QDS_Datum::format( const double num, const QString& id, const bool convert )
 {
@@ -1241,7 +1490,11 @@ QString QDS_Datum::format( const double num, const QString& id, const bool conve
 }
 
 /*!
-  Format the specified string as dictionary item value.
+  \brief Format the specified string as dictionary item value.
+  \param str string value being formatted
+  \param id data dictionary ID
+  \param convert if \c true, perform conversion from "SI" units system
+  \return formatted value
 */
 QString QDS_Datum::format( const QString& str, const QString& id, const bool convert )
 {
@@ -1268,7 +1521,11 @@ QString QDS_Datum::format( const QString& str, const QString& id, const bool con
 }
 
 /*!
-  Format the given string accordance to dictionary item format.
+  \brief Format the given value according to the data dictionary item type.
+  \param aFormat format string
+  \param aType data dictionary item type
+  \param aValue integer value being formatted
+  \return formatted value
 */
 QString QDS_Datum::format( const QString& aFormat, const int aType, const int aValue )
 {
@@ -1280,11 +1537,11 @@ QString QDS_Datum::format( const QString& aFormat, const int aType, const int aV
     {
     case DDS_DicItem::Float:
       txt = sprintf( aFormat, (double)aValue );
-      txt = txt.stripWhiteSpace();
+      txt = txt.trimmed();
       break;
     case DDS_DicItem::Integer:
       txt = sprintf( aFormat, aValue );
-      txt = txt.stripWhiteSpace();
+      txt = txt.trimmed();
       break;
     case DDS_DicItem::String:
     default:
@@ -1299,7 +1556,11 @@ QString QDS_Datum::format( const QString& aFormat, const int aType, const int aV
 }
 
 /*!
-  Format the given string accordance to dictionary item format.
+  \brief Format the given value according to the data dictionary item type.
+  \param aFormat format string
+  \param aType data dictionary item type
+  \param aValue double value being formatted
+  \return formatted value
 */
 QString QDS_Datum::format( const QString& aFormat, const int aType, const double aValue )
 {
@@ -1310,16 +1571,16 @@ QString QDS_Datum::format( const QString& aFormat, const int aType, const double
     switch ( aType )
     {
     case DDS_DicItem::Float:
-      txt = QString().sprintf( aFormat, aValue );
-      txt = txt.stripWhiteSpace();
+      txt = QString().sprintf( aFormat.toLatin1().constData(), aValue );
+      txt = txt.trimmed();
       break;
     case DDS_DicItem::Integer:
-      txt = QString().sprintf( aFormat, (int)aValue );
-      txt = txt.stripWhiteSpace();
+      txt = QString().sprintf( aFormat.toLatin1().constData(), (int)aValue );
+      txt = txt.trimmed();
       break;
     case DDS_DicItem::String:
     default:
-      txt = QString().sprintf( aFormat, aValue );
+      txt = QString().sprintf( aFormat.toLatin1().constData(), aValue );
       break;
     }
   }
@@ -1330,14 +1591,18 @@ QString QDS_Datum::format( const QString& aFormat, const int aType, const double
 }
 
 /*!
-  Format the given string accordance to dictionary item format.
+  \brief Format the given value according to the data dictionary item type.
+  \param aFormat format string
+  \param aType data dictionary item type
+  \param aValue string value being formatted
+  \return formatted value
 */
 QString QDS_Datum::format( const QString& aFormat, const int aType, const QString& aValue )
 {
   QString txt = aValue;
 
   if ( aType != DDS_DicItem::String )
-    txt = txt.stripWhiteSpace();
+    txt = txt.trimmed();
 
   if ( aFormat.isEmpty() || txt.isEmpty() )
     return txt;
@@ -1347,11 +1612,11 @@ QString QDS_Datum::format( const QString& aFormat, const int aType, const QStrin
   case DDS_DicItem::Float:
     txt = txt.replace( 'd', 'e' ).replace( 'D', 'E' );
     txt = sprintf( aFormat, txt.toDouble() );
-    txt = txt.stripWhiteSpace();
+    txt = txt.trimmed();
     break;
   case DDS_DicItem::Integer:
     txt = sprintf( aFormat, txt.toInt() );
-    txt = txt.stripWhiteSpace();
+    txt = txt.trimmed();
     break;
   case DDS_DicItem::String:
     txt = sprintf( aFormat, txt );
@@ -1362,26 +1627,43 @@ QString QDS_Datum::format( const QString& aFormat, const int aType, const QStrin
 }
 
 /*!
-  Wrapper around the standard sprintf function.
+  \brief Wrapper around the standard sprintf() function.
+
   Process some non standard flags from format string.
+
+  \param fmt string format
+  \param val value
+  \return formatted value
 */
 QString QDS_Datum::sprintf( const QString& fmt, const int val )
 {
-  return QString().sprintf( canonicalFormat( fmt ), val );
+  return QString().sprintf( canonicalFormat( fmt ).toLatin1().constData(), val );
 }
 
 /*!
-  Wrapper around the standard sprintf function.
+  \brief Wrapper around the standard sprintf() function.
+  \overload
+
   Process some non standard flags from format string.
+
+  \param fmt string format
+  \param val value
+  \return formatted value
 */
 QString QDS_Datum::sprintf( const QString& fmt, const double val )
 {
-  return QString().sprintf( canonicalFormat( fmt ), val );
+  return QString().sprintf( canonicalFormat( fmt ).toLatin1().constData(), val );
 }
 
 /*!
-  Wrapper around the standard sprintf function.
+  \brief Wrapper around the standard sprintf() function.
+  \overload
+
   Process some non standard flags from format string.
+
+  \param fmt string format
+  \param val value
+  \return formatted value
 */
 QString QDS_Datum::sprintf( const QString& fmt, const QString& val )
 {
@@ -1391,11 +1673,11 @@ QString QDS_Datum::sprintf( const QString& fmt, const QString& val )
   QString txt = val;
 
   QRegExp rx( "^(%[0-9]*.?[0-9]*s)$" );
-  if ( aFormat.find( rx ) != -1 )
+  if ( aFormat.indexOf( rx ) != -1 )
   {
     // QString().sprintf() always expects string in UTF8 encoding, so we cannot use it here
     char* buf = new char[txt.length() + 1];
-    ::sprintf( buf, aFormat.latin1(), (const char*)(txt.local8Bit()) );
+    ::sprintf( buf, aFormat.toLatin1().constData(), (const char*)(txt.toLocal8Bit()) );
     txt = QString::fromLocal8Bit( buf );
 
     delete[] buf;
@@ -1412,16 +1694,18 @@ QString QDS_Datum::sprintf( const QString& fmt, const QString& val )
     }*/
   }
 
-  if ( aFlags.contains( "u", false ) )
-    txt = txt.upper();
-  if ( aFlags.contains( "l", false ) )
-    txt = txt.lower();
+  if ( aFlags.contains( "u", Qt::CaseInsensitive ) )
+    txt = txt.toUpper();
+  if ( aFlags.contains( "l", Qt::CaseInsensitive ) )
+    txt = txt.toLower();
 
   return txt;
 }
 
 /*!
-  Returns the canonical sprintf format.
+  \brief Get the canonical sprintf() format.
+  \param fmt string format
+  \return canonical sprintf() format
 */
 QString QDS_Datum::canonicalFormat( const QString& fmt )
 {
@@ -1430,15 +1714,18 @@ QString QDS_Datum::canonicalFormat( const QString& fmt )
 }
 
 /*!
-  Returns the canonical sprintf format and non standard flags.
+  \brief Get the canonical sprintf() format and non standard flags.
+  \param fmt string format
+  \param flags format flags
+  \return canonical sprintf() format
 */
 QString QDS_Datum::canonicalFormat( const QString& fmt, QString& flags )
 {
   QString newFmt = fmt;
-  flags = QString::null;
+  flags = QString();
 
   QRegExp rx( "^(%[0-9]*.?[0-9]*)([a-z,A-Z]+)[g|c|d|i|o|u|x|e|f|n|p|s|X|E|G]$" );
-  if ( rx.search( newFmt ) >= 0 )
+  if ( rx.indexIn( newFmt ) >= 0 )
   {
     flags = rx.cap( 2 );
     newFmt.remove( rx.pos( 2 ), flags.length() );
@@ -1447,7 +1734,9 @@ QString QDS_Datum::canonicalFormat( const QString& fmt, QString& flags )
 }
 
 /*!
-  Returns displayable units string for given dictionary item id
+  \brief Get displayable units string for specified data dictionary item.
+  \param id data dictionary item ID
+  \return units string
 */
 QString QDS_Datum::units( const QString& id )
 {
@@ -1465,30 +1754,33 @@ QString QDS_Datum::units( const QString& id )
 }
 
 /*!
-  Get prefix string from format.
+  \brief Get prefix string from format.
+  \return current implementation returns null string
 */
 QString QDS_Datum::prefix() const
 {
-  return QString::null;
+  return QString();
 }
 
 /*!
-  Get suffix string from format.
+  \brief Get suffix string from format.
+  \return current implementation returns null string
 */
 QString QDS_Datum::suffix() const
 {
-  return QString::null;
+  return QString();
 }
 
 /*!
-  Get min value.
+  \brief Get minimum value.
+  \return minimum value
 */
 QString QDS_Datum::minValue() const
 {
   QString pref = prefix();
   QString suff = suffix();
 
-  QString aMin = minimumValue().stripWhiteSpace();
+  QString aMin = minimumValue().trimmed();
 
   if ( !pref.isEmpty() && aMin.left( pref.length() ) == pref )
     aMin = aMin.mid( pref.length() );
@@ -1500,14 +1792,15 @@ QString QDS_Datum::minValue() const
 }
 
 /*!
-  Get max value.
+  \brief Get maximum value.
+  \return maximum value
 */
 QString QDS_Datum::maxValue() const
 {
   QString pref = prefix();
   QString suff = suffix();
 
-  QString aMax = maximumValue().stripWhiteSpace();
+  QString aMax = maximumValue().trimmed();
 
   if ( !pref.isEmpty() && aMax.left( pref.length() ) == pref )
     aMax = aMax.mid( pref.length() );
@@ -1519,15 +1812,17 @@ QString QDS_Datum::maxValue() const
 }
 
 /*!
-  Reset the numeric value cache.
+  \brief Reset the numeric value cache.
 */
 void QDS_Datum::invalidateCache()
 {
-  myTargetValue = QString::null;
+  myTargetValue = QString();
 }
 
 /*!
-  Remove the acceleartor tags '&' from specified label string \asrc.
+  \brief Remove the acceleartor tags '&' from specified label string \a src.
+  \param src processed string
+  \return string after removing '&' symbols
 */
 QString QDS_Datum::removeAccel( const QString& src )
 {
@@ -1546,7 +1841,9 @@ QString QDS_Datum::removeAccel( const QString& src )
 }
 
 /*!
-  Returns true if given format string \atheFormat has specificator for double values.
+  \brief Check if given format specified doube value.
+  \param theFormat format string 
+  \return \c true if \a theFormat has specificator for double values
 */
 bool QDS_Datum::isDoubleFormat( const QString& theFormat )
 {
@@ -1560,7 +1857,8 @@ bool QDS_Datum::isDoubleFormat( const QString& theFormat )
 }
 
 /*!
-  Returns datum flags.
+  \brief Get datum flags.
+  \return datum flags (QDS::DatumFlags)
 */
 int QDS_Datum::flags() const
 {
@@ -1568,7 +1866,8 @@ int QDS_Datum::flags() const
 }
 
 /*!
-  Perform intialization if it needed. [internal]
+  \brief Perform initialization if it needed.
+  \internal
 */
 void QDS_Datum::initDatum() const
 {
@@ -1580,11 +1879,14 @@ void QDS_Datum::initDatum() const
   that->initialize();
 
   if ( parent() )
-    parent()->removeEventFilter( this );
+    parent()->removeEventFilter( (QObject*)this );
 }
 
 /*!
-  Return wrapper for specified subwidget. [internal]
+  \brief Get wrapper for specified subwidget.
+  \internal
+  \param wid subwidget
+  \return wrapper
 */
 QDS_Datum::Wrapper* QDS_Datum::wrapper( QWidget* wid ) const
 {
@@ -1594,14 +1896,17 @@ QDS_Datum::Wrapper* QDS_Datum::wrapper( QWidget* wid ) const
   Wrapper* wrap = 0;
   for ( QMap<int, Wrapper*>::ConstIterator it = myWrapper.begin(); it != myWrapper.end() && !wrap; ++it )
   {
-    if ( it.data() && it.data()->widget() == wid )
-      wrap = it.data();
+    if ( it.value() && it.value()->widget() == wid )
+      wrap = it.value();
   }
   return wrap;
 }
 
 /*!
-  Return wrapper for specified subwidget name. [internal]
+  \brief Get wrapper for specified subwidget.
+  \internal
+  \param id subwidget ID
+  \return wrapper
 */
 QDS_Datum::Wrapper* QDS_Datum::wrapper( const int id ) const
 {
@@ -1612,15 +1917,30 @@ QDS_Datum::Wrapper* QDS_Datum::wrapper( const int id ) const
 }
 
 /*!
-  Return subwidget name for specified wrapper. [internal]
+  \brief Get subwidget type for specified wrapper.
+  \internal
+  \param wrap wrapper
+  \return subwidget ID
 */
 int QDS_Datum::wrapperType( QDS_Datum::Wrapper* wrap ) const
 {
   int id = -1;
   for ( QMap<int, Wrapper*>::ConstIterator it = myWrapper.begin(); it != myWrapper.end() && id == -1; ++it )
   {
-    if ( it.data() == wrap )
+    if ( it.value() == wrap )
       id = it.key();
   }
   return id;
 }
+
+/*!
+  \fn void QDS_Datum::paramChanged();
+  \brief The signal is emitted when the datum value is changed.
+*/
+
+/*!
+  void QDS_Datum::paramChanged( QString& txt );
+  \brief The signal is emitted when the datum value is changed.
+  \param txt new datum value
+*/
+
index 9ff431f66ad35eabed35f827b395458670c83bb0..e438a4e17f2ebc9c3f49cd29d11588c8db0f9314 100644 (file)
@@ -1,41 +1,40 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QDS_DATUM_H
 #define QDS_DATUM_H
 
 #include "QDS.h"
+#include <QPointer>
+#include <QMap>
+#include <QLabel>
 
-#include <qwidget.h>
-#include <qstring.h>
-#include <qvariant.h>
-#include <qguardedptr.h>
+class QHBoxLayout;
+class QVBoxLayout;
+class QGridLayout;
+class QValidator;
 
 #include <DDS_DicItem.h>
 
-class QLabel;
 class QWidget;
-class QValidator;
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-
-class Handle(DDS_Dictionary);
 
 class QDS_EXPORT QDS_Datum : public QObject, public QDS
 {
@@ -44,7 +43,7 @@ class QDS_EXPORT QDS_Datum : public QObject, public QDS
   class Wrapper;
 
 public:
-  QDS_Datum( const QString&, QWidget* = 0, const int = All, const QString& = QString::null );
+  QDS_Datum( const QString&, QWidget* = 0, const int = All, const QString& = QString() );
   virtual ~QDS_Datum();
 
   QString                   id() const;
@@ -96,8 +95,8 @@ public:
   void                      setFocus();
 
   virtual bool              isValid( const bool = true, 
-                                     const QString& = QString::null,
-                                     const QString& = QString::null ) const;
+                                     const QString& = QString(),
+                                     const QString& = QString() ) const;
   virtual QValidator*       validator( const bool = false ) const;
 
   void                      addTo( QVBoxLayout* );
@@ -118,6 +117,9 @@ public:
 
   operator QWidget*() const;
 
+  bool isCustomTr() const;
+  void enableCustomTr( const bool );
+
 signals:
   void                      paramChanged();
   void                      paramChanged( QString& );
@@ -183,8 +185,8 @@ private:
   static QString            canonicalFormat( const QString&, QString& );
 
 private:
-  typedef QGuardedPtr<QLabel>  GuardedLabel;
-  typedef QGuardedPtr<QWidget> GuardedWidget;
+  typedef QPointer<QLabel>  GuardedLabel;
+  typedef QPointer<QWidget> GuardedWidget;
 
 private:
   QString                   myId;
@@ -199,7 +201,7 @@ private:
   QString                   mySourceValue;
   QString                   myTargetValue;
 
-  bool                      myInitialised;
+  bool                      myInitialised, myTr;
 
   friend class QDS;
 };
index cb5ddf1486690e53029822e4b2e4883f4d57bb04..aa00d7352ba70dba2b20cc1d6094e12d2eb074e3 100644 (file)
@@ -1,29 +1,33 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QDS_LineEdit.h"
 
-#include <qlineedit.h>
-#include <qvalidator.h>
+#include <QLineEdit>
+#include <QValidator>
 
-/*
-  class: QDS_LineEdit::Editor
-  descr: Internal class inherited from line edit
+/*!
+  \class QDS_LineEdit::Editor
+  \internal
+  \brief Improved version of QLineEdit.
 */
 
 class QDS_LineEdit::Editor : public QLineEdit
@@ -52,16 +56,30 @@ private:
 /*
   \class QDS_LineEdit
   
-  Datum with control corresponding to line edit. User can enter parameter value in single line editor.
-  User inputted values will be checked by validator according to type if value and parameter properties
-  (minimum, maximum, filter, precision, etc). If user input not valid value then this value will be
-  displayed in red color.
+  \brief Datum with control corresponding to the line edit. 
+
+  User can enter parameter value in single line editor.
+  The value entered by the user is checked by the validator according to item type
+  according to the item properties (minimum, maximum, filter, precision, etc).
+
+  If user input is not valid, the value is displayed in red color.
 */
 
 /*!
-  Constructor. Create line edit datum object with datum identifier \aid under widget \aparent. Parameter \aflags
-  define behaviour of datum and set of created subwidgets. Default value of this parameter is QDS::All.
-  Parameter \acomp specify the component name which will be used during search of dictionary item.
+  \brief Constructor. 
+
+  Create line edit datum object with datum identifier \a id and parent widget \a parent. 
+
+  Parameter \a flags defines behaviour of datum and set of created
+  subwidgets. Default value of this parameter is QDS::All.
+
+  Parameter \a comp specifies the component name which will be used
+  when searching the dictionary item.
+
+  \param id datum identifier
+  \param parent parent widget
+  \param flags datum flags
+  \param comp component
 */
 QDS_LineEdit::QDS_LineEdit( const QString& id, QWidget* parent, const int flags, const QString& comp )
 : QDS_Datum( id, parent, flags, comp )
@@ -69,15 +87,18 @@ QDS_LineEdit::QDS_LineEdit( const QString& id, QWidget* parent, const int flags,
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QDS_LineEdit::~QDS_LineEdit()
 {
 }
 
 /*!
-  Notification about active unit system changing. Reimplemented from QDS_Datum.
+  \brief Process notification about active units system changing.
+
   Update validator settings for line edit.
+
+  \param system new active units system
 */
 void QDS_LineEdit::unitSystemChanged( const QString& system )
 {
@@ -88,14 +109,14 @@ void QDS_LineEdit::unitSystemChanged( const QString& system )
     return;
   
   delete le->validator();
-  le->clearValidator();
+  le->setValidator(0);
   QValidator* valid = validator();
   if ( valid )
     le->setValidator( valid );
 
   QString aFormat = format();
   int num = 0;
-  int pos = aFormat.find( '%' );
+  int pos = aFormat.indexOf( '%' );
   if ( pos != -1 )
   {
     pos++;
@@ -112,12 +133,12 @@ void QDS_LineEdit::unitSystemChanged( const QString& system )
   int minLen  = format( format(), type(), minValue() ).length();
   int maxLen  = format( format(), type(), maxValue() ).length();
 
-  num = QMAX( QMAX( num, zeroLen ), QMAX( minLen, maxLen ) );
+  num = qMax( qMax( num, zeroLen ), qMax( minLen, maxLen ) );
   ((Editor*)le)->setNumber( num );
 }
 
 /*!
-  Select all text in the editor.
+  \brief Select all text in the editor.
 */
 void QDS_LineEdit::selectAll()
 {
@@ -126,7 +147,7 @@ void QDS_LineEdit::selectAll()
 }
 
 /*!
-  Deselect all text in the editor.
+  \brief Deselect all text in the editor.
 */
 void QDS_LineEdit::deselect()
 {
@@ -135,7 +156,8 @@ void QDS_LineEdit::deselect()
 }
 
 /*!
-  Select or deselect all text in the editor.
+  \brief Select/deselect all text in the editor.
+  \param on select text if \c true and deselect if \c false
 */
 void QDS_LineEdit::setSelection( const bool on )
 {
@@ -146,7 +168,8 @@ void QDS_LineEdit::setSelection( const bool on )
 }
 
 /*!
-  Returns true if the editor has selected text.
+  \brief Check if there is selection in the editor.
+  \return \c true if the editor has selected text
 */
 bool QDS_LineEdit::hasSelection() const
 {
@@ -154,18 +177,21 @@ bool QDS_LineEdit::hasSelection() const
 }
 
 /*!
-  Set the aligment of line edit. Reimplemented from QDS_Datum.
+  \brief Set the aligment for the line edit.
+  \param align alignment type (Qt::Alignment)
+  \param type ORed subwidget flags
 */
 void QDS_LineEdit::setAlignment( const int align, const int type )
 {
   if ( ( type & Control ) && lineEdit() )
-    lineEdit()->setAlignment( align );
+    lineEdit()->setAlignment( Qt::Alignment(align) );
 
   QDS_Datum::setAlignment( align, type );
 }
 
 /*!
-  Returns string value from QLineEdit widget. Reimplemented from QDS_Datum.
+  \brief Get string value from datum.
+  \return datum string value
 */
 QString QDS_LineEdit::getString() const
 {
@@ -176,7 +202,8 @@ QString QDS_LineEdit::getString() const
 }
 
 /*!
-  Sets the string value into QLineEdit widget. Reimplemented from QDS_Datum.
+  \brief Set string value to datum.
+  \param txt new datum string value
 */
 void QDS_LineEdit::setString( const QString& txt )
 {
@@ -185,15 +212,18 @@ void QDS_LineEdit::setString( const QString& txt )
 }
 
 /*!
-  Returns pointer to QLineEdit widget.
+  \brief Get line edit widget.
+  \return pointer to the QLineEdit widget
 */
 QLineEdit* QDS_LineEdit::lineEdit() const
 {
-  return ::qt_cast<QLineEdit*>( controlWidget() );
+  return ::qobject_cast<QLineEdit*>( controlWidget() );
 }
 
 /*!
-  Create QLineEdit widget as control subwidget. Reimplemented from QDS_Datum.
+  \brief Create line edit widget as control subwidget.
+  \param parent parent widget
+  \return created line edit widget
 */
 QWidget* QDS_LineEdit::createControl( QWidget* parent )
 {
@@ -204,9 +234,13 @@ QWidget* QDS_LineEdit::createControl( QWidget* parent )
 }
 
 /*!
-  Notify about text changing in line edit.
+  \brief Called when text in the edit box is modified by the user.
+
+  Notify about text changing in the line edit.
+
+  \param txt current text in the line edit widget (not used)
 */
-void QDS_LineEdit::onTextChanged( const QString& )
+void QDS_LineEdit::onTextChanged( const QString& /*txt*/ )
 {
   invalidateCache();
 
@@ -217,7 +251,11 @@ void QDS_LineEdit::onTextChanged( const QString& )
 }
 
 /*!
-  Checks the current parameter value on validity. If value is not valid then set text color as red.
+  \brief Called when text is changed.
+
+  Validate the current parameter value. If value is not valid then set text color as red.
+
+  Emits signal paramChanged() to notify about changing of the control state.
 */
 void QDS_LineEdit::onParamChanged()
 {
@@ -229,9 +267,14 @@ void QDS_LineEdit::onParamChanged()
 
   QPalette aPal = anEdit->palette();
   if ( !aValid )
-    aPal.setColor( QPalette::Active, QColorGroup::Text, QColor( 255, 0, 0 ) );
+    aPal.setColor( QPalette::Active, QPalette::Text, QColor( 255, 0, 0 ) );
   else
-    aPal.setColor( QPalette::Active, QColorGroup::Text, QColor( 0, 0, 0 ) );
+    aPal.setColor( QPalette::Active, QPalette::Text, QColor( 0, 0, 0 ) );
 
   anEdit->setPalette( aPal );
 }
+
+/*!
+  \brief void QDS_LineEdit::returnPressed();
+  \brief The signal is emitted when user presses \c Enter key in the line edit.
+*/
index 293e57eedf58b73cb0c52fac55d3b361c0f73423..332a2b948e1c1383204bad5e0a5fb4faaff2b3ca 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QDS_LINEEDIT_H
 #define QDS_LINEEDIT_H
@@ -33,7 +36,7 @@ protected:
   class Editor;
 
 public:
-  QDS_LineEdit( const QString&, QWidget* = 0, const int = All, const QString& = QString::null );
+  QDS_LineEdit( const QString&, QWidget* = 0, const int = All, const QString& = QString() );
   virtual ~QDS_LineEdit();
 
   virtual void         deselect();
index 44771f0fc1c5b47560ed30bb4862d17ae34f95ba..c2ae107ce6206115f1b3e45782053f206a410661 100644 (file)
@@ -1,65 +1,82 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QDS_RadioBox.h"
 
-#include <DDS_Dictionary.h>
-
-#include <TCollection_AsciiString.hxx>
 #include <TColStd_HArray1OfInteger.hxx>
 #include <TColStd_HArray1OfExtendedString.hxx>
 
-#include <qobjectlist.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QVBoxLayout>
+#include <QRadioButton>
 
 /*
   \class QDS_RadioBox
-  
-  Datum with control corresponding to button group with set of exclusive radio buttons.
+  \brief Datum with control corresponding to button group with set of exclusive radio buttons.
+
   This control used for datum with enumerable values. It can be used for datum which has
-  type of value 'List'. Each radio button of combobox defined two properties:
-  integer identifier and string name. All operations on radio buttons performed via identifier.
+  type of value 'List'. Each radio button of group box is defined by two properties:
+  integer identifier and string name. All operations on radio buttons are performed via identifier.
 
-  If datum label text is specified then it displayed in group box title.
+  If datum label text is specified, then it is displayed in the group box title.
 */
 
 /*!
-  Constructor. Create radio button box datum object with datum identifier \aid under widget \aparent.
-  Parameter \aflags define behaviour of datum and set of created subwidgets. Default value of this
-  parameter is QDS::Control. Parameter \acomp specify the component name which will be used during
-  search of dictionary item.
+  \brief Constructor. 
+
+  Create radio button box datum object with datum identifier \a id and parent widget \a parent.
+  
+  Parameter \a flags defines behaviour of datum and set of created
+  subwidgets. Default value of this parameter is QDS::All. 
+  
+  Parameter \a comp specifies the component name which will be used
+  when searching the dictionary item.
+
+  \param id datum identifier
+  \param parent parent widget
+  \param flags datum flags
+  \param comp component
 */
 QDS_RadioBox::QDS_RadioBox( const QString& id, QWidget* parent, const int flags, const QString& comp )
-: QDS_Datum( id, parent, flags & ~( Label | Units ), comp )
+: QDS_Datum( id, parent, flags & ~( Label | Units ), comp ),
+  myButtonGroup( 0 )
 {
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QDS_RadioBox::~QDS_RadioBox()
 {
 }
 
 /*!
-  Returns number of buttons in radio box. If total is 'false' then only
-  visible buttons are taken into account otherwise all buttons.
+  \brief Get number of buttons in radio box.
+
+  If \a total is \c false, only visible buttons are taken into account; 
+  otherwise total number of buttons is returned
+
+  \param total get number of visible buttons if \c true and total number of buttons if \c false
+  \return requested number of items
 */
 int QDS_RadioBox::count( bool total ) const
 {
@@ -67,17 +84,18 @@ int QDS_RadioBox::count( bool total ) const
     return myValue.count();
   else
   {
-    QPtrList<QRadioButton> bList;
+    QList<QRadioButton*> bList;
     buttons( bList );
     return bList.count();
   }
 }
 
 /*!
-  Returns list of button identifiers \aids. If \atotal is 'false' then only visible
-  buttons are taken into account otherwise all buttons.
+  \brief Get buttons identifiers.
+  \param ids returned list of buttons IDs
+  \param total take into account only visible buttons if \c true and all buttons if \c false
 */
-void QDS_RadioBox::values( QValueList<int>& ids, bool total ) const
+void QDS_RadioBox::values( QList<int>& ids, bool total ) const
 {
   ids.clear();
   for ( QIntList::const_iterator it = myDataIds.begin(); it != myDataIds.end(); ++it )
@@ -86,7 +104,9 @@ void QDS_RadioBox::values( QValueList<int>& ids, bool total ) const
 }
 
 /*!
-  Returns visible state of button specified by \aid.
+  \brief Get visibility state of the button specified by \a id.
+  \param id button ID
+  \return item visibility state
 */
 bool QDS_RadioBox::state( const int id ) const
 {
@@ -97,13 +117,20 @@ bool QDS_RadioBox::state( const int id ) const
 }
 
 /*!
-  Sets the visible state of button specified by \aid. If \aid is -1 then specified
-  state will be set to all buttons. If \aappend is set then keep status for other
-  buttons otherwise status of other buttons will be cleared.
+  \brief Set the visibility state of the button specified by \a id.
+
+  If \a id is -1 then specified state will be set to all buttons.
+
+  If \a append is set to \c true, keep current status for other buttons,
+  otherwise status of other buttons is cleared.
+
+  \param on new visibility state
+  \param id button ID
+  \param append if \c true, keep original status for other buttons
 */
 void QDS_RadioBox::setState( const bool on, const int id, const bool append )
 {
-  QValueList<int> lst;
+  QList<int> lst;
   if ( id < 0 )
   {
     for ( IdStateMap::Iterator it = myState.begin(); it != myState.end(); ++it )
@@ -116,11 +143,16 @@ void QDS_RadioBox::setState( const bool on, const int id, const bool append )
 }
 
 /*!
-  Sets the visible state of buttons specified by list of identifiers \aids.
-  If \aappend is set then keep status for other buttons otherwise status of other
-  buttons will be cleared.
+  \brief Set the visibility state of buttons specified by \a ids.
+
+  If \a append is set to \c true, keep the current status for other buttons,
+  otherwise status of other buttons is cleared.
+
+  \param on new visibility state
+  \param ids buttons IDs list
+  \param append if \c true, keep original status for other buttons
 */
-void QDS_RadioBox::setState( const bool on, const QValueList<int>& ids, const bool append )
+void QDS_RadioBox::setState( const bool on, const QList<int>& ids, const bool append )
 {
   if ( ids.isEmpty() && append )
     return;
@@ -129,21 +161,21 @@ void QDS_RadioBox::setState( const bool on, const QValueList<int>& ids, const bo
 
   QMap<int, int> aMap;
   for ( uint i = 0; i < ids.count(); i++ )
-    aMap.insert( *ids.at( i ), 0 );
+    aMap.insert( ids.at( i ), 0 );
 
   for ( IdStateMap::Iterator it = myState.begin(); it != myState.end(); ++it )
   {
     if ( aMap.contains( it.key() ) )
     {
-      if ( it.data() != on )
+      if ( it.value() != on )
       {
-        it.data() = on;
+        it.value() = on;
         changed = true;
       }
     }
-    else if ( !append && it.data() == on )
+    else if ( !append && it.value() == on )
     {
-      it.data() = !on;
+      it.value() = !on;
       changed = true;
     }
   }
@@ -152,11 +184,16 @@ void QDS_RadioBox::setState( const bool on, const QValueList<int>& ids, const bo
 }
 
 /*!
-  Sets the custom user buttons into the radio box. User buttons like standard dictionary
-  button from list will be added into the radio box. This functionality allow to user override
+  \brief Set the custom user buttons into the radio box.
+
+  User items like standard dictionary buttons will be added
+  into the radio box. This function allows user to customize
   buttons.
+
+  \param ids buttons IDs
+  \param names buttons names
 */
-void QDS_RadioBox::setValues( const QValueList<int>& ids, const QStringList& names )
+void QDS_RadioBox::setValues( const QList<int>& ids, const QStringList& names )
 {
   if ( ids.count() != names.count() )
     return;
@@ -166,21 +203,30 @@ void QDS_RadioBox::setValues( const QValueList<int>& ids, const QStringList& nam
 }
 
 /*!
-  This is an overloaded member function, provided for convenience.
-  It behaves essentially like the above function. It creates
-  QValueList (0, 1, 2 ... ) and call previous method
+  \brief Set the custom user buttons into the radio box.
+  \overload
+
+  User buttons like standard dictionary buttons will be added
+  into the radio box. This function allows user to customize
+  buttons.
+
+  Uses (0, 1, 2 ... ) as buttons IDs.
+
+  \param names buttons names
 */
 void QDS_RadioBox::setValues( const QStringList& names )
 {
-  QValueList< int > ids;
+  QList< int > ids;
   for ( int i = 0, n = names.count(); i < n; i++ )
     ids.append( i );
   setValues( ids, names );
 }
 
 /*!
-  Returns string from radio box. Reimplemented. String which contains identifier of
-  currently selected button returned.
+  \brief Get string from the radio box.
+
+  String which contains identifier of the currently selected button is returned.
+  \return identifier of the current button converted to string
 */
 QString QDS_RadioBox::getString() const
 {
@@ -188,7 +234,7 @@ QString QDS_RadioBox::getString() const
   QButtonGroup* bg = buttonGroup();
   if ( bg )
   {
-    int id = bg->selectedId();
+    int id = bg->checkedId();
     if ( id != -1 )
       res = QString::number( id );
   }
@@ -196,8 +242,11 @@ QString QDS_RadioBox::getString() const
 }
 
 /*!
-  Sets the string into radio box. Reimplemented. Button with identifier from specified
-  string \atxt became selected in radio box.
+  \brief Set the string value to the radio box widget.
+
+  Button with the identifier from specified string \a txt becomes selected in the radio box.
+
+  \param txt string value
 */
 void QDS_RadioBox::setString( const QString& txt )
 {
@@ -205,14 +254,15 @@ void QDS_RadioBox::setString( const QString& txt )
   if ( !bg )
     return;
 
-  int oldId = bg->selectedId();
+  int oldId = bg->checkedId();
 
   if ( txt.isEmpty() )
   {
-    QPtrList<QRadioButton> bList;
+    QList<QRadioButton*> bList;
     buttons( bList );
-    for ( QPtrListIterator<QRadioButton> it( bList ); it.current(); ++it )
-      it.current()->setChecked( false );
+    QListIterator<QRadioButton*> it( bList );
+    while ( it.hasNext() )
+      it.next()->setChecked( false );
   }
   else
   {
@@ -223,11 +273,11 @@ void QDS_RadioBox::setString( const QString& txt )
 
     bool block = signalsBlocked();
     blockSignals( true );
-    bg->setButton( id );
+    bg->button(id)->setChecked(true);
     blockSignals( block );
   }
 
-  int newId = bg->selectedId();
+  int newId = bg->checkedId();
 
   if ( oldId != newId )
   {
@@ -240,27 +290,45 @@ void QDS_RadioBox::setString( const QString& txt )
 }
 
 /*!
-  Returns pointer to QButtonGroup widget.
+  \brief Get internal button group.
+  \return pointer to the QButtonGroup object
 */
 QButtonGroup* QDS_RadioBox::buttonGroup() const
 {
-  return ::qt_cast<QButtonGroup*>( controlWidget() );
+  return myButtonGroup;
+}
+
+/*!
+  \brief Get internal group box widget.
+  \return pointer to the QGroupBox widget
+*/
+QGroupBox* QDS_RadioBox::groupBox() const
+{
+  return ::qobject_cast<QGroupBox*>( controlWidget() );
 }
 
 /*!
-  Create QButtonGroup widget as control subwidget.
+  \brief Get radio button group box widget.
+  \return internal group box widget
 */
 QWidget* QDS_RadioBox::createControl( QWidget* parent )
 {
-  QButtonGroup* bg = new QButtonGroup( 1, Qt::Vertical, "", parent );
-  bg->setExclusive( true );
-  bg->setRadioButtonExclusive( true );
-  return bg;
+  myButtonGroup = new QButtonGroup( parent );
+  myButtonGroup->setExclusive( true );
+
+  QGroupBox *gb = new QGroupBox( "", parent );
+  QVBoxLayout *vbox = new QVBoxLayout;
+  vbox->addStretch(1);
+  gb->setLayout(vbox);
+  return gb;
 }
 
 /*!
-  Notification about active unit system changing. Reimplemented from QDS_Datum.
-  Update radio box content.
+  \brief Process notification about active units system changing.
+
+  Update radio box contents.
+  
+  \param system new active units system
 */
 void QDS_RadioBox::unitSystemChanged( const QString& system )
 {
@@ -325,15 +393,15 @@ void QDS_RadioBox::unitSystemChanged( const QString& system )
   for ( QIntList::iterator iter2 = add.begin(); iter2 != add.end(); ++iter2 )
     myState.insert( *iter2, true );
 
-  QButtonGroup* bg = buttonGroup();
-  if ( bg )
-    bg->setTitle( label() );
+  QGroupBox* gb = groupBox();
+  if ( gb ) gb->setTitle( label() );
 
   updateRadioBox();
 }
 
 /*!
-  Notify about activation radio button.
+  \brief Called when user toggles any radio button.
+  \param on new radio button state
 */
 void QDS_RadioBox::onToggled( bool on )
 {
@@ -347,7 +415,7 @@ void QDS_RadioBox::onToggled( bool on )
 }
 
 /*!
-  Updates RadioBox after have change of visible state or buttons have been inserted/removed.
+  \brief Update radio box.
 */
 void QDS_RadioBox::updateRadioBox()
 {
@@ -355,12 +423,20 @@ void QDS_RadioBox::updateRadioBox()
   if ( !bg )
     return;
 
-  int curId = bg->selectedId();
+  QGroupBox* gb = groupBox();
+  if ( !gb )
+    return;
+
+  int curId = bg->checkedId();
 
-  QPtrList<QRadioButton> bList;
+  QList<QRadioButton*> bList;
   buttons( bList );
-  for ( QPtrListIterator<QRadioButton> itr( bList ); itr.current(); ++itr )
-    delete itr.current();
+  QListIterator<QRadioButton*> itr( bList );
+  while ( itr.hasNext() ) {
+    QRadioButton* aButton = itr.next();
+    if ( gb->layout() ) gb->layout()->removeWidget(aButton);
+    delete aButton;
+  }
 
   for ( QIntList::const_iterator it = myDataIds.begin(); it != myDataIds.end(); ++it )
   {
@@ -368,8 +444,10 @@ void QDS_RadioBox::updateRadioBox()
     if ( !myValue.contains( id ) || !myState.contains( id ) || !myState[id] )
       continue;
 
-    QRadioButton* rb = new QRadioButton( myValue[id], bg );
-    bg->insert( rb, id );
+    QRadioButton* rb = new QRadioButton( myValue[id] );
+    ((QObject*)rb)->setParent( bg );
+    bg->addButton( rb, id );
+    if ( gb->layout() ) gb->layout()->addWidget(rb);
 
     connect( rb, SIGNAL( toggled( bool ) ), this, SLOT( onToggled( bool ) ) );
   }
@@ -377,49 +455,49 @@ void QDS_RadioBox::updateRadioBox()
   if ( curId != -1 )
   {
     int id = curId;
-    if ( !bg->find( id ) )
+    if ( !bg->button( id ) )
     {
-      QPtrList<QRadioButton> bList;
+      QList<QRadioButton*> bList;
       buttons( bList );
       if ( !bList.isEmpty() )
-        id = bg->id( bList.getFirst() );
+        id = bg->id( bList.empty() ? 0 : bList.first() );
     }
 
     bool block = signalsBlocked();
     blockSignals( true );
-    bg->setButton( id );
+    bg->button(id)->setChecked(true);
     blockSignals( block );
   }
 
-  if ( curId != bg->selectedId() )
+  if ( curId != bg->checkedId() )
   {
     onParamChanged();
+    QString str = getString();
     emit paramChanged();
-    emit paramChanged( getString() );
+    emit paramChanged( str );
   }
 }
 
 /*!
-  Returns the list of the radio buttons from the button group.
+  \brief Get all the radio buttons from the radio box.
+  \param lst returned list of radio buttons
 */
-void QDS_RadioBox::buttons( QPtrList<QRadioButton>& lst ) const
+void QDS_RadioBox::buttons( QList<QRadioButton*>& lst ) const
 {
-  lst.setAutoDelete( false );
   lst.clear();
 
   QButtonGroup* bg = buttonGroup();
   if ( !bg )
     return;
 
-  QObjectList* objs = bg->queryList( "QRadioButton" );
-  if ( objs )
-  {
-    for ( QObjectListIt it( *objs ); it.current(); ++it )
-    {
-      QRadioButton* rb = ::qt_cast<QRadioButton*>( it.current() );
-      if ( rb )
-        lst.append( rb );
-    }
-  }
-  delete objs;
+  QList<QRadioButton*> objs = bg->findChildren<QRadioButton*>();
+  QListIterator<QRadioButton*> it( objs );
+  while ( it.hasNext() )
+    lst.append( it.next() );
 }
+
+/*!
+  \fn void QDS_RadioBox::activated( int id );
+  \brief The signal is emitted when any radio button is toggled.
+  \param id button ID
+*/
index 862b6ab4f617d71ea4f9a055bb62c25cba88c6ac..0d667d45c0f2ba7b4538a728c744b4a3923ff402 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QDS_RADIOBOX_H
 #define QDS_RADIOBOX_H
 
 #include <Qtx.h>
 
-#include <qmap.h>
-#include <qpixmap.h>
-#include <qstringlist.h>
+#include <QMap>
+#include <QStringList>
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
 class QButtonGroup;
+class QGroupBox;
 class QRadioButton;
 
 class QDS_EXPORT QDS_RadioBox : public QDS_Datum
@@ -39,19 +42,19 @@ class QDS_EXPORT QDS_RadioBox : public QDS_Datum
   Q_OBJECT
 
 public:
-  QDS_RadioBox( const QString&, QWidget* = 0, const int = Control, const QString& = QString::null );
+  QDS_RadioBox( const QString&, QWidget* = 0, const int = Control, const QString& = QString() );
   virtual ~QDS_RadioBox();
 
   int                        count( bool = false ) const;
-  void                       values( QValueList<int>&, bool = false ) const;
+  void                       values( QList<int>&, bool = false ) const;
 
   int                        columns() const;
   void                       setColumns( const int );
 
   bool                       state( const int ) const;
   void                       setState( const bool, const int, const bool = true );
-  void                       setState( const bool, const QValueList<int>&, const bool = true );
-  void                       setValues( const QValueList<int>&, const QStringList& );
+  void                       setState( const bool, const QList<int>&, const bool = true );
+  void                       setValues( const QList<int>&, const QStringList& );
   void                       setValues( const QStringList& );
 
 signals:
@@ -62,8 +65,9 @@ protected slots:
 
 protected:
   QButtonGroup*              buttonGroup() const;
+  QGroupBox*                 groupBox() const;
   virtual QWidget*           createControl( QWidget* );
-  void                       buttons( QPtrList<QRadioButton>& ) const;
+  void                       buttons( QList<QRadioButton*>& ) const;
 
   virtual QString            getString() const;
   virtual void               setString( const QString& );
@@ -84,9 +88,11 @@ private:
   QIntList                   myDataIds;
   QIntList                   myUserIds;
   QStringList                myUserNames;
+
+  QButtonGroup*              myButtonGroup;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( default:4251 )
 #endif
 
index 71864cb51e5ad06014b1fe141a8f8a517a46535b..407cbe14e75cfc6f4058def30a94cba1ba6da6a5 100644 (file)
@@ -1,39 +1,51 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QDS_SpinBox.h"
 
 #include <QtxIntSpinBox.h>
 
-#include <qvalidator.h>
-
 /*
   \class QDS_SpinBox
-  
-  Datum with control corresponding to spin box. This control used for integer numbers.
-  User can input data directly in spin box or can modify current value with given
-  increment.
+  \brief Datum with control corresponding to spin box.
+
+  This control used for integer numbers. User can input data directly in the spin box
+  or can modify current value by clicking arrow (+/-) buttons.
 */
 
 /*!
-  Constructor. Create spin box datum object with datum identifier \aid under widget \aparent. Parameter \aflags
-  define behaviour of datum and set of created subwidgets. Default value of this parameter is QDS::All.
-  Parameter \acomp specify the component name which will be used during search of dictionary item.
+  \brief Constructor. 
+
+  Create spin box datum object with datum identifier \a id and parent widget \a parent.
+
+  Parameter \a flags defines behaviour of datum and set of created
+  subwidgets. Default value of this parameter is QDS::All.
+
+  Parameter \a comp specifies the component name which will be used
+  when searching the dictionary item.
+
+  \param id datum identifier
+  \param parent parent widget
+  \param flags datum flags
+  \param comp component
 */
 QDS_SpinBox::QDS_SpinBox( const QString& id, QWidget* parent, const int flags, const QString& comp )
 : QDS_Datum( id, parent, flags, comp )
@@ -41,14 +53,15 @@ QDS_SpinBox::QDS_SpinBox( const QString& id, QWidget* parent, const int flags, c
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QDS_SpinBox::~QDS_SpinBox()
 {
 }
 
 /*!
-  Returns string from QSpinBox widget. Reimplemented.
+  \brief Get string from the spin box.
+  \return string value
 */
 QString QDS_SpinBox::getString() const
 {
@@ -58,15 +71,16 @@ QString QDS_SpinBox::getString() const
   {
     res = aSpinBox->text();
     if ( !aSpinBox->suffix().isEmpty() )
-      res.remove( res.find( aSpinBox->suffix() ), aSpinBox->suffix().length() );
+      res.remove( res.indexOf( aSpinBox->suffix() ), aSpinBox->suffix().length() );
     if ( !aSpinBox->prefix().isEmpty() )
-      res.remove( res.find( aSpinBox->prefix() ), aSpinBox->prefix().length() );
+      res.remove( res.indexOf( aSpinBox->prefix() ), aSpinBox->prefix().length() );
   }
   return res;
 }
 
 /*!
-  Sets the string into QSpinBox widget. Reimplemented.
+  \brief Set the string value to the spin box widget.
+  \param txt string value
 */
 void QDS_SpinBox::setString( const QString& txt )
 {
@@ -79,15 +93,18 @@ void QDS_SpinBox::setString( const QString& txt )
 }
 
 /*!
-  Returns pointer to QSpinBox widget.
+  \brief Get spin box widget.
+  \return internal spin box widget.
 */
 QtxIntSpinBox* QDS_SpinBox::spinBox() const
 {
-  return ::qt_cast<QtxIntSpinBox*>( controlWidget() );
+  return ::qobject_cast<QtxIntSpinBox*>( controlWidget() );
 }
 
 /*!
-  Create QSpinBox widget as control subwidget. Reimplemented.
+  \brief Create internal spin box as control widget.
+  \param parent parent widget
+  \return created spin box widget
 */
 QWidget* QDS_SpinBox::createControl( QWidget* parent )
 {
@@ -98,7 +115,11 @@ QWidget* QDS_SpinBox::createControl( QWidget* parent )
 }
 
 /*!
-  Notify about value changing in spin box.
+  \brief Called when value in the spin box is changed.
+
+  Emit signals to notify  about value changing in the spin box.
+
+  \param val current spin box value
 */
 void QDS_SpinBox::onValueChanged( int val )
 {
@@ -109,28 +130,33 @@ void QDS_SpinBox::onValueChanged( int val )
 }
 
 /*!
-  Sets the increment step.
+  \brief Set the spin box increment value.
+  \param step new increment value
 */
 void QDS_SpinBox::setStep( const int step )
 {
   if ( spinBox() )
-    spinBox()->setLineStep( step );
+    spinBox()->setSingleStep( step );
 }
 
 /*!
-  Returns the increment step.
+  \brief Get the spin box increment value.
+  \return current increment value
 */
 int QDS_SpinBox::step() const
 {
   int s = 0;
   if ( spinBox() )
-    s = spinBox()->lineStep();
+    s = spinBox()->singleStep();
   return s;
 }
 
 /*!
-  Notification about active unit system changing. Reimplemented from QDS_Datum.
-  Update validator and spin box parameters: suffix, prefix, minimum, maximum.
+  \brief Process notification about active units system changing.
+
+  Update spin box contents according to the data dictionary item properties: suffix, prefix, minimum, maximum
+  
+  \param system new active units system
 */
 void QDS_SpinBox::unitSystemChanged( const QString& system )
 {
@@ -139,13 +165,16 @@ void QDS_SpinBox::unitSystemChanged( const QString& system )
   QSpinBox* sb = spinBox();
   if ( sb )
   {
-    delete sb->validator();
-    QValidator* valid = validator();
-    sb->setValidator( valid );
+    // not porting this code to qt4, only commented, since from the task context
+    // the new setted validator accepts all integers
+    //delete sb->validator();
+    //QValidator* valid = validator();
+    //sb->setValidator( valid );
 
     sb->setSuffix( suffix() );
     sb->setPrefix( prefix() );
-    sb->setMinValue( minValue().toInt() );
-    sb->setMaxValue( maxValue().toInt() );
+    sb->setMinimum( minValue().isEmpty() ? -INT_MAX : minValue().toInt() );
+    sb->setMaximum( maxValue().isEmpty() ? INT_MAX : maxValue().toInt() );
+
   }
 }
index f0456900e860cab9e7d73d1db16a886cece2a94a..c313be8e01de6a2e15e6f89e08cacc4ea0bc7f80 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QDS_SPINBOX_H
 #define QDS_SPINBOX_H
@@ -28,7 +31,7 @@ class QDS_EXPORT QDS_SpinBox : public QDS_Datum
   Q_OBJECT
 
 public:
-  QDS_SpinBox( const QString&, QWidget* = 0, const int = All, const QString& = QString::null );
+  QDS_SpinBox( const QString&, QWidget* = 0, const int = All, const QString& = QString() );
   virtual ~QDS_SpinBox();
 
   int              step() const;
index 0bd7bcf264a95da6d3850a08674c718e865e3458..bc8def56a995dbfcd21045ef1289da285869acbc 100644 (file)
@@ -1,41 +1,51 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QDS_SpinBoxDbl.h"
 
-#include <DDS_Dictionary.h>
-
-#include <qvalidator.h>
-
-#include <QtxDblSpinBox.h>
+#include <QtxDoubleSpinBox.h>
 
 /*
   \class QDS_SpinBoxDbl
+  \brief Datum with control corresponding to spin box.
   
-  Datum with control corresponding to spin box. This control used for double numbers.
-  User can input data directly in spin box or can modify current value with given
-  increment.
+  This control is suitable for double numbers. User can input data directly in the spin box
+  or can modify current value by clicking arrow (+/-) buttons.
 */
 
 /*!
-  Constructor. Create spin box datum object with datum identifier \aid under widget \aparent. Parameter \aflags
-  define behaviour of datum and set of created subwidgets. Default value of this parameter is QDS::All.
-  Parameter \acomp specify the component name which will be used during search of dictionary item.
+  \brief Constructor. 
+
+  Create spin box datum object with datum identifier \a id and parent widget \a parent.
+
+  Parameter \a flags defines behaviour of datum and set of created
+  subwidgets. Default value of this parameter is QDS::All.
+
+  Parameter \a comp specifies the component name which will be used
+  when searching the dictionary item.
+
+  \param id datum identifier
+  \param parent parent widget
+  \param flags datum flags
+  \param comp component
 */
 QDS_SpinBoxDbl::QDS_SpinBoxDbl( const QString& id, QWidget* parent, const int flags, const QString& comp )
 : QDS_Datum( id, parent, flags, comp )
@@ -43,19 +53,20 @@ QDS_SpinBoxDbl::QDS_SpinBoxDbl( const QString& id, QWidget* parent, const int fl
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QDS_SpinBoxDbl::~QDS_SpinBoxDbl()
 {
 }
 
 /*!
-  Returns string from QSpinBox widget. Reimplemented.
+  \brief Get string from the spin box.
+  \return string value
 */
 QString QDS_SpinBoxDbl::getString() const
 {
   QString res;
-  QtxDblSpinBox* sb = spinBox();
+  QtxDoubleSpinBox* sb = spinBox();
   if ( sb && !sb->isCleared() )
   {
     bool hasFocus = sb->hasFocus();
@@ -64,9 +75,9 @@ QString QDS_SpinBoxDbl::getString() const
     
     res = sb->text();
     if ( !sb->suffix().isEmpty() )
-      res.remove( res.find( sb->suffix() ), sb->suffix().length() );
+      res.remove( res.indexOf( sb->suffix() ), sb->suffix().length() );
     if ( !sb->prefix().isEmpty() )
-      res.remove( res.find( sb->prefix() ), sb->prefix().length() );
+      res.remove( res.indexOf( sb->prefix() ), sb->prefix().length() );
     
     if ( hasFocus )
       sb->setFocus();
@@ -76,7 +87,8 @@ QString QDS_SpinBoxDbl::getString() const
 }
 
 /*!
-  Sets the string into QSpinBox widget. Reimplemented.
+  \brief Set the string value to the spin box widget.
+  \param txt string value
 */
 void QDS_SpinBoxDbl::setString( const QString& txt )
 {
@@ -89,26 +101,33 @@ void QDS_SpinBoxDbl::setString( const QString& txt )
 }
 
 /*!
-  Returns pointer to QtxDblSpinBox widget.
+  \brief Get spin box widget.
+  \return internal spin box widget.
 */
-QtxDblSpinBox* QDS_SpinBoxDbl::spinBox() const
+QtxDoubleSpinBox* QDS_SpinBoxDbl::spinBox() const
 {
-  return ::qt_cast<QtxDblSpinBox*>( controlWidget() );
+  return ::qobject_cast<QtxDoubleSpinBox*>( controlWidget() );
 }
 
 /*!
-  Create QSpinBox widget as control subwidget. Reimplemented.
+  \brief Create internal spin box as control widget.
+  \param parent parent widget
+  \return created spin box widget
 */
 QWidget* QDS_SpinBoxDbl::createControl( QWidget* parent )
 {
-  QtxDblSpinBox* aSpinBox = new QtxDblSpinBox( parent );
+  QtxDoubleSpinBox* aSpinBox = new QtxDoubleSpinBox( parent );
   aSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   connect( aSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged( double ) ) );
   return aSpinBox;
 }
 
 /*!
-  Notify about value changing in spin box.
+  \brief Called when value in the spin box is changed.
+
+  Emit signals to notify  about value changing in the spin box.
+
+  \param val current spin box value
 */
 void QDS_SpinBoxDbl::onValueChanged( double )
 {
@@ -120,40 +139,47 @@ void QDS_SpinBoxDbl::onValueChanged( double )
 }
 
 /*!
-  Returns the increment step.
+  \brief Get the spin box increment value.
+  \return current increment value
 */
 double QDS_SpinBoxDbl::step() const
 {
   double s = 0;
   if ( spinBox() )
-    s = spinBox()->lineStep();
+    s = spinBox()->singleStep();
   return s;
 }
 
 /*!
-  Sets the increment step.
+  \brief Set the spin box increment value.
+  \param step new increment value
 */
 void QDS_SpinBoxDbl::setStep( const double step )
 {
   if ( spinBox() )
-    spinBox()->setLineStep( step );
+    spinBox()->setSingleStep( step );
 }
 
 /*!
-  Notification about active unit system changing. Reimplemented from QDS_Datum.
-  Update validator and spin box parameters: suffix, prefix, minimum, maximum.
+  \brief Process notification about active units system changing.
+
+  Update spin box contents according to the data dictionary item properties: suffix, prefix, minimum, maximum
+  
+  \param system new active units system
 */
 void QDS_SpinBoxDbl::unitSystemChanged( const QString& system )
 {
   QDS_Datum::unitSystemChanged( system );
 
-  QtxDblSpinBox* sb = spinBox();
+  QtxDoubleSpinBox* sb = spinBox();
   if ( !sb )
     return;
 
-  delete sb->validator();
-  QValidator* valid = validator();
-  sb->setValidator( valid );
+  // not porting this code to qt4, only commented, since from the task context
+  // the new setted validator accepts any double
+  //delete sb->validator();
+  //QValidator* valid = validator();
+  //sb->setValidator( valid );
 
   sb->setSuffix( suffix() );
   sb->setPrefix( prefix() );
@@ -163,9 +189,9 @@ void QDS_SpinBoxDbl::unitSystemChanged( const QString& system )
   if ( !aDicItem.IsNull() )
     aPreci = aDicItem->GetPrecision();
 
-  sb->setPrecision( aPreci );
+  sb->setDecimals( aPreci );
 
-  sb->setLineStep( .1 );
-  sb->setMinValue( minValue().isEmpty() ? -DBL_MAX : minValue().toDouble() );
-  sb->setMaxValue( maxValue().isEmpty() ? DBL_MAX : maxValue().toDouble() );
+  sb->setSingleStep( .1 );
+  sb->setMinimum( minValue().isEmpty() ? -DBL_MAX : minValue().toDouble() );
+  sb->setMaximum( maxValue().isEmpty() ? DBL_MAX : maxValue().toDouble() );
 }
index 362f75c7c6d070be6391dc6ed074fc0f6427781d..0d7d2b1187b792b1c90411e77a9dd6d0e9255b65 100644 (file)
@@ -1,50 +1,53 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QDS_PINBOXDBL_H
 #define QDS_PINBOXDBL_H
 
 #include "QDS_Datum.h"
 
-class QtxDblSpinBox;
+class QtxDoubleSpinBox;
 
 class QDS_EXPORT QDS_SpinBoxDbl : public QDS_Datum
 {
   Q_OBJECT
 
 public:
-  QDS_SpinBoxDbl( const QString&, QWidget* = 0, const int = All, const QString& = QString::null );
+  QDS_SpinBoxDbl( const QString&, QWidget* = 0, const int = All, const QString& = QString() );
   virtual ~QDS_SpinBoxDbl();
 
-  double           step() const;
-  void             setStep( const double );
+  double            step() const;
+  void              setStep( const double );
 
 private slots:
-  void             onValueChanged( double );
+  void              onValueChanged( double );
 
 protected:
-  QtxDblSpinBox*   spinBox() const;
-  virtual QWidget* createControl( QWidget* );
+  QtxDoubleSpinBox* spinBox() const;
+  virtual QWidget*  createControl( QWidget* );
 
-  virtual QString  getString() const;
-  virtual void     setString( const QString& );
+  virtual QString   getString() const;
+  virtual void      setString( const QString& );
 
-  virtual void     unitSystemChanged( const QString& );
+  virtual void      unitSystemChanged( const QString& );
 };
 
 #endif 
index b14e80c8f9a7fd0cc7befef8e1b542feb78288dc..e17cca801db7b5fd8fa82cfaf5d577684a4e05d6 100644 (file)
@@ -1,26 +1,26 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "QDS_Table.h"
 
-#include "QDS_LineEdit.h"
-
 class QDS_Table::DeleteFilter : public QObject
 {
 public:
index c7d33abf95fd0b300f0fed189251dd5d6246e623..9384371aa1a6080ac8a76f457bf727131ae9a242 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QDS_TABLE_H
 #define QDS_TABLE_H
@@ -23,8 +26,8 @@
 
 #include <QtxTable.h>
 
-#include <qmap.h>
-#include <qptrvector.h>
+#include <QMap>
+#include <QVector>
 
 class QDS_EXPORT QDS_Table : public QtxTable
 {
@@ -82,7 +85,7 @@ private:
   QDS_Datum*       datum( const QWidget* ) const;
 
 private:
-  typedef QPtrVector<QDS_Datum>       DatumVector;
+  typedef QVector<QDS_Datum*>         DatumVector;
   typedef QMap<int, QDS_Datum*>       DatumMap;
   typedef QMap<int, DatumMap>         CellMap;
 
index 1eb66dad9bf626390494f1b9362cb3bbd0fdaeda..61ff1044deb6f937730b0d409f0e607b8d3398b3 100644 (file)
@@ -1,36 +1,51 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QDS_TextEdit.h"
 
-#include <qtextedit.h>
+#include <QTextEdit>
 
 /*
   \class QDS_TextEdit
+  \brief Datum with control corresponding to the text edit. 
 
-  Datum with control corresponding to text edit. User can enter parameter value in multiple line editor.
+  User can enter parameter value in multi line editor.
 */
 
 /*!
-  Constructor. Create text edit datum object with datum identifier \aid under widget \aparent.
-  Parameter \aflags define behaviour of datum and set of created subwidgets. Default value of this
-  parameter is QDS::All. Parameter \acomp specify the component name which will be used during search
-  of dictionary item.
+  \brief Constructor. 
+
+  Create combobox datum object with datum identifier \a id 
+  and parent widget \a parent. 
+
+  Parameter \a flags defines behaviour of datum and set of created
+  subwidgets. Default value of this parameter is QDS::All.
+
+  Parameter \a comp specifies the component name which will be used
+  when searching the dictionary item.
+
+  \param id datum identifier
+  \param parent parent widget
+  \param flags datum flags
+  \param comp component
 */
 QDS_TextEdit::QDS_TextEdit( const QString& id, QWidget* parent, const int flags, const QString& comp )
 : QDS_Datum( id, parent, flags, comp )
@@ -38,25 +53,27 @@ QDS_TextEdit::QDS_TextEdit( const QString& id, QWidget* parent, const int flags,
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QDS_TextEdit::~QDS_TextEdit()
 {
 }
 
 /*!
-  Returns string from QTextEdit widget. Reimplemented from QDS_Datum.
+  \brief Get string value from datum.
+  \return datum string value
 */
 QString QDS_TextEdit::getString() const
 {
   QString res;
   if ( textEdit() )
-    res = textEdit()->text();
+    res = textEdit()->toPlainText();
   return res;
 }
 
 /*!
-  Sets the string into QTextEdit widget. Reimplemented from QDS_Datum.
+  \brief Set string value to datum.
+  \param txt new datum string value
 */
 void QDS_TextEdit::setString( const QString& txt )
 {
@@ -65,15 +82,18 @@ void QDS_TextEdit::setString( const QString& txt )
 }
 
 /*!
-  Returns pointer to QTextEdit widget.
+  \brief Get text edit widget.
+  \return internaltext edit widget
 */
 QTextEdit* QDS_TextEdit::textEdit() const
 {
-  return ::qt_cast<QTextEdit*>( controlWidget() );
+  return ::qobject_cast<QTextEdit*>( controlWidget() );
 }
 
 /*!
-  Create QTextEdit widget as control subwidget.
+  \brief Create text edit widget as control subwidget.
+  \param parent parent widget
+  \return created text edit widget
 */
 QWidget* QDS_TextEdit::createControl( QWidget* parent )
 {
@@ -83,6 +103,8 @@ QWidget* QDS_TextEdit::createControl( QWidget* parent )
 }
 
 /*!
+  \brief Called when text is changed by the user.
+
   Notify about text changing in text edit.
 */
 void QDS_TextEdit::onTextChanged()
@@ -96,3 +118,8 @@ void QDS_TextEdit::onTextChanged()
   emit paramChanged();
   emit paramChanged( str );
 }
+
+/*!
+  \fn void QDS_TextEdit::returnPressed();
+  \brief The signal is emitted when user presses \c Enter key in the text edit.
+*/
index 469fbaa36e233b85ac57ecb3c847fe05ac31083f..19fec6269b3dbcc54d9c0b068dd4930e1d04d622 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QDS_TEXTEEDIT_H
 #define QDS_TEXTEEDIT_H
@@ -28,7 +31,7 @@ class QDS_EXPORT QDS_TextEdit : public QDS_Datum
   Q_OBJECT
 
 public:
-  QDS_TextEdit( const QString&, QWidget* = 0, const int = All, const QString& = QString::null );
+  QDS_TextEdit( const QString&, QWidget* = 0, const int = All, const QString& = QString() );
   virtual ~QDS_TextEdit();
 
 signals:
index 37b2ea658d1c506bc27308a710b227838323ab98..16df1ba3a7d79c2ce86a0bf2d4db895facef5da1 100644 (file)
@@ -1,34 +1,42 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QDS_Validator.h"
 
 /*!
   \class QDS_IntegerValidator
+  \brief A validator for integer values.
 
-  This class to provide validation of user inputted string for datum with 'Integer'
+  This class provides validation of the strings entered by the user for datum with 'Integer'
   value type according to datum properties: minimum value, maximum value, filter.
 
-  Inherits from QIntValidator.
+  Inherits QIntValidator.
 */
 
 /*!
-  Constructor. Create empty validator object.
+  \brief Constructor.
+
+  Create empty validator object.
+
+  \param p parent object
 */
 QDS_IntegerValidator::QDS_IntegerValidator( QObject* p )
 : QIntValidator( p )
@@ -36,29 +44,42 @@ QDS_IntegerValidator::QDS_IntegerValidator( QObject* p )
 }
 
 /*!
-  Constructor. Create validator object with filter string \af.
+  \brief Constructor.
+  
+  Create validator object with filter string \a f.
+
+  \param f filter string
+  \param p parent object
 */
 QDS_IntegerValidator::QDS_IntegerValidator( const QString& f, QObject* p )
 : QIntValidator( p ),
-myFilter( f )
+  myFilter( f )
 {
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QDS_IntegerValidator::~QDS_IntegerValidator()
 {
 }
 
 /*!
-  Validate the inputed string \ainput. Reimplemented from QIntValidator. Perform
-  standard check by QIntValidator::validate(). If returned state is not Invalid and
-  filter specified then perform validation with filter by QRegExpValidator.
+  \brief Validate the entered string \a input. 
+
+  Reimplemented from QIntValidator. 
+  
+  Perform standard check by QIntValidator::validate(). If returned state 
+  is not \c QValidator::Invalid and filter is specified then perform validation
+  with filter by QRegExpValidator.
 
-  Returns Invalid if input is invalid according to this validator's rules,
-  Intermediate if it is likely that a little more editing will make the input acceptable
-  and Acceptable if the input is valid.
+  Returns \c QValidator::Invalid if input is invalid according to this validator's rules,
+  \c QValidator::Intermediate if it is likely that a little more editing will make the
+  input acceptable and \c QValidator::Acceptable if the input is valid.
+
+  \param input string being validated
+  \param pos cursor position
+  \return validation state (\c QValidator::State)
 */
 QValidator::State QDS_IntegerValidator::validate( QString& input, int& pos ) const
 {
@@ -67,22 +88,27 @@ QValidator::State QDS_IntegerValidator::validate( QString& input, int& pos ) con
   if ( ivState != Invalid && !myFilter.isEmpty() )
     rgState = QRegExpValidator( QRegExp( myFilter ), 0 ).validate( input, pos );
 
-  ivState = QMIN( ivState, rgState );
+  ivState = qMin( ivState, rgState );
 
   return ivState;
 }
 
 /*!
   \class QDS_DoubleValidator
+  \brief A validator for floating point values.
 
-  This class to provide validation of user inputted string for datum with 'Float'
+  This class provides validation of the strings entered by the user for datum with 'Float'
   value type according to datum properties: minimum value, maximum value, precision, filter.
 
-  Inherits from QDoubleValidator.
+  Inherits QDoubleValidator.
 */
 
 /*!
-  Constructor. Create empty validator object.
+  \brief Constructor.
+  
+  Create empty validator object.
+  
+  \param p parent object
 */
 QDS_DoubleValidator::QDS_DoubleValidator( QObject* p )
 : QDoubleValidator( p )
@@ -90,29 +116,42 @@ QDS_DoubleValidator::QDS_DoubleValidator( QObject* p )
 }
 
 /*!
-  Constructor. Create validator object with filter string \af.
+  \brief Constructor.
+  
+  Create validator object with filter string \a f.
+  
+  \param f filter string
+  \param p parent object
 */
 QDS_DoubleValidator::QDS_DoubleValidator( const QString& f, QObject* p )
 : QDoubleValidator( p ),
-myFilter( f )
+  myFilter( f )
 {
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QDS_DoubleValidator::~QDS_DoubleValidator()
 {
 }
 
 /*!
-  Validate the inputed string \ainput. Reimplemented from QDoubleValidator. Perform
-  standard check by QDoubleValidator::validate(). If returned state is not Invalid and
-  filter specified then perform validation with filter by QRegExpValidator.
+  \brief Validate the entered string \a input. 
+
+  Reimplemented from QDoubleValidator. 
+  
+  Perform standard check by QDoubleValidator::validate(). If returned state 
+  is not \c QValidator::Invalid and filter is specified then perform validation
+  with filter by QRegExpValidator.
 
-  Returns Invalid if input is invalid according to this validator's rules,
-  Intermediate if it is likely that a little more editing will make the input acceptable
-  and Acceptable if the input is valid.
+  Returns \c QValidator::Invalid if input is invalid according to this validator's rules,
+  \c QValidator::Intermediate if it is likely that a little more editing will make the
+  input acceptable and \c QValidator::Acceptable if the input is valid.
+
+  \param input string being validated
+  \param pos cursor position
+  \return validation state (\c QValidator::State)
 */
 QValidator::State QDS_DoubleValidator::validate( QString& input, int& pos ) const
 {
@@ -121,59 +160,78 @@ QValidator::State QDS_DoubleValidator::validate( QString& input, int& pos ) cons
   if ( dvState != Invalid && !myFilter.isEmpty() )
     rgState = QRegExpValidator( QRegExp( myFilter ), 0 ).validate( input, pos );
 
-  dvState = QMIN( dvState, rgState );
+  dvState = qMin( dvState, rgState );
 
   return dvState;
 }
 
 /*!
   \class QDS_StringValidator
+  \brief A validator for string values.
 
-  This class to provide validation of user inputted string for datum with 'String'
+  This class provides validation of the strings entered by the user for datum with 'String'
   value type according to datum properties: format, filter.
 
-  Inherits from QDoubleValidator.
+  Inherits from QValidator.
 */
 
 /*!
-  Constructor. Create empty validator object.
+  \brief Constructor.
+
+  Create empty validator object.
+
+  \param p parent object
 */
 QDS_StringValidator::QDS_StringValidator( QObject* p ) 
 : QValidator( p ), 
-myLen( -1 ) 
+  myLen( -1 ) 
 {
 }
 
 /*!
-  Constructor. Create validator object with filter string \af.
+  \brief Constructor. 
+
+  Create validator object with filter string \a f.
+
+  \param f filter string
+  \param p parent object
 */
 QDS_StringValidator::QDS_StringValidator( const QString& f, QObject* p ) 
 : QValidator( p ), 
-myFlags( f ), 
-myLen( -1 ) 
+  myFlags( f ), 
+  myLen( -1 ) 
 {
 }
 
 /*!
-  Constructor. Create validator object with filter string \aft and format flags \afg.
+  \brief Constructor.
+
+  Create validator object with filter string \a ft and format flags \a fg.
+  \param ft filter string
+  \param fg format string
+  \param p parent object
 */
 QDS_StringValidator::QDS_StringValidator( const QString& ft, const QString& fg, QObject* p ) 
 : QValidator( p ), 
-myLen( -1 ), 
-myFilter( ft ), 
-myFlags( fg ) 
+  myLen( -1 ), 
+  myFilter( ft ), 
+  myFlags( fg ) 
 {
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QDS_StringValidator::~QDS_StringValidator() 
 {
 }
 
 /*!
-  Returns valid string length. If length not specified -1 returned.
+  \brief Get maximum valid string length.
+
+  If maximum length is not specified, -1 is returned.
+
+  \return maximum string length
 */
 int QDS_StringValidator::length() const 
 { 
@@ -181,8 +239,12 @@ int QDS_StringValidator::length() const
 }
 
 /*!
-  Sets the valid string length \al. If value less than zero valid string
-  length not specified.
+  \brief Set maximum valid string length.
+
+  If l <= 0 is not specified, maximum valid length is reset
+  (any string length is valid).
+
+  \param l maximum strin length
 */
 void QDS_StringValidator::setLength( const int l )
 {
@@ -190,14 +252,22 @@ void QDS_StringValidator::setLength( const int l )
 }
 
 /*!
-  Validate the inputed string \ainput. Reimplemented from QValidator. Convert specified
-  string to upper/lower case if the format flags contains specificator 'u'/'l'.
-  If valid string lenght is specified then check given string length. If
-  filter specified then perform validation with filter by QRegExpValidator.
-
-  Returns Invalid if input is invalid according to this validator's rules,
-  Intermediate if it is likely that a little more editing will make the input acceptable
-  and Acceptable if the input is valid.
+  \brief Validate the entered string \a input. 
+
+  Reimplemented from QValidator. 
+  
+  Convert specified string to the upper/lower case if the format flags contains
+  specificator 'u'/'l' correspondingly.  If valid string length is specified,
+  then check given string length. If filter is specified, then perform also 
+  validation with filter by QRegExpValidator.
+
+  Returns \c QValidator::Invalid if input is invalid according to this validator's rules,
+  \c QValidator::Intermediate if it is likely that a little more editing will make the
+  input acceptable and \c QValidator::Acceptable if the input is valid.
+
+  \param input string being validated
+  \param pos cursor position
+  \return validation state (\c QValidator::State)
 */
 QValidator::State QDS_StringValidator::validate( QString& input, int& pos ) const
 {
@@ -205,10 +275,10 @@ QValidator::State QDS_StringValidator::validate( QString& input, int& pos ) cons
     return Acceptable;
 
   QString orig = input;
-  if ( myFlags.contains( 'u', false ) )
-    input = input.upper();
-  if ( myFlags.contains( 'l', false ) )
-    input = input.lower();
+  if ( myFlags.contains( 'u', Qt::CaseInsensitive ) )
+    input = input.toUpper();
+  if ( myFlags.contains( 'l', Qt::CaseInsensitive ) )
+    input = input.toLower();
 
   State rgState = Acceptable;
   State svState = orig == input ? Acceptable : Intermediate;
@@ -219,7 +289,7 @@ QValidator::State QDS_StringValidator::validate( QString& input, int& pos ) cons
   if ( !myFilter.isEmpty() )
     rgState = QRegExpValidator( QRegExp( myFilter ), 0 ).validate( input, pos );
 
-  svState = QMIN( svState, rgState );
+  svState = qMin( svState, rgState );
 
   return svState;
 }
index e7fed65aa7dced6d637ecf2fea1600082bc2be17..a8c70a7db4a6a24cd05aaccf82312712de97b1d6 100644 (file)
@@ -1,31 +1,31 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QDS_VALIDATOR_H
 #define QDS_VALIDATOR_H
 
 #include "QDS.h"
 
-#include <qvalidator.h>
+#include <QValidator>
 
-/*!
-  class QDS_IntegerValidator
-*/
 class QDS_EXPORT QDS_IntegerValidator : public QIntValidator
 {
 public:
@@ -36,12 +36,9 @@ public:
   virtual State validate( QString&, int& ) const;
 
 private:
-  QString myFilter;
+  QString myFilter;    //!< string filter
 };
 
-/*!
-  class QDS_DoubleValidator
-*/
 class QDS_DoubleValidator : public QDoubleValidator
 {
 public:
@@ -52,12 +49,9 @@ public:
   virtual State validate( QString&, int& ) const;
 
 private:
-  QString myFilter;
+  QString myFilter;    //!< string filter
 };
 
-/*!
-  class QDS_StringValidator
-*/
 class QDS_EXPORT QDS_StringValidator : public QValidator
 {
 public:
@@ -72,9 +66,9 @@ public:
   void          setLength( const int );
 
 private:
-  int           myLen;
-  QString       myFlags;
-  QString       myFilter;
+  int           myLen;        //!< string length
+  QString       myFlags;      //!< string format flags
+  QString       myFilter;     //!< string filter
 };
 
 #endif
index 4fab946b88d88e790bb3ec6e890d9757d212af1f..01adf5147504ce102ee4cda2e6671544e731bbec 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
diff --git a/src/QDS/resources/QDS_msg_en.ts b/src/QDS/resources/QDS_msg_en.ts
new file mode 100644 (file)
index 0000000..10470e9
--- /dev/null
@@ -0,0 +1,72 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>QDS_Datum</name>
+    <message>
+        <source>DATA_ERR_TITLE</source>
+        <translation>Incorrect parameter value</translation>
+    </message>
+    <message>
+        <source>DATA_STRING</source>
+        <translation> non-empty string</translation>
+    </message>
+    <message>
+        <source>DATA_NON_EMPTY</source>
+        <translation> non-empty</translation>
+    </message>
+    <message>
+        <source>DATA_MIN_LIMIT</source>
+        <translation> is greater than %1</translation>
+    </message>
+    <message>
+        <source>DATA_FLOAT</source>
+        <translation> real</translation>
+    </message>
+    <message>
+        <source>DATA_RANGE</source>
+        <translation> in range [%1, %2]</translation>
+    </message>
+    <message>
+        <source>DATA_SHOULD_BE_VALUE</source>
+        <translation>Should be%1 value</translation>
+    </message>
+    <message>
+        <source>DATA_INTEGER</source>
+        <translation> integer</translation>
+    </message>
+    <message>
+        <source>DATA_INCORRECT_VALUE</source>
+        <translation>Value of parameter &quot;%1&quot; is incorrect.</translation>
+    </message>
+    <message>
+        <source>DATA_MAX_LIMIT</source>
+        <translation> is less than %1</translation>
+    </message>
+    <message>
+        <source>DATA_INPUT_VALUE</source>
+        <translation>Please, input correct value.</translation>
+    </message>
+</context>
+</TS>
index b71936b9a35e9ca61217a6ea350d468867e03877..9da7c3a3dac05a2a268d746fa390480aa99eb378 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : suit
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 # header files
 
-salomeinclude_HEADERS= Qtx.h \
-       QtxAction.h \
-       QtxColorScale.h \
-       QtxComboBox.h \
-       QtxDblSpinBox.h \
-       QtxDialog.h \
-       QtxDockAction.h \
-       QtxDockWindow.h \
-       QtxGroupBox.h \
-       QtxIntSpinBox.h \
-       QtxListAction.h \
-       QtxListBox.h \
-       QtxListOfOperations.h \
-       QtxLogoMgr.h \
-       QtxMenuButton.h \
-       QtxMRUAction.h \
-       QtxOperations.h \
-       QtxPathDialog.h \
-       QtxPopupMgr.h \
-       QtxResourceMgr.h \
-       QtxStdOperations.h \
-       QtxTable.h \
-       QtxToolBar.h \
-       QtxToolTip.h \
-       QtxParser.h \
-       QtxPopupMenu.h \
-       QtxActionMgr.h \
-       QtxActionMenuMgr.h \
-       QtxActionToolMgr.h \
-       QtxMainWindow.h \
-       QtxWorkspaceAction.h \
-       QtxWorkstackAction.h \
-       QtxListResourceEdit.h \
-       QtxWorkstack.h \
-       QtxResourceEdit.h \
-       QtxListView.h \
-       QtxDirListEditor.h \
-       QtxDblValidator.h \
-       QtxSplash.h
+#VSR: already migrated to Qt4 files
+salomeinclude_HEADERS =                \
+       Qtx.h                   \
+       QtxAction.h             \
+       QtxActionGroup.h        \
+       QtxActionMenuMgr.h      \
+       QtxActionMgr.h          \
+       QtxActionSet.h          \
+       QtxActionToolMgr.h      \
+       QtxColorButton.h        \
+       QtxColorScale.h         \
+       QtxComboBox.h           \
+       QtxDialog.h             \
+       QtxDockAction.h         \
+       QtxDockWidget.h         \
+       QtxDoubleSpinBox.h      \
+       QtxEvalExpr.h           \
+       QtxFontEdit.h           \
+       QtxGridBox.h            \
+       QtxGroupBox.h           \
+       QtxIntSpinBox.h         \
+       QtxListAction.h         \
+       QtxTreeView.h           \
+       QtxLogoMgr.h            \
+       QtxMainWindow.h         \
+       QtxMap.h                \
+       QtxMenu.h               \
+       QtxMultiAction.h        \
+       QtxMRUAction.h          \
+       QtxPagePrefMgr.h        \
+       QtxPathDialog.h         \
+       QtxPathEdit.h           \
+       QtxPathListEdit.h       \
+       QtxPopupMgr.h           \
+       QtxPreferenceMgr.h      \
+       QtxResourceMgr.h        \
+       QtxRubberBand.h         \
+       QtxSearchTool.h         \
+       QtxSplash.h             \
+       QtxToolBar.h            \
+       QtxToolTip.h            \
+       QtxTranslator.h         \
+       QtxValidator.h          \
+       QtxWorkspace.h          \
+       QtxWorkspaceAction.h    \
+       QtxWorkstack.h          \
+       QtxWorkstackAction.h
+
+#VSR: not yet migrated to Qt4 files
+#                              \
+       QtxListBox.h            \
+       QtxTable.h
 
 # Libraries targets
 
-lib_LTLIBRARIES= libqtx.la
+lib_LTLIBRARIES = libqtx.la
+
+#VSR: already migrated to Qt4 files
+dist_libqtx_la_SOURCES =       \
+       Qtx.cxx                 \
+       QtxAction.cxx           \
+       QtxActionGroup.cxx      \
+       QtxActionMenuMgr.cxx    \
+       QtxActionMgr.cxx        \
+       QtxActionSet.cxx        \
+       QtxActionToolMgr.cxx    \
+       QtxColorButton.cxx      \
+       QtxColorScale.cxx       \
+       QtxComboBox.cxx         \
+       QtxDialog.cxx           \
+       QtxDockAction.cxx       \
+       QtxDockWidget.cxx       \
+       QtxDoubleSpinBox.cxx    \
+       QtxEvalExpr.cxx         \
+       QtxFontEdit.cxx         \
+       QtxGridBox.cxx          \
+       QtxGroupBox.cxx         \
+       QtxIntSpinBox.cxx       \
+       QtxListAction.cxx       \
+       QtxTreeView.cxx         \
+       QtxLogoMgr.cxx          \
+       QtxMainWindow.cxx       \
+       QtxMenu.cxx             \
+       QtxMultiAction.cxx      \
+       QtxMRUAction.cxx        \
+       QtxPagePrefMgr.cxx      \
+       QtxPathDialog.cxx       \
+       QtxPathEdit.cxx         \
+       QtxPathListEdit.cxx     \
+       QtxPopupMgr.cxx         \
+       QtxPreferenceMgr.cxx    \
+       QtxResourceMgr.cxx      \
+       QtxRubberBand.cxx       \
+       QtxSearchTool.cxx       \
+       QtxSplash.cxx           \
+       QtxToolBar.cxx          \
+       QtxToolTip.cxx          \
+       QtxTranslator.cxx       \
+       QtxValidator.cxx        \
+       QtxWorkspace.cxx        \
+       QtxWorkspaceAction.cxx  \
+       QtxWorkstack.cxx        \
+       QtxWorkstackAction.cxx
+
+#VSR: not yet migrated to Qt4 files
+#                              \
+       QtxListBox.cxx          \
+       QtxTable.cxx
 
-dist_libqtx_la_SOURCES= \
-       Qtx.cxx \
-       QtxAction.cxx \
-       QtxColorScale.cxx \
-       QtxComboBox.cxx \
-       QtxDblSpinBox.cxx \
-       QtxDialog.cxx \
-       QtxDockAction.cxx \
-       QtxDockWindow.cxx \
-       QtxGroupBox.cxx \
-       QtxIntSpinBox.cxx \
-       QtxListAction.cxx \
-       QtxListBox.cxx \
-       QtxListOfOperations.cxx \
-       QtxLogoMgr.cxx \
-       QtxMenuButton.cxx \
-       QtxMRUAction.cxx \
-       QtxPathDialog.cxx \
-       QtxPopupMgr.cxx \
-       QtxResourceMgr.cxx \
-       QtxStdOperations.cxx \
-       QtxTable.cxx \
-       QtxToolBar.cxx \
-       QtxToolTip.cxx \
-       QtxOperations.cxx \
-       QtxParser.cxx \
-       QtxPopupMenu.cxx \
-       QtxActionMgr.cxx \
-       QtxActionMenuMgr.cxx \
-       QtxActionToolMgr.cxx \
-       QtxMainWindow.cxx \
-       QtxWorkspaceAction.cxx \
-       QtxWorkstackAction.cxx \
-       QtxListResourceEdit.cxx \
-       QtxResourceEdit.cxx \
-       QtxWorkstack.cxx \
-       QtxListView.cxx \
-       QtxDirListEditor.cxx \
-       QtxDblValidator.cxx \
-       QtxSplash.cxx
+#VSR: already migrated to Qt4 files
+MOC_FILES =                            \
+       QtxAction_moc.cxx               \
+       QtxActionGroup_moc.cxx          \
+       QtxActionMenuMgr_moc.cxx        \
+       QtxActionMgr_moc.cxx            \
+       QtxActionSet_moc.cxx            \
+       QtxActionToolMgr_moc.cxx        \
+       QtxColorButton_moc.cxx          \
+       QtxColorScale_moc.cxx           \
+       QtxComboBox_moc.cxx             \
+       QtxDialog_moc.cxx               \
+       QtxDockAction_moc.cxx           \
+       QtxDockWidget_moc.cxx           \
+       QtxDoubleSpinBox_moc.cxx        \
+       QtxFontEdit_moc.cxx             \
+       QtxGridBox_moc.cxx              \
+       QtxGroupBox_moc.cxx             \
+       QtxIntSpinBox_moc.cxx           \
+       QtxListAction_moc.cxx           \
+       QtxTreeView_moc.cxx             \
+       QtxLogoMgr_moc.cxx              \
+       QtxMainWindow_moc.cxx           \
+       QtxMenu_moc.cxx                 \
+       QtxMultiAction_moc.cxx          \
+       QtxMRUAction_moc.cxx            \
+       QtxPagePrefMgr_moc.cxx          \
+       QtxPathDialog_moc.cxx           \
+       QtxPathEdit_moc.cxx             \
+       QtxPathListEdit_moc.cxx         \
+       QtxPopupMgr_moc.cxx             \
+       QtxRubberBand_moc.cxx           \
+       QtxSearchTool_moc.cxx           \
+       QtxSplash_moc.cxx               \
+       QtxToolBar_moc.cxx              \
+       QtxToolTip_moc.cxx              \
+       QtxValidator_moc.cxx            \
+       QtxWorkspace_moc.cxx            \
+       QtxWorkspaceAction_moc.cxx      \
+       QtxWorkstack_moc.cxx            \
+       QtxWorkstackAction_moc.cxx
 
-MOC_FILES= \
-       QtxAction_moc.cxx \
-       QtxColorScale_moc.cxx \
-       QtxComboBox_moc.cxx \
-       QtxDblSpinBox_moc.cxx \
-       QtxDialog_moc.cxx \
-       QtxDockAction_moc.cxx \
-       QtxDockWindow_moc.cxx \
-       QtxGroupBox_moc.cxx \
-       QtxIntSpinBox_moc.cxx \
-       QtxListAction_moc.cxx \
-       QtxListBox_moc.cxx \
-       QtxLogoMgr_moc.cxx \
-       QtxMenuButton_moc.cxx \
-       QtxMRUAction_moc.cxx \
-       QtxPathDialog_moc.cxx \
-       QtxPopupMgr_moc.cxx \
-       QtxPopupMenu_moc.cxx \
-       QtxTable_moc.cxx \
-       QtxToolBar_moc.cxx \
-       QtxToolTip_moc.cxx \
-       QtxActionMgr_moc.cxx \
-       QtxActionMenuMgr_moc.cxx \
-       QtxActionToolMgr_moc.cxx \
-       QtxMainWindow_moc.cxx \
-       QtxWorkspaceAction_moc.cxx \
-       QtxWorkstackAction_moc.cxx \
-       QtxWorkstack_moc.cxx \
-       QtxListView_moc.cxx \
-       QtxListResourceEdit_moc.cxx \
-       QtxDirListEditor_moc.cxx \
-       QtxDblValidator_moc.cxx \
-       QtxSplash_moc.cxx
-nodist_libqtx_la_SOURCES= $(MOC_FILES)
+#VSR: not yet migrated to Qt4 files
+#                                      \
+       QtxListBox_moc.cxx              \
+       QtxTable_moc.cxx
 
-libqtx_la_CPPFLAGS=$(QT_INCLUDES)
+nodist_libqtx_la_SOURCES = $(MOC_FILES)
 
-libqtx_la_LDFLAGS=$(QT_MT_LIBS)
+libqtx_la_CPPFLAGS = $(QT_INCLUDES)
+libqtx_la_LDFLAGS  = $(QT_MT_LIBS)
index 6e2a31648aecf3e0ef337076bc916b49181ebb29..c60344a4f3eb0477fe755372adb83727a1a88384 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      Qtx.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "Qtx.h"
 
-#include <qdir.h>
-#include <qbitmap.h>
-#include <qstring.h>
-#include <qwidget.h>
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qtoolbar.h>
-#include <qgroupbox.h>
-#include <qfileinfo.h>
-#include <qpopupmenu.h>
-#include <qobjectlist.h>
-#include <qwidgetlist.h>
-#include <qapplication.h>
+#include <QDir>
+#include <QMenu>
+#include <QRegExp>
+#include <QBitmap>
+#include <QWidget>
+#include <QLayout>
+#include <QPainter>
+#include <QDirModel>
+#include <QFileInfo>
+#include <QCompleter>
+#include <QApplication>
+#include <QDesktopWidget>
+#include <QLinearGradient>
+#include <QRadialGradient>
+#include <QConicalGradient>
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
 
 /*!
-       Name: setTabOrder [static public]
-       Desc: Set tab order for specified list of widgets. Last parameter should be null pointer.
+  \class Qtx
+  \brief A set of helpful utility functions.
+
+  The class implements a set of the static functions which can be used
+  for the different purposes:
+  - specify tab order for the set of widgets: setTabOrder()
+  - align one widget to the coordinates of the another one: alignWidget()
+  - remove extra separators from the menu or toolbar: simplifySeparators()
+  - retrieve directory, file name and extension parts of the path:
+  dir(), file(), extension()
+  - get the path to the temporary directory: tmpDir()
+  - create or remove a directory (recursively): mkDir(), rmDir()
+  - convert text file from DOS to UNIX native format: dos2unix()
+  - convert a picture to the gray scale: grayscale()
+  - other
 */
 
+/*!
+  \brief Convert character array (ASCII string) to the QString.
+  \param str character array
+  \param len array length, if < 0, the array should be zero-terminated
+  \return QString object
+ */
+QString Qtx::toQString( const char* str, const int len )
+{
+  return toQString( (unsigned char*)str, len );
+}
+
+/*!
+  \brief Convert integer array (UNICODE string) to the QString.
+  \param str integer array
+  \param len array length, if < 0, the array should be zero-terminated
+  \return QString object
+ */
+QString Qtx::toQString( const short* str, const int len )
+{
+  return toQString( (unsigned short*)str, len );
+}
+
+/*!
+  \brief Convert character array (ASCII string) to the QString.
+  \param str character array
+  \param len array length, if < 0, the array should be zero-terminated
+  \return QString object
+ */
+QString Qtx::toQString( const unsigned char* str, const int len )
+{
+  QString res;
+  const unsigned char* s = str;
+  while ( len < 0 || res.length() < len )
+  {
+    if ( *s == '\0' )
+      break;
+
+    res.append( QChar( *s ) );
+    s++;
+  }
+  return res;
+}
+
+/*!
+  \brief Convert integer array (UNICODE string) to the QString.
+  \param str integer array
+  \param len array length, if < 0, the array should be zero-terminated
+  \return QString object
+ */
+QString Qtx::toQString( const unsigned short* str, const int len )
+{
+  QString res;
+  const unsigned short* s = str;
+  while ( len < 0 || res.length() < len )
+  {
+    if ( *s == '\0' )
+      break;
+
+    res.append( QChar( *s ) );
+    s++;
+  }
+  return res;
+}
+
+/*!
+  \brief Set tab order for specified list of widgets.
+
+  The function has arbitrary number of parameters, each should be
+  hovewer of QWidget* type. Last parameter should be null pointer.
+
+  \param first first widget in the sequence
+*/
 void Qtx::setTabOrder( QWidget* first, ... )
 {
   va_list wids;
-       va_start( wids, first );
+  va_start( wids, first );
 
-       QWidgetList widList;
+  QWidgetList widList;
 
-       QWidget* cur = first;
-       while ( cur )
-       {
-         widList.append( cur );
-               cur = va_arg( wids, QWidget* );
+  QWidget* cur = first;
+  while ( cur )
+  {
+    widList.append( cur );
+    cur = va_arg( wids, QWidget* );
   }
 
-       setTabOrder( widList );
+  setTabOrder( widList );
 }
 
 /*!
-       Name: setTabOrder [static public]
-       Desc: Set tab order for specified list of widgets.
+  \brief Set tab order for specified list of widgets.
+  \param widgets list of widgets
 */
-
 void Qtx::setTabOrder( const QWidgetList& widgets )
 {
   if ( widgets.count() < 2 )
     return;
 
   QWidget* prev = 0;
-  for ( QWidgetListIt it( widgets ); it.current(); ++it )
+  for ( QWidgetList::const_iterator it = widgets.begin(); it!= widgets.end(); ++it )
   {
-    QWidget* next = it.current();
+    QWidget* next = *it;
     if ( prev && next )
       QWidget::setTabOrder( prev, next );
     prev = next;
@@ -82,157 +171,125 @@ void Qtx::setTabOrder( const QWidgetList& widgets )
 }
 
 /*!
-       Name: alignWidget [static public]
-       Desc: Align widget 'src' relative to widget 'ref' acording to alignment flags.
-             Alignment flags:
-                         Qtx::AlignLeft      - Align left side of 'src' to left side of 'ref'.
-                         Qtx::AlignRight     - Align right side of 'src' to right side of 'ref'.
-                         Qtx::AlignTop       - Align top side of 'src' to top side of 'ref'.
-                         Qtx::AlignBottom    - Align bottom side of 'src' to bottom side of 'ref'.
-                         Qtx::AlignHCenter   - Align 'src' to center of 'ref' in horizontal dimension.
-                         Qtx::AlignVCenter   - Align 'src' to center of 'ref' in vertical dimension.
-                         Qtx::AlignCenter    - Align 'src' to center of 'ref' in both dimensions.
-                         Qtx::AlignOutLeft   - Align right side of 'src' to left side of 'ref'.
-                         Qtx::AlignOutRight  - Align left side of 'src' to right side of 'ref'.
-                         Qtx::AlignOutTop    - Align bottom side of 'src' to top side of 'ref'.
-                         Qtx::AlignOutBottom - Align top side of 'src' to bottom side of 'ref'.
+  \brief Align widget \a src relative to widget \a ref acording to the 
+         alignment flags \a alignFlags.
+  \param src source widget (being aligned)
+  \param ref reference widget (source widget being aligned to)
+  \param alignFlags alignment flags (Qtx::AlignmentFlags)
 */
-
 void Qtx::alignWidget( QWidget* src, const QWidget* ref, const int alignFlags )
 {
-       if ( !src || !ref || !alignFlags )
-               return;
+  if ( !src || !ref || !alignFlags )
+    return;
 
-       QPoint srcOri = src->pos();
-       QPoint refOri = ref->pos();
-       if ( src->parentWidget() && !src->isTopLevel() )
-               srcOri = src->parentWidget()->mapToGlobal( srcOri );
-       if ( ref->parentWidget() && !ref->isTopLevel() )
-               refOri = ref->parentWidget()->mapToGlobal( refOri );
+  QPoint srcOri = src->pos();
+  QPoint refOri = ref->pos();
+  if ( src->parentWidget() && !src->isTopLevel() )
+    srcOri = src->parentWidget()->mapToGlobal( srcOri );
+  if ( ref->parentWidget() && !ref->isTopLevel() )
+    refOri = ref->parentWidget()->mapToGlobal( refOri );
 
-       int x = srcOri.x(), y = srcOri.y();
-       int refWidth = ref->frameGeometry().width(), refHei = ref->frameGeometry().height();
-       int srcWidth = src->frameGeometry().width(), srcHei = src->frameGeometry().height();
+  int x = srcOri.x(), y = srcOri.y();
+  int refWidth = ref->frameGeometry().width(), refHei = ref->frameGeometry().height();
+  int srcWidth = src->frameGeometry().width(), srcHei = src->frameGeometry().height();
 
-       if ( srcWidth <= 0 )
-               srcWidth = src->sizeHint().width();
+  if ( srcWidth <= 0 )
+    srcWidth = src->sizeHint().width();
   if ( srcHei <= 0 )
     srcHei = src->sizeHint().height();
 
-       int border = 0;
+  int border = 0;
   if ( ref->isTopLevel() && ref->isMaximized() &&
        src->isTopLevel() && !src->isMaximized() )
     border = ( src->frameGeometry().width() - src->width() ) / 2;
 
-       if ( alignFlags & Qtx::AlignLeft )
-               x = refOri.x() + border;
-       if ( alignFlags & Qtx::AlignOutLeft )
-               x = refOri.x() - srcWidth - border;
-       if ( alignFlags & Qtx::AlignRight )
-               x = refOri.x() + refWidth - srcWidth - border;
-       if ( alignFlags & Qtx::AlignOutRight )
-               x = refOri.x() + refWidth + border;
-       if ( alignFlags & Qtx::AlignTop )
-               y = refOri.y() + border;
-       if ( alignFlags & Qtx::AlignOutTop )
-               y = refOri.y() - srcHei - border;
-       if ( alignFlags & Qtx::AlignBottom )
-               y = refOri.y() + refHei - srcHei - border;
-       if ( alignFlags & Qtx::AlignOutBottom )
-               y = refOri.y() + refHei + border;
-       if ( alignFlags & Qtx::AlignHCenter )
-               x = refOri.x() + ( refWidth - srcWidth ) / 2;
-       if ( alignFlags & Qtx::AlignVCenter )
-               y = refOri.y() + ( refHei - srcHei ) / 2;
-
-       if ( src->parentWidget() && !src->isTopLevel() )
-       {
-               QPoint pos = src->parentWidget()->mapFromGlobal( QPoint( x, y ) );
-               x = pos.x();
-               y = pos.y();
-       }
-
-       QWidget* desk = QApplication::desktop();
-       if ( desk && x + srcWidth + border > desk->width() )
-               x = desk->width() - srcWidth - border;
-       if ( desk && y + srcHei + border > desk->height() )
-               y = desk->height() - srcHei - border;
-
-       x = QMAX( x, 0 );
-       y = QMAX( y, 0 );
-
-       src->move( x, y );
-}
-
-/*!
-       Name: simplifySeparators [static public]
-       Desc: Checks toolbar for unnecessary separators and removes them
-*/
-void Qtx::simplifySeparators( QToolBar* toolbar )
-{
-  if ( !toolbar )
-    return;
-
-  const QObjectList* objList = toolbar->children();
-  if ( !objList )
-    return;
-
-  QObjectList delList;
-
-  bool isPrevSep = true;
-  for ( QObjectListIt it( *objList ); it.current(); ++it )
+  if ( alignFlags & Qtx::AlignLeft )
+    x = refOri.x() + border;
+  if ( alignFlags & Qtx::AlignOutLeft )
+    x = refOri.x() - srcWidth - border;
+  if ( alignFlags & Qtx::AlignRight )
+    x = refOri.x() + refWidth - srcWidth - border;
+  if ( alignFlags & Qtx::AlignOutRight )
+    x = refOri.x() + refWidth + border;
+  if ( alignFlags & Qtx::AlignTop )
+    y = refOri.y() + border;
+  if ( alignFlags & Qtx::AlignOutTop )
+    y = refOri.y() - srcHei - border;
+  if ( alignFlags & Qtx::AlignBottom )
+    y = refOri.y() + refHei - srcHei - border;
+  if ( alignFlags & Qtx::AlignOutBottom )
+    y = refOri.y() + refHei + border;
+  if ( alignFlags & Qtx::AlignHCenter )
+    x = refOri.x() + ( refWidth - srcWidth ) / 2;
+  if ( alignFlags & Qtx::AlignVCenter )
+    y = refOri.y() + ( refHei - srcHei ) / 2;
+
+  if ( src->parentWidget() && !src->isTopLevel() )
   {
-    bool isSep = it.current()->isA( "QToolBarSeparator" );
-    if ( isPrevSep && isSep )
-      delList.append( it.current() );
-    isPrevSep = isSep;
+    QPoint pos = src->parentWidget()->mapFromGlobal( QPoint( x, y ) );
+    x = pos.x();
+    y = pos.y();
   }
 
-  for ( QObjectListIt itr( delList ); itr.current(); ++itr )
-    delete itr.current();
+  QWidget* desk = QApplication::desktop();
+  if ( desk && x + srcWidth + border > desk->width() )
+    x = desk->width() - srcWidth - border;
+  if ( desk && y + srcHei + border > desk->height() )
+    y = desk->height() - srcHei - border;
 
-  if ( toolbar->children() && !toolbar->children()->isEmpty() &&
-       toolbar->children()->getFirst()->isA( "QToolBarSeparator" ) )
-    delete toolbar->children()->getFirst();
+  x = qMax( x, 0 );
+  y = qMax( y, 0 );
 
-  if ( toolbar->children() && !toolbar->children()->isEmpty() &&
-       toolbar->children()->getLast()->isA( "QToolBarSeparator" ) )
-    delete toolbar->children()->getLast();
+  src->move( x, y );
 }
 
 /*!
-       Name: simplifySeparators [static public]
-       Desc: Checks popup menu recursively for unnecessary separators and removes them
+  \brief Remove (recursively) unnecessary separators from the menu or toolbar.
+  \param wid widget, should be of QMenu* or QToolBar* class
 */
-void Qtx::simplifySeparators( QPopupMenu* popup, const bool recursive )
+void Qtx::simplifySeparators( QWidget* wid, const bool recursive )
 {
-  if ( !popup || !popup->count() )
+  if ( !wid )
+    return;
+
+  QList<QAction*> items = wid->actions();
+  if ( items.isEmpty() )
     return;
 
-  QIntList idRemove;
-  for ( uint i = 1; i < popup->count(); i++ )
+  QList<QAction*> toRemove;
+  for ( int i = 1; i < items.count(); i++ )
   {
-    if ( popup->findItem( popup->idAt( i ) )->isSeparator() &&
-         popup->findItem( popup->idAt( i - 1 ) )->isSeparator() )
-      idRemove.append( popup->idAt( i ) );
+    if ( items[i]->isSeparator() && items[i - 1]->isSeparator() )
+      toRemove.append( items[i] );
 
-    if ( recursive )
-      simplifySeparators( popup->findItem( popup->idAt( i ) )->popup() );
+    if ( recursive && items[i]->menu() )
+      simplifySeparators( items[i]->menu(), recursive );
   }
 
-  for ( QIntList::const_iterator it = idRemove.begin(); it != idRemove.end(); ++it )
-    popup->removeItem( *it );
+  for ( QList<QAction*>::iterator it = toRemove.begin(); it != toRemove.end(); ++it )
+    wid->removeAction( *it );
 
-  if ( popup->count() > 0 && popup->findItem( popup->idAt( 0 ) )->isSeparator() )
-    popup->removeItem( popup->idAt( 0 ) );
+  items = wid->actions();
+  if ( !items.isEmpty() && items[0]->isSeparator() )
+    wid->removeAction( items[0] );
 
-  if ( popup->count() > 0 && popup->findItem( popup->idAt( popup->count() - 1 ) )->isSeparator() )
-    popup->removeItem( popup->idAt( popup->count() - 1 ) );
+  items = wid->actions();
+  if ( !items.isEmpty() && items[items.count() - 1]->isSeparator() )
+    wid->removeAction( items[items.count() - 1] );
 }
 
 /*!
-       Name: isParent [static public]
-       Desc: Returns 'true' if specified 'parent' is parent object of given 'child'.
+  \brief Return \c true if specified \a parent is a parent object
+         of given \a child (in terms of QObject).
+
+  This function works recursively. It means that \a true is also
+  returned if \a parent is a grand-father, grand-grand-father, etc
+  of \a child. If the same object is given as both \a parent and
+  \a child, \c true is also returned.
+
+  \param child child object
+  \param parent parent object
+  \return \c true if the \a parent is a parent of \a child
 */
 bool Qtx::isParent( QObject* child, QObject* parent )
 {
@@ -250,42 +307,95 @@ bool Qtx::isParent( QObject* child, QObject* parent )
 }
 
 /*!
-       Name: dir [static public]
-       Desc: Returns dir name or null string.
+  \brief Find the parent object of class specified by \a className (in terms of QObject).
+
+  \param obj current object
+  \param className class name of the parent
+  \return parent object or null pointer if the parent not found
+*/
+QObject* Qtx::findParent( QObject* obj, const char* className )
+{
+  if ( !obj )
+    return 0;
+
+  if ( !className || !strlen( className ) )
+    return obj->parent();
+
+  QObject* res = 0;
+  QObject* p = obj->parent();
+  while ( p && !res )
+  {
+    if ( p->inherits( className ) )
+      res = p;
+    p = p->parent();
+  }
+
+  return res;
+}
+
+/*!
+  \brief Return directory part of the file path.
+
+  If the file path does not include directory part (the file is in the
+  current directory), null string is returned.
+
+  \param path file path
+  \param abs if true (default) \a path parameter is treated as absolute file path
+  \return directory part of the file path
 */
 QString Qtx::dir( const QString& path, const bool abs )
 {
-  QString dirPath = QFileInfo( path ).dirPath( abs );
+  QDir aDir = QFileInfo( path ).dir();
+  QString dirPath = abs ? aDir.absolutePath() : aDir.path();
   if ( dirPath == QString( "." ) )
-    dirPath = QString::null;
+    dirPath = QString();
   return dirPath;
 }
 
 /*!
-       Name: file [static public]
-       Desc: Returns file with or without extension.
+  \brief Return file name part of the file path.
+
+  \param path file path
+  \param withExt if true (default) complete file name (with all
+         extension except the last) is returned, otherwise only base name
+         is returned
+  \return file name part of the file path
 */
 QString Qtx::file( const QString& path, bool withExt )
 {
+  QString fPath = path;
+  while ( !fPath.isEmpty() && ( fPath[fPath.length() - 1] == '\\' || fPath[fPath.length() - 1] == '/' ) )
+    fPath.remove( fPath.length() - 1, 1 );
+
   if ( withExt )
-    return QFileInfo( path ).fileName();
+    return QFileInfo( fPath ).fileName();
   else
-    return QFileInfo( path ).baseName();
+    return QFileInfo( fPath ).baseName();
 }
 
 /*!
-       Name: extension [static public]
-       Desc: Returns the file extension only or null string.
+  \brief Return extension part of the file path.
+
+  \param path file path
+  \param full if true complete extension (all extensions, dot separated)
+         is returned, otherwise (default) only last extension is returned
+  \return extension part of the file path
 */
-QString Qtx::extension( const QString& path )
+QString Qtx::extension( const QString& path, const bool full )
 {
-  return QFileInfo( path ).extension(false); // after the last dot
+  return full ? QFileInfo( path ).completeSuffix() : QFileInfo( path ).suffix();
 }
 
 /*!
-       Name: library [static public]
-       Desc: Generate library file name.
-        Append required prefix (lib) and suffix (.dll/.so) to the library file name.
+  \brief Convert the given parameter to the platform-specific library name.
+
+  The function appends platform-specific prefix (lib) and suffix (.dll/.so)
+  to the library file name.
+  For example, if \a str = "mylib", "libmylib.so" is returned for Linux and
+  mylib.dll for Windows.
+
+  \param str short library name
+  \return full library name
 */
 QString Qtx::library( const QString& str )
 {
@@ -304,7 +414,7 @@ QString Qtx::library( const QString& str )
   QString libExt( "so" );
 #endif
 
-  if ( ext.lower() != QString( "so" ) && ext.lower() != QString( "dll" ) )
+  if ( ext.toLower() != QString( "so" ) && ext.toLower() != QString( "dll" ) )
   {
     if ( !name.isEmpty() && !ext.isEmpty() )
       name += QString( "." );
@@ -319,113 +429,99 @@ QString Qtx::library( const QString& str )
 }
 
 /*!
-       Name: tmpDir [static public]
-       Desc: Returns path to temporary directory.
+  \brief Get the temporary directory name.
+  \return temporary directory (platform specific)
 */
 QString Qtx::tmpDir()
 {
-       char* tmpdir = ::getenv( "TEMP" );
-       if ( !tmpdir )
-               tmpdir = ::getenv ( "TMP" );
-       if ( !tmpdir )
-       {
+  char* tmpdir = ::getenv( "TEMP" );
+  if ( !tmpdir )
+    tmpdir = ::getenv ( "TMP" );
+  if ( !tmpdir )
+  {
 #ifdef WIN32
-               tmpdir = "C:\\";
+    tmpdir = "C:\\";
 #else
-               tmpdir = "/tmp";
+    tmpdir = "/tmp";
 #endif
-       }
-       return QString( tmpdir );
+  }
+  return QString( tmpdir );
 }
 
 /*!
-       Name: mkDir [static public]
-       Desc: Creates directory with intermediate perent directories.
-                   Returns true in successfull case.
+  \brief Create directory recursively including all intermediate sub directories.
+  \return \c true if the directory is successfully created and \c false otherwise
 */
 bool Qtx::mkDir( const QString& dirPath )
 {
-       QString path = QDir::convertSeparators( dirPath );
-
-#ifdef WIN32
-       while ( !path.isEmpty() && path.at( path.length() - 1 ) == QDir::separator() )
-               path.remove( path.length() - 1, 1 );
-
-       if ( path.at( path.length() - 1 ) == ':' )
-               return QFileInfo( path ).exists();
-#endif
-
-       QFileInfo fInfo( path );
-       if ( fInfo.exists() )
-               return fInfo.isDir();
-
-       if ( !mkDir( fInfo.dirPath() ) )
-               return false;
-
-       return QDir( fInfo.dirPath() ).mkdir( fInfo.fileName() );
+  return QDir().mkpath( dirPath );
 }
 
 /*!
-       Name: rmDir [static public]
-       Desc: Removes directory with its subdirectories and files.
-                   Returns true in successfull case.
+  \brief Remove directory recursively including all subdirectories and files.
+  \return \c true if the directory is successfully removed and \c false otherwise
 */
 bool Qtx::rmDir( const QString& thePath )
 {
-       QFileInfo fi( thePath );
-       if ( !fi.exists() )
-               return true;
-
-       bool stat = true;
-       if ( fi.isFile() )
-               stat = QFile::remove( thePath );
-       else if ( fi.isDir() )
-       {
-               QDir aDir( thePath );
-               const QFileInfoList* anEntries = aDir.entryInfoList();
-               if ( anEntries )
-               {
-                       for ( QPtrListIterator<QFileInfo> it( *anEntries ); it.current(); ++it )
-                       {
-                               if ( it.current()->fileName() == "." || it.current()->fileName() == ".." )
-                                       continue;
-                               stat = stat && rmDir( it.current()->absFilePath() );
-                       }
-               }
-               stat = stat && aDir.rmdir( thePath );
-       }
-       return stat;
-}
-
-/*!
-       Name: addSlash [static public]
-       Desc: Adds a slash to the end of 'path' if it is not already there.
+  QFileInfo fi( thePath );
+  if ( !fi.exists() )
+    return true;
+
+  bool stat = true;
+  if ( fi.isFile() )
+    stat = QFile::remove( thePath );
+  else if ( fi.isDir() )
+  {
+    QDir aDir( thePath );
+    QFileInfoList anEntries = aDir.entryInfoList();
+    for ( QFileInfoList::iterator it = anEntries.begin(); it != anEntries.end(); ++it )
+    {
+      QFileInfo inf = *it;
+      if ( inf.fileName() == "." || inf.fileName() == ".." )
+       continue;
+      stat = stat && rmDir( inf.absoluteFilePath() );
+    }
+    stat = stat && aDir.rmdir( thePath );
+  }
+  return stat;
+}
+
+/*!
+  \brief Add a slash (platform-specific) to the end of \a path
+         if it is not already there.
+  \param path directory path
+  \return modified path (with slash added to the end)
 */
 QString Qtx::addSlash( const QString& path )
 {
-       QString res = path;
+  QString res = path;
   if ( !res.isEmpty() && res.at( res.length() - 1 ) != QChar( '/' ) &&
-         res.at( res.length() - 1 ) != QChar( '\\' ) )
+       res.at( res.length() - 1 ) != QChar( '\\' ) )
   res += QDir::separator();
   return res;
 }
 
 /*!
-       Name: dos2unix [static public]
-       Desc: Convert text file. Replace symbols "LF/CR" by symbol "LF".
+  \brief Convert text file from DOS format to UNIX.
+
+  The function replaces "LF/CR" symbols sequence by "LF" symbol.
+
+  \param absName file name
+  \return \c true if the file is converted successfully and \c false in
+         case of any error
 */
 bool Qtx::dos2unix( const QString& absName )
 {
-  FILE* src = ::fopen( absName, "rb" );
+  FILE* src = ::fopen( absName.toLatin1(), "rb" );
   if ( !src )
-               return false;
+    return false;
 
   /* we'll use temporary file */
   char temp[512] = { '\0' };
   QString dir = Qtx::dir( absName );
-  FILE* tgt = ::fopen( strcpy( temp, ::tempnam( dir, "__x" ) ), "wb" );
+  FILE* tgt = ::fopen( strcpy( temp, ::tempnam( dir.toLatin1(), "__x" ) ), "wb" );
   if ( !tgt )
-               return false;
+    return false;
 
   /* temp -> result of conversion */
   const char CR = 0x0d;
@@ -471,7 +567,7 @@ bool Qtx::dos2unix( const QString& absName )
       break;              /* converted ok */
   }
   ::fclose( src );
-       ::fclose( tgt );
+  ::fclose( tgt );
 
   /* rename temp -> src */
   if ( !QFile::remove( absName ) )
@@ -481,8 +577,60 @@ bool Qtx::dos2unix( const QString& absName )
 }
 
 /*!
-       Name: rgbSet [static public]
-       Desc: Pack the specified color into one integer RGB set.
+  \brief Create path completer which can be used in the widgets
+  to provide auto completions.
+
+  Create an instance of QCompleter class and returns the pointer on it.
+  The calling function is responsible to the desstroying of the created 
+  completer object.
+
+  The QCompleter class provides completions based on a item model and can be
+  used in such as QLineEdit and QComboBox. 
+  When the user starts typing a word, QCompleter suggests possible ways of 
+  completing the word, based on a word list. 
+
+  \param type path type (Qtx::PathType)
+  \param filter file/directory filters (list of wildcards, separated by ";;")
+  \return a pointer to the created completer
+*/
+QCompleter* Qtx::pathCompleter( const PathType type, const QString& filter )
+{
+  QStringList extList;
+  QStringList filterList = filter.split( ";;" );
+  for ( QStringList::const_iterator it = filterList.begin(); it != filterList.end(); ++it )
+  {
+    QRegExp rx( "[\\s\\w,;]*\\(?\\*\\.([\\w]+)\\)?[\\d\\s\\w]*" );
+    int index = 0;
+    while ( ( index = rx.indexIn( *it, index ) ) != -1 )
+    {
+      extList.append( QString( "*.%1" ).arg( rx.cap( 1 ) ) );
+      index += rx.matchedLength();
+    }
+  }
+
+  QDir::Filters filters = 0;
+  switch ( type )
+  {
+  case PT_OpenFile:
+  case PT_SaveFile:
+    filters = QDir::AllEntries | QDir::AllDirs | QDir::NoDotAndDotDot;
+    break;
+  case PT_Directory:
+    filters = QDir::Drives | QDir::Dirs | QDir::NoDotAndDotDot;
+    break;
+  }
+
+  QDirModel* dm = new QDirModel( extList, filters, QDir::Unsorted );
+  QCompleter* cmp = new QCompleter( dm, 0 );
+  dm->setParent( cmp );
+
+  return cmp;
+}
+
+/*!
+  \brief Pack the specified color into integer RGB set.
+  \param c unpacked color
+  \return packed color
 */
 int Qtx::rgbSet( const QColor& c )
 {
@@ -490,8 +638,11 @@ int Qtx::rgbSet( const QColor& c )
 }
 
 /*!
-       Name: rgbSet [static public]
-       Desc: Pack the specified color components into one integer RGB set.
+  \brief Pack the specified RGB color components into integer RGB set.
+  \param r red component
+  \param g green component
+  \param b blue component
+  \return packed color
 */
 int Qtx::rgbSet( const int r, const int g, const int b )
 {
@@ -499,19 +650,23 @@ int Qtx::rgbSet( const int r, const int g, const int b )
 }
 
 /*!
-       Name: rgbSet [static public]
-       Desc: Unpack the specified integer RGB set into the color.
+  \brief Unpack the specified integer RGB set to the color.
+  \param rgb packed color
+  \return unpacked color (QColor)
 */
-void Qtx::rgbSet( const int rgb, QColor& c )
+QColor Qtx::rgbSet( const int rgb )
 {
   int r, g, b;
   rgbSet( rgb, r, g, b );
-  c = QColor( r, g, b );
+  return QColor( r, g, b );
 }
 
 /*!
-       Name: rgbSet [static public]
-       Desc: Unpack the specified integer RGB set into the color components.
+  \brief Unpack the specified integer RGB set to the three RGB components.
+  \param rgb packed color
+  \param r returned unpacked red component
+  \param g returned unpacked green component
+  \param b returned unpacked blue component
 */
 void Qtx::rgbSet( const int rgb, int& r, int& g, int& b )
 {
@@ -521,8 +676,11 @@ void Qtx::rgbSet( const int rgb, int& r, int& g, int& b )
 }
 
 /*!
-       Name: scaleColor [static public]
-       Desc: Returns the color specified by the index between min (blue) and max (red).
+  \brief Return the color specified by the index between min (blue) and max (red).
+  \param index color index
+  \param min required minimum hue value
+  \param max required maximum hue value
+  \return resulting color
 */
 QColor Qtx::scaleColor( const int index, const int min, const int max )
 {
@@ -530,7 +688,7 @@ QColor Qtx::scaleColor( const int index, const int min, const int max )
 
   int hue = HUE[0];
 
-       if ( min != max )
+  if ( min != max )
   {
     double aPosition = 9.0 * ( index - min ) / ( max - min );
     if ( aPosition > 0.0 )
@@ -545,14 +703,15 @@ QColor Qtx::scaleColor( const int index, const int min, const int max )
     }
   }
 
-  return QColor( hue, 255, 255, QColor::Hsv );
+  return QColor::fromHsv( hue, 255, 255 );
 }
 
 /*!
-       Name: scaleColors [static public]
-       Desc: Returns the 'num' number of colors from blue to red.
+  \brief Generate required number of colors aligned from blue to red.
+  \param num required number of colors
+  \param lst returned set of colors
 */
-void Qtx::scaleColors( const int num, QValueList<QColor>& lst )
+void Qtx::scaleColors( const int num, QColorList& lst )
 {
   lst.clear();
   for ( int i = 0; i < num; i++ )
@@ -560,8 +719,31 @@ void Qtx::scaleColors( const int num, QValueList<QColor>& lst )
 }
 
 /*!
-       Name: grayscale [static public]
-       Desc: Convert color image to grayscale image.
+  \brief Scale the pixmap to the required size.
+
+  If \h is 0 (default) the value of \a w is used instead (to create
+  square pixmap).
+
+  \param icon pixmap to be resized
+  \param w required pixmap width
+  \param h required pixmap height
+  \return scaled pixmap
+*/
+QPixmap Qtx::scaleIcon( const QPixmap& icon, const unsigned w, const unsigned h )
+{
+  QPixmap p;
+  int aw = w, ah = h <= 0 ? w : h;
+  if ( icon.isNull() || aw <= 0 || ah <= 0 || aw == icon.width() && ah == icon.height() )
+    p = icon;
+  else
+    p = icon.fromImage( icon.toImage().scaled( aw, ah, Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
+  return p;
+}
+
+/*!
+  \brief Convert given image to the grayscale format.
+  \param img initial image
+  \return converted to the grayscale image
 */
 QImage Qtx::grayscale( const QImage& img )
 {
@@ -589,26 +771,47 @@ QImage Qtx::grayscale( const QImage& img )
 }
 
 /*!
-       Name: grayscale [static public]
-       Desc: Convert color pixmap to grayscale pixmap.
+  \brief Convert given pixmap to the grayscale format.
+  \param pix initial pixmap
+  \return converted to the grayscale pixmap
 */
 QPixmap Qtx::grayscale( const QPixmap& pix )
 {
   QPixmap res;
-  res.convertFromImage( grayscale( pix.convertToImage() ) );
+  res.fromImage( grayscale( pix.toImage() ) );
   return res;
 }
 
 /*!
-       Name: transparentImage [static public]
-       Desc: Create transparent image with specified width \aw, height \ah and color depth \ad.
+  \brief Create transparent image.
+  \param w required image width
+  \param h required image height
+  \param d required image depth
+  \return generated image
 */
 QImage Qtx::transparentImage( const int w, const int h, const int d )
 {
-  QImage img;
-  if ( img.create( w, h, d < 0 ? QPixmap::defaultDepth() : d ) )
+  QImage::Format fmt;
+  switch ( d )
+  {
+  case 1:
+    fmt = QImage::Format_Mono;
+    break;
+  case 8:
+    fmt = QImage::Format_Indexed8;
+    break;
+  case 16:
+  case 24:
+  case 32:
+  default:
+    fmt = QImage::Format_ARGB32;
+    break;
+  }
+
+  QImage img( w, h, fmt );
+  if ( !img.isNull() )
   {
-    img.setAlphaBuffer( true );
+//    img.setAlphaBuffer( true );
     for ( int i = 0; i < img.height(); i++ )
       for ( int j = 0; j < img.width(); j++ )
         img.setPixel( j, i, qRgba( 0, 0, 0, 0 ) );
@@ -617,48 +820,58 @@ QImage Qtx::transparentImage( const int w, const int h, const int d )
 }
 
 /*!
-       Name: transparentPixmap [static public]
-       Desc: Create transparent pixmap with specified width \aw, height \ah and color depth \ad.
+  \brief Create transparent pixmap.
+  \param w required image width
+  \param h required pixmap height
+  \param d required pixmap depth
+  \return generated pixmap
 */
 QPixmap Qtx::transparentPixmap( const int w, const int h, const int d )
 {
   QPixmap pix;
   QImage img = transparentImage( w, h, d );
   if ( !img.isNull() )
-    pix.convertFromImage( img );
+    pix.fromImage( img );
   return pix;
 }
 
 /*!
-       Name: composite [static public]
-       Desc: Create composite pixmap. Pixmap 'pix' draws over pixmap 'dest' with coordinates
-        specified relative upper left corner of 'dest'. If 'dest' not given then new empty
-        pixmap with appropriate size created.
+  \brief Create composite pixmap. 
+
+  Pixmap \a pix is drawn over pixmap \a dest with coordinates
+  specified relatively to the upper left corner of \a dest.
+  If \a dest is not given, the new empty pixmap with appropriate size created instead.
+
+  \param pix source pixmap
+  \param x horizontal shift
+  \param y vertical shift
+  \param dest background pixmap
+  \return resulting pixmap
 */
 QPixmap Qtx::composite( const QPixmap& pix, const int x, const int y, const QPixmap& dest )
 {
   if ( pix.isNull() )
     return dest;
 
-  int width = QMAX( pix.width() + x, dest.width() );
-  int height = QMAX( pix.height() + y, dest.height() );
+  int width = qMax( pix.width() + x, dest.width() );
+  int height = qMax( pix.height() + y, dest.height() );
 
   QPixmap res( width, height );
   QImage img = transparentImage( width, height, 32 );
 
   QPainter p;
   p.begin( &res );
-  p.fillRect( 0, 0, width, height, QBrush( white ) );
+  p.fillRect( 0, 0, width, height, QBrush( Qt::white ) );
 
   if ( !dest.isNull() )
   {
     p.drawPixmap( 0, 0, dest );
-    QImage temp = dest.convertToImage();
+    QImage temp = dest.toImage();
     for ( int i = 0; i < temp.width() && i < img.width(); i++ )
     {
       for ( int j = 0; j < temp.height() && j < img.height(); j++ )
       {
-        if ( temp.hasAlphaBuffer() )
+        if ( temp.hasAlphaChannel() )
           img.setPixel( i, j, temp.pixel( i, j ) );
         else
         {
@@ -670,7 +883,7 @@ QPixmap Qtx::composite( const QPixmap& pix, const int x, const int y, const QPix
   }
 
   p.drawPixmap( x, y, pix );
-  QImage temp = pix.convertToImage();
+  QImage temp = pix.toImage();
   for ( int c = x; c < temp.width() + x && c < img.width(); c++ )
   {
     for ( int r = y; r < temp.height() + y && r < img.height(); r++ )
@@ -694,8 +907,384 @@ QPixmap Qtx::composite( const QPixmap& pix, const int x, const int y, const QPix
   }
 
   QBitmap bmp( width, height );
-  bmp.convertFromImage( img, Qt::ColorMode_Mask | Qt::ThresholdDither );
+  bmp.fromImage( img, Qt::ColorMode_Mask | Qt::ThresholdDither );
   res.setMask( bmp );
 
   return res;
 }
+
+/*!
+  \brief Convert color to the string representation.
+  
+  The resulting string is in the one of two possible formats
+  (\c RR, \c GG, \c BB and \c AA value represent red, green, blue
+  and alpha components of the color):
+  - if color has alpha channel : "#RR,#GG,#BB,#AA"
+  - if color does not have alpha channel : "#RRGGBB" 
+
+  If color is invalid, null string is returned.
+
+  Backward conversion can be done with stringToColor() method.
+
+  \param color color to be converted
+  \return string representation of the color
+
+  \sa stringToColor()
+*/
+QString Qtx::colorToString( const QColor& color )
+{
+  QString str;
+  if ( color.isValid() )
+  {
+    if ( color.alpha() != 255 )
+    {
+      QStringList vals;
+      vals << QString( "#%1" ).arg( color.red(),   0, 16 );
+      vals << QString( "#%1" ).arg( color.green(), 0, 16 );
+      vals << QString( "#%1" ).arg( color.blue(),  0, 16 );
+      vals << QString( "#%1" ).arg( color.alpha(), 0, 16 );
+      str = vals.join( "," );
+    }
+    else
+    {
+      str = color.name();
+    }
+  }
+  return str;
+}
+
+/*!
+  \brief Create color from the string representation.
+  
+  The parameter \a str must be in the one of following formats
+  (\c RR, \c GG, \c BB and \c AA value represent red, green, blue
+  and alpha components of the color):
+  - "#RR,#GG,#BB[,#AA]" or "#RR #GG #BB[ #AA]" (\c RR, \c GG, \c BB
+  and optional \c AA values represent red, green, blue and alpha
+  components of the color in hexadecimal form)
+  - "RR,GG,BB[,AA]" or "RR GG BB[ AA]" (\c RR, \c GG, \c BB
+  and optional \c AA values represent red, green, blue and alpha
+  components of the color in decimal form)
+  - #RRGGBB" - (\c RR, \c GG and \c BB values represent red, green and blue
+  components of the color in hexadecimal form)
+  - an integer value representing packed color components (see rgbSet())
+  - a name from the list of colors defined in the list of SVG color keyword names
+  provided by the World Wide Web Consortium; for example, "steelblue" or "gainsboro".
+
+  Backward conversion can be done with colorToString() method.
+
+  \param str string representation of the color
+  \param color resulting color value
+  \return \c true if the conversion is successful and \c false otherwise
+
+  \sa colorToString(), rgbSet()
+*/
+bool Qtx::stringToColor( const QString& str, QColor& color )
+{
+  bool res = true;
+  QStringList vals = str.split( QRegExp( "[\\s|,]" ), QString::SkipEmptyParts );
+
+  QIntList nums;
+  for ( QStringList::const_iterator it = vals.begin(); it != vals.end() && res; ++it )
+  {
+    int num = 0;
+    if ( (*it).startsWith( "#" ) )
+      num = (*it).mid( 1 ).toInt( &res, 16 );
+    else
+      num = (*it).toInt( &res, 10 );
+    if ( res )
+      nums.append( num );
+  }
+
+  res = res && nums.count() >= 3;
+  if ( res )
+    color.setRgb( nums[0], nums[1], nums[2] );
+
+  if ( !res )
+  {
+    int pack = str.toInt( &res );
+    if ( res )
+      color = Qtx::rgbSet( pack );
+  }
+
+  if ( !res )
+  {
+    color = QColor( str );
+    res = color.isValid();
+  }
+
+  return res;
+}
+
+/*!
+  \brief Dump linear gradient to the string description.
+  \param gradient linear gradient to be converted
+  \return string representation of the linear gradient
+  \sa stringToLinearGradient()
+*/
+QString Qtx::gradientToString( const QLinearGradient& gradient )
+{
+  QStringList data;
+  data << "linear";
+  data << QString::number( gradient.start().x() );
+  data << QString::number( gradient.start().y() );
+  data << QString::number( gradient.finalStop().x() );
+  data << QString::number( gradient.finalStop().y() );
+  switch( gradient.spread() ) 
+  {
+  case QGradient::PadSpread:
+    data << "pad";
+    break;
+  case QGradient::RepeatSpread:
+    data << "repeat";
+    break;
+  case QGradient::ReflectSpread:
+    data << "reflect";
+    break;
+  default:
+    break;
+  }
+  QGradientStops stops = gradient.stops();
+  QGradientStop stop;
+  foreach ( stop, stops ) 
+  {
+    data << QString::number( stop.first );
+    data << colorToString( stop.second );
+  }
+  return data.join( "|" );
+}
+
+/*!
+  \brief Dump radial gradient to the string description.
+  \param gradient radial gradient to be converted
+  \return string representation of the radial gradient
+  \sa stringToRadialGradient()
+*/
+QString Qtx::gradientToString( const QRadialGradient& gradient )
+{
+  QStringList data;
+  data << "radial";
+  data << QString::number( gradient.center().x() );
+  data << QString::number( gradient.center().y() );
+  data << QString::number( gradient.focalPoint().x() );
+  data << QString::number( gradient.focalPoint().y() );
+  data << QString::number( gradient.radius() );
+  switch( gradient.spread() ) 
+  {
+  case QGradient::PadSpread:
+    data << "pad";
+    break;
+  case QGradient::RepeatSpread:
+    data << "repeat";
+    break;
+  case QGradient::ReflectSpread:
+    data << "reflect";
+    break;
+  default:
+    break;
+  }
+  QGradientStops stops = gradient.stops();
+  QGradientStop stop;
+  foreach ( stop, stops ) 
+  {
+    data << QString::number( stop.first );
+    data << colorToString( stop.second );
+  }
+  return data.join( "|" );
+}
+
+/*!
+  \brief Dump conical gradient to the string description.
+  \param gradient conical gradient to be converted
+  \return string representation of the conical gradient
+  \sa stringToConicalGradient()
+*/
+QString Qtx::gradientToString( const QConicalGradient& gradient )
+{
+  QStringList data;
+  data << "conical";
+  data << QString::number( gradient.center().x() );
+  data << QString::number( gradient.center().y() );
+  data << QString::number( gradient.angle() );
+  switch( gradient.spread() ) 
+  {
+  case QGradient::PadSpread:
+    data << "pad";
+    break;
+  case QGradient::RepeatSpread:
+    data << "repeat";
+    break;
+  case QGradient::ReflectSpread:
+    data << "reflect";
+    break;
+  default:
+    break;
+  }
+  QGradientStops stops = gradient.stops();
+  QGradientStop stop;
+  foreach ( stop, stops ) 
+  {
+    data << QString::number( stop.first );
+    data << colorToString( stop.second );
+  }
+  return data.join( "|" );
+}
+
+/*!
+  \brief Create linear gradient from its string representation.
+  \param str string representation of the linear gradient
+  \param gradient resulting linear gradient object
+  \return \c true if the conversion is successful and \c false otherwise
+  \sa gradientToString()
+*/
+bool Qtx::stringToLinearGradient( const QString& str, QLinearGradient& gradient )
+{
+  bool success = false;
+  QStringList vals = str.split( "|", QString::SkipEmptyParts );
+  if ( vals.count() > 4 && ( vals[0] == "linear" || vals[0] == "lg" ) )
+  {
+    // start and end points 
+    double x1, y1, x2, y2;
+    bool bOk1, bOk2, bOk3, bOk4;
+    x1 = vals[1].toDouble( &bOk1 );
+    y1 = vals[2].toDouble( &bOk2 );
+    x2 = vals[3].toDouble( &bOk3 );
+    y2 = vals[4].toDouble( &bOk4 );
+    if ( bOk1 && bOk2 && bOk3 && bOk4 )
+    {
+      gradient = QLinearGradient( x1, y1, x2, y2 );
+      // spread type
+      if ( vals.count() > 5 )
+      {
+       QString spread = vals[ 5 ].trimmed().toLower();
+       if ( spread == "pad" || spread == "0" )
+         gradient.setSpread( QGradient::PadSpread );
+       else if ( spread == "repeat" || spread == "2" )
+         gradient.setSpread( QGradient::RepeatSpread );
+       else if ( spread == "reflect" || spread == "1" )
+         gradient.setSpread( QGradient::ReflectSpread );
+      }
+      // stop points
+      QGradientStops stops;
+      for ( int i = 6; i < vals.count(); i+=2 )
+      {
+       bool bOk5, bOk6 = false;
+       QColor c;
+       double stop = vals[i].toDouble( &bOk5 );
+       if ( i+1 < vals.count() )
+         bOk6 = stringToColor( vals[ i+1 ], c );
+       if ( bOk5 && stop >= 0.0 && stop <= 1.0 && bOk6 && c.isValid() )
+         stops.append( QGradientStop( stop, c ) );
+      }
+      gradient.setStops( stops );
+      success = true;
+    }
+  }
+  return success;
+}
+
+/*!
+  \brief Create radial gradient from its string representation.
+  \param str string representation of the radial gradient
+  \param gradient resulting radial gradient object
+  \return \c true if the conversion is successful and \c false otherwise
+  \sa gradientToString()
+*/
+bool Qtx::stringToRadialGradient( const QString& str, QRadialGradient& gradient )
+{
+  bool success = false;
+  QStringList vals = str.split( "|", QString::SkipEmptyParts );
+  if ( vals.count() > 5 && vals[0] == "radial" || vals[0] == "rg" ) 
+  {
+    // center, radius and focal point
+    double cx, cy, r, fx, fy;
+    bool bOk1, bOk2, bOk3, bOk4, bOk5;
+    cx = vals[1].toDouble( &bOk1 );
+    cy = vals[2].toDouble( &bOk2 );
+    fx = vals[3].toDouble( &bOk4 );
+    fy = vals[4].toDouble( &bOk5 );
+    r  = vals[5].toDouble( &bOk3 );
+    if ( bOk1 && bOk2 && bOk3 && bOk4 && bOk5 )
+    {
+      gradient = QRadialGradient( cx, cy, r, fx, fy );
+      // spread type
+      if ( vals.count() > 6 )
+      {
+       QString spread = vals[ 6 ].trimmed().toLower();
+       if ( spread == "pad" || spread == "0" )
+         gradient.setSpread( QGradient::PadSpread );
+       else if ( spread == "repeat" || spread == "2" )
+         gradient.setSpread( QGradient::RepeatSpread );
+       else if ( spread == "reflect" || spread == "1" )
+         gradient.setSpread( QGradient::ReflectSpread );
+      }
+      // stop points
+      QGradientStops stops;
+      for ( int i = 7; i < vals.count(); i+=2 )
+      {
+       bool bOk7, bOk8 = false;
+       QColor c;
+       double stop = vals[i].toDouble( &bOk7 );
+       if ( i+1 < vals.count() )
+         bOk8 = stringToColor( vals[ i+1 ], c );
+       if ( bOk7 && stop >= 0.0 && stop <= 1.0 && bOk8 && c.isValid() )
+         stops.append( QGradientStop( stop, c ) );
+      }
+      gradient.setStops( stops );
+      success = true;
+    }
+  }
+  return success;
+}
+
+/*!
+  \brief Create conical gradient from its string representation.
+  \param str string representation of the conical gradient
+  \param gradient resulting conical gradient object
+  \return \c true if the conversion is successful and \c false otherwise
+  \sa gradientToString()
+*/
+bool Qtx::stringToConicalGradient( const QString& str, QConicalGradient& gradient )
+{
+  bool success = false;
+  QStringList vals = str.split( "|", QString::SkipEmptyParts );
+  if ( vals.count() > 3 && vals[0] == "conical" || vals[0] == "cg" ) 
+  {
+    // center and angle
+    double cx, cy, a;
+    bool bOk1, bOk2, bOk3;
+    cx = vals[1].toDouble( &bOk1 );
+    cy = vals[2].toDouble( &bOk2 );
+    a = vals[3].toDouble( &bOk3 );
+    if ( bOk1 && bOk2 && bOk3 )
+    {
+      gradient = QConicalGradient( cx, cy, a );
+      // spread type
+      if ( vals.count() > 4 )
+      {
+       QString spread = vals[ 4 ].trimmed().toLower();
+       if ( spread == "pad" || spread == "0" )
+         gradient.setSpread( QGradient::PadSpread );
+       else if ( spread == "repeat" || spread == "2" )
+         gradient.setSpread( QGradient::RepeatSpread );
+       else if ( spread == "reflect" || spread == "1" )
+         gradient.setSpread( QGradient::ReflectSpread );
+      }
+      // stop points
+      QGradientStops stops;
+      for ( int i = 5; i < vals.count(); i+=2 )
+      {
+       bool bOk4, bOk5 = false;
+       QColor c;
+       double stop = vals[i].toDouble( &bOk4 );
+       if ( i+1 < vals.count() )
+         bOk5 = stringToColor( vals[ i+1 ], c );
+       if ( bOk4 && stop >= 0.0 && stop <= 1.0 && bOk5 && c.isValid() )
+         stops.append( QGradientStop( stop, c ) );
+      }
+      gradient.setStops( stops );
+      success = true;
+    }
+  }
+  return success;
+}
index 0d5cb3a40e7a1b60e1fd1a3e3c7899551f29d897..6960d4d96abcfc084eed45ff978f8fa1268729f6 100755 (executable)
@@ -1,39 +1,38 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      Qtx.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTX_H
 #define QTX_H
 
-#if defined QTX_EXPORTS
-#if defined WIN32
-#define QTX_EXPORT _declspec( dllexport )
-#else
-#define QTX_EXPORT  
-#endif
-#else
 #if defined WIN32
-#define QTX_EXPORT _declspec( dllimport )
+#  if defined QTX_EXPORTS
+#    define QTX_EXPORT _declspec( dllexport )
+#  else
+#    define QTX_EXPORT _declspec( dllimport )
+#  endif
 #else
-#define QTX_EXPORT  
-#endif
+#  define QTX_EXPORT  
 #endif
 
 #if defined SOLARIS
 #define true  1
 #endif
 
-#ifndef INCLUDE_MENUITEM_DEF
-#define INCLUDE_MENUITEM_DEF
-#endif
-
-#include <qnamespace.h>
-
-#ifndef QT_VERSION
-#define QT_VER 0
-#else
-#if QT_VERSION >= 0x30000
-#define QT_VER 3
-#else
-#if QT_VERSION >= 300
-#define QT_VER 3
-#else
-#if QT_VERSION >= 200
-#define QT_VER 2
-#else
-#if QT_VERSION >= 100
-#define QT_VER 1
-#endif
-#endif
-#endif
-#endif
-#endif
-
-#include <qimage.h>
-#include <qpixmap.h>
+#include <QString>
+#include <QList>
+#include <QColor>
+#include <QImage>
+#include <QPixmap>
 
 class QObject;
-class QString;
 class QWidget;
-class QToolBar;
-class QGroupBox;
-class QPopupMenu;
-class QWidgetList;
+class QCompleter;
+class QLinearGradient;
+class QRadialGradient;
+class QConicalGradient;
 
-template <class> class QValueList;
+typedef QList<int>    QIntList;       //!< list of int values
+typedef QList<short>  QShortList;     //!< list of short int values
+typedef QList<double> QDoubleList;    //!< list of double values
+typedef QList<QColor> QColorList;     //!< list of colors
 
-#if QT_VER < 3
-#define QPtrList QList
-#define QPtrListIterator QListIterator
-#endif
-
-typedef QValueList<int>    QIntList;
-typedef QValueList<short>  QShortList;
-typedef QValueList<double> QDoubleList;
-
-/*!
-  \class Qtx
-  \brief Set of auxiliary static methods
-*/
-class QTX_EXPORT Qtx : public Qt
+class QTX_EXPORT Qtx
 {
 public:
-  enum AlignmentFlags
+  //! Widget alignment flags
+  typedef enum
   {
-    AlignOutLeft   = AlignVCenter  << 2,
-    AlignOutRight  = AlignOutLeft  << 2,
-    AlignOutTop    = AlignOutRight << 2,
-    AlignOutBottom = AlignOutTop   << 2
+    AlignLeft            = Qt::AlignLeft,            //!< align left side of one widget to the left side of another widget
+    AlignLeading         = Qt::AlignLeading,         //!< synonim for AlignLeft
+    AlignRight           = Qt::AlignRight,           //!< align right side of one widget to the right side of another widget
+    AlignTrailing        = Qt::AlignTrailing,        //!< synonim for AlignRight
+    AlignHCenter         = Qt::AlignHCenter,         //!< align one widget to the center of another widget in horizontal dimension
+    AlignJustify         = Qt::AlignJustify,         //!< synonym of Qt::AlignJustify
+    AlignAbsolute        = Qt::AlignAbsolute,        //!< synonym of Qt::AlignAbsolute
+    AlignHorizontal_Mask = Qt::AlignHorizontal_Mask, //!< synonym of Qt::AlignHorizontal_Mask
+
+    AlignTop             = Qt::AlignTop,             //!< align top side of one widget to the top side of another widget
+    AlignBottom          = Qt::AlignBottom,          //!< align bottom side of one widget to the bottom side of another widget
+    AlignVCenter         = Qt::AlignVCenter,         //!< align one widget to the center of another widget in vertical dimension
+    AlignVertical_Mask   = Qt::AlignVertical_Mask,   //!< synonym of Qt::AlignVertical_Mask
+
+    AlignCenter          = Qt::AlignCenter,          //!< align one widget to the center of another widget in both dimensions
+
+    AlignOutLeft         = Qt::AlignVCenter  << 2,   //!< align right side of one widget to the left side of another widget
+    AlignOutRight        = AlignOutLeft      << 2,   //!< align left side of one widget to the right side of another widget
+    AlignOutTop          = AlignOutRight     << 2,   //!< align bottom side of one widget to the top side of another widget
+    AlignOutBottom       = AlignOutTop       << 2    //!< align top side of one widget to the bottom side of another widget
+  } AlignmentFlags;
+
+  //! Path type, indicates required directory/file operation
+  typedef enum { 
+    PT_OpenFile,      //!< the file is opened
+    PT_SaveFile,      //!< the file is saved
+    PT_Directory      //!< the directory path is required
+  } PathType;
+
+  //! Custom data roles
+  enum { 
+    AppropriateRole = Qt::UserRole + 100   //!< can be used to return \c true if data is appropriate
   };
 
-  static void    setTabOrder( QWidget*, ... );
-  static void    setTabOrder( const QWidgetList& );
-  static void    alignWidget( QWidget*, const QWidget*, const int );
+  typedef enum {
+       Shown,   //!< column should be always visible
+       Hidden,  //!< column should be always hidden
+       Toggled  //!< it should be possible to show/hide the column with help of popup menu
+  } Appropriate;  //!< appropriate status
+
+  static QString     toQString( const char*, const int = -1 );
+  static QString     toQString( const short*, const int = -1 );
+  static QString     toQString( const unsigned char*, const int = -1 );
+  static QString     toQString( const unsigned short*, const int = -1 );
+
+  static void        setTabOrder( QWidget*, ... );
+  static void        setTabOrder( const QWidgetList& );
+  static void        alignWidget( QWidget*, const QWidget*, const int );
+
+  static void        simplifySeparators( QWidget*, const bool = true );
+
+  static bool        isParent( QObject*, QObject* );
+  static QObject*    findParent( QObject*, const char* );
+
+  static QString     dir( const QString&, const bool = true );
+  static QString     file( const QString&, const bool = true );
+  static QString     extension( const QString&, const bool = false );
 
-  static void    simplifySeparators( QToolBar* );
-  static void    simplifySeparators( QPopupMenu*, const bool = true );
+  static QString     library( const QString& );
 
-  static bool    isParent( QObject*, QObject* );
+  static QString     tmpDir();
+  static bool        mkDir( const QString& );
+  static bool        rmDir( const QString& );
+  static bool        dos2unix( const QString& );
+  static QString     addSlash( const QString& );
 
-  static QString extension( const QString& );
-  static QString dir( const QString&, const bool = true );
-  static QString file( const QString&, const bool = true );
+  static QCompleter* pathCompleter( const PathType, const QString& = QString() );
 
-  static QString library( const QString& );
+  static int         rgbSet( const QColor& );
+  static int         rgbSet( const int, const int, const int );
 
-  static QString tmpDir();
-  static bool    mkDir( const QString& );
-  static bool    rmDir( const QString& );
-  static bool    dos2unix( const QString& );
-  static QString addSlash( const QString& );
+  static QColor      rgbSet( const int );
+  static void        rgbSet( const int, int&, int&, int& );
 
-  static int     rgbSet( const QColor& );
-  static int     rgbSet( const int, const int, const int );
+  static QColor      scaleColor( const int, const int, const int );
+  static void        scaleColors( const int, QColorList& );
 
-  static void    rgbSet( const int, QColor& );
-  static void    rgbSet( const int, int&, int&, int& );
+  static QPixmap     scaleIcon( const QPixmap&, const unsigned, const unsigned = 0 );
+  static QImage      grayscale( const QImage& );
+  static QPixmap     grayscale( const QPixmap& );
+  static QImage      transparentImage( const int, const int, const int = -1 );
+  static QPixmap     transparentPixmap( const int, const int, const int = -1 );
+  static QPixmap     composite( const QPixmap&, const int, const int, const QPixmap& = QPixmap() );
 
-  static QColor  scaleColor( const int, const int, const int );
-  static void    scaleColors( const int, QValueList<QColor>& );
+  static QString     colorToString( const QColor& );
+  static bool        stringToColor( const QString&, QColor& );
 
-  static QImage  grayscale( const QImage& );
-  static QPixmap grayscale( const QPixmap& );
-  static QImage  transparentImage( const int, const int, const int = -1 );
-  static QPixmap transparentPixmap( const int, const int, const int = -1 );
-  static QPixmap composite( const QPixmap&, const int, const int, const QPixmap& = QPixmap() );
+  static QString     gradientToString( const QLinearGradient& );
+  static QString     gradientToString( const QRadialGradient& );
+  static QString     gradientToString( const QConicalGradient& );
+  static bool        stringToLinearGradient( const QString&, QLinearGradient& );
+  static bool        stringToRadialGradient( const QString&, QRadialGradient& );
+  static bool        stringToConicalGradient( const QString&, QConicalGradient& );
 };
 
 #endif
diff --git a/src/Qtx/Qtx.pro b/src/Qtx/Qtx.pro
new file mode 100644 (file)
index 0000000..a5b7c33
--- /dev/null
@@ -0,0 +1,117 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = qtx
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+QT += xml
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += QTX_EXPORTS
+
+HEADERS  = Qtx.h
+HEADERS += QtxAction.h
+HEADERS += QtxActionMenuMgr.h
+HEADERS += QtxActionMgr.h
+HEADERS += QtxActionSet.h
+HEADERS += QtxActionToolMgr.h
+HEADERS += QtxColorScale.h
+HEADERS += QtxComboBox.h
+HEADERS += QtxDialog.h
+HEADERS += QtxDockAction.h
+HEADERS += QtxDockWidget.h
+HEADERS += QtxDoubleSpinBox.h
+HEADERS += QtxEvalExpr.h
+HEADERS += QtxGridBox.h
+HEADERS += QtxGroupBox.h
+HEADERS += QtxIntSpinBox.h
+HEADERS += QtxListAction.h
+HEADERS += QtxLogoMgr.h
+HEADERS += QtxMainWindow.h
+HEADERS += QtxMap.h
+HEADERS += QtxMRUAction.h
+HEADERS += QtxPathDialog.h
+HEADERS += QtxPopupMgr.h
+HEADERS += QtxResourceMgr.h
+HEADERS += QtxSplash.h
+HEADERS += QtxToolBar.h
+HEADERS += QtxToolTip.h
+HEADERS += QtxValidator.h
+HEADERS += QtxWorkspace.h
+HEADERS += QtxWorkspaceAction.h
+HEADERS += QtxWorkstack.h
+HEADERS += QtxWorkstackAction.h
+#HEADERS += QtxDirListEditor.h
+#HEADERS += QtxListBox.h
+#HEADERS += QtxListResourceEdit.h
+#HEADERS += QtxListView.h
+#HEADERS += QtxPopupMenu.h
+#HEADERS += QtxResourceEdit.h
+#HEADERS += QtxTable.h
+
+SOURCES  = Qtx.cxx
+SOURCES += QtxAction.cxx
+SOURCES += QtxActionMenuMgr.cxx
+SOURCES += QtxActionMgr.cxx
+SOURCES += QtxActionSet.cxx
+SOURCES += QtxActionToolMgr.cxx
+SOURCES += QtxColorScale.cxx
+SOURCES += QtxComboBox.cxx
+SOURCES += QtxDialog.cxx
+SOURCES += QtxDockAction.cxx
+SOURCES += QtxDockWidget.cxx
+SOURCES += QtxDoubleSpinBox.cxx
+SOURCES += QtxEvalExpr.cxx
+SOURCES += QtxGridBox.cxx
+SOURCES += QtxGroupBox.cxx
+SOURCES += QtxIntSpinBox.cxx
+SOURCES += QtxListAction.cxx
+SOURCES += QtxLogoMgr.cxx
+SOURCES += QtxMainWindow.cxx
+SOURCES += QtxMRUAction.cxx
+SOURCES += QtxPathDialog.cxx
+SOURCES += QtxPopupMgr.cxx
+SOURCES += QtxResourceMgr.cxx
+SOURCES += QtxSplash.cxx
+SOURCES += QtxToolBar.cxx
+SOURCES += QtxToolTip.cxx
+SOURCES += QtxValidator.cxx
+SOURCES += QtxWorkspace.cxx
+SOURCES += QtxWorkspaceAction.cxx
+SOURCES += QtxWorkstack.cxx
+SOURCES += QtxWorkstackAction.cxx
+#SOURCES += QtxDirListEditor.cxx
+#SOURCES += QtxListBox.cxx
+#SOURCES += QtxListResourceEdit.cxx
+#SOURCES += QtxListView.cxx
+#SOURCES += QtxPopupMenu.cxx
+#SOURCES += QtxResourceEdit.cxx
+#SOURCES += QtxTable.cxx
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+INSTALLS += includes
index dbae4819fd35b499bcd742742272fd2076f51307..49102514222393f3ab651da2144ce6458db2e29b 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxAction.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxAction.h"
 
-#include <qpopupmenu.h>
-#include <qmenubar.h>
+#include <QEvent>
+#include <QPointer>
+#include <QActionEvent>
+#include <QApplication>
 
 /*!
-       Name: QtxAction [public]
-       Desc: Constructs an action with given parent and name. If toggle is true the
-                 action will be a toggle action, otherwise it will be a command action.
+  \class QtxAction::ActionNotify
+  \brief Notify event used to signalize about event adding/removing.
+  \internal
 */
 
-QtxAction::QtxAction( QObject* parent, const char* name, bool toggle )
-  : QAction( parent, name, toggle )
+class QtxAction::ActionNotify : public QEvent
 {
-}
+public:
+  ActionNotify( bool add, QWidget* wid ) : QEvent( QEvent::User ), myAdd( add ), myWidget( wid ) {};
+  ~ActionNotify() {};
+
+  bool              isAdded() const { return myAdd; }
+  QWidget*          widget() const { return myWidget; }
+
+private:
+  bool              myAdd;
+  QPointer<QWidget> myWidget;
+};
 
 /*!
-       Name: QtxAction [public]
-       Desc: This constructor creates an action with the following properties: the
-                 description text, the icon or iconset icon, the menu text and keyboard
-                 accelerator. It is a child of given parent and named specified name.
-                 If toggle is true the action will be a toggle action, otherwise it will
-                 be a command action.
+  \class QtxAction
+  \brief Generic action class.
+
+  The class QtxAction inherits QWidgetAction class and can be used 
+  as base class when implementing any custom menu/toolbar actions.
+  It is necessary to subclass from QtxAction and redefine virtual 
+  callback methods addedTo(), removedFrom() (which are called automatically
+  when the action is added to the widget and removed from it) to customize
+  the action behavior.  
 */
 
-QtxAction::QtxAction( const QString& text, const QIconSet& icon,
-                      const QString& menuText, int accel,
-                      QObject* parent, const char* name, bool toggle )
-  : QAction( text, icon, menuText, accel, parent, name, toggle )
+/*!
+  \brief Constructor.
+
+  Creates an action owned by \a parent. 
+  Parameter \a toggle can be used to make the action checkable.
+
+  \param parent parent object
+  \param toggle if \c true the action will be a toggle action
+*/
+QtxAction::QtxAction( QObject* parent, bool toggle )
+: QWidgetAction( parent )
 {
+  setCheckable( toggle );
+
+  QApplication::instance()->installEventFilter( this );
 }
 
 /*!
-       Name: QtxAction [public]
-       Desc: This constructor creates an action with the following properties: the
-                 description text, the menu text and keyboard accelerator. It is a child
-                 of given parent and named specified name. If toggle is true the action
-                 will be a toggle action, otherwise it will be a command action.
+  \brief Constructor.
+
+  Creates an action owned by \a parent. Parameters \a text,
+  \a icon, \a menuText and \a accel specify the action's attributes.
+  Parameter \a toggle can be used to make the action checkable.
+
+  \param text tooltip text
+  \param icon iconset
+  \param menuText menu text
+  \param accel shortcut key sequence
+  \param parent parent object
+  \param toggle if \c true the action will be a toggle action
 */
-
-QtxAction::QtxAction( const QString& text, const QString& menuText, int accel,
-                      QObject* parent, const char* name, bool toggle )
-  : QAction( text, menuText, accel, parent, name, toggle )
+QtxAction::QtxAction( const QString& text, const QIcon& icon,
+                      const QString& menuText, int accel, QObject* parent, bool toggle )
+: QWidgetAction( parent )
 {
+  setIcon( icon );
+  setText( menuText );
+  setToolTip( text );
+  setShortcut( accel );
+  setCheckable( toggle );
+
+  QApplication::instance()->installEventFilter( this );
 }
 
 /*!
-       Name: ~QtxAction [virtual public]
-       Desc: Destructor.
+  \brief Constructor.
+
+  Creates an action owned by \a parent. Parameters \a text,
+  \a menuText and \a accel specify the action's attributes.
+  Parameter \a toggle can be used to make the action checkable.
+
+  \param text tooltip text
+  \param menuText menu text
+  \param accel shortcut key sequence
+  \param parent parent object
+  \param toggle if \c true the action is a toggle action
 */
+QtxAction::QtxAction( const QString& text, const QString& menuText,
+                      int accel, QObject* parent, bool toggle )
+: QWidgetAction( parent )
+{
+  setText( menuText );
+  setToolTip( text );
+  setShortcut( accel );
+  setCheckable( toggle );
 
+  QApplication::instance()->installEventFilter( this );
+}
+
+/*!
+  \brief Destructor.
+*/
 QtxAction::~QtxAction()
 {
 }
 
 /*!
-       Name: addTo [virtual public]
-       Desc: Adds this action to widget. Returns true if the action was added
-                 successfully and false otherwise.
+  \brief Customize action events.
+  
+  Sends a notification event to the action when it is added to 
+  the widget or removed from it in order to perform custom processing.
+
+  \param o object
+  \param e event
+  \return \c true if further event processing should be stopped
+  \sa customEvent(), addedTo(), removedFrom()
 */
-
-bool QtxAction::addTo( QWidget* w )
+bool QtxAction::eventFilter( QObject* o, QEvent* e )
 {
-  if ( w->inherits( "QMenuBar" ) ) {
-    // --- Add action to the QMenuBar ---
-    // n.b. currently for the actions inserted to the menu bar 
-    // the following properties are not supported:
-    // * tooltips
-    // * what's this info
-    // * toggle mode
-    QMenuBar* mb = (QMenuBar*)w;
-    if ( myMenuIds.find( w ) != myMenuIds.end() )
-      return false;                        // already added
-    if ( name() == "qt_separator_action" ) // separator
-      myMenuIds[ w ] = mb->insertSeparator();
-    else if ( iconSet().isNull() )         // has no icon
-      myMenuIds[ w ] = mb->insertItem( menuText(), this, SIGNAL( activated() ), accel() );
-    else                                   // has icon
-      myMenuIds[ w ] = mb->insertItem( iconSet(), menuText(), this, SIGNAL( activated() ), accel() );
-    mb->setItemEnabled( myMenuIds[ w ], isEnabled() );
-    mb->setItemVisible( myMenuIds[ w ], isVisible() );
-    return true;
+  if ( o && o->isWidgetType() )
+  {
+    if ( e->type() == QEvent::ActionAdded && ((QActionEvent*)e)->action() == this )
+      QApplication::postEvent( this, new ActionNotify( true, (QWidget*)o ) );
+    if ( e->type() == QEvent::ActionRemoved && ((QActionEvent*)e)->action() == this )
+      QApplication::postEvent( this, new ActionNotify( false, (QWidget*)o ) );
   }
-  return QAction::addTo( w );
+  return QWidgetAction::eventFilter( o, e );
 }
 
 /*!
-       Name: addTo [virtual public]
-       Desc: Adds this action to widget. If widget is QPopupMenu given index will
-                 be used for menu item inserting. Returns true if the action was added
-                 successfully and false otherwise.
-*/
+  \brief Called when the action is added to the widget.
 
-bool QtxAction::addTo( QWidget* w, const int index )
-{
-  if ( !addTo( w ) )
-    return false;
+  This method can be redefined in the subclasses to customize 
+  the action behavior. Base implementation does nothing. 
 
-  if ( w->inherits( "QPopupMenu" ) ) {
-    // --- Add action to the QPopupMenu ---
-    QPopupMenu* popup = (QPopupMenu*)w;
-    if ( index >= 0 && index < (int)popup->count() - 1 ) {
-      int id = popup->idAt( popup->count() - 1 );
-      if ( id != -1 ) {
-       QMenuItem* item = popup->findItem( id );
-       if ( item && item->isSeparator() ) {
-         popup->removeItem( id );
-         popup->insertSeparator( index );
-       }
-       else {
-         QPopupMenu* p = item ? item->popup() : 0;
-         int accel = popup->accel( id );
-         bool isOn = popup->isItemEnabled( id );
-         bool isVisible = popup->isItemVisible( id );
-         bool isChecked = popup->isItemChecked( id );
-         QString text = popup->text( id );
-         QIconSet icon;
-         if ( popup->iconSet( id ) )
-           icon = *popup->iconSet( id );
-         popup->removeItem( id );
-         int pos;
-         if ( icon.isNull() )
-           if ( p )
-             pos = popup->indexOf( popup->insertItem( text, p, id, index ) );
-           else
-             pos = popup->indexOf( popup->insertItem( text, id, index ) );
-         else
-           if ( p )
-             pos = popup->indexOf( popup->insertItem( icon, text, p, id, index ) );
-           else
-             pos = popup->indexOf( popup->insertItem( icon, text, p, id, index ) );
-         popup->setId( pos, id );
-         popup->setAccel( accel, id );
-         popup->setItemEnabled( id, isOn );
-         popup->setItemVisible( id, isVisible );
-         popup->setItemChecked( id, isChecked );
-         if ( !whatsThis().isEmpty() )
-           popup->setWhatsThis( id, whatsThis() );
-         if ( !p )
-           popup->connectItem( id, this, SLOT( internalActivation() ) );
-       }
-      }
-    }
-  }
-  else if ( w->inherits( "QMenuBar" ) ) {
-    // --- Add action to the QMenuBar ---
-    QMenuBar* mb = (QMenuBar*)w;
-    if ( index >= 0 && index < (int)mb->count() - 1 ) {
-      int id = mb->idAt( mb->count() - 1 );
-      if ( id != -1 ) {
-       QMenuItem* item = mb->findItem( id );
-       if ( item && item->isSeparator() ) {
-         mb->removeItem( id );
-         mb->insertSeparator( index );
-       }
-       else {
-         QPopupMenu* p = item ? item->popup() : 0;
-         int accel = mb->accel( id );
-         bool isOn = mb->isItemEnabled( id );
-         bool isVisible = mb->isItemVisible( id );
-         QString text = mb->text( id );
-         QIconSet icon;
-         if ( mb->iconSet( id ) )
-           icon = *mb->iconSet( id );
-         mb->removeItem( id );
-         int pos;
-         if ( icon.isNull() )
-           if ( p )
-             pos = mb->indexOf( mb->insertItem( text, p, id, index ) );
-           else
-             pos = mb->indexOf( mb->insertItem( text, id, index ) );
-         else
-           if ( p )
-             pos = mb->indexOf( mb->insertItem( icon, text, p, id, index ) );
-           else
-             pos = mb->indexOf( mb->insertItem( icon, text, p, id, index ) );
-         mb->setId( pos, id );
-         mb->setAccel( accel, id );
-         mb->setItemEnabled( id, isOn );
-         mb->setItemVisible( id, isVisible );
-         if ( !p )
-           mb->connectItem( id, this, SIGNAL( activated() ) );
-       }
-      }
-    }
-  }
-  return true;
+  \param w widget (should be menu or toolbar)
+  \sa removedFrom()
+*/
+void QtxAction::addedTo( QWidget* /*w*/ )
+{
 }
 
 /*!
-       Name: removeFrom [virtual public]
-       Desc: Removes this action from widget. Returns true if the action was removed
-                 successfully and false otherwise.
-*/
+  \brief Called when the action is removed from the widget.
+
+  This method can be redefined in the subclasses to customize
+  the action behavior. Base implementation does nothing.
 
-bool QtxAction::removeFrom( QWidget* w )
+  \param w widget (should be menu or toolbar)
+  \sa addedTo()
+*/
+void QtxAction::removedFrom( QWidget* /*w*/ )
 {
-  // check if widget is QMenuBar
-  if ( w->inherits( "QMenuBar" ) ) {
-    QMenuBar* mb = (QMenuBar*)w;
-    if ( myMenuIds.find( w ) == myMenuIds.end() )
-      return false;  // not yet added
-    mb->removeItem( myMenuIds[ w ] );
-    myMenuIds.remove( w );
-    return true;
-  }
-  return QAction::removeFrom( w );
 }
 
 /*!
-       Name: setPopup [virtual public]
-       Desc: Set or unset the sub popup menu for item with specified id in the given popup.
+  \brief Process notification events.
+  
+  Calls addedTo() method when the action is added to the widget
+  and removedFrom() when it is removed from the widget
+  in order to perform custom processing.
+
+  \param e noification event
+  \sa eventFilter(), addedTo(), removedFrom()
 */
-
-void QtxAction::setPopup( QWidget* w, const int id, QPopupMenu* subPopup ) const
+void QtxAction::customEvent( QEvent* e )
 {
-  if ( !w )
+  ActionNotify* ae = (ActionNotify*)e;
+  if ( !ae->widget() )
     return;
 
-  QMenuData* pmd = 0;
-
-  if ( w->inherits( "QPopupMenu" ) )
-    pmd = ::qt_cast<QPopupMenu*>( w );
-  else if ( w->inherits( "QMenuBar" ) )
-    pmd = ::qt_cast<QMenuBar*>( w );
-
-  if ( !pmd )
-    return;  // bad widget
-
-  QMenuData* md = 0;
-  QMenuItem* item = pmd->findItem( id, &md );
-  if ( !item || md != pmd )
-    return;  // item is not found
-
-  QPopupMenu* oldPopup = item->popup();
-  if ( oldPopup == subPopup )
-    return;  // popup is not changed
-
-  // get properties
-  int accel = pmd->accel( id );
-  bool isOn = pmd->isItemEnabled( id );
-  bool isVisible = pmd->isItemVisible( id );
-  int pos = pmd->indexOf( id );
-  QString text = pmd->text( id );
-  QIconSet icon;
-  if ( pmd->iconSet( id ) )
-    icon = *pmd->iconSet( id );
-
-  // remove previous item
-  pmd->removeItem( id );
-
-  // add new item
-  if ( w->inherits( "QPopupMenu" ) ) {
-    // --- QPopupMenu ---
-    QPopupMenu* popup = (QPopupMenu*)w;
-    if ( icon.isNull() )
-      pos = popup->indexOf( subPopup ? popup->insertItem( text, subPopup, id, pos ) :
-                                      popup->insertItem( text, id, pos ) );
-    else
-      pos = popup->indexOf( subPopup ? popup->insertItem( icon, text, subPopup, id, pos ) : 
-                                      popup->insertItem( icon, text, id, pos ) );
-  }
-  else {
-    // --- QMenuBar ---
-    QMenuBar* mb = (QMenuBar*)w;
-    if ( icon.isNull() )
-      pos = mb->indexOf( subPopup ? mb->insertItem( text, subPopup, id, pos ) : 
-                                   mb->insertItem( text, id, pos ) );
-    else
-      pos = mb->indexOf( subPopup ? mb->insertItem( icon, text, subPopup, id, pos ) : 
-                                   mb->insertItem( icon, text, id, pos ) );
-  }
-
-  // restore properties
-  pmd->setId( pos, id ); // for sure (if id < 0)
-  pmd->setAccel( accel, id );
-  pmd->setItemEnabled( id, isOn );
-  pmd->setItemVisible( id, isVisible );
-
-  // delete old popup
-  delete oldPopup;
+  if ( ae->isAdded() )
+    addedTo( ae->widget() );
+  else
+    removedFrom( ae->widget() );
 }
-
index af0473f3ff2c89c9968946bbe024106af3118f18..4e5448002f129e6352f96cb21f23aa3a00aa77ea 100755 (executable)
@@ -1,55 +1,59 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// File:      QtxAction.hxx
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxAction.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXACTION_H
 #define QTXACTION_H
 
 #include "Qtx.h"
 
-#include <qaction.h>
-#include <qmap.h>
+#include <QWidgetAction>
+
+class QIcon;
 
 #ifdef WIN32
 #pragma warning ( disable:4251 )
 #endif
 
-class QTX_EXPORT QtxAction : public QAction
+class QTX_EXPORT QtxAction : public QWidgetAction
 {
-    Q_OBJECT
+  Q_OBJECT
+
+  class ActionNotify;
 
 public:
-    QtxAction( QObject* = 0, const char* = 0, bool = false );
-    QtxAction( const QString&, const QString&, int, QObject*, const char* = 0, bool = false );
-    QtxAction( const QString&, const QIconSet&, const QString&, int, QObject*, const char* = 0, bool = false );
-    virtual ~QtxAction();
+  QtxAction( QObject* = 0, bool = false );
+  QtxAction( const QString&, const QString&, int, QObject*, bool = false );
+  QtxAction( const QString&, const QIcon&, const QString&, int, QObject*, bool = false );
+  virtual ~QtxAction();
 
-    virtual bool addTo( QWidget* );
-    virtual bool addTo( QWidget*, const int );
-    virtual bool removeFrom( QWidget* );
+  virtual bool eventFilter( QObject*, QEvent* );
 
 protected:
-    void         setPopup( QWidget*, const int, QPopupMenu* ) const;
+  virtual void addedTo( QWidget* );
+  virtual void removedFrom( QWidget* );
 
-private:
-    QMap<QWidget*,int> myMenuIds;
+  virtual void customEvent( QEvent* );
 };
 
 #ifdef WIN32
diff --git a/src/Qtx/QtxActionGroup.cxx b/src/Qtx/QtxActionGroup.cxx
new file mode 100644 (file)
index 0000000..eeea9d7
--- /dev/null
@@ -0,0 +1,364 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxActionGroup.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxActionGroup.h"
+
+#include "QtxComboBox.h"
+
+#include <QMenu>
+#include <QMenuBar>
+#include <QActionGroup>
+
+/*!
+  \class QtxActionGroup
+  \brief The QtxActionGroup class groups actions together.
+
+  QtxActionGroup class operates with a list of actions in the similar way as it does QActionGroup class.
+  But in contrast to the Qt 4's class, QtxActrionGroup behaves rather like it was in Qt series 3x.
+  For example, it automatically shows exclusive combo box widget when action group is added to the toolbar
+  and if \a usesDropDown and \a exclusive flags are both set to \c true.
+  
+  The setExclusive() function is used to ensure that only one action is active at any moment:
+  it should be used with actions which have their \a checkable state set to \c true.
+
+  Action group actions appear as individual menu options and toolbar buttons. For exclusive action
+  groups use setUsesDropDown() to display the actions in a subwidget of the toolbar or menu the action group
+  is added on.
+
+  Actions can be added to the action group using add() function. Add the action group to the menu or
+  toolbar in the same way as for single action - using addAction() method of QMenu or QToolbar class.
+*/
+
+/*!
+  \brief Constructor
+
+  The created action group is exclusive by default.
+
+  \param parent owner object
+  \sa setExclusive()
+*/
+QtxActionGroup::QtxActionGroup( QObject* parent )
+: QtxActionSet( parent ),
+  myDropDown( false )
+{
+  setMenu( new QMenu( 0 ) );
+  myActionGroup = new QActionGroup( this );
+
+  connect( myActionGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( onTriggered( QAction* ) ) );
+}
+
+/*!
+  \brief Constructor
+  \param parent owner object
+  \param exclusive if \c true only one action in the group will ever be active
+  \sa setExclusive()
+*/
+QtxActionGroup::QtxActionGroup( QObject* parent, const bool exclusive )
+: QtxActionSet( parent ),
+  myDropDown( false )
+{
+  setMenu( new QMenu( 0 ) );
+  myActionGroup = new QActionGroup( this );
+  myActionGroup->setExclusive( exclusive );
+
+  connect( myActionGroup, SIGNAL( triggered( QAction* ) ), this, SIGNAL( selected( QAction* ) ) );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxActionGroup::~QtxActionGroup()
+{
+}
+
+/*!
+  \brief Check if the action group is exclusive
+  \return \c true if the action group is exclusive and \c false otherwise
+  \sa setExclusive(), setUsesDropDown()
+*/
+bool QtxActionGroup::isExclusive() const
+{
+  return myActionGroup->isExclusive();
+}
+
+/*!
+  \brief Set/clear the action group exclusiveness
+  \param on if \c true the action group will be exclusive
+  \sa isExclusive(), setUsesDropDown()
+*/
+void QtxActionGroup::setExclusive( const bool on )
+{
+  if ( myActionGroup->isExclusive() == on )
+    return;
+
+  bool e = isEmptyAction();
+
+  myActionGroup->setExclusive( on );
+
+  if ( e != isEmptyAction() )
+    updateType();
+}
+
+/*!
+  \brief Check if action group should appear in a subwidget of parent widget
+
+  Note: for this option to take into effect, the \a exclusive flag should
+  be also set to \c true
+
+  \return \c true if the action group is shown in subwidget
+  \sa setUsesDropDown(), setExclusive()
+*/
+bool QtxActionGroup::usesDropDown() const
+{
+  return myDropDown;
+}
+
+/*!
+  \brief Defines a way how the group's actions should be displayed in parent widget 
+  action group is added to - as a group of actions or in a subwidget (e.g. in the
+  combo box).
+  \param on if \c true, action group will be shown in the subwidget
+  \sa usesDropDown(), setExclusive()
+*/
+void QtxActionGroup::setUsesDropDown( const bool on )
+{
+  if ( myDropDown == on )
+    return;
+
+  bool e = isEmptyAction();
+
+  myDropDown = on;
+
+  if ( e != isEmptyAction() )
+    updateType();
+}
+
+/*!
+  \brief Append the specified action into group.
+  \a action action to be added to the action group
+*/
+void QtxActionGroup::add( QAction* a )
+{
+  insertAction( a );
+}
+
+/*!
+  \brief Called when some subwidget item is activated by the user.
+  \param id item identifier
+*/
+void QtxActionGroup::onActivated( int id )
+{
+  const QObject* s = sender();
+
+  QAction* a = action( id );
+  if ( !a )
+    return;
+
+  if ( a->isChecked() )
+    return;
+
+  a->setChecked( true );
+  a->trigger();
+
+  QList<QWidget*> lst = createdWidgets();
+  for ( QList<QWidget*>::iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    QtxComboBox* cb = ::qobject_cast<QtxComboBox*>( *it );
+    if ( cb && cb != s )
+      cb->setCurrentId( id );
+  }
+}
+
+/*!
+  \brief Called when some action owned by this action group is activated by the user
+  \param a action being activated
+*/
+void QtxActionGroup::onTriggered( QAction* a )
+{
+  int id = actionId( a );
+  if ( id != -1 ) {
+    QList<QWidget*> lst = createdWidgets();
+    for ( QList<QWidget*>::iterator it = lst.begin(); it != lst.end(); ++it )
+    {
+      QtxComboBox* cb = ::qobject_cast<QtxComboBox*>( *it );
+      if ( cb )
+       cb->setCurrentId( id );
+    }
+  }
+  
+  emit selected( a );
+}
+
+/*!
+  \brief Update action group for the specified widget.
+  \param w a widget this action group is added to
+*/
+void QtxActionGroup::updateAction( QWidget* w )
+{
+  if ( !::qobject_cast<QMenu*>( w ) && !::qobject_cast<QMenuBar*>( w ) ) {
+    QtxComboBox* cb = createdWidget( w );
+    if ( !cb )
+      QtxActionSet::updateAction( w );
+    else
+    {
+      updateAction( cb );
+      
+      QList<QAction*> lst = actions();
+      for ( QList<QAction*>::iterator it = lst.begin(); it != lst.end(); ++it )
+       w->removeAction( *it );
+    }
+  }
+  else
+  {
+    if ( !usesDropDown() ) {
+      QtxActionSet::updateAction( w );
+    }
+    else {
+      QList<QAction*> lst = actions();
+      for ( QList<QAction*>::iterator it = lst.begin(); it != lst.end(); ++it )
+       w->removeAction( *it );
+    }
+  }
+}
+
+/*!
+  \brief Update action group for the specified combo box.
+  \param cb a combo box this action group is added to
+*/
+void QtxActionGroup::updateAction( QtxComboBox* cb )
+{
+  if ( !cb )
+    return;
+
+  cb->clear();
+  cb->setCleared( false );
+
+  QAction* cur = 0;
+  QList<QAction*> lst = actions();
+  for ( QList<QAction*>::iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    QAction* a = *it;
+    cb->addItem( a->icon(), a->text() );
+    cb->setId( cb->count() - 1, actionId( a ) );
+    if ( a->isChecked() )
+      cur = a;
+  }
+
+  if ( cur )
+    cb->setCurrentId( actionId( cur ) );
+  else
+    cb->setCleared( true );
+}
+
+/*!
+  \brief Create widget representing action group in the widget
+  this action group is added to.
+  \param p widget this action group is being added to
+  \return new widget representing this action group
+*/
+QWidget* QtxActionGroup::createWidget( QWidget* p )
+{
+  if ( ::qobject_cast<QMenu*>( p ) || ::qobject_cast<QMenuBar*>( p ) )
+    return 0;
+
+  QtxComboBox* cb = !isEmptyAction() ? new QtxComboBox( p ) : 0;
+  if ( cb )
+    connect( cb, SIGNAL( activatedId( int ) ), this, SLOT( onActivated( int ) ) );
+  return cb;
+}
+
+/*!
+  \brief Check if the action itself should be invisible
+  (only child action are shown)
+  \return \c true if the action itself should be visible
+*/
+bool QtxActionGroup::isEmptyAction() const
+{
+  return !isExclusive() || !usesDropDown();
+}
+
+/*!
+  \brief Called when action is added to the action group
+  \param a action being added to the action group
+*/
+void QtxActionGroup::actionAdded( QAction* a )
+{
+  myActionGroup->addAction( a );
+  if ( menu() )
+    menu()->addAction( a );
+}
+
+/*!
+  \brief Called when action is removed from the action group
+  \param a action being removed from the action group
+*/
+void QtxActionGroup::actionRemoved( QAction* a )
+{
+  myActionGroup->removeAction( a );
+  if ( menu() )
+    menu()->removeAction( a );
+}
+
+/*!
+  \brief Internal update
+*/
+void QtxActionGroup::updateType()
+{
+  QList<QWidget*> lst = associatedWidgets();
+  for ( QList<QWidget*>::iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    QWidget* w = *it;
+    QList<QAction*> lst = w->actions();
+
+    int i = lst.indexOf( this );
+    w->removeAction( this );
+
+    lst = w->actions();
+    w->insertAction( i < lst.count() ? lst.at( i ) : 0, this );
+  }
+  setVisible( !isEmptyAction() );
+}
+
+/*!
+  \brief Get combo box created by this action group for the specified widget.
+  \param p widget this action group is added to
+  \return combo box if it was created for the specified widget or 0 otherwise
+*/
+QtxComboBox* QtxActionGroup::createdWidget( QWidget* p )
+{
+  QtxComboBox* cb = 0;
+  QList<QWidget*> lst = createdWidgets();
+  for ( QList<QWidget*>::iterator it = lst.begin(); it != lst.end() && !cb; ++it )
+  {
+    if ( (*it)->parent() == p )
+      cb = ::qobject_cast<QtxComboBox*>( *it );
+  }
+  return cb;
+}
+
+/*!
+  \fn void QtxActionGroup::selected( QAction* a );
+  \brief Emitted when some child action is toggled by the user.
+  \param a action being toggled
+*/
diff --git a/src/Qtx/QtxActionGroup.h b/src/Qtx/QtxActionGroup.h
new file mode 100644 (file)
index 0000000..45a8067
--- /dev/null
@@ -0,0 +1,85 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxActionGroup.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXACTIONGROUP_H
+#define QTXACTIONGROUP_H
+
+#include "QtxActionSet.h"
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+class QtxComboBox;
+class QActionGroup;
+
+class QTX_EXPORT QtxActionGroup : public QtxActionSet
+{
+  Q_OBJECT
+
+public:
+  QtxActionGroup( QObject* = 0 );
+  QtxActionGroup( QObject*, const bool );
+  virtual ~QtxActionGroup();
+
+  bool             isExclusive() const;
+  bool             usesDropDown() const;
+
+  void             add( QAction* );
+
+public slots:
+  void             setExclusive( const bool );
+  void             setUsesDropDown( const bool );
+
+signals:
+  void             selected( QAction* );
+
+private slots:
+  void             onActivated( int );
+  void             onTriggered( QAction* );
+
+protected:
+  virtual void     updateAction( QWidget* );
+  virtual void     updateAction( QtxComboBox* );
+
+  virtual QWidget* createWidget( QWidget* );
+
+  virtual bool     isEmptyAction() const;
+  virtual void     actionAdded( QAction* );
+  virtual void     actionRemoved( QAction* );
+
+private:
+  void             updateType();
+  QtxComboBox*     createdWidget( QWidget* );
+
+private:
+  bool             myDropDown;
+  QActionGroup*    myActionGroup;
+};
+
+#ifdef WIN32
+#pragma warning( default:4251 )
+#endif
+
+#endif
index 94f7050a0e2ef678e7bd1175f3ce84d659f52737..8e29512927efab055ea5c0f6d8e709bdc0b02ee7 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxActionMenuMgr.cxx
-// Author:    Alexander SOLOVYEV, Sergey TELKOV
-
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
+//
 #include "QtxActionMenuMgr.h"
 
 #include "QtxAction.h"
 
-#include <qwidget.h>
-#include <qmenubar.h>
-#include <qpopupmenu.h>
-#include <qwidgetlist.h>
-#include <qobjectlist.h>
-#include <qmainwindow.h>
-#include <qfile.h>
-#include <qdom.h>
-#include <qvaluelist.h>
-
-// VSR: Uncomment this #define in order to allow dynamic menus support
-// (emit signals when popup menu is pre-activated)
-// Currently this support is disabled.
-//#define ENABLE_DYNAMIC_MENU
-/*!
-       Service functions
-       Level: Internal
-*/
-namespace {
-  QValueList<int> prepareIds( const QWidget* w )
-  {
-    QValueList<int> l;
-    const QMenuData* md = 0;
-    if ( w->inherits( "QMenuBar" ) )
-      md = ::qt_cast<QMenuBar*>( w );
-    else if ( w->inherits( "QPopupMenu" ) )
-      md = ::qt_cast<QPopupMenu*>( w );
-    if ( md ) {
-      for ( uint i = 0; i < md->count(); i++ )
-             l.append( md->idAt( i ) );
-    }
-    return l;
-  }
-
-  int getNewId( const QWidget* w, const QValueList<int>& l, bool retId = true )
-  {
-    const QMenuData* md = 0;
-    if ( w->inherits( "QMenuBar" ) )
-      md = ::qt_cast<QMenuBar*>( w );
-    else if ( w->inherits( "QPopupMenu" ) )
-      md = ::qt_cast<QPopupMenu*>( w );
-    if ( md )
-    {
-      for ( uint i = 0, j = 0; i < md->count() && j < l.count(); i++, j++ )
-             if ( md->idAt( i ) != l[ j ] )
-          return retId ? md->idAt( i ) : i;
-      if ( md->count() > l.count() )
-        return retId ? md->idAt( md->count()-1 ) : md->count() - 1;
-    }
-    return -1;
-  }
-
-  void dumpMenu( QWidget* w, bool before )
-  {
-    if ( !w )
-      return;
-
-    QMenuData* md = 0;
-    if ( w->inherits( "QMenuBar" ) )
-      md = ::qt_cast<QMenuBar*>( w );
-    else if ( w->inherits( "QPopupMenu" ) )
-      md = ::qt_cast<QPopupMenu*>( w );
-
-    if ( !md )
-      return;
-
-    printf( ">>> start dump menu (%s) >>>\n", before ? "before" : "after" );
-    for ( uint i = 0; i < md->count(); i++ )
-      printf( "%d: %d: %s\n", i, md->idAt( i ), md->text( md->idAt( i ) ).latin1() );
-    printf( "<<< end dump menu (%s) <<<\n", before ? "before" : "after" );
-  }
-};
+#include <QMenu>
+#include <QMenuBar>
+#include <QWidget>
+#include <QMainWindow>
 
 /*!
-       Class: QtxActionMenuMgr::MenuAction
-       Level: Internal
+  \class QtxActionMenuMgr::MenuNode
+  \brief Represents a menu item inside main menu structure.
+  \internal
 */
 
-class QtxActionMenuMgr::MenuAction : public QtxAction
+class QtxActionMenuMgr::MenuNode
 {
 public:
-  MenuAction( const QString&, const QString&, QObject*, const int = -1, const bool = false );
-  virtual ~MenuAction();
-
-  virtual bool addTo( QWidget* );
-
-  virtual bool removeFrom( QWidget* );
-
-  QPopupMenu*  popup() const;
-
-private:
-  int                myId;
-  QPopupMenu*        myPopup;
-  bool               myEmptyEnabled;
-  QMap<QWidget*,int> myIds;
+  MenuNode();
+  MenuNode( MenuNode*, const int, const int, const int );
+  ~MenuNode();
+  
+  MenuNode* parent;       //!< parent menu node
+  int       id;           //!< menu nodeID
+  int       idx;          //!< menu node index 
+  int       group;        //!< menu group ID
+  bool      visible;      //!< visibility status
+  int       emptyEnabled; //!< enable empty menu flag
+  NodeList  children;     //!< children menu nodes list
 };
 
-
 /*!
-  Constructor for menu action
-  \param text - description text
-  \param menutext - menu text
-  \param parent - parent object
-  \param id - integer identificator of action
-  \param allowEmpty - if it is true, it makes possible to add this action with empty popup to menu
+  \brief Default constructor.
+  \internal
 */
-
-QtxActionMenuMgr::MenuAction::MenuAction( const QString& text,
-                                         const QString& menuText,
-                                         QObject*       parent,
-                                         const int      id,
-                                         const bool     allowEmpty )
-: QtxAction( text, menuText, 0, parent ),
-  myId( id ),
-  myPopup( 0 ),
-  myEmptyEnabled( allowEmpty )
+QtxActionMenuMgr::MenuNode::MenuNode()
+  : parent( 0 ), id( -1 ), idx( -1 ), group( -1 ), visible( true ), emptyEnabled( 0 )
 {
-  myPopup = new QPopupMenu();
 }
 
 /*!
-  Destructor: deletes internal popup
+  \brief Constructor.
+  \internal
+  \param p parent menu node
+  \param _id menu node ID
+  \param _idx menu node index
+  \param _group menu node group ID
 */
-QtxActionMenuMgr::MenuAction::~MenuAction()
+QtxActionMenuMgr::MenuNode::MenuNode( MenuNode* p,
+                                     const int _id,
+                                     const int _idx,
+                                     const int _group )
+: parent( p ), id( _id ), idx( _idx ), group( _group ), visible( true ), emptyEnabled( 0 )
 {
-  delete myPopup;
+  if ( p )
+    p->children.append( this );
 }
 
 /*!
-  Adds action to widget, for example, to popup menu or menu bar
+  \brief Destructor.
+  \internal
 */
-bool QtxActionMenuMgr::MenuAction::addTo( QWidget* w )
+QtxActionMenuMgr::MenuNode::~MenuNode()
 {
-  if ( !w ) 
-    return false;  // bad widget
-
-  if ( !w->inherits( "QPopupMenu" ) && !w->inherits( "QMenuBar" ) )
-    return false;  // not allowed widget type
-
-  if ( myIds.find( w ) != myIds.end() )
-    return false;  // already added
-
-  if ( !myPopup )
-    return false;  // bad own popup menu
-
-  if ( !myEmptyEnabled && !myPopup->count() )
-    return false;  // not allowed empty menu
-
-  if ( w->inherits( "QPopupMenu" )  ) {
-    QValueList<int> l = prepareIds( w );
-    int idx;
-    if ( QtxAction::addTo( w ) && ( idx = getNewId( w, l, false ) ) != -1 ) {
-      QPopupMenu* pm = (QPopupMenu*)w;
-      myIds[ w ] = pm->idAt( idx );
-      if ( myId != -1 ) 
-       pm->setId( idx, myId );
-      setPopup( pm, myId != -1 ? myId : myIds[ w ], myPopup );
-    }
-  }
-  else if ( w->inherits( "QMenuBar" ) ) {
-    QValueList<int> l = prepareIds( w );
-    int idx;
-    if ( QtxAction::addTo( w ) && ( idx = getNewId( w, l, false ) ) != -1 ) {
-      QMenuBar* mb = (QMenuBar*)w;
-      myIds[ w ] = mb->idAt( idx );
-      if ( myId != -1 ) 
-       mb->setId( idx, myId );
-      setPopup( mb, myId != -1 ? myId : myIds[ w ], myPopup );
-    }
-  }
-  else
-    return false;
-
-  return true;
+  for ( NodeList::iterator it = children.begin(); it != children.end(); ++it )
+    delete *it;
 }
 
 /*!
-  Removes action from widget, for example, from popup menu or menu bar
-*/
-bool QtxActionMenuMgr::MenuAction::removeFrom( QWidget* w )
-{
-  if ( !w ) 
-    return false;  // bad widget
+  \class QtxActionMenuMgr
+  \brief Main menu actions manager.
 
-  if ( !w->inherits( "QPopupMenu" ) && !w->inherits( "QMenuBar" ) )
-    return false;  // not allowed widget type
+  Menu manager allows using of set of action for automatic generating of
+  application main menu and dynamic update of its contents.
 
-  if ( myIds.find( w ) == myIds.end() )
-    return false;  // not yet added
+  Use insert(), append() and remove() methods to create main menu.
+  Methods show(), hide() allow displaying/erasing of specified menu items.
 
-  if ( w->inherits( "QPopupMenu" ) ) {
-    if ( myId != -1 ) {
-      QPopupMenu* pm = (QPopupMenu*)w;
-      int idx = pm->indexOf( myId );
-      if ( idx != -1 ) pm->setId( idx, myIds[ w ] );
-    }
-    myIds.remove( w );
-    return QtxAction::removeFrom( w );;
-  }
-  else if ( w->inherits( "QMenuBar" ) )
-  {
-    if ( myId != -1 ) {
-      QMenuBar* mb = (QMenuBar*)w;
-      int idx = mb->indexOf( myId );
-      if ( idx != -1 ) mb->setId( idx, myIds[ w ] );
-    }
-    myIds.remove( w );
-    return QtxAction::removeFrom( w );
-  }
-  return false;
-}
+  Actions can be grouped with help of group identificator. Inside the popup
+  or main menu bar menu items are ordered by the group identifier (ascending).
 
-/*!
-  \return internal popup of action
+  Menu manager automatically optimizes the menu by removing extra separators,
+  hiding empty popup menus etc.
 */
-QPopupMenu* QtxActionMenuMgr::MenuAction::popup() const
-{
-  return myPopup;
-}
 
 /*!
-       Class: QtxActionMenuMgr
-       Level: Public
+  \brief Constructor.
+  \param p parent main window
 */
 QtxActionMenuMgr::QtxActionMenuMgr( QMainWindow* p )
-: QtxActionMgr( p ),
+: QtxActionMgr( p ), 
+  myRoot( new MenuNode() ),
   myMenu( p ? p->menuBar() : 0 )
 {
-  myRoot.id = -1;
-  myRoot.group = -1;
-
   if ( myMenu ) {
     connect( myMenu, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
-#ifdef ENABLE_DYNAMIC_MENU
-    if ( myMenu->inherits( "QMenuBar" ) )
-      connect( myMenu, SIGNAL( highlighted( int ) ), this, SLOT( onHighlighted( int ) ) );
-#endif
   }
 }
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param mw menu widget
+  \param p parent object
 */
 QtxActionMenuMgr::QtxActionMenuMgr( QWidget* mw, QObject* p )
-: QtxActionMgr( p ),
+: QtxActionMgr( p ), 
+  myRoot( new MenuNode() ),
   myMenu( mw )
 {
-  myRoot.id = -1;
-  myRoot.group = -1;
-
-  if ( myMenu )
+  if ( myMenu ) {
     connect( myMenu, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+  }
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxActionMenuMgr::~QtxActionMenuMgr()
 {
-  for ( NodeListIterator it( myRoot.children ); it.current() && myMenu; ++it )
+  for ( MenuMap::Iterator itr = myMenus.begin(); itr != myMenus.end(); ++itr )
   {
-    QAction* a = itemAction( it.current()->id );
-    if ( !a )
-      a = menuAction( it.current()->id );
-
-    if ( a )
-      a->removeFrom( myMenu );
+    QPointer<QAction> a = itr.value();
+    delete a->menu();
+    delete a;
   }
 
-  for ( MenuMap::Iterator itr = myMenus.begin(); itr != myMenus.end(); ++itr )
-    delete itr.data();
+  delete myRoot;
 }
 
 /*!
-  \return whether menu item corresponding to action is visible
-  \param actId - identificator of action
-  \param place - identificator of some parent action
+  \brief Check if an action with \a actId identifier is visible to
+  the parent action with \a place identifier.
+  \param actId action ID
+  \param place some parent action ID
+  \return \c true if an action is visible to the parent
+  \sa setVisible()
 */
 bool QtxActionMenuMgr::isVisible( const int actId, const int place ) const
 {
@@ -309,10 +166,11 @@ bool QtxActionMenuMgr::isVisible( const int actId, const int place ) const
 }
 
 /*!
-  Sets visible state of action
-  \param actId - identificator of action
-  \param place - identificator of some parent action
-  \param v - visibility state
+  \brief Set action's visibility flag.
+  \param actId action ID
+  \param place some parent action ID
+  \param v new visibility state
+  \sa isVisible()
 */
 void QtxActionMenuMgr::setVisible( const int actId, const int place, const bool v )
 {
@@ -322,38 +180,57 @@ void QtxActionMenuMgr::setVisible( const int actId, const int place, const bool
 }
 
 /*!
-  Insert action as children menu item 
-  \param id - identificator of action
-  \param menus - few names of parent menu items, separated by '|'. It means sequence of menu items,
-  for example "File|Edit" means File->Edit submenu. If submenu doesn't exist, it will be created.
-  \param group - group identificator
-  \param idx - index inside Qt menu
+  \brief Insert action to the menu.
+
+  Insert an action to the named menu. The \a menus parameter represents 
+  the menu name: it can be a sequence of strings, separated by '|' symbol.
+  For example, "File|Edit" means \c File->Edit submenu.
+  If submenu doesn't exist, it will be created.
+
+  \param id action ID
+  \param menus menu name
+  \param group group ID
+  \param idx menu index inside the menu group
+  \return action ID
 */
 int QtxActionMenuMgr::insert( const int id, const QString& menus, const int group, const int idx )
 {
-  return insert( id, QStringList::split( "|", menus ), group, idx );
+  return insert( id, menus.split( "|", QString::SkipEmptyParts ), group, idx );
 }
 
 /*!
-  Insert action as children menu item 
-  \param a - action
-  \param menus - few names of parent menu items, separated by '|'. It means sequence of menu items,
-  for example "File|Edit" means File->Edit submenu. If submenu doesn't exist, it will be created.
-  \param group - group identificator
-  \param idx - index inside Qt menu
+  \brief Insert action to the menu.
+
+  Insert an action to the named menu. The \a menus parameter represents 
+  the menu name: it can be a sequence of strings, separated by '|' symbol.
+  For example, "File|Edit" means \c File->Edit submenu.
+  If submenu doesn't exist, it will be created.
+
+  \param a action
+  \param menus menu name
+  \param group group ID
+  \param idx menu index inside the menu group
+  \return action ID
 */
 int QtxActionMenuMgr::insert( QAction* a, const QString& menus, const int group, const int idx )
 {
-  return insert( a, QStringList::split( "|", menus ), group, idx );
+  return insert( a, menus.split( "|", QString::SkipEmptyParts ), group, idx );
 }
 
 /*!
-  Insert action as children menu item 
-  \param id - identificator of action
-  \param menus - list of names of parent menu items, separated by |. It means sequence of menu items,
-  for example "File|Edit" means File->Edit submenu. If submenu doesn't exist, it will be created.
-  \param group - group identificator
-  \param idx - index inside Qt menu
+  \brief Insert action to the menu.
+
+  Insert an action to the named menu. The \a menus parameter represents 
+  the menu names list.
+  For example, string list consisting from two items "File" and "Edit"
+  means \c File->Edit submenu.
+  If submenu doesn't exist, it will be created.
+
+  \param id action ID
+  \param menus menu names list
+  \param group group ID
+  \param idx menu index inside the menu group
+  \return action ID
 */
 int QtxActionMenuMgr::insert( const int id, const QStringList& menus, const int group, const int idx )
 {
@@ -365,12 +242,19 @@ int QtxActionMenuMgr::insert( const int id, const QStringList& menus, const int
 }
 
 /*!
-  Insert action as children menu item 
-  \param a - action
-  \param menus - list of names of parent menu items. It means sequence of menu items,
-  for example "File|Edit" means File->Edit submenu. If submenu doesn't exist, it will be created.
-  \param group - group identificator
-  \param idx - index inside Qt menu
+  \brief Insert action to the menu.
+
+  Insert an action to the named menu. The \a menus parameter represents 
+  the menu names list.
+  For example, string list consisting from two items "File" and "Edit"
+  means \c File->Edit submenu.
+  If submenu doesn't exist, it will be created.
+
+  \param a action
+  \param menus menu names list
+  \param group group ID
+  \param idx menu index inside the menu group
+  \return action ID
 */
 int QtxActionMenuMgr::insert( QAction* a, const QStringList& menus, const int group, const int idx )
 {
@@ -382,39 +266,36 @@ int QtxActionMenuMgr::insert( QAction* a, const QStringList& menus, const int gr
 }
 
 /*!
-  Insert action as children menu item 
-  \param id - identificator of action
-  \param pId - identificator of action corresponding to parent menu item
-  \param group - group identificator
-  \param idx - index inside Qt menu
+  \brief Insert action to the menu.
+  \param id action ID
+  \param pId parent menu action ID
+  \param group group ID
+  \param idx menu index inside the menu group
+  \return action ID
 */
 int QtxActionMenuMgr::insert( const int id, const int pId, const int group, const int idx )
 {
   if ( id == -1 )
     return -1;
 
-  MenuNode* pNode = pId == -1 ? &myRoot : find( pId );
+  MenuNode* pNode = pId == -1 ? myRoot : find( pId );
   if ( !pNode )
     return -1;
 
-  MenuNode* node = new MenuNode( pNode );
-  node->id = id;
-  node->idx = idx;
-  node->group = group;
-
-  pNode->children.append( node );
+  MenuNode* node = new MenuNode( pNode, id, idx, group );
 
-  updateMenu( pNode, false );
+  triggerUpdate( pNode->id, false );
 
   return node->id;
 }
 
 /*!
-  Insert action as children menu item 
-  \param a - action
-  \param pId - identificator of action corresponding to parent menu item
-  \param group - group identificator
-  \param idx - index inside Qt menu
+  \brief Insert action to the menu.
+  \param a action
+  \param pId parent menu action ID
+  \param group group ID
+  \param idx menu index inside the menu group
+  \return action ID
 */
 int QtxActionMenuMgr::insert( QAction* a, const int pId, const int group, const int idx )
 {
@@ -422,29 +303,28 @@ int QtxActionMenuMgr::insert( QAction* a, const int pId, const int group, const
 }
 
 /*!
-  Create and insert action as children menu item 
-  \return identificator of inserted action
-  \param title - menu text of action
-  \param pId - identificator of action corresponding to parent menu item
-  \param group - group identificator
-  \param id - identificator of new action
-  \param idx - index inside Qt menu
-  \param allowEmpty - indicates, that it is possible to add this action with empty popup menu to other menu
+  \brief Create and insert menu item action to the menu.
+  \param title menu text
+  \param pId parent menu action ID
+  \param group group ID
+  \param id action ID
+  \param idx menu index inside the menu group
+  \return action ID
 */
-int QtxActionMenuMgr::insert( const QString& title, const int pId, const int group, const int id, const int idx, const bool allowEmpty )
+int QtxActionMenuMgr::insert( const QString& title, const int pId, const int group, const int id, const int idx )
 {
-  MenuNode* pNode = pId == -1 ? &myRoot : find( pId );
+  MenuNode* pNode = pId == -1 ? myRoot : find( pId );
   if ( !pNode )
     return -1;
 
   MenuNode* eNode = id == -1 ? 0 : find( id );
 
   int fid = -1;
-  for ( NodeListIterator it( pNode->children ); it.current() && fid == -1; ++it )
+  for ( NodeList::iterator it = pNode->children.begin(); it != pNode->children.end() && fid == -1; ++it )
   {
-    if ( myMenus.contains( it.current()->id ) &&
-         clearTitle( myMenus[it.current()->id]->menuText() ) == clearTitle( title ) )
-      fid = it.current()->id;
+    if ( myMenus.contains( (*it)->id ) &&
+         clearTitle( myMenus[(*it)->id]->text() ) == clearTitle( title ) )
+      fid = (*it)->id;
   }
 
   if ( fid != -1 )
@@ -452,74 +332,81 @@ int QtxActionMenuMgr::insert( const QString& title, const int pId, const int gro
 
   int gid = (id == -1 || eNode ) ? generateId() : id;
 
-  MenuAction* ma = new MenuAction( clearTitle( title ), title, this, gid, allowEmpty );
-#ifdef ENABLE_DYNAMIC_MENU
-  connect( ma->popup(), SIGNAL( highlighted( int ) ), this, SLOT( onHighlighted( int ) ) );
-#endif
+  QMenu* menu = new QMenu( 0 );
+  QAction* ma = menu->menuAction();
+  ma->setText( title );
 
-  MenuNode* node = new MenuNode( pNode );
-  node->group = group;
-  node->idx = idx;
-  node->id = myMenus.insert( gid, ma ).key();
+  connect( ma->menu(), SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
+  connect( ma->menu(), SIGNAL( aboutToHide() ), this, SLOT( onAboutToHide() ) );
 
-  pNode->children.append( node );
+  MenuNode* node = new MenuNode( pNode, myMenus.insert( gid, ma ).key(), idx, group );
 
-  updateMenu( pNode, false );
+  triggerUpdate( pNode->id, false );
 
   return node->id;
 }
 
 /*!
-  Create and insert action as children menu item 
-  \return identificator of inserted action
-  \param title - menu text of action
-  \param menus - string list of parents' menu texts, separated by |
-  \param group - group identificator
-  \param id - identificator of new action
-  \param idx - index inside Qt menu
-  \param allowEmpty - indicates, that it is possible to add this action with empty popup menu to other menu
+  \brief Create and insert menu item action to the menu.
+
+  Insert an action to the named menu. The \a menus parameter represents 
+  the menu name: it can be a sequence of strings, separated by '|' symbol.
+  For example, "File|Edit" means \c File->Edit submenu.
+  If submenu doesn't exist, it will be created.
+
+  \param title menu text
+  \param menus menu name
+  \param group group ID
+  \param id action ID
+  \param idx menu index inside the menu group
+  \return action ID
 */
-int QtxActionMenuMgr::insert( const QString& title, const QString& menus, const int group, const int id, const int idx, const bool allowEmpty )
+int QtxActionMenuMgr::insert( const QString& title, const QString& menus, const int group, const int id, const int idx )
 {
-  return insert( title, QStringList::split( "|", menus ), group, id, idx, allowEmpty );
+  return insert( title, menus.split( "|", QString::SkipEmptyParts ), group, id, idx );
 }
 
 /*!
-  Create and insert action as children menu item 
-  \return identificator of inserted action
-  \param title - menu text of action
-  \param menus - list of parents menu items
-  \param group - group identificator
-  \param id - identificator of new action
-  \param idx - index inside Qt menu
-  \param allowEmpty - indicates, that it is possible to add this action with empty popup menu to other menu
+  \brief Create and insert menu item action to the menu.
+
+  Insert an action to the named menu. The \a menus parameter represents 
+  the menu names list.
+  For example, string list consisting from two items "File" and "Edit"
+  means \c File->Edit submenu.
+  If submenu doesn't exist, it will be created.
+
+  \param title menu text
+  \param menus menu names list
+  \param group group ID
+  \param id action ID
+  \param idx menu index inside the menu group
+  \return action ID
 */
-int QtxActionMenuMgr::insert( const QString& title, const QStringList& menus, const int group, const int id, const int idx, const bool allowEmpty )
+int QtxActionMenuMgr::insert( const QString& title, const QStringList& menus, const int group, const int id, const int idx )
 {
   int pId = createMenu( menus, -1 );
-  return insert( title, pId, group, id, idx, allowEmpty );
+  return insert( title, pId, group, id, idx );
 }
 
 /*!
-  Create and append action as last children
-  \return identificator of inserted action
-  \param title - menu text of action
-  \param pId - id of action corresponding to parent menu item
-  \param group - group identificator
-  \param id - identificator of new action
-  \param allowEmpty - indicates, that it is possible to add this action with empty popup menu to other menu
+  \brief Create and add menu item action to the end of menu.
+  \param title menu text
+  \param pId parent menu action ID
+  \param group group ID
+  \param id action ID
+  \return action ID
 */
-int QtxActionMenuMgr::append( const QString& title, const int pId, const int group, const int id, const bool allowEmpty )
+int QtxActionMenuMgr::append( const QString& title, const int pId, const int group, const int id )
 {
-  return insert( title, pId, group, id, allowEmpty );
+  return insert( title, pId, group, id );
 }
 
 /*!
-  Create and append action as last children
-  \return identificator of inserted action
-  \param id - identificator of existing action
-  \param pId - id of action corresponding to parent menu item
-  \param group - group identificator
+  \brief Create and add menu item action to the end of menu.
+  \param id action ID
+  \param pId parent menu action ID
+  \param group group ID
+  \return action ID
 */
 int QtxActionMenuMgr::append( const int id, const int pId, const int group )
 {
@@ -527,11 +414,11 @@ int QtxActionMenuMgr::append( const int id, const int pId, const int group )
 }
 
 /*!
-  Create and append action as last children
-  \return identificator of inserted action
-  \param a - action
-  \param pId - id of action corresponding to parent menu item
-  \param group - group identificator
+  \brief Create and add menu item action to the end of menu.
+  \param a action
+  \param pId parent menu action ID
+  \param group group ID
+  \return action ID
 */
 int QtxActionMenuMgr::append( QAction* a, const int pId, const int group )
 {
@@ -539,25 +426,24 @@ int QtxActionMenuMgr::append( QAction* a, const int pId, const int group )
 }
 
 /*!
-  Create and insert action as first children
-  \return identificator of inserted action
-  \param title - menu text of action
-  \param pId - id of action corresponding to parent menu item
-  \param group - group identificator
-  \param id - identificator of new action
-  \param allowEmpty - indicates, that it is possible to add this action with empty popup menu to other menu
+  \brief Create and add menu item action to the beginning of menu.
+  \param title menu text
+  \param pId parent menu action ID
+  \param group group ID
+  \param id action ID
+  \return action ID
 */
-int QtxActionMenuMgr::prepend( const QString& title, const int pId, const int group, const int id, const bool allowEmpty )
+int QtxActionMenuMgr::prepend( const QString& title, const int pId, const int group, const int id )
 {
-  return insert( title, pId, group, id, 0, allowEmpty );
+  return insert( title, pId, group, id, 0 );
 }
 
 /*!
-  Create and insert action as last children
-  \return identificator of inserted action
-  \param id - identificator of existing action
-  \param pId - id of action corresponding to parent menu item
-  \param group - group identificator
+  \brief Create and add menu item action to the beginning of menu.
+  \param id action ID
+  \param pId parent menu action ID
+  \param group group ID
+  \return action ID
 */
 int QtxActionMenuMgr::prepend( const int id, const int pId, const int group )
 {
@@ -565,11 +451,11 @@ int QtxActionMenuMgr::prepend( const int id, const int pId, const int group )
 }
 
 /*!
-  Create and insert action as last children
-  \return identificator of inserted action
-  \param a - action
-  \param pId - id of action corresponding to parent menu item
-  \param group - group identificator
+  \brief Create and add menu item action to the beginning of menu.
+  \param a action
+  \param pId parent menu action ID
+  \param group group ID
+  \return action ID
 */
 int QtxActionMenuMgr::prepend( QAction* a, const int pId, const int group )
 {
@@ -577,8 +463,8 @@ int QtxActionMenuMgr::prepend( QAction* a, const int pId, const int group )
 }
 
 /*!
-  Removes menu item corresponding to action
-  \param id - identificator of action
+  \brief Remove menu item with given \a id.
+  \param id menu action ID
 */
 void QtxActionMenuMgr::remove( const int id )
 {
@@ -587,33 +473,34 @@ void QtxActionMenuMgr::remove( const int id )
 }
 
 /*!
-  Removes menu item
-  \param id - identificator of action
-  \param pId - identificator of action corresponding to parent menu item
-  \param group - group identificator
+  \brief Remove menu item with given \a id.
+  \param id menu action ID
+  \param pId parent menu action ID
+  \param group group ID
 */
 void QtxActionMenuMgr::remove( const int id, const int pId, const int group )
 {
-  MenuNode* pNode = pId == -1 ? &myRoot : find( pId );
+  MenuNode* pNode = pId == -1 ? myRoot : find( pId );
   if ( !pNode )
     return;
 
   NodeList delNodes;
-  for ( NodeListIterator it( pNode->children ); it.current(); ++it )
+  for ( NodeList::iterator it = pNode->children.begin(); it != pNode->children.end(); ++it )
   {
-    if ( it.current()->id == id && ( it.current()->group == group || group == -1 ) )
-      delNodes.append( it.current() );
+    if ( (*it)->id == id && ( (*it)->group == group || group == -1 ) )
+      delNodes.append( *it );
   }
 
-  for ( NodeListIterator itr( delNodes ); itr.current(); ++itr )
-    pNode->children.remove( itr.current() );
+  for ( NodeList::iterator itr = delNodes.begin(); itr != delNodes.end(); ++itr )
+    pNode->children.removeAll( *itr );
 
-  updateMenu( pNode, false );
+  triggerUpdate( pNode->id, false );
 }
 
 /*!
-  Shows menu item corresponding to action
-  \param id - identificator of action
+  \brief Show menu item with given \a id.
+  \param id menu action ID
+  \sa hide()
 */
 void QtxActionMenuMgr::show( const int id )
 {
@@ -621,8 +508,9 @@ void QtxActionMenuMgr::show( const int id )
 }
 
 /*!
-  Hides menu item corresponding to action
-  \param id - identificator of action
+  \brief Hide menu item with given \a id.
+  \param id menu action ID
+  \sa show()
 */
 void QtxActionMenuMgr::hide( const int id )
 {
@@ -630,8 +518,10 @@ void QtxActionMenuMgr::hide( const int id )
 }
 
 /*!
-  \return shown status of menu item corresponding to action
-  \param id - identificator of action
+  \brief Get visibility status for menu item with given \a id.
+  \param id menu action ID
+  \return \c true if an item is shown
+  \sa setShown()
 */
 bool QtxActionMenuMgr::isShown( const int id ) const
 {
@@ -643,31 +533,68 @@ bool QtxActionMenuMgr::isShown( const int id ) const
 }
 
 /*!
-  Sets shown status of menu item corresponding to action
-  \param id - identificator of action
-  \param on - new shown status
+  \brief Set visibility status for menu item with given \a id.
+  \param id menu action ID
+  \param on new visibility status
+  \sa isShown()
 */
 void QtxActionMenuMgr::setShown( const int id, const bool on )
 {
   NodeList aNodes;
   find( id, aNodes );
 
-  QMap<MenuNode*, int> updMap;
-  for ( NodeListIterator it( aNodes ); it.current(); ++it )
+  for ( NodeList::iterator it = aNodes.begin(); it != aNodes.end(); ++it )
   {
-    if ( it.current()->visible != on )
+    if ( (*it)->visible != on )
     {
-      it.current()->visible = on;
-      updMap.insert( it.current()->parent, 0 );
+      (*it)->visible = on;
+      triggerUpdate( (*it)->parent ? (*it)->parent->id : myRoot->id, false );
     }
   }
+}
 
-  for ( QMap<MenuNode*, int>::ConstIterator itr = updMap.begin(); itr != updMap.end(); ++itr )
-    updateMenu( itr.key(), false );
+/*!
+  \brief Change menu title for the action with given \a id.
+  \param id menu action ID
+  \param title new menu title
+*/
+void QtxActionMenuMgr::change( const int id, const QString& title )
+{
+  QAction* a = menuAction( id );
+  if ( a )
+    a->setText( title );
 }
 
 /*!
-  SLOT: called when corresponding menu is destroyed, clears internal pointer to menu
+  \brief Called when the submenu is about to show.
+  
+  Emits the signal menuAboutToShow(QMenu*).
+*/
+void QtxActionMenuMgr::onAboutToShow()
+{
+  QMenu* m = ::qobject_cast<QMenu*>( sender() );
+  if ( m )
+    emit menuAboutToShow( m );
+}
+
+/*!
+  \brief Called when the submenu is about to hide.
+  
+  Emits the signal menuAboutToHide(QMenu*).
+*/
+void QtxActionMenuMgr::onAboutToHide()
+{
+  QMenu* m = ::qobject_cast<QMenu*>( sender() );
+  if ( m )
+    emit menuAboutToHide( m );
+}
+
+/*!
+  \brief Called when the corresponding menu object is destroyed.
+
+  Clears internal pointer to menu to disable crashes.
+  
+  \param obj (menu) object being destroyed
 */
 void QtxActionMenuMgr::onDestroyed( QObject* obj )
 {
@@ -675,38 +602,33 @@ void QtxActionMenuMgr::onDestroyed( QObject* obj )
     myMenu = 0;
 }
 
+
 /*!
-  SLOT: called when menu item is highlighted
+  \fn void QtxActionMenuMgr::menuAboutToShow( QMenu* m )
+  \brief Emitted when the menu is about to be shown.
+  \param m menu being shown
 */
-void QtxActionMenuMgr::onHighlighted( int id )
+
+/*!
+  \fn void QtxActionMenuMgr::menuAboutToHide( QMenu* m )
+  \brief Emitted when the menu is about to be hidden.
+  \param m menu being hidden
+*/
+
+/*!
+  \brief Get the menu widget.
+  \return menu widget (QMenuBar)
+*/
+QWidget* QtxActionMenuMgr::menuWidget() const
 {
-  const QObject* snd = sender();
-  int pid = 0, realId;
-  if ( myMenu && snd == myMenu )
-    pid = -1;
-  else {
-    for ( MenuMap::Iterator itr = myMenus.begin(); itr != myMenus.end(); ++itr ) {
-      if ( itr.data()->popup() && itr.data()->popup() == snd )
-       pid = itr.key();
-    }
-  }
-  if ( pid ) {
-    realId = findId( id, pid );
-    if ( realId != -1 ) {
-      bool updatesEnabled = isUpdatesEnabled();
-      setUpdatesEnabled( false );
-      emit menuHighlighted( pid, realId );
-      setUpdatesEnabled( updatesEnabled );
-      updateMenu( find( realId ) );
-    }
-  }
+  return myMenu;
 }
 
 /*!
-  Assignes new menu with manager
-  \param mw - new menu
+  \brief Assign new menu widget to the menu manager.
+  \param mw new menu widget
 */
-void QtxActionMenuMgr::setWidget( QWidget* mw )
+void QtxActionMenuMgr::setMenuWidget( QWidget* mw )
 {
   if ( myMenu == mw )
     return;
@@ -718,65 +640,70 @@ void QtxActionMenuMgr::setWidget( QWidget* mw )
 
   if ( myMenu )
     connect( myMenu, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+
+  triggerUpdate( -1, true );
 }
 
 /*!
-  \return menu node by it's place description
-  \param actId - identificator of action
-  \param pId - identificator of action corresponding to start menu item
-  \param rec - recursive search
+  \brief Search menu node.
+  \param id menu action ID
+  \param pId parent menu item ID
+  \param rec if \c true perform recursive search
+  \return menu node or 0 if it is not found
 */
-QtxActionMenuMgr::MenuNode* QtxActionMenuMgr::find( const int actId, const int pId, const bool rec ) const
+QtxActionMenuMgr::MenuNode* QtxActionMenuMgr::find( const int id, const int pId, const bool rec ) const
 {
-  return find( actId, find( pId ), rec );
+  return find( id, find( pId ), rec );
 }
 
 /*!
-  \return menu node by it's place description
-  \param actId - identificator of action
-  \param startNode - start menu item
-  \param rec - recursive search
+  \brief Search menu node.
+  \param id menu action ID
+  \param startNode start menu node (if 0, search from root node)
+  \param rec if \c true perform recursive search
+  \return menu node or 0 if it is not found
 */
 QtxActionMenuMgr::MenuNode* QtxActionMenuMgr::find( const int id, MenuNode* startNode, const bool rec ) const
 {
   MenuNode* node = 0;
-  MenuNode* start = startNode ? startNode : (MenuNode*)&myRoot;
-  for ( NodeListIterator it( start->children ); it.current() && !node; ++it )
+  MenuNode* start = startNode ? startNode : myRoot;
+  for ( NodeList::iterator it = start->children.begin(); it != start->children.end() && !node; ++it )
   {
-    if ( it.current()->id == id )
-      node = it.current();
+    if ( (*it)->id == id )
+      node = *it;
     else if ( rec )
-      node = find( id, it.current(), rec );
+      node = find( id, *it, rec );
   }
   return node;
 }
 
 /*!
-  Finds menu node
-  \return true if at least one node is found
-  \param id - identificator of action
-  \param lst - list to be filled with found nodes
-  \param startNode - start menu item
+  \brief Search recursively all menu nodes with given \a id.
+  \param id menu action ID
+  \param NodeList resulting list of menu nodes
+  \param startNode start menu node (if 0, search from root node)
+  \return \c true if at least one node is found
 */
 bool QtxActionMenuMgr::find( const int id, NodeList& lst, MenuNode* startNode ) const
 {
-  MenuNode* start = startNode ? startNode : (MenuNode*)&myRoot;
-  for ( NodeListIterator it( start->children ); it.current(); ++it )
+  MenuNode* start = startNode ? startNode : myRoot;
+  for ( NodeList::iterator it = start->children.begin(); it != start->children.end(); ++it )
   {
-    if ( it.current()->id == id )
-      lst.prepend( it.current() );
+    MenuNode* node = *it;
+    if ( node->id == id )
+      lst.prepend( node );
 
-    find( id, lst, it.current() );
+    find( id, lst, node );
   }
   return !lst.isEmpty();
 }
 
 /*!
-  Finds menu node
-  \return menu node
-  \param title - menu text of searched node
-  \param pId - id of action corresponding to start menu item
-  \param rec - recursive searching
+  \brief Search menu node.
+  \param title menu item title
+  \param pId parent menu item ID
+  \param rec if \c true perform recursive search
+  \return menu node or 0 if it is not found
 */
 QtxActionMenuMgr::MenuNode* QtxActionMenuMgr::find( const QString& title, const int pId, const bool rec ) const
 {
@@ -784,89 +711,93 @@ QtxActionMenuMgr::MenuNode* QtxActionMenuMgr::find( const QString& title, const
 }
 
 /*!
-  Finds menu node
-  \return true if at least one node is found
-  \param title - menu text of node
-  \param lst - list to be filled with found nodes
-  \param startNode - start menu item
+  \brief Search recursively all menu nodes with given \a title.
+  \param title menu item title
+  \param NodeList resulting list of menu nodes
+  \param startNode start menu node (if 0, search from root node)
+  \return \c true if at least one node is found
 */
 bool QtxActionMenuMgr::find( const QString& title, NodeList& lst, MenuNode* startNode ) const
 {
-  MenuNode* start = startNode ? startNode : (MenuNode*)&myRoot;
-  for ( NodeListIterator it( start->children ); it.current(); ++it )
+  MenuNode* start = startNode ? startNode : myRoot;
+  for ( NodeList::iterator it = start->children.begin(); it != start->children.end(); ++it )
   {
-    QAction* a = itemAction( it.current()->id );
+    QAction* a = itemAction( (*it)->id );
     if ( !a )
-      a = menuAction( it.current()->id );
-    if ( a && clearTitle( a->menuText() ) == clearTitle( title ) )
-      lst.prepend( it.current() );
+      a = menuAction( (*it)->id );
+    if ( a && clearTitle( a->text() ) == clearTitle( title ) )
+      lst.prepend( *it );
 
-    find( title, lst, it.current() );
+    find( title, lst, *it );
   }
   return !lst.isEmpty();
 }
 
 /*!
-  Finds menu node
-  \return menu node
-  \param title - menu text of searched node
-  \param startNode - start menu item
-  \param rec - recursive searching
+  \brief Search menu node.
+  \param title menu item title
+  \param startNode start menu node (if 0, search from root node)
+  \param rec if \c true perform recursive search
+  \return menu node or 0 if it is not found
 */
 QtxActionMenuMgr::MenuNode* QtxActionMenuMgr::find( const QString& title, MenuNode* startNode, const bool rec ) const
 {
   MenuNode* node = 0;
-  MenuNode* start = startNode ? startNode : (MenuNode*)&myRoot;
-  for ( NodeListIterator it( start->children ); it.current() && !node; ++it )
+  MenuNode* start = startNode ? startNode : myRoot;
+  for ( NodeList::iterator it = start->children.begin(); it != start->children.end() && !node; ++it )
   {
-    QAction* a = itemAction( it.current()->id );
+    QAction* a = itemAction( (*it)->id );
     if ( !a )
-      a = menuAction( it.current()->id );
-    if ( a && clearTitle( a->menuText() ) == clearTitle( title ) )
-      node = it.current();
+      a = menuAction( (*it)->id );
+    if ( a && clearTitle( a->text() ) == clearTitle( title ) )
+      node = *it;
     if ( !node && rec )
-      node = find( title, it.current(), rec );
+      node = find( title, *it, rec );
   }
   return node;
 }
 
 /*!
-  Find id among children
-  \return id (>0) if on success or -1 on fail
-  \param id - id to be searched
-  \param pid - id of parent, among children of that 'id' must be searched
+  \brief Find menu item by given ID (one-level only).
+  \param id menu action ID
+  \param pid parent meun item ID
+  \return id (>0) on success or -1 if menu item is not found
 */
 int QtxActionMenuMgr::findId( const int id, const int pid ) const
 {
-  MenuNode* start = pid != -1 ? find( pid ) : (MenuNode*)&myRoot;
-  if ( start ) {
-    for ( NodeListIterator it( start->children ); it.current(); ++it ) {
-      if ( it.current()->id == id ) return id;
+  MenuNode* start = pid != -1 ? find( pid ) : myRoot;
+  if ( start )
+  {
+    for ( NodeList::iterator it = start->children.begin(); it != start->children.end(); ++it )
+    {
+      if ( (*it)->id == id )
+        return id;
     }
   }
   return -1;
 }
 
 /*!
-  Removes child
-  \param id - id of child to be removed
-  \param startNode - parent menu item
+  \brief Removes menu node (with all its children).
+  \param id menu action ID
+  \param startNode parent menu node which search starts from (if 0, search starts from root)
 */
 void QtxActionMenuMgr::removeMenu( const int id, MenuNode* startNode )
 {
-  MenuNode* start = startNode ? startNode : &myRoot;
-  for ( NodeListIterator it( start->children ); it.current(); ++it )
+  MenuNode* start = startNode ? startNode : myRoot;
+  for ( NodeList::iterator it = start->children.begin(); it != start->children.end(); ++it )
   {
-    if ( it.current()->id == id )
-      start->children.remove( it.current() );
+    if ( (*it)->id == id )
+      start->children.removeAll( *it );
     else
-      removeMenu( id, it.current() );
+      removeMenu( id, *it );
   }
 }
 
 /*!
-  \return menu item action by id
-  \param id - id of action
+  \brief Get action by \a id.
+  \param id action ID
+  \return action or 0 if \a id is invalid
 */
 QAction* QtxActionMenuMgr::itemAction( const int id ) const
 {
@@ -874,12 +805,13 @@ QAction* QtxActionMenuMgr::itemAction( const int id ) const
 }
 
 /*!
-  \return menu action by id
-  \param id - id of action
+  \brief Get submenu action by \a id.
+  \param id submenu ID
+  \return submenu action or 0 if action is not found
 */
-QtxActionMenuMgr::MenuAction* QtxActionMenuMgr::menuAction( const int id ) const
+QAction* QtxActionMenuMgr::menuAction( const int id ) const
 {
-  MenuAction* a = 0;
+  QAction* a = 0;
 
   if ( myMenus.contains( id ) )
     a = myMenus[id];
@@ -888,18 +820,38 @@ QtxActionMenuMgr::MenuAction* QtxActionMenuMgr::menuAction( const int id ) const
 }
 
 /*!
-  Updates menu ( isUpdatesEnabled() must return true )
-  \param startNode - first menu item to be updated
-  \param rec - recursive update
-  \param updParent - update also parent item (without recursion)
-  \sa isUpdatesEnabled()
+  \brief Get submenu action by \a id.
+  \param id submenu ID
+  \return submenu action or 0 if it is not found
+*/
+int QtxActionMenuMgr::menuActionId( QAction* a ) const
+{
+  int id = -1;
+  for ( MenuMap::ConstIterator itr = myMenus.begin(); itr != myMenus.end() && id == -1; ++itr )
+  {
+    if ( itr.value() == a )
+      id = itr.key();
+  }
+  return id;
+}
+
+/*!
+  \brief Update menu.
+
+  Does nothing if update is disabled.
+
+  \param startNode start menu item to be updated
+  \param rec if \c true, perform recursive update
+  \param updParent if \c true update also parent item (without recursion)
+
+  \sa isUpdatesEnabled() and setUpdatesEnabled()
 */
 void QtxActionMenuMgr::updateMenu( MenuNode* startNode, const bool rec, const bool updParent )
 {
   if ( !isUpdatesEnabled() )
     return;
 
-  MenuNode* node = startNode ? startNode : &myRoot;
+  MenuNode* node = startNode ? startNode : myRoot;
 
   QWidget* mw = menuWidget( node );
   if ( !mw )
@@ -907,123 +859,180 @@ void QtxActionMenuMgr::updateMenu( MenuNode* startNode, const bool rec, const bo
 
   bool filled = checkWidget( mw );
 
-  for ( NodeListIterator it1( node->children ); it1.current(); ++it1 )
+  // first remove all own actions and collect foreign ones
+  QMap< QAction*, QList<QAction*> > foreign;
+  QAction* a;
+  QAction* preva = 0;
+  QListIterator<QAction*> ait( mw->actions() ); ait.toBack();
+  while ( ait.hasPrevious() )
   {
-    QAction* a = itemAction( it1.current()->id );
-    if ( !a )
-      a = menuAction( it1.current()->id );
-
-    if ( a )
-      a->removeFrom( mw );
+    a = ait.previous();
+    if ( ownAction( a, node ) )
+    {
+      preva = a;
+      mw->removeAction( a );     // remove own actions
+    }
+    else
+    {
+      foreign[preva].prepend(a); // do not yet remove foreign actions
+    }
   }
-  /* VSR: commented to allow direct creating of menus by calling insertItem() methods
-  if ( mw->inherits( "QMenuBar" ) )
-    ((QMenuBar*)mw)->clear();
-  else if ( mw->inherits( "QPopupMenu" ) )
-    ((QPopupMenu*)mw)->clear();
-  */
+  // now only foreign actions should stay in the menu, thus remove them also
+  QMap< QAction*, QList<QAction*> >::Iterator formapit;
+  for( formapit = foreign.begin(); formapit != foreign.end(); ++formapit )
+  {
+    QMutableListIterator<QAction*> foralit( formapit.value() );
+    while ( foralit.hasNext() )
+    {
+      a = foralit.next();
+      if ( !mw->actions().contains( a ) )
+       foralit.remove();
+    }
+  }
+  QList<QAction*> alist = mw->actions();
+  foreach( a, alist ) mw->removeAction( a );
+
+  // collect all registered menus by group id
   QMap<int, NodeList> idMap;
-  for ( NodeListIterator it2( node->children ); it2.current(); ++it2 )
+  for ( NodeList::iterator it2 = node->children.begin(); it2 != node->children.end(); ++it2 )
   {
-    NodeList& lst = idMap[it2.current()->group];
-    int idx = it2.current()->idx;
+    NodeList& lst = idMap[(*it2)->group];
+    int idx = (*it2)->idx;
     if ( idx < 0 || idx >= (int)lst.count() )
-      lst.append( it2.current() );
+      lst.append( *it2 );
     else
-      lst.insert( idx, it2.current() );
+      lst.insert( idx, *it2 );
   }
 
   QIntList groups = idMap.keys();
-  qHeapSort( groups );
+  qSort( groups );
 
-  groups.remove( -1 );
+  groups.removeAll( -1 );
   groups.append( -1 );
 
+  // rebuild menu: 1. add all registered actions
   for ( QIntList::const_iterator gIt = groups.begin(); gIt != groups.end(); ++gIt )
   {
     if ( !idMap.contains( *gIt ) )
       continue;
 
     const NodeList& lst = idMap[*gIt];
-    for ( NodeListIterator iter( lst ); iter.current(); ++iter )
+    for ( NodeList::const_iterator iter = lst.begin(); iter != lst.end(); ++iter )
     {
-      MenuNode* par = iter.current()->parent;
-      if ( !isVisible( iter.current()->id, par ? par->id : -1 ) )
-       continue;
+      MenuNode* node = *iter;
+      if ( !node ) continue;
 
       if ( rec )
-        updateMenu( iter.current(), rec, false );
+        updateMenu( node, rec, false );
 
-      QAction* a = itemAction( iter.current()->id );
+      MenuNode* par = node->parent;
+      if ( !isVisible( node->id, par ? par->id : -1 ) )
+        continue;
+
+      bool isMenu = false;
+      QAction* a = itemAction( node->id );
       if ( !a )
-        a = menuAction( iter.current()->id );
-      if ( a )
-       a->addTo( mw );
+      {
+        isMenu = true;
+        a = menuAction( node->id );
+      }
+      if ( !a ) continue;
+
+      if ( !isMenu || !a->menu()->isEmpty() || node->emptyEnabled > 0 )
+        mw->addAction( a );
     }
   }
 
+  // rebuild menu: 2. insert back all foreign actions
+  for( formapit = foreign.begin(); formapit != foreign.end(); ++formapit ) {
+    preva = formapit.key();
+    foreach( a, formapit.value() )
+      mw->insertAction( preva, a );
+  }
+  
+  // remove extra separators
   simplifySeparators( mw );
 
+  // update parent menu if necessary
   if ( updParent && node->parent && filled != checkWidget( mw ) )
     updateMenu( node->parent, false );
 }
 
 /*!
-  Updates menu (virtual variant). To be redefined for custom activity on menu updating
+  \brief Internal update.
+  
+  Customizes the menu update processing.
 */
 void QtxActionMenuMgr::internalUpdate()
 {
-  if ( isUpdatesEnabled() )
-    updateMenu();
+  if ( !isUpdatesEnabled() )
+    return;
+
+  updateMenu();
+  myUpdateIds.clear();
 }
 
 /*!
-  \return true if widget is non-empty menu
-  \param wid - widget to be checked
+  \brief Check if action belongs to the menu manager
+  \internal
+  \param a action being checked
+  \param node parent menu node
+  \return \c true if action belongs to the menu \a node
+*/
+bool QtxActionMenuMgr::ownAction( QAction* a, MenuNode* node ) const
+{
+  for ( NodeList::const_iterator iter = node->children.begin(); iter != node->children.end(); ++iter )
+  {
+    QAction* mya = itemAction( (*iter)->id );
+    if ( !mya ) mya = menuAction( (*iter)->id );
+    if ( mya && mya == a ) return true;
+  }
+  return false;
+}
+
+/*!
+  \brief Check if menu widget has any actions.
+  \param wid widget to be checked
+  \return \c true if widget contains action(s)
 */
 bool QtxActionMenuMgr::checkWidget( QWidget* wid ) const
 {
   if ( !wid )
     return false;
 
-  QMenuData* md = 0;
-  if ( wid->inherits( "QPopupMenu" ) )
-    md = (QPopupMenu*)wid;
-  else if ( wid->inherits( "QMenuBar" ) )
-    md = (QMenuBar*)wid;
-
-  return md ? md->count() : false;
+  return !wid->actions().isEmpty();
 }
 
 /*!
-  \return popup of menu item
-  \param node - menu item
+  \brief Get menu widget for the given \a node.
+  \param node menu node
+  \return popup menu or main menu corresponding to the menu node
+  (or 0 if it is not found)
 */
-QWidget* QtxActionMenuMgr::menuWidget( MenuNode* node) const
+QWidget* QtxActionMenuMgr::menuWidget( MenuNode* node ) const
 {
-  if ( !node || node == &myRoot )
+  if ( !node || node == myRoot )
      return myMenu;
 
   if ( !myMenus.contains( node->id ) || !myMenus[node->id] )
     return 0;
 
-  return myMenus[node->id]->popup();
+  return myMenus[node->id]->menu();
 }
 
 /*!
-  Removes excess separators of menu 
-  \param wid - menu to be processed
+  \brief Remove extra separators from menu widget.
+  \param wid menu widget to be processed
 */
 void QtxActionMenuMgr::simplifySeparators( QWidget* wid )
 {
-  if ( wid && wid->inherits( "QPopupMenu" ) )
-    Qtx::simplifySeparators( (QPopupMenu*)wid, false );
+  Qtx::simplifySeparators( wid, false );
 }
 
 /*!
-  Removes special symbols (&) from string
-  \param txt string to be processed
-  \return clear variant of string
+  \brief Remove special symbols (&) from string to get clear menu title.
+  \param txt string to be processed
+  \return clear title
 */
 QString QtxActionMenuMgr::clearTitle( const QString& txt ) const
 {
@@ -1039,9 +1048,10 @@ QString QtxActionMenuMgr::clearTitle( const QString& txt ) const
 }
 
 /*!
-  Creates and inserts many menu items 
-  \param lst - list of menu texts
-  \param pId - id of action corresponding to parent menu item
+  \brief Create and inserts menu item recursively.
+  \param lst list of menu names
+  \param pId parent menu item ID
+  \return created menu item ID (last in the chain)
 */
 int QtxActionMenuMgr::createMenu( const QStringList& lst, const int pId )
 {
@@ -1050,8 +1060,8 @@ int QtxActionMenuMgr::createMenu( const QStringList& lst, const int pId )
 
   QStringList sl( lst );
 
-  QString title = sl.last().stripWhiteSpace();
-  sl.remove( sl.fromLast() );
+  QString title = sl.last().trimmed();
+  sl.removeLast();
 
   int parentId = sl.isEmpty() ? pId : createMenu( sl, pId );
 
@@ -1059,10 +1069,10 @@ int QtxActionMenuMgr::createMenu( const QStringList& lst, const int pId )
 }
 
 /*!
-  Loads actions description from file
-  \param fname - name of file
-  \param r - reader of file
-  \return true on success
+  \brief Load actions description from the file.
+  \param fname file name
+  \param r action reader
+  \return \c true on success and \c false on error
 */
 bool QtxActionMenuMgr::load( const QString& fname, QtxActionMgr::Reader& r )
 {
@@ -1071,51 +1081,163 @@ bool QtxActionMenuMgr::load( const QString& fname, QtxActionMgr::Reader& r )
 }
 
 /*!
-  \return true if item has such child
-  \param title - menu text of child
-  \param pid - id of action corresponding to item
+  \brief Check if the parent menu contains menu item with given \a title.
+  \param title menu title
+  \param pid parent menu item ID
+  \return \c true if parent menu item contains such child item
 */
-bool QtxActionMenuMgr::containsMenu( const QString& title, const int pid ) const
+bool QtxActionMenuMgr::containsMenu( const QString& title, const int pid, const bool rec ) const
 {
-  return (bool)find( title, pid, false );
+  return (bool)find( title, pid, rec );
 }
 
 /*!
-  \return true if item has such child
-  \param id - id of action corresponding to child
-  \param pid - id of action corresponding to item
+  \brief Check if the parent menu contains menu item with given \a id.
+  \param id menu item ID
+  \param pid parent menu item ID
+  \return \c true if parent menu item contains such child item
 */
-bool QtxActionMenuMgr::containsMenu( const int id, const int pid ) const
+bool QtxActionMenuMgr::containsMenu( const int id, const int pid, const bool rec ) const
 {
-  return (bool)find( id, pid, false );
+  return (bool)find( id, pid, rec );
 }
 
+/*!
+  \brief Get menu by the specified identifier.
+  \param id menu item ID
+  \return menu pointer or 0 if menu is not found
+*/
+QMenu* QtxActionMenuMgr::findMenu( const int id ) const
+{
+  QMenu* m = 0;
+  QAction* a = menuAction( id );
+  if ( a )
+    m = a->menu();
+  return m;
+}
 
 /*!
-  Constructor
-  \param r - menu reader
-  \param mgr - menu manager
+  \brief Get menu by the title.
+  \param title menu text
+  \param pid parent menu item ID (to start search)
+  \param rec if \c true, perform recursive update
+  \return menu pointer or 0 if menu is not found
 */
-QtxActionMenuMgr::MenuCreator::MenuCreator( QtxActionMgr::Reader* r,
-                                            QtxActionMenuMgr* mgr )
+QMenu* QtxActionMenuMgr::findMenu( const QString& title, const int pid, const bool rec ) const
+{
+  QMenu* m = 0;
+  MenuNode* node = find( title, pid, rec );
+  if ( node )
+  {
+    QAction* a = menuAction( node->id );
+    if ( a )
+      m = a->menu();
+  }
+  return m;
+}
+
+/*!
+  \brief Check if empty menu is enabled
+  \param id menu item ID
+  \return \c true if empty menu is enabled
+*/
+bool QtxActionMenuMgr::isEmptyEnabled( const int id ) const
+{
+  MenuNode* node = find( id );
+  if ( node && menuAction( id ) )
+    return node->emptyEnabled > 0;
+  
+  return false;
+}
+
+/*!
+  \brief Enable/disable empty menu
+  \param id menu item ID
+  \param enable if \c true, empty menu will be enabled, otherwise empty menu will be disabled
+*/
+void QtxActionMenuMgr::setEmptyEnabled( const int id, const bool enable )
+{
+  MenuNode* node = find( id );
+  if ( node && menuAction( id ) ) {
+    int old = node->emptyEnabled;
+    node->emptyEnabled += enable ? 1 : -1;
+    if ( old <= 0 && enable || old > 0 && !enable ) // update menu only if enabled state has been changed
+      updateMenu( node, true, true );
+  }
+}
+
+/*!
+  \brief Perform delayed menu update.
+  \param id menu item ID
+  \param rec if \c true, perform recursive update
+*/
+void QtxActionMenuMgr::triggerUpdate( const int id, const bool rec )
+{
+  bool isRec = rec;
+  if ( myUpdateIds.contains( id ) )
+    isRec = isRec || myUpdateIds[ id ];
+  myUpdateIds.insert( id, isRec );
+
+  QtxActionMgr::triggerUpdate();
+}
+
+/*!
+  \brief Called when delayed content update is performed.
+
+  Customizes the content update operation.
+*/
+void QtxActionMenuMgr::updateContent()
+{
+  // Warning: For correct updating it is necessary to update the most enclosed submenu in first turn
+  //          because not updated empty submenu will be skipped. Now the submenus are iterated in
+  //          ascending order according to their identifiers. For a submenus with automatically generated 
+  //          identifiers this will work correctly since the uppermost submenus have the biggest number
+  //          (identifiers are generated by decrementing 1 starting from -1). In general, if any submenu
+  //          have positive identifiers this method might not work correctly. In this case it would be
+  //          necessary to improve this method and to add preliminary sorting a submenus by depth of an 
+  //          enclosure.
+  for ( QMap<int, bool>::const_iterator it = myUpdateIds.constBegin(); it != myUpdateIds.constEnd(); ++it )
+  {
+    MenuNode* node = it.key() == -1 ? myRoot : find( it.key() );
+    if ( node )
+      updateMenu( node, it.value() );
+  }
+  myUpdateIds.clear();
+}
+
+/*!
+  \class QtxActionMenuMgr::MenuCreator
+  \brief Menu actions creator.
+
+  Used by Reader to create actions by reading descriptions from the file
+  and fill in the action manager with the actions.
+*/
+
+/*!
+  \brief Constructor.
+  \param r menu actions reader
+  \param mgr menu manager
+*/
+QtxActionMenuMgr::MenuCreator::MenuCreator( QtxActionMgr::Reader* r, QtxActionMenuMgr* mgr )
 : QtxActionMgr::Creator( r ),
   myMgr( mgr )
 {
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxActionMenuMgr::MenuCreator::~MenuCreator()
 {
 }
 
 /*!
-  Appends new menu items
-  \param tag - tag of item
-  \param subMenu - it has submenu
-  \param attr - list of attributes
-  \param pId - id of action corresponding to parent item
+  \brief Create and append to the action manager a new action.
+  \param tag item tag name
+  \param subMenu \c true if this item is submenu
+  \param attr attributes map
+  \param pId parent action ID
+  \return menu action ID
 */
 int QtxActionMenuMgr::MenuCreator::append( const QString& tag, const bool subMenu,
                                            const ItemAttributes& attr, const int pId )
@@ -1141,20 +1263,21 @@ int QtxActionMenuMgr::MenuCreator::append( const QString& tag, const bool subMen
     res = myMgr->insert( separator(), pId, intValue( attr, group, 0 ), intValue( attr, pos, -1 ) );
   else
   {
-    QPixmap pix; QIconSet set;
+    QIcon set;
+    QPixmap pix;
     QString name = strValue( attr, icon );
     if( !name.isEmpty() && loadPixmap( name, pix ) )
-      set = QIconSet( pix );
+      set = QIcon( pix );
 
     QtxAction* newAct = new QtxAction( strValue( attr, tooltip ), set,
-                                       strValue( attr, label ), 
+                                       strValue( attr, label ),
                                        QKeySequence( strValue( attr, accel ) ),
                                        myMgr );
     newAct->setToolTip( strValue( attr, tooltip ) );
     QString toggleact = strValue( attr, toggle );
-    newAct->setToggleAction( !toggleact.isEmpty() );
-    newAct->setOn( toggleact.lower()=="true" );
-        
+    newAct->setCheckable( !toggleact.isEmpty() );
+    newAct->setChecked( toggleact.toLower() == "true" );
+
     connect( newAct );
     int aid = myMgr->registerAction( newAct, actId );
     res = myMgr->insert( aid, pId, intValue( attr, group, 0 ), intValue( attr, pos, -1 ) );
index bdbe139a4b646414f5eef6e0f457b4697a46be29..071c34adb65ca8eacd615ddc27c8936bf307f27b 100644 (file)
@@ -1,81 +1,50 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxActionMenuMgr.h
-// Author:    Alexander SOLOVYEV, Sergey TELKOV
-
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
+//
 #ifndef QTXACTIONMENUMGR_H
 #define QTXACTIONMENUMGR_H
 
 #include "Qtx.h"
 #include "QtxActionMgr.h"
 
-#include <qptrlist.h>
-#include <qstringlist.h>
+#include <QList>
 
-class QPopupMenu;
+class QMenu;
 class QMainWindow;
+class QStringList;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
-/*!
-  \class QtxActionMenuMgr
-  Allows to use set of action to automatically build main menu.
-  With help of methods insert/append/remove it is possible to 
-  describe whole structure of menu. Method hide allows
-  to temporary remove some items from menu, method show allows to 
-  recreate them.
-  Actions can be grouped with help of group identifictor.
-  Inside popup or menu bar items have order by increasing group id.
-  This manager is able to attune menu: to remove excess separators,
-  to remove empty popup menu etc.
-*/
 class QTX_EXPORT QtxActionMenuMgr : public QtxActionMgr
 {
   Q_OBJECT
 
   class MenuNode;
 
-  typedef QPtrList<MenuNode>         NodeList;
-  typedef QPtrListIterator<MenuNode> NodeListIterator;
-
-  /*!
-    \class MenuNode
-    Represents a menu item inside main menu structure.
-    For internal purposes only
-  */
-  class MenuNode
-  {
-  public:
-    MenuNode() : parent( 0 ), visible( true ) { children.setAutoDelete( true ); };
-    MenuNode( MenuNode* p ) : parent( p ), visible( true ) { children.setAutoDelete( true ); };
-
-    int       id;
-    int       idx;
-    int       group;
-    MenuNode* parent;
-    bool      visible;
-    NodeList  children;
-  };
-
-  class MenuAction;
+  typedef QList<MenuNode*> NodeList;  //!< menu nodes list
 
 protected:
   class MenuCreator;
@@ -85,6 +54,8 @@ public:
   QtxActionMenuMgr( QWidget*, QObject* );
   virtual ~QtxActionMenuMgr();
 
+  QWidget*     menuWidget() const;
+
   virtual bool isVisible( const int, const int ) const;
   virtual void setVisible( const int, const int, const bool );
 
@@ -97,17 +68,17 @@ public:
   virtual int  insert( const int, const int, const int, const int = -1 );
   int          insert( QAction*, const int, const int, const int = -1 );
 
-  int          insert( const QString&, const QString&, const int, const int = -1, const int = -1, const bool = false );
-  int          insert( const QString&, const QStringList&, const int, const int = -1, const int = -1, const bool = false );
-  virtual int  insert( const QString&, const int, const int, const int = -1, const int = -1, const bool = false );
+  int          insert( const QString&, const QString&, const int, const int = -1, const int = -1 );
+  int          insert( const QString&, const QStringList&, const int, const int = -1, const int = -1 );
+  virtual int  insert( const QString&, const int, const int, const int = -1, const int = -1 );
 
   int          append( const int, const int, const int );
   int          append( QAction*, const int, const int );
-  int          append( const QString&, const int, const int, const int = -1, const bool = false );
+  int          append( const QString&, const int, const int, const int = -1 );
 
   int          prepend( const int, const int, const int );
   int          prepend( QAction*, const int, const int );
-  int          prepend( const QString&, const int, const int, const int = -1, const bool = false );
+  int          prepend( const QString&, const int, const int, const int = -1 );
 
   void         remove( const int );
   void         remove( const int, const int, const int = -1 );
@@ -118,21 +89,31 @@ public:
   bool         isShown( const int ) const;
   void         setShown( const int, const bool );
 
+  virtual void change( const int, const QString& );
+
   virtual bool load( const QString&, QtxActionMgr::Reader& );
 
-  bool         containsMenu( const QString&, const int ) const;
-  bool         containsMenu( const int, const int ) const;
+  bool         containsMenu( const QString&, const int, const bool = false ) const;
+  bool         containsMenu( const int, const int, const bool = false ) const;
+
+  QMenu*       findMenu( const int ) const;
+  QMenu*       findMenu( const QString&, const int, const bool = false ) const;
 
+  bool         isEmptyEnabled( const int ) const;
+  void         setEmptyEnabled( const int, const bool );
 
 private slots:
+  void         onAboutToShow();
+  void         onAboutToHide();
   void         onDestroyed( QObject* );
-  void         onHighlighted( int );
 
 signals:
-  void         menuHighlighted( int, int );
+  void         menuAboutToShow( QMenu* );
+  void         menuAboutToHide( QMenu* );
 
 protected:
-  void         setWidget( QWidget* );
+  void         setMenuWidget( QWidget* );
+
   MenuNode*    find( const int, const int, const bool = true ) const;
   MenuNode*    find( const int, MenuNode* = 0, const bool = true ) const;
   bool         find( const int, NodeList&, MenuNode* = 0 ) const;
@@ -144,31 +125,33 @@ protected:
   void         removeMenu( const int, MenuNode* );
 
   QAction*     itemAction( const int ) const;
-  MenuAction*  menuAction( const int ) const;
+  QAction*     menuAction( const int ) const;
+  int          menuActionId( QAction* ) const;
 
   void         updateMenu( MenuNode* = 0, const bool = true, const bool = true );
-  virtual void internalUpdate();  
+  virtual void internalUpdate();
+  virtual void updateContent();
 
 private:
+  bool         ownAction( QAction*, MenuNode* ) const;
   bool         checkWidget( QWidget* ) const;
   QWidget*     menuWidget( MenuNode* ) const;
   void         simplifySeparators( QWidget* );
   QString      clearTitle( const QString& ) const;
   int          createMenu( const QStringList&, const int );
 
-private:
-  typedef QMap<int, MenuAction*> MenuMap;
+  void         triggerUpdate( const int, const bool rec = true );
 
 private:
-  MenuNode     myRoot;
-  QWidget*     myMenu;
-  MenuMap      myMenus;
+  typedef QMap<int, QAction*> MenuMap;     //!< actions map
+  
+private:
+  MenuNode*       myRoot;        //!< root menu node
+  QWidget*        myMenu;        //!< menu widget
+  MenuMap         myMenus;       //!< actions map
+  QMap<int, bool> myUpdateIds;   //!< list of actions ID being updated
 };
 
-/*!
-  \class QtxActionMenuMgr::MenuCreator
-  Allows to create automatically main menu by data read from file
-*/
 class QtxActionMenuMgr::MenuCreator : public QtxActionMgr::Creator
 {
 public:
@@ -179,7 +162,7 @@ public:
                       const ItemAttributes&, const int );
 
 private:
-  QtxActionMenuMgr* myMgr;
+  QtxActionMenuMgr* myMgr;       //!< menu manager
 };
 
 
index b157b835e7e76030a5a91d37e05d7852837fa248..3241ee76d426eae1bafd001738fc7510155bac83 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxActionMgr.cxx
-// Author:    Alexander SOLOVYEV, Sergey TELKOV
-
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
+//
 #include "Qtx.h"
 #include "QtxActionMgr.h"
 #include "QtxAction.h"
+#include <QFile>
+#include <QTimer>
+#ifndef QT_NO_DOM
+#include <QDomDocument>
+#include <QDomNode>
+#include <QCoreApplication>
+#endif
 
-#include <qwidget.h>
-#include <qtoolbar.h>
-#include <qpopupmenu.h>
-#include <qwidgetlist.h>
-#include <qobjectlist.h>
-#include <qfile.h>
-#include <qdom.h>
-
-static QAction* qtx_separator_action = 0;
+typedef QList< QPointer<QAction> > qtx_actionlist;
+static qtx_actionlist qtx_separator_actions;
 
+/*!
+  \brief Clean all cashed separator actions.
+  \internal
+*/
 void qtxSeparatorActionCleanup()
 {
-  delete qtx_separator_action;
-  qtx_separator_action = 0;
+  for ( qtx_actionlist::iterator it = qtx_separator_actions.begin(); it != qtx_separator_actions.end(); ++it )
+  {
+    QAction* a = *it;
+    delete a;
+  }
 }
 
 /*!
-       Class: QtxActionMenuMgr::SeparatorAction
-       Level: Internal
+  \class QtxActionMgr::SeparatorAction
+  \brief Separator action class.
+  \internal
 */
 
-class QtxActionMgr::SeparatorAction : public QtxAction
+class QtxActionMgr::SeparatorAction : public QAction
 {
 public:
   SeparatorAction( QObject* = 0 );
   virtual ~SeparatorAction();
-
-  virtual bool addTo( QWidget* );
-  virtual bool removeFrom( QWidget* );
-
-private:
-  QMap<QPopupMenu*, QIntList>  myMenus;
-  QMap<QToolBar*, QWidgetList> myTools;
 };
 
 /*!
-  Constructor
+  \brief Constructor.
+  \internal
+  \param parent parent object
 */
 QtxActionMgr::SeparatorAction::SeparatorAction( QObject* parent )
-: QtxAction( parent )
+: QAction( parent )
 {
+  setSeparator( true );
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxActionMgr::SeparatorAction::~SeparatorAction()
 {
 }
 
 /*!
-  Adds action to widget
-  \param wid - widget
-*/
-bool QtxActionMgr::SeparatorAction::addTo( QWidget* wid )
-{
-  if ( !wid )
-    return false;
-
-  bool res = true;
-  if ( wid->inherits( "QPopupMenu" ) )
-  {
-    QPopupMenu* popup = (QPopupMenu*)wid;
-    myMenus[popup].append( popup->insertSeparator() );
-  }
-  else if ( wid->inherits( "QToolBar" ) )
-  {
-    QToolBar* tb = (QToolBar*)wid;
-    tb->addSeparator();
-    myTools[tb].append( (QWidget*)tb->children()->getLast() );
-  }
-  else
-    res = false;
-
-  return res;
-}
-
-/*!
-  Removes action from widget
-  \param wid - widget
-*/
-bool QtxActionMgr::SeparatorAction::removeFrom( QWidget* wid )
-{
-  if ( !wid )
-    return false;
+  \class QtxActionMgr
+  \brief Manages a set of actions accessible by unique identifier.
+  
+  Base class for menu, toolbar actions containers and popup menu creators.
 
-  bool res = true;
-  if ( wid->inherits( "QPopupMenu" ) )
-  {
-    QPopupMenu* popup = (QPopupMenu*)wid;
-    if ( myMenus.contains( popup ) )
-    {
-      const QIntList& list = myMenus[popup];
-      for ( QIntList::const_iterator it = list.begin(); it != list.end(); ++it )
-        popup->removeItem( *it );
+  Actions are registered in the manager with the registerAction() method
+  and unregistered from it with the unRegisterAction() method.
 
-      myMenus.remove( popup );
-    }
-  }
-  else if ( wid->inherits( "QToolBar" ) )
-  {
-    QToolBar* tb = (QToolBar*)wid;
-    if ( myTools.contains( tb ) )
-    {
-      QMap<QObject*, int> childMap;
-      if ( tb->children() )
-      {
-        for ( QObjectListIt it( *tb->children() ); it.current(); ++it )
-          childMap.insert( it.current(), 0 );
-      }
-      const QWidgetList& list = myTools[tb];
-      for ( QWidgetListIt it( list ); it.current(); ++it )
-      {
-        if ( childMap.contains( it.current() ) )
-        delete it.current();
-      }
-
-      myTools.remove( tb );
-    }
-  }
-  else
-    res = false;
+  Functions action() and actionId() allow getting action by its identifier
+  and vice versa. Method contains() returns \c true if the action with 
+  the specified identifier is already registered.
 
-  return res;
-}
+  To get total number of the registered actions can be retrieved by
+  the method count(). Function isEmpty() returns \c true if manager does not
+  contains any actions. The list of all actions identifiers can be retrieved
+  with the idList() function.
 
-/*!
-       Class: QtxActionMgr
-       Level: Public
+  The method separator() allows creating a separator action which can be
+  used in the menus or toolbars to separate logical groups of actions.
+  
+  To enable/disable any action by its identifier, use setEnabled() method.
 */
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param parent parent object
 */
 QtxActionMgr::QtxActionMgr( QObject* parent )
 : QObject( parent ),
-myUpdate( true )
+  myUpdate( true ),
+  myUpdTimer( 0 )
 {
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxActionMgr::~QtxActionMgr()
 {
 }
 
 /*!
-  Stores action in internal map
-  If action with such id is registered already, then it will be unregistered
-  \param a - action to be registered
-  \param userId - proposed id (if it is less than 0, then id will be generated automatically)
+  \brief Register an action in the internal map.
+
+  If \a userId is less than 0, the identifier for the action 
+  is generated automatically. If action with given \a userId 
+  is already registered, it will be re-registered.
+
+  \param a action to be registered
+  \param userId action ID
+  \return action ID (the same as userId or generated one)
+  \sa unRegisterAction()
 */
 int QtxActionMgr::registerAction( QAction* a, const int userId )
 {
@@ -201,8 +159,9 @@ int QtxActionMgr::registerAction( QAction* a, const int userId )
 }
 
 /*!
-  Removes action from internal map
-  \param id - action id
+  \brief Unregister action from internal map.
+  \param id action ID
+  \sa registerAction()
 */
 void QtxActionMgr::unRegisterAction( const int id )
 {
@@ -211,8 +170,10 @@ void QtxActionMgr::unRegisterAction( const int id )
 }
 
 /*!
-  \return action by id
-  \param id - action id
+  \brief Get action by specified identifier.
+  \param id action ID
+  \return action (or 0 if \a id is invalid)
+  \sa actionId()
 */
 QAction* QtxActionMgr::action( const int id ) const
 {
@@ -223,8 +184,10 @@ QAction* QtxActionMgr::action( const int id ) const
 }
 
 /*!
-  \return id by action
-  \param a - action
+  \brief Get action identifier.
+  \param a action
+  \return action ID (or -1 if action is not found)
+  \sa action()
 */
 int QtxActionMgr::actionId( const QAction* a ) const
 {
@@ -234,7 +197,7 @@ int QtxActionMgr::actionId( const QAction* a ) const
   int theId = -1;
   for ( ActionMap::ConstIterator it = myActions.begin(); it != myActions.end() && theId == -1; ++it )
   {
-    if ( it.data() == a )
+    if ( it.value() == a )
       theId = it.key();
   }
 
@@ -242,8 +205,9 @@ int QtxActionMgr::actionId( const QAction* a ) const
 }
 
 /*!
-  \return true if internal map contains such id
-  \param id - action id
+  \brief Check if an action with given \a id is registered in the action manager.
+  \param id action ID
+  \return \c true if internal map contains action with such identifier
 */
 bool QtxActionMgr::contains( const int id ) const
 {
@@ -251,7 +215,9 @@ bool QtxActionMgr::contains( const int id ) const
 }
 
 /*!
-  \return count of actions in internal map
+  \brief Get total number of registered actions.
+  \return number of actions in the internal map
+  \sa isEmpty()
 */
 int QtxActionMgr::count() const
 {
@@ -259,7 +225,9 @@ int QtxActionMgr::count() const
 }
 
 /*!
-  \return true if internal map is empty
+  \brief Check if there are no actions registered in the action manager.
+  \return \c true if internal map is empty
+  \sa count()
 */
 bool QtxActionMgr::isEmpty() const
 {
@@ -267,15 +235,18 @@ bool QtxActionMgr::isEmpty() const
 }
 
 /*!
-  Fills list with ids of registered actions
+  \brief Get all registered actions identifiers.
+  \return list of actions identifiers
 */
-void QtxActionMgr::idList( QIntList& lst ) const
+QIntList QtxActionMgr::idList() const
 {
-  lst = myActions.keys();
+  return myActions.keys();
 }
 
 /*!
-  \return true if updates are enabled
+  \brief Check if update is enabled.
+  \return \c true if update is enabled
+  \sa setUpdatesEnabled(), update()
 */
 bool QtxActionMgr::isUpdatesEnabled() const
 {
@@ -283,8 +254,9 @@ bool QtxActionMgr::isUpdatesEnabled() const
 }
 
 /*!
-  Enables/disables updates
-  \param upd - new state
+  \brief Enable/disable update operation.
+  \param upd new state
+  \sa isUpdatesEnabled(), update()
 */
 void QtxActionMgr::setUpdatesEnabled( const bool upd )
 {
@@ -292,39 +264,69 @@ void QtxActionMgr::setUpdatesEnabled( const bool upd )
 }
 
 /*!
-  \return true if action is visible (by default \return always true)
+  \brief Check if an action with \a actId identifier is visible to
+  the parent action with \a place identifier.
+
+  This method can be redefined in subclasses.
+  Base implementatin always returns \c true.
+
+  \param actId action ID
+  \param place some parent action ID
+  \return \c true if an action is visible to the parent
+  \sa setVisible()
 */
-bool QtxActionMgr::isVisible( const int, const int ) const
+bool QtxActionMgr::isVisible( const int /*actId*/, const int /*place*/ ) const
 {
   return true;
 }
 
 /*!
-  Sets visibility of action (by default, empty implementation)
+  \brief Set action's visibility flag.
+
+  This method can be redefined in subclasses.
+  Base implementatin does nothing.
+
+  \param actId action ID
+  \param place some parent action ID
+  \param v new visibility state
+  \sa isVisible()
 */
-void QtxActionMgr::setVisible( const int, const int, const bool )
+void QtxActionMgr::setVisible( const int /*actId*/, const int /*place*/, const bool /*v*/ )
 {
 }
 
 /*!
-  Updates actions, check isUpdatesEnabled() and call internalUpdate()
-  \sa isUpdatesEnabled(), internalUpdate()
+  \brief Update actions.
+
+  Calls virtual function internalUpdate to update the contents.
+  Does nothing if update is disabled.
+
+  \sa setUpdatesEnabled(), isUpdatesEnabled(), internalUpdate()
 */
 void QtxActionMgr::update()
 {
-  if ( isUpdatesEnabled() )
-    internalUpdate();
+  if ( !isUpdatesEnabled() )
+    return;
+
+  internalUpdate();
+  if ( myUpdTimer )
+    myUpdTimer->stop();
 }
 
 /*!
-  Real update (to be redefined in successors)
+  \brief Internal update.
+
+  This method is called by update() function and can be redefined 
+  in subclasses to customize update operation. Base implementation
+  does nothing.
 */
 void QtxActionMgr::internalUpdate()
 {
 }
 
 /*!
-  \return global free id
+  \brief Generate unique action identifier.
+  \return new ID
 */
 int QtxActionMgr::generateId() const
 {
@@ -333,8 +335,9 @@ int QtxActionMgr::generateId() const
 }
 
 /*!
-  \return true if action is enabled
-  \param id - action id
+  \brief Check is action with given \a id is enabled.
+  \param id action ID
+  \return \c true if action is enabled
 */
 bool QtxActionMgr::isEnabled( const int id ) const
 {
@@ -346,56 +349,111 @@ bool QtxActionMgr::isEnabled( const int id ) const
 }
 
 /*!
-  Enables/disables action
-  \param id - action id
-  \param en - new state
+  Enable/disable action with given \a id.
+  \param id action ID
+  \param enable new state
 */
-void QtxActionMgr::setEnabled( const int id, const bool en )
+void QtxActionMgr::setEnabled( const int id, const bool enable )
 {
   QAction* a = action( id );
   if ( a )
-    a->setEnabled( en );
+    a->setEnabled( enable );
 }
 
 /*!
-  \return action for separator
-  If this action doesn't exist, then it will be created
-  \param individual - if it is false, then action will be shared, otherwise it will be created on every call
+  \brief Create new separator action.
+
+  If \a own is \c true, then the caller is responsible for the action
+  destroying. If \a own is \c false, new separator action will be owned by the
+  action manager which will destroy it on application exit.
+
+  \param own ownership flag
+  \return new separator action
 */
-QAction* QtxActionMgr::separator( const bool individual )
+QAction* QtxActionMgr::separator( const bool own )
 {
-  if ( individual )
+  if ( own )
     return new SeparatorAction();
 
-  if ( !qtx_separator_action )
-  {
-    qtx_separator_action = new SeparatorAction();
+  if ( qtx_separator_actions.isEmpty() )
     qAddPostRoutine( qtxSeparatorActionCleanup );
+
+  SeparatorAction* a = new SeparatorAction();
+  qtx_separator_actions.append( a );
+
+  return a;
+}
+
+/*!
+  \brief Perform delayed update.
+
+  Does nothing if update is disabled.
+  \sa isUpdatesEnabled(), setUpdatesEnabled(), update()
+*/
+void QtxActionMgr::triggerUpdate()
+{
+  if ( !isUpdatesEnabled() )
+    return;
+
+  if ( !myUpdTimer )
+  {
+    myUpdTimer = new QTimer( this );
+    myUpdTimer->setSingleShot( true );
+    connect( myUpdTimer, SIGNAL( timeout() ), this, SLOT( onUpdateContent() ) );
   }
-  return qtx_separator_action;
+  myUpdTimer->stop();
+  // add timer event to event list
+  myUpdTimer->start( 0 );
 }
 
 /*!
-       Class: QtxActionMgr::Reader
-       Level: Public
+  \brief Internal content update operation.
+
+  Called automatically by onUpdateContent() when the delayed update
+  is triggered. Base implementation does nothing.
+
+  \sa triggerUpdate(), onUpdateContent()
+*/
+void QtxActionMgr::updateContent()
+{
+}
+
+/*!
+  \brief Called when delayed update is performed (via timer event).
+
+  Calls virtual method updateContent() which can be redefined in the
+  subclasses to customize the content update operation.
+*/
+void QtxActionMgr::onUpdateContent()
+{
+  updateContent();
+}
+
+/*!
+  \class QtxActionMgr::Reader
+  \brief Generic actions description files reader class.
+
+  This class is used to read files of some format to create actions 
+  and fill an action manager with the actions automatically.
 */
 
 /*!
-  Constructor
+  \brief Constructor.
 */
 QtxActionMgr::Reader::Reader()
 {
 }
 
 /*!
-  Destructor
+  \brief Destructor
 */
 QtxActionMgr::Reader::~Reader()
 {
 }
 
 /*!
-  \return list of options
+  \brief Get the list of options.
+  \return options list
 */
 QStringList QtxActionMgr::Reader::options() const
 {
@@ -403,9 +461,13 @@ QStringList QtxActionMgr::Reader::options() const
 }
 
 /*!
-  \return value of option
-  \param name - option name
-  \param def - default option value (is returned, if there is no such option)
+  \brief Get option value.
+  
+  If there is no such option the default value (\a def) is returned.
+
+  \param name option name
+  \param def default option value
+  \return option value
 */
 QString QtxActionMgr::Reader::option( const QString& name, const QString& def ) const
 {
@@ -416,18 +478,40 @@ QString QtxActionMgr::Reader::option( const QString& name, const QString& def )
 }
 
 /*!
-  Sets value of option
-  \param name option name
-  \param value - option value
+  \brief Set option value.
+  \param name option name
+  \param value new option value
 */
 void QtxActionMgr::Reader::setOption( const QString& name, const QString& value )
 {
   myOptions[ name ] = value;
 }
 
+/*!
+  \fn bool QtxActionMgr::Reader::read( const QString& fname, Creator& cr ) const
+  \brief Read the file and fill and action manager with actions 
+         by using help actions creator. 
+
+  This method should be redefined in the subclasses.
+  
+  \param fname XML file name
+  \param cr actions creator
+  \return \c true on success and \c false in case of error
+*/
+
+/*!
+  \class QtxActionMgr::XMLReader
+  \brief XML file reader.
+
+  This class is used to read files of XML format to create 
+  actions and fill an action manager with actions automatically.
+*/
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param root root XML tag name
+  \param item menu item XML tag name
+  \param dir resources directory (containing icons, etc)
 */
 QtxActionMgr::XMLReader::XMLReader( const QString& root,
                                     const QString& item,
@@ -449,25 +533,27 @@ QtxActionMgr::XMLReader::XMLReader( const QString& root,
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxActionMgr::XMLReader::~XMLReader()
 {
 }
 
 /*!
-  Reads file and fills action manager with help of creator
-  \param fname - file name
-  \param cr - creator
+  \brief Read the file and fill and action manager with actions 
+         by using actions creator.
+  \param fname XML file name
+  \param cr actions creator
+  \return \c true on success and \c false in case of error
 */
 bool QtxActionMgr::XMLReader::read( const QString& fname, Creator& cr ) const
 {
-  bool res = false;  
+  bool res = false;
 
 #ifndef QT_NO_DOM
 
   QFile file( fname );
-  if ( !file.open( IO_ReadOnly ) )
+  if ( !file.open( QFile::ReadOnly ) )
     return res;
 
   QDomDocument doc;
@@ -501,10 +587,10 @@ bool QtxActionMgr::XMLReader::read( const QString& fname, Creator& cr ) const
 }
 
 /*!
-  Create item by xml node
-  \param parent_node - parent node
-  \param parent_id - parent id
-  \param cr - creator
+  \brief Read XML mode and create an item if requied.
+  \param parent_node parent XML file node
+  \param parent_id parent action ID
+  \param cr actions creator
 */
 void QtxActionMgr::XMLReader::read( const QDomNode& parent_node,
                                     const int parent_id,
@@ -513,7 +599,7 @@ void QtxActionMgr::XMLReader::read( const QDomNode& parent_node,
   if( parent_node.isNull() )
     return;
 
-  QStringList items = QStringList::split( "|", option( QString( "menu_item" ) ) );
+  QStringList items = option( "menu_item" ).split( "|", QString::SkipEmptyParts );
 
   const QDomNodeList& children = parent_node.childNodes();
   for( int i=0, n=children.count(); i<n; i++ )
@@ -541,14 +627,17 @@ void QtxActionMgr::XMLReader::read( const QDomNode& parent_node,
 }
 
 /*!
-  \return true if node satisfies pattern
+  \brief Check node name correspondance to some pattern.
+  \param node XML file node
+  \param pattern node name pattern
+  \return \c true if node satisfies pattern
 */
 bool QtxActionMgr::XMLReader::isNodeSimilar( const QDomNode& node,
                                              const QString& pattern ) const
 {
   if( node.nodeName()==pattern )
     return true;
-  
+
   QDomDocument temp;
   QString mes;
   temp.setContent( pattern, true, &mes );
@@ -566,19 +655,30 @@ bool QtxActionMgr::XMLReader::isNodeSimilar( const QDomNode& node,
   return ok;
 }
 
+/*!
+  \class QtxActionMgr::Creator
+  \brief Generic actions creator class.
+
+  Used by Reader to create actions and fill in the action 
+  manager with the actions.
+*/
 
 /*!
-  \return integer value by attributes
-  \param attrs - attributes
-  \param name - name of attribute
-  \param def - default value (is returned on fail)
+  \brief Get integer attribute value from the attribute map.
+
+  Returns default value (\a def) if the attribute is not found.
+
+  \param attrs attributes map
+  \param name attribute name
+  \param def default attribute value
+  \return attribute value
 */
 int QtxActionMgr::Creator::intValue( const ItemAttributes& attrs,
                                      const QString& name, int def )
 {
   if( attrs.contains( name ) )
   {
-    bool ok; 
+    bool ok;
     int res = attrs[ name ].toInt( &ok );
     if( ok )
       return res;
@@ -587,10 +687,14 @@ int QtxActionMgr::Creator::intValue( const ItemAttributes& attrs,
 }
 
 /*!
-  \return string value by attributes
-  \param attrs - attributes
-  \param name - name of attribute
-  \param def - default value (is returned on fail)
+  \brief Get string attribute value from the attribute map.
+
+  Returns default value (\a def) if the attribute is not found.
+
+  \param attrs attributes map
+  \param name attribute name
+  \param def default attribute value
+  \return attribute value
 */
 QString QtxActionMgr::Creator::strValue( const ItemAttributes& attrs,
                                          const QString& name,
@@ -603,7 +707,8 @@ QString QtxActionMgr::Creator::strValue( const ItemAttributes& attrs,
 }
 
 /*!
-   Constructor
+  \brief Constructor.
+  \param r action reader
 */
 QtxActionMgr::Creator::Creator( QtxActionMgr::Reader* r )
 : myReader( r )
@@ -611,14 +716,15 @@ QtxActionMgr::Creator::Creator( QtxActionMgr::Reader* r )
 }
 
 /*!
-   Destructor
+  \brief Destructor.
 */
 QtxActionMgr::Creator::~Creator()
 {
 }
 
 /*!
-  \return corresponding reader
+  \brief Get actions reader.
+  \return actions reader
 */
 QtxActionMgr::Reader* QtxActionMgr::Creator::reader() const
 {
@@ -626,23 +732,29 @@ QtxActionMgr::Reader* QtxActionMgr::Creator::reader() const
 }
 
 /*!
-  Connects action to some slots (default implementation is empty)
+  \brief Connect action to some specific slot(s).
+
+  This method can be redefined in subclasses. 
+  Base implementation does nothing.
+
+  \param a action
 */
-void QtxActionMgr::Creator::connect( QAction* ) const
+void QtxActionMgr::Creator::connect( QAction* /*a*/ ) const
 {
 }
 
 /*!
-  Loads pixmap 
-  \param fname - file name
-  \param pix - to return loaded pixmap
+  \brief Load pixmap from the file.
+  \param fname file name
+  \param pix used to return pixmap
+  \return \c true if pixmap is loaded successfully and \c false in case of error
 */
 bool QtxActionMgr::Creator::loadPixmap( const QString& fname, QPixmap& pix ) const
 {
   if( !reader() )
     return false;
 
-  QStringList dirlist = QStringList::split( ";", reader()->option( "icons_dir", "." ) );
+  QStringList dirlist = reader()->option( "icons_dir", "." ).split( ";", QString::SkipEmptyParts );
   QStringList::const_iterator anIt = dirlist.begin(),
                               aLast = dirlist.end();
   bool res = false;
@@ -651,3 +763,19 @@ bool QtxActionMgr::Creator::loadPixmap( const QString& fname, QPixmap& pix ) con
 
   return res;
 }
+
+/*!
+  \fn int QtxActionMgr::Creator::append( const QString& tag, 
+                                         const bool subMenu, 
+                                         const ItemAttributes& attr,
+                                         const int pId )
+  \brief Create (and probably append to the action manager) new action.
+
+  This method should be redefined in the subclasses.
+  
+  \param tag item tag name
+  \param subMenu \c true if this item is submenu
+  \param attr attributes map
+  \param pId parent action ID
+  \return item (for example action) ID
+*/
index e0ba1d0e68dfa19c283879570709cc8f645770a2..f80591374626a5ec154c4c37058a6f2406945c65 100644 (file)
@@ -1,47 +1,45 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxActionMgr.h
-// Author:    Alexander SOLOVYEV, Sergey TELKOV
-
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
+//
 #ifndef QTXACTIONMGR_H
 #define QTXACTIONMGR_H
 
 #include "Qtx.h"
 
-#include <qmap.h>
-#include <qobject.h>
-#include <qguardedptr.h>
+#include <QMap>
+#include <QObject>
+#include <QPointer>
 
+class QTimer;
 class QAction;
 class QDomNode;
 
-
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
 
-/*!
-  \class QtxActionMgr
-  Contains set of actions accessible by id.
-  Base class for menu, popup creators and other action containers.
-*/
 class QTX_EXPORT QtxActionMgr : public QObject
 {
   Q_OBJECT 
@@ -68,7 +66,7 @@ public:
 
   int              count() const;
   bool             isEmpty() const;
-  void             idList( QIntList& ) const;
+  QIntList         idList() const;
 
   bool             isUpdatesEnabled() const;
   virtual void     setUpdatesEnabled( const bool );
@@ -87,23 +85,26 @@ protected:
   virtual void     internalUpdate();
   int              generateId() const;
 
+  void             triggerUpdate();
+  virtual void     updateContent();
+
+private slots:
+  void             onUpdateContent();
+
 private:
-  typedef QGuardedPtr<QAction> ActionPtr;
-  typedef QMap<int, ActionPtr> ActionMap;
+  typedef QPointer<QAction>    ActionPtr; //!< Action guarded pointer
+  typedef QMap<int, ActionPtr> ActionMap; //!< Actions map
 
 private:
-  bool             myUpdate;
-  ActionMap        myActions;
+  bool             myUpdate;     //!< update flag
+  ActionMap        myActions;    //!< actions map
+  QTimer*          myUpdTimer;   //!< update timer
 };
 
 
-QTX_EXPORT typedef QMap<QString, QString> ItemAttributes;
+QTX_EXPORT typedef QMap<QString, QString> ItemAttributes; //!< attributes map
 
-/*!
-  \class QtxActionMgr::Creator
-  Allows to fill automatically action manager with actions created by data from file
-*/
-class QtxActionMgr::Creator
+class QTX_EXPORT QtxActionMgr::Creator
 {
 public:
   Creator( QtxActionMgr::Reader* );
@@ -111,57 +112,47 @@ public:
 
   Reader* reader() const;
 
-  virtual int append( const QString&, const bool,
-                      const ItemAttributes&, const int ) = 0;
-  virtual void connect( QAction* ) const;
+  virtual int    append( const QString&, const bool,
+                        const ItemAttributes&, const int ) = 0;
+  virtual void   connect( QAction* ) const;
 
-  virtual bool loadPixmap( const QString&, QPixmap& ) const;
+  virtual bool   loadPixmap( const QString&, QPixmap& ) const;
 
 protected:
   static int     intValue( const ItemAttributes&, const QString&, const int );
   static QString strValue( const ItemAttributes&, const QString&,
-                                      const QString& = QString::null );
+                          const QString& = QString() );
 private:
-  QtxActionMgr::Reader*  myReader;
+  QtxActionMgr::Reader*  myReader;  //!< actions reader
 };
 
-/*!
-  \class QtxActionMgr::Reader
-  This class is used to read files of some format
-  to create actions and to fill action manager automatically
-*/
-class QtxActionMgr::Reader
+class QTX_EXPORT QtxActionMgr::Reader
 {
 public:
-  QTX_EXPORT Reader();
-  QTX_EXPORT virtual ~Reader();
+  Reader();
+  virtual ~Reader();
 
-  QTX_EXPORT QStringList  options() const;
-  QTX_EXPORT QString      option( const QString&, const QString& = QString::null ) const;
-  QTX_EXPORT void         setOption( const QString&, const QString& );
+  QStringList    options() const;
+  QString        option( const QString&, const QString& = QString() ) const;
+  void           setOption( const QString&, const QString& );
 
-  QTX_EXPORT virtual bool read( const QString&, Creator& ) const = 0;
+  virtual bool   read( const QString&, Creator& ) const = 0;
 
 private:
-  QMap< QString, QString > myOptions;
+  QMap< QString, QString > myOptions;  //!< options map
 };
 
-/*!
-  \class QtxActionMgr::Reader
-  This class is used to read files of XML format
-  to create actions and to fill action manager automatically
-*/
-class QtxActionMgr::XMLReader : public Reader
+class QTX_EXPORT QtxActionMgr::XMLReader : public Reader
 {
 public:
-  QTX_EXPORT XMLReader( const QString&, const QString&, const QString& );
-  QTX_EXPORT virtual ~XMLReader();
+  XMLReader( const QString&, const QString&, const QString& );
+  virtual ~XMLReader();
 
-  QTX_EXPORT virtual bool read( const QString&, Creator& ) const;
+  virtual bool   read( const QString&, Creator& ) const;
 
 protected:
-  QTX_EXPORT virtual void read( const QDomNode&, const int, Creator& ) const;
-  QTX_EXPORT virtual bool isNodeSimilar( const QDomNode&, const QString& ) const;
+  virtual void   read( const QDomNode&, const int, Creator& ) const;
+  virtual bool   isNodeSimilar( const QDomNode&, const QString& ) const;
 };
 
 
diff --git a/src/Qtx/QtxActionSet.cxx b/src/Qtx/QtxActionSet.cxx
new file mode 100644 (file)
index 0000000..e43e700
--- /dev/null
@@ -0,0 +1,410 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxActionSet.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxActionSet.h"
+
+#include <QApplication>
+
+/*!
+  \class QtxActionSet
+  \brief An action class which is represented in the menu bar (or toolbar) as
+  a group of items (which can be customized).
+
+  Example: Window menu in the MDI application with menu items:
+  - Cascade
+  - Tile vertically
+  - Tile horizontally
+  - <separator>
+  - Window1
+  - Window2
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent object
+*/
+QtxActionSet::QtxActionSet( QObject* parent )
+: QtxAction( parent )
+{
+  connect( this, SIGNAL( changed() ), this, SLOT( onChanged() ) );
+
+  setVisible( false );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxActionSet::~QtxActionSet()
+{
+}
+
+/*!
+  \brief Get list of child actions.
+  \return list of assigned actions
+*/
+QList<QAction*> QtxActionSet::actions() const
+{
+  return mySet;
+}
+
+/*!
+  \brief Assign child actions.
+  \param lst list of actions
+*/
+void QtxActionSet::setActions( const QList<QAction*>& lst )
+{
+  for ( ActionList::iterator it = mySet.begin(); it != mySet.end(); ++it )
+  {
+    if ( !lst.contains( *it ) )
+      delete *it;
+  }
+
+  mySet.clear();
+
+  insertActions( lst );
+}
+
+/*!
+  \brief Insert actions at the specified position.
+  \param lst list of actions
+  \param index position in the action list (if < 0, items are appended to the end of list)
+*/
+void QtxActionSet::insertActions( const QList<QAction*>& lst, const int index )
+{
+  int idx = qMin( index < 0 ? mySet.count() : index, mySet.count() );
+
+  for ( QList<QAction*>::const_iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    QAction* a = *it;
+    int ident = generateId();
+
+    a->setParent( this );
+    mySet.insert( idx++, a );
+    a->setData( ident );
+
+    connect( a, SIGNAL( triggered( bool ) ), this, SLOT( onActionTriggered( bool ) ) );
+  }
+
+  updateAction();
+}
+
+/*!
+  \brief Insert action at the specified position.
+
+  If \a id < 0, it is generated automatically.
+
+  \param a action being inserted
+  \param id action ID
+  \param index position in the action list (if < 0, item is appended to the end of list)
+  \return action identifier
+*/
+int QtxActionSet::insertAction( QAction* a, const int id, const int index )
+{
+  if ( !a )
+    return -1;
+
+  int ident = id < 0 ? generateId() : id;
+  int idx = qMin( index < 0 ? mySet.count() : index, mySet.count() );
+
+  a->setParent( this );
+  mySet.insert( idx, a );
+  a->setData( ident );
+
+  connect( a, SIGNAL( triggered( bool ) ), this, SLOT( onActionTriggered( bool ) ) );
+
+  actionAdded( a );
+
+  updateAction();
+
+  return ident;
+}
+
+/*!
+  \brief Insert action at the specified position.
+
+  If \a id < 0, it is generated automatically.
+
+  \param txt action text
+  \param id action ID
+  \param index position in the action list (if < 0, item is appended to the end of list)
+  \return action identifier
+*/
+int QtxActionSet::insertAction( const QString& txt, const int id, const int index )
+{
+  return insertAction( new QtxAction( txt, txt, 0, this ), id, index );
+}
+
+/*!
+  \brief Insert action at the specified position.
+
+  If \a id < 0, it is generated automatically.
+
+  \param txt action text
+  \param icon action icon
+  \param id action ID
+  \param index position in the action list (if < 0, item is appended to the end of list)
+  \return action identifier
+*/
+int QtxActionSet::insertAction( const QString& txt, const QIcon& icon, const int id, const int index )
+{
+  return insertAction( new QtxAction( txt, icon, txt, 0, this ), id, index );
+}
+
+/*!
+  \brief Remove specified action.
+
+  An action is removed from the action list and destroyed.
+
+  \param a action to be removed.
+*/
+void QtxActionSet::removeAction( QAction* a )
+{
+  if ( !mySet.contains( a ) )
+    return;
+
+  mySet.removeAll( a );
+  actionRemoved( a );
+  delete a;
+}
+
+/*!
+  \brief Remove specified action.
+
+  An action is removed from the action list and destroyed.
+
+  \param id action identifier
+*/
+void QtxActionSet::removeAction( const int id )
+{
+  removeAction( action( id ) );
+}
+
+/*!
+  \brief Remove all actions.
+
+  An actions list is cleared and all actions are destroyed.
+*/
+void QtxActionSet::clear()
+{
+  qDeleteAll( mySet );
+  mySet.clear();
+
+  updateAction();
+}
+
+/*!
+  \brief Called when action is changed.
+
+  Update action state.
+*/
+void QtxActionSet::onChanged()
+{
+  QList<QWidget*> lst = createdWidgets();
+  for ( QList<QWidget*>::iterator it = lst.begin(); it != lst.end(); ++it )
+    (*it)->setEnabled( isEnabled() );
+
+  if ( !isVisible() || !isEmptyAction() )
+    return;
+
+  bool block = signalsBlocked();
+  blockSignals( true );
+  setVisible( false );
+  blockSignals( block );
+}
+
+/*!
+  \brief Called when some action is activated by the user.
+  \param on toggled state (not used)
+*/
+void QtxActionSet::onActionTriggered( bool /*on*/ )
+{
+  QAction* a = ::qobject_cast<QAction*>( sender() );
+  if ( !a )
+    return;
+
+  int id = actionId( a );
+  if ( id != -1 )
+    emit triggered( id );
+  emit triggered( a );
+}
+
+/*!
+  \brief Called when this action set is added to the menu bar (or toolbar).
+  \param w widget this action set is added to
+*/
+void QtxActionSet::addedTo( QWidget* w )
+{
+  QtxAction::addedTo( w );
+
+  updateAction( w );
+}
+
+/*!
+  \brief Called when this action set is removed from the menu bar (or toolbar).
+  \param w widget this action set is removed from
+*/
+void QtxActionSet::removedFrom( QWidget* w )
+{
+  QtxAction::removedFrom( w );
+
+  updateAction( w );
+}
+
+/*!
+  \brief Get action by specified identifier.
+  \param id action ID
+  \return action or 0 if it is not found
+*/
+QAction* QtxActionSet::action( int id ) const
+{
+  QAction* a = 0;
+  for ( ActionList::const_iterator it = mySet.begin(); it != mySet.end() && !a; ++it )
+  {
+    if ( actionId( *it ) == id )
+      a = *it;
+  }
+  return a;
+}
+
+/*!
+  \brief Get action identifier for the action.
+  \param a action
+  \return action ID or -1 if it is not found
+*/
+int QtxActionSet::actionId( QAction* a ) const
+{
+  int id = -1;
+  if ( a && a->data().canConvert( QVariant::Int ) )
+    id = a->data().toInt();
+  return id;
+}
+
+/*!
+  \brief Set action identifier for the action.
+  \param a action
+  \param id new action ID
+*/
+void QtxActionSet::setActionId( QAction* a, const int id )
+{
+  if ( !a || id == -1 )
+    return;
+
+  a->setData( id );
+}
+
+/*!
+  \brief Notify that action was added
+*/
+void QtxActionSet::actionAdded( QAction* )
+{
+}
+
+/*!
+  \brief Notify that action was removed
+*/
+void QtxActionSet::actionRemoved( QAction* )
+{
+}
+
+/*!
+  \brief Getneration unique action identifier
+  \return generation action ID
+*/
+int QtxActionSet::generateId() const
+{
+  QMap<int, int> map;
+  for ( ActionList::const_iterator it = mySet.begin(); it != mySet.end(); ++it )
+    map.insert( (*it)->data().toInt(), 0 );
+
+  int id = -2;
+  while ( map.contains( id ) )
+    id--;
+
+  return id;
+}
+
+/*!
+  \brief Update action set.
+*/
+void QtxActionSet::updateAction()
+{
+  QList<QWidget*> lst = associatedWidgets();
+  for ( QList<QWidget*>::iterator it = lst.begin(); it != lst.end(); ++it )
+    updateAction( *it );
+}
+
+/*!
+  \brief Update action set for the specified widget.
+  \param w a widget this action is added to
+*/
+void QtxActionSet::updateAction( QWidget* w )
+{
+  if ( !w )
+    return;
+
+  for ( ActionList::iterator it = mySet.begin(); it != mySet.end(); ++it )
+    w->removeAction( *it );
+
+  if ( !w->actions().contains( this ) )
+    return;
+
+  QAction* first = 0;
+  for ( int i = 0; i < mySet.count(); i++ )
+  {
+    QAction* a = mySet.at( i );
+    if ( !first )
+      first = a;
+    w->insertAction( this, a );
+  }
+  if ( first )
+  {
+    QApplication::instance()->removeEventFilter( this );
+
+    w->insertAction( first, this );
+
+    QApplication::instance()->installEventFilter( this );
+  }
+}
+
+/*!
+  \brief Check if the action itself should be invisible
+  (only child action are shown)
+  \return \c true if the action itself should be visible
+*/
+bool QtxActionSet::isEmptyAction() const
+{
+  return true;
+}
+
+/*!
+  \fn void QtxActionSet::triggered( int id );
+  \brief Emitted when some child action is activated by the user.
+  \param action ID
+*/
+
+/*!
+  \fn void QtxActionSet::triggered( QAction* a );
+  \brief Emitted when some child action is activated by the user.
+  \param a action being activated
+*/
diff --git a/src/Qtx/QtxActionSet.h b/src/Qtx/QtxActionSet.h
new file mode 100644 (file)
index 0000000..952a849
--- /dev/null
@@ -0,0 +1,96 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxActionSet.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXACTIONSET_H
+#define QTXACTIONSET_H
+
+#include "QtxAction.h"
+
+#include <QList>
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+class QTX_EXPORT QtxActionSet : public QtxAction
+{
+  Q_OBJECT
+
+public:
+  QtxActionSet( QObject* = 0 );
+  virtual ~QtxActionSet();
+
+  QList<QAction*> actions() const;
+  void            setActions( const QList<QAction*>& );
+
+  void            insertActions( const QList<QAction*>&, const int = -1 );
+
+  int             insertAction( QAction*, const int id = -1, const int = -1 );
+  int             insertAction( const QString&, const int id = -1, const int = -1 );
+  int             insertAction( const QString&, const QIcon&, const int id = -1, const int = -1 );
+
+  void            removeAction( QAction* );
+  void            removeAction( const int );
+
+  void            clear();
+
+signals:
+  void            triggered( int );
+  void            triggered( QAction* );
+
+private slots:
+  void            onChanged();
+  void            onActionTriggered( bool = false );
+
+protected:
+  virtual void    addedTo( QWidget* );
+  virtual void    removedFrom( QWidget* );
+
+  virtual void    actionAdded( QAction* );
+  virtual void    actionRemoved( QAction* );
+
+  QAction*        action( int ) const;
+  int             actionId( QAction* ) const;
+  void            setActionId( QAction*, const int );
+
+  virtual bool    isEmptyAction() const;
+
+  virtual void    updateAction();
+  virtual void    updateAction( QWidget* );
+
+private:
+  int             generateId() const;
+
+private:
+  typedef QList<QAction*> ActionList;
+
+private:
+  ActionList      mySet;      //!< actions list
+};
+
+#ifdef WIN32
+#pragma warning( default:4251 )
+#endif
+
+#endif
index 9ce5696135d7063fb694cfaf8654d8f8386e178e..8f3b8804eb4af2b221e72503c9dee68fbb8e7a42 100644 (file)
@@ -1,50 +1,86 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxActionToolMgr.cxx
-// Author:    Alexander SOLOVYEV, Sergey TELKOV
-
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
+//
 #include "QtxActionToolMgr.h"
 
 #include "QtxAction.h"
 #include "QtxToolBar.h"
 
-#include <qmainwindow.h>
-#include <qobjectlist.h>
+#include <QMainWindow>
+
+/*!
+  \class QtxActionToolMgr::ToolNode
+  \brief Represents a toolbutton inside toolbar structure.
+  \internal
+*/
 
 /*!
-  Constructor
+  \fn QtxActionToolMgr::ToolNode::ToolNode()
+  \internal
+  \brief Default constructor.
+*/
+
+/*!
+  \fn QtxActionToolMgr::ToolNode::ToolNode( const int _id )
+  \brief Constructor.
+  \internal
+  \param _id toolbar node ID
+*/
+
+/*!
+  \class QtxActionToolMgr
+  \brief Toolbar actions manager.
+  
+  Toolbar manager allows using of set of action for automatic generating of
+  application toolbars and dynamic update of toolbars contents.
+
+  Use insert(), append() and remove() methods to create toolbar and add actions to it.
+  Methods show(), hide() allow displaying/erasing of specified toolbar items.
+
+  Toolbar manager automatically optimizes toolbars by removing extra separators, etc.
+*/
+
+/*!
+  \brief Constructor.
+  \param p parent main window
 */
 QtxActionToolMgr::QtxActionToolMgr( QMainWindow* p )
 : QtxActionMgr( p ),
-myMainWindow( p )
+  myMainWindow( p )
 {
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxActionToolMgr::~QtxActionToolMgr()
 {
 }
 
 /*!
-  \return desktop
+  \brief Get parent main window.
+  \return main window pointer
 */
 QMainWindow* QtxActionToolMgr::mainWindow() const
 {
@@ -52,26 +88,33 @@ QMainWindow* QtxActionToolMgr::mainWindow() const
 }
 
 /*!
-  Creates toolbar 
-  \return id of just created toolbar
-  \param name - name of toolbar
-  \param tid - proposed id (if such id is used already, then it will be returned without creation)
+  \brief Create toolbar and assign \a id to it.
+
+  If \a tid is less than 0, the identifier is generated automatically.
+  If toolbar with given \a tid is already registered, the toolbar will not be created.
+
+  \param title toolbar title
+  \param tid requested toolbar ID
+  \param mw parent main window; if it is null, the tool manager's main window is used
+  \return id of created/found toolbar
 */
-int QtxActionToolMgr::createToolBar( const QString& name, const int tid )
+int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainWindow* mw )
 {
   static int _toolBarId = -1;
 
   int tbId = -1;
   for ( ToolBarMap::ConstIterator it = myToolBars.begin(); it != myToolBars.end() && tbId == -1; ++it )
   {
-    if ( it.data().toolBar->label().lower() == name.lower() )
+    if( it.value().toolBar->windowTitle().toLower() == title.toLower() &&
+        ( !mw || it.value().toolBar->parent()==mw ) )
       tbId = it.key();
   }
 
   if ( tbId != -1 )
     return tbId;
 
-  QToolBar* tb = find( name, mainWindow() );
+  QMainWindow* tbw = mw ? mw : mainWindow();
+  QToolBar* tb = find( title, tbw );
 
   tbId = tid < 0 ? --_toolBarId : tid;
 
@@ -80,9 +123,12 @@ int QtxActionToolMgr::createToolBar( const QString& name, const int tid )
 
   if ( !tb )
   {
-    tb = new QtxToolBar( true, mainWindow() );
-    tb->setLabel( name );
-  }
+    tb = new QtxToolBar( true, tbw );
+    //mainWindow()->addToolBar( tb );
+    tb->setWindowTitle( title );
+    tb->setObjectName( title );
+    tb->setToolTip( title );
+   }
 
   tInfo.toolBar = tb;
   connect( tInfo.toolBar, SIGNAL( destroyed() ), this, SLOT( onToolBarDestroyed() ) );
@@ -91,34 +137,31 @@ int QtxActionToolMgr::createToolBar( const QString& name, const int tid )
 }
 
 /*!
-  \return toolbar by title
-  \param label - toolbar title
-  \param mw - desktop
+  \brief Search toolbar with given \a title owned by main window \mw. 
+  \param title toolbar title
+  \param mw main window
+  \return toolbar or 0 if it is not found
 */
-QToolBar* QtxActionToolMgr::find( const QString& label, QMainWindow* mw ) const
+QToolBar* QtxActionToolMgr::find( const QString& title, QMainWindow* mw ) const
 {
   if ( !mw )
     return 0;
 
-  QString pattern = label.lower();
+  QString pattern = title.toLower();
 
   QToolBar* res = 0;
-  QPtrList<QDockWindow> lst = mw->dockWindows();
-  for ( QPtrListIterator<QDockWindow> it( lst ); it.current() && !res; ++it )
+  QList<QToolBar*> toolbars = qFindChildren<QToolBar*>( mw );
+  for ( QList<QToolBar*>::iterator it = toolbars.begin(); it != toolbars.end() && !res; ++it )
   {
-    if ( !it.current()->inherits( "QToolBar" ) )
-      continue;
-
-    QToolBar* cur = (QToolBar*)it.current();
-    if ( cur->label().lower() == pattern )
-      res = cur;
+    if ( (*it)->windowTitle().toLower() == pattern )
+      res = *it;
   }
   return res;
 }
 
 /*!
-  Removes toolbar
-  \param tid - toolbar id
+  \brief Remove toolbar.
+  \param tid toolbar ID
 */
 void QtxActionToolMgr::removeToolBar( const int tid )
 {
@@ -130,76 +173,80 @@ void QtxActionToolMgr::removeToolBar( const int tid )
 }
 
 /*!
-  Removes toolbar
-  \param tname - toolbar name
+  \brief Remove toolbar.
+  \param title toolbar title
 */
-void QtxActionToolMgr::removeToolBar( const QString& tname )
+void QtxActionToolMgr::removeToolBar( const QString& title )
 {
-  removeToolBar( find( tname ) );
+  removeToolBar( find( title ) );
 }
 
 /*!
-  Insert action into toolbar
-  \param id - identificator of action
-  \param tId - identificator of toolbar
-  \param idx - position inside toolbar
+  \brief Insert action into toolbar.
+  \param id action ID
+  \param tid toolbar ID
+  \param idx action index in the toolbar (if < 0, action is appended to the end)
+  \return action ID
 */
 int QtxActionToolMgr::insert( const int id, const int tid, const int idx )
 {
   if ( !contains( id ) || !hasToolBar( tid ) )
     return -1;
-
+/*
   if ( containsAction( id, tid ) )
     remove( id, tid );
-
-  ToolNode node;
-  node.id = id;
+*/
+  ToolNode node( id );
 
   NodeList& list = myToolBars[tid].nodes;
-  int index = idx < 0 ? list.count() : QMIN( idx, (int)list.count() );
-  list.insert( list.at( index ), node );
-  updateToolBar( tid );
+  int index = idx < 0 ? list.count() : qMin( idx, (int)list.count() );
+  list.insert( index, node );
+  triggerUpdate( tid );
 
   return id;
 }
 
 /*!
-  Insert action into toolbar
-  \param act - action
-  \param tId - identificator of toolbar
-  \param pos - position inside toolbar
+  \brief Insert action into toolbar.
+  \param a action
+  \param tid toolbar ID
+  \param idx action index in the toolbar (if < 0, action is appended to the end)
+  \return action ID
 */
-int QtxActionToolMgr::insert( QAction* act, const int tid, const int pos )
+int QtxActionToolMgr::insert( QAction* a, const int tid, const int idx )
 {
-  return insert( registerAction( act ), tid, pos );
+  return insert( registerAction( a ), tid, idx );
 }
 
 /*!
-  Insert action into toolbar
-  \param id - identificator of action
-  \param tname - name of toolbar
-  \param pos - position inside toolbar
+  \brief Insert action into toolbar.
+  \param id action ID
+  \param title toolbar title
+  \param idx action index in the toolbar (if < 0, action is appended to the end)
+  \return action ID
 */
-int QtxActionToolMgr::insert( const int id, const QString& tname, const int pos )
+int QtxActionToolMgr::insert( const int id, const QString& title, const int idx )
 {
-  return insert( id, createToolBar( tname ), pos );
+  return insert( id, createToolBar( title ), idx );
 }
 
 /*!
-  Insert action into toolbar
-  \param act - action
-  \param tname - name of toolbar
-  \param pos - position inside toolbar
+  \brief Insert action into toolbar.
+  \param a action
+  \param title toolbar title
+  \param idx action index in the toolbar (if < 0, action is appended to the end)
+  \return action ID
 */
-int QtxActionToolMgr::insert( QAction* act, const QString& tname, const int pos )
+int QtxActionToolMgr::insert( QAction* a, const QString& title, const int idx )
 {
-  return insert( registerAction( act ), createToolBar( tname ), pos );
+  return insert( registerAction( a ), createToolBar( title ), idx );
 }
 
 /*!
-  Append action into toolbar as last toolbutton
-  \param id - identificator of action
-  \param tId - identificator of toolbar
+  \brief Append action to the end of toolbar.
+  \param id action ID
+  \param tid toolbar ID
+  \return action ID
 */
 int QtxActionToolMgr::append( const int id, const int tid )
 {
@@ -207,39 +254,43 @@ int QtxActionToolMgr::append( const int id, const int tid )
 }
 
 /*!
-  Append action into toolbar as last toolbutton
-  \param act - action
-  \param tId - identificator of toolbar
+  \brief Append action to the end of toolbar.
+  \param a action
+  \param tid toolbar ID
+  \return action ID
 */
-int QtxActionToolMgr::append( QAction* act, const int tid )
+int QtxActionToolMgr::append( QAction* a, const int tid )
 {
-  return insert( act, tid );
+  return insert( a, tid );
 }
 
 /*!
-  Append action into toolbar as last toolbutton
-  \param id - identificator of action
-  \param tname - toolbar name
+  \brief Append action to the end of toolbar.
+  \param id action ID
+  \param title toolbar title
+  \return action ID
 */
-int QtxActionToolMgr::append( const int id, const QString& tname )
+int QtxActionToolMgr::append( const int id, const QString& title )
 {
-  return insert( id, tname );
+  return insert( id, title );
 }
 
 /*!
-  Append action into toolbar as last toolbutton
-  \param act - action
-  \param tname - toolbar name
+  \brief Append action to the end of toolbar.
+  \param a action
+  \param title toolbar title
+  \return action ID
 */
-int QtxActionToolMgr::append( QAction* act, const QString& tname )
+int QtxActionToolMgr::append( QAction* a, const QString& title )
 {
-  return insert( act, tname );
+  return insert( a, title );
 }
 
 /*!
-  Append action into toolbar as first toolbutton
-  \param id - identificator of action
-  \param tId - identificator of toolbar
+  \brief Insert action to the beginning of toolbar.
+  \param id action ID
+  \param tid toolbar ID
+  \return action ID
 */
 int QtxActionToolMgr::prepend( const int id, const int tid )
 {
@@ -247,39 +298,42 @@ int QtxActionToolMgr::prepend( const int id, const int tid )
 }
 
 /*!
-  Append action into toolbar as first toolbutton
-  \param act - action
-  \param tId - identificator of toolbar
+  \brief Insert action to the beginning of toolbar.
+  \param a action
+  \param tid toolbar ID
+  \return action ID
 */
-int QtxActionToolMgr::prepend( QAction* act, const int tid )
+int QtxActionToolMgr::prepend( QAction* a, const int tid )
 {
-  return insert( act, tid, 0 );
+  return insert( a, tid, 0 );
 }
 
 /*!
-  Append action into toolbar as first toolbutton
-  \param id - identificator of action
-  \param tname - toolbar name
+  \brief Insert action to the beginning of toolbar.
+  \param id action ID
+  \param title toolbar title
+  \return action ID
 */
-int QtxActionToolMgr::prepend( const int id, const QString& tname )
+int QtxActionToolMgr::prepend( const int id, const QString& title )
 {
-  return insert( id, tname, 0 );
+  return insert( id, title, 0 );
 }
 
 /*!
-  Append action into toolbar as first toolbutton
-  \param act - action
-  \param tname - toolbar name
+  \brief Insert action to the beginning of toolbar.
+  \param a action ID
+  \param title toolbar title
+  \return action ID
 */
-int QtxActionToolMgr::prepend( QAction* act, const QString& tname )
+int QtxActionToolMgr::prepend( QAction* a, const QString& title )
 {
-  return insert( act, tname, 0 );
+  return insert( a, title, 0 );
 }
 
 /*!
-  Remove action from toolbar
-  \param id - identificator of action
-  \param tId - identificator of toolbar
+  \brief Remove action from toolbar.
+  \param id action ID
+  \param tid toolbar ID
 */
 void QtxActionToolMgr::remove( const int id, const int tid )
 {
@@ -296,22 +350,23 @@ void QtxActionToolMgr::remove( const int id, const int tid )
 
   myToolBars[tid].nodes = newList;
 
-  updateToolBar( tid );
+  triggerUpdate( tid );
 }
 
 /*!
-  Remove action from toolbar
-  \param id - identificator of action
-  \param tname - name of toolbar
+  \brief Remove action from toolbar.
+  \param id action ID
+  \param title toolbar title
 */
-void QtxActionToolMgr::remove( const int id, const QString& tname )
+void QtxActionToolMgr::remove( const int id, const QString& title )
 {
-  remove( id, find( tname ) );
+  remove( id, find( title ) );
 }
 
 /*!
-  \return toolbar by it's id
-  \param tId - identificator of toolbar
+  \brief Get toolbar by given \a tid.
+  \param tid toolbar ID
+  \return toolbar or 0 if it is not found
 */
 QToolBar* QtxActionToolMgr::toolBar( const int tid ) const
 {
@@ -322,17 +377,19 @@ QToolBar* QtxActionToolMgr::toolBar( const int tid ) const
 }
 
 /*!
-  \return toolbar by it's name
-  \param tname - name of toolbar
+  \brief Get toolbar by given \a title.
+  \param title toolbar title
+  \return toolbar or 0 if it is not found
 */
-QToolBar* QtxActionToolMgr::toolBar( const QString& tname ) const
+QToolBar* QtxActionToolMgr::toolBar( const QString& title ) const
 {
-  return toolBar( find( tname ) );
+  return toolBar( find( title ) );
 }
 
 /*!
-  \return true if manager contains toolbar with such id
-  \param tId - identificator of toolbar
+  \brief Check if toolbar with given \a id already registered.
+  \param tid toolbar ID
+  \return \c true if toolbar is registered in the toolbar manager
 */
 bool QtxActionToolMgr::hasToolBar( const int tid ) const
 {
@@ -340,25 +397,28 @@ bool QtxActionToolMgr::hasToolBar( const int tid ) const
 }
 
 /*!
-  \return true if manager contains toolbar with such name
-  \param tname - name of toolbar
+  \brief Check if toolbar with given \a id already registered.
+  \param title toolbar title
+  \return \c true if toolbar is registered in the toolbar manager
 */
-bool QtxActionToolMgr::hasToolBar( const QString& tname ) const
+bool QtxActionToolMgr::hasToolBar( const QString& title ) const
 {
-  return find( tname ) != -1;
+  return find( title ) != -1;
 }
 
 /*!
-  \return true if toolbar contains action
-  \param id - identificator of action
-  \param tId - identificator of toolbar
+  \brief Check if toolbar contains given action.
+  \param id action ID
+  \param tid toolbar ID
+  \return \c true if toolbar contains action
 */
 bool QtxActionToolMgr::containsAction( const int id, const int tid ) const
 {
   for ( ToolBarMap::ConstIterator it = myToolBars.begin(); it != myToolBars.end(); ++it )
   {
-    if ( tid == -1 || it.key() == tid ) {
-      const NodeList& list = it.data().nodes;
+    if ( tid == -1 || it.key() == tid )
+    {
+      const NodeList& list = it.value().nodes;
       for ( NodeList::const_iterator nit = list.begin(); nit != list.end(); ++nit )
        if ( (*nit).id == id )
          return true;
@@ -368,7 +428,9 @@ bool QtxActionToolMgr::containsAction( const int id, const int tid ) const
 }
 
 /*!
-  SLOT: called when toolbar is destroyed, removes just destroyed toolbar from map
+  \brief Called when toolbar is destroyed.
+
+  Clears internal pointer to the toolbar to disable crashes.
 */
 void QtxActionToolMgr::onToolBarDestroyed()
 {
@@ -376,112 +438,126 @@ void QtxActionToolMgr::onToolBarDestroyed()
 }
 
 /*!
-  \return id of toolbar by it's name
-  \param tname - name of toolbar
+  \brief Search toolbar by given \a name.
+  \param title toolbar title
+  \return toolbar ID or -1 if it is not found
 */
-int QtxActionToolMgr::find( const QString& tname ) const
+int QtxActionToolMgr::find( const QString& title ) const
 {
   int id = -1;
   for ( ToolBarMap::ConstIterator it = myToolBars.begin(); it != myToolBars.end() && id == -1; ++it )
   {
-    if ( it.data().toolBar->label() == tname )
+    if ( it.value().toolBar->windowTitle() == title )
       id = it.key();
   }
   return id;
 }
 
 /*!
-  \return id of toolbar
-  \param t - toolbar
+  \brief Get toolbar identifier.
+  \param tb toolbar
+  \return toolbar ID or -1 if toolbar is not registered
 */
-int QtxActionToolMgr::find( QToolBar* t ) const
+int QtxActionToolMgr::find( QToolBar* tb ) const
 {
   int id = -1;
   for ( ToolBarMap::ConstIterator it = myToolBars.begin(); it != myToolBars.end() && id == -1; ++it )
   {
-    if ( it.data().toolBar == t )
+    if ( it.value().toolBar == tb )
       id = it.key();
   }
   return id;
 }
 
 /*!
-  Updates toolbar
-  \param tId - toolbar id
+  \brief Update toolbar.
+  \param tid toolbar ID
 */
-void QtxActionToolMgr::updateToolBar( const int tId )
+void QtxActionToolMgr::updateToolBar( const int tid )
 {
   if ( !isUpdatesEnabled() )
     return;
 
-  if ( !myToolBars.contains( tId ) )
+  if ( !myToolBars.contains( tid ) )
     return;
 
-  QToolBar* tb = myToolBars[tId].toolBar;
-  const NodeList& list = myToolBars[tId].nodes;
+  QToolBar* tb = myToolBars[tid].toolBar;
+  const NodeList& list = myToolBars[tid].nodes;
 
   for ( NodeList::const_iterator it = list.begin(); it != list.end(); ++it )
   {
     QAction* a = action( (*it).id );
-    if ( a )
-      a->removeFrom( tb );
+    tb->removeAction( a );
+//    if ( a )
+//      a->removeFrom( tb );
   }
 
   tb->clear();
 
   for ( NodeList::const_iterator itr = list.begin(); itr != list.end(); ++itr )
   {
-    if ( !isVisible( (*itr).id, tId ) )
+    if ( !isVisible( (*itr).id, tid ) )
       continue;
 
     QAction* a = action( (*itr).id );
-    if ( a )
-      a->addTo( tb );
+    tb->addAction( a );
+//    if ( a )
+//      a->addTo( tb );
   }
 
   simplifySeparators( tb );
+  
+  // fix of 19921 -->
+  if ( !tb->isVisible() )
+    tb->adjustSize();
+  // fix of 19921 <--
 }
 
 /*!
-  Updates all toolbars
+  \brief Update all registered toolbars.
 */
 void QtxActionToolMgr::internalUpdate()
 {
+  if ( !isUpdatesEnabled() )
+    return;
+
   for ( ToolBarMap::ConstIterator it1 = myToolBars.begin(); it1 != myToolBars.end(); ++it1 )
     updateToolBar( it1.key() );
+
+  myUpdateIds.clear();
 }
 
 /*!
-  Removes excess separators from toolbar
+  \brief Remove extra separators from the toolbar.
+  \param tb toolbar
 */
-void QtxActionToolMgr::simplifySeparators( QToolBar* t )
+void QtxActionToolMgr::simplifySeparators( QToolBar* tb )
 {
-  if ( t )
-    Qtx::simplifySeparators( t );
+  Qtx::simplifySeparators( tb );
 }
 
 /*!
-  Shows action in all toolbars
-  \param actId - action id
+  \brief Show action (in all toolbars).
+  \param id action ID
 */
-void QtxActionToolMgr::show( const int actId )
+void QtxActionToolMgr::show( const int id )
 {
-  setShown( actId, true );
+  setShown( id, true );
 }
 
 /*!
-  Hides action in all toolbars
-  \param actId - action id
+  \brief Hide action (in all toolbars).
+  \param id action ID
 */
-void QtxActionToolMgr::hide( const int actId )
+void QtxActionToolMgr::hide( const int id )
 {
-  setShown( actId, false );
+  setShown( id, false );
 }
 
 /*!
-  Changes shown status of action in all toolbars
-  \param id - action id
-  \param on - new shown status
+  \brief Set visibility status for toolbar action with given \a id.
+  \param id action ID
+  \param on new visibility status
 */
 void QtxActionToolMgr::setShown( const int id, const bool on )
 {
@@ -490,15 +566,16 @@ void QtxActionToolMgr::setShown( const int id, const bool on )
 }
 
 /*!
-  \return true if action is shown in all toolbars
-  \param id - action id
+  \brief Get visibility status for toolbar action with given \a id.
+  \param id action ID
+  \return \c true if action is shown in all toolbars
 */
 bool QtxActionToolMgr::isShown( const int id ) const
 {
-  QPtrList<ToolNode> nodes;
+  QList<const ToolNode*> nodes;
   for ( ToolBarMap::ConstIterator it = myToolBars.begin(); it != myToolBars.end(); ++it )
   {
-    const NodeList& nl = it.data().nodes;
+    const NodeList& nl = it.value().nodes;
     for ( NodeList::const_iterator itr = nl.begin(); itr != nl.end(); ++itr )
     {
       const ToolNode& node = *itr;
@@ -511,46 +588,48 @@ bool QtxActionToolMgr::isShown( const int id ) const
     return false;
 
   bool vis = true;
-  for ( QPtrListIterator<ToolNode> itr( nodes ); itr.current() && vis; ++itr )
-    vis = itr.current()->visible;
+  for ( QList<const ToolNode*>::iterator itr = nodes.begin(); itr != nodes.end() && vis; ++itr )
+    vis = (*itr)->visible;
 
   return vis;
 }
 
 /*!
-  \return shown status of action in toolbar
-  \param id - action id
-  \param tId - toolbar id
+  \brief Check if an action with given \a id is visible in the toolbar \a tid.
+  \param id action ID
+  \param tid toolbar ID
+  \return \c true if action is shown in the toolbar
 */
-bool QtxActionToolMgr::isVisible( const int id, const int tId ) const
+bool QtxActionToolMgr::isVisible( const int id, const int tid ) const
 {
-  if ( !myToolBars.contains( tId ) )
+  if ( !myToolBars.contains( tid ) )
     return false;
 
   bool vis = false;
-  const NodeList& lst = myToolBars[tId].nodes;
-  for ( NodeList::const_iterator it = lst.begin(); it != lst.end() && !vis; ++it )
+  const ToolBarInfo& inf = myToolBars[tid];
+  for ( NodeList::const_iterator it = inf.nodes.begin(); it != inf.nodes.end() && !vis; ++it )
   {
     const ToolNode& node = *it;
     if ( node.id == id )
+
       vis = node.visible;
   }
   return vis;
 }
 
 /*!
-  Changes action shown status in certain toolbar
-  \param id - action id
-  \param tId - toolbar id
-  \param on - new shown status
+  \brief Show/hide action with given \a id in the toolbar \a tid.
+  \param id action ID
+  \param tid toolbar ID
+  \param on new visibility status
 */
-void QtxActionToolMgr::setVisible( const int id, const int tId, const bool on )
+void QtxActionToolMgr::setVisible( const int id, const int tid, const bool on )
 {
-  if ( !myToolBars.contains( tId ) )
+  if ( !myToolBars.contains( tid ) )
     return;
 
   bool changed = false;
-  NodeList& lst = myToolBars[tId].nodes;
+  NodeList& lst = myToolBars[tid].nodes;
   for ( NodeList::iterator it = lst.begin(); it != lst.end(); ++it )
   {
     ToolNode& node = *it;
@@ -562,13 +641,14 @@ void QtxActionToolMgr::setVisible( const int id, const int tId, const bool on )
   }
 
   if ( changed )
-    updateToolBar( tId );
+    triggerUpdate( tid );
 }
 
 /*!
-  Loads toolbar content from file
-  \param fname - file name
-  \param r - reader
+  \brief Load toolbar contents from the file.
+  \param fname file name
+  \param r actions reader
+  \return \c true on success and \c false on error
 */
 bool QtxActionToolMgr::load( const QString& fname, QtxActionMgr::Reader& r )
 {
@@ -576,9 +656,44 @@ bool QtxActionToolMgr::load( const QString& fname, QtxActionMgr::Reader& r )
   return r.read( fname, cr );
 }
 
+/*!
+  \brief Called when delayed content update is performed.
+
+  Customizes the content update operation.
+*/
+void QtxActionToolMgr::updateContent()
+{
+  if ( !isUpdatesEnabled() )
+    return;
+
+  for ( QMap<int,int>::const_iterator it = myUpdateIds.constBegin(); it != myUpdateIds.constEnd(); ++it )
+    updateToolBar( it.key() );
+  myUpdateIds.clear();
+}
+
+/*!
+  \brief Perform delayed toolbar update.
+  \param tid toolbar ID
+*/
+void QtxActionToolMgr::triggerUpdate( const int tid )
+{
+  myUpdateIds.insert( tid, 0 );
+  QtxActionMgr::triggerUpdate();
+}
+
 
 /*!
-  Constructor
+  \class QtxActionToolMgr::ToolCreator
+  \brief Toolbars creator.
+
+  Used by Reader to create actions by reading descriptions from the file,
+  create toolbars and fill in the toolbara with the actions.
+*/
+
+/*!
+  \brief Constructor.
+  \param r actions reader
+  \param mgr toolbar manager
 */
 QtxActionToolMgr::ToolCreator::ToolCreator( QtxActionMgr::Reader* r,
                                             QtxActionToolMgr* mgr )
@@ -588,21 +703,22 @@ QtxActionToolMgr::ToolCreator::ToolCreator( QtxActionMgr::Reader* r,
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxActionToolMgr::ToolCreator::~ToolCreator()
 {
 }
 
 /*!
-  Appends new tool buttons
-  \param tag - tag of toolmenu
-  \param subMenu - it has submenu (not used here)
-  \param attr - list of attributes
-  \param pId - id of action corresponding to parent item
+  \brief Create and append to the action manager a new toolbar or toolbar action.
+  \param tag item tag name
+  \param subMenu \c true if this item is submenu (not used)
+  \param attr attributes map
+  \param tid toolbar ID
+  \return toolbar or toolbar action ID
 */
-int QtxActionToolMgr::ToolCreator::append( const QString& tag, const bool subMenu,
-                                           const ItemAttributes& attr, const int tId )
+int QtxActionToolMgr::ToolCreator::append( const QString& tag, const bool /*subMenu*/,
+                                           const ItemAttributes& attr, const int tid )
 {  
   if( !myMgr || !reader() )
     return -1;
@@ -618,31 +734,28 @@ int QtxActionToolMgr::ToolCreator::append( const QString& tag, const bool subMen
           toggle  = reader()->option( "toggle",    "toggle"    );
 
   int res = -1, actId = intValue( attr, id, -1 );
-  if( tId==-1 )
+  if( tid==-1 )
     res = myMgr->createToolBar( strValue( attr, label ), intValue( attr, id, -1 ) );
   else if( tag==sep )
-    res = myMgr->insert( separator(), tId, intValue( attr, pos, -1 ) );
+    res = myMgr->insert( separator(), tid, intValue( attr, pos, -1 ) );
   else
   {
-    QPixmap pix; QIconSet set;
+    QIcon set;
+    QPixmap pix;
     QString name = strValue( attr, icon );
     if( !name.isEmpty() && loadPixmap( name, pix ) )
-      set = QIconSet( pix );
+      set = QIcon( pix );
 
-    QtxAction* newAct = new QtxAction( strValue( attr, tooltip ), set,
-                                       strValue( attr, label ), 
-                                       QKeySequence( strValue( attr, accel ) ),
-                                       myMgr );
+    QtxAction* newAct = new QtxAction( strValue( attr, tooltip ), set, strValue( attr, label ),
+                                       QKeySequence( strValue( attr, accel ) ), myMgr );
     QString toggleact = strValue( attr, toggle );
-    newAct->setToggleAction( !toggleact.isEmpty() );
-    newAct->setOn( toggleact.lower()=="true" );
+    newAct->setCheckable( !toggleact.isEmpty() );
+    newAct->setChecked( toggleact.toLower() == "true" );
         
     connect( newAct );
     int aid = myMgr->registerAction( newAct, actId );
-    res = myMgr->insert( aid, tId, intValue( attr, pos, -1 ) );
+    res = myMgr->insert( aid, tid, intValue( attr, pos, -1 ) );
   }
 
   return res;
 }
-
-
index 9300ec22af8be289b12e3e8ebabc8a7b8848609c..dd6b19cf4ebc9c6cc63ff93155e3d1df6d442c94 100644 (file)
@@ -1,66 +1,59 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxActionToolMgr.h
-// Author:    Alexander SOLOVYEV, Sergey TELKOV
-
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
+//
 #ifndef QTXACTIONTOOLMGR_H
 #define QTXACTIONTOOLMGR_H
 
 #include "Qtx.h"
-
-#include <qaction.h>
-
 #include "QtxActionMgr.h"
 
+#include <QMap>
+#include <QList>
+
 class QToolBar;
 class QMainWindow;
+class QAction;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
-/*!
-  \class QtxActionToolMgr
-  Allows to use set of action to automatically build set of toolbars.
-  With help of methods insert/append/remove it is possible to 
-  describe toolbars and its internal structure.
-  This manager is able to attune toolbar by removing excess separators
-*/
 class QTX_EXPORT QtxActionToolMgr : public QtxActionMgr
 {
   Q_OBJECT
 
-  /*!
-    \class ToolNode
-    Represents a toolbutton inside toolbar
-    For internal purposes only
-  */
   class ToolNode
   {
   public:
     ToolNode() : id( -1 ), visible( true ) {};
+    ToolNode( const int _id ) : id( _id ), visible( true ) {};
 
-    int       id;
-    bool      visible;
+    int       id;          //!< tool node ID
+    bool      visible;     //!< visibility status
   };
 
-  typedef QValueList<ToolNode> NodeList;
+  typedef QList<ToolNode> NodeList;    //!< toolbar nodes list
 
 protected:
   class ToolCreator;
@@ -71,7 +64,7 @@ public:
 
   QMainWindow*    mainWindow() const;
 
-  int             createToolBar( const QString&, int = -1 );
+  int             createToolBar( const QString&, int = -1, QMainWindow* = 0 );
   void            removeToolBar( const QString& );
   void            removeToolBar( const int );
 
@@ -111,33 +104,34 @@ public:
 
   virtual bool    load( const QString&, QtxActionMgr::Reader& );
 
+  int             find( QToolBar* ) const;
+
 protected slots:
   void            onToolBarDestroyed();
 
 protected:
-  int             find( QToolBar* ) const;  
   int             find( const QString& ) const;
   QToolBar*       find( const QString&, QMainWindow* ) const;
 
   virtual void    internalUpdate();
   void            updateToolBar( const int );
 
+  virtual void    updateContent();
+
 private:
   void            simplifySeparators( QToolBar* );
+  void            triggerUpdate( const int );
 
 private:
-  typedef struct { NodeList nodes; QToolBar* toolBar; } ToolBarInfo;
-  typedef QMap<int, ToolBarInfo>                        ToolBarMap;
+  typedef struct { NodeList nodes; QToolBar* toolBar; } ToolBarInfo;   //!< toolbar info
+  typedef QMap<int, ToolBarInfo>                        ToolBarMap;    //!< toolbars map
 
 private:
-  ToolBarMap      myToolBars;
-  QMainWindow*    myMainWindow;
+  ToolBarMap      myToolBars;      //!< toobars map
+  QMainWindow*    myMainWindow;    //!< parent main window
+  QMap<int,int>   myUpdateIds;     //!< list of actions ID being updated
 };
 
-/*!
-  \class QtxActionToolMgr::ToolCreator
-  Allows to create automatically toolbar by data read from file
-*/
 class QtxActionToolMgr::ToolCreator : public QtxActionMgr::Creator
 {
 public:
@@ -148,7 +142,7 @@ public:
                       const ItemAttributes&, const int );
 
 private:
-  QtxActionToolMgr* myMgr;
+  QtxActionToolMgr* myMgr;         //!< toolbar manager
 };
 
 #endif
diff --git a/src/Qtx/QtxColorButton.cxx b/src/Qtx/QtxColorButton.cxx
new file mode 100644 (file)
index 0000000..d792cf5
--- /dev/null
@@ -0,0 +1,427 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxColorButton.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxColorButton.h"
+
+#include <QMenu>
+#include <QStyle>
+#include <QLayout>
+#include <QBitmap>
+#include <QPainter>
+#include <QPaintEvent>
+#include <QColorDialog>
+#include <QStyleOptionToolButton>
+
+/*!
+  \class QtxColorButton
+  \brief The QtxColorButton class implements a widget for color
+  preference items editing.
+
+  The color preference item is represented as the colored button with
+  assocoiated popup menu whihc is called when the user presses the small
+  arrow button near it. The popup menu allows selecting of the color
+  from the predefined set. In addition it contains the button which
+  invokes standard "Select color" dialog box.
+
+  Initial color value can be set with setColor() method. Chosen color
+  can be retrieved with the color() method.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+*/
+QtxColorButton::QtxColorButton( QWidget* parent )
+: QToolButton( parent )
+{
+  setCheckable( false );
+  setPopupMode( MenuButtonPopup );
+
+  QMenu* pm = new QMenu( this );
+  QGridLayout* grid = new QGridLayout( pm );
+  grid->setMargin( 5 );
+  grid->setSpacing( 0 );
+
+  QList<QColor> cList = colorsList();
+  int w = 8;
+  int h = cList.count() / w;
+
+  for ( int y = 0; y < h; y++ )
+  {
+    for ( int x = 0; x < w; x++ )
+    {
+      QColor c = cList.at( x * h + y ).toRgb();
+      QToolButton* btn = new QToolButton( pm );
+      btn->setAutoRaise( true );
+      btn->setCheckable( true );
+      myColors.insert( btn, c );
+      grid->addWidget( btn, y + 1, x );
+
+      btn->installEventFilter( this );
+
+      connect( btn, SIGNAL( clicked( bool ) ), this, SLOT( onToggled( bool ) ) );
+
+      updateButton( btn );
+    }
+  }
+
+  myAutoButton = new QToolButton( pm );
+  myAutoButton->setText( tr( "Auto" ) );
+  myAutoButton->setAutoRaise( true );
+  myAutoButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+  grid->addWidget( myAutoButton, 0, 0, 1, grid->columnCount() );
+  connect( myAutoButton, SIGNAL( clicked( bool ) ), this, SLOT( onAutoClicked( bool ) ) );
+
+  QToolButton* other = new QToolButton( pm );
+  other->setText( tr( "Other colors..." ) );
+  other->setAutoRaise( true );
+  other->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+  grid->addWidget( other, grid->rowCount(), 0, 1, grid->columnCount() );
+  connect( other, SIGNAL( clicked( bool ) ), this, SLOT( onDialogClicked( bool ) ) );
+
+  other->installEventFilter( this );
+
+  setMenu( pm );
+
+  connect( this, SIGNAL( clicked( bool ) ), this, SLOT( onClicked( bool ) ) );
+  connect( pm,   SIGNAL( aboutToShow() ),   this, SLOT( onAboutToShow() ) );
+
+  myAutoButton->setVisible( false );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxColorButton::~QtxColorButton()
+{
+}
+
+/*!
+  \brief Get currently selected color.
+
+  Returns null QColor if no color is selected.
+
+  \return selected color
+  \sa setColor()
+*/
+QColor QtxColorButton::color() const
+{
+  return myColors.contains( this ) ? myColors[this] : QColor();
+}
+
+/*!
+  \brief Set color.
+  \param c color to be set as current
+  \sa color()
+*/
+void QtxColorButton::setColor( const QColor& c )
+{
+  myColors.insert( this, c );
+  updateState();
+  update();
+  updateButton( this );
+}
+
+/*!
+  \brief Returns the status of "auto" color button in popup widget.
+  \return \c true if the "auto" button is enabled
+*/
+bool QtxColorButton::isAutoEnabled() const
+{
+  return myAutoButton->isVisibleTo( myAutoButton->parentWidget() );
+}
+
+/*!
+  \brief Enable/disable the "auto" color button in popup widget.
+  \param on enable/disable state
+*/
+void QtxColorButton::setAutoEnabled( bool on )
+{
+  myAutoButton->setVisible( on );
+}
+
+/*!
+  \brief Returns text of the "auto" color button in popup widget.
+*/
+QString QtxColorButton::autoText() const
+{
+  return myAutoButton->text();
+}
+
+/*!
+  \brief Sets text of the "auto" color button in popup widget.
+  \param txt new button text
+*/
+void QtxColorButton::setAutoText( const QString& txt )
+{
+  myAutoButton->setText( txt );
+}
+
+/*!
+  \brief Filter events for the child widgets.
+  \param o event receiver object
+  \param e event
+  \return \c true if the event should be filtered
+*/
+bool QtxColorButton::eventFilter( QObject* o, QEvent* e )
+{
+  if ( e->type() == QEvent::Leave )
+    updateButton( ::qobject_cast<QToolButton*>( o ) );
+  return QToolButton::eventFilter( o, e );
+}
+
+/*!
+  \brief Called when the popup menu is about to show.
+
+  Updates the menu and child widgets state.
+*/
+void QtxColorButton::onAboutToShow()
+{
+  updateState();
+}
+
+/*!
+  \brief Called when the button is clicked by the user.
+
+  Emits the signal clicked( QColor ).
+
+  \param on button state (not used)
+*/
+void QtxColorButton::onClicked( bool )
+{
+  emit clicked( color() );
+}
+
+/*!
+  \brief Called when any color selection button from popup menu
+  is clicked.
+
+  Changes the currently selected color and emits the signal
+  changed( QColor ).
+
+  \param on button state
+*/
+void QtxColorButton::onToggled( bool on )
+{
+  const QToolButton* tb = ::qobject_cast<QToolButton*>( sender() );
+  if ( !tb )
+    return;
+
+  QColor old = color();
+
+  if ( on && myColors.contains( tb ) )
+  {
+    myColors.insert( this, myColors[tb] );
+    updateButton( this );
+  }
+
+  if ( menu() )
+    menu()->hide();
+
+  updateState();
+
+  if ( old != color() )
+    emit changed( color() );
+}
+
+/*!
+  \brief Called the "Auto" child button from popup menu
+  is clicked.
+
+  Sets the undefined (auto) color as current.
+
+  \param on (not used)
+*/
+void QtxColorButton::onAutoClicked( bool )
+{
+  if ( menu() )
+    menu()->hide();
+
+  setColor( QColor() );
+}
+
+/*!
+  \brief Called the "Other colors" child button from popup menu
+  is clicked.
+
+  Invokes standard "Select color" dialog box allowing user to select
+  custom color. If the current color is changed by the user, emits
+  the signal changed( QColor ).
+
+  \param on (not used)
+*/
+void QtxColorButton::onDialogClicked( bool )
+{
+  QColor c = QColorDialog::getColor( color(), this );
+  if ( !c.isValid() )
+    return;
+
+  QColor old = color();
+
+  setColor( c );
+
+  if ( old != color() )
+    emit changed( color() );
+}
+
+/*!
+  \brief Customize paint event for the widget.
+  \param e paint event
+*/
+void QtxColorButton::paintEvent( QPaintEvent* e )
+{
+  QToolButton::paintEvent( e );
+
+  QStyleOptionToolButton opt;
+  opt.initFrom( this );
+  opt.text = text();
+  opt.icon = icon();
+  opt.features = QStyleOptionToolButton::Menu;
+
+  QRect r = style()->subControlRect( QStyle::CC_ToolButton, &opt, QStyle::SC_ToolButton );
+  r.setTopLeft( r.topLeft() + QPoint( 2, 2 ) );
+  r.setBottomRight( r.bottomRight() - QPoint( 2, 2 ) );
+
+  QPixmap pix( r.size() );
+  pix.fill( palette().color( backgroundRole() ) );
+
+  if ( color().isValid() )
+    drawColor( &pix, color() );
+  else {
+    QPainter pixp( &pix );
+    pixp.drawRect( 2, 2, pix.width() - 4, pix.height() - 4 );
+    pixp.fillRect( 3, 3, pix.width() - 6, pix.height() - 6, QBrush( Qt::BDiagPattern ) );
+    pixp.end();
+  }
+
+  QPainter p( this );
+  p.drawPixmap( r, pix );
+  p.end();
+}
+
+/*!
+  \brief Update widget state.
+*/
+void QtxColorButton::updateState()
+{
+  QList<QToolButton*> bList = qFindChildren<QToolButton*>( menu() );
+  for ( QList<QToolButton*>::iterator cit = bList.begin(); cit != bList.end(); ++cit )
+    updateButton( *cit );
+}
+
+/*!
+  \brief Update child button state.
+  \param btn child button
+*/
+void QtxColorButton::updateButton( QToolButton* btn )
+{
+  QColor c = color().toRgb();
+  bool block = btn->signalsBlocked();
+  btn->blockSignals( true );
+  btn->setChecked( false );
+  if ( myColors.contains( btn ) ) {
+    btn->setIcon( buttonIcon( myColors[btn] ) );
+    btn->setChecked( myColors[btn].toRgb() == c );
+  }
+  btn->setDown( false );
+  btn->blockSignals( block );
+}
+
+/*!
+  \brief Generate (if necessary) or get the icon for the button.
+  \param c color to be used for the icon
+  \return icon pixmap for the button
+*/
+QPixmap QtxColorButton::buttonIcon( const QColor& c ) const
+{
+  static QMap<int, QPixmap> pixMap;
+
+  if ( pixMap.contains( c.rgb() ) )
+    return pixMap[c.rgb()];
+
+  QPixmap pix( 16, 16 );
+
+  QColor bg = Qt::white;
+  if ( bg == c )
+    bg = Qt::gray;
+  pix.fill( bg );
+
+  drawColor( &pix, c );
+
+  pix.setMask( pix.createHeuristicMask() );
+
+  pixMap.insert( c.rgb(), pix );
+
+  return pix;
+}
+
+/*!
+  \brief Draw pixmap.
+  \param pd paint device
+  \param c color
+  \param m margin
+*/
+void QtxColorButton::drawColor( QPaintDevice* pd, const QColor& c, const int m ) const
+{
+  if ( !pd )
+    return;
+
+  QPainter p( pd );
+  p.setPen( Qt::black );
+  p.fillRect( m, m, pd->width() - 2 * m - 1, pd->height() - 2 * m - 1, QBrush( c ) );
+  p.drawRect( m, m, pd->width() - 2 * m - 1, pd->height() - 2 * m - 1 );
+  p.end();
+}
+
+/*!
+  \brief Get predefined list of colors to be used in the popup menu.
+  \return list of colors
+*/
+QList<QColor> QtxColorButton::colorsList() const
+{
+  QList<QColor> lst;
+
+  for ( int g = 0; g < 4; g++ )
+  {
+    for ( int r = 0; r < 4; r++ )
+    {
+      for ( int b = 0; b < 3; b++ )
+        lst.append( QColor( qRgb( r * 255 / 3, g * 255 / 3, b * 255 / 2 ) ) );
+    }
+  }
+  return lst;
+}
+
+/*!
+  \fn void QtxColorButton::clicked( QColor color );
+  \brief This signal is emitted when the widget button is clicked by
+         the user.
+  \param color current color
+*/
+
+/*!
+  \fn void QtxColorButton::changed( QColor color );
+  \brief This signal is emitted when the current color is changed.
+  \param color new current color
+*/
diff --git a/src/Qtx/QtxColorButton.h b/src/Qtx/QtxColorButton.h
new file mode 100644 (file)
index 0000000..0b73d3a
--- /dev/null
@@ -0,0 +1,87 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxColorButton.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXCOLORBUTTON_H
+#define QTXCOLORBUTTON_H
+
+#include "Qtx.h"
+
+#include <QMap>
+#include <QColor>
+#include <QPixmap>
+#include <QToolButton>
+
+class QPaintDevice;
+
+class QTX_EXPORT QtxColorButton : public QToolButton
+{
+  Q_OBJECT
+
+public:
+  QtxColorButton( QWidget* = 0 );
+  virtual ~QtxColorButton();
+
+  QColor        color() const;
+  void          setColor( const QColor& );
+
+  bool          eventFilter( QObject*, QEvent* );
+
+  bool          isAutoEnabled() const;
+  void          setAutoEnabled( bool );
+
+  QString       autoText() const;
+  void          setAutoText( const QString& );
+
+signals:
+  void          clicked( QColor );
+  void          changed( QColor );
+
+private slots:
+  void          onClicked( bool );
+  void          onToggled( bool );
+
+  void          onAboutToShow();
+  void          onAutoClicked( bool );
+  void          onDialogClicked( bool );
+
+protected:
+  virtual void  paintEvent( QPaintEvent* );
+
+private:
+  QList<QColor> colorsList() const;
+
+  void          updateState();
+  void          updateButton( QToolButton* );
+  QPixmap       buttonIcon( const QColor& ) const;
+  void          drawColor( QPaintDevice*, const QColor&, const int = 1 ) const;
+
+private:
+  typedef QMap<const QToolButton*, QColor> ColorMap;
+
+private:
+  ColorMap      myColors;
+  QToolButton*  myAutoButton;
+};
+
+#endif
index 30c9193612be1b8c396866cdfaa75337f82a5f0a..40911008049c7aa08c1825231a59ec83c48c6c2c 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxColorScale.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxColorScale.h"
 
-#include <qmap.h>
-#include <qimage.h>
-#include <qregexp.h>
-#include <qpixmap.h>
-#include <qbitmap.h>
-#include <qpainter.h>
-#include <qmainwindow.h>
-#include <qstringlist.h>
-#include <qstylesheet.h>
-#include <qsimplerichtext.h>
+#include <QMap>
+#include <QRegExp>
+#include <QStringList>
+#include <QPixmap>
+#include <QPainter>
+#include <QTextDocument>
 
 #include <math.h>
 
 /*!
-  Constructor
+  \class QtxColorScale
+  \brief Color Scale widget.
 */
-QtxColorScale::QtxColorScale( QWidget* parent, const char* name, WFlags f )
-: QFrame( parent, name, f | WResizeNoErase | WRepaintNoErase ),
-myDock( 0 ),
-myMin( 0.0 ),
-myMax( 1.0 ),
-myTitle( "" ),
-myInterval( 10 ),
-myStyleSheet( 0 ),
-myFormat( "%.4g" ),
-myColorMode( Auto ),
-myLabelMode( Auto ),
-myLabelPos( Right ),
-myTitlePos( Center ),
-myDumpMode( NoDump ),
-myFlags( AtBorder | WrapTitle )
-{
-       setCaption( tr ( "Color scale" ) );
-}
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param parent parent widget
+  \param f widget flags
 */
-QtxColorScale::QtxColorScale( const int num, QWidget* parent, const char* name, WFlags f )
-: QFrame( parent, name, f | WResizeNoErase | WRepaintNoErase ),
-myDock( 0 ),
-myMin( 0.0 ),
-myMax( 1.0 ),
-myTitle( "" ),
-myInterval( num ),
-myStyleSheet( 0 ),
-myFormat( "%.4g" ),
-myColorMode( Auto ),
-myLabelMode( Auto ),
-myLabelPos( Right ),
-myTitlePos( Center ),
-myDumpMode( NoDump ),
-myFlags( AtBorder | WrapTitle )
+QtxColorScale::QtxColorScale( QWidget* parent, Qt::WindowFlags f )
+: QFrame( parent, f ),
+  myMin( 0.0 ),
+  myMax( 1.0 ),
+  myTitle( "" ),
+  myFormat( "%.4g" ),
+  myInterval( 10 ),
+  myDumpMode( NoDump ),
+  myColorMode( Auto ),
+  myLabelMode( Auto ),
+  myFlags( AtBorder | WrapTitle ),
+  myLabelPos( Right ),
+  myTitlePos( Center )
 {
-       setCaption( tr ( "Color scale" ) );
+  setWindowTitle( tr ( "Color scale" ) );
 }
 
-#if QT_VER == 3
-
 /*!
-  Constructor
+  \brief Constructor.
+  \param num number of color scale intervals
+  \param parent parent widget
+  \param f widget flags
 */
-QtxColorScale::QtxColorScale( Dock* dock, const char* name, WFlags f )
-: QFrame( dock, name, f | WResizeNoErase | WRepaintNoErase ),
-myMin( 0.0 ),
-myMax( 1.0 ),
-myTitle( "" ),
-myDock( dock ),
-myInterval( 10 ),
-myStyleSheet( 0 ),
-myFormat( "%.4g" ),
-myColorMode( Auto ),
-myLabelMode( Auto ),
-myLabelPos( Right ),
-myTitlePos( Center ),
-myDumpMode( NoDump ),
-myFlags( AtBorder | WrapTitle )
+QtxColorScale::QtxColorScale( const int num, QWidget* parent, Qt::WindowFlags f )
+: QFrame( parent, f ),
+  myMin( 0.0 ),
+  myMax( 1.0 ),
+  myTitle( "" ),
+  myFormat( "%.4g" ),
+  myInterval( num ),
+  myDumpMode( NoDump ),
+  myColorMode( Auto ),
+  myLabelMode( Auto ),
+  myFlags( AtBorder | WrapTitle ),
+  myLabelPos( Right ),
+  myTitlePos( Center )
 {
-       setCaption( tr ( "Color scale" ) );
+  setWindowTitle( tr ( "Color scale" ) );
 }
 
-#endif
-
 /*!
-  Destructor
+  \brief Destructor.
+
+  Does nothing for the moment.
 */
 QtxColorScale::~QtxColorScale()
 {
 }
 
 /*!
-  \returns minimal limit of scale.
+  \brief Get color scale minimum value.
+  \return lower limit of the color scale
 */
 double QtxColorScale::minimum() const
 {
-       return myMin;
+  return myMin;
 }
 
 /*!
-  \return maximal limit of scale.
+  \brief Get color scale maximum value.
+  \return upper limit of the color scale
 */
 double QtxColorScale::maximum() const
 {
-       return myMax;
+  return myMax;
 }
 
 /*!
-  \return range (minimal and maximal limits) of scale.
+  \brief Get color scale range.
+  \param min returning lower limit of the color scale
+  \param max returning upper limit of the color scale
 */
 void QtxColorScale::range( double& min, double& max ) const
 {
-       min = myMin;
-       max = myMax;
+  min = myMin;
+  max = myMax;
 }
 
 /*!
-  \return the current title string.
+  \brief Get color scale title.
+  \return current title
 */
 QString QtxColorScale::title() const
 {
-       return myTitle;
+  return myTitle;
 }
 
 /*!
-  \returns the current format of number presentation in labels for Auto label mode (sprintf specification).
+  \brief Get current format of the number presentation.
+
+  This format is used to output values in the color scale labels
+  in "Auto" label mode. The format uses sprintf specification.
+
+  \return current format
 */
 QString QtxColorScale::format() const
 {
-       return myFormat;
+  return myFormat;
 }
 
 /*!
-  \return dump mode.
+  \brief Get Color scale dump mode.
+  \return current dump mode (QtxColorScale::DumpMode)
 */
 int QtxColorScale::dumpMode() const
 {
-       return myDumpMode;
+  return myDumpMode;
 }
 
 /*!
-  \return label mode.
+  \brief Get label mode.
+  \return current label mode (QtxColorScale::Mode)
 */
 int QtxColorScale::labelMode() const
 {
-       return myLabelMode;
+  return myLabelMode;
 }
 
 /*!
-  \return color mode.
+  \brief Get color mode.
+  \return current color mode (QtxColorScale::Mode)
 */
 int QtxColorScale::colorMode() const
 {
-       return myColorMode;
+  return myColorMode;
 }
 
 /*!
-  \return intervals number of color scale.
+  \brief Get number of color scale intervals.
+  \return number of intervals
 */
 int QtxColorScale::intervalsNumber() const
 {
-       return myInterval;
+  return myInterval;
 }
 
 /*!
-  \return the user label of specified interval.
+  \brief Get user label for the specified color scale interval.
+  \param idx interval index
+  \return user label for specified interval
 */
 QString QtxColorScale::label( const int idx ) const
 {
-       QString res;
-       if ( idx >= 0 && idx < (int)myLabels.count() )
-               res = *myLabels.at( idx );
-       return res;
+  QString res;
+  if ( idx >= 0 && idx < (int)myLabels.count() )
+    res = myLabels[idx];
+  return res;
 }
 
 /*!
-  \return the user color of specified interval.
+  \brief Get user color for the specified color scale interval.
+  \param idx interval index
+  \return user color for specified interval
 */
 QColor QtxColorScale::color( const int idx ) const
 {
-       QColor res;
-       if ( idx >= 0 && idx < (int)myColors.count() )
-               res = *myColors.at( idx );
-       return res;
+  QColor res;
+  if ( idx >= 0 && idx < (int)myColors.count() )
+    res = myColors[idx];
+  return res;
 }
 
 /*!
-  \return the user labels.
+  \brief Get user labels for all color scale intervals.
+  \param list returning labels list
 */
 void QtxColorScale::labels( QStringList& list ) const
 {
-       list = myLabels;
+  list = myLabels;
 }
 
 /*!
-  \return the user color.
+  \brief Get user colors for all color scale intervals.
+  \param list returning colors list
 */
-void QtxColorScale::colors( QValueList<QColor>& list ) const
+void QtxColorScale::colors( QList<QColor>& list ) const
 {
-       list = myColors;
+  list = myColors;
 }
 
 /*!
-  \return the label position.
+  \brief Get label position.
+  \return label position (QtxColorScale::Position)
 */
 int QtxColorScale::labelPosition() const
 {
-       return myLabelPos;
+  return myLabelPos;
 }
 
 /*!
-  \return the title position.
+  \brief Get title position.
+  \return title position (QtxColorScale::Position)
 */
 int QtxColorScale::titlePosition() const
 {
-       return myTitlePos;
+  return myTitlePos;
 }
 
 /*!
-  Sets the minimum limit.
+  \brief Set color scale minimum value.
+  \param val lower limit of the color scale
 */
 void QtxColorScale::setMinimum( const double val )
 {
-       setRange( val, maximum() );
+  setRange( val, maximum() );
 }
 
 /*!
-  Sets the maximum limit.
+  \brief Set color scale maximum value.
+  \param val upper limit of the color scale
 */
 void QtxColorScale::setMaximum( const double val )
 {
-       setRange( minimum(), val );
+  setRange( minimum(), val );
 }
 
 /*!
-  Sets the minimum and maximum limits.
+  \brief Set color scale range.
+  \param min lower limit of the color scale
+  \param max upper limit of the color scale
 */
 void QtxColorScale::setRange( const double min, const double max )
 {
-       if ( myMin == min && myMax == max )
-               return;
-
-       myMin = min;
-       myMax = max;
-
-       myPrecise = QString::null;
+  if ( myMin == min && myMax == max )
+    return;
+  
+  myMin = min;
+  myMax = max;
+  
+  myPrecise = QString();
 
-       if ( colorMode() == Auto || labelMode() == Auto )
-               updateScale();
+  if ( colorMode() == Auto || labelMode() == Auto )
+    updateScale();
 }
 
 /*!
-  Sets the title string.
+  \brief Set color scale title.
+  \param str new title
 */
 void QtxColorScale::setTitle( const QString& str )
 {
-       if ( myTitle == str )
-               return;
-
-       myTitle = str;
-       updateScale();
+  if ( myTitle == str )
+    return;
+  
+  myTitle = str;
+  updateScale();
 }
 
 /*!
-  Sets the format of number presentation in labels for
-  Auto label mode (sprintf specification).
+  \brief Set current format of the number presentation.
+  \sa format()
+  \param format new number presentation format
 */
 void QtxColorScale::setFormat( const QString& format )
 {
-       if ( myFormat == format )
-               return;
+  if ( myFormat == format )
+    return;
 
-       myFormat = format;
-       myPrecise = QString::null;
-       if ( colorMode() == Auto )
-               updateScale();
+  myFormat = format;
+  myPrecise = QString();
+  if ( colorMode() == Auto )
+    updateScale();
 }
 
 /*!
-  Sets the number of intervals.
+  \brief Set number of color scale intervals.
+  \param num number of intervals
 */
 void QtxColorScale::setIntervalsNumber( const int num )
 {
-       if ( myInterval == num || num < 1 )
-               return;
-
-       myInterval = num;
-       myPrecise = QString::null;
-
-       updateScale();
+  if ( myInterval == num || num < 1 )
+    return;
+  
+  myInterval = num;
+  myPrecise = QString();
+  
+  updateScale();
 }
 
 /*!
-  Sets the user label for specified interval. If number
-  of interval is negative then user label will be added
-  as new at the end of list.
+  \brief Set user label for the specified color scale interval.
+
+  If number of interval is negative then user label will be added
+  as new to the end of list.
+
+  \param txt user label
+  \param idx interval index
 */
 void QtxColorScale::setLabel( const QString& txt, const int idx )
 {
-       bool changed = false;
-       uint i = idx < 0 ? myLabels.count() : idx;
-       if ( i < myLabels.count() )
-       {
-               changed = *myLabels.at( i ) != txt;
-               myLabels[i] = txt;
-       }
-       else
-       {
-               changed = true;
-               while ( i >= myLabels.count() )
-                   myLabels.append( "" );
-               myLabels[i] = txt;
-       }
-       if ( changed )
-               updateScale();
+  bool changed = false;
+  int i = idx < 0 ? myLabels.count() : idx;
+  if ( i < myLabels.count() )
+  {
+    changed = myLabels[i] != txt;
+    myLabels[i] = txt;
+  }
+  else
+  {
+    changed = true;
+    while ( i >= myLabels.count() )
+      myLabels.append( "" );
+    myLabels[i] = txt;
+  }
+  if ( changed )
+    updateScale();
 }
 
 /*!
-  Sets the user color for specified interval. If number
-  of interval is negative then user color will be added
-  as new at the end of list.
+  \brief Set user color for the specified color scale interval.
+
+  If number of interval is negative then user color will be added
+  as new to the end of list.
+
+  \param clr user color
+  \param idx interval index
 */
 void QtxColorScale::setColor( const QColor& clr, const int idx )
 {
-       bool changed = false;
-       uint i = idx < 0 ? myColors.count() : idx;
-       if ( i < myColors.count() )
-       {
-               changed = *myColors.at( i ) != clr;
-               myColors[i] = clr;
-       }
-       else
-       {
-               changed = true;
-        while ( i >= myColors.count() )
-            myColors.append( QColor() );
-               myColors[i] = clr;
-       }
-       if ( changed )
-               updateScale();
+  bool changed = false;
+  int i = idx < 0 ? myColors.count() : idx;
+  if ( i < myColors.count() )
+  {
+    changed = myColors[i] != clr;
+    myColors[i] = clr;
+  }
+  else
+  {
+    changed = true;
+    while ( i >= myColors.count() )
+      myColors.append( QColor() );
+    myColors[i] = clr;
+  }
+  if ( changed )
+    updateScale();
 }
 
 /*!
-  Replace the all user label with specified list.
+  \brief Set user labels for all color scale intervals.
+  \param list new labels list
 */
 void QtxColorScale::setLabels( const QStringList& list )
 {
-       if ( list.isEmpty() )
-               return;
+  if ( list.isEmpty() )
+    return;
 
-       myLabels = list;
-       updateScale();
+  myLabels = list;
+  updateScale();
 }
 
 /*!
-  Replace the all user colors with specified list.
+  \brief Set user colors for all color scale intervals.
+  \param list new colors list
 */
-void QtxColorScale::setColors( const QValueList<QColor>& list )
+void QtxColorScale::setColors( const QList<QColor>& list )
 {
-       if ( list.isEmpty() )
-           return;
+  if ( list.isEmpty() )
+    return;
 
-       myColors = list;
-       updateScale();
+  myColors = list;
+  updateScale();
 }
 
 /*!
-  Sets the color mode (Auto or User).
+  \brief Set color scale color mode.
+  \param mode new color mode (QtxColorScale::Mode)
 */
 void QtxColorScale::setColorMode( const int mode )
 {
-       if ( myColorMode == mode )
-               return;
-
-       myColorMode = mode;
-       updateScale();
+  if ( myColorMode == mode )
+    return;
+  
+  myColorMode = mode;
+  updateScale();
 }
 
 /*!
-  Sets the dump mode.
+  \brief Set color scale dump mode.
+  \param mode new dump mode (QtxColorScale::DumpMode)
 */
 void QtxColorScale::setDumpMode( const int mode )
 {
-       myDumpMode = mode;
+  myDumpMode = mode;
 }
 
 /*!
-  Sets the label mode (Auto or User).
+  \brief Set color scale label mode.
+  \param mode new label mode (QtxColorScale::Mode)
 */
 void QtxColorScale::setLabelMode( const int mode )
 {
-       if ( myLabelMode != mode )
-       {
-               myLabelMode = mode;
-               updateScale();
-       }
+  if ( myLabelMode != mode )
+  {
+    myLabelMode = mode;
+    updateScale();
+  }
 }
 
 /*!
-  Sets the label position.
+  \brief Set label position.
+  \param pos new label position (QtxColorScale::Position)
 */
 void QtxColorScale::setLabelPosition( const int pos )
 {
-       if ( myLabelPos != pos && pos >= None && pos <= Center )
-       {
-               myLabelPos = pos;
-               updateScale();
-       }
+  if ( myLabelPos != pos && pos >= None && pos <= Center )
+  {
+    myLabelPos = pos;
+    updateScale();
+  }
 }
 
 /*!
-  Sets the title position.
+  \brief Set title position.
+  \param pos new title position (QtxColorScale::Position)
 */
 void QtxColorScale::setTitlePosition( const int pos )
 {
-       if ( myTitlePos != pos && pos >= None && pos <= Center )
-       {
-               myTitlePos = pos;
-               updateScale();
-       }
+  if ( myTitlePos != pos && pos >= None && pos <= Center )
+  {
+    myTitlePos = pos;
+    updateScale();
+  }
 }
 
 /*!
-  Set the specified flags.
+  \brief Set color scale flags.
+  \param flags new flags
 */
 void QtxColorScale::setFlags( const int flags )
 {
-       int prev = myFlags;
-       myFlags |= flags;
-       if ( prev != myFlags )
-               updateScale();
+  int prev = myFlags;
+  myFlags |= flags;
+  if ( prev != myFlags )
+    updateScale();
 }
 
 /*!
-  \return true if specified flags are setted.
+  \brief Test color scale flags.
+  \return \c true if specified flags are set
 */
 bool QtxColorScale::testFlags( const int flags ) const
 {
-       return ( myFlags & flags ) == flags;
+  return ( myFlags & flags ) == flags;
 }
 
 /*!
-  Clear (reset) the specified flags.
+  \brief Clear (reset) color scale flags.
+  \param flags color scale flags to be cleared
 */
 void QtxColorScale::clearFlags( const int flags )
 {
-       int prev = myFlags;
-       myFlags &= ~flags;
-       if ( prev != myFlags )
-               updateScale();
+  int prev = myFlags;
+  myFlags &= ~flags;
+  if ( prev != myFlags )
+    updateScale();
 }
 
 /*!
+  \brief Get widget's minumum size hint.
   \return minimum size hint
 */
 QSize QtxColorScale::minimumSizeHint() const
 {
   QSize sz = calculateSize( true, myFlags, titlePosition() != None, labelPosition() != None, true );
-       return sz + QSize( frameWidth(), frameWidth() );
+  return sz + QSize( frameWidth(), frameWidth() );
 }
 
 /*!
+  \brief Get widget's default size hint.
   \return size hint
 */
 QSize QtxColorScale::sizeHint() const
 {
   QSize sz = calculateSize( false, myFlags, titlePosition() != None, labelPosition() != None, true );
-       return sz + QSize( frameWidth(), frameWidth() );
+  return sz + QSize( frameWidth(), frameWidth() );
 }
 
 /*!
-  Dump color scale into pixmap with current size.
+  \brief Calculate color scale size.
+  \param min if \c true, color scale size is calculated to be as smallest as possible
+  \param flags color scale flags
+  \param title color scale title
+  \param labels if \c true take into account labels
+  \param colors if \c true take into account colors
+  \return color scale size
 */
 QSize QtxColorScale::calculateSize( const bool min, const int flags, const bool title,
-                                                                                   const bool labels, const bool colors ) const
+                                   const bool labels, const bool colors ) const
 {
-       int num = intervalsNumber();
-
-       int spacer = 5;
-       int textWidth = 0;
-       int textHeight = fontMetrics().height();
-       int colorWidth = 20;
-
-       if ( labels && colors )
+  int num = intervalsNumber();
+  
+  int spacer = 5;
+  int textWidth = 0;
+  int textHeight = fontMetrics().height();
+  int colorWidth = 20;
+  
+  if ( labels && colors )
   {
     QtxColorScale* that = (QtxColorScale*)this;
     QString fmt = that->myFormat;
 
-               for ( int idx = 0; idx < num; idx++ )
-                       textWidth = QMAX( textWidth, fontMetrics().width( getLabel( idx ) ) );
-
+    for ( int idx = 0; idx < num; idx++ )
+      textWidth = qMax( textWidth, fontMetrics().width( getLabel( idx ) ) );
+    
     if ( !min )
       that->myFormat = that->myFormat.replace( QRegExp( "g" ), "f" );
-
-               for ( int index = 0; index < num; index++ )
-                       textWidth = QMAX( textWidth, fontMetrics().width( getLabel( index ) ) );
-
+    
+    for ( int index = 0; index < num; index++ )
+      textWidth = qMax( textWidth, fontMetrics().width( getLabel( index ) ) );
+    
     that->myFormat = fmt;
   }
+  
+  int scaleWidth = 0;
+  int scaleHeight = 0;
+  
+  int titleWidth = 0;
+  int titleHeight = 0;
+  
+  if ( flags & AtBorder )
+  {
+    num++;
+    if ( min && title && !myTitle.isEmpty() )
+      titleHeight += 10;
+  }
+  
+  if ( colors )
+  {
+    scaleWidth = colorWidth + textWidth + ( textWidth ? 3 : 2 ) * spacer;
+    if ( min )
+      scaleHeight = qMax( 2 * num, 3 * textHeight );
+    else
+      scaleHeight = (int)( 1.5 * ( num + 1 ) * textHeight );
+  }
+
+  if ( title )
+  {
+    QTextDocument* srt = textDocument( flags );
+    if ( srt )
+    {
+      QPainter p( (QtxColorScale*)this );
+      if ( scaleWidth )
+       srt->setTextWidth( scaleWidth );
+      
+      titleHeight = (int)srt->size().height() + spacer;
+      titleWidth = (int)srt->size().width() + 10;
+      
+    }
+    delete srt;
+  }
 
-       int scaleWidth = 0;
-       int scaleHeight = 0;
-
-       int titleWidth = 0;
-       int titleHeight = 0;
-
-       if ( flags & AtBorder )
-       {
-               num++;
-               if ( min && title && !myTitle.isEmpty() )
-                       titleHeight += 10;
-       }
-
-       if ( colors )
-       {
-               scaleWidth = colorWidth + textWidth + ( textWidth ? 3 : 2 ) * spacer;
-               if ( min )
-                       scaleHeight = QMAX( 2 * num, 3 * textHeight );
-               else
-                       scaleHeight = (int)( 1.5 * ( num + 1 ) * textHeight );
-       }
-
-       if ( title )
-       {
-               QSimpleRichText* srt = simpleRichText( flags );
-               if ( srt )
-               {
-                       QPainter p( this );
-                       if ( scaleWidth )
-                               srt->setWidth( &p, scaleWidth );
-
-                       titleHeight = srt->height() + spacer;
-                       titleWidth = srt->widthUsed() + 10;
-
-                       delete srt;
-               }
-       }
-
-       int W = QMAX( titleWidth, scaleWidth ) + width() - contentsRect().width();
-       int H = scaleHeight + titleHeight + height() - contentsRect().height();
-
-       return QSize( W, H );
+  int W = qMax( titleWidth, scaleWidth ) + width() - contentsRect().width();
+  int H = scaleHeight + titleHeight + height() - contentsRect().height();
+  
+  return QSize( W, H );
 }
 
 /*!
-  Dump color scale into pixmap with current size.
+  \brief Dump color scale into pixmap with current size.
+  \return generated pixmap
 */
 QPixmap QtxColorScale::dump() const
 {
-       QPixmap aPix;
+  QPixmap aPix;
+  
+  if ( dumpMode() != NoDump )
+  {
+    aPix = QPixmap( size() );
+    if ( !aPix.isNull() )
+    {
+      bool scale = ( myDumpMode == ScaleDump || myDumpMode == FullDump );
+      bool label = ( myDumpMode == ScaleDump || myDumpMode == FullDump ) &&
+       labelPosition() != None;
+      bool title = ( myDumpMode == TitleDump || myDumpMode == FullDump ) &&
+       titlePosition() != None;
+      QColor bgc = palette().color( backgroundRole() );
+      QPainter p;
+      p.begin( &aPix );
+      p.fillRect( 0, 0, aPix.width(), aPix.height(), bgc );
+      drawScale( &p, bgc, false, 0, 0, aPix.width(), aPix.height(), title, label, scale );
+      p.end();
+    }
+  }
   
-       if ( dumpMode() != NoDump )
-       {
-               aPix = QPixmap( size() );
-               if ( !aPix.isNull() )
-               {
-                       bool scale = ( myDumpMode == ScaleDump || myDumpMode == FullDump );
-                       bool label = ( myDumpMode == ScaleDump || myDumpMode == FullDump ) &&
-                                                labelPosition() != None;
-                       bool title = ( myDumpMode == TitleDump || myDumpMode == FullDump ) &&
-                                                titlePosition() != None;
-
-#if QT_VER < 3
-            QColor bgc = backgroundColor();
-#else
-            QColor bgc = paletteBackgroundColor();
-#endif
-                       QPainter p;
-                       p.begin( &aPix );
-                       p.fillRect( 0, 0, aPix.width(), aPix.height(), bgc );
-                       drawScale( &p, bgc, false, 0, 0, aPix.width(), aPix.height(), title, label, scale );
-                       p.end();
-               }
-       }
-
-       return aPix;
+  return aPix;
 }
 
 /*!
-  Dump color scale into pixmap with specified size.
+  \brief Dump color scale into pixmap with the specified size.
+  \param w pixmap width
+  \param h pixmap height
+  \return generated pixmap
 */
 QPixmap QtxColorScale::dump( const int w, const int h ) const
 {
-#if QT_VER < 3
-       return dump( backgroundColor(), w, h );
-#else
-       return dump( paletteBackgroundColor(), w, h );
-#endif
+  return dump( palette().color( backgroundRole() ), w, h );
 }
 
 /*!
-  Dump color scale into pixmap with specified size and background color.
+  \brief Dump color scale into pixmap with the specified size and background color.
+  \param bg pixmap background color
+  \param w pixmap width
+  \param h pixmap height
+  \return generated pixmap
 */
 QPixmap QtxColorScale::dump( const QColor& bg, const int w, const int h ) const
 {
-       QPixmap aPix;
-       if ( dumpMode() != NoDump )
-       {
-               bool scale = ( myDumpMode == ScaleDump || myDumpMode == FullDump );
-               bool label = ( myDumpMode == ScaleDump || myDumpMode == FullDump ) &&
-                                        labelPosition() != None;
-               bool title = ( myDumpMode == TitleDump || myDumpMode == FullDump ) &&
-                                        titlePosition() != None;
-
-               int W = w;
-               int H = h;
-               if ( W < 0 || H < 0 )
-               {
-                       QSize sz = calculateSize( false, myFlags & ~WrapTitle, title, label, scale );
-
-                       if ( W < 0 )
-                               W = sz.width();
-                       if ( H < 0 )
-                               H = sz.height();
-               }
-
-               aPix = QPixmap( W, H );
-               if ( !aPix.isNull() )
-               {
-                       QPainter p;
-                       p.begin( &aPix );
-                       p.fillRect( 0, 0, aPix.width(), aPix.height(), bg );
-                       drawScale( &p, bg, false, 0, 0, aPix.width(), aPix.height(), title, label, scale );
-                       p.end();
-               }
-       }
-
-       return aPix;
+  QPixmap aPix;
+  if ( dumpMode() != NoDump )
+  {
+    bool scale = ( myDumpMode == ScaleDump || myDumpMode == FullDump );
+    bool label = ( myDumpMode == ScaleDump || myDumpMode == FullDump ) &&
+      labelPosition() != None;
+    bool title = ( myDumpMode == TitleDump || myDumpMode == FullDump ) &&
+      titlePosition() != None;
+    
+    int W = w;
+    int H = h;
+    if ( W < 0 || H < 0 )
+    {
+      QSize sz = calculateSize( false, myFlags & ~WrapTitle, title, label, scale );
+      
+      if ( W < 0 )
+       W = sz.width();
+      if ( H < 0 )
+       H = sz.height();
+    }
+    
+    aPix = QPixmap( W, H );
+    if ( !aPix.isNull() )
+    {
+      QPainter p;
+      p.begin( &aPix );
+      p.fillRect( 0, 0, aPix.width(), aPix.height(), bg );
+      drawScale( &p, bg, false, 0, 0, aPix.width(), aPix.height(), title, label, scale );
+      p.end();
+    }
+  }
+  
+  return aPix;
 }
 
 /*!
-  Show the color scale. [Reimplemented]
+  \brief Show color scale (reimplemented from QFrame).
 */
 void QtxColorScale::show()
 {
-#if QT_VER == 3
-       if ( myDock )
-               myDock->activate();
-       else
-#endif
-       QFrame::show();
+  QFrame::show();
 }
 
 /*!
-  Hides the color scale. [Reimplemented]
+  \brief Hide color scale (reimplemented from QFrame).
 */
 void QtxColorScale::hide()
 {
-#if QT_VER == 3
-       if ( myDock )
-               myDock->deactivate();
-       else
-#endif
-       QFrame::hide();
+  QFrame::hide();
 }
 
 /*!
-  Draw color scale contents. [Reimplemented]
+  \brief Paint widget
+  \param e paint event
 */
-void QtxColorScale::drawContents( QPainter* p )
+void QtxColorScale::paintEvent( QPaintEvent* e )
 {
-       if ( !isUpdatesEnabled() )
-               return;
-
-       QRect aDrawRect = contentsRect();
+  QPainter p( this );
+  drawFrame( &p );
+  drawContents( &p );
+}
 
-       drawScale( p, false/*testFlags( Transparent )*/, aDrawRect.x(),
-                          aDrawRect.y(), aDrawRect.width(), aDrawRect.height(),
-                          titlePosition() != None, labelPosition() != None, true );
+/*!
+  \brief Draw color scale (reimplemented from QFrame).
+  \param p painter
+*/
+void QtxColorScale::drawContents( QPainter* p )
+{
+  if ( !updatesEnabled() )
+    return;
+  
+  QRect aDrawRect = contentsRect();
+  
+  drawScale( p, false/*testFlags( Transparent )*/, aDrawRect.x(),
+            aDrawRect.y(), aDrawRect.width(), aDrawRect.height(),
+            titlePosition() != None, labelPosition() != None, true );
 }
 
 /*!
-  Draw color scale contents.
+  \brief Draw color scale contents.
+  \param p painter
+  \param transp if \c true color scale is drawn on transparent background
+  \param X color scale x coordinate
+  \param Y color scale y coordinate
+  \param W color scale width
+  \param H color scale height
+  \param drawTitle if \c true, draw title
+  \param drawLabel if \c true, draw labels
+  \param drawColors if \c true, draw colors
 */
 void QtxColorScale::drawScale( QPainter* p, const bool transp, const int X, const int Y,
-                               const int W, const int H, const bool title,
-                               const bool label, const bool scale ) const
+                               const int W, const int H, const bool drawTitle,
+                               const bool drawLabel, const bool drawColors ) const
 {
-       QPixmap cache( W, H );
-       QPainter cp( &cache );
-
-#if QT_VER < 3
-       drawScale( &cp, backgroundColor(), transp, 0, 0, W, H, title, label, scale );
-#else
-       drawScale( &cp, paletteBackgroundColor(), transp, 0, 0, W, H, title, label, scale );
-#endif
-       cp.end();
-
-       p->drawPixmap( X, Y, cache );
+  QPixmap cache( W, H );
+  QPainter cp( &cache );
+  
+  drawScale( &cp, palette().color( backgroundRole() ), transp, 0, 0, W, H, drawTitle, drawLabel, drawColors );
+  cp.end();
+  
+  p->drawPixmap( X, Y, cache );
 }
 
 /*!
-  Draw color scale contents.
+  \brief Draw color scale contents.
+  \param p painter
+  \param bg background color
+  \param transp if \c true color scale is drawn on transparent background
+  \param X color scale x coordinate
+  \param Y color scale y coordinate
+  \param W color scale width
+  \param H color scale height
+  \param drawTitle if \c true, draw title
+  \param drawLabel if \c true, draw labels
+  \param drawColors if \c true, draw colors
 */
 void QtxColorScale::drawScale( QPainter* p, const QColor& bg, const bool transp,
                                const int X, const int Y, const int W, const int H,
                                const bool drawTitle, const bool drawLabel, const bool drawColors ) const
 {
-       if ( !transp )
-               p->fillRect( X, Y, W, H, bg );
-
-       int num = intervalsNumber();
-
-       int labPos = labelPosition();
-
-       int spacer = 5;
-       int textWidth = 0;
-       int textHeight = p->fontMetrics().height();
-
-       QString aTitle = title();
-
-       int titleWidth = 0;
-       int titleHeight = 0;
-
-       if ( qGray( bg.rgb() ) < 128 )
-               p->setPen( QColor( 255, 255, 255 ) );
-       else
-           p->setPen( QColor( 0, 0, 0 ) );
-
-       // Draw title
-       if ( drawTitle )
-       {
-               QSimpleRichText* srt = simpleRichText( myFlags );
-               if ( srt )
-               {
-                       srt->setWidth( p, W - 10 );
-                       titleHeight = srt->height() + spacer;
-                       titleWidth = srt->widthUsed();
-                       QColorGroup cg = colorGroup();
-                       cg.setColor( QColorGroup::Text, p->pen().color() );
-                       srt->draw( p, X + 5, Y, QRect( 0, 0, srt->width(), srt->height() ), cg );
-
-                       delete srt;
-               }
-       }
-
-       bool reverse = testFlags( Reverse );
-
-       QValueList<QColor>  colors;
-       QValueList<QString> labels;
-       for ( int idx = 0; idx < num; idx++ )
-       {
-               if ( reverse )
-               {
-                       colors.append( getColor( idx ) );
-                       labels.append( getLabel( idx ) );
-               }
-               else
-               {
-                       colors.prepend( getColor( idx ) );
-                       labels.prepend( getLabel( idx ) );
-               }
-       }
-
-       if ( testFlags( AtBorder ) )
-       {
-               if ( reverse )
-                       labels.append( getLabel( num ) );
-               else
-                       labels.prepend( getLabel( num ) );
-               if ( drawLabel )
-                       textWidth = QMAX( textWidth, p->fontMetrics().width( labels.last() ) );
-       }
-
-       if ( drawLabel )
-       {
-               const QFontMetrics& fm = p->fontMetrics();
-               for ( QStringList::ConstIterator it = labels.begin(); it != labels.end(); ++it )
-                       textWidth = QMAX( textWidth, fm.width( *it) );
-       }
-
-       int lab = labels.count();
-
-       double spc = ( H - ( ( QMIN( lab, 2 ) + QABS( lab - num - 1 ) ) * textHeight ) - titleHeight );
-       double val = spc != 0 ? 1.0 * ( lab - QMIN( lab, 2 ) ) * textHeight / spc : 0;
-       double iPart;
-       double fPart = modf( val, &iPart );
-       int filter = (int)iPart + ( fPart != 0 ? 1 : 0 );
-       filter = QMAX( filter, 1 );
-
-       double step = 1.0 * ( H - ( lab - num + QABS( lab - num - 1 ) ) * textHeight - titleHeight ) / num;
-
-       int ascent = p->fontMetrics().ascent();
-       int colorWidth = QMAX( 5, QMIN( 20, W - textWidth - 3 * spacer ) );
-       if ( labPos == Center || !drawLabel )
-               colorWidth = W - 2 * spacer;
-
-       // Draw colors
-       int x = X + spacer;
-       switch ( labPos )
-       {
-       case Left:
-           x += textWidth + ( textWidth ? 1 : 0 ) * spacer;
-               break;
-       }
-
-       double offset = 1.0 * textHeight / 2 * ( lab - num + QABS( lab - num - 1 ) ) + titleHeight;
-       QValueList<QColor>::Iterator cit = colors.begin();
+  if ( !transp )
+    p->fillRect( X, Y, W, H, bg );
+  
+  int num = intervalsNumber();
+  
+  int labPos = labelPosition();
+  
+  int spacer = 5;
+  int textWidth = 0;
+  int textHeight = p->fontMetrics().height();
+  
+  QString aTitle = title();
+  
+  int titleWidth = 0;
+  int titleHeight = 0;
+  
+  if ( qGray( bg.rgb() ) < 128 )
+    p->setPen( QColor( 255, 255, 255 ) );
+  else
+    p->setPen( QColor( 0, 0, 0 ) );
+  
+  // Draw title
+  if ( drawTitle )
+  {
+    QTextDocument* srt = textDocument( myFlags );
+    if ( srt )
+    {
+      srt->setTextWidth( W - 10 );
+      titleHeight = (int)srt->size().height() + spacer;
+      titleWidth = (int)srt->size().width();
+      p->save();
+      p->translate( X + 5, Y );
+      srt->drawContents( p );
+      p->restore();
+    }
+    delete srt;
+  }
+
+  bool reverse = testFlags( Reverse );
+  
+  QList<QColor>  colors;
+  QList<QString> labels;
+  for ( int idx = 0; idx < num; idx++ )
+  {
+    if ( reverse )
+    {
+      colors.append( getColor( idx ) );
+      labels.append( getLabel( idx ) );
+    }
+    else
+    {
+      colors.prepend( getColor( idx ) );
+      labels.prepend( getLabel( idx ) );
+    }
+  }
+  
+  if ( testFlags( AtBorder ) )
+  {
+    if ( reverse )
+      labels.append( getLabel( num ) );
+    else
+      labels.prepend( getLabel( num ) );
+    if ( drawLabel )
+      textWidth = qMax( textWidth, p->fontMetrics().width( labels.last() ) );
+  }
+  
+  if ( drawLabel )
+  {
+    const QFontMetrics& fm = p->fontMetrics();
+    for ( QStringList::ConstIterator it = labels.begin(); it != labels.end(); ++it )
+      textWidth = qMax( textWidth, fm.width( *it) );
+  }
+  
+  int lab = labels.count();
+  
+  double spc = ( H - ( ( qMin( lab, 2 ) + qAbs( lab - num - 1 ) ) * textHeight ) - titleHeight );
+  double val = spc != 0 ? 1.0 * ( lab - qMin( lab, 2 ) ) * textHeight / spc : 0;
+  double iPart;
+  double fPart = modf( val, &iPart );
+  int filter = (int)iPart + ( fPart != 0 ? 1 : 0 );
+  filter = qMax( filter, 1 );
+  
+  double step = 1.0 * ( H - ( lab - num + qAbs( lab - num - 1 ) ) * textHeight - titleHeight ) / num;
+  
+  int ascent = p->fontMetrics().ascent();
+  int colorWidth = qMax( 5, qMin( 20, W - textWidth - 3 * spacer ) );
+  if ( labPos == Center || !drawLabel )
+    colorWidth = W - 2 * spacer;
+  
+  // Draw colors
+  int x = X + spacer;
+  switch ( labPos )
+  {
+  case Left:
+    x += textWidth + ( textWidth ? 1 : 0 ) * spacer;
+    break;
+  }
+
+  double offset = 1.0 * textHeight / 2 * ( lab - num + qAbs( lab - num - 1 ) ) + titleHeight;
+  QList<QColor>::Iterator cit = colors.begin();
   uint ci = 0;
-       for ( ci = 0; cit != colors.end() && drawColors; ++cit, ci++ )
-       {
-               int y = (int)( Y + ci * step + offset );
-               int h = (int)( Y + ( ci + 1 ) * step + offset ) - y;
-               p->fillRect( x, y, colorWidth, h, *cit );
-       }
-
-       if ( drawColors )
-               p->drawRect( int( x - 1 ), int( Y + offset - 1 ), int( colorWidth + 2 ), int( ci * step + 2 ) );
-
-       // Draw labels
-       offset = 1.0 * QABS( lab - num - 1 ) * ( step - textHeight ) / 2 +
-                                                1.0 * QABS( lab - num - 1 ) * textHeight / 2;
-       offset += titleHeight;
-       if ( drawLabel && !labels.isEmpty() )
-       {
-               int i1 = 0;
-               int i2 = lab - 1;
-               int last1( i1 ), last2( i2 );
-               int x = X + spacer;
-               switch ( labPos )
-               {
-               case Center:
-                       x += ( colorWidth - textWidth ) / 2;
-                       break;
-               case Right:
-                       x += colorWidth + spacer;
-                       break;
-               }
-               while ( i2 - i1 >= filter || ( i2 == 0 && i1 == 0 ) )
-               {
-                       int pos1 = i1;
-                       int pos2 = lab - 1 - i2;
-                       if ( filter && !( pos1 % filter ) )
-                       {
-                               p->drawText( x, (int)( Y + i1 * step + ascent + offset ), *labels.at( i1 ) );
-                               last1 = i1;
-                       }
-                       if ( filter && !( pos2 % filter ) )
-                       {
-                               p->drawText( x, (int)( Y + i2 * step + ascent + offset ), *labels.at( i2 ) );
-                               last2 = i2;
-                       }
-                       i1++;
-                       i2--;
-               }
-               int pos = i1;
-               int i0 = -1;
-               while ( pos <= i2 && i0 == -1 )
-               {
-                       if ( filter && !( pos % filter ) &&
-                                QABS( pos - last1 ) >= filter && QABS( pos - last2 ) >= filter )
-                               i0 = pos;
-                       pos++;
-               }
-
-               if ( i0 != -1 )
-                       p->drawText( x, (int)( Y + i0 * step + ascent + offset ), *labels.at( i0 ) );
-       }
+  for ( ci = 0; cit != colors.end() && drawColors; ++cit, ci++ )
+  {
+    int y = (int)( Y + ci * step + offset );
+    int h = (int)( Y + ( ci + 1 ) * step + offset ) - y;
+    p->fillRect( x, y, colorWidth, h, *cit );
+  }
+  
+  if ( drawColors )
+    p->drawRect( int( x - 1 ), int( Y + offset - 1 ), int( colorWidth + 2 ), int( ci * step + 2 ) );
+  
+  // Draw labels
+  offset = 1.0 * qAbs( lab - num - 1 ) * ( step - textHeight ) / 2 +
+    1.0 * qAbs( lab - num - 1 ) * textHeight / 2;
+  offset += titleHeight;
+  if ( drawLabel && !labels.isEmpty() )
+  {
+    int i1 = 0;
+    int i2 = lab - 1;
+    int last1( i1 ), last2( i2 );
+    int x = X + spacer;
+    switch ( labPos )
+    {
+    case Center:
+      x += ( colorWidth - textWidth ) / 2;
+      break;
+    case Right:
+      x += colorWidth + spacer;
+      break;
+    }
+    while ( i2 - i1 >= filter || ( i2 == 0 && i1 == 0 ) )
+    {
+      int pos1 = i1;
+      int pos2 = lab - 1 - i2;
+      if ( filter && !( pos1 % filter ) )
+      {
+       p->drawText( x, (int)( Y + i1 * step + ascent + offset ), labels[i1] );
+       last1 = i1;
+      }
+      if ( filter && !( pos2 % filter ) )
+      {
+       p->drawText( x, (int)( Y + i2 * step + ascent + offset ), labels[i2] );
+       last2 = i2;
+      }
+      i1++;
+      i2--;
+    }
+    int pos = i1;
+    int i0 = -1;
+    while ( pos <= i2 && i0 == -1 )
+    {
+      if ( filter && !( pos % filter ) &&
+          qAbs( pos - last1 ) >= filter && qAbs( pos - last2 ) >= filter )
+       i0 = pos;
+      pos++;
+    }
+
+    if ( i0 != -1 )
+      p->drawText( x, (int)( Y + i0 * step + ascent + offset ), labels[i0] );
+  }
 }
 
 /*!
-  \return the format for number labels.
+  \brief Generate number presentation format.
+  \return format for number labels
 */
 QString QtxColorScale::getFormat() const
 {
-       QString aFormat = format();
-
-       if ( !testFlags( PreciseFormat ) || testFlags( Integer ) )
-               return aFormat;
-
-       if ( !myPrecise.isEmpty() )
-               return myPrecise;
-
-       if ( aFormat.find( QRegExp( "^(%[0-9]*.?[0-9]*[fegFEG])$" ) ) != 0 )
-               return aFormat;
-
-       int pos1 = aFormat.find( '.' );
-       int pos2 = aFormat.find( QRegExp( "[fegFEG]") );
-
-       QString aLocFormat;
-       int precision = 1;
-       if ( pos1 > 0 )
-       {
-               aLocFormat = aFormat.mid( 0, pos1 + 1 );
-               precision = aFormat.mid( pos1 + 1, pos2 - pos1 - 1 ).toInt();
-               if ( precision < 1 )
-                       precision = 1;
-       }
-       else
-               return aFormat;
+  QString aFormat = format();
+  
+  if ( !testFlags( PreciseFormat ) || testFlags( Integer ) )
+    return aFormat;
+  
+  if ( !myPrecise.isEmpty() )
+    return myPrecise;
   
-       QtxColorScale* that = (QtxColorScale*)this;
-
-       // calculate format, maximum precision limited
-       // to 7 digits after the decimal point.
-       while ( myPrecise.isEmpty() && precision < 7 )
-       {
-               QString aTmpFormat = aLocFormat;
-               aTmpFormat += QString( "%1" ).arg( precision );
-               aTmpFormat += aFormat.mid( pos2 );
-
-               QMap<QString, int> map;
-               bool isHasTwinz = false;
-
-               for ( int idx = 0; idx < intervalsNumber() && !isHasTwinz; idx++ )
-               {
-                       double val = getNumber( idx );
-                       QString tmpname = QString().sprintf( aTmpFormat, val );
-                       isHasTwinz = map.contains( tmpname );
-                       map.insert( tmpname, 1 );
-               }
-
-               if ( !isHasTwinz )
-                       that->myPrecise = aTmpFormat;
-               precision++;
-       }
-
-       if ( !myPrecise.isEmpty() )
-               aFormat = myPrecise;
-
-       return aFormat;
+  if ( !aFormat.contains( QRegExp( "^(%[0-9]*.?[0-9]*[fegFEG])$" ) ) )
+    return aFormat;
+  
+  int pos1 = aFormat.indexOf( '.' );
+  int pos2 = aFormat.indexOf( QRegExp( "[fegFEG]") );
+  
+  QString aLocFormat;
+  int precision = 1;
+  if ( pos1 > 0 )
+  {
+    aLocFormat = aFormat.mid( 0, pos1 + 1 );
+    precision = aFormat.mid( pos1 + 1, pos2 - pos1 - 1 ).toInt();
+    if ( precision < 1 )
+      precision = 1;
+  }
+  else
+    return aFormat;
+  
+  QtxColorScale* that = (QtxColorScale*)this;
+  
+  // calculate format, maximum precision limited
+  // to 7 digits after the decimal point.
+  while ( myPrecise.isEmpty() && precision < 7 )
+  {
+    QString aTmpFormat = aLocFormat;
+    aTmpFormat += QString( "%1" ).arg( precision );
+    aTmpFormat += aFormat.mid( pos2 );
+    
+    QMap<QString, int> map;
+    bool isHasTwinz = false;
+    
+    for ( int idx = 0; idx < intervalsNumber() && !isHasTwinz; idx++ )
+    {
+      double val = getNumber( idx );
+      QString tmpname = QString().sprintf( aTmpFormat.toLatin1(), val );
+      isHasTwinz = map.contains( tmpname );
+      map.insert( tmpname, 1 );
+    }
+    
+    if ( !isHasTwinz )
+      that->myPrecise = aTmpFormat;
+    precision++;
+  }
+  
+  if ( !myPrecise.isEmpty() )
+    aFormat = myPrecise;
+  
+  return aFormat;
 }
 
 /*!
-  \return the number for specified interval.
+  \brief Get color scale value corresponding to the specified interval.
+  \param idx interval index
+  \return color scale value
 */
 double QtxColorScale::getNumber( const int idx ) const
 {
-       double val = 0;
-       if ( intervalsNumber() > 0 )
-               val = minimum() + idx * ( QABS( maximum() - minimum() ) / intervalsNumber() );
-       return val;
+  double val = 0;
+  if ( intervalsNumber() > 0 )
+    val = minimum() + idx * ( qAbs( maximum() - minimum() ) / intervalsNumber() );
+  return val;
 }
 
 /*!
-  \return the label for specified interval according to the current label mode.
+  \brief Get color scale label text corresponding to the specified interval.
+  \param idx interval index
+  \return color scale label text
 */
 QString QtxColorScale::getLabel( const int idx ) const
 {
-       QString res;
-       if ( labelMode() == User )
-               res = label( idx );
-       else
-       {
-               double val = getNumber( idx );
-               res = QString().sprintf( getFormat(), testFlags( Integer ) ? (int)val : val );
-       }
-       return res;
+  QString res;
+  if ( labelMode() == User )
+    res = label( idx );
+  else
+  {
+    double val = getNumber( idx );
+    res = QString().sprintf( getFormat().toLatin1(), testFlags( Integer ) ? (int)val : val );
+  }
+  return res;
 }
 
 /*!
-  \return the color for specified interval according to the current color mode.
+  \brief Get color scale color corresponding to the specified interval.
+  \param idx interval index
+  \return color scale color
 */
 QColor QtxColorScale::getColor( const int idx ) const
 {
-       QColor res;
-       if ( colorMode() == User )
-               res = color( idx );
-       else
+  QColor res;
+  if ( colorMode() == User )
+    res = color( idx );
+  else
     res = Qtx::scaleColor( idx, 0, intervalsNumber() - 1 );
-       return res;
+  return res;
 }
 
 /*!
-  Update color scale if it required.
+  \brief Update color scale.
 */
 void QtxColorScale::updateScale()
 {
   update();
-       updateGeometry();
-}
-
-/*!
-  \return QSimpleRichText object for title. If title
-  not defined (empty string) then return null pointer.
-  Object should be deleted by caller function.
-*/
-QSimpleRichText* QtxColorScale::simpleRichText( const int flags ) const
-{
-       QSimpleRichText* srt = 0;
-
-       QString aTitle;
-       switch ( titlePosition() )
-       {
-       case Left:
-               aTitle = QString( "<p align=\"left\">%1</p>" );
-               break;
-       case Right:
-               aTitle = QString( "<p align=\"right\">%1</p>" );
-               break;
-       case Center:
-               aTitle = QString( "<p align=\"center\">%1</p>" );
-               break;
-       case None:
-       default:
-               break;
-       }
-
-       if ( !aTitle.isEmpty() && !title().isEmpty() )
-       {
-               if ( !myStyleSheet )
-               {
-                       QtxColorScale* that = (QtxColorScale*)this;
-                       that->myStyleSheet = new QStyleSheet( that );
-               }
-
-               if ( myStyleSheet )
-               {
-                       QStyleSheetItem* item = myStyleSheet->item( "p" );
-                       if ( item )
-                               item->setWhiteSpaceMode( flags & WrapTitle ? QStyleSheetItem::WhiteSpaceNormal :
-                                                                                                                    QStyleSheetItem::WhiteSpaceNoWrap );
-               }
-
-               aTitle = aTitle.arg( title() );
-               srt = new QSimpleRichText( aTitle, font(), QString::null, myStyleSheet );
-       }
-
-       return srt;
-}
-
-#if QT_VER == 3
-
-/*!
-  \class QtxColorScale::Dock
-  Dockable window contains the color scale.
-*/
-
-/*!
-  Constructor
-*/
-QtxColorScale::Dock::Dock( Place p, QWidget* parent, const char* name, WFlags f )
-: QDockWindow( p, parent, name, f ),
-myBlockShow( false ),
-myBlockResize( false )
-{
-       myScale = new QtxColorScale( this );
-
-       setWidget( myScale );
-
-       setCloseMode( Always );
-       setMovingEnabled( true );
-       setResizeEnabled( true );
-       setHorizontalStretchable( false );
-
-       setCaption( tr ( "Color scale" ) );
-}
-
-/*!
-  Destructor.
-*/
-QtxColorScale::Dock::~Dock()
-{
-}
-
-/*!
-  \return color scale widget.
-*/
-QtxColorScale* QtxColorScale::Dock::colorScale() const
-{
-       return myScale;
+  updateGeometry();
 }
 
 /*!
-  Set the dockable window is visible for main window.
-*/
-void QtxColorScale::Dock::activate()
-{
-       if ( myBlockShow )
-               return;
-
-       QMainWindow* mw = 0;
-       QWidget* p = parentWidget();
-       while ( !mw && p )
-       {
-               if ( p->inherits( "QMainWindow" ) )
-                       mw = (QMainWindow*)p;
-               p = p->parentWidget();
-       }
-       if ( mw )
-               mw->setAppropriate( this, true );
-}
+  \brief Get text document (rich text) for the color scale title representation.
 
-/*!
-  Set the dockable window is hidden for main window.
-*/
-void QtxColorScale::Dock::deactivate()
-{
-       if ( myBlockShow )
-               return;
-
-       QMainWindow* mw = 0;
-       QWidget* p = parentWidget();
-       while ( !mw && p )
-       {
-               if ( p->inherits( "QMainWindow" ) )
-                       mw = (QMainWindow*)p;
-               p = p->parentWidget();
-       }
-       if ( mw )
-               mw->setAppropriate( this, false );
-}
+  If title is not defined (empty string) then null pointer is returned.
+  The calling function is responsible for the returning object deleting.
 
-/*!
-  \return true if the dockable window is visible.
+  \param flags color scale flags (not used)
+  \return text document or 0 if title is not set
 */
-bool QtxColorScale::Dock::isActive() const
+QTextDocument* QtxColorScale::textDocument( const int /*flags*/ ) const
 {
-       QMainWindow* mw = 0;
-       QWidget* p = parentWidget();
-       while ( !mw && p )
-       {
-               if ( p->inherits( "QMainWindow" ) )
-                       mw = (QMainWindow*)p;
-               p = p->parentWidget();
-       }
-       if ( mw )
-               return mw->appropriate( (QDockWindow*)this );
-       else
-               return false;
-}
+  QTextDocument* doc = 0;
 
-/*!
-  Redefined show
-*/
-void QtxColorScale::Dock::show()
-{
-       bool f = myBlockShow;
-       myBlockShow = true;
-       QDockWindow::show();
-       myBlockShow = f;
-}
-
-/*!
-  Redefined hide
-*/
-void QtxColorScale::Dock::hide()
-{
-       bool f = myBlockShow;
-       myBlockShow = false;
-       QDockWindow::hide();
-       myBlockShow = f;
-}
-
-/*!
-  Make extent width as maximum value of widget width.
-*/
-void QtxColorScale::Dock::resize( int w, int h )
-{
-       QDockWindow::resize( w, h );
-
-       if ( myBlockResize )
-               return;
-
-       if ( orientation() == Qt::Vertical )
-               setFixedExtentWidth( QMAX( fixedExtent().width(), w ) );
-       else if ( orientation() == Qt::Horizontal )
-               setFixedExtentHeight( QMAX( fixedExtent().height(), h ) );
-}
+  QString aTitle;
+  switch ( titlePosition() )
+  {
+  case Left:
+    aTitle = QString( "<p align=\"left\">%1</p>" );
+    break;
+  case Right:
+    aTitle = QString( "<p align=\"right\">%1</p>" );
+    break;
+  case Center:
+    aTitle = QString( "<p align=\"center\">%1</p>" );
+    break;
+  case None:
+  default:
+    break;
+  }
+  
+  if ( !aTitle.isEmpty() && !title().isEmpty() )
+  {
+    /*
+    if ( !myStyleSheet )
+    {
+      QtxColorScale* that = (QtxColorScale*)this;
+      that->myStyleSheet = new QStyleSheet( that );
+    }
+      
+    if ( myStyleSheet )
+    {
+      QStyleSheetItem* item = myStyleSheet->item( "p" );
+      if ( item )
+      item->setWhiteSpaceMode( flags & WrapTitle ? QStyleSheetItem::WhiteSpaceNormal :
+      QStyleSheetItem::WhiteSpaceNoWrap );
+    }
+    */
+    aTitle = aTitle.arg( title() );
+    doc = new QTextDocument( aTitle );
+  }
 
-/*!
-  Set orientation
-  \param o - new orientation
-*/
-void QtxColorScale::Dock::setOrientation( Orientation o )
-{
-       bool b = myBlockResize;
-       myBlockResize = true;
-       QDockWindow::setOrientation( o );
-       myBlockResize = b;
+  return doc;
 }
-
-#endif
index bae5e9d63cce27d8bbbcac65cc7e05627ed33642..8b601adbf5d3f61b2076003a2f4b934a5bb9f325 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxColorScale.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXCOLORSCALE_H
 #define QTXCOLORSCALE_H
 
 #include "Qtx.h"
 
-#include <qframe.h>
-#include <qvaluelist.h>
-
-#if QT_VER == 3
-#include <qdockwindow.h>
-#endif
+#include <QFrame>
+#include <QList>
 
-class QStyleSheet;
-class QSimpleRichText;
+class QTextDocument;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
-/*!
-  \class QtxColorScale
-  Color Scale widget.
-*/
 class QTX_EXPORT QtxColorScale : public QFrame
 {
-         Q_OBJECT
+  Q_OBJECT
 
 public:
-         typedef enum { Auto, User } Mode;
-         typedef enum { None, Left, Right, Center } Position;
-         typedef enum { NoDump, TitleDump, ScaleDump, FullDump } DumpMode;
-         typedef enum { AtBorder = 0x001, Reverse = 0x002, Integer = 0x004,
-                                          WrapTitle = 0x008, PreciseFormat = 0x010, Transparent = 0x020 } Flags;
-
-#if QT_VER == 3
-         class Dock : public QDockWindow
-         {
-      public:
-          Dock( Place = InDock, QWidget* = 0, const char* = 0, WFlags = 0 );
-          virtual ~Dock();
-          
-          QtxColorScale* colorScale() const;
-          
-          void           activate();
-          void           deactivate();
-          
-          bool           isActive() const;
-          
-          virtual void   show();
-          virtual void   hide();
-          
-          virtual void   resize( int, int );
-          virtual void   setOrientation( Orientation );
-          
-      private:
-          QtxColorScale* myScale;
-          bool           myBlockShow;
-          bool           myBlockResize;
-      };
-
-private:
-         QtxColorScale( Dock*, const char* = 0, WFlags = 0 );
-#endif
+  //! Color scale color/label mode.
+  typedef enum { 
+    Auto,            //!< auto
+    User             //!< user defined
+  } Mode;
+  //! Color scale title, label position.
+  typedef enum { 
+    None,            //!< do not draw
+    Left,            //!< draw at the left
+    Right,           //!< draw at the right
+    Center           //!< draw at the center
+  } Position;
+  //! Dump mode.
+  typedef enum { 
+    NoDump,          //!< do not dump
+    TitleDump,       //!< dump title
+    ScaleDump,       //!< dump scale
+    FullDump         //!< dump all
+  } DumpMode;
+  //! Color scale flags (bitwise).
+  typedef enum { 
+    AtBorder      = 0x001,   //!< diplay values at colors boundaries
+    Reverse       = 0x002,   //!< display color scale in reverse order
+    Integer       = 0x004,   //!< round numbers to integer values
+    WrapTitle     = 0x008,   //!< wrap title to several lines
+    PreciseFormat = 0x010,   //!< autodetect decimal point precision for color scale values
+    Transparent   = 0x020    //!< transparent background (not implemented yet!)
+  } Flags;
 
 public:
-         QtxColorScale( QWidget* = 0, const char* = 0, WFlags = 0 );
-         QtxColorScale( const int, QWidget* = 0, const char* = 0, WFlags = 0 );
-         virtual ~QtxColorScale();
-
-         double                minimum() const;
-         double                maximum() const;
-         void                  range( double&, double& ) const;
-         int                   dumpMode() const;
-         int                   labelMode() const;
-         int                   colorMode() const;
-         int                   intervalsNumber() const;
-
-         QString               title() const;
-         QString               format() const;
-         QString               label( const int ) const;
-         QColor                color( const int ) const;
-         void                  labels( QStringList& ) const;
-         void                  colors( QValueList<QColor>& ) const;
-
-         int                   labelPosition() const;
-         int                   titlePosition() const;
-
-         void                  setMinimum( const double );
-         void                  setMaximum( const double );
-         void                  setRange( const double, const double );
-         void                  setDumpMode( const int );
-         void                  setColorMode( const int );
-         void                  setLabelMode( const int );
-         void                  setIntervalsNumber( const int );
-
-         void                  setTitle( const QString& );
-         void                  setFormat( const QString& );
-         void                  setLabel( const QString&, const int = -1 );
-         void                  setColor( const QColor&, const int = -1 );
-         void                  setLabels( const QStringList& );
-         void                  setColors( const QValueList<QColor>& );
-
-         void                  setLabelPosition( const int );
-         void                  setTitlePosition( const int );
-
-         void                  setFlags( const int );
-         bool                  testFlags( const int ) const;
-         void                  clearFlags( const int );
-
-         QPixmap               dump() const;
-         QPixmap               dump( const int = -1, const int = -1 ) const;
-         QPixmap               dump( const QColor&, const int = -1, const int = -1 ) const;
-
-         virtual QSize         minimumSizeHint() const;
-         virtual QSize         sizeHint() const;
-
-         virtual void          show();
-         virtual void          hide();
+  QtxColorScale( QWidget* = 0, Qt::WindowFlags = 0 );
+  QtxColorScale( const int, QWidget* = 0, Qt::WindowFlags = 0 );
+  virtual ~QtxColorScale();
+
+  double                minimum() const;
+  double                maximum() const;
+  void                  range( double&, double& ) const;
+  int                   dumpMode() const;
+  int                   labelMode() const;
+  int                   colorMode() const;
+  int                   intervalsNumber() const;
+
+  QString               title() const;
+  QString               format() const;
+  QString               label( const int ) const;
+  QColor                color( const int ) const;
+  void                  labels( QStringList& ) const;
+  void                  colors( QList<QColor>& ) const;
+
+  int                   labelPosition() const;
+  int                   titlePosition() const;
+
+  void                  setMinimum( const double );
+  void                  setMaximum( const double );
+  void                  setRange( const double, const double );
+  void                  setDumpMode( const int );
+  void                  setColorMode( const int );
+  void                  setLabelMode( const int );
+  void                  setIntervalsNumber( const int );
+
+  void                  setTitle( const QString& );
+  void                  setFormat( const QString& );
+  void                  setLabel( const QString&, const int = -1 );
+  void                  setColor( const QColor&, const int = -1 );
+  void                  setLabels( const QStringList& );
+  void                  setColors( const QList<QColor>& );
+
+  void                  setLabelPosition( const int );
+  void                  setTitlePosition( const int );
+
+  void                  setFlags( const int );
+  bool                  testFlags( const int ) const;
+  void                  clearFlags( const int );
+
+  QPixmap               dump() const;
+  QPixmap               dump( const int = -1, const int = -1 ) const;
+  QPixmap               dump( const QColor&, const int = -1, const int = -1 ) const;
+
+  virtual QSize         minimumSizeHint() const;
+  virtual QSize         sizeHint() const;
+
+  virtual void          show();
+  virtual void          hide();
 
 protected:
-         virtual void          drawContents( QPainter* );
+  virtual void          paintEvent( QPaintEvent* );
+  virtual void          drawContents( QPainter* );
 
 private:
-         void                  updateScale();
-         QString               getFormat() const;
-         QString               getLabel( const int ) const;
-         QColor                getColor( const int ) const;
-         double                getNumber( const int ) const;
-         QSimpleRichText*      simpleRichText( const int ) const;
-         void                  drawScale( QPainter*, const bool, const int, const int,
-                                                                                          const int, const int, const bool, const bool, const bool ) const;
-         void                  drawScale( QPainter*, const QColor&, const bool,
-                                                                                          const int, const int, const int, const int,
-                                                                                          const bool, const bool, const bool ) const;
-         QSize                 calculateSize( const bool, const int,
-                                                                                                    const bool, const bool, const bool ) const;
-
-#if QT_VER == 3
-         friend class QtxColorScale::Dock;
-#endif
+  void                  updateScale();
+  QString               getFormat() const;
+  QString               getLabel( const int ) const;
+  QColor                getColor( const int ) const;
+  double                getNumber( const int ) const;
+  QTextDocument*        textDocument( const int ) const;
+  void                  drawScale( QPainter*, const bool, const int, const int,
+                                  const int, const int, const bool, const bool, const bool ) const;
+  void                  drawScale( QPainter*, const QColor&, const bool,
+                                  const int, const int, const int, const int,
+                                  const bool, const bool, const bool ) const;
+  QSize                 calculateSize( const bool, const int,
+                                      const bool, const bool, const bool ) const;
 
 private:
-         double                myMin;
-         double                myMax;
-         QString               myTitle;
-         QString               myFormat;
-         QString               myPrecise;
-         int                   myInterval;
-         int                   myDumpMode;
-         int                   myColorMode;
-         int                   myLabelMode;
-
-         QValueList<QColor>    myColors;
-         QValueList<QString>   myLabels;
-
-         Dock*                 myDock;
-         int                   myFlags;
-         int                   myLabelPos;
-         int                   myTitlePos;
-         QStyleSheet*          myStyleSheet;
+  double                myMin;             //!< lower limit
+  double                myMax;             //!< upper limit
+  QString               myTitle;           //!< title
+  QString               myFormat;          //!< number presentation format
+  QString               myPrecise;         //!< double values precision format
+  int                   myInterval;        //!< number of color scale intervals
+  int                   myDumpMode;        //!< dump mode (QtxColorScale::DumpMode)
+  int                   myColorMode;       //!< color mode (QtxColorScale::Mode)
+  int                   myLabelMode;       //!< label mode (QtxColorScale::Mode)
+
+  QList<QColor>         myColors;          //!< list of colors
+  QList<QString>        myLabels;          //!< list of labels
+
+  int                   myFlags;           //!< color scale flags (QtxColorScale::Flags)
+  int                   myLabelPos;        //!< label position (QtxColorScale::Position)
+  int                   myTitlePos;        //!< title position (QtxColorScale::Position)
 };
 
 #ifdef WIN32
 #pragma warning( default:4251 )
 #endif
 
-#endif
+#endif  // QTXCOLORSCALE_H
index a2c95f2512d0ed643d17d17505bb9663330470ca..74425a78848b0d77fbbf7e4a6e243bd2d9448514 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxComboBox.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxComboBox.h"
 
-#include <qpixmap.h>
-#include <qlineedit.h>
-#include <qvaluelist.h>
+#include <QStandardItemModel>
+#include <QLineEdit>
+#include <QEvent>
+#include <QApplication>
+
+/*!
+  \class QtxComboBox::Model
+  \brief Internal view model, used to process 'cleared' state of the combo box.
+  \internal
+*/
+class QtxComboBox::Model : public QStandardItemModel
+{
+public:
+  Model( QObject* parent = 0 );
+  ~Model();
+  void setCleared( const bool );
+
+  QVariant data( const QModelIndex&, int = Qt::DisplayRole ) const;
+
+private:
+  bool   myCleared;
+};
+
+/*!
+  \brief Constructor
+  \internal
+  \param parent parent object
+*/
+QtxComboBox::Model::Model( QObject* parent )
+  : QStandardItemModel( 0, 1, parent ),
+    myCleared( false )
+{
+}
+
+/*!
+  \brief Destructor
+  \internal
+*/
+QtxComboBox::Model::~Model()
+{
+}
+
+/*!
+  \brief Set 'cleared' state
+  \param isClear new 'cleared' state
+  \internal
+*/
+void QtxComboBox::Model::setCleared( const bool isClear )
+{
+  if ( myCleared == isClear )
+    return;
+  
+  myCleared = isClear;
+}
+
+/*!
+  \brief Get model data.
+  \param index model index
+  \param role data role
+  \return data of role \a role for the \a index
+  \internal
+*/
+QVariant QtxComboBox::Model::data( const QModelIndex& index, int role ) const
+{
+  return ( myCleared && ( role == Qt::DisplayRole || role == Qt::DecorationRole ) ) ?
+    QVariant() : QStandardItemModel::data( index, role );
+}
+
+/*!
+  \class QtxComboBox::ClearEvent
+  \brief Custom event, used to process 'cleared' state of the combo box
+  in the editable mode.
+  \internal
+*/
+
+#define CLEAR_EVENT QEvent::Type( QEvent::User + 123 )
+
+class QtxComboBox::ClearEvent : public QEvent
+{
+public:
+  ClearEvent();
+};
 
 /*!
-  Constructor
+  \brief Constructor
+  \internal
 */
-QtxComboBox::QtxComboBox( QWidget* parent, const char* name )
-: QComboBox( parent, name ),
-myCleared( false )
+QtxComboBox::ClearEvent::ClearEvent() : QEvent( CLEAR_EVENT )
 {
-    connect( this, SIGNAL( activated( int ) ), this, SLOT( onActivated( int ) ) );
-    connect( this, SIGNAL( activated( const QString& ) ), this, SLOT( onActivated( const QString& ) ) );
 }
 
 /*!
-  Constructor
+  \class QtxComboBox
+  \brief Enhanced version of Qt combo box class.
+
+  In addition to the QComboBox class, QtxComboBox supports 
+  adding/removing the items with the associated unique identifiers.
+  It also provides a way to set "cleared" state to the combo box -
+  when no item is selected.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
 */
-QtxComboBox::QtxComboBox( bool rw, QWidget* parent, const char* name )
-: QComboBox( rw, parent, name ),
-myCleared( false )
+QtxComboBox::QtxComboBox( QWidget* parent )
+: QComboBox( parent ),
+  myCleared( false )
 {
-    connect( this, SIGNAL( activated( int ) ), this, SLOT( onActivated( int ) ) );
-    connect( this, SIGNAL( activated( const QString& ) ), this, SLOT( onActivated( const QString& ) ) );
+  connect( this, SIGNAL( activated( int ) ),            this, SLOT( onActivated( int ) ) );
+  connect( this, SIGNAL( currentIndexChanged( int ) ),  this, SLOT( onCurrentChanged( int ) ) );
+  setModel( new Model( this ) );
 }
 
 /*!
-  Destructor
+  \brief Destructor.
+
+  Does nothing currently.
 */
 QtxComboBox::~QtxComboBox()
 {
 }
 
 /*!
-  \return true if combobox is cleared
+  \brief Check if the combo box is in the "cleared" state.
+  \return \c true if combobox is in the "cleared" state
 */
 bool QtxComboBox::isCleared() const
 {
-    return myCleared;
+  return myCleared;
 }
 
 /*!
-  Sets cleared status
-  \param isClear - new status
+  \brief Set "cleared" state.
+  \param isClear new "cleared" state
 */
 void QtxComboBox::setCleared( const bool isClear )
 {
-    if ( myCleared == isClear )
-        return;
-    
-    myCleared = isClear;
+  if ( myCleared == isClear )
+    return;
     
-    if ( editable() )
-    {
-        if ( myCleared )
-            lineEdit()->setText( "" );
-        else
-            lineEdit()->setText( text( currentItem() ) );
-    }
-    
-    update();
+  myCleared = isClear;
+
+  if ( lineEdit() )
+    lineEdit()->setText( myCleared ? QString( "" ) : itemText( currentIndex() ) );
+
+  update();
 }
 
 /*!
-  Sets currently selected item
-  \param idx - index of item
+  \brief Get current item ID.
+  \return item id
 */
-void QtxComboBox::setCurrentItem( int idx )
+int QtxComboBox::currentId() const
 {
-    if ( idx < 0 || idx >= count() )
-        return;
-    
-    myCleared = false;
-    QComboBox::setCurrentItem( idx );
+  return id( currentIndex() );
 }
 
 /*!
-  Sets current text
-  \param txt - new current text
+  \brief Set current item by ID.
+  \param num item ID
 */
-void QtxComboBox::setCurrentText( const QString& txt )
+void QtxComboBox::setCurrentId( int num )
 {
-    myCleared = false;
-#if QT_VER < 3
-    int i = -1;
-    for ( int j = 0; j < count() && i == -1; j++ )
-        if ( text( j ) == txt )
-            i = j;
-    if ( i >= 0 && i < count() )
-        setCurrentItem( i );
-    else if ( editable() )
-        lineEdit()->setText( txt );
-    else
-        changeItem( txt, currentItem() );
-#else
-    QComboBox::setCurrentText( txt );
-#endif
+  setCurrentIndex( index( num ) );
 }
 
 /*!
-  \return current selected id
+  \brief Set the identifier to specified item.
+  \param index - index of the item
+  \param id - identifier of the item
 */
-int QtxComboBox::currentId() const
+void QtxComboBox::setId( const int index, const int id )
 {
-    return id( currentItem() );
+  setItemData( index, QVariant( id ), (Qt::ItemDataRole)IdRole );
 }
 
 /*!
-  Sets current selected id
+  \brief Customize paint event.
+  \param e paint event
 */
-void QtxComboBox::setCurrentId( int num )
+void QtxComboBox::paintEvent( QPaintEvent* e )
 {
-    setCurrentItem( index( num ) );
+  Model* m = dynamic_cast<Model*>( model() );
+  if ( m )
+    m->setCleared( myCleared );
+  QComboBox::paintEvent( e );
+  if ( m )
+    m->setCleared( false );
 }
 
 /*!
-  Custom paint event handler
+  \brief Customize child addition/removal event
+  \param e child event
 */
-void QtxComboBox::paintEvent( QPaintEvent* e )
+void QtxComboBox::childEvent( QChildEvent* e )
+{
+  if ( ( e->added() || e->polished() ) && qobject_cast<QLineEdit*>( e->child() ) )
+    QApplication::postEvent( this, new ClearEvent() );
+}
+
+/*!
+  \brief Process custom events
+  \param e custom event
+*/
+void QtxComboBox::customEvent( QEvent* e )
 {
-    if ( !count() || !myCleared || editable() )
-        QComboBox::paintEvent( e );
-    else
-        paintClear( e );
+  if ( e->type() == CLEAR_EVENT && lineEdit() && myCleared )
+    lineEdit()->setText( "" );
 }
 
 /*!
-  SLOT: called if some item is activated
-  \param idx - index of activated item
+  \brief Called when any item is activated by the user.
+  \param idx activated item index
 */
 void QtxComboBox::onActivated( int idx )
 {
-    resetClear();
-    
-    if ( myIndexId.contains( idx ) )
-        emit activatedId( myIndexId[idx] );
+  resetClear();
+  emit activatedId( id( idx ) );
 }
 
 /*!
-  SLOT: called if some item is activated
-*/void QtxComboBox::onActivated( const QString& )
+  \brief Called when current item is chaned (by the user or programmatically).
+  \param idx item being set current
+*/
+void QtxComboBox::onCurrentChanged( int idx )
 {
+  if ( idx != -1 )
     resetClear();
 }
 
 /*!
-  Strips "cleared" state and updates
+  \brief Reset "cleared" state and update the combo box.
 */
 void QtxComboBox::resetClear()
 {
-    if ( !myCleared )
-        return;
-    
-    myCleared = false;
-    update();
+  if ( !myCleared )
+    return;
+  
+  myCleared = false;
+  update();
 }
 
 /*!
-  Draws combobox when it is cleared or isn't editable
+  \brief Get item ID by the index.
+  \param idx item index
+  \return item ID or -1 if index is invalid.
 */
-void QtxComboBox::paintClear( QPaintEvent* e )
+int QtxComboBox::id( const int idx ) const
 {
-    int curIndex = currentItem();
-    QString curText = text( curIndex );
-    
-    QPixmap curPix;
-    if ( pixmap( curIndex ) )
-        curPix = *pixmap( curIndex );
-    
-    bool upd = isUpdatesEnabled();
-    setUpdatesEnabled( false );
-    
-    changeItem( "", curIndex );
-    QComboBox::paintEvent( e );
-    
-    if ( curPix.isNull() )
-        changeItem( curText, curIndex );
-    else
-        changeItem( curPix, curText, curIndex );
-    
-    setUpdatesEnabled( upd );
+  int id = -1;
+  QVariant v = itemData( idx, (Qt::ItemDataRole)IdRole );
+  if ( v.canConvert( QVariant::Int ) )
+    id = v.toInt();
+  return id;
 }
 
 /*!
-  \return id by index
+  \brief Get item index by the ID.
+  \param id item ID
+  \return item index or -1 if ID is invalid.
 */
-int QtxComboBox::id( const int idx ) const
+int QtxComboBox::index( const int ident ) const
 {
-    int id = -1;
-    if ( myIndexId.contains( idx ) )
-        id = myIndexId[idx];
-    return id;
+  int idx = -1;
+  for ( int i = 0; i < (int)count() && idx == -1; i++ )
+  {
+    if ( id( i ) == ident )
+      idx = i;
+  }
+  return idx;
 }
 
 /*!
-  \return index by id
+  \brief Returns true if the item with index has ID.
+  \param idx item index
 */
-int QtxComboBox::index( const int id ) const
+bool QtxComboBox::hasId( const int idx ) const
 {
-    int idx = -1;
-    for ( IndexIdMap::ConstIterator it = myIndexId.begin();
-    it != myIndexId.end() && idx == -1; ++it )
-        if ( it.data() == id )
-            idx = it.key();
-        return idx;
+  QVariant v = itemData( idx, (Qt::ItemDataRole)IdRole );
+  return v.canConvert( QVariant::Int );
 }
+
+/*!
+  \fn void QtxComboBox::activatedId( int id )
+  \brief Emitted when the item with identificator \a id is activated.
+  \param id item ID
+*/
index 82c8989e0a48a89990bb28b9aafa008f19b03b16..345881b325350650496d3f2556808cd5568aa3be 100755 (executable)
@@ -1,31 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxComboBox.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXCOMBOBOX_H
 #define QTXCOMBOBOX_H
 
 #include "Qtx.h"
 
-#include <qmap.h>
-#include <qcombobox.h>
+#include <QMap>
+#include <QComboBox>
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 
 class QTX_EXPORT QtxComboBox : public QComboBox
 {
-    Q_OBJECT
+  Q_OBJECT
 
-    typedef QMap<int, int> IndexIdMap;
+  class Model;
+  class ClearEvent;
 
 public:
-    QtxComboBox( QWidget* = 0, const char* = 0 );
-    QtxComboBox( bool, QWidget* = 0, const char* = 0 );
-    virtual ~QtxComboBox();
+  QtxComboBox( QWidget* = 0 );
+  virtual ~QtxComboBox();
+
+  bool         isCleared() const;
+  void         setCleared( const bool );
 
-    bool         isCleared() const;
-    void         setCleared( const bool );
+  int          currentId() const;
+  void         setCurrentId( int );
 
-    virtual void setCurrentItem( int );
-    virtual void setCurrentText( const QString& );
+  int          id( const int ) const;
+  int          index( const int ) const;
 
-    int          currentId() const;
-    void         setCurrentId( int );
+  bool         hasId( const int ) const;
+  void         setId( const int, const int );
 
 signals:
-    void         activatedId( int );
-    void         highlightedId( int );
+  void         activatedId( int );
 
 private slots:
-    void         onActivated( int );
-    void         onActivated( const QString& );
+  void         onActivated( int );
+  void         onCurrentChanged( int );
 
 protected:
-    virtual void paintEvent( QPaintEvent* );
+  virtual void paintEvent( QPaintEvent* );
+  virtual void childEvent( QChildEvent* );
+  virtual void customEvent( QEvent* );
 
 private:
-    int          id( const int ) const;
-    int          index( const int ) const;
+  void         resetClear();
 
-    void         resetClear();
-    void         paintClear( QPaintEvent* );
+private:
+  enum { IdRole = Qt::UserRole + 10 };
 
 private:
-    bool         myCleared;
-    IndexIdMap   myIndexId;
+  bool         myCleared;     //!< "cleared" state
 };
 
 #ifdef WIN32
diff --git a/src/Qtx/QtxDblSpinBox.cxx b/src/Qtx/QtxDblSpinBox.cxx
deleted file mode 100755 (executable)
index 59f9f61..0000000
+++ /dev/null
@@ -1,603 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxDblSpinBox.cxx
-// Author:    Sergey TELKOV
-
-#include "QtxDblSpinBox.h"
-
-#include <qlineedit.h>
-#include <qvalidator.h>
-#include <qapplication.h>
-
-#include <float.h>
-
-/*!
-  \class  QtxDblSpinBox::Validator [internal]
-  Validator for QtxDblSpinBox (getted from Trolltech Qt - SpinBoxValidator)
-*/
-class QtxDblSpinBox::Validator : public QDoubleValidator
-{
-public:
-    Validator( QtxDblSpinBox* sb, const char* name )
-       : QDoubleValidator( sb, name ), spinBox( sb ) {}
-
-    virtual State validate( QString& str, int& pos ) const;
-
-private:
-    QtxDblSpinBox* spinBox;
-};
-
-
-/*!
-  Checks string and \return QValidator::State
-*/
-QValidator::State QtxDblSpinBox::Validator::validate( QString& str, int& pos ) const
-{
-  QString pref = spinBox->prefix();
-  QString suff = spinBox->suffix();
-  uint overhead = pref.length() + suff.length();
-  State state = Invalid;
-
-  if ( overhead == 0 )
-         state = QDoubleValidator::validate( str, pos );
-  else
-       {
-               if ( str.length() >= overhead && str.startsWith( pref ) &&
-         str.right( suff.length() ) == suff )
-               {
-                       QString core = str.mid( pref.length(), str.length() - overhead );
-                       int corePos = pos - pref.length();
-                       state = QDoubleValidator::validate( core, corePos );
-                       pos = corePos + pref.length();
-                       str.replace( pref.length(), str.length() - overhead, core );
-               }
-               else
-               {
-                       state = QDoubleValidator::validate( str, pos );
-                       if ( state == Invalid )
-                       {
-                               QString special = spinBox->specialValueText().stripWhiteSpace();
-                               QString candidate = str.stripWhiteSpace();
-                               if ( special.startsWith( candidate ) )
-                               {
-                                       if ( candidate.length() == special.length() )
-                                               state = Acceptable;
-                                       else
-                                               state = Intermediate;
-                               }
-                       }
-               }
-  }
-  return state;
-}
-
-/*!
-  Constructor
-*/
-QtxDblSpinBox::QtxDblSpinBox( QWidget* parent, const char* name )
-: QSpinBox( parent, name ),
-myCleared( false ),
-myBlocked( false ),
-myPrecision( 0 )
-{
-  myMin = -DBL_MAX;
-  myMax = DBL_MAX;
-  myStep = QRangeControl::lineStep();
-       myValue = 0;
-  setValidator( new Validator( this, "double_spinbox_validator" ) );
-  rangeChange();
-  updateDisplay();
-
-  connect( editor(), SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) );
-}
-
-/*!
-  Constructor
-*/
-QtxDblSpinBox::QtxDblSpinBox( double min, double max, double step, QWidget* parent, const char* name )
-: QSpinBox( parent, name ),
-myMin( min ),
-myMax( max ),
-myStep( step ),
-myCleared( false ),
-myBlocked( false ),
-myPrecision( 0 )
-{
-       myValue = myMin;
-  setValidator( new Validator( this, "double_spinbox_validator" ) );
-  rangeChange();
-  updateDisplay();
-
-  connect( editor(), SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) );
-}
-
-/*!
-  Destructor
-*/
-QtxDblSpinBox::~QtxDblSpinBox()
-{
-}
-
-/*!
-  \return min value of spin box
-*/
-double QtxDblSpinBox::minValue() const
-{
-  return myMin;
-}
-
-/*!
-  \return max value of spin box
-*/
-double QtxDblSpinBox::maxValue() const
-{
-  return myMax;
-}
-
-/*!
-  Changes min value of spin box
-  \param min - new min value
-*/
-void QtxDblSpinBox::setMinValue( int min )
-{
-       setMinValue( (double)min );
-}
-
-/*!
-  Changes min value of spin box
-  \param min - new min value
-*/
-void QtxDblSpinBox::setMinValue( double min )
-{
-  if ( myMin != min )
-  {
-    myMin = min;
-    rangeChange();
-  }
-}
-
-/*!
-  Changes max value of spin box
-  \param max - new max value
-*/
-void QtxDblSpinBox::setMaxValue( int max )
-{
-       setMaxValue( (double)max );
-}
-
-/*!
-  Changes max value of spin box
-  \param max - new max value
-*/
-void QtxDblSpinBox::setMaxValue( double max )
-{
-  if ( myMax != max )
-  {
-    myMax = max;
-    rangeChange();
-  }
-}
-
-/*!
-  Changes min and max value of spin box
-  \param min - new min value
-  \param max - new max value
-*/
-void QtxDblSpinBox::setRange( int min, int max )
-{
-       setRange( (double)min, (double)max );
-}
-
-/*!
-  Changes min and max value of spin box
-  \param min - new min value
-  \param max - new max value
-*/
-void QtxDblSpinBox::setRange( double min, double max )
-{
-  if ( myMin != min || myMax != max )
-  {
-    myMin = min;
-    myMax = max;
-    rangeChange();
-  }
-}
-
-/*!
-  \return step of spin box
-*/
-double QtxDblSpinBox::lineStep() const
-{
-  return myStep;
-}
-
-/*!
-  Changes step of spin box
-  \param step - new step
-*/
-void QtxDblSpinBox::setLineStep( int step )
-{
-  setLineStep( (double)step );
-}
-
-/*!
-  Changes step of spin box
-  \param step - new step
-*/
-void QtxDblSpinBox::setLineStep( double step )
-{
-  myStep = step;
-}
-
-/*!
-  \return value of spin box
-*/
-double QtxDblSpinBox::value() const
-{
-  QSpinBox::value();
-
-  return myValue;
-}
-
-/*!
-  Changes value of spin box
-  \param val - new value of spin box
-*/
-void QtxDblSpinBox::setValue( int val )
-{
-       setValue( (double)val );
-}
-
-/*!
-  Changes value of spin box
-  \param val - new value of spin box
-*/
-void QtxDblSpinBox::setValue( double val )
-{
-       myCleared = false;
-  double prevVal = myValue;
-  myValue = bound( val );
-  if ( prevVal != myValue )
-    valueChange();
-}
-
-/*!
-  Adds step to value
-*/
-void QtxDblSpinBox::stepUp()
-{
-       interpretText();
-       if ( wrapping() && myValue + myStep > myMax )
-               setValue( myMin );
-       else
-               setValue( myValue + myStep );
-}
-
-/*!
-  Subtracks step from value
-*/
-void QtxDblSpinBox::stepDown()
-{
-       interpretText();
-       if ( wrapping() && myValue - myStep < myMin )
-               setValue( myMax );
-       else
-               setValue( myValue - myStep );
-}
-
-/*!
-  \return number of digit after comma
-*/
-int QtxDblSpinBox::precision() const
-{
-       return myPrecision;
-}
-
-/*!
-  Changes number of digit after comma
-  \param prec - new digit number
-*/
-void QtxDblSpinBox::setPrecision( const int prec )
-{
-       int newPrec = QMAX( prec, 0 );
-       int oldPrec = QMAX( myPrecision, 0 );
-       myPrecision = prec;
-       if ( newPrec != oldPrec )
-               updateDisplay();
-}
-
-/*!
-  \return true if spin box is cleared
-*/
-bool QtxDblSpinBox::isCleared() const
-{
-       return myCleared;
-}
-
-/*!
-  Changes cleared status of spin box
-  \param on - new status
-*/
-void QtxDblSpinBox::setCleared( const bool on )
-{
-       if ( myCleared == on )
-               return;
-
-       myCleared = on;
-       updateDisplay();
-}
-
-/*!
-  Selects all content of spin box editor
-*/
-void QtxDblSpinBox::selectAll()
-{
-#if QT_VER >= 3
-       QSpinBox::selectAll();
-#else
-  editor()->selectAll();
-#endif
-}
-
-/*!
-  Custom event filter, updates text of spin box editor
-*/
-bool QtxDblSpinBox::eventFilter( QObject* o, QEvent* e )
-{
-  if ( !myCleared || o != editor() || !editor()->text().stripWhiteSpace().isEmpty() )
-  {
-    bool state = QSpinBox::eventFilter( o, e );
-    if ( e->type() == QEvent::FocusOut && o == editor() )
-      updateDisplay();
-    return state;
-  }
-
-  if ( e->type() == QEvent::FocusOut || e->type() == QEvent::Leave || e->type() == QEvent::Hide )
-    return false;
-
-  if ( e->type() == QEvent::KeyPress &&
-         ( ((QKeyEvent*)e)->key() == Key_Tab || ((QKeyEvent*)e)->key() == Key_BackTab ) )
-  {
-    QApplication::sendEvent( this, e );
-    return true;
-  }
-
-  return QSpinBox::eventFilter( o, e );
-}
-
-/*!
-  Updates text of editor
-*/
-void QtxDblSpinBox::updateDisplay()
-{
-  if ( myBlocked )
-    return;
-
-  bool upd = editor()->isUpdatesEnabled();
-  editor()->setUpdatesEnabled( false );
-
-  bool isBlock = myBlocked;
-  myBlocked = true;
-    
-  QString txt = currentValueText();
-    
-  if ( myValue >= myMax )
-    QSpinBox::setValue( QSpinBox::maxValue() );
-  else if ( myValue <= myMin )
-    QSpinBox::setValue( QSpinBox::minValue() );
-  else
-    QSpinBox::setValue( ( QSpinBox::minValue() + QSpinBox::maxValue() ) / 2 );
-  
-  QSpinBox::updateDisplay();
-
-  editor()->setUpdatesEnabled( upd );
-
-  editor()->setText( myCleared ? QString::null : txt );
-  if ( !myCleared && editor()->hasFocus() )
-  {
-    if ( editor()->text() == specialValueText() )
-      editor()->selectAll();
-    else
-      editor()->setSelection( prefix().length(), editor()->text().length() - prefix().length() - suffix().length() );
-  }
-  else
-    editor()->setCursorPosition( 0 );
-
-  myBlocked = isBlock;
-}
-
-/*!
-  Sets double value by text in editor
-*/
-void QtxDblSpinBox::interpretText()
-{
-  myCleared = false;
-
-  bool ok = true;
-  bool done = false;
-  double newVal = 0;
-  if ( !specialValueText().isEmpty() )
-  {
-         QString s = QString( text() ).stripWhiteSpace();
-         QString t = QString( specialValueText() ).stripWhiteSpace();
-         if ( s == t )
-    {
-      newVal = minValue();
-           done = true;
-    }
-  }
-  if ( !done )
-         newVal = mapTextToDoubleValue( &ok );
-  if ( ok )
-         setValue( newVal );
-  updateDisplay();
-}
-
-/*!
-  Emits signal "valueChanged"
-*/
-void QtxDblSpinBox::valueChange()
-{
-  updateDisplay();
-  emit valueChanged( myValue );
-  emit valueChanged( currentValueText() );
-}
-
-/*!
-  Attune parameters on range changing
-*/
-void QtxDblSpinBox::rangeChange()
-{
-  double min = QMIN( myMin, myMax );
-  double max = QMAX( myMin, myMax );
-  myMin = min;
-  myMax = max;
-  QDoubleValidator* v = ::qt_cast<QDoubleValidator*>( validator() );
-  if ( v )
-    v->setRange( myMin, myMax );
-
-       if ( myMin == myMax )
-               QSpinBox::setRange( 0, 0 );
-       else
-               QSpinBox::setRange( 0, 2 );
-
-  setValue( myValue );
-  updateDisplay();
-}
-
-/*!
-  \return text of editor
-*/
-QString QtxDblSpinBox::currentValueText()
-{
-  QString s;
-  if ( (myValue == minValue()) && !specialValueText().isEmpty() )
-         s = specialValueText();
-  else
-       {
-         s = prefix();
-               s.append( mapValueToText( myValue ) );
-               s.append( suffix() );
-       }
-  return s;
-}
-
-/*!
-  Converts number to string
-  \param v - number to be converted
-*/
-QString QtxDblSpinBox::mapValueToText( double v )
-{
-       QString s;
-  s.setNum( v, myPrecision >= 0 ? 'f' : 'g', myPrecision == 0 ? 6 : QABS( myPrecision ) );
-  return removeTrailingZeroes( s );
-}
-
-/*!
-  Converts value to string
-*/
-QString QtxDblSpinBox::mapValueToText( int )
-{
-  QString s;
-  s.setNum( myValue, myPrecision >= 0 ? 'f' : 'g', myPrecision == 0 ? 6 : QABS( myPrecision ) );
-  return removeTrailingZeroes( s );
-}
-
-/*!
-  Converts current text of editor to double
-*/
-double QtxDblSpinBox::mapTextToDoubleValue( bool* ok )
-{
-  QString s = text();
-  double newVal = s.toDouble( ok );
-  if ( !(*ok) && !( !prefix() && !suffix() ) )
-  {
-         s = cleanText();
-         newVal = s.toDouble( ok );
-  }
-  return newVal;
-}
-
-/*!
-  \return value corrected in accordance with borders
-  \param val - value to be corrected
-*/
-double QtxDblSpinBox::bound( double val )
-{
-  double newVal = val;
-  if ( newVal > myMax )
-    newVal = myMax;
-  if ( newVal < myMin )
-    newVal = myMin;
-  return newVal;
-}
-
-/*!
-  Custom handler for leave event
-*/
-void QtxDblSpinBox::leaveEvent( QEvent* e )
-{
-       if ( !myCleared )
-               QSpinBox::leaveEvent( e );
-}
-
-/*!
-  Custom handler for wheel event
-*/
-void QtxDblSpinBox::wheelEvent( QWheelEvent* e )
-{
-  if ( !isEnabled() )
-    return;
-
-  QSpinBox::wheelEvent( e );
-  updateDisplay();
-}
-
-/*!
-  SLOT: called if text is changed
-*/
-void QtxDblSpinBox::onTextChanged( const QString& str )
-{
-  if ( !myBlocked )
-    myCleared = false;
-}
-
-/*!
-  \return string without excess zeros in start and in end
-*/
-QString QtxDblSpinBox::removeTrailingZeroes( const QString& src ) const
-{
-  QString delim( "." );
-
-  int idx = src.findRev( delim );
-  if ( idx == -1 )
-    return src;
-
-  QString iPart = src.left( idx );
-  QString fPart = src.mid( idx + 1 );
-
-  while ( !fPart.isEmpty() && fPart.at( fPart.length() - 1 ) == '0' )
-    fPart.remove( fPart.length() - 1, 1 );
-
-  QString res = iPart;
-  if ( !fPart.isEmpty() )
-    res += delim + fPart;
-
-  return res;
-}
diff --git a/src/Qtx/QtxDblSpinBox.h b/src/Qtx/QtxDblSpinBox.h
deleted file mode 100755 (executable)
index b715fb3..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxDblSpinBox.h
-// Author:    Sergey TELKOV
-
-#ifndef QTXDBLSPINBOX_H
-#define QTXDBLSPINBOX_H
-
-#include "Qtx.h"
-
-#include <qspinbox.h>
-
-/*!
-  \class  QtxDblSpinBox
-  Spin box for real numbers.
-*/
-class QTX_EXPORT QtxDblSpinBox : public QSpinBox
-{
-  Q_OBJECT
-
-  class Validator;
-
-public:
-       typedef enum QSpinBox::ButtonSymbols ButtonSymbols;
-
-public:
-  QtxDblSpinBox( QWidget* = 0, const char* = 0 );
-  QtxDblSpinBox( double, double, double = 1, QWidget* = 0, const char* = 0 );
-  virtual ~QtxDblSpinBox();
-
-  double                  minValue() const;
-  double                  maxValue() const;
-  void               setMinValue( int );
-  void               setMaxValue( int );
-  void               setMinValue( double );
-  void               setMaxValue( double );
-  void              setRange( int, int );
-  virtual void       setRange( double, double );
-
-  double                  lineStep() const;
-  void               setLineStep( int );
-  virtual void       setLineStep( double );
-
-  double             value() const;
-
-  int                precision() const;
-  virtual void       setPrecision( const int );
-  
-  bool               isCleared() const;
-  virtual void       setCleared( const bool );
-  
-  virtual bool       eventFilter( QObject*, QEvent* );
-    
-signals:
-  void               valueChanged( double );
-  void                    valueChanged( const QString& );
-    
-public slots:
-  virtual void      stepUp();
-  virtual void      stepDown();
-  virtual void       selectAll();
-  virtual void      setValue( int );
-  virtual void      setValue( double );
-  
-protected slots:
-  virtual void       onTextChanged( const QString& );
-
-protected:
-  virtual void      updateDisplay();
-  virtual void      interpretText();
-  
-  virtual void      valueChange();
-  virtual void      rangeChange();
-  
-  QString            currentValueText();
-  virtual QString    mapValueToText( int );
-  virtual QString    mapValueToText( double );
-  virtual double     mapTextToDoubleValue( bool* );
-  
-  virtual void       leaveEvent( QEvent* );
-  virtual void       wheelEvent( QWheelEvent* );
-  
-  double             bound( double );
-
-  QString            removeTrailingZeroes( const QString& ) const;
-
-private:
-  double             myMin;
-  double             myMax;
-  double             myStep;
-  double             myValue;
-  bool               myCleared;
-  bool               myBlocked;
-  int                myPrecision;
-};
-
-#endif
diff --git a/src/Qtx/QtxDblValidator.cxx b/src/Qtx/QtxDblValidator.cxx
deleted file mode 100644 (file)
index b7dd3e9..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxDblValidator.cxx
-// Author:    Alexandre SOLOVYOV
-
-#include "QtxDblValidator.h"
-
-/*!
-  Constructor
-  \param bot - minimal possible value
-  \param top - maximal possible value
-  \param dec - number of digits
-  \param o - parent object
-  \param name - name of validator
-*/
-QtxDblValidator::QtxDblValidator( const double bot, const double top, const int dec,
-                                 QObject* o, const char* name )
-: QDoubleValidator( bot, top, dec, o, name )
-{
-}
-
-/*!
-  Destructor
-*/
-QtxDblValidator::~QtxDblValidator()
-{
-}
-
-/*!
-  Corrects string: if it represent double value less then bottom, it becomes equal to bottom,
-  if it is more then top, it becomes equal to top, if it isn't number is becomes '0'
-*/
-void QtxDblValidator::fixup( QString& str ) const
-{
-  bool ok = false;
-  double d = str.toDouble( &ok );
-  if( ok )
-  {
-    if( d<bottom() )
-      str = QString::number( bottom() );
-    else if( d>top() )
-      str = QString::number( top() );
-  }
-  else
-    str = "0";
-}
diff --git a/src/Qtx/QtxDblValidator.h b/src/Qtx/QtxDblValidator.h
deleted file mode 100644 (file)
index a5b389f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxDblValidator.h
-// Author:    Alexandre SOLOVYOV
-
-#ifndef QTX_DOUBLE_VALIDATOR
-#define QTX_DOUBLE_VALIDATOR
-
-#include "Qtx.h"
-
-#include <qvalidator.h>
-
-class QTX_EXPORT QtxDblValidator : public QDoubleValidator
-{
-  Q_OBJECT
-
-public:
-  QtxDblValidator( const double, const double, const int,
-                  QObject*, const char* = 0 );
-  ~QtxDblValidator();
-
-  virtual void fixup( QString& ) const;
-};
-
-#endif
index c52cb85fe5c4fce9f1aee386ca3c129c2ae86766..3200b78516ab5213c68eec21dadd1ab95cdade92 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxDialog.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxDialog.h"
 
-#include "QtxGroupBox.h"
-
-#include <qlabel.h>
-#include <qframe.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qapplication.h>
+#include <QLabel>
+#include <QLayout>
+#include <QKeyEvent>
+#include <QFrame>
+#include <QTabWidget>
+#include <QPushButton>
+#include <QApplication>
 
 /*!
-       Class: QtxDialog::Area
-       Level: Internal
+  \class QtxDialog::Area
+  \internal
+  \brief Area containing dialog box buttons.
 */
+
 class QtxDialog::Area : public QFrame
 {
 public:
-       Area( Orientation, QtxDialog*, QWidget* = 0 );
-       virtual ~Area();
+  Area( Qt::Orientation, QtxDialog*, QWidget* = 0 );
+  virtual ~Area();
 
-       bool                     isBorderEnabled() const;
-       void                     setBorderEnabled( const bool );
+  bool                     isBorderEnabled() const;
+  void                     setBorderEnabled( const bool );
 
-       void                     setBorderWidget( QLabel* );
+  void                     setBorderWidget( QLabel* );
 
-       void                     insertButton( QButton* );
-       void                     removeButton( QButton* );
-       bool                     contains( QButton* ) const;
+  void                     insertButton( QAbstractButton* );
+  void                     removeButton( QAbstractButton* );
+  bool                     contains( QAbstractButton* ) const;
 
-       int                      policy() const;
-       void                     setPolicy( const int );
+  int                      policy() const;
+  void                     setPolicy( const int );
 
-       void                     layoutButtons();
+  void                     layoutButtons();
 
-       const QPtrList<QButton>& buttons() const;
+  const QList<QAbstractButton*>& buttons() const;
 
 private:
-       void                     updateBorder();
+  void                     updateBorder();
 
 private:
-       QtxDialog*               myDlg;
-       QLabel*                  myLine;
-       bool                     myBorder;
-       int                      myPolicy;
-       QPtrList<QButton>        myButtons;
-       Orientation              myOrientation;
+  QtxDialog*               myDlg;          //!< parent dialog box
+  QLabel*                  myLine;         //!< border widget 
+  bool                     myBorder;       //!< "has border" flag
+  int                      myPolicy;       //!< button layout type (QtxDialog::PlacePolicy)
+  QList<QAbstractButton*>  myButtons;      //!< buttons list
+  Qt::Orientation          myOrientation;  //!< buttons orientation (Qt::Orientation)
 };
 
 /*!
-  Contructor
+  \brief Constructor.
+  \param o buttons orientation
+  \param dlg dialog box owning this area
+  \param parent parent widget
 */
-QtxDialog::Area::Area( Orientation o, QtxDialog* dlg, QWidget* parent )
+QtxDialog::Area::Area( Qt::Orientation o, QtxDialog* dlg, QWidget* parent )
 : QFrame( parent ),
-myDlg( dlg ),
-myLine( 0 ),
-myBorder( false ),
-myPolicy( Position ),
-myOrientation( o )
+  myDlg( dlg ),
+  myLine( 0 ),
+  myBorder( false ),
+  myPolicy( Position ),
+  myOrientation( o )
 {
-       if ( myOrientation == Qt::Horizontal )
-               setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) );
-       else
-               setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred ) );
+  if ( myOrientation == Qt::Horizontal )
+    setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) );
+  else
+    setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred ) );
 
-       hide();
+  hide();
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxDialog::Area::~Area()
 {
 }
 
 /*!
-  Inserts button to area
-  \param b - button
+  \brief Insert button to the area.
+  \param b button to be added
+  \sa removeButton()
 */
-void QtxDialog::Area::insertButton( QButton* b )
+void QtxDialog::Area::insertButton( QAbstractButton* b )
 {
-       if ( !b || myButtons.findRef( b ) != -1 )
-               return;
+  if ( !b || myButtons.contains( b ) )
+    return;
 
-       QWidget* parent = b->parentWidget();
-       if ( parent != this )
-               b->reparent( this, 0, QPoint( 0, 0 ), b->isVisibleTo( parent ) );
+  QWidget* parent = b->parentWidget();
+  if ( parent != this )
+    b->setParent( this );
 
-       myButtons.append( b );
+  myButtons.append( b );
 
-       if ( myDlg )
-               myDlg->adjustButtons();
-       layoutButtons();
+  if ( myDlg )
+    myDlg->adjustButtons();
+  layoutButtons();
 
-       show();
+  show();
 
-       updateBorder();
+  updateBorder();
 }
 
 /*!
-  Removes button from area
-  \param b - button
+  \brief Remove button from the area.
+  \param b button to be removed
+  \sa insertButton()
 */
-void QtxDialog::Area::removeButton( QButton* b )
+void QtxDialog::Area::removeButton( QAbstractButton* b )
 {
-       if ( !b )
-               return;
+  if ( !b )
+    return;
 
-       myButtons.removeRef( b );
+  myButtons.removeAll( b );
 
-       if ( myButtons.isEmpty() )
-               hide();
+  if ( myButtons.isEmpty() )
+    hide();
 
-       updateBorder();
+  updateBorder();
 
-       if ( myDlg )
-               myDlg->adjustButtons();
+  if ( myDlg )
+    myDlg->adjustButtons();
 
-       layoutButtons();
+  layoutButtons();
 }
 
 /*!
-  \return true if area contains button
-  \param b - button
+  \brief Check if area owns the button specified.
+  \param b button to be checked
+  \return \c true if area contains button
 */
-bool QtxDialog::Area::contains( QButton* b ) const
+bool QtxDialog::Area::contains( QAbstractButton* b ) const
 {
-       return myButtons.containsRef( b );
+  return myButtons.contains( b );
 }
 
 /*!
-  \return policy of button layouting.
+  \brief Get buttons layout policy.
+  \return policy of button layouting (Qtx::PlacePolicy)
+  \sa setPolicy()
 */
 int QtxDialog::Area::policy() const
 {
-       return myPolicy;
+  return myPolicy;
 }
 
 /*!
-  Changes policy of button layouting.
-  \param p new policy
+  \brief Set buttons layout policy.
+  \param p new policy
 */
 void QtxDialog::Area::setPolicy( const int p )
 {
-       if ( myPolicy == p )
-               return;
+  if ( myPolicy == p )
+    return;
 
-       myPolicy = p;
-       layoutButtons();
+  myPolicy = p;
+  layoutButtons();
 }
 
 /*!
-  \return true if border enabled
+  \brief Check of the border is enabled.
+  \return \c true if border is enabled
+  \sa setBorderEnabled(), setBorderWidget()
 */
 bool QtxDialog::Area::isBorderEnabled() const
 {
-       return myLine && myBorder;
+  return myLine && myBorder;
 }
 
 /*!
-  Enables/disable separator between main frame and button frame
-  \param on new state
+  \brief Enable/disable border (separator between main frame and button frame)
+  \param on new state
 */
 void QtxDialog::Area::setBorderEnabled( const bool on )
 {
-       if ( !myLine || myBorder == on )
-               return;
+  if ( !myLine || myBorder == on )
+    return;
 
-       myBorder = on;
-       updateBorder();
+  myBorder = on;
+  updateBorder();
 }
 
 /*!
-  Sets label as separator between main frame and button frame
-  \param line - new separator
+  \brief Set border widget (separator between main frame and button frame).
+  \param line new separator widget
 */
 void QtxDialog::Area::setBorderWidget( QLabel* line )
 {
-       if ( myLine == line )
-               return;
+  if ( myLine == line )
+    return;
 
-       delete myLine;
-       myLine = line;
-       updateBorder();
+  delete myLine;
+  myLine = line;
+  updateBorder();
 }
 
 /*!
-  \return const reference to list of buttons
+  \brief Get all area buttons.
+  \return const reference to the list of buttons
 */
-const QPtrList<QButton>& QtxDialog::Area::buttons() const
+const QList<QAbstractButton*>& QtxDialog::Area::buttons() const
 {
-       return myButtons;
+  return myButtons;
 }
 
 /*!
-  Updates visibility of border
+  \brief Update border visibility.
 */
 void QtxDialog::Area::updateBorder()
 {
-       if ( !myLine )
-               return;
+  if ( !myLine )
+    return;
 
-       bool isVis = isVisibleTo( parentWidget() );
-#if QT_VER >= 3    
-       if ( isVis )
-#else
-       if ( isVis && myBorder )
-#endif
-               myLine->show();
-       else
-               myLine->hide();
+  bool isVis = isVisibleTo( parentWidget() );
+  myLine->setVisible( isVis );
 
-       myLine->setLineWidth( myBorder ? 1 : 0 );
+  myLine->setLineWidth( myBorder ? 1 : 0 );
 }
 
 /*!
-  Installs buttons into layout
+  \brief Layout buttons in the area.
 */
 void QtxDialog::Area::layoutButtons()
 {
-       int aPolicy = policy();
-
-       QMap<QButton*, int> buttonId;
-       for ( QPtrListIterator<QButton> it1( myButtons ); it1.current(); ++it1 )
-               buttonId.insert( it1.current(), 0 );
-
-       QPtrList<QButton> src;
-       for ( ButtonMap::Iterator mit = myDlg->myButton.begin();
-                 mit != myDlg->myButton.end(); ++mit )
-       {
-               if ( buttonId.contains( mit.data() ) )
-               {
-                       buttonId[mit.data()] = mit.key();
-                       if ( mit.key() >= 0 )
-                               src.append( mit.data() );
-               }
-       }
-
-       for ( QPtrListIterator<QButton> it2( myButtons ); it2.current(); ++it2 )
-               if ( buttonId[it2.current()] < 0 )
-                       src.append( it2.current() );
-
-       QPtrList<QButton> left, right, center, other;
-       for ( QPtrListIterator<QButton> it( src ); it.current(); ++it )
-       {
-               if ( !it.current()->isVisibleTo( this ) )
-                       continue;
-
-               int aPosition = myDlg->buttonPosition( it.current() );
-               if ( aPosition == -1 )
-                       continue;
-
-               if ( aPolicy != QtxDialog::Position )
-                       other.append( it.current() );
-               else if ( aPosition == QtxDialog::Left )
-                       left.append( it.current() );
-               else if ( aPosition == QtxDialog::Right )
-                       right.append( it.current() );
-               else if ( aPosition == QtxDialog::Center )
-                       center.append( it.current() );
-       }
+  int aPolicy = policy();
+
+  QMap<QAbstractButton*, int> buttonId;
+  for ( QList<QAbstractButton*>::iterator it1 = myButtons.begin(); it1 != myButtons.end(); ++it1 )
+    buttonId.insert( *it1, 0 );
+
+  QList<QAbstractButton*> src;
+  for ( ButtonMap::Iterator mit = myDlg->myButton.begin(); mit != myDlg->myButton.end(); ++mit )
+  {
+    if ( buttonId.contains( mit.value() ) )
+    {
+      buttonId[mit.value()] = mit.key();
+      if ( mit.key() >= 0 )
+       src.append( mit.value() );
+    }
+  }
+
+  for ( QList<QAbstractButton*>::iterator it2 = myButtons.begin(); it2 != myButtons.end(); ++it2 )
+  {
+    if ( buttonId[*it2] < 0 )
+      src.append( *it2 );
+  }
+
+  QList<QAbstractButton*> left, right, center, other;
+  for ( QList<QAbstractButton*>::iterator it = src.begin(); it != src.end(); ++it )
+  {
+    if ( !(*it)->isVisibleTo( this ) )
+      continue;
+
+    int aPosition = myDlg->buttonPosition( *it );
+    if ( aPosition == -1 )
+      continue;
+
+    if ( aPolicy != QtxDialog::Position )
+      other.append( *it );
+    else if ( aPosition == QtxDialog::Left )
+      left.append( *it );
+    else if ( aPosition == QtxDialog::Right )
+      right.append( *it );
+    else if ( aPosition == QtxDialog::Center )
+      center.append( *it );
+  }
 
   delete layout();
 
-       QBoxLayout* buttonLayout = 0;
-       if ( myOrientation == Qt::Vertical )
-               buttonLayout = new QVBoxLayout( this, 0, 5 );
-       else
-               buttonLayout = new QHBoxLayout( this, 0, 5 );
-
-       if ( !buttonLayout )
-               return;
-
-       if ( aPolicy == QtxDialog::Position )
-       {
-               for ( QPtrListIterator<QButton> lit( left ); lit.current(); ++lit )
-                       buttonLayout->addWidget( lit.current() );
-               buttonLayout->addStretch( 1 );
-               for ( QPtrListIterator<QButton> cit( center ); cit.current(); ++cit )
-                       buttonLayout->addWidget( cit.current() );
-               buttonLayout->addStretch( 1 );
-               for ( QPtrListIterator<QButton> rit( right ); rit.current(); ++rit )
-                       buttonLayout->addWidget( rit.current() );
-       }
-       else
-       {
-               for ( QPtrListIterator<QButton> oit( other ); oit.current(); ++oit )
-               {
-                       buttonLayout->addWidget( oit.current() );
-                       if ( aPolicy == QtxDialog::Uniform && !oit.atLast() )
-                               buttonLayout->addStretch( 1 );
-               }
-       }
+  QBoxLayout* buttonLayout = 0;
+  if ( myOrientation == Qt::Vertical )
+    buttonLayout = new QVBoxLayout( this );
+  else
+    buttonLayout = new QHBoxLayout( this );
+
+  if ( !buttonLayout )
+    return;
+
+  buttonLayout->setMargin( 0 );
+  buttonLayout->setSpacing( 5 );
+
+  if ( aPolicy == QtxDialog::Position )
+  {
+    for ( QList<QAbstractButton*>::iterator lit = left.begin(); lit != left.end(); ++lit )
+      buttonLayout->addWidget( *lit );
+    buttonLayout->addStretch( 1 );
+    for ( QList<QAbstractButton*>::iterator cit = center.begin(); cit != center.end(); ++cit )
+      buttonLayout->addWidget( *cit );
+    buttonLayout->addStretch( 1 );
+    for ( QList<QAbstractButton*>::iterator rit = right.begin(); rit != right.end(); ++rit )
+      buttonLayout->addWidget( *rit );
+  }
+  else
+  {
+    for ( int i = 0; i < (int)other.count(); i++ )
+    {
+      buttonLayout->addWidget( other[i] );
+      if ( aPolicy == QtxDialog::Uniform && i < (int)other.count() - 1  )
+       buttonLayout->addStretch( 1 );
+    }
+  }
 
   QWidgetList wids;
   if ( layout() )
   {
-    for ( QLayoutIterator it = layout()->iterator(); it.current(); ++it )
+    for ( int i = 0; i < layout()->count(); i++ )
     {
-      if ( !it.current()->widget() )
+      if ( !layout()->itemAt( i ) || layout()->itemAt( i )->widget() )
         continue;
 
-      if ( QApplication::reverseLayout() )
-        wids.prepend( it.current()->widget() );
+      if ( QApplication::layoutDirection() == Qt::RightToLeft )
+        wids.prepend( layout()->itemAt( i )->widget() );
       else
-        wids.append( it.current()->widget() );
+        wids.append( layout()->itemAt( i )->widget() );
     }
   }
   Qtx::setTabOrder( wids );
@@ -332,40 +345,43 @@ void QtxDialog::Area::layoutButtons()
 
 /*!
   \class QtxDialog::Border
-
-  Special label used as separator between main frame and button frame
+  \internal
+  \brief Special label used as border widget (separator
+         between main frame and button frame).
 */
+
 class QtxDialog::Border : public QLabel
 {
 public:
-       Border( QWidget* = 0 );
-       virtual ~Border();
+  Border( QWidget* = 0 );
+  virtual ~Border();
 
-       virtual void setLineWidth( int );
+  virtual void setLineWidth( int );
 
-       virtual QSize sizeHint() const;
-       virtual QSize minimumSizeHint() const;
+  virtual QSize sizeHint() const;
+  virtual QSize minimumSizeHint() const;
 };
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param parent parent widget
 */
 QtxDialog::Border::Border( QWidget* parent )
 : QLabel( parent )
 {
-    setAlignment( Qt::AlignCenter );
+  setAlignment( Qt::AlignCenter );
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxDialog::Border::~Border()
 {
 }
 
 /*!
-  Set line width of separator
-  \param lw new line width
+  \brief Set separator line width.
+  \param lw new line width
 */
 void QtxDialog::Border::setLineWidth( int lw )
 {
@@ -378,511 +394,528 @@ void QtxDialog::Border::setLineWidth( int lw )
 }
 
 /*!
-  \return the recommended size for the widget
+  \brief Get recommended size for the widget.
+  \return recommended size for the widget
 */
 QSize QtxDialog::Border::sizeHint() const
 {
   QSize sz( 5, 5 );
 
-#if QT_VER >= 3    
   if ( lineWidth() > 0 )
-       {
+  {
     if ( frameShape() == VLine )
       sz += QSize( 5 + lineWidth(), 0 );
-               else if ( frameShape() == HLine )
+    else if ( frameShape() == HLine )
       sz += QSize( 0, 5 + lineWidth() );
-       }
-#endif
+  }
 
   return sz;
 }
 
 /*!
-  \return the recommended minimum size for the widget
+  \brief Get recommended minimum size for the widget.
+  \return recommended minimum size for the widget
 */
 QSize QtxDialog::Border::minimumSizeHint() const
 {
-       return sizeHint();
+  return sizeHint();
 }
 
 /*!
-  Constructor
+  \class QtxDialog
+  \brief Generic dialog box class.
+*/
+
+/*!
+  \brief Constructor.
+
   Construct a dialog with specified parent and name.
-  \param modal define modal status of dialog (default non modal dialog created).
-  \param allowResize - if it is true then dialog can be resize by user (default non resizable dialog created).
-  \param Button flags specified control buttons for dialog (default buttons is OK, Cancel and Help).
-  \param Widget flags used as in any widget.
-*/
-QtxDialog::QtxDialog( QWidget* parent, const char* name,
-                                         bool modal, bool allowResize, const int f, WFlags wf )
-: QDialog( parent, name, modal,
-           wf | WStyle_Customize | WStyle_Title | WStyle_SysMenu |
+  By default non-modal, non-resizable with the OK, Cancel and Help buttons
+  dialog box is created.
+
+  \param parent parent widget
+  \param modal if \c true dialog box is modal
+  \param allowResize if \c true then dialog can be resized by user
+  \param f specified control buttons for dialog box (QtxDialog::ButtonFlags)
+  \param wf dialog box flags (Qt::WindowFlags)
+*/
+QtxDialog::QtxDialog( QWidget* parent, bool modal, bool allowResize, const int f, Qt::WindowFlags wf )
+: QDialog( parent, (Qt::WindowFlags)( wf | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::Dialog |
 #ifdef WIN32
-           ( allowResize ? WStyle_NormalBorder : WStyle_NoBorderEx ) |
-#else
-           WStyle_NormalBorder |
+           ( allowResize ? 0 : Qt::FramelessWindowHint ) |
 #endif
-           ( allowResize ? WStyle_Maximize : 0 ) ),
-mySender( 0 ),
-myAlignment( 0 ),
-myInited( false ),
-myDialogFlags( Accept | SetFocus )
-{
-       QVBoxLayout* base = new QVBoxLayout( this, 5, 0 );
-       QtxGroupBox* main = new QtxGroupBox( 1, Qt::Horizontal, "", this );
-       main->setFrameStyle( QFrame::NoFrame );
-       main->setInsideMargin( 0 );
-       main->setInsideSpacing( 0 );
-       base->addWidget( main );
-
-       Area* topArea = new Area( Qt::Horizontal, this, main );
-       QLabel* topLine = new Border( main );
-       QtxGroupBox* midGroup = new QtxGroupBox( 1, Qt::Vertical, "", main );
-       QLabel* botLine = new Border( main );
-       Area* botArea = new Area( Qt::Horizontal, this, main );
-
-       midGroup->setFrameStyle( QFrame::NoFrame );
-       midGroup->setInsideMargin( 0 );
-       midGroup->setInsideSpacing( 0 );
-
-       Area* leftArea = new Area( Qt::Vertical, this, midGroup );
-       QLabel* leftLine = new Border( midGroup );
-       myMainFrame = new QFrame( midGroup );
-       QLabel* rightLine = new Border( midGroup );
-       Area* rightArea = new Area( Qt::Vertical, this, midGroup );
-
-       myMainFrame->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,
-                                                                                               QSizePolicy::Expanding ) );
-
-       topLine->setFrameStyle( QFrame::Sunken | QFrame::HLine );
-       botLine->setFrameStyle( QFrame::Sunken | QFrame::HLine );
-       leftLine->setFrameStyle( QFrame::Sunken | QFrame::VLine );
-       rightLine->setFrameStyle( QFrame::Sunken | QFrame::VLine );
-       topArea->setBorderWidget( topLine );
-       botArea->setBorderWidget( botLine );
-       leftArea->setBorderWidget( leftLine );
-       rightArea->setBorderWidget( rightLine );
-
-       myArea.insert( TopArea,    topArea );
-       myArea.insert( BottomArea, botArea );
-       myArea.insert( LeftArea,   leftArea );
-       myArea.insert( RightArea,  rightArea );
-
-       for ( AreaMap::Iterator itr = myArea.begin(); itr != myArea.end(); ++ itr )
-               itr.data()->setBorderEnabled( false );
-
-       myButton.insert( OK,     new QPushButton( tr( "&OK" ),     this ) );
-       myButton.insert( Cancel, new QPushButton( tr( "&Cancel" ), this ) );
-       myButton.insert( Close,  new QPushButton( tr( "C&lose" ),  this ) );
-       myButton.insert( Help,   new QPushButton( tr( "&Help" ),   this ) );
-       myButton.insert( Apply,  new QPushButton( tr( "&Apply" ),  this ) );
-       myButton.insert( Yes,    new QPushButton( tr( "&Yes" ),    this ) );
-       myButton.insert( No,     new QPushButton( tr( "&No" ),     this ) );
-
-       for ( ButtonMap::Iterator it = myButton.begin(); it != myButton.end(); ++it )
-       {
-               ((QPushButton*)it.data())->setAutoDefault( false );
-#if QT_VER >= 3
-               connect( it.data(), SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+           ( ( allowResize 
+#ifdef WIN32 
+              // in qwidget_win.cpp flag WStyle_ContextHelp will be unset in WStyle_MinMax in switched ON
+              && !( wf & Qt::WindowContextHelpButtonHint )
 #endif
-       }
+              ) ? Qt::WindowMaximizeButtonHint : 0 ) ) ),
+  myInited( false ),
+  mySender( 0 ),
+  myAlignment( 0 ),
+  myDialogFlags( Accept | SetFocus )
+{
+  setModal( modal );
+
+  QVBoxLayout* base = new QVBoxLayout( this );
+  base->setMargin( 5 );
+  base->setSpacing( 0 );
+
+  QWidget* main = new QWidget( this );
+  base->addWidget( main );
+
+  QVBoxLayout* lMain = new QVBoxLayout( main );
+  lMain->setMargin( 0 );
+  lMain->setSpacing( 0 );
+
+  Area* topArea = new Area( Qt::Horizontal, this, main );
+  QLabel* topLine = new Border( main );
+  lMain->addWidget( topArea );
+  lMain->addWidget( topLine );
+
+  QWidget* midGroup = new QWidget( main );
+  lMain->addWidget( midGroup );
+
+  QVBoxLayout* midLyout = new QVBoxLayout( midGroup );
+  midLyout->setMargin( 0 );
+  midLyout->setSpacing( 0 );
+
+  QLabel* botLine = new Border( main );
+  Area* botArea = new Area( Qt::Horizontal, this, main );
+  lMain->addWidget( botLine );
+  lMain->addWidget( botArea );
+
+  Area* leftArea = new Area( Qt::Vertical, this, midGroup );
+  QLabel* leftLine = new Border( midGroup );
+  midLyout->addWidget( leftArea );
+  midLyout->addWidget( leftLine );
+
+  myMainFrame = new QFrame( midGroup );
+  midLyout->addWidget( myMainFrame );
+
+  QLabel* rightLine = new Border( midGroup );
+  Area* rightArea = new Area( Qt::Vertical, this, midGroup );
+  midLyout->addWidget( rightLine );
+  midLyout->addWidget( rightArea );
+
+  myMainFrame->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+
+  topLine->setFrameStyle( QFrame::Sunken | QFrame::HLine );
+  botLine->setFrameStyle( QFrame::Sunken | QFrame::HLine );
+  leftLine->setFrameStyle( QFrame::Sunken | QFrame::VLine );
+  rightLine->setFrameStyle( QFrame::Sunken | QFrame::VLine );
+
+  topArea->setBorderWidget( topLine );
+  botArea->setBorderWidget( botLine );
+  leftArea->setBorderWidget( leftLine );
+  rightArea->setBorderWidget( rightLine );
+
+  myArea.insert( TopArea,    topArea );
+  myArea.insert( BottomArea, botArea );
+  myArea.insert( LeftArea,   leftArea );
+  myArea.insert( RightArea,  rightArea );
+
+  for ( AreaMap::Iterator itr = myArea.begin(); itr != myArea.end(); ++ itr )
+    itr.value()->setBorderEnabled( false );
+
+  myButton.insert( OK,     new QPushButton( tr( "&OK" ),     this ) );
+  myButton.insert( Cancel, new QPushButton( tr( "&Cancel" ), this ) );
+  myButton.insert( Close,  new QPushButton( tr( "C&lose" ),  this ) );
+  myButton.insert( Help,   new QPushButton( tr( "&Help" ),   this ) );
+  myButton.insert( Apply,  new QPushButton( tr( "&Apply" ),  this ) );
+  myButton.insert( Yes,    new QPushButton( tr( "&Yes" ),    this ) );
+  myButton.insert( No,     new QPushButton( tr( "&No" ),     this ) );
+
+  for ( ButtonMap::Iterator it = myButton.begin(); it != myButton.end(); ++it )
+  {
+    ((QPushButton*)it.value())->setAutoDefault( false );
+    connect( it.value(), SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+  }
+
+  setButtonPosition( Left,   OK | Cancel | Apply );
+  setButtonPosition( Center, Yes | No | Close );
+  setButtonPosition( Right,  Help );
+  setButtonPlace( BottomArea, All );
 
-       setButtonPosition( Left,   OK | Cancel | Apply );
-       setButtonPosition( Center, Yes | No | Close );
-       setButtonPosition( Right,  Help );
-       setButtonPlace( BottomArea, All );
+  connect( myButton[Apply],  SIGNAL( clicked() ), this, SIGNAL( dlgApply() ) );
+  connect( myButton[Help],   SIGNAL( clicked() ), this, SIGNAL( dlgHelp() ) );
 
-       connect( myButton[Apply],  SIGNAL( clicked() ), this, SIGNAL( dlgApply() ) );
-       connect( myButton[Help],   SIGNAL( clicked() ), this, SIGNAL( dlgHelp() ) );
+  connect( myButton[OK],     SIGNAL( clicked() ), this, SLOT( onAccept() ) );
+  connect( myButton[Cancel], SIGNAL( clicked() ), this, SLOT( onReject() ) );
+  connect( myButton[Yes],    SIGNAL( clicked() ), this, SLOT( onAccept() ) );
+  connect( myButton[No],     SIGNAL( clicked() ), this, SLOT( onReject() ) );
+  connect( myButton[Close],  SIGNAL( clicked() ), this, SLOT( onReject() ) );
 
-       connect( myButton[OK],     SIGNAL( clicked() ), this, SLOT( onAccept() ) );
-       connect( myButton[Cancel], SIGNAL( clicked() ), this, SLOT( onReject() ) );
-       connect( myButton[Yes],    SIGNAL( clicked() ), this, SLOT( onAccept() ) );
-       connect( myButton[No],     SIGNAL( clicked() ), this, SLOT( onReject() ) );
-       connect( myButton[Close],  SIGNAL( clicked() ), this, SLOT( onReject() ) );
+  QIcon icon;
+  QWidget* p = parentWidget();
+  while( p && p->parentWidget() )
+    p = p->parentWidget();
 
-       QPixmap icon;
-       if ( qApp && qApp->mainWidget() && qApp->mainWidget()->icon() )
-               setIcon( *qApp->mainWidget()->icon() );
+  if ( p )
+    setWindowIcon( p->windowIcon() );
 
-       myButtonFlags = f;
+  myButtonFlags = f;
 
 #ifndef WIN32
-       if ( !allowResize )
-               setMaximumSize( minimumSize() );
+  if ( !allowResize )
+    setMaximumSize( minimumSize() );
 #endif
 
-       update();
+  update();
 }
 
 /*!
-       Name: ~QtxDialog [public]
-       Desc: Destructor
+  \brief Destructor.
 */
-
 QtxDialog::~QtxDialog()
 {
 }
 
 /*!
-       Name: setButtonFlags [public]
-       Desc: Allow to set specified control button(s) into dialog.
+  \brief Add specified control button(s) to the dialog box.
+  \param f ORed buttons flags (Qtx::ButtonFlags)
+  \sa clearButtonFlags(), testButtonFlags()
 */
-
 void QtxDialog::setButtonFlags( const int f )
 {
-       int old = myButtonFlags;
-       myButtonFlags = myButtonFlags | f;
-       if ( old != myButtonFlags )
-               update();
+  int old = myButtonFlags;
+  myButtonFlags = myButtonFlags | f;
+  if ( old != myButtonFlags )
+    update();
 }
 
 /*!
-       Name: clearButtonFlags [public]
-       Desc: Allow to unset specified control button(s) from dialog.
+  \brief Remove specified control button(s) from the dialog box.
+  \param f ORed buttons flags (Qtx::ButtonFlags)
+  \sa setButtonFlags(), testButtonFlags()
 */
-
 void QtxDialog::clearButtonFlags( const int f )
 {
-       int old = myButtonFlags;
-       myButtonFlags = myButtonFlags & ~f;
-       if ( old != myButtonFlags )
-               update();
+  int old = myButtonFlags;
+  myButtonFlags = myButtonFlags & ~f;
+  if ( old != myButtonFlags )
+    update();
 }
 
 /*!
-       Name: testButtonFlags [public]
-       Desc: Return true if specified control button is used in dialog.
+  \brief Test specified buttons.
+  \return \c true if specified control buttons are used in the dialog box
+  \sa setButtonFlags(), clearButtonFlags()
 */
-
 bool QtxDialog::testButtonFlags( const int f ) const
 {
-    return ( myButtonFlags & f ) == f;
+  return ( myButtonFlags & f ) == f;
 }
 
 /*!
-       Name: setDialogFlags [public]
-       Desc: Allow to set the dialog flags.
-
-                 Following flags can be used:
-                       Accept    - Allow to control dialog accepting. See also acceptData().
-                       Reject    - Allow to control dialog rejecting. See also rejectData().
-                       AlignOnce - Allow to align dialog only when it first time shown.
-                       SetFocus  - Allow to set focus on dialog when it shown. User can use
-                  setFocusProxy() and specify own initial focus widget.
+  \brief Set specified dialog box flags.
+  \param f dialog box flags (QtxDialog::DialogFlags)
+  \sa clearDialogFlags(), testDialogFlags(), acceptData(), rejectData()
 */
-
 void QtxDialog::setDialogFlags( const int f )
 {
-       myDialogFlags = myDialogFlags | f;
+  myDialogFlags = myDialogFlags | f;
 }
 
 /*!
-       Name: clearDialogFlags [public]
-       Desc: Allow to clear the dialog flags. See also setDialogFlags().
+  \brief Clear specified the dialog flags.
+  \param f dialog box flags (QtxDialog::DialogFlags)
+  \sa setDialogFlags(), testDialogFlags()
 */
-
 void QtxDialog::clearDialogFlags( const int f )
 {
-       myDialogFlags = myDialogFlags & ~f;
+  myDialogFlags = myDialogFlags & ~f;
 }
 
 /*!
-       Name: testDialogFlags [public]
-       Desc: Returns true if specified dialog flag is setted (see setDialogFlags()).
+  \brief Test specified dialog flags.
+  \return \c true if specified dialog box falgs are set
+  \sa setDialogFlags(), clearDialogFlags()
 */
-
 bool QtxDialog::testDialogFlags( const int f ) const
 {
-    return ( myDialogFlags & f ) == f;
+  return ( myDialogFlags & f ) == f;
 }
 
 /*!
-       Name: mainFrame [public]
-       Desc: Returns main frame of dialog. Main frame should contains all
-          elements of dialog except control buttons.
-*/
+  \brief Get dialog box main frame widget.
+
+  Main frame is an internal widget which should contains all
+  elements of dialog box except control buttons.
 
+  \return main frame widget 
+*/
 QFrame* QtxDialog::mainFrame() const
 {
-    return myMainFrame;
+  return myMainFrame;
 }
 
 /*!
-       Name: buttonPosition [public]
-       Desc: Returns position of specified button.
+  \brief Get specified control button position
+  \param id control button ID (QtxDialog::ButtonFlags)
+  \return button's position (QtxDialog::ButtonPosition) or -1 if it is not set or invalid \a id is given
+  \sa setButtonPosition()
 */
-
 int QtxDialog::buttonPosition( const int id ) const
 {
-       int pos = -1;
-       if ( myPosition.contains( id ) )
-               pos = myPosition[id];
-       return pos;
+  int pos = -1;
+  if ( myPosition.contains( id ) )
+    pos = myPosition[id];
+  return pos;
 }
-
 /*!
-       Name: setButtonPosition [public]
-       Desc: Sets the position for specified button(s). Following positions
-                 may be used: Left, Right, Center, Top, Bottom.
+  \brief Set the specified control button(s) position.
+  \param id control button(s) ID (QtxDialog::ButtonFlags)
+  \param pos button(s) position (QtxDialog::ButtonPosition)
 */
-
 void QtxDialog::setButtonPosition( const int pos, const int id )
 {
-       ButtonMap map = buttons( id );
+  ButtonMap map = buttons( id );
 
-       QMap<QObject*, int> changed;
-       for ( ButtonMap::Iterator it = map.begin(); it != map.end(); ++it )
-       {
-               if ( myPosition[it.key()] == pos )
-                       continue;
+  QMap<QObject*, int> changed;
+  for ( ButtonMap::Iterator it = map.begin(); it != map.end(); ++it )
+  {
+    if ( myPosition[it.key()] == pos )
+      continue;
       
-               myPosition[it.key()] = pos;
-               if ( button( it.key() ) )
-                       changed.insert( button( it.key() )->parent(), 0 );
-    }
-
-       for ( AreaMap::Iterator itr = myArea.begin(); itr != myArea.end(); ++itr )
-               if ( changed.contains( itr.data() ) )
-                       itr.data()->layoutButtons();
+    myPosition[it.key()] = pos;
+    if ( button( it.key() ) )
+      changed.insert( button( it.key() )->parent(), 0 );
+  }
+  
+  for ( AreaMap::Iterator itr = myArea.begin(); itr != myArea.end(); ++itr )
+  {
+    if ( changed.contains( itr.value() ) )
+      itr.value()->layoutButtons();
+  }
 }
 
 /*!
-       Name: setPlacePosition [public]
-       Desc: Sets button position for all buttons in given place.
+  \brief Set button position for all buttons in specified \a area.
+  \param pos button(s) position (QtxDialog::ButtonPosition)
+  \param area buttons area (QtxDialog::ButtonArea)
+  \sa setButtonPosition()
 */
-
 void QtxDialog::setPlacePosition( const int pos, const int area )
 {
-       if ( !myArea.contains( area ) )
-               return;
+  if ( !myArea.contains( area ) )
+    return;
 
-       Area* anArea = myArea[area];
+  Area* anArea = myArea[area];
 
-       bool changed = false;
-       for ( ButtonMap::Iterator it = myButton.begin(); it != myButton.end(); ++it )
-       {
-               if ( !anArea->contains( it.data() ) )
-                       continue;
+  bool changed = false;
+  for ( ButtonMap::Iterator it = myButton.begin(); it != myButton.end(); ++it )
+  {
+    if ( !anArea->contains( it.value() ) )
+      continue;
 
-               changed = changed &&  myPosition[it.key()] != pos;
+    changed = changed &&  myPosition[it.key()] != pos;
 
-               myPosition[it.key()] = pos;
-    }
+    myPosition[it.key()] = pos;
+  }
 
-       if ( changed )
-               anArea->layoutButtons();
+  if ( changed )
+    anArea->layoutButtons();
 }
 
 /*!
-       Name: placePolicy [public]
-       Desc: Returns policy of button layouting for specified place.
-
-                 Following place may be used:
-                       TopArea    - Horizontal area in the top side of dialog.
-                       BottomArea - Horizontal area in the bottom side of dialog.
-                       LeftArea   - Vertical area in the left side of dialog.
-                       RightArea  - Vertical area in the right side of dialog.
-
-                 Following policy may be used:
-                   Position - Buttons placed according their position.
-                       Expand   - Buttons fills all available space.
-                       Uniform  - Buttons uniformly placed in area.
+  \brief Get buttons layouting policy for the specified \a area.
+  \param area buttons area (QtxDialog::ButtonArea)
+  \sa setPlacePolicy()
 */
-
 int QtxDialog::placePolicy( const int area ) const
 {
-       int res = -1;
-       if ( myArea.contains( area ) )
-               res = myArea[area]->policy();
-       return res;
+  int res = -1;
+  if ( myArea.contains( area ) )
+    res = myArea[area]->policy();
+  return res;
 }
 
 /*!
-       Name: setPlacePolicy [public]
-       Desc: Sets the policy of button layouting for specified place.
-                 See also placePolicy().
+  \brief set buttons layouting policy for the specified \a area.
+  \param policy buttons layouting policy (QtxDialog::PlacePolicy)
+  \param area buttons area (QtxDialog::ButtonArea)
+  \sa placePolicy()
 */
-
 void QtxDialog::setPlacePolicy( const int policy, const int area )
 {
-       if ( area < 0 )
-               for ( AreaMap::Iterator itr = myArea.begin(); itr != myArea.end(); ++itr )
-                       itr.data()->setPolicy( policy );
-       else if ( myArea.contains( area ) )
-               myArea[area]->setPolicy( policy );
+  if ( area < 0 )
+  {
+    for ( AreaMap::Iterator itr = myArea.begin(); itr != myArea.end(); ++itr )
+      itr.value()->setPolicy( policy );
+  }
+  else if ( myArea.contains( area ) )
+    myArea[area]->setPolicy( policy );
 }
 
 /*!
-       Name: setButtonPlace [public]
-       Desc: Move given button(s) into specified place.
+  \brief Move specified button(s) into specified area.
+  \param area buttons area (QtxDialog::ButtonArea)
+  \param id control button(s) ID (QtxDialog::ButtonFlags)
 */
-
-void QtxDialog::setButtonPlace( const int area, const int ids )
+void QtxDialog::setButtonPlace( const int area, const int id )
 {
-       if ( !myArea.contains( area ) )
-               return;
-
-       Area* anArea = myArea[area];
-
-       ButtonMap map = buttons( ids );
+  if ( !myArea.contains( area ) )
+    return;
 
-       QMap<Area*, int> areaMap;
-       for ( AreaMap::ConstIterator aIt = myArea.begin(); aIt != myArea.end(); ++aIt )
-               areaMap.insert( aIt.data(), 0 );
+  Area* anArea = myArea[area];
+  ButtonMap map = buttons( id );
+  QMap<Area*, int> areaMap;
+  for ( AreaMap::ConstIterator aIt = myArea.begin(); aIt != myArea.end(); ++aIt )
+    areaMap.insert( aIt.value(), 0 );
 
-       for ( ButtonMap::Iterator it = map.begin(); it != map.end(); ++it )
-       {
-               Area* old = (Area*)it.data()->parent();
-               if ( old == anArea )
-                       continue;
+  for ( ButtonMap::Iterator it = map.begin(); it != map.end(); ++it )
+  {
+    Area* old = (Area*)it.value()->parent();
+    if ( old == anArea )
+      continue;
 
-               if ( areaMap.contains( old ) )
-                       old->removeButton( it.data() );
-               anArea->insertButton( it.data() );
-    }
+    if ( areaMap.contains( old ) )
+      old->removeButton( it.value() );
+    anArea->insertButton( it.value() );
+  }
 }
 
 /*!
-       Name: isBorderEnabled [public]
-       Desc: Returns true if border is shown for specified button area.
+  \brief Check if border is enabled.
+  \param area buttons area (QtxDialog::ButtonArea)
+  \return \c true if border is enabled for specified button area.
+  \sa setBorderEnabled()
 */
-
 bool QtxDialog::isBorderEnabled( const int area ) const
 {
-       bool res = false;
-       if ( myArea.contains( area ) )
-               res  = myArea[area]->isBorderEnabled();
-       return res;
+  bool res = false;
+  if ( myArea.contains( area ) )
+    res  = myArea[area]->isBorderEnabled();
+  return res;
 }
 
 /*!
-       Name: setBorderEnabled [public]
-       Desc: Show/hide border for specified button area. Border are
-             line which separate main frame and control buttons.
-*/
+  \brief Show/hide border for the specified button area.
+
+  Border is a line which separate main frame and control buttons.
 
+  \param area buttons area (QtxDialog::ButtonArea)
+  \param on enable border flag
+  \sa isBorderEnabled()
+*/
 void QtxDialog::setBorderEnabled( const bool on, const int area )
 {
-       if ( !myArea.contains( area ) )
-               return;
+  if ( !myArea.contains( area ) )
+    return;
 
-       if ( myArea[area]->isBorderEnabled() == on )
-               return;
+  if ( myArea[area]->isBorderEnabled() == on )
+    return;
 
-       myArea[area]->setBorderEnabled( on );
+  myArea[area]->setBorderEnabled( on );
 
-       if ( isVisible() )
-       {
-               QApplication::sendPostedEvents();
-               adjustSize();
-       }
+  if ( isVisible() )
+  {
+    QApplication::sendPostedEvents();
+    adjustSize();
+  }
 }
 
 /*!
-       Name: isButtonEnabled [public]
-       Desc: Returns true if all specified button(s) is enabled.
+  \brief Get "enabled" status of the specified button(s).
+  \param id control button(s) ID (QtxDialog::ButtonFlags)
+  \return \c true if all specified buttons are enabled.
+  \sa setButtonEnabled()
 */
-
-bool QtxDialog::isButtonEnabled( const int f ) const
+bool QtxDialog::isButtonEnabled( const int id ) const
 {
-       ButtonMap map = buttons( f );
-       bool result = !map.isEmpty();
-       for ( ButtonMap::Iterator it = map.begin(); it != map.end(); ++it )
-               result = result && it.data()->isEnabled();
-       return result;
+  ButtonMap map = buttons( id );
+  bool result = !map.isEmpty();
+  for ( ButtonMap::Iterator it = map.begin(); it != map.end(); ++it )
+    result = result && it.value()->isEnabled();
+  return result;
 }
 
 /*!
-       Name: setButtonEnabled [public]
-       Desc: Enable/disable specified button(s).
+  \brief Enable/disable specified button(s).
+  \param on enable button(s) flag
+  \param id control button(s) ID (QtxDialog::ButtonFlags)
+  \sa isButtonEnabled()
 */
-
-void QtxDialog::setButtonEnabled( const bool on, const int ids )
+void QtxDialog::setButtonEnabled( const bool on, const int id )
 {
-       ButtonMap map = buttons( ids );
-       for ( ButtonMap::Iterator it = map.begin(); it != map.end(); ++it )
-               it.data()->setEnabled( on );
+  ButtonMap map = buttons( id );
+  for ( ButtonMap::Iterator it = map.begin(); it != map.end(); ++it )
+    it.value()->setEnabled( on );
 }
 
 /*!
-       Name: hasButtonFocus [public]
-       Desc: Retruns true if specified button has keyboard focus.
+  \brief Check if specified button has keyboard focus.
+  \param id control button ID (QtxDialog::ButtonFlags)
+  \return \c true if specified button has keyboard focus
+  \sa setButtonFocus()
 */
-
 bool QtxDialog::hasButtonFocus( const int id ) const
 {
-       bool res = false;
-       QButton* pb = button( id );
-       if ( pb )
-        res = pb->hasFocus();
-       return res;
+  bool res = false;
+  QAbstractButton* pb = button( id );
+  if ( pb )
+    res = pb->hasFocus();
+  return res;
 }
 
 /*!
-       Name: setButtonFocus [public]
-       Desc: Sets the keyboard focus on specified button.
+  \brief Sets the keyboard focus to the specified button.
+  \param id control button ID (QtxDialog::ButtonFlags)
+  \sa hasButtonFocus()
 */
-
 void QtxDialog::setButtonFocus( const int id )
 {
-       QButton* pb = button( id );
-       if ( pb )
-           pb->setFocus();
+  QAbstractButton* pb = button( id );
+  if ( pb )
+    pb->setFocus();
 }
 
 /*!
-       Name: buttonText [public]
-       Desc: Return text of specified button.
+  \brief Get specified button's text.
+  \param id control button ID (QtxDialog::ButtonFlags)
+  \return button's text
+  \sa setButtonText()
 */
-
 QString QtxDialog::buttonText( const int id )
 {
-       QString retval;
-       QButton* but = button( id );
-       if ( but )
-               retval = but->text();
-       return retval;
+  QString retval;
+  QAbstractButton* but = button( id );
+  if ( but )
+    retval = but->text();
+  return retval;
 }
 
 /*!
-       Name: setButtonText [public]
-       Desc: Sets text to specified button.
+  \brief Set specified button's text.
+  \param id control button ID (QtxDialog::ButtonFlags)
+  \param text button's text
+  \sa buttonText()
 */
-
 void QtxDialog::setButtonText( const int id, const QString& text )
 {
-       QButton* but = button( id );
-       if ( but && but->text() != text )
-       {
-               but->setText( text );
-               adjustButtons();
-       }
-}
-
-/*!
-       Name: setAlignment [public]
-       Desc: Sets alignment policy. Returns the previous alignment.
-                 Use the function before the first show of the dialog.
-                 If dialog flag AlignOnce is setted then align will performed
-                 only one time otherwise dialog will be aligned every time
-                 when it shown. Dialog will be aligned relative to it parent.
-
-                 Following align flags may be used:
-                       Qtx::AlignAuto      - Align to center of desktop (default).
-                       Qtx::AlignLeft      - Align left side of dialog to left side of parent.
-                       Qtx::AlignRight     - Align right side of dialog to right side of parent.
-                       Qtx::AlignTop       - Align top side of dialog to top side of parent.
-                       Qtx::AlignBottom    - Align bottom side of dialog to bottom side of parent.
-                       Qtx::AlignHCenter   - Align dialog to center of parent in horizontal dimension.
-                       Qtx::AlignVCenter   - Align dialog to center of parent in vertical dimension.
-                       Qtx::AlignCenter    - Align dialog to center of parent in both dimensions.
-                       Qtx::AlignOutLeft   - Align right side of dialog to left side of parent.
-                       Qtx::AlignOutRight  - Align left side of dialog to right side of parent.
-                       Qtx::AlignOutTop    - Align bottom side of dialog to top side of parent.
-                       Qtx::AlignOutBottom - Align top side of dialog to bottom side of parent.
-*/
+  QAbstractButton* but = button( id );
+  if ( but && but->text() != text )
+  {
+    but->setText( text );
+    adjustButtons();
+  }
+}
 
+/*!
+  \brief Sets alignment policy.
+
+  Use the function before the the dialog is first time shown.
+  If dialog flag AlignOnce is set then alignment is performed
+  only once, otherwise the dialog is aligned each time when it
+  is shown. 
+  Dialog box is aligned relatively to its parent.
+  By default, dialog box is aligned to the center of the parent 
+  widget (usually desktop or another dialog box).
+  
+  \param align alignment flag(s) (Qtx::AlignmentFlags)
+  \return previous alignment policy
+*/
 uint QtxDialog::setAlignment( uint align )
 {
   uint oldAlign = myAlignment;
@@ -891,498 +924,563 @@ uint QtxDialog::setAlignment( uint align )
 }
 
 /*!
-       Name: update [virtual public slot]
-       Desc: Updates dialog, show selected buttons and hide unselected.
+  \brief Update dialog box.
 */
-
 void QtxDialog::update()
 {
-       for ( ButtonMap::Iterator it = myButton.begin(); it != myButton.end(); ++it )
-               if ( it.key() >= 0 )
-                       testButtonFlags( it.key() ) ? it.data()->show() : it.data()->hide();
+  for ( ButtonMap::Iterator it = myButton.begin(); it != myButton.end(); ++it )
+    if ( it.key() >= 0 )
+      it.value()->setVisible( testButtonFlags( it.key() ) );
 
-       for ( AreaMap::Iterator itr = myArea.begin(); itr != myArea.end(); ++itr )
-               itr.data()->layoutButtons();
+  for ( AreaMap::Iterator itr = myArea.begin(); itr != myArea.end(); ++itr )
+    itr.value()->layoutButtons();
 
-       adjustButtons();
+  adjustButtons();
 
-       QDialog::update();
+  QDialog::update();
 }
 
 /*!
-       Name: show [virtual public]
-       Desc: Show dialog, set keyboard focus on dialog.
+  \brief Show/hide dialog box, set keyboard focus to the dialog.
+  
+  Re-implemented from Qt.
+  
+  \param on show/hide flag
 */
-
-void QtxDialog::show()
+void QtxDialog::setVisible( bool on )
 {
-       QDialog::show();
+  resize( sizeHint() );
 
-       if ( testDialogFlags( SetFocus ) )
-         setFocus();
+  QDialog::setVisible( on );
 
-       myInited = true;
+  if ( on )
+  {
+    if ( testDialogFlags( SetFocus ) )
+      setFocus();
+    myInited = true;
+  }
+  else
+    QApplication::instance()->processEvents();
 }
 
 /*!
-       Name: hide [virtual public]
-       Desc: Hides dialog, processed all posted events.
+  \brief Get user button by the specified \a id.
+  \param id user button ID
+  \return user button or 0 if it is not found
+  \sa insertButton(), removeButton(), userButtonIds()
 */
-
-void QtxDialog::hide()
+QAbstractButton* QtxDialog::userButton( const int id ) const
 {
-       QDialog::hide();
-       qApp->processEvents();
+  QAbstractButton* b = 0;
+  if ( id < -1 && myButton.contains( id ) )
+    b = myButton[id];
+  return b;
 }
 
 /*!
-       Name: userButton [public]
-       Desc: Return user dialog button using specified identificator.
+  \brief Get all user button IDs.
+  \return list of user buttons identificators
+  \sa insertButton(), removeButton(), userButton()
 */
-
-QButton* QtxDialog::userButton( const int id ) const
+QIntList QtxDialog::userButtonIds() const
 {
-       QButton* b = 0;
-       if ( id < -1 && myButton.contains( id ) )
-               b = myButton[id];
-    return b;
+  QIntList retlist;
+  for ( ButtonMap::ConstIterator it = myButton.begin(); it != myButton.end(); ++it )
+    if ( it.key() < 0 )
+      retlist.append( it.key() );
+  return retlist;
 }
 
 /*!
-       Name: userButtonIds [public]
-       Desc: Return list of user dialog button identificators.
-*/
+  \brief Add user button to the dialog box.
 
-QValueList<int> QtxDialog::userButtonIds() const
-{
-       QValueList<int> retlist;
-       for ( ButtonMap::ConstIterator it = myButton.begin(); it != myButton.end(); ++it )
-               if ( it.key() < 0 )
-                       retlist.append( it.key() );
-       return retlist;
-}
+  The button is inserted to the specified dialog box area.
+  if the button is added successfully, the unique identificator of 
+  the added button is returned, otherwise -1 is returned.
 
-/*!
-       Name: insertButton [public]
-       Desc: Add new user dialog button. Function return identificator of
-                 newly added button in successfull case otherwise -1 will be returned.
+  \param text text of the added button
+  \param area buttons area (QtxDialog::ButtonArea)
+  \return button ID
+  \sa removeButton(), userButton(), userButtonIds()
 */
-
 int QtxDialog::insertButton( const QString& text, const int area )
 {
-       if ( !myArea.contains( area ) )
-               return -1;
+  if ( !myArea.contains( area ) )
+    return -1;
 
-       int id = -2;
-       while ( myButton.contains( id ) )
-               id--;
+  int id = -2;
+  while ( myButton.contains( id ) )
+    id--;
 
-       Area* anArea = myArea[area];
-       QButton* b = createButton( this );
-       if ( b )
-       {
-               b->setText( text );
-               myButton.insert( id, b );
-               myPosition.insert( id, Left );
-
-               connect( b, SIGNAL( clicked() ), this, SLOT( onButton() ) );
-#if QT_VER >= 3
-               connect( b, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
-#endif
+  Area* anArea = myArea[area];
+  QAbstractButton* b = createButton( this );
+  if ( b )
+  {
+    b->setText( text );
+    myButton.insert( id, b );
+    myPosition.insert( id, Left );
+    
+    connect( b, SIGNAL( clicked() ), this, SLOT( onButton() ) );
+    connect( b, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
 
-               anArea->insertButton( b );
-               update();
-       }
-       else
-               id = -1;
+    anArea->insertButton( b );
+    update();
+  }
+  else
+    id = -1;
 
-       return id;
+  return id;
 }
 
 /*!
-       Name: removeButton [public]
-       Desc: Remove user dialog button with specified identificator. If
-                 identificator equal -1 then method will remove all user dialog buttons.
-*/
+  \brief Remove user button.
+
+  If \c id is -1, all user buttons are removed.
 
+  \param id user button ID
+  \sa insertButton(), userButton(), userButtonIds()
+*/
 void QtxDialog::removeButton( const int id )
 {
-       if ( id >= 0 )
-               return;
-
-       ButtonMap map;
-       if ( id == -1 )
-       {
-               for ( ButtonMap::Iterator it = myButton.begin(); it != myButton.end(); ++it )
-               {
-                       if ( it.key() < 0 )
-                               map.insert( it.key(), it.data() );
-               }
-       }
-       else if ( myButton.contains( id ) )
-               map.insert( id, myButton[id] );
-
-       for ( ButtonMap::Iterator itr = map.begin(); itr != map.end(); ++itr )
-       {
-               for ( AreaMap::Iterator it = myArea.begin(); it != myArea.end(); ++it )
-                       it.data()->removeButton( itr.data() );
-
-               myButton.remove( itr.key() );
-               myPosition.remove( itr.key() );
-
-               delete itr.data();
-       }
-    update();
+  if ( id >= 0 )
+    return;
+
+  ButtonMap map;
+  if ( id == -1 )
+  {
+    for ( ButtonMap::Iterator it = myButton.begin(); it != myButton.end(); ++it )
+    {
+      if ( it.key() < 0 )
+       map.insert( it.key(), it.value() );
+    }
+  }
+  else if ( myButton.contains( id ) )
+    map.insert( id, myButton[id] );
+
+  for ( ButtonMap::Iterator itr = map.begin(); itr != map.end(); ++itr )
+  {
+    for ( AreaMap::Iterator it = myArea.begin(); it != myArea.end(); ++it )
+      it.value()->removeButton( itr.value() );
+
+    myButton.remove( itr.key() );
+    myPosition.remove( itr.key() );
+    
+    delete itr.value();
+  }
+  update();
 }
 
 /*!
-       Name: setUnits [static public]
-       Desc: Sets specified measure units in given label. Measure units close
-                 in braces. If measure units not exist then they will be added.
-                 For example:
-                       1. Label contains text 'Radius'.
-                          setUnits( aLabel, "mm" )    => aLabel contains 'Radius (mm)'
-               setUnits( aLabel, "cm" )    => aLabel contains 'Radius (cm)'
-            2. Label "aLabel" contains text 'Radius ():'.
-               setUnits( aLabel, "mm" )    => aLabel contains 'Radius (mm):'
-               setUnits( aLabel, "cm" )    => aLabel contains 'Radius (cm):'
-*/
+  \brief Set measure units to the specified label.
 
+  In the dialog box label the measure units are closed in braces.
+  If measure units do not exist they will be added.
+
+  For example:
+  \code
+  // create label "Radius"
+  QLabel* aLabel = new QLabel( "Radius", mainFrame() );
+  // set measure units to "mm"
+  setUnits( aLabel, "mm" )    // => aLabel contains 'Radius (mm)'
+  // set measure units to "cm"
+  setUnits( aLabel, "cm" )    // => aLabel contains 'Radius (cm)'
+
+  // create label "Radius" with initially not set measure units
+  QLabel* aLabel = new QLabel( "Radius ():", mainFrame() );
+  // set measure units to "mm"
+  setUnits( aLabel, "mm" )    // => aLabel contains 'Radius (mm):'
+  // set measure units to "cm"
+  setUnits( aLabel, "cm" )    // => aLabel contains 'Radius (cm):'
+  \endcode
+
+  \param aLabel label widget
+  \param aUnits measure units
+*/
 void QtxDialog::setUnits( QLabel* aLabel, const QString& aUnits )
 {
-       QString label = aLabel->text();
-       int begin;
-       int end = label.findRev( ')' );
-
-       QString startLabel = label;
-       QString finalLabel;
-
-       if ( end != -1 )
-       {
-               begin = label.left( end ).findRev( '(' );
-               if ( begin != -1 )
-               {
-                       startLabel = label.mid( 0, begin );
-                       finalLabel = label.mid( end + 1 );
-               }
-       }
-       else
-       {
-               startLabel = startLabel.stripWhiteSpace();
-               if ( startLabel.at( startLabel.length() - 1 ) == ':' )
-               {
-                       finalLabel = startLabel.mid( startLabel.length() - 1 );
-                       startLabel = startLabel.mid( 0, startLabel.length() - 1 );
-               }
-       }
-       if ( aUnits.length() )
-               label = startLabel.stripWhiteSpace() +
-               " (" + aUnits + ") " + finalLabel.stripWhiteSpace();
-       else
-               label = startLabel.stripWhiteSpace() +
-               " " + finalLabel.stripWhiteSpace();
-       aLabel->setText( label );
-}
-
-/*!
-       Name: acceptData [virtual protected]
-       Desc: If returns true dialog will be accepted and closed. This method
-             called if dialog flag Accept is setted.
-*/
+  QString label = aLabel->text();
+
+  int begin;
+  int end = label.lastIndexOf( ')' );
 
+  QString startLabel = label;
+  QString finalLabel;
+
+  if ( end != -1 )
+  {
+    begin = label.left( end ).lastIndexOf( '(' );
+    if ( begin != -1 )
+    {
+      startLabel = label.mid( 0, begin );
+      finalLabel = label.mid( end + 1 );
+    }
+  }
+  else
+  {
+    startLabel = startLabel.trimmed();
+    if ( startLabel.at( startLabel.length() - 1 ) == ':' )
+    {
+      finalLabel = startLabel.mid( startLabel.length() - 1 );
+      startLabel = startLabel.mid( 0, startLabel.length() - 1 );
+    }
+  }
+  if ( aUnits.length() )
+    label = startLabel.trimmed() + " (" + aUnits + ") " + finalLabel.trimmed();
+  else
+    label = startLabel.trimmed() + " " + finalLabel.trimmed();
+  aLabel->setText( label );
+}
+
+/*!
+  \brief Check if data entered by the user is valid.
+
+  This method can be re-implemented in the successor class if it
+  requires to check user input consistency.
+  Default implementation returns \c true.
+
+  This method is called if dialog flag QtxDialog::Accept is set.
+  If this method returns \c true, then dialog will be accepted and closed.
+
+  \return \c true if user input is valid
+  \sa accept()
+*/
 bool QtxDialog::acceptData() const
 {
   return true;
 }
 
 /*!
-       Name: rejectData [virtual protected]
-       Desc: If returns true dialog will be rejected and closed. This method
-             called if dialog flag Reject is setted.
-*/
+  \brief Check if dialog box can be cancelled.
 
+  This method can be re-implemented in the successor class if it
+  requires to check possibility to cancel dialog box safely.
+  Default implementation returns \c true.
+
+  This method is called if dialog flag QtxDialog::Reject is set.
+  If this method returns \c true, then dialog will be rejected and closed.
+
+  \return \c true if dialog box can be cancelled
+  \sa reject()
+*/
 bool QtxDialog::rejectData() const
 {
-       return true;
+  return true;
 }
 
 /*!
-       Name: createButton [virtual protected]
-       Desc: Create new user button. Invoked from method "insertButton".
-*/
+  \brief Create new user button.
+
+  This method is invoked from method insertButton().
 
-QButton* QtxDialog::createButton( QWidget* parent )
+  \param parent parent widget
+  \return new user button
+*/
+QAbstractButton* QtxDialog::createButton( QWidget* parent )
 {
-       QPushButton* pb = new QPushButton( parent );
-       pb->setAutoDefault( false );
-       return pb;
+  QPushButton* pb = new QPushButton( parent );
+  pb->setAutoDefault( false );
+  return pb;
 }
 
 /*!
-       Name: button [protected]
-       Desc: Return pointer on control button specified by identifier.
-                 If identifier is wrong then null pointer will returned.
+  \brief Get button by the specified ID.
+  \param f control button ID (QtxDialog::ButtonFlags)
+  \return button or 0 if \a id is invalid
 */
-
-QButton* QtxDialog::button( const int f ) const
+QAbstractButton* QtxDialog::button( const int f ) const
 {
-       QButton* retval = 0;
-       if ( myButton.contains( f ) )
-               retval = myButton[f];
-       return retval;
+  QAbstractButton* retval = 0;
+  if ( myButton.contains( f ) )
+    retval = myButton[f];
+  return retval;
 }
 
 /*!
-       Name: buttons [protected]
-       Desc: Return map with control dialog buttons accordance to given button flags.
+  \brief Get buttons by the specified IDs.
+  \param f control button(s) ID(s) (QtxDialog::ButtonFlags)
+  \return button map
 */
-
 QtxDialog::ButtonMap QtxDialog::buttons( const int f ) const
 {
-       ButtonMap retmap;
-       if ( f < -1 )
-       {
-               if ( myButton.contains( f ) )
-                       retmap.insert( f, myButton[f] );
-       }
-       else
-       {
-               for ( ButtonMap::ConstIterator it = myButton.begin(); it != myButton.end(); ++it )
-                       if ( f == -1 || ( it.key() >= 0 && f & it.key() ) )
-                               retmap.insert( it.key(), it.data() );
-       }
-
-       return retmap;
+  ButtonMap retmap;
+  if ( f < -1 )
+  {
+    if ( myButton.contains( f ) )
+      retmap.insert( f, myButton[f] );
+  }
+  else
+  {
+    for ( ButtonMap::ConstIterator it = myButton.begin(); it != myButton.end(); ++it )
+      if ( f == -1 || ( it.key() >= 0 && f & it.key() ) )
+       retmap.insert( it.key(), it.value() );
+  }
+  return retmap;
 }
 
 /*!
-       Name: buttonId [protected]
-       Desc: Return identifier of specified button.
+  \brief Get specified button's identifier.
+  \param b button
+  \return button ID
 */
-
-int QtxDialog::buttonId( const QButton* b ) const
+int QtxDialog::buttonId( const QAbstractButton* b ) const
 {
-       int id = -1;
-       for ( ButtonMap::ConstIterator it = myButton.begin(); it != myButton.end() && id == -1; ++it )
-               if ( it.data() == b )
-                       id = it.key();
-       return id;
+  int id = -1;
+  for ( ButtonMap::ConstIterator it = myButton.begin(); it != myButton.end() && id == -1; ++it )
+    if ( it.value() == b )
+      id = it.key();
+  return id;
 }
 
 /*!
-       Name: buttonPosition
-       Desc: Returns position of specified button. [protected]
+  \brief Get position of specified button.
+  \param b button
+  \return button position (QtxDialog::ButtonPosition)
 */
-
-int QtxDialog::buttonPosition( QButton* b ) const
+int QtxDialog::buttonPosition( QAbstractButton* b ) const
 {
-       return buttonPosition( buttonId( b ) );
+  return buttonPosition( buttonId( b ) );
 }
 
 /*!
-       Name: showEvent [virtual protected]
-       Desc: Aligns this dialog according the parent widget and alignment
-             policy before the show.
-*/
+  \brief Align this dialog according to the parent widget and alignment
+         policy before the dialog box is shown.
+
+  Re-implemented from Qt.
 
+  \param e show event
+*/
 void QtxDialog::showEvent( QShowEvent* e )
 {
-       if ( !testDialogFlags( AlignOnce ) || !myInited )
-               Qtx::alignWidget( this, parentWidget(), myAlignment );
-       QDialog::showEvent( e );
+  if ( !testDialogFlags( AlignOnce ) || !myInited )
+    Qtx::alignWidget( this, parentWidget(), myAlignment );
+  QDialog::showEvent( e );
 }
 
 /*!
-       Name: hideEvent [virtual protected]
-       Desc: Process all existing events when dialog is closed.
-*/
+  \brief Process all existing events when dialog box is hidden.
 
+  Re-implemented from Qt.
+
+  \param e hide event
+*/
 void QtxDialog::hideEvent( QHideEvent* e )
 {
-       qApp->processEvents();
-       QDialog::hideEvent( e );
+  QApplication::instance()->processEvents();
+  QDialog::hideEvent( e );
 }
 
 /*!
-       Name: childEvent [virtual protected]
-       Desc: Setting up layout when size grip is added.
-*/
+  \brief Update dialog box layout when the size grip is added.
+
+  Re-implemented from Qt.
 
+  \param e child event
+*/
 void QtxDialog::childEvent( QChildEvent* e )
 {
-       QDialog::childEvent( e );
-       if ( layout() && e->inserted() && e->child()->inherits( "QSizeGrip" ) )
-       {
-               layout()->setMargin( 12 );
-#if QT_VER >= 3
-               connect( e->child(), SIGNAL( destroyed() ), this, SLOT( onSizeGripDestroyed() ) );
-#endif
-       }
+  QDialog::childEvent( e );
+  if ( layout() && e->added() && e->child()->inherits( "QSizeGrip" ) )
+  {
+    layout()->setMargin( 12 );
+    connect( e->child(), SIGNAL( destroyed() ), this, SLOT( onSizeGripDestroyed() ) );
+  }
 }
 
 /*!
-       Name: keyPressEvent [virtual protected]
-       Desc: Calls reject() if key Escape is pressed.
-             Calls accept() if key "Ctrl+Enter" is pressed.
-                 Process key "F1" and emit signal dlgHelp().
-                 Transfer key "Ctrl+(Shift+)Tab" press event to Tab Widget.
-*/
+  \brief Process key pressing event.
+
+  Re-implemented from Qt.
+
+  Call reject() if "Escape" key is pressed.
+  Call accept() if "Ctrl+Enter" key-sequence is pressed.
+  Process "F1" key and emit signal dlgHelp().
+  Transfer "Ctrl+(Shift+)Tab" key-sequence press event 
+  to the child Tab widget (if there is any).
 
+  \param e key press event
+*/
 void QtxDialog::keyPressEvent( QKeyEvent* e )
 {
-       QDialog::keyPressEvent( e );
-       if ( e->isAccepted() )
-           return;
+  QDialog::keyPressEvent( e );
+
+  if ( e->isAccepted() )
+    return;
 
-       if ( ( e->state() == 0 ) && ( e->key() == Key_Escape ) )
-               reject();
+  if ( !e->modifiers() && e->key() == Qt::Key_Escape )
+    reject();
 
-       if ( ( e->state() == ControlButton ) && ( e->key() == Key_Return ) )
-       {
-               if ( testButtonFlags( OK ) || testButtonFlags( Yes ) )
-                       accept();
-               else if ( testButtonFlags( Apply ) && isButtonEnabled( Apply ) )
-                       emit dlgApply();
-               e->accept();
-       }
+  if ( e->modifiers() == Qt::ControlModifier && e->key() == Qt::Key_Return )
+  {
+    if ( testButtonFlags( OK ) || testButtonFlags( Yes ) )
+      accept();
+    else if ( testButtonFlags( Apply ) && isButtonEnabled( Apply ) )
+      emit dlgApply();
+    e->accept();
+  }
 
-       if ( e->key() == Key_F1 && testButtonFlags( Help ) && isButtonEnabled( Help ) )
-       {
-               e->accept();
-               emit dlgHelp();
-       }
+  if ( e->key() == Qt::Key_F1 && testButtonFlags( Help ) && isButtonEnabled( Help ) )
+  {
+    e->accept();
+    emit dlgHelp();
+  }
 
-       if ( ( e->key() == Key_Tab ) && ( e->state() & ControlButton ) )
-       {
-               QObject* tab = child( 0, "QTabWidget" );
-               if ( tab )
-                       tab->event( e );
-       }
+  if ( e->key() == Qt::Key_Tab && e->modifiers() & Qt::ControlModifier )
+  {
+    QObject* tab = qFindChild<QTabWidget*>( this );
+    if ( tab )
+      QApplication::sendEvent( tab, e );
+  }
 }
 
 /*!
-       Name: closeEvent [virtual protected]
-       Desc: Reject the dialog.
+  \brief Called when user closes dialog box.
+  
+  Call reject() method.
+  
+  \param e close event (not used)
 */
-
-void QtxDialog::closeEvent( QCloseEvent* )
+void QtxDialog::closeEvent( QCloseEvent* /*e*/ )
 {
-       reject();
+  reject();
 }
 
 /*!
-       Name: accept [virtual protected slot]
-       Desc: Invoke function acceptData() if it needed and if acceptData() return
-                 false does nothing. Otherwise hides the dialog and sets the result code
-                 to Accepted. Emit signal according to the pressed control button.
-*/
+  \brief Accept the dialog box.
+
+  This method is used when any accept button is pressed (usually
+  "OK", "Yes", etc).
 
+  If dialog flag QtxDialog::Accept is set, this function invokes 
+  acceptData() method, which should in this case return \c true to
+  allow further processing. 
+
+  If acceptData() returns \c false, this function just returns.
+
+  If acceptData() returns \c true, the Accepted result is set
+  and signal according to the pressed control button is emitted.
+  Then the default implementation of accept() method is called
+  (which hides the dialog box and, depending on the dialog box flags,
+  can close and destroy it).
+  \sa acceptData()
+*/
 void QtxDialog::accept()
 {
-       if ( !mySender )
-       {
-               if ( testButtonFlags( OK ) )
-                       mySender = button( OK );
-               else if ( testButtonFlags( Yes ) )
-                       mySender = button( Yes );
-               else
-                       mySender = button( Close );
-       }
+  if ( !mySender )
+  {
+    if ( testButtonFlags( OK ) )
+      mySender = button( OK );
+    else if ( testButtonFlags( Yes ) )
+      mySender = button( Yes );
+    else
+      mySender = button( Close );
+  }
 
   if ( !mySender || !mySender->isWidgetType() ||
        !((QWidget*)mySender)->isEnabled() )
-               return;
+    return;
 
-       if ( testDialogFlags( Accept ) && !acceptData() )
-               return;
+  if ( testDialogFlags( Accept ) && !acceptData() )
+    return;
 
-       QDialog::accept();
+  QDialog::accept();
 
-       emitSignal();
+  emitSignal();
 }
 
 /*!
-       Name: reject [virtual protected slot]
-       Desc: Invoke function rejectData() if it needed and if rejectData() return
-                 false does nothing. Otherwise hides the dialog and sets the result code
-                 to Rejected. Emit signal according to the pressed control button. (If
-                 dialog was closed by key Escape or by close event emit signal dlgCancel(),
-                 or dlgClose(), or dlgNo().
-*/
+  \brief Reject the dialog box.
+
+  This method is used when any reject button is pressed (usually
+  "Close", "Cancel", "No", etc).
+
+  If dialog flag QtxDialog::Reject is set, this function invokes 
+  rejectData() method, which should in this case return \c true to
+  allow further processing. 
 
+  If rejectData() returns \c false, this function just returns.
+
+  If rejectData() returns \c true, the Rejected result is set
+  and signal according to the pressed control button is emitted.
+  Then the default implementation of reject() method is called
+  (which hides the dialog box and, depending on the dialog box flags,
+  can close and destroy it).
+  \sa rejectData()
+*/
 void QtxDialog::reject()
 {
-       if ( testDialogFlags( Reject ) && !rejectData() )
-               return;
+  if ( testDialogFlags( Reject ) && !rejectData() )
+    return;
 
-       if ( !mySender )
-       {
-               if ( testButtonFlags( Cancel ) )
-                       mySender = button( Cancel );
-               else if ( testButtonFlags( No ) )
-                       mySender = button( No );
-               else
-                       mySender = button( Close );
-       }
+  if ( !mySender )
+  {
+    if ( testButtonFlags( Cancel ) )
+      mySender = button( Cancel );
+    else if ( testButtonFlags( No ) )
+      mySender = button( No );
+    else
+      mySender = button( Close );
+  }
 
-    if ( !mySender || !mySender->isWidgetType() ||
-         !((QWidget*)mySender)->isEnabled() )
-        return;
+  if ( !mySender || !mySender->isWidgetType() ||
+       !((QWidget*)mySender)->isEnabled() )
+    return;
 
-       QDialog::reject();
+  QDialog::reject();
 
-       emitSignal();
+  emitSignal();
 }
 
 /*!
-       Name: reject [private]
-       Desc: Emit signal appropriate to control button.
+  \brief Emit signal correspondingly to the control button.
 */
-
 void QtxDialog::emitSignal()
 {
-       qApp->processEvents();
-       QApplication::syncX();
+  QApplication::instance()->processEvents();
+  QApplication::syncX();
 
-       int id = buttonId( (QButton*)mySender );
-       mySender = 0;
+  int id = buttonId( (QAbstractButton*)mySender );
+  mySender = 0;
 
-       switch ( id )
-       {
-       case OK:
-               emit dlgOk();
-               break;
-       case Cancel:
-               emit dlgCancel();
-               break;
-       case Close:
-               emit dlgClose();
-               break;
-       case Yes:
-               emit dlgYes();
-               break;
-       case No:
-               emit dlgNo();
-               break;
-       }
+  switch ( id )
+  {
+  case OK:
+    emit dlgOk();
+    break;
+  case Cancel:
+    emit dlgCancel();
+    break;
+  case Close:
+    emit dlgClose();
+    break;
+  case Yes:
+    emit dlgYes();
+    break;
+  case No:
+    emit dlgNo();
+    break;
+  }
 }
 
 /*!
-       Name: onAccept [private slot]
-       Desc: Process signals "clicked()" from control buttons "OK", "Yes". Invoke accept().
-*/
+  \brief This slot is called when user presses on of the buttons
+         "OK", "Yes", etc.
 
+  Call accept() method.
+*/
 void QtxDialog::onAccept()
 {
-    const QObject* obj = sender();
-    mySender = obj;
-    accept();
+  const QObject* obj = sender();
+  mySender = obj;
+  accept();
 }
 
 /*!
-       Name: onReject [private slot]
-       Desc: Process signals "clicked()" from control buttons "Cancel", "No", "Close".
-                 Invoke reject().
+  \brief This slot is called when user presses on of the buttons
+         "Cancel", "No", "Close".
+
+  Call reject() method.
 */
 
 void QtxDialog::onReject()
@@ -1393,62 +1491,103 @@ void QtxDialog::onReject()
 }
 
 /*!
-       Name: onButton [private slot]
-       Desc: Receive signal "clicked()" from user buttons and emit signal
-                 "dlgButton( int )" with identificator of clicked user button.
+  \brief Process user button click event.
+  
+  This method is called when user presses one of custom user buttons.
+  Emits signal dlgButton(int) with identificator of the clicked user
+  button passed as parameter.
 */
-
 void QtxDialog::onButton()
 {
-       int id = buttonId( (QButton*)sender() );
-       if ( id != -1 )
-               emit dlgButton( id );
+  int id = buttonId( (QAbstractButton*)sender() );
+  if ( id != -1 )
+    emit dlgButton( id );
 }
 
 /*!
-       Name: onDestroyed [private slot]
-       Desc: Remove user button if it was destroyed.
+  \brief Watch for the user button destroying.
+  \param obj button being destroyed
 */
-
 void QtxDialog::onDestroyed( QObject* obj )
 {
-       QButton* b = (QButton*)obj;
-       int id = buttonId( b );
-       if ( id == -1 )
-               return;
+  QAbstractButton* b = (QAbstractButton*)obj;
+  int id = buttonId( b );
+  if ( id == -1 )
+    return;
 
-       myButton.remove( id );
-       myPosition.remove( id );
-       for ( AreaMap::Iterator it = myArea.begin(); it != myArea.end(); ++it )
-               it.data()->removeButton( b );
+  myButton.remove( id );
+  myPosition.remove( id );
+  for ( AreaMap::Iterator it = myArea.begin(); it != myArea.end(); ++it )
+    it.value()->removeButton( b );
 }
 
 /*!
-       Name: onSizeGripDestroyed [private slot]
-       Desc: Setting up layout when size grip is destroyed.
+  \brief Update dialog box layout when the size grip is destroyed.
 */
-
 void QtxDialog::onSizeGripDestroyed()
 {
-       if ( layout() )
-               layout()->setMargin( 5 );
+  if ( layout() )
+    layout()->setMargin( 5 );
 }
 
 /*!
-       Name: adjustButtons [private]
-       Desc: Setting the equal with for all buttons.
+  \brief Adjust buttons (set equal size for all buttons).
 */
-
 void QtxDialog::adjustButtons()
 {
-       int minWidth = 0;
-       for ( AreaMap::Iterator aIt = myArea.begin(); aIt != myArea.end(); ++aIt )
-               for ( QPtrListIterator<QButton> bIt( aIt.data()->buttons() ); bIt.current(); ++bIt )
-                       if ( bIt.current()->isVisibleTo( this ) )
-                               minWidth = QMAX( minWidth, bIt.current()->sizeHint().width() );
+  int minWidth = 0;
+  for ( AreaMap::Iterator aIt = myArea.begin(); aIt != myArea.end(); ++aIt )
+  {
+    const QList<QAbstractButton*>& lst = aIt.value()->buttons();
+    for ( QList<QAbstractButton*>::const_iterator bIt = lst.begin(); bIt != lst.end(); ++bIt )
+      if ( (*bIt)->isVisibleTo( this ) )
+       minWidth = qMax( minWidth, (*bIt)->sizeHint().width() );
+  }
 
-       for ( AreaMap::Iterator aItr = myArea.begin(); aItr != myArea.end(); ++aItr )
-               for ( QPtrListIterator<QButton> bItr( aItr.data()->buttons() ); bItr.current(); ++bItr )
-                       if ( bItr.current()->isVisibleTo( this ) )
-                               bItr.current()->setMinimumWidth( minWidth );
+  for ( AreaMap::Iterator aItr = myArea.begin(); aItr != myArea.end(); ++aItr )
+  {
+    const QList<QAbstractButton*>& lst = aItr.value()->buttons();
+    for ( QList<QAbstractButton*>::const_iterator bItr = lst.begin(); bItr != lst.end(); ++bItr )
+      if ( (*bItr)->isVisibleTo( this ) )
+       (*bItr)->setMinimumWidth( minWidth );
+  }
 }
+
+/*!
+  \fn void QtxDialog::dlgButton( int id )
+  \brief Emitted when the user button is clicked.
+  \param id user button identificator
+*/
+/*!
+  \fn void QtxDialog::dlgParamChanged()
+  \brief This signal can be used in successor classes to signalize about
+         some dialog parameter changing.
+*/
+/*!
+  \fn void QtxDialog::dlgHelp()
+  \brief Emitted when the "Help" button is clicked.
+*/
+/*!
+  \fn void QtxDialog::dlgApply()
+  \brief Emitted when the "Apply" button is clicked.
+*/
+/*!
+  \fn void QtxDialog::dlgOk()
+  \brief Emitted when the "OK" button is clicked.
+*/
+/*!
+  \fn void QtxDialog::dlgNo()
+  \brief Emitted when the "No" button is clicked.
+*/
+/*!
+  \fn void QtxDialog::dlgYes()
+  \brief Emitted when the "Yes" button is clicked.
+*/
+/*!
+  \fn void QtxDialog::dlgClose()
+  \brief Emitted when the "Close" button is clicked.
+*/
+/*!
+  \fn void QtxDialog::dlgCancel()
+  \brief Emitted when the "Cancel" button is clicked.
+*/
index dbf4fbd9d8ae143e45abeaff15e1df13d5eea831..bd5824924ab18bc7a6f9144ef79820927ff13cb7 100755 (executable)
@@ -1,36 +1,38 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// File:      QtxDialog.hxx
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxDialog.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXDIALOG_H
 #define QTXDIALOG_H
 
 #include "Qtx.h"
 
-#include <qmap.h>
-#include <qdialog.h>
-#include <qvaluelist.h>
+#include <QDialog>
+#include <QMap>
 
 class QFrame;
 class QLabel;
-class QButton;
+class QAbstractButton;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -38,149 +40,163 @@ class QButton;
 
 class QTX_EXPORT QtxDialog : public QDialog
 {
-         Q_OBJECT
+  Q_OBJECT
 
-         class Area;
-         class Border;
+  class Area;
+  class Border;
 
 public:
-    typedef enum { Position, Expand, Uniform } PlacePolicy;
-    typedef enum { TopArea, BottomArea, LeftArea, RightArea } ButtonArea;
-    typedef enum { Left, Right, Center, Top = Left, Bottom = Right } ButtonPosition;
-
-    typedef enum { None      = 0x00000000,
-                   OK        = 0x00000001,
-                   Apply     = 0x00000002,
-                   Cancel    = 0x00000004,
-                   Yes       = 0x00000008,
-                   No        = 0x00000010,
-                   Close     = 0x00000020,
-                   Help      = 0x00000040,
-                   OKCancel  = OK  | Cancel,
-                   YesNo     = Yes | No,
-                   Standard  = OK  | Cancel | Help,
-                   All       = Standard | YesNo | Apply | Close } ButtonFlags;
-
-    typedef enum { Accept    = 0x000001,
-                                          Reject    = 0x000002,
-                                          AlignOnce = 0x000004,
-                   SetFocus  = 0x000008 } DialogFlags;
-
+  //! Buttons alignment type
+  typedef enum { Position,          //!< buttons are placed according their position
+                Expand,            //!< buttons occupy all available space
+                Uniform            //!< buttons are uniformly placed in the area
+  } PlacePolicy;
+  //! Buttons area
+  typedef enum { TopArea,           //!< horizontal area at the top side of the dialog box
+                BottomArea,        //!< horizontal area at the bottom side of the dialog box
+                LeftArea,          //!< vertical area at the left side of the dialog box
+                RightArea          //!< vertical area at the right side of the dialog box
+  } ButtonArea;
+  //! Button position
+  typedef enum { Left,              //!< set button left-most
+                Right,             //!< set button right-most
+                Center,            //!< place button in the center
+                Top = Left,        //!< set button top-most
+                Bottom = Right     //!< set button bottom-most
+  } ButtonPosition;
+  //! Button ID flags
+  typedef enum { None      = 0x00000000,                      //!< no button used
+                OK        = 0x00000001,                      //!< OK button
+                Apply     = 0x00000002,                      //!< Apply button
+                Cancel    = 0x00000004,                      //!< Cancel button
+                Yes       = 0x00000008,                      //!< Yes button
+                No        = 0x00000010,                      //!< No button
+                Close     = 0x00000020,                      //!< Close button
+                Help      = 0x00000040,                      //!< Help button
+                OKCancel  = OK  | Cancel,                    //!< OK & Cancel button
+                YesNo     = Yes | No,                        //!< Yes & No buttons
+                Standard  = OK  | Cancel | Help,             //!< OK, Cancel & Help buttons
+                All       = Standard | YesNo | Apply | Close //!< all buttons
+  } ButtonFlags;
+  //! Dialog box flags
+  typedef enum { Accept    = 0x000001, //!< allow dialog box accepting control
+                Reject    = 0x000002, //!< allow dialog box rejecting control
+                AlignOnce = 0x000004, //!< align dialog box only when it is first time shown
+                SetFocus  = 0x000008  //!< allow to set focus on dialog box when it is shown (user can use setFocusProxy() and specify own initial focus widget)
+  } DialogFlags;
+  
 public:
-    QtxDialog( QWidget* = 0, const char* = 0, bool = false,
-               bool = false, const int = Standard, WFlags = 0 );
-    virtual ~QtxDialog();
-
-    void             setDialogFlags( const int );
-    void             clearDialogFlags( const int );
-    bool             testDialogFlags( const int ) const;
-
-    void             setButtonFlags( const int );
-    void             clearButtonFlags( const int );
-    bool             testButtonFlags( const int ) const;
-
-    int              buttonPosition( const int ) const;
-    void             setButtonPosition( const int, const int = -1 );
-    void             setPlacePosition( const int, const int );
-
-    int              placePolicy( const int ) const;
-    void             setPlacePolicy( const int, const int );
-    void             setButtonPlace( const int, const int );
-
-    QString          buttonText( const int );
-    void             setButtonText( const int, const QString& text );
-
-    void             setButtonFocus( const int );
-    bool             hasButtonFocus( const int ) const;
-
-    bool             isButtonEnabled( const int ) const;
-    void             setButtonEnabled( const bool, const int );
-
-    bool             isBorderEnabled( const int ) const;
-    void             setBorderEnabled( const bool, const int );
-
-    void             removeButton( const int );
-    int              insertButton( const QString&, const int = BottomArea );
-
-    QValueList<int>  userButtonIds() const;
-    QButton*         userButton( const int ) const;
-
-    virtual void     show();
-    virtual void     hide();
-
-    uint             setAlignment( uint align );
-    static  void     setUnits( QLabel*, const QString& );
-
+  QtxDialog( QWidget* = 0, bool = false, bool = false, const int = Standard, Qt::WindowFlags = 0 );
+  virtual ~QtxDialog();
+  
+  void             setDialogFlags( const int );
+  void             clearDialogFlags( const int );
+  bool             testDialogFlags( const int ) const;
+  
+  void             setButtonFlags( const int );
+  void             clearButtonFlags( const int );
+  bool             testButtonFlags( const int ) const;
+  
+  int              buttonPosition( const int ) const;
+  void             setButtonPosition( const int, const int = -1 );
+  void             setPlacePosition( const int, const int );
+  
+  int              placePolicy( const int ) const;
+  void             setPlacePolicy( const int, const int );
+  void             setButtonPlace( const int, const int );
+  
+  QString          buttonText( const int );
+  void             setButtonText( const int, const QString& text );
+  
+  void             setButtonFocus( const int );
+  bool             hasButtonFocus( const int ) const;
+  
+  bool             isButtonEnabled( const int ) const;
+  void             setButtonEnabled( const bool, const int );
+  
+  bool             isBorderEnabled( const int ) const;
+  void             setBorderEnabled( const bool, const int );
+  
+  void             removeButton( const int );
+  int              insertButton( const QString&, const int = BottomArea );
+  
+  QIntList         userButtonIds() const;
+  QAbstractButton* userButton( const int ) const;
+  
+  uint             setAlignment( uint align );
+  static  void     setUnits( QLabel*, const QString& );
+  
 signals:
-    void             dlgButton( int );
-    void             dlgParamChanged();
-
-    void             dlgHelp();
-    void             dlgApply();
-
-    void             dlgOk();
-    void             dlgNo();
-    void             dlgYes();
-    void             dlgClose();
-    void             dlgCancel();
-
+  void             dlgButton( int );
+  void             dlgParamChanged();
+  
+  void             dlgHelp();
+  void             dlgApply();
+  
+  void             dlgOk();
+  void             dlgNo();
+  void             dlgYes();
+  void             dlgClose();
+  void             dlgCancel();
+  
 public slots:
-    void             update();
+  void             update();
+  virtual void     setVisible( bool );
 
 protected slots:
-    virtual void     accept();
-    virtual void     reject();
+  virtual void     accept();
+  virtual void     reject();
 
 private slots:
-    void             onAccept();
-    void             onReject();
-    void             onButton();
-    void             onSizeGripDestroyed();
-    void             onDestroyed( QObject* );
+  void             onAccept();
+  void             onReject();
+  void             onButton();
+  void             onSizeGripDestroyed();
+  void             onDestroyed( QObject* );
 
 protected:
-    typedef QMap<int, QButton*> ButtonMap;
+  typedef QMap<int, QAbstractButton*> ButtonMap;   //!< button map
 
 protected:
-    QFrame*          mainFrame() const;
-
-    virtual bool     acceptData() const;
-    virtual bool     rejectData() const;
-
-    virtual QButton* createButton( QWidget* );
-
-    QButton*         button( const int ) const;
-    ButtonMap        buttons( const int = All ) const;
-    int              buttonId( const QButton* ) const;
-    int              buttonPosition( QButton* ) const;
-
-    virtual void     showEvent( QShowEvent* );
-    virtual void     hideEvent( QHideEvent* );
-    virtual void     closeEvent( QCloseEvent* );
-    virtual void     childEvent( QChildEvent* );
-    virtual void     keyPressEvent( QKeyEvent* );
-
+  QFrame*          mainFrame() const;
+  
+  virtual bool     acceptData() const;
+  virtual bool     rejectData() const;
+  
+  virtual QAbstractButton* createButton( QWidget* );
+  
+  QAbstractButton* button( const int ) const;
+  ButtonMap        buttons( const int = All ) const;
+  int              buttonId( const QAbstractButton* ) const;
+  int              buttonPosition( QAbstractButton* ) const;
+  
+  virtual void     showEvent( QShowEvent* );
+  virtual void     hideEvent( QHideEvent* );
+  virtual void     closeEvent( QCloseEvent* );
+  virtual void     childEvent( QChildEvent* );
+  virtual void     keyPressEvent( QKeyEvent* );
+  
 private:
-         void             adjustButtons();
-    void             emitSignal();
-
+  void             adjustButtons();
+  void             emitSignal();
+  
 private:
-    typedef QMap<int, Area*> AreaMap;
-    typedef QMap<int, int>   PositionMap;
-
-    friend class Area;
+  typedef QMap<int, Area*> AreaMap;        //!< button area map
+  typedef QMap<int, int>   PositionMap;    //!< button position map
+  
+  friend class Area;
 
 private:
-    AreaMap          myArea;
-    ButtonMap        myButton;
-    PositionMap      myPosition;
-
-    bool             myInited;
-    const QObject*   mySender;
-    uint             myAlignment;
-    QFrame*          myMainFrame;
-    int              myButtonFlags;
-    int              myDialogFlags;
+  AreaMap          myArea;                 //!< buttons areas map
+  ButtonMap        myButton;               //!< buttons map
+  PositionMap      myPosition;             //!< buttons position map
+  
+  bool             myInited;               //!< dialog's "initialized" flag
+  const QObject*   mySender;               //!< signal sender
+  uint             myAlignment;            //!< dialog box alignment type
+  QFrame*          myMainFrame;            //!< main frame
+  int              myButtonFlags;          //!< button flags
+  int              myDialogFlags;          //!< dialog flags
 };
 
 #ifdef WIN32
diff --git a/src/Qtx/QtxDirListEditor.cxx b/src/Qtx/QtxDirListEditor.cxx
deleted file mode 100644 (file)
index cd4bb9f..0000000
+++ /dev/null
@@ -1,571 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "QtxDirListEditor.h"
-
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qmessagebox.h>
-#include <qfiledialog.h>
-#include <qapplication.h>
-
-#define MARGIN_SIZE    11
-#define SPACING_SIZE    6
-#define SPACER_SIZE     5
-
-static const char* delete_icon[] = {
-"16 16 3 1",
-"` c #810000",
-"  c none",
-"# c #ffffff",
-"                ",
-"                ",
-" ``#        ``# ",
-" ````#     ``#  ",
-"  ````#   ``#   ",
-"    ```# `#     ",
-"     `````#     ",
-"      ```#      ",
-"     `````#     ",
-"    ```# ``#    ",
-"   ```#   ``#   ",
-"  ```#     `#   ",
-"  ```#      `#  ",
-"   `#        `# ",
-"                ",
-"                "
-};
-
-static const char* insert_icon[] = {
-"16 16 5 1",
-"` c #000000",
-". c #ffff00",
-"# c #9d9da1",
-"  c none",
-"b c #ffffff",
-"                ",
-"                ",
-" #  #b #.       ",
-"  # #.#.` ` `   ",
-"  .#.b####   `  ",
-" ### ..         ",
-"  . # .#     `  ",
-" #` #.          ",
-"    #        `  ",
-"  `             ",
-"             `  ",
-"  `             ",
-"             `  ",
-"  ` ` ` ` ` `   ",
-"                ",
-"                "
-};
-
-static const char* movedown_icon[] = {
-"16 16 2 1",
-"` c #000000",
-"  c none",
-"                ",
-"                ",
-"         ```    ",
-"        ```     ",
-"       ```      ",
-"       ```      ",
-"       ```      ",
-"       ```      ",
-"   ```````````  ",
-"    `````````   ",
-"     ```````    ",
-"      `````     ",
-"       ```      ",
-"        `       ",
-"                ",
-"                "
-};
-
-static const char* moveup_icon[] = {
-"16 16 2 1",
-"` c #000000",
-"  c none",
-"                ",
-"                ",
-"        `       ",
-"       ```      ",
-"      `````     ",
-"     ```````    ",
-"    `````````   ",
-"   ```````````  ",
-"       ```      ",
-"       ```      ",
-"       ```      ",
-"       ```      ",
-"      ```       ",
-"     ```        ",
-"                ",
-"                "
-};
-
-/*!
-  Constructor
-*/
-QtxDirListEditor::QtxDirListEditor( QWidget* parent )
-: QWidget( parent )
-{
-  myEdited       = false;
-  myLastSelected = 0;
-  myEdit         = 0; 
-  myBtn          = 0;
-
-  QGridLayout* topLayout = new QGridLayout(this);
-  topLayout->setMargin(0);
-  topLayout->setSpacing(0);
-  
-  setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
-  
-  myDirList = new QListBox(this);
-  myDirList->setSelectionMode(QListBox::Single);
-  myDirList->setHScrollBarMode(QListBox::AlwaysOff);
-  myDirList->horizontalScrollBar()->installEventFilter(this);
-  myDirList->verticalScrollBar()->installEventFilter(this);
-  myDirList->insertItem(tr("<empty>"));
-  myDirList->installEventFilter(this);
-
-  QHBoxLayout* ctrlLayout = new QHBoxLayout;
-  ctrlLayout->setMargin(0);
-  ctrlLayout->setSpacing(0);
-
-  // QLabel* lab = new QLabel(myDirList, tr("DIRECTORIES_LBL"), this);
-
-  QToolButton* insertBtn = new QToolButton(this);
-  insertBtn->setIconSet(QPixmap( insert_icon ));
-  insertBtn->setAutoRaise(true);
-
-  QToolButton* deleteBtn = new QToolButton(this);
-  deleteBtn->setIconSet(QPixmap( delete_icon ));
-  deleteBtn->setAutoRaise(true);
-
-  QToolButton* upBtn = new QToolButton(this);
-  upBtn->setIconSet(QPixmap( moveup_icon ));
-  upBtn->setAutoRaise(true);
-
-  QToolButton* downBtn = new QToolButton(this);
-  downBtn->setIconSet(QPixmap( movedown_icon ));
-  downBtn->setAutoRaise(true);
-  
-  // ctrlLayout->addWidget(lab);
-  ctrlLayout->addItem(new QSpacerItem(SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum));
-  ctrlLayout->addWidget(insertBtn);
-  ctrlLayout->addWidget(deleteBtn);
-  ctrlLayout->addWidget(upBtn);
-  ctrlLayout->addWidget(downBtn);
-
-  QHBoxLayout* btnLayout = new QHBoxLayout;
-  btnLayout->setMargin(0);
-  btnLayout->setSpacing(6);
-  
-  topLayout->addLayout(ctrlLayout, 0, 0);
-  topLayout->addWidget(myDirList,  1, 0);
-  topLayout->addLayout(btnLayout,  2, 0);
-
-  connect(myDirList, SIGNAL(mouseButtonClicked(int, QListBoxItem*, const QPoint&)), 
-          this, SLOT(onMouseButtonClicked(int, QListBoxItem*, const QPoint&)));
-  connect(myDirList, SIGNAL(doubleClicked(QListBoxItem*)), 
-          this, SLOT(onDblClicked(QListBoxItem*)));
-  
-  connect(insertBtn, SIGNAL(clicked()), this, SLOT(onInsert()));
-  connect(deleteBtn, SIGNAL(clicked()), this, SLOT(onDelete()));
-  connect(upBtn,     SIGNAL(clicked()), this, SLOT(onUp()));
-  connect(downBtn,   SIGNAL(clicked()), this, SLOT(onDown()));
-}
-
-/*!
-  Destructor
-*/
-QtxDirListEditor::~QtxDirListEditor()
-{
-}
-
-/*!
-  Gets list of paths
-*/
-void QtxDirListEditor::getPathList(QStringList& list)
-{
-  // Finish the path editing
-  if (myEdit) {
-    validate(true);
-    
-    myEdit->deleteLater();
-    myBtn->deleteLater();
-    myEdit = 0;
-    myBtn  = 0;
-    myEdited = false;
-    myDirList->setFocus();
-  }
-
-  list.clear();
-  for (unsigned i = 0; i < myDirList->count()-1; i++)
-    list.append(myDirList->text(i));
-}
-
-/*!
-  Sets list of paths
-*/
-void QtxDirListEditor::setPathList(const QStringList& list) {
-  myDirList->clear();
-  myDirList->insertItem(tr("<empty>"));
-  for (unsigned i = 0; i < list.count(); i++)
-    myDirList->insertItem(list[i], myDirList->count()-1);
-}
-
-/*!
-  Validates entered path, returns true if OK
-*/
-bool QtxDirListEditor::validate( const bool quietMode )
-{
-  if ( myEdited )
-  {
-    QString dirPath = QFileInfo( myEdit->text().stripWhiteSpace() ).filePath();
-/*
-#ifndef WNT
-    if ( dirPath.startsWith( "~") ) {
-      dirPath = dirPath.remove(0,1);
-      QString user;
-      int slashPos = dirPath.find("/");
-      if ( slashPos >= 0 ) {
-       user = dirPath.left(slashPos);
-       dirPath = dirPath.mid(slashPos);
-      }
-      else {
-       user = dirPath;
-       dirPath = "";
-      }
-      if ( user.isEmpty() )
-       user = getenv( "USER" );
-
-      struct passwd* user_data = getpwnam( user.latin1() );
-      if ( user_data == NULL ) {
-       // unknown user or something another error
-       QMessageBox::critical(this, 
-                             tr("Error"),
-                             tr("Unknown user %1").arg(user), 
-                             tr("Ok"));
-       myEdit->setFocus();
-        return false;
-      }
-      dirPath = user_data->pw_dir + dirPath;
-    }
-#endif
-*/
-    QDir dir(dirPath);
-    QListBoxItem* found = 0;
-    for (unsigned i = 0; i < myDirList->count()-1; i++) {
-      QDir aDir(myDirList->text(i));
-      if ( aDir.canonicalPath().isNull() && myDirList->text(i) == dir.absPath() ||
-          !aDir.canonicalPath().isNull() && aDir.exists() && aDir.canonicalPath() == dir.canonicalPath()) {
-          found = myDirList->item(i);
-        break;
-      }
-    }
-    if (dirPath.isEmpty()) {
-      if (found) {
-        // it should be last (empty) item in the list - nothing to do
-        return true;
-      }
-      else {
-        // delete directory from the list
-        removeDir(myLastSelected);
-        return true;
-      }
-    }
-    else {
-      if (found) {
-        if (found != myLastSelected) {
-          // it is forbidden to add directory more then once
-         if ( !quietMode )
-           QMessageBox::critical(this, 
-                                 tr("Error"),
-                                 tr("Directory already specified."), 
-                                 tr("Ok"));
-         myEdit->setFocus();
-          return false;
-        }
-      }
-      else {
-        if (!dir.exists()) {
-         if ( !quietMode && QMessageBox::information(this, 
-                                                     tr("Warning"),
-                                                     tr("%1\n\nThe directory doesn't exist.\nAdd directory anyway?").arg(dir.absPath()),
-                                                     tr("Yes"), tr("No"), QString::null, 1, 1) == 1) {
-           myEdit->setFocus();
-            return false;
-         }
-        }
-        // append
-        appendDir(myLastSelected, dir.absPath());
-      }
-    }
-  }
-  return true;
-}
-
-/*!
-  Appends/changes directory
-*/
-void QtxDirListEditor::appendDir(QListBoxItem* item, const QString& dir) {
-  int index = myDirList->index(item);
-  if (index >= 0 && index < (int)myDirList->count()) {
-    if (index == (int)myDirList->count()-1) {
-      // it is the last item (new), well, insert it before the last (empty)
-      myDirList->insertItem(dir, myDirList->count()-1);
-    }
-    else {
-      // change item
-      myDirList->changeItem(dir, index);
-    }
-  }
-}
-
-/*!
-  Removes directory from list
-*/
-void QtxDirListEditor::removeDir(QListBoxItem* item) {
-  // do not remove last item (empty)
-  int index = myDirList->index(item);
-  if (index >= 0 && index < (int)myDirList->count()-1) {
-    delete item;
-    myLastSelected = myDirList->item(index);
-    myDirList->setSelected(myLastSelected, true);
-  }
-}
-
-/*!
-  Resize event
-*/
-void QtxDirListEditor::resizeEvent(QResizeEvent* event) {
-  QWidget::resizeEvent(event);
-  if ( myEdited ) {
-    myEdit->resize(myDirList->viewport()->width()-myBtn->sizeHint().width(), myEdit->height());
-    myBtn->move(myEdit->width(), myEdit->y());
-  }
-}
-
-/*!
-  Called when user clicks inside directories list box
-*/
-void QtxDirListEditor::onMouseButtonClicked(int           button, 
-                                           QListBoxItem* item, 
-                                           const QPoint& point) {
-  if (myEdited) {
-    if (!validate()) {
-      myDirList->setCurrentItem(myLastSelected);
-      myDirList->setSelected(myLastSelected, true);
-      return;
-    }
-    delete myEdit;
-    delete myBtn;
-    myEdit = 0;
-    myBtn  = 0;
-    myEdited = false;
-    myDirList->setFocus();
-  }
-  if (item) {
-    myDirList->setCurrentItem(item);
-    myDirList->setSelected(item, true);
-    myDirList->ensureCurrentVisible();
-    qApp->processEvents();
-    if (button == LeftButton && myLastSelected == item) {
-      QRect ir = myDirList->itemRect(myLastSelected);
-      
-      myEdit = new QLineEdit(myDirList->viewport());
-      myBtn  = new QToolButton(myDirList->viewport());
-      myBtn->setText(" ... ");
-      connect(myBtn, SIGNAL(clicked()), this, SLOT(onBtnClicked()));
-      myEdit->setGeometry(0, 
-                          ir.top()-(myEdit->sizeHint().height()-ir.height())/2, 
-                          myDirList->viewport()->width()-myBtn->sizeHint().width(), 
-                          myEdit->sizeHint().height());
-      myBtn->setGeometry (myEdit->width(), 
-                          ir.top()-(myEdit->sizeHint().height()-ir.height())/2, 
-                          myBtn->sizeHint().width(),
-                          myEdit->sizeHint().height());
-      connect(myEdit, SIGNAL(returnPressed()), this, SLOT(onEditFinished()));
-      myEdited = true;
-      myEdit->show();
-      myBtn->show();
-      if (myDirList->index(myLastSelected) != (int)myDirList->count()-1)
-        myEdit->setText(myLastSelected->text());
-      myEdit->selectAll();
-      myEdit->setCursorPosition(myEdit->text().length());
-      myEdit->installEventFilter(this);
-      myEdit->setFocus();
-    }
-  }
-  else {
-    myDirList->clearSelection();
-  }
-  myLastSelected = item;
-}
-
-/*!
-  Called when user double-clicks on any item
-*/
-void QtxDirListEditor::onDblClicked(QListBoxItem* item) {
-  onMouseButtonClicked(LeftButton, item, QPoint(0,0));
-}
-
-/*!
-  <...> (Browse dir) button slot
-*/
-void QtxDirListEditor::onBtnClicked() {
-  QString dir = myEdit->text().stripWhiteSpace().isEmpty() ? 
-                QString::null : 
-                myEdit->text().stripWhiteSpace();
-
-  dir = QFileDialog::getExistingDirectory(dir, this, 0, tr("Select directory"), true);
-
-  if (!dir.isEmpty()) {
-    myEdit->setText(dir);
-    myEdit->selectAll();
-    myEdit->setCursorPosition(myEdit->text().length());
-  }
-}
-
-/*!
-  Called when user finises editing of path by pressing <Enter>
-*/
-void QtxDirListEditor::onEditFinished() {
-  if (myEdit) {
-    if (!validate()) {
-      myDirList->setCurrentItem(myLastSelected);
-      myDirList->setSelected(myLastSelected, true);
-      return;
-    }
-    myEdit->deleteLater();
-    myBtn->deleteLater();
-    myEdit = 0;
-    myBtn  = 0;
-    myEdited = false;
-    myDirList->setFocus();
-  }
-}
-
-/*!
-  Event filter
-*/
-bool QtxDirListEditor::eventFilter(QObject* object, QEvent* event) {
-  if ( myEdited ) {
-    if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonDblClick) {
-      if (object == myDirList->horizontalScrollBar() || object == myDirList->verticalScrollBar()) {
-       if (!validate()) {
-         myDirList->setCurrentItem(myLastSelected);
-         myDirList->setSelected(myLastSelected, true);
-         return true;
-       }
-       delete myEdit;
-       delete myBtn;
-       myEdit = 0;
-       myBtn  = 0;
-       myEdited = false;
-       myDirList->setFocus();
-      }
-    }
-    else if (event->type() == QEvent::KeyPress) {
-      QKeyEvent* ke = (QKeyEvent*)event;
-      if (ke->key() == Key_Tab)
-       return true;
-      if (object == myDirList) {
-       return true;
-      }
-      else if (object == myEdit) {
-        if ( ke->key() == Key_Up || ke->key() == Key_Down || ke->key() == Key_PageUp || ke->key() == Key_PageDown ||
-            ( ke->key() == Key_Home  || ke->key() == Key_End  || ke->key() == Key_Prior || ke->key() == Key_Next ) && 
-                 (ke->state() & ControlButton) ) {
-          return true;
-       }
-       else if ( ke->key() == Key_Escape ) {
-         delete myEdit;
-         delete myBtn;
-         myEdit = 0;
-         myBtn  = 0;
-         myEdited = false;
-         myDirList->setFocus();
-         return true;
-       }
-      }
-    }
-  }
-  return QWidget::eventFilter(object, event);
-}
-
-/*!
-  <Insert> button slot
-*/
-void QtxDirListEditor::onInsert() {
-  if (!myEdited) {
-    myLastSelected = 0;
-    onMouseButtonClicked(LeftButton, myDirList->item(myDirList->count()-1), QPoint(0,0));
-    onMouseButtonClicked(LeftButton, myDirList->item(myDirList->count()-1), QPoint(0,0));
-  }
-}
-
-/*!
-  <Delete> button slot
-*/
-void QtxDirListEditor::onDelete() {
-  if (!myEdited && myDirList->currentItem() >=0) {
-    removeDir(myDirList->item(myDirList->currentItem()));
-    myDirList->setFocus();
-  }
-}
-
-/*!
-  <Move up> button slot
-*/
-void QtxDirListEditor::onUp() {
-  if (!myEdited && myLastSelected) {
-    int index = myDirList->currentItem();
-    if (index > 0 && index < (int)myDirList->count()-1 && myDirList->isSelected(index)) {
-      QString t = myDirList->text(index-1);
-      myDirList->changeItem(myDirList->text(index), index-1);
-      myDirList->changeItem(t, index);
-      myDirList->setCurrentItem(index-1);
-      myLastSelected = myDirList->item(index-1);
-      myDirList->setSelected(myLastSelected, true);
-      myDirList->setFocus();
-    }
-  }
-}
-
-/*!
-  <Move down> button slot
-*/
-void QtxDirListEditor::onDown() {
-  if (!myEdited && myLastSelected) {
-    int index = myDirList->currentItem();
-    if (index >= 0 && index < (int)myDirList->count()-2 && myDirList->isSelected(index)) {
-      QString t = myDirList->text(index+1);
-      myDirList->changeItem(myDirList->text(index), index+1);
-      myDirList->changeItem(t, index);
-      myDirList->setCurrentItem(index+1);
-      myLastSelected = myDirList->item(index+1);
-      myDirList->setSelected(myLastSelected, true);
-      myDirList->setFocus();
-    }
-  }
-}
diff --git a/src/Qtx/QtxDirListEditor.h b/src/Qtx/QtxDirListEditor.h
deleted file mode 100644 (file)
index 38d62de..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef QTX_DIRLISTEDITOR_H
-#define QTX_DIRLISTEDITOR_H
-
-#include "Qtx.h"
-
-#include <qwidget.h>
-#include <qtoolbutton.h>
-#include <qlineedit.h>
-#include <qlistbox.h>
-#include <qcombobox.h>
-
-#ifdef WIN32
-#pragma warning( disable:4251 )
-#endif
-
-/*!
- * \brief The GUI implementation of the directory list
- */
-class QTX_EXPORT QtxDirListEditor : public QWidget {
-
-  Q_OBJECT
-
-public:
-
-  /*!
-   * \brief Constructor
-   * \param parent - the parent of the widget
-   */
-  QtxDirListEditor(QWidget* parent);
-
-  /*!
-   * \brief Destructor
-   */
-  ~QtxDirListEditor();
-
-  /*!
-   * \brief Gets list of paths
-   * \param list - the returned reference to the list of paths
-   */
-  void          getPathList(QStringList& list);
-
-  /*!
-   * \brief Sets list of paths
-   * \param list - the list of paths to set
-   */
-  void          setPathList(const QStringList& list);
-
-  /*!
-   * \brief Event filter, redefined from QObject class
-   */
-  bool          eventFilter(QObject* object, QEvent* event);
-
-protected:
-
-  /*!
-   * \brief Validates entered path
-   * \retval bool - returns status (true if OK)
-   */
-  bool          validate( const bool quietMode = false );
-
-  /*!
-   * \brief Appends/changes path
-   * \param item - the item in QListBox
-   * \param dir - the path
-   */
-  void          appendDir(QListBoxItem* item, const QString& dir);
-
-  /*!
-   * \brief Removes directory from list
-   * \param item - the item in QListBox
-   */
-  void          removeDir(QListBoxItem* item);
-
-  /*!
-   * \brief Resize event handler, reimplemented from QWidget
-   * \param event - the resize event
-   */
-  void          resizeEvent(QResizeEvent* event);
-
-protected slots:
-
-  /*!
-   * \brief Called when user clicks inside directories list box
-   */
-  void          onMouseButtonClicked(int, QListBoxItem*, const QPoint&);
-
-  /*!
-   * \brief Called when user double-clicks on any item
-   */
-  void          onDblClicked(QListBoxItem*);
-
-  /*!
-   * \brief <...> (Browse dir) button slot
-   */
-  void          onBtnClicked();
-
-  /*!
-   * \brief Ccalled when user finises editing of path by pressing <Enter>
-   */
-  void          onEditFinished();
-
-  /*!
-   * \brief <Insert> button slot
-   */
-  void          onInsert();
-
-  /*!
-   * \brief  <Delete> button slot
-   */
-  void          onDelete();
-
-  /*!
-   * \brief  <Move up> button slot
-   */
-  void          onUp();
-
-  /*!
-   * \brief  <Move down> button slot
-   */
-  void          onDown();
-
-private:
-  QListBox*     myDirList;          //!< directory list
-  QLineEdit*    myEdit;             //!< path edit box
-  QToolButton*  myBtn;              //!<  browse pah button
-  bool          myEdited;           //!<  edit mode flag
-  QListBoxItem* myLastSelected;     //!< last selected row
-
-};
-
-#endif
index 1b25e280a0a5253a15d1e56445fd8e982611f58c..caba437b64980f2fcf94bf3b22abd5876b1bed48 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxDockAction.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxDockAction.h"
 
-#include "QtxResourceMgr.h"
-
-#include <qevent.h>
-#include <qtoolbar.h>
-#include <qdockarea.h>
-#include <qdockwindow.h>
-#include <qmainwindow.h>
-#include <qobjectlist.h>
-#include <qapplication.h>
-
-/*!
-       Name: QtxDockAction [public]
-       Desc: Constructs an Dock action with given main window and name.
-*/
-
-QtxDockAction::QtxDockAction( QMainWindow* mw, const char* name )
-: QtxAction( "Windows and Toolbars", "Windows and Toolbars", 0, mw, name ),
-myMain( mw ),
-myAutoAdd( true ),
-mySeparate( true ),
-myAutoPlace( false )
-{
-  initialize( mw );
-}
-
-/*!
-       Name: QtxDockAction [public]
-       Desc: This constructor creates an action with the following properties: the
-                   description text, the menu text and. It is a child of given main window
-        and named specified name.
-*/
-
-QtxDockAction::QtxDockAction( const QString& text, const QString& menuText, QMainWindow* mw, const char* name )
-: QtxAction( text, menuText, 0, mw, name ),
-myMain( mw ),
-myAutoAdd( true ),
-mySeparate( true ),
-myAutoPlace( false )
-{
-  initialize( mw );
-}
-
-/*!
-       Name: QtxDockAction [public]
-       Desc: This constructor creates an action with the following properties: the
-                   description text, the menu text, the icon or iconset icon and keyboard
-        accelerator. It is a child of given main window and named specified name.
-*/
-
-QtxDockAction::QtxDockAction( const QString& text, const QIconSet& icon, const QString& menuText, QMainWindow* mw, const char* name )
-: QtxAction( text, icon, menuText, 0, mw, name ),
-myMain( mw ),
-myAutoAdd( true ),
-mySeparate( true ),
-myAutoPlace( false )
-{
-  initialize( mw );
-}
-
-/*!
-       Name: ~QtxDockAction [public]
-       Desc: Removes all added popup items.
-*/
-
-QtxDockAction::~QtxDockAction()
-{
-  for ( MenuMap::ConstIterator mIt = myMenu.begin(); mIt != myMenu.end(); ++mIt )
-    removeFrom( mIt.key() );
-
-  for ( InfoMap::ConstIterator iIt = myInfo.begin(); iIt != myInfo.end(); ++iIt )
-    delete iIt.data().a;
-}
-
-/*!
-       Name: mainWindow [public]
-       Desc: Returns the main window which contains managed dock windows.
-*/
-
-QMainWindow* QtxDockAction::mainWindow() const
-{
-  return myMain;
-}
-
-/*!
-       Name: isAutoAdd [public]
-       Desc: Returns the auto add property. If this property is setted then all newly
-        appeared dock windows will be automatically added.
-*/
-
-bool QtxDockAction::isAutoAdd() const
-{
-  return myAutoAdd;
-}
-
-/*!
-       Name: setAutoAdd [public]
-       Desc: Sets the auto add property. If this property is setted then all newly
-        appeared dock windows will be automatically added.
-*/
-
-void QtxDockAction::setAutoAdd( const bool on )
-{
-  myAutoAdd = on;
-}
-
-/*!
-       Name: isAutoPlace [public]
-       Desc: Returns the auto place property. If this property is setted then all newly
-        added dock windows will be automatically placed according stored place information.
-*/
-
-bool QtxDockAction::isAutoPlace() const
-{
-  return myAutoPlace;
-}
-
-/*!
-       Name: setAutoPlace [public]
-       Desc: Sets the auto place property. If this property is setted then all newly
-        added dock windows will be automatically placed according stored place
-        information.
-*/
-
-void QtxDockAction::setAutoPlace( const bool on )
-{
-  myAutoPlace = on;
-}
+#include <QMenu>
+#include <QToolBar>
+#include <QDockWidget>
+#include <QMainWindow>
 
 /*!
-       Name: isSeparate [public]
-       Desc: Returns the 'separate' property.
-*/
+  \class QtxDockAction
+  \brief Dockable windows & toolbars list action.
 
-bool QtxDockAction::isSeparate() const
-{
-  return mySeparate;
-}
-
-/*!
-       Name: setSeparate [public]
-       Desc: Sets the 'separate' property. If this property is 'true' then toolbars and
-        dock windows menu items will be placed in different popup menus  otherwise
-        their will  be placed  in  one  common  popup  menu. This property will be
-        affected in next method 'addTo'.
+  Implements the action which provides the popup menu with the list
+  of toolbars and/or dockable windows list owned by the main window.
+  This action can be used, for example, in the menu "Windows".
 */
 
-void QtxDockAction::setSeparate( const bool on )
-{
-  if ( mySeparate == on )
-    return;
-
-  mySeparate = on;
-  updateMenus();
-}
-
 /*!
-       Name: addTo [public]
-       Desc: Add the dock windows sub menu item to the end of specified popup.
+  \brief Constructor.
+  \param mw parent main window
 */
-
-bool QtxDockAction::addTo( QWidget* wid )
+QtxDockAction::QtxDockAction( QMainWindow* mw )
+: QtxAction( "Windows and Toolbars", "Windows and Toolbars", 0, mw ),
+  myType( Both ),
+  myMain( mw )
 {
-  return addTo( wid, -1 );
+  initialize();
 }
 
 /*!
-       Name: addTo [public]
-       Desc: Add the dock windows sub menu item to specified popup at the given index.
+  \brief Constructor.
+  \param text description (tooltip) text
+  \param menuText menu text
+  \param mw parent main window
 */
-
-bool QtxDockAction::addTo( QWidget* wid, const int idx )
+QtxDockAction::QtxDockAction( const QString& text, const QString& menuText, QMainWindow* mw )
+: QtxAction( text, menuText, 0, mw ),
+  myType( Both ),
+  myMain( mw )
 {
-  if ( !wid || !wid->inherits( "QPopupMenu" ) )
-    return false;
-
-  QPopupMenu* pm = (QPopupMenu*)wid;
-  checkPopup( pm );
-
-  if ( myMenu.contains( pm ) )
-    return false;
-
-  MenuInfo mInfo;
-  mInfo.dock = new QPopupMenu( pm );
-  mInfo.tool = isSeparate() ? new QPopupMenu( pm ) : 0;
-
-  QString dock, tool;
-  splitMenuText( dock, tool );
-
-  myMenu.insert( pm, mInfo );
-
-  int index = idx;
-
-  if ( mInfo.dock )
-    iconSet().isNull() ? pm->insertItem ( dock, mInfo.dock, -1, index ) :
-                         pm->insertItem ( iconSet(), dock, mInfo.dock, -1, index );
-
-  if ( index >= 0 )
-    index++;
-
-  if ( mInfo.tool )
-    iconSet().isNull() ? pm->insertItem ( tool, mInfo.tool, -1, index ) :
-                         pm->insertItem ( iconSet(), tool, mInfo.tool, -1, index );
-
-  connect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
-  connect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onPopupDestroyed( QObject* ) ) );
-
-  return true;
+  initialize();
 }
 
 /*!
-       Name: removeFrom [public]
-       Desc: Removes dock window sub menu from specified popup.
+  \brief Constructor.
+  \param text description (tooltip) text
+  \param icon action icon
+  \param menuText menu text
+  \param mw parent main window
 */
-
-bool QtxDockAction::removeFrom( QWidget* wid )
+QtxDockAction::QtxDockAction( const QString& text, const QIcon& icon, const QString& menuText, QMainWindow* mw )
+: QtxAction( text, icon, menuText, 0, mw ),
+  myType( Both ),
+  myMain( mw )
 {
-  QPopupMenu* pm = (QPopupMenu*)wid;
-
-  if ( myMenu.contains( pm ) )
-  {
-    pm->removeItem( findId( pm, myMenu[pm].dock ) );
-    pm->removeItem( findId( pm, myMenu[pm].tool ) );
-
-    delete myMenu[pm].dock;
-    delete myMenu[pm].tool;
-    myMenu.remove( pm );
-
-    disconnect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
-    disconnect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onPopupDestroyed( QObject* ) ) );
-  }
-
-  return QtxAction::removeFrom( wid );
+  initialize();
 }
 
 /*!
-  Sets menu text of action
-  \param txt - new menu text
+  \brief Desctructor
+  
+  Does nothing currently.
 */
-void QtxDockAction::setMenuText( const QString& txt )
-{
-  if ( menuText() == txt )
-    return;
-
-  QtxAction::setMenuText( txt );
-  updateMenus();
-}
-
-/*!
-       Name: addDockWindow [public]
-       Desc: Add dock window to internal data structures. Action will be include all added
-        dock windows in to menu and manage their place configuration.
-*/
-
-bool QtxDockAction::addDockWindow( QDockWindow* dw )
-{
-  if ( !dw || !mainWindow() )
-    return false;
-
-  if ( myInfo.contains( dw ) )
-    return false;
-
-  myInfo.insert( dw, DockInfo() );
-
-  DockInfo& inf = myInfo[dw];
-  inf.name = windowName( dw );
-  QAction* a = inf.a = new QAction( mainWindow(), 0, true );
-
-  autoLoadPlaceInfo( dw );
-
-  bool block = a->signalsBlocked();
-  a->blockSignals( true );
-  a->setOn( dw->isVisibleTo( mainWindow() ) );
-  a->blockSignals( block );
-
-  updateInfo( dw );
-  savePlaceInfo( dw );
-
-  dw->installEventFilter( this );
-
-  connect( a, SIGNAL( toggled( bool ) ), this, SLOT( onToggled( bool ) ) );
-  connect( dw, SIGNAL( destroyed( QObject* ) ), this, SLOT( onWindowDestroyed( QObject* ) ) );
-  connect( dw, SIGNAL( visibilityChanged( bool ) ), this, SLOT( onVisibilityChanged( bool ) ) );
-
-  return true;
-}
-
-/*!
-       Name: removeDockWindow [public]
-       Desc: Remove dock window from internal data structures. Action will not manage this window.
-*/
-
-bool QtxDockAction::removeDockWindow( QDockWindow* dw )
-{
-  if ( !myInfo.contains( dw ) )
-    return false;
-
-  myGeom.remove( myInfo[dw].name );
-
-  delete myInfo[dw].a;
-  myInfo.remove( dw );
-
-  dw->removeEventFilter( this );
-
-  disconnect( dw, SIGNAL( destroyed( QObject* ) ), this, SLOT( onWindowDestroyed( QObject* ) ) );
-  disconnect( dw, SIGNAL( visibilityChanged( bool ) ), this, SLOT( onVisibilityChanged( bool ) ) );
-
-  return true;
-}
-
-/*!
-       Name: eventFilter [public]
-       Desc: Event filter process caption and icon changing of managed dock windows
-        and try to add newly appeared dock windows.
-*/
-
-bool QtxDockAction::eventFilter( QObject* o, QEvent* e )
-{
-  if ( o->inherits( "QDockWindow" ) && ( e->type() == QEvent::CaptionChange ||
-                                         e->type() == QEvent::IconChange ) )
-    updateInfo( (QDockWindow*)o );
-
-  if ( o->inherits( "QDockArea" ) && e->type() == QEvent::ChildRemoved )
-  {
-    QChildEvent* ce = (QChildEvent*)e;
-    if ( ce->child() && ce->child()->inherits( "QDockWindow" ) )
-      savePlaceInfo( (QDockWindow*)ce->child() );
-  }
-
-  if ( o->inherits( "QDockArea" ) && e->type() == QEvent::ChildInserted )
-  {
-    QChildEvent* ce = (QChildEvent*)e;
-    if ( ce->child() && ce->child()->inherits( "QDockWindow" ) )
-      QApplication::postEvent( this, new QCustomEvent( (QEvent::Type)AutoAdd, ce->child() ) );
-  }
-
-  return false;
-}
-
-/*!
-       Name: restoreGeometry [public]
-       Desc: Retrieve the dock window geometry. If dock window specified as 0
-        then all windows geometry will be restored.
-*/
-
-void QtxDockAction::restoreGeometry( QDockWindow* dw ) const
+QtxDockAction::~QtxDockAction()
 {
-  if ( !dw )
-    loadPlaceInfo();
-  else
-    loadPlaceInfo( dw );
 }
 
 /*!
-       Name: storeGeometry [public]
-       Desc: Store the dock window geometry. If dock window specified as 0
-        then all windows geometry will be stored.
+  \brief Get parent main window.
+  \return main window pointer.
 */
-
-void QtxDockAction::storeGeometry( QDockWindow* dw )
+QMainWindow* QtxDockAction::mainWindow() const
 {
-  QPtrList<QDockWindow> dwList;
-
-  if ( dw )
-    dwList.append( dw );
-  else
-    dockWindows( dwList );
-
-  for ( QPtrListIterator<QDockWindow> it( dwList ); it.current(); ++it )
-    savePlaceInfo( it.current() );
+  return myMain;
 }
 
 /*!
-       Name: loadGeometry [public]
-       Desc: Retrieve the dock windows geometry information from the specified resource manager section.
+  \brief Get dock action type.
+  \return dock type (QtxDockAction::DockType)
 */
-
-void QtxDockAction::loadGeometry( QtxResourceMgr* resMgr, const QString& section, const bool clear )
+int QtxDockAction::dockType() const
 {
-  QString sec = section.stripWhiteSpace();
-  if ( !resMgr || sec.isEmpty() )
-    return;
-
-  myNames = QStringList::split( "|", resMgr->stringValue( sec, "windows_list", QString::null ) );
-
-  QMap<QString, int> map;
-  QStringList params = resMgr->parameters( sec );
-  for ( QStringList::const_iterator it = params.begin(); it != params.end(); ++it )
-  {
-    QString p = QStringList::split( ".", *it, true ).first().stripWhiteSpace();
-    if ( !p.isEmpty() )
-      map.insert( p, 0 );
-  }
-
-  for ( QMap<QString, int>::ConstIterator itr = map.begin(); itr != map.end(); ++itr )
-  {
-    GeomInfo inf;
-    if ( !clear && myGeom.contains( itr.key() ) )
-      inf = myGeom[itr.key()];
-    else
-    {
-      inf.vis = true; inf.newLine = false; inf.place = DockTop;
-      inf.index = 0; inf.offset = 0;
-      inf.x = 0; inf.y = 0; inf.w = 0; inf.h = 0;
-      inf.fixW = -1; inf.fixH = -1;
-    }
-    if ( loadGeometry( resMgr, sec, itr.key(), inf ) )
-      myGeom.insert( itr.key(), inf );
-  }
+  return myType;
 }
 
 /*!
-       Name: saveGeometry [public]
-       Desc: Store the dock windows geometry information into the specified resource manager section.
+  \brief Set dock action type.
+  \param type dock type (QtxDockAction::DockType)
 */
-
-void QtxDockAction::saveGeometry( QtxResourceMgr* resMgr, const QString& section, const bool clear ) const
+void QtxDockAction::setDockType( const int type )
 {
-  QString sec = section.stripWhiteSpace();
-  if ( !resMgr || sec.isEmpty() )
-    return;
-
-  QtxDockAction* that = (QtxDockAction*)this;
-  that->storeGeometry();
-
-  that->myNames.clear();
-  collectNames( Minimized, that->myNames );
-  for ( int i = DockTornOff; i < Minimized; i++ )
-    collectNames( i, that->myNames );
-
-  if ( clear )
-    resMgr->remove( sec );
-
-  resMgr->setValue( sec, "windows_list", myNames.join( "|" ) );
-
-  for ( GeomMap::ConstIterator it = myGeom.begin(); it != myGeom.end(); ++it )
-    saveGeometry( resMgr, sec, it.key(), it.data() );
+  myType = type;
 }
 
 /*!
-       Name: onAboutToShow [private slots]
-       Desc: Prepare sub popup with dock windows list when parent popup is shown.
+  \brief Prepare popup menu with dock windows list when 
+         parent popup menu is shown.
 */
-
 void QtxDockAction::onAboutToShow()
 {
-  const QObject* obj = sender();
-  if ( obj && obj->inherits( "QPopupMenu" ) )
-  {
-    QPopupMenu* pm = (QPopupMenu*)obj;
-    fillPopup( pm );
-    pm->setItemEnabled( findId( pm, myMenu[pm].dock ), isEnabled() && myMenu[pm].dock && myMenu[pm].dock->count() );
-    pm->setItemEnabled( findId( pm, myMenu[pm].tool ), isEnabled() && myMenu[pm].tool && myMenu[pm].tool->count() );
-  }
-}
-
-/*!
-       Name: onToggled [private slots]
-       Desc: Show or hide dock window when user toggled window item in popup.
-*/
-
-void QtxDockAction::onToggled( bool on )
-{
-  QDockWindow* dw = dockWindow( (QAction*)sender() );
-  if ( dw )
-    on ? dw->show() : dw->hide();
+  updateMenu();
+  setVisible( menu() && !menu()->isEmpty() );
 }
 
 /*!
-       Name: onPopupDestroyed [private slots]
-       Desc: Remove destroyed popup from data structures.
+  \brief Get all toolbars owned by parent main window.
+  \param lst returned list of all toolbars owned by main window
 */
-
-void QtxDockAction::onPopupDestroyed( QObject* obj )
+void QtxDockAction::toolBars( QList<QToolBar*>& lst ) const
 {
-  myMenu.remove( (QPopupMenu*)obj );
-}
-
-/*!
-       Name: onWindowDestroyed [private slots]
-       Desc: Remove information about destroyed dock window.
-*/
-
-void QtxDockAction::onWindowDestroyed( QObject* obj )
-{
-  QDockWindow* dw = (QDockWindow*)obj;
-  if ( !myInfo.contains( dw ) )
-    return;
-
-  delete myInfo[dw].a;
-  myInfo.remove( dw );
-}
-
-/*!
-       Name: onVisibilityChanged [private slots]
-       Desc: Toggle corresponded action when visibility state of dock window changed.
-*/
-
-void QtxDockAction::onVisibilityChanged( bool on )
-{
-  const QObject* obj = sender();
-  if ( !obj || !obj->inherits( "QDockWindow" ) )
-    return;
-
-  QDockWindow* dw = (QDockWindow*)obj;
-
-  QAction* a = action( dw );
-  if ( a && a->isOn() != on )
-  {
-    bool block = a->signalsBlocked();
-    a->blockSignals( true );
-    a->setOn( on );
-    a->blockSignals( block );
-  }
-
-  savePlaceInfo( dw );
-}
-
-/*!
-       Name: onDockWindowPositionChanged [private slots]
-       Desc: Update dock window place information
-*/
-
-void QtxDockAction::onDockWindowPositionChanged( QDockWindow* dw )
-{
-  savePlaceInfo( dw );
-}
-
-/*!
-       Name: event [protected]
-       Desc: Check consistency the popup content and internal datas.
-        Synchronize internal data structures with popup content.
-*/
-
-bool QtxDockAction::event( QEvent* e )
-{
-  if ( e->type() == (int)AutoAdd )
-  {
-    QCustomEvent* ce = (QCustomEvent*)e;
-    QDockWindow* dw = (QDockWindow*)ce->data();
-    if ( !myInfo.contains( dw ) )
-    {
-      autoAddDockWindow( dw );
-      autoLoadPlaceInfo( dw );
-    }
-  }
-
-  return QtxAction::event( e );
-}
-
-/*!
-       Name: checkPopup [private]
-       Desc: Check consistency the popup content and internal datas.
-        Synchronize internal data structures with popup content.
-*/
-
-void QtxDockAction::checkPopup( QPopupMenu* pm )
-{
-  if ( !myMenu.contains( pm ) )
-    return;
-
-  int id = findId( pm, myMenu[pm].dock );
-  if ( id == -1 )
-  {
-    delete myMenu[pm].dock;
-    myMenu[pm].dock = 0;
-  }
-  id = findId( pm, myMenu[pm].tool );
-  if ( id == -1 )
-  {
-    delete myMenu[pm].tool;
-    myMenu[pm].tool = 0;
-  }
-
-  if ( !myMenu[pm].dock )
-  {
-    delete myMenu[pm].tool;
-    myMenu.remove( pm );
-    disconnect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
-  }
-}
-
-/*!
-       Name: fillPopup [private]
-       Desc: Clear the popup and the add to it required actions.
-*/
-
-void QtxDockAction::fillPopup( QPopupMenu* pm ) const
-{
-  if ( !pm || !mainWindow() )
-    return;
-
-  if ( !myMenu.contains( pm ) )
-    return;
-
-  QPopupMenu* dockMenu = myMenu[pm].dock;
-  QPopupMenu* toolMenu = myMenu[pm].tool;
-
-  for ( InfoMap::ConstIterator mit = myInfo.begin(); mit != myInfo.end(); ++mit )
-  {
-    mit.data().a->removeFrom( dockMenu );
-    mit.data().a->removeFrom( toolMenu );
-  }
-
-  if ( dockMenu )
-    dockMenu->clear();
-
-  if ( toolMenu )
-    toolMenu->clear();
-
-  QPtrList<QDockWindow> dockList;
-  dockWindows( dockList, mainWindow() );
+  lst.clear();
 
-  if ( dockList.isEmpty() )
+  QMainWindow* mw = mainWindow();
+  if ( !mw )
     return;
 
-  QPtrList<QAction> toolBars, windows;
-  for ( QPtrListIterator<QDockWindow> it( dockList ); it.current(); ++it )
+  QList<QToolBar*> toolbars = qFindChildren<QToolBar*>( mw );
+  for ( QList<QToolBar*>::iterator it = toolbars.begin(); it != toolbars.end(); ++it )
   {
-    if ( !myInfo.contains( it.current() ) )
-    {
-      QtxDockAction* that = (QtxDockAction*)this;
-      that->autoAddDockWindow( it.current() );
-    }
-
-    if ( !mainWindow()->appropriate( it.current() ) ||
-         it.current()->caption().isEmpty() || !action( it.current() ) )
-      continue;
-
-    if ( isToolBar( it.current() ) )
-      toolBars.append( action( it.current() ) );
-    else
-      windows.append( action( it.current() ) );
+    QToolBar* tb = *it;
+    if ( tb->parentWidget() == mw )
+      lst.append( tb );
   }
-
-  for ( QPtrListIterator<QAction> wit( windows ); wit.current(); ++wit )
-    wit.current()->addTo( dockMenu );
-
-  dockMenu->insertSeparator();
-
-  for ( QPtrListIterator<QAction> tit( toolBars ); tit.current(); ++tit )
-    tit.current()->addTo( toolMenu ? toolMenu : dockMenu );
-
-  Qtx::simplifySeparators( dockMenu );
-  Qtx::simplifySeparators( toolMenu );
-}
-
-/*!
-       Name: isToolBar [private]
-       Desc: Returns 'true' if dock window is a toolbar.
-*/
-
-bool QtxDockAction::isToolBar( QDockWindow* dw ) const
-{
-  return dw && dw->inherits( "QToolBar" );
 }
 
 /*!
-       Name: findId [private]
-       Desc: Returns identificator of popup item which contains sub popup 'pm' in the popup 'cont'.
+  \brief Get all dockable windows owned by parent main window.
+  \param lst returned list of all dockable windows owned by main window
 */
-
-int QtxDockAction::findId( QPopupMenu* cont, QPopupMenu* pm ) const
-{
-  if ( !cont || !pm )
-    return -1;
-
-  int id = -1;
-
-  for ( int i = 0; i < (int)cont->count() && id == -1; i++ )
-  {
-    QMenuData* md = 0;
-    QMenuItem* item = cont->findItem( cont->idAt( i ), &md );
-    if ( item && md == cont && item->popup() == pm )
-      id = item->id();
-  }
-  return id;
-}
-
-/*!
-       Name: dockWindows [private]
-       Desc: Returns all dock windows of the main window.
-*/
-
-void QtxDockAction::dockWindows( QPtrList<QDockWindow>& lst, QMainWindow* main ) const
+void QtxDockAction::dockWidgets( QList<QDockWidget*>& lst ) const
 {
   lst.clear();
 
-  QMainWindow* mw = main ? main : mainWindow();
+  QMainWindow* mw = mainWindow();
   if ( !mw )
     return;
 
-  QObjectList* objs = mw->queryList( "QDockWindow" );
-  if ( objs )
+  QList<QDockWidget*> dockwidgets = qFindChildren<QDockWidget*>( mw );
+  for ( QList<QDockWidget*>::iterator it = dockwidgets.begin(); it != dockwidgets.end(); ++it )
   {
-    for ( QObjectListIt it( *objs ); it.current(); ++it )
-    {
-      QDockWindow* dockWin = ::qt_cast<QDockWindow*>( it.current() );
-      if ( dockWin && dockMainWindow( mw, dockWin ) )
-        lst.append( dockWin );
-    }
+    QDockWidget* dw = *it;
+    if ( dw->parentWidget() == mw )
+      lst.append( dw );
   }
-  delete objs;
-}
-
-/*!
-  \return true if main window is parent of object
-  \param mw - main window
-  \param win - object
-*/
-bool QtxDockAction::dockMainWindow( QMainWindow* mw, QObject* win ) const
-{
-  if ( !mw || !win )
-    return false;
-
-  while ( win )
-  {
-    if ( win->parent() && win->parent() == mw )
-      return true;
-
-    if ( ::qt_cast<QMainWindow*>( win->parent() ) )
-      return false;
-
-    win = win->parent();
-  }
-
-  return false;
 }
 
-/*!
-       Name: updateInfo [private]
-       Desc: Updates icon and caption info of dock window in the corresponded action.
-*/
-
+/*
 void QtxDockAction::updateInfo( QDockWindow* dw )
 {
   QAction* a = action( dw );
@@ -772,533 +186,72 @@ void QtxDockAction::updateInfo( QDockWindow* dw )
   if ( icon )
     a->setIconSet( *icon );
 }
-
-/*!
-       Name: savePlaceInfo [private]
-       Desc: Store the place and geometry information from specified dock window.
-*/
-
-void QtxDockAction::savePlaceInfo( QDockWindow* dw )
-{
-  if ( !myInfo.contains( dw ) )
-    return;
-
-  if ( !myGeom.contains( myInfo[dw].name ) )
-    myGeom.insert( myInfo[dw].name, GeomInfo() );
-
-  GeomInfo& inf = myGeom[myInfo[dw].name];
-
-  Dock dock;
-  inf.vis = dw->isVisibleTo( mainWindow() );
-  mainWindow()->getLocation( dw, dock, inf.index, inf.newLine, inf.offset );
-
-  inf.place = dock;
-  inf.x = dw->x();
-  inf.y = dw->y();
-  inf.w = dw->width();
-  inf.h = dw->height();
-  inf.fixW = dw->fixedExtent().width();
-  inf.fixH = dw->fixedExtent().height();
-}
-
-/*!
-       Name: loadPlaceInfo [private]
-       Desc: Retrieve the stored place and geometry information to specified dock window.
-*/
-
-void QtxDockAction::loadPlaceInfo( QDockWindow* dw ) const
-{
-  if ( !myInfo.contains( dw ) )
-    return;
-
-  QMainWindow* mw = mainWindow();
-  if ( !mw )
-    return;
-
-  QObject* p = dw->parent();
-  if ( !( !p || p == mw || ( p->parent() && p->parent() == mw ) ) )
-    return;
-
-  QString winName = myInfo[dw].name;
-  if ( winName.isEmpty() || !myGeom.contains( winName ) )
-    return;
-
-  GeomInfo inf = myGeom[myInfo[dw].name];
-
-  mainWindow()->moveDockWindow( dw, (Qt::Dock)inf.place, inf.newLine, inf.index, inf.offset );
-  dw->setGeometry( inf.x, inf.y, inf.w, inf.h );
-
-  dw->setFixedExtentWidth( inf.fixW );
-  dw->setFixedExtentHeight( inf.fixH );
-
-  QtxDockAction* that = (QtxDockAction*)this;
-  that->myGeom.insert( myInfo[dw].name, inf );
-}
-
-/*!
-       Name: loadPlaceInfo [private]
-       Desc: Retrieve the stored place and geometry information to all dock windows.
-*/
-
-void QtxDockAction::loadPlaceInfo() const
-{
-  QMainWindow* mw = mainWindow();
-  if ( !mw )
-    return;
-
-  typedef QPtrList<QDockWindow> DockWinList;
-
-  DockWinList lst;
-  dockWindows( lst, mw );
-
-  QMap<QString, QDockWindow*> nameMap;
-  for ( QPtrListIterator<QDockWindow> itr( lst ); itr.current(); ++itr )
-  {
-    QObject* p = itr.current()->parent();
-    if ( !( !p || p == mw || ( p->parent() && p->parent() == mw ) ) )
-      continue;
-
-    QString name;
-    if ( myInfo.contains( itr.current() ) )
-      name = myInfo[itr.current()].name;
-
-    if ( !myGeom.contains( name ) )
-      continue;
-
-    nameMap.insert( name, itr.current() );
-  }
-
-  DockWinList winList;
-  for ( QStringList::const_iterator iter = myNames.begin(); iter != myNames.end(); ++iter )
-  {
-    if ( nameMap.contains( *iter ) )
-      winList.append( nameMap[*iter] );
-    nameMap.remove( *iter );
-  }
-
-  for ( QMap<QString, QDockWindow*>::ConstIterator mIt = nameMap.begin(); mIt != nameMap.end(); ++mIt )
-    winList.append( mIt.data() );
-
-  QMap<int, DockWinList> winMap;
-  QMap<QDockWindow*, GeomInfo*> geomMap;
-
-  for ( QPtrListIterator<QDockWindow> it( winList ); it.current(); ++it )
-  {
-    QString name;
-    if ( myInfo.contains( it.current() ) )
-      name = myInfo[it.current()].name;
-
-    if ( !myGeom.contains( name ) )
-      continue;
-
-    //! collect pointer of info to have fresh info data after processEvents();
-    GeomInfo* inf = (GeomInfo*)&( myGeom[name] );
-    geomMap.insert( it.current(), inf );
-    if ( !winMap.contains( inf->place ) )
-      winMap.insert( inf->place, DockWinList() );
-    winMap[inf->place].append( it.current() );
-  }
-
-  loadPlaceArea( DockMinimized, mw, 0,
-                 winMap.contains( DockMinimized ) ? winMap[DockMinimized] : DockWinList(), geomMap );
-  for ( int i = DockTornOff; i < DockMinimized; i++ )
-  {
-    loadPlaceArea( i, mw, dockArea( i ), winMap.contains( i ) ? winMap[i] : DockWinList(), geomMap );
-  }
-}
-
-/*!
-       Name: loadPlaceArea [private]
-       Desc: Set the place and geometry information to all dock windows in the area.
-*/
-
-void QtxDockAction::loadPlaceArea( const int place, QMainWindow* mw, QDockArea* area,
-                                   const QPtrList<QDockWindow>& dockList,
-                                   const QMap<QDockWindow*, GeomInfo*>& geomMap ) const
-{
-  for ( QPtrListIterator<QDockWindow> it( dockList ); it.current(); ++it )
-  {
-    if ( !geomMap.contains( it.current() ) )
-      continue;
-
-    GeomInfo* inf = geomMap[it.current()];
-    mw->moveDockWindow( it.current(), (Qt::Dock)place, inf->newLine, inf->index, inf->offset );
-  }
-
-  if ( !area )
-    return;
-
-  qApp->processEvents();
-
-  for ( QPtrListIterator<QDockWindow> itr( dockList ); itr.current(); ++itr )
-  {
-    QDockWindow* dw = itr.current();
-    if ( !geomMap.contains( dw ) )
-      continue;
-
-    GeomInfo* inf = geomMap[dw];
-    if ( place != DockTornOff )
-    {
-      dw->setNewLine( inf->newLine );
-                 dw->setOffset( inf->offset );
-                 dw->setFixedExtentWidth( inf->fixW );
-                 dw->setFixedExtentHeight( inf->fixH );
-    }
-    dw->setGeometry( inf->x, inf->y, inf->w, inf->h );
-
-    QAction* a = action( dw );
-    if ( a )
-    {
-      bool block = a->signalsBlocked();
-      a->blockSignals( true );
-      a->setOn( inf->vis );
-      a->blockSignals( block );
-    }
-
-    if ( mainWindow() && mainWindow()->appropriate( dw ) )
-      inf->vis ? dw->show() : dw->hide();
-  }
-
-  QWidget* wid = area;
-  if ( wid->layout() )
-  {
-    wid->layout()->invalidate();
-    wid->layout()->activate();
-  }
-}
-
-/*!
-       Name: action [private]
-       Desc: Returns action for the given dock window.
 */
 
-QAction* QtxDockAction::action( QDockWindow* dw ) const
-{
-  QAction* a = 0;
-  if ( myInfo.contains( dw ) )
-    a = myInfo[dw].a;
-  return a;
-}
-
 /*!
-       Name: dockWindow [private]
-       Desc: Returns dock window for the given action.
-*/
-
-QDockWindow* QtxDockAction::dockWindow( const QAction* a ) const
-{
-  QDockWindow* dw = 0;
-  for ( InfoMap::ConstIterator it = myInfo.begin(); it != myInfo.end() && !dw; ++it )
-  {
-    if ( it.data().a == a )
-      dw = it.key();
-  }
-  return dw;
-}
+  \brief Customize action adding to the widget operation.
+  
+  Called when the action is added to the widget.
+  Reimplemented from QtxAction class.
 
-/*!
-       Name: initialize [private]
-       Desc: Initialisation of the object. Sets the event filters and add existing dock windows.
+  \param w widget this action is added to (menu or toolbar)
 */
-
-void QtxDockAction::initialize( QMainWindow* mw )
+void QtxDockAction::addedTo( QWidget* w )
 {
-  if ( !mw )
-    return;
-
-  QPtrList<QDockWindow> lst;
-  dockWindows( lst, mw );
-
-  for ( QPtrListIterator<QDockWindow> it( lst ); it.current(); ++it )
-    QApplication::postEvent( this, new QCustomEvent( (QEvent::Type)AutoAdd, it.current() ) );
-
-  if ( mw->topDock() )
-    mw->topDock()->installEventFilter( this );
-  if ( mw->leftDock() )
-    mw->leftDock()->installEventFilter( this );
-  if ( mw->rightDock() )
-    mw->rightDock()->installEventFilter( this );
-  if ( mw->bottomDock() )
-    mw->bottomDock()->installEventFilter( this );
-
-  connect( mw, SIGNAL( dockWindowPositionChanged( QDockWindow* ) ),
-           this, SLOT( onDockWindowPositionChanged( QDockWindow* ) ) );
+  if ( w->inherits( "QMenu" ) )
+    connect( w, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
 }
 
 /*!
-       Name: windowName [private]
-       Desc: Generate the dock window name.
-*/
-
-QString QtxDockAction::windowName( QDockWindow* dw ) const
-{
-  QString name;
+  \brief Customize action removing from the widget operation.
+  
+  Called when the action is removed from the widget.
+  Reimplemented from QtxAction class.
 
-  if ( dw )
-  {
-    name = dw->name( "" );
-    if ( name.isEmpty() )
-      name = dw->caption();
-  }
-
-  return name;
-}
-
-/*!
-       Name: autoAddDockWindow [private]
-       Desc: Add the dock window if auto add property is setted.
+  \param w widget this action is removed from to (menu or toolbar)
 */
-
-bool QtxDockAction::autoAddDockWindow( QDockWindow* dw )
+void QtxDockAction::removedFrom( QWidget* w )
 {
-  if ( !isAutoAdd() )
-    return false;
-
-  return addDockWindow( dw );
+  if ( w->inherits( "QMenu" ) )
+    disconnect( w, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
 }
 
 /*!
-       Name: autoLoadPlaceInfo [private]
-       Desc: Retieve the dock window place geometry if auto place property is setted.
+  \brief Initialize the action.
 */
-
-void QtxDockAction::autoLoadPlaceInfo( QDockWindow* dw )
+void QtxDockAction::initialize()
 {
-  if ( isAutoPlace() )
-    loadPlaceInfo( dw );
+  setMenu( new QMenu( 0 ) );
 }
 
 /*!
-       Name: splitMenuText [private]
-       Desc: 
+  \brief Update action child popup menu.
 */
-
-void QtxDockAction::splitMenuText( QString& dock, QString& tool ) const
+void QtxDockAction::updateMenu()
 {
-  dock = tool = menuText();
-  if ( !isSeparate() )
+  QMenu* pm = menu();
+  if ( !pm )
     return;
 
-  QStringList lst = splitText( menuText(), "|" );
-  if ( lst.count() < 2 )
-    lst = splitText( menuText(), "and" );
+  pm->clear();
 
-  dock = lst.first();
-  tool = lst.last();
-}
-
-/*!
-       Name: splitText [private]
-       Desc: 
-*/
-
-QStringList QtxDockAction::splitText( const QString& str, const QString& sep ) const
-{
-  QStringList res;
-
-  int idx = str.lower().find( sep.lower() );
-  if ( idx != -1 )
+  if ( dockType() == DockWidget || dockType() == Both )
   {
-    res.append( str.mid( 0, idx ).stripWhiteSpace() );
-    res.append( str.mid( idx + sep.length() ).stripWhiteSpace() );
+    QList<QDockWidget*> dwList;
+    dockWidgets( dwList );
+    for ( QList<QDockWidget*>::iterator it = dwList.begin(); it != dwList.end(); ++it )
+      pm->addAction( (*it)->toggleViewAction() );
   }
 
-  return res;
-}
-
-/*!
-       Name: dockPlace [private]
-       Desc: 
-*/
+  pm->addSeparator();
 
-int QtxDockAction::dockPlace( const QString& dockName ) const
-{
-  static QMap<QString, int> dockNameMap;
-  if ( dockNameMap.isEmpty() )
+  if ( dockType() == ToolBar || dockType() == Both )
   {
-    dockNameMap["top"]       = DockTop;
-    dockNameMap["bottom"]    = DockBottom;
-    dockNameMap["left"]      = DockLeft;
-    dockNameMap["right"]     = DockRight;
-    dockNameMap["tornoff"]   = DockTornOff;
-    dockNameMap["torn_off"]  = DockTornOff;
-    dockNameMap["outside"]   = DockTornOff;
-    dockNameMap["undock"]    = DockTornOff;
-    dockNameMap["minimized"] = DockMinimized;
-    dockNameMap["unmanaged"] = DockUnmanaged;
+    QList<QToolBar*> tbList;
+    toolBars( tbList );
+    for ( QList<QToolBar*>::iterator it = tbList.begin(); it != tbList.end(); ++it )
+      pm->addAction( (*it)->toggleViewAction() );
   }
 
-  int res = -1;
-  if ( dockNameMap.contains( dockName.lower() ) )
-    res = dockNameMap[dockName.lower()];
-  return res;
-}
-
-/*!
-       Name: dockArea [private]
-       Desc: 
-*/
-
-QDockArea* QtxDockAction::dockArea( const int place ) const
-{
-  if ( !mainWindow() )
-    return 0;
-
-  QDockArea* area = 0;
-  switch ( place )
-  {
-  case DockTop:
-    area = mainWindow()->topDock();
-    break;
-  case DockBottom:
-    area = mainWindow()->bottomDock();
-    break;
-  case DockLeft:
-    area = mainWindow()->leftDock();
-    break;
-  case DockRight:
-    area = mainWindow()->rightDock();
-    break;
-  }
-  return area;
-}
-
-/*!
-       Name: loadGeometry [private]
-       Desc: 
-*/
-
-bool QtxDockAction::loadGeometry( QtxResourceMgr* resMgr, const QString& sec,
-                                  const QString& name, GeomInfo& inf ) const
-{
-  if ( !resMgr || sec.isEmpty() || name.isEmpty() )
-    return false;
-
-  QString tmpl = QString( "%1.%2" ).arg( name );
-
-  inf.vis     = resMgr->booleanValue( sec, tmpl.arg( "visible" ), inf.vis );
-  inf.newLine = resMgr->booleanValue( sec, tmpl.arg( "new_line" ), inf.newLine );
-
-  inf.index   = resMgr->integerValue( sec, tmpl.arg( "index" ), inf.index );
-  inf.offset  = resMgr->integerValue( sec, tmpl.arg( "offset" ), inf.offset );
-
-  inf.x       = resMgr->integerValue( sec, tmpl.arg( "x" ), inf.x );
-  inf.y       = resMgr->integerValue( sec, tmpl.arg( "y" ), inf.y );
-  inf.w       = resMgr->integerValue( sec, tmpl.arg( "width" ), inf.w );
-  inf.h       = resMgr->integerValue( sec, tmpl.arg( "height" ), inf.h );
-
-  inf.fixW    = resMgr->integerValue( sec, tmpl.arg( "fixed_width" ), inf.fixW );
-  inf.fixH    = resMgr->integerValue( sec, tmpl.arg( "fixed_height" ), inf.fixH );
-
-  int place = -1;
-  if ( !resMgr->value( sec, tmpl.arg( "place" ), place ) )
-  {
-    QString placeStr;
-    if ( resMgr->value( sec, tmpl.arg( "place" ), placeStr ) )
-      place = dockPlace( placeStr );
-  }
-
-  if ( place >= DockUnmanaged && place <= DockMinimized )
-    inf.place = place;
-
-  return true;
-}
-
-/*!
-       Name: saveGeometry [private]
-       Desc: 
-*/
-
-bool QtxDockAction::saveGeometry( QtxResourceMgr* resMgr, const QString& sec,
-                                  const QString& name, const GeomInfo& inf ) const
-{
-  if ( !resMgr || sec.isEmpty() || name.isEmpty() )
-    return false;
-
-  QString tmpl = QString( "%1.%2" ).arg( name );
-
-  resMgr->setValue( sec, tmpl.arg( "visible" ), inf.vis );
-  resMgr->setValue( sec, tmpl.arg( "new_line" ), inf.newLine );
-  resMgr->setValue( sec, tmpl.arg( "index" ), inf.index );
-  resMgr->setValue( sec, tmpl.arg( "offset" ), inf.offset );
-  resMgr->setValue( sec, tmpl.arg( "x" ), inf.x );
-  resMgr->setValue( sec, tmpl.arg( "y" ), inf.y );
-  resMgr->setValue( sec, tmpl.arg( "width" ), inf.w );
-  resMgr->setValue( sec, tmpl.arg( "height" ), inf.h );
-  resMgr->setValue( sec, tmpl.arg( "fixed_width" ), inf.fixW );
-  resMgr->setValue( sec, tmpl.arg( "fixed_height" ), inf.fixH );
-  resMgr->setValue( sec, tmpl.arg( "place" ), inf.place );
-
-  return true;
-}
-
-/*!
-       Name: collectNames [private]
-       Desc: 
-*/
-
-void QtxDockAction::collectNames( const int place, QStringList& lst ) const
-{
-  QPtrList<QDockWindow> winList;
-  QDockArea* area = dockArea( place );
-  if ( area )
-    winList = area->dockWindowList();
-  else
-    winList = mainWindow()->dockWindows( (Qt::Dock)place );
-
-  for ( QPtrListIterator<QDockWindow> it( winList ); it.current(); ++it )
-  {
-    QString name;
-    if ( myInfo.contains( it.current() ) )
-      name = myInfo[it.current()].name;
-    if ( name.isEmpty() )
-      name = windowName( it.current() );
-    if ( name.isEmpty() )
-      continue;
-
-    lst.append( name );
-  }
-}
-
-/*!
-  Updates menu of action
-*/
-void QtxDockAction::updateMenus()
-{
-  for ( MenuMap::Iterator it = myMenu.begin(); it != myMenu.end(); ++it )
-  {
-    QPopupMenu* pm = it.key();
-    MenuInfo& inf = it.data();
-
-    int toolId = findId( pm, inf.tool );
-    int dockId = findId( pm, inf.dock );
-
-    int index = pm->indexOf( dockId );
-
-    if ( isSeparate() && !inf.tool )
-      inf.tool = new QPopupMenu( pm );
-
-    pm->removeItem( dockId );
-    pm->removeItem( toolId );
-
-    if ( !isSeparate() && inf.tool )
-    {
-      delete inf.tool;
-      inf.tool = 0;
-    }
-
-    QString dock, tool;
-    splitMenuText( dock, tool );
-
-    if ( inf.dock )
-      iconSet().isNull() ? pm->insertItem ( dock, inf.dock, -1, index ) :
-                           pm->insertItem ( iconSet(), dock, inf.dock, -1, index );
-
-    if ( index >= 0 )
-      index++;
-
-    if ( inf.tool )
-      iconSet().isNull() ? pm->insertItem ( tool, inf.tool, -1, index ) :
-                          pm->insertItem ( iconSet(), tool, inf.tool, -1, index );
-  }
+  Qtx::simplifySeparators( pm );
 }
index a18d102fba0dd02dea073d71eab0283c7061378a..fbc1b2d39131c831ad3251bbb5dd50399bd07abe 100755 (executable)
@@ -1,38 +1,39 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxDockAction.h
 // Author:    Sergey TELKOV
-
-#ifndef QTX_DOCKACTION_H
-#define QTX_DOCKACTION_H
+//
+#ifndef QTXDOCKACTION_H
+#define QTXDOCKACTION_H
 
 #include "QtxAction.h"
 
-#include <qevent.h>
-#include <qptrlist.h>
-#include <qpopupmenu.h>
+#include <QList>
 
-class QAction;
-class QDockArea;
-class QDockWindow;
+class QIcon;
+class QString;
+class QToolBar;
+class QDockWidget;
 class QMainWindow;
-class QtxResourceMgr;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -42,123 +43,45 @@ class QTX_EXPORT QtxDockAction : public QtxAction
 {
   Q_OBJECT
 
-  Q_PROPERTY( bool autoAdd   READ isAutoAdd   WRITE setAutoAdd )
-  Q_PROPERTY( bool autoPlace READ isAutoPlace WRITE setAutoPlace )
-  Q_PROPERTY( bool separate  READ isSeparate  WRITE setSeparate )
+public:
+  //! Dock windows type.
+  enum { ToolBar,      //!< list toolbars only
+        DockWidget,   //!< list dockable windows only
+        Both          //!< list toolbars and dockable windows
+  } DockType;
 
 public:
-  QtxDockAction( QMainWindow*, const char* = 0 );
-  QtxDockAction( const QString&, const QString&, QMainWindow*, const char* = 0 );
-  QtxDockAction( const QString&, const QIconSet&, const QString&, QMainWindow*, const char* = 0 );
+  QtxDockAction( QMainWindow* );
+  QtxDockAction( const QString&, const QString&, QMainWindow* );
+  QtxDockAction( const QString&, const QIcon&, const QString&, QMainWindow* );
   virtual ~QtxDockAction();
 
-  QMainWindow* mainWindow() const;
-
-  bool         isAutoAdd() const;
-  void         setAutoAdd( const bool );
+  int          dockType() const;
+  void         setDockType( const int );
 
-  bool         isAutoPlace() const;
-  void         setAutoPlace( const bool );
-
-  bool         isSeparate() const;
-  void         setSeparate( const bool );
-
-  virtual bool addTo( QWidget* );
-  virtual bool addTo( QWidget*, const int );
-  virtual bool removeFrom( QWidget* );
-  virtual void setMenuText( const QString& );
-
-  bool         addDockWindow( QDockWindow* );
-  bool         removeDockWindow( QDockWindow* );
-
-  virtual bool eventFilter( QObject*, QEvent* );
-
-  virtual void storeGeometry( QDockWindow* = 0 );
-  virtual void restoreGeometry( QDockWindow* = 0 ) const;
-
-  virtual void loadGeometry( QtxResourceMgr*, const QString&, const bool = true );
-  virtual void saveGeometry( QtxResourceMgr*, const QString&, const bool = true ) const;
+  QMainWindow* mainWindow() const;
 
 private slots:
   void         onAboutToShow();
-  void         onToggled( bool );
-  void         onVisibilityChanged( bool );
-  void         onPopupDestroyed( QObject* );
-  void         onWindowDestroyed( QObject* );
-  void         onDockWindowPositionChanged( QDockWindow* );
 
 protected:
-  virtual bool event( QEvent* );
+  virtual void addedTo( QWidget* );
+  virtual void removedFrom( QWidget* );
 
 private:
-  QAction*     action( QDockWindow* ) const;
-  QDockWindow* dockWindow( const QAction* ) const;
+  void         initialize();
+  void         updateMenu();
 
-  void         checkPopup( QPopupMenu* );
-  void         fillPopup( QPopupMenu* ) const;
-  int          findId( QPopupMenu*, QPopupMenu* ) const;
-
-  void         initialize( QMainWindow* );
-  void         updateInfo( QDockWindow* );
-  bool         isToolBar( QDockWindow* ) const;
-  void         dockWindows( QPtrList<QDockWindow>&, QMainWindow* = 0 ) const;
-
-  QString      windowName( QDockWindow* ) const;
-  void         savePlaceInfo( QDockWindow* );
-  void         loadPlaceInfo( QDockWindow* ) const;
-  void         loadPlaceInfo() const;
-
-  bool         autoAddDockWindow( QDockWindow* );
-  void         autoLoadPlaceInfo( QDockWindow* );
-
-  void         splitMenuText( QString&, QString& ) const;
-  QStringList  splitText( const QString&, const QString& ) const;
-
-  QDockArea*   dockArea( const int ) const;
-  int          dockPlace( const QString& ) const;
-
-  void         collectNames( const int, QStringList& ) const;
-
-  void         updateMenus();
-
-  bool         dockMainWindow( QMainWindow*, QObject* ) const;
+  void         toolBars( QList<QToolBar*>& ) const;
+  void         dockWidgets( QList<QDockWidget*>& ) const;
 
 private:
-  enum { AutoAdd = QEvent::User, LoadArea };
-
-  typedef struct { bool vis, newLine;
-                   int place, index, offset;
-                   int x, y, w, h, fixW, fixH; } GeomInfo;
-  typedef struct { QString name; QAction* a; }   DockInfo;
-  typedef struct { QPopupMenu *dock, *tool; }    MenuInfo;
-
-  typedef QMap<QDockWindow*, DockInfo>   InfoMap;
-  typedef QMap<QString, GeomInfo>        GeomMap;
-  typedef QMap<QPopupMenu*, MenuInfo>    MenuMap;
-
-private:
-  bool         loadGeometry( QtxResourceMgr*, const QString&,
-                             const QString&, GeomInfo& ) const;
-  bool         saveGeometry( QtxResourceMgr*, const QString&,
-                             const QString&, const GeomInfo& ) const;
-  void         loadPlaceArea( const int, QMainWindow*, QDockArea*,
-                              const QPtrList<QDockWindow>&,
-                              const QMap<QDockWindow*, GeomInfo*>& ) const;
-
-private:
-  InfoMap      myInfo;
-  MenuMap      myMenu;
-  GeomMap      myGeom;
-  QMainWindow* myMain;
-  QStringList  myNames;
-
-  bool         myAutoAdd;
-  bool         mySeparate;
-  bool         myAutoPlace;
+  int          myType;   //!< dock action type
+  QMainWindow* myMain;   //!< parent main window
 };
 
 #ifdef WIN32
 #pragma warning( default:4251 )
 #endif
 
-#endif
+#endif // QTXDOCKACTION_H
diff --git a/src/Qtx/QtxDockWidget.cxx b/src/Qtx/QtxDockWidget.cxx
new file mode 100644 (file)
index 0000000..fcb5231
--- /dev/null
@@ -0,0 +1,484 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxDockWidget.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxDockWidget.h"
+
+#include <QAction>
+#include <QLayout>
+#include <QMainWindow>
+#include <QResizeEvent>
+#include <QApplication>
+
+/*!
+  \class QtxDockWidget::Watcher
+  \internal
+  \brief Internal class which goal is to watch parent dockable widget state changing.
+*/
+
+class QtxDockWidget::Watcher : public QObject
+{
+public:
+  Watcher( QtxDockWidget* );
+
+  void           shown( QtxDockWidget* );
+  void           hidden( QtxDockWidget* );
+
+  virtual bool   eventFilter( QObject*, QEvent* );
+
+  bool           isEmpty() const;
+  bool           isVisible() const;
+
+protected:
+  enum { Update = QEvent::User, Remove };
+
+  virtual void   customEvent( QEvent* );
+
+private:
+  void           installFilters();
+
+  void           showContainer();
+  void           hideContainer();
+
+  void           updateIcon();
+  void           updateCaption();
+  void           updateVisibility();
+
+  void           setEmpty( const bool );
+  void           setVisible( const bool );
+
+private:
+  QtxDockWidget* myCont;
+  bool           myState;
+  bool           myEmpty;
+  bool           myBlock;
+  bool           myShown;
+};
+
+/*!
+  \brief Constructor.
+  \param cont dockable widget to be watched
+*/
+QtxDockWidget::Watcher::Watcher( QtxDockWidget* cont )
+: QObject( cont ), myCont( cont ),
+  myState( true ),
+  myEmpty( false ),
+  myBlock( false )
+{
+  myCont->installEventFilter( this );
+
+  installFilters();
+
+  myShown = myCont->isVisibleTo( myCont->parentWidget() );
+}
+
+/*!
+  \brief Custom event filter.
+  \param o event receiver object
+  \param e event sent to object
+  \return \c true if further event processing should be stopped
+*/
+bool QtxDockWidget::Watcher::eventFilter( QObject* o, QEvent* e )
+{
+  if ( o == myCont && ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ||
+                        e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ) )
+  {
+    installFilters();
+  }
+
+  if ( o == myCont && e->type() == QEvent::ChildAdded )
+  {
+    QChildEvent* ce = (QChildEvent*)e;
+    if ( ce->child()->isWidgetType() )
+      ce->child()->installEventFilter( this );
+
+    QApplication::postEvent( this, new QEvent( (QEvent::Type)Update ) );
+  }
+
+  if ( o != myCont && e->type() == QEvent::WindowIconChange )
+    updateIcon();
+
+  if ( o != myCont && e->type() == QEvent::WindowTitleChange )
+    updateCaption();
+
+  if ( o != myCont && ( e->type() == QEvent::HideToParent || e->type() == QEvent::ShowToParent ) )
+    updateVisibility();
+
+  if ( o == myCont && e->type() == QEvent::ChildRemoved )
+  {
+    QApplication::postEvent( this, new QEvent( (QEvent::Type)Remove ) );
+  }
+
+  return false;
+}
+
+/*!
+  \brief Set internal status to "shown"
+  \param dw dockable widget
+*/
+void QtxDockWidget::Watcher::shown( QtxDockWidget* dw )
+{
+  if ( dw != myCont )
+    return;
+
+  setVisible( true );
+}
+
+/*!
+  \brief Set internal status to "hidden"
+  \param dw dockable widget
+*/
+void QtxDockWidget::Watcher::hidden( QtxDockWidget* dw )
+{
+  if ( dw != myCont )
+    return;
+
+  setVisible( false );
+}
+
+bool QtxDockWidget::Watcher::isEmpty() const
+{
+  return myEmpty;
+}
+
+bool QtxDockWidget::Watcher::isVisible() const
+{
+  return myShown;
+}
+
+void QtxDockWidget::Watcher::setEmpty( const bool on )
+{
+  myEmpty = on;
+}
+
+void QtxDockWidget::Watcher::setVisible( const bool on )
+{
+  myShown = on;
+}
+
+/*!
+  \brief Show the dock window being watched
+*/
+void QtxDockWidget::Watcher::showContainer()
+{
+  if ( !myCont )
+    return;
+
+  bool vis = isVisible();
+
+  QtxDockWidget* cont = myCont;
+  myCont = 0;
+  cont->show();
+  myCont = cont;
+
+  setVisible( vis );
+}
+
+/*!
+  \brief Hide the dock window being watched
+*/
+void QtxDockWidget::Watcher::hideContainer()
+{
+  if ( !myCont )
+    return;
+
+  bool vis = isVisible();
+
+  QtxDockWidget* cont = myCont;
+  myCont = 0;
+  cont->hide();
+  myCont = cont;
+
+  setVisible( vis );
+}
+
+/*!
+  \brief Proces custom events.
+  \param e custom event (not used)
+*/
+void QtxDockWidget::Watcher::customEvent( QEvent* e )
+{
+  if ( e->type() == Update )
+  {
+    updateIcon();
+    updateCaption();
+    updateVisibility();
+  }
+  else if ( myCont && e->type() == Remove && !myCont->widget() )
+  {
+    myCont->deleteLater();
+    myCont = 0;
+  }
+}
+
+/*!
+  \brief Install this object as event filter to all children widgets
+         of the dockable widget being watched.
+*/
+void QtxDockWidget::Watcher::installFilters()
+{
+  if ( !myCont )
+    return;
+
+  QLayout* l = myCont->layout();
+  if ( !l )
+    return;
+
+  for ( int i = 0; i < (int)l->count(); i++ )
+  {
+    if ( l->itemAt( i ) && l->itemAt( i )->widget() )
+      l->itemAt( i )->widget()->installEventFilter( this );
+  }
+}
+
+/*!
+  \brief Update visibility state of all children widgets of the dockable widget
+         being watched.
+*/
+void QtxDockWidget::Watcher::updateVisibility()
+{
+  if ( !myCont )
+    return;
+
+  bool vis = false;
+  if ( myCont->widget() )
+    vis = myCont->widget()->isVisibleTo( myCont );
+  else
+  {
+    QLayout* l = myCont->layout();
+    if ( l )
+    {
+      for ( int i = 0; i < (int)l->count() && !vis; i++ )
+       vis = l->itemAt( i ) && l->itemAt( i )->widget() && l->itemAt( i )->widget()->isVisibleTo( myCont );
+    }
+  }
+
+  bool empty = isEmpty();
+  if ( empty == vis )
+  {
+    empty = !vis;
+    setEmpty( empty );
+    if ( !empty )
+      myCont->toggleViewAction()->setVisible( myState );
+    else
+    {
+      myState = myCont->toggleViewAction()->isVisible();
+      myCont->toggleViewAction()->setVisible( false );
+    }
+  }
+
+  vis = !empty && isVisible();
+  if ( vis != myCont->isVisibleTo( myCont->parentWidget() ) )
+    vis ? showContainer() : hideContainer();
+}
+
+/*!
+  \brief Update the icon of dockable window being watched
+*/
+void QtxDockWidget::Watcher::updateIcon()
+{
+  if ( !myCont || !myCont->widget() || myBlock )
+    return;
+
+  myBlock = true;
+  myCont->setWindowIcon( myCont->widget()->windowIcon() );
+  myBlock = false;
+}
+
+/*!
+  \brief Update the title of dockable window being watched
+*/
+void QtxDockWidget::Watcher::updateCaption()
+{
+  if ( myCont && myCont->widget() && !myCont->widget()->windowTitle().isNull() )
+    myCont->setWindowTitle( myCont->widget()->windowTitle() );
+}
+
+/*!
+  \class QtxDockWidget
+  \brief Enhanced dockable widget class.
+*/
+
+/*!
+  \brief Constructor.
+  \param title dockable widget title
+  \param parent parent widget
+  \param f widget flags
+*/
+QtxDockWidget::QtxDockWidget( const QString& title, QWidget* parent, Qt::WindowFlags f )
+: QDockWidget( title, parent, f ),
+  myWatcher( 0 ),
+  myOrientation( (Qt::Orientation)-1 )
+{
+  updateState();
+}
+
+/*!
+  \brief Constructor.
+  \param watch if \c true the event filter is installed to watch wigdet state changes
+         to update it properly
+  \param parent parent widget
+  \param f widget flags
+*/
+QtxDockWidget::QtxDockWidget( const bool watch, QWidget* parent, Qt::WindowFlags f )
+: QDockWidget( parent, f ),
+  myWatcher( 0 ),
+  myOrientation( (Qt::Orientation)-1 )
+{
+  if ( watch )
+    myWatcher = new Watcher( this );
+
+  updateState();
+}
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+  \param f widget flags
+*/
+QtxDockWidget::QtxDockWidget( QWidget* parent, Qt::WindowFlags f )
+: QDockWidget( parent, f ),
+myWatcher( 0 )
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxDockWidget::~QtxDockWidget()
+{
+}
+
+/*!
+  \brief Get the recommended size for the widget.
+  \return recommended dockable widget size
+*/
+QSize QtxDockWidget::sizeHint() const
+{
+  QSize sz = QDockWidget::sizeHint();
+
+  printf( "----------------> QtxDockWidget::sizeHint()\n" );
+
+  return QSize( 500, 100 );
+
+  return sz;
+}
+
+/*!
+  \brief Get the recommended minimum size for the widget.
+  \return recommended dockable widget minimum size
+*/
+QSize QtxDockWidget::minimumSizeHint() const
+{
+  QSize sz = QDockWidget::minimumSizeHint();
+
+  return sz;
+}
+
+/*!
+  \brief Show/hide the dockable window.
+  \param on new visibility state
+*/
+void QtxDockWidget::setVisible( bool on )
+{
+  updateGeometry();
+  if ( widget() )
+    widget()->updateGeometry();
+
+  QDockWidget::setVisible( on && ( myWatcher ? !myWatcher->isEmpty() : true )  );
+
+  if ( myWatcher )
+  {
+    if ( on )
+      myWatcher->shown( this );
+    else
+      myWatcher->hidden( this );
+  }
+}
+
+/*!
+  \brief Process resize event
+  \param e event
+*/
+void QtxDockWidget::resizeEvent( QResizeEvent* e )
+{
+  QDockWidget::resizeEvent( e );
+  updateState();
+}
+
+/*!
+  \brief Get dockable window orientation.
+  \return orientation type
+*/
+Qt::Orientation QtxDockWidget::orientation() const
+{
+  QMainWindow* mw = 0;
+  QWidget* wid = parentWidget();
+  while ( wid && !mw )
+  {
+    mw = ::qobject_cast<QMainWindow*>( wid );
+    wid = wid->parentWidget();
+  }
+
+  Qt::Orientation res = (Qt::Orientation)-1;
+
+  if ( !mw )
+    return res;
+
+  Qt::DockWidgetArea area = mw->dockWidgetArea( (QtxDockWidget*)this );
+  switch ( area )
+  {
+  case Qt::LeftDockWidgetArea:
+  case Qt::RightDockWidgetArea:
+    res = Qt::Vertical;
+    break;
+  case Qt::TopDockWidgetArea:
+  case Qt::BottomDockWidgetArea:
+    res = Qt::Horizontal;
+    break;
+  default:
+    break;
+  }
+
+  return res;
+}
+
+/*!
+  \brief Update dockable window state.
+*/
+void QtxDockWidget::updateState()
+{
+  Qt::Orientation o = orientation();
+  if ( myOrientation == o )
+    return;
+
+  myOrientation = o;
+
+  emit orientationChanged( myOrientation );
+}
+
+/*!
+  \fn QtxDockWidget::orientationChanged(Qt::Orientation o)
+  \brief Emitted when the dockable window orientation is changed.
+  \param o new window orientation
+*/
diff --git a/src/Qtx/QtxDockWidget.h b/src/Qtx/QtxDockWidget.h
new file mode 100644 (file)
index 0000000..ca55bfb
--- /dev/null
@@ -0,0 +1,66 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxDockWidget.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXDOCKWIDGET_H
+#define QTXDOCKWIDGET_H
+
+#include "Qtx.h"
+
+#include <QDockWidget>
+
+class QTX_EXPORT QtxDockWidget : public QDockWidget
+{
+  Q_OBJECT
+
+  class Watcher;
+
+public:
+  QtxDockWidget( const QString&, QWidget* = 0, Qt::WindowFlags = 0 );
+  QtxDockWidget( const bool, QWidget* = 0, Qt::WindowFlags = 0 );
+  QtxDockWidget( QWidget*, Qt::WindowFlags = 0 );
+  virtual ~QtxDockWidget();
+
+  virtual QSize   sizeHint() const;
+  virtual QSize   minimumSizeHint() const;
+
+  Qt::Orientation orientation() const;
+
+signals:
+  void            orientationChanged( Qt::Orientation );
+
+public slots:
+  virtual void    setVisible( bool );
+
+protected:
+  virtual void    resizeEvent( QResizeEvent* );
+
+private:
+  void            updateState();
+
+private:
+  Watcher*        myWatcher;       //!< watcher object
+  Qt::Orientation myOrientation;   //!< dockable window orientation
+};
+
+#endif // QTXDOCKWIDGET_H
diff --git a/src/Qtx/QtxDockWindow.cxx b/src/Qtx/QtxDockWindow.cxx
deleted file mode 100644 (file)
index da6f5cc..0000000
+++ /dev/null
@@ -1,412 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxDockWindow.cxx
-// Author:    Sergey TELKOV
-
-#include "QtxDockWindow.h"
-
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qdockarea.h>
-#include <qmainwindow.h>
-#include <qapplication.h>
-
-/*!
-  \class QtxDockWindow::Watcher [Internal]
-  Internal object with event filter.
-*/
-class QtxDockWindow::Watcher : public QObject
-{
-public:
-  Watcher( QtxDockWindow* );
-
-  void           shown( QtxDockWindow* );
-  void           hided( QtxDockWindow* );
-
-  virtual bool   eventFilter( QObject*, QEvent* );
-
-protected:
-  virtual void   customEvent( QCustomEvent* );
-
-private:
-  void           installFilters();
-
-  void           showContainer();
-  void           hideContainer();
-
-  void           updateIcon();
-  void           updateCaption();
-  void           updateVisibility();
-
-private:
-  QtxDockWindow* myCont;
-  bool           myState;
-  bool           myEmpty;
-  bool           myVisible;
-};
-
-/*!
-  Constructor
-*/
-QtxDockWindow::Watcher::Watcher( QtxDockWindow* cont )
-: QObject( cont ), myCont( cont ),
-myState( true ),
-myEmpty( true )
-{
-  if ( myCont->mainWindow() )
-    myState = myCont->mainWindow()->appropriate( myCont );
-
-  myCont->installEventFilter( this );
-  myVisible = myCont->isVisibleTo( myCont->parentWidget() );
-
-  installFilters();
-}
-
-/*!
-  Custom event filter
-*/
-bool QtxDockWindow::Watcher::eventFilter( QObject* o, QEvent* e )
-{
-  if ( o == myCont &&
-       ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ||
-         e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ||
-         e->type() == QEvent::ChildInserted ) )
-    QApplication::postEvent( this, new QCustomEvent( QEvent::User ) );
-
-  if ( o != myCont && e->type() == QEvent::IconChange )
-    updateIcon();
-
-  if ( o != myCont && e->type() == QEvent::CaptionChange )
-    updateCaption();
-
-  if ( ( o != myCont && ( e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ) ) ||
-       ( o == myCont && ( e->type() == QEvent::ChildRemoved ) ) ||
-       ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ) )
-    updateVisibility();
-
-  return false;
-}
-
-/*!
-  Sets internal status to shown
-*/
-void QtxDockWindow::Watcher::shown( QtxDockWindow* dw )
-{
-  if ( dw != myCont )
-    return;
-
-  myVisible = true;
-}
-
-/*!
-  Sets internal status to hidden
-*/
-void QtxDockWindow::Watcher::hided( QtxDockWindow* dw )
-{
-  if ( dw != myCont )
-    return;
-
-  myVisible = false;
-}
-
-/*!
-  Shows corresponding dock window
-*/
-void QtxDockWindow::Watcher::showContainer()
-{
-  if ( !myCont )
-    return;
-
-  QtxDockWindow* cont = myCont;
-  myCont = 0;
-  cont->show();
-  myCont = cont;
-}
-
-/*!
-  Hides corresponding dock window
-*/
-void QtxDockWindow::Watcher::hideContainer()
-{
-  if ( !myCont )
-    return;
-
-  QtxDockWindow* cont = myCont;
-  myCont = 0;
-  cont->hide();
-  myCont = cont;
-}
-
-/*!
-  Event filter of custom events
-*/
-void QtxDockWindow::Watcher::customEvent( QCustomEvent* e )
-{
-  installFilters();
-
-  updateIcon();
-  updateCaption();
-  updateVisibility();
-}
-
-/*!
-  Installs this object as event filter to all widgets inside corresponding main window
-*/
-void QtxDockWindow::Watcher::installFilters()
-{
-  if ( !myCont )
-    return;
-
-  QBoxLayout* bl = myCont->boxLayout();
-  if ( !bl )
-    return;
-
-  for ( QLayoutIterator it = bl->iterator(); it.current(); ++it )
-  {
-    if ( it.current()->widget() )
-      it.current()->widget()->installEventFilter( this );
-  }
-}
-
-/*!
-  Updates visibility of all widgets inside corresponding main window
-*/
-void QtxDockWindow::Watcher::updateVisibility()
-{
-  if ( !myCont )
-    return;
-
-  QBoxLayout* bl = myCont->boxLayout();
-  if ( !bl )
-    return;
-
-  bool vis = false;
-  for ( QLayoutIterator it = bl->iterator(); it.current() && !vis; ++it )
-    vis = it.current()->widget() && it.current()->widget()->isVisibleTo( myCont );
-
-  QMainWindow* mw = myCont->mainWindow();
-  if ( mw && myEmpty == vis )
-  {
-    myEmpty = !vis;
-    if ( !myEmpty )
-      mw->setAppropriate( myCont, myState );
-    else
-    {
-      myState = mw->appropriate( myCont );
-      mw->setAppropriate( myCont, false );
-    }
-  }
-
-  vis = !myEmpty && myVisible;
-  if ( vis != myCont->isVisibleTo( myCont->parentWidget() ) )
-    vis ? showContainer() : hideContainer();
-}
-
-/*!
-  Updates icon of corresponding main window
-*/
-void QtxDockWindow::Watcher::updateIcon()
-{
-  if ( !myCont || !myCont->widget() )
-    return;
-  
-  const QPixmap* ico = myCont->widget()->icon();
-  myCont->setIcon( ico ? *ico : QPixmap() );
-}
-
-/*!
-  Updates caption of corresponding main window
-*/
-void QtxDockWindow::Watcher::updateCaption()
-{
-  if ( myCont && myCont->widget() && !myCont->widget()->caption().isNull() )
-    myCont->setCaption( myCont->widget()->caption() );
-}
-
-/*!
-  Constructor
-*/
-QtxDockWindow::QtxDockWindow( Place p, QWidget* parent, const char* name, WFlags f )
-: QDockWindow( p, parent, name, f ),
-myWatcher( 0 ),
-myStretch( false )
-{
-}
-
-/*!
-  Constructor
-*/
-QtxDockWindow::QtxDockWindow( const bool watch, QWidget* parent, const char* name, WFlags f )
-: QDockWindow( InDock, parent, name, f ),
-myWatcher( 0 ),
-myStretch( false )
-{
-  if ( watch )
-    myWatcher = new Watcher( this );
-}
-
-/*!
-  Constructor
-*/
-QtxDockWindow::QtxDockWindow( QWidget* parent, const char* name, WFlags f )
-: QDockWindow( InDock, parent, name, f ),
-myWatcher( 0 ),
-myStretch( false )
-{
-}
-
-/*!
-  Destructor
-*/
-QtxDockWindow::~QtxDockWindow()
-{
-}
-
-/*!
-  Sets the dock window's main widget
-  \param wid - new main widget
-*/
-void QtxDockWindow::setWidget( QWidget* wid )
-{
-  if ( wid )
-  {
-    if ( wid->parentWidget() != this )
-      wid->reparent( this, QPoint( 0, 0 ), wid->isVisibleTo( wid->parentWidget() ) );
-    if ( myWatcher )
-    {
-      setCaption( wid->caption() );
-      if ( wid->icon() )
-        setIcon( *wid->icon() );
-    }
-  }
-
-  QDockWindow::setWidget( wid );
-}
-
-/*!
-  \return true if the dock window is stretchable
-*/
-bool QtxDockWindow::isStretchable() const
-{
-  return myStretch;
-}
-
-/*!
-  Sets the dock window "stretchable" state
-  \param on - new state
-*/
-void QtxDockWindow::setStretchable( const bool on )
-{
-  if ( myStretch == on )
-    return;
-
-  myStretch = on;
-
-  boxLayout()->setStretchFactor( widget(), myStretch ? 1 : 0 );
-
-  if ( myStretch != isHorizontalStretchable() ||
-       myStretch != isVerticalStretchable() )
-  {
-         if ( orientation() == Horizontal )
-           setHorizontalStretchable( myStretch );
-         else
-           setVerticalStretchable( myStretch );
-  }
-}
-
-/*!
-  \return the recommended size for the widget
-*/
-QSize QtxDockWindow::sizeHint() const
-{
-  QSize sz = QDockWindow::sizeHint();
-
-  if ( place() == InDock && isStretchable() && area() )
-  {
-    if ( orientation() == Horizontal )
-      sz.setWidth( area()->width() );
-    else
-      sz.setHeight( area()->height() );
-  }
-
-  return sz;
-}
-
-/*!
-  \return the recommended minimum size for the widget
-*/
-QSize QtxDockWindow::minimumSizeHint() const
-{
-  QSize sz = QDockWindow::minimumSizeHint();
-
-  if ( orientation() == Horizontal )
-         sz = QSize( 0, QDockWindow::minimumSizeHint().height() );
-  else
-    sz = QSize( QDockWindow::minimumSizeHint().width(), 0 );
-
-  if ( place() == InDock && isStretchable() && area() )
-  {
-    if ( orientation() == Horizontal )
-      sz.setWidth( area()->width() );
-    else
-      sz.setHeight( area()->height() );
-  }
-
-  return sz;
-}
-
-/*!
-  \return corresponding main window
-*/
-QMainWindow* QtxDockWindow::mainWindow() const
-{
-  QMainWindow* mw = 0;
-
-  QWidget* wid = parentWidget();
-  while ( !mw && wid )
-  {
-    if ( wid->inherits( "QMainWindow" ) )
-      mw = (QMainWindow*)wid;
-    wid = wid->parentWidget();
-  }
-
-  return mw;
-}
-
-/*!
-  Shows window
-*/
-void QtxDockWindow::show()
-{
-  if ( myWatcher )
-    myWatcher->shown( this );
-
-  QDockWindow::show();
-}
-
-/*!
-  Hides window
-*/
-void QtxDockWindow::hide()
-{
-  if ( myWatcher )
-    myWatcher->hided( this );
-
-  QDockWindow::hide();
-}
diff --git a/src/Qtx/QtxDockWindow.h b/src/Qtx/QtxDockWindow.h
deleted file mode 100644 (file)
index 6aa0190..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxDockWindow.h
-// Author:    Sergey TELKOV
-
-#include "Qtx.h"
-
-#include <qdockwindow.h>
-
-class QTX_EXPORT QtxDockWindow : public QDockWindow
-{
-  Q_OBJECT
-
-  class Watcher;
-
-public:
-  QtxDockWindow( Place = InDock, QWidget* = 0, const char* = 0, WFlags = 0 );
-  QtxDockWindow( const bool, QWidget*, const char* = 0, WFlags = 0 );
-  QtxDockWindow( QWidget*, const char* = 0, WFlags = 0 );
-  virtual ~QtxDockWindow();
-
-  virtual void  setWidget( QWidget* );
-
-  bool          isStretchable() const;
-  virtual void  setStretchable( const bool );
-
-  virtual QSize sizeHint() const;
-  virtual QSize minimumSizeHint() const;
-
-  QMainWindow*  mainWindow() const;
-
-public slots:
-  virtual void  show();
-  virtual void  hide();
-
-private:
-  Watcher*      myWatcher;
-  bool          myStretch;
-};
diff --git a/src/Qtx/QtxDoubleSpinBox.cxx b/src/Qtx/QtxDoubleSpinBox.cxx
new file mode 100644 (file)
index 0000000..87d5b60
--- /dev/null
@@ -0,0 +1,313 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxDoubleSpinBox.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxDoubleSpinBox.h"
+
+#include <QLineEdit>
+#include <QDoubleValidator>
+
+/*!
+  \class QtxDoubleSpinBox
+  \brief Enhanced version of the Qt's double spin box.
+
+  The QtxDoubleSpinBox class represents the widget for entering the
+  floating point values. In addition to the functionality provided by
+  QDoubleSpinBox, this class supports "cleared" state - this is the
+  state corresponding to "None" (or empty) entered value.
+
+  To set "cleared" state use setCleared() method. To check if the spin
+  box stores "cleared" state, use isCleared() method.
+  For example:
+  \code
+  if (myDblSpinBox->isCleared()) {
+    ... // process "None" state
+  }
+  else {
+    double value = myDblSpinBox->value();
+    ... // process entered value
+  }
+  \endcode
+*/
+
+/*!
+  \brief Constructor.
+
+  Constructs a spin box with 0.0 as minimum value and 99.99 as maximum value,
+  a step value of 1.0 and a precision of 2 decimal places. 
+  The value is initially set to 0.00.
+
+  \param parent parent object
+*/
+QtxDoubleSpinBox::QtxDoubleSpinBox( QWidget* parent )
+: QDoubleSpinBox( parent ),
+  myCleared( false ),
+  myPrecision(0)
+{
+  connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), 
+          this, SLOT( onTextChanged( const QString& ) ) );
+}
+
+/*!
+  \brief Constructor.
+
+  Constructs a spin box with specified minimum, maximum and step value.
+  The precision is set to 2 decimal places. 
+  The value is initially set to the minimum value.
+
+  \param min spin box minimum possible value
+  \param max spin box maximum possible value
+  \param step spin box increment/decrement value
+  \param parent parent object
+*/
+QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, QWidget* parent )
+: QDoubleSpinBox( parent ),
+  myCleared( false ),
+  myPrecision( 0 )
+{
+  setMinimum( min );
+  setMaximum( max );
+  setSingleStep( step );
+
+  connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), 
+          this, SLOT( onTextChanged( const QString& ) ) );
+}
+
+/*!
+  \brief Constructor.
+
+  Constructs a spin box with specified minimum, maximum and step value.
+  The precision is set to 2 decimal places. 
+  The value is initially set to the minimum value.
+
+  \param min spin box minimum possible value
+  \param max spin box maximum possible value
+  \param step spin box increment/decrement value
+  \param parent parent object
+*/
+QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, int prec, int dec, QWidget* parent )
+: QDoubleSpinBox( parent ),
+  myCleared( false ),
+  myPrecision( prec )
+{
+  setDecimals( dec );
+  setMinimum( min );
+  setMaximum( max );
+  setSingleStep( step );
+
+  connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), 
+          this, SLOT( onTextChanged( const QString& ) ) );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxDoubleSpinBox::~QtxDoubleSpinBox()
+{
+}
+
+/*!
+  \brief Check if spin box is in the "cleared" state.
+  \return \c true if spin box is cleared
+  \sa setCleared()
+*/
+bool QtxDoubleSpinBox::isCleared() const
+{
+  return myCleared;
+}
+
+/*!
+  \brief Change "cleared" status of the spin box.
+  \param on new "cleared" status
+  \sa isCleared()
+*/
+void QtxDoubleSpinBox::setCleared( const bool on )
+{
+  if ( myCleared == on )
+    return;
+  
+  myCleared = on;
+  setSpecialValueText( specialValueText() );
+}
+
+/*!
+  \brief Set precision of the spin box
+  
+  If precision value is less than 0, the 'g' format is used for value output,
+  otherwise 'f' format is used.
+
+  \param prec new precision value.
+  \sa precision()
+*/
+void QtxDoubleSpinBox::setPrecision( const int prec )
+{
+  int newPrec = qMax( prec, 0 );
+  int oldPrec = qMax( myPrecision, 0 );
+  myPrecision = prec;
+  if ( newPrec != oldPrec )
+    update();
+}
+
+/*!
+  \brief Get precision value of the spin box
+  \return current prevision value
+  \sa setPrecision()
+*/
+int QtxDoubleSpinBox::getPrecision() const
+{
+  return myPrecision;
+}
+
+/*!
+  \brief Interpret text entered by the user as a value.
+  \param text text entered by the user
+  \return mapped value
+  \sa textFromValue()
+*/
+double QtxDoubleSpinBox::valueFromText( const QString& text ) const
+{
+  if (myPrecision < 0)
+    return text.toDouble();
+
+  return QDoubleSpinBox::valueFromText(text);
+}
+
+/*!
+  \brief This function is used by the spin box whenever it needs to display
+  the given value.
+
+  \param val spin box value
+  \return text representation of the value
+  \sa valueFromText()
+*/
+QString QtxDoubleSpinBox::textFromValue( double val ) const
+{
+  QString s = QLocale().toString( val, myPrecision >= 0 ? 'f' : 'g', myPrecision == 0 ? 6 : qAbs( myPrecision ) );
+  return removeTrailingZeroes( s );
+}
+
+/*!
+  \brief Return source string with removed leading and trailing zeros.
+  \param str source string
+  \return resulting string
+*/
+QString QtxDoubleSpinBox::removeTrailingZeroes( const QString& src ) const
+{
+  QString delim( QLocale().decimalPoint() );
+
+  int idx = src.lastIndexOf( delim );
+  if ( idx == -1 )
+    return src;
+
+  QString iPart = src.left( idx );
+  QString fPart = src.mid( idx + 1 );
+
+  while ( !fPart.isEmpty() && fPart.at( fPart.length() - 1 ) == '0' )
+    fPart.remove( fPart.length() - 1, 1 );
+
+  QString res = iPart;
+  if ( !fPart.isEmpty() )
+    res += delim + fPart;
+
+  return res;
+}
+
+/*!
+  \brief Perform \a steps increment/decrement steps.
+  
+  The \a steps value can be any integer number. If it is > 0,
+  the value incrementing is done, otherwise value is decremented
+  \a steps times.  
+
+  \param steps number of increment/decrement steps
+*/
+void QtxDoubleSpinBox::stepBy( int steps )
+{
+  myCleared = false;
+
+  QDoubleSpinBox::stepBy( steps );
+}
+
+/*!
+  \brief This function is used to determine whether input is valid.
+  \param str currently entered value
+  \param pos cursor position in the string
+  \return validating operation result
+*/
+QValidator::State QtxDoubleSpinBox::validate( QString& str, int& pos ) const
+{
+  if (myPrecision >= 0)
+    return QDoubleSpinBox::validate(str, pos);
+
+  QString pref = this->prefix();
+  QString suff = this->suffix();
+  uint overhead = pref.length() + suff.length();
+  QValidator::State state = QValidator::Invalid;
+
+  QDoubleValidator v (NULL);
+  v.setDecimals( decimals() );
+  v.setBottom( minimum() );
+  v.setTop( maximum() );
+  v.setNotation( QDoubleValidator::ScientificNotation );
+
+  if ( overhead == 0 )
+    state = v.validate( str, pos );
+  else
+    {
+      if ( str.length() >= overhead && str.startsWith( pref ) &&
+          str.right( suff.length() ) == suff )
+       {
+         QString core = str.mid( pref.length(), str.length() - overhead );
+         int corePos = pos - pref.length();
+         state = v.validate( core, corePos );
+         pos = corePos + pref.length();
+         str.replace( pref.length(), str.length() - overhead, core );
+       }
+      else
+       {
+         state = v.validate( str, pos );
+         if ( state == QValidator::Invalid )
+           {
+             QString special = this->specialValueText().trimmed();
+             QString candidate = str.trimmed();
+             if ( special.startsWith( candidate ) )
+               {
+                 if ( candidate.length() == special.length() )
+                   state = QValidator::Acceptable;
+                 else
+                   state = QValidator::Intermediate;
+               }
+           }
+       }
+    }
+  return state;
+}
+
+/*!
+  \brief Called when user enters the text in the spin box.
+  \param txt current spin box text (not used)
+*/
+void QtxDoubleSpinBox::onTextChanged( const QString& /*txt*/ )
+{
+  myCleared = false;
+}
diff --git a/src/Qtx/QtxDoubleSpinBox.h b/src/Qtx/QtxDoubleSpinBox.h
new file mode 100644 (file)
index 0000000..5c094e8
--- /dev/null
@@ -0,0 +1,67 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxDoubleSpinBox.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXDOUBLESPINBOX_H
+#define QTXDOUBLESPINBOX_H
+
+#include "Qtx.h"
+
+#include <QDoubleSpinBox>
+#include <QValidator>
+
+class QTX_EXPORT QtxDoubleSpinBox : public QDoubleSpinBox
+{
+  Q_OBJECT
+
+public:
+  QtxDoubleSpinBox( QWidget* = 0 );
+  QtxDoubleSpinBox( double, double, double = 1, QWidget* = 0 );
+  QtxDoubleSpinBox( double, double, double, int, int, QWidget* = 0 );
+  virtual ~QtxDoubleSpinBox();
+
+  bool            isCleared() const;
+  virtual void    setCleared( const bool );
+
+  int             getPrecision() const ;
+  void            setPrecision( const int );
+
+  virtual void    stepBy( int );
+
+  virtual double  valueFromText( const QString& ) const;
+  virtual QString textFromValue( double ) const;
+
+  virtual QValidator::State validate( QString&, int& ) const;
+
+private slots:
+  virtual void    onTextChanged( const QString& );
+
+protected:
+  QString         removeTrailingZeroes( const QString& ) const;
+
+private:
+  bool            myCleared;
+  int             myPrecision;
+};
+
+#endif
diff --git a/src/Qtx/QtxEvalExpr.cxx b/src/Qtx/QtxEvalExpr.cxx
new file mode 100644 (file)
index 0000000..3f8630d
--- /dev/null
@@ -0,0 +1,2439 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxEvalExpr.cxx
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
+//
+#include "QtxEvalExpr.h"
+
+#include <QStack>
+
+#include <math.h>
+
+/*!
+  \class QtxEvalExpr
+  \brief String expression evaluator.
+*/
+
+/*!
+  \brief Constructor.
+
+  The evaluator is initalized by standard operations. Use another constructor with parameter
+  \a stdSets = \c false to avoid initialization of evaluator with standard operations.
+
+  \param expr expression to be evaluated
+*/
+QtxEvalExpr::QtxEvalExpr( const QString& expr )
+{
+  intialize( true, expr );
+}
+
+/*!
+  \brief Constructor.
+  \param stdSets if \c true, the evaluator is initalized by standard operations
+  \param expr expression to be evaluated
+*/
+QtxEvalExpr::QtxEvalExpr( const bool stdSets, const QString& expr )
+{
+  intialize( stdSets, expr );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxEvalExpr::~QtxEvalExpr()
+{
+  delete myParser;
+}
+
+/*!
+  \brief Initialize the evaluator.
+  \param stdSets if \c true, the evaluator is initalized by standard operations
+  \param expr expression to be evaluated
+*/
+void QtxEvalExpr::intialize( const bool stdSets, const QString& expr )
+{
+  myParser = new QtxEvalParser();
+  if ( stdSets )
+  {
+    myParser->setAutoDeleteOperationSets( true );
+    myParser->insertOperationSet( new QtxEvalSetLogic() );
+    myParser->insertOperationSet( new QtxEvalSetArithmetic() );
+    myParser->insertOperationSet( new QtxEvalSetString() );
+    myParser->insertOperationSet( new QtxEvalSetMath() );
+    myParser->insertOperationSet( new QtxEvalSetSets() );
+    myParser->insertOperationSet( new QtxEvalSetConst() );
+  }
+  setExpression( expr );
+}
+
+/*!
+  \brief Evaluate the expression.
+  \param expr expression to be evaluated
+  \return result of the evaluation
+*/
+QVariant QtxEvalExpr::calculate( const QString& expr )
+{
+  if ( !expr.isEmpty() )
+    setExpression( expr );
+  return myParser->calculate();
+}
+
+/*!
+  \brief Get the expression.
+  \return expression string
+*/
+QString QtxEvalExpr::expression() const
+{
+  return myExpr;
+}
+
+/*!
+  \brief Set the expression.
+  \param expr expression string
+*/
+void QtxEvalExpr::setExpression( const QString& expr )
+{
+  if ( expr == expression() )
+    return;
+
+  myExpr = expr;
+  myParser->setExpression( myExpr );
+}
+
+/*!
+  \brief Get the code of latest parsing error.
+  \return the code of the last error
+*/
+QtxEvalExpr::Error QtxEvalExpr::error() const
+{
+  return myParser->error();
+}
+
+/*!
+  \brief Get the expression parser.
+  \return expression parser
+*/
+QtxEvalParser* QtxEvalExpr::parser() const
+{
+  return myParser;
+}
+
+/*!
+  \brief Get current set of operations.
+  \return operations set
+  \sa insertOperationSet(), removeOperationSet(), operationSet()
+*/
+QList<QtxEvalSet*> QtxEvalExpr::operationSets() const
+{
+  return myParser->operationSets();
+}
+
+/*!
+  \brief Install the operation.
+  \param operation to be added
+  \param idx index in the list at which the operation shoud be inserted
+  \sa operationSets(), removeOperationSet(), operationSet()
+*/
+void QtxEvalExpr::insertOperationSet( QtxEvalSet* set, const int idx )
+{
+  myParser->insertOperationSet( set, idx );
+}
+
+/*!
+  \brief Remove the operation.
+  \param operation to be removed
+  \sa operationSets(), insertOperationSet(), operationSet()
+*/
+void QtxEvalExpr::removeOperationSet( QtxEvalSet* set )
+{
+  myParser->removeOperationSet( set );
+}
+
+/*!
+  \brief Get the operation by name.
+  \param name operation name
+  \return operation of 0 if not found
+  \sa operationSets(), insertOperationSet(), removeOperationSet()
+*/
+QtxEvalSet* QtxEvalExpr::operationSet( const QString& name ) const
+{
+  return myParser->operationSet( name );
+}
+
+/*!
+  \brief Get the 'auto-delete operations' flag value.
+  \return \c true if all operations shoud be automatically deleted when the evaluator is destroyed
+  \sa setAutoDeleteOperationSets()
+*/
+bool QtxEvalExpr::autoDeleteOperationSets() const
+{
+  return myParser->autoDeleteOperationSets();
+}
+
+/*!
+  \brief Set the 'auto-delete operations' flag value.
+  \param on if \c true, all operations shoud be automatically deleted when the evaluator is destroyed
+  \sa autoDeleteOperationSets()
+*/
+void QtxEvalExpr::setAutoDeleteOperationSets( const bool on )
+{
+  myParser->setAutoDeleteOperationSets( on );
+}
+
+/*!
+  \class QtxEvalParser
+  \brief Expression parser.
+
+  This class provides the functionality to calculate value of the expression using defined set of operations.
+  Standard operations (arithmetics, logic, strings, etc) are implemented in the corresponding successors of the
+  QtxEvalSet class: QtxEvalSetArithmetic, QtxEvalSetLogic, QtxEvalSetMath, QtxEvalSetString, ...
+
+  The parser allows using parameters with help of methods has(), set(), remove(), value(). It uses
+  postfix representation of expressions and uses class QtxEvalSet in order to make certain operation.
+
+  Every instance of parser contains only one postfix - thus, if the expression is changed, the postfix
+  must be rebuilt. In order to increase performance of frequent calculations for many of expressions it is 
+  recommended to use different instances of the parser for each expression.
+*/
+
+/*!
+  \brief Constructor.
+*/
+QtxEvalParser::QtxEvalParser()
+: myAutoDel( false )
+{
+  setError( QtxEvalExpr::OK );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxEvalParser::~QtxEvalParser()
+{
+  if ( autoDeleteOperationSets() )
+    qDeleteAll( mySets );
+}
+
+/*!
+  \brief Get current operations set.
+  \return current operations set
+*/
+QList<QtxEvalSet*> QtxEvalParser::operationSets() const
+{
+  return mySets;
+}
+
+/*!
+  \brief Get the operations set by \a name.
+  \param name the name of the operation set
+  \return operation set or 0 if not found
+*/
+QtxEvalSet* QtxEvalParser::operationSet( const QString& name ) const
+{
+  QtxEvalSet* set = 0;
+  for ( SetList::const_iterator it = mySets.begin(); it != mySets.end() && !set; ++it )
+  {
+    if ( (*it)->name() == name )
+      set = *it;
+  }
+  return set;
+}
+
+/*!
+  \brief Install the operations set.
+  \param operations set to be added
+  \param idx index in the list at which the operations set shoud be inserted
+  \sa operationSets(), removeOperationSet(), operationSet()
+*/
+void QtxEvalParser::insertOperationSet( QtxEvalSet* set, const int idx )
+{
+  if ( mySets.contains( set ) )
+    return;
+
+  int index = idx < 0 ? mySets.count() : idx;
+  index = qMin( index, mySets.count() );
+  mySets.insert( index, set );
+}
+
+/*!
+  \brief Remove the operations set.
+  \param operations set to be removed
+  \sa operationSets(), insertOperationSet(), operationSet()
+*/
+void QtxEvalParser::removeOperationSet( QtxEvalSet* set )
+{
+  mySets.removeAll( set );
+}
+
+/*!
+  \brief Get the 'auto-delete operations' flag value.
+  \return \c true if all operations shoud be automatically deleted when the parser is destroyed
+  \sa setAutoDeleteOperationSets()
+*/
+bool QtxEvalParser::autoDeleteOperationSets() const
+{
+  return myAutoDel;
+}
+
+/*!
+  \brief Set the 'auto-delete operations' flag value.
+  \param on if \c true, all operations shoud be automatically deleted when the parser is destroyed
+  \sa autoDeleteOperationSets()
+*/
+void QtxEvalParser::setAutoDeleteOperationSets( const bool on )
+{
+  myAutoDel = on;
+}
+
+/*!
+  \brief Search elements of the list as substrings starting from \a offset.
+  \param list list of substrings
+  \param str string in which the searching is performed
+  \param offset starting index for search
+  \param matchLen returning matching length of any substring
+  \param listind returning index of the found substring in the \a list
+  \return position of first found substring inside the \a str or -1 if no matches is found
+*/
+int QtxEvalParser::search( const QStringList& list, const QString& str,
+                           int offset, int& matchLen, int& listind )
+{
+  int min = -1;
+  QStringList::const_iterator anIt = list.begin(), aLast = list.end();
+  for ( int ind = 0; anIt != aLast; anIt++, ind++ )
+  {
+    int pos = str.indexOf( *anIt, offset );
+    if ( pos >= 0 && ( min < 0 || min > pos ||
+                       ( min == pos && matchLen < (int)(*anIt).length() ) ) )
+    {
+      min = pos;
+      listind = ind;
+      matchLen = (*anIt).length();
+    }
+  }
+  if ( min < 0 )
+    matchLen = 0;
+  return min;
+}
+
+/*!
+  \brief Get the substring field from the string \a str.
+  \param str source string
+  \param pos start position of the substring
+  \param len length of the substring
+  \return substring (leading and trailing spaces are truncated)
+*/
+QString QtxEvalParser::note( const QString& str, int pos, int len )
+{
+    return str.mid( pos, len ).trimmed();
+}
+
+/*!
+  \brief Prepare to the parsing.
+
+  Performs the first step of the parsing:
+  - find tokens
+  - determine tokens types
+  - create unsorted pseudo-postfix (with brackets)
+
+  \param expr string expression
+  \param post postfix to be created
+  \return \c true on success and \c false if error is found
+*/
+bool QtxEvalParser::prepare( const QString& expr, Postfix& post )
+{
+  int pos = 0;
+  int len = expr.length();
+  QStack<int> aBracketStack;
+  QStringList anOpers, anOpenBr, aCloseBr;
+  if ( !checkOperations() )
+    return false;
+
+  bracketsList( anOpenBr, true );
+  bracketsList( aCloseBr, false );
+  operationList( anOpers );
+
+  while ( pos < len && error() == QtxEvalExpr::OK )
+  {
+    PostfixItem item;
+    while ( pos < len && expr[pos].isSpace() )
+      pos++;
+    if ( pos >= len )
+      break;
+
+    int mBrLen = 0, mLen = 0, br_ind = -1, op_ind = -1;
+    int oPos = search( anOpenBr, expr, pos, mBrLen, br_ind );
+    int cPos = oPos == pos ? -1 : search( aCloseBr, expr, pos, mBrLen, br_ind );
+    int opPos = search( anOpers, expr, pos, mLen, op_ind );
+
+    if ( expr[pos] == QChar( '\'' ) )
+    {
+      int vpos = pos + 1;
+      while ( vpos < (int)expr.length() && expr[vpos] != QChar( '\'' ) )
+        vpos++;
+
+      mLen = vpos - pos + 1;
+
+      int res = createValue( note( expr, pos, mLen ), item.myValue );
+      item.myType = res ? Value : Param;
+      post.append( item );
+      pos = vpos + 1;
+      continue;
+    }
+
+    if ( oPos == pos )
+    {
+      aBracketStack.push( br_ind );
+      item.myValue = note( expr, pos, mBrLen );
+      item.myType = Open;
+      post.append( item );
+    }
+    else if ( cPos == pos )
+    {
+      if ( aBracketStack.count() == 0 )
+      {
+        setError( QtxEvalExpr::ExcessClose );
+        break;
+      }
+      if ( br_ind != aBracketStack.top() )
+      {
+        setError( QtxEvalExpr::BracketsNotMatch );
+        break;
+      }
+      else
+      {
+        aBracketStack.pop();
+        item.myValue = note( expr, pos, mBrLen );
+        item.myType = Close;
+        post.append( item );
+      }
+    }
+    else
+      mBrLen = 0;
+
+    if ( opPos == pos )
+    {
+      mBrLen = 0;
+      item.myValue = note( expr, pos, mLen );
+      item.myType = Binary;
+
+      if ( oPos == pos )
+        post.insert( post.count() - 1, item );
+      else
+        post.append( item );
+    }
+    else
+    {
+      mLen = 0;
+      if ( oPos != pos && cPos != pos )
+      {
+             int i; 
+        for ( i = pos + 1; i < (int)expr.length(); i++ )
+        {
+          if ( expr[i].isSpace() )
+            break;
+        }
+
+        int vpos = i;
+        if ( oPos >= 0 && oPos < vpos )
+          vpos = oPos;
+        if ( cPos >= 0 && cPos < vpos )
+          vpos = cPos;
+        if ( opPos >= 0 && opPos < vpos )
+          vpos = opPos;
+
+        while( vpos < (int)expr.length() && 
+               ( expr[vpos].isLetter() || expr[vpos].isDigit() || expr[vpos]=='_' ) )
+          vpos++;
+
+        mLen = vpos - pos;
+        bool res = createValue( note( expr, pos, mLen ), item.myValue );
+        item.myType = res ? Value : Param;
+        post.append( item );
+      }
+    }
+
+    pos += mBrLen + mLen;
+  }
+
+  //Bracket checking
+  int brValue = 0;
+  for ( Postfix::iterator anIt = post.begin(); anIt != post.end(); ++anIt )
+  {
+    if ( (*anIt).myType == Open )
+      brValue++;
+    else if ( (*anIt).myType == Close )
+    {
+      if ( brValue > 0 )
+        brValue--;
+      else
+      {
+        setError( QtxEvalExpr::ExcessClose );
+        break;
+      }
+    }
+  }
+
+  if ( brValue > 0 )
+    setError( QtxEvalExpr::CloseExpected );
+
+  return error() == QtxEvalExpr::OK;
+}
+
+/*!
+  \brief Analyze the operations used.
+  
+  Second step of the parsing: analyze the types of the operations used in the expression.
+
+  \param post unsorted postfix
+  \return \c true on success and \c false if error is found
+*/
+bool QtxEvalParser::setOperationTypes( Postfix& post )
+{
+  if ( !checkOperations() )
+    return false;
+
+  QStringList anOpen, aClose;
+  bracketsList( anOpen, true );
+  bracketsList( aClose, false );
+
+  Postfix::iterator aPrev, aNext;
+  for ( Postfix::iterator anIt = post.begin(); anIt != post.end(); ++anIt )
+  {
+    aPrev = anIt;
+    aPrev--;
+    aNext = anIt;
+    aNext++;
+    if ( (*anIt).myType != Binary )
+      continue;
+
+    if ( ( anIt == post.begin() || (*aPrev).myType == Open ||
+           (*aPrev).myType == Pre || (*aPrev).myType == Binary ) &&  aNext != post.end() &&
+         ( (*aNext).myType == Value || (*aNext).myType == Param ||
+           (*aNext).myType == Open  || (*aNext).myType == Binary ) )
+      (*anIt).myType = Pre;
+    else if ( anIt != post.begin() && ( (*aPrev).myType == Close || (*aPrev).myType == Param ||
+                                        (*aPrev).myType == Value || (*aPrev).myType == Pre ||
+                                        (*aPrev).myType == Post || (*aPrev).myType == Binary ) &&
+              ( aNext == post.end() || (*aNext).myType == Close ) )
+      (*anIt).myType = Post;
+
+    if ( anOpen.contains( (*anIt).myValue.toString() ) )
+      (*anIt).myType = Pre;
+    else if ( aClose.contains( (*anIt).myValue.toString() ) )
+      (*anIt).myType = Post;
+  }
+
+  return error() == QtxEvalExpr::OK;
+}
+
+/*!
+  \brief Get the number of the globar brackets pairs.
+
+  For example, the expression '((2+3))' has 2 global brackets pairs.
+
+  \param post postfix to be checked
+  \param f starting position for the search
+  \param l last position for the search
+  \return number of brackets pairs
+*/
+int QtxEvalParser::globalBrackets( const QtxEvalParser::Postfix& post, int f, int l )
+{
+  int i;
+  int start_br = 0;
+  int fin_br = 0;
+  int br = 0;
+  int br_num = 0;
+  int min_br_num = (l-f+1)*5;
+    
+  for( i=f; i<=l; i++ )
+    if( post[ i ].myType==QtxEvalParser::Open )
+      start_br++;
+    else
+      break;
+  for( i=l; i>=f; i-- )
+    if( post[ i ].myType==QtxEvalParser::Close )
+      fin_br++;
+    else
+      break;
+
+  br = start_br<fin_br ? start_br : fin_br;
+  for( i=f+br; i<=l-br; i++ )
+  {
+    if( post[i].myType==QtxEvalParser::Open )
+      br_num++;
+    else if( post[i].myType==QtxEvalParser::Close )
+      br_num--;
+    if( br_num<min_br_num )
+      min_br_num = br_num;
+  }
+  
+  return br+min_br_num;
+}
+
+/*!
+  \brief Sort the operations in the postfix.
+
+  Third step of parsing: sort the postfix operations in order to convert it to real postfix.
+
+  \param post source postfix
+  \param res returning resulting postfix
+  \param anOpen list of open brackets
+  \param aClose list of close brackets
+  \param f start index of postfix for sorting
+  \param l last index of postfix for sorting
+  \return \c true on success and \c false if error is found
+*/
+bool QtxEvalParser::sort( const Postfix& post, Postfix& res, const QStringList& anOpen,
+                          const QStringList& aClose, int f, int l )
+{
+  if ( l < f )
+    return true;
+
+  if ( f < 0 )
+    f = 0;
+
+  if ( l < 0 )
+    l = post.count() - 1;
+
+  int br = globalBrackets( post, f, l );
+  f += br;
+  l -= br;
+
+  if ( f == l && f >= 0 )
+    res.append( post[f] );
+
+  if ( l <= f )
+    return true;
+
+  if ( !checkOperations() )
+    return false;
+
+  int min = -1;
+  QIntList argmin;
+  QList<PostfixItemType> min_types;
+
+  for ( int i = 0, j = f; j <= l; i++, j++ )
+  {
+    const PostfixItem& item = post[j];
+    PostfixItemType tt = item.myType;
+    if ( tt == Binary || tt == Pre || tt == Post )
+    {
+      int cur_pr = priority( item.myValue.toString(), tt == Binary );
+      if ( cur_pr > 0 )
+      {
+        if ( min < 0 || min >= cur_pr )
+        {
+          if ( min == cur_pr )
+          {
+            argmin.append( f + i );
+            min_types.append( tt );
+          }
+          else
+          {
+            min = cur_pr;
+            argmin.clear();
+            argmin.append( f + i );
+            min_types.clear(); min_types.append( tt );
+          }
+        }
+      }
+      else
+      {
+        setError( QtxEvalExpr::InvalidOperation );
+        break;
+      }
+    }
+    else if ( tt == Open )
+    {
+      QString opBr = item.myValue.toString();
+      int ind = anOpen.indexOf( opBr ), brValue = 0;
+      while ( j <= l )
+      {
+        const PostfixItem& anItem = post[j];
+        if ( anItem.myType == Open )
+          brValue++;
+
+        if ( anItem.myType == Close )
+        {
+          brValue--;
+          QString clBr = anItem.myValue.toString();
+          if ( aClose.indexOf( clBr ) == ind && brValue == 0 )
+            break;
+        }
+        i++; j++;
+      }
+
+      if ( brValue > 0 )
+      {
+        setError( QtxEvalExpr::CloseExpected );
+          break;
+      }
+    }
+  }
+
+  if ( error() == QtxEvalExpr::OK )
+  {
+    if ( min >= 0 )
+    {
+      Postfix one;
+      QList<Postfix> parts;
+      QIntList::const_iterator anIt = argmin.begin(), aLast = argmin.end();
+      bool ok = sort( post, one, anOpen, aClose, f, *anIt - 1 );
+      parts.append( one );
+      one.clear();
+      for ( ; anIt != aLast && ok; anIt++ )
+      {
+        QIntList::const_iterator aNext = anIt; aNext++;
+        ok = sort( post, one, anOpen, aClose, *anIt + 1, aNext == aLast ? l : *aNext - 1 );
+        parts.append( one );
+        one.clear();
+      }
+
+      if ( !ok )
+        return false;
+
+      QStack<PostfixItem> aStack;
+      QList<Postfix>::const_iterator aPIt = parts.begin();
+      QList<PostfixItemType>::const_iterator aTIt = min_types.begin();
+      res += (*aPIt);
+      aPIt++;
+      anIt = argmin.begin();
+      for ( ; anIt != aLast; anIt++, aPIt++, aTIt++ )
+      {
+        if ( *aTIt == Pre )
+        {
+          if ( anOpen.contains( post[*anIt].myValue.toString() ) == 0 )
+          {
+            res += (*aPIt);
+            aStack.push( post[ *anIt ] );
+          }
+          else
+          {
+            res.append( post[*anIt] );
+            res += *aPIt;
+          }
+        }
+        else
+        {
+          res += *aPIt;
+          while ( !aStack.isEmpty() )
+          {
+            res.append( aStack.top() );
+            aStack.pop();
+          }
+          res.append( post[*anIt] );
+        }
+      }
+      while ( !aStack.isEmpty() )
+      {
+        res.append( aStack.top() );
+        aStack.pop();
+      }
+    }
+    else
+    { //there are no operations
+      for ( int k = f; k <= l; k++ )
+      {
+        if ( post.at( k ).myType==Value || post.at( k ).myType == Param )
+          res.append( post.at( k ) );
+      }
+    }
+  }
+
+  return error() == QtxEvalExpr::OK;
+}
+
+/*!
+  \brief Parse the expression and build the posfix.
+
+  If by parsing error is found, the function returns \c false. In this case the code of the error
+  can be retrieved with error() method.
+
+  \param expr string expression
+  \return \c true on success and \c false if error is found
+*/
+bool QtxEvalParser::parse( const QString& expr )
+{
+  myPostfix.clear();
+
+  if ( !checkOperations() )
+    return false;
+
+  Postfix p;
+  QStringList opens, closes;
+
+  setError( QtxEvalExpr::OK );
+  bracketsList( opens, true );
+  bracketsList( closes, false );
+
+  return prepare( expr, p ) && setOperationTypes( p ) && sort( p, myPostfix, opens, closes );
+}
+
+/*!
+  \brief Calculate the operation.
+
+  The result of the operation is returned in the parameter \a v1.
+
+  \param op operation name
+  \param v1 first argument (not valid for unary prefix operations)
+  \param v2 second argument (not valid for unary postfix operations)
+  \return \c true on success and \c false if error is found
+*/
+bool QtxEvalParser::calculate( const QString& op, QVariant& v1, QVariant& v2 )
+{
+  QtxEvalExpr::Error err = isValid( op, v1.type(), v2.type() );
+  if ( err == QtxEvalExpr::OK )
+    setError( calculation( op, v1, v2 ) );
+  else
+    setError( err );
+
+  return error() == QtxEvalExpr::OK;
+}
+
+/*!
+  \brief Calculate the expression without postfix rebuilding.
+  \return QVariant as result (it is invalid if there were errors during calculation)
+*/
+QVariant QtxEvalParser::calculate()
+{
+  if ( !checkOperations() )
+    return QVariant();
+
+  setError( QtxEvalExpr::OK );
+
+  QStringList anOpen, aClose;
+  bracketsList( anOpen, true );
+  bracketsList( aClose, false );
+
+  QStack<QVariant> aStack;
+  Postfix::iterator anIt = myPostfix.begin(), aLast = myPostfix.end();
+  for ( ; anIt != aLast && error() == QtxEvalExpr::OK; anIt++ )
+  {
+    QString nn = (*anIt).myValue.toString();
+    if ( (*anIt).myType == Param )
+    {
+      if ( hasParameter( nn ) )
+      {
+        QVariant& v = myParams[nn];
+        if ( v.isValid() )
+          aStack.push( v );
+        else
+          setError( QtxEvalExpr::InvalidToken );
+      }
+      else
+        setError( QtxEvalExpr::InvalidToken );
+    }
+    else if ( (*anIt).myType == Value )
+      aStack.push( (*anIt).myValue );
+    else if ( (*anIt).myType == Pre || (*anIt).myType == Post )
+    {
+      if ( anOpen.contains( nn ) )
+      {
+        QVariant inv;
+        if ( calculate( nn, inv, inv ) )
+          aStack.push( QVariant() );
+      }
+      else if ( aClose.contains( nn ) )
+      {
+        QList<QVariant> set;
+        while ( true )
+        {
+          if ( aStack.isEmpty() )
+          {
+            setError( QtxEvalExpr::StackUnderflow );
+            break;
+          }
+          if ( aStack.top().isValid() )
+          {
+            set.append( aStack.top() );
+            aStack.pop();
+          }
+          else
+          {
+            aStack.pop();
+            break;
+          }
+        }
+
+        QVariant qSet = set, inv;
+        if ( calculate( nn, qSet, inv ) )
+          aStack.push( set );
+      }
+      else if ( aStack.count() >= 1 )
+      {
+        QVariant inv;
+        QVariant* v1 = &aStack.top(), *v2 = &inv; //"post-" case
+        if ( (*anIt).myType == Pre )
+        {
+          v2 = &aStack.top();
+          v1 = &inv;
+        }
+        calculate( nn, *v1, *v2 );
+      }
+      else
+        setError( QtxEvalExpr::StackUnderflow );
+    }
+    else if ( (*anIt).myType == Binary )
+    {
+      if ( aStack.count() >= 2 )
+      {
+        QVariant v2 = aStack.top();
+        aStack.pop();
+        calculate( nn, aStack.top(), v2 );
+      }
+      else
+        setError( QtxEvalExpr::StackUnderflow );
+    }
+  }
+
+  QVariant res;
+  if ( error() == QtxEvalExpr::OK )
+  {
+    int count = aStack.count();
+    if ( count == 0 )
+      setError( QtxEvalExpr::StackUnderflow );
+    else if( count == 1 )
+      res = aStack.top();
+    else
+      setError( QtxEvalExpr::ExcessData );
+  }
+  return res;
+}
+
+/*!
+  \brief Change the expression, rebuild the postfix and calculate it.
+  \param expr new expression
+  \return QVariant as result (it is invalid if there were errors during calculation)
+*/
+QVariant QtxEvalParser::calculate( const QString& expr )
+{
+  setExpression( expr );
+  return calculate();
+}
+
+/*!
+  \brief Change the expression and rebuild the postfix.
+  \param expr new expression
+  \return \c true on success and \c false if error is found
+*/
+bool QtxEvalParser::setExpression( const QString& expr )
+{
+  return parse( expr );
+}
+
+/*!
+  \brief Check if the parser contains specified parameter.
+  \param name parameter name
+  \return \c true, if the parser contains parameter
+*/
+bool QtxEvalParser::hasParameter( const QString& name ) const
+{
+  return myParams.contains( name.trimmed() );
+}
+
+/*!
+  \brief Set parameters value.
+  \param name parameter name
+  \param value parameter value
+*/
+void QtxEvalParser::setParameter( const QString& name, const QVariant& value )
+{
+  myParams.insert( name.trimmed(), value );
+}
+
+/*!
+  \brief Remove parameter.
+  \param name parameter name
+  \return \c true on success
+*/
+bool QtxEvalParser::removeParameter( const QString& name )
+{
+  return myParams.remove( name.trimmed() );
+}
+
+/*!
+  \brief Get the parameter value.
+  \param name parameter name
+  \return parameter value or invalud QVariant if there is no such parameter
+*/
+QVariant QtxEvalParser::parameter( const QString& name ) const
+{
+  QVariant res;
+  if ( myParams.contains( name.trimmed() ) )
+    res = myParams[name.trimmed()].toString();
+  return res;
+}
+
+/*!
+  \brief Search first parameter with assigned invalid value.
+  \param name used to retrieve the name of the parameter if it is found
+  \return \c true if parameter is found
+*/
+bool QtxEvalParser::firstInvalid( QString& name ) const
+{
+  for ( ParamMap::const_iterator anIt = myParams.begin(); anIt != myParams.end(); anIt++ )
+  {
+    if ( !anIt.value().isValid() )
+    {
+      name = anIt.key();
+      return true;
+    }
+  }
+  return false;
+}
+
+/*!
+  \brief Remove all parameters with assigned invalid values.
+*/
+void QtxEvalParser::removeInvalids()
+{
+  QStringList toDelete;
+  for ( ParamMap::const_iterator anIt = myParams.begin(); anIt != myParams.end(); anIt++ )
+  {
+    if ( !anIt.value().isValid() )
+      toDelete.append( anIt.key() );
+  }
+
+  for ( QStringList::const_iterator aLIt = toDelete.begin(); aLIt != toDelete.end(); aLIt++ )
+    myParams.remove( *aLIt );
+}
+
+/*!
+  \brief Get the code of the latest parsing error.
+  \return last error code
+*/
+QtxEvalExpr::Error QtxEvalParser::error() const
+{
+  return myError;
+}
+
+/*!
+  \brief Set the error vode.
+  \internal
+  \param err error code
+*/
+void QtxEvalParser::setError( QtxEvalExpr::Error err )
+{
+  myError = err;
+}
+
+/*!
+  \brief Dump the current postfix contents to the string.
+  \return string representation of the internal parser postfix
+*/
+QString QtxEvalParser::dump() const
+{
+  return dump( myPostfix );
+}
+
+/*!
+  \brief Dump the postfix contents to the string.
+  \param post postfix to be dumped
+  \return string representation of the postfix
+*/
+QString QtxEvalParser::dump( const Postfix& post ) const
+{
+  QString res;
+
+  if ( !checkOperations() )
+    return res;
+
+  for ( Postfix::const_iterator anIt = post.begin(); anIt != post.end(); anIt++ )
+  {
+    if ( (*anIt).myType == Value && (*anIt).myValue.type() == QVariant::String )
+      res += "'" + (*anIt).myValue.toString() + "'";
+    else
+      res += (*anIt).myValue.toString();
+    
+    if ( (*anIt).myType == Pre )
+      res += "(pre)";
+    else if ( (*anIt).myType == Post )
+      res += "(post)";
+    else if ( (*anIt).myType == Binary )
+      res += "(bin)";
+
+    res += "_";
+  }
+
+  return res;
+}
+
+/*!
+  \brief Get the list of the parameters names.
+  \return parameters names
+*/
+QStringList QtxEvalParser::parameters() const
+{
+  QStringList lst;
+  for ( Postfix::const_iterator anIt = myPostfix.begin(); anIt != myPostfix.end(); anIt++ )
+  {
+    if ( (*anIt).myType == Param )
+    {
+      QString name = (*anIt).myValue.toString();
+      if ( !lst.contains( name ) )
+        lst.append( name );
+    }
+  }
+  return lst;
+}
+
+/*!
+  \brief Remove all parameters.
+*/
+void QtxEvalParser::clearParameters()
+{
+  myParams.clear();
+}
+
+/*!
+  \brief Get the string representation for the list of QVariant values.
+  \param list list to be converted
+  \return string representation for the list
+*/
+QString QtxEvalParser::toString( const QList<QVariant>& list )
+{
+  QString res = "set : [ ";
+  for ( QList<QVariant>::const_iterator anIt = list.begin(); anIt != list.end(); anIt++ )
+    res += (*anIt).toString() + " ";
+  res += "]";
+  return res;
+}
+
+/*!
+  \brief Get names of all operations used in the expression.
+  \param list returning list of the operations names
+*/
+void QtxEvalParser::operationList( QStringList& list ) const
+{
+  for ( SetList::const_iterator it = mySets.begin(); it != mySets.end(); ++it )
+  {
+    QStringList custom;
+    QtxEvalSet* set = *it;
+    set->operationList( custom );
+    for ( QStringList::const_iterator sIt = custom.begin(); sIt != custom.end(); ++sIt )
+    {
+      if ( !list.contains( *sIt ) )
+        list.append( *sIt );
+    }
+  }
+}
+
+/*!
+  \brief Get list of brackets.
+  \param list returning list of brackets
+  \param open if \c true, collect opening brackets, or closing brackets otherwise
+*/
+void QtxEvalParser::bracketsList( QStringList& list, bool open ) const
+{
+  for ( SetList::const_iterator it = mySets.begin(); it != mySets.end(); ++it )
+  {
+    QStringList custom;
+    QtxEvalSet* set = *it;
+    set->bracketsList( custom, open );
+    for ( QStringList::const_iterator sIt = custom.begin(); sIt != custom.end(); ++sIt )
+    {
+      if ( !list.contains( *sIt ) )
+        list.append( *sIt );
+    }
+  }
+}
+
+/*!
+  \brief Create value.
+  \param str parsed string
+  \param val returning value
+  \return \c true on success
+*/
+bool QtxEvalParser::createValue( const QString& str, QVariant& val ) const
+{
+  bool ok = false;
+  for ( SetList::const_iterator it = mySets.begin(); it != mySets.end() && !ok; ++it )
+    ok = (*it)->createValue( str, val );
+  return ok;
+}
+
+/*!
+  \brief Get the operation priority level.
+  \param op operation
+  \param isBin \c true if the operation is binary and \c false if it is unary
+  \return operation priority
+*/
+int QtxEvalParser::priority( const QString& op, bool isBin ) const
+{
+  int i = 0;
+  int priority = 0;
+  for ( SetList::const_iterator it = mySets.begin(); it != mySets.end() && priority <= 0; ++it, i++ )
+    priority = (*it)->priority( op, isBin );
+
+  return priority > 0 ? priority + i * 50 : 0;
+}
+
+/*!
+  \brief Check operation validity.
+
+  If the operation is valid, QtxEvalExpr::OK is returned.
+
+  \param op operation
+  \param t1 first operand type
+  \param t2 second operand type
+  \return error code (QtxEvalExpr::Error)
+*/
+QtxEvalExpr::Error QtxEvalParser::isValid( const QString& op,
+                                           const QVariant::Type t1, const QVariant::Type t2 ) const
+{
+  QtxEvalExpr::Error err = QtxEvalExpr::OK;
+  for ( SetList::const_iterator it = mySets.begin(); it != mySets.end(); ++it )
+  {
+    err = (*it)->isValid( op, t1, t2 );
+    if ( err == QtxEvalExpr::OK )
+      break;
+  }
+  return err;
+}
+
+/*!
+  \brief Perform calculation
+  
+  The result of the operation is returned in the parameter \a v1.
+  If the operation is calculated correctly, the function returns QtxEvalExpr::OK.
+
+  \param op operation name
+  \param v1 first argument (not valid for unary prefix operations)
+  \param v2 second argument (not valid for unary postfix operations)
+  \return error code (QtxEvalExpr::Error)
+*/
+QtxEvalExpr::Error QtxEvalParser::calculation( const QString& op, QVariant& v1, QVariant& v2 ) const
+{
+  QVariant nv1, nv2;
+  for ( SetList::const_iterator it = mySets.begin(); it != mySets.end(); ++it )
+  {
+    nv1 = v1;
+    nv2 = v2;
+    if ( (*it)->isValid( op, v1.type(), v2.type() ) == QtxEvalExpr::OK )
+    {
+      QtxEvalExpr::Error err = (*it)->calculate( op, nv1, nv2 );
+      if ( err == QtxEvalExpr::OK || err == QtxEvalExpr::InvalidResult )
+      {
+        v1 = nv1;
+        v2 = nv2;
+        return err;
+      }
+    }
+  }
+  return QtxEvalExpr::InvalidOperation;
+}
+
+/*!
+  \brief Check current operations set.
+  \return \c false if current set of operations is empty
+*/
+bool QtxEvalParser::checkOperations() const
+{
+  if ( !mySets.isEmpty() )
+    return true;
+
+  QtxEvalParser* that = (QtxEvalParser*)this;
+  that->setError( QtxEvalExpr::OperationsNull );
+  return false;
+}
+
+/*!
+  \class QtxEvalSet
+  \brief Generic class for all the operations sets used in expressions.
+*/
+
+/*!
+  \brief Constructor.
+*/
+QtxEvalSet::QtxEvalSet()
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxEvalSet::~QtxEvalSet()
+{
+}
+
+/*!
+  \fn void QtxEvalSet::operationList( QStringList& list ) const;
+  \brief Get the list of possible operations.
+  \param list returning list of operations supported by the class
+*/
+
+/*!
+  \fn void QtxEvalSet::bracketsList( QStringList& list, bool open ) const;
+  \brief Get list of brackets.
+  \param list returning list of brackets
+  \param open if \c true, collect opening brackets, or closing brackets otherwise
+*/
+
+/*!
+  \brief Create value from its string representation.
+
+  By default, the string value is set, that corresponds to the parameter.
+  Base implementation always returns \c false (it means that string 
+  is evaluated to the parameter).
+  Successor class can re-implement this method to return \c true 
+  if the argument being parsed can be evaluated as custom value.
+
+  \param str string representration of the value
+  \param val returning value
+  \return \c true if \a str can be evaluated as custom value and \c false
+          otherwise (parameter)
+*/
+bool QtxEvalSet::createValue( const QString& str, QVariant& val ) const
+{
+  val = str;
+  return false;
+}
+
+/*!
+  \fn int QtxEvalSet::priority( const QString& op, bool isBin ) const;
+  \brief Get the operation priority.
+
+  Operation priority counts from 1.
+  If the operation is impossible, this function should return value <= 0.
+  
+  \param op operation
+  \param isBin \c true if the operation is binary and \c false if it is unary
+  \return operation priority
+*/
+
+/*!
+  \fn QtxEvalExpr::Error QtxEvalSet::isValid( const QString& op, const QVariant::Type t1, 
+                                              const QVariant::Type t2 ) const;
+  \brief Check operation validity.
+
+  If the operation is valid, QtxEvalExpr::OK is returned.
+  If types of operands are invalid, the function returns QtxEvalExpr::OperandsNotMatch
+  or QtxEvalExpr::InvalidOperation.
+
+  \param op operation
+  \param t1 first operand type
+  \param t2 second operand type
+  \return error code (QtxEvalExpr::Error)
+*/
+
+/*!
+  \fn QtxEvalExpr::Error QtxEvalSet::calculate( const QString& op, QVariant& v1,
+                                                QVariant& v2 ) const;
+  \brief Calculate the operation.
+
+  Process binary operation with values \a v1 and \a v2.
+  For unary operation the \v2 is invalid.
+  The result of the operation is returned in the parameter \a v1.
+
+  \param op operation name
+  \param v1 first argument (not valid for unary prefix operations)
+  \param v2 second argument (not valid for unary postfix operations)
+  \return error code (QtxEvalExpr::Error)
+*/
+
+/*!
+  \fn QString QtxEvalSet::name() const;
+  \brief Get unique operations set name.
+
+  Should be redefined in the successor classes.
+
+  \return operations set name
+*/
+
+/*!
+  \class QtxEvalSetBase
+  \brief Generic class. Provides functionality for standard operations sets.
+*/
+
+/*!
+  \brief Constructor.
+*/
+QtxEvalSetBase::QtxEvalSetBase()
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxEvalSetBase::~QtxEvalSetBase()
+{
+}
+
+/*!
+  \brief Get list of brackets.
+  \param list returning list of brackets
+  \param open if \c true, collect opening brackets, or closing brackets otherwise
+*/
+void QtxEvalSetBase::bracketsList( QStringList& list, bool open ) const
+{
+  list.append( open ? "(" : ")" );
+}
+
+/*!
+  \brief Get the list of possible operations.
+  \param list returning list of operations supported by the class
+*/
+void QtxEvalSetBase::operationList( QStringList& list ) const
+{
+  list += myOpers;
+}
+
+/*!
+  \brief Add operation names to the internal list of operations.
+  \param list operations to be added
+*/
+void QtxEvalSetBase::addOperations( const QStringList& list )
+{
+  for ( QStringList::const_iterator anIt = list.begin(); anIt != list.end(); ++anIt )
+  {
+    if ( !myOpers.contains( *anIt ) )
+      myOpers.append( *anIt );
+  }
+}
+
+/*!
+  \brief Add operand types.
+  \param list operand types to be added
+*/
+void QtxEvalSetBase::addTypes( const ListOfTypes& list )
+{
+  for ( ListOfTypes::const_iterator anIt = list.begin(); anIt != list.end(); ++anIt )
+  {
+    if ( !myTypes.contains( *anIt ) )
+      myTypes.append( *anIt );
+  }
+}
+
+/*!
+  \brief Check operation validity.
+
+  If the operation is valid, QtxEvalExpr::OK is returned.
+  If types of operands are invalid, the function returns QtxEvalExpr::OperandsNotMatch
+  or QtxEvalExpr::InvalidOperation.
+
+  \param op operation
+  \param t1 first operand type
+  \param t2 second operand type
+  \return error code (QtxEvalExpr::Error)
+*/
+QtxEvalExpr::Error QtxEvalSetBase::isValid( const QString& op,
+                                            const QVariant::Type t1, const QVariant::Type t2 ) const
+{
+  if ( ( t1 == QVariant::Invalid || myTypes.contains( t1 ) ) &&
+       ( t2 == QVariant::Invalid || myTypes.contains( t2 ) ) &&
+       ( t1 != QVariant::Invalid || t2 != QVariant::Invalid ) )
+  {
+    if ( priority( op, t1 != QVariant::Invalid && t2 != QVariant::Invalid ) > 0 )
+      return QtxEvalExpr::OK;
+    else
+      return QtxEvalExpr::InvalidOperation;
+  }
+  else
+    return QtxEvalExpr::OperandsNotMatch;
+}
+
+/*!
+  \class QtxEvalSetArithmetic
+  \brief Provides set of arithmetical operations for the parser.
+*/
+
+/*!
+  \brief Constructor.
+*/
+QtxEvalSetArithmetic::QtxEvalSetArithmetic()
+: QtxEvalSetBase()
+{
+  addOperations( QString( "+;-;*;/;=;<;>;<=;>=;<>;!=" ).split( ";" ) );
+
+  ListOfTypes aTypes;
+  aTypes.append( QVariant::Int );
+  aTypes.append( QVariant::UInt );
+  aTypes.append( QVariant::Double );
+  addTypes( aTypes );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxEvalSetArithmetic::~QtxEvalSetArithmetic()
+{
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetArithmetic::Name()
+{
+  return "Arithmetic";
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetArithmetic::name() const
+{
+  return Name();
+}
+
+/*!
+  \brief Create value from its string representation.
+
+  Creates numbers from string representation.
+
+  \param str string representration of the value
+  \param val returning value
+  \return \c true if \a str can be evaluated as custom value and \c false
+          otherwise (parameter)
+*/
+bool QtxEvalSetArithmetic::createValue( const QString& str, QVariant& val ) const
+{
+  bool ok = false;
+  val = str.toInt( &ok );
+
+  if ( !ok )
+  {
+    val = str.toDouble( &ok );
+    if ( !ok )
+      ok = QtxEvalSetBase::createValue( str, val );
+  }
+  return ok;
+}
+
+/*!
+  \brief Get the operation priority.
+
+  Operation priority counts from 1.
+  If the operation is impossible, this function returns value <= 0.
+  
+  \param op operation
+  \param isBin \c true if the operation is binary and \c false if it is unary
+  \return operation priority
+*/
+int QtxEvalSetArithmetic::priority( const QString& op, bool isBin ) const
+{
+  if ( isBin )
+  {
+    if ( op == "<" || op == ">" || op == "=" ||
+         op == "<=" || op == ">=" || op == "<>" || op == "!=" )
+      return 1;
+    else if ( op == "+" || op == "-" )
+      return 2;
+    else if( op == "*" || op == "/" )
+      return 3;
+    else
+      return 0;
+  }
+  else if ( op == "+" || op == "-" )
+    return 5;
+  else
+    return 0;
+}
+
+/*!
+  \brief Calculate the operation.
+
+  Process binary operation with values \a v1 and \a v2.
+  For unary operation the \v2 is invalid.
+  The result of the operation is returned in the parameter \a v1.
+
+  \param op operation name
+  \param v1 first argument (not valid for unary prefix operations)
+  \param v2 second argument (not valid for unary postfix operations)
+  \return error code (QtxEvalExpr::Error)
+*/
+QtxEvalExpr::Error QtxEvalSetArithmetic::calculate( const QString& op, QVariant& v1, QVariant& v2 ) const
+{
+  QtxEvalExpr::Error err = QtxEvalExpr::OK;
+
+  if ( v1.isValid() && v2.isValid() )
+  {
+    // binary operations
+    if ( ( v1.type() == QVariant::Int || v1.type() == QVariant::UInt ) &&
+         ( v2.type() == QVariant::Int || v2.type() == QVariant::UInt ) )
+    {
+      int _v1 = v1.toInt();
+      int _v2 = v2.toInt();
+
+      if ( op == "+" )
+        v1 = _v1 + _v2;
+      else if ( op == "-" )
+        v1 = _v1 - _v2;
+      else if ( op == "*" )
+        v1 = _v1 * _v2;
+      else if ( op == "/" )
+      {
+        if ( _v2 != 0 )
+        {
+          if ( _v1 % _v2 == 0 )
+            v1 = _v1 / _v2;
+          else
+            v1 = double( _v1 ) / double( _v2 );
+        }
+        else
+          err = QtxEvalExpr::InvalidResult;
+      }
+      else if ( op == "<" )
+        v1 = _v1 < _v2;
+      else if ( op == ">" )
+        v1 = _v1 > _v2;
+      else if ( op == "=" )
+        v1 = _v1 == _v2;
+      else if ( op == "<=" )
+        v1 = _v1 <= _v2;
+      else if ( op == ">=" )
+        v1 = _v1 >= _v2;
+      else if ( op == "<>" || op == "!=" )
+        v1 = _v1 != _v2;
+    }
+    else if ( ( v1.type() == QVariant::Int || v1.type() == QVariant::Double ) &&
+              ( v2.type() == QVariant::Int || v2.type() == QVariant::Double ) )
+    {
+      double _v1 = v1.toDouble();
+      double _v2 = v2.toDouble();
+
+      if ( op == "+" )
+        v1 = _v1 + _v2;
+      else if ( op == "-" )
+        v1 = _v1 - _v2;
+      else if ( op == "*" )
+          v1 = _v1 * _v2;
+      else if ( op == "/" )
+      {
+        if ( _v2 != 0 )
+          v1 = _v1 / _v2;
+        else
+          err = QtxEvalExpr::InvalidResult;
+      }
+      else if ( op == "<" )
+        v1 = _v1 < _v2;
+      else if ( op == ">" )
+        v1 = _v1 > _v2;
+      else if ( op == "=" )
+        v1 = _v1 == _v2;
+      else if ( op == "<=" )
+        v1 = _v1 <= _v2;
+      else if ( op == ">=" )
+        v1 = _v1 >= _v2;
+      else if ( op == "<>" || op == "!=" )
+        v1 = _v1 != _v2;
+    }
+    else // prefix operations
+    {
+      if ( op == "-" )
+      {
+        if ( v2.type() == QVariant::Int )
+          v2 = -v2.toInt();
+        else if ( v2.type() == QVariant::Double )
+          v2 = -v2.toDouble();
+      }
+    }
+  }
+
+  return err;
+}
+
+/*!
+  \class QtxEvalSetLogic
+  \brief Provides set of logical operations for the parser.
+*/
+
+/*!
+  \brief Constructor.
+*/
+QtxEvalSetLogic::QtxEvalSetLogic()
+: QtxEvalSetBase()
+{
+  addOperations( QString( "and;&&;or;||;xor;not;!;imp;=" ).split( ";" ) );
+
+  ListOfTypes aTypes;
+  aTypes.append( QVariant::Bool );
+  aTypes.append( QVariant::Int );
+  aTypes.append( QVariant::UInt );
+  addTypes( aTypes );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxEvalSetLogic::~QtxEvalSetLogic()
+{
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetLogic::Name()
+{
+  return "Logic";
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetLogic::name() const
+{
+  return Name();
+}
+
+/*!
+  \brief Create value from its string representation.
+
+  Create \c true or \c false value from string representation.
+
+  \param str string representration of the value
+  \param val returning value
+  \return \c true if \a str can be evaluated as custom value and \c false
+          otherwise (parameter)
+*/
+bool QtxEvalSetLogic::createValue( const QString& str, QVariant& val ) const
+{
+  bool ok = true;
+  QString valStr = str.toLower();
+  if ( valStr == "true" || valStr == "yes" )
+    val = QVariant( true );
+  else if ( valStr == "false" || valStr == "no" )
+    val = QVariant( false );
+  else
+    ok = QtxEvalSetBase::createValue( str, val );
+
+  return ok;
+}
+
+/*!
+  \brief Get the operation priority.
+
+  Operation priority counts from 1.
+  If the operation is impossible, this function returns value <= 0.
+  
+  \param op operation
+  \param isBin \c true if the operation is binary and \c false if it is unary
+  \return operation priority
+*/
+int QtxEvalSetLogic::priority( const QString& op, bool isBin ) const
+{
+  if ( isBin )
+  {
+    if ( op == "and" || op == "or" || op == "xor" || op == "&&" || op == "||" || op == "imp" )
+      return 1;
+    else if ( op == "=" )
+      return 2;
+    else 
+      return 0;
+  }
+  else if ( op == "not" || op == "!" )
+    return 5;
+  else
+    return 0;
+}
+
+/*!
+  \brief Calculate the operation.
+
+  Process binary operation with values \a v1 and \a v2.
+  For unary operation the \v2 is invalid.
+  The result of the operation is returned in the parameter \a v1.
+
+  \param op operation name
+  \param v1 first argument (not valid for unary prefix operations)
+  \param v2 second argument (not valid for unary postfix operations)
+  \return error code (QtxEvalExpr::Error)
+*/
+QtxEvalExpr::Error QtxEvalSetLogic::calculate( const QString& op, QVariant& v1, QVariant& v2 ) const
+{
+  QtxEvalExpr::Error err = QtxEvalExpr::OK;
+  int val1 = intValue( v1 );
+  int val2 = intValue( v2 );
+  if ( v1.isValid() && v2.isValid() )
+  {
+    if ( op == "and" || op == "&&" )
+      v1 = val1 && val2;
+    else if ( op == "or" || op == "||" )
+      v1 = val1 || val2;
+    else if ( op == "xor" )
+      v1 = ( !val1 && val2 ) || ( val1 && !val2 );
+    else if ( op == "imp" )
+      v1 = !val1 || val2;
+    else if ( op == "=" )
+      v1 = val1 == val2;
+  }
+  else if ( op == "not" || op == "!" )
+    v2 = !val2;
+
+  return err;
+}
+
+/*!
+  \brief Convert value to the integer.
+
+  Note: the value is converted to the integer (not boolean) in order
+  to compare integer numbers correctly.
+
+  \param v value being converted
+  \return converted value
+*/
+int QtxEvalSetLogic::intValue( const QVariant& v ) const
+{
+  int res = 0;
+  switch ( v.type() )
+  {
+  case QVariant::Bool:
+    res = v.toBool() ? 1 : 0;
+    break;
+  case QVariant::Int:
+  case QVariant::UInt:
+    res = v.toInt();
+    break;
+  default:
+    break;
+  }
+  return res;
+}
+
+/*!
+  \class QtxEvalSetMath
+  \brief Provides a set of more complex operations (mathematical functions)
+         for the parser (sqrt, sin, cos, etc).
+*/
+
+/*!
+  \brief Constructor.
+*/
+QtxEvalSetMath::QtxEvalSetMath()
+: QtxEvalSetBase()
+{
+  addOperations( QString( "sqrt;abs;sin;cos;rad2grad;grad2rad" ).split( ";" ) );
+
+  ListOfTypes aTypes;
+  aTypes.append( QVariant::Int );
+  aTypes.append( QVariant::Double );
+  addTypes( aTypes );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxEvalSetMath::~QtxEvalSetMath()
+{
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetMath::Name()
+{
+  return "Math";
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetMath::name() const
+{
+  return Name();
+}
+
+/*!
+  \brief Create value from its string representation.
+
+  Creates numbers from string representation.
+
+  \param str string representration of the value
+  \param val returning value
+  \return \c true if \a str can be evaluated as custom value and \c false
+          otherwise (parameter)
+*/
+bool QtxEvalSetMath::createValue( const QString& str, QVariant& val ) const
+{
+  bool ok = false;
+  val = str.toInt( &ok );
+
+  if ( !ok )
+  {
+    val = str.toDouble( &ok );
+    if ( !ok )
+      ok = QtxEvalSetBase::createValue( str, val );
+  }
+  return ok;
+}
+
+/*!
+  \brief Get the operation priority.
+
+  Operation priority counts from 1.
+  If the operation is impossible, this function returns value <= 0.
+  
+  \param op operation
+  \param isBin \c true if the operation is binary and \c false if it is unary
+  \return operation priority
+*/
+int QtxEvalSetMath::priority( const QString& op, bool isBin ) const
+{
+  if ( isBin )
+    return 0;
+  else if ( op == "sqrt" || op == "abs" || op == "sin" ||
+            op == "cos" || op == "rad2grad" || op == "grad2rad" )
+    return 1;
+  else
+    return 0;
+}
+
+/*!
+  \brief Calculate the operation.
+
+  Process binary operation with values \a v1 and \a v2.
+  For unary operation the \v2 is invalid.
+  The result of the operation is returned in the parameter \a v1.
+
+  \param op operation name
+  \param v1 first argument (not valid for unary prefix operations)
+  \param v2 second argument (not valid for unary postfix operations)
+  \return error code (QtxEvalExpr::Error)
+*/
+QtxEvalExpr::Error QtxEvalSetMath::calculate( const QString& op, QVariant& v1, QVariant& v2 ) const
+{
+  QtxEvalExpr::Error err = QtxEvalExpr::OK;
+  double val = v2.toDouble();
+  if ( op == "sqrt" )
+  {
+    if ( val >= 0 )
+      v2 = sqrt( val );
+    else
+      err = QtxEvalExpr::InvalidResult;
+  }
+  else if ( op == "abs" )
+  {
+    if ( v2.type() == QVariant::Int )
+      v2 = abs( v2.toInt() );
+    else 
+      v2 = fabs( v2.toDouble() );
+  }
+  else if ( op == "sin" )
+    v2 = sin( val );
+  else if ( op == "cos" )
+    v2 = cos( val );
+  else if ( op == "grad2rad" )
+    v2 = val * 3.14159256 / 180.0;
+  else if ( op == "rad2grad" )
+    v2 = val * 180.0 / 3.14159256;
+
+  return err;
+}
+
+/*!
+  \class QtxEvalSetString
+  \brief Provides set of string operations for the parser.
+*/
+
+/*!
+  \brief Constructor.
+*/
+QtxEvalSetString::QtxEvalSetString()
+: QtxEvalSetBase()
+{
+  addOperations( QString( "+;=;<;>;<=;>=;<>;!=;length;lower;upper" ).split( ";" ) );
+
+  ListOfTypes aTypes;
+  aTypes.append( QVariant::Int );
+  aTypes.append( QVariant::Double );
+  aTypes.append( QVariant::String );
+  addTypes( aTypes );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxEvalSetString::~QtxEvalSetString()
+{
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetString::Name()
+{
+  return "String";
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetString::name() const
+{
+  return Name();
+}
+
+/*!
+  \brief Create value from its string representation.
+
+  Creates string value from Qt string representation.
+
+  \param str string representration of the value
+  \param val returning value
+  \return \c true if \a str can be evaluated as custom value and \c false
+          otherwise (parameter)
+*/
+bool QtxEvalSetString::createValue( const QString& str, QVariant& val ) const
+{
+  bool ok = false;
+  if ( str.length() > 1 && str[0] == '\'' && str[str.length() - 1] == '\'' )
+  {
+    val = str.mid( 1, str.length() - 2 );
+    ok = true;
+  }
+  else
+    ok = QtxEvalSetBase::createValue( str, val );
+  return ok;
+}
+
+/*!
+  \brief Get the operation priority.
+
+  Operation priority counts from 1.
+  If the operation is impossible, this function returns value <= 0.
+  
+  \param op operation
+  \param isBin \c true if the operation is binary and \c false if it is unary
+  \return operation priority
+*/
+int QtxEvalSetString::priority( const QString& op, bool isBin ) const
+{
+  if ( isBin )
+  {
+    if ( op == "+" ) 
+      return 2;
+    else if ( op == "=" || op == "<" || op == ">" ||
+              op == "<=" || op == ">=" || op == "<>" || op == "!=" )
+      return 1;
+    else
+      return 0;
+  }
+  else if ( op == "length" || op == "lower" || op=="upper" )
+    return 5;
+  else
+    return 0;
+}
+
+/*!
+  \brief Calculate the operation.
+
+  Process binary operation with values \a v1 and \a v2.
+  For unary operation the \v2 is invalid.
+  The result of the operation is returned in the parameter \a v1.
+
+  \param op operation name
+  \param v1 first argument (not valid for unary prefix operations)
+  \param v2 second argument (not valid for unary postfix operations)
+  \return error code (QtxEvalExpr::Error)
+*/
+QtxEvalExpr::Error QtxEvalSetString::calculate( const QString& op, QVariant& v1, QVariant& v2 ) const
+{
+  QtxEvalExpr::Error err = QtxEvalExpr::OK;
+  if ( v1.isValid() && v2.isValid() )
+  {
+    QString _v1 = v1.toString();
+    QString _v2 = v2.toString();
+    if ( op == "+" )
+      v1 = _v1 + _v2;
+    else if ( op == "=" )
+      v1 = _v1 ==_v2;
+    else if ( op == "<" )
+      v1 = _v1 < _v2;
+    else if ( op == ">" )
+      v1 = _v1 > _v2;
+    else if ( op == "<>" || op == "!=" )
+      v1 = _v1 != _v2;
+    else if ( op == "<=" )
+      v1 = _v1 < _v2 || _v1 == _v2;
+    else if ( op == ">=" )
+      v1 = _v1 > _v2 || _v1 == _v2;
+  }
+  else if ( !v1.isValid() && v2.isValid() )
+  {
+    QString val = v2.toString();
+    if ( op == "length" )
+      v2 = (int)val.length();
+    else if ( op == "lower" )
+      v2 = val.toLower();
+    else if ( op == "upper" )
+      v2 = val.toUpper();
+  }
+  return err;
+}
+
+/*!
+  \class QtxEvalSetSets
+  \brief Provides set of operations with sequences for the parser.
+*/
+
+/*!
+  \brief Constructor.
+*/
+QtxEvalSetSets::QtxEvalSetSets()
+: QtxEvalSetBase()
+{
+  addOperations( QString( "{;};=;<>;!=;+;-;*;in;count" ).split( ";" ) );
+
+  ListOfTypes aTypes;
+  aTypes.append( QVariant::List );
+  addTypes( aTypes );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxEvalSetSets::~QtxEvalSetSets()
+{
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetSets::Name()
+{
+  return "Sets";
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetSets::name() const
+{
+  return Name();
+}
+
+/*!
+  \brief Get list of brackets.
+  \param list returning list of brackets
+  \param open if \c true, collect opening brackets, or closing brackets otherwise
+*/
+void QtxEvalSetSets::bracketsList( QStringList& list, bool open ) const
+{
+  list.append( open ? "{" : "}" );
+  QtxEvalSetBase::bracketsList( list, open );
+}
+
+/*!
+  \brief Get the operation priority.
+
+  Operation priority counts from 1.
+  If the operation is impossible, this function returns value <= 0.
+  
+  \param op operation
+  \param isBin \c true if the operation is binary and \c false if it is unary
+  \return operation priority
+*/
+int QtxEvalSetSets::priority( const QString& op, bool isBin ) const
+{
+  if ( isBin )
+  {
+    if ( op == "=" || op == "<>" || op == "!=" )
+      return 1;
+    else if ( op == "+" || op == "-" || op == "*" )
+      return 2;
+    else if ( op == "in" )
+      return 3;
+    else
+      return 0;
+  }
+  else if ( op == "{" || op == "}" )
+    return 5;
+  else if ( op == "count" )
+    return 4;
+  else
+    return 0;
+}
+
+/*!
+  \brief Check operation validity.
+
+  If the operation is valid, QtxEvalExpr::OK is returned.
+  If types of operands are invalid, the function returns QtxEvalExpr::OperandsNotMatch
+  or QtxEvalExpr::InvalidOperation.
+
+  \param op operation
+  \param t1 first operand type
+  \param t2 second operand type
+  \return error code (QtxEvalExpr::Error)
+*/
+QtxEvalExpr::Error QtxEvalSetSets::isValid( const QString& op,
+                                            const QVariant::Type t1, const QVariant::Type t2 ) const
+{
+  if ( op == "{" )
+    return QtxEvalExpr::OK;
+
+  if ( op != "in" )
+    return QtxEvalSetBase::isValid( op, t1, t2 );
+
+  if ( t1 != QVariant::Invalid && t2 == QVariant::List )
+    return QtxEvalExpr::OK;
+  else
+    return QtxEvalExpr::OperandsNotMatch;
+}
+
+/*!
+  \brief Add new value \a v to the sequence \a set.
+  \param set sequence
+  \param v value to be added
+*/
+void QtxEvalSetSets::add( ValueSet& set, const QVariant& v )
+{
+  if ( v.isValid() && !set.contains( v ) )
+    set.append( v );
+}
+
+/*!
+  \brief Add all values from sequence \a s2 to the sequence \a s1.
+  \param s1 destination sequence
+  \param s2 source sequence
+*/
+void QtxEvalSetSets::add( ValueSet& s1, const ValueSet& s2 )
+{
+  for ( ValueSet::const_iterator anIt = s2.begin(); anIt != s2.end(); ++anIt )
+    add( s1, *anIt );
+}
+
+/*!
+  \brief Remove value \a v from sequence \a set.
+  \param set sequence
+  \param v value to be removed
+*/
+void QtxEvalSetSets::remove( ValueSet& set, const QVariant& v )
+{
+  set.removeAll( v );
+}
+
+/*!
+  \brief Remove all values listed in the sequence \a s2 from the sequence \a s1.
+  \param s1 sequence from which items are removed
+  \param s2 sequence which items are removed
+*/
+void QtxEvalSetSets::remove( ValueSet& s1, const ValueSet& s2 )
+{
+  for ( ValueSet::const_iterator anIt = s2.begin(); anIt != s2.end(); ++anIt )
+    s1.removeAll( *anIt );
+}
+
+/*!
+  \brief Calculate the operation.
+
+  Process binary operation with values \a v1 and \a v2.
+  For unary operation the \v2 is invalid.
+  The result of the operation is returned in the parameter \a v1.
+
+  \param op operation name
+  \param v1 first argument (not valid for unary prefix operations)
+  \param v2 second argument (not valid for unary postfix operations)
+  \return error code (QtxEvalExpr::Error)
+*/
+QtxEvalExpr::Error QtxEvalSetSets::calculate( const QString& op, QVariant& v1, QVariant& v2 ) const
+{
+  QtxEvalExpr::Error err = QtxEvalExpr::OK;
+
+  if ( op != "{" )
+  {
+    if ( op == "}" )
+    {
+      ValueSet aNewList;
+      add( aNewList, v1.toList() );
+      v1 = aNewList;
+    }
+    else if ( op == "=" || op == "<>" || op == "!=" || op == "+" || op == "-" || op == "*" )
+    {
+      ValueSet aNewList;
+      add( aNewList, v1.toList() );
+      if ( op == "=" || op == "<>" || op == "!=" || op == "-" )
+      {
+        remove( aNewList, v2.toList() );
+        if ( op == "=" )
+          v1 = aNewList.isEmpty() && v1.toList().count() == v2.toList().count();
+        else if ( op == "<>" || op == "!=" )
+          v1 = !aNewList.isEmpty() || v1.toList().count() != v2.toList().count();
+        else
+          v1 = aNewList;
+      }
+      else if ( op == "+" )
+      {
+        add( aNewList, v2.toList() );
+        v1 = aNewList;
+      }
+      else if ( op == "*" )
+      {
+        ValueSet toDelete;
+        add( toDelete, aNewList );
+        remove( toDelete, v2.toList() );
+        remove( aNewList, toDelete );
+        v1 = aNewList;
+      }
+    }
+    else if ( op== "count" )
+      v2 = (int)v2.toList().count();
+    else if ( op == "in" )
+    {
+      if ( v1.type() == QVariant::List )
+      {
+        bool res = true;
+        ValueSet lst1 = v1.toList();
+        ValueSet lst2 = v2.toList();
+        for ( ValueSet::const_iterator anIt = lst1.begin(); anIt != lst1.end() && res; ++anIt )
+          res = lst2.contains( *anIt );
+
+        v1 = res;
+      }
+      else
+             v1 = QVariant( v2.toList().contains( v1 ) );
+    }
+  }
+  return err;
+}
+
+/*!
+  \class QtxEvalSetConst
+  \brief Provides different standard constants.
+*/
+QtxEvalSetConst::QtxEvalSetConst()
+: QtxEvalSet()
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxEvalSetConst::~QtxEvalSetConst()
+{
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetConst::Name()
+{
+  return "Const";
+}
+
+/*!
+  \brief Get operations set name.
+  \return operations set name
+*/
+QString QtxEvalSetConst::name() const
+{
+  return Name();
+}
+
+/*!
+  \brief Create value from its string representation.
+
+  Convert constant name to its value.
+
+  \param str string representration of the constant
+  \param val returning value
+  \return \c true if \a str can be evaluated as custom value and \c false
+          otherwise (parameter)
+*/
+bool QtxEvalSetConst::createValue( const QString& str, QVariant& val ) const
+{
+  bool ok = true;
+  if ( str == "pi" )            // PI number
+    val = QVariant( 3.141593 );
+  else if ( str == "exp" )      // Exponent value (e)
+    val = QVariant( 2.718282 );
+  else if ( str == "g" )        // Free fall acceleration (g)
+    val = QVariant( 9.80665 );
+  else
+    ok = false;
+
+  return ok;
+}
+
+/*!
+  \brief Get the list of possible operations.
+  \param list returning list of operations supported by the class (not used)
+*/
+void QtxEvalSetConst::operationList( QStringList& /*list*/ ) const
+{
+}
+
+/*!
+  \brief Get list of brackets.
+  \param list returning list of brackets (not used)
+  \param open if \c true, collect opening brackets, or closing brackets otherwise (not used)
+*/
+void QtxEvalSetConst::bracketsList( QStringList& /*list*/, bool /*open*/ ) const
+{
+}
+
+/*!
+  \brief Get the operation priority.
+
+  Operation priority counts from 1.
+  If the operation is impossible, this function returns value <= 0.
+  
+  \param op operation (not used)
+  \param isBin \c true if the operation is binary and \c false if it is unary (not used)
+  \return operation priority
+*/
+int QtxEvalSetConst::priority( const QString& /*op*/, bool /*isBin*/ ) const
+{
+  return 0;
+}
+
+/*!
+  \brief Check operation validity.
+
+  Always returns QtxEvalExpr::InvalidOperation.
+
+  \param op operation (not used)
+  \param t1 first operand type (not used)
+  \param t2 second operand type (not used)
+  \return error code (QtxEvalExpr::Error)
+*/
+QtxEvalExpr::Error QtxEvalSetConst::isValid( const QString&       /*op*/, 
+                                            const QVariant::Type /*t1*/,
+                                            const QVariant::Type /*t2*/ ) const
+{
+  return QtxEvalExpr::InvalidOperation;
+}
+
+/*!
+  \brief Calculate the operation.
+
+  Always returns QtxEvalExpr::InvalidOperation.
+
+  \param op operation name (not used)
+  \param v1 first argument (not valid for unary prefix operations) (not used)
+  \param v2 second argument (not valid for unary postfix operations) (not used)
+  \return error code (QtxEvalExpr::Error)
+*/
+QtxEvalExpr::Error QtxEvalSetConst::calculate( const QString&, QVariant&, QVariant& ) const
+{
+  return QtxEvalExpr::InvalidOperation;
+}
diff --git a/src/Qtx/QtxEvalExpr.h b/src/Qtx/QtxEvalExpr.h
new file mode 100644 (file)
index 0000000..d2fce8b
--- /dev/null
@@ -0,0 +1,327 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxEvalExpr.h
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
+//
+#ifndef QTXEVALEXPR_H
+#define QTXEVALEXPR_H
+
+#include "Qtx.h"
+
+#include <QList>
+#include <QVariant>
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+class QtxEvalSet;
+class QtxEvalParser;
+
+class QTX_EXPORT QtxEvalExpr
+{
+public:
+  //! Parsing error type
+  typedef enum
+  {
+    OK,               //!< No errors found
+    OperandsNotMatch, //!< Types of arguments are invalid for this operation
+    InvalidResult,    //!< Operation cannot find result (for example, division by zero)
+    InvalidOperation, //!< Unknown operation
+    OperationsNull,   //!< Internal operations pointer of parser is null
+    InvalidToken,     //!< Invalid token (neither operation, nor parameter of value)
+    CloseExpected,    //!< Closing bracket is expected
+    ExcessClose,      //!< Extra closing bracket is found
+    BracketsNotMatch, //!< Opening and closing brackets are of different type, e.g. [)
+    StackUnderflow,   //!< There are no arguments in the stack for the operation
+    ExcessData        //!< The parsing is finished, but there are more then one value in the stack
+  } Error;
+
+public:
+  QtxEvalExpr( const QString& = QString() );
+  QtxEvalExpr( const bool, const QString& = QString() );
+  ~QtxEvalExpr();
+
+  QVariant           calculate( const QString& = QString() );
+
+  QString            expression() const;
+  void               setExpression( const QString& );
+
+  Error              error() const;
+  QtxEvalParser*     parser() const;
+
+  bool               autoDeleteOperationSets() const;
+  void               setAutoDeleteOperationSets( const bool );
+
+  QList<QtxEvalSet*> operationSets() const;
+  QtxEvalSet*        operationSet( const QString& ) const;
+  void               removeOperationSet( QtxEvalSet* );
+  void               insertOperationSet( QtxEvalSet*, const int = -1 );
+
+private:
+  void               intialize( const bool, const QString& );
+
+private:
+  QString            myExpr;
+  QtxEvalParser*     myParser;
+};
+
+class QTX_EXPORT QtxEvalParser
+{
+public:
+  QtxEvalParser();
+  virtual ~QtxEvalParser();
+
+  QVariant           calculate();
+  QVariant           calculate( const QString& );
+  bool               setExpression( const QString& );
+
+  QList<QtxEvalSet*> operationSets() const;
+  QtxEvalSet*        operationSet( const QString& ) const;
+  void               removeOperationSet( QtxEvalSet* );
+  void               insertOperationSet( QtxEvalSet*, const int = -1 );
+
+  bool               autoDeleteOperationSets() const;
+  void               setAutoDeleteOperationSets( const bool );
+
+  virtual void       clearParameters();
+  virtual bool       removeParameter( const QString& name );
+  virtual QVariant   parameter( const QString& name ) const;
+  virtual bool       hasParameter( const QString& name ) const;
+  virtual void       setParameter( const QString& name, const QVariant& value );
+  QStringList        parameters() const;
+
+  QtxEvalExpr::Error error() const;
+
+  bool               firstInvalid( QString& ) const;
+  void               removeInvalids();
+  QString            dump() const;
+
+  static QString     toString( const QList<QVariant>& );
+
+protected:
+  //! Types of postfix representation elements
+  typedef enum
+  {
+    Value, //!< Value (number, string, etc.)
+    Param, //!< Parameter
+    Open,  //!< Open bracket
+    Close, //!< Close bracket
+    Pre,   //!< Unary prefix operation
+    Post,  //!< Unary postfix operation
+    Binary //!< Binary operation
+  } PostfixItemType;
+
+  //! Postfix representation element
+  typedef struct
+  {
+    QVariant          myValue;
+    PostfixItemType   myType;
+  } PostfixItem;
+
+  typedef QList<PostfixItem>      Postfix;   //!< postfix representation
+  typedef QList<QtxEvalSet*>      SetList;   //!< list of operations
+  typedef QMap<QString, QVariant> ParamMap;  //!< parameter-to-value map
+
+protected:
+  QString            dump( const Postfix& ) const;
+  virtual bool       prepare( const QString&, Postfix& );
+  virtual bool       setOperationTypes( Postfix& );
+  virtual bool       sort( const Postfix&, Postfix&, const QStringList&,
+                           const QStringList&, int f = -1, int l = -1 );
+
+  virtual bool       parse( const QString& );
+  virtual void       setError( const QtxEvalExpr::Error );
+
+  bool               calculate( const QString&, QVariant&, QVariant& );
+
+  static int         search( const QStringList&, const QString&,
+                             int offset, int& matchLen, int& listind );
+  static QString     note( const QString& str, int pos, int len );
+  static int         globalBrackets( const Postfix&, int, int );
+
+private:
+  void               operationList( QStringList& ) const;
+  void               bracketsList( QStringList&, bool ) const;
+  bool               createValue( const QString&, QVariant& ) const;
+  int                priority( const QString&, bool isBin ) const;
+  QtxEvalExpr::Error isValid( const QString&,
+                              const QVariant::Type, const QVariant::Type ) const;
+  QtxEvalExpr::Error calculation( const QString&, QVariant&, QVariant& ) const;
+
+  bool               checkOperations() const;
+
+private:
+  SetList            mySets;
+  QtxEvalExpr::Error myError;
+  ParamMap           myParams;
+  Postfix            myPostfix;
+  bool               myAutoDel;
+};
+
+class QTX_EXPORT QtxEvalSet
+{
+public:
+  QtxEvalSet();
+  virtual ~QtxEvalSet();
+
+  virtual QString            name() const = 0;
+
+  virtual void               operationList( QStringList& ) const = 0;
+
+  virtual void               bracketsList( QStringList&, bool open ) const = 0;
+
+  virtual bool               createValue( const QString&, QVariant& ) const;
+
+  virtual int                priority( const QString&, bool isBin ) const = 0;
+
+  virtual QtxEvalExpr::Error isValid( const QString&, const QVariant::Type,
+                                      const QVariant::Type ) const = 0;
+
+  virtual QtxEvalExpr::Error calculate( const QString&, QVariant&, QVariant& ) const = 0;
+};
+
+class QTX_EXPORT QtxEvalSetBase : public QtxEvalSet
+{
+public:
+  QtxEvalSetBase();
+  virtual ~QtxEvalSetBase();
+
+  virtual void               operationList( QStringList& ) const;
+  virtual void               bracketsList( QStringList&, bool open ) const;
+
+  virtual QtxEvalExpr::Error isValid( const QString&, const QVariant::Type,
+                                      const QVariant::Type ) const;
+protected: 
+  typedef QList<QVariant::Type> ListOfTypes;
+
+  void                       addTypes( const ListOfTypes& );
+  void                       addOperations( const QStringList& );
+
+private:
+  QStringList                myOpers;
+  ListOfTypes                myTypes;
+};
+
+class QTX_EXPORT QtxEvalSetArithmetic : public QtxEvalSetBase
+{
+public:
+  QtxEvalSetArithmetic();
+  virtual ~QtxEvalSetArithmetic();
+
+  virtual bool               createValue( const QString&, QVariant& ) const;
+  virtual int                priority( const QString&, bool isBin ) const;
+  virtual QtxEvalExpr::Error calculate( const QString&, QVariant&, QVariant& ) const;
+
+  static QString             Name();
+  virtual QString            name() const;
+};
+
+class QTX_EXPORT QtxEvalSetLogic : public QtxEvalSetBase
+{
+public:
+  QtxEvalSetLogic();
+  virtual ~QtxEvalSetLogic();
+
+  virtual bool               createValue( const QString&, QVariant& ) const;
+  virtual int                priority( const QString&, bool isBin ) const;
+  virtual QtxEvalExpr::Error calculate( const QString&, QVariant&, QVariant& ) const;
+
+  static QString             Name();
+  virtual QString            name() const;
+
+private:
+  int                        intValue( const QVariant& v ) const;
+};
+
+class QTX_EXPORT QtxEvalSetMath : public QtxEvalSetBase
+{
+public:
+  QtxEvalSetMath();
+  virtual ~QtxEvalSetMath();
+
+  virtual bool               createValue( const QString&, QVariant& ) const;
+  virtual int                priority( const QString&, bool isBin ) const;
+  virtual QtxEvalExpr::Error calculate( const QString&, QVariant&, QVariant& ) const;
+
+  static QString             Name();
+  virtual QString            name() const;
+};
+
+class QTX_EXPORT QtxEvalSetString : public QtxEvalSetBase
+{
+public:
+  QtxEvalSetString();
+  virtual ~QtxEvalSetString();
+
+  virtual bool               createValue( const QString&, QVariant& ) const;
+  virtual int                priority( const QString&, bool isBin ) const;
+  virtual QtxEvalExpr::Error calculate( const QString&, QVariant&, QVariant& ) const;
+
+  static QString             Name();
+  virtual QString            name() const;
+};
+
+class QTX_EXPORT QtxEvalSetSets : public QtxEvalSetBase
+{
+public:
+  typedef QList<QVariant> ValueSet;
+
+public:
+  QtxEvalSetSets();
+  virtual ~QtxEvalSetSets();
+
+  virtual void               bracketsList( QStringList&, bool open ) const;
+  virtual int                priority( const QString&, bool isBin ) const;
+  virtual QtxEvalExpr::Error isValid( const QString&, const QVariant::Type,
+                                      const QVariant::Type ) const;
+  virtual QtxEvalExpr::Error calculate( const QString&, QVariant&, QVariant& ) const;
+
+  static void add( ValueSet&, const QVariant& );
+  static void add( ValueSet&, const ValueSet& );
+  static void remove( ValueSet&, const QVariant& );
+  static void remove( ValueSet&, const ValueSet& );
+
+  static QString             Name();
+  virtual QString            name() const;
+};
+
+class QTX_EXPORT QtxEvalSetConst : public QtxEvalSet
+{
+public:
+  QtxEvalSetConst();
+  virtual ~QtxEvalSetConst();
+
+  static QString             Name();
+  virtual QString            name() const;
+
+  virtual bool               createValue( const QString&, QVariant& ) const;
+
+  virtual void               operationList( QStringList& ) const;
+  virtual void               bracketsList( QStringList&, bool open ) const;
+  virtual int                priority( const QString&, bool isBin ) const;
+  virtual QtxEvalExpr::Error isValid( const QString&, const QVariant::Type,
+                                      const QVariant::Type ) const;
+  virtual QtxEvalExpr::Error calculate( const QString&, QVariant&, QVariant& ) const;
+};
+
+#endif // QTXEVALEXPR_H
diff --git a/src/Qtx/QtxFontEdit.cxx b/src/Qtx/QtxFontEdit.cxx
new file mode 100644 (file)
index 0000000..30cacf8
--- /dev/null
@@ -0,0 +1,495 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxFontEdit.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxFontEdit.h"
+
+#include "QtxComboBox.h"
+
+#include <QLayout>
+#include <QToolButton>
+#include <QFontDialog>
+#include <QFontDatabase>
+#include <QFontComboBox>
+
+/*!
+  \class QtxFontEdit
+  \brief The QtxFontEdit class represents a widget for font
+  preference items editing.
+
+  The font preference item is represented as the drop-down combo box 
+  filled with the list of available fonts. Additional controls for
+  modifying font properties ('bold', 'italic', font size, etc) are also
+  available for use.
+
+  Initial font value can be set with setCurrentFont() method. Chosen font
+  can be retrieved with the currentFont() method.
+
+  Font properties can be set with the setFontSize(), setFontFamily(), 
+  setFontScripting() methods and retrieved with fontSize(), fontFamily(), 
+  fontScripting() methods.
+
+  Additional widgets for direct modyfing font properties are available
+  with use of setFeatures() method.
+*/
+
+/*!
+  \brief Constructor
+  \param feat font widget features (ORed QtxFontEdit::Features flags)
+  \param parent parent widget
+*/
+QtxFontEdit::QtxFontEdit( const int feat, QWidget* parent )
+: QFrame( parent ),
+  myFeatures( feat ),
+  myMode( Native )
+{
+  initialize();
+}
+
+/*!
+  \brief Constructor
+  \param parent parent widget
+
+  All font widget features are enabled.
+*/
+QtxFontEdit::QtxFontEdit( QWidget* parent )
+: QFrame( parent ),
+  myFeatures( All )
+{
+  initialize();
+}
+
+/*!
+  \brief Destructor
+*/
+QtxFontEdit::~QtxFontEdit()
+{
+}
+
+/*!
+  \brief Get font widget features.
+  \return font widget features (ORed QtxFontEdit::Features flags)
+  \sa setFeatures()
+*/
+int QtxFontEdit::features() const
+{
+  return myFeatures;
+}
+
+/*!
+  \brief Set font widget features.
+  \param f font widget features (ORed QtxFontEdit::Features flags)
+  \sa features()
+*/
+void QtxFontEdit::setFeatures( const int f )
+{
+  if ( myFeatures == f )
+    return;
+
+  myFeatures = f;
+  updateState();
+}
+
+/*!
+  \brief Get currently selected font.
+  \return current font
+  \sa setCurrentFont()
+*/
+QFont QtxFontEdit::currentFont() const
+{
+  QFont fnt( fontFamily(), fontSize() );
+
+  int script = fontScripting();
+  fnt.setBold( script & Bold );
+  fnt.setItalic( script & Italic );
+  fnt.setUnderline( script & Underline );
+  fnt.setOverline( script & Shadow ); //addVtkFontPref( tr( "LABELS" ), valLblFontGr, "values_labeling_font" );
+
+  return fnt;
+}
+
+/*!
+  \brief Set currently selected font.
+  \param fnt current font
+  \sa currentFont()
+*/
+void QtxFontEdit::setCurrentFont( const QFont& fnt )
+{
+  myFamily->blockSignals( true );
+  myCustomFams->blockSignals( true );
+  mySize->blockSignals( true );
+  myB->blockSignals( true );
+  myI->blockSignals( true );
+  myU->blockSignals( true );
+  
+  setFontFamily( fnt.family() );
+  setFontSize( fnt.pointSize() );
+  setFontScripting( ( fnt.bold() ? Bold : 0 ) |
+                    ( fnt.italic() ? Italic : 0 ) |
+                    ( fnt.underline() ? Underline : 0 ) | 
+                    ( fnt.overline() ? Shadow : 0 ) );
+
+  myFamily->blockSignals( false );
+  myCustomFams->blockSignals( false );
+  mySize->blockSignals( false );
+  myB->blockSignals( false );
+  myI->blockSignals( false );
+  myU->blockSignals( false );
+
+  emit( changed( currentFont() ) );
+}
+
+/*!
+  \brief Get selected font family name.
+  \return current font family name
+  \sa setFontFamily()
+*/
+QString QtxFontEdit::fontFamily() const
+{
+  if ( myMode == Native )
+    return myFamily->currentFont().family();
+  else
+    return myCustomFams->currentText();
+}
+
+/*!
+  \brief Get selected font size.
+  \return current font size
+  \sa setFontSize()
+*/
+int QtxFontEdit::fontSize() const
+{
+  bool ok;
+  int pSize = mySize->currentText().toInt( &ok );
+  return ok ? pSize : 0;
+}
+
+/*!
+  \brief Get selected font scripting.
+  \return current font scripting
+  \sa setFontScripting()
+*/
+int QtxFontEdit::fontScripting() const
+{
+  return ( myB->isChecked() ? Bold : 0 ) |
+         ( myI->isChecked() ? Italic : 0 ) |
+         ( myU->isChecked() ? Underline : 0 ) |
+         ( myS->isChecked() ? Shadow : 0 ) ;
+}
+
+/*!
+  \brief Set font family name.
+  \param fam new font family name
+  \sa fontFamily()
+*/
+void QtxFontEdit::setFontFamily( const QString& fam )
+{
+  if ( myMode == Native )
+  {
+    myFamily->setCurrentFont( QFont( fam ) );
+    onFontChanged( myFamily->currentFont() );  
+  }
+  else 
+  {
+    myCustomFams->setCurrentIndex( myCustomFams->findText( fam ) );
+    if ( !myCustomFams->signalsBlocked() )
+      emit( changed( currentFont() ) );
+  }
+}
+
+/*!
+  \brief Set font size.
+  \param fam new font size
+  \sa fontSize()
+*/
+void QtxFontEdit::setFontSize( const int s )
+{
+  if ( s <= 0 )
+    return;
+
+  int idx = mySize->findText( QString::number( s ) );
+  if ( idx != -1 )
+    mySize->setCurrentIndex( idx );
+  else if ( mySize->isEditable() )
+    mySize->setEditText( QString::number( s ) );
+}
+
+/*!
+  \brief Set font scripting.
+  \param fam new font scripting
+  \sa fontScripting()
+*/
+void QtxFontEdit::setFontScripting( const int script )
+{
+  myB->setChecked( script & Bold );
+  myI->setChecked( script & Italic );
+  myU->setChecked( script & Underline );
+  myS->setChecked( script & Shadow );
+}
+
+/*!
+  \brief Update widget state
+*/
+void QtxFontEdit::updateState()
+{
+  int feat = features();
+
+  myFamily->setVisible( ( feat & Family ) && myMode == Native );
+  myCustomFams->setVisible( ( feat & Family ) && myMode == Custom );
+  mySize->setVisible( feat & Size );
+  myB->setVisible( feat & Bold );
+  myI->setVisible( feat & Italic );
+  myU->setVisible( feat & Underline );
+  myS->setVisible( feat & Shadow );
+  myPreview->setVisible( feat & Preview );
+
+  mySize->setEditable( feat & UserSize );
+}
+
+/*!
+  \brief Called when current font is changed.
+  \param f (not used)
+*/
+void QtxFontEdit::onFontChanged( const QFont& /*f*/ )
+{
+  bool blocked = mySize->signalsBlocked();
+  mySize->blockSignals( true );
+
+  int s = fontSize();
+  mySize->clear();
+
+  QList<int> szList = QFontDatabase().pointSizes( fontFamily() );
+  QStringList sizes;
+  for ( QList<int>::const_iterator it = szList.begin(); it != szList.end(); ++it )
+    sizes.append( QString::number( *it ) );
+  mySize->addItems( sizes );
+
+  setFontSize( s );
+
+  mySize->blockSignals( blocked );
+
+  if ( !myFamily->signalsBlocked() )
+    emit( changed( currentFont() ) );
+}
+
+void QtxFontEdit::onPropertyChanged()
+{
+  emit( changed( currentFont() ) );
+}
+
+/*!
+  \brief Called when "Preview" button is clicked.
+  \param on (not used)
+*/
+void QtxFontEdit::onPreview( bool /*on*/ )
+{
+  bool ok;
+  QFont fnt = QFontDialog::getFont( &ok, currentFont() );
+
+  if ( ok )
+    setCurrentFont( fnt );
+}
+
+/*
+  \brief Perform internal intialization.
+*/
+void QtxFontEdit::initialize()
+{
+  QHBoxLayout* base = new QHBoxLayout( this );
+  base->setMargin( 0 );
+  base->setSpacing( 5 );
+
+  base->addWidget( myFamily = new QFontComboBox( this ) );
+  base->addWidget( myCustomFams = new QComboBox( this ) );
+  base->addWidget( mySize = new QtxComboBox( this ) );
+  mySize->setInsertPolicy( QComboBox::NoInsert );
+  mySize->setValidator( new QIntValidator( 1, 250, mySize ) );
+
+  base->addWidget( myB = new QToolButton( this ) );
+  myB->setText( tr( "B" ) );
+  myB->setCheckable( true );
+
+  base->addWidget( myI = new QToolButton( this ) );
+  myI->setText( tr( "I" ) );
+  myI->setCheckable( true );
+
+  base->addWidget( myU = new QToolButton( this ) );
+  myU->setText( tr( "U" ) );
+  myU->setCheckable( true );
+
+  base->addWidget( myS = new QToolButton( this ) );
+  myS->setText( tr( "S" ) );
+  myS->setCheckable( true );
+
+  base->addWidget( myPreview = new QToolButton( this ) );
+  myPreview->setText( "..." );
+
+  myFamily->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
+  myCustomFams->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
+
+  connect( myPreview, SIGNAL( clicked( bool ) ),                    this, SLOT( onPreview( bool ) ) );
+  connect( myFamily,  SIGNAL( currentFontChanged( const QFont& ) ), this, SLOT( onFontChanged( const QFont& ) ) );
+  connect( mySize,    SIGNAL( currentIndexChanged( int ) ),         this, SLOT( onPropertyChanged() ) );
+  connect( mySize,    SIGNAL( editTextChanged( QString ) ),         this, SLOT( onPropertyChanged() ) );
+  connect( myB,       SIGNAL( toggled( bool ) ),                    this, SLOT( onPropertyChanged() ) );
+  connect( myI,       SIGNAL( toggled( bool ) ),                    this, SLOT( onPropertyChanged() ) );
+  connect( myU,       SIGNAL( toggled( bool ) ),                    this, SLOT( onPropertyChanged() ) );
+
+  myCustomFams->hide();
+  myS->hide();
+
+  updateState();
+  onFontChanged( currentFont() );
+}
+
+/*!
+  \brief Specifies whether widget works in Native or Custom mode. Native mode 
+  is intended for working with system fonts. Custom mode is intended for 
+  working with manually defined set of fonts. Set of custom fonts can be 
+  specified with setCustomFonts() method 
+  \param mode mode from QtxFontEdit::Mode enumeration
+  \sa mode()
+*/
+void QtxFontEdit::setMode( const int mode )
+{
+  if ( myMode == mode )
+    return;
+
+  myMode = mode;
+
+  myFamily->setShown( myMode == Native );
+  myCustomFams->setShown( myMode == Custom );
+
+  updateGeometry();
+}
+
+/*!
+  \brief Verifies whether widget works in Native or Custom mode
+  \return Native or Custom mode
+  \sa setMode()
+*/
+int QtxFontEdit::mode() const
+{
+  return myMode;
+}
+
+/*!
+  \brief Sets list of custom fonts. 
+  <b>This method is intended for working in Custom mode.</b>
+  \param fams list of families
+  \sa fonts(), setMode()
+*/
+void QtxFontEdit::setFonts( const QStringList& fams )
+{
+  QString currFam = myCustomFams->currentText();
+  
+  myCustomFams->clear();
+  myCustomFams->addItems( fams );
+
+  int ind = myCustomFams->findText( currFam );
+  if ( ind != -1 )
+    myCustomFams->setCurrentIndex( ind );
+
+  setSizes( QList<int>() );
+}
+
+/*!
+  \brief Sets list of available font sizes. 
+  <b>This method is intended for working in Custom mode.</b> The list of sizes can 
+  be empty. In this case system generate listof size automatically from 8 till 72.
+  \param sizes list of sizes
+  \sa sizes(), setMode()
+*/
+void QtxFontEdit::setSizes( const QList<int>& sizes )
+{
+  QString currSize = mySize->currentText();
+
+  mySize->clear();
+  if ( !sizes.isEmpty() )
+  {
+    QStringList szList;
+    for ( QList<int>::const_iterator it = sizes.begin(); it != sizes.end(); ++it )
+      szList.append( QString::number( *it ) );
+    mySize->addItems( szList );
+  }
+  else
+  {
+    static QStringList defLst;
+    if ( defLst.isEmpty() )
+    {
+      QString str( "8 9 10 11 12 14 16 18 20 22 24 26 28 36 48 72" );
+      defLst = str.split( " " );
+    }
+    mySize->addItems( defLst );
+  }
+  
+  int ind = mySize->findText( currSize );
+  if ( ind != -1 )
+    mySize->setCurrentIndex( ind );
+}
+
+/*!
+  \brief Gets list of custom fonts 
+  \return list of families
+  \sa setFonts(), setMode()
+*/
+QStringList QtxFontEdit::fonts() const
+{
+  QStringList fams;
+  for ( int i = 0, n = myCustomFams->count(); i < n; i++ )
+    fams.append( myCustomFams->itemText( i ) );
+  return fams;
+}
+
+/*!
+  \brief Gets list of custom fonts 
+  \return list of families
+  \sa setCustomFonts(), setMode()
+*/
+QList<int> QtxFontEdit::sizes() const
+{
+  QList<int> lst;
+  for ( int i = 0, n = mySize->count(); i < n; i++ )
+    lst.append( mySize->itemText( i ).toInt() );
+  return lst;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Qtx/QtxFontEdit.h b/src/Qtx/QtxFontEdit.h
new file mode 100644 (file)
index 0000000..8934f9c
--- /dev/null
@@ -0,0 +1,112 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxFontEdit.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXFONTEDIT_H
+#define QTXFONTEDIT_H
+
+#include "Qtx.h"
+
+#include <QFrame>
+
+class QtxComboBox;
+class QComboBox;
+class QToolButton;
+class QFontComboBox;
+
+class QTX_EXPORT QtxFontEdit : public QFrame
+{
+  Q_OBJECT
+
+public:
+  //! Font widget features
+  typedef enum { 
+    Family    = 0x01,                                      //!< show font family selection widget
+    Size      = 0x02,                                      //!< show font size widget
+    UserSize  = 0x04,                                      //!< allow font size direct change
+    Bold      = 0x08,                                      //!< show 'bold' widget
+    Italic    = 0x10,                                      //!< show 'italic' widget
+    Underline = 0x20,                                      //!< show 'underline' widget
+    Shadow    = 0x40,                                      //!< show 'shadow' widget
+    Preview   = 0x80,                                      //!< show font preview widget
+    Scripting = Bold | Italic | Underline,                 //!< show font scripting widgets ('bold','italic','underline')
+    All = Family | Size | UserSize | Scripting | Preview   //!< show all font widgets
+  } Features;
+
+  typedef enum 
+  {
+    Native, //!< Native mode intended for working with system fonts
+    Custom  //!< Custom mode intended for working with manually defined set of fonts
+  } Mode;
+
+public:
+  QtxFontEdit( const int, QWidget* = 0 );
+  QtxFontEdit( QWidget* = 0 );
+  virtual ~QtxFontEdit();
+
+  QFont          currentFont() const;
+  void           setCurrentFont( const QFont& );
+
+  int            fontSize() const;
+  QString        fontFamily() const;
+  int            fontScripting() const;
+
+  void           setFontSize( const int );
+  void           setFontFamily( const QString& );
+  void           setFontScripting( const int );
+
+  int            features() const;
+  void           setFeatures( const int );
+
+  void           setMode( const int );
+  int            mode() const;
+
+  void           setFonts( const QStringList& );
+  QStringList    fonts() const;
+
+  void           setSizes( const QList<int>& = QList<int>() );
+  QList<int>     sizes() const;
+
+signals:
+  void           changed( const QFont& );
+
+private slots:
+  void           onPreview( bool );
+  void           onFontChanged( const QFont& );
+  void           onPropertyChanged();
+private:
+  void           initialize();
+  void           updateState();
+
+private:
+  QtxComboBox*   mySize;
+  QFontComboBox* myFamily;
+  QToolButton*   myPreview;
+  int            myFeatures;
+  QToolButton    *myB, *myI, *myU, *myS;
+  int            myMode;
+  QComboBox*     myCustomFams;
+};
+
+#endif // QTXFONTEDIT_H
diff --git a/src/Qtx/QtxGridBox.cxx b/src/Qtx/QtxGridBox.cxx
new file mode 100644 (file)
index 0000000..c2f0423
--- /dev/null
@@ -0,0 +1,365 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxGridBox.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxGridBox.h"
+
+#include <QGridLayout>
+#include <QChildEvent>
+
+/*!
+  \class QtxGridBox::Space
+  \internal
+  \brief Represents a space in the grid box.
+*/
+
+class QtxGridBox::Space : public QWidget
+{
+public:
+  Space( const int, QtxGridBox* );
+  virtual ~Space();
+
+  virtual QSize sizeHint() const;
+  virtual QSize minimumSizeHint() const;
+
+private:
+  int           mySize;
+  QtxGridBox*   myGrid;
+};
+
+/*!
+  \brief Constructor.
+  \param sz size
+  \param gb parent grid box
+*/
+QtxGridBox::Space::Space( const int sz, QtxGridBox* gb )
+: QWidget( gb ),
+  mySize( sz ),
+  myGrid( gb )
+{
+  setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxGridBox::Space::~Space()
+{
+}
+
+/*!
+  \brief Get recommended size for the widget.
+  \return recommended size for the widget
+*/
+QSize QtxGridBox::Space::sizeHint() const
+{
+  return minimumSizeHint();
+}
+
+/*!
+  \brief Get recommended minimum size for the widget.
+  \return recommended minimum size for the widget
+*/
+QSize QtxGridBox::Space::minimumSizeHint() const
+{
+  QSize sz( 0, 0 );
+  if ( myGrid && myGrid->orientation() == Qt::Horizontal )
+    sz.setWidth( mySize );
+  else
+    sz.setHeight( mySize );
+  return sz;
+}
+
+/*!
+  \class QtxGridBox
+  \brief A container widget with possibility to automatically layout
+         child widgets.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+  \param m grid box margin
+  \param s grid box spacing
+*/
+QtxGridBox::QtxGridBox( QWidget* parent, const int m, const int s )
+: QWidget( parent ),
+  myCols( 1 ),
+  mySkip( false ),
+  myOrient( Qt::Vertical ),
+  myCol( 0 ),
+  myRow( 0 )
+{
+  myLayout = new QGridLayout( this );
+  myLayout->setMargin( m );
+  myLayout->setSpacing( s );
+}
+
+/*!
+  \brief Constructor.
+  \param cols number of grid box columns or rows (depending on the orientation)
+  \param o grid box orientation
+  \param parent parent widget
+  \param m grid box margin
+  \param s grid box spacing
+*/
+QtxGridBox::QtxGridBox( const int cols, Qt::Orientation o, QWidget* parent, const int m, const int s )
+: QWidget( parent ),
+  myCols( cols ),
+  mySkip( false ),
+  myOrient( o ),
+  myLayout( 0 ),
+  myCol( 0 ),
+  myRow( 0 )
+{
+  myLayout = new QGridLayout( this );
+  myLayout->setMargin( m );
+  myLayout->setSpacing( s );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxGridBox::~QtxGridBox()
+{
+}
+
+/*!
+  \brief Get number of grid box columns/rows (depending on the orientation).
+  \return number of columns (rows)
+*/
+int QtxGridBox::columns() const
+{
+  return myCols;
+}
+
+/*!
+  \brief Get the grid box orientation.
+  \return orientation
+*/
+Qt::Orientation QtxGridBox::orientation() const
+{
+  return myOrient;
+}
+
+/*!
+  \brief Set number of grid box columns/rows (depending on the orientation).
+  \param cols number of columns (rows)
+*/
+void QtxGridBox::setColumns( const int cols )
+{
+  setLayout( cols, orientation() );
+}
+
+/*!
+  \brief Set the grid box orientation.
+  \param o orientation
+*/
+void QtxGridBox::setOrientation( Qt::Orientation o )
+{
+  setLayout( columns(), o );
+}
+
+/*!
+  \brief Initialize internal layout.
+  \param cols number of columns (rows)
+  \param o orientation
+*/
+void QtxGridBox::setLayout( const int cols, Qt::Orientation o )
+{
+  if ( myCols == cols && myOrient == o )
+    return;
+
+  myCols = cols;
+  myOrient = o;
+
+  arrangeWidgets();
+}
+
+/*!
+  \brief Get "skip invisible widgets" flags.
+  \return current flag state
+*/
+bool QtxGridBox::skipInvisible() const
+{
+  return mySkip;
+}
+
+/*!
+  \brief Set "skip invisible widgets" flags.
+
+  If this flag is set to \c false, invisible widgets
+  are not taken into account when layouting widgets.
+
+  \param on new flag state
+*/
+void QtxGridBox::setSkipInvisible( const bool on )
+{
+  if ( mySkip == on )
+    return;
+
+  mySkip = on;
+  arrangeWidgets();
+}
+
+/*!
+  \brief Add space (empty cell) to the grid box.
+  \param sp requied space size
+*/
+void QtxGridBox::addSpace( const int sp )
+{
+  new Space( sp, this );
+}
+
+/*!
+  \brief Get grid box's inside margin size.
+  \return inside margin size
+*/
+int QtxGridBox::insideMargin() const
+{
+  return myLayout->margin();
+}
+
+/*!
+  \brief Get grid box's inside spacing size.
+  \return inside spacing size
+*/
+int QtxGridBox::insideSpacing() const
+{
+  return myLayout->spacing();
+}
+
+/*!
+  \brief Set grid box's inside margin size.
+  \param m new inside margin size
+*/
+void QtxGridBox::setInsideMargin( const int m )
+{
+  myLayout->setMargin( m );
+}
+
+/*!
+  \brief Set grid box's inside spacing size.
+  \param s new inside spacing size
+*/
+void QtxGridBox::setInsideSpacing( const int s )
+{
+  myLayout->setSpacing( s );
+}
+
+/*!
+  \brief Custom event filter.
+  \param o event receiver object.
+  \param e event
+  \return \c true if the event processing should be stopped
+*/
+bool QtxGridBox::eventFilter( QObject* o, QEvent* e )
+{
+  if ( skipInvisible() && ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ||
+                            e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ) )
+    arrangeWidgets();
+
+  return QWidget::eventFilter( o, e );
+}
+
+/*!
+  \brief Customize child event.
+  \param e child event
+*/
+void QtxGridBox::childEvent( QChildEvent* e )
+{
+  if ( e->child()->isWidgetType() )
+  {
+    QWidget* wid = (QWidget*)e->child();
+    if ( e->type() == QEvent::ChildAdded )
+    {
+      placeWidget( wid );
+      wid->installEventFilter( this );
+    }
+    else if ( e->type() == QEvent::ChildRemoved )
+      wid->removeEventFilter( this );
+  }
+  QWidget::childEvent( e );
+}
+
+/*!
+  \brief Increment the grid box current cell.
+*/
+void QtxGridBox::skip()
+{
+  if ( orientation() == Qt::Horizontal )
+  {
+    myCol++;
+    if ( myCol >= columns() )
+    {
+      myRow++;
+      myCol = 0;
+    }
+  }
+  else
+  {
+    myRow++;
+    if ( myRow >= columns() )
+    {
+      myCol++;
+      myRow = 0;
+    }
+  }
+}
+
+/*!
+  \brief Arrange child widgets.
+*/
+void QtxGridBox::arrangeWidgets()
+{
+  myRow = myCol = 0;
+  int m = myLayout ? myLayout->margin() : 0;
+  int s = myLayout ? myLayout->spacing() : 0;
+  delete myLayout;
+  myLayout = new QGridLayout( this );
+  myLayout->setMargin( m );
+  myLayout->setSpacing( s );
+
+  QObjectList list = children();
+  for ( QObjectList::iterator it = list.begin(); it != list.end(); ++it )
+  {
+    if ( !(*it)->isWidgetType() )
+      continue;
+
+    QWidget* wid = (QWidget*)(*it);
+    if ( !skipInvisible() || wid->isVisibleTo( this ) )
+      placeWidget( wid );
+  }
+  updateGeometry();
+}
+
+/*!
+  \brief Place new widget to the current grid box cell.
+  \param wid widget being inserted
+*/
+void QtxGridBox::placeWidget( QWidget* wid )
+{
+  myLayout->addWidget( wid, myRow, myCol );
+
+  skip();
+}
diff --git a/src/Qtx/QtxGridBox.h b/src/Qtx/QtxGridBox.h
new file mode 100644 (file)
index 0000000..7ddf76b
--- /dev/null
@@ -0,0 +1,82 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxGridBox.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXGRIDBOX_H
+#define QTXGRIDBOX_H
+
+#include "Qtx.h"
+
+#include <QWidget>
+
+class QGridLayout;
+
+class QTX_EXPORT QtxGridBox : public QWidget
+{
+  Q_OBJECT
+
+  class Space;
+
+public:
+  QtxGridBox( QWidget* = 0, const int = 5, const int = 5 );
+  QtxGridBox( const int, Qt::Orientation, QWidget* = 0, const int = 5, const int = 5 );
+  virtual ~QtxGridBox();
+
+  int             columns() const;
+  Qt::Orientation orientation() const;
+
+  void            setColumns( const int );
+  void            setOrientation( Qt::Orientation );
+
+  void            setLayout( const int, Qt::Orientation );
+
+  bool            skipInvisible() const;
+  void            setSkipInvisible( const bool );
+
+  void            addSpace( const int );
+
+  int             insideMargin() const;
+  int             insideSpacing() const;
+  void            setInsideMargin( const int );
+  void            setInsideSpacing( const int );
+
+  virtual bool    eventFilter( QObject*, QEvent* );
+
+protected:
+  void            childEvent( QChildEvent* );
+
+private:
+  void            skip();
+  void            arrangeWidgets();
+  void            placeWidget( QWidget* );
+
+private:
+  int             myCols;
+  bool            mySkip;
+  Qt::Orientation myOrient;
+  QGridLayout*    myLayout;
+
+  int             myCol, myRow;
+};
+
+#endif
index 6975f779e27cced40777c9a06d6e11572fc6341b..c6cccf4b363186e703808a4d7301ce7087ad8a5c 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxGroupBox.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxGroupBox.h"
 
-#include <qhbox.h>
-#include <qlayout.h>
-#include <qtoolbutton.h>
-#include <qapplication.h>
-#include <qobjectlist.h>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QEvent>
+#include <QObjectList>
+#include <QApplication>
 
 /*!
-  Constructor
-*/
-QtxGroupBox::QtxGroupBox( QWidget* parent, const char* name )
-: QGroupBox( parent, name ),
-myContainer( 0 )
-{
-}
+  \class QtxGroupBox
+  \brief Enhanced group box widget.
 
-/*!
-  Constructor
+  The QtxGroupBox class allows inserting custom widgets in the 
+  group box title. Use insertTitleWidget() method to add
+  custom widget to the title and removeTitleWidget() to remove it.
 */
-QtxGroupBox::QtxGroupBox( const QString& title, QWidget* parent, const char* name )
-: QGroupBox( title, parent, name ),
-myContainer( 0 )
-{
-  initialize();
-}
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param parent parent widget 
 */
-QtxGroupBox::QtxGroupBox( int strips, Orientation o, QWidget* parent, const char* name )
-: QGroupBox( strips, o, parent, name ),
-myContainer( 0 )
+QtxGroupBox::QtxGroupBox( QWidget* parent )
+: QGroupBox( parent ),
+  myContainer( 0 )
 {
   initialize();
 }
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param title group box title text
+  \param parent parent widget 
 */
-QtxGroupBox::QtxGroupBox( int strips, Orientation o, const QString& title,
-                                          QWidget* parent, const char* name )
-: QGroupBox( strips, o, title, parent, name ),
-myContainer( 0 )
+QtxGroupBox::QtxGroupBox( const QString& title, QWidget* parent )
+: QGroupBox( title, parent ),
+  myContainer( 0 )
 {
   initialize();
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxGroupBox::~QtxGroupBox()
 {
-  delete myContainer;
 }
 
 /*!
-  Creates horizontal box as container
+  \brief Initialize the group box.
+
+  Creates horizontal box as container for title widgets.
 */
 void QtxGroupBox::initialize()
 {
-  myContainer = new QHBox( this, 0, WStyle_Customize | WStyle_NoBorderEx | WStyle_Tool );
+  myContainer = new QWidget( this );
+  QHBoxLayout* base = new QHBoxLayout( myContainer );
+  base->setMargin( 0 );
+  base->setSpacing( 0 );
 
   updateTitle();
 }
 
-#if QT_VER < 3
-
-/*!
-  \return the width of the empty space between the items in the group and the frame of the group
-*/
-int QtxGroupBox::insideMargin() const
-{
-  int m = 0;
-  if ( layout() )
-    m = layout()->margin();
-  return m;
-}
-
-/*!
-  \return the width of the empty space between each of the items in the group
-*/
-int QtxGroupBox::insideSpacing() const
-{
-  int s = 0;
-  if ( layout() )
-    s = layout()->spacing();
-  return s;
-}
-
-/*!
-  Sets the width of the empty space between the items in the group and the frame of the group
-*/
-void QtxGroupBox::setInsideMargin( int m )
-{
-  if ( layout() )
-    layout()->setMargin( m );
-}
-
 /*!
-  Sets the width of the empty space between each of the items in the group
-*/
-void QtxGroupBox::setInsideSpacing( int s )
-{
-  if ( layout() )
-    layout()->setSpacing( s );
-}
-
-#endif
-
-/*!
-  Inserts title widget
-  \param wid - new title widget
+  \brief Add widget to the group box title.
+  \param wid widget being added to the title
 */
 void QtxGroupBox::insertTitleWidget( QWidget* wid )
 {
   if ( !myContainer )
     return;
 
-  wid->reparent( myContainer, QPoint( 0, 0 ), true );
+  myContainer->layout()->addWidget( wid );
   wid->installEventFilter( this );
 
   updateTitle();
 }
 
 /*!
-  Removes title widget
-  \param wid - title widget
+  \brief Remove widget from the group box title.
+  \param wid widget to be removed from the title
 */
 void QtxGroupBox::removeTitleWidget( QWidget* wid )
 {
   if ( !myContainer || wid->parentWidget() != myContainer )
     return;
 
-  wid->reparent( 0, QPoint( 0, 0 ), false );
+  myContainer->layout()->removeWidget( wid );
+  wid->setParent( 0 );
   wid->removeEventFilter( this );
+  wid->hide();
 
   updateTitle();
 }
 
 /*!
-  Calculates margin
-*/
-void QtxGroupBox::adjustInsideMargin()
-{
-  QApplication::sendPostedEvents( myContainer, QEvent::ChildInserted );
-
-  myContainer->resize( myContainer->minimumSizeHint() );
-
-  setInsideMargin( myContainer->height() );
-}
-
-/*!
-  Sets the alignment of the group box title
+  \brief Show/hide group box.
+  \param on if \c true, show group box, otherwise, hide it
 */
-void QtxGroupBox::setAlignment( int align )
+void QtxGroupBox::setVisible( bool on )
 {
-  QGroupBox::setAlignment( align );
+  if ( on )
+    updateTitle();
 
-  updateTitle();
+  QGroupBox::setVisible( on );
 }
 
 /*!
-  Sets title of groop box
+  \brief Get recommended size for the widget.
+  \return recommended size for the widget
 */
-void QtxGroupBox::setTitle( const QString& title )
-{
-  QGroupBox::setTitle( title );
-
-  updateTitle();
-}
-
-/*!
-  Changes the layout of the group box
-  \param strips - number of column/rows
-  \param o - orientation
-*/
-void QtxGroupBox::setColumnLayout( int strips, Orientation o )
+QSize QtxGroupBox::sizeHint() const
 {
-  if ( myContainer )
-    myContainer->reparent( 0, QPoint( 0, 0 ), false );
-
-  QGroupBox::setColumnLayout( strips, o );
-
-  if ( myContainer )
-    myContainer->reparent( this, QPoint( 0, 0 ), false );
-
-  updateTitle();
+  return expandTo( QGroupBox::sizeHint() );
 }
 
 /*!
-  Shows group box
+  \brief Get recommended minimum size for the widget.
+  \return recommended minimum size for the widget
 */
-void QtxGroupBox::show()
+QSize QtxGroupBox::minimumSizeHint() const
 {
-  QGroupBox::show();
-
-  updateTitle();
+  return expandTo( QGroupBox::minimumSizeHint() );
 }
 
 /*!
-  Updates group box
+  \brief Custom event filter.
+  \param obj event receiver
+  \param e event
+  \return \c true if event processing should be stopped
 */
-void QtxGroupBox::update()
+bool QtxGroupBox::eventFilter( QObject* obj, QEvent* e )
 {
-  QGroupBox::update();
+  QEvent::Type type = e->type();
+  if ( myContainer && obj->parent() == myContainer &&
+       ( type == QEvent::Show || type == QEvent::ShowToParent ||
+         type == QEvent::Hide || type == QEvent::HideToParent ) )
+    QApplication::postEvent( this, new QEvent( QEvent::User ) );
 
-  updateTitle();
+  return QGroupBox::eventFilter( obj, e );
 }
-
 /*!
-  \return the recommended size for the widget
+  \brief Get central widget (or first found one).
+  \return widget
 */
-QSize QtxGroupBox::sizeHint() const
+QWidget* QtxGroupBox::widget() const
 {
-  QSize sz = QGroupBox::sizeHint();
-
-  int sw = titleSize().width();
-
-  if ( myContainer )
-  {
-    if ( alignment() == AlignCenter )
-      sw += 2 * ( myContainer->width() + 5 );
-    else
-      sw += 1 * ( myContainer->width() + 5 );
-  }
+  if ( !layout() )
+    return 0;
 
-  sw += frameRect().left();
-
-  return QSize( QMAX( sz.width(), sw ), sz.height() );
+  QWidget* w = 0;
+  for ( int i = 0; i < (int)layout()->count() && !w; i++ )
+    w = layout()->itemAt( i )->widget();
+  return w;
 }
 
 /*!
-  \return the recommended minimum size for the widget
+  \brief Set central widget to the group box.
+  \param wid widget being added to the group box
 */
-QSize QtxGroupBox::minimumSizeHint() const
+void QtxGroupBox::setWidget( QWidget* wid )
 {
-  QSize sz = QGroupBox::minimumSizeHint();
+  QWidget* w = widget();
+  if ( w == wid )
+    return;
 
-  int sw = titleSize().width() + myContainer ? myContainer->width() + 5 : 0;
+  if ( layout() )
+    layout()->removeWidget( w );
 
-  if ( myContainer )
+  if ( !wid )
+    delete layout();
+  else if ( !layout() )
   {
-    if ( alignment() == AlignCenter )
-      sw += 2 * ( myContainer->width() + 5 );
-    else
-      sw += 1 * ( myContainer->width() + 5 );
+    QLayout* bl = new QVBoxLayout( this );
+    bl->setMargin( 0 );
+    bl->setSpacing( 0 );
   }
 
-  sw += frameRect().left();
-
-  return QSize( QMAX( sz.width(), sw ), sz.height() );
-}
-
-/*!
-  Custom event filter
-*/
-bool QtxGroupBox::eventFilter( QObject* obj, QEvent* e )
-{
-  QEvent::Type type = e->type();
-  if ( myContainer && obj->parent() == myContainer &&
-       ( type == QEvent::Show || type == QEvent::ShowToParent ||
-         type == QEvent::Hide || type == QEvent::HideToParent ) )
-    QApplication::postEvent( this, new QCustomEvent( QEvent::User ) );
+  if ( layout() )
+    layout()->addWidget( wid );
 
-  return QGroupBox::eventFilter( obj, e );
+  if ( wid )
+    wid->updateGeometry();
 }
 
 /*!
-  Custom resize event filter
+  \brief Customize resize event.
+  \param e resize event
 */
 void QtxGroupBox::resizeEvent( QResizeEvent* e )
 {
@@ -298,56 +218,38 @@ void QtxGroupBox::resizeEvent( QResizeEvent* e )
 }
 
 /*!
-  Custom child event filter
+  \brief Customize child event.
+  \param e child event
 */
 void QtxGroupBox::childEvent( QChildEvent* e )
 {
-  if ( e->type() == QEvent::ChildInserted && e->child() == myContainer )
+/*
+  if ( e->type() == QEvent::ChildAdded && e->child() == myContainer )
     return;
-
-  QGroupBox::childEvent( e );
-}
-
-/*!
-  Event filter of custom items
 */
-void QtxGroupBox::customEvent( QCustomEvent* )
-{
-  updateTitle();
+  QGroupBox::childEvent( e );
 }
 
 /*!
-  On frame changed
+  \brief Process custom events.
+  \param e custom event (not used)
 */
-void QtxGroupBox::frameChanged()
+void QtxGroupBox::customEvent( QEvent* /*e*/ )
 {
   updateTitle();
 }
 
 /*!
-  \return size of title
+  \brief Get the group box title size.
+  \return title size
 */
 QSize QtxGroupBox::titleSize() const
 {
-  QSize sz( 0, 0 );
-
-  if ( layout() )
-  {
-    QSpacerItem* si = 0;
-    for ( QLayoutIterator it = layout()->iterator(); it.current() && !si; ++it )
-      si = it.current()->spacerItem();
-    if ( si )
-      sz = si->sizeHint();
-  }
-
-  int w = sz.width();
-  int h = sz.height() + insideMargin();
-
-  return QSize( w, h );
+  return QSize( fontMetrics().width( title() ), fontMetrics().height() );
 }
 
 /*!
-  Updates title
+  \brief Update the group box title.
 */
 void QtxGroupBox::updateTitle()
 {
@@ -355,53 +257,92 @@ void QtxGroupBox::updateTitle()
     return;
 
   int align = alignment();
-  if ( align == AlignAuto )
-    align = QApplication::reverseLayout() ? AlignRight : AlignLeft;
 
   if ( title().isEmpty() )
-    align = AlignRight;
+    align = Qt::AlignRight;
 
   QSize ts = titleSize();
 
   int m = 5;
 
-  int w = frameRect().width() - ts.width();
-  if ( align == AlignCenter )
+  int w = width() - ts.width();
+  if ( align == Qt::AlignCenter )
     w = w / 2;
 
   w -= m;
 
-  QApplication::sendPostedEvents( myContainer, QEvent::ChildInserted );
   myContainer->resize( myContainer->minimumSizeHint() );
 
   bool vis = false;
-  const QObjectList* list = myContainer->children();
-  if ( list )
-  {
-    for ( QObjectListIt it( *list ); it.current() && !vis; ++it )
-      vis = it.current()->isWidgetType() &&
-            ((QWidget*)it.current())->isVisibleTo( myContainer );
-  }
+  const QObjectList list = myContainer->children();
+  for ( QObjectList::const_iterator it = list.begin(); it != list.end() && !vis; ++it )
+    vis = (*it)->isWidgetType() && ((QWidget*)(*it))->isVisibleTo( myContainer );
 
-  if ( myContainer->height() > ts.height() || myContainer->width() > w || !vis )
+  if ( !vis )
     myContainer->hide();
   else
   {
     int x = 0;
-    if ( align == AlignRight )
-      x = frameRect().left() + m;
+    if ( align == Qt::AlignRight )
+      x = rect().left() + m;
     else
-      x = frameRect().right() - myContainer->width() - m;
+      x = rect().right() - myContainer->width() - m;
 
-    int y = frameRect().top() - ( myContainer->height() - frameWidth() ) / 2;
+    int y = rect().top() - ( myContainer->height() - ts.height() ) / 2;
 
-    QPoint pos( x, QMAX( 0, y ) );
-    pos = mapToGlobal( pos );
-    if ( myContainer->parentWidget() )
-      pos = myContainer->parentWidget()->mapFromGlobal( pos );
+    QPoint pos( x, qMax( 0, y ) );
     myContainer->move( pos );
     myContainer->show();
   }
 
+  if ( layout() )
+  {
+    if ( myContainer && myContainer->isVisibleTo( this ) )
+      setInsideMargin( qMax( 0, myContainer->height() - ts.height() ) );
+    else
+      setInsideMargin( 0 );
+  }
+
   updateGeometry();
 }
+
+/*!
+  \brief Expand group box to the specified size.
+  \param sz new size
+*/
+QSize QtxGroupBox::expandTo( const QSize& sz ) const
+{
+  int sh = 0;
+  int sw = titleSize().width();
+  if ( myContainer && myContainer->isVisibleTo( (QWidget*)this ) )
+  {
+    if ( alignment() == Qt::AlignCenter )
+      sw += 2 * ( myContainer->width() + 5 );
+    else
+      sw += 1 * ( myContainer->width() + 5 );
+    sw += 20;
+    sh = myContainer->height() + 5;
+  }
+  return QSize( qMax( sz.width(), sw ), qMax( sz.height(), sh ) );
+}
+
+/*!
+  \brief Set group box's inside margin size.
+  \param m new inside margin size
+*/
+void QtxGroupBox::setInsideMargin( const int m )
+{
+  QVBoxLayout* bl = ::qobject_cast<QVBoxLayout*>( layout() );
+
+  if ( !bl )
+    return;
+
+  QSpacerItem* spacer = 0;
+  if ( bl->count() )
+    spacer = bl->itemAt( 0 )->spacerItem();
+
+  if ( !spacer )
+    bl->insertSpacing( 0, m );
+  else
+    spacer->changeSize( 0, m );
+}
index 04f9bb2e6c4f7c90189ded53b954dc8e94c3398f..f37b8dd2248be7325e3fbe4fc8b7e0d98c5676fd 100644 (file)
@@ -1,77 +1,68 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxGroupBox.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXGROUPBOX_H
 #define QTXGROUPBOX_H
 
 #include "Qtx.h"
 
-#include <qgroupbox.h>
-#include <qwidgetlist.h>
+#include <QGroupBox>
 
 class QTX_EXPORT QtxGroupBox : public QGroupBox
 {
   Q_OBJECT
 
 public:
-  QtxGroupBox( QWidget* = 0, const char* = 0 );
-  QtxGroupBox( const QString&, QWidget* = 0, const char* = 0 );
-  QtxGroupBox( int, Orientation, QWidget* = 0, const char* = 0 );
-  QtxGroupBox( int, Orientation, const QString&, QWidget* = 0, const char* = 0 );
+  QtxGroupBox( QWidget* = 0 );
+  QtxGroupBox( const QString&, QWidget* = 0 );
   virtual ~QtxGroupBox();
 
-#if QT_VER < 3
-  int           insideMargin() const;
-  int           insideSpacing() const;
-  void          setInsideMargin( int );
-  void          setInsideSpacing( int );
-#endif
-
-  virtual void  setAlignment( int );
-  virtual void  setTitle( const QString& );
-  virtual void  setColumnLayout( int, Orientation );
-
   virtual void  insertTitleWidget( QWidget* );
   virtual void  removeTitleWidget( QWidget* );
 
-  virtual void  show();
-  virtual void  update();
-
-  void          adjustInsideMargin();
-
   virtual QSize sizeHint() const;
   virtual QSize minimumSizeHint() const;
 
   virtual bool  eventFilter( QObject*, QEvent* );
 
+  QWidget*      widget() const;
+  void          setWidget( QWidget* );
+
+public slots:
+  virtual void  setVisible( bool );
+
 protected:
-  virtual void  frameChanged();
   virtual void  childEvent( QChildEvent* );
   virtual void  resizeEvent( QResizeEvent* );
-  virtual void  customEvent( QCustomEvent* );
+  virtual void  customEvent( QEvent* );
 
 private:
   void          initialize();
   void          updateTitle();
   QSize         titleSize() const;
+  void          setInsideMargin( const int );
+  QSize         expandTo( const QSize& ) const;
 
 private:
   QWidget*      myContainer;
index e002377e6cb0130f3019302be3d6ba502e31e555..426e31bb91de721e45033baaf44829dc51c12296 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxIntSpinBox.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxIntSpinBox.h"
 
-#include <qlineedit.h>
-#include <qapplication.h>
+#include <QLineEdit>
+/*!
+  \class QtxIntSpinBox
+  \brief Enhanced version of the Qt's spin box.
+
+  The QtxIntSpinBox class represents the widget for entering the
+  integer values. In addition to the functionality provided by
+  QSpinBox, this class supports "cleared" state - this is the
+  state corresponding to "None" (or empty) entered value.
+
+  To set "cleared" state use setCleared() method. To check if the spin
+  box stores "cleared" state, use isCleared() method.
+  For example:
+  \code
+  if (mySpinBox->isCleared()) {
+    ... // process "None" state
+  }
+  else {
+    int value = mySpinBox->value();
+    ... // process entered value
+  }
+  \endcode
+*/
 
 /*!
-  Constructor
+  \brief Constructor.
+
+  Constructs a spin box with 0 as minimum value and 99 as maximum value, 
+  a step value of 1. The value is initially set to 0.
+
+  \param parent parent object
 */
-QtxIntSpinBox::QtxIntSpinBox( QWidget* parent, const char* name )
-: QSpinBox( parent, name ),
-myCleared( false ),
-myBlocked( false )
+QtxIntSpinBox::QtxIntSpinBox( QWidget* parent )
+: QSpinBox( parent ),
+  myCleared( false )
 {
-  connect( editor(), SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) );
+  setCorrectionMode( QSpinBox::CorrectToNearestValue );
+  connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), 
+          this, SLOT( onTextChanged( const QString& ) ) );
 }
 
 /*!
-  Constructor
+  \brief Constructor.
+
+  Constructs a spin box with specified minimum, maximum and step value.
+  The value is initially set to the minimum value.
+
+  \param min spin box minimum possible value
+  \param max spin box maximum possible value
+  \param step spin box increment/decrement value
+  \param parent parent object
 */
-QtxIntSpinBox::QtxIntSpinBox( int min, int max, int step, QWidget* parent, const char* name )
-: QSpinBox( min, max, step, parent, name ),
-myCleared( false ),
-myBlocked( false )
+QtxIntSpinBox::QtxIntSpinBox( int min, int max, int step, QWidget* parent )
+: QSpinBox( parent ),
+  myCleared( false )
 {
-  connect( editor(), SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) );
+  setMinimum( min );
+  setMaximum( max );
+  setSingleStep( step );
+  setCorrectionMode( QSpinBox::CorrectToNearestValue );
+
+  connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), 
+          this, SLOT( onTextChanged( const QString& ) ) );
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxIntSpinBox::~QtxIntSpinBox()
 {
 }
 
 /*!
-  \return true if spin box is cleared
+  \brief Check if spin box is in the "cleared" state.
+  \return \c true if spin box is cleared
 */
 bool QtxIntSpinBox::isCleared() const
 {
@@ -62,112 +106,49 @@ bool QtxIntSpinBox::isCleared() const
 }
 
 /*!
-  Changes cleared status of spin box
-  \param on - new status
+  \brief Change "cleared" status of the spin box.
+  \param on new "cleared" status
 */
 void QtxIntSpinBox::setCleared( const bool on )
 {
   if ( myCleared == on )
     return;
-    
+  
   myCleared = on;
-  updateDisplay();
+  setSpecialValueText( specialValueText() );
 }
 
 /*!
-  Changes value of spin box
-  \param val - new value of spin box
+  \brief Convert value to the text.
+  \param val value being converted
+  \return string containing the converted value
 */
-void QtxIntSpinBox::setValue( int value )
+QString QtxIntSpinBox::textFromValue( int val ) const
 {
-  myCleared = false;
-
-  QSpinBox::setValue( value );
+  return myCleared ? QString() : QSpinBox::textFromValue( val );
 }
 
 /*!
-  Custom event filter
-*/
-bool QtxIntSpinBox::eventFilter( QObject* o, QEvent* e )
-{
-  if ( !myCleared || o != editor() || !editor()->text().stripWhiteSpace().isEmpty() )
-    return QSpinBox::eventFilter( o, e );
+  \brief Perform \a steps increment/decrement steps.
+  
+  The \a steps value can be any integer number. If it is > 0,
+  the value incrementing is done, otherwise value is decremented
+  \a steps times.  
 
-  if ( e->type() == QEvent::FocusOut || e->type() == QEvent::Leave || e->type() == QEvent::Hide )
-    return false;
-
-  if ( e->type() == QEvent::KeyPress &&
-            ( ((QKeyEvent*)e)->key() == Key_Tab || ((QKeyEvent*)e)->key() == Key_BackTab ) )
-  {
-    QApplication::sendEvent( this, e );
-    return true;
-  }
-
-  return QSpinBox::eventFilter( o, e );
-}
-
-/*!
-  Sets integer value by text in editor
+  \param steps number of increment/decrement steps
 */
-void QtxIntSpinBox::interpretText()
+void QtxIntSpinBox::stepBy( int steps )
 {
   myCleared = false;
 
-  QSpinBox::interpretText();
+  QSpinBox::stepBy( steps );
 }
 
 /*!
-  Updates text of editor
-*/
-void QtxIntSpinBox::updateDisplay()
-{
-  if ( myBlocked )
-    return;
-
-  bool block = myBlocked;
-  myBlocked = true;
-
-  QSpinBox::updateDisplay();
-
-  if ( myCleared )
-    editor()->clear();
-  else if ( editor()->hasFocus() )
-  {
-    if ( editor()->text() == specialValueText() )
-      editor()->selectAll();
-    else
-      editor()->setSelection( prefix().length(), editor()->text().length() - prefix().length() - suffix().length() );
-  }
-
-  myBlocked = block;
-}
-
-/*!
-  Custom handler for leave event
-*/
-void QtxIntSpinBox::leaveEvent( QEvent* e )
-{
-  if ( !myCleared )
-    QSpinBox::leaveEvent( e );
-}
-
-/*!
-  Custom handler for wheel event
-*/
-void QtxIntSpinBox::wheelEvent( QWheelEvent* e )
-{
-  if ( !isEnabled() )
-    return;
-
-  QSpinBox::wheelEvent( e );
-  updateDisplay();
-}
-
-/*!
-  SLOT: called if text is changed
+  \brief Called when user enters the text in the spin box.
+  \param txt current spin box text (not used)
 */
 void QtxIntSpinBox::onTextChanged( const QString& )
 {
-  if ( !myBlocked )
-    myCleared = false;
+  myCleared = false;
 }
index 7f083d519401674522fa9e14b4a8c5012adce995..39230639ca36ae5f6e6dc3816c6d365a782cb065 100755 (executable)
@@ -1,60 +1,56 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxIntSpinBox.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXINTSPINBOX_H
 #define QTXINTSPINBOX_H
 
 #include "Qtx.h"
 
-#include <qspinbox.h>
+#include <QSpinBox>
 
 class QTX_EXPORT QtxIntSpinBox : public QSpinBox
 {
-    Q_OBJECT
+  Q_OBJECT
 
 public:
-  QtxIntSpinBox( QWidget* = 0, const char* = 0 );
-  QtxIntSpinBox( int, int, int = 1, QWidget* = 0, const char* = 0 );
+  QtxIntSpinBox( QWidget* = 0 );
+  QtxIntSpinBox( int, int, int = 1, QWidget* = 0 );
   virtual ~QtxIntSpinBox();
     
-  bool         isCleared() const;
-  virtual void setCleared( const bool );
-    
-  virtual bool eventFilter( QObject*, QEvent* );
+  bool            isCleared() const;
+  virtual void    setCleared( const bool );
     
-public slots:
-  virtual void setValue( int );
-
+  virtual void    stepBy( int );
+  
 protected slots:
-  virtual void onTextChanged( const QString& );
+  virtual void    onTextChanged( const QString& );
   
 protected:
-  virtual void interpretText();
-  virtual void updateDisplay();
-  virtual void leaveEvent( QEvent* );
-  virtual void wheelEvent( QWheelEvent* );
+  virtual QString textFromValue( int ) const;
     
 private:
-  bool         myCleared;
-  bool         myBlocked;
+  bool            myCleared;
 };
 
 #endif
index 52f09303943cb6377d2a74e29a5f803634b1f108..b63f0fcd1bc197647dea9435745945944436a188 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxListAction.cxx
-// Author:    Sergey TELKOV (Based on code by Eugene AKSENOV)
-
+// Author:    Sergey TELKOV
+//
 #include "QtxListAction.h"
 
-#include <qvbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qlistbox.h>
-#include <qtoolbar.h>
-#include <qwmatrix.h>
-#include <qpopupmenu.h>
-#include <qtoolbutton.h>
-#include <qobjectlist.h>
-#include <qapplication.h>
-
-static const char* list_arrow_icon[] = {
-"10 6 2 1",
-"# c #000000",
-"  c none",
-"          ",
-" #######  ",
-"  #####   ",
-"   ###    ",
-"    #     ",
-"          "
-};
+#include <QMenu>
+#include <QLabel>
+#include <QVBoxLayout>
+#include <QMouseEvent>
+#include <QListWidget>
+#include <QToolButton>
+#include <QApplication>
 
 /*!
-  \class QtxListAction::ToolButton
-  Custom tool button
+  \class QtxListAction::ScrollEvent
+  \internal
+  \brief Event for the scrolling in the list of actions.
 */
-class QtxListAction::ToolButton : public QToolButton
+
+class QtxListAction::ScrollEvent : public QEvent
 {
 public:
-  ToolButton( QtxListAction*, QWidget* = 0, const char* = 0 );
-  virtual ~ToolButton();
+  enum { Scroll = User + 1 };
 
-  virtual QSize sizeHint() const;
+  ScrollEvent( bool down ) : QEvent( (QEvent::Type)Scroll ), myDown( down ) {}
+  virtual ~ScrollEvent() {}
+
+  bool isDown() const { return myDown; }
 
 private:
-  QtxListAction* myAction;
+  bool myDown;
 };
 
 /*!
-  Constructor
+  \class QtxListAction::ListWidget
+  \internal
+  \brief List of actions.
 */
-QtxListAction::ToolButton::ToolButton( QtxListAction* a, QWidget* parent, const char* name )
-: QToolButton( parent, name ),
-myAction( a )
-{
-  setIconSet( QPixmap( list_arrow_icon ) );
-}
 
-/*!
-  Destructor
-*/
-QtxListAction::ToolButton::~ToolButton()
+class QtxListAction::ListWidget : public QListWidget
 {
-  if ( myAction )
-    myAction->controlDeleted( this );
-}
+public:
+  ListWidget( QWidget* parent = 0 ) : QListWidget( parent ) {}
+  virtual ~ListWidget() {}
 
-/*!
-  \return the recommended size for the widget
-*/
-QSize QtxListAction::ToolButton::sizeHint() const
-{
-  QSize sz = iconSet().pixmap().size();
-  return QSize( sz.width() + 2, sz.height() + 2 );
-}
+protected:
+  virtual void scrollContentsBy( int dx, int dy )
+  {
+    QListWidget::scrollContentsBy( dx, dy );
+    if ( dy != 0 )
+      QApplication::postEvent( viewport(), new ScrollEvent( dy <= 0 ) );
+  }
+};
 
 /*!
-  Constructs an list action with given parent and name. If toggle is true the
-  action will be a toggle action, otherwise it will be a command action.
+  \class QtxListAction::ListFrame
+  \internal
+  \brief Expanding frame with action list and comment.
 */
-QtxListAction::QtxListAction( QObject* parent, const char* name, bool toggle )
-: QtxAction( parent, name, toggle ),
-myFrame( 0 ),
-myMode( Item ),
-myRaise( false )
+
+class QtxListAction::ListFrame: public QMenu
 {
-  initialize();
-}
+public:
+  ListFrame( QtxListAction*, QWidget* parent );
+  virtual ~ListFrame();
 
-/*!
-  This constructor creates an action with the following properties: the
-  description text, the icon or iconset icon, the menu text and keyboard
-  accelerator. It is a child of given parent and named specified name.
-  If toggle is true the action will be a toggle action, otherwise it will
-  be a command action.
-*/
+  void                    clear();
+  const QStringList       names() const;
+  void                    addNames( const QStringList& );
 
-QtxListAction::QtxListAction( const QString& text, const QIconSet& icon,
-                              const QString& menuText, int accel,
-                              QObject* parent, const char* name, bool toggle )
-: QtxAction( text, icon, menuText, accel, parent, name, toggle ),
-myFrame( 0 ),
-myMode( Item ),
-myRaise( false )
-{
-  initialize();
-}
+  void                    setSingleComment( const QString& );
+  void                    setMultipleComment( const QString& );
 
-/*!
-  This constructor creates an action with the following properties: the
-  description text, the menu text and keyboard accelerator. It is a child
-  of given parent and named specified name. If toggle is true the action
-  will be a toggle action, otherwise it will be a command action.
-*/
+  int                     selected() const;
+  void                    setSelected( const int );
 
-QtxListAction::QtxListAction( const QString& text, const QString& menuText,
-                              int accel, QObject* parent, const char* name, bool toggle )
-: QtxAction( text, menuText, accel, parent, name, toggle ),
-myFrame( 0 ),
-myMode( Item ),
-myRaise( false )
-{
-  initialize();
-}
+  int                     linesNumber() const;
+  int                     charsNumber() const;
 
-/*!
-  Destructor.
-*/
+  void                    setLinesNumber( const int );
+  void                    setCharsNumber( const int );
 
-QtxListAction::~QtxListAction()
-{
-  if ( myFrame ) {
-    myFrame->myAction = 0;
-    delete myFrame;
-    myFrame = 0;
-  }
-}
+  virtual QSize           sizeHint() const;
+  virtual QSize           minimumSizeHint() const;
 
-/*!
-       Name: popupMode [public]
-       Desc: Returns popup mode. If popup mode "Item" (default) then action will
-             be added into popup menu as menu item. If popup mode "SubMenu" then
-                   action will be added into popup menu as sub menu with list of items.
-*/
+  virtual bool            eventFilter( QObject*, QEvent* );
 
-int QtxListAction::popupMode() const
-{
-  return myMode;
-}
+  virtual void            setVisible( bool );
+
+protected:
+  virtual void            keyPressEvent( QKeyEvent* );
+
+private:
+  void                    accept();
+  void                    updateComment();
+  void                    setNames( const QStringList& );
+  void                    removePostedEvens( QObject*, int );
+
+private:
+  QListWidget*            myList;
+  QStringList             myNames;
+  QtxListAction*          myAction;
+  QLabel*                 myComment;
+
+  int                     myLines;
+  int                     myChars;
+
+  QString                 mySingleComment;
+  QString                 myMultipleComment;
+};
 
 /*!
-       Name: setPopupMode [public]
-       Desc: Set the popup mode. Popup mode define way in this action will be
-             added into popup menu. This function should be used before addTo.
-*/
+  \brief Constructor.
+  \param a list action
+  \param parent parent widget
+*/
+QtxListAction::ListFrame::ListFrame( QtxListAction* a, QWidget* parent )
+: QMenu( parent ),
+  myList( 0 ),
+  myAction( a ),
+  myComment( 0 ),
+  myLines( 5 ),
+  myChars( 5 )
+{
+  QVBoxLayout* top = new QVBoxLayout( this );
+  top->setMargin( 0 );
+  QFrame* main = new QFrame( this );
+  main->setFrameStyle( QFrame::Panel | QFrame::Raised );
+  top->addWidget( main );
+
+  QVBoxLayout* base = new QVBoxLayout( main );
+  base->setMargin( 3 );
+  base->setSpacing( 2 );
+
+  myList = new ListWidget( main );
+  myList->setSelectionMode( QListWidget::MultiSelection );
+  myList->setVerticalScrollMode( QListWidget::ScrollPerItem );
+  myList->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
+  myList->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
+  myList->viewport()->installEventFilter( this );
+  myList->viewport()->setMouseTracking( true );
+  myList->setFocusPolicy( Qt::NoFocus );
+
+  myComment = new QLabel( main );
+  myComment->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+  myComment->setAlignment( Qt::AlignCenter );
+  myMultipleComment = "%1";
 
-void QtxListAction::setPopupMode( const int mode )
-{
-  myMode = mode;
+  base->addWidget( myList );
+  base->addWidget( myComment );
 }
 
 /*!
-  \return list of names
+  \brief Destructor.
 */
-QStringList QtxListAction::names() const
+QtxListAction::ListFrame::~ListFrame()
 {
-  QStringList lst;
-  if ( myFrame )
-    lst = myFrame->names();
-  return lst;
 }
 
 /*!
-       Name: addNames [public]
-       Desc: Fills the list of actions. Removes the old contents from
-             the list if 'clear' is true.
+  \brief Clear list of names.
 */
-
-void QtxListAction::addNames( const QStringList& names, bool clear )
+void QtxListAction::ListFrame::clear()
 {
-  if ( !myFrame )
-    return;
-
-  if ( clear )
-    myFrame->clear();
-
-       myFrame->addNames( names );
-
-       QStringList lst = myFrame->names();
-       for ( PopupsMap::Iterator pit = myPopups.begin(); pit != myPopups.end(); ++pit )
-       {
-               int i = 1;
-               QPopupMenu* pm = (QPopupMenu*)pit.key();
-               for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it )
-                       pit.data().popup->insertItem( *it, i++ );
-               pm->setItemEnabled( pit.data().id, isEnabled() && pit.data().popup->count() );
-  }
-
-       for ( ButtonsMap::Iterator bit = myButtons.begin(); bit != myButtons.end(); ++bit )
-       {
-               bit.data().drop->setEnabled( isEnabled() && !lst.isEmpty() );
-               bit.data().main->setEnabled( isEnabled() && !lst.isEmpty() );
-       }
+  myNames.clear();
+  setNames( myNames );
 }
 
 /*!
-       Name: addTo [virtual public]
-       Desc: Adds this control to 'popup' or 'toolbar'.
-*/
-
-bool QtxListAction::addTo( QWidget* w )
-{
-       if ( myButtons.contains( w ) || myPopups.contains( w ) )
-               return false;
+  \brief Add names to the list.
 
-       if ( !w->inherits( "QPopupMenu" ) || popupMode() != SubMenu )
-               if ( !QtxAction::addTo( w ) )
-                       return false;
+  Truncates each name to fit the frame width.
+  Method QtxListAction::setCharsNumber(int) can be used to change
+  the frame width (in characters).
 
-#if QT_VER < 3
-  if ( w->children() )
-    addedTo( (QWidget*)w->children()->getLast(), w );
-#endif
-
-  if ( w->inherits( "QToolBar" ) )
-  {
-               Buttons& entry = myButtons[w];
-               QHBox* dropWrap = new QHBox( w );
-    entry.drop = new ToolButton( this, dropWrap, "qt_dockwidget_internal" );
-
-    entry.drop->setTextLabel( text() );
-    entry.drop->setToggleButton( true );
-    entry.drop->setAutoRaise( entry.main->autoRaise() );
-
-    entry.main->setEnabled( isEnabled() && !myFrame->names().isEmpty() );
-    entry.drop->setEnabled( isEnabled() && !myFrame->names().isEmpty() );
-
-               entry.main->installEventFilter( this );
-    entry.drop->installEventFilter( this );
-
-               QToolTip::add( entry.drop, toolTip(), myTipGroup, statusTip() );
-
-    connect( entry.drop, SIGNAL( toggled( bool ) ), this, SLOT( onExpand( bool ) ) );
-  }
-       else if ( w->inherits( "QPopupMenu" ) && popupMode() == SubMenu )
-       {
-               Popups entry;
-               QPopupMenu* pm = (QPopupMenu*)w;
-
-               entry.popup = new QPopupMenu( pm );
-               entry.id = pm->insertItem( text(), entry.popup );
-
-               int i = 1;
-               QStringList lst = myFrame->names();
-               for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it )
-               {
-                       int id = entry.popup->insertItem( *it );
-                       entry.popup->setItemParameter( id, i++ );
-               }
-               pm->setItemEnabled( entry.id, isEnabled() && entry.popup->count() );
-               myPopups.insert( w, entry );
-
-               connect( entry.popup, SIGNAL( activated( int ) ), this, SLOT( onActivated( int ) ) );
-       }
-
-#if QT_VER >= 3
-       connect( w, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
-#endif
-
-    return true;
-}
-
-/*!
-       Name: addTo [virtual public]
-       Desc: Adds this control to 'popup' or 'toolbar'. Allow to specify index
-             for adding into 'popup'.
+  \param names list of names to be added
+  \sa setNames(), QtxListAction::setCharsNumber(int)
 */
-
-bool QtxListAction::addTo( QWidget* w, const int idx )
+void QtxListAction::ListFrame::addNames( const QStringList& names )
 {
-  return QtxAction::addTo( w, idx );
+  for ( QStringList::ConstIterator it = names.begin(); it != names.end(); ++it )
+    myNames.append( *it );
+  setNames( myNames );
 }
 
 /*!
-       Name: removeFrom [virtual public]
-       Desc: Removes this control from 'popup' or 'toolbar'.
-*/
+  \brief Set names to the list.
 
-bool QtxListAction::removeFrom( QWidget* w )
+  Truncates each name to fit the frame width.
+  Method QtxListAction::setCharsNumber(int) can be used to change
+  the frame width (in characters).
+
+  \param names list of names to be set
+  \sa addNames(), QtxListAction::setCharsNumber(int)
+*/
+void QtxListAction::ListFrame::setNames( const QStringList& names )
 {
-  if ( !QtxAction::removeFrom( w ) )
-    return false;
+  if ( !myList )
+    return;
 
-  if ( w->inherits( "QToolBar" ) )
+  myList->clear();
+  QStringList strList;
+  for ( QStringList::const_iterator it = names.begin(); it != names.end(); ++it )
   {
-    if ( myFrame )
-      myFrame->hide();
-
-    if ( myButtons.contains( w ) )
+    QString s = *it;
+    QFontMetrics fm = myList->fontMetrics();
+    int maxW = charsNumber() * fm.maxWidth();
+    int w = fm.width( s );
+    if ( w > maxW )
     {
-      Buttons& entry = myButtons[w];
-
-      if ( entry.drop->parent() && entry.drop->parent()->parent() == w )
-        delete entry.drop->parent();
-      else
-        delete entry.drop;
+      QString extra( "..." );
+      int len = s.length();
+      int extraLen = fm.width( extra ) + 1;
+      while ( true )
+      {
+        w = fm.width( s, --len );
+        if ( w + extraLen < maxW )
+        {
+          s = s.left( len );
+          break;
+        }
+      }
+      s += extra;
     }
-    myButtons.remove( w );
+    strList.append( s );
   }
-  else if ( w->inherits( "QPopupMenu" ) )
-    myPopups.remove( w );
-
-#if QT_VER >= 3
-       disconnect( w, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
-#endif
-
-  return true;
+  myList->addItems( strList );
 }
 
 /*!
-       Name: setEnabled [virtual public slot]
-       Desc: Enables/disables this control.
+  \brief Get list of names.
+  \return list of names
 */
-
-void QtxListAction::setEnabled( bool enable )
+const QStringList QtxListAction::ListFrame::names() const
 {
-  QtxAction::setEnabled( enable );
-
-       bool isOn = enable && !myFrame->names().isEmpty();
-
-       for ( ButtonsMap::Iterator bit = myButtons.begin(); bit != myButtons.end(); ++bit )
-       {
-               bit.data().drop->setEnabled( isOn );
-               bit.data().main->setEnabled( isOn );
-       }
-
-       for ( PopupsMap::Iterator pit = myPopups.begin(); pit != myPopups.end(); ++pit )
-       {
-               QPopupMenu* cont = (QPopupMenu*)pit.key();
-               cont->setItemEnabled( pit.data().id, isOn );
-  }
+  return myNames;
 }
 
 /*!
-       Name: setMaxLines [public]
-       Desc: Sets max number of lines that list frame shows
-                 without vertical scroll bar. Default value is 5.
+  \brief Get maximum numer of lines shown without activation of vertical scroll bar.
+  \return number of lines
+  \sa setLinesNumber(), charsNumber(), setCharsNumber()
 */
-
-void QtxListAction::setMaxLines( int nlines )
+int QtxListAction::ListFrame::linesNumber() const
 {
-  myFrame->setMaxLines( nlines );
+  return myLines;
 }
 
 /*!
-       Name: setMaxLineChars [public]
-       Desc: Sets max number of characters in a line which list frame shows
-             without truncation. Default value is 12 (the widest char size is used).
-*/
+  \brief Get maximum numer of characters in the line.
 
-void QtxListAction::setMaxLineChars( int nchars )
-{
-  myFrame->setMaxLineChars( nchars );
-}
+  If the name length is greater than this value, it will be truncated.
 
-/*!
-       Name: setComment [public]
-       Desc: Sets the format Qt string for comments displayed under the list
-             of actions for one action and for several actions.
-                   Ex. "Undo %1 actions" format string will work as "Undo 3 actions"
-                   when 3 actions are selected. The default format string is "%1".
+  \return number of characters
+  \sa setCharsNumber(), linesNumber(), setLinesNumber()
 */
-
-void QtxListAction::setComment( const QString& c, const QString& sc )
+int QtxListAction::ListFrame::charsNumber() const
 {
-  if ( !myFrame )
-    return;
-
-  myFrame->setSingleComment( sc.isEmpty() ? c : sc );
-       myFrame->setMultipleComment( c );
+  return myChars;
 }
 
 /*!
-       Name: eventFilter [virtual public]
-       Desc: Reimplemented to paint the tool buttons in 2D/3D.
+  \brief Set maximum numer of lines shown without activation of vertical scroll bar.
+  \param maxLines number of lines
+  \sa linesNumber(), charsNumber(), setCharsNumber()
 */
-
-bool QtxListAction::eventFilter( QObject* o, QEvent* e )
+void QtxListAction::ListFrame::setLinesNumber( const int maxLines )
 {
-  if ( !myRaise && ( e->type() == QEvent::Enter || e->type() == QEvent::Leave ) )
-  {
-               QWidget* obj = 0;
-               QWidget* wid = widget( (QWidget*)o );
-               if ( o == mainButton( wid ) )
-                       obj = dropButton( wid );
-               else if ( o == dropButton( wid ) )
-                       obj = mainButton( wid );
-
-               if ( obj )
-               {
-                       myRaise = true;
-                       QApplication::sendEvent( obj, e );
-            obj->repaint();
-                       myRaise = false;
-               }
-  }
-  return QObject::eventFilter( o, e );
+  myLines = maxLines;
 }
 
 /*!
-       Name: addedTo [protected]
-       Desc: Reimplemented for internal reasons.
-*/
-
-void QtxListAction::addedTo( QWidget* actionWidget, QWidget* container )
-{
-#if QT_VER >= 3
-       QtxAction::addedTo( actionWidget, container );
-#endif
+  \brief Set maximum numer of characters in the line.
 
-       if ( !container->inherits( "QToolBar" ) )
-               return;
+  If the name length is greater than this value, it will be truncated.
 
-       Buttons entry;
-       entry.main = (QToolButton*)actionWidget;
+  \param maxChars number of characters
+  \sa charsNumber(), linesNumber(), setLinesNumber()
+*/
+void QtxListAction::ListFrame::setCharsNumber( const int maxChars )
+{
+  if ( myChars == maxChars )
+    return;
 
-       myButtons.insert( container, entry );
+  myChars = maxChars;
+  setNames( myNames );
 }
 
 /*!
-       Name: initialize [private]
-       Desc: Initialization of object QtxListAction.
+  \brief Set comment which is displayed when single name is selected.
+  \param comment comment format
 */
-
-void QtxListAction::initialize()
+void QtxListAction::ListFrame::setSingleComment( const QString& comment )
 {
-       myTipGroup = new QToolTipGroup( this );
-
-       myFrame = new QtxListFrame( this, qApp->mainWidget() );
-  myFrame->setMaxLines( 5 );
-  myFrame->setMaxLineChars( 7 );
-
-       myFrame->hide();
-
-       connect( myFrame, SIGNAL( hided() ), this, SLOT( onHided() ) );
-  connect( this, SIGNAL( activated() ), this, SLOT( onSingle() ) );
-       connect( myFrame, SIGNAL( selected( int ) ), this, SLOT( onMultiple( int ) ) );
-
-       connect( myTipGroup, SIGNAL( removeTip() ), this, SLOT( clearStatusText() ) );
-       connect( myTipGroup, SIGNAL( showTip( const QString& ) ), this, SLOT( showStatusText( const QString& ) ) );
+  mySingleComment = comment;
+  setNames( myNames );
+  updateComment();
 }
 
 /*!
-       Name: onSingle [private slot]
-       Desc: Called when a single action is selected.
+  \brief Set comment which is displayed when multiple names are selected.
+  \param comment comment format
 */
-
-void QtxListAction::onSingle()
+void QtxListAction::ListFrame::setMultipleComment( const QString& comment )
 {
-  emit activated( 1 );
+  myMultipleComment = comment;
+  setNames( myNames );
+  updateComment();
 }
 
 /*!
-       Name: onMultiple [private slot]
-       Desc: Called when multiple actions are selected.
+  \brief Update displayed comment.
 */
-
-void QtxListAction::onMultiple( int numActions )
+void QtxListAction::ListFrame::updateComment()
 {
-  if ( myFrame )
-    myFrame->hide();
-
-  if ( numActions > 0 )
-    emit activated( numActions );
+  QString com;
+  int selNum = selected();
+  if ( selNum > 1 )
+    com = myMultipleComment;
+  else if ( selNum > 0 && !mySingleComment.isEmpty() )
+    com = mySingleComment;
+  
+  if ( !com.isEmpty() )
+    com = com.arg( selNum );
+  
+  myComment->setText( com );
 }
 
 /*!
-       Name: onExpand [private slot]
-       Desc: Activates the list of actions.
+  \brief Get preferable size for the list widget.
+  \return preferable size
 */
-
-void QtxListAction::onExpand( bool on )
+QSize QtxListAction::ListFrame::sizeHint() const
 {
-       const QObject* obj = sender();
-  if ( on )
-  {
-    QWidget* wid = widget( (QToolButton*)obj );
-               QToolButton* main = mainButton( wid );
-    myFrame->setOwner( main );
-               if ( main )
-                       myFrame->show();
-  }
-  else
-    myFrame->hide();
+  return QSize( myList->fontMetrics().maxWidth() * charsNumber() + 10,
+                qMax( 1, linesNumber() ) * ( myList->fontMetrics().height() + 2 ) +
+                myComment->sizeHint().height() );
 }
 
 /*!
-  SLOT: called when frame is hidden
+  \brief Get preferable minimum size for the list widget.
+  \return preferable minimum size
 */
-void QtxListAction::onHided()
+QSize QtxListAction::ListFrame::minimumSizeHint() const
 {
-  for ( ButtonsMap::Iterator bit = myButtons.begin(); bit != myButtons.end(); ++bit )
-       {
-    bool block = bit.data().drop->signalsBlocked();
-    bit.data().drop->blockSignals( true );
-    bit.data().drop->setOn( false );
-    bit.data().drop->blockSignals( block );
-  }
+  return QSize( myList->fontMetrics().maxWidth() * charsNumber() + 10,
+                qMax( 1, linesNumber() ) * ( myList->fontMetrics().height() + 2 ) +
+                myComment->sizeHint().height() );
 }
 
 /*!
-       Name: onActivated [private slot]
-       Desc: Called when a sub menu item is activated.
+  \brief Validate the action.
 */
-
-void QtxListAction::onActivated( int id )
+void QtxListAction::ListFrame::accept()
 {
-       QPopupMenu* pm = (QPopupMenu*)sender();
-       int num = pm->itemParameter( id );
-       if ( num > 0 )
-               emit activated( num );
+  int sel = selected();
+  if ( sel && myAction )
+    myAction->onMultiple( sel );
 }
 
 /*!
-       Name: onDestroyed [private slot]
-       Desc: Called when a container widget is destroyed.
+  \brief Called when list widget is shown/hidden.
+  \param on if \c true, widget is shown, otherswise it is hidden
 */
-
-void QtxListAction::onDestroyed( QObject* obj )
+void QtxListAction::ListFrame::setVisible( bool on )
 {
-       if ( !obj->isWidgetType() )
-               return;
+  if ( on )
+  {
+    myList->setFocus();
+    myList->scrollToItem( myList->item( 0 ), QListWidget::PositionAtTop );
+    setSelected( 0 );
+    updateComment();
+  }
 
-       myPopups.remove( (QWidget*)obj );
-       myButtons.remove( (QWidget*)obj );
+  QMenu::setVisible( on );
 }
 
 /*!
-       Name: widget [private]
-       Desc: Returns container widget for specified control.
-*/
+  \brief Process key press event.
+
+  The following keys are supported:
+  - Up/Down
+  - PageUp/PageDown
+  - Enter
+  - Escape
 
-QWidget* QtxListAction::widget( QWidget* obj ) const
+  \param e key press event
+*/
+void QtxListAction::ListFrame::keyPressEvent( QKeyEvent* e )
 {
-       QWidget* wid = 0;
-       for ( PopupsMap::ConstIterator pit = myPopups.begin(); pit != myPopups.end() && !wid; ++pit )
-               if ( pit.data().popup == obj )
-                       wid = pit.key();
+  if ( e->type() == QEvent::KeyRelease )
+    return;
 
-       for ( ButtonsMap::ConstIterator bit = myButtons.begin(); bit != myButtons.end() && !wid; ++bit )
-               if ( bit.data().main == obj || bit.data().drop == obj )
-                       wid = bit.key();
+  e->accept();
 
-       return wid;
+  int selNum = selected();
+  switch( e->key() )
+  {
+  case Qt::Key_Up:
+    setSelected( qMax( 1, selNum - 1 ) );
+    break;
+  case Qt::Key_Down:
+    setSelected( qMax( 1, selNum + 1 ) );
+    break;
+  case Qt::Key_PageUp:
+    setSelected( qMax( 1, selNum - linesNumber() ) );
+    break;
+  case Qt::Key_PageDown:
+    setSelected( selNum += linesNumber() );
+    break;
+  case Qt::Key_Home:
+    setSelected( 1 );
+    break;
+  case Qt::Key_End:
+    setSelected( myList->count() );
+    break;
+  case Qt::Key_Return:
+    accept();
+    break;
+  case Qt::Key_Escape:
+    hide();
+    break;
+  }
 }
 
 /*!
-       Name: listPopup [private]
-       Desc: Returns sub popup menu widget for specified container.
+  \brief Process mouse events on the viewport of the list widget.
+  \param o object recieving event (viewport)
+  \param e event
+  \return \c true if further event processing should be stopped.
 */
-
-QPopupMenu* QtxListAction::listPopup( QWidget* wid ) const
+bool QtxListAction::ListFrame::eventFilter( QObject* o, QEvent* e )
 {
-       QPopupMenu* p = 0;
-       if ( myPopups.contains( wid ) )
-               p = myPopups[wid].popup;
-       return p;
-}
+  bool res = true;
 
-/*!
-       Name: mainButton [private]
-       Desc: Returns main tool button for specified container.
-*/
+  switch( e->type() )
+  {
+  case QEvent::MouseMove:
+    {
+      QMouseEvent* me = (QMouseEvent*)e;
+      if ( !myList->viewport()->rect().contains( me->pos() ) )
+        setSelected( 0 );
+      else if ( myList->itemAt( me->pos() ) )
+        setSelected( myList->row( myList->itemAt( me->pos() ) ) + 1 );
+    }
+    break;
+  case QEvent::MouseButtonRelease:
+    accept();
+  case QEvent::MouseButtonPress:
+  case QEvent::MouseButtonDblClick:
+    break;
+  case ScrollEvent::Scroll:
+    {
+      ScrollEvent* se = (ScrollEvent*)e;
+      QPoint pos = myList->viewport()->mapFromGlobal( QCursor::pos() );
+      if ( myList->viewport()->rect().contains( pos ) )
+      {
+        if ( myList->itemAt( pos ) )
+          setSelected( myList->row( myList->itemAt( pos ) ) + 1 );
+      }
+      else if ( se->isDown() )
+        setSelected( myList->row( myList->itemAt( myList->viewport()->rect().bottomLeft() -
+                                                  QPoint( 0, myList->fontMetrics().height() / 2 ) ) ) + 1 );
+      else
+        setSelected( myList->row( myList->itemAt( myList->viewport()->rect().topLeft() +
+                                                  QPoint( 0, myList->fontMetrics().height() / 2 ) ) ) + 1 );
+    }
+    break;
+  default:
+    res = false;
+    break;
+  }
 
-QToolButton* QtxListAction::mainButton( QWidget* wid ) const
-{
-       QToolButton* mb = 0;
-       if ( myButtons.contains( wid ) )
-               mb = myButtons[wid].main;
-       return mb;
+  if ( res )
+    return true;
+  else
+    return QMenu::eventFilter( o, e );
 }
 
 /*!
-       Name: dropButton [private]
-       Desc: Returns drop tool button for specified container.
+  \brief Get number of selected names.
+  \return number of selected items
 */
-
-QToolButton* QtxListAction::dropButton( QWidget* wid ) const
+int QtxListAction::ListFrame::selected() const
 {
-       QToolButton* db = 0;
-       if ( myButtons.contains( wid ) )
-               db = myButtons[wid].drop;
-       return db;
+  int sel = 0;
+  QModelIndexList indexes = myList->selectionModel()->selectedRows();
+  for ( QModelIndexList::const_iterator it = indexes.begin(); it != indexes.end(); ++it )
+    sel = qMax( sel, (*it).row() + 1 );
+  
+  return sel;
 }
 
 /*!
-       Name: controlDeleted [private]
-       Desc: Called when action child controls deleted.
+  \brief Set number of selected names.
+  \param lastSel number of items to be selected
 */
-
-void QtxListAction::controlDeleted( QWidget* wid )
+void QtxListAction::ListFrame::setSelected( const int lastSel )
 {
-  QWidget* w = 0;
-  for ( ButtonsMap::Iterator it = myButtons.begin(); it != myButtons.end() && !w; ++it )
-  {
-    if ( it.data().main == wid || it.data().drop == wid )
-      w = it.key();
-  }
+  int last = qMin( lastSel, (int)myList->count() );
 
-  if ( w )
-  {
-    if ( myFrame )
-      myFrame->hide();
+  QItemSelection selection;
+  QItemSelectionModel* selModel = myList->selectionModel();
 
-    myButtons.remove( w );
-  }
+  for ( int i = 0; i < last; i++ )
+    selection.select( selModel->model()->index( i, 0 ), selModel->model()->index( i, 0 ) );
+
+  selModel->select( selection, QItemSelectionModel::ClearAndSelect );
+  
+  int item = last - 1;
+
+  myList->scrollToItem( myList->item( item ) );
+  myList->clearFocus();
+
+  removePostedEvens( myList->viewport(), ScrollEvent::Scroll );
+
+  updateComment();
 }
 
 /*!
-  \class QtxListFrame
-  Frame for the list of actions
+  \brief Filter all events of specified type sent to specified object.
+  \param o object
+  \param type event type to be filtered
 */
-class QtxListFrame::ScrollEvent : public QCustomEvent
+void QtxListAction::ListFrame::removePostedEvens( QObject* o, int type )
 {
-public:
-       enum { Scroll = User + 1 };
-
-       ScrollEvent( bool down ) : QCustomEvent( Scroll ), myDown( down ) {};
-       virtual ~ScrollEvent() {};
-
-       bool isDown() const { return myDown; };
+  class Filter : public QObject
+  {
+  public:
+    Filter() : QObject( 0 ) {}
+    virtual bool eventFilter( QObject*, QEvent* )
+    {
+      return true;
+    }
+  };
 
-private:
-       bool myDown;
-};
+  Filter f;
+  o->installEventFilter( &f );
+  QApplication::sendPostedEvents( o, type );
+}
 
 /*!
-       Class: QtxListAction
-       Level: Public
+  \class QtxListAction
+  \brief Action with associated list of items.
+  
+  This class can be helpuful, for example, for creation of Undo/Redo
+  toolbar items which show list of available commands in the popup list box.
 */
 
 /*!
-    Constructor
+  \brief Constructor.
+  \param parent parent object
 */
-QtxListFrame::QtxListFrame( QtxListAction* a, QWidget* parent, WFlags f )
-: QFrame( parent, 0, WStyle_Customize | WStyle_NoBorderEx | WType_Popup | WStyle_Tool | WStyle_StaysOnTop ),
-myList( 0 ),
-myOwner( 0 ),
-myAction( a ),
-myComment( 0 ),
-myMaxLines( 5 ),
-myMaxLineChars( 10 ),
-myScrollVal( 0 ),
-myScrollBlock( false )
+QtxListAction::QtxListAction( QObject* parent )
+: QtxAction( parent ),
+  myFrame( 0 )
 {
-  QVBoxLayout* theLayout = new QVBoxLayout( this, 3 );
-       theLayout->setResizeMode( QLayout::FreeResize );
-
-  myList = new QListBox( this );
-  myList->setSelectionMode( QListBox::Multi );
-  myList->setHScrollBarMode( QScrollView::AlwaysOff );
-       myList->setFocusPolicy( NoFocus );
-
-       QPalette p = myList->palette();
-       p.setColor( QPalette::Inactive, QColorGroup::Highlight,
-                                     p.color( QPalette::Active, QColorGroup::Highlight ) );
-       p.setColor( QPalette::Inactive, QColorGroup::HighlightedText,
-                                     p.color( QPalette::Active, QColorGroup::HighlightedText ) );
-       myList->setPalette( p );
-
-  /*  We'll have the vertical scroll bar only and
-      truncate the names which are too wide */
-  connect( myList, SIGNAL( contentsMoving( int, int ) ), this, SLOT( onScroll( int, int ) ) );
-
-  myComment = new QLabel( this );
-  myComment->setFrameStyle( Panel | Sunken );
-  myComment->setAlignment( AlignCenter );
-  myMultipleComment = "%1";
-
-  theLayout->addWidget( myList );
-  theLayout->addWidget( myComment );
-
-  setFrameStyle( Panel | Raised );
+  initialize();
 }
 
 /*!
-  Destructor
+  \brief Constructor.
+  \param icon action icon
+  \param menuText menu text
+  \param accel key accelerator
+  \param parent parent object
 */
-QtxListFrame::~QtxListFrame()
+QtxListAction::QtxListAction( const QIcon& icon, const QString& menuText, 
+                             int accel, QObject* parent )
+: QtxAction( menuText, icon, menuText, accel, parent ),
+  myFrame( 0 )
 {
-  if ( myAction )
-    myAction->myFrame = 0;
+  initialize();
 }
 
 /*!
-    Clears list of names [ public ]
+  \brief Constructor.
+  \param menuText menu text
+  \param accel key accelerator
+  \param parent parent object
 */
-
-void QtxListFrame::clear()
+QtxListAction::QtxListAction( const QString& menuText, int accel, QObject* parent )
+: QtxAction( menuText, menuText, accel, parent ),
+  myFrame( 0 )
 {
-       myNames.clear();
-       setNames( myNames );
+  initialize();
 }
 
 /*!
-    Adds a names to the list. Truncates the name to fit to the frame width.
-    Use QtxListAction::setMaxLineChar( int ) to set the width in characters. [ public ]
+  \brief Constructor.
+  \param text action description text (tooltip)
+  \param menuText menu text
+  \param accel key accelerator
+  \param parent parent object
 */
-  
-void QtxListFrame::addNames( const QStringList& names )
+QtxListAction::QtxListAction( const QString& text, const QString& menuText, 
+                             int accel, QObject* parent )
+: QtxAction( text, menuText, accel, parent ),
+  myFrame( 0 )
 {
-       for ( QStringList::ConstIterator it = names.begin(); it != names.end(); ++it )
-               myNames.append( *it );
-       setNames( myNames );
+  initialize();
 }
 
 /*!
-    Sets a names to the list. Truncates the name to fit to the frame width.
-    Use QtxListAction::setMaxLineChar( int ) to set the width in characters. [ public ]
+  \brief Constructor.
+  \param text action description text (tooltip)
+  \param icon action icon
+  \param menuText menu text
+  \param accel key accelerator
+  \param parent parent object
 */
-
-void QtxListFrame::setNames( const QStringList& names )
+QtxListAction::QtxListAction( const QString& text, const QIcon& icon, 
+                             const QString& menuText, int accel, QObject* parent )
+: QtxAction( text, icon, menuText, accel, parent ),
+  myFrame( 0 )
 {
-  if ( !myList )
-               return;
-
-       myList->clear();
-
-       for ( QStringList::ConstIterator it = names.begin(); it != names.end(); ++it )
-       {
-               QString s = *it;
-    QFontMetrics fm = myList->fontMetrics();
-    int maxW = myMaxLineChars * fm.maxWidth();
-    int w = fm.width( s );
-    if ( w > maxW )
-    {
-      QString extra( "..." );
-      int len = s.length();
-      int extraLen = fm.width( extra ) + 1;
-      while ( true )
-      {
-        w = fm.width( s, --len );
-        if ( w + extraLen < maxW )
-        {
-          s = s.left( len );
-          break;
-        }
-      }
-      s += extra;
-    }
-    myList->insertItem( s );
-  }
+  initialize();
 }
 
 /*!
-  \return list of names
+  \brief Destructor.
 */
-const QStringList QtxListFrame::names() const
+QtxListAction::~QtxListAction()
 {
-       return myNames;
+  delete myFrame;
+  myFrame = 0;
 }
 
 /*!
-    Sets max number of lines shown without activation of vertical scroll bar. [ public ]
+  \brief Get popup mode.
+  \return current popup mode (QtxListAction::PopupMode)
+  \sa setPopupMode()
 */
-
-void QtxListFrame::setMaxLines( int maxLines )
+int QtxListAction::popupMode() const
 {
-  myMaxLines = maxLines;
+  return menu() ? SubMenu : Item;
 }
 
 /*!
-    Sets max number of chars in line ( the rest will be truncated ). [ public ]
+  \brief Set popup mode.
+  \param mode new popup mode (QtxListAction::PopupMode)
+  \sa popupMode()
 */
-
-void QtxListFrame::setMaxLineChars( int maxChars )
+void QtxListAction::setPopupMode( const int mode )
 {
-       if ( myMaxLineChars == maxChars )
-               return;
+  if ( mode == popupMode() )
+    return;
 
-  myMaxLineChars = maxChars;
-       setNames( myNames );
+  if ( mode == Item )
+  {
+    delete menu();
+    setMenu( 0 );
+  }
+  else
+    setMenu( new QMenu( 0 ) );
+
+  onChanged();
 }
 
 /*!
-    Sets the format of single comment. [ public ]
+  \brief Get current list of names.
+  \return list of names
 */
-
-void QtxListFrame::setSingleComment( const QString& comment )
+QStringList QtxListAction::names() const
 {
-  mySingleComment = comment;
-       setNames( myNames );
-  updateComment();
+  QStringList lst;
+  if ( myFrame )
+    lst = myFrame->names();
+  return lst;
 }
 
 /*!
-    Sets the format of multiple comment. [ public ]
-*/
+  \brief Add names to the list.
 
-void QtxListFrame::setMultipleComment( const QString& comment )
-{
-  myMultipleComment = comment;
-       setNames( myNames );
-  updateComment();
-}
+  Truncates each name to fit the frame width.
+  Method setCharsNumber() can be used to change
+  the frame width (in characters).
 
-/*!
-    Updates comment display. [ public ]
+  \param names list of names to be added
+  \param clear if \c true, remove the old contents from the list
+  \sa setCharsNumber()
 */
-
-void QtxListFrame::updateComment()
+void QtxListAction::addNames( const QStringList& names, bool clear )
 {
-       QString com;
-       int selNum = selected();
-       if ( selNum > 1 )
-               com = myMultipleComment;
-       else if ( selNum > 0 && !mySingleComment.isEmpty() )
-               com = mySingleComment;
+  if ( !myFrame )
+    return;
 
-       if ( !com.isEmpty() )
-               com = com.arg( selNum );
+  if ( clear )
+    myFrame->clear();
 
-  myComment->setText( com );
+  myFrame->addNames( names );
+
+  onChanged();
 }
 
 /*!
-  Sets owner
-  \param wo - new owner
+  \brief Get maximum numer of lines shown without activation of vertical scroll bar.
+  \return number of lines
+  \sa setLinesNumber(), charsNumber(), setCharsNumber()
 */
-void QtxListFrame::setOwner( QWidget* wo )
+int QtxListAction::linesNumber() const
 {
-  myOwner = wo;
-  if ( myOwner )
-  {
-    QPoint lpos;
-    if ( myOwner->parentWidget() && myOwner->parentWidget()->inherits( "QToolBar" ) &&
-         ((QToolBar*)myOwner->parentWidget())->orientation() == Qt::Vertical )
-      lpos = QPoint( myOwner->x() + myOwner->width() + 2, myOwner->y() );
-    else
-                 lpos = QPoint( myOwner->x(), myOwner->y() + myOwner->height() + 2 );
-      QPoint gpos = myOwner->parentWidget() ? myOwner->parentWidget()->mapToGlobal( lpos )
-                                            : myOwner->mapToGlobal( lpos );
-    if ( parentWidget() )
-                       move( parentWidget()->mapFromGlobal( gpos ) );
-    else
-                 move( gpos );
-  }
+  return myFrame->linesNumber();
 }
 
 /*!
-    Validates the action. [ private slot ]
-*/
+  \brief Get maximum numer of characters in the line.
+
+  If the name length is greater than this value, it will be truncated.
 
-void QtxListFrame::accept()
+  \return number of characters
+  \sa setCharsNumber(), linesNumber(), setLinesNumber()
+*/
+int QtxListAction::charsNumber() const
 {
-  emit selected( selected() );
+  return myFrame->charsNumber();
 }
 
 /*!
-    Cancels the action. [ private slot ]
+  \brief Set maximum numer of lines shown without activation of vertical scroll bar.
+  \param nlines number of lines (5 by default)
+  \sa linesNumber(), charsNumber(), setCharsNumber()
 */
-
-void QtxListFrame::reject()
+void QtxListAction::setLinesNumber( const int nlines )
 {
-  emit selected( 0 );
+  myFrame->setLinesNumber( nlines );
 }
 
 /*!
-    Initializes / shows the frame. [ virtual public slot ]
-*/
-
-void QtxListFrame::show()
-{
-  int cnt = (int)myList->count();
-  if ( cnt )
-  {
-    myScrollVal = 0;
-               myList->setTopItem( 0 );
-    myList->clearSelection();
-               myList->setMinimumSize( 0, ( QMIN( cnt + 1, myMaxLines ) ) * myList->itemHeight() + 1 );
-    setSelected( 1 );
+  \brief Set maximum numer of characters in the line.
 
-    int linstep = myList->itemHeight();
-    myList->verticalScrollBar()->setLineStep( linstep );
-    myList->verticalScrollBar()->setPageStep( myMaxLines * linstep );
+  If the name length is greater than this value, it will be truncated.
 
-    QFontMetrics fm = myList->fontMetrics();
-    layout()->invalidate();
-    int maxHeight = layout()->minimumSize().height() + layout()->margin();
-    int maxWidth = myMaxLineChars * fm.maxWidth();
-               for ( uint i = 0; i <= myList->count(); i++ )
-                       maxWidth = QMAX( maxWidth, fm.width( myList->text( i ) ) );
+  \param maxChars number of characters (5 by default)
+  \sa charsNumber(), linesNumber(), setLinesNumber()
+*/
 
-               resize( width(), maxHeight );
+void QtxListAction::setCharsNumber( const int nchars )
+{
+  myFrame->setCharsNumber( nchars );
+}
 
-               myList->updateGeometry();
+/*!
+  \brief Set the format Qt string for comments displayed under the list
+         of actions for one action and for several actions.
 
-               QApplication::sendPostedEvents();
+  Example: "Undo %1 actions" format string will work as "Undo 3 actions"
+  when 3 actions are selected. The default format string is "%1".
 
-    myList->resizeContents( myList->contentsWidth(),
-                            myList->itemHeight() * cnt );
-    if ( myList->contentsHeight() > myList->visibleHeight() )
-         maxWidth += myList->verticalScrollBar()->width();
+  \param c single action comment format
+  \param c multiple actions comment format
+*/
+void QtxListAction::setComment( const QString& c, const QString& sc )
+{
+  if ( !myFrame )
+    return;
 
-               QString single = mySingleComment.arg( cnt );
-               QString multi = myMultipleComment.arg( cnt );
-               int comWidth = QMAX( myComment->fontMetrics().width( single ), myComment->fontMetrics().width( multi ) );
-               if ( myComment->frameWidth() )
-                       comWidth += myComment->fontMetrics().width( "x" );
+  myFrame->setSingleComment( sc.isEmpty() ? c : sc );
+  myFrame->setMultipleComment( c );
+}
 
-               maxWidth = QMAX( maxWidth, comWidth );
+/*!
+  \brief Create action widget.
 
-               resize( maxWidth, maxHeight );
-    updateComment();
+  This function is called whenever the action is added 
+  to a container widget that supports custom widgets like menu or toolbar.
+  
+  \param parent container widget the action is added to
+  \return tool button for toolbar and 0 otherwise
+*/
+QWidget* QtxListAction::createWidget( QWidget* parent )
+{
+  if ( parent && parent->inherits( "QMenu" ) )
+    return 0;
 
-    qApp->installEventFilter( this );
+  QToolButton* tb = new QToolButton( parent );
+  tb->setText( text() );
+  tb->setIcon( icon() );
+  tb->setPopupMode( QToolButton::MenuButtonPopup );
+  tb->setMenu( myFrame );
+  tb->setEnabled( isEnabled() && !names().isEmpty() );
+  tb->setToolTip( toolTip() );
+  connect( tb, SIGNAL( clicked( bool ) ), this, SLOT( onSingle( bool ) ) );
 
-    QFrame::show();
-  }
+  return tb;
 }
 
 /*!
-    Cleanup. [ virtual public slot ]
-*/
+  \brief Destroy action widget.
 
-void QtxListFrame::hide()
+  This function is called whenever the action is removed
+  from a container widget that supports custom widgets like menu or toolbar.
+  
+  \param widget container widget the action is removed from
+*/
+void QtxListAction::deleteWidget( QWidget* widget )
 {
-  qApp->removeEventFilter( this );
-  QFrame::hide();
-  emit hided();
+  delete widget;
 }
 
 /*!
-    Processes KeyUp/KeyDown, PageUp/PageDown, CR and Esc keys.
-    Returns 'true' if event is eaten, 'false' otherwise. [ private ]
+  \brief Initialize the action.
 */
-
-bool QtxListFrame::handleKeyEvent( QObject* , QKeyEvent* e )
+void QtxListAction::initialize()
 {
-  if ( e->type() == QEvent::KeyRelease )
-    return true;
+  setPopupMode( Item );
+  
+  myFrame = new QtxListAction::ListFrame( this, 0 );
+  myFrame->setLinesNumber( 7 );
+  myFrame->setCharsNumber( 5 );
 
-  int selNum = selected();
-  switch( e->key() )
-  {
-  case Key_Up:
-    setSelected( QMAX( 1, selNum - 1 ) );
-    break;
-  case Key_Down:
-    setSelected( QMAX( 1, selNum + 1 ) );
-    break;
-  case Key_PageUp:
-    setSelected( QMAX( 1, selNum - myMaxLines ) );
-    break;
-  case Key_PageDown:
-         setSelected( selNum += myMaxLines );
-    break;
-  case Key_Home:
-         setSelected( 1 );
-               break;
-  case Key_End:
-         setSelected( myList->count() );
-               break;
-  case Key_Return:
-    accept();
-    break;
-  case Key_Escape:
-    reject();
-    break;
-  }
-  return true;
+  myFrame->hide();
+
+  connect( this, SIGNAL( changed() ), this, SLOT( onChanged() ) );
+  connect( this, SIGNAL( triggered( bool ) ), this, SLOT( onSingle( bool ) ) );
 }
 
 /*!
-    Selects items on move, validates on button release. If object 'o' is not our name list,
-    we close the frame. Returns 'true' if event is eaten, 'false' otherwise. [ private ]
+  \brief Called the action contents is changed.
 */
-
-bool QtxListFrame::handleMouseEvent( QObject* o, QMouseEvent* e )
+void QtxListAction::onChanged()
 {
-  switch( e->type() )
-  {
-  case QEvent::MouseButtonPress:
-  {
-         if ( o != myList->viewport() && !isPopup() )
-                 reject();
-    return true;
-  }
-  case QEvent::MouseMove:
+  QStringList lst = myFrame->names();
+
+  if ( menu() )
   {
-    if ( o == myList->viewport() )
+    menu()->clear();
+    for ( QStringList::iterator iter = lst.begin(); iter != lst.end(); ++iter )
     {
-      QListBoxItem* lbi = myList->itemAt( e->pos() );
-      if ( lbi )
-        setSelected( myList->index( lbi ) + 1 );
+      QAction* a = new QAction( *iter, menu() );
+      menu()->addAction( a );
+      connect( a, SIGNAL( triggered( bool ) ), this, SLOT( onTriggered( bool ) ) );
     }
-    break;
   }
-  case QEvent::MouseButtonRelease:
+
+  QList<QWidget*> widList = createdWidgets();
+  for ( QList<QWidget*>::iterator it = widList.begin(); it != widList.end(); ++it )
   {
-    if ( o == myList->viewport() )
-      accept();
-    else
-                 reject();
-    break;
-  }
-  default:
-    break;
+    (*it)->setEnabled( isEnabled() && !lst.isEmpty() );
+    QToolButton* tb = ::qobject_cast<QToolButton*>( *it );
+    if ( tb )
+    {
+      tb->setText( text() );
+      tb->setIcon( icon() );
+      tb->setToolTip( toolTip() );
+    }
   }
-  return true;
 }
 
 /*!
-  Custom event filter
+  \brief Called when a user click action button.
+  \param on (not used)
 */
-bool QtxListFrame::event( QEvent* e )
-{
-  if ( e->type() != (int)ScrollEvent::Scroll )
-    return QFrame::event( e );
 
-  ScrollEvent* se = (ScrollEvent*)e;
-  if ( se->isDown() )
-    setSelected( myList->topItem() + myList->numItemsVisible() );
-  else
-    setSelected( myList->topItem() + 1 );
-  
-  return true;
-}
-
-/*!
-    Watches mouse events on the viewport of the list. [ virtual public ]
-*/
-
-bool QtxListFrame::eventFilter( QObject* o, QEvent* e )
+void QtxListAction::onSingle( bool /*on*/ )
 {
-  bool isKeyEvent = ( e->type() == QEvent::KeyPress ||
-                      e->type() == QEvent::KeyRelease );
-  bool isMouseEvent = ( e->type() == QEvent::MouseMove ||
-                        e->type() == QEvent::MouseButtonPress ||
-                        e->type() == QEvent::MouseButtonRelease ||
-                        e->type() == QEvent::MouseButtonDblClick );
-
-  if ( isKeyEvent )
-  {
-    if ( handleKeyEvent( o, ( QKeyEvent* )e ) )
-      return true;
-  }
-  else if ( isMouseEvent && o != myList->verticalScrollBar() )
-  {
-    if ( handleMouseEvent( o, ( QMouseEvent*)e ) )
-      return true;
-  }
-
-  if ( o != this && ( e->type() == QEvent::Resize || e->type() == QEvent::Move ) )
-    setOwner( myOwner );
-
-  return QFrame::eventFilter( o, e );
+  onMultiple( 1 );
 }
 
 /*!
-    Selects operations while scrolling the list. [ private slot ]
+  \brief Called when multiple items are selected. 
 */
-
-void QtxListFrame::onScroll( int x, int y )
+void QtxListAction::onMultiple( const int numActions )
 {
-  int dx = y - myScrollVal;
-       if ( !myScrollBlock )
-               QApplication::postEvent( this, new ScrollEvent( dx > 0 ) );
-  myScrollVal = y;
+  if ( myFrame )
+    myFrame->hide();
+
+  if ( numActions > 0 )
+    emit triggered( numActions );
 }
 
 /*!
-    Selects the actions [ 0 - lastSel ]. [ public ]
+  \brief Called when user activates an items in the popup sub menu. 
+  \param on (not used)
 */
-
-void QtxListFrame::setSelected( const int lastSel )
+void QtxListAction::onTriggered( bool /*on*/ )
 {
-       int last = QMIN( lastSel, (int)myList->count() );
-
-       for ( int i = 0; i < (int)myList->count(); i++ )
-               myList->setSelected( i, i < last );
-
-       int item = last - 1;
-
-       myScrollBlock = true;
-
-       if ( item < myList->topItem() )
-               myList->setTopItem( item );
-
-       if ( item >= myList->topItem() + myList->numItemsVisible() )
-               myList->setTopItem( item - myList->numItemsVisible() + 1 );
-
-       myScrollBlock = false;
+  if ( !menu() )
+    return;
 
-  myList->clearFocus();
+  QList<QAction*> actionList = menu()->actions();
+  int idx = actionList.indexOf( ::qobject_cast<QAction*>( sender() ) );
+  if ( idx < 0 )
+    return;
 
-  updateComment();
+  emit triggered( idx + 1 );
 }
 
 /*!
-  return number of selected items
+  \fn QtxListAction::activated(int numItems );
+  \brief This signal is emitted when an action is activated.
+  \param numItems number of items being selected in the action list.
 */
-int QtxListFrame::selected() const
-{
-       uint sel = 0;
-       while ( sel < myList->count() && myList->isSelected( sel ) )
-               sel++;
-       return sel;
-}
index 8ad60be5bb1e9b0764f7c8f9b69df617c7859a03..bcbf744944e81499bd44a20630dc150394f2b0b3 100755 (executable)
@@ -1,40 +1,33 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxListAction.h
+// Author:    Sergey TELKOV
 //
-// File:      QtxListAction.hxx
-// Author:    Sergey TELKOV (Based on code by Eugene AKSENOV)
-
 #ifndef QTXLISTACTION_H
 #define QTXLISTACTION_H
 
+#include "Qtx.h"
 #include "QtxAction.h"
-
-#include <qmap.h>
-#include <qframe.h>
-#include <qstringlist.h>
-
-class QLabel;
-class QListBox;
-class QPopupMenu;
-class QToolButton;
-class QToolTipGroup;
-
-class QtxListFrame;
+#include <QStringList>
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -42,151 +35,60 @@ class QtxListFrame;
 
 class QTX_EXPORT QtxListAction : public QtxAction
 {
-    Q_OBJECT
-
-    Q_PROPERTY( QStringList names READ names WRITE addNames )
+  Q_OBJECT
 
-    class ToolButton;
+  class ListFrame;
+  class ListWidget;
+  class ScrollEvent;
 
 public:
-    enum { Item, SubMenu } PopupMode;
+  //! Popup mode
+  enum { 
+    Item,         //!< action is added to popup menu as menu item
+    SubMenu       //!< action is added to popup menu as sub menu with list of items
+  } PopupMode;
 
 public:
-    QtxListAction( QObject* = 0, const char* = 0, bool = false );
-    QtxListAction( const QString&, const QIconSet&, const QString&, int, QObject*, const char* = 0, bool = false );
-    QtxListAction( const QString&, const QString&, int, QObject*, const char* = 0, bool = false );
-    virtual ~QtxListAction();
+  QtxListAction( QObject* = 0 );
+  QtxListAction( const QString&, int, QObject* );
+  QtxListAction( const QString&, const QString&, int, QObject* );
+  QtxListAction( const QIcon&, const QString&, int, QObject* );
+  QtxListAction( const QString&, const QIcon&, const QString&, int, QObject* );
+  virtual ~QtxListAction();
 
-public:
-    virtual bool            addTo( QWidget* );
-    virtual bool            addTo( QWidget*, const int );
-
-    virtual bool            removeFrom( QWidget* );
-    virtual bool            eventFilter( QObject*, QEvent* );
+  int              popupMode() const;
+  void             setPopupMode( const int );
 
-    int                     popupMode() const;
-    void                    setPopupMode( const int );
+  QStringList      names() const;
+  void             addNames( const QStringList&, bool = true );
+  void             setComment( const QString&, const QString& = QString() );
 
-    QStringList             names() const;
-    void                    addNames( const QStringList&, bool = true );
-    void                    setComment( const QString&, const QString& = QString::null );
+  int              linesNumber() const;
+  int              charsNumber() const;
 
-    void                    setMaxLines( int );
-    void                    setMaxLineChars( int );
+  void             setLinesNumber( const int );
+  void             setCharsNumber( const int );
 
 signals:
-    void                    activated( int );
-
-public slots:
-    virtual void            setEnabled( bool );
+  void             triggered( int );
 
 private slots:
-    void                    onHided();
-    void                    onSingle();
-    void                    onExpand( bool );
-    void                    onMultiple( int );
-    void                    onActivated( int );
-    void                    onDestroyed( QObject* );
+  void             onChanged();
+  void             onMultiple( const int );
+  void             onSingle( bool = false );
+  void             onTriggered( bool = false );
 
 protected:
-    virtual void            addedTo( QWidget*, QWidget* );
+  virtual QWidget* createWidget( QWidget* );
+  virtual void     deleteWidget( QWidget* );
 
 private:
-    void                    initialize();
-    QWidget*                widget( QWidget* ) const;
-    QPopupMenu*             listPopup( QWidget* ) const;
-    QToolButton*            mainButton( QWidget* ) const;
-    QToolButton*            dropButton( QWidget* ) const;
+  void             initialize();
 
-    void                    controlDeleted( QWidget* );
-
-private:
-    typedef struct { int id; QPopupMenu* popup; } Popups;
-    typedef struct { QToolButton* main; QToolButton* drop; } Buttons;
-    typedef QMap<QWidget*, Popups>  PopupsMap;
-    typedef QMap<QWidget*, Buttons> ButtonsMap;
-    
-private:
-    int                     myMode;
-    QtxListFrame*           myFrame;
-    bool                    myRaise;
-    PopupsMap               myPopups;
-    ButtonsMap              myButtons;
-    QToolTipGroup*          myTipGroup;
-
-    friend class ToolButton;
-    friend class QtxListFrame;
-};
-
-/*!
-  \class QtxListFrame
-*/
-class QtxListFrame : public QFrame
-{
-    Q_OBJECT
-
-    class ScrollEvent;
-
-public:
-    QtxListFrame( QtxListAction*, QWidget* parent, WFlags f = 0 );
-    virtual ~QtxListFrame();
-
-    void                    clear();
-    const QStringList       names() const;
-    void                    addNames( const QStringList& );
-    
-    void                    setSingleComment( const QString& );
-    void                    setMultipleComment( const QString& );
-    
-    int                     selected() const;
-    void                    setSelected( const int );
-    
-    void                    setMaxLines( int );
-    void                    setMaxLineChars( int );
-    
-    virtual bool            event( QEvent* );
-    virtual bool            eventFilter( QObject*, QEvent* );
-
-    void                    setOwner( QWidget* );
-
-    void                    updateComment();
-    
-signals:
-    void                    hided();
-    void                    selected( int );
-    
-public slots:
-    virtual void            show();
-    virtual void            hide();
-    
-private slots:
-    void                    reject();
-    void                    accept();
-    
-    void                    onScroll( int, int );
-    
 private:
-    void                    setNames( const QStringList& );
-    bool                    handleKeyEvent( QObject*, QKeyEvent* );
-    bool                    handleMouseEvent( QObject*, QMouseEvent* );
+  ListFrame*       myFrame;   //!< list of actions shown as submenu
 
-    friend class QtxListAction;
-    
-private:
-    QListBox*               myList;
-    QStringList             myNames;
-    QWidget*                myOwner;
-    QtxListAction*          myAction;
-    QLabel*                 myComment;
-    
-    QString                 mySingleComment;
-    QString                 myMultipleComment;
-    
-    int                     myMaxLines;
-    int                     myMaxLineChars;
-    
-    int                     myScrollVal;
-    bool                    myScrollBlock;
+  friend class QtxListAction::ListFrame;
 };
 
 #ifdef WIN32
index b4bdef35f33a4c2abad44c4198c00f895630ae95..21a286c11f2bab8a796c751036bfa01689f35ca7 100755 (executable)
@@ -1,24 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxListBox.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxListBox.h"
 
 #include <qpixmap.h>
index 180d2cafb02981e7e417ebd291b41fce146b01c7..74b4887289cbe8633701caa37c386d26f374afcd 100755 (executable)
@@ -1,30 +1,37 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxListBox.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXLISTBOX_H
 #define QTXLISTBOX_H
 
 #include "Qtx.h"
 
-#include <qlistbox.h>
+// This file isn't yet ported to Qt4 => there are some corrections for OCCViewer porting  -->
+//#include <qlistbox.h>
+#include <QListWidget>
+#include <QListWidgetItem>
+// <--
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 class QLineEdit;
 class QValidator;
 
-class QTX_EXPORT QtxListBox : public QListBox
+class QTX_EXPORT QtxListBox : public QListWidget//QListBox // This file isn't yet ported to Qt4 => there are some corrections for OCCViewer porting
 {
     Q_OBJECT
 
 public:
-    QtxListBox( QWidget* = 0, const char* = 0, WFlags = 0 );
+    QtxListBox( QWidget* = 0, const char* = 0, Qt::WindowFlags = 0 );
     virtual ~QtxListBox();
 
     bool              isEditEnabled() const;
     bool              defaultEditAction() const;
     bool              isModificationEnabled() const;
 
-    QListBoxItem*     editedItem() const;
+    QListWidgetItem*  editedItem() const;
     int               editedIndex() const;
 
     void              startEdition( const int );
-    void              startEdition( const QListBoxItem* );
+    void              startEdition( const QListWidgetItem* );
     void              endEdition( const bool );
 
     void              ensureItemVisible( const int );
-    void              ensureItemVisible( const QListBoxItem* );
+    void              ensureItemVisible( const QListWidgetItem* );
 
     virtual bool      eventFilter( QObject*, QEvent* );
 
@@ -68,7 +75,7 @@ public:
 
 signals:
     void              itemEdited( int );
-    void              itemEdited( QListBoxItem* );
+    void              itemEdited( QListWidgetItem* );
     void              itemMoved( int, int );
 
 public slots:
diff --git a/src/Qtx/QtxListOfOperations.cxx b/src/Qtx/QtxListOfOperations.cxx
deleted file mode 100644 (file)
index a6c2e68..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "QtxListOfOperations.h"
-#include <stdarg.h>
-
-/*!
-  Constructor
-*/
-QtxListOfOperations::QtxListOfOperations()
-{
-}
-
-/*!
-  Destructor
-*/
-QtxListOfOperations::~QtxListOfOperations()
-{
-}
-
-/*!
-  \return fills list with brackets symbols
-  \param list - list to be filled
-  \param open - if it is true, it is necessary to fill with open brackets otherwise with close
-*/
-void QtxListOfOperations::bracketsList( QStringList& list, bool open ) const
-{
-    OperationSetsIterator anIt = mySets.begin(),
-                          aLast = mySets.end();
-    QStringList custom;
-    for( ; anIt!=aLast; anIt++ )
-    {
-        custom.clear();
-        (*anIt).myOperations->bracketsList( custom, open );
-        QStringList::const_iterator aSIt = custom.begin(),
-                                    aSLast = custom.end();
-        for( ; aSIt!=aSLast; aSIt++ )
-            if( list.contains( *aSIt )==0 )
-                list.append( *aSIt );
-    }
-}
-
-/*!
-  Fills list with operation names
-*/
-void QtxListOfOperations::opersList( QStringList& list ) const
-{
-    OperationSetsIterator anIt = mySets.begin(),
-                          aLast = mySets.end();
-    QStringList custom;
-    for( ; anIt!=aLast; anIt++ )
-    {
-        custom.clear();
-        (*anIt).myOperations->opersList( custom );
-        QStringList::const_iterator aSIt = custom.begin(),
-                                    aSLast = custom.end();
-        for( ; aSIt!=aSLast; aSIt++ )
-            if( list.contains( *aSIt )==0 )
-                list.append( *aSIt );
-    }
-}
-
-/*!
-  Create some value by it's string representation
-*/
-bool QtxListOfOperations::createValue( const QString& str, QtxValue& val ) const
-{
-    bool ok;
-    OperationSetsIterator anIt = mySets.begin(),
-                          aLast = mySets.end();
-    for( ; anIt!=aLast; anIt++ )
-    {
-        ok = (*anIt).myOperations->createValue( str, val );
-        if( ok )
-            break;
-    }
-    return ok;
-}
-
-/*!
-  \return priority of operation
-*/
-int QtxListOfOperations::prior( const QString& op, bool isBin ) const
-{
-    OperationSetsIterator anIt = mySets.begin(),
-                          aLast = mySets.end();
-    int prior = 0;
-    for( ; anIt!=aLast; anIt++ )
-    {
-        prior = (*anIt).myOperations->prior( op, isBin );
-        if( prior>0 )
-        {
-            prior+=(*anIt).myAddPrior;
-            break;
-        }
-    }
-    return prior>0 ? prior : 0;
-}
-
-/*!
-   \return whether values with passed types are valid for arguments of operation
-   \param op - name of operation
-   \param t1 - type of first argument
-   \param t2 - type of second argument
-*/
-QtxParser::Error QtxListOfOperations::isValid( const QString& op,
-                                               const QVariant::Type t1,
-                                               const QVariant::Type t2 ) const
-{
-    OperationSetsIterator anIt = mySets.begin(),
-                          aLast = mySets.end();
-    QtxParser::Error err = QtxParser::OK;
-    for( ; anIt!=aLast; anIt++ )
-    {
-        err = (*anIt).myOperations->isValid( op, t1, t2 );
-        if( err==QtxParser::OK )
-            break;
-    }
-    return err;
-}
-
-/*!
-    Calculates result of operation
-    \return one of error states
-    \param op - name of operation
-    \param v1 - first operation argument (must be used also to store result)
-    \param v2 - second operation argument
-*/
-QtxParser::Error QtxListOfOperations::calculate( const QString& op,
-                                                 QtxValue& v1,
-                                                 QtxValue& v2 ) const
-{
-    const char* deb = op.latin1();
-
-    OperationSetsIterator anIt = mySets.begin(),
-                          aLast = mySets.end();
-    QtxValue nv1, nv2;
-    for( ; anIt!=aLast; anIt++ )
-    {
-        nv1 = v1;
-        nv2 = v2;
-        if( (*anIt).myOperations->isValid( op, v1.type(), v2.type() ) == QtxParser::OK )
-        {
-            QtxParser::Error err = (*anIt).myOperations->calculate( op, nv1, nv2 );
-            if( err==QtxParser::OK || err==QtxParser::InvalidResult )
-            {
-                QString oop = (*anIt).myName;
-                const char* ooo = oop.latin1();
-                v1 = nv1; v2 = nv2; 
-                return err;
-            }
-        }
-    }
-    return QtxParser::InvalidOperation;
-}
-
-/*!
-  Clears list of operations
-*/
-void QtxListOfOperations::clear()
-{
-    mySets.clear();
-}
-
-/*!
-  \return true if list contains operations
-  \param name - name of operation
-*/
-bool QtxListOfOperations::has( const QString& name ) const
-{
-    OperationSetsIterator anIt = mySets.begin(),
-                          aLast = mySets.end();
-    for( ; anIt!=aLast; anIt++ )
-        if( (*anIt).myName == name )
-            return true;
-    return false;
-}
-
-/*!
-  Appends operations to list
-  \param name - name of operations
-  \param oper - operations
-  \param prior - additional prior
-*/
-void QtxListOfOperations::append( const QString& name, QtxOperations* oper,
-                                  int prior )
-{
-    insert( name, oper, prior );
-}
-
-/*!
-  Prepends operations to list
-  \param name - name of operations
-  \param oper - operations
-  \param prior - additional prior
-*/
-void QtxListOfOperations::prepend( const QString& name, QtxOperations* oper,
-                                   int prior )
-{
-    insert( name, oper, prior, 0 );
-}
-
-/*!
-  Inserts operations to list
-  \param name - name of operations
-  \param oper - operations
-  \param prior - additional prior
-  \param pos - insert position 
-*/
-void QtxListOfOperations::insert( const QString& name, QtxOperations* oper,
-                                  int prior, int pos )
-{
-    if( has( name ) || oper==NULL || prior<0 )
-        return;
-
-    OperationSet op;
-    op.myName = name;
-    op.myOperations = oper;
-    op.myAddPrior = prior;
-    if( pos<0 )
-        mySets.append( op );
-    else
-        mySets.insert( mySets.at( pos ), op );
-}
-
-/*!
-  Removes operations from list
-  \param name - name of operations
-*/
-void QtxListOfOperations::remove( const QString& name )
-{
-    OperationSets::iterator anIt = mySets.begin(),
-                            aLast = mySets.end();
-    for( ; anIt!=aLast; anIt++ )
-        if( (*anIt).myName == name )
-        {
-            mySets.erase( anIt );
-            break;
-        }
-}
-
-/*!
-  \return count of operations in list
-*/
-int QtxListOfOperations::count() const
-{
-    return mySets.count();
-}
-
-/*!
-  \return operations by name
-  \name - name of operations
-*/
-QtxOperations* QtxListOfOperations::operations( const QString& name ) const
-{
-    OperationSetsIterator anIt = mySets.begin(),
-                          aLast = mySets.end();
-    for( ; anIt!=aLast; anIt++ )
-        if( (*anIt).myName == name )
-            return (*anIt).myOperations;
-    return NULL;
-}
diff --git a/src/Qtx/QtxListOfOperations.h b/src/Qtx/QtxListOfOperations.h
deleted file mode 100644 (file)
index def9dd8..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxListOfOperations.h
-// Author:    Alexander SOLOVYOV
-
-#ifndef __QTX_LIST_OF_OPERATIONS_HEADER__
-#define __QTX_LIST_OF_OPERATIONS_HEADER__
-
-#include "Qtx.h"
-#include "QtxOperations.h"
-
-#ifdef WIN32
-#pragma warning( disable:4251 )
-#endif
-
-
-/*!
-  Class: QtxListOfOperations
-
-  This class provides special variant of QtxOperations. It contains list of QtxOperations* with 
-  fixed order. When it is necessary to calculate operation or get it's priority, this operation is
-  being found starting from first item. It makes possible to create unions of operations. Every QtxOperations*
-  has priority, which is added to priority of operation, so that it makes possible to increase priority of
-  whole group of operations
-*/
-class QTX_EXPORT QtxListOfOperations : public QtxOperations
-{
-public:
-    QtxListOfOperations();
-    virtual ~QtxListOfOperations();
-
-    virtual void  opersList( QStringList& ) const;
-    virtual void  bracketsList( QStringList&, bool open ) const;
-
-    virtual bool  createValue( const QString&, QtxValue& ) const;
-    virtual int   prior    ( const QString&, bool isBin ) const;
-    virtual QtxParser::Error isValid( const QString&,
-                                      const QVariant::Type,
-                                      const QVariant::Type ) const;
-    virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
-
-    void clear  ();
-    bool has    ( const QString& ) const;
-    void append ( const QString&, QtxOperations*, int prior );
-    void prepend( const QString&, QtxOperations*, int prior );
-    void insert ( const QString&, QtxOperations*, int prior, int pos = -1 );
-    void remove ( const QString& );
-    int  count  () const;
-    QtxOperations* operations( const QString& ) const;
-
-private:
-    typedef struct
-    {
-        QString        myName;
-        QtxOperations* myOperations;
-        int            myAddPrior;
-
-    } OperationSet;
-
-    typedef QValueList< OperationSet >     OperationSets;
-    typedef OperationSets::const_iterator  OperationSetsIterator;
-
-    OperationSets mySets;
-};
-
-#endif
diff --git a/src/Qtx/QtxListResourceEdit.cxx b/src/Qtx/QtxListResourceEdit.cxx
deleted file mode 100644 (file)
index 2a7678d..0000000
+++ /dev/null
@@ -1,1749 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxListResourceEdit.cxx
-// Author:    Sergey TELKOV
-
-#include "QtxListResourceEdit.h"
-
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlistbox.h>
-#include <qcombobox.h>
-#include <qlineedit.h>
-#include <qcheckbox.h>
-#include <qtabwidget.h>
-#include <qvalidator.h>
-#include <qobjectlist.h>
-#include <qcolordialog.h>
-#include <qwidgetstack.h>
-#include <qtoolbutton.h>
-#include <qfontdialog.h>
-#include <qfontdatabase.h>
-#include <qfileinfo.h>
-#include <qfiledialog.h>
-#include <qapplication.h>
-
-#include "QtxIntSpinBox.h"
-#include "QtxDblSpinBox.h"
-#include "QtxComboBox.h"
-#include "QtxDirListEditor.h"
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::QtxListResourceEdit( QtxResourceMgr* mgr, QWidget* parent )
-: QFrame( parent ),
-QtxResourceEdit( mgr )
-{
-  QVBoxLayout* main = new QVBoxLayout( this, 0, 5 );
-  QGroupBox* base = new QGroupBox( 1, Qt::Vertical, "", this );
-  base->setFrameStyle( QFrame::NoFrame );
-  base->setInsideMargin( 0 );
-  main->addWidget( base );
-
-  myList  = new QListBox( base );
-  myStack = new QWidgetStack( base );
-
-  myList->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
-  myStack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
-
-  myList->setSelectionMode( QListBox::Single );
-
-  connect( myList, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );
-
-  setFocusProxy( myList );
-
-  updateState();
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::~QtxListResourceEdit()
-{
-}
-
-/*!
-  Sets value to widget
-  \param id - id of widget
-  \param prop - name of resource
-  \param val - value of resource
-*/
-void QtxListResourceEdit::setItemProperty( const int id, const QString& prop, const QVariant& val )
-{
-  Item* i = item( id );
-  if ( !i )
-    return;
-
-  bool prev = i->isEmpty();
-
-  QtxResourceEdit::setItemProperty( id, prop, val );
-
-  bool next = i->isEmpty();
-
-  if ( prev != next )
-    updateVisible();
-}
-
-/*!
-  SLOT: called if main list selection changed, raises resource group widgets
-*/
-void QtxListResourceEdit::onSelectionChanged()
-{
-  QString title = myList->text( myList->index( myList->selectedItem() ) );
-  if ( title.isEmpty() )
-    return;
-
-  Item* i = 0;
-  QPtrList<Item> lst;
-  childItems( lst );
-  for ( QPtrListIterator<Item> it( lst ); it.current() && !i; ++it )
-  {
-    if ( it.current()->title() == title )
-      i = it.current();
-  }
-
-  if ( i )
-    myStack->raiseWidget( i->id() );
-}
-
-/*!
-  Custom activity after item addition
-  \param i - added item
-*/
-void QtxListResourceEdit::itemAdded( QtxResourceEdit::Item* i )
-{
-  if ( !i )
-    return;
-
-  QPtrList<Item> items;
-  childItems( items );
-
-  if ( items.contains( i ) || items.contains( i->parentItem() ) )
-    updateVisible();
-}
-
-/*!
-  Creates and \return category
-  \param title - category title
-*/
-QtxResourceEdit::Item* QtxListResourceEdit::createItem( const QString& title, const int )
-{
-  Item* i = item( title, -1 );
-  if ( i )
-    return i;
-
-  Category* category = new Category( this, myStack );
-  myStack->addWidget( category, category->id() );
-
-  updateVisible();
-
-  if ( !myList->selectedItem() )
-    myList->setSelected( 0, true );
-
-  updateState();
-
-  return category;
-}
-
-/*!
-  Emits signal about resource changing
-  \param map - map of changed resources
-*/
-void QtxListResourceEdit::changedResources( const QMap<Item*, QString>& map )
-{
-  QMap<int, QString> idMap;
-  for ( QMap<Item*, QString>::ConstIterator it = map.begin(); it != map.end(); ++it )
-  {
-    idMap.insert( it.key()->id(), it.data() );
-
-    emit resourceChanged( it.key()->id() );
-
-    QString sec, param;
-    it.key()->resource( sec, param );
-    emit resourceChanged( sec, param );
-  }
-
-  emit resourcesChanged( idMap );
-}
-
-/*!
-  Updates widgets with accordance with main list selection
-*/
-void QtxListResourceEdit::updateState()
-{
-  if ( myList->selectedItem() &&  myStack->visibleWidget() )
-    myStack->show();
-  else
-    myStack->hide();
-
-  myList->setShown( myList->count() > 1 );
-}
-
-/*!
-  Updates visibility state
-*/
-void QtxListResourceEdit::updateVisible()
-{
-  QPtrList<Item> items;
-  childItems( items );
-
-  QString name = myList->text( myList->index( myList->selectedItem() ) );
-
-  myList->clear();
-  for ( QPtrListIterator<Item> it( items ); it.current(); ++it )
-  {
-    if ( it.current()->isEmpty() )
-      continue;
-
-    myList->insertItem( it.current()->title() );
-  }
-
-  int idx = -1;
-  for ( int i = 0; i < (int)myList->count() && idx == -1; i++ )
-  {
-    if ( myList->text( i ) == name )
-      idx = i;
-  }
-
-  myList->setSelected( QMAX( idx, 0 ), true );
-
-  updateState();
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::Category::Category( QtxListResourceEdit* edit, QWidget* parent )
-: QFrame( parent ),
-Item( edit )
-{
-  QVBoxLayout* main = new QVBoxLayout( this );
-  QGroupBox* base = new QGroupBox( 1, Qt::Horizontal, "", this );
-  base->setFrameStyle( QFrame::NoFrame );
-  base->setInsideMargin( 0 );
-  main->addWidget( base, 1 );
-
-  myTabs = new QTabWidget( base );
-  myInfo = new QLabel( base );
-
-  myInfo->setAlignment( Qt::AlignCenter );
-  myInfo->setFrameStyle( QFrame::WinPanel | QFrame::Raised );
-  myInfo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
-
-  updateState();
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::Category::~Category()
-{
-}
-
-/*!
-  \return true if it is empty
-*/
-bool QtxListResourceEdit::Category::isEmpty() const
-{
-  return Item::isEmpty() && myInfo->text().isEmpty();
-}
-
-/*!
-  \return category type
-*/
-int QtxListResourceEdit::Category::type() const
-{
-  return -1;
-}
-
-/*!
-  Default empty implementation of resources storing
-*/
-void QtxListResourceEdit::Category::store()
-{
-}
-
-/*!
-  Default empty implementation of resources retrieving
-*/
-void QtxListResourceEdit::Category::retrieve()
-{
-}
-
-/*!
-  \return value of property
-  \param prop - property name
-*/
-QVariant QtxListResourceEdit::Category::property( const QString& prop ) const
-{
-  QVariant var;
-  if ( prop == QString( "information" ) || prop == QString( "info" ) )
-    var = myInfo->text();
-  return var;
-}
-
-/*!
-  Sets property value
-  \param name - name of property
-  \param var - value of property
-*/
-void QtxListResourceEdit::Category::setProperty( const QString& name, const QVariant& var )
-{
-  QVariant prop = var;
-  if ( !prop.cast( QVariant::String ) )
-    return;
-
-  if ( name == QString( "information" ) || name == QString( "info" ) )
-    myInfo->setText( prop.toString() );
-
-  updateState();
-}
-
-/*!
-  Creates new tab
-  \param title - name of tab
-*/
-QtxResourceEdit::Item* QtxListResourceEdit::Category::createItem( const QString& title, const int )
-{
-  Item* i = item( title, id() );
-  if ( i )
-    return i;
-
-  Tab* tab = new Tab( resourceEdit(), this, this );
-  myTabs->addTab( tab, title );
-
-  updateState();
-
-  return tab;
-}
-
-/*!
-  Updates category
-*/
-void QtxListResourceEdit::Category::updateState()
-{
-  if ( myTabs->count() )
-    myTabs->show();
-  else
-    myTabs->hide();
-
-  if ( !myTabs->count() && !myInfo->text().isEmpty() )
-    myInfo->show();
-  else
-    myInfo->hide();
-}
-
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::Tab::Tab( QtxResourceEdit* edit, Item* pItem, QWidget* parent )
-: QFrame( parent ),
-Item( edit, pItem )
-{
-  QVBoxLayout* main = new QVBoxLayout( this );
-  QVBox* vbox = new QVBox( this );
-  vbox->setMargin( 5 );
-  myMainFrame = vbox;
-  main->addWidget( myMainFrame );
-  main->addStretch( 1 );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::Tab::~Tab()
-{
-}
-
-/*!
-  \return tab type
-*/
-int QtxListResourceEdit::Tab::type() const
-{
-  return -1;
-}
-
-/*!
-  Default empty implementation of resources storing
-*/
-void QtxListResourceEdit::Tab::store()
-{
-}
-
-/*!
-  Default empty implementation of resources retrieving
-*/
-void QtxListResourceEdit::Tab::retrieve()
-{
-}
-
-/*!
-  Delayed initialization of a widget
-*/
-void QtxListResourceEdit::Tab::polish()
-{
-  QFrame::polish();
-
-  adjustLabels();
-}
-
-/*!
-  Creates new group
-  \param title - name of group
-*/
-QtxResourceEdit::Item* QtxListResourceEdit::Tab::createItem( const QString& title, const int )
-{
-  Item* i = item( title, id() );
-  if ( i )
-    return i;
-
-  Group* group = new Group( title, resourceEdit(), this, myMainFrame );
-
-  return group;
-}
-
-/*!
-  Adjusts sizes of labels
-*/
-void QtxListResourceEdit::Tab::adjustLabels()
-{
-  QObjectList* labels = queryList( "QLabel" );
-  if ( labels )
-  {
-    int w = 0;
-    for ( QObjectListIt it1( *labels ); it1.current(); ++it1 )
-    {
-      if ( it1.current()->isWidgetType() )
-      {
-        QWidget* wid = (QWidget*)it1.current();
-        w = QMAX( w, wid->sizeHint().width() );
-      }
-    }
-    for ( QObjectListIt it2( *labels ); it2.current(); ++it2 )
-    {
-      if ( it2.current()->isWidgetType() )
-      {
-        QWidget* wid = (QWidget*)it2.current();
-        wid->setMinimumWidth( w );
-      }
-    }
-    delete labels;
-  }
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::Group::Group( const QString& title, QtxResourceEdit* edit, Item* pItem, QWidget* parent )
-: QGroupBox( 2, Qt::Horizontal, title, parent ),
-Item( edit, pItem )
-{
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::Group::~Group()
-{
-}
-
-/*!
-  \return group type
-*/
-int QtxListResourceEdit::Group::type() const
-{
-  return -1;
-}
-
-/*!
-  Default empty implementation of resources storing
-*/
-void QtxListResourceEdit::Group::store()
-{
-}
-
-/*!
-  Default empty implementation of resources retrieving
-*/
-void QtxListResourceEdit::Group::retrieve()
-{
-}
-
-/*!
-  \return value of property
-  \param prop - property name
-*/
-QVariant QtxListResourceEdit::Group::property( const QString& prop ) const
-{
-  QVariant var;
-  if ( prop == "columns" )
-    var = QVariant( columns() );
-  else if ( prop == "orientation" )
-    var = QVariant( orientation() );
-  else if ( prop == "frame" )
-    var = QVariant( frameStyle() != QFrame::NoFrame );
-  return var;
-}
-
-/*!
-  Sets property value
-  \param name - name of property
-  \param var - value of property
-*/
-void QtxListResourceEdit::Group::setProperty( const QString& name, const QVariant& var )
-{
-  QVariant prop = var;
-  if ( !prop.cast( QVariant::Int ) )
-    return;
-
-  if ( name == QString( "columns" ) && prop.cast( QVariant::Int ) && prop.toInt() > 0 )
-    setColumns( prop.toInt() );
-  else if ( name == QString( "orientation" ) && prop.cast( QVariant::Int ) )
-  {
-    int o = prop.toInt();
-    if ( o == Qt::Horizontal || o == Qt::Vertical )
-      setOrientation( (Orientation)o );
-  }
-  else if ( name == "frame" && prop.cast( QVariant::Bool ) )
-  {
-    setInsideMargin( prop.toBool() ? 5 : 0 );
-    QGroupBox::setTitle( prop.toBool() ? Item::title() : QString::null );
-    setFrameStyle( prop.toBool() ? QFrame::Box | QFrame::Sunken : QFrame::NoFrame );
-  }
-}
-
-/*!
-  Sets title of group
-  \param title - new title of group
-*/
-void QtxListResourceEdit::Group::setTitle( const QString& title )
-{
-  Item::setTitle( title );
-  QGroupBox::setTitle( title );
-}
-
-/*!
-  Creates new item
-  \param title - title of new item
-  \type - type of new item
-*/
-QtxResourceEdit::Item* QtxListResourceEdit::Group::createItem( const QString& title, const int type )
-{
-  Item* item = 0;
-
-  switch ( type )
-  {
-  case Color:
-    item = new ColorItem( title, resourceEdit(), this, this );
-    break;
-  case Bool:
-    item = new StateItem( title, resourceEdit(), this, this );
-    break;
-  case String:
-    item = new StringItem( title, resourceEdit(), this, this );
-    break;
-  case Selector:
-    item = new SelectItem( title, resourceEdit(), this, this );
-    break;
-  case DblSpin:
-    item = new DoubleSpinItem( title, resourceEdit(), this, this );
-    break;
-  case IntSpin:
-    item = new IntegerSpinItem( title, resourceEdit(), this, this );
-    break;
-  case Double:
-    item = new DoubleEditItem( title, resourceEdit(), this, this );
-    break;
-  case Integer:
-    item = new IntegerEditItem( title, resourceEdit(), this, this );
-    break;
-  case Space:
-    item = new Spacer( resourceEdit(), this, this );
-    break;
-  case GroupBox:
-    item = new Group( title, resourceEdit(), this, this );
-    break;
-  case Font:
-    item = new FontItem( title, resourceEdit(), this, this );
-    break;
-  case DirList:
-    item = new DirListItem( title, resourceEdit(), this, this );
-    break;
-  case File:
-    item = new FileItem( title, resourceEdit(), this, this );
-    break;
-  }
-
-  return item;
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::PrefItem::PrefItem( const int type, QtxResourceEdit* edit, Item* pi, QWidget* parent )
-: QHBox( parent ),
-Item( edit, pi ),
-myType( type )
-{
-  setSpacing( 5 );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::PrefItem::~PrefItem()
-{
-}
-
-/*!
-  \return preference item type
-*/
-int QtxListResourceEdit::PrefItem::type() const
-{
-  return myType;
-}
-
-/*!
-  Doesn't create item, \return 0 by default
-*/
-QtxResourceEdit::Item* QtxListResourceEdit::PrefItem::createItem( const QString&, const int )
-{
-  return 0;
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::Spacer::Spacer( QtxResourceEdit* edit, Item* pItem, QWidget* parent )
-: PrefItem( Space, edit, pItem, parent )
-{
-  setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::Spacer::~Spacer()
-{
-}
-
-/*!
-  Default empty implementation of resources storing
-*/
-void QtxListResourceEdit::Spacer::store()
-{
-}
-
-/*!
-  Default empty implementation of resources retrieving
-*/
-void QtxListResourceEdit::Spacer::retrieve()
-{
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::SelectItem::SelectItem( const QString& title, QtxResourceEdit* edit,
-                                            Item* pItem, QWidget* parent )
-: PrefItem( Selector, edit, pItem, parent )
-{
-  new QLabel( title, this );
-  myList = new QComboBox( false, this );
-  myList->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::SelectItem::~SelectItem()
-{
-}
-
-/*!
-  Stores value to resource manager
-*/
-void QtxListResourceEdit::SelectItem::store()
-{
-  int idx = myList->currentItem();
-  if ( idx >= 0 )
-    setInteger( myIndex.contains( idx ) ? myIndex[idx] : idx );
-}
-
-/*!
-  Retrieve value to resource manager
-*/
-void QtxListResourceEdit::SelectItem::retrieve()
-{
-  int id = getInteger( -1 );
-
-  for ( QMap<int, int>::ConstIterator it = myIndex.begin(); it != myIndex.end(); ++it )
-  {
-    if ( it.data() == id ) {
-      myList->setCurrentItem( it.key() );
-      return;
-    }
-  }
-  if ( id >= 0 )
-    myList->setCurrentItem( id );
-}
-
-/*!
-  \return value of property
-  \param prop - property name
-*/
-QVariant QtxListResourceEdit::SelectItem::property( const QString& name ) const
-{
-  QVariant val;
-  if ( name == QString( "strings" ) )
-  {
-    QStringList lst;
-    for ( int i = 0; i < (int)myList->count(); i++ )
-      lst.append( myList->text( i ) );
-    val = QVariant( lst );
-  }
-  else if ( name == QString( "indexes" ) )
-  {
-    QValueList<QVariant> lst;
-    for ( int i = 0; i < (int)myList->count(); i++ )
-      lst.append( myIndex.contains( i ) ? myIndex[i] : 0 );
-    val = QVariant( lst );
-  }
-  return val;
-}
-
-/*!
-  Sets property value
-  \param name - name of property
-  \param var - value of property
-*/
-void QtxListResourceEdit::SelectItem::setProperty( const QString& name, const QVariant& val )
-{
-  if ( name == QString( "strings" ) )
-    setStrings( val );
-  else if ( name == QString( "indexes" ) )
-    setIndexes( val );
-}
-
-/*!
-  Sets property "strings" - items for selection in combo box
-  \param var - must be string list: list of items
-*/
-void QtxListResourceEdit::SelectItem::setStrings( const QVariant& var )
-{
-  if ( var.type() != QVariant::StringList )
-    return;
-
-  setStrings( var.toStringList() );
-}
-
-/*!
-  Sets property "indexes" - corresponding indices of items in combo box
-  \param var - must be list of integer variants: list of indices
-*/
-void QtxListResourceEdit::SelectItem::setIndexes( const QVariant& var )
-{
-  if ( var.type() != QVariant::List )
-    return;
-
-  QValueList<QVariant> varList = var.toList();
-  QValueList<int> lst;
-  for ( QValueList<QVariant>::const_iterator it = varList.begin(); it != varList.end(); ++it )
-  {
-    if ( (*it).canCast( QVariant::Int ) )
-      lst.append( (*it).toInt() );
-  }
-  setIndexes( lst );
-}
-
-/*!
-  Sets property "strings" - items for selection in combo box
-  \param lst - list of items
-*/
-void QtxListResourceEdit::SelectItem::setStrings( const QStringList& lst )
-{
-  myList->clear();
-  myList->insertStringList( lst );
-}
-
-/*!
-  Sets property "indexes" - corresponding indices of items in combo box
-  \param var - list of indices
-*/
-void QtxListResourceEdit::SelectItem::setIndexes( const QValueList<int>& lst )
-{
-  myIndex.clear();
-
-  int idx = 0;
-  for ( QValueList<int>::const_iterator it = lst.begin(); it != lst.end(); ++it, idx++ )
-    myIndex.insert( idx, *it );
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::StateItem::StateItem( const QString& title, QtxResourceEdit* edit,
-                                           Item* pItem, QWidget* parent )
-: PrefItem( Bool, edit, pItem, parent )
-{
-  myState = new QCheckBox( title, this );
-  myState->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::StateItem::~StateItem()
-{
-}
-
-/*!
-  Stores value to resource manager
-*/
-void QtxListResourceEdit::StateItem::store()
-{
-  setBoolean( myState->isChecked() );
-}
-
-/*!
-  Retrieve value to resource manager
-*/
-void QtxListResourceEdit::StateItem::retrieve()
-{
-  myState->setChecked( getBoolean() );
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::StringItem::StringItem( const QString& title, QtxResourceEdit* edit,
-                                             Item* pItem, QWidget* parent )
-: PrefItem( String, edit, pItem, parent )
-{
-  new QLabel( title, this );
-  myString = new QLineEdit( this );
-  myString->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::StringItem::~StringItem()
-{
-}
-
-/*!
-  Stores value to resource manager
-*/
-void QtxListResourceEdit::StringItem::store()
-{
-  setString( myString->text() );
-}
-
-/*!
-  Retrieve value to resource manager
-*/
-void QtxListResourceEdit::StringItem::retrieve()
-{
-  myString->setText( getString() );
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::IntegerEditItem::IntegerEditItem( const QString& title, QtxResourceEdit* edit, Item* pItem, QWidget* parent )
-: PrefItem( Integer, edit, pItem, parent )
-{
-  new QLabel( title, this );
-  myInteger = new QLineEdit( this );
-  myInteger->setValidator( new QIntValidator( myInteger ) );
-  myInteger->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::IntegerEditItem::~IntegerEditItem()
-{
-}
-
-/*!
-  Stores value to resource manager
-*/
-void QtxListResourceEdit::IntegerEditItem::store()
-{
-  setString( myInteger->text() );
-}
-
-/*!
-  Retrieve value to resource manager
-*/
-void QtxListResourceEdit::IntegerEditItem::retrieve()
-{
-  myInteger->setText( getString() );
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::IntegerSpinItem::IntegerSpinItem( const QString& title, QtxResourceEdit* edit, Item* pItem, QWidget* parent )
-: PrefItem( IntSpin, edit, pItem, parent )
-{
-  new QLabel( title, this );
-  myInteger = new QtxIntSpinBox( this );
-  myInteger->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::IntegerSpinItem::~IntegerSpinItem()
-{
-}
-
-/*!
-  Stores value to resource manager
-*/
-void QtxListResourceEdit::IntegerSpinItem::store()
-{
-  setInteger( myInteger->value() );
-}
-
-/*!
-  Retrieve value to resource manager
-*/
-void QtxListResourceEdit::IntegerSpinItem::retrieve()
-{
-  myInteger->setValue( getInteger() );
-}
-
-/*!
-  \return value of property
-  \param prop - property name
-*/
-QVariant QtxListResourceEdit::IntegerSpinItem::property( const QString& name ) const
-{
-  QVariant var;
-  if ( name == QString( "minimum" ) || name == QString( "min" ) )
-    var = QVariant( myInteger->minValue() );
-  else if ( name == QString( "maximum" ) || name == QString( "max" ) )
-    var = QVariant( myInteger->maxValue() );
-  else if ( name == QString( "step" ) )
-    var = QVariant( myInteger->lineStep() );
-  else if ( name == QString( "special" ) )
-    var = QVariant( myInteger->specialValueText() );
-  else if ( name == QString( "prefix" ) )
-    var = QVariant( myInteger->prefix() );
-  else if ( name == QString( "suffix" ) )
-    var = QVariant( myInteger->suffix() );
-  return var;
-}
-
-/*!
-  Sets property value
-  \param name - name of property
-  \param var - value of property
-*/
-void QtxListResourceEdit::IntegerSpinItem::setProperty( const QString& name, const QVariant& var )
-{
-  QVariant prop = var;
-
-  if ( ( name == QString( "minimum" ) || name == QString( "min" ) ) && prop.cast( QVariant::Int ) )
-    myInteger->setMinValue( prop.toInt() );
-  else if ( ( name == QString( "maximum" ) || name == QString( "max" ) ) && prop.cast( QVariant::Int ) )
-    myInteger->setMaxValue( prop.toInt() );
-  else if ( name == QString( "step" ) && prop.cast( QVariant::Int ) && prop.toInt() > 0 )
-    myInteger->setLineStep( prop.toInt() );
-  else if ( name == QString( "special" ) && prop.cast( QVariant::String ) )
-    myInteger->setSpecialValueText( prop.toString() );
-  else if ( name == QString( "prefix" ) && prop.cast( QVariant::String ) )
-    myInteger->setPrefix( prop.toString() );
-  else if ( name == QString( "suffix" ) && prop.cast( QVariant::String ) )
-    myInteger->setSuffix( prop.toString() );
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::DoubleEditItem::DoubleEditItem( const QString& title, QtxResourceEdit* edit,
-                                                     Item* pItem, QWidget* parent )
-: PrefItem( Double, edit, pItem, parent )
-{
-  new QLabel( title, this );
-  myDouble = new QLineEdit( this );
-  myDouble->setValidator( new QDoubleValidator( myDouble ) );
-  myDouble->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::DoubleEditItem::~DoubleEditItem()
-{
-}
-
-/*!
-  Stores value to resource manager
-*/
-void QtxListResourceEdit::DoubleEditItem::store()
-{
-  setString( myDouble->text() );
-}
-
-/*!
-  Retrieve value to resource manager
-*/
-void QtxListResourceEdit::DoubleEditItem::retrieve()
-{
-  myDouble->setText( getString() );
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::DoubleSpinItem::DoubleSpinItem( const QString& title, QtxResourceEdit* edit,
-                                                     Item* pItem, QWidget* parent )
-: PrefItem( DblSpin, edit, pItem, parent )
-{
-  new QLabel( title, this );
-  myDouble = new QtxDblSpinBox( this );
-  myDouble->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::DoubleSpinItem::~DoubleSpinItem()
-{
-}
-
-/*!
-  Stores value to resource manager
-*/
-void QtxListResourceEdit::DoubleSpinItem::store()
-{
-  setDouble( myDouble->value() );
-}
-
-/*!
-  Retrieve value to resource manager
-*/
-void QtxListResourceEdit::DoubleSpinItem::retrieve()
-{
-  myDouble->setValue( getDouble() );
-}
-
-/*!
-  \return value of property
-  \param prop - property name
-*/
-QVariant QtxListResourceEdit::DoubleSpinItem::property( const QString& name ) const
-{
-  QVariant var;
-  if ( name == QString( "minimum" ) || name == QString( "min" ) )
-    var = QVariant( myDouble->minValue() );
-  else if ( name == QString( "maximum" ) || name == QString( "max" ) )
-    var = QVariant( myDouble->maxValue() );
-  else if ( name == QString( "precision" ) )
-    var = QVariant( myDouble->precision() );
-  else if ( name == QString( "step" ) )
-    var = QVariant( myDouble->lineStep() );
-  else if ( name == QString( "special" ) )
-    var = QVariant( myDouble->specialValueText() );
-  else if ( name == QString( "prefix" ) )
-    var = QVariant( myDouble->prefix() );
-  else if ( name == QString( "suffix" ) )
-    var = QVariant( myDouble->suffix() );
-  return var;
-}
-
-/*!
-  Sets property value
-  \param name - name of property
-  \param var - value of property
-*/
-void QtxListResourceEdit::DoubleSpinItem::setProperty( const QString& name, const QVariant& var )
-{
-  QVariant prop = var;
-
-  if ( ( name == QString( "minimum" ) || name == QString( "min" ) ) && prop.cast( QVariant::Double ) )
-    myDouble->setMinValue( prop.toDouble() );
-  else if ( ( name == QString( "maximum" ) || name == QString( "max" ) ) && prop.cast( QVariant::Double ) )
-    myDouble->setMaxValue( prop.toDouble() );
-  else if ( name == QString( "step" ) && prop.cast( QVariant::Double ) && prop.toDouble() > 0 )
-    myDouble->setLineStep( prop.toDouble() );
-  else if ( name == QString( "precision" ) && prop.cast( QVariant::Int ) && prop.toInt() > 0 )
-    myDouble->setPrecision( prop.toInt() );
-  else if ( name == QString( "special" ) && prop.cast( QVariant::String ) )
-    myDouble->setSpecialValueText( prop.toString() );
-  else if ( name == QString( "prefix" ) && prop.cast( QVariant::String ) )
-    myDouble->setPrefix( prop.toString() );
-  else if ( name == QString( "suffix" ) && prop.cast( QVariant::String ) )
-    myDouble->setSuffix( prop.toString() );
-}
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::ColorItem::ColorItem( const QString& title, QtxResourceEdit* edit,
-                                           Item* pItem, QWidget* parent )
-: PrefItem( Color, edit, pItem, parent )
-{
-  /*!
-    \class QtxListResourceEdit::ColorItem::ColorSelector
-    \brief Label, showing color and allowing to pick color with help of standard color dialog
-  */
-  class ColorSelector : public QLabel
-  {
-  public:
-    ColorSelector( QWidget* parent = 0 ) : QLabel( parent )
-    {
-      setFrameStyle( WinPanel | Raised );
-    }
-    virtual ~ColorSelector() {}
-    virtual QSize minimumSizeHint() const
-    {
-      return QLabel::minimumSizeHint() + QSize( 0, 2 );
-    }
-
-  protected:
-    virtual void mousePressEvent( QMouseEvent* e )
-    {
-      if ( e->button() == LeftButton )
-      {
-        setFrameStyle( WinPanel | Sunken );
-        QColor c = QColorDialog::getColor( paletteBackgroundColor(), this );
-        if ( c.isValid() )
-          setPaletteBackgroundColor( c );
-
-        setFrameStyle( WinPanel | Raised );
-      }
-    }
-  };
-
-  new QLabel( title, this );
-  myColor = new ColorSelector( this );
-  myColor->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::ColorItem::~ColorItem()
-{
-}
-
-/*!
-  Stores value to resource manager
-*/
-void QtxListResourceEdit::ColorItem::store()
-{
-  setColor( myColor->paletteBackgroundColor() );
-}
-
-/*!
-  Retrieve value to resource manager
-*/
-void QtxListResourceEdit::ColorItem::retrieve()
-{
-  myColor->setPaletteBackgroundColor( getColor() );
-}
-
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::FontItem::FontItem( const QString& title, QtxResourceEdit* edit,
-                                         Item* pItem, QWidget* parent )
-: PrefItem( Font, edit, pItem, parent )
-{
-  new QLabel( title, this );
-  myFamilies = new QtxComboBox( false, this );
-  mySizes = new QtxComboBox( true, this );
-  mySizes->setInsertionPolicy( QComboBox::NoInsertion );
-  myBold = new QCheckBox( tr( "Bold" ), this );
-  myItalic = new QCheckBox( tr( "Italic" ), this );
-  myUnderline = new QCheckBox( tr( "Shadow" ), this );
-  myPreview = new QToolButton( this );
-  myPreview->setText( "..." );
-
-  myFamilies->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
-  mySizes->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
-
-  connect( myFamilies, SIGNAL( activated( int ) ), this, SLOT( onActivateFamily( int ) ) );
-  connect( myPreview, SIGNAL( clicked() ), this, SLOT( onPreview() ) );
-
-  setProperty( "system", ( bool )true );
-  setProperty( "widget_flags", ( int )All );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::FontItem::~FontItem()
-{
-}
-
-/*!
-  Stores value to resource manager
-*/
-void QtxListResourceEdit::FontItem::store()
-{
-  QFont f( family(), size() );
-  bool bold, italic, underline;
-  params( bold, italic, underline );
-  f.setBold( bold );
-  f.setItalic( italic );
-  f.setUnderline( underline );
-  Item::setFont( f );
-}
-
-/*!
-  Retrieve value to resource manager
-*/
-void QtxListResourceEdit::FontItem::retrieve()
-{
-  QFont f = getFont();
-  setFamily( f.family() );
-  setSize( f.pointSize() );
-  setParams( f.bold(), f.italic(), f.underline() );
-}
-
-/*!
-  \return value of property
-  \param prop - property name
-*/
-QVariant QtxListResourceEdit::FontItem::property( const QString& name ) const
-{
-  if( name=="system" )
-    return myIsSystem;
-
-  else if( name=="widget_flags" )
-    return ( int )myFlags;
-  
-  if( myIsSystem )
-  {
-    if( name=="families" )
-    {
-      QFontDatabase fdb;
-      return fdb.families();
-    }
-
-    else if( name=="default_family" )
-    {
-      QFontDatabase fdb;
-      QStringList fam = fdb.families();
-      if( fam.count()>0 )
-        return fam.first();
-      else
-        return QString::null;
-    }
-
-    else
-    {
-      QStringList parts = QStringList::split( ":", name );
-      if( parts.count()==2 )
-      {
-        if( parts[1]=="default_bold" || parts[1]=="default_italic" || parts[1]=="default_underline" )
-          return false;
-
-        else if( parts[1]=="sizes" )
-        {
-          QFontDatabase fdb;
-          QValueList<int> sizes = fdb.pointSizes( parts[0] );
-          QValueList<QVariant> vsizes;
-          QValueList<int>::const_iterator anIt = sizes.begin(),
-                                          aLast = sizes.end();
-          for( ; anIt!=aLast; anIt++ )
-            vsizes.append( *anIt );
-
-          return vsizes;
-        }
-
-        else if( parts[1]=="default_size" )
-        {
-          if( parts[0].isEmpty() )
-            return 0;
-            
-          QFontDatabase fdb;
-          QValueList<int> sizes = fdb.pointSizes( parts[0] );
-          if( sizes.count()>0 )
-            return sizes.first();
-          else
-            return 0;
-        }
-      }
-    }
-  }
-
-  else if( myProperties.contains( name ) )
-    return myProperties[ name ];
-
-  return QVariant();
-}
-
-/*!
-  Sets property value
-  \param name - name of property
-  \param var - value of property
-*/
-void QtxListResourceEdit::FontItem::setProperty( const QString& name, const QVariant& value )
-{
-  if( name=="system" )
-  {
-    if( !value.canCast( QVariant::Bool ) )
-      return;
-
-    bool isSystem = value.toBool();
-    if( myIsSystem==isSystem )
-      return;
-
-    myIsSystem = isSystem;
-
-    QVariant families = property( "families" );
-    QString fam = family();
-
-    myFamilies->clear();
-    if( families.canCast( QVariant::StringList ) )
-    {
-      QStringList list = families.toStringList();
-      myFamilies->insertStringList( list );
-    }
-
-    setFamily( fam );
-    setSize( -1 ); //set default size
-  }
-  
-  else if( name=="widget_flags" )
-  {
-    if( !value.canCast( QVariant::Int ) )
-      return;
-
-    int wf = value.toInt();
-    
-    myFlags = wf;
-    myFamilies ->setShown( wf & Family );
-    mySizes    ->setShown( wf & Size );
-    mySizes->lineEdit()->setReadOnly( ( wf & UserSize )==0 );
-    myBold     ->setShown( wf & Bold );
-    myItalic   ->setShown( wf & Italic );
-    myUnderline->setShown( wf & Underline );
-    bool isSystem = property( "system" ).canCast( QVariant::Bool ) ? property( "system" ).toBool() : false;
-    myPreview->setShown( ( wf & Preview ) && isSystem );
-
-    internalUpdate();
-  }
-  
-  else
-    myProperties[ name ] = value;
-}
-
-/*!
-  Sets family of font
-  \param f - new family
-*/
-void QtxListResourceEdit::FontItem::setFamily( const QString& f )
-{
-  QString curtext;
-  if( myFamilies->isShown() )
-  {
-    if( myFamilies->listBox()->findItem( f, Qt::ExactMatch ) )
-      curtext = f;
-  }
-  else
-  {
-    QVariant deffam = property( "default_family" );
-    if( deffam.canCast( QVariant::String ) )
-      curtext = deffam.toString();
-  }
-  
-  if ( curtext.isEmpty() )
-    curtext = (QApplication::font()).family();
-
-  int idx = -1;
-  for ( int i = 0; i < (int)myFamilies->count() && idx < 0; i++ )
-  {
-    if ( myFamilies->text( i ) == curtext )
-      idx = i;
-  }
-
-  if ( idx >= 0 )
-    myFamilies->setCurrentItem( idx );
-
-  onActivateFamily( idx );  
-}
-
-/*!
-  \return family of font
-*/
-QString QtxListResourceEdit::FontItem::family() const
-{
-  return myFamilies->currentText();
-}
-
-/*!
-  Sets size of font
-  \param s - new size of font
-*/
-void QtxListResourceEdit::FontItem::setSize( const int s )
-{
-  int cursize = -1;
-  if( mySizes->isShown() && s>0 )
-  {
-    if( ( myFlags & UserSize ) || mySizes->listBox()->findItem( QString( "%1" ).arg( s ), Qt::ExactMatch ) )
-      cursize = s;
-  }
-  else
-  {
-    QVariant defsize = property( QString( "%1:default_size" ).arg( family() ) );
-    if( defsize.canCast( QVariant::Int ) )
-      cursize = defsize.toInt();
-  }
-
-  mySizes->setCurrentText( cursize>0 ? QString( "%1" ).arg( cursize ) : "" );
-}
-
-/*!
-  \return size of font
-*/
-int QtxListResourceEdit::FontItem::size() const
-{
-  QString s = mySizes->currentText();
-  bool ok;
-  int pSize = s.toInt( &ok );
-  return ( ok ? pSize : 0 );
-}
-
-/*!
-  Sets font parameters
-  \param bold - is font bold
-  \param italic - is font italic
-  \param underline - is font underlined
-*/
-void QtxListResourceEdit::FontItem::setParams( const bool bold, const bool italic, const bool underline )
-{
-  bool curbold = false, curitalic = false, curunderline = false;
-  if( myBold->isShown() )
-    curbold = bold;
-  else
-  {
-    QVariant def = property( QString( "%1:default_bold" ).arg( family() ) );
-    if( def.canCast( QVariant::Bool ) )
-      curbold = def.toBool();
-  }
-  if( myItalic->isShown() )
-    curitalic = italic;
-  else
-  {
-    QVariant def = property( QString( "%1:default_italic" ).arg( family() ) );
-    if( def.canCast( QVariant::Bool ) )
-      curitalic = def.toBool();
-  }
-  if( myUnderline->isShown() )
-    curunderline = underline;
-  else
-  {
-    QVariant def = property( QString( "%1:default_underline" ).arg( family() ) );
-    if( def.canCast( QVariant::Bool ) )
-      curunderline = def.toBool();
-  }
-  myBold->setChecked( curbold );
-  myItalic->setChecked( curitalic );
-  myUnderline->setChecked( curunderline );
-}
-
-/*!
-  \return font parameters
-  \param bold - is font bold
-  \param italic - is font italic
-  \param underline - is font underlined
-*/
-void QtxListResourceEdit::FontItem::params( bool& bold, bool& italic, bool& underline )
-{
-  bold = myBold->isChecked();
-  italic = myItalic->isChecked();
-  underline = myUnderline->isChecked();
-}
-
-/*!
-  Updates internal selection of font properties
-*/
-void QtxListResourceEdit::FontItem::internalUpdate()
-{
-  setFamily( family() );
-  setSize( size() );
-  bool b1, b2, b3;
-  params( b1, b2, b3 );
-  setParams( b1, b2, b3 );
-}
-
-/*!
-  SLOT: called if family is activated, updates list of possible sizes
-*/
-void QtxListResourceEdit::FontItem::onActivateFamily( int )
-{
-  QVariant sizes = property( QString( "%1:sizes" ).arg( family() ) );
-
-  int s = size();
-  mySizes->clear();
-  if( sizes.canCast( QVariant::List ) )
-  {
-    QValueList<QVariant> list = sizes.toList();
-    QStringList sizeItems;
-    QValueList<QVariant>::const_iterator anIt = list.begin(),
-                                         aLast = list.end();
-    for( ; anIt!=aLast; anIt++ )
-      if( (*anIt).canCast( QVariant::Int ) && (*anIt).toInt()>0 )
-        sizeItems.append( QString( "%1" ).arg( (*anIt).toInt() ) );
-    mySizes->insertStringList( sizeItems );
-  }
-  setSize( s );
-}
-
-/*!
-  SLOT: called if it is necessary to show font preview
-*/
-void QtxListResourceEdit::FontItem::onPreview()
-{
-  QFont f( family(), size() );
-  bool bold, italic, underline;
-  params( bold, italic, underline );
-  f.setBold( bold );
-  f.setItalic( italic );
-  f.setUnderline( underline );
-
-  bool ok;
-  f = QFontDialog::getFont( &ok, f );
-
-  if( ok )
-  {
-    setFamily( f.family() );
-    setSize( f.pointSize() );
-    setParams( f.bold(), f.italic(), f.underline() );
-  }
-}
-
-
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::DirListItem::DirListItem( const QString& title, QtxResourceEdit* edit, Item* pItem, QWidget* parent )
-: PrefItem( Font, edit, pItem, parent )
-{
-  myDirListEditor = new QtxDirListEditor( this ); 
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::DirListItem::~DirListItem()
-{
-}
-
-/*!
-  Stores value to resource manager
-*/
-void QtxListResourceEdit::DirListItem::store()
-{
-  QStringList list;
-  myDirListEditor->getPathList(list);
-  setString( QString(list.join(";")) );
-}
-
-/*!
-  Retrieve value to resource manager
-*/
-void QtxListResourceEdit::DirListItem::retrieve()
-{
-  myDirListEditor->setPathList(QStringList::split(";", getString()));
-}
-
-
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::FileItem::FileItem( const QString& title, QtxResourceEdit* edit,
-                                         Item* pItem, QWidget* parent )
-: PrefItem( Font, edit, pItem, parent ),
-  myFlags( QFileInfo::ReadUser ),
-  myIsExisting( true ),
-  myIsReadOnly ( true ),
-  myFileDlg( 0 )
-{
-  new QLabel( title, this );
-  myFile = new QLineEdit( this );
-  myFile->setValidator( new FileValidator( this, myFile ) );
-  myFile->setReadOnly( myIsReadOnly );
-  myOpenFile = new QToolButton( this );
-  myOpenFile->setText( "..." );
-  connect( myOpenFile, SIGNAL( clicked() ), this, SLOT( onOpenFile() ) );
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::FileItem::~FileItem()
-{
-  if( myFileDlg ) 
-    delete myFileDlg;
-}
-
-/*!
-  Stores value to resource manager
-*/
-void QtxListResourceEdit::FileItem::store()
-{
-  setString( myFile->text() );
-}
-
-/*!
-  Retrieve value to resource manager
-*/
-void QtxListResourceEdit::FileItem::retrieve()
-{
-  myFile->setText( getString() );
-}
-
-/*!
-  \return value of property
-  \param prop - property name
-*/
-QVariant QtxListResourceEdit::FileItem::property( const QString& name ) const
-{
-  if( name=="filter" )
-    return myFilter;
-  else if( name=="existing" )
-    return myIsExisting;
-  else if( name=="flags" )
-    return myFlags;
-  else if( name=="readOnly")
-    return myIsReadOnly;
-
-  return QVariant();
-}
-
-/*!
-  Sets property value
-  \param name - name of property
-  \param var - value of property
-*/
-void QtxListResourceEdit::FileItem::setProperty( const QString& name, const QVariant& value )
-{
-  if( name=="filter" )
-  {
-    if( value.canCast( QVariant::String ) )
-    {
-      myFilter.clear();
-      myFilter.append( value.toString() );
-    }
-    else if( value.canCast( QVariant::StringList ) )
-      myFilter = value.toStringList();
-  }
-  else if( name=="existing" && value.canCast( QVariant::Bool ) )
-    myIsExisting = value.toBool();
-
-  else if( name=="flags" && value.canCast( QVariant::UInt ) )
-    myFlags = value.toUInt();
-
-  else if( name=="readOnly" && value.canCast( QVariant::Bool) ) {
-    myIsReadOnly = value.toBool();
-    myFile->setReadOnly( myIsReadOnly );
-  }
-}
-
-/*!
-  SLOT: called if user click "Open File" button, shows dialog 
-*/
-void QtxListResourceEdit::FileItem::onOpenFile()
-{
-  if( !myFileDlg )
-  {
-    myFileDlg = new QFileDialog( "." );
-    connect( myFileDlg, SIGNAL( fileHighlighted( const QString& ) ), this, SLOT( onFileSelected( const QString& ) ) );
-  }
-  
-  myFileDlg->setCaption( title() );
-  myFileDlg->setFilters( myFilter );
-  myFileDlg->setMode( myIsExisting ? QFileDialog::ExistingFile : QFileDialog::AnyFile );
-
-  if( myFileDlg->exec()==QDialog::Accepted )
-  {
-               QString selFile = QDir::convertSeparators( myFileDlg->selectedFile() );
-    myFile->setText( selFile ); 
-  }
-}
-
-/*!
-  \return true if file satisfies permissions
-  \param f - file name
-*/
-bool QtxListResourceEdit::FileItem::isFileCorrect( const QString& f ) const
-{
-  bool res = false;
-  QFileInfo info( f );
-  if( !myIsExisting || info.exists() )
-    res = info.isFile() && info.permission( myFlags );
-
-  return res;
-}
-
-/*!
-  SLOT: called if user has selected file in file dialog, checks file permissions and passes it's name to widget
-  \param f - file name
-*/
-void QtxListResourceEdit::FileItem::onFileSelected( const QString& f )
-{
-  if( myFileDlg && !isFileCorrect( f ) )
-    myFileDlg->setSelection( "" );
-}
-
-
-/*!
-  Constructor
-*/
-QtxListResourceEdit::FileItem::FileValidator::FileValidator( FileItem* item, QObject* parent )
-: QValidator( parent ),
-  myItem( item )
-{
-}
-
-/*!
-  Destructor
-*/
-QtxListResourceEdit::FileItem::FileValidator::~FileValidator()
-{
-}
-
-/*!
-  Check file permissions
-  \param f - file name
-*/
-QValidator::State QtxListResourceEdit::FileItem::FileValidator::validate( QString& f, int& ) const
-{
-  if( myItem && myItem->isFileCorrect( f ) )
-    return QValidator::Acceptable;
-  else
-    return QValidator::Intermediate;
-}
diff --git a/src/Qtx/QtxListResourceEdit.h b/src/Qtx/QtxListResourceEdit.h
deleted file mode 100644 (file)
index fc53800..0000000
+++ /dev/null
@@ -1,532 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxListResourceEdit.h
-// Author:    Sergey TELKOV
-
-#ifndef QTXLISTRESOURCEEDIT_H
-#define QTXLISTRESOURCEEDIT_H
-
-#include "QtxResourceEdit.h"
-
-#include <qmap.h>
-#include <qhbox.h>
-#include <qframe.h>
-#include <qgroupbox.h>
-#include <qvalidator.h>
-
-class QLabel;
-class QListBox;
-class QLineEdit;
-class QCheckBox;
-class QComboBox;
-class QTabWidget;
-class QWidgetStack;
-
-class QtxIntSpinBox;
-class QtxDblSpinBox;
-
-class QtxDirListEditor;
-
-/*!
-  \class QtxListResourceEdit
-  GUI implementation of QtxResourceEdit - manager of resources
-*/
-
-class QTX_EXPORT QtxListResourceEdit : public QFrame, public QtxResourceEdit
-{
-  Q_OBJECT
-
-public:
-  class Tab;
-  class Group;
-  class Category;
-  class PrefItem;
-
-  class Spacer;
-  class ColorItem;
-  class StateItem;
-  class SelectItem;
-  class StringItem;
-  class DoubleSpinItem;
-  class DoubleEditItem;
-  class IntegerSpinItem;
-  class IntegerEditItem;
-  class FontItem;
-  class FileItem;
-  class DirListItem;
-
-  enum { Space, Bool, Color, String, Selector, DblSpin, IntSpin, Double, Integer, GroupBox, Font, DirList, File, User };
-
-public:
-  QtxListResourceEdit( QtxResourceMgr*, QWidget* = 0 );
-  virtual ~QtxListResourceEdit();
-
-  virtual void  setItemProperty( const int, const QString&, const QVariant& );
-
-signals:
-  void          resourceChanged( int );
-  void          resourceChanged( QString&, QString& );
-  void          resourcesChanged( const QMap<int, QString>& );
-
-private slots:
-  void          onSelectionChanged();
-
-protected:
-  virtual void  itemAdded( Item* );
-  virtual Item* createItem( const QString&, const int );
-  virtual void  changedResources( const QMap<Item*, QString>& );
-
-private:
-  void          updateState();
-  void          updateVisible();
-
-private:
-  QListBox*     myList;
-  QWidgetStack* myStack;
-};
-
-/*!
-  \class QtxListResourceEdit::Category
-  GUI implementation of 'Category' frame
-*/
-
-class QtxListResourceEdit::Category : public QFrame, public Item
-{
-public:
-  Category( QtxListResourceEdit*, QWidget* = 0 );
-  virtual ~Category();
-
-  virtual bool     isEmpty() const;
-
-  virtual int      type() const;
-  virtual void     store();
-  virtual void     retrieve();
-
-  virtual QVariant property( const QString& ) const;
-  virtual void     setProperty( const QString&, const QVariant& );
-
-protected:
-  virtual Item*    createItem( const QString&, const int );
-
-private:
-  void             updateState();
-
-private:
-  QLabel*          myInfo;
-  QTabWidget*      myTabs;
-};
-
-/*!
-  \class QtxListResourceEdit::Tab
-  GUI implementation of resources tab.
-*/
-
-class QtxListResourceEdit::Tab : public QFrame, public Item
-{
-public:
-  Tab( QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~Tab();
-
-  virtual int   type() const;
-  virtual void  store();
-  virtual void  retrieve();
-
-public:
-  virtual void  polish();
-
-protected:
-  virtual Item* createItem( const QString&, const int );
-
-private:
-  void          adjustLabels();
-
-private:
-  QWidget*      myMainFrame;
-};
-
-/*!
-  \class QtxListResourceEdit::Group
-  GUI implementation of resources group.
-*/
-
-class QtxListResourceEdit::Group : public QGroupBox, public Item
-{
-public:
-  Group( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~Group();
-
-  virtual int      type() const;
-  virtual void     store();
-  virtual void     retrieve();
-
-  virtual QVariant property( const QString& ) const;
-  virtual void     setProperty( const QString&, const QVariant& );
-
-  virtual void     setTitle( const QString& );
-
-protected:
-  virtual Item*    createItem( const QString&, const int );
-};
-
-/*!
-  \class QtxListResourceEdit::PrefItem
-  Base class for preferences items.
-*/
-
-class QtxListResourceEdit::PrefItem : public QHBox, public Item
-{
-public:
-  PrefItem( const int, QtxResourceEdit*, Item* = 0, QWidget* = 0 );
-  virtual ~PrefItem();
-
-  virtual int   type() const;
-
-protected:
-  virtual Item* createItem( const QString&, const int );
-
-private:
-  int           myType;
-};
-
-/*!
-  \class QtxListResourceEdit::Spacer
-  GUI implementation of resources spacer.
-*/
-
-class QtxListResourceEdit::Spacer : public PrefItem
-{
-public:
-  Spacer( QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~Spacer();
-
-  virtual void store();
-  virtual void retrieve();
-};
-
-/*!
-  \class QtxListResourceEdit::SelectItem
-  GUI implementation of resources selector item.
-*/
-
-class QtxListResourceEdit::SelectItem : public PrefItem
-{
-public:
-  SelectItem( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~SelectItem();
-
-  virtual void     store();
-  virtual void     retrieve();
-
-  virtual QVariant property( const QString& ) const;
-  virtual void     setProperty( const QString&, const QVariant& );
-
-private:
-  void             setStrings( const QVariant& );
-  void             setIndexes( const QVariant& );
-
-  void             setStrings( const QStringList& );
-  void             setIndexes( const QValueList<int>& );
-
-private:
-  QComboBox*       myList;
-  QMap<int, int>   myIndex;
-};
-
-/*!
-  \class  QtxListResourceEdit::StateItem
-  GUI implementation of resources bool item.
-*/
-class QtxListResourceEdit::StateItem : public PrefItem
-{
-public:
-  StateItem( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~StateItem();
-
-  virtual void     store();
-  virtual void     retrieve();
-
-private:
-  QCheckBox*       myState;
-};
-
-/*!
-  \class  QtxListResourceEdit::StringItem
-  GUI implementation of resources string item.
-*/
-
-class QtxListResourceEdit::StringItem : public PrefItem
-{
-public:
-  StringItem( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~StringItem();
-
-  virtual void     store();
-  virtual void     retrieve();
-
-private:
-  QLineEdit*       myString;
-};
-
-/*!
-  \class  QtxListResourceEdit::IntegerEditItem
-  GUI implementation of resources integer item.
-*/
-
-class QtxListResourceEdit::IntegerEditItem : public PrefItem
-{
-public:
-  IntegerEditItem( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~IntegerEditItem();
-
-  virtual void     store();
-  virtual void     retrieve();
-
-private:
-  QLineEdit*       myInteger;
-};
-
-/*!
-  \class  QtxListResourceEdit::IntegerSpinItem
-  GUI implementation of resources integer item.
-*/
-
-class QtxListResourceEdit::IntegerSpinItem : public PrefItem
-{
-public:
-  IntegerSpinItem( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~IntegerSpinItem();
-
-  virtual void     store();
-  virtual void     retrieve();
-
-  virtual QVariant property( const QString& ) const;
-  virtual void     setProperty( const QString&, const QVariant& );
-
-private:
-  QtxIntSpinBox*  myInteger;
-};
-
-/*!
-  \class  QtxListResourceEdit::DoubleEditItem
-  GUI implementation of resources double item.
-*/
-
-class QtxListResourceEdit::DoubleEditItem : public PrefItem
-{
-public:
-  DoubleEditItem( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~DoubleEditItem();
-
-  virtual void     store();
-  virtual void     retrieve();
-
-private:
-  QLineEdit*       myDouble;
-};
-
-/*!
-  \class  QtxListResourceEdit::DoubleSpinItem
-  GUI implementation of resources double item.
-*/
-
-class QtxListResourceEdit::DoubleSpinItem : public PrefItem
-{
-public:
-  DoubleSpinItem( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~DoubleSpinItem();
-
-  virtual void     store();
-  virtual void     retrieve();
-
-  virtual QVariant property( const QString& ) const;
-  virtual void     setProperty( const QString&, const QVariant& );
-
-private:
-  QtxDblSpinBox*   myDouble;
-};
-
-/*!
-  \class  QtxListResourceEdit::ColorItem
-  GUI implementation of resources color item.
-*/
-
-class QtxListResourceEdit::ColorItem : public PrefItem
-{
-public:
-  ColorItem( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~ColorItem();
-
-  virtual void     store();
-  virtual void     retrieve();
-
-private:
-  QWidget*         myColor;
-};
-
-class QtxComboBox;
-class QToolButton;
-
-/*!
-  \class  QtxListResourceEdit::FontItem
-  GUI implementation of resources font item.
-*/
-class QtxListResourceEdit::FontItem : public PrefItem
-{
-  Q_OBJECT
-
-public:
-  typedef enum
-  {
-    Family    = 0x01,
-    Size      = 0x02,
-    UserSize  = 0x04,
-    Bold      = 0x08,
-    Italic    = 0x10,
-    Underline = 0x20,
-    Preview   = 0x40,
-
-    All = Family | Size | UserSize | Bold | Italic | Underline | Preview
-    
-  } WidgetFlags;
-  
-public:
-  FontItem( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~FontItem();
-
-  virtual void store();
-  virtual void retrieve();
-
-  virtual QVariant property( const QString& ) const;
-  virtual void     setProperty( const QString&, const QVariant& );
-
-private slots:
-  void onActivateFamily( int );
-  void onPreview();
-  
-private:
-  void       setFamily( const QString& );
-  QString    family() const;
-  void       setSize( const int );
-  int        size() const;
-  void       setParams( const bool, const bool, const bool );
-  void       params( bool&, bool&, bool& );
-  void       internalUpdate();
-  
-private:
-  int            myFlags;
-  bool           myIsSystem;
-  QtxComboBox   *myFamilies, *mySizes;
-  QCheckBox     *myBold, *myItalic, *myUnderline;
-  QToolButton   *myPreview;
-  QMap<QString, QVariant>   myProperties;
-};
-
-
-/*!
-  \class QtxListResourceEdit
-  \brief GUI implementation of resources directory list item.
-*/
-class QtxListResourceEdit::DirListItem : public PrefItem
-{
-  Q_OBJECT
-  
-public:
-
-  /*!
-   * \brief Constructor
-   */
-  DirListItem( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  /*!
-   * \brief Destructor
-   */
-  virtual ~DirListItem();
-
-  /*!
-   * \brief Stores the data
-   */
-  virtual void     store();
-
-  /*!
-   * \brief Retrieves the data
-   */
-  virtual void     retrieve();
-
-private:
-  QtxDirListEditor* myDirListEditor; //!< The widget wich implements in GUI the list of directories
-};
-
-class QtxComboBox;
-class QToolButton;
-class QFileDialog;
-
-/*!
-  \class QtxListResourceEdit::FontItem
-  GUI implementation of resources font item.
-*/
-
-class QtxListResourceEdit::FileItem : public PrefItem
-{
-  Q_OBJECT
-
-private:
-  /*!
-    \class QtxListResourceEdit::FileItem::FileValidator
-    custom file validator: checks files on some rights
-  */
-
-  class FileValidator : public QValidator
-  {
-  public:
-    FileValidator( FileItem*, QObject* );
-    ~FileValidator();
-
-    virtual QValidator::State validate( QString&, int& ) const;
-
-  private:
-    FileItem* myItem;
-  };
-
-public:
-  FileItem( const QString&, QtxResourceEdit*, Item*, QWidget* = 0 );
-  virtual ~FileItem();
-
-  virtual void store();
-  virtual void retrieve();
-  
-  virtual QVariant property( const QString& ) const;
-  virtual void     setProperty( const QString&, const QVariant& );
-
-  virtual bool isFileCorrect( const QString& ) const;
-
-private slots:
-  void onOpenFile();
-  void onFileSelected( const QString& );
-
-private:
-  uint          myFlags;
-  bool          myIsReadOnly;
-  QStringList   myFilter;
-  bool          myIsExisting;
-  QLineEdit*    myFile;
-  QToolButton*  myOpenFile;
-  QFileDialog*  myFileDlg;
-};
-
-
-#endif
diff --git a/src/Qtx/QtxListView.cxx b/src/Qtx/QtxListView.cxx
deleted file mode 100755 (executable)
index 92af7e3..0000000
+++ /dev/null
@@ -1,422 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "QtxListView.h"
-
-#include <qheader.h>
-#include <qpopupmenu.h>
-#include <qpushbutton.h>
-
-static const char* list_xpm[] = {
-"16 16 6 1",
-". c None",
-"a c #E3E9EB",
-"b c #798391",
-"c c #EBEBEB",
-"d c #ABB4BE",
-"e c #030E1F",
-"................",
-"................",
-"................",
-"...aaaaaaaaaa...",
-"..abbbbbbbbbbe..",
-"..abecbecbecbe..",
-"..abbbbbbbbbbe..",
-"..abecbecbecbe..",
-"..abecaaaaaaaa..",
-"..abeccdbbbbbb..",
-"..abecccdbbbbe..",
-"..abbbbe.dbbe...",
-"...eeeee..de....",
-"................",
-"................",
-"................" };
-
-/*!
-  Constructor
-*/
-QtxListView::QtxListView( const int state, QWidget* parent, const char* name, WFlags f )
-: QListView( parent, name, f ),
-myButton( 0 ),
-myHeaderState( state )
-{
-  initialize();
-}
-
-/*!
-  Constructor
-*/
-QtxListView::QtxListView( QWidget* parent, const char* name, WFlags f )
-: QListView( parent, name, f ),
-myButton( 0 ),
-myHeaderState( HeaderAuto )
-{
-  initialize();
-}
-
-/*!
-  Initialization
-*/
-void QtxListView::initialize()
-{
-  if ( myHeaderState == HeaderButton )
-  {
-    QPixmap p( list_xpm );
-
-    QPushButton* but = new QPushButton( this );
-    but->setDefault( false );
-    but->setFlat( true );
-    but->setIconSet( p );
-    but->setBackgroundPixmap( p );
-    if ( p.mask() )
-           but->setMask( *p.mask() );
-    myButton = but;
-
-    connect( myButton, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) );
-  }
-  else
-  {
-    header()->installEventFilter( this );
-  }
-
-  myPopup = new QPopupMenu( this );
-  connect( myPopup, SIGNAL( activated( int ) ), this, SLOT( onShowHide( int ) ) );
-  connect( header(), SIGNAL( sizeChange( int, int, int ) ), this, SLOT( onHeaderResized() ) );
-}
-
-/*!
-  Destructor
-*/
-QtxListView::~QtxListView()
-{
-}
-
-/*!
-  Add new column
-  \param label - column title
-  \param width - column width
-*/
-int QtxListView::addColumn( const QString& label, int width )
-{
-  int res = QListView::addColumn( label, width );
-  for ( int i = myAppropriate.count(); i <= res; i++ )
-    myAppropriate.append( 1 );
-  onHeaderResized();
-  return res;
-}
-
-/*!
-  Add new column
-  \param iconset - column icon
-  \param label - column title
-  \param width - column width
-*/
-int QtxListView::addColumn( const QIconSet& iconset, const QString& label, int width ) 
-{
-  int res = QListView::addColumn( iconset, label, width );
-  for ( int i = myAppropriate.count(); i <= res; i++ )
-    myAppropriate.append( 1 );
-  onHeaderResized();
-  return res;
-}
-
-/*!
-  Removes column
-  \param index - column index
-*/
-void QtxListView::removeColumn( int index ) 
-{
-  QListView::removeColumn( index );
-  if ( index >= 0 && index < (int)myAppropriate.count() )
-    myAppropriate.remove( myAppropriate.at( index ) );
-  onHeaderResized();
-}
-
-/*!
-  \return true if column is situated in popup for show/hide columns
-*/
-bool QtxListView::appropriate( const int index ) const
-{
-  return index >= 0 && index < (int)myAppropriate.count() && myAppropriate[index];
-}
-
-/*!
-  Sets appropriate state: whether column is situated in popup for show/hide columns
-  \param index - column index
-  \param on - new state
-*/
-void QtxListView::setAppropriate( const int index, const bool on )
-{
-  if ( index < 0 || index >= (int)myAppropriate.count() )
-    return;
-
-  myAppropriate[index] = on ? 1 : 0;
-}
-
-/*!
-  Resizes list view and header
-*/
-void QtxListView::resize( int w, int h )
-{
-  QListView::resize( w, h );
-  onHeaderResized();
-}
-
-/*!
-  Shows list view
-*/
-void QtxListView::show()
-{
-  QListView::show();
-  onHeaderResized();
-}
-
-/*!
-  Update on resize contents
-*/
-void QtxListView::resizeContents( int w, int h )
-{
-/*
-  if ( myButton && myButton->isVisibleTo( myButton->parentWidget() ) )
-  {
-    if ( header()->orientation() == Qt::Horizontal )
-      w += myButton->width();
-    else
-      h += myButton->width();
-  }
-*/
-  QListView::resizeContents( w, h );
-
-  onHeaderResized();
-}
-
-/*!
-  Shows column
-  \param ind - column index
-*/
-void QtxListView::show( int ind )
-{
-  setShown( ind, true );
-}
-
-/*!
-  Hides column
-  \param ind - column index
-*/
-void QtxListView::hide( int ind )
-{
-  setShown( ind, false );
-}
-
-/*!
-  \return true if column is shown
-  \param ind - column index
-*/
-bool QtxListView::isShown( int ind ) const
-{
-  if ( ind>=0 && ind<header()->count() )
-    return columnWidth( ind ) > 0 || header()->isResizeEnabled( ind );
-  else
-    return false;
-}
-
-/*!
-  Shows/hides column
-  \param ind - column index
-  \param sh - new is shown state
-*/
-void QtxListView::setShown( int ind, bool sh )
-{
-  if( ind<0 || ind>=header()->count() || isShown( ind )==sh )
-    return;
-
-  ColumnData& data = myColumns[ind];
-  if ( sh )
-  {
-    int w = data.width;
-    bool resizeable = data.resizeable;
-    myColumns.remove( ind );
-
-    setColumnWidth( ind, w );
-    header()->setResizeEnabled( resizeable, ind );
-  }
-  else
-  {
-    int w = columnWidth( ind );
-    bool r = header()->isResizeEnabled( ind );
-    setColumnWidth( ind, 0 );
-    header()->setResizeEnabled( false, ind );
-    data.width = w;
-    data.resizeable = r;
-  }
-  updateContents();
-}
-
-/*!
-  Changes column width
-  \param c - column index
-  \param w - new width
-*/
-void QtxListView::setColumnWidth( int c, int w )
-{
-  if ( myColumns.contains( c ) )
-    myColumns[c].width = w;
-
-  QListView::setColumnWidth( c, !myColumns.contains( c ) ? w : 0 );
-}
-
-/*!
-  \return the recommended size for the widget
-*/
-QSize QtxListView::sizeHint() const
-{
-  QSize sz = QListView::sizeHint();
-
-  if ( myButton && myButton->isVisibleTo( myButton->parentWidget() ) )
-    sz.setWidth( sz.width() + 2 + myButton->width() );
-
-  return sz;
-}
-
-/*!
-  \return the recommended minimum size for the widget
-*/
-QSize QtxListView::minimumSizeHint() const
-{
-  QSize sz = QListView::minimumSizeHint();
-
-  if ( myButton && myButton->isVisibleTo( myButton->parentWidget() ) )
-    sz.setWidth( sz.width() + 2 + myButton->width() );
-
-  return sz;
-}
-
-/*!
-  SLOT: called if header is resized
-*/
-void QtxListView::onHeaderResized()
-{
-  if ( myHeaderState == HeaderAuto )
-  {
-    int c = 0;
-    for ( int i = 0; i < columns(); i++ )
-    {
-      if ( !header()->label( i ).isEmpty() ||
-           ( header()->iconSet( i ) && !header()->iconSet( i )->isNull() ) )
-        c++;
-    }
-
-    if ( c > 1 )
-      header()->show();
-    else
-      header()->hide();
-  }
-
-  if ( !myButton || !header()->isVisibleTo( this ) )
-    return;
-
-  int lw = lineWidth();
-  int h = header()->size().height() - 1;
-  myButton->setFixedSize( h, h );
-
-  int x = header()->headerWidth() - header()->offset() + 2;
-  if ( x < header()->width() - h )
-    x = header()->width() - h;
-
-  if ( myHeaderState == HeaderButton )
-  {
-    if ( header()->orientation() == Qt::Horizontal )
-      myButton->move( lw+x, lw );
-    else
-      myButton->move( lw, lw+x );
-  }
-}
-
-/*!
-  Shows popup filled with column names to show/hide column
-  \param x, y - position of popup
-*/
-void QtxListView::showPopup( const int x, const int y )
-{
-  myPopup->clear();
-  for ( int i = 0; i < columns(); i++ )
-  {
-    if ( appropriate( i ) )
-    {
-      int id = myPopup->insertItem( header()->label( i ), i );
-      myPopup->setItemChecked( id, isShown( i ) );
-    }
-  }
-
-  if( myPopup->count() )
-    myPopup->exec( mapToGlobal( QPoint( x, y ) ) );
-}
-
-/*!
-  SLOT: shows popup on button ".." click
-*/
-void QtxListView::onButtonClicked()
-{
-  if ( myHeaderState != HeaderButton )
-    return;
-
-  int x = myButton->x(),
-      y = myButton->y() + myButton->height();
-
-  showPopup( x, y );
-}
-
-/*!
-  SLOT: called on popup action is activated, toggles shown state of column
-  \param id - column index
-*/
-void QtxListView::onShowHide( int id )
-{
-  //if ( myHeaderState != HeaderButton )
-  //  return;
-
-  setShown( id, !isShown( id ) );
-}
-
-/*!
-  Receives all resize events sent to the viewport
-*/
-void QtxListView::viewportResizeEvent( QResizeEvent* e )
-{
-  QListView::viewportResizeEvent( e );
-  onHeaderResized();
-}
-
-/*!
-  Custom event filter, shows popup on right button click
-*/
-bool QtxListView::eventFilter( QObject* o, QEvent* e )
-{
-  if( o==header() && e->type()==QEvent::MouseButtonPress )
-  {
-    QMouseEvent* me = ( QMouseEvent* )e;
-    if( me->button()==Qt::RightButton )
-    {
-      showPopup( me->x()+2, me->y()+2 );
-      return true;
-    }
-  }
-  
-  return QListView::eventFilter( o, e );
-}
diff --git a/src/Qtx/QtxListView.h b/src/Qtx/QtxListView.h
deleted file mode 100755 (executable)
index 76aa63a..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef QTXLISTVIEW_H
-#define QTXLISTVIEW_H
-
-#include "Qtx.h"
-
-#ifdef WIN32
-#pragma warning( disable:4251 )
-#endif
-
-#include <qlistview.h>
-#include <qiconset.h>
-
-class QButton;
-class QPopupMenu;
-
-class QTX_EXPORT QtxListView : public QListView
-{
-  Q_OBJECT
-
-public:
-  enum { HeaderAuto, HeaderButton, NoHeaderButton };
-
-public:
-  QtxListView( QWidget* = 0, const char* = 0, WFlags = 0 );
-  QtxListView( const int, QWidget* = 0, const char* = 0, WFlags = 0 );
-  virtual ~QtxListView();
-
-  virtual int   addColumn( const QString&, int = -1 );
-  virtual int   addColumn( const QIconSet&, const QString&, int width = -1 );
-
-  virtual void  removeColumn( int );
-
-  virtual void  resize( int, int );
-
-  void          show( int );
-  void          hide( int );
-
-  bool          isShown( int ) const;
-  void          setShown( int, bool );
-
-  bool          appropriate( const int ) const;
-  virtual void  setAppropriate( const int, const bool );
-
-  virtual void  setColumnWidth( int, int );
-
-  virtual QSize sizeHint() const;
-  virtual QSize minimumSizeHint() const;
-
-public slots:
-  virtual void  show();
-  virtual void  resizeContents( int, int );
-
-protected slots:
-  void          onHeaderResized();
-  void          onButtonClicked();
-  void          onShowHide( int );
-
-protected:
-  virtual void  viewportResizeEvent( QResizeEvent* );
-  virtual bool  eventFilter( QObject*, QEvent* );
-  virtual void  showPopup( const int x, const int y );
-
-private:
-  typedef struct { int width; bool resizeable; } ColumnData;
-  typedef QMap<int, ColumnData>                  ColumnsMap;
-
-private:
-  void          initialize();
-
-private:
-  QPopupMenu*   myPopup;
-  QButton*      myButton;
-  ColumnsMap    myColumns;
-  QIntList      myAppropriate;
-  int           myHeaderState;
-};
-
-#ifdef WIN32
-#pragma warning( default:4251 )
-#endif
-
-#endif
index 2103eccaee0ee8cfa89b250d82408903615b3bb2..bed55bebccb3219d47c68a457b8a4e63c09633f1 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxLogoMgr.cxx
+// Author:    Sergey TELKOV
 //
 #include "QtxLogoMgr.h"
 
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qstyle.h>
-#include <qimage.h>
-#include <qbitmap.h>
-#include <qlayout.h>
-#include <qmenubar.h>
-#include <qapplication.h>
+#include <QLabel>
+#include <QImage>
+#include <QBitmap>
+#include <QHBoxLayout>
+#include <QMenuBar>
+#include <QPointer>
+#include <QApplication>
+#include <QMovie>
+
+/*!
+  \class QtxLogoMgr::LogoBox
+  \internal
+  \brief Logo images container.
+*/
+
+class QtxLogoMgr::LogoBox : public QWidget
+{
+public:
+  LogoBox( QMenuBar* );
+
+  QMenuBar*      menuBar() const;
+  virtual bool   eventFilter( QObject*, QEvent* );
+  void           setLabels( const QList<QLabel*>& );
+
+protected:
+  virtual void   customEvent( QEvent* );
+
+private:
+  void           updateCorner();
+  void           updateContents();
+
+private:
+  typedef QPointer<QWidget> WidgetPtr;
+
+private:
+  QMenuBar*      myMB;       //!< parent menu bar
+  QList<QLabel*> myLabels;   //!< list of labels containing logo images
+  WidgetPtr      myCornWid;  //!< corner widget
+};
+
+/*!
+  \brief Constructor.
+  \param mb menu bar
+*/
+QtxLogoMgr::LogoBox::LogoBox( QMenuBar* mb )
+: QWidget( mb ),
+  myMB( mb ),
+  myCornWid( 0 )
+{
+  myMB->installEventFilter( this );
+  updateCorner();
+}
+
+/*!
+  \brief Get menu bar.
+  \return menu bar
+*/
+QMenuBar* QtxLogoMgr::LogoBox::menuBar() const
+{
+  return myMB;
+}
+
+/*!
+  \brief Custom event filter.
+  \param o event receiver object
+  \param e event sent to object
+  \return \c true if further event processing should be stopped
+*/
+bool QtxLogoMgr::LogoBox::eventFilter( QObject* o, QEvent* e )
+{
+  if ( o != menuBar() )
+    return false;
+
+  if ( e->type() == QEvent::MenubarUpdated || e->type() == QEvent::Resize )
+    updateCorner();
+
+  if ( e->type() == QEvent::ChildAdded || e->type() == QEvent::ChildRemoved )
+  {
+    updateCorner();
+    QApplication::postEvent( this, new QEvent( QEvent::User ) );
+  }
+
+  return false;
+}
+
+/*!
+  \brief Set label widgets (logo containers).
+  \param labs list of labels
+*/
+void QtxLogoMgr::LogoBox::setLabels( const QList<QLabel*>& labs )
+{
+  for ( QList<QLabel*>::iterator it = myLabels.begin(); it != myLabels.end(); ++it )
+  {
+    if ( !labs.contains( *it ) )
+      delete *it;
+  }
+
+  myLabels = labs;
+  updateContents();
+}
+
+/*!
+  \brief Custom event processing (update logo widget).
+  \param e event (not used)
+*/
+void QtxLogoMgr::LogoBox::customEvent( QEvent* /*e*/ )
+{
+  updateCorner();
+}
+
+/*!
+  \brief Update menu bar's corner widget.
+*/
+void QtxLogoMgr::LogoBox::updateCorner()
+{
+  if ( menuBar()->cornerWidget() == this )
+    return;
+
+  myCornWid = menuBar()->cornerWidget();
+  myMB->setCornerWidget( this );
+  updateContents();
+}
 
 /*!
-  Constructor
+  \brief Update logo manager contents.
+*/
+void QtxLogoMgr::LogoBox::updateContents()
+{
+  if ( layout() )
+    delete layout();
+
+  QHBoxLayout* base = new QHBoxLayout( this );
+  base->setMargin( 0 );
+  base->setSpacing( 3 );
+
+  for ( QList<QLabel*>::const_iterator it = myLabels.begin(); it != myLabels.end(); ++it )
+    base->addWidget( *it );
+
+  if ( myCornWid )
+    base->addWidget( myCornWid );
+
+  QApplication::sendPostedEvents();
+}
+
+/*!
+  \class QtxLogoMgr
+  \brief Provides a way to install logo pictures to the application main window.
+
+  The class includes the following functionality:
+  - add the logo image
+  - remove logo image
+  - support static images and animated images (QMovie)
+  - start/stop and pause/resume the animated logos
+*/
+
+/*!
+  \brief Constructor.
+  \param mb parent menu bar
 */
 QtxLogoMgr::QtxLogoMgr( QMenuBar* mb )
-: QObject( mb ),
-myMenus( mb ),
-myId( 0 )
+: QObject( mb )
 {
+  myBox = new LogoBox( mb );
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxLogoMgr::~QtxLogoMgr()
 {
 }
 
 /*!
-  Returns the menubar.
+  \brief Get menu bar.
+  \return parent menu bar
 */
 QMenuBar* QtxLogoMgr::menuBar() const
 {
-  return myMenus;
+  return myBox->menuBar();
 }
 
 /*!
-  Returns the count of the existed logos.
+  \brief Get number of logo images.
+  \return current number of logo images
 */
 int QtxLogoMgr::count() const
 {
@@ -61,36 +215,77 @@ int QtxLogoMgr::count() const
 }
 
 /*!
-  Insert new logo to the menu bar area
+  \brief Insert new logo pixmap to the menu bar area.
+  \param id unique string identifier of the logo
+  \param pix logo pixmap
+  \param index logo position (if < 0, logo is added to the end)
 */
 void QtxLogoMgr::insert( const QString& id, const QPixmap& pix, const int index )
 {
   if ( pix.isNull() )
     return;
 
-  LogoInfo* inf = 0;
+  LogoInfo& inf = insert( id, index );
+
+  inf.pix = pix;
+
+  generate();
+}
+
+/*!
+  \brief Insert new animated logo to the menu bar area.
+  \param id unique string identifier of the logo
+  \param pix logo movie
+  \param index logo position (if < 0, logo is added to the end)
+*/
+void QtxLogoMgr::insert( const QString& id, QMovie* movie, const int index )
+{
+  if ( !movie )
+    return;
+
+  LogoInfo& inf = insert( id, index );
+
+  inf.mov = movie;
+  movie->setParent( this );
+  movie->setCacheMode( QMovie::CacheAll );
+  movie->jumpToFrame( 0 );
+
+  generate();
+}
+
+/*!
+  \brief Insert new logo information structure into the logos list.
+  \param id unique string identifier of the logo
+  \param index logo position (if < 0, logo is added to the end)
+  \return logo information object
+*/
+QtxLogoMgr::LogoInfo& QtxLogoMgr::insert( const QString& id, const int index )
+{
+  LogoInfo empty;
+  empty.id = id;
+  empty.mov = 0;
 
   int idx = find( id );
   if ( idx < 0 )
   {
     idx = index < (int)myLogos.count() ? index : -1;
     if ( idx < 0 )
-      inf = &( *myLogos.append( LogoInfo() ) );
+    {
+      myLogos.append( empty );
+      idx = myLogos.count() - 1;
+    }
     else
-      inf = &( *myLogos.insert( myLogos.at( idx ), LogoInfo() ) );
+      myLogos.insert( idx, empty );
   }
-  else
-    inf = &( *myLogos.at( idx ) );
-
 
-  inf->id = id;
-  inf->pix = pix;
+  LogoInfo& inf = myLogos[idx];
 
-  generate();
+  return inf;
 }
 
 /*!
-  Removes a logo
+  \brief Remove a logo.
+  \param id logo identifier
 */
 void QtxLogoMgr::remove( const QString& id )
 {
@@ -98,13 +293,13 @@ void QtxLogoMgr::remove( const QString& id )
   if ( idx < 0 )
     return;
 
-  myLogos.remove( myLogos.at( idx ) );
+  myLogos.removeAt( idx );
 
   generate();
 }
 
 /*!
-  Removes all logos 
+  \brief Removes all logos.
 */
 void QtxLogoMgr::clear()
 {
@@ -113,88 +308,132 @@ void QtxLogoMgr::clear()
 }
 
 /*!
-  Inserts logo to menu bar
+  \brief Start the animation of movie logo.
+
+  If \a id is empty, all movie logos animation are started.
+
+  \param id logo identifier
 */
-void QtxLogoMgr::generate()
+void QtxLogoMgr::startAnimation( const QString& id )
 {
-  if ( !menuBar() )
-    return;
+  QList<QMovie*> movList;
+  movies( id, movList );
 
-  if ( myId ) 
-    menuBar()->removeItem( myId );
+  for ( QList<QMovie*>::iterator it = movList.begin(); it != movList.end(); ++it )
+    (*it)->start();
+}
 
-  myId = 0;
+/*!
+  \brief Stop the animation of movie logo.
 
-  if ( myLogos.isEmpty() )
-    return;
+  If \a id is empty, all movie logos animation are stopped.
 
-  class LogoBox : public QHBox
-  {
-  public:
-    LogoBox( QWidget* parent = 0, const char* name = 0, WFlags f = 0 ) : QHBox( parent, name, f ) {};
+  \param id logo identifier
+*/
+void QtxLogoMgr::stopAnimation( const QString& id )
+{
+  QList<QMovie*> movList;
+  movies( id, movList );
 
-    void addSpacing( int spacing )
-    {
-      QApplication::sendPostedEvents( this, QEvent::ChildInserted );
-      ((QHBoxLayout*)layout())->addSpacing( spacing );
-    }
+  for ( QList<QMovie*>::iterator it = movList.begin(); it != movList.end(); ++it )
+    (*it)->stop();
+}
 
-  protected:
-    void drawContents( QPainter* p )
-    {
-      if ( parentWidget()->inherits( "QMenuBar" ) )
-        style().drawControl( QStyle::CE_MenuBarEmptyArea, p, this, contentsRect(), colorGroup() );
-      else
-        QHBox::drawContents( p );
-    }
-  };
+/*!
+  \brief Pause/resume the animation of movie logo.
+
+  If \a pause is \c true, the animation is paused; otherwise
+  it is resumed.
+  
+  If \a id is empty, the operation is performed for all movis logos.
+
+  \param pause if \c true, pause animation, otherwise resume it
+  \param id logo identifier
+*/
+void QtxLogoMgr::pauseAnimation( const bool pause, const QString& id )
+{
+  QList<QMovie*> movList;
+  movies( id, movList );
 
-  LogoBox* cnt = new LogoBox( menuBar() );
-  cnt->setSpacing( 3 );
+  for ( QList<QMovie*>::iterator it = movList.begin(); it != movList.end(); ++it )
+    (*it)->setPaused( pause );
+}
+
+/*!
+  \brief Regenerate logo manager widget contents.
+  
+  Insert logo to menu bar if it not yet done, layout the widget.
+*/
+void QtxLogoMgr::generate()
+{
+  if ( !menuBar() )
+    return;
 
+  QList<QLabel*> labels;
   for ( LogoList::const_iterator it = myLogos.begin(); it != myLogos.end(); ++it )
   {
     QPixmap pix = (*it).pix;
-    if ( !pix.mask() )
+    QMovie* mov = (*it).mov;
+    if ( !pix.isNull() && !pix.mask() )
     {
-      QImage img = pix.convertToImage();
       QBitmap bm;
-      if ( img.hasAlphaBuffer() )
-        bm = img.createAlphaMask();
+      QImage img = pix.toImage();
+      if ( img.hasAlphaChannel() )
+        bm = QPixmap::fromImage( img.createAlphaMask() );
       else
-        bm = img.createHeuristicMask();
+        bm = QPixmap::fromImage( img.createHeuristicMask() );
       pix.setMask( bm );
     }
 
-    QLabel* logoLab = new QLabel( cnt );
-    logoLab->setPixmap( (*it).pix );
+    QLabel* logoLab = new QLabel( myBox );
+    if ( mov )
+      logoLab->setMovie( mov );
+    else
+    {
+      logoLab->setPixmap( (*it).pix );
+//      if ( !pix.mask().isNull() )
+//         logoLab->setMask( pix.mask() );
+    }
+
     logoLab->setScaledContents( false );
-    logoLab->setAlignment( QLabel::AlignCenter ); 
+    logoLab->setAlignment( Qt::AlignCenter );
 
-    if ( pix.mask() )
-         logoLab->setMask( *pix.mask() );
+    labels.append( logoLab );
   }
 
-  QApplication::sendPostedEvents( cnt, QEvent::ChildInserted );
-  cnt->addSpacing( 2 );
-
-  myId = menuBar()->insertItem( cnt );
-
-  QApplication::sendPostedEvents( menuBar()->parentWidget(), QEvent::LayoutHint );
-  QApplication::postEvent( menuBar()->parentWidget(), new QEvent( QEvent::LayoutHint ) );
+  myBox->setLabels( labels );
 }
 
 /*!
-  \return index of found logo
-  \param id - logo id
+  \brief Search the logo by the specified \a id.
+  \param id logo identifier
+  \return index of logo or -1 if not found
 */
 int QtxLogoMgr::find( const QString& id ) const
 {
   int idx = -1;
-  for ( uint i = 0; i < myLogos.count() && idx < 0; i++ )
+  for ( int i = 0; i < myLogos.count() && idx < 0; i++ )
   {
-    if ( (*myLogos.at( i ) ).id == id )
+    if ( myLogos.at( i ).id == id )
       idx = i;
   }
   return idx;
 }
+
+/*!
+  \brief Get movie logos by specified \a id.
+
+  If \a id is empty, all movie logos are returned.
+
+  \param id logo identifier
+  \param lst list of movies, which satisfy the \a id
+*/
+void QtxLogoMgr::movies( const QString& id, QList<QMovie*>& lst ) const
+{
+  lst.clear();
+  for ( LogoList::const_iterator it = myLogos.begin(); it != myLogos.end(); ++it )
+  {
+    if ( (*it).mov && ( id.isEmpty() || id == (*it).id ) )
+      lst.append( (*it).mov );
+  }
+}
index 7e0615c825911a776a795aa764674be433716a9b..2aa6941e251be3512dcec962d0348debc3068b57 100644 (file)
@@ -1,30 +1,38 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#ifndef QTX_LOGOMGR_H
-#define QTX_LOGOMGR_H
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxLogoMgr.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXLOGOMGR_H
+#define QTXLOGOMGR_H
 
 #include "Qtx.h"
 
-class QMenuBar;
+#include <QObject>
+#include <QList>
+#include <QPixmap>
 
-#include <qobject.h>
-#include <qpixmap.h>
+class QMenuBar;
+class QMovie;
 
 #ifdef WIN32
 #pragma warning( disable : 4251 )
@@ -34,34 +42,42 @@ class QTX_EXPORT QtxLogoMgr : public QObject
 {
   Q_OBJECT
 
+  class LogoBox;
+
 public:
   QtxLogoMgr( QMenuBar* );
   virtual ~QtxLogoMgr();
 
   int        count() const;
 
+  void       insert( const QString&, QMovie*, const int = -1 );
   void       insert( const QString&, const QPixmap&, const int = -1 );
   void       remove( const QString& );
   void       clear();
 
+  void       startAnimation( const QString& = QString() );
+  void       stopAnimation( const QString& = QString() );
+  void       pauseAnimation( const bool, const QString& = QString() );
+
   QMenuBar*  menuBar() const;
 
 private:
-  void       generate();
-  int        find( const QString& ) const;
+  typedef struct { QString id; QPixmap pix; QMovie* mov; } LogoInfo;
+  typedef QList<LogoInfo>                                  LogoList;
 
 private:
-  typedef struct { QString id; QPixmap pix; } LogoInfo;
-  typedef QValueList<LogoInfo>                LogoList;
+  void       generate();
+  int        find( const QString& ) const;
+  LogoInfo&  insert( const QString&, const int );
+  void       movies( const QString&, QList<QMovie*>& ) const;
 
 private:
-  int        myId;
-  QMenuBar*  myMenus;
-  LogoList   myLogos;
+  LogoBox*   myBox;         //!< widget containing logox
+  LogoList   myLogos;       //!< list of logo data
 };
 
 #ifdef WIN32
 #pragma warning( default : 4251 )
 #endif
 
-#endif
+#endif // QTXLOGOMGR_H
index eea0be25ab086d3893a5f042cc841abeae07aafc..d6f6f3d11f7972467e2ede927e7fccebb733948f 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxMRUAction.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxMRUAction.h"
 
 #include "QtxResourceMgr.h"
 
-#include <qpopupmenu.h>
+#include <QMenu>
+#include <QIcon>
 
 /*!
-       Name: QtxMRUAction [public]
-       Desc: Constructs an MRU action with given parent and name.
+  \class QtxMRUAction
+  \brief Menu action which provides most recent used items support.
 */
 
-QtxMRUAction::QtxMRUAction( QObject* parent, const char* name )
-: QtxAction( "Most Recently Used", "Most Recently Used", 0, parent, name ),
-myVisCount( 5 ),
-myPopupMode( SubMenu ),
-myInsertMode( MoveFirst )
+/*!
+  \brief Constructor.
+  \param parent parent object
+*/
+QtxMRUAction::QtxMRUAction( QObject* parent )
+: QtxAction( tr( "Most Recently Used" ), tr( "Most Recently Used" ), 0, parent ),
+  myVisCount( 5 ),
+  myHistoryCount( -1 ),
+  myLinkType( LinkAuto ),
+  myInsertMode( MoveFirst )
 {
+  myClear = new QAction( tr( "Clear" ), this );
+  myClear->setVisible( false );
+
+  setMenu( new QMenu( 0 ) );
+
+  connect( menu(), SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
+  connect( myClear, SIGNAL( triggered( bool ) ), this, SLOT( onCleared( bool ) ) );
 }
 
 /*!
-       Name: QtxMRUAction [public]
-       Desc: This constructor creates an action with the following properties: the
-                   description text, the menu text and.  It is a child of given parent and
-        named specified name.
+  \brief Constructor.
+  \param description (tooltip) text
+  \param menuText menu text
+  \param parent parent object
 */
-
-QtxMRUAction::QtxMRUAction( const QString& text, const QString& menuText, QObject* parent, const char* name )
-: QtxAction( text, menuText, 0, parent, name ),
-myVisCount( 5 ),
-myPopupMode( SubMenu ),
-myInsertMode( MoveFirst )
+QtxMRUAction::QtxMRUAction( const QString& text, const QString& menuText, QObject* parent )
+: QtxAction( text, menuText, 0, parent ),
+  myVisCount( 5 ),
+  myHistoryCount( -1 ),
+  myLinkType( LinkAuto ),
+  myInsertMode( MoveFirst )
 {
+  myClear = new QAction( tr( "Clear" ), this );
+  myClear->setVisible( false );
+
+  setMenu( new QMenu( 0 ) );
+  connect( menu(), SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
+  connect( myClear, SIGNAL( triggered( bool ) ), this, SLOT( onCleared( bool ) ) );
 }
 
 /*!
-       Name: QtxMRUAction [public]
-       Desc: This constructor creates an action with the following properties: the
-                   description text, the menu text, the icon or iconset icon and keyboard
-        accelerator. It is a child of given parent and named specified name.
+  \brief Constructor.
+  \param description (tooltip) text
+  \param icon action icon
+  \param menuText menu text
+  \param parent parent object
 */
-
-QtxMRUAction::QtxMRUAction( const QString& text, const QIconSet& icon, const QString& menuText, QObject* parent, const char* name )
-: QtxAction( text, icon, menuText, 0, parent, name ),
-myVisCount( 5 ),
-myPopupMode( SubMenu ),
-myInsertMode( MoveFirst )
+QtxMRUAction::QtxMRUAction( const QString& text, const QIcon& icon,
+                            const QString& menuText, QObject* parent )
+: QtxAction( text, icon, menuText, 0, parent ),
+  myVisCount( 5 ),
+  myHistoryCount( -1 ),
+  myLinkType( LinkAuto ),
+  myInsertMode( MoveFirst )
 {
+  myClear = new QAction( tr( "Clear" ), this );
+  myClear->setVisible( false );
+
+  setMenu( new QMenu( 0 ) );
+  connect( menu(), SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
+  connect( myClear, SIGNAL( triggered( bool ) ), this, SLOT( onCleared( bool ) ) );
 }
 
 /*!
-       Name: ~QtxMRUAction [public]
-       Desc: This destructor removes all added popup items.
+  \brief Destructor.
 */
-
 QtxMRUAction::~QtxMRUAction()
 {
-  for ( ItemsMap::ConstIterator iIt = myItems.begin(); iIt != myItems.end(); ++iIt )
-    removeFrom( iIt.key() );
-
-  for ( MenusMap::ConstIterator mIt = myMenus.begin(); mIt != myMenus.end(); ++mIt )
-    removeFrom( mIt.key() );
+  delete menu();
 }
 
 /*!
-       Name: insertMode [public]
-       Desc: Returns the insert mode.
+  \brief Get items insertion policy.
+  \return insertion policy (QtxMRUAction::InsertionMode)
 */
-
 int QtxMRUAction::insertMode() const
 {
   return myInsertMode;
 }
 
 /*!
-       Name: setInsertMode [public]
-       Desc: Returns the insert mode. Can be following values:
-      MoveFirst - place the specified link to the first position in any case
-      MoveLast  - place the specified link to the last position in any case
-      AddFirst  - if inserted link doesn't exist then add to the first position
-      AddLast   - if inserted link doesn't exist then add to the lase position
+  \brief Set items insertion policy.
+  \param mode insertion policy (QtxMRUAction::InsertionMode)
 */
-
 void QtxMRUAction::setInsertMode( const int mode )
 {
   myInsertMode = mode;
 }
 
 /*!
-       Name: popupMode [public]
-       Desc: Returns the popup mode.
+  \brief Get the type of link menu name.
+  \return link type (QtxMRUAction::LinkType)
 */
-
-int QtxMRUAction::popupMode() const
+int QtxMRUAction::linkType() const
 {
-  return myPopupMode;
+  return myLinkType;
 }
 
 /*!
-       Name: setPopupMode [public]
-       Desc: Set the popup mode. If this mode is 'Items' then method "addTo" creates the
-        items in the specified popup menu.  If mode is 'SubMenu' then items will be
-        create in sub popup menu which will be placed in specified popup.
+  \brief Set the type of link menu name.
+  \param link type (QtxMRUAction::LinkType)
 */
-
-void QtxMRUAction::setPopupMode( const int mode )
+void QtxMRUAction::setLinkType( const int type )
 {
-  myPopupMode = mode;
+  myLinkType = type;
 }
 
 /*!
-       Name: count [public]
-       Desc: Returns the number of links.
+  \brief Get number of MRU items.
+  \return number of MRU items
 */
-
 int QtxMRUAction::count() const
 {
   return myLinks.count();
 }
 
 /*!
-       Name: isEmpty [public]
-       Desc: Returns 'true' if there is no links.
+  \brief Check if the MRU items list is empty.
+  \return \c true if there are no MRU items
 */
-
 bool QtxMRUAction::isEmpty() const
 {
   return myLinks.isEmpty();
 }
 
 /*!
-       Name: visibleCount [public]
-       Desc: Returns the number of first links which will be added to popup menu.
-        If 'visibleCount' less than 1 then all links will be used.
+  \brief Get number of visible MRU items.
+  \return visible MRU items number
+  \sa setVisibleCount()
 */
-
 int QtxMRUAction::visibleCount() const
 {
   return myVisCount;
 }
 
 /*!
-       Name: setVisibleCount [public]
-       Desc: Sets the number of links which will be used in popup menu.
-*/
+  \brief Set number of visible MRU items.
+
+  This method sets the maximum number of MRU items
+  to be displayed in the popup menu (5 by default).
+
+  If \a num < 1, then all MRU items will be displayed.
 
+  \param num visible MRU items number
+*/
 void QtxMRUAction::setVisibleCount( int num )
 {
   if ( myVisCount == num )
     return;
 
   myVisCount = num;
+}
+
+/*!
+  \brief Return visible status of the menu item which clear all MRU items.
+*/
+bool QtxMRUAction::isClearPossible() const
+{
+  return myClear->isVisible();
+}
+
+/*!
+  \brief Set visible the menu item which clear all MRU items.
+*/
+void QtxMRUAction::setClearPossible( const bool on )
+{
+  myClear->setVisible( on );
+}
 
-  updateState();
+/*!
+  \brief Get number of totally stored MRU items.
+  \return number of MRU items stored in the preferences
+  \sa setHistoryCount(), saveLinks(), loadLinks()
+*/
+int QtxMRUAction::historyCount() const
+{
+  return myHistoryCount;
 }
 
 /*!
-       Name: insert [public]
-       Desc: Insert the link according to the insert mode.
+  \brief Set number of totally stored MRU items.
+
+  This option allows setting number of MRU items to be stored
+  in the preferences file.
+
+  If \a num < 0, then number of stored MRU items is not limited.
+
+  \return number of MRU items stored in the preferences
+  \sa historyCount(), saveLinks(), loadLinks()
 */
+void QtxMRUAction::setHistoryCount( const int num )
+{
+  myHistoryCount = num;
+}
+
+/*!
+  \brief Insert MRU item.
+
+  The item is inserted according to the current insertion policy.
 
+  \param link MRU item to be added
+*/
 void QtxMRUAction::insert( const QString& link )
 {
   if ( myLinks.contains( link ) && ( insertMode() == AddFirst || insertMode() == AddLast ) )
     return;
 
-  myLinks.remove( link );
+  myLinks.removeAll( link );
 
   switch ( insertMode() )
   {
@@ -197,41 +255,48 @@ void QtxMRUAction::insert( const QString& link )
     myLinks.append( link );
     break;
   }
-
-  updateState();
 }
 
 /*!
-       Name: remove [public]
-       Desc: Removes link with specified index.
-*/
+  \brief Remove MRU item.
+
+  Does nothing if \a idx is out of range.
 
+  \param idx MRU item index
+*/
 void QtxMRUAction::remove( const int idx )
 {
   if ( idx < 0 || idx >= (int)myLinks.count() )
     return;
 
-  myLinks.remove( myLinks.at( idx ) );
-
-  updateState();
+  myLinks.removeAt( idx );
 }
 
 /*!
-       Name: remove [public]
-       Desc: Removes specified link.
-*/
+  \brief Remove MRU item.
 
+  Does nothing if there is no speicified item in the list.
+
+  \param link MRU item to be removed
+*/
 void QtxMRUAction::remove( const QString& link )
 {
-  if ( myLinks.remove( link ) )
-    updateState();
+  myLinks.removeAll( link );
 }
 
 /*!
-       Name: item [public]
-       Desc: Returns the link with specified index.
+  \brief Remove all MRU items.
 */
+void QtxMRUAction::clear()
+{
+  myLinks.clear();
+}
 
+/*!
+  \brief Get MRU item
+  \param idx MRU item index
+  \return MRU item or null QString if \a idx is out of range
+*/
 QString QtxMRUAction::item( const int idx ) const
 {
   QString res;
@@ -241,127 +306,31 @@ QString QtxMRUAction::item( const int idx ) const
 }
 
 /*!
-       Name: find [public]
-       Desc: Find specified link. If link exists then returns index otherwise -1 returned.
+  \brief Get MRU item index.
+  \param link MRU item
+  \return MRU item index or -1 if item is not found
 */
-
 int QtxMRUAction::find( const QString& link ) const
 {
-  return myLinks.findIndex( link );
+  return myLinks.indexOf( link );
 }
 
 /*!
-       Name: contains [public]
-       Desc: Returns 'true' if given link exist.
+  \brief Check if MRU item is in the list.
+  \param link MRU item
+  \return \c true if specified item is already added to the list
 */
-
 bool QtxMRUAction::contains( const QString& link ) const
 {
   return myLinks.contains( link );
 }
 
 /*!
-       Name: addTo [public]
-       Desc: Add the MRU links to the end of specified popup according to the popup mode.
-*/
-
-bool QtxMRUAction::addTo( QWidget* wid )
-{
-  if ( !wid || !wid->inherits( "QPopupMenu" ) )
-    return false;
-
-  QPopupMenu* pm = (QPopupMenu*)wid;
-  checkPopup( pm );
-
-  int mode = popupMode();
-
-  if ( ( mode == Items && myItems.contains( pm ) ) ||
-       ( mode == SubMenu && myMenus.contains( pm ) ) )
-    return false;
-
-  bool exist = myItems.contains( pm ) || myMenus.contains( pm );
-
-  if ( mode == SubMenu && !QtxAction::addTo( wid ) )
-    return false;
-
-  if ( mode == Items )
-  {
-    myItems.insert( pm, Item() );
-    myItems[pm].pId = myItems[pm].nId -1;
-    connect( pm, SIGNAL( activated( int ) ), this, SLOT( onActivated( int ) ) );
-  }
-  else if ( mode == SubMenu )
-  {
-    myMenus.insert( pm, new QPopupMenu( pm ) );
-    setPopup( pm, pm->idAt( pm->count() - 1 ), myMenus[pm] );
-    connect( myMenus[pm], SIGNAL( activated( int ) ), this, SLOT( onActivated( int ) ) );
-  }
-
-  if ( !exist )
-  {
-    connect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
-    connect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
-  }
-
-  return insertLinks( pm, mode );
-}
-
-/*!
-       Name: addTo [public]
-       Desc: Add the MRU links to the specified popup at given index according to the popup mode.
-*/
-
-bool QtxMRUAction::addTo( QWidget* wid, const int idx )
-{
-  if ( !QtxAction::addTo( wid, idx ) )
-    return false;
-
-  QPopupMenu* pm = (QPopupMenu*)wid;
-
-  removeLinks( pm, popupMode() );
-  insertLinks( pm, popupMode(), idx );
-
-  return true;
-}
-
-/*!
-       Name: removeFrom [public]
-       Desc: Removes all MRU links from specified popup.
-*/
-
-bool QtxMRUAction::removeFrom( QWidget* wid )
-{
-  QtxAction::removeFrom( wid );
-
-  QPopupMenu* pm = (QPopupMenu*)wid;
-  if ( !wid || !wid->inherits( "QPopupMenu" ) )
-    return false;
-
-  if ( myItems.contains( pm ) )
-  {
-    removeLinks( pm, Items );
-    myItems.remove( pm );
-    disconnect( pm, SIGNAL( activated( int ) ), this, SLOT( onActivated( int ) ) );
-  }
-  if ( myMenus.contains( pm ) )
-  {
-    removeLinks( pm, SubMenu );
-    delete myMenus[pm];
-    myMenus.remove( pm );
-  }
-
-  disconnect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
-  disconnect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
-
-  return true;
-}
-
-/*!
-       Name: loadLinks [public]
-       Desc: Load the MRU links from specified resource manager section.
-        If parameter 'clear' is 'true' then link list will be cleared first.
+  \brief Load the MRU items from specified resources section.
+  \param resMgr resources manager
+  \param section resources section
+  \param clear if \c true, previous MRU items list is cleared
 */
-
 void QtxMRUAction::loadLinks( QtxResourceMgr* resMgr, const QString& section, const bool clear )
 {
   if ( !resMgr || section.isEmpty() )
@@ -382,281 +351,167 @@ void QtxMRUAction::loadLinks( QtxResourceMgr* resMgr, const QString& section, co
     if ( !(*it).startsWith( itemPrefix ) )
       continue;
 
-    QString link = resMgr->stringValue( section, *it, QString::null );
+    QString link = resMgr->stringValue( section, *it, QString() );
     if ( link.isEmpty() || map.contains( link ) )
       continue;
 
     myLinks.append( link );
     map.insert( link, 0 );
   }
-
-  updateState();
 }
 
 /*!
-       Name: saveLinks [public]
-       Desc: Save the MRU links into specified resource manager section.
-        If parameter 'clear' is 'true' then section will be cleared first.
+  \brief Save the MRU items to specified resources section.
+  \param resMgr resources manager
+  \param section resources section
+  \param clear if \c true, the resources section is first cleared
 */
-
 void QtxMRUAction::saveLinks( QtxResourceMgr* resMgr, const QString& section, const bool clear ) const
 {
   if ( !resMgr || section.isEmpty() )
     return;
 
-  if ( clear )
-    resMgr->remove( section );
+  QString itemPrefix( "item_" );
+
+  if ( clear ) {
+    QStringList items = resMgr->parameters( section );
+    for ( QStringList::const_iterator it = items.begin(); it != items.end(); ++it )
+    {
+      if ( (*it).startsWith( itemPrefix ) )
+       resMgr->remove( section, *it );
+    }
+  }
 
   QStringList lst;
   QMap<QString, int> map;
   for ( QStringList::const_iterator itr = myLinks.begin(); itr != myLinks.end(); ++itr )
-    map.insert( *lst.append( *itr ), 0 );
+  {
+    lst.append( *itr );
+    map.insert( *itr, 0 );
+  }
 
-  QString itemPrefix( "item_" );
   QStringList items = resMgr->parameters( section );
   for ( QStringList::const_iterator it = items.begin(); it != items.end(); ++it )
   {
     if ( !(*it).startsWith( itemPrefix ) )
       continue;
 
-    QString link = resMgr->stringValue( section, *it, QString::null );
+    QString link = resMgr->stringValue( section, *it, QString() );
     if ( !link.isEmpty() && !map.contains( link ) )
-      map.insert( *lst.append( link ), 0 );
+    {
+      lst.append( link );
+      map.insert( link, 0 );
+    }
 
     resMgr->remove( section, *it );
   }
 
   int counter = 0;
-  for ( QStringList::const_iterator iter = lst.begin(); iter != lst.end(); ++iter, counter++ )
+  for ( QStringList::const_iterator iter = lst.begin();
+       iter != lst.end() && ( myHistoryCount < 0 || counter < myHistoryCount );
+       ++iter, counter++ )
     resMgr->setValue( section, itemPrefix + QString().sprintf( "%03d", counter ), *iter );
 }
 
 /*!
-       Name: setEnabled [public slot]
-       Desc: Enable or disable all popup items with MRU links.
-*/
+  \brief Prepare MRU items popup menu.
 
-void QtxMRUAction::setEnabled( bool on )
-{
-  QtxAction::setEnabled( on );
-
-  for ( ItemsMap::ConstIterator iter = myItems.begin(); iter != myItems.end(); ++iter )
-    for ( QIntList::const_iterator it = iter.data().idList.begin(); it != iter.data().idList.end(); ++it )
-      iter.key()->setItemEnabled( *it, on );
-}
-
-/*!
-       Name: onAboutToShow [private slots]
-       Desc: Enable or disable sub menu item according to number of MRU links
-        in sub popup when parent popup is shown.
+  This method is called when the parent menu is shown.
+  Enables or disables sub menu item according to the number of MRU items.
 */
-
 void QtxMRUAction::onAboutToShow()
 {
-  const QObject* obj = sender();
-  if ( obj && obj->inherits( "QPopupMenu" ) )
-  {
-    QPopupMenu* pm = (QPopupMenu*)obj;
-    if ( myMenus.contains( pm ) )
-      pm->setItemEnabled( findId( pm, myMenus[pm]), isEnabled() && myMenus[pm] && myMenus[pm]->count() );
-  }
+  updateMenu();
 }
 
 /*!
-       Name: onActivated [private slot]
-       Desc: Process popup item activation and emit signal activated with selected MRU link.
-*/
+  \brief Called when any MRU item is selected by the user.
 
-void QtxMRUAction::onActivated( int id )
+  Emits signal activated(const QString&) passing selected MRU item as parameter.
+*/
+void QtxMRUAction::onActivated()
 {
-  const QObject* obj = sender();
-  if ( !obj->inherits( "QPopupMenu" ) )
+  QAction* a = ::qobject_cast<QAction*>( sender() );
+  if ( !a )
     return;
 
-  QPopupMenu* pm = (QPopupMenu*)obj;
-
-  QString link;
-  if ( ( myItems.contains( pm ) && myItems[pm].idList.contains( id ) ) ||
-       ( myMenus.contains( (QPopupMenu*)pm->parent() ) && myMenus[(QPopupMenu*)pm->parent()] == pm ) )
-    link = pm->text( id );
-
-  if ( !link.isEmpty() )
+  QString link = a->data().toString();
+  if ( !link.isEmpty() && myLinks.contains( link ) )
     emit activated( link );
 }
 
-/*!
-       Name: onDestroyed [private slot]
-       Desc: Removes deleted popup menu from internal data structures.
-*/
-
-void QtxMRUAction::onDestroyed( QObject* obj )
+void QtxMRUAction::onCleared( bool )
 {
-  if ( !obj )
-    return;
-
-  myItems.remove( (QPopupMenu*)obj );
-  myMenus.remove( (QPopupMenu*)obj );
+  clear();
 }
 
 /*!
-       Name: updateState [private]
-       Desc: Updates the state of all popup menus which contains MRU link items.
+  \brief Update MRU items popup menu.
 */
-
-void QtxMRUAction::updateState()
+void QtxMRUAction::updateMenu()
 {
-  for ( ItemsMap::ConstIterator iIt = myItems.begin(); iIt != myItems.end(); ++iIt )
-    updatePopup( iIt.key(), Items );
-
-  for ( MenusMap::ConstIterator mIt = myMenus.begin(); mIt != myMenus.end(); ++mIt )
-    updatePopup( mIt.key(), SubMenu );
-}
+  QMenu* pm = menu();
+  if ( !pm )
+    return;
 
-/*!
-       Name: checkPopup [private]
-       Desc: Check consistency the popup content and internal datas.
-        Synchronize internal data structures with popup content.
-*/
+  pm->clear();
 
-void QtxMRUAction::checkPopup( QPopupMenu* pm )
-{
-  if ( myItems.contains( pm ) )
-  {
-    bool found = true;
-    for ( QIntList::const_iterator it = myItems[pm].idList.begin(); it != myItems[pm].idList.end() && found; ++it )
-      found = pm->indexOf( *it ) != -1;
-    if ( !found )
-    {
-      removeLinks( pm, Items );
-      myItems.remove( pm );
-      disconnect( pm, SIGNAL( activated( int ) ), this, SLOT( onActivated( int ) ) );
-    }
-  }
-  if ( myMenus.contains( pm ) )
+  QStringList links;
+  QMap<QString, int> map;
+  int count = visibleCount() < 0 ? myLinks.count() : visibleCount();
+  int i = insertMode() == AddLast || insertMode() == MoveLast ? qMax( 0, myLinks.count()-count ) : 0;
+  for ( ; i < myLinks.count() && count > 0; ++i, count-- )
   {
-    int id = findId( pm, myMenus[pm] );
-    if ( id == -1 )
+    links.append( myLinks[i] );
+    if ( linkType() == LinkAuto )
     {
-      delete myMenus[pm];
-      myMenus.remove( pm );
+      QString shortName = Qtx::file( myLinks[i] );
+      if ( map.contains( shortName ) )
+       map[shortName]++;
+      else
+       map.insert( shortName, 0 );
     }
   }
 
-  if ( !myItems.contains( pm ) && !myMenus.contains( pm ) )
-    disconnect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
-}
-
-/*!
-       Name: updatePopup [private]
-       Desc: Updates the MRU link items state in the specified popup menu.
-*/
-
-void QtxMRUAction::updatePopup( QPopupMenu* pm, const int mode )
-{
-  if ( !pm )
-    return;
-
-  int idx = -1;
-  if ( mode == Items && myItems.contains( pm ) )
+  i = 1;
+  for ( QStringList::const_iterator it = links.begin(); it != links.end(); ++it, i++ )
   {
-    if ( !myItems[pm].idList.isEmpty() )
-      idx = pm->indexOf( myItems[pm].idList.first() );
-    else
+    QString linkName;
+    switch( linkType() )
     {
-      int pIdx = pm->indexOf( myItems[pm].pId );
-      int nIdx = pm->indexOf( myItems[pm].nId );
-      if ( pIdx != -1 )
-        idx = pIdx + 1;
-      else if ( nIdx != -1 )
-        idx = nIdx - 1;
+    case LinkAuto:
+      linkName = Qtx::file( *it );
+      if ( map.contains( linkName ) && map[linkName] )
+       linkName = *it;
+      break;
+    case LinkShort:
+      linkName = Qtx::file( *it );
+      break;
+    case LinkFull:
+    default:
+      linkName = *it;
+      break;
     }
-  }
-
-  removeLinks( pm, mode );
-  insertLinks( pm, mode, idx );
-}
-
-/*!
-       Name: removeLinks [private]
-       Desc: Removes MRU link items from specified popup.
-*/
 
-bool QtxMRUAction::removeLinks( QPopupMenu* pm, const int mode )
-{
-  if ( !pm )
-    return false;
+    if ( links.count() < 10 )
+      linkName = QString( "&%1 %2" ).arg( i ).arg( linkName );
 
-  if ( mode == SubMenu && myMenus.contains( pm ) )
-    myMenus[pm]->clear();
-  else if ( mode == Items && myItems.contains( pm ) )
-  {
-    for ( QIntList::const_iterator it = myItems[pm].idList.begin(); it != myItems[pm].idList.end(); ++it )
-      pm->removeItem( *it );
-    myItems[pm].idList.clear();
+    pm->addAction( linkName, this, SLOT( onActivated() ) )->setData( *it );
   }
 
-  return true;
-}
-
-/*!
-       Name: insertLinks [private]
-       Desc: Inserts MRU link items to the specified popup.
-*/
-
-bool QtxMRUAction::insertLinks( QPopupMenu* pm, const int mode, const int idx )
-{
-  if ( !pm )
-    return false;
+  if ( pm->isEmpty() )
+    pm->addAction( tr( "<Empty>" ) )->setEnabled( false );
 
-  int count = visibleCount() < 0 ? myLinks.count() : visibleCount();
-  bool isOn = isEnabled();
-  if ( mode == SubMenu && myMenus.contains( pm ) )
-  {
-    for ( QStringList::const_iterator it = myLinks.begin(); it != myLinks.end() && count > 0; ++it, count-- )
-    {
-      int id = myMenus[pm]->insertItem( *it, -1 );
-      myMenus[pm]->setItemEnabled( id, isOn );
-    }
-  }
-  else if ( mode == Items )
+  if ( isClearPossible() )
   {
-    QIntList ids;
-    int index = idx;
-    for ( QStringList::const_iterator it = myLinks.begin(); it != myLinks.end() && count > 0; ++it, count--  )
-    {
-      ids.append( pm->insertItem( *it, -1, index ) );
-      pm->setItemEnabled( ids.last(), isOn );
-      if ( index >= 0 )
-        index++;
-    }
-    myItems[pm].idList = ids;
-    if ( !myItems[pm].idList.isEmpty() )
-    {
-      myItems[pm].pId = pm->idAt( pm->indexOf( myItems[pm].idList.first() ) - 1 );
-      myItems[pm].nId = pm->idAt( pm->indexOf( myItems[pm].idList.first() ) + 1 );
-    }
+    pm->addSeparator();
+    pm->addAction( myClear );
+    myClear->setEnabled( !pm->isEmpty() );
   }
-  return true;
 }
 
 /*!
-       Name: findId [private]
-       Desc: Returns identificator of popup item which contains sub popup 'pm' in the popup 'cont'.
+  \fn void QtxMRUAction::activated( const QString& link );
+  \brief Emitted when user selects any MRU item in the menu.
+  \param link selected MRU item
 */
-
-int QtxMRUAction::findId( QPopupMenu* cont, QPopupMenu* pm ) const
-{
-  if ( !cont || !pm )
-    return -1;
-
-  int id = -1;
-
-  for ( int i = 0; i < (int)cont->count() && id == -1; i++ )
-  {
-    QMenuData* md = 0;
-    QMenuItem* item = cont->findItem( cont->idAt( i ), &md );
-    if ( item && md == cont && item->popup() == pm )
-      id = item->id();
-  }
-  return id;
-}
index 6325860f8144ef362ceccd57b1597efb9db6a54b..2611593d5ce07eabbba08077784ecf50a2c55345 100755 (executable)
@@ -1,33 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxMRUAction.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXMRUACTION_H
 #define QTXMRUACTION_H
 
 #include "QtxAction.h"
 
-#include <qmap.h>
-#include <qstringlist.h>
+#include <QStringList>
 
-class QPopupMenu;
 class QtxResourceMgr;
 
 #ifdef WIN32
@@ -38,23 +39,30 @@ class QTX_EXPORT QtxMRUAction : public QtxAction
 {
   Q_OBJECT
 
-  Q_PROPERTY( int visibleCount READ visibleCount WRITE setVisibleCount )
-
 public:
-  enum { Items, SubMenu };
-  enum { MoveFirst, MoveLast, AddFirst, AddLast };
+  //! Items insertion policy
+  typedef enum { MoveFirst,   //!< put the specified item to the beginning
+                MoveLast,    //!< put the specified item to the end
+                AddFirst,    //!< if specified item doesn't exist, add it to the beginning
+                AddLast      //!< if specified item doesn't exist, add it to the end
+  } InsertionMode;
+
+  typedef enum { LinkAuto,    //!< put the full path of link into the menu if link file names of severals link are same
+                LinkShort,   //!< put the only file name of link into the menu
+                LinkFull     //!< put the full path of link into the menu
+  } LinkType;
 
 public:
-  QtxMRUAction( QObject* = 0, const char* = 0 );
-  QtxMRUAction( const QString&, const QString&, QObject*, const char* = 0 );
-  QtxMRUAction( const QString&, const QIconSet&, const QString&, QObject*, const char* = 0 );
+  QtxMRUAction( QObject* = 0 );
+  QtxMRUAction( const QString&, const QString&, QObject* = 0 );
+  QtxMRUAction( const QString&, const QIcon&, const QString&, QObject* = 0 );
   virtual ~QtxMRUAction();
 
   int          insertMode() const;
   void         setInsertMode( const int );
 
-  int          popupMode() const;
-  void         setPopupMode( const int );
+  int          linkType() const;
+  void         setLinkType( const int );
 
   int          count() const;
   bool         isEmpty() const;
@@ -62,6 +70,12 @@ public:
   int          visibleCount() const;
   void         setVisibleCount( const int );
 
+  bool         isClearPossible() const;
+  void         setClearPossible( const bool );
+
+  int          historyCount() const;
+  void         setHistoryCount( const int );
+
   void         remove( const int );
   void         remove( const QString& );
   void         insert( const QString& );
@@ -70,46 +84,30 @@ public:
   int          find( const QString& ) const;
   bool         contains( const QString& ) const;
 
-  virtual bool addTo( QWidget* );
-  virtual bool addTo( QWidget*, const int );
-
-  virtual bool removeFrom( QWidget* );
-
   virtual void loadLinks( QtxResourceMgr*, const QString&, const bool = true );
   virtual void saveLinks( QtxResourceMgr*, const QString&, const bool = true ) const;
 
-signals:
-  void         activated( QString );
-
 public slots:
-  virtual void setEnabled( bool );
+  void         clear();
+
+signals:
+  void         activated( const QString& );
 
 private slots:
+  void         onActivated();
   void         onAboutToShow();
-  void         onActivated( int );
-  void         onDestroyed( QObject* );
-
-private:
-  void         updateState();
-  void         checkPopup( QPopupMenu* );
-  void         updatePopup( QPopupMenu*, const int );
-  bool         removeLinks( QPopupMenu*, const int );
-  bool         insertLinks( QPopupMenu*, const int, const int = -1 );
-
-  int          findId( QPopupMenu*, QPopupMenu* ) const;
+  void         onCleared( bool );
 
 private:
-  typedef struct { int pId, nId; QIntList idList; } Item;
-  typedef QMap<QPopupMenu*, Item>                   ItemsMap;
-  typedef QMap<QPopupMenu*, QPopupMenu*>            MenusMap;
+  void         updateMenu();
 
 private:
-  QStringList  myLinks;
-  ItemsMap     myItems;
-  MenusMap     myMenus;
-  int          myVisCount;
-  int          myPopupMode;
-  int          myInsertMode;
+  QStringList  myLinks;        //!< most recent used items
+  QAction*     myClear;        //!< clear item
+  int          myVisCount;     //!< number of visible MRU items
+  int          myHistoryCount; //!< number of stored MRU items
+  int          myLinkType;     //!< type of link names in menu
+  int          myInsertMode;   //!< items insertion policy
 };
 
 #endif
index 99f602bbb69824ff562c477f359ea94152ec29b7..ac0053e5bf841666d21f717a541a8e019105b803 100644 (file)
@@ -1,37 +1,43 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxMainWindow.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxMainWindow.h"
 
 #include "QtxToolBar.h"
 #include "QtxResourceMgr.h"
 
-#include <qlayout.h>
-#include <qmenubar.h>
-#include <qstatusbar.h>
-#include <qapplication.h>
+#include <QEvent>
+#include <QMenuBar>
+#include <QStatusBar>
+#include <QApplication>
+#include <QDesktopWidget>
 
 /*!
-    Class: QtxMainWindow::Filter [Internal]
-    Descr: Internal object with event filter for QtxMainWindow.
+  \class QtxMainWindow::Filter
+  \internal
+  \brief Internal object used to filter child removal events for 
+         specified widget from parent widget.
 */
 
 class QtxMainWindow::Filter : public QObject
@@ -43,30 +49,39 @@ public:
   virtual bool eventFilter( QObject*, QEvent* );
 
 private:
-  QMainWindow* myMain;
-  QWidget*     myWidget;
+  QMainWindow* myMain;      //!< parent main window
+  QWidget*     myWidget;    //!< widget being watched
 };
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param wid widget to be watched
+  \param mw parent main window
+  \param parent parent object (in terms of QObject)
 */
 QtxMainWindow::Filter::Filter( QWidget* wid, QtxMainWindow* mw, QObject* parent )
 : QObject( parent ),
-myMain( mw ),
-myWidget( wid )
+  myMain( mw ),
+  myWidget( wid )
 {
-  myMain->installEventFilter( this );
+  QApplication::instance()->installEventFilter( this );
 };
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxMainWindow::Filter::~Filter()
 {
 }
 
 /*!
-  Custom event filter
+  \brief Event filter.
+
+  Watches for the specified widget and prevents its removal from the
+  parent main window.
+
+  \param o recevier object
+  \param e event
 */
 bool QtxMainWindow::Filter::eventFilter( QObject* o, QEvent* e )
 {
@@ -77,21 +92,27 @@ bool QtxMainWindow::Filter::eventFilter( QObject* o, QEvent* e )
   return QObject::eventFilter( o, e );
 }
 
+
+/*!
+  \class QtxMainWindow
+  \brief Enhanced main window which supports dockable menubar and status bar
+         plus geometry saving/restoring.
+*/
+
 /*!
-    Class: QtxMainWindow [Public]
-    Descr: Main window with support of dockable menubar/status bar
-           and geometry store/retrieve.
+  \brief Constructor.
+  \param parent parent widget
+  \param f widget flags (Qt::WindowFlags)
 */
-QtxMainWindow::QtxMainWindow( QWidget* parent, const char* name, WFlags f )
-: QMainWindow( parent, name, f ),
-myMode( -1 ),
-myMenuBar( NULL ),
-myStatusBar( NULL )
+QtxMainWindow::QtxMainWindow( QWidget* parent, Qt::WindowFlags f )
+: QMainWindow( parent, f ),
+  myMenuBar( 0 ),
+  myStatusBar( 0 )
 {
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxMainWindow::~QtxMainWindow()
 {
@@ -100,16 +121,18 @@ QtxMainWindow::~QtxMainWindow()
 }
 
 /*!
-  \return true if menu bar exists
+  \brief Check if the menu bar is dockable.
+  \return \c true if dockable menu bar exists
 */
 bool QtxMainWindow::isDockableMenuBar() const
 {
-  return myMenuBar;
+  return myMenuBar != 0;
 }
 
 /*!
-  Creates or deletes menu bar
-  \param on - if it is true, then to create, otherwise - to delete
+  \brief Set menu bar dockable/undockable.
+  \param on if \c true, make menu bar dockable, otherwise 
+            make menu bar undockable
 */
 void QtxMainWindow::setDockableMenuBar( const bool on )
 {
@@ -122,38 +145,31 @@ void QtxMainWindow::setDockableMenuBar( const bool on )
 
   if ( on && !myMenuBar )
   {
-    mb->setCaption( tr( "Menu bar" ) );
-    QtxToolBar* dockMb = new QtxToolBar( true, this, "menu bar container" );
-    myMenuBar = dockMb;
+    myMenuBar = new QtxToolBar( true, this );
     new Filter( mb, this, myMenuBar );
-    dockMb->setWidget( mb );
-    dockMb->setNewLine( true );
-    dockMb->setStretchable( true );
-    dockMb->setResizeEnabled( false );
-
-    moveDockWindow( dockMb, DockTop );
-    setDockEnabled( dockMb, Left, false );
-    setDockEnabled( dockMb, Right, false );
+    myMenuBar->setObjectName( "menu_bar_container" );
+    myMenuBar->setWindowTitle( tr( "Menu bar" ) );
+    myMenuBar->addWidget( mb );
+    myMenuBar->setAllowedAreas( Qt::TopToolBarArea | Qt::BottomToolBarArea );
 
-    setAppropriate( dockMb, false );
+    addToolBarBreak( Qt::TopToolBarArea );
+    addToolBar( Qt::TopToolBarArea, myMenuBar );
+    addToolBarBreak( Qt::TopToolBarArea );
 
-    connect( dockMb, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+    connect( myMenuBar, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
   }
   else if ( !on && myMenuBar )
   {
-    mb->reparent( this, QPoint( 0, 0 ), mb->isVisibleTo( mb->parentWidget() ) );
+    setMenuBar( mb );
     disconnect( myMenuBar, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
     delete myMenuBar;
     myMenuBar = 0;
-    QChildEvent ce( QEvent::ChildRemoved, mb );
-    QApplication::sendEvent( this, &ce );
   }
-
-  setUpLayout();
 }
 
 /*!
-  \return true if status bar exists
+  \brief Check if the status bar is dockable.
+  \return \c true if dockable status bar exists
 */
 bool QtxMainWindow::isDockableStatusBar() const
 {
@@ -161,8 +177,9 @@ bool QtxMainWindow::isDockableStatusBar() const
 }
 
 /*!
-  Creates or deletes status bar
-  \param on - if it is true, then to create, otherwise - to delete
+  \brief Set status bar dockable/undockable.
+  \param on if \c true, make status bar dockable, otherwise 
+            make status bar undockable
 */
 void QtxMainWindow::setDockableStatusBar( const bool on )
 {
@@ -175,209 +192,205 @@ void QtxMainWindow::setDockableStatusBar( const bool on )
 
   if ( on && !myStatusBar )
   {
-    sb->setCaption( tr( "Status bar" ) );
-    QtxToolBar* dockSb = new QtxToolBar( true, this, "status bar container" );
-    myStatusBar = dockSb;
-    new Filter( sb, this, myStatusBar );
-    dockSb->setWidget( sb );
-    dockSb->setNewLine( true );
-    dockSb->setStretchable( true );
-    dockSb->setResizeEnabled( false );
     sb->setMinimumWidth( 250 );
-
     sb->setSizeGripEnabled( false );
+    myStatusBar = new QtxToolBar( true, this );
+    new Filter( sb, this, myStatusBar );
+    myStatusBar->setObjectName( "status_bar_container" );
+    myStatusBar->setWindowTitle( tr( "Status bar" ) );
+    myStatusBar->addWidget( sb );
+    myStatusBar->setAllowedAreas( Qt::TopToolBarArea | Qt::BottomToolBarArea );
 
-    moveDockWindow( dockSb, DockBottom );
-    setDockEnabled( dockSb, Left, false );
-    setDockEnabled( dockSb, Right, false );
-
-    setAppropriate( dockSb, false );
+    addToolBar( Qt::BottomToolBarArea, myStatusBar );
 
-    connect( dockSb, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+    connect( myStatusBar, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
   }
   else if ( !on && myStatusBar )
   {
-    sb->reparent( this, QPoint( 0, 0 ), sb->isVisibleTo( sb->parentWidget() ) );
+    setStatusBar( sb );
     disconnect( myStatusBar, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
     delete myStatusBar;
     myStatusBar = 0;
-    QChildEvent ce( QEvent::ChildRemoved, sb );
-    QApplication::sendEvent( this, &ce );
 
     sb->setSizeGripEnabled( true );
   }
-
-  setUpLayout();
 }
 
 /*!
-  Retrieve the geometry information from the specified resource manager section.
-  \param resMgr - instance of ersource manager
-  \param section - section name
+  \brief Dump main window geometry to the string.
+  \return string represenation of the window geometry
 */
-void QtxMainWindow::loadGeometry( QtxResourceMgr* resMgr, const QString& section )
+QString QtxMainWindow::storeGeometry() const
 {
-  QString sec = section.stripWhiteSpace();
-  if ( !resMgr || sec.isEmpty() )
-    return;
-
-  int winState = -1;
-  if ( !resMgr->value( sec, "state", winState ) )
-  {
-    QString stateStr;
-    if ( resMgr->value( sec, "state", stateStr ) )
-      winState = windowState( stateStr );
-  }
-
-  int win_w = resMgr->integerValue( sec, "width", width() );
-  int win_h = resMgr->integerValue( sec, "height", height() );
-
-  int winPosX = windowPosition( resMgr->stringValue( sec, QString( "pos_x" ), QString::null ) );
-  int winPosY = windowPosition( resMgr->stringValue( sec, QString( "pos_y" ), QString::null ) );
-
-  QWidget* desk = QApplication::desktop();
-
-  int win_x = 0;
-  if ( winPosX == WP_Absolute )
-    win_x = resMgr->integerValue( sec, "pos_x", x() );
-  else if ( desk )
-    win_x = relativeCoordinate( winPosX, desk->width(), win_w );
+  QRect frame = frameGeometry();
+  QRect screen = QApplication::desktop()->availableGeometry( this );
+
+  QString x;
+  if ( frame.left() == screen.left() )
+    x = QString( "+0" );
+  else if ( frame.right() == screen.right() )
+    x = QString( "-0" );
+  else
+    x = QString( "+%1" ).arg( frame.left() );
 
-  int win_y = 0;
-  if ( winPosX == WP_Absolute )
-    win_y = resMgr->integerValue( sec, "pos_y", y() );
-  else if ( desk )
-    win_y = relativeCoordinate( winPosY, desk->height(), win_h );
+  QString y;
+  if ( frame.top() == screen.top() )
+    y = QString( "+0" );
+  else if ( frame.bottom() == screen.bottom() )
+    y = QString( "-0" );
+  else
+    y = QString( "+%1" ).arg( frame.top() );
 
-  bool vis = isVisibleTo( parentWidget() );
+  QString geom = QString( "%1x%2%3%4" ).arg( width() ).arg( height() ).arg( x ).arg( y );
 
-  resize( win_w, win_h );
-  move( win_x, win_y );
+  QString state;
+  switch ( windowState() )
+  {
+  case Qt::WindowMaximized:
+    state = QString( "max" );
+    break;
+  case Qt::WindowMinimized:
+    state = QString( "min" );
+    break;
+  case Qt::WindowFullScreen:
+    state = QString( "full" );
+    break;
+  }
 
-  myMode = -1;
+  if ( !state.isEmpty() )
+    geom += QString( ":" ) + state;
 
-  if ( vis )
-    QApplication::postEvent( this, new QCustomEvent( QEvent::User, (void*)winState ) );
-  else
-    myMode = winState;
+  return geom;
 }
 
 /*!
-  Shows main window
+  \brief Restore main window geometry from the string.
+  \param str string represenation of the window geometry
 */
-void QtxMainWindow::show()
+void QtxMainWindow::retrieveGeometry( const QString& str )
 {
-  if ( myMode != -1 )
-    QApplication::postEvent( this, new QCustomEvent( QEvent::User, (void*)myMode ) );
-
-  myMode = -1;
+  QString geom = str;
+  geom.remove( '\t' );
+  geom.remove( ' ' );
 
-  QMainWindow::show();
-}
+  QRect rect = geometry();
+  QRect screen = QApplication::desktop()->availableGeometry( this );
 
-/*!
-  Handler of custom events
-*/
-void QtxMainWindow::customEvent( QCustomEvent* e )
-{
-  QMainWindow::customEvent( e );
-
-  size_t mode = size_t(e->data());
-  switch ( mode )
+  QRegExp szRx( "(\\d+%?)\\s*x\\s*(\\d+%?)" );
+  if ( szRx.indexIn( geom ) != -1 )
   {
-  case WS_Normal:
-    showNormal();
-    break;
-  case WS_Minimized:
-    showMinimized();
-    break;
-  case WS_Maximized:
-    showMaximized();
-    break;
+    int w = -1;
+    bool wp = false;
+    int ws = geometryValue( szRx.cap( 1 ).trimmed(), w, wp );
+    bool wOk = ws != 0;
+    if ( wOk && wp )
+      w = screen.width() * qMax( qMin( w, 100 ), 0 ) / 100;
+    wOk = wOk && w;
+
+    int h = -1;
+    bool hp = false;
+    int hs = geometryValue( szRx.cap( 2 ).trimmed(), h, hp );
+    bool hOk = hs != 0;
+    if ( hOk && hp )
+      h = screen.height() * qMax( qMin( h, 100 ), 0 ) / 100;
+    hOk = hOk && h;
+
+    if ( wOk && hOk )
+      rect.setSize( QSize( w, h ) );
   }
-}
 
-/*!
-  \return relative co-ordinate by two points
-  \param type - type of result: WP_Center (center), WP_Left (left), WP_Right (right)
-  \param wh - left point
-  \param WH - right point
-*/
-int QtxMainWindow::relativeCoordinate( const int type, const int WH, const int wh ) const
-{
-  int res = 0;
-  switch ( type )
+  QRegExp posRx( "([+|-]\\d+%?)\\s*([+|-]\\d+%?)" );
+  if ( posRx.indexIn( geom ) != -1 )
   {
-  case WP_Center:
-    res = ( WH - wh ) / 2;
-    break;
-  case WP_Left:
-    res = 0;
-    break;
-  case WP_Right:
-    res = WH - wh;
-    break;
+    int x = -1;
+    bool xp = false;
+    int xs = geometryValue( posRx.cap( 1 ).trimmed(), x, xp );
+    bool xOk = xs != 0;
+    if ( xOk )
+    {
+      if ( xp )
+       x = screen.width() * qMax( qMin( x, 100 ), 0 ) / 100;
+      x = ( xs > 0 ? x : screen.right() - x - rect.width() ) + frameGeometry().x() - geometry().x();
+    }
+
+    int y = -1;
+    bool yp = false;
+    int ys = geometryValue( posRx.cap( 2 ).trimmed(), y, yp );
+    bool yOk = ys != 0;
+    if ( yOk )
+    {
+      if ( yp )
+       y = screen.height() * qMax( qMin( y, 100 ), 0 ) / 100;
+      y = ( ys > 0 ? y : screen.bottom() - y - rect.height() ) + frameGeometry().y() - geometry().y();
+    }
+
+    if ( xOk && yOk )
+      rect.moveTo( x, y );
   }
-  return res;
-}
 
-/*!
-  Store the geometry information into the specified resource manager section.
-  \param resMgr - instance of ersource manager
-  \param section - section name
-*/
-void QtxMainWindow::saveGeometry( QtxResourceMgr* resMgr, const QString& section ) const
-{
-  QString sec = section.stripWhiteSpace();
-  if ( !resMgr || sec.isEmpty() )
-    return;
+  Qt::WindowState state = Qt::WindowNoState;
 
-  resMgr->setValue( sec, "pos_x", pos().x() );
-  resMgr->setValue( sec, "pos_y", pos().y() );
-  resMgr->setValue( sec, "width", width() );
-  resMgr->setValue( sec, "height", height() );
+  QRegExp stRx( ":(\\w+)" );
+  if ( stRx.indexIn( geom ) != -1 )
+  {
+    QString stStr = stRx.cap( 1 ).trimmed().toLower();
+    if ( stStr.startsWith( QString( "max" ) ) )
+      state = Qt::WindowMaximized;
+    else if ( stStr.startsWith( QString( "min" ) ) )
+      state = Qt::WindowMinimized;
+    else if ( stStr.startsWith( QString( "full" ) ) )
+      state = Qt::WindowFullScreen;
+  }
 
-  int winState = WS_Normal;
-  if ( isMinimized() )
-    winState = WS_Minimized;
-  else if ( isMaximized() )
-    winState = WS_Maximized;
+  resize( rect.size() );
+  move( rect.topLeft() );
 
-  resMgr->setValue( sec, "state", winState );
+  if ( state != Qt::WindowNoState )
+    setWindowState( state );
 }
 
 /*!
-  Custom event filter
+  \brief Retrieve numerical value from the string.
+  
+  Numerical value in the string have the structure [+|-]\d*[%],
+  that is one or more digits which can start from "+" or "-" and
+  can end with "%" symbol.
+
+  \param str string being converted
+  \param num returning value (> 0)
+  \param percent if string ends with "%" this parameter is equal to \c true after
+         returning from the function
+  \return -1 if value < 0, 1 if value > 0 and 0 in case of error
 */
-bool QtxMainWindow::eventFilter( QObject* o, QEvent* e )
+int QtxMainWindow::geometryValue( const QString& str, int& num, bool& percent ) const
 {
-  return QMainWindow::eventFilter( o, e );
-}
+  num = -1;
+  int res = 1;
+  QString numStr = str;
+  if ( numStr.startsWith( "+" ) || numStr.startsWith( "-" ) )
+  {
+    res = numStr.startsWith( "+" ) ? 1 : -1;
+    numStr = numStr.mid( 1 );
+  }
 
-/*!
-  Controls whether or not the dw dock window's caption should appear
-  as a menu item on the dock window menu that lists the dock windows.
-  \param dw - window
-  \param a - if it is true, then it appears in menu
-*/
-void QtxMainWindow::setAppropriate( QDockWindow* dw, bool a )
-{
-  QMainWindow::setAppropriate( dw, myStatusBar != dw && myMenuBar != dw && a );
-}
+  percent = numStr.endsWith( "%" );
+  if ( percent )
+    numStr = numStr.mid( 0, numStr.length() - 1 );
 
-/*!
-  Sets up layout
-*/
-void QtxMainWindow::setUpLayout()
-{
-  QMainWindow::setUpLayout();
+  bool ok = false;
+  num = numStr.toInt( &ok );
+  if ( !ok )
+    res = 0;
 
-  if ( myMenuBar && layout() )
-    layout()->setMenuBar( 0 );
+  return res;
 }
 
 /*!
-  SLOT: called on object destroyed, clears internal fields in case of deletion of menu bar or status bar
+  \brief Called when child object (menu bar, status bar) is destroyed.
+  
+  Clears internal pointer to prevent crashes.
+
+  \param obj signal sender (object being destroyed)
 */
 void QtxMainWindow::onDestroyed( QObject* obj )
 {
@@ -400,54 +413,3 @@ void QtxMainWindow::onDestroyed( QObject* obj )
   }
 }
 
-/*!
-  \return flag of window state by it's name
-  \param str - name of flag
-*/
-int QtxMainWindow::windowState( const QString& str ) const
-{
-  static QMap<QString, int> winStateMap;
-  if ( winStateMap.isEmpty() )
-  {
-    winStateMap["normal"]    = WS_Normal;
-    winStateMap["min"]       = WS_Minimized;
-    winStateMap["mini"]      = WS_Minimized;
-    winStateMap["minimized"] = WS_Minimized;
-    winStateMap["max"]       = WS_Maximized;
-    winStateMap["maxi"]      = WS_Maximized;
-    winStateMap["maximized"] = WS_Maximized;
-    winStateMap["hidden"]    = WS_Hidden;
-    winStateMap["hided"]     = WS_Hidden;
-    winStateMap["hide"]      = WS_Hidden;
-    winStateMap["invisible"] = WS_Hidden;
-  }
-
-  int res = -1;
-  QString stateStr = str.stripWhiteSpace().lower();
-  if ( winStateMap.contains( stateStr ) )
-    res = winStateMap[stateStr];
-  return res;
-}
-
-/*!
-  \return flag of position by it's name
-  \param str - name of position
-*/
-int QtxMainWindow::windowPosition( const QString& str ) const
-{
-  static QMap<QString, int> winPosMap;
-  if ( winPosMap.isEmpty() )
-  {
-    winPosMap["center"] = WP_Center;
-    winPosMap["left"]   = WP_Left;
-    winPosMap["right"]  = WP_Right;
-    winPosMap["top"]    = WP_Top;
-    winPosMap["bottom"] = WP_Bottom;
-  }
-
-  int res = WP_Absolute;
-  QString posStr = str.stripWhiteSpace().lower();
-  if ( winPosMap.contains( posStr ) )
-    res = winPosMap[posStr];
-  return res;
-}
index ee779aefd3b33820888a34322013bec3c335645b..a77e9959a0e96d5851793587b4a45649bb2fa8b9 100644 (file)
@@ -1,32 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxMainWindow.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXMAINWINDOW_H
 #define QTXMAINWINDOW_H
 
 #include "Qtx.h"
 
-#include <qmainwindow.h>
+#include <QMainWindow>
 
-class QDockWindow;
 class QtxResourceMgr;
 
 class QTX_EXPORT QtxMainWindow : public QMainWindow
@@ -35,11 +37,8 @@ class QTX_EXPORT QtxMainWindow : public QMainWindow
 
   class Filter;
 
-  enum { WS_Normal, WS_Minimized, WS_Maximized, WS_Hidden };
-  enum { WP_Absolute, WP_Center, WP_Left, WP_Right, WP_Top = WP_Left, WP_Bottom = WP_Right };
-
 public:
-  QtxMainWindow( QWidget* = 0, const char* = 0, WFlags = WType_TopLevel );
+  QtxMainWindow( QWidget* = 0, Qt::WindowFlags = 0 );
   virtual ~QtxMainWindow();
 
   bool              isDockableMenuBar() const;
@@ -48,31 +47,18 @@ public:
   bool              isDockableStatusBar() const;
   void              setDockableStatusBar( const bool );
 
-  void              loadGeometry( QtxResourceMgr*, const QString& );
-  void              saveGeometry( QtxResourceMgr*, const QString& ) const;
-
-  virtual bool      eventFilter( QObject*, QEvent* );
-
-public slots:
-  virtual void      show();
-  virtual void      setAppropriate( QDockWindow*, bool );
-
-protected:
-  virtual void      setUpLayout();
-  virtual void      customEvent( QCustomEvent* );
+  QString           storeGeometry() const;
+  void              retrieveGeometry( const QString& );
 
 private slots:
   void              onDestroyed( QObject* );
 
 private:
-  int               windowState( const QString& ) const;
-  int               windowPosition( const QString& ) const;
-  int               relativeCoordinate( const int, const int, const int ) const;
+  int               geometryValue( const QString&, int&, bool& ) const;
 
 private:
-  int               myMode;
-  QDockWindow*      myMenuBar;
-  QDockWindow*      myStatusBar;
+  QToolBar*         myMenuBar;       //!< dockable menu bar
+  QToolBar*         myStatusBar;     //!< dockable status bar
 };
 
-#endif
+#endif // QTXMAINWINDOW_H
diff --git a/src/Qtx/QtxMap.h b/src/Qtx/QtxMap.h
new file mode 100644 (file)
index 0000000..6545f5f
--- /dev/null
@@ -0,0 +1,213 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : QtxMap.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef QTXMAP_H
+#define QTXMAP_H
+
+template <class Key, class Value> class IMap;
+template <class Key, class Value> class IMapIterator;
+template <class Key, class Value> class IMapConstIterator;
+
+/*!
+  \brief Indexed map template class.
+*/
+template <class Key, class Value> class IMap
+{
+public:
+  typedef IMapIterator<Key,Value>      Iterator;
+  typedef IMapConstIterator<Key,Value> ConstIterator;
+
+public:
+  IMap() {}
+  IMap( const IMap& m ) : myKeys( m.myKeys ), myData( m.myData ) {}
+  IMap& operator=( const IMap& m ) { myKeys = m.myKeys; myData = m.myData; return *this; }
+  
+  int  count() const   { return myData.count(); }
+  int  size() const    { return myData.count(); }
+  bool empty() const   { return myData.empty(); }
+  bool isEmpty() const { return myData.empty(); }
+  
+  void clear() { myKeys.clear(); myData.clear(); }
+  
+  QList<Key>   keys()   const { return myKeys; }
+  QList<Value> values() const { QList<Value> l; for ( int i = 0; i < count(); i++ ) l.append( value( i ) ); return l; }
+  bool         contains ( const Key& key ) const { return myData.contains( key ); }
+  
+  Iterator      begin()       { return Iterator( this );               }
+  Iterator      end()         { return Iterator( this, count() );      }
+  ConstIterator begin() const { return ConstIterator( this );          }
+  ConstIterator end() const   { return ConstIterator( this, count() ); }
+  
+  Iterator insert( const Key& key, const Value& value, bool overwrite = true )
+  { 
+    if ( myData.find( key ) == myData.end() || overwrite )
+    {
+      if ( myData.find( key ) != myData.end() && overwrite )
+        myKeys.removeAt( myKeys.indexOf( key ) );
+      myKeys.append( key );
+      myData[key] = value;
+    }
+    return Iterator( this, index( key ) );
+  }
+
+  Iterator replace( const Key& key, const Value& value )
+  { 
+    if ( myData.find( key ) == myData.end() )
+      myKeys.append( key );
+    myData[ key ] = value;
+    return Iterator( this, index( key ) );
+  }
+
+  int           index( const Key& key ) const { return myKeys.indexOf( key );      }
+  Iterator      at( const int index )         { return Iterator( this, index );      }
+  ConstIterator at( const int index ) const   { return ConstIterator( this, index ); }
+
+  Key& key( const int index )
+  {
+    if ( index < 0 || index >= (int)myKeys.count() ) 
+      return dummyKey;
+    return myKeys[index];
+  }
+
+  Value value( const int index )
+  {
+    if ( index < 0 || index >= (int)myKeys.count() ) 
+      return dummyValue;
+    return myData[ myKeys[index] ];
+  }
+
+  Value operator[]( const Key& key )
+  {
+    if ( myData.find( key ) == myData.end() )
+      insert( key, Value() );
+    return myData[ key ];
+  }
+
+  const Value operator[]( const Key& key ) const
+  {
+    if ( myData.find( key ) == myData.end() )
+      return dummyValue;
+    return myData[key];
+  }
+
+  void erase( Iterator it )     { remove( it );    }
+  void erase( const Key& key )  { remove( key );   }
+  void erase( const int index ) { remove( index ); }
+  void remove( Iterator it )    { if ( it.myMap != this ) return; remove( it.myIndex ); }
+  void remove( const Key& key ) { remove( index( key ) ); }
+  void remove( const int index )
+  {
+    if ( index >= 0 && index < (int)myKeys.count() )
+    {
+      myData.remove( myKeys[index] );
+      myKeys.removeAt( index );
+    }
+  }
+
+private:
+  QList<Key>      myKeys;
+  QMap<Key,Value> myData;
+  Key             dummyKey;
+  Value           dummyValue;
+
+  friend class IMapIterator<Key,Value>;
+  friend class IMapConstIterator<Key,Value>;
+};
+
+/*!
+  \brief Indexed map iterator template class.
+*/
+template <class Key, class Value> class IMapIterator
+{
+public:
+  IMapIterator()                           : myMap( 0 ), myIndex( 0 )                                   { init(); }
+  IMapIterator( const IMap<Key,Value>* m ) : myMap( const_cast< IMap<Key,Value>* >( m ) ), myIndex( 0 ) { init(); }
+  IMapIterator( const IMapIterator& i )    : myMap( i.myMap ), myIndex( i.myIndex )                     { init(); }
+
+  bool operator==( const IMapIterator& i ) { return !operator!=( i );                                   }
+  bool operator!=( const IMapIterator& i ) { return !myMap || myMap != i.myMap || myIndex != i.myIndex; }
+  
+  operator bool() const { return myIndex >= 0; }
+
+  const Key&   key() const  { return myMap->key( myIndex );   }
+  Value&       value()       { return myMap->value( myIndex ); }
+  const Value& value() const { return myMap->value( myIndex ); }
+
+  Value& operator*() { return value(); }
+
+  IMapIterator& operator++()      { myIndex++; init(); return *this;                     }
+  IMapIterator  operator++( int ) { IMapIterator i = *this; myIndex++; init(); return i; }
+  IMapIterator& operator--()      { myIndex--; init(); return *this;                     }
+  IMapIterator  operator--( int ) { IMapIterator i = *this; myIndex--; init(); return i; }
+
+private:
+  IMapIterator( const IMap<Key,Value>* m, const int index ) : myMap( const_cast< IMap<Key,Value>* >( m ) ), myIndex( index ) { init(); }
+  void init() { if ( !myMap || myIndex >= myMap->count() ) myIndex = -1; }
+
+private:
+  IMap<Key,Value>* myMap;
+  int              myIndex;
+
+  friend class IMap<Key, Value>;
+  friend class IMapConstIterator<Key, Value>;
+};
+
+/*!
+  \brief Indexed map const iterator template class.
+*/
+template <class Key, class Value> class IMapConstIterator
+{
+public:
+  IMapConstIterator()                                    : myMap( 0 ), myIndex( 0 )                                    { init(); }
+  IMapConstIterator( const IMap<Key,Value>* m )          : myMap( const_cast< IMap<Key,Value>* >( m )  ), myIndex( 0 ) { init(); }
+  IMapConstIterator( const IMapConstIterator& i )        : myMap( i.myMap ), myIndex( i.myIndex )                      { init(); }
+  IMapConstIterator( const IMapIterator<Key, Value>& i ) : myMap( i.myMap ), myIndex( i.myIndex )                      { init(); }
+  
+  bool operator==( const IMapConstIterator& i ) { return !operator!=( i );                                   }
+  bool operator!=( const IMapConstIterator& i ) { return !myMap || myMap != i.myMap || myIndex != i.myIndex; }
+  
+  operator bool() const { return myIndex >= 0; }
+  
+  const Key&   key() const  { return myMap->key( myIndex );   }
+  const Value value() const { return myMap->value( myIndex ); }
+  
+  const Value operator*() const { return value(); }
+
+  IMapConstIterator& operator++()      { myIndex++; init(); return *this;                          }
+  IMapConstIterator  operator++( int ) { IMapConstIterator i = *this; myIndex++; init(); return i; }
+  IMapConstIterator& operator--()      { myIndex--; init(); return *this;                          }
+  IMapConstIterator  operator--( int ) { IMapConstIterator i = *this; myIndex--; init(); return i; }
+  
+private:
+  IMapConstIterator( const IMap<Key,Value>* m, const int index ): myMap( const_cast< IMap<Key,Value>* >( m ) ), myIndex( index ) { init(); }
+  void init() { if ( !myMap || myIndex >= myMap->count() ) myIndex = -1; }
+  
+private:
+  IMap<Key,Value>* myMap;
+  int              myIndex;
+  
+  friend class IMap<Key,Value>;
+};
+
+#endif // QTXMAP_H
diff --git a/src/Qtx/QtxMenu.cxx b/src/Qtx/QtxMenu.cxx
new file mode 100644 (file)
index 0000000..6e146ef
--- /dev/null
@@ -0,0 +1,411 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxMenu.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxMenu.h"
+
+#include <QLabel>
+#include <QLayout>
+#include <QPainter>
+#include <QPaintEvent>
+#include <QTextDocument>
+#include <QWidgetAction>
+#include <QLinearGradient>
+#include <QAbstractTextDocumentLayout>
+
+/*!
+  \class QtxMenu::Title
+  \brief Popup menu title item.
+  \internal
+*/
+
+class QtxMenu::Title : public QWidget
+{
+public:
+  Title( QWidget* = 0 );
+  virtual ~Title();
+
+  QIcon            icon() const;
+  void             setIcon( const QIcon& );
+
+  QString          text() const;
+  void             setText( const QString& );
+
+  Qt::Alignment    alignment() const;
+  void             setAlignment( const Qt::Alignment );
+
+  virtual QSize    sizeHint() const;
+  virtual QSize    minimumSizeHint() const;
+
+protected:
+  virtual void     paintEvent( QPaintEvent* );
+
+private:
+  QIcon            myIcon;
+  QString          myText;
+  Qt::Alignment    myAlignment;
+};
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+  \internal
+*/
+QtxMenu::Title::Title( QWidget* parent )
+: QWidget( parent ),
+  myAlignment( 0 )
+{
+}
+
+/*!
+  \brief Destructor.
+  \internal
+*/
+QtxMenu::Title::~Title()
+{
+}
+
+/*!
+  \brief Get title icon.
+  \return title item icon
+  \internal
+*/
+QIcon QtxMenu::Title::icon() const
+{
+  return myIcon;
+}
+
+/*!
+  \brief Set title icon.
+  \param ico title item icon
+  \internal
+*/
+void QtxMenu::Title::setIcon( const QIcon& ico )
+{
+  myIcon = ico;
+}
+
+/*!
+  \brief Get title menu text.
+  \return menu text for the title item
+  \internal
+*/
+QString QtxMenu::Title::text() const
+{
+  return myText;
+}
+
+/*!
+  \brief Set title menu text.
+  \param txt menu text to be used for the title item
+  \internal
+*/
+void QtxMenu::Title::setText( const QString& txt )
+{
+  myText = txt;
+}
+
+/*!
+  \brief Get title alignment flags.
+  \return title alignment flags
+  \internal
+*/
+Qt::Alignment QtxMenu::Title::alignment() const
+{
+  return myAlignment;
+}
+
+/*!
+  \brief Set title alignment flags.
+  \param a title alignment flags
+  \internal
+*/
+void QtxMenu::Title::setAlignment( const Qt::Alignment a )
+{
+  myAlignment = a;
+}
+
+/*!
+  \brief Get recommended size for the title item widget.
+  \return title item widget size
+  \internal
+*/
+QSize QtxMenu::Title::sizeHint() const
+{
+  int m = 5;
+  QTextDocument doc;
+  doc.setHtml( text() );
+
+  QSize sz = icon().isNull() ? QSize( 0, 0 ) : icon().actualSize( QSize( 16, 16 ) );
+  sz.setWidth( 2 * m + sz.width() + (int)doc.size().width() );
+  sz.setHeight( 2 * m + qMax( sz.height(), (int)doc.size().height() ) );
+  return sz;
+}
+
+/*!
+  \brief Get recommended minimum size for the title item widget.
+  \return title item widget minimum size
+  \internal
+*/
+QSize QtxMenu::Title::minimumSizeHint() const
+{
+  return sizeHint();
+}
+
+/*!
+  \brief Paint the title item widget.
+  \param e paint event (not used)
+  \internal
+*/
+void QtxMenu::Title::paintEvent( QPaintEvent* /*e*/ )
+{
+  int m = 5;
+  QIcon ico = icon();
+  QString txt = text();
+  Qt::Alignment align = alignment();
+
+  QRect base = rect();
+  base.setTop( base.top() + 1 );
+  base.setLeft( base.left() + 1 );
+  base.setRight( base.right() -1 );
+  base.setBottom( base.bottom() - 1 );
+
+  QTextDocument doc;
+  doc.setHtml( txt );
+
+  QSize isz = ico.isNull() ? QSize( 0, 0 ) : ico.actualSize( QSize( 16, 16 ) );
+  QSize sz( (int)doc.size().width(), (int)doc.size().height() );
+
+  QPainter p( this );
+  QAbstractTextDocumentLayout::PaintContext ctx;
+  ctx.palette.setColor( QPalette::Text, palette().color( QPalette::Light ) );
+
+  QLinearGradient linearGrad( base.topLeft(), base.topRight() );
+  linearGrad.setColorAt( 0, palette().color( QPalette::Highlight ) );
+  linearGrad.setColorAt( 1, palette().color( QPalette::Window ) );
+
+  p.fillRect( base, linearGrad );
+
+  QPoint start = base.topLeft() + QPoint( m, m );
+  if ( align & Qt::AlignLeft )
+    start.setX( base.left() + m );
+  else if ( align & Qt::AlignRight )
+    start.setX( base.right() - m - isz.width() - sz.width() );
+  else if ( align & Qt::AlignHCenter )
+    start.setX( base.left() + ( base.width() - isz.width() - sz.width() ) / 2 );
+
+  if ( align & Qt::AlignTop )
+    start.setY( base.top() + m );
+  else if ( align & Qt::AlignBottom )
+    start.setY( base.bottom() - m - qMax( isz.height(), - sz.height() ) );
+  else if ( align & Qt::AlignVCenter )
+    start.setY( base.top() + ( base.height() - qMax( isz.height(), sz.height() ) ) / 2 );
+
+  if ( !ico.isNull() )
+  {
+    ico.paint( &p, QRect( start, isz ) );
+    start.setX( start.x() + isz.width() );
+  }
+
+  p.save();
+  p.translate( start );
+  doc.documentLayout()->draw( &p, ctx );
+  p.restore();
+}
+
+/*!
+  \class QtxMenu
+  \brief The class QtxMenu represents the popup menu with the title.
+
+  The title for the popup menu can be set via setTitleText() method.
+  In addition, title item can contain the icon, which can be set using
+  setTitleIcon() method. Current title text and icon can be retrieved with
+  titleText() and titleIcon() methods.
+
+  The title text alignment flags can be changed using setTitleAlignment()
+  method and retrieved with titleAlignment() method.
+
+  By default, QtxMenu::TitleAuto mode is used. In this mode, the title item
+  is shown only if it is not empty. To show title always (even empty), pass
+  QtxMenu::TitleOn to the setTitleMode() method. To hide the title, use 
+  setTitleMode() method with QtxMenu::TitleOff parameter.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+*/
+QtxMenu::QtxMenu( QWidget* parent )
+: QMenu( parent ),
+  myMode( TitleAuto )
+{
+  myTitle = new Title( this );
+  myAction = new QWidgetAction( this );
+  myAction->setDefaultWidget( myTitle );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxMenu::~QtxMenu()
+{
+}
+
+/*!
+  \brief Get title menu text.
+  \return menu text for the title item
+*/
+QString QtxMenu::titleText() const
+{
+  return myTitle->text();
+}
+
+/*!
+  \brief Get title icon.
+  \return title item icon
+*/
+QIcon QtxMenu::titleIcon() const
+{
+  return myTitle->icon();
+}
+
+/*!
+  \brief Get title item display mode.
+  \return popup menu title display mode (QtxMenu::TitleMode)
+*/
+QtxMenu::TitleMode QtxMenu::titleMode() const
+{
+  return myMode;
+}
+
+/*!
+  \brief Get title alignment flags.
+  \return title alignment flags
+*/
+Qt::Alignment QtxMenu::titleAlignment() const
+{
+  return myTitle->alignment();
+}
+
+/*!
+  \brief Set title menu text.
+  \param txt menu text to be used for the title item
+*/
+void QtxMenu::setTitleText( const QString& txt )
+{
+  if ( titleText() == txt )
+    return;
+
+  myTitle->setText( txt );
+
+  updateTitle();
+}
+
+/*!
+  \brief Set title icon.
+  \param ico title item icon
+*/
+void QtxMenu::setTitleIcon( const QIcon& ico )
+{
+  myTitle->setIcon( ico );
+
+  updateTitle();
+}
+
+/*!
+  \brief Set title item display mode.
+  \param m popup menu title display mode (QtxMenu::TitleMode)
+*/
+void QtxMenu::setTitleMode( const QtxMenu::TitleMode m )
+{
+  if ( myMode == m )
+    return;
+
+  myMode = m;
+
+  updateTitle();
+}
+
+/*!
+  \brief Set title alignment flags.
+  \param a title alignment flags
+*/
+void QtxMenu::setTitleAlignment( const Qt::Alignment a )
+{
+  if ( titleAlignment() == a )
+    return;
+
+  myTitle->setAlignment( a );
+
+  updateTitle();
+}
+
+/*!
+  \brief Customize show/hide menu operation.
+  \param on new popup menu visibility state
+*/
+void QtxMenu::setVisible( bool on )
+{
+  if ( on )
+    insertTitle();
+
+  QMenu::setVisible( on );
+
+  if ( !on )
+    removeTitle();
+}
+
+/*!
+  \brief Insert title item to the popup menu.
+*/
+void QtxMenu::insertTitle()
+{
+  if ( titleMode() == TitleOff || ( titleMode() == TitleAuto && titleText().trimmed().isEmpty() ) )
+    return;
+
+  if ( actions().isEmpty() )
+    addAction( myAction );
+  else
+    insertAction( actions().first(), myAction );
+}
+
+/*!
+  \brief Remove title item from the popup menu.
+*/
+void QtxMenu::removeTitle()
+{
+  if ( actions().contains( myAction ) )
+    removeAction( myAction );
+}
+
+/*!
+  \brief Update title item.
+*/
+void QtxMenu::updateTitle()
+{
+  if ( !actions().contains( myAction ) )
+    return;
+
+  removeTitle();
+  insertTitle();
+}
diff --git a/src/Qtx/QtxMenu.h b/src/Qtx/QtxMenu.h
new file mode 100644 (file)
index 0000000..a719802
--- /dev/null
@@ -0,0 +1,78 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxMenu.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXMENU_H
+#define QTXMENU_H
+
+#include "Qtx.h"
+
+#include <QMenu>
+
+class QWidgetAction;
+
+class QTX_EXPORT QtxMenu : public QMenu
+{
+  Q_OBJECT
+
+  class Title;
+
+public:
+  //! Popup menu title mode
+  typedef enum { 
+    TitleAuto,        //!< auto mode
+    TitleOn,          //!< always on (display title)
+    TitleOff          //!< always off (do not display title)
+  } TitleMode;
+
+public:
+  QtxMenu( QWidget* = 0 );
+  virtual ~QtxMenu();
+
+  QIcon                  titleIcon() const;
+  QString                titleText() const;
+
+  TitleMode              titleMode() const;
+  Qt::Alignment          titleAlignment() const;
+
+  virtual void           setTitleIcon( const QIcon& );
+  virtual void           setTitleText( const QString& );
+
+  virtual void           setTitleMode( const TitleMode );
+  virtual void           setTitleAlignment( const Qt::Alignment );
+
+public slots:
+  virtual void           setVisible( bool );
+
+private:
+  void                   updateTitle();
+  void                   insertTitle();
+  void                   removeTitle();
+
+private:
+  TitleMode              myMode;
+  Title*                 myTitle;
+  QWidgetAction*         myAction;
+};
+
+#endif // QTXMENU_H
diff --git a/src/Qtx/QtxMenuButton.cxx b/src/Qtx/QtxMenuButton.cxx
deleted file mode 100755 (executable)
index dc8abdd..0000000
+++ /dev/null
@@ -1,429 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxMenuButton.cxx
-// Author:    Sergey TELKOV
-
-#include "QtxMenuButton.h"
-
-#include <qstyle.h>
-#include <qpainter.h>
-#include <qpopupmenu.h>
-#include <qpointarray.h>
-#include <qapplication.h>
-
-class QtxMenuButton::PopupMenu : public QPopupMenu
-{
-public:
-    PopupMenu( QtxMenuButton* mb ) : QPopupMenu( mb ), myMenuButton( mb ) {};
-    virtual ~PopupMenu() {};
-
-    virtual void setMinimumSize( int, int );
-
-private:
-    QtxMenuButton* myMenuButton;
-};
-
-/*!
-  Sets the widget's minimum size
-  \param w - width
-  \param h - height
-*/
-void QtxMenuButton::PopupMenu::setMinimumSize( int w, int h )
-{
-    if ( myMenuButton->isAlignWidth() &&
-         ( myMenuButton->position() == Top || myMenuButton->position() == Bottom ) )
-        w = QMAX( w, myMenuButton->width() );
-
-    QPopupMenu::setMinimumSize( w, h );
-}
-
-
-/*!
-  Constructor
-  \param pos - position
-  \param parent - parent widget
-  \param name - name
-*/
-QtxMenuButton::QtxMenuButton( int pos, QWidget* parent, const char* name )
-: QPushButton( parent, name ),
-myPos( pos )
-{
-       initialize();
-}
-
-/*!
-  Constructor
-  \param text - button text
-  \param parent - parent widget
-  \param name - name
-*/
-QtxMenuButton::QtxMenuButton( const QString& text, QWidget* parent, const char* name )
-: QPushButton( parent, name ),
-myPos( Bottom )
-{
-       setText( text );
-       initialize();
-}
-
-/*!
-  Constructor
-  \param pos - position
-  \param text - button text
-  \param parent - parent widget
-  \param name - name
-*/
-QtxMenuButton::QtxMenuButton( int pos, const QString& text, QWidget* parent, const char* name )
-: QPushButton( parent, name ),
-myPos( pos )
-{
-       setText( text );
-       initialize();
-}
-
-/*!
-  Constructor
-  \param parent - parent widget
-  \param name - name
-*/
-QtxMenuButton::QtxMenuButton( QWidget* parent, const char* name )
-: QPushButton( parent, name ),
-myPos( Bottom )
-{
-       initialize();
-}
-
-/*!
-  Destructor
-*/
-QtxMenuButton::~QtxMenuButton()
-{
-}
-
-/*!
-  Initialization
-*/
-void QtxMenuButton::initialize()
-{
-       myArrow = true;
-    myAlign = true;
-
-       setAutoDefault( false );
-       myPopup = new PopupMenu( this );
-    myPopup->hide();
-
-       connect( myPopup, SIGNAL( activated( int ) ), this, SIGNAL( activated( int ) ) );
-       connect( this, SIGNAL( clicked() ), this, SLOT( onShowPopup() ) );
-}
-
-/*!
-  \return position
-*/
-int QtxMenuButton::position() const
-{
-       return myPos;
-}
-
-/*!
-  \return true if align is enabled
-*/
-bool QtxMenuButton::isAlignWidth() const
-{
-    return myAlign;
-}
-
-/*!
-  \return true if arrow is shown
-*/
-bool QtxMenuButton::isArrowEnabled() const
-{
-       return myArrow;
-}
-
-/*!
-  Changes position
-  \param pos - new position
-*/
-void QtxMenuButton::setPosition( const int pos )
-{
-       if ( myPos == pos )
-               return;
-
-    myPos = pos;
-    if ( myPopup->isVisible() )
-        onShowPopup();
-}
-
-/*!
-  Changes align state
-  \param on - new align state
-*/
-void QtxMenuButton::setAlignWidth( const bool on )
-{
-    if ( myAlign == on )
-        return;
-
-    myAlign = on;
-    updateGeometry();
-}
-
-/*!
-  Enables/disable arrow
-  \param on - new enabled state
-*/
-void QtxMenuButton::setArrowEnabled( const bool on )
-{
-       if ( myArrow == on )
-               return;
-
-    myArrow = on;
-    repaint();
-}
-
-/*!
-  Clears popup
-*/
-void QtxMenuButton::clear()
-{
-       if ( myPopup )
-               myPopup->clear();
-       onShowPopup();
-       updateGeometry();
-}
-
-/*!
-  Removes item from popup
-  \param id - item id
-*/
-void QtxMenuButton::removeItem( int id )
-{
-       if ( myPopup )
-               myPopup->removeItem( id );
-       updateGeometry();
-}
-
-/*!
-  Inserts separator into popup
-  \param id - position
-*/
-int QtxMenuButton::insertSeparator( int id )
-{
-       int res = -1;
-       if ( myPopup )
-               res = myPopup->insertSeparator( id );
-    return res;
-}
-
-/*!
-  Inserts item into popup
-  \param t - menu text
-  \param id - item id
-  \param index - position
-*/
-int QtxMenuButton::insertItem( const QString& t, int id, int index )
-{
-       int resId = -1;
-       if ( myPopup )
-               resId = myPopup->insertItem( t, id, index );
-
-       if ( resId != -1 )
-               updateGeometry();
-
-       return resId;
-}
-
-/*!
-  Inserts item into popup
-  \param is - icons
-  \param t - menu text
-  \param id - item id
-  \param index - position
-*/
-int QtxMenuButton::insertItem( const QIconSet& is, const QString& t, int id, int index )
-{
-       int resId = -1;
-       if ( myPopup )
-               resId = myPopup->insertItem( is, t, id, index );
-
-       if ( resId != -1 )
-               updateGeometry();
-
-       return resId;
-}
-
-/*!
-  SLOT: calls when button is clicked, shows popup
-*/
-void QtxMenuButton::onShowPopup()
-{
-       if ( !myPopup || !myPopup->count() )
-       {
-               myPopup->hide();
-               return;
-       }
-
-       QPoint p = mapToGlobal( QPoint( 0, 0 ) );
-       int x = p.x();
-       int y = p.y() + 1;
-       int margin = 0;
-       int xoffset = 0;
-       int yoffset = 0;
-       switch ( position() )
-       {
-       case Left:
-               xoffset = -1 * ( myPopup->sizeHint().width() + margin );
-               break;
-       case Right:
-               xoffset = width() + margin;
-               break;
-       case Top:
-               yoffset = -1 * ( myPopup->sizeHint().height() + margin );
-               break;
-       case Bottom:
-       default:
-               yoffset = height() + margin;
-               break;
-       }
-       int dw = QApplication::desktop()->width();
-       int dh = QApplication::desktop()->height();
-       x = QMIN( QMAX( x + xoffset, 0 ), dw );
-       y = QMIN( QMAX( y + yoffset, 0 ), dh );
-
-       myPopup->exec( QPoint( x, y ) );
-}
-
-/*!
-  Custom event handler
-*/
-bool QtxMenuButton::event( QEvent* e )
-{
-       if ( e->type() == QEvent::MouseButtonPress ||
-                e->type() == QEvent::MouseButtonDblClick ||
-                e->type() == QEvent::MouseButtonRelease )
-       {
-               onShowPopup();
-               return false;
-       }
-
-       return QPushButton::event( e );
-}
-
-/*!
-  \return the recommended size for the widget
-*/
-QSize QtxMenuButton::sizeHint() const
-{
-       QSize sz = QPushButton::sizeHint();
-       if ( ( position() == Top || position() == Bottom ) && myPopup && myAlign )
-               sz = QSize( QMAX( sz.width(), myPopup->sizeHint().width() ), sz.height() );
-
-       return sz;
-}
-
-/*!
-  \return the recommended minimum size for the widget
-*/
-QSize QtxMenuButton::minimumSizeHint() const
-{
-       QSize sz = QPushButton::minimumSizeHint();
-       if ( ( position() == Top || position() == Bottom ) && myPopup && myAlign )
-               sz = QSize( QMAX( sz.width(), myPopup->sizeHint().width() ), sz.height() );
-
-       return sz;
-}
-
-/*!
-  Custom resize event handler
-*/
-void QtxMenuButton::resizeEvent( QResizeEvent* re )
-{
-       if ( re )
-               QPushButton::resizeEvent( re );
-
-       if ( ( position() == Top || position() == Bottom ) && myPopup && myAlign )
-        myPopup->setMinimumWidth( re ? re->size().width() : width() );
-}
-
-/*!
-  \return corresponding popup
-*/
-QPopupMenu* QtxMenuButton::popup() const
-{
-    return myPopup;
-}
-
-/*!
-  Draws label
-*/
-void QtxMenuButton::drawButtonLabel( QPainter* p )
-{
-    QPushButton::drawButtonLabel( p );
-/*
-       QStyle::SFlags flags = QStyle::Style_Default;
-       if ( isEnabled() )
-               flags |= QStyle::Style_Enabled;
-       if ( hasFocus() )
-               flags |= QStyle::Style_HasFocus;
-*/
-#if QT_VER < 3
-    QRect r = rect();
-#else
-       QRect r = style().subRect( QStyle::SR_PushButtonContents, this );
-#endif
-
-       if ( myArrow && myPopup && myPopup->count() )
-       {
-               int w = 7;
-               int h = 7;
-               int margin = 5;
-
-               QRect ar( 0, 0, w, h );
-               if ( position() == Left || position() == Top )
-                       r.moveBy( ar.width() + 2 * margin, 0 );
-               else
-                       ar.moveBy( r.width() - ar.width() - 2 * margin, 0 );
-
-               r.setWidth( r.width() - ar.width() - 2 * margin );
-    
-               ar.moveBy( margin, ( height() - h ) / 2 );
-
-               QPointArray arrow( 3 );
-               switch ( position() )
-               {
-               case Left:
-                       arrow.putPoints( 0, 3, ar.left(), ar.top() + ar.height() / 2, ar.right(), ar.top(), ar.right(), ar.bottom() );
-                       break;
-               case Right:
-                       arrow.putPoints( 0, 3, ar.left(), ar.top(), ar.left(), ar.bottom(), ar.right(), ar.top() + ar.height() / 2 );
-                       break;
-               case Top:
-                       arrow.putPoints( 0, 3, ar.left(), ar.bottom(), ar.right(), ar.bottom(), ar.left() + ar.width() / 2, ar.top() );
-                       break;
-               case Bottom:
-               default:
-                       arrow.putPoints( 0, 3, ar.left(), ar.top(), ar.right(), ar.top(), ar.left() + ar.width() / 2, ar.bottom() );
-                       break;
-               }
-
-               p->setPen( colorGroup().text() );
-               p->setBrush( colorGroup().text() );
-               p->drawPolygon( arrow, true );
-       }
-
-//     style().drawControl( QStyle::CE_PushButtonLabel, p, this, r, colorGroup(), flags );
-}
diff --git a/src/Qtx/QtxMenuButton.h b/src/Qtx/QtxMenuButton.h
deleted file mode 100755 (executable)
index b0f6741..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxMenuButton.h
-// Author:    Sergey TELKOV
-
-#ifndef QTXMENUBUTTON_H
-#define QTXMENUBUTTON_H
-
-#include "Qtx.h"
-
-#include <qpushbutton.h>
-
-class QIconSet;
-class QPopupMenu;
-
-class QTX_EXPORT QtxMenuButton : public QPushButton
-{
-    Q_OBJECT
-
-    class PopupMenu;
-
-public:
-    enum { Left, Right, Top, Bottom };
-
-public:
-    QtxMenuButton( int, QWidget* = 0, const char* = 0 );
-       QtxMenuButton( const QString&, QWidget* = 0, const char* = 0 );
-       QtxMenuButton( int, const QString&, QWidget* = 0, const char* = 0 );
-       QtxMenuButton( QWidget* = 0, const char* = 0 );
-       virtual ~QtxMenuButton();
-
-       int           position() const;
-       void          setPosition( const int );
-
-    bool          isAlignWidth() const;
-    void          setAlignWidth( const bool );
-
-       bool          isArrowEnabled() const;
-       void          setArrowEnabled( const bool );
-
-       void          clear();
-       void          removeItem( int );
-       int           insertSeparator( int = -1 );
-       int           insertItem( const QString&, int = -1, int = -1 );
-       int           insertItem( const QIconSet&, const QString&, int = -1, int = -1 );
-
-       virtual QSize sizeHint() const;
-       virtual QSize minimumSizeHint() const;
-
-signals:
-       void          activated( int );
-
-private slots:
-       void          onShowPopup();
-
-protected:
-    QPopupMenu*   popup() const;
-       virtual bool  event( QEvent* );
-       virtual void  resizeEvent( QResizeEvent* );
-       virtual void  drawButtonLabel( QPainter* );
-
-private:
-    void          initialize();
-
-private:
-       int           myPos;
-       bool          myArrow;
-    bool          myAlign;
-       QPopupMenu*   myPopup;
-};
-
-#endif
diff --git a/src/Qtx/QtxMultiAction.cxx b/src/Qtx/QtxMultiAction.cxx
new file mode 100644 (file)
index 0000000..eb8bf51
--- /dev/null
@@ -0,0 +1,447 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxMultiAction.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxMultiAction.h"
+
+#include <QMenu>
+#include <QLayout>
+#include <QToolBar>
+#include <QPainter>
+#include <QHelpEvent>
+#include <QToolButton>
+#include <QApplication>
+#include <QStyleOptionButton>
+
+/*!
+  \class QtxMultiAction::Filter
+  \brief Waches for the buttons in the popup menu 
+  to update the tool buttons state.
+  \internal
+*/
+
+class QtxMultiAction::Filter : public QObject
+{
+public:
+  //! \brief Constructor
+  Filter( QObject* parent ) : QObject( parent ) {}
+  //! \brief Destructor
+  ~Filter() {}
+  //! \brief Process events from the child tool buttons
+  bool eventFilter( QObject* o, QEvent* e )
+  {
+    if ( e->type() == QEvent::Leave ) {
+      QToolButton* tb = qobject_cast<QToolButton*>( o );
+      if ( tb )
+       tb->setDown( false );
+    }
+    return QObject::eventFilter( o, e );
+  }
+};
+
+/*!
+  \class QtxMultiAction::Menu
+  \brief Custom menu to be used with the toolbuttons as drop down list.
+  \internal
+*/
+
+class QtxMultiAction::Menu : public QMenu
+{
+public:
+  //! \brief Constructor
+  Menu( QWidget* parent = 0 ) : QMenu( parent ) {}
+  //! \brief Destructor
+  ~Menu() {};
+
+protected:
+  //! \brief Paint the button
+  virtual bool event( QEvent* e )
+  {
+    bool res = false;
+    switch ( e->type() )
+    {
+    case QEvent::ToolTip:
+    case QEvent::WhatsThis:
+    case QEvent::QueryWhatsThis:
+      {
+        QHelpEvent* help = static_cast<QHelpEvent*>( e );
+        QWidget* w = QApplication::widgetAt( help->globalPos() );
+        if ( w && Qtx::isParent( w, this ) )
+        {
+          QHelpEvent he( help->type(), w->mapFromGlobal( help->globalPos() ), help->globalPos() );
+          QApplication::sendEvent( w, &he );
+          res = true;
+        }
+      }
+      break;
+    case QEvent::StatusTip:
+    case QEvent::WhatsThisClicked:
+      if ( parentWidget() )
+      {
+        QApplication::sendEvent( parentWidget(), e );
+        res = true;
+      }
+      break;
+    default:
+      res = QMenu::event( e );
+      break;
+    }
+    return res;
+  }
+};
+
+/*!
+  \class QtxMultiAction::Button
+  \brief Custom button to be used in the toolbar.
+  \internal
+*/
+
+class QtxMultiAction::Button : public QToolButton
+{
+public:
+  //! \brief Constructor
+  Button( QWidget* parent = 0 ) : QToolButton( parent ) {}
+  //! \brief Destructor
+  ~Button() {};
+
+protected:
+  //! \brief Paint the button
+  virtual void paintEvent( QPaintEvent* e )
+  {
+    QToolButton::paintEvent( e );
+
+    int s = 10;
+    int m = -2;
+    int w = width();
+    int h = height();
+
+    QStyleOptionButton opt;
+    opt.initFrom( this );
+    QRect rect = opt.rect;
+    int x = rect.x(), y = rect.y();
+    if ( isDown() )
+      opt.rect = QRect( x + w - s - m, y + h - s - m, s, s );
+    else
+      opt.rect = QRect( x + w - s - m - 1, y + h - s - m - 1, s, s );
+
+    QPainter p( this );
+    style()->drawPrimitive( QStyle::PE_IndicatorSpinDown, &opt, &p );
+  }
+};
+
+/*!
+  \class QtxMultiAction
+  \brief The class QtxMultiAction implements modifiable action.
+
+  The QtxMultiAction class provides a possibility to assign a set of actions 
+  (insertAction() function). The action can be used in the toolbar (and even
+  in the menu) to show drop-down menu with the list of the assigned actions.
+
+  Initially the first action from the list becomes current and it is activated
+  when the tool button is clicked by the user. If user presses and holds the mouse
+  button at the tool button, it shows the popup menu with all the assigned actions.
+  When the user selects any action from the popup menu, it becames current.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent object
+*/
+QtxMultiAction::QtxMultiAction( QObject* parent )
+: QtxActionSet( parent ),
+  myCurrent( 0 )
+{
+  setVisible( true );
+  setMenu( new QMenu( 0 ) );
+
+  connect( this, SIGNAL( triggered( QAction* ) ), this, SLOT( onTriggered( QAction* ) ) );
+}
+
+/*!
+  \brief Constructor.
+  \param txt action menu text
+  \param parent parent object
+*/
+QtxMultiAction::QtxMultiAction( const QString& txt, QObject* parent )
+: QtxActionSet( parent ),
+  myCurrent( 0 )
+{
+  setText( txt );
+  setVisible( true );
+  setMenu( new QMenu( 0 ) );
+
+  connect( this, SIGNAL( triggered( QAction* ) ), this, SLOT( onTriggered( QAction* ) ) );
+}
+
+/*!
+  \brief Constructor.
+  \param ico action menu icon
+  \param txt action menu text
+  \param parent parent object
+*/
+QtxMultiAction::QtxMultiAction( const QIcon& ico, const QString& txt, QObject* parent )
+: QtxActionSet( parent ),
+  myCurrent( 0 )
+{
+  setIcon( ico );
+  setText( txt );
+  setVisible( true );
+  setMenu( new QMenu( 0 ) );
+
+  connect( this, SIGNAL( triggered( QAction* ) ), this, SLOT( onTriggered( QAction* ) ) );
+}
+
+/*!
+  \brief Destructor
+*/
+QtxMultiAction::~QtxMultiAction()
+{
+}
+
+/*!
+  \brief Set current action.
+  \param a action to be set current
+*/
+void QtxMultiAction::setActiveAction( QAction* a )
+{
+  if ( a && actions().contains( a ) && a != myCurrent && a->isEnabled() )
+  {
+    myCurrent = a;
+    updateAction();
+  }
+}
+
+/*!
+  \brief Get current action.
+  \return current action (0 if there is no active action)
+*/
+QAction* QtxMultiAction::activeAction() const
+{
+  return myCurrent;
+}
+
+/*!
+  \brief Called when the user activates the current action 
+  (for example by clicking the tool button).
+  \param on (not used)
+*/
+void QtxMultiAction::onClicked( bool /*on*/ )
+{
+  if ( myCurrent )
+    myCurrent->activate( QAction::Trigger );
+}
+
+/*!
+  \brief Called when user activates any action from the
+  dropdown menu.
+  \param a action being activated
+*/
+void QtxMultiAction::onTriggered( QAction* a )
+{
+  if ( !a )
+    return;
+
+  QList<QWidget*> lst = createdWidgets();
+  for ( QList<QWidget*>::iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    QToolButton* tb = ::qobject_cast<QToolButton*>( *it );
+    if ( tb && tb->menu() )
+      tb->menu()->hide();
+  }
+
+  if ( myCurrent != a )
+  {
+    myCurrent = a;
+    updateAction();
+  }
+}
+
+/*!
+  \brief Update action.
+*/
+void QtxMultiAction::updateAction()
+{
+  QtxActionSet::updateAction();
+
+  QList<QWidget*> lst = createdWidgets();
+  for ( QList<QWidget*>::iterator it = lst.begin(); it != lst.end(); ++it )
+    updateButton( ::qobject_cast<QToolButton*>( *it ) );
+}
+
+/*!
+  \brief Update child (popup menu) action.
+  \param w widget menu widget
+*/
+void QtxMultiAction::updateAction( QWidget* w )
+{
+  if ( !w )
+    return;
+
+  if ( w->inherits( "QMenu" ) )
+  {
+    QtxActionSet::updateAction( menu() );
+
+    QApplication::instance()->removeEventFilter( this );
+
+    menu()->removeAction( this );
+
+    QApplication::instance()->installEventFilter( this );
+  }
+}
+
+/*!
+  \brief Check if the action itself should be invisible
+  (only child action are shown)
+  \return \c true if the action itself should be visible
+*/
+bool QtxMultiAction::isEmptyAction() const
+{
+  return false;
+}
+
+/*!
+  \brief Create widget to be displayed in the toolbar.
+  \param parent parent widget (should be toolbar)
+  \return toolbar button
+*/
+QWidget* QtxMultiAction::createWidget( QWidget* parent )
+{
+  QToolBar* tb = ::qobject_cast<QToolBar*>( parent );
+  if ( !tb )
+    return 0;
+
+  QToolButton* w = new QToolButton( tb );
+  w->setMenu( new Menu( w ) );
+  w->setMouseTracking( true );
+  w->setFocusPolicy( Qt::NoFocus );
+  w->setIconSize( tb->iconSize() );
+  w->setToolButtonStyle( tb->toolButtonStyle() );
+
+  connect( w, SIGNAL( clicked( bool ) ), this, SLOT( onClicked( bool ) ) );
+  connect( tb, SIGNAL( iconSizeChanged( const QSize& ) ), w, SLOT( setIconSize( QSize ) ) );
+  connect( tb, SIGNAL( toolButtonStyleChanged( Qt::ToolButtonStyle ) ),
+           w, SLOT( setToolButtonStyle( Qt::ToolButtonStyle ) ) );
+
+  updateButton( w );
+  return w;
+}
+
+/*!
+  \brief Called when the child action is added to this action.
+  \param a child action being added
+*/
+void QtxMultiAction::actionAdded( QAction* a )
+{
+  connect( a, SIGNAL( changed() ), this, SLOT( onActionChanged() ) );
+  onActionChanged();
+}
+
+/*!
+  \brief Called when the child action is removed from this action.
+  \param a child action being removed
+*/
+void QtxMultiAction::actionRemoved( QAction* a )
+{
+  disconnect( a, SIGNAL( changed() ), this, SLOT( onActionChanged() ) );
+
+  if ( myCurrent != a )
+    return;
+
+  myCurrent = 0;
+
+  onActionChanged();
+
+  updateAction();
+}
+
+/*!
+  \brief Update toolbar button.
+  \param btn toolbar button
+*/
+void QtxMultiAction::updateButton( QToolButton* btn )
+{
+  if ( !btn )
+    return;
+
+  btn->setIcon( myCurrent ? myCurrent->icon() : QIcon() );
+  btn->setText( myCurrent ? myCurrent->text() : QString() );
+  btn->setToolTip( myCurrent ? myCurrent->toolTip() : QString() );
+  btn->setStatusTip( myCurrent ? myCurrent->statusTip() : QString() );
+
+  QMenu* pm = btn->menu();
+  if ( !pm )
+    return;
+
+  pm->clear();
+  for ( int i = 0; pm->layout() && i < pm->layout()->count(); i++ )
+    delete pm->layout()->widget();
+
+  delete pm->layout();
+
+  QVBoxLayout* vbox = new QVBoxLayout( pm );
+  vbox->setMargin( 1 );
+  vbox->setSpacing( 0 );
+  Filter* filter = new Filter( vbox );
+  QList<QAction*> actList = actions();
+  for ( QList<QAction*>::iterator itr = actList.begin(); itr != actList.end(); ++itr )
+  {
+    QToolButton* b = new QToolButton( pm );
+    b->setDefaultAction( *itr );
+    b->setToolTip( (*itr)->toolTip() );
+    b->setStatusTip( (*itr)->statusTip() );
+    b->setAutoRaise( true );
+    b->setIconSize( btn->iconSize() );
+    b->setToolButtonStyle( btn->toolButtonStyle() );
+    b->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
+    b->installEventFilter( filter );
+    vbox->addWidget( b );
+  }
+}
+
+/*!
+  \brief Called when any child action is enabled/disabled.
+  
+  If the current action is disabled, the multi-action switches
+  to first found enabled. If all child actions are disabled, the
+  action itself is also disabled.
+*/
+void QtxMultiAction::onActionChanged()
+{
+  if ( myCurrent && myCurrent->isEnabled() )
+    return;
+
+  QList<QAction*> alist = actions();
+  QAction* a = 0;
+  for ( QList<QAction*>::ConstIterator it = alist.begin(); it != alist.end() && !a; ++it ) {
+    if ( (*it)->isEnabled() )
+      a = *it;
+  }
+
+  if ( a )
+    myCurrent = a;
+  else
+    myCurrent = alist.isEmpty() ? 0 : alist.first();
+
+  setEnabled( myCurrent && myCurrent->isEnabled() );
+  updateAction();
+}
diff --git a/src/Qtx/QtxMultiAction.h b/src/Qtx/QtxMultiAction.h
new file mode 100644 (file)
index 0000000..5258381
--- /dev/null
@@ -0,0 +1,71 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxMultiAction.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXMULTIACTION_H
+#define QTXMULTIACTION_H
+
+#include "QtxActionSet.h"
+
+class QToolButton;
+
+class QTX_EXPORT QtxMultiAction : public QtxActionSet
+{
+  Q_OBJECT
+
+  class Menu;
+  class Button;
+  class Filter;
+
+public:
+  QtxMultiAction( QObject* parent = 0 );
+  QtxMultiAction( const QString&, QObject* parent = 0 );
+  QtxMultiAction( const QIcon&, const QString&, QObject* parent = 0 );
+  virtual ~QtxMultiAction();
+
+  void             setActiveAction( QAction* );
+  QAction*         activeAction() const;
+
+private slots:
+  void             onClicked( bool );
+  void             onTriggered( QAction* );
+  void             onActionChanged();
+
+protected:
+  virtual bool     isEmptyAction() const;
+  virtual QWidget* createWidget( QWidget* );
+
+  virtual void     updateAction();
+  virtual void     updateAction( QWidget* );
+
+  virtual void     actionAdded( QAction* );
+  virtual void     actionRemoved( QAction* );
+
+private:
+  void             updateButton( QToolButton* );
+
+private:
+  QAction*         myCurrent;
+};
+
+#endif // QTXMULTIACTION_H
diff --git a/src/Qtx/QtxOperations.cxx b/src/Qtx/QtxOperations.cxx
deleted file mode 100644 (file)
index ccf1500..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "QtxOperations.h"
-
-/*!
-    Default constructor
-*/
-QtxOperations::QtxOperations()
-{
-}
-
-/*!
-    Destructor
-*/
-QtxOperations::~QtxOperations()
-{
-}
-
-/*!
-    Creates QtxValue by it's string representation
-*/
-bool QtxOperations::createValue( const QString& str, QtxValue& v ) const
-{
-    v = str;
-    return false;
-}
diff --git a/src/Qtx/QtxOperations.h b/src/Qtx/QtxOperations.h
deleted file mode 100644 (file)
index 642a3bf..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxOperations.h
-// Author:    Alexander SOLOVYOV
-
-#ifndef __QTX_OPERATIONS_HEADER__
-#define __QTX_OPERATIONS_HEADER__
-
-#include "Qtx.h"
-#include "QtxParser.h"
-
-class QTX_EXPORT QtxOperations
-{
-public:
-    QtxOperations();
-    virtual ~QtxOperations();
-
-    virtual void  opersList( QStringList& ) const = 0;
-    //list of possible operations
-
-    virtual void  bracketsList( QStringList&, bool open ) const = 0;
-    //list of open/close brackets
-
-    virtual bool  createValue( const QString&, QtxValue& ) const;
-    //by default, the String value will be set, it corresponds to parameter
-    //base method returns false (always parameter)
-    //successor's method returns true if it has created custom value
-    //or call base if it hasn't
-
-    virtual int   prior( const QString&, bool isBin ) const = 0;
-    //returns prioritet of operation;
-    //if operation is impossible, it must return 0 or less
-
-    virtual QtxParser::Error isValid( const QString&,
-                                      const QVariant::Type,
-                                      const QVariant::Type ) const = 0;
-    //return OK if this parameter types is valid for operation
-    //return OperandsNotMatch or InvalidOperation otherwise
-
-    virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const = 0;
-    //process binary operation with values
-    //for unary operation the second QtxValue will be passed as invalid
-};
-
-#endif
diff --git a/src/Qtx/QtxPagePrefMgr.cxx b/src/Qtx/QtxPagePrefMgr.cxx
new file mode 100644 (file)
index 0000000..4d333f8
--- /dev/null
@@ -0,0 +1,3808 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxPagePrefMgr.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxPagePrefMgr.h"
+
+#include "QtxGridBox.h"
+#include "QtxFontEdit.h"
+#include "QtxGroupBox.h"
+#include "QtxComboBox.h"
+#include "QtxIntSpinBox.h"
+#include "QtxColorButton.h"
+#include "QtxDoubleSpinBox.h"
+
+#include <QEvent>
+#include <QLayout>
+#include <QToolBox>
+#include <QLineEdit>
+#include <QTextEdit>
+#include <QCheckBox>
+#include <QSplitter>
+#include <QTabWidget>
+#include <QListWidget>
+#include <QApplication>
+#include <QDateTimeEdit>
+#include <QStackedWidget>
+
+/*!
+  \class QtxPagePrefMgr
+  \brief GUI implementation of the QtxPreferenceMgr class: preferences manager.
+*/
+
+/*!
+  \brief Constructor.
+  \param resMgr resource manager
+  \param parent parent widget
+*/
+QtxPagePrefMgr::QtxPagePrefMgr( QtxResourceMgr* resMgr, QWidget* parent )
+: QFrame( parent ),
+  QtxPreferenceMgr( resMgr ),
+  myInit( false )
+{
+  myBox = new QtxGridBox( 1, Qt::Horizontal, this, 0 );
+  QVBoxLayout* base = new QVBoxLayout( this );
+  base->setMargin( 5 );
+  base->setSpacing( 0 );
+  base->addWidget( myBox );
+}
+
+/*!
+  \brief Destructor
+*/
+QtxPagePrefMgr::~QtxPagePrefMgr()
+{
+}
+
+/*!
+  \brief Get recommended size for the widget.
+  \return recommended widget size
+*/
+QSize QtxPagePrefMgr::sizeHint() const
+{
+  return QFrame::sizeHint();
+}
+
+/*!
+  \brief Get recommended minimum size for the widget.
+  \return recommended minimum widget size
+*/
+QSize QtxPagePrefMgr::minimumSizeHint() const
+{
+  return QFrame::minimumSizeHint();
+}
+
+/*!
+  \brief Customize show/hide widget operation.
+  \param on if \c true the widget is being shown, otherswise
+  it is being hidden
+*/
+void QtxPagePrefMgr::setVisible( bool on )
+{
+  if ( on )
+    initialize();
+
+  QApplication::instance()->processEvents();
+
+  QFrame::setVisible( on );
+}
+
+/*!
+  \brief Update widget contents.
+*/
+void QtxPagePrefMgr::updateContents()
+{
+  QtxPreferenceMgr::updateContents();
+
+  QList<QtxPreferenceItem*> lst = childItems();
+  for ( QList<QtxPreferenceItem*>::const_iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    QtxPagePrefItem* item = dynamic_cast<QtxPagePrefItem*>( *it );
+    if ( item && item->widget() && item->widget()->parent() != myBox )
+      item->widget()->setParent( myBox );
+  }
+
+  setWindowIcon( icon() );
+}
+
+/*!
+  \brief Callback function which is called when the child
+  preference item is added.
+  \param item child item being added
+  \sa itemRemoved(), itemChanged()
+*/
+void QtxPagePrefMgr::itemAdded( QtxPreferenceItem* /*item*/ )
+{
+  triggerUpdate();
+}
+
+/*!
+  \brief Callback function which is called when the child
+  preference item is removed.
+  \param item child item being removed
+  \sa itemAdded(), itemChanged()
+*/
+void QtxPagePrefMgr::itemRemoved( QtxPreferenceItem* /*item*/ )
+{
+  triggerUpdate();
+}
+
+/*!
+  \brief Callback function which is called when the child
+  preference item is modified.
+  \param item child item being modified
+  \sa itemAdded(), itemRemoved()
+*/
+void QtxPagePrefMgr::itemChanged( QtxPreferenceItem* /*item*/ )
+{
+  triggerUpdate();
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefMgr::optionValue( const QString& name ) const
+{
+  if ( name == "orientation" )
+    return myBox->orientation() == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal;
+  else
+    return QtxPreferenceMgr::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefMgr::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "orientation" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      myBox->setOrientation( val.toInt() == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal );
+  }
+  else
+    QtxPreferenceMgr::setOptionValue( name, val );
+}
+
+/*!
+  \brief Perform internal initialization.
+*/
+void QtxPagePrefMgr::initialize() const
+{
+  //  if ( myInit )
+  //    return;
+
+  QtxPagePrefMgr* that = (QtxPagePrefMgr*)this;
+  that->initialize( that );
+
+  //  that->myInit = true;
+}
+
+void QtxPagePrefMgr::initialize( QtxPreferenceItem* item )
+{
+  if ( !item )
+    return;
+
+  QList<QtxPreferenceItem*> lst = item->childItems( false );
+  for ( QList<QtxPreferenceItem*>::iterator it = lst.begin(); it != lst.end(); ++it )
+    initialize( *it );
+
+  updateContents();
+}
+
+/*!
+  \class QtxPagePrefItem
+  \brief Base class for implementation of all the widget-based
+  preference items.
+*/
+
+class QtxPagePrefItem::Listener : public QObject
+{
+public:
+  Listener( QtxPagePrefItem* );
+  virtual ~Listener();
+
+  virtual bool eventFilter( QObject*, QEvent* );
+
+private:
+  QtxPagePrefItem* myItem;
+};
+
+QtxPagePrefItem::Listener::Listener( QtxPagePrefItem* item )
+: QObject( 0 ),
+  myItem( item )
+{
+}
+
+QtxPagePrefItem::Listener::~Listener()
+{
+}
+
+bool QtxPagePrefItem::Listener::eventFilter( QObject* o, QEvent* e )
+{
+  if ( !myItem || myItem->widget() != o )
+    return false;
+
+  if ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent )
+    myItem->widgetShown();
+  if ( e->type() == QEvent::Hide || e->type() == QEvent::HideToParent )
+    myItem->widgetHided();
+
+  return false;
+}
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefItem::QtxPagePrefItem( const QString& title, QtxPreferenceItem* parent,
+                                  const QString& sect, const QString& param )
+: QtxPreferenceItem( title, sect, param, parent ),
+  myWidget( 0 ),
+  myListener( 0 )
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefItem::~QtxPagePrefItem()
+{
+  delete myWidget;
+  delete myListener;
+}
+
+void QtxPagePrefItem::activate()
+{
+  QtxPreferenceItem::activate();
+
+  if ( widget() )
+    widget()->setFocus();
+}
+
+/*!
+  \brief Get preference item editor widget.
+  \return editor widget
+  \sa setWidget()
+*/
+QWidget* QtxPagePrefItem::widget() const
+{
+  return myWidget;
+}
+
+/*!
+  \brief Set preference item editor widget.
+  \param wid editor widget
+  \sa widget()
+*/
+void QtxPagePrefItem::setWidget( QWidget* wid )
+{
+  if ( myWidget && myListener )
+    myWidget->removeEventFilter( myListener );
+
+  myWidget = wid;
+
+  if ( myWidget )
+  {
+    if ( !myListener )
+      myListener = new Listener( this );
+    myWidget->installEventFilter( myListener );
+  }
+
+  sendItemChanges();
+}
+
+/*!
+  \brief Callback function which is called when the child
+  preference item is added.
+  \param item child item being added
+  \sa itemRemoved(), itemChanged()
+*/
+void QtxPagePrefItem::itemAdded( QtxPreferenceItem* /*item*/ )
+{
+  contentChanged();
+}
+
+/*!
+  \brief Callback function which is called when the child
+  preference item is removed.
+  \param item child item being removed
+  \sa itemAdded(), itemChanged()
+*/
+void QtxPagePrefItem::itemRemoved( QtxPreferenceItem* /*item*/ )
+{
+  contentChanged();
+}
+
+/*!
+  \brief Callback function which is called when the child
+  preference item is modified.
+  \param item child item being modified
+  \sa itemAdded(), itemRemoved()
+*/
+void QtxPagePrefItem::itemChanged( QtxPreferenceItem* /*item*/ )
+{
+  contentChanged();
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+
+  This method should be reimplemented in the subclasses.
+  Base implementation does nothing.
+
+  \sa retrieve()
+*/
+void QtxPagePrefItem::store()
+{
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+
+  This method should be reimplemented in the subclasses.
+  Base implementation does nothing.
+
+  \sa store()
+*/
+void QtxPagePrefItem::retrieve()
+{
+}
+
+/*!
+  \brief Invoked when preference item widget is shown.
+*/
+void QtxPagePrefItem::widgetShown()
+{
+}
+
+/*!
+  \brief Invoked when preference item widget is hided.
+*/
+void QtxPagePrefItem::widgetHided()
+{
+}
+
+void QtxPagePrefItem::ensureVisible( QtxPreferenceItem* i )
+{
+  QtxPreferenceItem::ensureVisible();
+
+  QtxPagePrefItem* item = dynamic_cast<QtxPagePrefItem*>( i );
+  if ( item && item->widget() )
+    item->widget()->setVisible( true );
+}
+
+/*!
+  \brief Find all child items of the QtxPagePrefItem type.
+  \param list used to return list of child items
+  \param rec if \c true, perform recursive search
+*/
+void QtxPagePrefItem::pageChildItems( QList<QtxPagePrefItem*>& list, const bool rec ) const
+{
+  QList<QtxPreferenceItem*> lst = childItems( rec );
+  for ( QList<QtxPreferenceItem*>::const_iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    QtxPagePrefItem* item = dynamic_cast<QtxPagePrefItem*>( *it );
+    if ( item )
+      list.append( item );
+  }
+}
+
+/*!
+  \brief Called when contents is changed (item is added, removed or modified).
+
+  Triggers the item update.
+*/
+void QtxPagePrefItem::contentChanged()
+{
+  triggerUpdate();
+}
+
+/*!
+  \class QtxPageNamedPrefItem
+  \brief Base class for implementation of the named preference items
+  (items with text labels).
+*/
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPageNamedPrefItem::QtxPageNamedPrefItem( const QString& title, QtxPreferenceItem* parent,
+                                            const QString& sect, const QString& param )
+: QtxPagePrefItem( title, parent, sect, param ),
+  myControl( 0 )
+{
+  QWidget* main = new QWidget();
+
+  //  QtxPagePrefGroupItem* aGroup = 0;//dynamic_cast<QtxPagePrefGroupItem*>(parent);
+  //  if ( !aGroup )
+  //  {
+    QHBoxLayout* base = new QHBoxLayout( main );
+    base->setMargin( 0 );
+    base->setSpacing( 5 );
+
+    myLabel = new QLabel( title, main );
+    base->addWidget( myLabel );
+    //  }
+    //  else
+    //    myLabel = new QLabel( title, aGroup->gridBox() );
+
+  setWidget( main );
+
+  myLabel->setVisible( !title.isEmpty() );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPageNamedPrefItem::~QtxPageNamedPrefItem()
+{
+}
+
+/*!
+  \brief Set preference title.
+  \param txt new preference title.
+*/
+void QtxPageNamedPrefItem::setTitle( const QString& txt )
+{
+  QtxPagePrefItem::setTitle( txt );
+
+  label()->setText( title() );
+  if ( !title().isEmpty() )
+    label()->setVisible( true );
+}
+
+/*!
+  \brief Get label widget corresponding to the preference item.
+  \return label widget
+*/
+QLabel* QtxPageNamedPrefItem::label() const
+{
+  return myLabel;
+}
+
+/*!
+  \brief Get control widget corresponding to the preference item.
+  \return control widget
+  \sa setControl()
+*/
+QWidget* QtxPageNamedPrefItem::control() const
+{
+  return myControl;
+}
+
+/*!
+  \brief Set control widget corresponding to the preference item.
+  \param wid control widget
+  \sa control()
+*/
+void QtxPageNamedPrefItem::setControl( QWidget* wid )
+{
+  if ( myControl == wid )
+    return;
+
+  delete myControl;
+  myControl = wid;
+
+  if ( myControl )
+  {
+    //    QtxPagePrefGroupItem* aGroup = 0;//dynamic_cast<QtxPagePrefGroupItem*>(parentItem());
+    //    if ( !aGroup )
+    widget()->layout()->addWidget( myControl );
+    widget()->setFocusProxy( myControl );
+      //    else myControl->setParent( aGroup->gridBox() );
+  }
+}
+
+void QtxPageNamedPrefItem::adjustLabels( QtxPagePrefItem* parent )
+{
+  if ( !parent )
+    return;
+
+  QList<QtxPreferenceItem*> childList = parent->childItems();
+
+  QList<QtxPageNamedPrefItem*> namedItems;
+  for ( QList<QtxPreferenceItem*>::iterator it = childList.begin(); it != childList.end(); ++it )
+  {
+    QtxPageNamedPrefItem* item = dynamic_cast<QtxPageNamedPrefItem*>( *it );
+    if ( item )
+      namedItems.append( item );
+  }
+
+  int sz = 0;
+  for ( QList<QtxPageNamedPrefItem*>::iterator it1 = namedItems.begin(); it1 != namedItems.end(); ++it1 )
+  {
+    QtxPageNamedPrefItem* item = *it1;
+    if ( item->label() )
+      sz = qMax( sz, item->label()->sizeHint().width() );
+  }
+
+  for ( QList<QtxPageNamedPrefItem*>::iterator it2 = namedItems.begin(); it2 != namedItems.end(); ++it2 )
+  {
+    QtxPageNamedPrefItem* item = *it2;
+    if ( item->label() )
+      item->label()->setMinimumWidth( sz );
+  }
+}
+
+/*!
+  \class QtxPagePrefListItem
+  \brief GUI implementation of the list container preference item.
+*/
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefListItem::QtxPagePrefListItem( const QString& title, QtxPreferenceItem* parent,
+                                          const QString& sect, const QString& param )
+: QtxPagePrefItem( title, parent, sect, param ),
+  myFix( false )
+{
+  QSplitter* main = new QSplitter( Qt::Horizontal );
+  main->setChildrenCollapsible( false );
+
+  main->addWidget( myList = new QListWidget( main ) );
+  main->addWidget( myStack = new QStackedWidget( main ) );
+
+  myList->setSelectionMode( QListWidget::SingleSelection );
+
+  myStack->addWidget( myInfLabel = new QLabel( myStack ) );
+  myInfLabel->setAlignment( Qt::AlignCenter );
+
+  connect( myList, SIGNAL( itemSelectionChanged() ), this, SLOT( onItemSelectionChanged() ) );
+
+  setWidget( main );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefListItem::~QtxPagePrefListItem()
+{
+}
+
+/*!
+  \brief Get message text which is shown if the container is empty.
+  \return message text
+  \sa setEmptyInfo()
+*/
+QString QtxPagePrefListItem::emptyInfo() const
+{
+  return myInfText;
+}
+
+/*!
+  \brief Set message text which is shown if the container is empty.
+  \param new message text
+  \sa emptyInfo()
+*/
+void QtxPagePrefListItem::setEmptyInfo( const QString& inf )
+{
+  if ( myInfText == inf )
+    return;
+
+  myInfText = inf;
+
+  updateVisible();
+}
+
+/*!
+  \brief Check if the preference item widget is of fixed size.
+  \return \c true if the widget has the fixed size
+  \sa setFixedSize()
+*/
+bool QtxPagePrefListItem::isFixedSize() const
+{
+  return myFix;
+}
+
+/*!
+  \brief Set the preference item widget to be of fixed size.
+  \param on if \c true, the widget will have the fixed size
+  \sa isFixedSize()
+*/
+void QtxPagePrefListItem::setFixedSize( const bool on )
+{
+  if ( myFix == on )
+    return;
+
+  myFix = on;
+
+  updateGeom();
+}
+
+/*!
+  \brief Update widget contents.
+*/
+void QtxPagePrefListItem::updateContents()
+{
+  QtxPagePrefItem::updateContents();
+  updateVisible();
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefListItem::optionValue( const QString& name ) const
+{
+  if ( name == "fixed_size" )
+    return isFixedSize();
+  else if ( name == "empty_info" || name == "info" )
+    return emptyInfo();
+  else
+    return QtxPagePrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefListItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "fixed_size" )
+  {
+    if ( val.canConvert( QVariant::Bool ) )
+      setFixedSize( val.toBool() );
+  }
+  else if ( name == "empty_info" || name == "info" )
+  {
+    if ( val.canConvert( QVariant::String ) )
+      setEmptyInfo( val.toString() );
+  }
+  else
+    QtxPagePrefItem::setOptionValue( name, val );
+}
+
+void QtxPagePrefListItem::widgetShown()
+{
+  updateState();
+}
+
+void QtxPagePrefListItem::ensureVisible( QtxPreferenceItem* i )
+{
+  if ( !i )
+    return;
+
+  QtxPreferenceItem::ensureVisible( i );
+
+  setSelected( i->id() );
+  updateState();
+}
+
+/*!
+  \brief Called when the selection in the list box is changed.
+*/
+void QtxPagePrefListItem::onItemSelectionChanged()
+{
+  updateState();
+}
+
+/*!
+  \brief Update information label widget.
+*/
+void QtxPagePrefListItem::updateInfo()
+{
+  QString infoText;
+  QtxPagePrefItem* item = selectedItem();
+  if ( item )
+  {
+    infoText = emptyInfo();
+    QRegExp rx( "%([%|N])" );
+
+    int idx = 0;
+    while ( ( idx = rx.indexIn( infoText ) ) != -1 )
+    {
+      if ( rx.cap() == QString( "%%" ) )
+        infoText.replace( idx, rx.matchedLength(), "%" );
+      else if ( rx.cap() == QString( "%N" ) )
+        infoText.replace( idx, rx.matchedLength(), item->title() );
+    }
+  }
+  myInfLabel->setText( infoText );
+}
+
+/*!
+  \brief Update widget state.
+*/
+void QtxPagePrefListItem::updateState()
+{
+  QtxPagePrefItem* item = selectedItem();
+  QWidget* wid = item && !item->isEmpty() ? item->widget() : myInfLabel;
+  if ( wid )
+    myStack->setCurrentWidget( wid );
+
+  updateInfo();
+}
+
+/*!
+  \brief Update visibile child widgets.
+*/
+void QtxPagePrefListItem::updateVisible()
+{
+  QList<QtxPagePrefItem*> items;
+  pageChildItems( items );
+
+  QMap<QWidget*, int> map;
+  for ( int i = 0; i < (int)myStack->count(); i++ )
+    map.insert( myStack->widget( i ), 0 );
+
+  int selId = selected();
+  myList->clear();
+  for ( QList<QtxPagePrefItem*>::const_iterator it = items.begin(); it != items.end(); ++it )
+  {
+    if ( (*it)->isEmpty() && myInfText.isEmpty() )
+      continue;
+
+    myList->addItem( (*it)->title() );
+    myList->item( myList->count() - 1 )->setIcon( (*it)->icon() );
+    myList->item( myList->count() - 1 )->setData( Qt::UserRole, (*it)->id() );
+
+    QWidget* wid = (*it)->widget();
+    if ( !map.contains( wid ) )
+      myStack->addWidget( wid );
+
+    map.remove( wid );
+  }
+
+  map.remove( myInfLabel );
+
+  for ( QMap<QWidget*, int>::const_iterator it = map.begin(); it != map.end(); ++it )
+    myStack->removeWidget( it.key() );
+
+  setSelected( selId );
+  if ( selected() == -1 && myList->count() )
+    setSelected( myList->item( 0 )->data( Qt::UserRole ).toInt() );
+
+  //myList->setVisible( myList->count() > 1 );
+
+  updateState();
+  updateGeom();
+}
+
+/*!
+  \brief Update widget geometry.
+*/
+void QtxPagePrefListItem::updateGeom()
+{
+  if ( myFix )
+    myList->setFixedWidth( myList->minimumSizeHint().width() + 10 );
+  else
+  {
+    myList->setMinimumWidth( 0 );
+    myList->setMaximumWidth( 16777215 );
+
+    QSplitter* s = ::qobject_cast<QSplitter*>( widget() );
+    if ( s )
+    {
+      int w = myList->minimumSizeHint().width() + 30;
+      QList<int> szList;
+      szList.append( w );
+      szList.append( s->width() - w );
+      s->setSizes( szList );
+    }
+  }
+}
+
+/*!
+  \brief Get identifier of the currently selected preference item.
+  \return identifier of the currently selected item or -1 if no item is selected
+  \sa setSelected()
+*/
+int QtxPagePrefListItem::selected() const
+{
+  QList<QListWidgetItem*> selList = myList->selectedItems();
+  if ( selList.isEmpty() )
+    return -1;
+
+  QVariant v = selList.first()->data( Qt::UserRole );
+  return v.canConvert( QVariant::Int ) ? v.toInt() : -1;
+}
+
+/*!
+  \brief Get currently selected preference item.
+  \return currently selected item or 0 if no item is selected
+  \sa setSelected()
+*/
+QtxPagePrefItem* QtxPagePrefListItem::selectedItem() const
+{
+  int selId = selected();
+
+  QList<QtxPagePrefItem*> items;
+  pageChildItems( items );
+
+  QtxPagePrefItem* item = 0;
+  for ( QList<QtxPagePrefItem*>::const_iterator it = items.begin(); it != items.end() && !item; ++it )
+  {
+    if ( (*it)->id() == selId )
+      item = *it;
+  }
+  return item;
+}
+
+/*!
+  \brief Set currently selected preference item.
+  \param id identifier of the preference item to make selected
+*/
+void QtxPagePrefListItem::setSelected( const int id )
+{
+  int idx = -1;
+  for ( int i = 0; i < (int)myList->count() && idx < 0; i++ )
+  {
+    QVariant v = myList->item( i )->data( Qt::UserRole );
+    if ( v.canConvert( QVariant::Int ) && v.toInt() == id )
+      idx = i;
+  }
+
+  QItemSelection sel;
+  QItemSelectionModel* selModel = myList->selectionModel();
+
+  if ( idx >= 0 )
+    sel.select( myList->model()->index( idx, 0 ), myList->model()->index( idx, 0 ) );
+
+  selModel->select( sel, QItemSelectionModel::ClearAndSelect );
+}
+
+/*!
+  \class QtxPagePrefToolBoxItem
+  \brief GUI implementation of the tool box container preference item.
+*/
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefToolBoxItem::QtxPagePrefToolBoxItem( const QString& title, QtxPreferenceItem* parent,
+                                                const QString& sect, const QString& param )
+: QtxPagePrefItem( title, parent, sect, param )
+{
+  setWidget( myToolBox = new QToolBox( 0 ) );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefToolBoxItem::~QtxPagePrefToolBoxItem()
+{
+}
+
+/*!
+  \brief Update widget contents.
+*/
+void QtxPagePrefToolBoxItem::updateContents()
+{
+  QtxPagePrefItem::updateContents();
+  updateToolBox();
+}
+
+/*!
+  \brief Update tool box widget.
+*/
+void QtxPagePrefToolBoxItem::updateToolBox()
+{
+  QList<QtxPagePrefItem*> items;
+  pageChildItems( items );
+
+  QWidget* cur = myToolBox->currentWidget();
+
+  int i = 0;
+  QMap<QWidget*, int> map;
+  for ( QList<QtxPagePrefItem*>::const_iterator it = items.begin(); it != items.end(); ++it )
+  {
+    QWidget* wid = (*it)->widget();
+    if ( !wid )
+      continue;
+
+    if ( myToolBox->widget( i ) != wid )
+    {
+      if ( myToolBox->indexOf( wid ) != -1 )
+        myToolBox->removeItem( myToolBox->indexOf( wid ) );
+
+      myToolBox->insertItem( i, wid, (*it)->title() );
+    }
+    else
+      myToolBox->setItemText( i, (*it)->title() );
+
+    myToolBox->setItemIcon( i, (*it)->icon() );
+
+    i++;
+    map.insert( wid, 0 );
+  }
+
+  QList<QWidget*> del;
+  for ( int idx = 0; idx < (int)myToolBox->count(); idx++ )
+  {
+    QWidget* w = myToolBox->widget( idx );
+    if ( !map.contains( w ) )
+      del.append( w );
+  }
+
+  for ( QList<QWidget*>::const_iterator itr = del.begin(); itr != del.end(); ++itr )
+    myToolBox->removeItem( myToolBox->indexOf( *itr ) );
+
+  if ( cur )
+    myToolBox->setCurrentWidget( cur );
+}
+
+void QtxPagePrefToolBoxItem::ensureVisible( QtxPreferenceItem* i )
+{
+  if ( !i )
+    return;
+
+  QtxPreferenceItem::ensureVisible( i );
+
+  QtxPagePrefItem* item = dynamic_cast<QtxPagePrefItem*>( i );
+  if ( item && item->widget() )
+    myToolBox->setCurrentWidget( item->widget() );
+}
+
+/*!
+  \class QtxPagePrefTabsItem
+  \brief GUI implementation of the tab widget container.
+*/
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefTabsItem::QtxPagePrefTabsItem( const QString& title, QtxPreferenceItem* parent,
+                                          const QString& sect, const QString& param )
+: QtxPagePrefItem( title, parent, sect, param )
+{
+  setWidget( myTabs = new QTabWidget( 0 ) );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefTabsItem::~QtxPagePrefTabsItem()
+{
+}
+
+/*!
+  \brief Update widget contents.
+*/
+void QtxPagePrefTabsItem::updateContents()
+{
+  QtxPagePrefItem::updateContents();
+  updateTabs();
+}
+
+/*!
+  \brief Get tabs position.
+  \return current tabs position (QTabWidget::TabPosition)
+  \sa setTabPosition()
+*/
+int QtxPagePrefTabsItem::tabPosition() const
+{
+  return myTabs->tabPosition();
+}
+
+/*!
+  \brief Set tabs position.
+  \param tp new tabs position (QTabWidget::TabPosition)
+  \sa tabPosition()
+*/
+void QtxPagePrefTabsItem::setTabPosition( const int tp )
+{
+  myTabs->setTabPosition( (QTabWidget::TabPosition)tp );
+}
+
+/*!
+  \brief Get tabs shape.
+  \return current tabs shape (QTabWidget::TabShape)
+  \sa setTabShape()
+*/
+int QtxPagePrefTabsItem::tabShape() const
+{
+  return myTabs->tabShape();
+}
+
+/*!
+  \brief Set tabs shape.
+  \param ts new tabs shape (QTabWidget::TabShape)
+  \sa tabShape()
+*/
+void QtxPagePrefTabsItem::setTabShape( const int ts )
+{
+  myTabs->setTabShape( (QTabWidget::TabShape)ts );
+}
+
+/*!
+  \brief Get tabs icon size.
+  \return current tabs icon size
+  \sa setTabIconSize()
+*/
+QSize QtxPagePrefTabsItem::tabIconSize() const
+{
+  return myTabs->iconSize();
+}
+
+/*!
+  \brief Set tabs icon size.
+  \param sz new tabs icon size
+  \sa tabIconSize()
+*/
+void QtxPagePrefTabsItem::setTabIconSize( const QSize& sz )
+{
+  myTabs->setIconSize( sz );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefTabsItem::optionValue( const QString& name ) const
+{
+  if ( name == "position" )
+    return tabPosition();
+  else if ( name == "shape" )
+    return tabShape();
+  else if ( name == "icon_size" )
+    return tabIconSize();
+  else
+    return QtxPagePrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefTabsItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "position" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setTabPosition( val.toInt() );
+  }
+  else if ( name == "shape" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setTabShape( val.toInt() );
+  }
+  else if ( name == "icon_size" )
+  {
+    if ( val.canConvert( QVariant::Size ) )
+      setTabIconSize( val.toSize() );
+  }
+  else
+    QtxPagePrefItem::setOptionValue( name, val );
+}
+
+void QtxPagePrefTabsItem::ensureVisible( QtxPreferenceItem* i )
+{
+  if ( !i )
+    return;
+
+  QtxPreferenceItem::ensureVisible( i );
+
+  QtxPagePrefItem* item = dynamic_cast<QtxPagePrefItem*>( i );
+  if ( item && item->widget() )
+    myTabs->setCurrentWidget( item->widget() );
+}
+
+/*!
+  \brief Update tabs.
+*/
+void QtxPagePrefTabsItem::updateTabs()
+{
+  QList<QtxPagePrefItem*> items;
+  pageChildItems( items );
+
+  QWidget* cur = myTabs->currentWidget();
+
+  int i = 0;
+  QMap<QWidget*, int> map;
+  for ( QList<QtxPagePrefItem*>::const_iterator it = items.begin(); it != items.end(); ++it )
+  {
+    QWidget* wid = (*it)->widget();
+    if ( !wid )
+      continue;
+
+    if ( myTabs->widget( i ) != wid )
+    {
+      if ( myTabs->indexOf( wid ) != -1 )
+        myTabs->removeTab( myTabs->indexOf( wid ) );
+
+      myTabs->insertTab( i, wid, (*it)->title() );
+    }
+    else
+      myTabs->setTabText( i, (*it)->title() );
+
+    myTabs->setTabIcon( i, (*it)->icon() );
+
+    i++;
+    map.insert( wid, 0 );
+  }
+
+  QList<QWidget*> del;
+  for ( int idx = 0; idx < (int)myTabs->count(); idx++ )
+  {
+    QWidget* w = myTabs->widget( idx );
+    if ( !map.contains( w ) )
+      del.append( w );
+  }
+
+  for ( QList<QWidget*>::const_iterator itr = del.begin(); itr != del.end(); ++itr )
+    myTabs->removeTab( myTabs->indexOf( *itr ) );
+
+  if ( cur )
+    myTabs->setCurrentWidget( cur );
+}
+
+/*!
+  \class QtxPagePrefFrameItem
+  \brief GUI implementation of the frame widget container.
+*/
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefFrameItem::QtxPagePrefFrameItem( const QString& title, QtxPreferenceItem* parent,
+                                            const QString& sect, const QString& param )
+: QtxPagePrefItem( title, parent, sect, param )
+{
+  QWidget* main = new QWidget();
+  QVBoxLayout* base = new QVBoxLayout( main );
+  base->setMargin( 0 );
+  base->setSpacing( 0 );
+
+  base->addWidget( myBox = new QtxGridBox( 1, Qt::Horizontal, main, 5, 5 ) );
+  base->addItem( new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
+
+  setWidget( main );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefFrameItem::~QtxPagePrefFrameItem()
+{
+}
+
+/*!
+  \brief Update widget contents.
+*/
+void QtxPagePrefFrameItem::updateContents()
+{
+  QtxPagePrefItem::updateContents();
+
+  updateFrame();
+
+  QtxPageNamedPrefItem::adjustLabels( this );
+}
+
+/*!
+  \brief Get frame margin.
+  \return current frame margin
+  \sa setMargin()
+*/
+int QtxPagePrefFrameItem::margin() const
+{
+  return myBox->insideMargin();
+}
+
+/*!
+  \brief Get frame margin.
+  \param m new frame margin
+  \sa margin()
+*/
+void QtxPagePrefFrameItem::setMargin( const int m )
+{
+  myBox->setInsideMargin( m );
+}
+
+/*!
+  \brief Get frame spacing.
+  \return current frame spacing
+  \sa setSpacing()
+*/
+int QtxPagePrefFrameItem::spacing() const
+{
+  return myBox->insideSpacing();
+}
+
+/*!
+  \brief Set frame spacing.
+  \param s new frame spacing
+  \sa spacing()
+*/
+void QtxPagePrefFrameItem::setSpacing( const int s )
+{
+  myBox->setInsideSpacing( s );
+}
+
+/*!
+  \brief Get number of frame columns.
+  \return current columns number
+  \sa setColumns()
+*/
+int QtxPagePrefFrameItem::columns() const
+{
+  return myBox->columns();
+}
+
+/*!
+  \brief Set number of frame columns.
+  \param c new columns number
+  \sa columns()
+*/
+void QtxPagePrefFrameItem::setColumns( const int c )
+{
+  myBox->setColumns( c );
+}
+
+/*!
+  \brief Get frame box orientation.
+  \return current frame orientation
+  \sa setOrientation()
+*/
+Qt::Orientation QtxPagePrefFrameItem::orientation() const
+{
+  return myBox->orientation();
+}
+
+/*!
+  \brief Set frame box orientation.
+  \param o new frame orientation
+  \sa orientation()
+*/
+void QtxPagePrefFrameItem::setOrientation( const Qt::Orientation o )
+{
+  myBox->setOrientation( o );
+}
+
+/*!
+  \brief Check if the frame widget stretching is enabled.
+  \return \c true if the widget is stretchable
+  \sa setStretch()
+*/
+bool QtxPagePrefFrameItem::stretch() const
+{
+  QSpacerItem* s = 0;
+  QLayout* l = widget() ? widget()->layout() : 0;
+  for ( int i = 0; l && i < l->count() && !s; i++ )
+    s = l->itemAt( i )->spacerItem();
+
+  return s ? (bool)( s->expandingDirections() & Qt::Vertical ) : false;
+}
+
+/*!
+  \brief Enable/disable frame widget stretching.
+  \param on new stretchable state
+  \sa stretch()
+*/
+void QtxPagePrefFrameItem::setStretch( const bool on )
+{
+  QSpacerItem* s = 0;
+  QLayout* l = widget() ? widget()->layout() : 0;
+  for ( int i = 0; l && i < l->count() && !s; i++ )
+    s = l->itemAt( i )->spacerItem();
+
+  if ( s )
+    s->changeSize( 0, 0, QSizePolicy::Minimum, on ? QSizePolicy::Expanding : QSizePolicy::Minimum );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefFrameItem::optionValue( const QString& name ) const
+{
+  if ( name == "margin" )
+    return margin();
+  else if ( name == "spacing" )
+    return spacing();
+  else if ( name == "columns" )
+    return columns();
+  else if ( name == "orientation" )
+    return orientation();
+  else if ( name == "stretch" )
+    return stretch();
+  else
+    return QtxPagePrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefFrameItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "margin" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setMargin( val.toInt() );
+  }
+  else if ( name == "spacing" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setSpacing( val.toInt() );
+  }
+  else if ( name == "columns" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setColumns( val.toInt() );
+  }
+  else if ( name == "orientation" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setOrientation( (Qt::Orientation)val.toInt() );
+  }
+  else if ( name == "stretch" )
+  {
+    if ( val.canConvert( QVariant::Bool ) )
+      setStretch( val.toBool() );
+  }
+  else
+    QtxPagePrefItem::setOptionValue( name, val );
+}
+
+void QtxPagePrefFrameItem::widgetShown()
+{
+  QtxPagePrefItem::widgetShown();
+
+  QtxPageNamedPrefItem::adjustLabels( this );
+}
+
+/*!
+  \brief Update frame widget.
+*/
+void QtxPagePrefFrameItem::updateFrame()
+{
+  QList<QtxPagePrefItem*> items;
+  pageChildItems( items );
+
+  for ( QList<QtxPagePrefItem*>::const_iterator it = items.begin(); it != items.end(); ++it )
+  {
+    QWidget* wid = (*it)->widget();
+    if ( !wid )
+      continue;
+
+    if ( wid->parent() != myBox )
+      wid->setParent( myBox );
+  }
+}
+
+/*!
+  \class QtxPagePrefGroupItem
+  \brief GUI implementation of the group widget container.
+*/
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefGroupItem::QtxPagePrefGroupItem( const QString& title, QtxPreferenceItem* parent,
+                                            const QString& sect, const QString& param )
+: QtxPagePrefItem( title, parent, sect, param )
+{
+  myGroup = new QtxGroupBox( title, 0 );
+  myBox = new QtxGridBox( 1, Qt::Horizontal, myGroup, 5, 5 );
+  myGroup->setWidget( myBox );
+
+  setWidget( myGroup );
+
+  updateState();
+}
+
+/*!
+  \brief Constructor.
+  \param cols columns number
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefGroupItem::QtxPagePrefGroupItem( const int cols, const QString& title, QtxPreferenceItem* parent,
+                                            const QString& sect, const QString& param )
+: QtxPagePrefItem( title, parent, sect, param )
+{
+  myGroup = new QtxGroupBox( title, 0 );
+  myBox = new QtxGridBox( cols, Qt::Horizontal, myGroup, 5, 5 );
+  myGroup->setWidget( myBox );
+
+  setWidget( myGroup );
+
+  updateState();
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefGroupItem::~QtxPagePrefGroupItem()
+{
+}
+
+/*!
+  \brief Assign resource file settings to the preference item.
+  \param sect resource file section name
+  \param param resource file parameter name
+  \sa resource()
+*/
+void QtxPagePrefGroupItem::setResource( const QString& sect, const QString& param )
+{
+  QtxPagePrefItem::setResource( sect, param );
+  updateState();
+}
+
+/*!
+  \brief Update widget contents.
+*/
+void QtxPagePrefGroupItem::updateContents()
+{
+  QtxPagePrefItem::updateContents();
+
+  myGroup->setTitle( title() );
+
+  updateState();
+  updateGroup();
+
+  QtxPageNamedPrefItem::adjustLabels( this );
+}
+
+/*!
+  \brief Get group box margin.
+  \return current group box margin
+  \sa setMargin()
+*/
+int QtxPagePrefGroupItem::margin() const
+{
+  return myBox->insideMargin();
+}
+
+/*!
+  \brief Get group box margin.
+  \param m new group box margin
+  \sa margin()
+*/
+void QtxPagePrefGroupItem::setMargin( const int m )
+{
+  myBox->setInsideMargin( m );
+}
+
+/*!
+  \brief Get group box spacing.
+  \return current group box spacing
+  \sa setSpacing()
+*/
+int QtxPagePrefGroupItem::spacing() const
+{
+  return myBox->insideSpacing();
+}
+
+/*!
+  \brief Set group box spacing.
+  \param s new group box spacing
+  \sa spacing()
+*/
+void QtxPagePrefGroupItem::setSpacing( const int s )
+{
+  myBox->setInsideSpacing( s );
+}
+
+/*!
+  \brief Get number of group box columns.
+  \return current columns number
+  \sa setColumns()
+*/
+int QtxPagePrefGroupItem::columns() const
+{
+  return myBox->columns();
+}
+
+/*!
+  \brief Set number of group box columns.
+  \param c new columns number
+  \sa columns()
+*/
+void QtxPagePrefGroupItem::setColumns( const int c )
+{
+  myBox->setColumns( c );
+}
+
+/*!
+  \brief Get group box orientation.
+  \return current group box orientation
+  \sa setOrientation()
+*/
+Qt::Orientation QtxPagePrefGroupItem::orientation() const
+{
+  return myBox->orientation();
+}
+
+/*!
+  \brief Set group box orientation.
+  \param o new group box orientation
+  \sa orientation()
+*/
+void QtxPagePrefGroupItem::setOrientation( const Qt::Orientation o )
+{
+  myBox->setOrientation( o );
+}
+
+/*!
+  \brief Get 'flat' flag of the group box widget.
+  \return \c true if the group box is flat
+*/
+bool QtxPagePrefGroupItem::isFlat() const
+{
+  return myGroup->isFlat();
+}
+
+/*!
+  \brief Get 'flat' flag of the group box widget.
+  \param on if \c true the group box will be made flat
+*/
+void QtxPagePrefGroupItem::setFlat( const bool on )
+{
+  myGroup->setFlat( on );
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefGroupItem::store()
+{
+  if ( myGroup->isCheckable() )
+    setBoolean( myGroup->isChecked() );
+}
+
+/*!
+  \brief Return widget contained grid layout of this group.
+*/
+QtxGridBox* QtxPagePrefGroupItem::gridBox() const
+{
+  return myBox;
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefGroupItem::retrieve()
+{
+  if ( myGroup->isCheckable() )
+    myGroup->setChecked( getBoolean() );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefGroupItem::optionValue( const QString& name ) const
+{
+  if ( name == "margin" )
+    return margin();
+  else if ( name == "spacing" )
+    return spacing();
+  else if ( name == "columns" )
+    return columns();
+  else if ( name == "orientation" )
+    return orientation();
+  else if ( name == "flat" )
+    return isFlat();
+  else
+    return QtxPagePrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefGroupItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "margin" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setMargin( val.toInt() );
+  }
+  else if ( name == "spacing" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setSpacing( val.toInt() );
+  }
+  else if ( name == "columns" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setColumns( val.toInt() );
+  }
+  else if ( name == "orientation" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setOrientation( (Qt::Orientation)val.toInt() );
+  }
+  else if ( name == "flat" )
+  {
+    if ( val.canConvert( QVariant::Bool ) )
+      setFlat( val.toBool() );
+  }
+  else
+    QtxPagePrefItem::setOptionValue( name, val );
+}
+
+void QtxPagePrefGroupItem::widgetShown()
+{
+  QtxPagePrefItem::widgetShown();
+
+  QtxPageNamedPrefItem::adjustLabels( this );
+}
+
+/*!
+  \brief Update widget state.
+*/
+void QtxPagePrefGroupItem::updateState()
+{
+  QString section, param;
+  resource( section, param );
+  myGroup->setCheckable( !title().isEmpty() && !section.isEmpty() && !param.isEmpty() );
+}
+
+/*!
+  \brief Update group box widget.
+*/
+void QtxPagePrefGroupItem::updateGroup()
+{
+  QList<QtxPagePrefItem*> items;
+  pageChildItems( items );
+
+  for ( QList<QtxPagePrefItem*>::const_iterator it = items.begin(); it != items.end(); ++it )
+  {
+    QWidget* wid = (*it)->widget();
+    if ( !wid )
+      continue;
+
+    if ( wid->parent() != myBox )
+      wid->setParent( myBox );
+  }
+}
+
+/*!
+  \class QtxPagePrefLabelItem
+  \brief Label item which can be used in the preferences editor dialog box.
+*/
+
+/*!
+  \brief Constructor.
+
+  Creates label item with specified title.
+
+  \param text label text
+  \param parent parent preference item
+*/
+QtxPagePrefLabelItem::QtxPagePrefLabelItem( const QString& text, QtxPreferenceItem* parent )
+: QtxPagePrefItem( text, parent )
+{
+  setWidget( myLabel = new QLabel( text ) );
+}
+
+QtxPagePrefLabelItem::QtxPagePrefLabelItem( Qt::Alignment align, const QString& text, QtxPreferenceItem* parent )
+: QtxPagePrefItem( text, parent )
+{
+  setWidget( myLabel = new QLabel( text ) );
+  myLabel->setAlignment( align );
+}
+
+QtxPagePrefLabelItem::~QtxPagePrefLabelItem()
+{
+}
+
+void QtxPagePrefLabelItem::setTitle( const QString& text )
+{
+  QtxPagePrefItem::setTitle( text );
+
+  if ( myLabel )
+    myLabel->setText( text );
+}
+
+Qt::Alignment QtxPagePrefLabelItem::alignment() const
+{
+  return myLabel->alignment();
+}
+
+void QtxPagePrefLabelItem::setAlignment( Qt::Alignment align )
+{
+  myLabel->setAlignment( align );
+}
+
+QVariant QtxPagePrefLabelItem::optionValue( const QString& name ) const
+{
+  QVariant val;
+  if ( name == "alignment" )
+    val = (int)alignment();
+  return val;
+}
+
+void QtxPagePrefLabelItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "alignment" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setAlignment( (Qt::Alignment)val.toInt() );
+  }
+}
+
+/*!
+  \class QtxPagePrefSpaceItem
+  \brief Simple spacer item which can be used in the preferences
+  editor dialog box.
+*/
+
+/*!
+  \brief Constructor.
+
+  Creates spacer item with zero width and height and expanding
+  on both directions (by height and width).
+
+  \param parent parent preference item
+*/
+QtxPagePrefSpaceItem::QtxPagePrefSpaceItem( QtxPreferenceItem* parent )
+: QtxPagePrefItem( QString(), parent )
+{
+  initialize( 0, 0, 1, 1 );
+}
+
+/*!
+  \brief Constructor.
+
+  Creates spacer item with zero width and height and expanding
+  according to the specified orientation.
+
+  \param o spacer orientation
+  \param parent parent preference item
+*/
+QtxPagePrefSpaceItem::QtxPagePrefSpaceItem( Qt::Orientation o, QtxPreferenceItem* parent )
+: QtxPagePrefItem( QString(), parent )
+{
+  if ( o == Qt::Horizontal )
+    initialize( 0, 0, 1, 0 );
+  else
+    initialize( 0, 0, 0, 1 );
+}
+
+/*!
+  \brief Constructor.
+
+  Creates spacer item with specified width and height. The spacing
+  item is expanding horizontally if \a w <= 0 and vertically
+  if \a h <= 0.
+
+  \param w spacer width
+  \param h spacer height
+  \param parent parent preference item
+*/
+QtxPagePrefSpaceItem::QtxPagePrefSpaceItem( const int w, const int h, QtxPreferenceItem* parent )
+: QtxPagePrefItem( QString(), parent )
+{
+  initialize( w, h, w > 0 ? 0 : 1, h > 0 ? 0 : 1 );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefSpaceItem::~QtxPagePrefSpaceItem()
+{
+}
+
+/*!
+  \brief Get spacer item size for the specified direction.
+  \param o direction
+  \return size for the specified direction
+  \sa setSize()
+*/
+int QtxPagePrefSpaceItem::size( Qt::Orientation o ) const
+{
+  return o == Qt::Horizontal ? widget()->minimumWidth() : widget()->minimumHeight();
+}
+
+/*!
+  \brief Set spacer item size for the specified direction.
+  \param o direction
+  \param sz new size for the specified direction
+  \sa size()
+*/
+void QtxPagePrefSpaceItem::setSize( Qt::Orientation o, const int sz )
+{
+  if ( o == Qt::Horizontal )
+    widget()->setMinimumWidth( sz );
+  else
+    widget()->setMinimumHeight( sz );
+}
+
+/*!
+  \brief Get spacer item stretch factor for the specified direction.
+  \param o direction
+  \return stretch factor for the specified direction
+  \sa setStretch()
+*/
+int QtxPagePrefSpaceItem::stretch( Qt::Orientation o ) const
+{
+  QSizePolicy sp = widget()->sizePolicy();
+  return o == Qt::Horizontal ? sp.horizontalStretch() : sp.verticalStretch();
+}
+
+/*!
+  \brief Set spacer item stretch factor for the specified direction.
+  \param o direction
+  \param sf new stretch factor for the specified direction
+  \sa stretch()
+*/
+void QtxPagePrefSpaceItem::setStretch( Qt::Orientation o, const int sf )
+{
+  QSizePolicy sp = widget()->sizePolicy();
+  if ( o == Qt::Horizontal )
+  {
+    sp.setHorizontalStretch( sf );
+    sp.setHorizontalPolicy( sf > 0 ? QSizePolicy::Expanding : QSizePolicy::Fixed );
+  }
+  else
+  {
+    sp.setVerticalStretch( sf );
+    sp.setVerticalPolicy( sf > 0 ? QSizePolicy::Expanding : QSizePolicy::Fixed );
+  }
+
+  widget()->setSizePolicy( sp );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefSpaceItem::optionValue( const QString& name ) const
+{
+  if ( name == "horizontal_size" || name == "hsize" )
+    return size( Qt::Horizontal );
+  else if ( name == "vertical_size" || name == "vsize" )
+    return size( Qt::Vertical );
+  else if ( name == "horizontal_stretch" || name == "hstretch" )
+    return stretch( Qt::Horizontal );
+  else if ( name == "vertical_stretch" || name == "vstretch" )
+    return stretch( Qt::Vertical );
+  else
+    return QtxPagePrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefSpaceItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "horizontal_size" || name == "hsize" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setSize( Qt::Horizontal, val.toInt() );
+  }
+  else if ( name == "vertical_size" || name == "vsize" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setSize( Qt::Vertical, val.toInt() );
+  }
+  else if ( name == "horizontal_stretch" || name == "hstretch" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setStretch( Qt::Horizontal, val.toInt() );
+  }
+  else if ( name == "vertical_stretch" || name == "vstretch" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setStretch( Qt::Vertical, val.toInt() );
+  }
+  else
+    QtxPagePrefItem::setOptionValue( name, val );
+}
+
+/*!
+  \brief Perform internal initialization.
+  \param w spacer item width
+  \param h spacer item height
+  \param ws spacer item horizontal stretch factor
+  \param hs spacer item vertical stretch factor
+*/
+void QtxPagePrefSpaceItem::initialize( const int w, const int h, const int hs, const int vs )
+{
+  QSizePolicy sp;
+  sp.setHorizontalPolicy( hs > 0 ? QSizePolicy::Expanding : QSizePolicy::Fixed );
+  sp.setVerticalPolicy( vs > 0 ? QSizePolicy::Expanding : QSizePolicy::Fixed );
+
+  sp.setHorizontalStretch( hs );
+  sp.setVerticalStretch( vs );
+
+  QWidget* wid = new QWidget();
+  wid->setSizePolicy( sp );
+
+  wid->setMinimumSize( w, h );
+
+  setWidget( wid );
+}
+
+/*!
+  \class  QtxPagePrefCheckItem
+  \brief GUI implementation of the resources check box item (boolean).
+*/
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefCheckItem::QtxPagePrefCheckItem( const QString& title, QtxPreferenceItem* parent,
+                                            const QString& sect, const QString& param )
+
+: QtxPagePrefItem( title, parent, sect, param )
+{
+  myCheck = new QCheckBox( title );
+  myCheck->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+  setWidget( myCheck );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefCheckItem::~QtxPagePrefCheckItem()
+{
+}
+
+/*!
+  \brief Set preference item title.
+  \param txt new preference title.
+*/
+void QtxPagePrefCheckItem::setTitle( const QString& txt )
+{
+  QtxPagePrefItem::setTitle( txt );
+
+  myCheck->setText( title() );
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefCheckItem::store()
+{
+  setBoolean( myCheck->isChecked() );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefCheckItem::retrieve()
+{
+  myCheck->setChecked( getBoolean() );
+}
+
+/*!
+  \class QtxPagePrefEditItem
+  \brief GUI implementation of the resources line edit box item
+  for string, integer and double values.
+*/
+
+/*!
+  \brief Constructor.
+
+  Creates preference item for string value editing.
+
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefEditItem::QtxPagePrefEditItem( const QString& title, QtxPreferenceItem* parent,
+                                          const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param ),
+  myType( String )
+{
+  setControl( myEditor = new QLineEdit() );
+  updateEditor();
+}
+
+/*!
+  \brief Constructor.
+
+  Creates preference item for editing of the value which type
+  is specified by parameter \a type.
+
+  \param type preference item input type (QtxPagePrefEditItem::InputType)
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefEditItem::QtxPagePrefEditItem( const int type, const QString& title,
+                                          QtxPreferenceItem* parent, const QString& sect,
+                                         const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param ),
+  myType( type )
+{
+  setControl( myEditor = new QLineEdit() );
+  updateEditor();
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefEditItem::~QtxPagePrefEditItem()
+{
+}
+
+/*!
+  \brief Get edit box preference item input type.
+  \return preference item input type (QtxPagePrefEditItem::InputType)
+  \sa setInputType()
+*/
+int QtxPagePrefEditItem::inputType() const
+{
+  return myType;
+}
+
+/*!
+  \brief Set edit box preference item input type.
+  \param type new preference item input type (QtxPagePrefEditItem::InputType)
+  \sa inputType()
+*/
+void QtxPagePrefEditItem::setInputType( const int type )
+{
+  if ( myType == type )
+    return;
+
+  myType = type;
+  updateEditor();
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefEditItem::store()
+{
+  setString( myEditor->text() );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefEditItem::retrieve()
+{
+  QString txt = getString();
+  if ( myEditor->validator() )
+  {
+    int pos = 0;
+    if ( myEditor->validator()->validate( txt, pos ) == QValidator::Invalid )
+      txt.clear();
+  }
+  myEditor->setText( txt );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefEditItem::optionValue( const QString& name ) const
+{
+  if ( name == "input_type" || name == "type" )
+    return inputType();
+  else
+    return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefEditItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "input_type" || name == "type" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setInputType( val.toInt() );
+  }
+  else
+    QtxPageNamedPrefItem::setOptionValue( name, val );
+}
+
+/*!
+  \brief Update edit box widget.
+*/
+void QtxPagePrefEditItem::updateEditor()
+{
+  QValidator* val = 0;
+  switch ( inputType() )
+  {
+  case Integer:
+    val = new QIntValidator( myEditor );
+    break;
+  case Double:
+    val = new QDoubleValidator( myEditor );
+    break;
+  default:
+    break;
+  }
+
+  if ( !myEditor->text().isEmpty() && val )
+  {
+    int pos = 0;
+    QString str = myEditor->text();
+    if ( val->validate( str, pos ) == QValidator::Invalid )
+      myEditor->clear();
+  }
+
+  delete myEditor->validator();
+  myEditor->setValidator( val );
+}
+
+/*!
+  \class QtxPagePrefSelectItem
+  \brief GUI implementation of the resources selector item
+  (string, integer or double values list).
+
+  All items in the list (represented as combo box) should be specified
+  by the unique identifier which is stored to the resource file instead
+  of the value itself.
+*/
+
+/*!
+  \brief Constructor.
+
+  Creates preference item with combo box widget which is not editable
+  (direct value entering is disabled).
+
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefSelectItem::QtxPagePrefSelectItem( const QString& title, QtxPreferenceItem* parent,
+                                              const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param ),
+  myType( NoInput )
+{
+  setControl( mySelector = new QtxComboBox() );
+  mySelector->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+  mySelector->setDuplicatesEnabled( false );
+  updateSelector();
+}
+
+/*!
+  \brief Constructor.
+
+  Creates preference item with combo box widget which is editable
+  according to the specified input type (integer, double or string values).
+
+  \param type input type (QtxPagePrefSelectItem::InputType)
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefSelectItem::QtxPagePrefSelectItem( const int type, const QString& title, QtxPreferenceItem* parent,
+                                              const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param ),
+  myType( type )
+{
+  setControl( mySelector = new QtxComboBox() );
+  mySelector->setDuplicatesEnabled( false );
+  updateSelector();
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefSelectItem::~QtxPagePrefSelectItem()
+{
+}
+
+/*!
+  \brief Get edit box preference item input type.
+  \return preference item input type (QtxPagePrefSelectItem::InputType)
+  \sa setInputType()
+*/
+int QtxPagePrefSelectItem::inputType() const
+{
+  return myType;
+}
+
+/*!
+  \brief Set edit box preference item input type.
+  \param type new preference item input type (QtxPagePrefSelectItem::InputType)
+  \sa inputType()
+*/
+void QtxPagePrefSelectItem::setInputType( const int type )
+{
+  if ( myType == type )
+    return;
+
+  myType = type;
+  updateSelector();
+}
+
+/*!
+  \brief Get the list of the values from the selection widget.
+  \return list of values
+  \sa numbers(), setStrings()
+*/
+QStringList QtxPagePrefSelectItem::strings() const
+{
+  QStringList res;
+  for ( uint i = 0; i < mySelector->count(); i++ )
+    res.append( mySelector->itemText( i ) );
+  return res;
+}
+
+/*!
+  \brief Get the list of the values identifiers from the selection widget.
+  \return list of values IDs
+  \sa strings(), setNumbers()
+*/
+QList<int> QtxPagePrefSelectItem::numbers() const
+{
+  QList<int> res;
+  for ( uint i = 0; i < mySelector->count(); i++ )
+  {
+    if ( mySelector->hasId( i ) )
+      res.append( mySelector->id( i ) );
+  }
+  return res;
+}
+
+/*!
+  \brief Set the list of the values to the selection widget.
+  \param lst new list of values
+  \sa strings(), setNumbers()
+*/
+void QtxPagePrefSelectItem::setStrings( const QStringList& lst )
+{
+  mySelector->clear();
+  mySelector->addItems( lst );
+}
+
+/*!
+  \brief Set the list of the values identifiers to the selection widget.
+  \param ids new list of values IDs
+  \sa numbers(), setStrings()
+*/
+void QtxPagePrefSelectItem::setNumbers( const QList<int>& ids )
+{
+  uint i = 0;
+  for ( QList<int>::const_iterator it = ids.begin(); it != ids.end() && i < mySelector->count(); ++it, i++ )
+    mySelector->setId( i, *it );
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefSelectItem::store()
+{
+  if ( mySelector->isCleared() )
+    return;
+
+  int idx = mySelector->currentIndex();
+
+  if ( mySelector->hasId( idx ) )
+    setInteger( mySelector->id( idx ) );
+  else if ( idx >= 0 )
+    setString( mySelector->itemText( idx ) );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefSelectItem::retrieve()
+{
+  QString txt = getString();
+
+  int idx = -1;
+
+  bool ok = false;
+  int num = txt.toInt( &ok );
+  if ( ok )
+    idx = mySelector->index( num );
+  else
+  {
+    for ( uint i = 0; i < mySelector->count() && idx == -1; i++ )
+    {
+      if ( mySelector->itemText( i ) == txt )
+        idx = i;
+    }
+  }
+
+  if ( idx != -1 )
+    mySelector->setCurrentIndex( idx );
+  else if ( mySelector->isEditable() )
+  {
+    int pos = 0;
+    if ( mySelector->validator() &&
+         mySelector->validator()->validate( txt, pos ) == QValidator::Invalid )
+      mySelector->setCleared( true );
+    else
+    {
+      mySelector->setCleared( false );
+      mySelector->addItem( txt );
+      mySelector->setCurrentIndex( mySelector->count() - 1 );
+    }
+  }
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefSelectItem::optionValue( const QString& name ) const
+{
+  if ( name == "input_type" || name == "type" )
+    return inputType();
+  else if ( name == "strings" || name == "labels" )
+    return strings();
+  else if ( name == "numbers" || name == "ids" || name == "indexes" )
+  {
+    QList<QVariant> lst;
+    QList<int> nums = numbers();
+    for ( QList<int>::const_iterator it = nums.begin(); it != nums.end(); ++it )
+      lst.append( *it );
+    return lst;
+  }
+  else
+    return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefSelectItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "input_type" || name == "type" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setInputType( val.toInt() );
+  }
+  else if ( name == "strings" || name == "labels" )
+    setStrings( val );
+  else if ( name == "numbers" || name == "ids" || name == "indexes" )
+    setNumbers( val );
+  else
+    QtxPageNamedPrefItem::setOptionValue( name, val );
+}
+
+/*!
+  \brief Set the list of the values from the resource manager.
+  \param var new values list
+  \internal
+*/
+void QtxPagePrefSelectItem::setStrings( const QVariant& var )
+{
+  if ( var.type() != QVariant::StringList )
+    return;
+
+  setStrings( var.toStringList() );
+}
+
+/*!
+  \brief Set the list of the values identifiers from the resource manager.
+  \param var new values IDs list
+  \internal
+*/
+void QtxPagePrefSelectItem::setNumbers( const QVariant& var )
+{
+  if ( var.type() != QVariant::List )
+    return;
+
+  QList<int> lst;
+  QList<QVariant> varList = var.toList();
+  for ( QList<QVariant>::const_iterator it = varList.begin(); it != varList.end(); ++it )
+  {
+    if ( (*it).canConvert( QVariant::Int ) )
+      lst.append( (*it).toInt() );
+  }
+  setNumbers( lst );
+}
+
+/*!
+  \brief Update selector widget.
+*/
+void QtxPagePrefSelectItem::updateSelector()
+{
+  QValidator* val = 0;
+  switch ( inputType() )
+  {
+  case Integer:
+    val = new QIntValidator( mySelector );
+    break;
+  case Double:
+    val = new QDoubleValidator( mySelector );
+    break;
+  default:
+    break;
+  }
+
+  mySelector->setEditable( inputType() != NoInput );
+
+  if ( mySelector->isEditable() && !mySelector->currentText().isEmpty() && val )
+  {
+    int pos = 0;
+    QString str = mySelector->currentText();
+    if ( val->validate( str, pos ) == QValidator::Invalid )
+      mySelector->clearEditText();
+  }
+
+  delete mySelector->validator();
+  mySelector->setValidator( val );
+}
+
+/*!
+  \class QtxPagePrefSpinItem
+  \brief GUI implementation of the resources spin box item
+  (for integer or double value).
+*/
+
+/*!
+  \brief Constructor.
+
+  Creates spin box preference item for the entering integer values.
+
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefSpinItem::QtxPagePrefSpinItem( const QString& title, QtxPreferenceItem* parent,
+                                          const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param ),
+  myType( Integer )
+{
+  updateSpinBox();
+}
+
+/*!
+  \brief Constructor.
+
+  Creates spin box preference item for the entering values which type
+  is specified by the parameter \a type.
+
+  \param type input type (QtxPagePrefSpinItem::InputType).
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefSpinItem::QtxPagePrefSpinItem( const int type, const QString& title,
+                                          QtxPreferenceItem* parent, const QString& sect,
+                                         const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param ),
+  myType( type )
+{
+  updateSpinBox();
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefSpinItem::~QtxPagePrefSpinItem()
+{
+}
+
+/*!
+  \brief Get spin box preference item input type.
+  \return preference item input type (QtxPagePrefSpinItem::InputType)
+  \sa setInputType()
+*/
+int QtxPagePrefSpinItem::inputType() const
+{
+  return myType;
+}
+
+/*!
+  \brief Set spin box preference item input type.
+  \param type new preference item input type (QtxPagePrefSpinItem::InputType)
+  \sa inputType()
+*/
+void QtxPagePrefSpinItem::setInputType( const int type )
+{
+  if ( myType == type )
+    return;
+
+  myType = type;
+  updateSpinBox();
+}
+
+/*!
+  \brief Get spin box preference item step value.
+  \return spin box single step value
+  \sa setStep()
+*/
+QVariant QtxPagePrefSpinItem::step() const
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+    return isb->singleStep();
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+    return dsb->singleStep();
+  else
+    return QVariant();
+}
+
+/*!
+  \brief Get spin box preference item minimum value.
+  \return spin box minimum value
+  \sa setMinimum()
+*/
+QVariant QtxPagePrefSpinItem::minimum() const
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+    return isb->minimum();
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+    return dsb->minimum();
+  else
+    return QVariant();
+}
+
+/*!
+  \brief Get spin box preference item maximum value.
+  \return spin box maximum value
+  \sa setMaximum()
+*/
+QVariant QtxPagePrefSpinItem::maximum() const
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+    return isb->maximum();
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+    return dsb->maximum();
+  else
+    return QVariant();
+}
+
+/*!
+  \brief Get spin box preference item prefix string.
+  \return spin box prefix string
+  \sa setPrefix()
+*/
+QString QtxPagePrefSpinItem::prefix() const
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+    return isb->prefix();
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+    return dsb->prefix();
+  else
+    return QString();
+}
+
+/*!
+  \brief Get spin box preference item suffix string.
+  \return spin box suffix string
+  \sa setSuffix()
+*/
+QString QtxPagePrefSpinItem::suffix() const
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+    return isb->suffix();
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+    return dsb->suffix();
+  else
+    return QString();
+}
+
+/*!
+  \brief Get spin box preference item special value text (which is shown
+  when the spin box reaches minimum value).
+  \return spin box special value text
+  \sa setSpecialValueText()
+*/
+QString QtxPagePrefSpinItem::specialValueText() const
+{
+  QAbstractSpinBox* sb = ::qobject_cast<QAbstractSpinBox*>( control() );
+  if ( sb )
+    return sb->specialValueText();
+  else
+    return QString();
+}
+
+/*!
+  \brief Set spin box preference item step value.
+  \param step new spin box single step value
+  \sa step()
+*/
+void QtxPagePrefSpinItem::setStep( const QVariant& step )
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+  {
+    if ( step.canConvert( QVariant::Int ) )
+      isb->setSingleStep( step.toInt() );
+  }
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+  {
+    if ( step.canConvert( QVariant::Double ) )
+      dsb->setSingleStep( step.toDouble() );
+  }
+}
+
+/*!
+  \brief Set spin box preference item minimum value.
+  \param min new spin box minimum value
+  \sa minimum()
+*/
+void QtxPagePrefSpinItem::setMinimum( const QVariant& min )
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+  {
+    if ( min.canConvert( QVariant::Int ) )
+      isb->setMinimum( min.toInt() );
+  }
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+  {
+    if ( min.canConvert( QVariant::Double ) )
+      dsb->setMinimum( min.toDouble() );
+  }
+}
+
+/*!
+  \brief Set spin box preference item maximum value.
+  \param min new spin box maximum value
+  \sa maximum()
+*/
+void QtxPagePrefSpinItem::setMaximum( const QVariant& max )
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+  {
+    if ( max.canConvert( QVariant::Int ) )
+      isb->setMaximum( max.toInt() );
+  }
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+  {
+    if ( max.canConvert( QVariant::Double ) )
+      dsb->setMaximum( max.toDouble() );
+  }
+}
+
+/*!
+  \brief Set spin box preference item prefix string.
+  \param txt new spin box prefix string
+  \sa prefix()
+*/
+void QtxPagePrefSpinItem::setPrefix( const QString& txt )
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+    isb->setPrefix( txt );
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+    dsb->setPrefix( txt );
+}
+
+/*!
+  \brief Set spin box preference item suffix string.
+  \param txt new spin box suffix string
+  \sa suffix()
+*/
+void QtxPagePrefSpinItem::setSuffix( const QString& txt )
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+    isb->setSuffix( txt );
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+    dsb->setSuffix( txt );
+}
+
+/*!
+  \brief Set spin box preference item special value text (which is shown
+  when the spin box reaches minimum value).
+  \param txt new spin box special value text
+  \sa specialValueText()
+*/
+void QtxPagePrefSpinItem::setSpecialValueText( const QString& txt )
+{
+  QAbstractSpinBox* sb = ::qobject_cast<QAbstractSpinBox*>( control() );
+  if ( sb )
+    sb->setSpecialValueText( txt );
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefSpinItem::store()
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+    setInteger( isb->value() );
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+    setDouble( dsb->value() );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefSpinItem::retrieve()
+{
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+    isb->setValue( getInteger( isb->value() ) );
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+    dsb->setValue( getDouble( dsb->value() ) );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefSpinItem::optionValue( const QString& name ) const
+{
+  if ( name == "input_type" || name == "type" )
+    return inputType();
+  else if ( name == "minimum" || name == "min" )
+    return minimum();
+  else if ( name == "maximum" || name == "max" )
+    return maximum();
+  else if ( name == "step" )
+    return step();
+  else if ( name == "prefix" )
+    return prefix();
+  else if ( name == "suffix" )
+    return suffix();
+  else if ( name == "special" )
+    return specialValueText();
+  else
+    return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefSpinItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "input_type" || name == "type" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setInputType( val.toInt() );
+  }
+  else if ( name == "minimum" || name == "min" )
+    setMinimum( val );
+  else if ( name == "maximum" || name == "max" )
+    setMaximum( val );
+  else if ( name == "step" )
+    setStep( val );
+  else if ( name == "prefix" )
+  {
+    if ( val.canConvert( QVariant::String ) )
+      setPrefix( val.toString() );
+  }
+  else if ( name == "suffix" )
+  {
+    if ( val.canConvert( QVariant::String ) )
+      setSuffix( val.toString() );
+  }
+  else if ( name == "special" )
+  {
+    if ( val.canConvert( QVariant::String ) )
+      setSpecialValueText( val.toString() );
+  }
+  else
+    QtxPageNamedPrefItem::setOptionValue( name, val );
+}
+
+/*!
+  \brief Update spin box widget.
+*/
+void QtxPagePrefSpinItem::updateSpinBox()
+{
+  QVariant val;
+  QVariant stp = step();
+  QVariant min = minimum();
+  QVariant max = maximum();
+
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+    val = isb->value();
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+    val = dsb->value();
+
+  switch ( inputType() )
+  {
+  case Integer:
+    setControl( new QtxIntSpinBox() );
+    break;
+  case Double:
+    setControl( new QtxDoubleSpinBox() );
+    break;
+  default:
+    break;
+  }
+
+  control()->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+
+  setStep( stp );
+  setMinimum( min );
+  setMaximum( max );
+
+  if ( QtxIntSpinBox* isb = ::qobject_cast<QtxIntSpinBox*>( control() ) )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      isb->setValue( val.toInt() );
+  }
+  else if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+  {
+    if ( val.canConvert( QVariant::Double ) )
+      dsb->setValue( val.toDouble() );
+  }
+}
+
+/*!
+  \class  QtxPagePrefTextItem
+  \brief GUI implementation of the resources text box edit item
+  (for large text data).
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefTextItem::QtxPagePrefTextItem( QtxPreferenceItem* parent, const QString& sect,
+                                         const QString& param )
+: QtxPageNamedPrefItem( QString(), parent, sect, param )
+{
+  myEditor = new QTextEdit();
+  myEditor->setAcceptRichText( false );
+
+  setControl( myEditor );
+}
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefTextItem::QtxPagePrefTextItem( const QString& title, QtxPreferenceItem* parent,
+                                          const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  myEditor = new QTextEdit();
+  myEditor->setAcceptRichText( false );
+
+  setControl( myEditor );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefTextItem::~QtxPagePrefTextItem()
+{
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefTextItem::store()
+{
+  setString( myEditor->toPlainText() );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefTextItem::retrieve()
+{
+  myEditor->setPlainText( getString() );
+}
+
+/*!
+  \class QtxPagePrefColorItem
+  \brief GUI implementation of the resources color item.
+*/
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefColorItem::QtxPagePrefColorItem( const QString& title, QtxPreferenceItem* parent,
+                                            const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  //  QtxPagePrefGroupItem* aGroup 0; //= dynamic_cast<QtxPagePrefGroupItem*>( parent );
+
+  //  setControl( myColor = new QtxColorButton( aGroup ? aGroup->gridBox() : 0 ) );
+  setControl( myColor = new QtxColorButton( 0 ) );
+  myColor->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefColorItem::~QtxPagePrefColorItem()
+{
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefColorItem::store()
+{
+  setColor( myColor->color() );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefColorItem::retrieve()
+{
+  myColor->setColor( getColor() );
+}
+
+/*!
+  \class QtxPagePrefFontItem
+  \brief GUI implementation of the resources font item.
+*/
+
+/*!
+  \brief Constructor.
+  \param feat font editor widget features (QtxFontEdit::Features)
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefFontItem::QtxPagePrefFontItem( const int feat, const QString& title,
+                                          QtxPreferenceItem* parent, const QString& sect,
+                                         const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  setControl( myFont = new QtxFontEdit( feat ) );
+}
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefFontItem::QtxPagePrefFontItem( const QString& title, QtxPreferenceItem* parent,
+                                          const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  setControl( myFont = new QtxFontEdit() );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefFontItem::~QtxPagePrefFontItem()
+{
+}
+
+/*!
+  \brief Get font widget features.
+  \return font widget features (ORed QtxFontEdit::Features flags)
+  \sa setFeatures()
+*/
+int QtxPagePrefFontItem::features() const
+{
+  return myFont->features();
+}
+
+/*!
+  \brief Set font widget features.
+  \param f new font widget features (ORed QtxFontEdit::Features flags)
+  \sa features()
+*/
+void QtxPagePrefFontItem::setFeatures( const int f )
+{
+  myFont->setFeatures( f );
+}
+
+/*!
+  \brief Specifies whether widget works in Native or Custom mode. Native mode 
+  is intended for working with system fonts. Custom mode is intended for 
+  working with manually defined set of fonts. Set of custom fonts can be 
+  specified with setFonts() method 
+  \param mode mode from QtxFontEdit::Mode enumeration
+  \sa mode()
+*/
+void QtxPagePrefFontItem::setMode( const int mode )
+{
+  myFont->setMode( mode );
+}
+
+/*!
+  \brief Verifies whether widget works in Native or Custom mode
+  \return Native or Custom mode
+  \sa setMode()
+*/
+int QtxPagePrefFontItem::mode() const
+{
+  return myFont->mode();
+}
+
+/*!
+  \brief Sets list of custom fonts. 
+  <b>This method is intended for working in Custom mode only.</b>
+  \param fams list of families
+  \sa fonts(), setMode()
+*/
+void QtxPagePrefFontItem::setFonts( const QStringList& fams )
+{
+  myFont->setFonts( fams );
+}
+
+/*!
+  \brief Gets list of custom fonts 
+  \return list of families
+  \sa setFonts(), setMode()
+*/
+QStringList QtxPagePrefFontItem::fonts() const
+{
+  return myFont->fonts();
+}
+
+/*!
+  \brief Sets list of available font sizes. 
+  <b>This method is intended for working in Custom mode only.</b> The list of sizes can 
+  be empty. In this case system generate listof size automatically from 8 till 72.
+  \param sizes list of sizes
+  \sa sizes(), setMode()
+*/
+void QtxPagePrefFontItem::setSizes( const QList<int>& sizes )
+{
+  myFont->setSizes( sizes );
+}
+
+/*!
+  \brief Gets list of custom fonts 
+  \return list of families
+  \sa setFonts(), setMode()
+*/
+QList<int> QtxPagePrefFontItem::sizes() const
+{
+  return myFont->sizes();
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefFontItem::store()
+{
+  setFont( myFont->currentFont() );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefFontItem::retrieve()
+{
+  myFont->setCurrentFont( getFont() );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefFontItem::optionValue( const QString& name ) const
+{
+  if ( name == "features" )
+    return features();
+  else if ( name == "mode" )
+    return mode();
+  else if ( name == "fonts" || name == "families" )
+    return fonts();
+  else if ( name == "sizes" )
+  {
+    QList<QVariant> lst;
+    QList<int> nums = sizes();
+    for ( QList<int>::const_iterator it = nums.begin(); it != nums.end(); ++it )
+      lst.append( *it );
+    return lst;
+  }
+  else
+    return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefFontItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "features" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setFeatures( val.toInt() );
+  }
+  else if ( name == "mode" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setMode( val.toInt() );
+  }
+  else if ( name == "fonts" || name == "families" )
+  {
+    if ( val.canConvert( QVariant::StringList ) )
+      setFonts( val.toStringList() );
+  }
+  else if ( name == "sizes" )
+  {
+    if ( val.type() == QVariant::List )
+    {
+      QList<int> lst;
+      QList<QVariant> varList = val.toList();
+      for ( QList<QVariant>::const_iterator it = varList.begin(); it != varList.end(); ++it )
+      {
+        if ( (*it).canConvert( QVariant::Int ) )
+          lst.append( (*it).toInt() );
+      }
+      setSizes( lst );
+    }
+  }
+  else
+    QtxPageNamedPrefItem::setOptionValue( name, val );
+}
+
+/*!
+  \class  QtxPagePrefPathItem
+  \brief GUI implementation of the resources file/directory path item.
+*/
+
+/*!
+  \brief Constructor.
+  \param type path widget mode (Qtx::PathType )
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefPathItem::QtxPagePrefPathItem( const Qtx::PathType type, const QString& title,
+                                          QtxPreferenceItem* parent, const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  setControl( myPath = new QtxPathEdit( type ) );
+}
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefPathItem::QtxPagePrefPathItem( const QString& title, QtxPreferenceItem* parent,
+                                          const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  setControl( myPath = new QtxPathEdit() );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefPathItem::~QtxPagePrefPathItem()
+{
+}
+
+/*!
+  \brief Get path widget mode.
+  \return current path widget mode (Qtx::PathType)
+  \sa setPathType()
+*/
+Qtx::PathType QtxPagePrefPathItem::pathType() const
+{
+  return myPath->pathType();
+}
+
+/*!
+  \brief Set path widget mode.
+  \param type new path widget mode (Qtx::PathType)
+  \sa pathType()
+*/
+void QtxPagePrefPathItem::setPathType( const Qtx::PathType type )
+{
+  myPath->setPathType( type );
+}
+
+/*!
+  \brief Get currently used path widget filters.
+  \return file or directory path filters
+  \sa setPathFilter()
+*/
+QString QtxPagePrefPathItem::pathFilter() const
+{
+  return myPath->pathFilter();
+}
+
+/*!
+  \brief Set path widget filters.
+  \param f new file or directory path filters
+  \sa pathFilter()
+*/
+void QtxPagePrefPathItem::setPathFilter( const QString& f )
+{
+  myPath->setPathFilter( f );
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefPathItem::store()
+{
+  setString( myPath->path() );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefPathItem::retrieve()
+{
+  myPath->setPath( getString() );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefPathItem::optionValue( const QString& name ) const
+{
+  if ( name == "path_type" )
+    return pathType();
+  else if ( name == "path_filter" )
+    return pathFilter();
+  else
+    return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefPathItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "path_type" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setPathType( (Qtx::PathType)val.toInt() );
+  }
+  else if ( name == "path_filter" )
+  {
+    if ( val.canConvert( QVariant::String ) )
+      setPathFilter( val.toString() );
+  }
+  else
+    QtxPageNamedPrefItem::setOptionValue( name, val );
+}
+
+/*!
+  \class QtxPagePrefPathListItem
+  \brief GUI implementation of the resources files/directories list item.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefPathListItem::QtxPagePrefPathListItem( QtxPreferenceItem* parent,
+                                                  const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( QString(), parent, sect, param )
+{
+  setControl( myPaths = new QtxPathListEdit() );
+}
+
+/*!
+  \brief Constructor.
+  \param type path list widget mode (Qtx::PathType)
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefPathListItem::QtxPagePrefPathListItem( const Qtx::PathType type, const QString& title,
+                                                  QtxPreferenceItem* parent, const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  setControl( myPaths = new QtxPathListEdit( type ) );
+}
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefPathListItem::QtxPagePrefPathListItem( const QString& title, QtxPreferenceItem* parent,
+                                                  const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  setControl( myPaths = new QtxPathListEdit() );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefPathListItem::~QtxPagePrefPathListItem()
+{
+}
+
+/*!
+  \brief Get path list widget mode.
+  \return currently used path list widget mode (Qtx::PathType)
+  \sa setPathType()
+*/
+Qtx::PathType QtxPagePrefPathListItem::pathType() const
+{
+  return myPaths->pathType();
+}
+
+/*!
+  \brief Set path list widget mode.
+  \param type new path list widget mode (Qtx::PathType)
+  \sa pathType()
+*/
+void QtxPagePrefPathListItem::setPathType( const Qtx::PathType type )
+{
+  myPaths->setPathType( type );
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefPathListItem::store()
+{
+  setString( myPaths->pathList().join( ";" ) );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefPathListItem::retrieve()
+{
+  myPaths->setPathList( getString().split( ";" ) );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefPathListItem::optionValue( const QString& name ) const
+{
+  if ( name == "path_type" )
+    return pathType();
+  else
+    return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefPathListItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "path_type" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setPathType( (Qtx::PathType)val.toInt() );
+  }
+  else
+    QtxPageNamedPrefItem::setOptionValue( name, val );
+}
+
+/*!
+  \class  QtxPagePrefDateTimeItem
+  \brief GUI implementation of resources date/time item.
+*/
+
+/*!
+  \brief Constructor.
+
+  Creates an item to enter date and time.
+
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefDateTimeItem::QtxPagePrefDateTimeItem( const QString& title, QtxPreferenceItem* parent,
+                                                  const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param ),
+  myType( DateTime )
+{
+  setControl( myDateTime = new QDateTimeEdit() );
+  myDateTime->setCalendarPopup( true );
+  myDateTime->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+  updateDateTime();
+}
+
+/*!
+  \brief Constructor.
+
+  Creates preference item for editing of the date and/or time value:
+  the type is specified by parameter \a type.
+
+  \param type preference item input type (QtxPagePrefDateTimeItem::InputType)
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefDateTimeItem::QtxPagePrefDateTimeItem( const int type, const QString& title, QtxPreferenceItem* parent,
+                                                  const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param ),
+  myType( type )
+{
+  setControl( myDateTime = new QDateTimeEdit() );
+  myDateTime->setCalendarPopup( true );
+  myDateTime->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+  updateDateTime();
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefDateTimeItem::~QtxPagePrefDateTimeItem()
+{
+}
+
+/*!
+  \brief Get date/time box preference item input type.
+  \return preference item input type (QtxPagePrefDateTimeItem::InputType)
+  \sa setInputType()
+*/
+int QtxPagePrefDateTimeItem::inputType() const
+{
+  return myType;
+}
+
+/*!
+  \brief Set date/time box preference item input type.
+  \param type new preference item input type (QtxPagePrefDateTimeItem::InputType)
+  \sa inputType()
+*/
+void QtxPagePrefDateTimeItem::setInputType( const int type )
+{
+  if ( myType == type )
+    return;
+
+  myType = type;
+  updateDateTime();
+}
+
+/*!
+  \brief Check if the popup calendar menu is enabled.
+  \return \c true if calendar popup menu is enabled
+*/
+bool QtxPagePrefDateTimeItem::calendar() const
+{
+  return myDateTime->calendarPopup();
+}
+
+/*!
+  \brief Enable/disable popup calendar menu.
+  \param on new flag state
+*/
+void QtxPagePrefDateTimeItem::setCalendar( const bool on )
+{
+  myDateTime->setCalendarPopup( on );
+}
+
+/*!
+  \brief Get maximum date value.
+  \return maximum date value
+  \sa setMaximumDate(), minimumDate(), maximumTime(), minimumTime()
+*/
+QDate QtxPagePrefDateTimeItem::maximumDate() const
+{
+  return myDateTime->maximumDate();
+}
+
+/*!
+  \brief Get maximum time value.
+  \return maximum time value
+  \sa setMaximumTime(), minimumTime(), maximumDate(), minimumDate()
+*/
+QTime QtxPagePrefDateTimeItem::maximumTime() const
+{
+  return myDateTime->maximumTime();
+}
+
+/*!
+  \brief Get minimum date value.
+  \return minimum date value
+  \sa setMinimumDate(), maximumDate(), maximumTime(), minimumTime()
+*/
+QDate QtxPagePrefDateTimeItem::minimumDate() const
+{
+  return myDateTime->minimumDate();
+}
+
+/*!
+  \brief Get minimum time value.
+  \return maximum time value
+  \sa setMinimumTime(), maximumTime(), maximumDate(), minimumDate()
+*/
+QTime QtxPagePrefDateTimeItem::minimumTime() const
+{
+  return myDateTime->minimumTime();
+}
+
+/*!
+  \brief Set maximum date value.
+  \param d new maximum date value
+  \sa maximumDate(), minimumDate(), maximumTime(), minimumTime()
+*/
+void QtxPagePrefDateTimeItem::setMaximumDate( const QDate& d )
+{
+  if ( d.isValid() )
+    myDateTime->setMaximumDate( d );
+  else
+    myDateTime->clearMaximumDate();
+}
+
+/*!
+  \brief Set maximum time value.
+  \param t new maximum time value
+  \sa maximumTime(), minimumTime(), maximumDate(), minimumDate()
+*/
+void QtxPagePrefDateTimeItem::setMaximumTime( const QTime& t )
+{
+  if ( t.isValid() )
+    myDateTime->setMaximumTime( t );
+  else
+    myDateTime->clearMaximumTime();
+}
+
+/*!
+  \brief Set minimum date value.
+  \param d new minimum date value
+  \sa minimumDate(), maximumDate(), maximumTime(), minimumTime()
+*/
+void QtxPagePrefDateTimeItem::setMinimumDate( const QDate& d )
+{
+  if ( d.isValid() )
+    myDateTime->setMinimumDate( d );
+  else
+    myDateTime->clearMinimumDate();
+}
+
+/*!
+  \brief Set minimum time value.
+  \param t new minimum time value
+  \sa minimumTime(), maximumTime(), maximumDate(), minimumDate()
+*/
+void QtxPagePrefDateTimeItem::setMinimumTime( const QTime& t )
+{
+  if ( t.isValid() )
+    myDateTime->setMinimumTime( t );
+  else
+    myDateTime->clearMinimumTime();
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefDateTimeItem::store()
+{
+  QString str;
+  switch ( inputType() )
+  {
+  case Date:
+    str = myDateTime->date().toString( Qt::ISODate );
+    break;
+  case Time:
+    str = myDateTime->time().toString( Qt::ISODate );
+    break;
+  case DateTime:
+    str = myDateTime->dateTime().toString( Qt::ISODate );
+    break;
+  }
+
+  setString( str );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefDateTimeItem::retrieve()
+{
+  QString str = getString();
+  switch ( inputType() )
+  {
+  case Date:
+    myDateTime->setDate( QDate::fromString( str, Qt::ISODate ) );
+    break;
+  case Time:
+    myDateTime->setTime( QTime::fromString( str, Qt::ISODate ) );
+    break;
+  case DateTime:
+    myDateTime->setDateTime( QDateTime::fromString( str, Qt::ISODate ) );
+    break;
+  }
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefDateTimeItem::optionValue( const QString& name ) const
+{
+  if ( name == "input_type" || name == "type" )
+    return inputType();
+  else if ( name == "minimum_date" || name == "min_date" )
+    return minimumDate();
+  else if ( name == "maximum_date" || name == "max_date" )
+    return maximumDate();
+  else if ( name == "minimum_time" || name == "min_time" )
+    return minimumTime();
+  else if ( name == "maximum_time" || name == "max_time" )
+    return maximumTime();
+  else
+    return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefDateTimeItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "input_type" || name == "type" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setInputType( val.toInt() );
+  }
+  else if ( name == "minimum_date" || name == "min_date" )
+  {
+    if ( val.canConvert( QVariant::Date ) )
+      setMinimumDate( val.toDate() );
+  }
+  else if ( name == "maximum_date" || name == "max_date" )
+  {
+    if ( val.canConvert( QVariant::Date ) )
+      setMaximumDate( val.toDate() );
+  }
+  else if ( name == "minimum_time" || name == "min_time" )
+  {
+    if ( val.canConvert( QVariant::Time ) )
+      setMinimumTime( val.toTime() );
+  }
+  else if ( name == "maximum_time" || name == "max_time" )
+  {
+    if ( val.canConvert( QVariant::Time ) )
+      setMaximumTime( val.toTime() );
+  }
+  else
+    QtxPageNamedPrefItem::setOptionValue( name, val );
+}
+
+/*!
+  \brief Update date/time widget.
+*/
+void QtxPagePrefDateTimeItem::updateDateTime()
+{
+  QString dispFmt;
+  switch ( inputType() )
+  {
+  case Date:
+    dispFmt = QDateEdit().displayFormat();
+    break;
+  case Time:
+    dispFmt = QTimeEdit().displayFormat();
+    break;
+  case DateTime:
+    dispFmt = QDateTimeEdit().displayFormat();
+    break;
+  }
+
+  myDateTime->setDisplayFormat( dispFmt );
+}
diff --git a/src/Qtx/QtxPagePrefMgr.h b/src/Qtx/QtxPagePrefMgr.h
new file mode 100644 (file)
index 0000000..28fada6
--- /dev/null
@@ -0,0 +1,661 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxPagePrefMgr.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXPAGEPREFMGR_H
+#define QTXPAGEPREFMGR_H
+
+#include "QtxPreferenceMgr.h"
+
+#include "QtxPathEdit.h"
+#include "QtxPathListEdit.h"
+
+#include <QFrame>
+#include <QLabel>
+#include <QPointer>
+
+class QtxGridBox;
+class QtxFontEdit;
+class QtxGroupBox;
+class QtxComboBox;
+class QtxColorButton;
+
+class QToolBox;
+class QLineEdit;
+class QTextEdit;
+class QCheckBox;
+class QTabWidget;
+class QToolButton;
+class QListWidget;
+class QFileDialog;
+class QDateTimeEdit;
+class QStackedWidget;
+
+class QTX_EXPORT QtxPagePrefMgr : public QFrame, public QtxPreferenceMgr
+{
+  Q_OBJECT
+
+public:
+  QtxPagePrefMgr( QtxResourceMgr*, QWidget* = 0 );
+  virtual ~QtxPagePrefMgr();
+
+  virtual QSize    sizeHint() const;
+  virtual QSize    minimumSizeHint() const;
+
+  virtual void     updateContents();
+
+signals:
+  void             resourceChanged( int );
+  void             resourceChanged( QString&, QString& );
+  void             resourcesChanged( const QMap<int, QString>& );
+
+public slots:
+  virtual void     setVisible( bool );
+
+protected:
+  virtual void     itemAdded( QtxPreferenceItem* );
+  virtual void     itemRemoved( QtxPreferenceItem* );
+  virtual void     itemChanged( QtxPreferenceItem* );
+
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private:
+  void             initialize() const;
+  void             initialize( QtxPreferenceItem* );
+
+private:
+  QtxGridBox*      myBox;
+  bool             myInit;
+};
+
+class QTX_EXPORT QtxPagePrefItem : public QtxPreferenceItem
+{
+  class Listener;
+
+public:
+  QtxPagePrefItem( const QString&, QtxPreferenceItem* = 0,
+                   const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefItem();
+
+  QWidget*          widget() const;
+
+  virtual void      activate();
+
+protected:
+  void              setWidget( QWidget* );
+
+  virtual void      itemAdded( QtxPreferenceItem* );
+  virtual void      itemRemoved( QtxPreferenceItem* );
+  virtual void      itemChanged( QtxPreferenceItem* );
+
+  void              pageChildItems( QList<QtxPagePrefItem*>&, const bool = false ) const;
+
+  virtual void      store();
+  virtual void      retrieve();
+
+  virtual void      widgetShown();
+  virtual void      widgetHided();
+
+  virtual void      ensureVisible( QtxPreferenceItem* );
+
+private:
+  virtual void      contentChanged();
+
+private:
+  QPointer<QWidget> myWidget;
+  Listener*         myListener;
+};
+
+class QTX_EXPORT QtxPageNamedPrefItem : public QtxPagePrefItem
+{
+public:
+  QtxPageNamedPrefItem( const QString&, QtxPreferenceItem* = 0,
+                        const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPageNamedPrefItem();
+
+  virtual void      setTitle( const QString& );
+
+  static void       adjustLabels( QtxPagePrefItem* );
+
+protected:
+  QLabel*           label() const;
+  QWidget*          control() const;
+
+  void              setControl( QWidget* );
+
+private:
+  QPointer<QLabel>  myLabel;
+  QPointer<QWidget> myControl;
+};
+
+class QTX_EXPORT QtxPagePrefListItem : public QObject, public QtxPagePrefItem
+{
+  Q_OBJECT
+
+public:
+  QtxPagePrefListItem( const QString&, QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefListItem();
+
+  virtual void     updateContents();
+
+  QString          emptyInfo() const;
+  void             setEmptyInfo( const QString& );
+
+  bool             isFixedSize() const;
+  void             setFixedSize( const bool );
+
+private slots:
+  void             onItemSelectionChanged();
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+  virtual void     ensureVisible( QtxPreferenceItem* );
+
+  virtual void     widgetShown();
+
+private:
+  void             updateInfo();
+  void             updateGeom();
+  void             updateState();
+  void             updateVisible();
+
+  int              selected() const;
+  QtxPagePrefItem* selectedItem() const;
+  void             setSelected( const int );
+
+private:
+  bool             myFix;
+  QListWidget*     myList;
+  QStackedWidget*  myStack;
+
+  QString          myInfText;
+  QLabel*          myInfLabel;
+};
+
+class QTX_EXPORT QtxPagePrefToolBoxItem : public QtxPagePrefItem
+{
+public:
+  QtxPagePrefToolBoxItem( const QString&, QtxPreferenceItem* = 0,
+                          const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefToolBoxItem();
+
+  virtual void     updateContents();
+
+protected:
+  virtual void     ensureVisible( QtxPreferenceItem* );
+
+private:
+  void             updateToolBox();
+
+private:
+  QToolBox*        myToolBox;
+};
+
+class QTX_EXPORT QtxPagePrefTabsItem : public QtxPagePrefItem
+{
+public:
+  QtxPagePrefTabsItem( const QString&, QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefTabsItem();
+
+  virtual void     updateContents();
+
+  int              tabPosition() const;
+  void             setTabPosition( const int );
+
+  int              tabShape() const;
+  void             setTabShape( const int );
+
+  QSize            tabIconSize() const;
+  void             setTabIconSize( const QSize& );
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+  virtual void     ensureVisible( QtxPreferenceItem* );
+
+private:
+  void             updateTabs();
+
+private:
+  QTabWidget*      myTabs;
+};
+
+class QTX_EXPORT QtxPagePrefFrameItem : public QtxPagePrefItem
+{
+public:
+  QtxPagePrefFrameItem( const QString&, QtxPreferenceItem* = 0,
+                        const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefFrameItem();
+
+  virtual void     updateContents();
+
+  bool             stretch() const;
+  void             setStretch( const bool );
+
+  int              margin() const;
+  void             setMargin( const int );
+
+  int              spacing() const;
+  void             setSpacing( const int );
+
+  int              columns() const;
+  void             setColumns( const int );
+
+  Qt::Orientation  orientation() const;
+  void             setOrientation( const Qt::Orientation );
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+  virtual void     widgetShown();
+
+private:
+  void             updateFrame();
+
+private:
+  QtxGridBox*      myBox;
+};
+
+class QTX_EXPORT QtxPagePrefGroupItem : public QtxPagePrefItem
+{
+public:
+  QtxPagePrefGroupItem( const QString&, QtxPreferenceItem* = 0,
+                        const QString& = QString(), const QString& = QString() );
+  QtxPagePrefGroupItem( const int, const QString&, QtxPreferenceItem* = 0,
+                        const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefGroupItem();
+
+  virtual void     updateContents();
+
+  int              margin() const;
+  void             setMargin( const int );
+
+  int              spacing() const;
+  void             setSpacing( const int );
+
+  int              columns() const;
+  void             setColumns( const int );
+
+  Qt::Orientation  orientation() const;
+  void             setOrientation( const Qt::Orientation );
+
+  bool             isFlat() const;
+  void             setFlat( const bool );
+
+  virtual void     setResource( const QString&, const QString& );
+
+  virtual void     store();
+  virtual void     retrieve();
+
+  QtxGridBox*      gridBox() const;
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+  virtual void     widgetShown();
+
+private:
+  void             updateState();
+  void             updateGroup();
+
+private:
+  QtxGridBox*      myBox;
+  QtxGroupBox*     myGroup;
+};
+
+class QTX_EXPORT QtxPagePrefLabelItem : public QtxPagePrefItem
+{
+public:
+  QtxPagePrefLabelItem( const QString&, QtxPreferenceItem* = 0 );
+  QtxPagePrefLabelItem( Qt::Alignment, const QString&, QtxPreferenceItem* = 0 );
+  virtual ~QtxPagePrefLabelItem();
+
+  virtual void      setTitle( const QString& );
+
+  Qt::Alignment     alignment() const;
+  void              setAlignment( Qt::Alignment );
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private:
+  QPointer<QLabel>  myLabel;
+};
+
+class QTX_EXPORT QtxPagePrefSpaceItem : public QtxPagePrefItem
+{
+public:
+  QtxPagePrefSpaceItem( QtxPreferenceItem* = 0 );
+  QtxPagePrefSpaceItem( Qt::Orientation, QtxPreferenceItem* = 0 );
+  QtxPagePrefSpaceItem( const int, const int, QtxPreferenceItem* = 0 );
+  virtual ~QtxPagePrefSpaceItem();
+
+  int              size( Qt::Orientation ) const;
+  void             setSize( Qt::Orientation, const int );
+
+  int              stretch( Qt::Orientation ) const;
+  void             setStretch( Qt::Orientation, const int );
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private:
+  void             initialize( const int, const int, const int, const int );
+};
+
+class QTX_EXPORT QtxPagePrefCheckItem : public QtxPagePrefItem
+{
+public:
+  QtxPagePrefCheckItem( const QString&, QtxPreferenceItem* = 0,
+                        const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefCheckItem();
+
+  virtual void     setTitle( const QString& );
+
+  virtual void     store();
+  virtual void     retrieve();
+
+private:
+  QCheckBox*       myCheck;
+};
+
+class QTX_EXPORT QtxPagePrefEditItem : public QtxPageNamedPrefItem
+{
+public:
+  typedef enum { String, Integer, Double } InputType;
+
+public:
+  QtxPagePrefEditItem( const QString&, QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  QtxPagePrefEditItem( const int, const QString&, QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefEditItem();
+
+  int              inputType() const;
+  void             setInputType( const int );
+
+  virtual void     store();
+  virtual void     retrieve();
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private:
+  void             updateEditor();
+
+private:
+  int              myType;
+  QLineEdit*       myEditor;
+};
+
+class QTX_EXPORT QtxPagePrefSelectItem : public QtxPageNamedPrefItem
+{
+public:
+  typedef enum { NoInput, String, Integer, Double } InputType;
+
+public:
+  QtxPagePrefSelectItem( const QString&, QtxPreferenceItem* = 0,
+                         const QString& = QString(), const QString& = QString() );
+  QtxPagePrefSelectItem( const int, const QString&, QtxPreferenceItem* = 0,
+                         const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefSelectItem();
+
+  int              inputType() const;
+  void             setInputType( const int );
+
+  QStringList      strings() const;
+  QList<int>       numbers() const;
+
+  void             setStrings( const QStringList& );
+  void             setNumbers( const QList<int>& );
+
+  virtual void     store();
+  virtual void     retrieve();
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private:
+  void             updateSelector();
+  void             setStrings( const QVariant& );
+  void             setNumbers( const QVariant& );
+
+private:
+  int              myType;
+  QtxComboBox*     mySelector;
+};
+
+class QTX_EXPORT QtxPagePrefSpinItem : public QtxPageNamedPrefItem
+{
+public:
+  typedef enum { Integer, Double } InputType;
+
+public:
+  QtxPagePrefSpinItem( const QString&, QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  QtxPagePrefSpinItem( const int, const QString&, QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefSpinItem();
+
+  QVariant         step() const;
+  QVariant         minimum() const;
+  QVariant         maximum() const;
+
+  QString          prefix() const;
+  QString          suffix() const;
+  QString          specialValueText() const;
+
+  void             setStep( const QVariant& );
+  void             setMinimum( const QVariant& );
+  void             setMaximum( const QVariant& );
+
+  void             setPrefix( const QString& );
+  void             setSuffix( const QString& );
+  void             setSpecialValueText( const QString& );
+
+  int              inputType() const;
+  void             setInputType( const int );
+
+  virtual void     store();
+  virtual void     retrieve();
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private:
+  void             updateSpinBox();
+
+private:
+  int              myType;
+};
+
+class QTX_EXPORT QtxPagePrefTextItem : public QtxPageNamedPrefItem
+{
+public:
+  QtxPagePrefTextItem( QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  QtxPagePrefTextItem( const QString&, QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefTextItem();
+
+  virtual void     store();
+  virtual void     retrieve();
+
+private:
+  QTextEdit*       myEditor;
+};
+
+class QTX_EXPORT QtxPagePrefColorItem : public QtxPageNamedPrefItem
+{
+public:
+  QtxPagePrefColorItem( const QString&, QtxPreferenceItem* = 0,
+                        const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefColorItem();
+
+  virtual void     store();
+  virtual void     retrieve();
+
+private:
+  QtxColorButton*  myColor;
+};
+
+class QTX_EXPORT QtxPagePrefFontItem : public QObject, public QtxPageNamedPrefItem
+{
+  Q_OBJECT
+
+public:
+  QtxPagePrefFontItem( const int, const QString&, QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  QtxPagePrefFontItem( const QString&, QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefFontItem();
+
+  int              features() const;
+  void             setFeatures( const int );
+
+  void             setMode( const int );
+  int              mode() const;
+
+  void             setFonts( const QStringList& );
+  QStringList      fonts() const;
+
+  void             setSizes( const QList<int>& = QList<int>() );
+  QList<int>       sizes() const;
+
+  virtual void     store();
+  virtual void     retrieve();
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private:
+  QtxFontEdit*     myFont;
+};
+
+class QTX_EXPORT QtxPagePrefPathItem : public QtxPageNamedPrefItem
+{
+public:
+  QtxPagePrefPathItem( const Qtx::PathType, const QString&, QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  QtxPagePrefPathItem( const QString&, QtxPreferenceItem* = 0,
+                       const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefPathItem();
+
+  Qtx::PathType    pathType() const;
+  void             setPathType( const Qtx::PathType );
+
+  QString          pathFilter() const;
+  void             setPathFilter( const QString& );
+
+  virtual void     store();
+  virtual void     retrieve();
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private:
+  QtxPathEdit*     myPath;
+};
+
+class QTX_EXPORT QtxPagePrefPathListItem : public QtxPageNamedPrefItem
+{
+public:
+  QtxPagePrefPathListItem( QtxPreferenceItem* = 0,
+                           const QString& = QString(), const QString& = QString() );
+  QtxPagePrefPathListItem( const QString&, QtxPreferenceItem* = 0,
+                           const QString& = QString(), const QString& = QString() );
+  QtxPagePrefPathListItem( const Qtx::PathType, const QString&, QtxPreferenceItem* = 0,
+                           const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefPathListItem();
+
+  Qtx::PathType    pathType() const;
+  void             setPathType( const Qtx::PathType );
+
+  virtual void     store();
+  virtual void     retrieve();
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private:
+  QtxPathListEdit* myPaths;
+};
+
+class QTX_EXPORT QtxPagePrefDateTimeItem : public QtxPageNamedPrefItem
+{
+public:
+  typedef enum { Date, Time, DateTime } InputType;
+
+public:
+  QtxPagePrefDateTimeItem( const QString&, QtxPreferenceItem* = 0,
+                           const QString& = QString(), const QString& = QString() );
+  QtxPagePrefDateTimeItem( const int, const QString&, QtxPreferenceItem* = 0,
+                           const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefDateTimeItem();
+
+  int              inputType() const;
+  void             setInputType( const int );
+
+  bool             calendar() const;
+  void             setCalendar( const bool );
+
+  QDate            maximumDate() const;
+  QTime            maximumTime() const;
+  QDate            minimumDate() const;
+  QTime            minimumTime() const;
+
+  void             setMaximumDate( const QDate& );
+  void             setMaximumTime( const QTime& );
+  void             setMinimumDate( const QDate& );
+  void             setMinimumTime( const QTime& );
+
+  virtual void     store();
+  virtual void     retrieve();
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private:
+  void             updateDateTime();
+
+private:
+  int              myType;
+  QDateTimeEdit*   myDateTime;
+};
+
+#endif
diff --git a/src/Qtx/QtxParser.cxx b/src/Qtx/QtxParser.cxx
deleted file mode 100644 (file)
index b4b32bb..0000000
+++ /dev/null
@@ -1,850 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "QtxParser.h"
-#include "QtxOperations.h"
-
-/*!
-  Constructor
-*/
-QtxParser::QtxParser( QtxOperations* operations, const QString& expr )
-: myOperations( operations )
-{
-    if( myOperations )
-    {
-        setLastError( OK );
-        setExpr( expr );
-    }
-    else
-        setLastError( OperationsNull );
-}
-
-/*!
-  Destructor
-*/
-QtxParser::~QtxParser()
-{
-}
-
-/*!
-  Search elements of list as substrings starting on 'offset'
-  \returns the least position of substrings inside string
-  \param list - list of substrings
-  \param str - string where search
-  \param offset - starting index for search
-  \param matchLen - the length of appropriate substring
-  \param listind - list index of appropriate substring
-*/
-int QtxParser::search( const QStringList& list, const QString& str, int offset,
-                       int& matchLen, int& listind )
-{
-    QStringList::const_iterator anIt = list.begin(), aLast = list.end();
-    int min = -1;
-    for( int ind = 0; anIt!=aLast; anIt++, ind++ )
-    {
-      //const char* where = str.latin1(), *what = (*anIt).latin1();
-        int pos = str.find( *anIt, offset );
-        if( pos>=0 && ( min < 0 || min > pos ||
-                        ( min==pos && matchLen< (int)(*anIt).length() ) ) )
-        {
-            min = pos;
-            listind = ind;
-            matchLen = (*anIt).length();
-        }
-    }
-    if( min<0 )
-        matchLen = 0;
-    return min;
-}
-
-/*!
-  \return substring
-  \param str - string
-  \param pos - start position of substring
-  \param len - length of substring
-*/
-QString QtxParser::note( const QString& str, int pos, int len )
-{
-    return str.mid( pos, len ).stripWhiteSpace();
-}
-
-/*!
-  First step of parsing: finding tokens, determining its types and creating of unsorted pseudo-postfix (with brackets)
-  \param expr - string expression
-  \param post - postfix to be created
-*/
-bool QtxParser::prepare( const QString& expr, Postfix& post )
-{
-    int pos = 0, len = expr.length();
-    QValueStack< int > aBracketStack;
-    QStringList anOpers, anOpenBr, aCloseBr;
-    if( myOperations )
-    {
-        myOperations->bracketsList( anOpenBr, true );
-        myOperations->bracketsList( aCloseBr, false );
-        myOperations->opersList( anOpers );
-    }
-    else
-    {
-        setLastError( OperationsNull );
-        return false;
-    }
-
-    while( pos < len && lastError()==OK )
-    {
-        PostfixItem item;
-        while( expr[ pos ].isSpace() && pos<len ) pos++;
-        if( pos>=len )
-            break;
-
-        int mBrLen = 0, mLen = 0, br_ind = -1, op_ind = -1;
-        int oPos = search( anOpenBr, expr, pos, mBrLen, br_ind ),
-            cPos = oPos==pos ? -1 : search( aCloseBr, expr, pos, mBrLen, br_ind ),
-            opPos = search( anOpers, expr, pos, mLen, op_ind );
-
-        if( expr[ pos ]=="'" )
-        {
-            int vpos = pos+1;
-            while ( vpos< (int)expr.length() && expr[ vpos ]!="'" )
-                vpos++;
-
-            mLen = vpos-pos+1;
-
-            int res = myOperations->createValue( note( expr, pos, mLen ), item.myValue );
-            item.myType = res ? Value : Param;
-            post.append( item );
-            pos = vpos+1;
-            continue;
-        }
-
-        if( oPos==pos )
-        {
-            aBracketStack.push( br_ind );
-            item.myValue = note( expr, pos, mBrLen );
-            item.myType = Open;
-            post.append( item );
-        }
-
-        else if( cPos==pos )
-        {
-            if( aBracketStack.count()==0 )
-            {
-                setLastError( ExcessClose );
-                break;
-            }
-            if( br_ind!=aBracketStack.top() )
-            {
-                setLastError( BracketsNotMatch );
-                break;
-            }
-            else
-            {
-                aBracketStack.pop();
-                item.myValue = note( expr, pos, mBrLen );
-                item.myType = Close;
-                post.append( item );
-            }
-        }
-        else
-            mBrLen = 0;
-
-        if( opPos==pos )
-        {
-            mBrLen = 0;
-            item.myValue = note( expr, pos, mLen );
-            item.myType = Binary;
-            //the type is set by default;
-            //the method setOperationTypes will set correct types
-
-            if( oPos==pos )
-                post.insert( post.at( post.count()-1 ), item );
-            else
-                post.append( item );
-        }
-        else
-        {
-            mLen = 0;
-            if( oPos!=pos && cPos!=pos )
-            {
-               int i; 
-                for( i=pos+1; i<(int)expr.length(); i++ )
-                    if( expr[ i ].isSpace() )
-                        break;
-
-                int vpos = i;
-                if( oPos>=0 && oPos<vpos )
-                    vpos = oPos;
-                if( cPos>=0 && cPos<vpos )
-                    vpos = cPos;
-                if( opPos>=0 && opPos<vpos )
-                    vpos = opPos;
-
-                while( vpos<(int)expr.length() && 
-                       ( expr[vpos].isLetter() || expr[vpos].isDigit() || expr[vpos]=='_' ) )
-                    vpos++;
-
-                mLen = vpos-pos;
-                bool res = myOperations->createValue( note( expr, pos, mLen ), item.myValue );
-                item.myType = res ? Value : Param;
-                post.append( item );
-            }
-        }
-
-        pos+=mBrLen+mLen;
-    }
-
-    //Bracket checking
-    PostfixIterator anIt = post.begin(),
-                    aLast = post.end();
-    int brValue = 0;
-    for( ; anIt!=aLast; anIt++ )
-        if( (*anIt).myType==Open )
-            brValue++;
-        else if( (*anIt).myType==Close )
-            if( brValue>0 )
-                brValue--;
-            else
-            {
-                setLastError( ExcessClose );
-                break;
-            }
-    if( brValue>0 )
-        setLastError( CloseExpected );
-
-    return lastError()==OK;
-}
-
-/*!
-  Second step of parsing: determining types of operations
-  \param post - unsorted postfix
-*/
-bool QtxParser::setOperationTypes( Postfix& post )
-{
-    Postfix::iterator aStart = post.begin(),
-                      aLast = post.end(),
-                      anIt = aStart, aPrev, aNext;
-    QStringList anOpen, aClose;
-    if( myOperations )
-    {
-        myOperations->bracketsList( anOpen, true );
-        myOperations->bracketsList( aClose, false );
-    }
-    else
-        return false;
-
-    for( ; anIt!=aLast; anIt++ )
-    {
-        aPrev = anIt; aPrev--;
-        aNext = anIt; aNext++;
-        if( (*anIt).myType != Binary )
-            continue;
-
-        if( ( anIt==aStart || (*aPrev).myType == Open ||
-                              (*aPrev).myType == Pre ||
-                              (*aPrev).myType == Binary )
-            && 
-            aNext!=aLast && ( (*aNext).myType == Value ||
-                              (*aNext).myType == Param ||
-                              (*aNext).myType == Open  ||
-                              (*aNext).myType == Binary ) )
-            (*anIt).myType = Pre;
-
-        else if( anIt!=aStart && ( (*aPrev).myType == Close ||
-                                   (*aPrev).myType == Param ||
-                                   (*aPrev).myType == Value ||
-                                   (*aPrev).myType == Pre ||
-                                   (*aPrev).myType == Post ||
-                                   (*aPrev).myType == Binary )
-                 &&
-                 ( aNext==aLast || (*aNext).myType == Close ) )
-            (*anIt).myType = Post;
-
-        if( anOpen.contains( ( *anIt ).myValue.toString() )>0 )
-            (*anIt).myType = Pre;
-        else if( aClose.contains( ( *anIt ).myValue.toString() )>0 )
-            (*anIt).myType = Post;
-    }
-
-    return lastError()==OK;
-}
-
-/*!
-  \return how many global brackets there is (for example '((2+3))' has 2 global brackets)
-  \param post - postfix to be checked
-  \param f - start index to search
-  \param l - last index to search
-*/
-int QtxParser::globalBrackets( const QtxParser::Postfix& post, int f, int l )
-{
-    int i,
-        start_br = 0,
-        fin_br = 0,
-        br = 0,
-        br_num = 0,
-        min_br_num = (l-f+1)*5;
-    
-    for( i=f; i<=l; i++ )
-        if( post[ i ].myType==QtxParser::Open )
-            start_br++;
-        else
-            break;
-    for( i=l; i>=f; i-- )
-        if( post[ i ].myType==QtxParser::Close )
-            fin_br++;
-        else
-            break;
-
-    br = start_br<fin_br ? start_br : fin_br;
-    for( i=f+br; i<=l-br; i++ )
-    {
-        if( post[i].myType==QtxParser::Open )
-            br_num++;
-        else if( post[i].myType==QtxParser::Close )
-            br_num--;
-        if( br_num<min_br_num )
-            min_br_num = br_num;
-    }
-
-    return br+min_br_num;
-}
-
-/*!
-  Third step of parsing: sorting of postfix in order to convert it to real postfix
-  \param post - source postfix
-  \param res - destination postfix
-  \param anOpen - list of open brackets
-  \param aClose - list of close brackets
-  \param f - start index of postfix to sorting
-  \param l - last index of postfix to sorting
-*/
-bool QtxParser::sort( const Postfix& post, Postfix& res,
-                      const QStringList& anOpen,
-                      const QStringList& aClose,
-                      int f, int l )
-{
-    if( l<f )
-        return true;
-
-    if( f<0 )
-        f = 0;
-    if( l<0 )
-        l = post.count()-1;
-
-    int br = globalBrackets( post, f, l );
-    f+=br; l-=br;
-
-    if( f==l && f>=0 )
-        res.append( post[ f ] );
-    if( l<=f )
-        return true;
-
-    if( myOperations )
-    {
-        int min = -1;
-        QIntList argmin;
-        QValueList< PostfixItemType > min_types;
-
-        //Find operation with minimal priority
-        //PostfixIterator anIt = post.at( f ),
-        //                aLast = post.at( l+1 );
-        for( int i=0, j=f; j<=l; i++, j++ )
-        {
-            const PostfixItem& item = post[ j ];
-            PostfixItemType tt = item.myType;
-            if( tt==Binary || tt==Pre || tt==Post )
-            {
-                int cur_pr = myOperations->prior( item.myValue.toString(), tt==Binary );
-                if( cur_pr>0 )
-                {
-                    if( min<0 || min>=cur_pr )
-                    {
-                        if( min==cur_pr )
-                        {
-                            argmin.append( f+i );
-                            min_types.append( tt );
-                        }
-                        else
-                        {
-                            min = cur_pr;
-                            argmin.clear(); argmin.append( f+i );
-                            min_types.clear(); min_types.append( tt );
-                        }
-                    }
-                }
-                else
-                {
-                    setLastError( InvalidOperation );
-                    break;
-                }
-            }
-            else if( tt==Open )
-            {
-                QString opBr = item.myValue.toString();
-                int ind = anOpen.findIndex( opBr ), brValue = 0;
-                while( j<=l )
-                {
-                    const PostfixItem& anItem = post[ j ];
-                    if( anItem.myType==Open )
-                        brValue++;
-
-                    if( anItem.myType==Close )
-                    {
-                        brValue--;
-                        QString clBr = anItem.myValue.toString();
-                        if( aClose.findIndex( clBr )==ind && brValue==0 )
-                            break;
-                    }
-                    i++; j++;
-                }
-                if( brValue>0 )
-                {
-                    setLastError( CloseExpected );
-                    break;
-                }
-            }
-        }
-
-        if( lastError()==OK )
-            if( min>=0 )
-            {
-                QValueList< Postfix > parts;
-                QIntList::const_iterator anIt = argmin.begin(),
-                                         aLast = argmin.end();
-                Postfix one;
-                bool ok = sort( post, one, anOpen, aClose, f, *anIt - 1 );
-                parts.append( one );
-                one.clear();
-                for( ; anIt!=aLast && ok; anIt++ )
-                {
-                    QIntList::const_iterator aNext = anIt; aNext++;
-                    ok = sort( post, one, anOpen, aClose, *anIt + 1, aNext==aLast ? l : *aNext - 1 );
-                    parts.append( one );
-                    one.clear();
-                }
-                if( !ok )
-                    return false;
-
-                QValueList< Postfix >::const_iterator aPIt = parts.begin();
-                QValueList< PostfixItemType >::const_iterator aTIt = min_types.begin();
-                QValueStack< PostfixItem > aStack;
-                res += (*aPIt); aPIt++;
-                anIt = argmin.begin();
-                for( ; anIt!=aLast; anIt++, aPIt++, aTIt++ )
-                {
-                    if( *aTIt==Pre )
-                        if( anOpen.contains( post[ *anIt ].myValue.toString() )==0 )
-                        {
-                            res+=(*aPIt);
-                            aStack.push( post[ *anIt ] );
-                        }
-                        else
-                        {
-                            res.append( post[ *anIt ] );
-                            res+=(*aPIt);
-                        }
-                    else
-                    {
-                        res+=(*aPIt);
-                        while( !aStack.isEmpty() )
-                        {
-                            res.append( aStack.top() );
-                            aStack.pop();
-                        }
-                        res.append( post[ *anIt ] );
-                    }
-                }
-                while( !aStack.isEmpty() )
-                {
-                    res.append( aStack.top() );
-                    aStack.pop();
-                }
-            }
-            else
-            { //there are no operations
-                PostfixIterator anIt = post.at( f ),
-                                aLast = post.at( l+1 );
-                for( ; anIt!=aLast; anIt++ )
-                    if( (*anIt).myType==Value || (*anIt).myType==Param )
-                        res.append( *anIt );
-            }
-    }
-    else 
-        setLastError( OperationsNull );
-
-    return lastError()==OK;
-}
-
-/*!
-  Build posfix by expression
-  \param expr - string expression
-*/
-bool QtxParser::parse( const QString& expr )
-{
-    myPost.clear();
-
-    Postfix p;
-    QStringList opens, closes;
-
-    if( myOperations )
-    {
-        setLastError( OK );
-        myOperations->bracketsList( opens, true );
-        myOperations->bracketsList( closes, false );
-    }
-    else
-    {
-        setLastError( OperationsNull );
-        return false;
-    }
-
-    //return prepare( expr, myPost ) && setOperationTypes( myPost );
-    return prepare( expr, p ) && setOperationTypes( p ) && 
-           sort( p, myPost, opens, closes );
-}
-
-/*!
-  Calculate operation
-  \param op - operation name
-  \param v1 - first argument (it is not valid for unary prefix operations and it is used to store result)
-  \param v2 - second argument (it is not valid for unary postfix operations)
-*/
-bool QtxParser::calculate( const QString& op, QtxValue& v1, QtxValue& v2 )
-{
-    Error err = myOperations->isValid( op, v1.type(), v2.type() );
-    if( err==OK )
-        setLastError( myOperations->calculate( op, v1, v2 ) );
-    else
-        setLastError( err );
-
-    return lastError()==OK;
-}
-
-/*!
-  Calculates expression without postfix rebuilding
-  \return QtxValue as result (it is invalid if there were errors during calculation)
-*/
-QtxValue QtxParser::calculate()
-{
-    setLastError( OK );
-
-    QStringList anOpen, aClose;
-    if( myOperations )
-    {
-        myOperations->bracketsList( anOpen, true );
-        myOperations->bracketsList( aClose, false );
-    }
-    else
-    {
-        setLastError( OperationsNull );
-        return QtxValue();
-    }
-
-    QtxValueStack aStack;
-    PostfixIterator anIt = myPost.begin(),
-                    aLast = myPost.end();
-    for( ; anIt!=aLast && lastError()==OK; anIt++ )
-    {
-        QString nn = (*anIt).myValue.toString();
-        if( (*anIt).myType==Param )
-        {
-            if( has( nn ) )
-            {
-                QVariant& v = myParameters[ nn ];
-                if( v.isValid() )
-                    aStack.push( v );
-                else
-                    setLastError( InvalidToken );
-            }
-            else
-                setLastError( InvalidToken );
-        }
-
-        else if( (*anIt).myType==Value )
-            aStack.push( (*anIt).myValue );
-
-        else if( (*anIt).myType==Pre || (*anIt).myType==Post )
-        {
-            if( anOpen.contains( nn )>0 )
-            {
-                QtxValue inv;
-                if( calculate( nn, inv, inv ) )
-                    aStack.push( QtxValue() );
-            }
-            else if( aClose.contains( nn )>0 )
-            {
-                QValueList< QtxValue > set;
-                while( true )
-                {
-                    if( aStack.count()==0 )
-                    {
-                        setLastError( StackUnderflow );
-                        break;
-                    }
-                    if( aStack.top().isValid() )
-                    {
-                        set.append( aStack.top() );
-                        aStack.pop();
-                    }
-                    else
-                    {
-                        aStack.pop();
-                        break;
-                    }
-                }
-
-                QtxValue qSet = set, inv;
-                if( calculate( nn, qSet, inv ) )
-                    aStack.push( set );
-            }
-            else if( aStack.count()>=1 )
-            {
-                QtxValue inv;
-                QtxValue* v1 = &aStack.top(), *v2 = &inv; //"post-" case
-                if( (*anIt).myType==Pre )
-                {
-                    v2 = &aStack.top(); v1 = &inv;
-                }
-
-                calculate( nn, *v1, *v2 );
-            }
-            else
-                setLastError( StackUnderflow );
-        }
-
-        else if( (*anIt).myType==Binary )
-        {
-            if( aStack.count()>=2 )
-            {
-                QVariant v2 = aStack.top(); aStack.pop();
-                calculate( nn, aStack.top(), v2 );
-            }
-            else
-                setLastError( StackUnderflow );
-        }
-    }
-
-    QtxValue res;
-    if( lastError()==OK )
-    {
-        int count = aStack.count();
-        if( count==0 )
-            setLastError( StackUnderflow );
-        else if( count==1 )
-            res = aStack.top();
-        else
-            setLastError( ExcessData );
-    }
-    return res;
-}
-
-/*!
-  Change expression, rebuild postfix and calculate it
-  \return QtxValue as result (it is invalid if there were errors during calculation)
-*/
-QtxValue QtxParser::calculate( const QString& expr )
-{
-    setExpr( expr );
-    return calculate();
-}
-
-/*!
-  Change expression and rebuild postfix
-*/
-bool QtxParser::setExpr( const QString& expr )
-{
-    return parse( expr );
-}
-
-/*!
-  \return true, if parser contain parameter
-  \param name - name of parameter
-*/
-bool QtxParser::has( const QString& name ) const
-{
-    return myParameters.contains( name.stripWhiteSpace() );
-}
-
-/*!
-  Sets parameter value
-  \param name - name of parameter
-  \param value - value of parameter
-*/
-void QtxParser::set( const QString& name, const QtxValue& value )
-{
-    myParameters[ name.stripWhiteSpace() ] = value;
-}
-
-/*!
-  Removes parameter
-  \param name - name of parameter
-*/
-bool QtxParser::remove( const QString& name )
-{
-    QString sname = name.stripWhiteSpace();
-    bool res = has( sname );
-    if( res )
-        myParameters.remove( sname );
-    return res;
-}
-
-/*!
-  \return value of parameter (result is invalid if there is no such parameter)
-  \param name - name of parameter
-*/
-QtxValue QtxParser::value( const QString& name ) const
-{
-    QString sname = name.stripWhiteSpace();
-    if( has( sname ) )
-        return myParameters[ sname ].toString();
-    else
-        return QtxValue();
-}
-
-/*!
-  Searches first parameter with assigned invalid QtxValue
-  \return true if it is found
-  \param name - variable to return name of parameter
-*/
-bool QtxParser::firstInvalid( QString& name ) const
-{
-    QMap< QString, QtxValue >::const_iterator anIt = myParameters.begin(),
-                                              aLast = myParameters.end();
-    for( ; anIt!=aLast; anIt++ )
-        if( !anIt.data().isValid() )
-        {
-            name = anIt.key();
-            return true;
-        }
-    return false;
-}
-
-/*!
-  Removes all parameters with assigned invalid QtxValues
-*/
-void QtxParser::removeInvalids()
-{
-    QStringList toDelete;
-    QMap< QString, QtxValue >::const_iterator anIt = myParameters.begin(),
-                                              aLast = myParameters.end();
-    for( ; anIt!=aLast; anIt++ )
-        if( !anIt.data().isValid() )
-            toDelete.append( anIt.key() );
-
-    QStringList::const_iterator aLIt = toDelete.begin(),
-                                aLLast = toDelete.end();
-    for( ; aLIt!=aLLast; aLIt++ )
-        myParameters.remove( *aLIt );
-}
-
-/*!
-  \return last error occured during parsing
-*/
-QtxParser::Error QtxParser::lastError() const
-{
-    return myLastError;
-}
-
-/*!
-  Sets last error occured during parsing (for internal using only)
-*/
-void QtxParser::setLastError( QtxParser::Error err )
-{
-    myLastError = err;
-}
-
-/*!
-  \return string dump of internal parser postfix
-*/
-QString QtxParser::dump() const
-{
-    return dump( myPost );
-}
-
-/*!
-  \return string dump of postfix
-  \param post - postfix to be dumped
-*/
-QString QtxParser::dump( const Postfix& post ) const
-{
-    QString res;
-
-    if( myOperations )
-    {
-        PostfixIterator anIt = post.begin(),
-                        aLast = post.end();
-        for( ; anIt!=aLast; anIt++ )
-        {
-            if( (*anIt).myType == Value && 
-                    ( ( *anIt ).myValue.type()==QVariant::String ||
-                    ( *anIt ).myValue.type()==QVariant::CString ) )
-                res += "'" + ( *anIt ).myValue.toString() + "'";
-            else
-                res += ( *anIt ).myValue.toString();
-            if( (*anIt).myType == Pre )
-                res += "(pre)";
-            else if( (*anIt).myType == Post )
-                res += "(post)";
-            else if( (*anIt).myType == Binary )
-                res += "(bin)";
-
-            res += "_";
-        }
-    }
-    return res;
-}
-
-/*!
-  Fills list with names of parameters
-  \param list - list to be filled
-*/
-void QtxParser::paramsList( QStringList& list )
-{
-    PostfixIterator anIt = myPost.begin(),
-                    aLast = myPost.end();
-    for( ; anIt!=aLast; anIt++ )
-        if( (*anIt).myType==Param )
-        {
-            QString name = (*anIt).myValue.toString();
-            if( list.contains( name )==0 )
-                list.append( name );
-        }
-}
-
-/*!
-  Removes all parameters
-*/
-void QtxParser::clear()
-{
-    myParameters.clear();
-}
-
-/*!
-  \return string representation for list of QtxValues
-  \param list - list to be converted
-*/
-QString QtxParser::toString( const QValueList< QtxValue >& list )
-{
-    QValueList< QtxValue >::const_iterator anIt = list.begin(),
-                                           aLast = list.end();
-    QString res = "set : [ ";
-    for( ; anIt!=aLast; anIt++ )
-        res+=(*anIt).toString()+" ";
-    res+="]";
-    return res;
-}
diff --git a/src/Qtx/QtxParser.h b/src/Qtx/QtxParser.h
deleted file mode 100644 (file)
index 0a0b05a..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxParser.h
-// Author:    Alexander SOLOVYOV
-
-#ifndef __QTX_PARSER_HEADER__
-#define __QTX_PARSER_HEADER__
-
-#include "Qtx.h"
-#include <qvaluestack.h>
-#include <qvariant.h>
-
-#ifdef WIN32
-#pragma warning( disable:4251 )
-#endif
-
-
-class QtxOperations;
-
-/*! \var QtxValue
-    \brief Alias for QVariant
-*/
-typedef QVariant QtxValue;
-
-
-/*!
-  \class QtxParser
-
-  This class allows to calculate values of expressions using different set of operations.
-  It is provided some of standard set of operations (arithmetics, logic, strings, etc - in QtxStdOperations.h).
-  This parser allows to use parameters with help of methods has(), set(), remove(), value(). It uses
-  postfix representation of expressions and uses class QtxOperations in order to make certain operation
-  Every instance of parser contains only one postfix, so that if expression has been changed, then postfix
-  must be rebuilt. In order to increase performance of frequent calculation for many of expressions it is 
-  recommended to use different instances of parser for expressions
-
-*/
-class QTX_EXPORT QtxParser
-{
-public:
-    /*!
-      \enum Error
-      \brief Errors during parsing
-    */
-    typedef enum
-    {
-        OK,               /*! \var All right */
-       OperandsNotMatch, /*! \var Types of arguments are invalid for this operation */
-       InvalidResult,    /*! \var Operation cannot find result (for example, division by zero) */
-       InvalidOperation, /*! \var Name of operation is unknown */
-        OperationsNull,   /*! \var Internal operations pointer of parser is null */
-       InvalidToken,     /*! \var It isn't operation, parameter of value  */
-       CloseExpected,    /*! \var Close bracket is expected */
-       ExcessClose,      /*! \var The one of close bracket is excess */
-        BracketsNotMatch, /*! \var Last open and this close bracket are different, for example [) */
-       StackUnderflow,   /*! \var There is no arguments in stack for operation */
-       ExcessData        /*! \var The parsing is finished, but there is more then one value in stack */
-
-    } Error;
-
-public:
-    QtxParser( QtxOperations*, const QString& = QString::null );
-    virtual ~QtxParser();
-
-    QtxValue   calculate();
-    QtxValue   calculate( const QString& );
-    bool       setExpr( const QString& );
-
-    virtual void     clear();
-    virtual bool     has   ( const QString& name ) const;
-    virtual void     set   ( const QString& name, const QtxValue& value );
-    virtual bool     remove( const QString& name );
-    virtual QtxValue value ( const QString& name ) const;
-
-    bool       firstInvalid( QString& ) const;
-    void       removeInvalids();
-    QString    dump() const;
-    Error      lastError() const;
-    void       paramsList( QStringList& );
-
-    static QString toString( const QValueList< QtxValue >& );
-
-protected:
-    /*!
-      \enum PostfixItemType
-      \brief Types of postfix representation elements
-    */  
-    typedef enum
-    {
-      Value, /*! \var Value (number, string, etc.)*/
-      Param, /*! \var Parameter */
-      Open,  /*! \var Open bracket */
-      Close, /*! \var Close bracket */
-      Pre,   /*! \var Unary prefix operation */
-      Post,  /*! \var Unary postfix operation */
-      Binary /*! \var Binary operation */
-
-    } PostfixItemType;
-
-    /*! \var postfix representation element */
-    typedef struct
-    {
-        QtxValue          myValue;
-        PostfixItemType   myType;
-
-    } PostfixItem;
-
-    /*! \var postfix representation */
-    typedef QValueList< PostfixItem > Postfix;
-
-    /*! \var postfix representation iterator */
-    typedef Postfix::const_iterator PostfixIterator;
-
-protected:
-            QString  dump( const Postfix& ) const;
-    virtual bool     prepare( const QString&, Postfix& );
-    virtual bool     setOperationTypes( Postfix& );
-    virtual bool     sort( const Postfix&, Postfix&, 
-                           const QStringList&, const QStringList&, 
-                           int f=-1, int l=-1 );
-
-    virtual bool     parse( const QString& );
-    virtual void     setLastError( const Error );
-
-            bool     calculate( const QString&, QtxValue&, QtxValue& );
-
-    static int       search        ( const QStringList&, const QString&, int offset,
-                                     int& matchLen, int& listind );
-    static QString   note          ( const QString& str, int pos, int len );
-    static int       globalBrackets( const Postfix&, int, int );
-
-private:
-    /*! \var stack of QtxValues */
-    typedef QValueStack < QtxValue >  QtxValueStack;
-
-private:
-    QtxOperations*              myOperations;
-    QMap< QString, QtxValue >   myParameters;
-    Error                       myLastError;
-    Postfix                     myPost;
-};
-
-#endif
index fd098e7ef2abfc36f5c418d950e87647569eb91d..684d0a40dbbc4198f7070680cbcf07bfb78c2efe 100755 (executable)
@@ -1,39 +1,42 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxPathDialog.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxPathDialog.h"
 
+#include "QtxGridBox.h"
 #include "QtxGroupBox.h"
 
-#include <qdir.h>
-#include <qlabel.h>
-#include <qpixmap.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qfileinfo.h>
-#include <qobjectlist.h>
-#include <qstringlist.h>
-#include <qfiledialog.h>
-#include <qmessagebox.h>
-#include <qpushbutton.h>
+#include <QDir>
+#include <QLabel>
+#include <QPixmap>
+#include <QLayout>
+#include <QLineEdit>
+#include <QObjectList>
+#include <QStringList>
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QPushButton>
 
 static const char* open_icon[] = {
 "16 16 5 1",
@@ -61,546 +64,680 @@ static const char* open_icon[] = {
 };
 
 /*!
-  Constructor.
+  \class QtxPathDialog
+  \brief The QtxPathDialog class provides a simple convenience dialog to
+         enter a path to the file or to the directory.
+
+  The QtxPathDialog class adds possibility to browse the file system 
+  with help of standard Open/Save dialog boxes or enter the file/directory
+  path manually.
+
+  Default implementation provides only one "standard" file entry.
+  Sometimes it is necessary to select several different files/directories
+  from the same dialog box. In this case it is possible to derive from the
+  QtxPathDialog class and use createFileEntry() method to add required
+  number of file entries.
 */
-QtxPathDialog::QtxPathDialog( const bool import, QWidget* parent, const bool modal, const bool resize, const int buttons, WFlags f )
-: QtxDialog( parent, 0, modal, resize, buttons, f ),
-myDefault( -1 ),
-myEntriesFrame( 0 ),
-myOptionsFrame( 0 )
-{
-       initialize();
 
-       setCaption( tr( import ? "Open file" : "Save file" ) );
-
-       setDefaultEntry( createFileEntry( tr( "File name" ), import ? OpenFile : SaveFile ) );
-       QLineEdit* le = fileEntry( defaultEntry() );
-       if ( le )
-               le->setMinimumWidth( 200 );
-
-       validate();
-
-       setFocusProxy( le );
+/*!
+  \brief Constructor.
+  \param import if \c true, the dialog box is shown for "open" mode, 
+         otherwise, it is shown in the "save" mode
+  \param parent parent widget
+  \param modal if \c true, the dialog box should be modal
+  \param resize if \c true, the dialog box is resizable
+  \param buttons required buttons (QtxDialog::ButtonFlags)
+  \param f window flags
+*/
+QtxPathDialog::QtxPathDialog( const bool import, QWidget* parent, const bool modal,
+                              const bool resize, const int buttons, Qt::WindowFlags f )
+: QtxDialog( parent, modal, resize, buttons, f ),
+  myDefault( -1 ),
+  myEntriesFrame( 0 ),
+  myOptionsFrame( 0 )
+{
+  initialize();
+  
+  setWindowTitle( tr( import ? "Open file" : "Save file" ) );
+  
+  setDefaultEntry( createFileEntry( tr( "File name" ), import ? OpenFile : SaveFile ) );
+  QLineEdit* le = fileEntry( defaultEntry() );
+  if ( le )
+    le->setMinimumWidth( 200 );
+  
+  validate();
+
+  setFocusProxy( le );
+
+  updateVisibility();
 }
 
 /*!
-  Constructor.
+  \brief Constructor.
+  \param parent parent widget
+  \param modal if \c true, the dialog box should be modal
+  \param resize if \c true, the dialog box is resizable
+  \param buttons required buttons (QtxDialog::ButtonFlags)
+  \param f window flags
 */
-QtxPathDialog::QtxPathDialog( QWidget* parent, const bool modal, const bool resize, const int buttons, WFlags f )
-: QtxDialog( parent, 0, modal, resize, buttons, f ),
-myDefault( -1 ),
-myEntriesFrame( 0 ),
-myOptionsFrame( 0 )
+QtxPathDialog::QtxPathDialog( QWidget* parent, const bool modal,
+                              const bool resize, const int buttons, Qt::WindowFlags f )
+: QtxDialog( parent, modal, resize, buttons, f ),
+  myDefault( -1 ),
+  myEntriesFrame( 0 ),
+  myOptionsFrame( 0 )
 {
-       initialize();
+  initialize();
+
+  updateVisibility();
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QtxPathDialog::~QtxPathDialog()
 {
 }
 
 /*!
+  \brief Get selected file name.
   \return file name
 */
 QString QtxPathDialog::fileName() const
 {
-       return fileName( defaultEntry() );
+  return fileName( defaultEntry() );
 }
 
 /*!
-  Sets file name
-  \param txt new file name
-  \param autoExtension - auto extension determination by file
+  \brief Set the file name.
+  \param txt new file name
+  \param autoExtension if \c true an extension is determined automatically by file
 */
 void QtxPathDialog::setFileName( const QString& txt, const bool autoExtension )
 {
-       setFileName( defaultEntry(), txt, autoExtension );
+  setFileName( defaultEntry(), txt, autoExtension );
 }
 
 /*!
-  \return filter
+  \brief Get current file filter.
+  \return file filter
 */
 QString QtxPathDialog::filter() const
 {
-       return myFilter;
+  return filter( defaultEntry() );
 }
 
 /*!
-  Changes filter (filter is a list of masks, separated by ';;')
-  \param fltr - new filter
+  \brief Change file filter.
+  
+  Filter is a list of file masks, separated by ';;'. For example, 
+  "*.h;;*.cxx"
+
+  \param fltr new file filter
 */
 void QtxPathDialog::setFilter( const QString& fltr )
 {
-       myFilter = fltr;
+  setFilter( defaultEntry(), fltr );
 }
 
 /*!
-  Shows path dialog
+  \brief Show/hide the path dialog box/
+  \param on new visibility state
 */
-void QtxPathDialog::show()
+void QtxPathDialog::setVisible( bool on )
 {
-       if ( hasVisibleChildren( myEntriesFrame ) )
-               myEntriesFrame->show();
-       else
-               myEntriesFrame->hide();
-
-       if ( hasVisibleChildren( myOptionsFrame ) )
-               myOptionsFrame->show();
-       else
-               myOptionsFrame->hide();
+  if ( on )
+    updateVisibility();
 
-       QtxDialog::show();
+  QtxDialog::setVisible( on );
 }
 
 /*!
-  SLOT: called if user click button to show standard file dialog
+  \brief Called when user clicks a "browse" button 
+         to open standard file dialog.
 */
 void QtxPathDialog::onBrowse()
 {
-       const QObject* obj = sender();
-
-       int id = -1;
-
-       for ( FileEntryMap::Iterator it = myEntries.begin(); it != myEntries.end() && id == -1; ++it )
-               if ( it.data().btn == obj )
-                       id = it.key();
-
-       if ( id == -1 )
-               return;
-
-       FileEntry& entry = myEntries[id];
-
-       bool isDir = entry.mode != OpenFile && entry.mode != SaveFile;
-
-       if ( !entry.dlg )
-       {
-               entry.dlg = new QFileDialog( QDir::current().path(), QString::null, this, 0, true );
-               entry.dlg->setCaption( caption() );
-               switch ( entry.mode )
-               {
-               case NewDir:
-               case OpenDir:
-               case SaveDir:
-                       isDir = true;
-                       entry.dlg->setMode( QFileDialog::DirectoryOnly );
-                       break;
-               case SaveFile:
-                       entry.dlg->setMode( QFileDialog::AnyFile );
-                       break;
-               case OpenFile:
-               default:
-                       entry.dlg->setMode( QFileDialog::ExistingFile );
-                       break;
-               }
-       }
-
-       if ( !isDir )
-               entry.dlg->setFilters( prepareFilters() );
-       entry.dlg->setSelection( fileName( id ) );
-
-       if ( entry.dlg->exec() != Accepted )
-               return;
-
-       QString fName = entry.dlg->selectedFile();
-
-       if ( fName.isEmpty() )
-               return;
-
-       if ( QFileInfo( fName ).extension().isEmpty() && !isDir )
-               fName = autoExtension( fName, entry.dlg->selectedFilter() );
-
-       fName = QDir::convertSeparators( fName );
-       QString prev = QDir::convertSeparators( fileName( id ) );
-       if ( isDir )
-       {
-               while ( prev.length() && prev.at( prev.length() - 1 ) == QDir::separator() )
-                       prev.remove( prev.length() - 1, 1 );
-               while ( fName.length() && fName.at( fName.length() - 1 ) == QDir::separator() )
-                       fName.remove( fName.length() - 1, 1 );
-       }
-
-       if ( prev == fName )
-               return;
-
-       setFileName( id, fName );
-       fileNameChanged( id, fName );
-
-       if ( id == defaultEntry() )
-               emit fileNameChanged( fName );
+  const QObject* obj = sender();
+
+  int id = -1;
+  
+  for ( FileEntryMap::Iterator it = myEntries.begin(); it != myEntries.end() && id == -1; ++it )
+  {
+    if ( it.value().btn == obj )
+      id = it.key();
+  }
+  
+  if ( id == -1 )
+    return;
+  
+  FileEntry& entry = myEntries[id];
+  
+  bool isDir = entry.mode != OpenFile && entry.mode != SaveFile;
+  
+  if ( !entry.dlg )
+  {
+    entry.dlg = new QFileDialog( this, windowTitle(), QDir::current().path() );
+    switch ( entry.mode )
+    {
+    case NewDir:
+    case OpenDir:
+    case SaveDir:
+      isDir = true;
+      entry.dlg->setFileMode( QFileDialog::DirectoryOnly );
+      break;
+    case SaveFile:
+      entry.dlg->setFileMode( QFileDialog::AnyFile );
+      break;
+    case OpenFile:
+    default:
+      entry.dlg->setFileMode( QFileDialog::ExistingFiles );
+      break;
+    }
+  }
+  
+  if ( !isDir )
+  {
+    QStringList fList = prepareFilters( entry.filter );
+    if ( !fList.isEmpty() )
+      entry.dlg->setFilters( fList );
+  }
+  entry.dlg->selectFile( fileName( id ) );
+
+  if ( entry.dlg->exec() != Accepted )
+    return;
+  
+  QStringList fileList = entry.dlg->selectedFiles();
+  QString fName = !fileList.isEmpty() ? fileList.first() : QString();
+  
+  if ( fName.isEmpty() )
+    return;
+  
+  if ( Qtx::extension( fName ).isEmpty() && !isDir )
+    fName = autoExtension( fName, entry.dlg->selectedFilter() );
+
+  fName = QDir::convertSeparators( fName );
+  QString prev = QDir::convertSeparators( fileName( id ) );
+  if ( isDir )
+  {
+    while ( prev.length() && prev.at( prev.length() - 1 ) == QDir::separator() )
+      prev.remove( prev.length() - 1, 1 );
+    while ( fName.length() && fName.at( fName.length() - 1 ) == QDir::separator() )
+      fName.remove( fName.length() - 1, 1 );
+  }
+  
+  if ( prev == fName )
+    return;
+  
+  setFileName( id, fName );
+  fileNameChanged( id, fName );
+  
+  if ( id == defaultEntry() )
+    emit fileNameChanged( fName );
 }
 
 /*!
-  SLOT: called if user presses RETURN in line edit
+  \brief Called when user presses \c Return key being in the line edit.
 */
 void QtxPathDialog::onReturnPressed()
 {
-       const QObject* obj = sender();
-
-       int id = -1;
-       for ( FileEntryMap::Iterator it = myEntries.begin(); it != myEntries.end() && id == -1; ++it )
-               if ( it.data().edit == obj )
-                       id = it.key();
-
-       if ( id == -1 )
-               return;
-
-       fileNameChanged( id, fileName( id ) );
-
-       if ( id == defaultEntry() )
-               emit fileNameChanged( fileName() );
+  const QObject* obj = sender();
+  
+  int id = -1;
+  for ( FileEntryMap::Iterator it = myEntries.begin(); it != myEntries.end() && id == -1; ++it )
+  {
+    if ( it.value().edit == obj )
+      id = it.key();
+  }
+
+  if ( id == -1 )
+    return;
+  
+  fileNameChanged( id, fileName( id ) );
+  
+  if ( id == defaultEntry() )
+    emit fileNameChanged( fileName() );
 }
 
 /*!
-  SLOT: called if text in line edit is changed
+ \brief Called when the text in the line edit is changed by the user.
+ \param txt current text (not used)
 */
-void QtxPathDialog::onTextChanged( const QString& )
+void QtxPathDialog::onTextChanged( const QString& /*txt*/ )
 {
-       validate();
+  validate();
 }
 
 /*!
-  Checks validity of text and according to it enables/disables OK, Yes buttons
+  \brief Check validity of the entered text and enable/disable standard
+  \c OK, \c Yes buttons.
 */
 void QtxPathDialog::validate()
 {
-       setButtonEnabled( isValid(), OK | Yes );
+  setButtonEnabled( isValid(), OK | Yes );
 }
 
 /*!
-  \return true if selected file is valid
+  \brief Check if the entered file/directory name is valid.
+  \return \c true if selected file name is valid
 */
 bool QtxPathDialog::isValid()
 {
-       bool ok = true;
-       for ( FileEntryMap::Iterator it = myEntries.begin(); it != myEntries.end() && ok; ++it )
-               if ( it.data().edit->isEnabled() )
-                       ok = !it.data().edit->text().stripWhiteSpace().isEmpty();
-
-       return ok;
+  bool ok = true;
+  for ( FileEntryMap::Iterator it = myEntries.begin(); it != myEntries.end() && ok; ++it )
+  {
+    if ( it.value().edit->isEnabled() )
+      ok = !it.value().edit->text().trimmed().isEmpty();
+  }
+  
+  return ok;
 }
 
 /*!
-  \return true entered data is accepted
+  \brief Check if the entered data is acceptable.
+  \return \c true if entered data is acceptable
 */
 bool QtxPathDialog::acceptData() const
 {
-       bool ok = true;
-
-       QWidget* parent = (QWidget*)this;
-
-       FileEntryMap::ConstIterator it;
-       for ( it = myEntries.begin(); it != myEntries.end() && ok; ++it )
+  bool ok = true;
+       
+  QWidget* parent = (QWidget*)this;
+
+  FileEntryMap::ConstIterator it;
+  for ( it = myEntries.begin(); it != myEntries.end() && ok; ++it )
+  {
+    const FileEntry& entry = it.value();
+    QFileInfo fileInfo( entry.edit->text() );
+    if ( entry.edit->text().isEmpty() )
+    {
+      QMessageBox::critical( parent, windowTitle(), tr( "File name not specified" ),
+                            QMessageBox::Ok, QMessageBox::NoButton );
+      ok = false;
+    }
+    else switch ( entry.mode )
+    {
+    case OpenFile:
+      if ( !fileInfo.exists() )
+      {
+       QMessageBox::critical( parent, windowTitle(), tr( "File \"%1\" does not exist" ).arg( fileInfo.filePath() ),
+                              QMessageBox::Ok, QMessageBox::NoButton );
+       ok = false;
+      }
+      break;
+    case SaveFile:
+      if ( fileInfo.exists() )
+       ok = QMessageBox::warning( parent, windowTitle(), tr( "File \"%1\" already exist. Do you want to overwrite it?" ).arg( fileInfo.filePath() ),
+                                  QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
+      break;
+    case OpenDir:
+      if ( !fileInfo.exists() || !fileInfo.isDir() )
+      {
+       QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" does not exist" ).arg( fileInfo.filePath() ),
+                              QMessageBox::Ok, QMessageBox::NoButton );
+       ok = false;
+      }
+      break;
+    case SaveDir:
+      if ( fileInfo.exists() && !fileInfo.isDir() )
+      {
+       QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
+                              QMessageBox::Ok, QMessageBox::NoButton );
+       ok = false;
+      }
+      break;
+    case NewDir:
+      if ( fileInfo.exists() )
+      {
+       if ( !fileInfo.isDir() )
        {
-               const FileEntry& entry = it.data();
-               QFileInfo fileInfo( entry.edit->text() );
-               if ( entry.edit->text().isEmpty() )
-               {
-                       QMessageBox::critical( parent, caption(), tr( "File name not specified" ),
-                                                                  QMessageBox::Ok, QMessageBox::NoButton );
-                       ok = false;
-               }
-               else switch ( entry.mode )
-               {
-               case OpenFile:
-                       if ( !fileInfo.exists() )
-                       {
-                               QMessageBox::critical( parent, caption(), tr( "File \"%1\" does not exist" ).arg( fileInfo.filePath() ),
-                                                                          QMessageBox::Ok, QMessageBox::NoButton );
-                               ok = false;
-                       }
-                       break;
-               case SaveFile:
-                       if ( fileInfo.exists() )
-                               ok = QMessageBox::warning( parent, caption(), tr( "File \"%1\" already exist. Do you want to overwrite it?" ).arg( fileInfo.filePath() ),
-                                                                                  QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
-                       break;
-               case OpenDir:
-                       if ( !fileInfo.exists() || !fileInfo.isDir() )
-                       {
-                               QMessageBox::critical( parent, caption(), tr( "Directory \"%1\" does not exist" ).arg( fileInfo.filePath() ),
-                                                                          QMessageBox::Ok, QMessageBox::NoButton );
-                               ok = false;
-                       }
-                       break;
-               case SaveDir:
-                       if ( fileInfo.exists() && !fileInfo.isDir() )
-                       {
-                               QMessageBox::critical( parent, caption(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
-                                                                          QMessageBox::Ok, QMessageBox::NoButton );
-                               ok = false;
-                       }
-                       break;
-               case NewDir:
-                       if ( fileInfo.exists() )
-                       {
-                               if ( !fileInfo.isDir() )
-                               {
-                                       QMessageBox::critical( parent, caption(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
-                                                                                  QMessageBox::Ok, QMessageBox::NoButton );
-                                       ok = false;
-                               }
-                               else if ( QDir( fileInfo.filePath() ).count() > 2 )
-                                       ok = QMessageBox::warning( parent, caption(), tr( "Directory \"%1\" not empty. Do you want to remove all files in this directory?" ).arg( fileInfo.filePath() ),
-                                                                                          QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
-                       }
-                       break;
-               default:
-                       break;
-               }
-
-               if ( !ok )
-                       entry.edit->setFocus();
+         QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
+                                QMessageBox::Ok, QMessageBox::NoButton );
+         ok = false;
        }
-
-       return ok;
+       else if ( QDir( fileInfo.filePath() ).count() > 2 )
+         ok = QMessageBox::warning( parent, windowTitle(), tr( "Directory \"%1\" not empty. Do you want to remove all files in this directory?" ).arg( fileInfo.filePath() ),
+                                    QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
+      }
+      break;
+    default:
+      break;
+    }
+    
+    if ( !ok )
+      entry.edit->setFocus();
+  }
+  
+  return ok;
 }
 
 /*!
-  Some custom activity on file name changing (must be redefined, default implementation is empty
+  \brief Perform custom actions when the file name is changed.
+
+  This method can be redefined in the successor classes.
+  Default implementation does nothing.
+
+  \param id file entry
+  \param fileName file name
 */
-void QtxPathDialog::fileNameChanged( int, QString )
+void QtxPathDialog::fileNameChanged( int /*id*/, QString /*fileName*/ )
 {
 }
 
 /*!
-  \return frame with options
+  \fn void QtxPathDialog::fileNameChanged( QString fileName );
+  \brief Emitted when the file name is changed.
+  \param fileName file name
+*/
+
+/*!
+  \brief Get options grame widget.
+  \return options frame widget
 */
 QFrame* QtxPathDialog::optionsFrame()
 {
-       return myOptionsFrame;
+  return myOptionsFrame;
 }
 
 /*!
-  \return file name
-  \param id - id of file entry
+  \brief Get file name from specified entry.
+  \param id file entry ID
+  \return file name or null string if \a id is invalid
 */
 QString QtxPathDialog::fileName( const int id ) const
 {
-       QString res;
-       if ( myEntries.contains( id ) )
-               res = myEntries[id].edit->text();
-
-       return res;
+  QString res;
+  if ( myEntries.contains( id ) )
+    res = myEntries[id].edit->text();
+  return res;
 }
 
 /*!
-  Change file name of file entry
-  \param id - id of file entry
-  \param txt new file name
-  \param autoExt - assign extension automatically
+  \brief Change file name by specified file entry.
+  \param id file entry ID
+  \param txt new file name
+  \param autoExt if \c true, assign extension automatically
 */
 void QtxPathDialog::setFileName( const int id, const QString& txt, const bool autoExt )
 {
-       int mode;
-       QLineEdit* le = fileEntry( id, mode );
-
-       if ( le )
-       {
-               if ( autoExt && ( mode == OpenFile || mode == SaveFile ) )
-                       le->setText( autoExtension( txt ) );
-               else
-                       le->setText( txt );
-       }
+  int mode;
+  QLineEdit* le = fileEntry( id, mode );
+       
+  if ( le )
+  {
+    if ( autoExt && ( mode == OpenFile || mode == SaveFile ) )
+      le->setText( autoExtension( txt, filter( id ) ) );
+    else
+      le->setText( txt );
+  }
 }
 
 /*!
-  \return line edit of file entry
-  \param id - id of file entry
+  \brief Get file filter from the specified file entry.
+  \param id file entry ID
+  \return file filter or null string if \a id is invalid
 */
-QLineEdit* QtxPathDialog::fileEntry( const int id ) const
+QString QtxPathDialog::filter( const int id ) const
 {
-       QLineEdit* le = 0;
-       if ( myEntries.contains( id ) )
-               le = myEntries[id].edit;
-
-       return le;
+  QString res;
+  if ( myEntries.contains( id ) )
+    res = myEntries[id].filter;
+  return res;
 }
 
 /*!
-  \return line edit and mode of file entry
-  \param id - id of file entry
-  \param theMode - for return mode of file entry
+  \brief Set file filter to the specified file entry.
+  \param id file entry ID
+  \param filter file filter or null string if \a id is invalid
 */
-QLineEdit* QtxPathDialog::fileEntry( const int theId, int& theMode ) const
+void QtxPathDialog::setFilter( const int id, const QString& filter )
 {
-       QLineEdit* le = 0;
-       if ( myEntries.contains( theId ) )
-       {
-               le = myEntries[theId].edit;
-               theMode = myEntries[theId].mode;
-       }
-
-       return le;
+  if ( myEntries.contains( id ) )
+    myEntries[id].filter = filter;
 }
 
 /*!
-  Creates file entry
-  \return id of just created file entry
-  \param lab - title of entry
-  \param mode - mode of entry
-  \param id - proposed id (if it is -1, then id will be chosen automatically)
+  \brief Get line edit widget for the specified file entry.
+  \param id file entry ID
+  \return line edit widget or 0 if \a id is invalid
 */
-int QtxPathDialog::createFileEntry( const QString& lab, const int mode, const int id )
+QLineEdit* QtxPathDialog::fileEntry( const int id ) const
 {
-       int num = id;
-       if ( num == -1 )
-       {
-               num--;
-               while ( myEntries.contains( num ) )
-                       num--;
-       }
-
-       FileEntry entry;
-       entry.dlg = 0;
-       entry.mode = mode;
+  QLineEdit* le = 0;
+  if ( myEntries.contains( id ) )
+    le = myEntries[id].edit;
+  
+  return le;
+}
 
-       new QLabel( lab, myEntriesFrame );
-       entry.edit = new QLineEdit( myEntriesFrame );
-       entry.btn = new QPushButton( myEntriesFrame );
-       entry.btn->setAutoDefault( false );
-       entry.btn->setPixmap( QPixmap( open_icon ) );
+/*!
+  \brief Get line edit widget and file mode for the specified file entry.
+  \param id file entry ID
+  \param theMode to return file entry mode
+  \return line edit widget or 0 if \a id is invalid
+*/
+QLineEdit* QtxPathDialog::fileEntry( const int theId, int& theMode ) const
+{
+  QLineEdit* le = 0;
+  if ( myEntries.contains( theId ) )
+  {
+    le = myEntries[theId].edit;
+    theMode = myEntries[theId].mode;
+  }
+  
+  return le;
+}
 
-       connect( entry.btn, SIGNAL( clicked() ), this, SLOT( onBrowse() ) );
-       connect( entry.edit, SIGNAL( returnPressed() ), this, SLOT( onReturnPressed() ) );
-       connect( entry.edit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) );
+/*!
+  \brief Create new file entry.
 
-       myEntries.insert( num, entry );
+  If required file entry is already in use or if specified \a id is < 0,
+  new ID is generated and returned.
 
-       return num;
+  \param lab file entry title
+  \param mode file entry mode
+  \param id required file entry ID
+  \return created file entry ID
+*/
+int QtxPathDialog::createFileEntry( const QString& lab, const int mode, 
+                                                           const QString& filter, const int id )
+{
+  int num = id;
+  if ( num == -1 )
+  {
+    num--;
+    while ( myEntries.contains( num ) )
+      num--;
+  }
+  
+  FileEntry entry;
+  entry.dlg = 0;
+  entry.mode = mode;
+  entry.filter = filter;
+  
+  new QLabel( lab, myEntriesFrame );
+  entry.edit = new QLineEdit( myEntriesFrame );
+
+  entry.btn = new QPushButton( myEntriesFrame );
+  entry.btn->setAutoDefault( false );
+  entry.btn->setIcon( QPixmap( open_icon ) );
+
+  Qtx::PathType type = Qtx::PT_OpenFile;
+  switch ( mode )
+  {
+  case OpenFile:
+    type = Qtx::PT_OpenFile;
+    break;
+  case SaveFile:
+    type = Qtx::PT_SaveFile;
+    break;
+  case OpenDir:
+  case SaveDir:
+  case NewDir:
+    type = Qtx::PT_Directory;
+    break;
+  }
+  entry.edit->setCompleter( Qtx::pathCompleter( type, filter ) );
+
+  connect( entry.btn, SIGNAL( clicked() ), this, SLOT( onBrowse() ) );
+  connect( entry.edit, SIGNAL( returnPressed() ), this, SLOT( onReturnPressed() ) );
+  connect( entry.edit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) );
+  
+  myEntries.insert( num, entry );
+  
+  return num;
 }
 
 /*!
-  \return id of default entry
+  \brief Get default file entry ID.
+  \return default entry ID
 */
 int QtxPathDialog::defaultEntry() const
 {
-       return myDefault;
+  return myDefault;
 }
 
 /*!
-  Change default entry id
-  \param id - new default entry id
+  \brief Set default entry.
+  \param id new default entry ID
 */
 void QtxPathDialog::setDefaultEntry( const int id )
 {
-       myDefault = id;
+  myDefault = id;
 }
 
 /*!
-  Initialize dialog layout
+  \brief Initialize dialog layout.
 */
 void QtxPathDialog::initialize()
 {
-       setCaption( tr( "File dialog" ) );
-
-       QVBoxLayout* main = new QVBoxLayout( mainFrame() );
-       QtxGroupBox* mainGroup = new QtxGroupBox( 1, Qt::Horizontal, "", mainFrame() );
-       mainGroup->setFrameStyle( QFrame::NoFrame );
-  mainGroup->setInsideMargin( 0 );
-       main->addWidget( mainGroup );
-
-       myEntriesFrame = new QGroupBox( 3, Qt::Horizontal, "", mainGroup );
-       myOptionsFrame = new QFrame( mainGroup );
+  setWindowTitle( tr( "File dialog" ) );
+
+  QVBoxLayout* main = new QVBoxLayout( mainFrame() );
+  main->setMargin( 0 );
+
+  QtxGroupBox* base = new QtxGroupBox( "", mainFrame() );
+  main->addWidget( base );
+  
+  QtxGridBox*  mainGroup = new QtxGridBox( 1, Qt::Horizontal, base, 0 );
+  base->setWidget( mainGroup );
+  
+  myEntriesFrame = new QtxGridBox( 3, Qt::Horizontal, mainGroup );
+  myOptionsFrame = new QFrame( mainGroup );
 }
 
 /*!
-  \return list of filters
+  \brief Prepare file filters.
+  \param list of file masks, separated by ';;', for example, "*.h;;*.cxx"
+  \return list of processed file filters
 */
-QStringList QtxPathDialog::prepareFilters() const
+QStringList QtxPathDialog::prepareFilters( const QString& filter ) const
 {
-       QStringList res;
-       if ( !myFilter.isEmpty() )
-       {
-               res = QStringList::split( ";;", myFilter );
-               bool allFilter = false;
-               for ( QStringList::ConstIterator it = res.begin(); it != res.end() && !allFilter; ++it )
-               {
-                       QStringList wildCards = filterWildCards( *it );
-                       allFilter = wildCards.findIndex( "*.*" ) != -1;
-               }
-
-               if ( !allFilter )
-                       res.append( tr( "All files (*.*)" ) );
-       }
-
-       return res;
+  QStringList res;
+  bool allFilter = false;
+  if ( !filter.isEmpty() )
+  {
+    res = filter.split( ";;" );
+    for ( QStringList::ConstIterator it = res.begin(); it != res.end() && !allFilter; ++it )
+    {
+      QStringList wildCards = filterWildCards( *it );
+      allFilter = wildCards.indexOf( "*.*" ) != -1;
+    }
+  }
+  
+  if ( !allFilter )
+    res.append( tr( "All files (*.*)" ) );
+  
+  return res;
 }
 
 /*!
+  \brief Get wildcards from the specified file filter.
+  \param theFilter file filter being processed
   \return list of filters with filtered wild cards
 */
 QStringList QtxPathDialog::filterWildCards( const QString& theFilter ) const
 {
-       QStringList res;
-
-       int b = theFilter.findRev( "(" );
-       int e = theFilter.findRev( ")" );
-       if ( b != -1 && e != -1 )
-       {
-               QString content = theFilter.mid( b + 1, e - b - 1 ).stripWhiteSpace();
-               QStringList lst = QStringList::split( " ", content );
-               for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it )
-                       if ( (*it).find( "." ) != -1 )
-                               res.append( (*it).stripWhiteSpace() );
-       }
-       return res;
+  QStringList res;
+
+  int b = theFilter.lastIndexOf( "(" );
+  int e = theFilter.lastIndexOf( ")" );
+  if ( b != -1 && e != -1 )
+  {
+    QString content = theFilter.mid( b + 1, e - b - 1 ).trimmed();
+    QStringList lst = content.split( " " );
+    for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it )
+    {
+      if ( (*it).indexOf( "." ) != -1 )
+       res.append( (*it).trimmed() );
+    }
+  }
+  return res;
 }
 
 /*!
+  \brief Get file file name with automatically assigned extension.
+  \param theFileName file name being processed
+  \param theFilter list of file filters
   \return file name with assigned extension
-  \param theFileName - source file name
-  \param theFilter - list of filters
 */
 QString QtxPathDialog::autoExtension( const QString& theFileName, const QString& theFilter ) const
 {
-       QString fName = theFileName;
-
-       if ( fName.isEmpty() )
-               return fName;
-
-       QString filter = theFilter;
-       if ( filter.isEmpty() )
-       {
-               QStringList filters = prepareFilters();
-               if ( !filters.isEmpty() )
-                       filter = filters.first();
-       }
-
-       QStringList wildCards = filterWildCards( filter );
-       if ( !wildCards.isEmpty() )
-       {
-               QString ext = wildCards.first();
-               if ( ext.find( "." ) != -1 )
-                       ext = ext.mid( ext.find( "." ) + 1 );
-
-               if ( !ext.isEmpty() && !ext.contains( "*" ) )
-                       fName = QDir::convertSeparators( fName ) + QString( "." ) + ext;
-       }
-
-       return fName;
+  QString fName = theFileName;
+
+  if ( fName.isEmpty() )
+    return fName;
+  
+  QString filter;
+  QStringList filters = prepareFilters( theFilter );
+  if ( !filters.isEmpty() )
+    filter = filters.first();
+
+  QStringList wildCards = filterWildCards( filter );
+  if ( !wildCards.isEmpty() )
+  {
+    QString ext = wildCards.first();
+    if ( ext.indexOf( "." ) != -1 )
+      ext = ext.mid( ext.indexOf( "." ) + 1 );
+    
+    if ( !ext.isEmpty() && !ext.contains( "*" ) )
+      fName = QDir::convertSeparators( fName ) + QString( "." ) + ext;
+  }
+  
+  return fName;
 }
 
 /*!
-  \return true if widget has visible children
-  \param wid - widget
+  \brief Check if there are visible child widgets.
+  \param wid parent widget being checked
+  \return \c true if widget \a wid has visible children
 */
 bool QtxPathDialog::hasVisibleChildren( QWidget* wid ) const
 {
-       bool res = false;
-       if ( wid )
-       {
-               const QObjectList* aChildren = wid->children();
-               if ( aChildren )
-               {
-                       for ( QObjectListIt it( *aChildren ); it.current() && !res; ++it )
-                       {
-                               if ( it.current()->isWidgetType() )
-                                       res = ((QWidget*)it.current())->isVisibleTo( wid );
-                       }
-               }
-       }
-       return res;
+  bool res = false;
+  if ( wid )
+  {
+    const QObjectList& aChildren = wid->children();
+    for ( QObjectList::const_iterator it = aChildren.begin(); it != aChildren.end() && !res; ++it )
+    {
+      if ( (*it)->isWidgetType() )
+       res = ((QWidget*)(*it))->isVisibleTo( wid );
+    }
+  }
+  return res;
+}
+
+/*!
+  \brief Upadte dialof box's child widgets visibility state.
+*/
+void QtxPathDialog::updateVisibility()
+{
+  if ( hasVisibleChildren( myEntriesFrame ) )
+    myEntriesFrame->show();
+  else
+    myEntriesFrame->hide();
+  
+  if ( hasVisibleChildren( myOptionsFrame ) )
+    myOptionsFrame->show();
+  else
+    myOptionsFrame->hide();
 }
index a4db3a7fd65a3d001dee7ac39f6dd2cb7c5deb39..a963d9e0871eb5af1dfbb5d3206b8e3f18d30cc8 100755 (executable)
@@ -1,30 +1,33 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxPathDialog.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXPATHDIALOG_H
 #define QTXPATHDIALOG_H
 
 #include "QtxDialog.h"
 
-#include <qmap.h>
+#include <QMap>
 
 class QFrame;
 class QLineEdit;
@@ -40,10 +43,12 @@ class QTX_EXPORT QtxPathDialog : public QtxDialog
   Q_OBJECT
 
 protected:
-  QtxPathDialog( QWidget* = 0, const bool = true, const bool = false, const int = Standard, WFlags = 0 );
+  QtxPathDialog( QWidget* = 0, const bool = true, const bool = false,
+                 const int = Standard, Qt::WindowFlags = 0 );
 
 public:
-  QtxPathDialog( const bool, QWidget* = 0, const bool = true, const bool = false, const int = Standard, WFlags = 0 );
+  QtxPathDialog( const bool, QWidget* = 0, const bool = true,
+                 const bool = false, const int = Standard, Qt::WindowFlags = 0 );
   virtual ~QtxPathDialog();
 
   QString            fileName() const;
@@ -52,11 +57,12 @@ public:
   QString            filter() const;
   void               setFilter( const QString& );
 
-  virtual void       show();
-
 signals:
   void               fileNameChanged( QString );
 
+public slots:
+  virtual void       setVisible( bool );
+
 protected slots:
   void               validate();
 
@@ -74,33 +80,37 @@ protected:
   QString            fileName( const int ) const;
   void               setFileName( const int, const QString&, const bool = false );
 
+  QString            filter( const int ) const;
+  void               setFilter( const int, const QString& );
+
   QLineEdit*         fileEntry( const int ) const;
   QLineEdit*         fileEntry( const int, int& ) const;
-  int                createFileEntry( const QString&, const int, const int = -1 );
+  int                createFileEntry( const QString&, const int,
+                                      const QString& = QString(), const int = -1 );
 
   int                defaultEntry() const;
   void               setDefaultEntry( const int );
 
 private:
   void               initialize();
-  QStringList        prepareFilters() const;
+  void               updateVisibility();
+  QStringList        prepareFilters( const QString& ) const;
        bool               hasVisibleChildren( QWidget* ) const;
   QStringList        filterWildCards( const QString& ) const;
-  QString            autoExtension( const QString&, const QString& = QString::null ) const;
+  QString            autoExtension( const QString&, const QString& = QString() ) const;
 
 protected:
   enum { OpenFile, SaveFile, OpenDir, SaveDir, NewDir };
 
 private:
-  typedef struct { int mode; QLineEdit* edit;
+  typedef struct { int mode; QLineEdit* edit; QString filter;
                    QPushButton* btn; QFileDialog* dlg; } FileEntry;
   typedef QMap<int, FileEntry> FileEntryMap;
 
 private:
-  QString            myFilter;
   FileEntryMap       myEntries;
   int                myDefault;
-  QFrame*            myEntriesFrame;
+  QWidget*           myEntriesFrame;
   QFrame*            myOptionsFrame;
 };
 
diff --git a/src/Qtx/QtxPathEdit.cxx b/src/Qtx/QtxPathEdit.cxx
new file mode 100644 (file)
index 0000000..1504448
--- /dev/null
@@ -0,0 +1,251 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxPathEdit.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxPathEdit.h"
+
+#include <QLayout>
+#include <QDirModel>
+#include <QLineEdit>
+#include <QCompleter>
+#include <QToolButton>
+#include <QFileDialog>
+#include <QRegExpValidator>
+
+static const char* browse_icon[] = {
+"16 16 5 1",
+"  c none",
+". c #ffff00",
+"# c #848200",
+"a c #ffffff",
+"b c #000000",
+"                ",
+"          bbb   ",
+"         b   b b",
+"              bb",
+"  bbb        bbb",
+" ba.abbbbbbb    ",
+" b.a.a.a.a.b    ",
+" ba.a.a.a.ab    ",
+" b.a.abbbbbbbbbb",
+" ba.ab#########b",
+" b.ab#########b ",
+" bab#########b  ",
+" bb#########b   ",
+" bbbbbbbbbbb    ",
+"                ",
+"                "
+};
+
+/*!
+  \class QtxPathEdit
+  \brief The QtxPathEdit class represents a widget for file or directory
+  path preference items editing.
+
+  The path preference item is represented as the line edit box for the 
+  direct path editing and small button clicking on which invokes browse
+  dialog box. The widget can be used in different modes: "Open File", 
+  "Save File", "Select Directory". The mode defines the type of the
+  standard browse dialog box which is invoked on the button clicking.
+
+  Initial path value can be set with setPath() method. Chosen path
+  can be retrieved with the path() method. The widget mode can be set 
+  with setPathType() and retrieved with pathType() method.
+
+  In addition, file/direcrory filters (wildcards) can be set with the
+  setPathFilter() method and retrieved with pathFilter() method.
+*/
+
+/*!
+  \brief Constructor
+  \param type widget mode (Qtx::PathType)
+  \param parent parent widget
+  \sa pathType(), setPathType()
+*/
+QtxPathEdit::QtxPathEdit( const Qtx::PathType type, QWidget* parent )
+: QFrame( parent ),
+  myType( type )
+{
+  initialize();
+}
+
+/*!
+  \brief Constructor
+
+  Qtx::PT_OpenFile mode is used by default.
+
+  \param parent parent widget
+  \sa pathType(), setPathType()
+*/
+QtxPathEdit::QtxPathEdit( QWidget* parent )
+: QFrame( parent ),
+  myType( Qtx::PT_OpenFile )
+{
+  initialize();
+}
+
+/*!
+  \brief Destructor
+*/
+QtxPathEdit::~QtxPathEdit()
+{
+}
+
+/*!
+  \brief Get widget mode.
+  \return currently used widget mode (Qtx::PathType)
+  \sa setPathType()
+*/
+Qtx::PathType QtxPathEdit::pathType() const
+{
+  return myType;
+}
+
+/*!
+  \brief Set widget mode.
+  \param type new widget mode (Qtx::PathType)
+  \sa pathType()
+*/
+void QtxPathEdit::setPathType( const Qtx::PathType type )
+{
+  if ( myType == type )
+    return;
+
+  myType = type;
+  updateState();
+}
+
+/*!
+  \brief Get currently selected path.
+  \return file or directory path entered by the user
+  \sa setPath()
+*/
+QString QtxPathEdit::path() const
+{
+  return myPath->text();
+}
+
+/*!
+  \brief Set path.
+  \param txt file or directory path 
+  \sa path()
+*/
+void QtxPathEdit::setPath( const QString& txt )
+{
+  myPath->setText( txt );
+}
+
+/*!
+  \brief Get currently used path filters.
+  \return file or directory path filters
+  \sa setPathFilter()
+*/
+QString QtxPathEdit::pathFilter() const
+{
+  return myFilter;
+}
+
+/*!
+  \brief Set path filters.
+  \param f new file or directory path filters
+  \sa pathFilter()
+*/
+void QtxPathEdit::setPathFilter( const QString& f )
+{
+  if ( myFilter == f )
+    return;
+
+  myFilter = f;
+  updateState();
+}
+
+/*!
+  \brief Called when user clicks "Browse" button. 
+
+  Invokes standard browsng dialog box depending on the used widget mode.
+
+  \param on (not used)
+  \sa mode(), setMode()
+*/
+void QtxPathEdit::onBrowse( bool /*on*/ )
+{
+  QString path;
+  QString initial = QFileInfo( myPath->text() ).path();
+  switch ( pathType() )
+  {
+  case Qtx::PT_OpenFile:
+    path = QFileDialog::getOpenFileName( myPath, QString(), initial, pathFilter() );
+    break;
+  case Qtx::PT_SaveFile:
+    path = QFileDialog::getSaveFileName( myPath, QString(), initial, pathFilter() );
+    break;
+  case Qtx::PT_Directory:
+    path = QFileDialog::getExistingDirectory( myPath, QString(), initial );
+    break;
+  }
+
+  if ( !path.isEmpty() )
+    myPath->setText( QDir::convertSeparators( path ) ); 
+
+  myPath->setFocus();
+}
+
+/*!
+  \brief Get internal line edit widget.
+  \return line edit box widget
+*/
+QLineEdit* QtxPathEdit::lineEdit() const
+{
+  return myPath;
+}
+
+/*!
+  \brief Perform internal widget intialization.
+*/
+void QtxPathEdit::initialize()
+{
+  QHBoxLayout* base = new QHBoxLayout( this );
+  base->setMargin( 0 );
+  base->setSpacing( 5 );
+
+  base->addWidget( myPath = new QLineEdit( this ) );
+  myPath->setValidator( new QRegExpValidator( QRegExp( "^([\\w/]{2}|[A-Z]:)[^:;\\*\\?]*[\\w\\\\/\\.]$" ), myPath ) );
+
+  QToolButton* browse = new QToolButton( this );
+  browse->setIcon( QPixmap( browse_icon ) );
+  base->addWidget( browse );
+
+  connect( browse, SIGNAL( clicked( bool ) ), this, SLOT( onBrowse( bool ) ) );
+
+  setFocusProxy( myPath );
+
+  updateState();
+}
+
+/*!
+  \brief Update widget state.
+*/
+void QtxPathEdit::updateState()
+{
+  myPath->setCompleter( Qtx::pathCompleter( pathType(), pathFilter() ) );
+}
diff --git a/src/Qtx/QtxPathEdit.h b/src/Qtx/QtxPathEdit.h
new file mode 100644 (file)
index 0000000..eea26b6
--- /dev/null
@@ -0,0 +1,68 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxPathEdit.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXPATHEDIT_H
+#define QTXPATHEDIT_H
+
+#include "Qtx.h"
+
+#include <QFrame>
+
+class QLineEdit;
+
+class QTX_EXPORT QtxPathEdit : public QFrame
+{
+  Q_OBJECT
+
+public:
+  QtxPathEdit( const Qtx::PathType, QWidget* = 0 );
+  QtxPathEdit( QWidget* = 0 );
+  virtual ~QtxPathEdit();
+
+  QString       path() const;
+  void          setPath( const QString& );
+
+  Qtx::PathType pathType() const;
+  void          setPathType( const Qtx::PathType );
+
+  QString       pathFilter() const;
+  void          setPathFilter( const QString& );
+
+private slots:
+  void          onBrowse( bool = false );
+
+protected:
+  QLineEdit*    lineEdit() const;
+
+private:
+  void          initialize();
+  void          updateState();
+
+private:
+  QLineEdit*    myPath;
+  Qtx::PathType myType;
+  QString       myFilter;
+};
+
+#endif
diff --git a/src/Qtx/QtxPathListEdit.cxx b/src/Qtx/QtxPathListEdit.cxx
new file mode 100644 (file)
index 0000000..37c33aa
--- /dev/null
@@ -0,0 +1,814 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxPathListEdit.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxPathListEdit.h"
+
+#include "QtxPathEdit.h"
+
+#include <QLayout>
+#include <QPainter>
+#include <QListView>
+#include <QLineEdit>
+#include <QKeyEvent>
+#include <QDirModel>
+#include <QCompleter>
+#include <QToolButton>
+#include <QMessageBox>
+#include <QFileDialog>
+#include <QItemDelegate>
+#include <QStringListModel>
+
+static const char* delete_icon[] = {
+"16 16 3 1",
+"` c #810000",
+"  c none",
+"# c #ffffff",
+"                ",
+"                ",
+" ``#        ``# ",
+" ````#     ``#  ",
+"  ````#   ``#   ",
+"    ```# `#     ",
+"     `````#     ",
+"      ```#      ",
+"     `````#     ",
+"    ```# ``#    ",
+"   ```#   ``#   ",
+"  ```#     `#   ",
+"  ```#      `#  ",
+"   `#        `# ",
+"                ",
+"                "
+};
+
+static const char* insert_icon[] = {
+"16 16 5 1",
+"` c #000000",
+". c #ffff00",
+"# c #9d9da1",
+"  c none",
+"b c #ffffff",
+"                ",
+"                ",
+" #  #b #.       ",
+"  # #.#.` ` `   ",
+"  .#.b####   `  ",
+" ### ..         ",
+"  . # .#     `  ",
+" #` #.          ",
+"    #        `  ",
+"  `             ",
+"             `  ",
+"  `             ",
+"             `  ",
+"  ` ` ` ` ` `   ",
+"                ",
+"                "
+};
+
+static const char* movedown_icon[] = {
+"16 16 2 1",
+"` c #000000",
+"  c none",
+"                ",
+"                ",
+"         ```    ",
+"        ```     ",
+"       ```      ",
+"       ```      ",
+"       ```      ",
+"       ```      ",
+"   ```````````  ",
+"    `````````   ",
+"     ```````    ",
+"      `````     ",
+"       ```      ",
+"        `       ",
+"                ",
+"                "
+};
+
+static const char* moveup_icon[] = {
+"16 16 2 1",
+"` c #000000",
+"  c none",
+"                ",
+"                ",
+"        `       ",
+"       ```      ",
+"      `````     ",
+"     ```````    ",
+"    `````````   ",
+"   ```````````  ",
+"       ```      ",
+"       ```      ",
+"       ```      ",
+"       ```      ",
+"      ```       ",
+"     ```        ",
+"                ",
+"                "
+};
+
+
+/*!
+  \class QtxPathListEdit::Editor
+  \brief Path editor widget
+  \internal
+*/
+
+class QtxPathListEdit::Editor : public QtxPathEdit
+{
+public:
+  /*!
+    \brief Constructor
+    \internal
+  */
+  Editor( QWidget* parent = 0 ) : QtxPathEdit( parent )
+  {
+    layout()->setSpacing( 0 );
+    lineEdit()->setFrame( false );
+  }
+
+  /*!
+    \brief Destructor
+    \internal
+  */
+  virtual ~Editor() {}
+};
+
+/*!
+  \class QtxPathListEdit::Delegate
+  \brief Custom item delegate for the paths list widget.
+  \internal
+*/
+
+class QtxPathListEdit::Delegate : public QItemDelegate
+{
+public:
+  Delegate( QtxPathListEdit*, QObject* = 0 );
+  virtual ~Delegate();
+
+  virtual QWidget* createEditor( QWidget*, const QStyleOptionViewItem&, const QModelIndex& ) const;
+  virtual void     setModelData( QWidget*, QAbstractItemModel*, const QModelIndex& ) const;
+  virtual void     setEditorData( QWidget*, const QModelIndex& ) const;
+  virtual void     paint( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
+
+protected:
+  virtual void     drawFocus( QPainter*, const QStyleOptionViewItem&, const QRect& ) const;
+
+private:
+  QtxPathListEdit* myPathEdit;
+};
+
+/*!
+  \brief Constructor.
+  \internal
+  \param pe path list editor
+  \param parent parent widget
+*/
+QtxPathListEdit::Delegate::Delegate( QtxPathListEdit* pe, QObject* parent )
+: QItemDelegate( parent ),
+  myPathEdit( pe )
+{
+}
+
+/*!
+  \brief Destructor.
+  \internal
+*/
+QtxPathListEdit::Delegate::~Delegate()
+{
+}
+
+/*!
+  \brief Create editor widget.
+  \internal
+  \param parent parent widget
+  \param option style option
+  \param index data model index
+*/
+QWidget* QtxPathListEdit::Delegate::createEditor( QWidget* parent, const QStyleOptionViewItem& option,
+                                                  const QModelIndex& index ) const
+{
+  return myPathEdit->createEditor( parent );
+}
+
+/*!
+  \brief Set modified data back to the data model.
+  \internal
+  \param editor editor widget
+  \param model data model
+  \param index data model index
+*/
+void QtxPathListEdit::Delegate::setModelData( QWidget* editor, QAbstractItemModel* model,
+                                              const QModelIndex& index ) const
+{
+  myPathEdit->setModelData( editor, index );
+}
+
+/*!
+  \brief Set data from the data model to the editor.
+  \internal
+  \param editor editor widget
+  \param index data model index
+*/
+void QtxPathListEdit::Delegate::setEditorData( QWidget* editor, const QModelIndex& index ) const
+{
+  myPathEdit->setEditorData( editor, index );
+}
+
+/*!
+  \brief Customize paint operation.
+  \internal
+  \param painter painter
+  \param option style option
+  \param index data model index
+*/
+void QtxPathListEdit::Delegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
+                                       const QModelIndex& index ) const
+{
+  QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
+  if ( cg == QPalette::Normal && !( option.state & QStyle::State_Active ) )
+    cg = QPalette::Inactive;
+
+  if ( option.state & QStyle::State_Selected )
+  {
+    painter->fillRect( option.rect, option.palette.brush( cg, QPalette::Highlight ) );
+    painter->setPen( option.palette.color( cg, QPalette::HighlightedText ) );
+  }
+  else
+    painter->setPen( option.palette.color( cg, QPalette::Text ) );
+
+  QItemDelegate::paint( painter, option, index );
+}
+
+/*!
+  \brief Customize drawing selection focus operation.
+  \internal
+  \param painter painter
+  \param option style option
+  \param rect selection rectangle
+*/
+void QtxPathListEdit::Delegate::drawFocus( QPainter* painter, const QStyleOptionViewItem& option,
+                                           const QRect& rect ) const
+{
+  QItemDelegate::drawFocus( painter, option, option.rect );
+}
+
+/*!
+  \class QtxPathListEdit
+  \brief The QtxPathListEdit class represents a widget for files or 
+  directories paths list preference items editing.
+
+  The path list preference item is represented as the list box widget.
+  It provides such operations like adding new file/directory path to the
+  list, removing selected paths and modifying of already entered ones.
+
+  The widget can be used in two modes: list of files or list of directories.
+  The mode defines the type of the standard browse dialog box which is
+  invoked on the browse button clicking.
+
+  Initial path list value can be set with setPathList() method. Chosen path
+  list can be retrieved with the pathList() method. The widget mode can be set 
+  with setPathType() and retrieved with pathType() method.
+
+  In addition, it is possible to add path items to the list with the insert()
+  method, remove items with the remove() methods, clear all the widget contents
+  with the clear() method. To get the number of entered paths can be retrieved
+  with the count() method. To check if any path already exists in the paths list,
+  use contains() method.
+*/
+
+/*!
+  \brief Constructor.
+  \param type widget mode (Qtx::PathType)
+  \param parent parent widget
+  \sa pathType(), setPathType()
+*/
+QtxPathListEdit::QtxPathListEdit( const Qtx::PathType type, QWidget* parent )
+: QFrame( parent ),
+  myCompleter( 0 ),
+  myType( type ),
+  myDuplicate( false )
+{
+  initialize();
+}
+
+/*!
+  \brief Constructor.
+
+  Qtx::PT_OpenFile mode is used by default.
+
+  \param parent parent widget
+  \sa pathType(), setPathType()
+*/
+QtxPathListEdit::QtxPathListEdit( QWidget* parent )
+: QFrame( parent ),
+  myCompleter( 0 ),
+  myType( Qtx::PT_OpenFile ),
+  myDuplicate( false )
+{
+  initialize();
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPathListEdit::~QtxPathListEdit()
+{
+}
+
+/*!
+  \brief Get widget mode.
+  \return currently used widget mode (Qtx::PathType)
+  \sa setPathType()
+*/
+Qtx::PathType QtxPathListEdit::pathType() const
+{
+  return myType;
+}
+
+/*!
+  \brief Set widget mode.
+  \param t new widget mode (Qtx::PathType)
+  \sa pathType()
+*/
+void QtxPathListEdit::setPathType( const Qtx::PathType t )
+{
+  if ( myType == t )
+    return;
+
+  myType = t;
+
+  delete myCompleter;
+  myCompleter = 0;
+}
+
+/*!
+  \brief Get currently selected paths list.
+  \return files or directories paths list entered by the user
+  \sa setPathList()
+*/
+QStringList QtxPathListEdit::pathList() const
+{
+  return myModel->stringList();
+}
+
+/*!
+  \brief Set paths list.
+  \param lst files or directories paths list
+  \sa pathList()
+*/
+void QtxPathListEdit::setPathList( const QStringList& lst )
+{
+  myModel->setStringList( lst );
+}
+
+/*!
+  \brief Check if the duplication of paths is enabled.
+  \return \c true if the duplication is enabled
+*/
+bool QtxPathListEdit::isDuplicateEnabled() const
+{
+  return myDuplicate;
+}
+
+/*!
+  \brief Enable/disable paths duplication.
+  \param on new flag value
+*/
+void QtxPathListEdit::setDuplicateEnabled( const bool on )
+{
+  myDuplicate = on;
+}
+
+/*!
+  \brief Get number of currently entered paths.
+  \return current paths number
+*/
+int QtxPathListEdit::count() const
+{
+  return myModel->rowCount();
+}
+
+/*!
+  \brief Check if the specified \a path already exists in 
+  the paths list.
+  \param path path to be checked
+  \return \c true if the path is already selected by the user 
+  or \c false otherwise
+*/
+bool QtxPathListEdit::contains( const QString& path ) const
+{
+  return myModel->stringList().contains( path );
+}
+
+/*!
+  \brief Clear paths list.
+*/
+void QtxPathListEdit::clear()
+{
+  myModel->removeRows( 0, myModel->rowCount() );
+}
+
+/*!
+  \brief Remove path from the paths list.
+  \param idx path index in the list
+*/
+void QtxPathListEdit::remove( const int idx )
+{
+  if ( 0 <= idx && idx < myModel->rowCount() )
+    myModel->removeRow( idx );
+}
+
+/*!
+  \brief Remove path from the paths list.
+  \param path path to be removed
+*/
+void QtxPathListEdit::remove( const QString& path )
+{
+  QModelIndexList indexes = myModel->match( myModel->index( 0, 0 ), Qt::DisplayRole, path,
+                                            myModel->rowCount(), Qt::MatchExactly | Qt::MatchCaseSensitive );
+  while ( !indexes.isEmpty() )
+  {
+    myModel->removeRow( indexes.last().row() );
+    indexes.removeLast();
+  }
+}
+
+/*!
+  \brief Add path to the list of paths.
+
+  If the specified index is out of range, the path is added to 
+  the end of the list.
+
+  \param path path to be added
+  \param idx index in the list to which the path should be inserted.
+*/
+void QtxPathListEdit::insert( const QString& path, const int idx )
+{
+  int index = idx < 0 ? myModel->rowCount() : qMin( idx, myModel->rowCount() );
+  if ( myModel->insertRow( index ) )
+    myModel->setData( myModel->index( index, 0 ), path, Qt::EditRole );
+}
+
+/*
+bool QtxPathListEdit::validate( const bool quietMode )
+{
+  if ( myEdited )
+  {
+    QString dirPath = QFileInfo( myEdit->text().stripWhiteSpace() ).filePath();
+    QDir dir(dirPath);
+    QListBoxItem* found = 0;
+    for (unsigned i = 0; i < myList->count()-1; i++) {
+      QDir aDir(myList->text(i));
+      if ( aDir.canonicalPath().isNull() && myList->text(i) == dir.absPath() ||
+          !aDir.canonicalPath().isNull() && aDir.exists() && aDir.canonicalPath() == dir.canonicalPath()) {
+          found = myList->item(i);
+        break;
+      }
+    }
+    if (dirPath.isEmpty()) {
+      if (found) {
+        // it should be last (empty) item in the list - nothing to do
+        return true;
+      }
+      else {
+        // delete directory from the list
+        removeDir(myLastSelected);
+        return true;
+      }
+    }
+    else {
+      if (found) {
+        if (found != myLastSelected) {
+          // it is forbidden to add directory more then once
+         if ( !quietMode )
+           QMessageBox::critical(this, 
+                                 tr("Error"),
+                                 tr("Directory already specified."), 
+                                 tr("Ok"));
+         myEdit->setFocus();
+          return false;
+        }
+      }
+      else {
+        if (!dir.exists()) {
+         if ( !quietMode && QMessageBox::information(this, 
+                                                     tr("Warning"),
+                                                     tr("%1\n\nThe directory doesn't exist.\nAdd directory anyway?").arg(dir.absPath()),
+                                                     tr("Yes"), tr("No"), QString(), 1, 1) == 1) {
+           myEdit->setFocus();
+            return false;
+         }
+        }
+        // append
+        appendDir(myLastSelected, dir.absPath());
+      }
+    }
+  }
+  return true;
+}
+*/
+
+/*!
+  \brief Customize child widget events processing.
+  \param o event receiver object
+  \param e event
+  \return \c true if the further event processing should be stopped.
+*/
+bool QtxPathListEdit::eventFilter( QObject* o, QEvent* e )
+{
+  if ( e->type() == QEvent::KeyPress )
+  {
+    QKeyEvent* ke = (QKeyEvent*)e;
+    if ( ke->key() == Qt::Key_Delete )
+      onDelete();
+    else if ( ke->key() == Qt::Key_Insert )
+      onInsert();
+    else if ( ke->key() == Qt::Key_Up && ke->modifiers() == Qt::CTRL )
+    {
+      onUp();
+      return true;
+    }
+    else if ( ke->key() == Qt::Key_Down && ke->modifiers() == Qt::CTRL )
+    {
+      onDown();
+      return true;
+    }
+  }
+
+  return QFrame::eventFilter( o, e );
+}
+
+/*!
+  \brief Called when <Insert> button is clicked.
+
+  Inserts new empty line to the list and sets input focus to it.
+
+  \param on (not used)
+*/
+void QtxPathListEdit::onInsert( bool /*on*/ )
+{
+  int empty = -1;
+  QStringList lst = myModel->stringList();
+  for ( int r = 0; r < lst.count() && empty == -1; r++ )
+  {
+    if ( lst.at( r ).isEmpty() )
+      empty = r;
+  }
+
+  if ( empty == -1 )
+    myModel->insertRows( empty = myModel->rowCount(), 1 );
+
+  QModelIndex idx = myModel->index( empty, 0 );
+  myList->setCurrentIndex( idx );
+  myList->edit( idx );
+}
+
+/*!
+  \brief Called when <Delete> button is clicked.
+
+  Removes currently selected path item.
+  
+  \param on (not used)
+*/
+void QtxPathListEdit::onDelete( bool )
+{
+  QModelIndex idx = myList->currentIndex();
+  if ( !idx.isValid() )
+    return;
+
+  myModel->removeRow( idx.row() );
+}
+
+/*!
+  \brief Called when <Up> button is clicked.
+
+  Move currently selected path item up to one row in the paths list.
+
+  \param on (not used)
+*/
+void QtxPathListEdit::onUp( bool )
+{
+  QModelIndex idx = myList->currentIndex();
+  if ( !idx.isValid() || idx.row() < 1 )
+    return;
+
+  QModelIndex toIdx = myModel->index( idx.row() - 1, 0 );
+
+  QVariant val = myModel->data( toIdx, Qt::DisplayRole );
+  myModel->setData( toIdx, myModel->data( idx, Qt::DisplayRole ), Qt::DisplayRole );
+  myModel->setData( idx, val, Qt::DisplayRole );
+
+  myList->setCurrentIndex( toIdx );
+}
+
+/*!
+  \brief Called when <Down> button is clicked.
+
+  Move currently selected path item down to one row in the paths list.
+
+  \param on (not used)
+*/
+void QtxPathListEdit::onDown( bool )
+{
+  QModelIndex idx = myList->currentIndex();
+  if ( !idx.isValid() || idx.row() >= myModel->rowCount() - 1 )
+    return;
+
+  QModelIndex toIdx = myModel->index( idx.row() + 1, 0 );
+
+  QVariant val = myModel->data( toIdx, Qt::DisplayRole );
+  myModel->setData( toIdx, myModel->data( idx, Qt::DisplayRole ), Qt::DisplayRole );
+  myModel->setData( idx, val, Qt::DisplayRole );
+
+  myList->setCurrentIndex( toIdx );
+}
+
+/*!
+  \brief Perform internal widget initialization.
+*/
+void QtxPathListEdit::initialize()
+{
+  QVBoxLayout* base = new QVBoxLayout( this );
+  base->setMargin( 0 );
+  base->setSpacing( 5 );
+
+  QWidget* cBox = new QWidget( this );
+  base->addWidget( cBox );
+  
+  QHBoxLayout* cLayout = new QHBoxLayout( cBox );
+  cLayout->setMargin( 0 );
+  cLayout->setSpacing( 0 );
+
+  cLayout->addStretch( 1 );
+
+  QToolButton* insertBtn = new QToolButton( cBox );
+  insertBtn->setIcon( QPixmap( insert_icon ) );
+  cLayout->addWidget( insertBtn );
+
+  QToolButton* deleteBtn = new QToolButton( cBox );
+  deleteBtn->setIcon( QPixmap( delete_icon ) );
+  cLayout->addWidget( deleteBtn );
+
+  QToolButton* upBtn = new QToolButton( cBox );
+  upBtn->setIcon( QPixmap( moveup_icon ) );
+  cLayout->addWidget( upBtn );
+
+  QToolButton* downBtn = new QToolButton( cBox );
+  downBtn->setIcon( QPixmap( movedown_icon ) );
+  cLayout->addWidget( downBtn );
+
+
+  myList = new QListView( this );
+  myList->setAlternatingRowColors( true );
+  myList->setItemDelegate( new Delegate( this, myList ) );
+  myList->setModel( myModel = new QStringListModel( myList ) );
+  myList->setSelectionMode( QListView::SingleSelection );
+  myList->setSelectionBehavior( QListView::SelectRows );
+  myList->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
+  myList->setEditTriggers( QListView::DoubleClicked );
+  myList->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+  myList->installEventFilter( this );
+
+  base->addWidget( myList );
+
+  connect( insertBtn, SIGNAL( clicked( bool ) ), this, SLOT( onInsert( bool ) ) );
+  connect( deleteBtn, SIGNAL( clicked( bool ) ), this, SLOT( onDelete( bool ) ) );
+  connect( upBtn,     SIGNAL( clicked( bool ) ), this, SLOT( onUp( bool ) ) );
+  connect( downBtn,   SIGNAL( clicked( bool ) ), this, SLOT( onDown( bool ) ) );
+}
+
+/*!
+  \brief Create editor widget.
+  \param parent parent widget for the editor
+  \return created editor widget
+*/
+QWidget* QtxPathListEdit::createEditor( QWidget* parent )
+{
+  QtxPathEdit* edit = new Editor( parent );
+  edit->setPathType( pathType() );
+  return edit;
+}
+
+/*!
+  \brief Set modified data from the editor to the list widget.
+  \param editor editor widget
+  \param index data model index
+*/
+void QtxPathListEdit::setModelData( QWidget* editor, const QModelIndex& index )
+{
+  QtxPathEdit* edit = ::qobject_cast<QtxPathEdit*>( editor );
+  if ( !edit )
+    return;
+
+  QString path = edit->path().trimmed();
+
+  if ( !isDuplicateEnabled() && !checkDuplicate( path, index.row() ) )
+    return;
+
+  if ( !checkExistance( path ) )
+    return;
+
+  myModel->setData( index, path, Qt::EditRole );
+}
+
+/*!
+  \brief Set data to the editor from the list widget when 
+  user starts path edition.
+  \param editor editor widget
+  \param index data model index
+*/
+void QtxPathListEdit::setEditorData( QWidget* editor, const QModelIndex& index )
+{
+  QtxPathEdit* edit = ::qobject_cast<QtxPathEdit*>( editor );
+  if ( !edit )
+    return;
+
+  QVariant v = myModel->data( index, Qt::EditRole );
+  edit->setPath( v.toString() );
+}
+
+/*!
+  \brief Check if path is correct (exists) and optionally 
+  show the question message box.
+  \param str path to be checked
+  \param msg if \c true and path does not exist, question message box is shown
+  \return \c true if the user confirms the path adding
+*/
+bool QtxPathListEdit::checkExistance( const QString& str, const bool msg )
+{
+  if ( pathType() == Qtx::PT_SaveFile )
+    return true;
+
+  bool ok = QFileInfo( str ).exists();
+  if ( !ok && msg )
+    ok = QMessageBox::question( this, tr( "Warning" ), tr( "Path \"%1\" doesn't exist. Add it to list anyway?" ).arg( str ),
+                                QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
+
+  if ( ok && QFileInfo( str ).exists() )
+  {
+    switch ( pathType() )
+    {
+    case Qtx::PT_OpenFile:
+      ok = QFileInfo( str ).isFile();
+      if ( !ok && msg )
+        QMessageBox::warning( this, tr( "Error" ), tr( "Location \"%1\" doesn't point to file" ).arg( str ) );
+      break;
+    case Qtx::PT_Directory:
+      ok = QFileInfo( str ).isDir();
+      if ( !ok && msg )
+        QMessageBox::warning( this, tr( "Error" ), tr( "Location \"%1\" doesn't point to directory" ).arg( str ) );
+      break;
+    }
+  }
+
+  return ok;
+}
+
+/*!
+  \brief Check if path already exists in the list and optionally
+  show the warning message box.
+  \param str path to be checked
+  \param row row corresponding to the path checked
+  \param msg if \c true and path does not exist, warning message box is shown
+  \return \c true if the user confirms the path adding
+*/
+bool QtxPathListEdit::checkDuplicate( const QString& str, const int row, const bool msg )
+{
+  int cur = -1;
+  QStringList lst = myModel->stringList();
+  for ( int r = 0; r < lst.count() && cur == -1; r++ )
+  {
+    if ( r != row && lst.at( r ) == str )
+      cur = r;
+  }
+
+  if ( cur != -1 && msg )
+    QMessageBox::warning( this, tr( "Error" ), tr( "Path \"%1\" already exist in the list" ).arg( str ) );
+   
+  return cur == -1;
+}
diff --git a/src/Qtx/QtxPathListEdit.h b/src/Qtx/QtxPathListEdit.h
new file mode 100644 (file)
index 0000000..012a5ad
--- /dev/null
@@ -0,0 +1,100 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxPathListEdit.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXPATHLISTEDIT_H
+#define QTXPATHLISTEDIT_H
+
+#include "Qtx.h"
+
+#include <QFrame>
+#include <QPointer>
+
+class QLineEdit;
+class QListView;
+class QCompleter;
+class QModelIndex;
+class QToolButton;
+class QStringListModel;
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+class QTX_EXPORT QtxPathListEdit : public QFrame
+{
+  Q_OBJECT
+
+  class Editor;
+  class Delegate;
+
+public:
+  QtxPathListEdit( const Qtx::PathType, QWidget* = 0 );
+  QtxPathListEdit( QWidget* = 0 );
+  virtual ~QtxPathListEdit();
+
+  Qtx::PathType     pathType() const;
+  void              setPathType( const Qtx::PathType );
+
+  QStringList       pathList() const;
+  void              setPathList( const QStringList& );
+
+  bool              isDuplicateEnabled() const;
+  void              setDuplicateEnabled( const bool );
+
+  int               count() const;
+  bool              contains( const QString& ) const;
+
+  void              clear();
+  void              remove( const int );
+  void              remove( const QString& );
+  void              insert( const QString&, const int = -1 );
+
+  bool              eventFilter( QObject*, QEvent* );
+
+protected slots:
+  void              onUp( bool = false );
+  void              onDown( bool = false );
+  void              onInsert( bool = false );
+  void              onDelete( bool = false );
+
+private:
+  void              initialize();
+  QWidget*          createEditor( QWidget* );
+  void              setModelData( QWidget*, const QModelIndex& );
+  void              setEditorData( QWidget*, const QModelIndex& );
+
+  bool              checkExistance( const QString&, const bool = true );
+  bool              checkDuplicate( const QString&, const int, const bool = true );
+
+private:
+  QListView*        myList;
+  Qtx::PathType     myType;
+  QStringListModel* myModel;
+  QCompleter*       myCompleter;
+  bool              myDuplicate;
+
+  friend class QtxPathListEdit::Delegate;
+};
+
+#endif
diff --git a/src/Qtx/QtxPopupMenu.cxx b/src/Qtx/QtxPopupMenu.cxx
deleted file mode 100644 (file)
index 8a1a4e4..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "QtxPopupMenu.h"
-
-#include <qpainter.h>
-
-/*!
-    Class: QtxPopupMenu::TitleMenuItem [Internal]
-    Descr: Custom menu item for popup title.
-*/
-
-class QtxPopupMenu::TitleMenuItem : public QCustomMenuItem
-{
-public:
-  TitleMenuItem( const QString&, const QIconSet&, const int );
-  virtual ~TitleMenuItem();
-
-  virtual bool  fullSpan() const;
-  virtual bool  isSeparator() const;
-  virtual void  setFont( const QFont& );
-
-  virtual void  paint( QPainter*, const QColorGroup&, bool, bool, int, int, int, int );
-  virtual QSize sizeHint();
-
-private:
-  QString       myText;
-  QIconSet      myIcon;
-  QFont         myFont;
-  int           myAlign;
-};
-
-/*!
-  Constructor
-*/
-QtxPopupMenu::TitleMenuItem::TitleMenuItem( const QString& txt, const QIconSet& ico, const int align )
-: QCustomMenuItem(),
-myText( txt ),
-myIcon( ico ),
-myAlign( align )
-{
-}
-
-/*!
-  Destructor
-*/
-QtxPopupMenu::TitleMenuItem::~TitleMenuItem()
-{
-}
-
-/*!
-  \return  TRUE if this item wants to span the entire popup menu width  
-*/
-bool QtxPopupMenu::TitleMenuItem::fullSpan() const
-{
-  return true;
-}
-
-/*!
-  \return TRUE if this item is just a separator
-*/
-bool QtxPopupMenu::TitleMenuItem::isSeparator() const
-{
-  return false;
-}
-
-/*!
-  Changes font of item
-  \param font - new font
-*/
-void QtxPopupMenu::TitleMenuItem::setFont( const QFont& font )
-{
-  myFont = font;
-  myFont.setBold( true );
-}
-
-/*!
-  Draws item
-*/
-void QtxPopupMenu::TitleMenuItem::paint( QPainter* p, const QColorGroup& cg,
-                                         bool act, bool enabled, int x, int y, int w, int h )
-{
-  QFont f = p->font();
-  p->setFont( myFont );
-
-  p->fillRect( x, y, w, h, cg.brush( QColorGroup::Dark ) );
-
-  p->setPen( cg.shadow() );
-  p->drawRect( x, y, w, h );
-
-  int m = 3;
-  int s = 3;
-  int iw = p->fontMetrics().width( myText ) + ( myIcon.isNull() ? 0 : myIcon.pixmap().width() + s );
-  int ih = QMAX( ( myIcon.isNull() ? 0 : myIcon.pixmap().height() ), p->fontMetrics().height() );
-
-  int ix = x;
-  int iy = y + m;
-
-  if ( myAlign & AlignLeft )
-    ix = x;
-  else if ( myAlign & AlignRight )
-    ix = x + ( w - iw );
-  else if ( myAlign & AlignHCenter )
-    ix = x + ( w - iw ) / 2;
-
-  if ( myAlign & AlignTop )
-    iy = y;
-  else if ( myAlign & AlignBottom )
-    iy = y + ( h - ih - m );
-  else if ( myAlign & AlignVCenter )
-    iy = y + ( h - ih ) / 2;
-
-  if ( !myIcon.isNull() )
-  {
-    p->drawPixmap( ix, iy + ( ih - myIcon.pixmap().height() ) / 2, myIcon.pixmap() );
-    ix += myIcon.pixmap().width() + s;
-  }
-
-  p->setPen( cg.brightText() );
-  p->drawText( ix, iy + ( ih - p->fontMetrics().height() ) / 2 +
-               p->fontMetrics().ascent(), myText, 0, -1 );
-
-  p->setFont( f );
-}
-
-/*!
-  \return the recommended size for item
-*/
-QSize QtxPopupMenu::TitleMenuItem::sizeHint()
-{
-  QFontMetrics fM( myFont );
-
-  int m = 3;
-  int s = 3;
-  int w = fM.width( myText ) + ( myIcon.isNull() ? 0 : myIcon.pixmap().width() + s );
-  int h = QMAX( ( myIcon.isNull() ? 0 : myIcon.pixmap().height() ), fM.height() ) + 2 * m;
-
-  return QSize( w, h );
-}
-
-/*!
-  Constructor
-*/
-QtxPopupMenu::QtxPopupMenu( QWidget* parent, const char* name )
-: QPopupMenu( parent, name ),
-myId( -1 ),
-myPolicy( TitleAuto ),
-myAlign( AlignCenter )
-{
-}
-
-/*!
-  Destructor
-*/
-QtxPopupMenu::~QtxPopupMenu()
-{
-}
-
-/*!
-  \return popup menu title
-*/
-QString QtxPopupMenu::titleText() const
-{
-  return myText;
-}
-
-/*!
-  \return popup menu icon
-*/
-QIconSet QtxPopupMenu::titleIcon() const
-{
-  return myIcon;
-}
-
-/*!
-  \return popup menu title policy
-*/
-int QtxPopupMenu::titlePolicy() const
-{
-  return myPolicy;
-}
-
-/*!
-  \return popup menu title alignment
-*/
-int QtxPopupMenu::titleAlignment() const
-{
-  return myAlign;
-}
-
-/*!
-  Changes title text
-  \param txt - new text
-*/
-void QtxPopupMenu::setTitleText( const QString& txt )
-{
-  if ( myText == txt )
-    return;
-
-  myText = txt;
-
-  updateTitle();
-}
-
-/*!
-  Changes title icon
-  \param icon - new icon
-*/
-void QtxPopupMenu::setTitleIcon( const QIconSet& ico )
-{
-  myIcon = ico;
-
-  updateTitle();
-}
-
-/*!
-  Changes title policy
-  \param p - new policy
-*/
-void QtxPopupMenu::setTitlePolicy( const int p )
-{
-  if ( myPolicy == p )
-    return;
-
-  myPolicy = p;
-
-  updateTitle();
-}
-
-/*!
-  Changes title alignment
-  \param a - new alignment
-*/
-void QtxPopupMenu::setTitleAlignment( const int a )
-{
-  if ( myAlign == a )
-    return;
-
-  myAlign = a;
-
-  updateTitle();
-}
-
-/*!
-  Shows menu
-*/
-void QtxPopupMenu::show()
-{
-  insertTitle();
-
-  QPopupMenu::show();
-}
-
-/*!
-  Hides menu
-*/
-void QtxPopupMenu::hide()
-{
-  QPopupMenu::hide();
-
-  removeTitle();
-}
-
-/*!
-  Creates title item
-  \param txt - item text
-  \param icon - item icon
-  \param align - item alignment
-*/
-QtxPopupMenu::TitleMenuItem* QtxPopupMenu::createTitleItem( const QString& txt, const QIconSet& ico,
-                                                            const int align ) const
-{
-  return new TitleMenuItem( txt, ico, align );
-}
-
-/*!
-  Inserts title item to popup menu
-*/
-void QtxPopupMenu::insertTitle()
-{
-  if ( myId != -1 || titlePolicy() == TitleOff ||
-       ( titlePolicy() == TitleAuto && titleText().stripWhiteSpace().isEmpty() ) )
-    return;
-
-  TitleMenuItem* item = createTitleItem( titleText(), titleIcon(), titleAlignment() );
-
-  myId = insertItem( item, -1, 0 );
-  setItemEnabled( myId, false );
-}
-
-/*!
-  Removes title item from popup menu
-*/
-void QtxPopupMenu::removeTitle()
-{
-  if ( myId == -1 )
-    return;
-
-  removeItem( myId );
-  myId = -1;
-}
-
-/*!
-  Updates title item
-*/
-void QtxPopupMenu::updateTitle()
-{
-  if ( myId != -1 )
-  {
-    removeTitle();
-    insertTitle();
-  }
-}
diff --git a/src/Qtx/QtxPopupMenu.h b/src/Qtx/QtxPopupMenu.h
deleted file mode 100644 (file)
index 01dd270..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef QTXPOPUPMENU_H
-#define QTXPOPUPMENU_H
-
-#include "Qtx.h"
-
-#include <qstring.h>
-#include <qiconset.h>
-#include <qpopupmenu.h>
-
-class QTX_EXPORT QtxPopupMenu : public QPopupMenu
-{
-  Q_OBJECT
-
-protected:
-  class TitleMenuItem;
-
-public:
-  enum { TitleAuto, TitleOn, TitleOff };
-
-public:
-  QtxPopupMenu( QWidget* = 0, const char* = 0 );
-  virtual ~QtxPopupMenu();
-
-  QString                titleText() const;
-  QIconSet               titleIcon() const;
-
-  int                    titlePolicy() const;
-  int                    titleAlignment() const;
-
-  virtual void           setTitleText( const QString& );
-  virtual void           setTitleIcon( const QIconSet& );
-
-  virtual void           setTitlePolicy( const int );
-  virtual void           setTitleAlignment( const int );
-
-public slots:
-  virtual void           show();
-  virtual void           hide();
-
-protected:
-  virtual TitleMenuItem* createTitleItem( const QString&, const QIconSet&, const int ) const;
-
-private:
-  void                   updateTitle();
-  void                   insertTitle();
-  void                   removeTitle();
-
-private:
-  int                    myId;
-  QString                myText;
-  QIconSet               myIcon;
-  int                    myAlign;
-  int                    myPolicy;
-};
-
-#endif
index 5f0df3de8722740d81f1a42c6d16b30e64c9daea..343f09314a51a73d17f477d27903fd38d0061ea0 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxPopupMgr.cxx
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
-
 #include "QtxPopupMgr.h"
-#include "QtxListOfOperations.h"
-#include "QtxStdOperations.h"
 #include "QtxAction.h"
-
-#include <qpopupmenu.h>
-#include <qdatetime.h>
-
+#include "QtxEvalExpr.h"
+#include <QMenu>
 
 /*!
-  \return value of global parameter (depending on whole selection, but not dependending on one object of selection)
-  \param str - name of parameter
-
-  By default, it returns count of selected objects ("selcount") and list of parameters ("$<name>")
+  \brief Used for comparing of two QVariant values.
+  \param v1 first argument for comparison
+  \param v2 second argument for comparison
+  \return \c true if \a v1 less than \a v2
 */
-QtxValue QtxPopupMgr::Selection::globalParam( const QString& str ) const
+bool operator<( const QVariant& v1, const QVariant& v2 )
 {
-  if( str==selCountParam() )
-    return count();
-
-  else if( str[0]==equality() )
+  QVariant::Type t1 = v1.type(), t2 = v2.type();
+  if ( t1 == t2 )
   {
-    QtxSets::ValueSet set;
-    QString par = str.mid( 1 );
-
-    for( int i=0, n=count(); i<n; i++ )
+    switch( t1 )
     {
-      QtxValue v = param( i, par );
-      if( v.isValid() )
-       QtxSets::add( set, v );
-      else
-       return QtxValue();      
+    case QVariant::Int:
+      return v1.toInt() < v2.toInt();
+    case QVariant::Double:
+      return v1.toDouble() < v2.toDouble();
+    case QVariant::String:
+      return v1.toString() < v2.toString();
+    case QVariant::StringList:
+    case QVariant::List:
+    {
+      const QList<QVariant>& aList1 = v1.toList(), aList2 = v2.toList();
+      QList<QVariant>::const_iterator anIt1 = aList1.begin(), aLast1 = aList1.end(),
+       anIt2 = aList2.begin(), aLast2 = aList2.end();
+      for ( ; anIt1 != aLast1 && anIt2 != aLast2;  anIt1++, anIt2++ )
+      {
+       if ( (*anIt1) != (*anIt2) )
+         return (*anIt1)<(*anIt2);
+      }
+      return anIt1 == aLast1 && anIt2 != aLast2;
+    }
+    default:
+      return v1.toString() < v2.toString();
     }
-    return set;
   }
-
-  else
-    return QtxValue();
+  return t1 < t2;
 }
 
 /*!
-  \return symbole to detect name of parameter list
+  \class QtxPopupMgr::PopupCreator
+  \internal
+  \brief Popup menu actions creator.
+
+  Used by Reader to create actions by reading descriptions from the file
+  and fill in the action manager with the actions.
 */
-QChar QtxPopupMgr::Selection::equality() const
+
+class QtxPopupMgr::PopupCreator : public QtxActionMgr::Creator
 {
-  return defEquality();
-}
+public:
+  PopupCreator( QtxActionMgr::Reader*, QtxPopupMgr* );
+  virtual ~PopupCreator();
+
+  virtual int     append( const QString&, const bool,
+                          const ItemAttributes&, const int );
+
+  virtual QString rule( const ItemAttributes&, 
+                       const QtxPopupMgr::RuleType = VisibleRule ) const;
+
+private:
+  QtxPopupMgr*    myMgr;
+};
 
 /*!
-  \return name of parameter for count of selected objects
+  \brief Constructor.
+  \param r menu action reader
+  \param mgr popup menu manager
 */
-QString QtxPopupMgr::Selection::selCountParam() const
+QtxPopupMgr::PopupCreator::PopupCreator( QtxActionMgr::Reader* r,
+                                         QtxPopupMgr* mgr )
+: QtxActionMgr::Creator( r ),
+  myMgr( mgr )
 {
-  return defSelCountParam();
 }
 
 /*!
-  \return default symbole to detect name of parameter list
+  \brief Destructor.
 */
-QChar QtxPopupMgr::Selection::defEquality()
+QtxPopupMgr::PopupCreator::~PopupCreator()
 {
-    return '$';
 }
 
 /*!
-  \return default name of parameter for count of selected objects
+  \brief Create and append new action to the action manager.
+  \param tag item tag name
+  \param subMenu \c true if this item is submenu
+  \param attr attributes map
+  \param pId parent action ID
+  \return menu action ID
 */
-QString QtxPopupMgr::Selection::defSelCountParam()
+int QtxPopupMgr::PopupCreator::append( const QString& tag, const bool subMenu,
+                                       const ItemAttributes& attr, const int pId )
 {
-    return "selcount";
-}
-
+  if ( !myMgr || !reader() )
+    return -1;
 
+  QString label   = reader()->option( "label",     "label"     ),
+          id      = reader()->option( "id",        "id"        ),
+          pos     = reader()->option( "pos",       "pos"       ),
+          group   = reader()->option( "group",     "group"     ),
+          tooltip = reader()->option( "tooltip",   "tooltip"   ),
+          sep     = reader()->option( "separator", "separator" ),
+          accel   = reader()->option( "accel",     "accel"     ),
+          icon    = reader()->option( "icon",      "icon"      ),
+          toggle  = reader()->option( "toggle",    "toggle"    );
 
-/*!
-  \class QtxCacheSelection
+  QtxActionMenuMgr* mgr = myMgr;
 
-  Special selection class, that caches parameter values.
-  Every parameter during popup building is calculated only one time,
-  although it may be included to many rules. After calculation
-  it is stored in internal map
-*/
+  int res = -1, actId = intValue( attr, id, -1 );;
+  if ( subMenu )
+    res = mgr->insert( strValue( attr, label ), pId, intValue( attr, group, 0 ), intValue( attr, pos, -1 ) );
+  else if ( tag == sep )
+    res = mgr->insert( separator(), pId, intValue( attr, group, 0 ), intValue( attr, pos, -1 ) );
+  else
+  {
+    QIcon set;
+    QPixmap pix;
+    QString name = strValue( attr, icon );
+    if( !name.isEmpty() )
+    {
+      if ( loadPixmap( name, pix ) )
+        set = QIcon( pix );
+    }
 
-class QtxCacheSelection : public QtxPopupMgr::Selection
-{
-public:
-  QtxCacheSelection( QtxPopupMgr::Selection* );
-  virtual ~QtxCacheSelection();
+    QString actLabel = strValue( attr, label );
+    QtxAction* newAct = new QtxAction( strValue( attr, tooltip ), set, actLabel,
+                                       QKeySequence( strValue( attr, accel ) ),
+                                       myMgr );
+    newAct->setToolTip( strValue( attr, tooltip ) );
+    QString toggleact = strValue( attr, toggle );
+    bool isToggle = !toggleact.isEmpty();
+    newAct->setCheckable( isToggle );
+    newAct->setChecked( toggleact.toLower() == "true" );
+        
+    connect( newAct );
+    int aid = mgr->registerAction( newAct, actId ); 
+    QString arule = rule( attr, QtxPopupMgr::VisibleRule );
+    if ( !arule.isEmpty() )
+      myMgr->setRule( newAct, arule, QtxPopupMgr::VisibleRule );
+    arule = rule( attr, QtxPopupMgr::EnableRule );
+    if ( !arule.isEmpty() )
+      myMgr->setRule( newAct, arule, QtxPopupMgr::EnableRule );
+    arule = rule( attr, QtxPopupMgr::ToggleRule );
+    if ( isToggle && !arule.isEmpty() )
+      myMgr->setRule( newAct, arule, QtxPopupMgr::ToggleRule );
+    res = mgr->insert( aid, pId, intValue( attr, group, 0 ), intValue( attr, pos, -1 ) );
+  }
 
-  virtual int      count() const;
-  virtual QtxValue param( const int, const QString& ) const;
-  virtual QtxValue globalParam( const QString& ) const;
+  return res;
+}
 
-private:
-  typedef QMap< QString, QtxValue >  CacheMap;
+/*!
+  \brief Get the rule for the menu item.
 
-  QtxPopupMgr::Selection*    mySel;
-  CacheMap                   myParamCache;
-};
+  Default implementation returns empty rule.
 
-/*!
-  Constructor
-  \param sel - base selection used for parameter calculation
+  \param attr attributes map
+  \param ruleType rule type (QtxPopupMgr::RuleType)
+  \return rule for the menu item corresponding to the rule type
 */
-QtxCacheSelection::QtxCacheSelection( QtxPopupMgr::Selection* sel )
-: mySel( sel )
+QString QtxPopupMgr::PopupCreator::rule( const ItemAttributes& /*attr*/, 
+                                        const QtxPopupMgr::RuleType /*ruleType*/ ) const
 {
+  return QString();
 }
 
 /*!
-  Destructor
-*/
-QtxCacheSelection::~QtxCacheSelection()
-{
-}
+  \class QtxPopupMgr
+  \brief Popup menu manager.
 
-/*!
-  \return count of selected objects
+  Menu manager allows using of set of action for automatic generating of
+  application context popup menu by reuquest and dynamic update of its
+  contents.
+
+  Use insert() methods to add menu items to the popup menu.
+
+  The visibility, enable and toggle state of the menu item is controlled
+  by the syntaxic rules, which can be set with setRule() methods.
+  The rules are parsed automatically with help of QtxEvalParser class.
+
+  QtxPopupSelection class is used as back-end for getting value of each
+  parameter found in the rule by the expression parser.
+  Use setSelection() and selection() to set/get the selection instance
+  for the popup menu manager.
+  
+  Popup menu manager automatically optimizes the menu by removing 
+  extra separators, hiding empty popup submenus etc.
 */
-int QtxCacheSelection::count() const
-{
-  return mySel ? mySel->count() : 0;
-}
 
 /*!
-  Calculates and caches parameters.
-  Already calculated parameters are returned without calculation
-  \return parameter value
-  \param i - index of selected object
-  \param name - name of parameter
+  \brief Constructor.
+  \param object parent object
 */
-QtxValue QtxCacheSelection::param( const int i, const QString& name ) const
+QtxPopupMgr::QtxPopupMgr( QObject* parent )
+: QtxActionMenuMgr( 0, parent ),
+  mySelection( 0 )
 {
-  QString param_name = name + "#####" + QString::number( i );
-  if( myParamCache.contains( param_name ) )
-    return myParamCache[ param_name ];
-  else
-  {
-    QtxValue v;
-    if( mySel )
-      v = mySel->param( i, name );
-    if( v.isValid() )
-      ( ( CacheMap& )myParamCache ).insert( param_name, v );
-    return v;
-  }
 }
 
 /*!
-  Calculates and caches global parameters.
-  Already calculated parameters are returned without calculation
-  \return parameter value
-  \param name - name of parameter
+  \brief Constructor.
+  \param popup popup menu
+  \param object parent object
 */
-QtxValue QtxCacheSelection::globalParam( const QString& name ) const
+QtxPopupMgr::QtxPopupMgr( QMenu* popup, QObject* parent )
+: QtxActionMenuMgr( popup, parent ),
+  mySelection( 0 )
 {
-  if( myParamCache.contains( name ) )
-    return myParamCache[ name ];
-  else
-  {
-    QtxValue v;
-    if( mySel )
-      v = mySel->globalParam( name );
-    if( v.isValid() )
-      ( ( CacheMap& )myParamCache ).insert( name, v );
-    return v;
-  }
 }
 
-
-
-
 /*!
-  Constructor
-  \param mgr - popup manager
+  \brief Destructor.
 */
-QtxPopupMgr::Operations::Operations( QtxPopupMgr* mgr )
-: QtxStrings(),
-  myPopupMgr( mgr )
+QtxPopupMgr::~QtxPopupMgr()
 {
-    QStringList aList;
-    aList.append( "every" );
-    aList.append( "any" );
-    aList.append( "onlyone" );
-    addOperations( aList );
-
-    myParser = new QtxParser( mgr->myOperations );
 }
 
 /*!
-  Destructor
-  Deletes internal parser
+  \brief Get popup menu.
+  \return popup menu
 */
-QtxPopupMgr::Operations::~Operations()
+QMenu* QtxPopupMgr::menu() const
 {
-    delete myParser;
+  return ::qobject_cast<QMenu*>( menuWidget() );
 }
 
 /*!
-    \return priority of popup operation 'op'.
-    \param isBin indicate whether the operation is binary
+  \brief Get popup menu.
+  \param menu popup menu
 */
-int QtxPopupMgr::Operations::prior( const QString& op, bool isBin ) const
+void QtxPopupMgr::setMenu( QMenu* menu )
 {
-    if( !isBin && ( op=="every" || op=="any" || op=="onlyone" ) )
-        return 1;
-    else
-        return QtxStrings::prior( op, isBin );
-
+  setMenuWidget( menu );
 }
 
 /*!
-    Calculates result of operation
-    \return one of error states
-    \param op - name of operation
-    \param v1 - first operation argument (must be used also to store result)
-    \param v2 - second operation argument
+  \brief Get selection.
+  \return current selection object
 */
-QtxParser::Error QtxPopupMgr::Operations::calculate
-    ( const QString& op, QtxValue& v1, QtxValue& v2 ) const
+QtxPopupSelection* QtxPopupMgr::selection() const
 {
-    int ind = -1;
-    if( op=="every" )
-        ind = 0;
-    else if( op=="any" )
-        ind = 1;
-    else if( op=="onlyone" )
-        ind = 2;
-
-    if( ind>=0 && ind<=2 )
-    {
-        QString val_name = op + "(" + v2.toString() + ")";
-        QtxParser::Error err = QtxParser::OK;
-
-        if( !myValues.contains( val_name ) )
-        {
-            myParser->setExpr( v2.toString() );
-            QStringList params, specific;
-            myParser->paramsList( params );
-
-            myParser->clear();
-            myPopupMgr->setParams( myParser, specific );
-
-            QtxPopupMgr::Selection* sel = myPopupMgr->myCurrentSelection;
-
-            int global_result = 0;
-            if( sel )
-                for( int i=0, n=sel->count(); i<n; i++ )
-                {
-                    QStringList::const_iterator anIt = specific.begin(),
-                                                aLast = specific.end();
-                    for( ; anIt!=aLast; anIt++ )
-                    {
-                        QtxValue v = sel->param( i, *anIt );
-                        if( v.isValid() )
-                            myParser->set( *anIt, v );
-                        else
-                            return QtxParser::InvalidToken;
-                    }
-
-                    QtxValue res = myParser->calculate();
-                    err = myParser->lastError();
-                    if( err==QtxParser::OK )
-                        if( res.type()==QVariant::Bool )
-                        {
-                            if( res.toBool() )
-                                global_result++;
-                            if( ind==2 && global_result>1 )
-                                break;
-                        }
-                        else
-                            return QtxParser::InvalidResult;
-                    else
-                        return err;
-                }
-
-            QtxValue& vv = ( QtxValue&  )myValues[ val_name ];
-            vv = ( ind==0 && global_result==sel->count() ) ||
-                 ( ind==1 ) ||
-                 ( ind==2 && global_result==1 );
-        }
-
-        v2 = myValues[ val_name ];
-
-        return err;
-    }
-    else
-        return QtxStrings::calculate( op, v1, v2 );
+  return mySelection;
 }
 
 /*!
-  Clears internal map of values
+  \brief Set selection.
+  \param sel new selection object
 */
-void QtxPopupMgr::Operations::clear()
+void QtxPopupMgr::setSelection( QtxPopupSelection* sel )
 {
-    myValues.clear();
-}
-
+  if ( mySelection == sel )
+    return;
 
+  delete mySelection;
 
+  mySelection = sel;
 
+  if ( mySelection )
+    mySelection->setParent( this );
+  connect( mySelection, SIGNAL( destroyed( QObject* ) ), 
+          this,        SLOT( onSelectionDestroyed( QObject* ) ) );
 
+  QtxActionMgr::triggerUpdate();
+}
 
+/*!
+  \brief Register an action and return its identifier.
 
+  If \a id is less than 0, the identifier for the action is generated automatically.
+  If action with given \a id is already registered, it will be re-registered.
+  If required \a id is already in use, new identifier is generatied; in this case
+  returning value will different from required one.
 
-/*!
-  Constructor
+  \param act action to be registered
+  \param id action ID
+  \param rule syntax rule
+  \param ruleType rule type (QtxPopupMgr::RuleType)
+  \return action ID (the same as \a id or generated one)
 */
-QtxPopupMgr::QtxPopupMgr( QPopupMenu* popup, QObject* parent )
-: QtxActionMenuMgr( popup, parent ),
-  myCurrentSelection( 0 )
+int QtxPopupMgr::registerAction( QAction* act, const int id, const QString& rule, const QtxPopupMgr::RuleType ruleType )
 {
-    createOperations();
+  int _id = QtxActionMenuMgr::registerAction( act, id );
+  setRule( act, rule, ruleType );
+  return _id;
 }
 
 /*!
-  Destructor
+  \brief Unregister action from internal map.
+  \param id action ID
 */
-QtxPopupMgr::~QtxPopupMgr()
+void QtxPopupMgr::unRegisterAction( const int id )
 {
-}
+  QAction* a = action( id );
+  if ( myRules.contains( a ) )
+  {
+    for ( ExprMap::iterator it = myRules[a].begin(); it != myRules[a].end(); ++it )
+      delete it.value();
+  }
+  myRules.remove( a );
 
-/*!
-  Creates popup operations instance
-*/
-void QtxPopupMgr::createOperations()
-{
-    myOperations = new QtxListOfOperations;
-    myOperations->prepend( "logic",   new QtxLogic(),           0 );
-    myOperations->prepend( "arithm",  new QtxArithmetics(),    50 );
-    myOperations->append( "strings", new QtxStrings(),       100 );
-    myOperations->append( "sets",    new QtxSets(),          150 );
-    myOperations->append( "custom",  new Operations( this ), 200 );
+  remove( id );
+
+  QtxActionMenuMgr::unRegisterAction( id );
 }
 
 /*!
-  Additional version of registerAction
-  \param act - action to be registered
-  \param visible - rule for visibility state
-  \param toggle - rule for toggle on state
-  \param id - proposed id (if it is less than 0, then id will be generated automatically)
+  \brief Insert action to the popup menu manager.
+  \param id action ID
+  \param pId parent menu action ID
+  \param rule syntax rule
+  \param ruleType rule type (QtxPopupMgr::RuleType)
+  \return action ID
 */
-int QtxPopupMgr::registerAction( QAction* act,
-                                 const QString& visible,
-                                 const QString& toggle,
-                                 const int id )
+int QtxPopupMgr::insertAction( const int id, const int pId, const QString& rule, const RuleType ruleType )
 {
-    int _id = QtxActionMenuMgr::registerAction( act, id );
-    setRule( _id, visible, true );
-    setRule( _id, toggle, false );
-    return _id;
+  int res = QtxActionMenuMgr::insert( id, pId, -1 );
+  setRule( action( id ), rule, ruleType );
+  return res;
 }
 
 /*!
-  Removes action from internal map
-  \param id - action id
+  \brief Insert action to the popup menu manager.
+  \param a action
+  \param pId parent menu action ID
+  \param rule syntax rule
+  \param ruleType rule type (QtxPopupMgr::RuleType)
+  \return action ID
 */
-void QtxPopupMgr::unRegisterAction( const int id )
+int QtxPopupMgr::insertAction( QAction* a, const int pId, const QString& rule, const RuleType ruleType )
 {
-    QAction* act = action( id );
-
-    myVisibility.remove( act );
-    myToggle.remove( act );
-
-    remove( id );
-    //QtxActionMenuMgr::unRegisterAction( id );
+  int res = QtxActionMenuMgr::insert( a, pId, -1 );
+  setRule( a, rule, ruleType );
+  return res;
 }
 
 /*!
-  \return true if manager has rule for action
-  \param act - action
-  \param visibility - if it is true, then rule for "visibility" is checked, otherwise - for "toggle"
+  \return true if action has rule of given type
+  \param a - action
+  \param t - rule type
 */
-bool QtxPopupMgr::hasRule( QAction* act, bool visibility ) const
+bool QtxPopupMgr::hasRule( QAction* a, const RuleType t ) const
 {
-    return map( visibility ).contains( act );
+  return a ? expression( a, t, false ) : false;
 }
 
 /*!
-  \return true if manager has rule for action
+  \return true if action with given id has rule of given type
   \param id - action id
-  \param visibility - if it is true, then rule for "visibility" is checked, otherwise - for "toggle"
+  \param t - rule type
 */
-bool QtxPopupMgr::hasRule( const int id, bool visibility ) const
+bool QtxPopupMgr::hasRule( const int id, const RuleType t ) const
 {
-    return hasRule( action( id ), visibility );
+  return hasRule( action( id ), t );
 }
 
 /*!
-  Sets new rule for action
-  \param act - action
-  \param rule - string expression of rule
-  \param visibility - if it is true, then rule for "visibility" will be set, otherwise - for "toggle"
+  \brief Get rule of type \a type for the action \a a.
+  \param a action
+  \param ruleType rule type (QtxPopupMgr::RuleType)
+  \return rule of required type
 */
-void QtxPopupMgr::setRule( QAction* act, const QString& rule, bool visibility )
+QString QtxPopupMgr::rule( QAction* a, const RuleType ruleType ) const
 {
-    if( !act || rule.isEmpty() )
-        return;
-
-    if( !hasRule( act, visibility ) )
-    {
-        QtxParser* p = new QtxParser( myOperations, rule );
-        if( p->lastError()==QtxParser::OK )
-            map( visibility ).insert( act, p );
-        else
-            delete p;
-    }
-    else
-    {
-        QtxParser* p = map( visibility )[ act ];
-        p->setExpr( rule );
-        if( p->lastError()!=QtxParser::OK )
-            p->setExpr( QString() );
-    }
+  QString rule;
+  QtxEvalExpr* expr = expression( a, ruleType );
+  if ( expr )
+    rule = expr->expression();
+  return rule;
 }
 
 /*!
-  Sets new rule for action
-  \param id - action id
-  \param rule - string expression of rule
-  \param visibility - if it is true, then rule for "visibility" will be set, otherwise - for "toggle"
+  \brief Get rule of type \a type for the action \a id.
+  \param id action ID
+  \param ruleType rule type (QtxPopupMgr::RuleType)
+  \return rule of required type
 */
-void QtxPopupMgr::setRule( const int id, const QString& rule, bool visibility )
+QString QtxPopupMgr::rule( const int id, const RuleType ruleType ) const
 {
-    setRule( action( id ), rule, visibility );
+  return rule( action( id ), ruleType );
 }
 
 /*!
-  \return true if parser has finished work without errors
-  \param p - parser
+  \brief Set rule of type \a type for the action \a a.
+  \param a action
+  \param rule rule
+  \param ruleType rule type (QtxPopupMgr::RuleType)
+  \return rule of required type
 */
-bool result( QtxParser* p )
+void QtxPopupMgr::setRule( QAction* a, const QString& rule, const RuleType ruleType )
 {
-    bool res = false;
-    if( p )
-    {
-        QtxValue vv = p->calculate();
-        res = p->lastError()==QtxParser::OK &&
-            ( ( vv.type()==QVariant::Int && vv.toInt()!=0 ) ||
-              ( vv.type()==QVariant::Bool && vv.toBool() ) );
-    }
-    return res;
+  if ( !a )
+    return;
+
+  QtxEvalExpr* expr = expression( a, ruleType, true );
+
+  expr->setExpression( rule );
 }
 
 /*!
-  Fills parser parameters with help of Selection::globalParam() method
-  \param p - parser
-  \param specific - list will be filled with names of parameters depending on selection objects (not global)
+  \brief Set rule of type \a type for the action \a id.
+  \param id action ID
+  \param rule rule
+  \param ruleType rule type (QtxPopupMgr::RuleType)
+  \return rule of required type
 */
-void QtxPopupMgr::setParams( QtxParser* p, QStringList& specific ) const
+void QtxPopupMgr::setRule( const int id, const QString& rule, const RuleType ruleType )
 {
-    if( !p || !myCurrentSelection )
-        return;
-
-    QStringList params;
-
-    p->paramsList( params );
-    QStringList::const_iterator anIt = params.begin(),
-                                aLast = params.end();
-    for( ; anIt!=aLast; anIt++ )
-    {
-      QtxValue v = myCurrentSelection->globalParam( *anIt );
-      if( v.isValid() )
-       p->set( *anIt, v );
-      else
-        specific.append( *anIt );
-    }
+  setRule( action( id ), rule, ruleType );
 }
 
 /*!
-  \return true if 'v1'<'v2'
-  This function can work with many types of values
+  \brief Calculate an expression.
+  \param p expression parser
+  \return \c true if parser has finished work without errors
 */
-bool operator<( const QtxValue& v1, const QtxValue& v2 )
+bool QtxPopupMgr::result( QtxEvalParser* p ) const
 {
-  QVariant::Type t1 = v1.type(), t2 = v2.type();
-  if( t1==t2 )
+  bool res = false;
+  if ( p )
   {
-    switch( t1 )
-    {
-    case QVariant::Int:
-      return v1.toInt() < v2.toInt();
-      
-    case QVariant::Double:
-      return v1.toDouble() < v2.toDouble();
-
-    case QVariant::CString:
-    case QVariant::String:
-      return v1.toString() < v2.toString();
+    QVariant vv = p->calculate();
+    res = p->error() == QtxEvalExpr::OK &&
+          ( ( vv.type() == QVariant::Int && vv.toInt() != 0 ) ||
+            ( vv.type() == QVariant::Bool && vv.toBool() ) );
+  }
+  return res;
+}
 
-    case QVariant::StringList:
-    case QVariant::List:
-    {
-      const QValueList<QtxValue>& aList1 = v1.toList(), aList2 = v2.toList();
-      QValueList<QtxValue>::const_iterator
-       anIt1 = aList1.begin(), aLast1 = aList1.end(),
-        anIt2 = aList2.begin(), aLast2 = aList2.end();
-      for( ; anIt1!=aLast1 && anIt2!=aLast2; anIt1++, anIt2++ )
-       if( (*anIt1)!=(*anIt2) )
-         return (*anIt1)<(*anIt2);
+/*!
+  \brief Fill the parser with parameters of the expression.
 
-      return anIt1==aLast1 && anIt2!=aLast2;
-    }
+  The values of the parameters are given from the selection object
+  (QtxPopupSelection).
+  
+  \param p expression parser
+  \param returning list of parameters names which are not retrieved from the selection
+  \sa selection()
+*/
+void QtxPopupMgr::setParameters( QtxEvalParser* p, QStringList& specific ) const
+{
+  if ( !p || !mySelection )
+    return;
 
-    default:
-      return v1.toString()<v2.toString();
-    }
+  QStringList params = p->parameters();
+  for ( QStringList::const_iterator it = params.begin(); it != params.end(); ++it )
+  {
+    QVariant v = parameter( *it );
+    if ( v.isValid() )
+      p->setParameter( *it, v );
+    else
+      specific.append( *it );
   }
-  else
-    return t1<t2;
 }
 
 /*!
-  \return true if rule of action is satisfied on current selection
-  \param act - action
-  \param visibility - what rule is checked: for visibility(true) or for toggle(false)
+  \brief Check the rule for the action.
+  \param act action
+  \param ruleType rule type (QtxPopupMgr::RuleType)
+  \return \c true if current selection satisfies the action rule
 */
-bool QtxPopupMgr::isSatisfied( QAction* act, bool visibility ) const
+bool QtxPopupMgr::isSatisfied( QAction* act, const RuleType ruleType ) const
 {
-  QString menu = act->menuText();
+  if ( !act )
+    return false;
 
-  bool res = false;
-  if( !act )
-    return res;
+  QtxEvalExpr* exp = expression( act, ruleType );
+  if ( !exp )
+    return true;
 
-  if( hasRule( act, visibility ) )
-  {
-    QtxParser* p = map( visibility )[ act ];
-    QStringList specific;
-    p->clear();
-    ( ( Operations* )myOperations->operations( "custom" ) )->clear();
+  bool res = false;
 
-    setParams( p, specific );
+  QtxEvalParser* p = exp->parser();
 
-    QMap<QValueList<QtxValue>,int> aCorteges;
-    QValueList<QtxValue> c;
+  QStringList specific;
+  p->clearParameters();
+  setParameters( p, specific );
 
-    if( specific.count()>0 )
-      if( myCurrentSelection )
+  QMap<QList<QVariant>, int> aCorteges;
+  if ( !specific.isEmpty() )
+  {
+    if ( mySelection )
+    {
+      res = false;
+      for ( int i = 0; i < mySelection->count() && !res; i++ )
       {
-       res = false;
-
-       for( int i=0, n=myCurrentSelection->count(); i<n && !res; i++ )
-       {
-         QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end();
-         c.clear();
-         for( ; anIt1!=aLast1; anIt1++ )
-           c.append( myCurrentSelection->param( i, *anIt1 ) );
-         aCorteges.insert( c, 0 );
-       }
-       
-       //qDebug( QString( "%1 corteges" ).arg( aCorteges.count() ) );
-       QMap<QValueList<QtxValue>,int>::const_iterator anIt = aCorteges.begin(), aLast = aCorteges.end();
-       for( ; anIt!=aLast; anIt++ )
-       {
-         QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end();
-         const QValueList<QtxValue>& aCortege = anIt.key();
-         QValueList<QtxValue>::const_iterator anIt2 = aCortege.begin();
-         for( ; anIt1!=aLast1; anIt1++, anIt2++ )
-           p->set( *anIt1, *anIt2 );
-         res = res || result( p );
-       }
-
-       /*
-       for( int i=0, n=myCurrentSelection->count(); i<n && !res; i++ )
-       {
-         QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end();
-         for( ; anIt1!=aLast1; anIt1++ )
-           p->set( *anIt1, myCurrentSelection->param( i, *anIt1 ) );
-         res = res || result( p );
-       }*/
+        QList<QVariant> c;
+       for ( QStringList::const_iterator anIt1 = specific.begin(); anIt1 != specific.end(); ++anIt1 )
+          c.append( parameter( *anIt1, i ) );
+        aCorteges.insert( c, 0 );
       }
-      else
-       res = false;
+      for ( QMap<QList<QVariant>, int>::const_iterator anIt = aCorteges.begin(); anIt  != aCorteges.end(); ++anIt )
+      {
+       const QList<QVariant>& aCortege = anIt.key();
+       QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end();
+       QList<QVariant>::const_iterator anIt2 = aCortege.begin();
+       for ( ; anIt1 != aLast1; anIt1++, anIt2++ )
+         p->setParameter( *anIt1, *anIt2 );
+       res = res || result( p );
+      }
+    }
     else
-      res = result( p );
+      res = false;
   }
+  else
+    res = result( p );
 
   return res;
 }
 
 /*!
-  \return true if item corresponding to action is visible
-  \param actId - action id
-  \param place - index of place
+  \brief Check if the menu item is visible.
+  \param id action ID
+  \param place some parent action ID
+  \return \c true if the action is visible
 */
-bool QtxPopupMgr::isVisible( const int actId, const int place ) const
+bool QtxPopupMgr::isVisible( const int id, const int place ) const
 {
-    bool res = QtxActionMenuMgr::isVisible( actId, place );
-    QAction* act = action( actId );
-    if( hasRule( act, true ) )
-        res = res && isSatisfied( act, true );
-    return res;
+  return QtxActionMenuMgr::isVisible( id, place ) && ( !hasRule( id ) || isSatisfied( action( id ) ) );
 }
 
 /*!
-  Updates popup according to selection
-  \param p - popup menu
-  \param sel - selection
+  \brief Perform internal update of the popup menu according 
+  to the current selection.
 */
-void QtxPopupMgr::updatePopup( QPopupMenu* p, Selection* sel )
+void QtxPopupMgr::internalUpdate()
 {
-  QTime t1 = QTime::currentTime();
+  myCache.clear();
 
-  if( !p || !sel )
-    return;
+  for ( RuleMap::iterator it = myRules.begin(); it != myRules.end(); ++it )
+  {
+    ExprMap& map = it.value();
+    if ( it.key()->isCheckable() && map.contains( ToggleRule ) &&
+         !map[ToggleRule]->expression().isEmpty() )
+      it.key()->setChecked( isSatisfied( it.key(), ToggleRule ) );
+  }
 
-  myCurrentSelection = new QtxCacheSelection( sel );
-  RulesMap::iterator anIt = myToggle.begin(),
-                            aLast = myToggle.end();
-  for( ; anIt!=aLast; anIt++ )
-    if( anIt.key()->isToggleAction() && hasRule( anIt.key(), false ) )
-      anIt.key()->setOn( isSatisfied( anIt.key(), false ) );
+  QtxActionMenuMgr::internalUpdate();
 
-  setWidget( ( QWidget* )p );
-  updateMenu();
-  QTime t2 = QTime::currentTime();
-  qDebug( QString( "update popup time = %1 msecs" ).arg( t1.msecsTo( t2 ) ) );
-  qDebug( QString( "number of objects = %1" ).arg( myCurrentSelection->count() ) );
+  myCache.clear();
+}
 
-  delete myCurrentSelection;
+/*!
+  \brief Update popup according to the current selection.
+*/
+void QtxPopupMgr::updateMenu()
+{
+  internalUpdate();
 }
 
 /*!
-  \return reference to map of rules
-  \param visibility - type of map: visibility of toggle
+  \brief Get an syntax expression for the action according to the specified rule type.
+  \param a action
+  \param ruleType rule type (QtxPopupMgr::RuleType)
+  \param create if \c true an expression does not exist, create it
+  \return syntax expression
 */
-QtxPopupMgr::RulesMap& QtxPopupMgr::map( bool visibility ) const
+QtxEvalExpr* QtxPopupMgr::expression( QAction* a, const RuleType ruleType, const bool create ) const
 {
-    return ( RulesMap& )( visibility ? myVisibility : myToggle );
+  QtxEvalExpr* res = 0;
+
+  QtxPopupMgr* that = (QtxPopupMgr*)this;
+  RuleMap& ruleMap = that->myRules;
+  if ( !ruleMap.contains( a ) && create )
+    ruleMap.insert( a, ExprMap() );
+
+  if ( ruleMap.contains( a ) )
+  {
+    ExprMap& exprMap = ruleMap[a];
+    if ( exprMap.contains( ruleType ) )
+      res = exprMap[ruleType];
+    else if ( create )
+      exprMap.insert( ruleType, res = new QtxEvalExpr() );
+  }
+
+  return res;
 }
 
 /*!
-  Loads actions description from file
-  \param fname - name of file
-  \param r - reader of file
-  \return true on success
+  \brief Load actions description from the file.
+  \param fname file name
+  \param r action reader
+  \return \c true on success and \c false on error
 */
 bool QtxPopupMgr::load( const QString& fname, QtxActionMgr::Reader& r )
 {
@@ -660,100 +617,159 @@ bool QtxPopupMgr::load( const QString& fname, QtxActionMgr::Reader& r )
   return r.read( fname, cr );
 }
 
+/*
+  \brief Get the specified parameter value.
+  \param name parameter name
+  \param idx additional index used when used parameters with same names 
+  \return parameter value
+  \sa selection()
+*/
+QVariant QtxPopupMgr::parameter( const QString& name, const int idx ) const
+{
+  QVariant val;
+  QString cacheName = name + ( idx >= 0 ? QString( "_%1" ).arg( idx ) : QString() );
+  if ( myCache.contains( cacheName ) )
+    val = myCache[cacheName];
+  else
+  {
+    if ( selection() )
+      val = idx < 0 ? selection()->parameter( name ) : 
+                      selection()->parameter( idx, name );
+    if ( val.isValid() )
+    {
+      QtxPopupMgr* that = (QtxPopupMgr*)this;
+      that->myCache.insert( cacheName, val );
+    }
+  }
+  return val;
+}
 
+/*!
+  \brief Called when selection is destroyed.
+  
+  Prevents crashes when the selection object is destroyed outside the
+  popup manager.
 
+  \param o selection object being destroyed
+*/
+void QtxPopupMgr::onSelectionDestroyed( QObject* o )
+{
+  if ( o == mySelection )
+    mySelection = 0;
+}
 
 /*!
-  Constructor
-  \param r - menu reader
-  \param mgr - menu manager
+  \class QtxPopupSelection
+  \brief This class is a part of the popup menu management system. 
+
+  The QtxPopupSelection class is used as back-end for getting value
+  of each parameter found in the rule by the expression parser.
+  
+  For example, it can be used for the analyzing of the currently 
+  selected objects and defining the values of the parameters used
+  in the rules syntax expression. Rules, in their turn, define
+  each action state - visibility, enabled and toggled state.
 */
-QtxPopupMgr::PopupCreator::PopupCreator( QtxActionMgr::Reader* r,
-                                         QtxPopupMgr* mgr )
-: QtxActionMgr::Creator( r ),
-  myMgr( mgr )
+
+/*!
+  \brief Constructor.
+*/
+QtxPopupSelection::QtxPopupSelection()
+: QObject( 0 )
 {
 }
 
 /*!
-  Destructor
-*/QtxPopupMgr::PopupCreator::~PopupCreator()
+  \brief Destructor.
+*/
+QtxPopupSelection::~QtxPopupSelection()
 {
 }
 
-
 /*!
-  Appends new menu items
-  \param tag - tag of item
-  \param subMenu - it has submenu
-  \param attr - list of attributes
-  \param pId - id of action corresponding to parent item
+  \brief Get an option value.
+  \param optName option name
+  \return option value or empty string if option is not found
 */
-int QtxPopupMgr::PopupCreator::append( const QString& tag, const bool subMenu,
-                                       const ItemAttributes& attr, const int pId )
+QString QtxPopupSelection::option( const QString& optName ) const
 {
-  if( !myMgr || !reader() )
-    return -1;
+  QString opt;
+  if ( myOptions.contains( optName ) )
+    opt = myOptions[optName];
+  return opt;
+}
 
-  QString label   = reader()->option( "label",     "label"     ),
-          id      = reader()->option( "id",        "id"        ),
-          pos     = reader()->option( "pos",       "pos"       ),
-          group   = reader()->option( "group",     "group"     ),
-          tooltip = reader()->option( "tooltip",   "tooltip"   ),
-          sep     = reader()->option( "separator", "separator" ),
-          accel   = reader()->option( "accel",     "accel"     ),
-          icon    = reader()->option( "icon",      "icon"      ),
-          toggle  = reader()->option( "toggle",    "toggle"    );
+/*!
+  \brief Set an option value.
+  \param optName option name
+  \param opt option value
+*/
+void QtxPopupSelection::setOption( const QString& optName, const QString& opt )
+{
+  myOptions.insert( optName, opt );
+}
 
-  int res = -1, actId = intValue( attr, id, -1 );;
-  if( subMenu )
-    res = myMgr->insert( strValue( attr, label ), pId, intValue( attr, group, 0 ), intValue( attr, pos, -1 ) );
-  else if( tag==sep )
-    res = myMgr->insert( separator(), pId, intValue( attr, group, 0 ), intValue( attr, pos, -1 ) );
-  else //if( !myMgr->contains( actId ) )
+/*!
+  \brief Get the parameter value.
+  \param str parameter name
+  \return parameter value
+*/
+QVariant QtxPopupSelection::parameter( const QString& str ) const
+{
+  if ( str == selCountParam() )
+    return count();
+  else if ( str.startsWith( equalityParam() ) )
   {
-    QPixmap pix; QIconSet set;
-    QString name = strValue( attr, icon );
-    if( !name.isEmpty() )
+    QtxEvalSetSets::ValueSet set;
+    QString par = str.mid( equalityParam().length() );
+    for ( int i = 0; i < (int)count(); i++ )
     {
-      if( loadPixmap( name, pix ) )
-        set = QIconSet( pix );
+      QVariant v = parameter( i, par );
+      if ( v.isValid() )
+       QtxEvalSetSets::add( set, v );
+      else
+       return QVariant();
     }
-
-    QString actLabel = strValue( attr, label );
-    QtxAction* newAct = new QtxAction( strValue( attr, tooltip ), set, actLabel,
-                                       QKeySequence( strValue( attr, accel ) ),
-                                       myMgr );
-    newAct->setToolTip( strValue( attr, tooltip ) );
-    QString toggleact = strValue( attr, toggle );
-    bool isToggle = !toggleact.isEmpty();
-    newAct->setToggleAction( isToggle );
-    newAct->setOn( toggleact.lower()=="true" );
-        
-    connect( newAct );
-    int aid = myMgr->registerAction( newAct, visibleRule( attr ), 
-                                     isToggle ? toggleRule( attr ) : QString::null,
-                                     actId );
-    res = myMgr->insert( aid, pId, intValue( attr, group, 0 ), intValue( attr, pos, -1 ) );
+    return set;
   }
-
-  return res;
+  else
+    return QVariant();
 }
 
 /*!
-  \return visibility rule by attributes
-  Default implementation is empty
+  \brief Get symbol which detects the name of the parameter list.
+  \return equality symbol (by default, "$")
 */
-QString QtxPopupMgr::PopupCreator::visibleRule( const ItemAttributes& ) const
+QString QtxPopupSelection::equalityParam() const
 {
-  return QString::null;
+  QString str = option( "equality" );
+  if ( str.isEmpty() )
+    str = "$";
+  return str;
 }
 
 /*!
-  \return toggle rule by attributes
-  Default implementation is empty
+  \brief Get name of the parameter, specifing number of selected objects
+  \return parameter name (by default, "selcount")
 */
-QString QtxPopupMgr::PopupCreator::toggleRule( const ItemAttributes& ) const
+QString QtxPopupSelection::selCountParam() const
 {
-  return QString::null;
+  QString str = option( "selcount" );
+  if ( str.isEmpty() )
+    str = "selcount";
+  return str;
 }
+
+/*!
+  \fn int QtxPopupSelection::count() const;
+  \brief Get number of the selected objects.
+  \return nb of selected objects
+*/
+
+/*!
+  \fn QVariant QtxPopupSelection::parameter( const int idx, const QString& name ) const;
+  \brief Get value of the parameter which is of list type
+  \param idx parameter index
+  \param name parameter name
+  \return parameter value
+*/
index 7bc260b3b6c09e2ec79a7131edd1ea27d02619cb..488c854411ac5d92bfc4ddd75a2e62034618dcd1 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxPopupMgr.h
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
+//
+#ifndef QTXPOPUPMGR_H
+#define QTXPOPUPMGR_H
 
-#ifndef __QTX_POPUP_MGR_HEADER__
-#define __QTX_POPUP_MGR_HEADER__
-
-#include "Qtx.h"
 #include "QtxActionMenuMgr.h"
-#include "QtxParser.h"
-#include "QtxStdOperations.h"
 
-#include <qmap.h>
+#include <QMap>
+#include <QVariant>
 
-class QtxListOfOperations;
+class QtxEvalExpr;
+class QtxEvalParser;
+class QtxPopupSelection;
 
 class QTX_EXPORT QtxPopupMgr : public QtxActionMenuMgr
 {
-    Q_OBJECT
+  Q_OBJECT
 
 public:
-    class QTX_EXPORT Selection
-    {
-    public:
-        virtual int      count() const = 0;
-        virtual QtxValue param( const int, const QString& ) const = 0;
-       virtual QtxValue globalParam( const QString& ) const;
-
-       virtual QChar    equality() const;
-       virtual QString  selCountParam() const;
-
-       static QChar    defEquality();
-       static QString  defSelCountParam();
-    };
+  //! Menu item rule type
+  typedef enum { 
+    VisibleRule,   //!< menu item visibility state
+    EnableRule,    //!< menu item enable state
+    ToggleRule     //!< menu item toggle state
+  } RuleType;
 
-protected:
-    class Operations : public QtxStrings
-    {
-    public:
-        Operations( QtxPopupMgr* );
-        virtual ~Operations();
+private:
+  class PopupCreator;
 
-        virtual int   prior( const QString&, bool isBin ) const;
-        virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
+public:
+  QtxPopupMgr( QObject* = 0 );
+  QtxPopupMgr( QMenu*, QObject* = 0 );
+  virtual ~QtxPopupMgr();
 
-        void clear();
+  int                insertAction( const int, const int, const QString&, const RuleType = VisibleRule );
+  int                insertAction( QAction*, const int, const QString&, const RuleType = VisibleRule );
 
-    private:
-        QtxPopupMgr*               myPopupMgr;
-        QtxParser*                 myParser;
-        QMap< QString, QtxValue >  myValues;
-    };
+  virtual int        registerAction( QAction*, const int, const QString& rule,
+                                     const RuleType = VisibleRule );
+  virtual void       unRegisterAction( const int );
 
-    friend class Operations;
+  virtual bool       isVisible( const int actId, const int place ) const;
 
-protected:
-  class PopupCreator;
+  QString            rule( QAction*, const RuleType = VisibleRule ) const;
+  QString            rule( const int, const RuleType = VisibleRule ) const;
 
-public:
-    QtxPopupMgr( QPopupMenu*, QObject* = 0 );
-    virtual ~QtxPopupMgr();
+  void               setRule( QAction*, const QString&, const RuleType = VisibleRule );
+  void               setRule( const int, const QString&, const RuleType = VisibleRule );
 
-    virtual int  registerAction( QAction*,
-                                 const QString& visible,
-                                 const QString& toggle = QString::null,
-                                 const int = -1 );
-    virtual void unRegisterAction( const int );
+  bool               hasRule( QAction*, const RuleType = VisibleRule ) const;
+  bool               hasRule( const int, const RuleType = VisibleRule ) const;
 
-    virtual bool isVisible( const int actId, const int place ) const;
+  QtxPopupSelection* selection() const;
+  void               setSelection( QtxPopupSelection* );
 
-    bool    hasRule( QAction*, bool visibility ) const;
-    bool    hasRule( const int, bool visibility ) const;
-    void    setRule( QAction*, const QString&, bool visibility );
-    void    setRule( const int, const QString&, bool visibility );
-    void    updatePopup( QPopupMenu*, Selection* );
+  QMenu*             menu() const;
+  void               setMenu( QMenu* );
 
-    //return name of parameter corresponding to selected objects count
-    //it will be set automatically
+  void               updateMenu();
 
-    virtual bool load( const QString&, QtxActionMgr::Reader& );
+  virtual bool       load( const QString&, QtxActionMgr::Reader& );
 
 protected:
-    typedef QMap< QAction*, QtxParser* > RulesMap;
+  virtual void       internalUpdate();
+  void               setParameters( QtxEvalParser*, QStringList& ) const;
+  virtual bool       isSatisfied( QAction*, const RuleType = VisibleRule ) const;
+  QtxEvalExpr*       expression( QAction*, const RuleType = VisibleRule, const bool = false ) const;
 
-protected:
-    virtual bool      isSatisfied( QAction*, bool visibility ) const;
-            void      setParams( QtxParser*, QStringList& ) const;
-            RulesMap& map( bool visibility ) const;
+private:
+  bool               result( QtxEvalParser* p ) const;
+  QVariant           parameter( const QString&, const int = -1 ) const;
 
-    void createOperations();
+private slots:
+  void               onSelectionDestroyed( QObject* );
 
 private:
-    RulesMap                 myVisibility, myToggle;
-    Selection*               myCurrentSelection;
-    QtxListOfOperations*     myOperations;
-};
-
+  typedef QMap<RuleType, QtxEvalExpr*> ExprMap;
+  typedef QMap<QAction*, ExprMap>      RuleMap;
+  typedef QMap<QString, QVariant>      CacheMap;
 
+private:
+  RuleMap            myRules;
+  CacheMap           myCache;
+  QtxPopupSelection* mySelection;
+};
 
-class QtxPopupMgr::PopupCreator : public QtxActionMgr::Creator
+class QTX_EXPORT QtxPopupSelection : public QObject
 {
+  Q_OBJECT
+
 public:
-  PopupCreator( QtxActionMgr::Reader*, QtxPopupMgr* );
-  virtual ~PopupCreator();
+  QtxPopupSelection();
+  virtual ~QtxPopupSelection();
 
-  virtual int append( const QString&, const bool,
-                      const ItemAttributes&, const int );
+  virtual int        count() const = 0;
+  virtual QVariant   parameter( const QString& ) const;
+  virtual QVariant   parameter( const int, const QString& ) const = 0;
 
-  virtual QString visibleRule( const ItemAttributes& ) const;
-  virtual QString toggleRule( const ItemAttributes& ) const;
+  QString            option( const QString& ) const;
+  void               setOption( const QString&, const QString& );
 
 private:
-  QtxPopupMgr* myMgr;
-};
+  QString            equalityParam() const;
+  QString            selCountParam() const;
+
+private:
+  typedef QMap<QString, QString> OptionsMap;
 
+private:
+  OptionsMap         myOptions;
+};
 
-#endif
+#endif // QTXPOPUPMGR_H
diff --git a/src/Qtx/QtxPreferenceMgr.cxx b/src/Qtx/QtxPreferenceMgr.cxx
new file mode 100644 (file)
index 0000000..6758276
--- /dev/null
@@ -0,0 +1,1121 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxPreferenceMgr.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxPreferenceMgr.h"
+
+#include "QtxResourceMgr.h"
+
+#include <QEvent>
+#include <QApplication>
+
+/*!
+  \class QtxPreferenceItem::Updater
+  \brief Preference item updater.
+  \internal
+*/
+
+class QtxPreferenceItem::Updater : public QObject
+{
+  Updater();
+public:
+  ~Updater();
+
+  static Updater*           instance();
+
+  void                      updateItem( QtxPreferenceItem* );
+  void                      removeItem( QtxPreferenceItem* );
+
+protected:
+  virtual void              customEvent( QEvent* );
+
+private:
+  QList<QtxPreferenceItem*> myItems;
+  static Updater*           _Updater;
+};
+
+QtxPreferenceItem::Updater* QtxPreferenceItem::Updater::_Updater = 0;
+
+/*!
+  \brief Constructor.
+  \internal
+*/
+QtxPreferenceItem::Updater::Updater()
+{
+}
+
+/*!
+  \brief Destructor.
+  \internal
+*/
+QtxPreferenceItem::Updater::~Updater()
+{
+}
+
+/*!
+  \brief Get the only updater instance.
+  \internal
+  \return the only updater instance
+*/
+QtxPreferenceItem::Updater* QtxPreferenceItem::Updater::instance()
+{
+  if ( !_Updater )
+    _Updater = new Updater();
+  return _Updater;
+}
+
+/*!
+  \brief Update the preference item.
+  \internal
+  \param item preference item to be updated
+*/
+void QtxPreferenceItem::Updater::updateItem( QtxPreferenceItem* item )
+{
+  if ( !item || myItems.contains( item ) )
+    return;
+
+  myItems.append( item );
+  QApplication::postEvent( this, new QEvent( QEvent::User ) );
+}
+
+/*!
+  \brief Called when preference item is removed.
+  \internal
+  \param item preference item being removed
+*/
+void QtxPreferenceItem::Updater::removeItem( QtxPreferenceItem* item )
+{
+  myItems.removeAll( item );
+}
+
+/*!
+  \brief Custom events provessing. Updates all the items.
+  \internal
+  \param e custom event (not used)
+*/
+void QtxPreferenceItem::Updater::customEvent( QEvent* /*e*/ )
+{
+  QList<QtxPreferenceItem*> lst = myItems;
+  for ( QList<QtxPreferenceItem*>::const_iterator it = lst.begin(); it != lst.end(); ++it )
+    (*it)->updateContents();
+}
+
+/*!
+  \class QtxPreferenceItem
+  \brief Base class for implementing of all the preference items.
+
+  To implement any specific preference item, cubclass from the
+  QtxPreferenceItem and redefine store() and retrieve() methods.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent preference item
+*/
+QtxPreferenceItem::QtxPreferenceItem( QtxPreferenceItem* parent )
+: myParent( 0 ),
+myEval( true )
+{
+  myId = generateId();
+
+  if ( parent )
+    parent->insertItem( this );
+}
+
+/*!
+  \brief Constructor.
+  \param title item title
+  \param parent parent preference item
+*/
+QtxPreferenceItem::QtxPreferenceItem( const QString& title, QtxPreferenceItem* parent )
+: myParent( 0 ),
+  myTitle( title )
+{
+  myId = generateId();
+
+  if ( parent )
+    parent->insertItem( this );
+}
+
+/*!
+  \brief Constructor.
+  \param title item title
+  \param sect resource file section to be associated with the item
+  \param param resource file parameter to be associated with the item
+  \param parent parent preference item
+*/
+QtxPreferenceItem::QtxPreferenceItem( const QString& title, const QString& sect,
+                                      const QString& param, QtxPreferenceItem* parent )
+: myParent( 0 ),
+  myTitle( title ),
+  mySection( sect ),
+  myParameter( param )
+{
+  myId = generateId();
+
+  if ( parent )
+    parent->insertItem( this );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPreferenceItem::~QtxPreferenceItem()
+{
+  ItemList list = myChildren;
+  myChildren.clear();
+  qDeleteAll( list );
+
+  if ( myParent )
+    myParent->removeItem( this );
+
+  Updater::instance()->removeItem( this );
+}
+
+/*!
+  \brief Get unique item identifier.
+  \return item ID
+*/
+int QtxPreferenceItem::id() const
+{
+  return myId;
+}
+
+/*!
+  \brief Get unique item type identifier.
+  \return item type ID
+*/
+int QtxPreferenceItem::rtti() const
+{
+  return QtxPreferenceItem::RTTI();
+}
+
+/*!
+  \brief Specify unique item class identifier.
+  \return item class ID
+*/
+int QtxPreferenceItem::RTTI()
+{
+  return 1;
+}
+
+/*!
+  \brief Get root preference item.
+  \return root item
+*/
+QtxPreferenceItem* QtxPreferenceItem::rootItem() const
+{
+  QtxPreferenceItem* item = (QtxPreferenceItem*)this;
+  while ( item->parentItem() )
+    item = item->parentItem();
+  return item;
+}
+
+/*!
+  \brief Get parent preference item.
+  \return parent item
+*/
+QtxPreferenceItem* QtxPreferenceItem::parentItem() const
+{
+  return myParent;
+}
+
+/*!
+  \brief Append child preference item.
+
+  Removes (if necessary) the item from the previous parent.
+
+  \param item item to be added
+  \sa removeItem()
+*/
+void QtxPreferenceItem::appendItem( QtxPreferenceItem* item )
+{
+  insertItem( item, 0 );
+}
+
+/*!
+  \brief Insert child preference item before specified item.
+  If the before item is 0 then new item is appended.
+
+  Removes (if necessary) the item from the previous parent.
+
+  \param item item to be added
+  \param before item before which is inserted new \aitem
+  \sa removeItem()
+*/
+void QtxPreferenceItem::insertItem( QtxPreferenceItem* item, QtxPreferenceItem* before )
+{
+  if ( !item )
+    return;
+
+  if ( myChildren.contains( item ) && item == before )
+    return;
+
+  if ( myChildren.contains( item ) )
+    myChildren.removeAll( item );
+
+  int idx = myChildren.indexOf( before );
+  if ( idx < 0 )
+    idx = myChildren.count();
+
+  if ( item->parentItem() && item->parentItem() != this )
+    item->parentItem()->removeItem( item );
+
+  item->myParent = this;
+  myChildren.insert( idx, item );
+
+  itemAdded( item );
+}
+
+/*!
+  \brief Remove child preference item.
+  \param item item to be removed
+  \sa insertItem()
+*/
+void QtxPreferenceItem::removeItem( QtxPreferenceItem* item )
+{
+  if ( !item || !myChildren.contains( item ) )
+    return;
+
+  item->myParent = 0;
+  myChildren.removeAll( item );
+
+  itemRemoved( item );
+}
+
+/*!
+  \brief Get all child preference items.
+  \param rec recursion boolean flag
+  \return list of child items
+*/
+QList<QtxPreferenceItem*> QtxPreferenceItem::childItems( const bool rec ) const
+{
+  QList<QtxPreferenceItem*> lst = myChildren;
+  if ( rec )
+  {
+    for ( ItemList::const_iterator it = myChildren.begin(); it != myChildren.end(); ++it )
+      lst += (*it)->childItems( rec );
+  }
+
+  return lst;
+}
+
+/*!
+  \brief Get preference item depth.
+  \return item depth
+*/
+int QtxPreferenceItem::depth() const
+{
+  return parentItem() ? parentItem()->depth() + 1 : 0;
+}
+
+/*!
+  \brief Get child preference items number.
+  \return number of child items
+  \sa isEmpty()
+*/
+int QtxPreferenceItem::count() const
+{
+  return myChildren.count();
+}
+
+/*!
+  \brief Check if the item has children.
+  \return \c true if item does not have children
+  \sa count()
+*/
+bool QtxPreferenceItem::isEmpty() const
+{
+  return myChildren.isEmpty();
+}
+
+/*!
+  \brief Get preference item icon.
+  \return item icon
+  \sa setIcon()
+*/
+QIcon QtxPreferenceItem::icon() const
+{
+  return myIcon;
+}
+
+/*!
+  \brief Get preference item title.
+  \return item title
+  \sa setTitle()
+*/
+QString QtxPreferenceItem::title() const
+{
+  return myTitle;
+}
+
+/*!
+  \brief Get resource file settings associated to the preference item.
+  \param sec used to return resource file section name
+  \param param used to return resource file parameter name
+  \sa setResource()
+*/
+void QtxPreferenceItem::resource( QString& sec, QString& param ) const
+{
+  sec = mySection;
+  param = myParameter;
+}
+
+/*!
+  \brief Set prefence item icon.
+  \param ico new item icon
+  \sa icon()
+*/
+void QtxPreferenceItem::setIcon( const QIcon& ico )
+{
+  if ( myIcon.serialNumber() == ico.serialNumber() )
+    return;
+
+  myIcon = ico;
+  sendItemChanges();
+}
+
+/*!
+  \brief Set preference item title .
+  \param title new item title
+  \sa title()
+*/
+void QtxPreferenceItem::setTitle( const QString& title )
+{
+  if ( myTitle == title )
+    return;
+
+  myTitle = title;
+  sendItemChanges();
+}
+
+/*!
+  \brief Assign resource file settings to the preference item.
+  \param sec resource file section name
+  \param param resource file parameter name
+  \sa resource()
+*/
+void QtxPreferenceItem::setResource( const QString& sec, const QString& param )
+{
+  mySection = sec;
+  myParameter = param;
+}
+
+/*!
+  \brief Update preference item.
+*/
+void QtxPreferenceItem::updateContents()
+{
+  Updater::instance()->removeItem( this );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOption()
+*/
+QVariant QtxPreferenceItem::option( const QString& name ) const
+{
+  return optionValue( name.toLower() );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa option()
+*/
+void QtxPreferenceItem::setOption( const QString& name, const QVariant& val )
+{
+  QVariant old = optionValue( name.toLower() );
+  setOptionValue( name.toLower(), val );
+  if ( old != optionValue( name.toLower() ) )
+    sendItemChanges();
+}
+
+bool QtxPreferenceItem::isEvaluateValues() const
+{
+  return myEval;
+}
+
+void QtxPreferenceItem::setEvaluateValues( const bool on )
+{
+  myEval = on;
+}
+
+/*!
+  \fn void QtxPreferenceItem::store();
+  \brief Save preference item (for example, to the resource file).
+
+  This method should be implemented in the subclasses.
+
+  \sa retrieve()
+*/
+
+/*!
+  \fn virtual void QtxPreferenceItem::retrieve();
+  \brief Restore preference item (for example, from the resource file).
+
+  This method should be implemented in the subclasses.
+
+  \sa store()
+*/
+
+/*!
+  \brief Get the value of the associated resource file setting.
+  \return associated resource file setting value
+  \sa setResourceValue()
+*/
+QString QtxPreferenceItem::resourceValue() const
+{
+  return getString();
+}
+
+/*!
+  \brief Get the value of the associated resource file setting.
+  \param val new associated resource file setting value
+  \sa resourceValue()
+*/
+void QtxPreferenceItem::setResourceValue( const QString& val )
+{
+  setString( val );
+}
+
+/*!
+  \brief Get the resources manager.
+  \return resource manager pointer or 0 if it is not defined
+*/
+QtxResourceMgr* QtxPreferenceItem::resourceMgr() const
+{
+  QtxPreferenceMgr* mgr = preferenceMgr();
+  return mgr ? mgr->resourceMgr() : 0;
+}
+
+/*!
+  \brief Get the parent preferences manager.
+  \return preferences manager or 0 if it is not defined
+*/
+QtxPreferenceMgr* QtxPreferenceItem::preferenceMgr() const
+{
+  return parentItem() ? parentItem()->preferenceMgr() : 0;
+}
+
+/*!
+  \brief Find the item by the specified identifier.
+  \param id child item ID
+  \param rec if \c true recursive search is done
+  \return child item or 0 if it is not found
+*/
+QtxPreferenceItem* QtxPreferenceItem::findItem( const int id, const bool rec ) const
+{
+  QtxPreferenceItem* item = 0;
+  for ( ItemList::const_iterator it = myChildren.begin(); it != myChildren.end() && !item; ++it )
+  {
+    QtxPreferenceItem* i = *it;
+    if ( i->id() == id )
+      item = i;
+    else if ( rec )
+      item = i->findItem( id, rec );
+  }
+  return item;
+}
+
+/*!
+  \brief Find the item by the specified title.
+  \param title child item title
+  \param rec if \c true recursive search is done
+  \return child item or 0 if it is not found
+*/
+QtxPreferenceItem* QtxPreferenceItem::findItem( const QString& title, const bool rec ) const
+{
+  QtxPreferenceItem* item = 0;
+  for ( ItemList::const_iterator it = myChildren.begin(); it != myChildren.end() && !item; ++it )
+  {
+    QtxPreferenceItem* i = *it;
+    if ( i->title() == title )
+      item = i;
+    else if ( rec )
+      item = i->findItem( title, rec );
+  }
+  return item;
+}
+
+/*!
+  \brief Find the item by the specified title and identifier.
+  \param title child item title
+  \param id child item ID
+  \param rec if \c true recursive search is done
+  \return child item or 0 if it is not found
+*/
+QtxPreferenceItem* QtxPreferenceItem::findItem( const QString& title, const int id, const bool rec ) const
+{
+  QtxPreferenceItem* item = 0;
+  for ( ItemList::const_iterator it = myChildren.begin(); it != myChildren.end() && !item; ++it )
+  {
+    QtxPreferenceItem* i = *it;
+    if ( i->title() == title && i->id() == id )
+      item = i;
+    else if ( rec )
+      item = i->findItem( title, id, rec );
+  }
+  return item;
+}
+
+void QtxPreferenceItem::activate()
+{
+}
+
+void QtxPreferenceItem::ensureVisible()
+{
+  if ( parentItem() )
+    parentItem()->ensureVisible( this );
+}
+
+/*!
+  \brief Get integer resources value corresponding to the item.
+  \param val default value (returned if there is no such resource)
+  \return integer value of the associated resource
+  \sa setInteger()
+*/
+int QtxPreferenceItem::getInteger( const int val ) const
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  return resMgr ? resMgr->integerValue( mySection, myParameter, val ) : val;
+}
+
+/*!
+  \brief Get double resources value corresponding to the item.
+  \param val default value (returned if there is no such resource)
+  \return double value of the associated resource
+  \sa setDouble()
+*/
+double QtxPreferenceItem::getDouble( const double val ) const
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  return resMgr ? resMgr->doubleValue( mySection, myParameter, val ) : val;
+}
+
+/*!
+  \brief Get boolean resources value corresponding to the item.
+  \param val default value (returned if there is no such resource)
+  \return boolean value of the associated resource
+  \sa setBoolean()
+*/
+bool QtxPreferenceItem::getBoolean( const bool val ) const
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  return resMgr ? resMgr->booleanValue( mySection, myParameter, val ) : val;
+}
+
+/*!
+  \brief Get string resources value corresponding to the item.
+  \param val default value (returned if there is no such resource)
+  \return string value of the associated resource
+  \sa setString()
+*/
+QString QtxPreferenceItem::getString( const QString& val ) const
+{
+  QString res = val;
+  QtxResourceMgr* resMgr = resourceMgr();
+  if ( resMgr )
+    resMgr->value( mySection, myParameter, res, isEvaluateValues() );
+  return res;
+}
+
+/*!
+  \brief Get color resources value corresponding to the item.
+  \param val default value (returned if there is no such resource)
+  \return color value of the associated resource
+  \sa setColor()
+*/
+QColor QtxPreferenceItem::getColor( const QColor& val ) const
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  return resMgr ? resMgr->colorValue( mySection, myParameter, val ) : val;
+}
+
+/*!
+  \brief Get font resources value corresponding to the item.
+  \param val default value (returned if there is no such resource)
+  \return font value of the associated resource
+  \sa setFont()
+*/
+QFont QtxPreferenceItem::getFont( const QFont& val ) const
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  return resMgr ? resMgr->fontValue( mySection, myParameter, val ) : val;
+}
+
+/*!
+  \brief Set integer resources value corresponding to the item.
+  \param val new value
+  \sa getInteger()
+*/
+void QtxPreferenceItem::setInteger( const int val )
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  if ( resMgr )
+    resMgr->setValue( mySection, myParameter, val );
+}
+
+/*!
+  \brief Set double resources value corresponding to the item.
+  \param val new value
+  \sa getDouble()
+*/
+void QtxPreferenceItem::setDouble( const double val )
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  if ( resMgr )
+    resMgr->setValue( mySection, myParameter, val );
+}
+
+/*!
+  \brief Set boolean resources value corresponding to the item.
+  \param val new value
+  \sa getBoolean()
+*/
+void QtxPreferenceItem::setBoolean( const bool val )
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  if ( resMgr )
+    resMgr->setValue( mySection, myParameter, val );
+}
+
+/*!
+  \brief Set string resources value corresponding to the item.
+  \param val new value
+  \sa getString()
+*/
+void QtxPreferenceItem::setString( const QString& val )
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  if ( resMgr )
+    resMgr->setValue( mySection, myParameter, val );
+}
+
+/*!
+  \brief Set color resources value corresponding to the item.
+  \param val new value
+  \sa getColor()
+*/
+void QtxPreferenceItem::setColor( const QColor& val )
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  if ( resMgr )
+    resMgr->setValue( mySection, myParameter, val );
+}
+
+/*!
+  \brief Set font resources value corresponding to the item.
+  \param val new value
+  \sa getFont()
+*/
+void QtxPreferenceItem::setFont( const QFont& val )
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  if ( resMgr )
+    resMgr->setValue( mySection, myParameter, val );
+}
+
+/*!
+  \brief Callback function which is called when the child
+  preference item is added.
+
+  This function can be reimplemented in the subclasses to customize
+  child item addition operation. Base implementation does nothing.
+
+  \param item child item being added
+  \sa itemRemoved(), itemChanged()
+*/
+void QtxPreferenceItem::itemAdded( QtxPreferenceItem* /*item*/ )
+{
+}
+
+/*!
+  \brief Callback function which is called when the child
+  preference item is removed.
+
+  This function can be reimplemented in the subclasses to customize
+  child item removal operation. Base implementation does nothing.
+
+  \param item child item being removed
+  \sa itemAdded(), itemChanged()
+*/
+void QtxPreferenceItem::itemRemoved( QtxPreferenceItem* /*item*/ )
+{
+}
+
+/*!
+  \brief Callback function which is called when the child
+  preference item is modified.
+
+  This function can be reimplemented in the subclasses to customize
+  child item modifying operation. Base implementation does nothing.
+
+  \param item child item being modified
+  \sa itemAdded(), itemRemoved()
+*/
+void QtxPreferenceItem::itemChanged( QtxPreferenceItem* )
+{
+}
+
+void QtxPreferenceItem::ensureVisible( QtxPreferenceItem* )
+{
+  ensureVisible();
+}
+
+/*!
+  \brief Initiate item updating.
+*/
+void QtxPreferenceItem::triggerUpdate()
+{
+  Updater::instance()->updateItem( this );
+}
+
+/*!
+  \brief Get preference item option value.
+
+  This function can be reimplemented in the subclasses.
+  Base implementation does nothing.
+
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPreferenceItem::optionValue( const QString& name ) const
+{
+  QVariant val;
+  if ( name == "eval" || name == "evaluation" || name == "subst" || name == "substitution" )
+    val = isEvaluateValues();
+  else if ( name == "title" )
+    val = title();
+  return val;
+}
+
+/*!
+  \brief Set preference item option value.
+
+  This function can be reimplemented in the subclasses.
+  Base implementation does nothing.
+
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPreferenceItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "eval" || name == "evaluation" || name == "subst" || name == "substitution" )
+  {
+    if ( val.canConvert( QVariant::Bool ) )
+      setEvaluateValues( val.toBool() );
+  }
+  else if ( name == "title" )
+  {
+    if ( val.canConvert( QVariant::String ) )
+      setTitle( val.toString() );
+  }
+}
+
+/*!
+  \brief Initiate item changing call back operation.
+*/
+void QtxPreferenceItem::sendItemChanges()
+{
+  if ( parentItem() )
+    parentItem()->itemChanged( this );
+}
+
+/*!
+  \brief Generate unique preference item identifier.
+  \return unique item ID
+*/
+int QtxPreferenceItem::generateId()
+{
+  static int _id = 0;
+  return _id++;
+}
+
+/*!
+  \class QtxPreferenceMgr
+  \brief Class for managing preferences items.
+*/
+
+/*!
+  \brief Constructor.
+  \param mgr resources manager
+*/
+QtxPreferenceMgr::QtxPreferenceMgr( QtxResourceMgr* mgr )
+: QtxPreferenceItem( 0 ),
+  myResMgr( mgr )
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPreferenceMgr::~QtxPreferenceMgr()
+{
+}
+
+/*!
+  \brief Get the resources manager.
+  \return resource manager pointer or 0 if it is not defined
+*/
+QtxResourceMgr* QtxPreferenceMgr::resourceMgr() const
+{
+  return myResMgr;
+}
+
+/*!
+  \brief Get the parent preferences manager.
+  \return pointer to itself
+*/
+QtxPreferenceMgr* QtxPreferenceMgr::preferenceMgr() const
+{
+  return (QtxPreferenceMgr*)this;
+}
+
+/*!
+  \brief Get preference item option value.
+  \param id preference item ID
+  \param propName option name
+  \return property value or null QVariant if option is not set
+  \sa setOption()
+*/
+QVariant QtxPreferenceMgr::option( const int id, const QString& propName ) const
+{
+  QVariant propValue;
+  QtxPreferenceItem* i = findItem( id, true );
+  if ( i )
+    propValue = i->option( propName );
+  return propValue;
+}
+
+/*!
+  \brief Set preference item option value.
+  \param id preference item ID
+  \param propName option name
+  \param propValue new property value
+  \sa option()
+*/
+void QtxPreferenceMgr::setOption( const int id, const QString& propName, const QVariant& propValue )
+{
+  QtxPreferenceItem* i = findItem( id, true );
+  if ( i )
+    i->setOption( propName, propValue );
+}
+
+/*!
+  \brief Store all preferences item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPreferenceMgr::store()
+{
+  ResourceMap before;
+  resourceValues( before );
+
+  QList<QtxPreferenceItem*> items = childItems( true );
+  for ( QList<QtxPreferenceItem*>::iterator it = items.begin(); it != items.end(); ++it )
+    (*it)->store();
+
+  ResourceMap after;
+  resourceValues( after );
+
+  ResourceMap changed;
+  differentValues( before, after, changed );
+
+  changedResources( changed );
+}
+
+/*!
+  \brief Retrieve all preference items from the resource manager.
+  \sa store()
+*/
+void QtxPreferenceMgr::retrieve()
+{
+  QList<QtxPreferenceItem*> items = childItems( true );
+  for ( QList<QtxPreferenceItem*>::iterator it = items.begin(); it != items.end(); ++it )
+    (*it)->retrieve();
+}
+
+/*!
+  \brief Dumps all values to the backup container.
+  \sa fromBackup()
+*/
+void QtxPreferenceMgr::toBackup()
+{
+  myBackup.clear();
+  resourceValues( myBackup );
+}
+
+/*!
+  \brief Restore all values from the backup container.
+  \sa toBackup()
+*/
+void QtxPreferenceMgr::fromBackup()
+{
+  ResourceMap before;
+  resourceValues( before );
+
+  setResourceValues( myBackup );
+
+  ResourceMap after;
+  resourceValues( after );
+
+  ResourceMap changed;
+  differentValues( before, after, changed );
+
+  changedResources( changed );
+}
+
+/*!
+  \brief Update preferences manager.
+
+  Base implementation does nothing.
+*/
+void QtxPreferenceMgr::update()
+{
+}
+
+/*!
+  \brief Get all resources items values.
+  \param map used as container filled with the resources values (<ID>:<value>)
+  \sa setResourceValues()
+*/
+void QtxPreferenceMgr::resourceValues( QMap<int, QString>& map ) const
+{
+  QString sect, name;
+  QtxResourceMgr* resMgr = resourceMgr();
+  QList<QtxPreferenceItem*> items = childItems( true );
+  for ( QList<QtxPreferenceItem*>::const_iterator it = items.begin(); it != items.end(); ++it )
+  {
+    QtxPreferenceItem* item = *it;
+    item->resource( sect, name );
+    if ( resMgr->hasValue( sect, name ) )
+      map.insert( item->id(), item->resourceValue() );
+  }
+}
+
+/*!
+  \brief Get all resources items values.
+  \param map used as container filled with the resources values
+  (<item>:<value>)
+  \sa setResourceValues()
+*/
+void QtxPreferenceMgr::resourceValues( ResourceMap& map ) const
+{
+  QString sect, name;
+  QtxResourceMgr* resMgr = resourceMgr();
+  QList<QtxPreferenceItem*> items = childItems( true );
+  for ( QList<QtxPreferenceItem*>::const_iterator it = items.begin(); it != items.end(); ++it )
+  {
+    QtxPreferenceItem* item = *it;
+    item->resource( sect, name );
+    if ( resMgr->hasValue( sect, name ) )
+      map.insert( item, item->resourceValue() );
+  }
+}
+
+/*!
+  \brief Set all resources items values.
+  \param map map with resources values (<ID>:<value>)
+  \sa resourceValues()
+*/
+void QtxPreferenceMgr::setResourceValues( QMap<int, QString>& map ) const
+{
+  for ( QMap<int, QString>::const_iterator it = map.begin(); it != map.end(); ++it )
+  {
+    QtxPreferenceItem* i = findItem( it.key(), true );
+    if ( i )
+      i->setResourceValue( it.value() );
+  }
+}
+
+/*!
+  \brief Set all resources items values.
+  \param map map with resources values (<item>:<value>)
+  \sa resourceValues()
+*/
+void QtxPreferenceMgr::setResourceValues( ResourceMap& map ) const
+{
+  for ( ResourceMap::const_iterator it = map.begin(); it != map.end(); ++it )
+    it.key()->setResourceValue( it.value() );
+}
+
+/*!
+  \brief Compare two maps of resources values to find differences.
+  \param map1 first map
+  \param map2 second map
+  \param resMap map to be filled with different values
+  \param fromFirst if \c true, then \a resMap will be filled with the values
+  from \a map1, otherwise - from \a map2
+*/
+void QtxPreferenceMgr::differentValues( const QMap<int, QString>& map1, const QMap<int, QString>& map2,
+                                        QMap<int, QString>& resMap, const bool fromFirst ) const
+{
+  resMap.clear();
+  const QMap<int, QString>& later = fromFirst ? map1 : map2;
+  const QMap<int, QString>& early = fromFirst ? map2 : map1;
+
+  for ( QMap<int, QString>::const_iterator it = later.begin(); it != later.end(); ++it )
+  {
+    if ( !early.contains( it.key() ) || early[it.key()] != it.value() )
+      resMap.insert( it.key(), it.value() );
+  }
+}
+
+/*!
+  \brief Compare two maps of resources values to find differences.
+  \param map1 first map
+  \param map2 second map
+  \param resMap map to be filled with different values
+  \param fromFirst if \c true, then \a resMap will be filled with the values
+  from \a map1, otherwise - from \a map2
+*/
+void QtxPreferenceMgr::differentValues( const ResourceMap& map1, const ResourceMap& map2,
+                                        ResourceMap& resMap, const bool fromFirst ) const
+{
+  resMap.clear();
+  const ResourceMap& later = fromFirst ? map1 : map2;
+  const ResourceMap& early = fromFirst ? map2 : map1;
+
+  for ( ResourceMap::const_iterator it = later.begin(); it != later.end(); ++it )
+  {
+    if ( !early.contains( it.key() ) || early[it.key()] != it.value() )
+      resMap.insert( it.key(), it.value() );
+  }
+}
+
+/*!
+  \brief Perform custom activity on resource changing.
+
+  This method is called from store() and fromBackup() methods.
+  Base implementation does nothing.
+
+  \sa store(), fromBackup()
+*/
+void QtxPreferenceMgr::changedResources( const ResourceMap& )
+{
+}
diff --git a/src/Qtx/QtxPreferenceMgr.h b/src/Qtx/QtxPreferenceMgr.h
new file mode 100644 (file)
index 0000000..8699d0b
--- /dev/null
@@ -0,0 +1,192 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxPreferenceMgr.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXPREFERENCEMGR_H
+#define QTXPREFERENCEMGR_H
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+#include "Qtx.h"
+
+#include <QFont>
+#include <QIcon>
+#include <QColor>
+#include <QVariant>
+
+class QtxResourceMgr;
+class QtxPreferenceMgr;
+
+class QTX_EXPORT QtxPreferenceItem
+{
+  class Updater;
+
+public:
+  QtxPreferenceItem( QtxPreferenceItem* = 0 );
+  QtxPreferenceItem( const QString&, QtxPreferenceItem* );
+  QtxPreferenceItem( const QString&, const QString&, const QString&, QtxPreferenceItem* );
+  virtual ~QtxPreferenceItem();
+
+  int                       id() const;
+  virtual int               rtti() const;
+
+  QtxPreferenceItem*        rootItem() const;
+  QtxPreferenceItem*        parentItem() const;
+  QList<QtxPreferenceItem*> childItems( const bool = false ) const;
+
+  int                       depth() const;
+  int                       count() const;
+  virtual bool              isEmpty() const;
+
+  void                      appendItem( QtxPreferenceItem* );
+  void                      removeItem( QtxPreferenceItem* );
+  void                      insertItem( QtxPreferenceItem*, QtxPreferenceItem* = 0 );
+
+  QIcon                     icon() const;
+  QString                   title() const;
+  void                      resource( QString&, QString& ) const;
+
+  virtual void              setIcon( const QIcon& );
+  virtual void              setTitle( const QString& );
+  virtual void              setResource( const QString&, const QString& );
+
+  virtual void              updateContents();
+
+  QVariant                  option( const QString& ) const;
+  void                      setOption( const QString&, const QVariant& );
+
+  bool                      isEvaluateValues() const;
+  void                      setEvaluateValues( const bool );
+
+  virtual void              store() = 0;
+  virtual void              retrieve() = 0;
+
+  QString                   resourceValue() const;
+  void                      setResourceValue( const QString& );
+
+  QtxPreferenceItem*        findItem( const int, const bool = false ) const;
+  QtxPreferenceItem*        findItem( const QString&, const bool = false ) const;
+  QtxPreferenceItem*        findItem( const QString&, const int, const bool = false ) const;
+
+  virtual QtxResourceMgr*   resourceMgr() const;
+  virtual QtxPreferenceMgr* preferenceMgr() const;
+
+  virtual void              activate();
+  void                      ensureVisible();
+
+  static int                RTTI();
+
+protected:
+  int                       getInteger( const int = 0 ) const;
+  double                    getDouble( const double = 0.0 ) const;
+  bool                      getBoolean( const bool = false ) const;
+  QColor                    getColor( const QColor& = QColor() ) const;
+  QFont                     getFont( const QFont& = QFont() ) const;
+  QString                   getString( const QString& = QString() ) const;
+
+  void                      setInteger( const int );
+  void                      setDouble( const double );
+  void                      setBoolean( const bool );
+  void                      setColor( const QColor& );
+  void                      setFont( const QFont& );
+  void                      setString( const QString& );
+
+  virtual void              itemAdded( QtxPreferenceItem* );
+  virtual void              itemRemoved( QtxPreferenceItem* );
+  virtual void              itemChanged( QtxPreferenceItem* );
+
+  virtual void              ensureVisible( QtxPreferenceItem* );
+
+  void                      sendItemChanges();
+
+  virtual void              triggerUpdate();
+
+  virtual QVariant          optionValue( const QString& ) const;
+  virtual void              setOptionValue( const QString&, const QVariant& );
+
+protected:
+  typedef QList<QtxPreferenceItem*> ItemList;
+
+private:
+  static int                generateId();
+
+private:
+  int                       myId;
+  QtxPreferenceItem*        myParent;
+  ItemList                  myChildren;
+
+  bool                      myEval;
+  QIcon                     myIcon;
+  QString                   myTitle;
+  QString                   mySection;
+  QString                   myParameter;
+};
+
+class QTX_EXPORT QtxPreferenceMgr : public QtxPreferenceItem
+{
+public:
+  QtxPreferenceMgr( QtxResourceMgr* );
+  virtual ~QtxPreferenceMgr();
+
+  virtual QtxResourceMgr*   resourceMgr() const;
+  virtual QtxPreferenceMgr* preferenceMgr() const;
+
+  QVariant                  option( const int, const QString& ) const;
+  void                      setOption( const int, const QString&, const QVariant& );
+
+  virtual void              store();
+  virtual void              retrieve();
+
+  virtual void              update();
+
+  virtual void              toBackup();
+  virtual void              fromBackup();
+
+protected:
+  typedef QMap<QtxPreferenceItem*, QString> ResourceMap;
+
+  void                      resourceValues( QMap<int, QString>& ) const;
+  void                      resourceValues( ResourceMap& ) const;
+
+  void                      setResourceValues( QMap<int, QString>& ) const;
+  void                      setResourceValues( ResourceMap& ) const;
+
+  void                      differentValues( const QMap<int, QString>&, const QMap<int, QString>&,
+                                             QMap<int, QString>&, const bool fromFirst = false ) const;
+  void                      differentValues( const ResourceMap&, const ResourceMap&,
+                                             ResourceMap&, const bool fromFirst = false ) const;
+
+  virtual void              changedResources( const ResourceMap& );
+
+private:
+  QtxResourceMgr*           myResMgr;
+  ResourceMap               myBackup;
+};
+
+#ifdef WIN32
+#pragma warning( default:4251 )
+#endif
+
+#endif
diff --git a/src/Qtx/QtxResourceEdit.cxx b/src/Qtx/QtxResourceEdit.cxx
deleted file mode 100644 (file)
index e96a57e..0000000
+++ /dev/null
@@ -1,748 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxResourceEdit.cxx
-// Author:    Sergey TELKOV
-
-#include "QtxResourceEdit.h"
-
-#include "QtxResourceMgr.h"
-
-
-/*!
-  Constructor
-*/
-QtxResourceEdit::QtxResourceEdit( QtxResourceMgr* mgr )
-: myResMgr( mgr )
-{
-}
-
-/*!
-  Destructor
-*/
-QtxResourceEdit::~QtxResourceEdit()
-{
-  ItemMap items;
-  for ( ItemMap::ConstIterator it = myItems.begin(); it != myItems.end(); ++it )
-    items.insert( it.key(), it.data() );
-
-  for ( ItemMap::ConstIterator itr = items.begin(); itr != items.end(); ++itr )
-    if ( myItems.contains( itr.key() ) )
-      delete itr.data();
-}
-
-/*!
-  \return assigned resource manager
-*/
-QtxResourceMgr* QtxResourceEdit::resourceMgr() const
-{
-  return myResMgr;
-}
-
-/*!
-  Adds new item
-  \param label - label of widget to edit preference
-  \param pId - parent item id
-  \param type - type of item
-  \param section - section of resource assigned with item
-  \param param - name of resource assigned with item
-*/
-int QtxResourceEdit::addItem( const QString& label, const int pId, const int type,
-                              const QString& section, const QString& param )
-{
-  Item* i = createItem( label, type, pId );
-  if ( !i )
-    return -1;
-
-  if ( !myItems.contains( i->id() ) )
-  {
-    myItems.insert( i->id(), i );
-
-    i->setTitle( label );
-    i->setResource( section, param );
-
-    if ( !i->parentItem() && !myChildren.contains( i ) )
-      myChildren.append( i );
-
-    itemAdded( i );
-  }
-
-  return i->id();
-}
-
-/*!
-  \return value of item property
-  \param id - item id
-  \propName - propertyName
-*/
-QVariant QtxResourceEdit::itemProperty( const int id, const QString& propName ) const
-{
-  QVariant propValue;
-  Item* i = item( id );
-  if ( i )
-    propValue = i->property( propName );
-  return propValue;
-}
-
-/*!
-  Sets value of item property
-  \param id - item id
-  \propName - propertyName
-  \propValue - new value of property
-*/
-void QtxResourceEdit::setItemProperty( const int id, const QString& propName, const QVariant& propValue )
-{
-  Item* i = item( id );
-  if ( i )
-    i->setProperty( propName, propValue );
-}
-
-/*!
-  \return resource assigned with item
-  \param id - item id
-  \param section - to return section of resource
-  \param param - to return name of resource
-*/
-void QtxResourceEdit::resource( const int id, QString& sec, QString& param ) const
-{
-  Item* i = item( id );
-  if ( i )
-    i->resource( sec, param );
-}
-
-/*!
-  Stores all values to resource manager
-*/
-void QtxResourceEdit::store()
-{
-  QMap<Item*, QString> before;
-  resourceValues( before );
-
-  for ( ItemMap::ConstIterator it = myItems.begin(); it != myItems.end(); ++it )
-    it.data()->store();
-
-  QMap<Item*, QString> after;
-  resourceValues( after );
-
-  QMap<Item*, QString> changed;
-  differentValues( before, after, changed );
-
-  changedResources( changed );
-}
-
-/*!
-  Retrieve all values from resource manager
-*/
-void QtxResourceEdit::retrieve()
-{
-  for ( ItemMap::ConstIterator it = myItems.begin(); it != myItems.end(); ++it )
-    it.data()->retrieve();
-}
-
-/*!
-  Stores all values to backup container
-*/
-void QtxResourceEdit::toBackup()
-{
-  myBackup.clear();
-  resourceValues( myBackup );
-}
-
-/*!
-  Retrieve all values from backup container
-*/
-void QtxResourceEdit::fromBackup()
-{
-  QMap<Item*, QString> before;
-  resourceValues( before );
-
-  setResourceValues( myBackup );
-
-  QMap<Item*, QString> after;
-  resourceValues( after );
-
-  QMap<Item*, QString> changed;
-  differentValues( before, after, changed );
-
-  changedResources( changed );
-}
-
-/*!
-  Updates resource edit (default implementation is empty)
-*/
-void QtxResourceEdit::update()
-{
-}
-
-/*!
-  \return item by it's id
-  \param id - item id 
-*/
-QtxResourceEdit::Item* QtxResourceEdit::item( const int id ) const
-{
-  Item* i = 0;
-  if ( myItems.contains( id ) )
-    i = myItems[id];
-  return i;
-}
-
-/*!
-  \return item by it's title (finds first item)
-  \param title - item title 
-*/
-QtxResourceEdit::Item* QtxResourceEdit::item( const QString& title ) const
-{
-  Item* i = 0;
-  for ( ItemMap::ConstIterator it = myItems.begin(); it != myItems.end() && !i; ++it )
-  {
-    if ( it.data()->title() == title )
-      i = it.data();
-  }
-  return i;
-}
-
-/*!
-  \return item by it's title and parent id
-  \param title - item title 
-  \param pId - parent id
-*/
-QtxResourceEdit::Item* QtxResourceEdit::item( const QString& title, const int pId ) const
-{
-  Item* i = 0;
-  Item* pItem = item( pId );
-  for ( ItemMap::ConstIterator it = myItems.begin(); it != myItems.end() && !i; ++it )
-  {
-    if ( it.data()->parentItem() == pItem && it.data()->title() == title )
-      i = it.data();
-  }
-  return i;
-}
-
-/*!
-  Creates item
-  \return new item
-  \param label - text of label for new item
-  \param type - type of new item
-  \param pId - parent id
-*/
-QtxResourceEdit::Item* QtxResourceEdit::createItem( const QString& label, const int type, const int pId )
-{
-  Item* i = 0;
-  if ( pId < 0 )
-    i = createItem( label, type );
-  else
-  {
-    Item* pItem = item( pId );
-    if ( pItem )
-    {
-      i = pItem->createItem( label, type );
-      pItem->insertChild( i );
-    }
-  }
-
-  return i;
-}
-
-/*!
-  Removes item
-  \param item - item to be removed
-*/
-void QtxResourceEdit::removeItem( Item* item )
-{
-  if ( !item )
-    return;
-
-  myChildren.remove( item );
-  myItems.remove( item->id() );
-
-  itemRemoved( item );
-}
-
-/*!
-  \return children items of resource edit
-  \param lst - list of items to be filled with children
-*/
-void QtxResourceEdit::childItems( QPtrList<Item>& lst ) const
-{
-  lst.clear();
-  for ( QPtrListIterator<Item> it( myChildren ); it.current(); ++it )
-    lst.append( it.current() );
-}
-
-/*!
-  \return all resources values from widgets
-  \param map - map to be filled by resources values
-*/
-void QtxResourceEdit::resourceValues( QMap<int, QString>& map ) const
-{
-  QString sect, name;
-  for ( ItemMap::ConstIterator it = myItems.begin(); it != myItems.end(); ++it )
-  {
-    it.data()->resource( sect, name );
-    if( myResMgr->hasValue( sect, name ) )
-      map.insert( it.key(), it.data()->resourceValue() );
-  }
-}
-
-/*!
-  \return all resources values from widgets
-  \param map - map to be filled by resources values
-*/
-void QtxResourceEdit::resourceValues( QMap<Item*, QString>& map ) const
-{
-  QString sect, name;
-  for ( ItemMap::ConstIterator it = myItems.begin(); it != myItems.end(); ++it )
-  {
-    it.data()->resource( sect, name );
-    if( myResMgr->hasValue( sect, name ) )
-      map.insert( it.data(), it.data()->resourceValue() );
-  }
-}
-
-/*!
-  Sets to widgets all resources values from map
-  \param map - map with resources values
-*/
-void QtxResourceEdit::setResourceValues( QMap<int, QString>& map ) const
-{
-  for ( QMap<int, QString>::ConstIterator it = map.begin(); it != map.end(); ++it )
-  {
-    Item* i = item( it.key() );
-    if ( i )
-      i->setResourceValue( it.data() );
-  }
-}
-
-/*!
-  Sets to widgets all resources values from map
-  \param map - map with resources values
-*/
-void QtxResourceEdit::setResourceValues( QMap<Item*, QString>& map ) const
-{
-  for ( QMap<Item*, QString>::ConstIterator it = map.begin(); it != map.end(); ++it )
-    it.key()->setResourceValue( it.data() );
-}
-
-/*!
-   Compares two map of resources values and finds different ones
-   \param map1 - first map
-   \param map2 - second map
-   \param resMap - map to be filled with different values
-   \param fromFirst - if it is true, then resMap will be filled with values from first map, otherwise - from second
-*/
-void QtxResourceEdit::differentValues( const QMap<int, QString>& map1, const QMap<int, QString>& map2,
-                                       QMap<int, QString>& resMap, const bool fromFirst ) const
-{
-  resMap.clear();
-  const QMap<int, QString>& later = fromFirst ? map1 : map2;
-  const QMap<int, QString>& early = fromFirst ? map2 : map1;
-
-  for ( QMap<int, QString>::ConstIterator it = later.begin(); it != later.end(); ++it )
-  {
-    if ( !early.contains( it.key() ) || early[it.key()] != it.data() )
-      resMap.insert( it.key(), it.data() );
-  }
-}
-
-/*!
-   Compares two map of resources values and finds different ones
-   \param map1 - first map
-   \param map2 - second map
-   \param resMap - map to be filled with different values
-   \param fromFirst - if it is true, then resMap will be filled with values from first map, otherwise - from second
-*/
-void QtxResourceEdit::differentValues( const QMap<Item*, QString>& map1, const QMap<Item*, QString>& map2,
-                                       QMap<Item*, QString>& resMap, const bool fromFirst ) const
-{
-  resMap.clear();
-  const QMap<Item*, QString>& later = fromFirst ? map1 : map2;
-  const QMap<Item*, QString>& early = fromFirst ? map2 : map1;
-
-  for ( QMap<Item*, QString>::ConstIterator it = later.begin(); it != later.end(); ++it )
-  {
-    if ( !early.contains( it.key() ) || early[it.key()] != it.data() )
-      resMap.insert( it.key(), it.data() );
-  }
-}
-
-/*!
-  Makes some activity on resource changing (called from store() method)
-  \sa store()
-*/
-void QtxResourceEdit::changedResources( const QMap<Item*, QString>& )
-{
-}
-
-/*!
-  Some activity on item addition (default implementation is empty)
-*/
-void QtxResourceEdit::itemAdded( Item* )
-{
-}
-
-/*!
-  Some activity on item removing (default implementation is empty)
-*/
-void QtxResourceEdit::itemRemoved( Item* )
-{
-}
-
-/*!
-  Constructor
-*/
-QtxResourceEdit::Item::Item( QtxResourceEdit* edit, Item* parent )
-: myEdit( edit ),
-myParent( 0 )
-{
-  myId = generateId();
-
-  if ( parent )
-    parent->insertChild( this );
-}
-
-/*!
-  Destructor
-*/
-QtxResourceEdit::Item::~Item()
-{
-  if ( resourceEdit() )
-    resourceEdit()->removeItem( this );
-}
-
-/*!
-  \return id of item
-*/
-int QtxResourceEdit::Item::id() const
-{
-  return myId;
-}
-
-/*!
-  \return parent item 
-*/
-QtxResourceEdit::Item* QtxResourceEdit::Item::parentItem() const
-{
-  return myParent;
-}
-
-/*!
-  Appends child and (if necessary) removes item from old parent
-  \param item - item to be added
-*/
-void QtxResourceEdit::Item::insertChild( Item* item )
-{
-  if ( !item || myChildren.contains( item ) )
-    return;
-
-  if ( item->parentItem() && item->parentItem() != this )
-    item->parentItem()->removeChild( item );
-
-  item->myParent = this;
-  myChildren.append( item );
-}
-
-/*!
-  Removes child
-  \param item - item to be removed
-*/
-void QtxResourceEdit::Item::removeChild( Item* item )
-{
-  if ( !item || !myChildren.contains( item ) )
-    return;
-
-  myChildren.remove( item );
-  item->myParent = 0;
-}
-
-/*!
-  Fills list with children items
-  \param lst - list to be filled with
-*/
-void QtxResourceEdit::Item::childItems( QPtrList<Item>& lst ) const
-{
-  for ( ItemListIterator it( myChildren ); it.current(); ++it )
-    lst.append( it.current() );
-}
-
-/*!
-  \return true if there is no children of this item
-*/
-bool QtxResourceEdit::Item::isEmpty() const
-{
-  return myChildren.isEmpty();
-}
-
-/*!
-  \return title of item
-*/
-QString QtxResourceEdit::Item::title() const
-{
-  return myTitle;
-}
-
-/*!
-  \return assigned resource placement
-  \param sec - to return section
-  \param param - to return param name
-*/
-void QtxResourceEdit::Item::resource( QString& sec, QString& param ) const
-{
-  sec = myResSection;
-  param = myResParameter;
-}
-
-/*!
-  Sets item title 
-  \param title - new item title
-*/
-void QtxResourceEdit::Item::setTitle( const QString& title )
-{
-  myTitle = title;
-}
-
-/*!
-  Assigns new resource to item
-  \param sec - section
-  \param sec - param name
-*/
-void QtxResourceEdit::Item::setResource( const QString& sec, const QString& param )
-{
-  myResSection = sec;
-  myResParameter = param;
-}
-
-/*!
-  Updates item (default implementation is empty)
-*/
-void QtxResourceEdit::Item::update()
-{
-}
-
-/*!
-  \return property value
-*/
-QVariant QtxResourceEdit::Item::property( const QString& ) const
-{
-  return QVariant();
-}
-
-/*!
-  Sets property value
-*/
-void QtxResourceEdit::Item::setProperty( const QString&, const QVariant& )
-{
-}
-
-/*!
-  \return value of assigned resource
-*/
-QString QtxResourceEdit::Item::resourceValue() const
-{
-  return getString();
-}
-
-/*!
-  Sets value of assigned resource
-  \param val - new value
-*/
-void QtxResourceEdit::Item::setResourceValue( const QString& val )
-{
-  setString( val );
-}
-
-/*!
-  \return corresponding resource manager
-*/
-QtxResourceMgr* QtxResourceEdit::Item::resourceMgr() const
-{
-  QtxResourceMgr* resMgr = 0;
-  if ( resourceEdit() )
-    resMgr = resourceEdit()->resourceMgr();
-  return resMgr;
-}
-
-/*!
-  \return corresponding resource edit
-*/
-QtxResourceEdit* QtxResourceEdit::Item::resourceEdit() const
-{
-  return myEdit;
-}
-
-/*!
-  \return integer value of resource corresponding to item
-  \param val - default value (it is returned if there is no such resource)
-*/
-int QtxResourceEdit::Item::getInteger( const int val ) const
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  return resMgr ? resMgr->integerValue( myResSection, myResParameter, val ) : val;
-}
-
-/*!
-  \return double value of resource corresponding to item
-  \param val - default value (it is returned if there is no such resource)
-*/
-double QtxResourceEdit::Item::getDouble( const double val ) const
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  return resMgr ? resMgr->doubleValue( myResSection, myResParameter, val ) : val;
-}
-
-/*!
-  \return boolean value of resource corresponding to item
-  \param val - default value (it is returned if there is no such resource)
-*/
-bool QtxResourceEdit::Item::getBoolean( const bool val ) const
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  return resMgr ? resMgr->booleanValue( myResSection, myResParameter, val ) : val;
-}
-
-/*!
-  \return string value of resource corresponding to item
-  \param val - default value (it is returned if there is no such resource)
-*/
-QString QtxResourceEdit::Item::getString( const QString& val ) const
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  return resMgr ? resMgr->stringValue( myResSection, myResParameter, val ) : val;
-}
-
-/*!
-  \return color value of resource corresponding to item
-  \param val - default value (it is returned if there is no such resource)
-*/
-QColor QtxResourceEdit::Item::getColor( const QColor& val ) const
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  return resMgr ? resMgr->colorValue( myResSection, myResParameter, val ) : val;
-}
-
-/*!
-  \return font value of resource corresponding to item
-  \param val - default value (it is returned if there is no such resource)
-*/
-QFont QtxResourceEdit::Item::getFont( const QFont& val ) const
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  return resMgr ? resMgr->fontValue( myResSection, myResParameter, val ) : val;
-}
-
-/*!
-  Sets value of resource
-  \param val - value
-*/
-void QtxResourceEdit::Item::setInteger( const int val )
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  if ( resMgr )
-    resMgr->setValue( myResSection, myResParameter, val );
-}
-
-/*!
-  Sets value of resource
-  \param val - value
-*/
-void QtxResourceEdit::Item::setDouble( const double val )
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  if ( resMgr )
-    resMgr->setValue( myResSection, myResParameter, val );
-}
-
-/*!
-  Sets value of resource
-  \param val - value
-*/
-void QtxResourceEdit::Item::setBoolean( const bool val )
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  if ( resMgr )
-    resMgr->setValue( myResSection, myResParameter, val );
-}
-
-/*!
-  Sets value of resource
-  \param val - value
-*/
-void QtxResourceEdit::Item::setString( const QString& val )
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  if ( resMgr )
-    resMgr->setValue( myResSection, myResParameter, val );
-}
-
-/*!
-  Sets value of resource
-  \param val - value
-*/
-void QtxResourceEdit::Item::setColor( const QColor& val )
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  if ( resMgr )
-    resMgr->setValue( myResSection, myResParameter, val );
-}
-
-/*!
-  Sets value of resource
-  \param val - value
-*/
-void QtxResourceEdit::Item::setFont( const QFont& val )
-{
-  QtxResourceMgr* resMgr = resourceMgr();
-  if ( resMgr )
-    resMgr->setValue( myResSection, myResParameter, val );
-}
-
-/*!
-  \return other item
-  \param id - other item id
-*/
-QtxResourceEdit::Item* QtxResourceEdit::Item::item( const int id ) const
-{
-  return resourceEdit() ? resourceEdit()->item( id ) : 0;
-}
-
-/*!
-  \return other item
-  \param title - other item title
-*/
-QtxResourceEdit::Item* QtxResourceEdit::Item::item( const QString& title ) const
-{
-  return resourceEdit() ? resourceEdit()->item( title ) : 0;
-}
-
-/*!
-  \return other item
-  \param title - other item title
-  \param id - parent item id
-*/
-QtxResourceEdit::Item* QtxResourceEdit::Item::item( const QString& title, const int id ) const
-{
-  return resourceEdit() ? resourceEdit()->item( title, id ) : 0;
-}
-
-/*!
-  \return free item id
-*/
-int QtxResourceEdit::Item::generateId()
-{
-  static int _id = 0;
-  return _id++;
-}
diff --git a/src/Qtx/QtxResourceEdit.h b/src/Qtx/QtxResourceEdit.h
deleted file mode 100644 (file)
index d6da330..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxResourceEdit.h
-// Author:    Sergey TELKOV
-
-#ifndef QTXRESOURCEEDIT_H
-#define QTXRESOURCEEDIT_H
-
-#ifdef WIN32
-#pragma warning( disable:4251 )
-#endif
-
-#include "Qtx.h"
-
-class QString;
-class QtxResourceMgr;
-
-#include <qcolor.h>
-#include <qvariant.h>
-#include <qfont.h>
-
-/*!
-  \class QtxResourceEdit
-  Class for managing preferences items
-*/
-class QTX_EXPORT QtxResourceEdit
-{
-public:
-  class Item;
-
-public:
-  QtxResourceEdit( QtxResourceMgr* );
-  virtual ~QtxResourceEdit();
-
-  QtxResourceMgr*      resourceMgr() const;
-
-  virtual int          addItem( const QString& label, const int pId = -1, const int = -1,
-                                const QString& section = QString::null,
-                                const QString& param = QString::null );
-
-  QVariant             itemProperty( const int, const QString& ) const;
-  virtual void         setItemProperty( const int, const QString&, const QVariant& );
-
-  void                 resource( const int, QString&, QString& ) const;
-
-  virtual void         store();
-  virtual void         retrieve();
-
-  virtual void         update();
-
-  virtual void         toBackup();
-  virtual void         fromBackup();
-
-protected:
-  Item*                item( const int ) const;
-  Item*                item( const QString& ) const;
-  Item*                item( const QString&, const int ) const;
-
-  virtual Item*        createItem( const QString&, const int ) = 0;
-
-  void                 resourceValues( QMap<int, QString>& ) const;
-  void                 resourceValues( QMap<Item*, QString>& ) const;
-
-  void                 setResourceValues( QMap<int, QString>& ) const;
-  void                 setResourceValues( QMap<Item*, QString>& ) const;
-  
-  void                 differentValues( const QMap<int, QString>&, const QMap<int, QString>&,
-                                        QMap<int, QString>&, const bool fromFirst = false ) const;
-  void                 differentValues( const QMap<Item*, QString>&, const QMap<Item*, QString>&,
-                                        QMap<Item*, QString>&, const bool fromFirst = false ) const;
-
-  virtual void         changedResources( const QMap<Item*, QString>& );
-
-  virtual void         itemAdded( Item* );
-  virtual void         itemRemoved( Item* );
-
-  void                 childItems( QPtrList<Item>& ) const;
-
-private:
-  void                 removeItem( Item* );
-  Item*                createItem( const QString&, const int, const int );
-
-private:
-  typedef QMap<int, Item*> ItemMap;
-
-private:
-  ItemMap              myItems;
-  QtxResourceMgr*      myResMgr;
-  QMap<Item*, QString> myBackup;
-  QPtrList<Item>       myChildren;
-
-  friend class QtxResourceEdit::Item;
-};
-
-/*!
-  \class QtxResourceEditor::Item
-  Class for incapsulation of one preference item
-*/
-
-class QTX_EXPORT QtxResourceEdit::Item
-{
-public:
-  Item( QtxResourceEdit*, Item* = 0 );
-  virtual ~Item();
-
-  int                  id() const;
-  virtual int          type() const = 0;
-
-  Item*                parentItem() const;
-  void                 childItems( QPtrList<Item>& ) const;
-
-  virtual bool         isEmpty() const;
-
-  QString              title() const;
-  void                 resource( QString&, QString& ) const;
-
-  virtual void         setTitle( const QString& );
-  virtual void         setResource( const QString&, const QString& );
-
-  virtual void         update();
-
-  virtual QVariant     property( const QString& ) const;
-  virtual void         setProperty( const QString&, const QVariant& );
-
-  virtual void         store() = 0;
-  virtual void         retrieve() = 0;
-
-  virtual Item*        createItem( const QString&, const int ) = 0;
-
-  QString              resourceValue() const;
-  void                 setResourceValue( const QString& );
-
-  virtual void         insertChild( Item* );
-  virtual void         removeChild( Item* );
-
-protected:
-  QtxResourceMgr*      resourceMgr() const;
-  QtxResourceEdit*     resourceEdit() const;
-
-  int                  getInteger( const int = 0 ) const;
-  double               getDouble( const double = 0.0 ) const;
-  bool                 getBoolean( const bool = false ) const;
-  QColor               getColor( const QColor& = QColor() ) const;
-  QFont                getFont( const QFont& = QFont() ) const;
-  QString              getString( const QString& = QString::null ) const;
-
-  void                 setInteger( const int );
-  void                 setDouble( const double );
-  void                 setBoolean( const bool );
-  void                 setColor( const QColor& );
-  void                 setFont( const QFont& );  
-  void                 setString( const QString& );
-
-  Item*                item( const int ) const;
-  Item*                item( const QString& ) const;
-  Item*                item( const QString&, const int ) const;
-
-protected:
-  typedef QPtrList<Item>         ItemList;
-  typedef QPtrListIterator<Item> ItemListIterator;
-
-private:
-  static int           generateId();
-
-private:
-  int                  myId;
-  Item*                myParent;
-  ItemList             myChildren;
-
-  QString              myTitle;
-  QString              myResSection;
-  QString              myResParameter;
-
-  QtxResourceEdit*     myEdit;
-};
-
-#ifdef WIN32
-#pragma warning( default:4251 )
-#endif
-
-#endif
index 02b3a1c656fb589da663b666a31e1df226875f74..cf91632aaaad0f3e5c963fd8ba5fb2cf0d380f68 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxResourceMgr.cxx
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
 #include "QtxResourceMgr.h"
+#include "QtxTranslator.h"
 
-#include <qdir.h>
-#include <qfile.h>
-#include <qregexp.h>
-#include <qpixmap.h>
-#include <qtranslator.h>
-#include <qapplication.h>
-
+#include <QDir>
+#include <QFile>
+#include <QRegExp>
+#include <QTextStream>
+#include <QApplication>
 #ifndef QT_NO_DOM
-#include <qdom.h>
+#include <QDomDocument>
+#include <QDomElement>
+#include <QDomNode>
 #endif
 
 #include <stdlib.h>
 
 /*!
-  Class: QtxResourceMgr::Resources
-  Level: Internal
+  \class QtxResourceMgr::Resources
+  \internal
+  \brief Represents container for settings read from the resource file.
 */
 
-QtxResourceMgr::Resources::Resources( const QtxResourceMgr* mgr, const QString& fileName )
-: myFileName( fileName ),
-  myMgr( const_cast<QtxResourceMgr*>( mgr ) )
+class QtxResourceMgr::Resources
+{
+public:
+  Resources( QtxResourceMgr*, const QString& );
+  virtual ~Resources();
+
+  QString                file() const;
+  void                   setFile( const QString& );
+
+  QString                value( const QString&, const QString&, const bool ) const;
+  void                   setValue( const QString&, const QString&, const QString& );
+
+  bool                   hasSection( const QString& ) const;
+  bool                   hasValue( const QString&, const QString& ) const;
+
+  void                   removeSection( const QString& );
+  void                   removeValue( const QString&, const QString& );
+
+  QPixmap                loadPixmap( const QString&, const QString&, const QString& ) const;
+  QTranslator*           loadTranslator( const QString&, const QString&, const QString& ) const;
+
+  QString                environmentVariable( const QString&, int&, int& ) const;
+  QString                makeSubstitution( const QString&, const QString&, const QString& ) const;
+
+  void                   clear();
+
+  QStringList            sections() const;
+  QStringList            parameters( const QString& ) const;
+
+  QString                path( const QString&, const QString&, const QString& ) const;
+
+protected:
+  QtxResourceMgr*        resMgr() const;
+
+private:
+  Section                section( const QString& );
+  const Section          section( const QString& ) const;
+
+  QString                fileName( const QString&, const QString&, const QString& ) const;
+
+private:
+  typedef QMap<QString, Section> SectionMap;
+
+private:
+  QtxResourceMgr*        myMgr;             //!< resources manager
+  SectionMap             mySections;        //!< sections map
+  QString                myFileName;        //!< resources file name
+  QMap<QString,QPixmap>  myPixmapCache;     //!< pixmaps cache
+
+  friend class QtxResourceMgr::Format;
+};
+
+/*!
+  \brief Constructor.
+  \param mgr parent resources manager
+  \param fileName resources file name
+*/
+QtxResourceMgr::Resources::Resources( QtxResourceMgr* mgr, const QString& fileName )
+: myMgr( mgr ),
+  myFileName( fileName )
 {
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxResourceMgr::Resources::~Resources()
 {
 }
 
 /*!
-  Returns name of resource file
-  This file is used to load/save operations
+  \brief Get resources file name.
+
+  This file is used to load/save operations.
+
+  \return file name
+  \sa setFile()
 */
 QString QtxResourceMgr::Resources::file() const
 {
@@ -59,8 +128,9 @@ QString QtxResourceMgr::Resources::file() const
 }
 
 /*!
-  Sets name of resource file
-  \param fn - name of file
+  \brief Set resources file name.
+  \param fn file name
+  \sa file()
 */
 void QtxResourceMgr::Resources::setFile( const QString& fn )
 {
@@ -68,14 +138,12 @@ void QtxResourceMgr::Resources::setFile( const QString& fn )
 }
 
 /*!
-  Returns string representation of parameter value
-  Returns QString::null if there is no such parameter
-
-  \param sect - name of section
-  \param name - name of parameter
-  \param subst - if it is true, then the substitution of variables
-  will be done with help of makeSubstitution method
-  \sa makeSubstitution()
+  \brief Get string representation of parameter value.
+  \param sect section name
+  \param name parameter name
+  \param subst if \c true, perform variables substitution
+  \return parameter value or null QString if there is no such parameter
+  \sa setValue(), makeSubstitution()
 */
 QString QtxResourceMgr::Resources::value( const QString& sect, const QString& name, const bool subst ) const
 {
@@ -91,21 +159,24 @@ QString QtxResourceMgr::Resources::value( const QString& sect, const QString& na
 }
 
 /*!
-  Sets value by it's string representation
-
-  \param sect - name of section
-  \param name - name of parameter
-  \param val - string value
+  \brief Set parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
+  \sa value(), makeSubstitution()
 */
 void QtxResourceMgr::Resources::setValue( const QString& sect, const QString& name, const QString& val )
 {
-  Section& s = section( sect );
-  s.insert( name, val );
+  if ( !mySections.contains( sect ) )
+    mySections.insert( sect, Section() );
+
+  mySections[sect].insert( name, val );
 }
 
 /*!
-  \return true if section exists
-  \param sect - name of section
+  \brief Check section existence.
+  \param sect section name
+  \return \c true if section exists
 */
 bool QtxResourceMgr::Resources::hasSection( const QString& sect ) const
 {
@@ -113,9 +184,10 @@ bool QtxResourceMgr::Resources::hasSection( const QString& sect ) const
 }
 
 /*!
-  \return true if parameter exists in section
-  \param sect - name of section
-  \param name - name of parameter
+  \brief Check parameter existence.
+  \param sect section name
+  \param name parameter name
+  \return \c true if parameter exists in specified section
 */
 bool QtxResourceMgr::Resources::hasValue( const QString& sect, const QString& name ) const
 {
@@ -123,8 +195,8 @@ bool QtxResourceMgr::Resources::hasValue( const QString& sect, const QString& na
 }
 
 /*!
-  Removes section from resources
-  \param sect - name of section
+  \brief Remove resourcs section.
+  \param sect secton name
 */
 void QtxResourceMgr::Resources::removeSection( const QString& sect )
 {
@@ -132,24 +204,23 @@ void QtxResourceMgr::Resources::removeSection( const QString& sect )
 }
 
 /*!
-  Removes parameter from section
-  \param sect - name of section
-  \param name - name of parameter
+  \brief Remove parameter from the section.
+  \param sect section name
+  \param name parameter name
 */
 void QtxResourceMgr::Resources::removeValue( const QString& sect, const QString& name )
 {
-  if ( !hasSection( sect ) )
+  if ( !mySections.contains( sect ) )
     return;
 
-  Section& s = section( sect );
-  s.remove( name );
+  mySections[sect].remove( name );
 
-  if ( s.isEmpty() )
+  if ( mySections[sect].isEmpty() )
     mySections.remove( sect );
 }
 
 /*!
-  Removes all sections
+  \brief Remove all sections.
 */
 void QtxResourceMgr::Resources::clear()
 {
@@ -157,6 +228,7 @@ void QtxResourceMgr::Resources::clear()
 }
 
 /*!
+  \brief Get all sections names.
   \return list of section names
 */
 QStringList QtxResourceMgr::Resources::sections() const
@@ -165,8 +237,9 @@ QStringList QtxResourceMgr::Resources::sections() const
 }
 
 /*!
-  \return list of parameter names from section
-  \param sec - name of section
+  \brief Get all parameters name in specified section.
+  \param sec section name
+  \return list of settings names
 */
 QStringList QtxResourceMgr::Resources::parameters( const QString& sec ) const
 {
@@ -177,11 +250,19 @@ QStringList QtxResourceMgr::Resources::parameters( const QString& sec ) const
 }
 
 /*!
-  \return path of file from directory built by parameter
-  \return QString::null if built path doesn't exist
-  \param sec - name of section
-  \param prefix - name of parameter containing some path
-  \param name - name of file
+  \brief Get absolute path to the file which name is defined by the parameter.
+
+  The file name is defined by \a name argument, while directory name is retrieved
+  from resources parameter \a prefix of section \a sec. Both directory and file name
+  can be relative. If the directory is relative, it is calculated from the initial
+  resources file name (see file()). Directory parameter can contain environment 
+  variables, which are substituted automatically.
+
+  \param sec section name
+  \param prefix parameter containing directory name
+  \param name file name
+  \return absolute file path or null QString if file does not exist
+  \sa fileName(), file(), makeSubstitution()
 */
 QString QtxResourceMgr::Resources::path( const QString& sec, const QString& prefix, const QString& name ) const
 {
@@ -189,13 +270,14 @@ QString QtxResourceMgr::Resources::path( const QString& sec, const QString& pref
   if ( !filePath.isEmpty() )
   {
     if ( !QFileInfo( filePath ).exists() )
-      filePath = QString::null;
+      filePath = QString();
   }
   return filePath;
 }
 
 /*!
-  \return corresponding resource manager
+  \brief Get resource manager
+  \return resource manager pointer
 */
 QtxResourceMgr* QtxResourceMgr::Resources::resMgr() const
 {
@@ -203,9 +285,14 @@ QtxResourceMgr* QtxResourceMgr::Resources::resMgr() const
 }
 
 /*!
-  \return instance of section by it's name. Section will be created if it doesn't exist
+  \brief Get resources section by specified name.
+
+  If section does not exist it is created (empty).
+
+  \param sn section name
+  \return resources section
 */
-QtxResourceMgr::Section& QtxResourceMgr::Resources::section( const QString& sn )
+QtxResourceMgr::Section QtxResourceMgr::Resources::section( const QString& sn )
 {
   if ( !mySections.contains( sn ) )
     mySections.insert( sn, Section() );
@@ -214,18 +301,31 @@ QtxResourceMgr::Section& QtxResourceMgr::Resources::section( const QString& sn )
 }
 
 /*!
-  \return instance of section by it's name. Section will be created if it doesn't exist
+  \brief Get resources section by specified name.
+  \param sn section name
+  \return resources section
 */
-const QtxResourceMgr::Section& QtxResourceMgr::Resources::section( const QString& sn ) const
+const QtxResourceMgr::Section QtxResourceMgr::Resources::section( const QString& sn ) const
 {
   return mySections[sn];
 }
 
 /*!
-  \return full path of file
-  \param sect - name of section
-  \param prefix - name of parameter containing some path
-  \param name - name of file
+  \brief Get file path.
+
+  The file name is defined by \a name argument, while directory name is retrieved
+  from resources parameter \a prefix of section \a sec. Both directory and file name
+  can be relative. If the directory is relative, it is calculated from the initial
+  resources file name (see file()). Directory parameter can contain environment 
+  variables, which are substituted automatically.
+  File existence is not checked.
+
+  \param sec section name
+  \param prefix parameter containing directory name
+  \param name file name
+  \return absolute file path or null QString if \a prefix parameter
+          does not exist in section \sec
+  \sa path(), file(), makeSubstitution()
 */
 QString QtxResourceMgr::Resources::fileName( const QString& sect, const QString& prefix, const QString& name ) const
 {
@@ -236,7 +336,7 @@ QString QtxResourceMgr::Resources::fileName( const QString& sect, const QString&
     if ( !path.isEmpty() )
     {
       if ( QFileInfo( path ).isRelative() )
-        path = Qtx::addSlash( QFileInfo( myFileName ).dirPath( true ) ) + path;
+        path = Qtx::addSlash( Qtx::dir( myFileName, true ) ) + path;
 
       path = Qtx::addSlash( path ) + name;
     }
@@ -245,17 +345,23 @@ QString QtxResourceMgr::Resources::fileName( const QString& sect, const QString&
   {
     QString fname = QDir::convertSeparators( path );
     QFileInfo inf( fname );
-    fname = inf.absFilePath();
+    fname = inf.absoluteFilePath();
     return fname;
   }
   return QString();
 }
 
 /*!
-  \return QPixmap loaded from file
-  \param sect - name of section
-  \param prefix - name of parameter containing some path
-  \param name - name of picture file
+  \brief Load and return pixmap from external file.
+  
+  If QtxResourceMgr::isPixmapCached() is \c true then cached pixmap is returned
+  (if it is already loaded), otherwise it is loaded from file.
+  If the file name is invalid, null pixmap is returned.
+
+  \param sect section name
+  \param prefix parameter containing resources directory name
+  \param name pixmap file name
+  \return pixmap loaded from file
 */
 QPixmap QtxResourceMgr::Resources::loadPixmap( const QString& sect, const QString& prefix, const QString& name ) const
 {
@@ -274,15 +380,17 @@ QPixmap QtxResourceMgr::Resources::loadPixmap( const QString& sect, const QStrin
 }
 
 /*!
-  \return just created and loaded translator
-  \param sect - name of section
-  \param prefix - name of parameter containing some path
-  \param name - name of file
+  \brief Load translator.
+  \param sect section name
+  \param prefix parameter containing resources directory
+  \param name translation file name
+  \return just created and loaded translator or 0 in case of error
 */
 QTranslator* QtxResourceMgr::Resources::loadTranslator( const QString& sect, const QString& prefix, const QString& name ) const
 {
-  QTranslator* trans = new QTranslator( 0 );
-  if ( !trans->load( fileName( sect, prefix, name ) ) )
+  QTranslator* trans = new QtxTranslator( 0 );
+  QString fname = fileName( sect, prefix, name );
+  if ( !trans->load( Qtx::file( fname, false ), Qtx::dir( fname ) ) )
   {
     delete trans;
     trans = 0;
@@ -291,39 +399,63 @@ QTranslator* QtxResourceMgr::Resources::loadTranslator( const QString& sect, con
 }
 
 /*!
-  Finds in string variables by patterns: ${name} or $(name) or %name%
-  \return first found name or QString::null if there is no ones
-  \param str - string where the search is processed
-  \param start - integer value for returning start position of variable
-  \param len - integer value for returning length of variable
+  \brief Parse given string to retrieve environment variable.
+
+  Looks through the string for the patterns: ${name} or $(name) or %name%.
+  If string contains variable satisfying any pattern, the variable name
+  is returned, start index of the variable is returned in the \a start parameter,
+  and length of the variable is returned in the \a len parameter.
+
+  \param str string being processed
+  \param start if variable is found, this parameter contains its starting 
+         position in the \a str
+  \param len if variable is found, this parameter contains its length 
+  \return first found variable or null QString if there is no ones
 */
 QString QtxResourceMgr::Resources::environmentVariable( const QString& str, int& start, int& len ) const
 {
-  QString varName = QString::null;
+  QString varName;
   len = 0;
 
-  QRegExp rx( "\\$\\{([a-zA-Z]+[a-zA-Z0-9_]*)\\}|\\$\\(([a-zA-Z]+[a-zA-Z0-9_]*)\\)|\\$([a-zA-Z]+[a-zA-Z0-9_]*)|\\%([a-zA-Z]+[a-zA-Z0-9_]*)\\%" );
+  QRegExp rx( "(^\\$\\{|[^\\$]\\$\\{)([a-zA-Z]+[a-zA-Z0-9_]*)(\\})|(^\\$\\(|[^\\$]\\$\\()([a-zA-Z]+[a-zA-Z0-9_]*)(\\))|(^\\$|[^\\$]\\$)([a-zA-Z]+[a-zA-Z0-9_]*)|(^%|[^%]%)([a-zA-Z]+[a-zA-Z0-9_]*)(%[^%]|%$)" );
 
-  int pos = rx.search( str, start );
+  int pos = rx.indexIn( str, start );
   if ( pos != -1 )
   {
-    start = pos;
-    len = rx.matchedLength();
-    QStringList caps = rx.capturedTexts();
-    for ( uint i = 1; i <= caps.count() && varName.isEmpty(); i++ )
-      varName = *caps.at( i );
+    int i = 1;
+    while ( i <= rx.numCaptures() && varName.isEmpty() )
+    {
+      QString capStr = rx.cap( i );
+      if ( !capStr.contains( "%" ) && !capStr.contains( "$" ) )
+        varName = capStr;
+      i++;
+    }
+
+    if ( !varName.isEmpty() )
+    {
+      int capIdx = i - 1;
+      start = rx.pos( capIdx );
+      int end = start + varName.length();
+      if ( capIdx > 1 && rx.cap( capIdx - 1 ).contains( QRegExp( "\\$|%" ) ) )
+        start = rx.pos( capIdx - 1 ) + rx.cap( capIdx - 1 ).indexOf( QRegExp( "\\$|%" ) );
+      if ( capIdx < rx.numCaptures() && !rx.cap( capIdx - 1 ).isEmpty() )
+        end++;
+      len = end - start;
+    }
   }
   return varName;
 }
 
 /*!
-  Substitutes variables by its' values. If variable is from enviroment,
-  it will be replaced by environment value. If it isn't, method tries to
-  find it's value among resources
-  \return new variant of string 'str'
-  \param str - string to process substitution
-  \param sect - section, in which the variables will be finding
-  \param name - name of variable which must be ignored during substitution
+  \brief Substitute variables by their values.
+
+  Environment variable is substituted by its value. For other variables resource
+  manager tries to find value among defined resources parameters.
+
+  \param str string to be processed
+  \param sect section, where variables are searched
+  \param name name of variable which must be ignored during substitution
+  \return processed string (with all substitutions made)
 */
 QString QtxResourceMgr::Resources::makeSubstitution( const QString& str, const QString& sect, const QString& name ) const
 {
@@ -339,9 +471,9 @@ QString QtxResourceMgr::Resources::makeSubstitution( const QString& str, const Q
     if ( envName.isNull() )
       break;
 
-    QString newStr = QString::null;
-    if ( ::getenv( envName ) )
-      newStr = QString( ::getenv( envName ) );
+    QString newStr;
+    if ( ::getenv( envName.toLatin1() ) )
+      newStr = QString( ::getenv( envName.toLatin1() ) );
 
     if ( newStr.isNull() )
     {
@@ -358,13 +490,18 @@ QString QtxResourceMgr::Resources::makeSubstitution( const QString& str, const Q
     res.replace( start, len, newStr );
   }
 
+  res.replace( "$$", "$" );
+  res.replace( "%%", "%" );
+
   return res;
 }
 
 /*!
-       Class: QtxResourceMgr::IniFormat
-       Level: Internal
+  \class QtxResourceMgr::IniFormat
+  \internal
+  \brief Reader/writer for .ini resources files.
 */
+
 class QtxResourceMgr::IniFormat : public Format
 {
 public:
@@ -377,7 +514,7 @@ protected:
 };
 
 /*!
-  Default constructor
+  \brief Constructor.
 */
 QtxResourceMgr::IniFormat::IniFormat()
 : Format( "ini" )
@@ -385,21 +522,22 @@ QtxResourceMgr::IniFormat::IniFormat()
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxResourceMgr::IniFormat::~IniFormat()
 {
 }
 
 /*!
-  Loads resources from ini-file to map of sections
-  \param fname - name of resource file
-  \param secMap - map of sections
+  \brief Load resources from ini-file.
+  \param fname resources file name
+  \param secMap resources map to be filled in
+  \return \c true on success and \c false on error
 */
 bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap<QString, Section>& secMap )
 {
   QFile file( fname );
-  if ( !file.open( IO_ReadOnly ) )
+  if ( !file.open( QFile::ReadOnly ) )
     return false;
 
   QTextStream ts( &file );
@@ -425,7 +563,7 @@ bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap<QString, Sectio
     if ( data.isNull() )
       break;
 
-    data = data.stripWhiteSpace();
+    data = data.trimmed();
     if ( data.isEmpty() )
       continue;
 
@@ -433,27 +571,26 @@ bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap<QString, Sectio
       continue;
 
     QRegExp rx( "^\\[([\\w\\s\\._]*)\\]$" );
-    if ( rx.search( data ) != -1 )
+    if ( rx.indexIn( data ) != -1 )
     {
       section = rx.cap( 1 );
       if ( section.isEmpty() )
       {
         res = false;
-        qWarning( QString( "Empty section in line %1" ).arg( line ) );
+        qWarning( "Empty section in line %d", line );
       }
     }
     else if ( data.contains( "=" ) && !section.isEmpty() )
     {
-      int pos = data.find( separator );
-      QString key = data.left( pos ).stripWhiteSpace();
-      QString val = data.mid( pos + 1 ).stripWhiteSpace();
+      int pos = data.indexOf( separator );
+      QString key = data.left( pos ).trimmed();
+      QString val = data.mid( pos + 1 ).trimmed();
       secMap[section].insert( key, val );
     }
     else
     {
       res = false;
-      section.isEmpty() ? qWarning( "Current section is empty" ) :
-                          qWarning( QString( "Error in line: %1" ).arg( line ) );
+      section.isEmpty() ? qWarning( "Current section is empty" ) : qWarning( "Error in line: %d", line );
     }
   }
 
@@ -463,25 +600,29 @@ bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap<QString, Sectio
 }
 
 /*!
-  Saves map of sections to resource ini-file
-  \param fname - name of resource file
-  \param secMap - map of sections
+  \brief Save resources to the ini-file.
+  \param fname resources file name
+  \param secMap resources map
+  \return \c true on success and \c false on error
 */
 bool QtxResourceMgr::IniFormat::save( const QString& fname, const QMap<QString, Section>& secMap )
 {
   QFile file( fname );
-  if ( !file.open( IO_WriteOnly ) )
+  if ( !file.open( QFile::WriteOnly ) )
     return false;
 
+  QTextStream ts( &file );
+
   bool res = true;
   for ( QMap<QString, Section>::ConstIterator it = secMap.begin(); it != secMap.end() && res; ++it )
   {
-    QString data = QString( "[%1]\n" ).arg( it.key() );
-    for ( Section::ConstIterator iter = it.data().begin(); iter != it.data().end(); ++iter )
-      data += iter.key() + " = " + iter.data() + "\n";
-    data += "\n";
+    QStringList data( QString( "[%1]" ).arg( it.key() ) );
+    for ( Section::ConstIterator iter = it.value().begin(); iter != it.value().end(); ++iter )
+      data.append( iter.key() + " = " + iter.value() );
+    data.append( "" );
 
-    res = file.writeBlock( data.latin1(), data.length() ) == (int)data.length();
+    for ( QStringList::ConstIterator itr = data.begin(); itr != data.end(); ++itr )
+      ts << *itr << endl;
   }
 
   file.close();
@@ -490,8 +631,9 @@ bool QtxResourceMgr::IniFormat::save( const QString& fname, const QMap<QString,
 }
 
 /*!
-       Class: QtxResourceMgr::XmlFormat
-       Level: Internal
+  \class QtxResourceMgr::XmlFormat
+  \internal
+  \brief Reader/writer for .xml resources files.
 */
 
 class QtxResourceMgr::XmlFormat : public Format
@@ -513,7 +655,7 @@ private:
 };
 
 /*!
-  Default constructor
+  \brief Constructor.
 */
 QtxResourceMgr::XmlFormat::XmlFormat()
 : Format( "xml" )
@@ -521,16 +663,17 @@ QtxResourceMgr::XmlFormat::XmlFormat()
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxResourceMgr::XmlFormat::~XmlFormat()
 {
 }
 
 /*!
-  Loads resources from xml-file to map of sections
-  \param fname - name of resource file
-  \param secMap - map of sections
+  \brief Load resources from xml-file.
+  \param fname resources file name
+  \param secMap resources map to be filled in
+  \return \c true on success and \c false on error
 */
 bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMap<QString, Section>& secMap )
 {
@@ -539,7 +682,7 @@ bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMap<QString, Sectio
 #ifndef QT_NO_DOM
 
   QFile file( fname );
-  if ( !file.open( IO_ReadOnly ) )
+  if ( !file.open( QFile::ReadOnly ) )
   {
     qDebug( "File cannot be opened" );
     return false;
@@ -622,15 +765,16 @@ bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMap<QString, Sectio
 
 #endif
 
-  if( res )
-    qDebug( QString( "File '%1' is loaded successfully" ).arg( fname ) );
+  if ( res )
+    qDebug( "File '%s' is loaded successfully", (const char*)fname.toLatin1() );
   return res;
 }
 
 /*!
-  Saves map of sections to resource xml-file
-  \param fname - name of resource file
-  \param secMap - map of sections
+  \brief Save resources to the xml-file.
+  \param fname resources file name
+  \param secMap resources map
+  \return \c true on success and \c false on error
 */
 bool QtxResourceMgr::XmlFormat::save( const QString& fname, const QMap<QString, Section>& secMap )
 {
@@ -639,7 +783,7 @@ bool QtxResourceMgr::XmlFormat::save( const QString& fname, const QMap<QString,
 #ifndef QT_NO_DOM
 
   QFile file( fname );
-  if ( !file.open( IO_WriteOnly ) )
+  if ( !file.open( QFile::WriteOnly ) )
     return false;
 
   QDomDocument doc( docTag() );
@@ -651,17 +795,20 @@ bool QtxResourceMgr::XmlFormat::save( const QString& fname, const QMap<QString,
     QDomElement sect = doc.createElement( sectionTag() );
     sect.setAttribute( nameAttribute(), it.key() );
     root.appendChild( sect );
-    for ( Section::ConstIterator iter = it.data().begin(); iter != it.data().end(); ++iter )
+    for ( Section::ConstIterator iter = it.value().begin(); iter != it.value().end(); ++iter )
     {
       QDomElement val = doc.createElement( parameterTag() );
       val.setAttribute( nameAttribute(), iter.key() );
-      val.setAttribute( valueAttribute(), iter.data() );
+      val.setAttribute( valueAttribute(), iter.value() );
       sect.appendChild( val );
     }
   }
 
-  QString docStr = doc.toString();
-  res = file.writeBlock( docStr.latin1(), docStr.length() ) == (int)docStr.length();
+  QTextStream ts( &file );
+  QStringList docStr = doc.toString().split( "\n" );
+  for ( QStringList::ConstIterator itr = docStr.begin(); itr != docStr.end(); ++itr )
+    ts << *itr << endl;
+
   file.close();
 
 #endif
@@ -670,7 +817,8 @@ bool QtxResourceMgr::XmlFormat::save( const QString& fname, const QMap<QString,
 }
 
 /*!
-  \return XML tag of document
+  \brief Get document tag name
+  \return XML document tag name
 */
 QString QtxResourceMgr::XmlFormat::docTag() const
 {
@@ -681,7 +829,8 @@ QString QtxResourceMgr::XmlFormat::docTag() const
 }
 
 /*!
-  \return XML tag of section
+  \brief Get section tag name
+  \return XML section tag name
 */
 QString QtxResourceMgr::XmlFormat::sectionTag() const
 {
@@ -692,7 +841,8 @@ QString QtxResourceMgr::XmlFormat::sectionTag() const
 }
 
 /*!
-  \return XML tag of parameter
+  \brief Get parameter tag name
+  \return XML parameter tag name
 */
 QString QtxResourceMgr::XmlFormat::parameterTag() const
 {
@@ -703,7 +853,8 @@ QString QtxResourceMgr::XmlFormat::parameterTag() const
 }
 
 /*!
-  \return XML attribute of parameter name
+  \brief Get parameter tag's "name" attribute name
+  \return XML parameter tag's "name" attribute name
 */
 QString QtxResourceMgr::XmlFormat::nameAttribute() const
 {
@@ -714,7 +865,8 @@ QString QtxResourceMgr::XmlFormat::nameAttribute() const
 }
 
 /*!
-  \return XML attribute of parameter value
+  \brief Get parameter tag's "value" attribute name
+  \return XML parameter tag's "value" attribute name
 */
 QString QtxResourceMgr::XmlFormat::valueAttribute() const
 {
@@ -725,13 +877,13 @@ QString QtxResourceMgr::XmlFormat::valueAttribute() const
 }
 
 /*!
-       Class: QtxResourceMgr::Format
-       Level: Public
+  \class QtxResourceMgr::Format
+  \brief Generic resources files reader/writer class.
 */
 
 /*!
-  \brief Constructs the format object with specified name.
-  \param fmt - name of the format
+  \brief Constructor.
+  \param fmt format name (for example, "xml" or "ini")
 */
 QtxResourceMgr::Format::Format( const QString& fmt )
 : myFmt( fmt )
@@ -739,14 +891,15 @@ QtxResourceMgr::Format::Format( const QString& fmt )
 }
 
 /*!
-  \brief Destructs the format object.
+  \brief Destructor
 */
 QtxResourceMgr::Format::~Format()
 {
 }
 
 /*!
-  \brief Returns the format name.
+  \brief Get the format name.
+  \return format name
 */
 QString QtxResourceMgr::Format::format() const
 {
@@ -754,7 +907,8 @@ QString QtxResourceMgr::Format::format() const
 }
 
 /*!
-  \brief Returns the string list of the format options.
+  \brief Get options names.
+  \return list of the format options
 */
 QStringList QtxResourceMgr::Format::options() const
 {
@@ -762,9 +916,12 @@ QStringList QtxResourceMgr::Format::options() const
 }
 
 /*!
-  \brief Returns the value of the option with specified name.
-         If option doesn't exist then empty string returned.
-  \param opt - name of the option
+  \brief Get the value of the option with specified name.
+
+  If option doesn't exist then null QString is returned.
+        
+  \param opt option name
+  \return option value
 */
 QString QtxResourceMgr::Format::option( const QString& opt ) const
 {
@@ -775,9 +932,9 @@ QString QtxResourceMgr::Format::option( const QString& opt ) const
 }
 
 /*!
-  \brief Sets the value of the option with specified name.
-  \param opt - name of the option
-  \param opt - value of the option
+  \brief Set the value of the option with specified name.
+  \param opt option name
+  \param val option value
 */
 void QtxResourceMgr::Format::setOption( const QString& opt, const QString& val )
 {
@@ -785,8 +942,9 @@ void QtxResourceMgr::Format::setOption( const QString& opt, const QString& val )
 }
 
 /*!
-  \brief Perform the loading of the resources from resource file.
-  \param res - resources object which will be loaded
+  \brief Load resources from the resource file.
+  \param res resources object
+  \return \c true on success and \c false on error
 */
 bool QtxResourceMgr::Format::load( Resources* res )
 {
@@ -798,14 +956,15 @@ bool QtxResourceMgr::Format::load( Resources* res )
   if ( status )
     res->mySections = sections;
   else
-    qDebug( "QtxResourceMgr: Could not load resource file \"%s\"", res->myFileName.latin1() );
+    qDebug( "QtxResourceMgr: Could not load resource file \"%s\"", (const char*)res->myFileName.toLatin1() );
 
   return status;
 }
 
 /*!
-  \brief Perform the saving of the resources into resource file.
-  \param res - resources object which will be saved
+  \brief Save resources to the resource file.
+  \param res resources object
+  \return \c true on success and \c false on error
 */
 bool QtxResourceMgr::Format::save( Resources* res )
 {
@@ -820,50 +979,131 @@ bool QtxResourceMgr::Format::save( Resources* res )
 }
 
 /*!
-       Class: QtxResourceMgr
-       Level: Public
+  \fn virtual bool QtxResourceMgr::Format::load( const QString& fname,
+                                                 QMap<QString, Section>& secMap )
+  \brief Load resources from the specified resources file.
+
+  Should be implemented in the successors.
+
+  \param fname resources file name
+  \param secMap resources map to be filled in
+  \return \c true on success and \c false on error
+*/
+
+/*!
+ \fn virtual bool QtxResourceMgr::Format::save( const QString& fname, 
+                                                const QMap<QString, Section>& secMap )
+
+  \brief Save resources to the specified resources file.
+
+  Should be implemented in the successors.
+
+  \param fname resources file name
+  \param secMap resources map
+  \return \c true on success and \c false on error
 */
 
 /*!
-  \brief Constructs the resource manager object for application.
-  \param appName - name of the application which resources will be used.
-  \param resVarTemplate - template for the resource environment variable name which
-                          should point to the resource directory list.
-                          Default value is "%1Resources". Its mean that for application
-                          with name "MyApp" environment variable "MyAppResources" will
-                          be used. Template may not have the parameter '%1' substituted
-                          by application name. In this case this string will be used as
-                          is without substitution.
-  Resource environment variable should contains one or several resource directories
-  separated by symbol ';'. Resource directories list transfered into the setDirList().
-  These directories and the user home directory used for the loading application resources.
-  Each of the resource directories can contains resource file. The name of this file defined
-  by the function globalFileName(). Resource file name in the user home defined by the
-  function userFileName(). Any resource looking firstly in the user home resources then
-  resource directories used in the specified order. All setted resources always stored into
-  the resource file at the user home. Only user home resource file is saved.
-  If you want to ignore of loading of Local User Preferences, you needs setup setIngoreUserValues()
-  as true.
+  \class QtxResourceMgr
+  \brief Application resources manager.
+
+  This class can be used to define settings, save/load settings and 
+  application preferences to the resource file(s), load translation files
+  (internationalization mechanism), load pixmaps and other resources from
+  external files, etc.
+
+  Currently it supports .ini and .xml resources file formats. To implement
+  own resources file format, inherit from the Format class and implement virtual
+  Format::load() and Format::save() methods.
+
+  Resources manager is initialized by the (symbolic) name of the application.
+  The parameter \a resVarTemplate specifies the template for the environment
+  variable which should point to the resource directory or list of directories.
+  Environment variable  name is calculated by substitution of "%1" substring in
+  the \a resVarTemplate parameter (if it contains such substring) by the 
+  application name (\a appName).
+  By default, \a resVarTemplate is set to "%1Resources". For example, if the application name
+  is "MyApp", the environment variable "MyAppResources" will be inspected in this case.
+  
+  Resource manager can handle several global application configuration files and
+  one user configuration file. Location of global configuration files is defined
+  by the environment variable (see above) and these files are always read-only.
+  The name of the global configuration files is retrieved by calling virtual method
+  globalFileName() which can be redefined in the QtxResourceMgr class successors.
+  User configuration file always situated in the user's home directory. It's name
+  is defined by calling virtual method userFileName() which can be also redefined
+  in the QtxResourceMgr class successors. This is the only file which the preferences
+  changed by the user during the application session are written to (usually 
+  when the application closes).
+
+  Resources environment variable should contain one or several resource directories
+  (separated by ";" symbol on Windows and ":" or ";" on Linux). Each resource directory 
+  can contain application global configuration file. The user configuration file has
+  the highest priority, for the global configuration files the priority is decreasing from
+  left to right, i.e. the first directory in the directoris list, defined by the 
+  resources environment variable has higher priority. Priority has the meaning when
+  searching requested resources (application preference, pixmap file name, translation
+  file, etc).
+
+  When retrieving preferences, it is sometimes helpful to ignore values coming from the
+  user preference file and take into account only global preferences.
+  To do this, use setWorkingMode() method passing QtxResourceMgr::IgnoreUserValues enumerator
+  as parameter.
+
+  Resources manager operates with such terms like options, sections and parameters. 
+  Parametets are named application resources, for example, application preferences like
+  integer, double, boolean or string values, pictures, font and color definitions, etc.
+  Parameters are organized inside the resources files into the named groups - sections.
+  Options are special kind of resoures which allow customizing resource files interpreting.
+  For example, by default language settings are defined in the resource file in the
+  section "language". It is possible to change this section name by setting "language" 
+  option to another value (see setOption()).
+  
+  Retrieving preferences values can be done by using one of value() methods, each returns
+  \c true if the corresponding preference is found. Another way is to use integerValue(),
+  doubleValue(), etc methods, which allow specifying default value which is used if the
+  specified preference is not found. Removing of preferences or sections can be done using
+  remove(const QString& sect) or remove(const QString& sect, const QString& name) methods.
+  To add the preference or to change exiting preference value use setValue() methods family.
+  Methods hasSection() and hasValue() can be used to check existence of section or
+  preference (in the specified section). List of all sections can be retrieved with the
+  sections() method, and list of all settings names in some specified section can be 
+  obtained with parameters() method.
+
+  Pixmaps can be loaded with the loadPixmap() methods. If the specified pixmap is not found,
+  the default one is returned. Default pixmap can be set by setDefaultPixmap().
+
+  One of the key feature of the resources manager is support of application 
+  internationalization mechanism. Translation files for the specified language can be loaded
+  with loadLanguage() method.
+*/
+
+/*!
+  \brief Constructs the resource manager.
+  \param appName application name
+  \param resVarTemplate resource environment variable pattern
 */
 QtxResourceMgr::QtxResourceMgr( const QString& appName, const QString& resVarTemplate )
 : myAppName( appName ),
   myCheckExist( true ),
+  myDefaultPix( 0 ),
   myIsPixmapCached( true ),
-  myIsIgnoreUserValues( false )
+  myHasUserValues( true ),
+  myWorkingMode( AllowUserValues )
 {
   QString envVar = !resVarTemplate.isEmpty() ? resVarTemplate : QString( "%1Resources" );
   if ( envVar.contains( "%1" ) )
     envVar = envVar.arg( appName );
 
   QString dirs;
-  if ( ::getenv( envVar ) )
-    dirs = ::getenv( envVar );
+  if ( ::getenv( envVar.toLatin1() ) )
+    dirs = ::getenv( envVar.toLatin1() );
 #ifdef WIN32
   QString dirsep = ";";      // for Windows: ";" is used as directories separator
 #else
   QString dirsep = "[:|;]";  // for Linux: both ":" and ";" can be used
 #endif
-  setDirList( QStringList::split( QRegExp(dirsep), dirs ) );
+  setDirList( dirs.split( QRegExp( dirsep ), QString::SkipEmptyParts ) );
 
   installFormat( new XmlFormat() );
   installFormat( new IniFormat() );
@@ -872,22 +1112,25 @@ QtxResourceMgr::QtxResourceMgr( const QString& appName, const QString& resVarTem
 }
 
 /*!
-  \brief Destructs the resource manager object and free allocated memory.
+  \brief Destructor.
+  
+  Destroy the resource manager and free allocated memory.
 */
 QtxResourceMgr::~QtxResourceMgr()
 {
   QStringList prefList = myTranslator.keys();
-  for ( QStringList::const_iterator it = prefList.begin(); it != prefList.end(); ++it )
+  for ( QStringList::ConstIterator it = prefList.begin(); it != prefList.end(); ++it )
     removeTranslators( *it );
-  for ( ResListIterator resIt( myResources ); resIt.current(); ++resIt )
-    delete resIt.current();
-  myResources.clear();
-  for ( FormatListIterator formIt( myFormats ); formIt.current(); ++formIt )
-    delete formIt.current();
+
+  qDeleteAll( myResources );
+  qDeleteAll( myFormats );
+
+  delete myDefaultPix;
 }
 
 /*!
-  \brief Returns the application name.
+  \brief Get the application name.
+  \return application name
 */
 QString QtxResourceMgr::appName() const
 {
@@ -895,9 +1138,12 @@ QString QtxResourceMgr::appName() const
 }
 
 /*!
-  \brief Returns the checking of the existance flag. If its 'true' then resource
-         will be setted into the manager only if it doesn't exist or has different
-         value that existing value.
+  \brief Get the "check existance" flag
+
+  If this flag is \c true then preference can be set (with setValue() method) 
+  only if it doesn't exist or if the value is changed.
+
+  \return \c true if "check existance" flag is set
 */
 bool QtxResourceMgr::checkExisting() const
 {
@@ -905,8 +1151,8 @@ bool QtxResourceMgr::checkExisting() const
 }
 
 /*!
-  \brief Sets the checking of the existance flag.
-  \param on - boolean value of the flag.
+  \brief Set the "check existance" flag.
+  \param on new flag value
 */
 void QtxResourceMgr::setCheckExisting( const bool on )
 {
@@ -914,7 +1160,13 @@ void QtxResourceMgr::setCheckExisting( const bool on )
 }
 
 /*!
-  \brief Returns the resource directories list except user home directory.
+  \brief Get the resource directories list.
+
+  Home user directory (where the user application configuration file is situated)
+  is not included. This is that directories list defined by the application
+  resources environment variable.
+
+  \return list of directories names
 */
 QStringList QtxResourceMgr::dirList() const
 {
@@ -922,8 +1174,11 @@ QStringList QtxResourceMgr::dirList() const
 }
 
 /*!
-  \brief Initialise the manager. Prepare the resource containers and load resources.
-  \param autoLoad - if 'true' then all resources will be loaded.
+  \brief Initialise resources manager.
+
+  Prepare the resources containers and load resources (if \a autoLoad is \c true).
+
+  \param autoLoad if \c true (default) then all resources are loaded
 */
 void QtxResourceMgr::initialize( const bool autoLoad ) const
 {
@@ -933,12 +1188,14 @@ void QtxResourceMgr::initialize( const bool autoLoad ) const
   QtxResourceMgr* that = (QtxResourceMgr*)this;
 
   if ( !userFileName( appName() ).isEmpty() )
-    that->myResources.append( new Resources( this, userFileName( appName() ) ) );
+    that->myResources.append( new Resources( that, userFileName( appName() ) ) );
 
-  for ( QStringList::const_iterator it = myDirList.begin(); it != myDirList.end(); ++it )
+  that->myHasUserValues = myResources.count() > 0;
+
+  for ( QStringList::ConstIterator it = myDirList.begin(); it != myDirList.end(); ++it )
   {
     QString path = Qtx::addSlash( *it ) + globalFileName( appName() );
-    that->myResources.append( new Resources( this, path ) );
+    that->myResources.append( new Resources( that, path ) );
   }
 
   if ( autoLoad )
@@ -946,7 +1203,15 @@ void QtxResourceMgr::initialize( const bool autoLoad ) const
 }
 
 /*!
-  \brief Return true if all loaded pixmaps are stored in internal map; by default: true
+  \brief Get "cached pixmaps" option value.
+
+  Resources manager allows possibility to cache loaded pixmaps that allow to
+  improve application performance. This feature is turned on by default - all 
+  loaded pixmaps are stored in the internal map. Switching of this feature on/off
+  can be done by setIsPixmapCached() method.
+
+  \return \c true if pixmap cache is turned on
+  \sa setIsPixmapCached()
 */
 bool QtxResourceMgr::isPixmapCached() const
 {
@@ -954,8 +1219,9 @@ bool QtxResourceMgr::isPixmapCached() const
 }
 
 /*!
-  \brief Set true, if it is necessary to store all loaded pixmap in internal map
-  (it accelerates following calls of loadPixmap)
+  \brief Switch "cached pixmaps" option on/off.
+  \param on enable pixmap cache if \c true and disable it if \c false
+  \sa isPixmapCached()
 */
 void QtxResourceMgr::setIsPixmapCached( const bool on )
 {
@@ -963,37 +1229,49 @@ void QtxResourceMgr::setIsPixmapCached( const bool on )
 }
 
 /*!
-  \brief Removes all resources from the manager.
+  \brief Remove all resources from the resources manager.
 */
 void QtxResourceMgr::clear()
 {
-  for ( ResListIterator it( myResources ); it.current(); ++it )
-    it.current()->clear();
+  for ( ResList::Iterator it = myResources.begin(); it != myResources.end(); ++it )
+    (*it)->clear();
 }
 
 /*!
-  Set state 'ignore user values'.
-  If it is true, then all resources loaded from user home directory is ignored
+  \brief Get current working mode.
+  
+  \return current working mode
+  \sa setWorkingMode(), value(), hasValue(), hasSection(), setValue()
 */
-void QtxResourceMgr::setIgnoreUserValues( const bool val )
+QtxResourceMgr::WorkingMode QtxResourceMgr::workingMode() const
 {
-  myIsIgnoreUserValues = val;
+  return myWorkingMode;
 }
 
 /*!
-  \return state 'ignore user values'
+  \brief Set resource manager's working mode.
+
+  The resource manager can operate in the following working modes:
+  * AllowUserValues  : methods values(), hasValue(), hasSection() take into account user values (default)
+  * IgnoreUserValues : methods values(), hasValue(), hasSection() do not take into account user values
+
+  Note, that setValue() method always put the value to the user settings file.
+  
+  \param mode new working mode
+  \sa workingMode(), value(), hasValue(), hasSection(), setValue()
 */
-bool QtxResourceMgr::ignoreUserValues() const
+void QtxResourceMgr::setWorkingMode( WorkingMode mode )
 {
-  return myIsIgnoreUserValues;
+  myWorkingMode = mode;
 }
 
 /*!
-  \brief Get the resource value as integer. Returns 'true' if it successfull otherwise
-         returns 'false'.
-  \param sect - Resource section name which contains resource.
-  \param name - Name of the resource.
-  \param iVal - Reference on the variable which should contains the resource output.
+  \brief Get interger parameter value.
+  \param sect section name
+  \param name parameter name
+  \param iVal parameter to return resulting integer value
+  \return \c true if parameter is found and \c false if parameter is not found
+          (in this case \a iVal value is undefined)
 */
 bool QtxResourceMgr::value( const QString& sect, const QString& name, int& iVal ) const
 {
@@ -1008,11 +1286,12 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, int& iVal
 }
 
 /*!
-  \brief Get the resource value as double. Returns 'true' if it successfull otherwise
-         returns 'false'.
-  \param sect - Resource section name which contains resource.
-  \param name - Name of the resource.
-  \param dVal - Reference on the variable which should contains the resource output.
+  \brief Get double parameter value.
+  \param sect section name
+  \param name parameter name
+  \param dVal parameter to return resulting double value
+  \return \c true if parameter is found and \c false if parameter is not found
+          (in this case \a dVal value is undefined)
 */
 bool QtxResourceMgr::value( const QString& sect, const QString& name, double& dVal ) const
 {
@@ -1027,11 +1306,12 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, double& dV
 }
 
 /*!
-  \brief Get the resource value as boolean. Returns 'true' if it successfull otherwise
-         returns 'false'.
-  \param sect - Resource section name which contains resource.
-  \param name - Name of the resource.
-  \param bVal - Reference on the variable which should contains the resource output.
+  \brief Get boolean parameter value.
+  \param sect section name
+  \param name parameter name
+  \param bVal parameter to return resulting boolean value
+  \return \c true if parameter is found and \c false if parameter is not found
+          (in this case \a bVal value is undefined)
 */
 bool QtxResourceMgr::value( const QString& sect, const QString& name, bool& bVal ) const
 {
@@ -1046,7 +1326,7 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, bool& bVal
     boolMap["false"] = boolMap["no"]  = boolMap["off"] = false;
   }
 
-  val = val.lower();
+  val = val.toLower();
   bool res = boolMap.contains( val );
   if ( res )
     bVal = boolMap[val];
@@ -1061,11 +1341,12 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, bool& bVal
 }
 
 /*!
-  \brief Get the resource value as color. Returns 'true' if it successfull otherwise
-         returns 'false'.
-  \param sect - Resource section name which contains resource.
-  \param name - Name of the resource.
-  \param cVal - Reference on the variable which should contains the resource output.
+  \brief Get color parameter value.
+  \param sect section name
+  \param name parameter name
+  \param cVal parameter to return resulting color value
+  \return \c true if parameter is found and \c false if parameter is not found
+          (in this case \a cVal value is undefined)
 */
 bool QtxResourceMgr::value( const QString& sect, const QString& name, QColor& cVal ) const
 {
@@ -1073,31 +1354,16 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QColor& cV
   if ( !value( sect, name, val, true ) )
     return false;
 
-  bool res = true;
-  QStringList vals = QStringList::split( ",", val, true );
-
-  QIntList nums;
-  for ( QStringList::const_iterator it = vals.begin(); it != vals.end() && res; ++it )
-    nums.append( (*it).toInt( &res ) );
-
-  if ( res && nums.count() >= 3 )
-    cVal.setRgb( nums[0], nums[1], nums[2] );
-  else
-  {
-    int pack = val.toInt( &res );
-    if ( res )
-      Qtx::rgbSet( pack, cVal );
-  }
-
-  return res;
+  return Qtx::stringToColor( val, cVal );
 }
 
 /*!
-  \brief Get the resource value as font. Returns 'true' if it successfull otherwise
-         returns 'false'.
-  \param sect - Resource section name which contains resource.
-  \param name - Name of the resource.
-  \param fVal - Reference on the variable which should contains the resource output.
+  \brief Get font parameter value.
+  \param sect section name
+  \param name parameter name
+  \param fVal parameter to return resulting font value
+  \return \c true if parameter is found and \c false if parameter is not found
+          (in this case \a fVal value is undefined)
 */
 bool QtxResourceMgr::value( const QString& sect, const QString& name, QFont& fVal ) const
 {
@@ -1105,7 +1371,7 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QFont& fVa
   if ( !value( sect, name, val, true ) )
     return false;
 
-  QStringList fontDescr = QStringList::split( ",", val );
+  QStringList fontDescr = val.split( ",", QString::SkipEmptyParts );
 
   if ( fontDescr.count() < 2 )
     return false;
@@ -1118,13 +1384,15 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QFont& fVa
 
   for ( int i = 1; i < (int)fontDescr.count(); i++ )
   {
-    QString curval = fontDescr[i].stripWhiteSpace().lower();
+    QString curval = fontDescr[i].trimmed().toLower();
     if ( curval == QString( "bold" ) )
       fVal.setBold( true );
     else if ( curval == QString( "italic" ) )
       fVal.setItalic( true );
     else if ( curval == QString( "underline" ) )
       fVal.setUnderline( true );
+    else if ( curval == QString( "shadow" ) || curval == QString( "overline" ) )
+      fVal.setOverline( true );
     else
     {
       bool isOk = false;
@@ -1138,14 +1406,99 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QFont& fVa
 }
 
 /*!
-  \brief Get the resource value as string (native format). Returns 'true' if it
-         successfull otherwise returns 'false'.
-  \param sect  - Resource section name which contains resource.
-  \param name  - Name of the resource.
-  \param val   - Reference on the variable which should contains the resource output.
-  \param subst - If 'true' then manager substitute reference on environment variables
-                 and other resources by thier values. Default value of this parameter
-                 is 'true'
+  \brief Get byte array parameter value.
+  \param sect section name
+  \param name parameter name
+  \param baVal parameter to return resulting byte array value
+  \return \c true if parameter is found and \c false if parameter is not found
+          (in this case \a baVal value is undefined)
+*/
+bool QtxResourceMgr::value( const QString& sect, const QString& name, QByteArray& baVal ) const
+{
+  QString val;
+  if ( !value( sect, name, val, true ) )
+    return false;
+
+  baVal.clear();
+  QStringList lst = val.split( QRegExp( "[\\s|,]" ), QString::SkipEmptyParts );
+  for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    int base = 10;
+    QString str = *it;
+    if ( str.startsWith( "#" ) )
+    {
+      base = 16;
+      str = str.mid( 1 );
+    }
+    bool ok = false;
+    int num = str.toInt( &ok, base );
+    if ( !ok || num < 0 || num > 255 )
+      continue;
+
+    baVal.append( (char)num );
+  }
+  return !baVal.isEmpty();
+}
+
+/*!
+  \brief Get linear gradient parameter value.
+  \param sect section name
+  \param name parameter name
+  \param gVal parameter to return resulting linear gradient value value
+  \return \c true if parameter is found and \c false if parameter is not found
+          (in this case \a gVal value is undefined)
+*/
+bool QtxResourceMgr::value( const QString& sect, const QString& name, QLinearGradient& gVal ) const
+{
+  QString val;
+  if ( !value( sect, name, val, true ) )
+    return false;
+
+  return Qtx::stringToLinearGradient( val, gVal );
+}
+
+/*!
+  \brief Get radial gradient parameter value.
+  \param sect section name
+  \param name parameter name
+  \param gVal parameter to return resulting radial gradient value value
+  \return \c true if parameter is found and \c false if parameter is not found
+          (in this case \a gVal value is undefined)
+*/
+bool QtxResourceMgr::value( const QString& sect, const QString& name, QRadialGradient& gVal ) const
+{
+  QString val;
+  if ( !value( sect, name, val, true ) )
+    return false;
+
+  return Qtx::stringToRadialGradient( val, gVal );
+}
+
+/*!
+  \brief Get conical gradient parameter value.
+  \param sect section name
+  \param name parameter name
+  \param gVal parameter to return resulting conical gradient value value
+  \return \c true if parameter is found and \c false if parameter is not found
+          (in this case \a gVal value is undefined)
+*/
+bool QtxResourceMgr::value( const QString& sect, const QString& name, QConicalGradient& gVal ) const
+{
+  QString val;
+  if ( !value( sect, name, val, true ) )
+    return false;
+
+  return Qtx::stringToConicalGradient( val, gVal );
+}
+
+/*!
+  \brief Get string parameter value (native format).
+  \param sect section name
+  \param name parameter name
+  \param val parameter to return resulting byte array value
+  \param subst if \c true perform environment variables substitution
+  \return \c true if parameter is found and \c false if parameter is not found
+          (in this case \a val value is undefined)
 */
 bool QtxResourceMgr::value( const QString& sect, const QString& name, QString& val, const bool subst ) const
 {
@@ -1153,26 +1506,30 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QString& v
 
   bool ok = false;
  
-  ResListIterator it( myResources );
-  if ( ignoreUserValues() )
+  ResList::ConstIterator it = myResources.begin();
+  if ( myHasUserValues && workingMode() == IgnoreUserValues )
     ++it;
 
-  for ( ; it.current() && !ok; ++it )
+  for ( ; it != myResources.end() && !ok; ++it )
   {
-    ok = it.current()->hasValue( sect, name );
+    ok = (*it)->hasValue( sect, name );
     if ( ok )
-      val = it.current()->value( sect, name, subst );
+      val = (*it)->value( sect, name, subst );
   }
 
   return ok;
 }
 
 /*!
-  \brief Returns the integer resource value. If resource can not be found or converted
-         then specified default value will be returned.
-  \param sect  - Resource section name which contains resource.
-  \param name  - Name of the resource.
-  \param def   - Default resource value which will be used when resource not found.
+  \brief Get interger parameter value.
+
+  If the specified parameter is not found or can not be converted to the integer value,
+  the specified default value is returned instead.
+
+  \param sect section name
+  \param name parameter name
+  \param def default value
+  \return parameter value (or default value if parameter is not found)
 */
 int QtxResourceMgr::integerValue( const QString& sect, const QString& name, const int def ) const
 {
@@ -1183,11 +1540,15 @@ int QtxResourceMgr::integerValue( const QString& sect, const QString& name, cons
 }
 
 /*!
-  \brief Returns the double resource value. If resource can not be found or converted
-         then specified default value will be returned.
-  \param sect  - Resource section name which contains resource.
-  \param name  - Name of the resource.
-  \param def   - Default resource value which will be used when resource not found.
+  \brief Get double parameter value.
+
+  If the specified parameter is not found or can not be converted to the double value,
+  the specified default value is returned instead.
+
+  \param sect section name
+  \param name parameter name
+  \param def default value
+  \return parameter value (or default value if parameter is not found)
 */
 double QtxResourceMgr::doubleValue( const QString& sect, const QString& name, const double def ) const
 {
@@ -1198,11 +1559,15 @@ double QtxResourceMgr::doubleValue( const QString& sect, const QString& name, co
 }
 
 /*!
-  \brief Returns the boolean resource value. If resource can not be found or converted
-         then specified default value will be returned.
-  \param sect  - Resource section name which contains resource.
-  \param name  - Name of the resource.
-  \param def   - Default resource value which will be used when resource not found.
+  \brief Get boolean parameter value.
+
+  If the specified parameter is not found or can not be converted to the boolean value,
+  the specified default value is returned instead.
+
+  \param sect section name
+  \param name parameter name
+  \param def default value
+  \return parameter value (or default value if parameter is not found)
 */
 bool QtxResourceMgr::booleanValue( const QString& sect, const QString& name, const bool def ) const
 {
@@ -1213,11 +1578,15 @@ bool QtxResourceMgr::booleanValue( const QString& sect, const QString& name, con
 }
 
 /*!
-  \brief Returns the font resource value. If resource can not be found or converted
-         then specified default value will be returned.
-  \param sect  - Resource section name which contains resource.
-  \param name  - Name of the resource.
-  \param def   - Default resource value which will be used when resource not found.
+  \brief Get font parameter value.
+
+  If the specified parameter is not found or can not be converted to the font value,
+  the specified default value is returned instead.
+
+  \param sect section name
+  \param name parameter name
+  \param def default value
+  \return parameter value (or default value if parameter is not found)
 */
 QFont QtxResourceMgr::fontValue( const QString& sect, const QString& name, const QFont& def ) const
 {
@@ -1228,11 +1597,15 @@ QFont QtxResourceMgr::fontValue( const QString& sect, const QString& name, const
 }
 
 /*!
-  \brief Returns the color resource value. If resource can not be found or converted
-         then specified default value will be returned.
-  \param sect  - Resource section name which contains resource.
-  \param name  - Name of the resource.
-  \param def   - Default resource value which will be used when resource not found.
+  \brief Get color parameter value.
+
+  If the specified parameter is not found or can not be converted to the color value,
+  the specified default value is returned instead.
+
+  \param sect section name
+  \param name parameter name
+  \param def default value
+  \return parameter value (or default value if parameter is not found)
 */
 QColor QtxResourceMgr::colorValue( const QString& sect, const QString& name, const QColor& def ) const
 {
@@ -1243,11 +1616,14 @@ QColor QtxResourceMgr::colorValue( const QString& sect, const QString& name, con
 }
 
 /*!
-  \brief Returns the string resource value. If resource can not be found or converted
-         then specified default value will be returned.
-  \param sect  - Resource section name which contains resource.
-  \param name  - Name of the resource.
-  \param def   - Default resource value which will be used when resource not found.
+  \brief Get string parameter value.
+
+  If the specified parameter is not found, the specified default value is returned instead.
+
+  \param sect section name
+  \param name parameter name
+  \param def default value
+  \return parameter value (or default value if parameter is not found)
 */
 QString QtxResourceMgr::stringValue( const QString& sect, const QString& name, const QString& def ) const
 {
@@ -1258,41 +1634,125 @@ QString QtxResourceMgr::stringValue( const QString& sect, const QString& name, c
 }
 
 /*!
-  \brief Checks existance of the specified resource.
-  \param sect  - Resource section name which contains resource.
-  \param name  - Name of the resource.
+  \brief Get byte array parameter value.
+
+  If the specified parameter is not found, the specified default value is returned instead.
+
+  \param sect section name
+  \param name parameter name
+  \param def default value
+  \return parameter value (or default value if parameter is not found)
+*/
+QByteArray QtxResourceMgr::byteArrayValue( const QString& sect, const QString& name, const QByteArray& def ) const
+{
+  QByteArray val;
+  if ( !value( sect, name, val ) )
+    val = def;
+  return val;
+}
+
+/*!
+  \brief Get linear gradient parameter value.
+
+  If the specified parameter is not found, the specified default value is returned instead.
+
+  \param sect section name
+  \param name parameter name
+  \param def default value
+  \return parameter value (or default value if parameter is not found)
+*/
+QLinearGradient QtxResourceMgr::linearGradientValue( const QString& sect, const QString& name, const QLinearGradient& def ) const
+{
+  QLinearGradient val;
+  if ( !value( sect, name, val ) )
+    val = def;
+  return val;
+}
+
+/*!
+  \brief Get radial gradient parameter value.
+
+  If the specified parameter is not found, the specified default value is returned instead.
+
+  \param sect section name
+  \param name parameter name
+  \param def default value
+  \return parameter value (or default value if parameter is not found)
+*/
+QRadialGradient QtxResourceMgr::radialGradientValue( const QString& sect, const QString& name, const QRadialGradient& def ) const
+{
+  QRadialGradient val;
+  if ( !value( sect, name, val ) )
+    val = def;
+  return val;
+}
+
+/*!
+  \brief Get conical gradient parameter value.
+
+  If the specified parameter is not found, the specified default value is returned instead.
+
+  \param sect section name
+  \param name parameter name
+  \param def default value
+  \return parameter value (or default value if parameter is not found)
+*/
+QConicalGradient QtxResourceMgr::conicalGradientValue( const QString& sect, const QString& name, const QConicalGradient& def ) const
+{
+  QConicalGradient val;
+  if ( !value( sect, name, val ) )
+    val = def;
+  return val;
+}
+
+/*!
+  \brief Check parameter existence.
+  \param sect section name
+  \param name parameter name
+  \return \c true if parameter exists in specified section
 */
 bool QtxResourceMgr::hasValue( const QString& sect, const QString& name ) const
 {
   initialize();
 
   bool ok = false;
-  for ( ResListIterator it( myResources ); it.current() && !ok; ++it )
-    ok = it.current()->hasValue( sect, name );
+
+  ResList::ConstIterator it = myResources.begin();
+  if ( myHasUserValues && workingMode() == IgnoreUserValues )
+    ++it;
+
+  for ( ; it != myResources.end() && !ok; ++it )
+    ok = (*it)->hasValue( sect, name );
 
   return ok;
 }
 
 /*!
-  \brief Checks existance of the specified resource section.
-  \param sect  - Resource section name which contains resource.
+  \brief Check section existence.
+  \param sect section name
+  \return \c true if section exists
 */
 bool QtxResourceMgr::hasSection( const QString& sect ) const
 {
   initialize();
 
   bool ok = false;
-  for ( ResListIterator it( myResources ); it.current() && !ok; ++it )
-    ok = it.current()->hasSection( sect );
+
+  ResList::ConstIterator it = myResources.begin();
+  if ( myHasUserValues && workingMode() == IgnoreUserValues )
+    ++it;
+
+  for ( ; it != myResources.end() && !ok; ++it )
+    ok = (*it)->hasSection( sect );
 
   return ok;
 }
 
 /*!
-  \brief Sets the integer resource value.
-  \param sect  - Resource section name.
-  \param name  - Name of the resource.
-  \param val   - Resource value.
+  \brief Set integer parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
 */
 void QtxResourceMgr::setValue( const QString& sect, const QString& name, int val )
 {
@@ -1304,10 +1764,10 @@ void QtxResourceMgr::setValue( const QString& sect, const QString& name, int val
 }
 
 /*!
-  \brief Sets the double resource value.
-  \param sect  - Resource section name.
-  \param name  - Name of the resource.
-  \param val   - Resource value.
+  \brief Set double parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
 */
 void QtxResourceMgr::setValue( const QString& sect, const QString& name, double val )
 {
@@ -1319,10 +1779,10 @@ void QtxResourceMgr::setValue( const QString& sect, const QString& name, double
 }
 
 /*!
-  \brief Sets the boolean resource value.
-  \param sect  - Resource section name.
-  \param name  - Name of the resource.
-  \param val   - Resource value.
+  \brief Set boolean parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
 */
 void QtxResourceMgr::setValue( const QString& sect, const QString& name, bool val )
 {
@@ -1334,10 +1794,10 @@ void QtxResourceMgr::setValue( const QString& sect, const QString& name, bool va
 }
 
 /*!
-  \brief Sets the color resource value.
-  \param sect  - Resource section name.
-  \param name  - Name of the resource.
-  \param val   - Resource value.
+  \brief Set color parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
 */
 void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QColor& val )
 {
@@ -1345,14 +1805,14 @@ void QtxResourceMgr::setValue( const QString& sect, const QString& name, const Q
   if ( checkExisting() && value( sect, name, res ) && res == val )
     return;
 
-  setResource( sect, name, QString( "%1, %2, %3" ).arg( val.red() ).arg( val.green() ).arg( val.blue() ) );
+  setResource( sect, name, Qtx::colorToString( val ) );
 }
 
 /*!
-  \brief Sets the font resource value.
-  \param sect  - Resource section name.
-  \param name  - Name of the resource.
-  \param val   - Resource value.
+  \brief Set font parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
 */
 void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QFont& val )
 {
@@ -1368,16 +1828,18 @@ void QtxResourceMgr::setValue( const QString& sect, const QString& name, const Q
     fontDescr.append( "Italic" );
   if ( val.underline() )
     fontDescr.append( "Underline" );
+  if ( val.overline() )
+    fontDescr.append( "Overline" );
   fontDescr.append( QString( "%1" ).arg( val.pointSize() ) );
 
   setResource( sect, name, fontDescr.join( "," ) );
 }
 
 /*!
-  \brief Sets the string resource value.
-  \param sect  - Resource section name.
-  \param name  - Name of the resource.
-  \param val   - Resource value.
+  \brief Set string parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
 */
 void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QString& val )
 {
@@ -1389,44 +1851,112 @@ void QtxResourceMgr::setValue( const QString& sect, const QString& name, const Q
 }
 
 /*!
-  \brief Remove the all specified resource section.
-  \param sect  - Resource section name.
+  \brief Set byte array parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
+*/
+void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QByteArray& val )
+{
+  QByteArray res;
+  if ( checkExisting() && value( sect, name, res ) && res == val )
+    return;
+
+  char buf[8];
+  QStringList lst;
+  for ( int i = 0; i < val.size();  i++ )
+  {
+    ::sprintf( buf, "#%02X", (unsigned char)val.at( i ) );
+    lst.append( QString( buf ) );
+  }
+  setResource( sect, name, lst.join( " " ) );
+}
+
+/*!
+  \brief Set linear gradient parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
+*/
+void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QLinearGradient& val )
+{
+  QLinearGradient res;
+  if ( checkExisting() && value( sect, name, res ) && res == val )
+    return;
+
+  setResource( sect, name, Qtx::gradientToString( val ) );
+}
+
+/*!
+  \brief Set radial gradient parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
+*/
+void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QRadialGradient& val )
+{
+  QRadialGradient res;
+  if ( checkExisting() && value( sect, name, res ) && res == val )
+    return;
+
+  setResource( sect, name, Qtx::gradientToString( val ) );
+}
+
+/*!
+  \brief Set conical gradient parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
+*/
+void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QConicalGradient& val )
+{
+  QConicalGradient res;
+  if ( checkExisting() && value( sect, name, res ) && res == val )
+    return;
+
+  setResource( sect, name, Qtx::gradientToString( val ) );
+}
+
+/*!
+  \brief Remove resources section.
+  \param sect section name
 */
 void QtxResourceMgr::remove( const QString& sect )
 {
   initialize();
 
-  for ( ResListIterator it( myResources ); it.current(); ++it )
-    it.current()->removeSection( sect );
+  for ( ResList::Iterator it = myResources.begin(); it != myResources.end(); ++it )
+    (*it)->removeSection( sect );
 }
 
 /*!
-  \brief Remove the specified resource.
-  \param sect  - Resource section name.
-  \param name  - Name of the resource.
+  \brief Remove the specified parameter.
+  \param sect section name
+  \param name parameter name
 */
 void QtxResourceMgr::remove( const QString& sect, const QString& name )
 {
   initialize();
 
-  for ( ResListIterator it( myResources ); it.current(); ++it )
-    it.current()->removeValue( sect, name );
+  for ( ResList::Iterator it = myResources.begin(); it != myResources.end(); ++it )
+    (*it)->removeValue( sect, name );
 }
 
 /*!
-  \brief Returns the current format which operates with resource files.
+  \brief Get current configuration files format.
+  \return configuration files format name
 */
 QString QtxResourceMgr::currentFormat() const
 {
   QString fmt;
   if ( !myFormats.isEmpty() )
-    fmt = myFormats.getFirst()->format();
+    fmt = myFormats[0]->format();
   return fmt;
 }
 
 /*!
-  \brief Sets the current format which operates with resource files.
-  \param fmt - Resource format name.
+  \brief Set current configuration files format.
+  \param fmt configuration files format name
 */
 void QtxResourceMgr::setCurrentFormat( const QString& fmt )
 {
@@ -1434,41 +1964,46 @@ void QtxResourceMgr::setCurrentFormat( const QString& fmt )
   if ( !form )
     return;
 
-  myFormats.remove( form );
+  myFormats.removeAll( form );
   myFormats.prepend( form );
 
   if ( myResources.isEmpty() )
     return;
 
-  ResListIterator resIt( myResources );
-  if ( myResources.count() > myDirList.count() && resIt.current() ) {
-    resIt.current()->setFile( userFileName( appName() ) );
+  ResList::Iterator resIt = myResources.begin();
+  if ( myResources.count() > myDirList.count() && resIt != myResources.end() )
+  {
+    (*resIt)->setFile( userFileName( appName() ) );
     ++resIt;
   }
 
-  for ( QStringList::const_iterator it = myDirList.begin(); it != myDirList.end() && resIt.current(); ++it, ++resIt )
-    resIt.current()->setFile( Qtx::addSlash( *it ) + globalFileName( appName() ) );
+  for ( QStringList::ConstIterator it = myDirList.begin(); it != myDirList.end() && resIt != myResources.end(); ++it, ++resIt )
+    (*resIt)->setFile( Qtx::addSlash( *it ) + globalFileName( appName() ) );
 }
 
 /*!
-  \brief Returns the resource format object by it name.
-  \param fmt - Resource format name.
+  \brief Get configuration files format by specified format name.
+  \param fmt configuration files format name
+  \return format object or 0 if format is not defined
 */
 QtxResourceMgr::Format* QtxResourceMgr::format( const QString& fmt ) const
 {
   Format* form = 0;
-  for ( FormatListIterator it( myFormats ); it.current() && !form; ++it )
+  for ( FormatList::ConstIterator it = myFormats.begin(); it != myFormats.end() && !form; ++it )
   {
-    if ( it.current()->format() == fmt )
-      form = it.current();
+    if ( (*it)->format() == fmt )
+      form = *it;
   }
 
   return form;
 }
 
 /*!
-  \brief Add the resource format to the manager. Newly added become current.
-  \param form - Resource format object.
+  \brief Install configuration files format.
+  
+  Added format becomes current.
+
+  \param form format object to be installed
 */
 void QtxResourceMgr::installFormat( QtxResourceMgr::Format* form )
 {
@@ -1477,16 +2012,17 @@ void QtxResourceMgr::installFormat( QtxResourceMgr::Format* form )
 }
 
 /*!
-  \brief Remove the resource format from the manager.
-  \param form - Resource format object.
+  \brief Remove configuration files format.
+  \param form format object to be uninstalled
 */
 void QtxResourceMgr::removeFormat( QtxResourceMgr::Format* form )
 {
-  myFormats.remove( form );
+  myFormats.removeAll( form );
 }
 
 /*!
-  \brief Returns the string list of the resource format options names.
+  \brief Get resource format options names.
+  \return list of options names
 */
 QStringList QtxResourceMgr::options() const
 {
@@ -1494,9 +2030,13 @@ QStringList QtxResourceMgr::options() const
 }
 
 /*!
-  \brief Returns the string value for the specified option. If option doesn't exist
-         then empty string will be returned.
-  \param opt - Option name.
+  \brief Get the string value of the specified resources format option.
+
+  If option does not exist, null QString is returned.
+
+  \param opt option name
+  \return option value
+  \sa setOption(), options()
 */
 QString QtxResourceMgr::option( const QString& opt ) const
 {
@@ -1507,9 +2047,10 @@ QString QtxResourceMgr::option( const QString& opt ) const
 }
 
 /*!
-  \brief Sets the string value for the specified option.
-  \param opt - Option name.
-  \param val - Option value.
+  \brief Set the string value of the specified resources format option.
+  \param opt option name
+  \param val option value
+  \sa option(), options()
 */
 void QtxResourceMgr::setOption( const QString& opt, const QString& val )
 {
@@ -1517,7 +2058,9 @@ void QtxResourceMgr::setOption( const QString& opt, const QString& val )
 }
 
 /*!
-  \brief Load the all resources from the resource files.
+  \brief Load all resources from all resource files (global and user).
+  \return \c true on success and \c false on error
+  \sa save()
 */
 bool QtxResourceMgr::load()
 {
@@ -1528,14 +2071,16 @@ bool QtxResourceMgr::load()
     return false;
 
   bool res = true;
-  for ( ResListIterator it( myResources ); it.current(); ++it )
-    res = fmt->load( it.current() ) && res;
+  for ( ResList::Iterator it = myResources.begin(); it != myResources.end(); ++it )
+    res = fmt->load( *it ) && res;
 
   return res;
 }
 
 /*!
-  \brief Import some file with resources
+  \brief Import resources from specified resource file.
+  \param fname resources file name
+  \return \c true on success and \c false on error
 */
 bool QtxResourceMgr::import( const QString& fname )
 {
@@ -1543,8 +2088,11 @@ bool QtxResourceMgr::import( const QString& fname )
   if ( !fmt )
     return false;
 
-  Resources* r = myResources.getFirst();
-  if( !r )
+  if ( myResources.isEmpty() || !myHasUserValues )
+    return false;
+
+  Resources* r = myResources[0];
+  if ( !r )
     return false;
 
   QString old = r->file();
@@ -1555,7 +2103,8 @@ bool QtxResourceMgr::import( const QString& fname )
 }
 
 /*!
-  \brief Save the changed resources in to the user resource file.
+  \brief Save all resources to the user resource files.
+  \return \c true on success and \c false on error
 */
 bool QtxResourceMgr::save()
 {
@@ -1565,37 +2114,40 @@ bool QtxResourceMgr::save()
   if ( !fmt )
     return false;
 
-  if ( myResources.isEmpty() )
+  if ( myResources.isEmpty() || !myHasUserValues )
     return true;
 
-  return fmt->save( myResources.getFirst() );
+  return fmt->save( myResources[0] );
 }
 
 /*!
-  \brief Returns the string list of the existing section names..
+  \brief Get all sections names.
+  \return list of section names
 */
 QStringList QtxResourceMgr::sections() const
 {
   initialize();
 
   QMap<QString, int> map;
-  for ( ResListIterator it( myResources ); it.current(); ++it )
+
+  ResList::ConstIterator it = myResources.begin();
+  if ( myHasUserValues && workingMode() == IgnoreUserValues )
+    ++it;
+
+  for ( ; it != myResources.end(); ++it )
   {
-    QStringList lst = it.current()->sections();
-    for ( QStringList::const_iterator itr = lst.begin(); itr != lst.end(); ++itr )
+    QStringList lst = (*it)->sections();
+    for ( QStringList::ConstIterator itr = lst.begin(); itr != lst.end(); ++itr )
       map.insert( *itr, 0 );
   }
 
-  QStringList res;
-  for ( QMap<QString, int>::ConstIterator iter = map.begin(); iter != map.end(); ++iter )
-    res.append( iter.key() );
-
-  return res;
+  return map.keys();
 }
 
 /*!
-  \brief Returns the string list of the existing resource names in the specified section.
-  \param sec - Resource section name.
+  \brief Get all parameters name in specified section.
+  \param sec section name
+  \return list of settings names
 */
 QStringList QtxResourceMgr::parameters( const QString& sec ) const
 {
@@ -1607,38 +2159,62 @@ QStringList QtxResourceMgr::parameters( const QString& sec ) const
   typedef IMap<QString, int> PMap;
 #endif
   PMap pmap;
-  ResListIterator it( myResources );
-  it.toLast();
-  for ( ; it.current(); --it ) {
-    QStringList lst = it.current()->parameters( sec );
-    for ( QStringList::const_iterator itr = lst.begin(); itr != lst.end(); ++itr )
+  
+  Resources* ur = !myResources.isEmpty() && workingMode() == IgnoreUserValues ? myResources[0] : 0;
+  
+  QListIterator<Resources*> it( myResources );
+  it.toBack();
+  while ( it.hasPrevious() )
+  {
+    Resources* r = it.previous();
+    if ( r == ur ) break;
+    QStringList lst = r->parameters( sec );
+    for ( QStringList::ConstIterator itr = lst.begin(); itr != lst.end(); ++itr )
+#if defined(QTX_NO_INDEXED_MAP)
+      if ( !pmap.contains( *itr ) ) pmap.insert( *itr, 0 );
+#else
       pmap.insert( *itr, 0, false );
+#endif
   }
 
-  QStringList res;
-  for ( PMap::ConstIterator iter = pmap.begin(); iter != pmap.end(); ++iter )
-    res.append( iter.key() );
-
-  return res;
+  return pmap.keys();
 }
 
 /*!
-  \return path of file from directory built by parameter
-  \return QString::null if built path doesn't exist
-  \param sec - name of section
-  \param prefix - name of parameter containing some path
-  \param name - name of file
+  \brief Get absolute path to the file which name is defined by the parameter.
+
+  The file name is defined by \a name argument, while directory name is retrieved
+  from resources parameter \a prefix of section \a sec. Both directory and file name
+  can be relative. If the directory is relative, it is calculated from the initial
+  resources file name. Directory parameter can contain environment 
+  variables, which are substituted automatically.
+
+  \param sec section name
+  \param prefix parameter containing directory name
+  \param name file name
+  \return absolute file path or null QString if file does not exist
 */
 QString QtxResourceMgr::path( const QString& sect, const QString& prefix, const QString& name ) const
 {
   QString res;
-  for ( ResListIterator it( myResources ); it.current() && res.isEmpty(); ++it )
-    res = it.current()->path( sect, prefix, name );
+
+  ResList::ConstIterator it = myResources.begin();
+  if ( myHasUserValues && workingMode() == IgnoreUserValues )
+    ++it;
+
+  for ( ; it != myResources.end() && res.isEmpty(); ++it )
+    res = (*it)->path( sect, prefix, name );
   return res;
 }
 
 /*!
-  \return section corresponding to resources paths
+  \brief Get application resources section name.
+
+  By default, application resources section name is "resources" but
+  it can be changed by setting the corresponding resources manager option.
+  
+  \return section corresponding to the resources directories
+  \sa option(), setOption()
 */
 QString QtxResourceMgr::resSection() const
 {
@@ -1649,7 +2225,13 @@ QString QtxResourceMgr::resSection() const
 }
 
 /*!
-  \return section corresponding to language settings
+  \brief Get application language section name.
+
+  By default, application language section name is "language" but
+  it can be changed by setting the corresponding resources manager option.
+  
+  \return section corresponding to the application language settings
+  \sa option(), setOption()
 */
 QString QtxResourceMgr::langSection() const
 {
@@ -1660,26 +2242,44 @@ QString QtxResourceMgr::langSection() const
 }
 
 /*!
-  \return default image used when during loading the image file doesn't exist
+  \brief Get default pixmap.
+  
+  Default pixmap is used when requested pixmap resource is not found.
+
+  \return default pixmap
+  \sa setDefaultPixmap(), loadPixmap()
 */
 QPixmap QtxResourceMgr::defaultPixmap() const
 {
-  return myDefaultPix;
+  QPixmap res;
+  if ( myDefaultPix && !myDefaultPix->isNull() )
+    res = *myDefaultPix;
+  return res;
 }
 
 /*!
-  Set image as default image used when during loading the image file doesn't exist
-  \param pix - image
+  \brief Set default pixmap.
+  
+  Default pixmap is used when requested pixmap resource is not found.
+
+  \param pix default pixmap
+  \sa defaultPixmap(), loadPixmap()
 */
 void QtxResourceMgr::setDefaultPixmap( const QPixmap& pix )
 {
-  myDefaultPix = pix;
+  delete myDefaultPix;
+  if ( pix.isNull() )
+    myDefaultPix = 0;
+  else
+    myDefaultPix = new QPixmap( pix );
 }
 
 /*!
-  \return image loaded from file 
-  \param prefix - name of parameter containing some path
-  \param name - name of file
+  \brief Load pixmap resource.
+  \param prefix parameter which refers to the resources directory (directories)
+  \param name pixmap file name
+  \return pixmap loaded from the file 
+  \sa defaultPixmap(), setDefaultPixmap()
 */
 QPixmap QtxResourceMgr::loadPixmap( const QString& prefix, const QString& name ) const
 {
@@ -1687,12 +2287,14 @@ QPixmap QtxResourceMgr::loadPixmap( const QString& prefix, const QString& name )
 }
 
 /*!
-  \return image loaded from file 
-  \param prefix - name of parameter containing some path
-  \param name - name of file
-  \param useDef - indicates if it is possible to use default image returning by defaultPixmap() method.
-  If it is false, the empty pixmap will be used as default
-  \sa defaultPixmap()
+  \brief Load pixmap resource.
+  \overload
+  \param prefix parameter which refers to the resources directory (directories)
+  \param name pixmap file name
+  \param useDef if \c false, default pixmap is not returned if resource is not found,
+         in this case null pixmap is returned instead
+  \return pixmap loaded from the file 
+  \sa defaultPixmap(), setDefaultPixmap()
 */
 QPixmap QtxResourceMgr::loadPixmap( const QString& prefix, const QString& name, const bool useDef ) const
 {
@@ -1700,45 +2302,57 @@ QPixmap QtxResourceMgr::loadPixmap( const QString& prefix, const QString& name,
 }
 
 /*!
-  Finds in all sections an existing path corresponding to 'prefix' parameter
-  and load image with name 'name' from this folder
-
-  \return image loaded from file 
-  \param prefix - name of parameter containing some path
-  \param name - name of file
-  \param defPix - default image used when file doesn't exist
+  \brief Load pixmap resource.
+  \overload
+  \param prefix parameter which refers to the resources directory (directories)
+  \param name pixmap file name
+  \param defPix default which should be used if the resource file doesn't exist
+  \return pixmap loaded from the file 
+  \sa defaultPixmap(), setDefaultPixmap()
 */
 QPixmap QtxResourceMgr::loadPixmap( const QString& prefix, const QString& name, const QPixmap& defPix ) const
 {
   initialize();
 
   QPixmap pix;
-  for ( ResListIterator it( myResources ); it.current() && pix.isNull(); ++it )
-    pix = it.current()->loadPixmap( resSection(), prefix, name );
+
+  ResList::ConstIterator it = myResources.begin();
+  if ( myHasUserValues && workingMode() == IgnoreUserValues )
+    ++it;
+
+  for ( ; it != myResources.end() && pix.isNull(); ++it )
+    pix = (*it)->loadPixmap( resSection(), prefix, name );
   if ( pix.isNull() )
     pix = defPix;
   return pix;
 }
 
 /*!
-  Loads translator for language
-  Name of translator file is constructed by list returning by option "translators" or,
-  if it is empty, by predefined pattern "%P_msg_%L.qm". It is recommended to used in translators
-  name the strings %A, %P, %L whose will be replaced by application name, prefix and language name correspondingly
+  \brief Load translation files according to the specified language.
+
+  Names of the translation files are calculated according to the pattern specified
+  by the "translators" option (this option is read from the section "language" of resources files).
+  By default, "%P_msg_%L.qm" pattern is used.
+  Keywords \%A, \%P, \%L in the pattern are substituted by the application name, prefix and language name
+  correspondingly.
+  For example, for prefix "SUIT" and language "en", all translation files "SUIT_msg_en.qm" are searched and
+  loaded.
 
-  \param pref - name of parameter containing path to translator's file.
-  If it is empty, the list of parameters from resource section ( resSection() )
-  is used.
+  If prefix is empty or null string, all translation files specified in the "resources" section of resources
+  files are loaded (actually, the section is retrieved from resSection() method). 
+  If language is not specified, it is retrieved from the langSection() method, and if the latest is also empty,
+  by default "en" (English) language is used.
+  By default, settings from the user preferences file are also loaded (if user resource file is valid, 
+  see userFileName()). To avoid loading user settings, pass \c false as first parameter.
 
-  \param l - name of language. If it is empty, then value of parameter "language"
-  from language section ( langSection() ) is used. If it is also empty, then
-  predefined name "en" is used
+  \param pref parameter which defines translation context (for example, package name)
+  \param l language name
 
-  \sa resSection(), langSection()
+  \sa resSection(), langSection(), loadTranslators()
 */
 void QtxResourceMgr::loadLanguage( const QString& pref, const QString& l )
 {
-  initialize();
+  initialize( true );
 
   QMap<QChar, QString> substMap;
   substMap.insert( 'A', appName() );
@@ -1750,7 +2364,7 @@ void QtxResourceMgr::loadLanguage( const QString& pref, const QString& l )
   if ( lang.isEmpty() )
   {
     lang = QString( "en" );
-    qWarning( QString( "Language not specified. Assumed: %1" ).arg( lang ) );
+    qWarning( "Language not specified. Assumed: %s", (const char*)lang.toLatin1() );
   }
 
   substMap.insert( 'L', lang );
@@ -1758,19 +2372,21 @@ void QtxResourceMgr::loadLanguage( const QString& pref, const QString& l )
   QString trs;
   if ( value( langSection(), "translators", trs, false ) && !trs.isEmpty() )
   {
-    QStringList translators    = QStringList::split( "|", option( "translators" ) );
-    QStringList newTranslators = QStringList::split( "|", trs );
-    for ( uint i = 0; i < newTranslators.count(); i++ )
-      if ( translators.find( newTranslators[i] ) == translators.end() )
+    QStringList translators    = option( "translators" ).split( "|", QString::SkipEmptyParts );
+    QStringList newTranslators = trs.split( "|", QString::SkipEmptyParts );
+    for ( int i = 0; i < (int)newTranslators.count(); i++ )
+    {
+      if ( translators.indexOf( newTranslators[i] ) < 0 )
         translators += newTranslators[i];
+    }
     setOption( "translators", translators.join( "|" ) );
   }
 
-  QStringList trList = QStringList::split( "|", option( "translators" ) );
+  QStringList trList = option( "translators" ).split( "|", QString::SkipEmptyParts );
   if ( trList.isEmpty() )
   {
     trList.append( "%P_msg_%L.qm" );
-    qWarning( QString( "Translators not defined. Assumed: %1" ).arg( trList.first() ) );
+    qWarning( "Translators not defined. Assumed: %s", (const char*)trList[0].toLatin1() );
   }
 
   QStringList prefixList;
@@ -1779,158 +2395,188 @@ void QtxResourceMgr::loadLanguage( const QString& pref, const QString& l )
   else
     prefixList = parameters( resSection() );
 
-  for ( QStringList::const_iterator iter = prefixList.begin(); iter != prefixList.end(); ++iter )
+  for ( QStringList::ConstIterator iter = prefixList.begin(); iter != prefixList.end(); ++iter )
   {
     QString prefix = *iter;
     substMap.insert( 'P', prefix );
 
     QStringList trs;
-    for ( QStringList::const_iterator it = trList.begin(); it != trList.end(); ++it )
-      trs.append( substMacro( *it, substMap ).stripWhiteSpace() );
+    for ( QStringList::ConstIterator it = trList.begin(); it != trList.end(); ++it )
+      trs.append( substMacro( *it, substMap ).trimmed() );
 
     loadTranslators( prefix, trs );
   }
 }
 
 /*!
-  Loads translators by path and list of files
-
-  \param prefix - value of this parameter must contain path
-  \param translators - list of translators' files 
+  \brief Load translation files for the specified translation context.
+  \param prefix parameter which defines translation context (for example, package name)
+  \param translators list of translation files 
+  \sa loadLanguage()
 */
 void QtxResourceMgr::loadTranslators( const QString& prefix, const QStringList& translators )
 {
   initialize();
 
+  ResList lst;
+
+  ResList::ConstIterator iter = myResources.begin();
+  if ( myHasUserValues && workingMode() == IgnoreUserValues )
+    ++iter;
+
+  for ( ; iter != myResources.end(); ++iter )
+    lst.prepend( *iter );
+
   QTranslator* trans = 0;
-  ResListIterator it( myResources );
-  it.toLast();
-  for ( ; it.current(); --it )
+  
+  for ( ResList::Iterator it = lst.begin(); it != lst.end(); ++it )
   {
-    for ( QStringList::const_iterator itr = translators.begin(); itr != translators.end(); ++itr )
+    for ( QStringList::ConstIterator itr = translators.begin(); itr != translators.end(); ++itr )
     {
-      trans = it.current()->loadTranslator( resSection(), prefix, *itr );
+      trans = (*it)->loadTranslator( resSection(), prefix, *itr );
       if ( trans )
       {
         if ( !myTranslator[prefix].contains( trans ) )
           myTranslator[prefix].append( trans );
-        qApp->installTranslator( trans );
+        QApplication::instance()->installTranslator( trans );
       }
     }
   }
 }
 
 /*!
-  Loads translator by path and file name
-
-  \param prefix - value of this parameter must contain path
-  \param name - name of translator file
+  \brief Load translation file.
+  \param prefix parameter which defines translation context (for example, package name)
+  \param name translator file name
+  \sa loadLanguage(), loadTranslators()
 */
 void QtxResourceMgr::loadTranslator( const QString& prefix, const QString& name )
 {
   initialize();
 
   QTranslator* trans = 0;
-  ResListIterator it( myResources );
-  it.toLast();
-  for ( ; it.current(); --it )
+
+  Resources* ur = !myResources.isEmpty() && workingMode() == IgnoreUserValues ? myResources[0] : 0;
+  
+  QListIterator<Resources*> it( myResources );
+  it.toBack();
+  while ( it.hasPrevious() )
   {
-    trans = it.current()->loadTranslator( resSection(), prefix, name );
+    Resources* r = it.previous();
+    if ( r == ur ) break;
+
+    trans = r->loadTranslator( resSection(), prefix, name );
     if ( trans )
     {
       if ( !myTranslator[prefix].contains( trans ) )
         myTranslator[prefix].append( trans );
-      qApp->installTranslator( trans );
+      QApplication::instance()->installTranslator( trans );
     }
   }
 }
 
 /*!
-  Remove all translators corresponding to prefix
-
-  \param prefix - parameter containing path
+  \brief Remove all translators corresponding to the specified translation context.
+  \param prefix parameter which defines translation context (for example, package name)
 */
 void QtxResourceMgr::removeTranslators( const QString& prefix )
 {
   if ( !myTranslator.contains( prefix ) )
     return;
 
-  for ( TransListIterator it( myTranslator[prefix] ); it.current(); ++it )
+  for ( TransList::Iterator it = myTranslator[prefix].begin(); it != myTranslator[prefix].end(); ++it )
   {
-    qApp->removeTranslator( it.current() );
-    delete it.current();
+    QApplication::instance()->removeTranslator( *it );
+    delete *it;
   }
 
   myTranslator.remove( prefix );
 }
 
 /*!
-  Moves translators corresponding to prefix to the top of translator stack 
-
-  \param prefix - parameter containing path
+  \brief Move all translators corresponding to the specified translation context 
+         to the top of translators stack (increase their priority).
+  \param prefix parameter which defines translation context (for example, package name)
 */
 void QtxResourceMgr::raiseTranslators( const QString& prefix )
 {
   if ( !myTranslator.contains( prefix ) )
     return;
 
-  for ( TransListIterator it( myTranslator[prefix] ); it.current(); ++it )
+  for ( TransList::Iterator it = myTranslator[prefix].begin(); it != myTranslator[prefix].end(); ++it )
   {
-    qApp->removeTranslator( it.current() );
-    qApp->installTranslator( it.current() );
+    QApplication::instance()->removeTranslator( *it );
+    QApplication::instance()->installTranslator( *it );
   }
 }
 
 /*!
-  Copies all resources to user resources, so that they will be saved in user home folder
+  \brief Copy all parameters to the user resources in order to
+         saved them lately in the user home folder.
 */
 void QtxResourceMgr::refresh()
 {
   QStringList sl = sections();
-  for ( QStringList::const_iterator it = sl.begin(); it != sl.end(); ++it )
+  for ( QStringList::ConstIterator it = sl.begin(); it != sl.end(); ++it )
   {
     QStringList pl = parameters( *it );
-    for ( QStringList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
+    for ( QStringList::ConstIterator itr = pl.begin(); itr != pl.end(); ++itr )
       setResource( *it, *itr, stringValue( *it, *itr ) );
   }
 }
 
 /*!
-  \brief Sets the resource directories list except user home directory and clear resources
+  \brief Set the resource directories (where global confguration files are searched).
+  
+  This function also clears all currently set resources.
+
+  \param dl directories list
 */
 void QtxResourceMgr::setDirList( const QStringList& dl )
 {
   myDirList = dl;
-  for ( ResListIterator it( myResources ); it.current(); ++it )
-    delete it.current();
+  for ( ResList::Iterator it = myResources.begin(); it != myResources.end(); ++it )
+    delete *it;
 
   myResources.clear();
 }
 
 /*!
-  Sets resource value
-  \param sect - name of section
-  \param name - name of parameter
-  \param val - string representation of value
+  \brief Set parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
 */
 void QtxResourceMgr::setResource( const QString& sect, const QString& name, const QString& val )
 {
   initialize();
 
-  if ( !myResources.isEmpty() )
+  if ( !myResources.isEmpty() && myHasUserValues )
     myResources.first()->setValue( sect, name, val );
 }
 
 /*!
-  \return name of resource file, which is being found in user home directory
-  \param appName - name of application
-  \param for_load - flag indicating that file will be used for loading (true) or for saving(false)
-  It makes possible to use different resource files for loading and saving
+  \brief Get user configuration file name.
+
+  This method can be redefined in the successor class to customize the user configuration file name.
+  User configuration file is always situated in the user's home directory. By default .<appName>rc
+  file is used on Linux (e.g. .MyApprc) and <appName>.<format> under Windows (e.g. MyApp.xml).
+
+  Parameter \a for_load (not used in default implementation) specifies the usage mode, i.e. if
+  user configuration file is opened for reading or writing. This allows customizing a way of application
+  resources initializing (for example, if the user configuraion file includes version number and there is
+  no file corresponding to this version in the user's home directory, it could be good idea to try 
+  the configuration file from the previous versions of the application).
+  
+  \param appName application name
+  \param for_load boolean flag indicating that file is opened for loading or saving (not used) 
+  \return user configuration file name
+  \sa globalFileName()
 */
 QString QtxResourceMgr::userFileName( const QString& appName, const bool /*for_load*/ ) const
 {
   QString fileName;
-  QString pathName = QDir::homeDirPath();
+  QString pathName = QDir::homePath();
 
 #ifdef WIN32
   fileName = QString( "%1.%2" ).arg( appName ).arg( currentFormat() );
@@ -1945,7 +2591,16 @@ QString QtxResourceMgr::userFileName( const QString& appName, const bool /*for_l
 }
 
 /*!
-  \return name of resource file, which is being found in all resource directories, except user home
+  \brief Get global configuration file name.
+  
+  This method can be redefined in the successor class to customize the global configuration file name.
+  Global configuration files are searched in the directories specified by the application resources
+  environment variable (e.g. MyAppResources). By default <appName>.<format> file name is used
+  (e.g. MyApp.xml).
+
+  \param appName application name
+  \return global configuration file name
+  \sa userFileName()
 */
 QString QtxResourceMgr::globalFileName( const QString& appName ) const
 {
@@ -1953,10 +2608,13 @@ QString QtxResourceMgr::globalFileName( const QString& appName ) const
 }
 
 /*!
-  Replaced substrings by pattern %A, %B, etc by values from map
+  \brief Perform substitution of the patterns like \%A, \%B, etc by values from the map.
+
+  Used by loadLanguage().
 
-  \param src - string to be processed
-  \param substMap - map of values for replacing
+  \param src sring to be processed
+  \param substMap map of values for replacing
+  \return processed string
 */
 QString QtxResourceMgr::substMacro( const QString& src, const QMap<QChar, QString>& substMap ) const
 {
@@ -1965,7 +2623,7 @@ QString QtxResourceMgr::substMacro( const QString& src, const QMap<QChar, QStrin
   QRegExp rx( "%[A-Za-z%]" );
 
   int idx = 0;
-  while ( ( idx = rx.search( trg, idx ) ) >= 0 )
+  while ( ( idx = rx.indexIn( trg, idx ) ) >= 0 )
   {
     QChar spec = trg.at( idx + 1 );
     QString subst;
index ff72dd3c2ba1a3a4dd0763f748566a3bd1e24342..626abe1f10c8da07901c8525f5a97f950433b981 100644 (file)
@@ -1,44 +1,53 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#ifndef QTX_RESOURCEMGR_H
-#define QTX_RESOURCEMGR_H
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxResourceMgr.h
+// Author:    Alexander SOLOVYOV, Sergey TELKOV
+//
+#ifndef QTXRESOURCEMGR_H
+#define QTXRESOURCEMGR_H
 
 #include "Qtx.h"
 
-#include <qmap.h>
-#include <qcolor.h>
-#include <qfont.h>
-#include <qpixmap.h>
-#include <qstringlist.h>
-#include <qtranslator.h>
-#include <qvaluelist.h>
+#ifndef QTX_NO_INDEXED_MAP
+#include "QtxMap.h"
+#endif
+
+#include <QMap>
+#include <QList>
+#include <QFont>
+#include <QColor>
+#include <QPixmap>
+#include <QByteArray>
+#include <QStringList>
+#include <QLinearGradient>
+#include <QRadialGradient>
+#include <QConicalGradient>
 
-class QPixmap;
+class QTranslator;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
-/*!
-  Class: QtxResourceMgr
-*/
-
 class QTX_EXPORT QtxResourceMgr
 {
   class IniFormat;
@@ -48,141 +57,148 @@ class QTX_EXPORT QtxResourceMgr
 public:
   class Format;
 
-  template <class Key, class Value> class IMap;
-  template <class Key, class Value> class IMapIterator;
-  template <class Key, class Value> class IMapConstIterator;
-
 #ifdef QTX_NO_INDEXED_MAP
-  typedef QMap<QString, QString> Section;
+  typedef QMap<QString, QString> Section;   //!< resource section
 #else
-  typedef IMap<QString, QString> Section;
+  typedef IMap<QString, QString> Section;   //!< resource section
 #endif
 
+  //! Working mode; defines a way how resource manager handles user preferences
+  typedef enum {
+    AllowUserValues,       //!< User values are processed by the resource manager
+    IgnoreUserValues       //!< User values are ignored by the resource manager
+  } WorkingMode;
+
 public:
-  QtxResourceMgr( const QString&, const QString& = QString::null );
+  QtxResourceMgr( const QString&, const QString& = QString() );
   virtual ~QtxResourceMgr();
 
-  QString         appName() const;
-  QStringList     dirList() const;
-
-  bool            checkExisting() const;
-  virtual void    setCheckExisting( const bool );
-
-  bool            isPixmapCached() const;
-  void            setIsPixmapCached( const bool );
-
-  void            clear();
-
-  void            setIgnoreUserValues( const bool = true );
-  bool            ignoreUserValues() const;
-
-  bool            value( const QString&, const QString&, int& ) const;
-  bool            value( const QString&, const QString&, double& ) const;
-  bool            value( const QString&, const QString&, bool& ) const;
-  bool            value( const QString&, const QString&, QColor& ) const;
-  bool            value( const QString&, const QString&, QFont& ) const;  
-  bool            value( const QString&, const QString&, QString&, const bool = true ) const;
-
-  int             integerValue( const QString&, const QString&, const int = 0 ) const;
-  double          doubleValue( const QString&, const QString&, const double = 0 ) const;
-  bool            booleanValue( const QString&, const QString&, const bool = false ) const;
-  QFont           fontValue( const QString&, const QString&, const QFont& = QFont() ) const;
-  QColor          colorValue( const QString&, const QString&, const QColor& = QColor() ) const;
-  QString         stringValue( const QString&, const QString&, const QString& = QString::null ) const;
-
-  bool            hasSection( const QString& ) const;
-  bool            hasValue( const QString&, const QString& ) const;
-
-  void            setValue( const QString&, const QString&, const int );
-  void            setValue( const QString&, const QString&, const double );
-  void            setValue( const QString&, const QString&, const bool );
-  void            setValue( const QString&, const QString&, const QFont& );
-  void            setValue( const QString&, const QString&, const QColor& );
-  void            setValue( const QString&, const QString&, const QString& );
-
-  void            remove( const QString& );
-  void            remove( const QString&, const QString& );
-
-  QString         currentFormat() const;
-  void            setCurrentFormat( const QString& );
-
-  Format*         format( const QString& ) const;
-  void            installFormat( Format* );
-  void            removeFormat( Format* );
-
-  QStringList     options() const;
-  QString         option( const QString& ) const;
-  void            setOption( const QString&, const QString& );
-
-  QPixmap         defaultPixmap() const;
-  virtual void    setDefaultPixmap( const QPixmap& );
-
-  QString         resSection() const;
-  QString         langSection() const;
-
-  QPixmap         loadPixmap( const QString&, const QString& ) const;
-  QPixmap         loadPixmap( const QString&, const QString&, const bool ) const;
-  QPixmap         loadPixmap( const QString&, const QString&, const QPixmap& ) const;
-  void            loadLanguage( const QString& = QString::null, const QString& = QString::null );
-
-  void            raiseTranslators( const QString& );
-  void            removeTranslators( const QString& );
-  void            loadTranslator( const QString&, const QString& );
-  void            loadTranslators( const QString&, const QStringList& );
-
-  QString         path( const QString&, const QString&, const QString& ) const;
-
-  bool            load();
-  bool            import( const QString& );
-  bool            save();
-
-  QStringList     sections() const;
-  QStringList     parameters( const QString& ) const;
-
-  void            refresh();
+  QString          appName() const;
+  QStringList      dirList() const;
+
+  bool             checkExisting() const;
+  virtual void     setCheckExisting( const bool );
+
+  bool             isPixmapCached() const;
+  void             setIsPixmapCached( const bool );
+
+  void             clear();
+
+  WorkingMode      workingMode() const;
+  void             setWorkingMode( WorkingMode );
+
+  bool             value( const QString&, const QString&, int& ) const;
+  bool             value( const QString&, const QString&, double& ) const;
+  bool             value( const QString&, const QString&, bool& ) const;
+  bool             value( const QString&, const QString&, QColor& ) const;
+  bool             value( const QString&, const QString&, QFont& ) const;  
+  bool             value( const QString&, const QString&, QByteArray& ) const;  
+  bool             value( const QString&, const QString&, QLinearGradient& ) const;  
+  bool             value( const QString&, const QString&, QRadialGradient& ) const;  
+  bool             value( const QString&, const QString&, QConicalGradient& ) const;  
+  bool             value( const QString&, const QString&, QString&, const bool = true ) const;
+
+  int              integerValue( const QString&, const QString&, const int = 0 ) const;
+  double           doubleValue( const QString&, const QString&, const double = 0 ) const;
+  bool             booleanValue( const QString&, const QString&, const bool = false ) const;
+  QFont            fontValue( const QString&, const QString&, const QFont& = QFont() ) const;
+  QColor           colorValue( const QString&, const QString&, const QColor& = QColor() ) const;
+  QString          stringValue( const QString&, const QString&, const QString& = QString() ) const;
+  QByteArray       byteArrayValue( const QString&, const QString&, const QByteArray& = QByteArray() ) const;
+  QLinearGradient  linearGradientValue( const QString&, const QString&, const QLinearGradient& = QLinearGradient() ) const;
+  QRadialGradient  radialGradientValue( const QString&, const QString&, const QRadialGradient& = QRadialGradient() ) const;
+  QConicalGradient conicalGradientValue( const QString&, const QString&, const QConicalGradient& = QConicalGradient() ) const;
+
+  bool             hasSection( const QString& ) const;
+  bool             hasValue( const QString&, const QString& ) const;
+
+  void             setValue( const QString&, const QString&, const int );
+  void             setValue( const QString&, const QString&, const double );
+  void             setValue( const QString&, const QString&, const bool );
+  void             setValue( const QString&, const QString&, const QFont& );
+  void             setValue( const QString&, const QString&, const QColor& );
+  void             setValue( const QString&, const QString&, const QString& );
+  void             setValue( const QString&, const QString&, const QByteArray& );
+  void             setValue( const QString&, const QString&, const QLinearGradient& );
+  void             setValue( const QString&, const QString&, const QRadialGradient& );
+  void             setValue( const QString&, const QString&, const QConicalGradient& );
+
+  void             remove( const QString& );
+  void             remove( const QString&, const QString& );
+
+  QString          currentFormat() const;
+  void             setCurrentFormat( const QString& );
+
+  Format*          format( const QString& ) const;
+  void             installFormat( Format* );
+  void             removeFormat( Format* );
+
+  QStringList      options() const;
+  QString          option( const QString& ) const;
+  void             setOption( const QString&, const QString& );
+
+  QPixmap          defaultPixmap() const;
+  virtual void     setDefaultPixmap( const QPixmap& );
+
+  QString          resSection() const;
+  QString          langSection() const;
+
+  QPixmap          loadPixmap( const QString&, const QString& ) const;
+  QPixmap          loadPixmap( const QString&, const QString&, const bool ) const;
+  QPixmap          loadPixmap( const QString&, const QString&, const QPixmap& ) const;
+  void             loadLanguage( const QString& = QString(), const QString& = QString() );
+
+  void             raiseTranslators( const QString& );
+  void             removeTranslators( const QString& );
+  void             loadTranslator( const QString&, const QString& );
+  void             loadTranslators( const QString&, const QStringList& );
+
+  QString          path( const QString&, const QString&, const QString& ) const;
+
+  bool             load();
+  bool             import( const QString& );
+  bool             save();
+
+  QStringList      sections() const;
+  QStringList      parameters( const QString& ) const;
+
+  void             refresh();
 
 protected:
-  virtual void    setDirList( const QStringList& );
-  virtual void    setResource( const QString&, const QString&, const QString& );
+  virtual void     setDirList( const QStringList& );
+  virtual void     setResource( const QString&, const QString&, const QString& );
 
-  virtual QString userFileName( const QString&, const bool = true ) const;
-  virtual QString globalFileName( const QString& ) const;
+  virtual QString  userFileName( const QString&, const bool = true ) const;
+  virtual QString  globalFileName( const QString& ) const;
 
 private:
-  void            initialize( const bool = true ) const;
-  QString         substMacro( const QString&, const QMap<QChar, QString>& ) const;
+  void             initialize( const bool = true ) const;
+  QString          substMacro( const QString&, const QMap<QChar, QString>& ) const;
 
 private:
-  typedef QPtrList<Resources>           ResList;
-  typedef QPtrList<Format>              FormatList;
-  typedef QMap<QString, QString>        OptionsMap;
-  typedef QPtrListIterator<Resources>   ResListIterator;
-  typedef QPtrListIterator<Format>      FormatListIterator;
-
-  typedef QPtrList<QTranslator>         TransList;
-  typedef QMap<QString, TransList>      TransListMap;
-  typedef QPtrListIterator<QTranslator> TransListIterator;
+  typedef QList<Resources*>        ResList;
+  typedef QList<QTranslator*>      TransList;
+  typedef QList<Format*>           FormatList;
+  typedef QMap<QString, QString>   OptionsMap;
+  typedef QMap<QString, TransList> TransListMap;
 
 private:
-  QString         myAppName;
-  QStringList     myDirList;
-  FormatList      myFormats;
-  OptionsMap      myOptions;
-  ResList         myResources;
-  bool            myCheckExist;
-  TransListMap    myTranslator;
-  QPixmap         myDefaultPix;
-  bool            myIsPixmapCached;
-
-  bool            myIsIgnoreUserValues;
+  QString          myAppName;                 //!< application name
+  QStringList      myDirList;                 //!< list of resources directories
+  FormatList       myFormats;                 //!< list of formats
+  OptionsMap       myOptions;                 //!< options map
+  ResList          myResources;               //!< resources list
+  bool             myCheckExist;              //!< "check existance" flag
+  TransListMap     myTranslator;              //!< map of loaded translators
+  QPixmap*         myDefaultPix;              //!< default icon
+  bool             myIsPixmapCached;          //!< "cached pixmaps" flag
+
+  bool             myHasUserValues;           //!< \c true if user preferences has been read
+  WorkingMode      myWorkingMode;             //!< working mode
 
   friend class QtxResourceMgr::Format;
 };
 
-/*!
-  Class: QtxResourceMgr::Format
-*/
-
 class QTX_EXPORT QtxResourceMgr::Format
 {
 public:
@@ -203,248 +219,8 @@ protected:
   virtual bool           save( const QString&, const QMap<QString, Section>& ) = 0;
 
 private:
-  QString                myFmt;
-  QMap<QString, QString> myOpt;
-};
-
-/*!
-  Class: QtxResourceMgr::Resources
-*/
-
-class QtxResourceMgr::Resources
-{
-public:
-  Resources( const QtxResourceMgr*, const QString& );
-  virtual ~Resources();
-
-  QString                file() const;
-  void                   setFile( const QString& );
-
-  QString                value( const QString&, const QString&, const bool ) const;
-  void                   setValue( const QString&, const QString&, const QString& );
-
-  bool                   hasSection( const QString& ) const;
-  bool                   hasValue( const QString&, const QString& ) const;
-
-  void                   removeSection( const QString& );
-  void                   removeValue( const QString&, const QString& );
-
-  QPixmap                loadPixmap( const QString&, const QString&, const QString& ) const;
-  QTranslator*           loadTranslator( const QString&, const QString&, const QString& ) const;
-
-  QString                environmentVariable( const QString&, int&, int& ) const;
-  QString                makeSubstitution( const QString&, const QString&, const QString& ) const;
-
-  void                   clear();
-
-  QStringList            sections() const;
-  QStringList            parameters( const QString& ) const;
-
-  QString                path( const QString&, const QString&, const QString& ) const;
-
-protected:
-  QtxResourceMgr*        resMgr() const;
-
-private:
-  Section&               section( const QString& );
-  const Section&         section( const QString& ) const;
-
-  QString                fileName( const QString&, const QString&, const QString& ) const;
-
-private:
-  typedef QMap<QString, Section> SectionMap;
-
-private:
-  SectionMap             mySections;
-  QString                myFileName;
-  QMap<QString,QPixmap>  myPixmapCache;
-  QtxResourceMgr*        myMgr;
-
-  friend class QtxResourceMgr::Format;
-};
-
-/*!
-  Class: QtxResourceMgr::IMapIterator
-*/
-
-template <class Key, class Value> class QtxResourceMgr::IMapIterator
-{
-public:
-  IMapIterator()                           : myMap( 0 ), myIndex( 0 )                                   { init(); }
-  IMapIterator( const IMap<Key,Value>* m ) : myMap( const_cast< IMap<Key,Value>* >( m ) ), myIndex( 0 ) { init(); }
-  IMapIterator( const IMapIterator& i )    : myMap( i.myMap ), myIndex( i.myIndex )                     { init(); }
-
-  bool operator==( const IMapIterator& i ) { return !operator!=( i );                                   }
-  bool operator!=( const IMapIterator& i ) { return !myMap || myMap != i.myMap || myIndex != i.myIndex; }
-  
-  operator bool() const { return myIndex >= 0; }
-
-  const Key&   key() const  { return myMap->key( myIndex );   }
-  Value&       data()       { return myMap->value( myIndex ); }
-  const Value& data() const { return myMap->value( myIndex ); }
-
-  Value& operator*() { return data(); }
-
-  IMapIterator& operator++()      { myIndex++; init(); return *this;                     }
-  IMapIterator  operator++( int ) { IMapIterator i = *this; myIndex++; init(); return i; }
-  IMapIterator& operator--()      { myIndex--; init(); return *this;                     }
-  IMapIterator  operator--( int ) { IMapIterator i = *this; myIndex--; init(); return i; }
-
-private:
-  IMapIterator( const IMap<Key,Value>* m, const int index ) : myMap( const_cast< IMap<Key,Value>* >( m ) ), myIndex( index ) { init(); }
-  void init() { if ( !myMap || myIndex >= myMap->count() ) myIndex = -1; }
-
-private:
-  IMap<Key,Value>* myMap;
-  int              myIndex;
-
-  friend class IMap<Key, Value>;
-  friend class IMapConstIterator<Key, Value>;
-};
-
-/*!
-  Class: QtxResourceMgr::IMapConstIterator
-*/
-
-template <class Key, class Value> class QtxResourceMgr::IMapConstIterator
-{
-public:
-  IMapConstIterator()                                    : myMap( 0 ), myIndex( 0 )                                    { init(); }
-  IMapConstIterator( const IMap<Key,Value>* m )          : myMap( const_cast< IMap<Key,Value>* >( m )  ), myIndex( 0 ) { init(); }
-  IMapConstIterator( const IMapConstIterator& i )        : myMap( i.myMap ), myIndex( i.myIndex )                      { init(); }
-  IMapConstIterator( const IMapIterator<Key, Value>& i ) : myMap( i.myMap ), myIndex( i.myIndex )                      { init(); }
-  
-  bool operator==( const IMapConstIterator& i ) { return !operator!=( i );                                   }
-  bool operator!=( const IMapConstIterator& i ) { return !myMap || myMap != i.myMap || myIndex != i.myIndex; }
-  
-  operator bool() const { return myIndex >= 0; }
-  
-  const Key&   key() const  { return myMap->key( myIndex );   }
-  const Value& data() const { return myMap->value( myIndex ); }
-  
-  const Value& operator*() const { return data(); }
-  
-  IMapConstIterator& operator++()      { myIndex++; init(); return *this;                          }
-  IMapConstIterator  operator++( int ) { IMapConstIterator i = *this; myIndex++; init(); return i; }
-  IMapConstIterator& operator--()      { myIndex--; init(); return *this;                          }
-  IMapConstIterator  operator--( int ) { IMapConstIterator i = *this; myIndex--; init(); return i; }
-  
-private:
-  IMapConstIterator( const IMap<Key,Value>* m, const int index ): myMap( const_cast< IMap<Key,Value>* >( m ) ), myIndex( index ) { init(); }
-  void init() { if ( !myMap || myIndex >= myMap->count() ) myIndex = -1; }
-  
-private:
-  IMap<Key,Value>* myMap;
-  int              myIndex;
-  
-  friend class IMap<Key,Value>;
+  QString                myFmt;    //!< format name
+  QMap<QString, QString> myOpt;    //!< options map
 };
 
-/*!
-  Class: QtxResourceMgr::IMap
-*/
-
-template <class Key, class Value> class QtxResourceMgr::IMap
-{
-public:
-  typedef IMapIterator<Key,Value>      Iterator;
-  typedef IMapConstIterator<Key,Value> ConstIterator;
-
-public:
-  IMap() {}
-  IMap( const IMap& m ) : myKeys( m.myKeys ), myData( m.myData ) {}
-  IMap& operator=( const IMap& m ) { myKeys = m.myKeys; myData = m.myData; return *this; }
-  
-  int  count() const   { return myData.count(); }
-  int  size() const    { return myData.count(); }
-  bool empty() const   { return myData.empty(); }
-  bool isEmpty() const { return myData.empty(); }
-  
-  void clear() { myKeys.clear(); myData.clear(); }
-  
-  QValueList<Key>   keys()   const { return myKeys; }
-  QValueList<Value> values() const { QValueList<Value> l; for ( int i = 0; i < count(); i++ ) l.append( value( i ) ); return l; }
-  bool              contains ( const Key& key ) const { return myData.contains( key ); }
-  
-  Iterator      begin()       { return Iterator( this );               }
-  Iterator      end()         { return Iterator( this, count() );      }
-  ConstIterator begin() const { return ConstIterator( this );          }
-  ConstIterator end() const   { return ConstIterator( this, count() ); }
-  
-  Iterator insert( const Key& key, const Value& value, bool overwrite = true )
-  { 
-    if ( myData.find( key ) == myData.end() || overwrite )
-    {
-      if ( myData.find( key ) != myData.end() && overwrite )
-        myKeys.remove( myKeys.find( key ) );
-      myKeys.append( key );
-      myData[key] = value;
-    }
-    return Iterator( this, index( key ) );
-  }
-
-  Iterator replace( const Key& key, const Value& value )
-  { 
-    if ( myData.find( key ) == myData.end() )
-      myKeys.append( key );
-    myData[ key ] = value;
-    return Iterator( this, index( key ) );
-  }
-
-  int           index( const Key& key ) const { return myKeys.findIndex( key );      }
-  Iterator      at( const int index )         { return Iterator( this, index );      }
-  ConstIterator at( const int index ) const   { return ConstIterator( this, index ); }
-
-  Key& key( const int index )
-  {
-    if ( index < 0 || index >= (int)myKeys.count() ) 
-      return dummyKey;
-    return myKeys[index];
-  }
-
-  Value& value( const int index )
-  {
-    if ( index < 0 || index >= (int)myKeys.count() ) 
-      return dummyValue;
-    return myData[ myKeys[index] ];
-  }
-
-  Value& operator[]( const Key& key )
-  {
-    if ( myData.find( key ) == myData.end() )
-      insert( key, Value() );
-    return myData[ key ];
-  }
-
-  const Value& operator[]( const Key& key ) const
-  {
-    if ( myData.find( key ) == myData.end() )
-      return dummyValue;
-    return myData[ key ];
-  }
-
-  void erase( Iterator it )     { remove( it );    }
-  void erase( const Key& key )  { remove( key );   }
-  void erase( const int index ) { remove( index ); }
-  void remove( Iterator it )    { if ( it.myMap != this ) return; remove( it.myIndex ); }
-  void remove( const Key& key ) { remove( index( key ) ); }
-  void remove( const int index )
-  {
-    if ( index >= 0 && index < (int)myKeys.count() )
-    {
-      myData.remove( myKeys[ index ] );
-      myKeys.remove( myKeys.at( index ) );
-    }
-  }
-
-private:
-  QValueList<Key> myKeys;
-  QMap<Key,Value> myData;
-  Key             dummyKey;
-  Value           dummyValue;
-
-  friend class IMapIterator<Key,Value>;
-  friend class IMapConstIterator<Key,Value>;
-};
-
-#endif
+#endif // QTXRESOURCEMGR_H
diff --git a/src/Qtx/QtxRubberBand.cxx b/src/Qtx/QtxRubberBand.cxx
new file mode 100755 (executable)
index 0000000..99f67f4
--- /dev/null
@@ -0,0 +1,315 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxRubberBand.cxx
+// Author:    Alexander A. BORODIN
+//
+#include "QtxRubberBand.h"
+
+#include <QBitmap>
+#include <QImage>
+#include <QPaintEvent>
+#include <QPainter>
+#include <QPalette>
+#include <QShowEvent>
+#include <QVectorIterator>
+
+/*!
+  \class QtxAbstractRubberBand
+  \brief Analog of class QRubberBand with possibility of creation non-rectangular contour for selection.
+  
+  Currently this class does not support Style functionality in full.
+*/
+
+/*!
+  \brief Constructor
+  \param theParent parent widget
+ */
+
+QtxAbstractRubberBand::QtxAbstractRubberBand( QWidget* theParent)
+  : QWidget( theParent/*,Qt::ToolTip*/ ),
+    myPoints(),
+    myIsClosed( false )
+{
+  setAttribute(Qt::WA_TransparentForMouseEvents);
+#ifndef WIN32
+  setAttribute(Qt::WA_NoSystemBackground);
+#endif //WIN32
+  setAttribute(Qt::WA_WState_ExplicitShowHide);
+  setVisible(false);
+  theParent->installEventFilter(this);
+  setGeometry( QRect(QPoint(0,0), theParent->size() ) );
+}
+
+/*!
+  \brief Destructor
+ */
+QtxAbstractRubberBand::~QtxAbstractRubberBand()
+{
+}
+
+void QtxAbstractRubberBand::clearGeometry()
+{
+  myPoints.clear();
+}
+
+bool QtxAbstractRubberBand::isClosed()
+{
+  return myIsClosed;
+}
+
+void QtxAbstractRubberBand::paintEvent( QPaintEvent* theEvent )
+{
+  if ( !myPoints.empty() )
+    {
+      QPixmap tiledPixmap(16, 16);
+     
+      QPainter pixmapPainter(&tiledPixmap);
+      pixmapPainter.setPen(Qt::NoPen);
+      pixmapPainter.setBrush(QBrush( Qt::black, Qt::Dense4Pattern ));
+      pixmapPainter.setBackground(QBrush( Qt::white ));
+      pixmapPainter.setBackgroundMode(Qt::OpaqueMode);
+      pixmapPainter.drawRect(0, 0, tiledPixmap.width(), tiledPixmap.height());
+      pixmapPainter.end();
+      // ### workaround for borked XRENDER
+      tiledPixmap = QPixmap::fromImage(tiledPixmap.toImage());
+
+
+      
+      QPainter aPainter( this );
+      aPainter.setRenderHint( QPainter::Antialiasing );
+      QRect r = myPoints.boundingRect();
+      aPainter.setClipRegion( r.normalized().adjusted( -1, -1, 2, 2 ) );
+      aPainter.drawTiledPixmap( 0, 0, width(), height(), tiledPixmap);
+
+      aPainter.end();
+
+    /*
+
+
+
+#ifdef WIN32
+      QPixmap anImage( size() );
+#else
+      QImage anImage( size(), QImage::Format_ARGB32_Premultiplied );
+#endif
+
+      anImage.fill( Qt::transparent );
+      QPainter aImgPainter( &anImage );
+      aImgPainter.setRenderHint( QPainter::Antialiasing );
+      aImgPainter.setCompositionMode(QPainter::CompositionMode_Source);
+
+      QPen aPen( Qt::black );
+      aPen.setWidth( 2 );
+      aImgPainter.setPen( aPen );
+    
+      aImgPainter.drawPolyline( myPoints );
+      if ( myIsClosed && myPoints.last() != myPoints.first() )
+        aImgPainter.drawLine( myPoints.last(), myPoints.first() );
+
+      //aImgPainter.setPen(Qt::NoPen);
+      //aImgPainter.setBrush(QBrush( Qt::white, Qt::Dense4Pattern));
+      //aImgPainter.setCompositionMode(QPainter::CompositionMode_SourceAtop);
+      //aImgPainter.drawRect(0, 0, width(), height());
+      aImgPainter.end();
+
+      QPainter aPainter( this );
+      aPainter.drawPolyline( myPoints );
+      if ( myIsClosed && myPoints.last() != myPoints.first() )
+        aPainter.drawLine( myPoints.last(), myPoints.first() );
+      
+#ifdef WIN32
+      aPainter.drawPixmap( 0, 0, anImage );
+#else
+      aPainter.drawImage( 0, 0, anImage );
+      #endif
+      aPainter.end();*/
+      
+    }
+}
+
+void QtxAbstractRubberBand::showEvent( QShowEvent* theEvent )
+{
+  raise();
+  theEvent->ignore();
+}
+
+void QtxAbstractRubberBand::moveEvent( QMoveEvent* )
+{
+}
+
+void QtxAbstractRubberBand::resizeEvent( QResizeEvent* )
+{
+}
+
+bool QtxAbstractRubberBand::eventFilter( QObject* obj, QEvent* e )
+{
+  if ( obj && obj == parent() && e->type() == QEvent::Resize )
+    {
+      QWidget* p = (QWidget*)parent();
+      setGeometry( QRect(QPoint(0,0), p->size() ) );
+    }
+  return QWidget::eventFilter( obj, e );
+}
+
+QRegion createRegion( const QPointF& p1, const QPointF& p2 )
+{
+  if ( p1 == p2 )
+    return QRegion();
+
+  QLineF n = QLineF( p1, p2 ).normalVector();//.unitVector();
+  n.setLength( 1 );
+  n.translate( p1 * -1 );
+  QPointF nPoint = n.p2();
+
+  QPolygonF p;
+  p << p1 + nPoint << p2 + nPoint << p2 - nPoint << p1 - nPoint << p1 + nPoint;
+
+  return QRegion( p.toPolygon() );
+}
+
+void QtxAbstractRubberBand::updateMask()
+{
+  QRegion r;
+
+  QVectorIterator<QPoint> it(myPoints);
+  while( it.hasNext() )
+    {
+      QPoint p = it.next();
+      if( !it.hasNext() )
+        break;
+
+      QPoint np = it.peekNext();
+      
+      if ( p == np ) continue;
+
+      r += createRegion( p, np );
+    }
+
+  if ( isClosed() )
+    r += createRegion( myPoints.last(), myPoints.first() );
+
+  setMask( r );
+
+}
+
+
+QtxRectRubberBand::QtxRectRubberBand(QWidget* parent)
+  :QtxAbstractRubberBand( parent )     
+{
+  myPoints.resize( 4 );
+  myIsClosed = true;
+}
+
+QtxRectRubberBand::~QtxRectRubberBand()
+{
+}
+
+void QtxRectRubberBand::initGeometry( const QRect& theRect )
+{
+  myPoints.clear();
+  myPoints << theRect.topLeft() << theRect.topRight() << theRect.bottomRight() << theRect.bottomLeft();
+  //setMask( QRegion( myPoints ) );
+  updateMask();
+}
+
+void QtxRectRubberBand::setStartPoint( const QPoint& thePoint )
+{
+  myPoints[0] = thePoint;
+  myPoints[1].setY( thePoint.y() );
+  myPoints[3].setX( thePoint.x() );
+  updateMask();
+}
+
+void QtxRectRubberBand::setEndPoint( const QPoint& thePoint)
+{
+  myPoints[2] = thePoint;      
+  myPoints[1].setX( thePoint.x() );
+  myPoints[3].setY( thePoint.y() );
+  updateMask();
+}
+
+void QtxRectRubberBand::clearGeometry()
+{
+  QMutableVectorIterator<QPoint> i(myPoints);
+  while (i.hasNext())
+    {
+      i.next();
+      i.setValue( QPoint( -1, -1 ) );
+    }
+}
+
+
+QtxPolyRubberBand::QtxPolyRubberBand(QWidget* parent)
+  :QtxAbstractRubberBand( parent )
+{
+}
+
+QtxPolyRubberBand::~QtxPolyRubberBand()
+{
+}
+
+void QtxPolyRubberBand::initGeometry( const QPolygon& thePoints )
+{
+  myPoints = thePoints;
+  updateMask();
+}
+
+void QtxPolyRubberBand::initGeometry( const QPoint& thePoint )
+{
+  myPoints.clear();  
+  myPoints << thePoint;
+  updateMask();
+}
+
+void QtxPolyRubberBand::addNode( const QPoint& thePoint )
+{
+  myPoints << thePoint;
+  updateMask();
+}
+
+void QtxPolyRubberBand::replaceLastNode( const QPoint& thePoint )
+{
+  if ( !myPoints.empty() )
+    {
+      myPoints.pop_back();
+      myPoints << thePoint;
+      updateMask();
+    }
+}
+
+void QtxPolyRubberBand::removeLastNode()
+{
+  if ( !myPoints.empty() )
+    {
+      myPoints.pop_back();
+      updateMask();
+    }
+}
+
+void QtxPolyRubberBand::setClosed( bool theFlag )
+{
+  if (myIsClosed != theFlag )
+    {
+      myIsClosed = theFlag;
+      updateMask();
+    }
+}
diff --git a/src/Qtx/QtxRubberBand.h b/src/Qtx/QtxRubberBand.h
new file mode 100755 (executable)
index 0000000..0abf9bb
--- /dev/null
@@ -0,0 +1,95 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxRubberBand.h
+// Author:    Alexander A. BORODIN
+//
+#ifndef QTXRUBBERBAND_H
+#define QTXRUBBERBAND_H
+
+#include "Qtx.h"
+
+#include <QWidget>
+
+class QTX_EXPORT QtxAbstractRubberBand : public QWidget
+{
+  Q_OBJECT
+
+protected:
+  QtxAbstractRubberBand( QWidget* );
+
+public:
+  virtual ~QtxAbstractRubberBand();
+
+  virtual void    clearGeometry();
+
+  bool            isClosed();
+
+protected:
+  virtual void    paintEvent( QPaintEvent* );
+  virtual void    showEvent( QShowEvent* );
+  virtual void    moveEvent( QMoveEvent* );
+  virtual void    resizeEvent( QResizeEvent* );
+
+  virtual bool    eventFilter( QObject*, QEvent* );
+
+  virtual void    updateMask();
+
+protected:
+  QPolygon        myPoints;
+
+  bool            myIsClosed;
+};
+
+class QTX_EXPORT QtxRectRubberBand: public QtxAbstractRubberBand
+{
+  Q_OBJECT
+
+public:
+  QtxRectRubberBand( QWidget* );
+  virtual ~QtxRectRubberBand();
+
+  void            initGeometry( const QRect& );
+  void            setStartPoint( const QPoint& );
+  void            setEndPoint( const QPoint& );
+       
+  virtual void    clearGeometry();
+};
+
+class QTX_EXPORT QtxPolyRubberBand: public QtxAbstractRubberBand
+{
+  Q_OBJECT
+
+public:
+  QtxPolyRubberBand( QWidget* );
+  virtual ~QtxPolyRubberBand();
+
+  void            initGeometry( const QPolygon& );
+  void            initGeometry( const QPoint& );
+
+  void            addNode( const QPoint& );
+  void            replaceLastNode( const QPoint& );
+  void            removeLastNode();
+
+  void            setClosed( bool );
+};
+
+#endif //QTXRUBBERBAND_H
diff --git a/src/Qtx/QtxSearchTool.cxx b/src/Qtx/QtxSearchTool.cxx
new file mode 100644 (file)
index 0000000..b7f9444
--- /dev/null
@@ -0,0 +1,1514 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : QtxSearchTool.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#include "QtxSearchTool.h"
+
+#include <QApplication>
+#include <QCheckBox>
+#include <QEvent>
+#include <QHBoxLayout>
+#include <QKeyEvent>
+#include <QLineEdit>
+#include <QPersistentModelIndex>
+#include <QShortcut>
+#include <QTimer>
+#include <QToolButton>
+#include <QTreeView>
+
+const char* const first_xpm[] = {
+"16 16 14 1",
+"      c None",
+".     c #111111",
+"+     c #0A0A0A",
+"@     c #161616",
+"#     c #ACACAC",
+"$     c #FC6D6E",
+"%     c #FB6364",
+"&     c #F25B5C",
+"*     c #EA5859",
+"=     c #C1494A",
+"-     c #B64545",
+";     c #AB4040",
+">     c #A03C3C",
+",     c #99393A",
+"           .    ",
+" +@+      ..#   ",
+" +$+#    .$.... ",
+" +$+#   .$$$$$.#",
+" +%+#  .%%%%%%.#",
+" +&+# .&&&&&&&.#",
+" +*+#.********.#",
+" +=+.=========.#",
+" +-+#.--------.#",
+" +;+##.;;;;;;;.#",
+" +>+# #.>>>>>>.#",
+" +,+#  #.,,,,,.#",
+" +,+#   #.,....#",
+" +,+#    #..####",
+" +@+#     #.#   ",
+"  ###      ##   "};
+
+const char* const last_xpm[] = {
+"16 16 14 1",
+"      c None",
+".     c #111111",
+"+     c #0A0A0A",
+"@     c #161616",
+"#     c #FC6D6E",
+"$     c #ACACAC",
+"%     c #FB6364",
+"&     c #F25B5C",
+"*     c #EA5859",
+"=     c #C1494A",
+"-     c #B64545",
+";     c #AB4040",
+">     c #A03C3C",
+",     c #99393A",
+"    .           ",
+"    ..      +@+ ",
+" ....#.     +#+$",
+" .#####.    +#+$",
+" .%%%%%%.   +%+$",
+" .&&&&&&&.  +&+$",
+" .********. +*+$",
+" .=========.+=+$",
+" .--------.$+-+$",
+" .;;;;;;;.$$+;+$",
+" .>>>>>>.$$ +>+$",
+" .,,,,,.$$  +,+$",
+" ....,.$$   +,+$",
+" $$$..$$    +,+$",
+"    .$$     +@+$",
+"    $$       $$$"};
+
+const char* const prev_xpm[] = {
+"16 16 12 1",
+"      c None",
+".     c #111111",
+"+     c #ACACAC",
+"@     c #FC6D6E",
+"#     c #FB6364",
+"$     c #F25B5C",
+"%     c #EA5859",
+"&     c #C1494A",
+"*     c #B64545",
+"=     c #AB4040",
+"-     c #A03C3C",
+";     c #99393A",
+"        .       ",
+"       ..+      ",
+"      .@......  ",
+"     .@@@@@@@.+ ",
+"    .########.+ ",
+"   .$$$$$$$$$.+ ",
+"  .%%%%%%%%%%.+ ",
+" .&&&&&&&&&&&.+ ",
+"  .**********.+ ",
+"  +.=========.+ ",
+"   +.--------.+ ",
+"    +.;;;;;;;.+ ",
+"     +.;......+ ",
+"      +..++++++ ",
+"       +.+      ",
+"        ++      "};
+
+const char* const next_xpm[] = {
+"16 16 12 1",
+"      c None",
+".     c #111111",
+"+     c #FC6D6E",
+"@     c #FB6364",
+"#     c #F25B5C",
+"$     c #EA5859",
+"%     c #C1494A",
+"&     c #B64545",
+"*     c #ACACAC",
+"=     c #AB4040",
+"-     c #A03C3C",
+";     c #99393A",
+"       .        ",
+"       ..       ",
+"  ......+.      ",
+"  .+++++++.     ",
+"  .@@@@@@@@.    ",
+"  .#########.   ",
+"  .$$$$$$$$$$.  ",
+"  .%%%%%%%%%%%. ",
+"  .&&&&&&&&&&.**",
+"  .=========.** ",
+"  .--------.**  ",
+"  .;;;;;;;.**   ",
+"  ......;.**    ",
+"   ****..**     ",
+"       .**      ",
+"       **       "};
+
+const char* const close_xpm[] = {
+"16 16 8 1",
+"      c None",
+".     c #D73727",
+"+     c #E17765",
+"@     c #E7957F",
+"#     c #DE6F48",
+"$     c #DF7B4F",
+"%     c #FAE9E4",
+"&     c #FFFFFF",
+"                ",
+"  ............  ",
+" .+@@@@@@@@@@+. ",
+" .@#$$$$$$$$#@. ",
+" .@$$%$$$$%$$@. ",
+" .@$%&%$$%&%$@. ",
+" .@$$%&%%&%$$@. ",
+" .@$$$%&&%$$$@. ",
+" .@$$$%&&%$$$@. ",
+" .@$$%&%%&%$$@. ",
+" .@$%&%$$%&%$@. ",
+" .@$$%$$$$%$$@. ",
+" .@#$$$$$$$$#@. ",
+" .+@@@@@@@@@@+. ",
+"  ............  ",
+"                "};
+
+const char* highlightColor = "#FF6666";
+const int DefaultAutoHideDelay = 10000;
+
+/*!
+  \brief Wrap specified widget by another dumb widget.
+  \internal
+  \param parent widget to be used as parent for the dumb widget
+  \param w widget to be wrapped
+  \return wrapper widget
+*/
+static QWidget* wrapWidget( QWidget* parent, QWidget* w )
+{
+  QWidget* wrapper = new QWidget( parent );
+  w->setParent( wrapper );
+  QHBoxLayout* l = new QHBoxLayout( wrapper );
+  l->setMargin( 1 );
+  l->setSpacing( 0 );
+  l->addWidget( w );
+  return wrapper;
+}
+
+/*!
+  \class QtxSearchTool
+  \brief Context search tool.
+
+  The QtxSearchTool class implements a specific context search tool widget
+  which can be embedded into any GUI element.
+  It represents the usual dialog panel with the line edit box used to enter
+  text to be searched and set of buttons, like "Find Next", "Find Previous", etc.
+  In addition, the search modifiers like "Case sensitive search", "Wrap search"
+  are provided.
+
+  Actually the class QtxSearchTool does not perform a serach itself - it is only
+  the generic widget. To use this widget, you have to install a searcher depending
+  on your needs. This should be a successor of the class QtxSearchTool::Searcher -
+  it is the class which will perform actual search of the data in your widget
+  according to the widget type.
+
+  For the current moment, only one standard searcher is implemented: it is the
+  class QtxTreeViewSearcher, which can be used to search the text data in the
+  tree view widget (QTreeView). See this class for more details.
+
+  The usual usage of the searcher widget is the following:
+  \code
+  QTreeView* tree = new QTreeView( this );
+  QtxSearchTool* st = new QtxSearchTool( this, tree, QtxSearchTool::Standard );
+  st->setActivators( QtxSearchTool::SlashKey | QtxSearchTool::StandardKey );
+  st->setSearcher( new QtxTreeViewSearcher( tree ) );
+  \endcode
+
+  Note, that controls to be displayed by the search tool widget are passed as
+  ORed flags to the widget's constructor. At any time, the available controls
+  can be set/get with setControls() and controls() methods.
+  By default, all widgets are displayed (see also QtxSearchTool::Controls
+  enumeration).
+
+  The class QtxSearchTool also provides a way to add custom widgets -
+  these widgets are displayed at the bottom area of the tool box. Use
+  method addCustomWidget() to add custom widget to the search tool box.
+  Your searcher class can use custom widgets to perform advanced search.
+
+  The class supports different ways of the activation, all of them can be
+  switched on/off with setActivators() method. See QtxSearchTool::Activator
+  enumeration for more details.
+  By default, all methods are switched on: default hot key is <Ctrl><S> and
+  standard key bindings are the platform dependent keyboard shortcuts.
+  Shortcuts can be assigned with the setShortcuts() methods.
+*/
+
+/*!
+  \brief Constructor.
+
+  Creates a search tool widget with parent widget \a parent
+  and watched widget \a watched. The controls to be displayed can be passed
+  via \a controls parameter. By default, all controls are displayed.
+
+  \param parent parent widget
+  \param watched watched widget
+  \param controls ORed controls flags (QtxSearchTool::Controls)
+  \sa setWatchedWidget(), setControls()
+*/
+QtxSearchTool::QtxSearchTool( QWidget* parent, QWidget* watched, int controls )
+: QFrame( parent ),
+  myWatched( watched ? watched : parent ),
+  mySearcher( 0 ),
+  myControls( controls ),
+  myActivators( None ),
+  myAutoHideTimer( 0 ),
+  myAutoHideEnabled( true )
+{
+  init();
+}
+
+/*!
+  \brief Constructor.
+
+  Creates a search tool widget with parent widget \a parent.
+  Parameter \a parent is also used to set watched widget.
+  The controls to be displayed can be passed via \a controls parameter.
+  By default, all controls are displayed.
+
+  \param parent parent widget
+  \param controls ORed controls flags (QtxSearchTool::Controls)
+  \sa setWatchedWidget(), setControls()
+*/
+QtxSearchTool::QtxSearchTool( QWidget* parent, int controls )
+: QFrame( parent ),
+  myWatched( parent ),
+  mySearcher( 0 ),
+  myControls( controls ),
+  myActivators( None ),
+  myAutoHideTimer( 0 ),
+  myAutoHideEnabled( true )
+{
+  init();
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxSearchTool::~QtxSearchTool()
+{
+  clearShortcuts();
+  if ( mySearcher )
+    delete mySearcher;
+}
+
+/*!
+  \brief Get watched widget.
+  \return currently used watched widget
+  \sa setWatchedWidget(), activators(), setActivators()
+*/
+QWidget* QtxSearchTool::watchedWidget() const
+{
+  return myWatched;
+}
+
+/*!
+  \brief Set watched widget.
+
+  Watched widget is that one for which shortcut bindings are set.
+  When this widget has focus and any hot key binbding is pressed by the user,
+  the search tool box is activated. The same occurs if slash key is pressed and
+  QtxSearchTool::SlashKey activator is enabled. If the QtxSearchTool::PrintKey
+  activator is enabled, the tool box is activated if any printed key is pressed
+  by the user.
+
+  \param watched a widget to be watched by the search tool
+  \sa watchedWidget(), activators(), setActivators()
+*/
+void QtxSearchTool::setWatchedWidget( QWidget* watched )
+{
+  if ( myWatched )
+  {
+    myWatched->removeEventFilter( this );
+  }
+
+  myWatched = watched;
+
+  initShortcuts( shortcuts() );
+
+  if ( myWatched )
+  {
+    myWatched->installEventFilter( this );
+  }
+}
+
+/*!
+  \brief Get current searcher.
+  \return currently set searcher (QtxSearchTool::Searcher)
+  \sa setSearcher()
+*/
+QtxSearchTool::Searcher* QtxSearchTool::searcher() const
+{
+  return mySearcher;
+}
+
+/*!
+  \brief Assign searcher.
+
+  Note: the search tool takes ownership to the searcher
+  and destroys it when deleted.
+
+  \param s searcher to be used (QtxSearchTool::Searcher)
+  \sa searcher()
+*/
+void QtxSearchTool::setSearcher( QtxSearchTool::Searcher* s )
+{
+  if ( mySearcher )
+    delete mySearcher;
+  mySearcher = s;
+}
+
+/*!
+  \brief Get activators.
+  \return activators currently enabled (ORed QtxSearchTool::Activator flags)
+  \sa setActivators()
+*/
+int QtxSearchTool::activators() const
+{
+  return myActivators;
+}
+
+/*!
+  \brief Set activators.
+  \param flags set activators to be used (ORed QtxSearchTool::Activator flags)
+  \sa activators()
+*/
+void QtxSearchTool::setActivators( const int flags )
+{
+  myActivators = flags;
+  updateShortcuts();
+}
+
+/*!
+  \brief Get controls.
+  \return controls currently enabled (ORed QtxSearchTool::Controls flags)
+  \sa setControls()
+*/
+int QtxSearchTool::controls() const
+{
+  return myControls;
+}
+
+/*!
+  \brief Set controls.
+  \param ctrls controls to be displayed (ORed QtxSearchTool::Controls flags)
+  \sa controls()
+*/
+void QtxSearchTool::setControls( const int ctrls )
+{
+  if ( myControls == ctrls )
+    return;
+  myControls = ctrls;
+  updateControls();
+}
+
+/*!
+  \brief Get shortcuts.
+
+  Note: the standard bindings are not include to the resulting list.
+
+  \return list of shortcuts bindings currently set
+  \sa setShortcuts()
+*/
+QList<QKeySequence> QtxSearchTool::shortcuts() const
+{
+  QList<QKeySequence> ks;
+
+  ShortcutList::ConstIterator it;
+  int i;
+  for ( it = myShortcuts.begin(), i = 0; it != myShortcuts.end(); ++it, i++ )
+  {
+    if ( i > 2 ) ks.append( (*it)->key() );
+  }
+
+  return ks;
+}
+
+/*!
+  \brief Set shortcuts.
+  \param accel shortcut binding(s) to be used
+  \sa shortcuts()
+*/
+void QtxSearchTool::setShortcuts( const QKeySequence& accel )
+{
+  QList<QKeySequence> ks;
+  ks << accel;
+  setShortcuts( ks );
+}
+
+/*!
+  \brief Set shortcuts.
+  \param accel shortcut bindings to be used
+  \sa shortcuts()
+*/
+void QtxSearchTool::setShortcuts( const QList<QKeySequence>& accels )
+{
+  initShortcuts( accels );
+}
+
+/*!
+  \brief Add custom widget.
+  \param w custom widget to be added
+  \param id widget unique ID to be used (if < 0, automatically assigned)
+  \return widget unique ID
+  \sa customWidget(), customWidgetId()
+*/
+int QtxSearchTool::addCustomWidget( QWidget* w, int id )
+{
+  if ( !w ) return -1;
+
+  static int _wid = -1;
+
+  int wid = -1;
+  QMap<int, QWidget*>::ConstIterator it;
+  for ( it = myWidgets.begin(); it != myWidgets.end() && wid == -1; ++it )
+  {
+    if ( it.value() == w )
+      wid = it.key();
+  }
+
+  if ( wid != -1 )
+    return wid;
+
+  wid = id < 0 ? --_wid : id;
+
+  QVBoxLayout* vbox = qobject_cast<QVBoxLayout*>( layout() );
+  w->setParent( this );
+  vbox->addWidget( w );
+  myWidgets.insert( wid, w );
+
+  return wid;
+}
+
+/*!
+  \brief Get custom widget by ID.
+  \param id widget ID
+  \return custom widget or 0 if not found
+  \sa addCustomWidget(), customWidgetId()
+*/
+QWidget* QtxSearchTool::customWidget( int id ) const
+{
+  QWidget* w = 0;
+  if ( myWidgets.contains( id ) )
+    w = myWidgets[ id ];
+  return w;
+}
+
+/*!
+  \brief Get custom widget ID.
+  \param w custom widget
+  \return custom widget ID or -1 if widget does not belong to the search tool
+  \sa addCustomWidget(), customWidget()
+*/
+int QtxSearchTool::customWidgetId( QWidget* w ) const
+{
+  int wid = -1;
+  QMap<int, QWidget*>::ConstIterator it;
+  for ( it = myWidgets.begin(); it != myWidgets.end() && wid == -1; ++it )
+  {
+    if ( it.value() == w )
+      wid = it.key();
+  }
+  return wid;
+}
+
+/*!
+  \brief Check if auto-hide of the tool widget is enabled.
+
+  By default, the search tool widget is automatically hidden
+  after 10 seconds of idle (only if watched widget has input focus).
+
+  \return \c true if auto-hide option is set
+  \sa enableAutoHide()
+*/
+bool QtxSearchTool::isAutoHideEnabled() const
+{
+  return myAutoHideEnabled;
+}
+
+/*!
+  \brief Set/clear auto-hide option.
+
+  By default, the search tool widget is automatically hidden
+  after 10 seconds of idle (only if watched widget has input focus).
+
+  \param enable new option state
+  \sa isAutoHideEnabled()
+*/
+void QtxSearchTool::enableAutoHide( bool enable )
+{
+  if ( myAutoHideEnabled == enable ) return;
+
+  myAutoHideEnabled = enable;
+
+  if ( myAutoHideEnabled )
+  {
+    if ( isVisible() && !focused() )
+      myAutoHideTimer->start();
+  }
+  else
+  {
+    myAutoHideTimer->stop();
+  }
+}
+
+/*!
+  \brief Get 'case sensitive search' option value.
+
+  This method returns \c true if 'case sensitive search' control
+  is enabled and switched on.
+
+  \return \c true if case sensitive search is performed
+  \sa isRegExpSearch(), isSearchWrapped(), setControls()
+  \sa setCaseSensitive(), setRegExpSearch(), setSearchWrapped()
+*/
+bool QtxSearchTool::isCaseSensitive() const
+{
+  return myControls & Case && myIsCaseSens->isChecked();
+}
+
+/*!
+  \brief Get 'regular expression search' option value.
+
+  This method returns \c true if 'regular expression search' control
+  is enabled and switched on.
+
+  \return \c true if regular expression search is performed
+  \sa isCaseSensitive(), isSearchWrapped(), setControls()
+  \sa setCaseSensitive(), setRegExpSearch(), setSearchWrapped()
+*/
+bool QtxSearchTool::isRegExpSearch() const
+{
+  return myControls & RegExp && myIsRegExp->isChecked();
+}
+
+/*!
+  \brief Get 'search wrapping' option value.
+
+  This method returns \c true if 'wrap search' control
+  is enabled and switched on.
+
+  \return \c true if search wrapping is enabled
+  \sa isCaseSensitive(), isRegExpSearch(), setControls()
+  \sa setCaseSensitive(), setRegExpSearch(), setSearchWrapped()
+*/
+bool QtxSearchTool::isSearchWrapped() const
+{
+  return myControls & Wrap && myWrap->isChecked();
+}
+
+/*!
+  \brief Set 'case sensitive search' option value.
+  \param on new option state
+  \sa setRegExpSearch(), setSearchWrapped(), setControls()
+  \sa isCaseSensitive(), isRegExpSearch(), isSearchWrapped()
+*/
+void QtxSearchTool::setCaseSensitive( bool on )
+{
+  if ( myControls & Case )
+    myIsCaseSens->setChecked( on );
+}
+
+/*!
+  \brief Set 'regular expression search' option value.
+  \param on new option state
+  \sa setCaseSensitive(), setSearchWrapped(), setControls()
+  \sa isCaseSensitive(), isRegExpSearch(), isSearchWrapped()
+*/
+void QtxSearchTool::setRegExpSearch( bool on )
+{
+  if ( myControls & RegExp )
+    myIsRegExp->setChecked( on );
+}
+
+/*!
+  \brief Set 'search wrapping' option value.
+  \param on new option state
+  \sa setCaseSensitive(), setRegExpSearch(), setControls()
+  \sa isCaseSensitive(), isRegExpSearch(), isSearchWrapped()
+*/
+void QtxSearchTool::setSearchWrapped( bool on )
+{
+  if ( myControls & Wrap )
+    myWrap->setChecked( on );
+}
+
+/*!
+  \brief Customize event handling.
+  \param e event
+  \return \c true if event has been handled
+*/
+bool QtxSearchTool::event( QEvent* e )
+{
+  if ( e->type() == QEvent::EnabledChange )
+  {
+    updateShortcuts();
+  }
+  else if ( e->type() == QEvent::KeyPress )
+  {
+    QKeyEvent* ke = (QKeyEvent*)e;
+    if ( ke->key() == Qt::Key_Escape )
+      hide();
+  }
+  else if ( e->type() == QEvent::Hide && myWatched )
+  {
+    myWatched->setFocus();
+  }
+  return QFrame::event( e );
+}
+
+/*!
+  \brief Filter events from the watched widget.
+  \param o object
+  \param e event
+  \return \c true if further event processing should be stopped
+*/
+bool QtxSearchTool::eventFilter( QObject* o, QEvent* e )
+{
+  switch ( e->type() ) 
+  {
+  case QEvent::KeyPress:
+    if ( myWatched && o == myWatched )
+    {
+      QKeyEvent* ke = (QKeyEvent*)e;
+      int key = ke->key();
+      QString ttf = myData->text();
+      QString text = ke->text();
+      
+      if ( isVisible() )
+      {
+        switch ( key )
+        {
+        case Qt::Key_Escape:
+          hide();
+          return true;
+        case Qt::Key_Backspace:
+          ttf.chop( 1 );
+          break;
+        case Qt::Key_Return:
+        case Qt::Key_Enter:
+          findNext();
+          return true;
+        default:
+          if ( text.isEmpty() || !text[0].isPrint() )
+            return QFrame::eventFilter( o, e );
+          ttf += text;
+        }
+      }
+      else
+      {
+        if ( text.isEmpty() || ! isEnabled() || !text[0].isPrint() )
+          return QFrame::eventFilter( o, e );
+
+        if ( text.startsWith( '/' ) && myActivators & SlashKey )
+        {
+          myData->clear();
+          find();
+          return true;
+        }
+        else if ( !( myActivators & PrintKey ) )
+        {
+          return QFrame::eventFilter( o, e );
+        }
+        
+        ttf = text;
+        show();
+      }
+      myData->setText( ttf );
+      find( ttf );
+    }
+    break; // case QEvent::KeyPress
+  case QEvent::FocusIn:
+  case QEvent::FocusOut:
+    if ( focused() )
+    {
+      myAutoHideTimer->stop();
+    }
+    else if ( isVisible() && isAutoHideEnabled() )
+    {
+      myAutoHideTimer->start();
+    }
+    break;
+  default:
+    break;
+  }
+  return QFrame::eventFilter( o, e );
+}
+
+/*!
+  \brief Activate search tool.
+
+  Call this method to start new search.
+*/
+void QtxSearchTool::find()
+{
+  show();
+
+  myData->setFocus( Qt::ShortcutFocusReason );
+  myData->selectAll();
+  myAutoHideTimer->stop();
+}
+
+/*!
+  \brief Find next appropriate data.
+
+  Call this method to repeat the search in the forward direction.
+*/
+void QtxSearchTool::findNext()
+{
+  find( myData->text(), fNext );
+}
+
+/*!
+  \brief Find previous appropriate data.
+
+  Call this method to repeat the search in the backward direction.
+*/
+void QtxSearchTool::findPrevious()
+{
+  find( myData->text(), fPrevious );
+}
+
+/*!
+  \brief Find first appropriate data.
+
+  Call this method to find the very first appropriate data.
+*/
+void QtxSearchTool::findFirst()
+{
+  find( myData->text(), fFirst );
+}
+
+/*!
+  \brief Find last appropriate data.
+
+  Call this method to find the very last appropriate data.
+*/
+void QtxSearchTool::findLast()
+{
+  find( myData->text(), fLast );
+}
+
+/*!
+  \brief Perform search.
+  \internal
+  \param what text to be searched
+  \param where search flags
+*/
+void QtxSearchTool::find( const QString& what, int where )
+{
+  if ( !isVisible() )
+    show();
+
+  QPalette p = myData->palette();
+  p.setColor( QPalette::Active,
+             QPalette::Base,
+             QApplication::palette( myData ).color( QPalette::Active,
+                                                    QPalette::Base ) );
+
+  bool found = true;
+  if ( mySearcher && !what.isEmpty() )
+  {
+    switch( where )
+    {
+    case fNext:
+      found = mySearcher->findNext( what, this ); break;
+    case fPrevious:
+      found = mySearcher->findPrevious( what, this ); break;
+    case fFirst:
+      found = mySearcher->findFirst( what, this ); break;
+    case fLast:
+      found = mySearcher->findLast( what, this ); break;
+    case fAny:
+    default:
+      found = mySearcher->find( what, this ); break;
+    }
+  }
+
+  if ( !found )
+    p.setColor( QPalette::Active, QPalette::Base, QColor( highlightColor ) );
+
+  if ( !focused() && myAutoHideEnabled )
+    myAutoHideTimer->start();
+
+  myData->setPalette( p );
+}
+
+/*!
+  \brief Called when any search modifier is switched.
+  \internal
+*/
+void QtxSearchTool::modifierSwitched()
+{
+  find( myData->text() );
+}
+
+/*!
+  \brief Initialize the search tool widget.
+  \internal
+*/
+void QtxSearchTool::init()
+{
+  setFrameStyle( QFrame::StyledPanel | QFrame::Plain );
+  QVBoxLayout* vbox = new QVBoxLayout();
+  vbox->setSpacing( 0 );
+  vbox->setMargin( 5 );
+  setLayout( vbox );
+
+  myBtnWidget = new QWidget( this );
+  QHBoxLayout* myBtnWidget_layout = new QHBoxLayout( myBtnWidget );
+  myBtnWidget_layout->setSpacing( 0 );
+  myBtnWidget_layout->setMargin( 0 );
+  vbox->addWidget( myBtnWidget );
+
+  myModWidget = new QWidget( this );
+  QHBoxLayout* myModWidget_layout = new QHBoxLayout( myModWidget );
+  myModWidget_layout->setSpacing( 0 );
+  myModWidget_layout->setMargin( 0 );
+  vbox->addWidget( myModWidget );
+
+  myClose = new QToolButton( myBtnWidget );
+  myClose->setIcon( QIcon( close_xpm ) );
+  myClose->setAutoRaise( true );
+  myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myClose ) );
+  connect( myClose, SIGNAL( clicked() ), this, SLOT( hide() ) );
+
+  myData = new QLineEdit( myBtnWidget );
+  myData->setMinimumWidth( 50 );
+  myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myData ), 1 );
+  connect( myData, SIGNAL( textChanged( const QString& ) ), this, SLOT( find( const QString& ) ) );
+  connect( myData, SIGNAL( returnPressed() ), this, SLOT( findNext() ) );
+  myData->installEventFilter( this );
+
+  myToFirst = new QToolButton( myBtnWidget );
+  myToFirst->setIcon( QIcon( first_xpm ) );
+  myToFirst->setAutoRaise( true );
+  myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myToFirst ), 0 );
+  connect( myToFirst, SIGNAL( clicked() ), this, SLOT( findFirst() ) );
+  myToFirst->installEventFilter( this );
+
+  myPrev = new QToolButton( myBtnWidget );
+  myPrev->setIcon( QIcon( prev_xpm ) );
+  myPrev->setAutoRaise( true );
+  myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myPrev ), 0 );
+  connect( myPrev, SIGNAL( clicked() ), this, SLOT( findPrevious() ) );
+  myPrev->installEventFilter( this );
+
+  myNext = new QToolButton( myBtnWidget );
+  myNext->setIcon( QIcon( next_xpm ) );
+  myNext->setAutoRaise( true );
+  myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myNext ), 0 );
+  connect( myNext, SIGNAL( clicked() ), this, SLOT( findNext() ) );
+  myNext->installEventFilter( this );
+
+  myToLast = new QToolButton( myBtnWidget );
+  myToLast->setIcon( QIcon( last_xpm ) );
+  myToLast->setAutoRaise( true );
+  myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myToLast ), 0 );
+  connect( myToLast, SIGNAL( clicked() ), this, SLOT( findLast() ) );
+  myToLast->installEventFilter( this );
+
+  myIsCaseSens = new QCheckBox( tr( "Case sensitive" ), myModWidget );
+  myModWidget_layout->addWidget( wrapWidget( myBtnWidget, myIsCaseSens ) );
+  connect( myIsCaseSens, SIGNAL( stateChanged( int ) ), this, SLOT( modifierSwitched() ) );
+  myIsCaseSens->installEventFilter( this );
+
+  myIsRegExp = new QCheckBox( tr( "Regular expression" ), myModWidget );
+  myModWidget_layout->addWidget( wrapWidget( myBtnWidget, myIsRegExp ) );
+  connect( myIsRegExp, SIGNAL( stateChanged( int ) ), this, SLOT( modifierSwitched() ) );
+  myIsRegExp->installEventFilter( this );
+
+  myWrap = new QCheckBox( tr( "Wrap search" ), myModWidget );
+  myModWidget_layout->addWidget( wrapWidget( myBtnWidget, myWrap ) );
+  connect( myWrap, SIGNAL( stateChanged( int ) ), this, SLOT( modifierSwitched() ) );
+  myWrap->installEventFilter( this );
+
+  setWatchedWidget( myWatched );
+
+  setShortcuts( QKeySequence( "Ctrl+S" ) );
+  setActivators( Any );
+  updateControls();
+}
+
+/*!
+  \brief Check if any child widget has input focus.
+  \internal
+  \return \c true if any child widget has input focus
+*/
+bool QtxSearchTool::focused() const
+{
+  return isVisible() && isAncestorOf( QApplication::focusWidget() );
+}
+
+/*!
+  \brief Clear shortcuts.
+  \internal
+*/
+void QtxSearchTool::clearShortcuts()
+{
+  ShortcutList::Iterator it;
+  for ( it = myShortcuts.begin(); it != myShortcuts.end(); ++it )
+  {
+    if ( !(*it).isNull() )
+    {
+      QShortcut* sc = (*it);
+      delete sc;
+    }
+  }
+  myShortcuts.clear();
+}
+
+/*!
+  \brief Install shortcuts.
+  \internal
+  \param accels shortcuts list
+*/
+void QtxSearchTool::initShortcuts( const QList<QKeySequence>& accels )
+{
+  clearShortcuts();
+
+  QWidget* p = myWatched ? myWatched : ( parentWidget() ? parentWidget() : this );
+  QShortcut* sc;
+
+  sc = new QShortcut( QKeySequence::Find, p );
+  connect( sc, SIGNAL( activated() ), this, SLOT( find() ) );
+  sc->setContext( Qt::WidgetShortcut );
+  myShortcuts.append( sc );
+
+  sc = new QShortcut( QKeySequence::FindNext, p );
+  sc->setContext( Qt::WidgetShortcut );
+  connect( sc, SIGNAL( activated() ), this, SLOT( findNext() ) );
+  myShortcuts.append( sc );
+
+  sc = new QShortcut( QKeySequence::FindPrevious, p );
+  sc->setContext( Qt::WidgetShortcut );
+  connect( sc, SIGNAL( activated() ), this, SLOT( findPrevious() ) );
+  myShortcuts.append( sc );
+
+  QList<QKeySequence>::ConstIterator it;
+  for ( it = accels.begin(); it != accels.end(); ++it )
+  {
+    sc = new QShortcut( *it, p );
+    sc->setContext( Qt::WidgetShortcut );
+    connect( sc, SIGNAL( activated() ), this, SLOT( find() ) );
+    myShortcuts.append( sc );
+  }
+
+  myAutoHideTimer = new QTimer( this );
+  myAutoHideTimer->setInterval( DefaultAutoHideDelay );
+  myAutoHideTimer->setSingleShot( true );
+  connect( myAutoHideTimer, SIGNAL( timeout() ), this, SLOT( hide() ) );
+
+  updateShortcuts();
+
+  hide();
+}
+
+/*!
+  \brief Update shortcuts state.
+  \internal
+*/
+void QtxSearchTool::updateShortcuts()
+{
+  int i;
+  ShortcutList::Iterator it;
+  for ( it = myShortcuts.begin(), i = 0; it != myShortcuts.end(); ++it, i++ )
+  {
+    (*it)->setEnabled( isEnabled() && ( i < 3 && myActivators & StandardKey ||
+                                       i > 2 && myActivators & HotKey ) );
+  }
+}
+
+/*!
+  \brief Update controls state.
+  \internal
+*/
+void QtxSearchTool::updateControls()
+{
+  myData->parentWidget()->setVisible( myControls & Search );
+  myNext->parentWidget()->setVisible( myControls & Next );
+  myPrev->parentWidget()->setVisible( myControls & Prev );
+  myToFirst->parentWidget()->setVisible( myControls & First );
+  myToLast->parentWidget()->setVisible( myControls & Last );
+  myClose->parentWidget()->setVisible( myControls & Close );
+  myIsCaseSens->parentWidget()->setVisible( myControls & Case );
+  myIsRegExp->parentWidget()->setVisible( myControls & RegExp );
+  myWrap->parentWidget()->setVisible( myControls & Wrap );
+
+  myBtnWidget->setVisible( myControls & Standard );
+  myModWidget->setVisible( myControls & Modifiers );
+}
+
+/*!
+  \class QtxSearchTool::Searcher
+  \brief Generic searcher class.
+
+  Searcher is generic class which is used by the search tool to perform
+  widget-dependant search.
+
+  To implement a searcher for some widget, just inherit from QtxSearchTool::Searcher
+  and override pure virtual methods find(), findNext(), findPrevious(),
+  findFirst() and findLast()
+*/
+
+/*!
+  \brief Constructor.
+*/
+QtxSearchTool::Searcher::Searcher()
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxSearchTool::Searcher::~Searcher()
+{
+}
+
+/*!
+  \fn QtxSearchTool::Searcher::find(const QString& text, QtxSearchTool* st)
+  \brief Start new search.
+  \param text text to be found
+  \param st search tool widget
+  \sa findNext(), findPrevious(), findFirst(), findLast()
+*/
+
+/*!
+  \fn QtxSearchTool::Searcher::findNext(const QString& text, QtxSearchTool* st)
+  \brief Search next appropriate item.
+  \param text text to be found
+  \param st search tool widget
+  \sa find(), findPrevious(), findFirst(), findLast()
+*/
+
+/*!
+  \fn QtxSearchTool::Searcher::findPrevious(const QString& text, QtxSearchTool* st)
+  \brief Search previous appropriate item.
+  \param text text to be found
+  \param st search tool widget
+  \sa find(), findNext(), findFirst(), findLast()
+*/
+
+/*!
+  \fn QtxSearchTool::Searcher::findFirst(const QString& text, QtxSearchTool* st)
+  \brief Search first appropriate item.
+  \param text text to be found
+  \param st search tool widget
+  \sa find(), findNext(), findPrevious(), findLast()
+*/
+
+/*!
+  \fn QtxSearchTool::Searcher::findLast(const QString& text, QtxSearchTool* st)
+  \brief Search last appropriate item.
+  \param text text to be found
+  \param st search tool widget
+  \sa find(), findNext(), findPrevious(), findFirst()
+*/
+
+/*!
+  \class QtxTreeViewSearcher
+  \brief A QTreeView class based searcher.
+
+  The class QtxTreeViewSearcher can be used to find the items in the
+  QTreeView widget.
+
+  The column for which data should be searched can be get/set with the
+  searchColumn(), setSearchColumn() methods.
+  By default, column 0 is used.
+*/
+
+/*!
+  \brief Constructor.
+  \param view tree view widget
+  \param col column for which search to be performed (0 by default)
+  \sa setSearchColumn()
+*/
+QtxTreeViewSearcher::QtxTreeViewSearcher( QTreeView* view, int col )
+  : myView( view ), myColumn( col )
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxTreeViewSearcher::~QtxTreeViewSearcher()
+{
+}
+
+/*!
+  \brief Get column for which search is performed.
+  \return column number
+  \sa setSearchColumn()
+*/
+int QtxTreeViewSearcher::searchColumn() const
+{
+  return myColumn;
+}
+
+/*!
+  \brief Set column for which search should be performed.
+  \param column column number
+  \sa searchColumn()
+*/
+void QtxTreeViewSearcher::setSearchColumn( int column )
+{
+  myColumn = column;
+}
+
+/*!
+  \brief Start new search.
+  \param text text to be found
+  \param st search tool widget
+  \sa findNext(), findPrevious(), findFirst(), findLast()
+*/
+bool QtxTreeViewSearcher::find( const QString& text, QtxSearchTool* st )
+{
+  if ( !myView )
+    return false;
+
+  const QModelIndexList& l = myView->selectionModel() ?
+    myView->selectionModel()->selectedIndexes() : QModelIndexList();
+
+  QModelIndex current;
+  if ( l.count() > 0 )
+    current = l.first();
+
+  bool wrapSearch = st->isSearchWrapped();
+
+  QModelIndexList found = findItems( text, st );
+
+  if ( found.count() > 0 )
+  {
+    if ( !current.isValid() )
+    {
+      showItem( found.first() );
+      return true;
+    }
+
+    if ( found.contains( current ) )
+    {
+      showItem( current );
+      return true;
+    }
+
+    QModelIndex next = findNearest( current, found, true );
+    if ( next.isValid() )
+    {
+      showItem( next );
+      return true;
+    }
+
+    if ( wrapSearch )
+    {
+      showItem( found.first() );
+      return true;
+    }
+  }
+
+  return false;
+}
+
+/*!
+  \brief Search next appropriate item.
+  \param text text to be found
+  \param st search tool widget
+  \sa find(), findPrevious(), findFirst(), findLast()
+*/
+bool QtxTreeViewSearcher::findNext( const QString& text, QtxSearchTool* st )
+{
+  if ( !myView )
+    return false;
+
+  const QModelIndexList& l = myView->selectionModel() ?
+    myView->selectionModel()->selectedIndexes() : QModelIndexList();
+
+  QModelIndex current;
+  if ( l.count() > 0 )
+    current = l.first();
+  else if ( myIndex.isValid() )
+    current = myIndex;
+
+  bool wrapSearch = st->isSearchWrapped();
+
+  QModelIndexList found = findItems( text, st );
+
+  if ( found.count() > 0 )
+  {
+    if ( !current.isValid() )
+    {
+      showItem( found.first() );
+      return true;
+    }
+
+    QModelIndex next = findNearest( current, found, true );
+    if ( next.isValid() )
+    {
+      showItem( next );
+      return true;
+    }
+
+    if ( wrapSearch )
+    {
+      showItem( found.first() );
+      return true;
+    }
+  }
+
+  return false;
+}
+
+/*!
+  \brief Search previous appropriate item.
+  \param text text to be found
+  \param st search tool widget
+  \sa find(), findNext(), findFirst(), findLast()
+*/
+bool QtxTreeViewSearcher::findPrevious( const QString& text, QtxSearchTool* st )
+{
+  if ( !myView )
+    return false;
+
+  const QModelIndexList& l = myView->selectionModel() ?
+    myView->selectionModel()->selectedIndexes() : QModelIndexList();
+
+  QModelIndex current;
+  if ( l.count() > 0 )
+    current = l.first();
+  else if ( myIndex.isValid() )
+    current = myIndex;
+
+  bool wrapSearch = st->isSearchWrapped();
+
+  QModelIndexList found = findItems( text, st );
+
+  if ( found.count() > 0 )
+  {
+    if ( !current.isValid() )
+    {
+      showItem( found.first() );
+      return true;
+    }
+
+    QModelIndex next = findNearest( current, found, false );
+    if ( next.isValid() )
+    {
+      showItem( next );
+      return true;
+    }
+
+    if ( wrapSearch )
+    {
+      showItem( found.last() );
+      return true;
+    }
+  }
+
+  return false;
+}
+
+/*!
+  \brief Search first appropriate item.
+  \param text text to be found
+  \param st search tool widget
+  \sa find(), findNext(), findPrevious(), findLast()
+*/
+bool QtxTreeViewSearcher::findFirst( const QString& text, QtxSearchTool* st )
+{
+  QModelIndexList found = findItems( text, st );
+
+  if ( found.count() > 0 )
+  {
+    showItem( found.first() );
+    return true;
+  }
+
+  return false;
+}
+
+/*!
+  \brief Search last appropriate item.
+  \param text text to be found
+  \param st search tool widget
+  \sa find(), findNext(), findPrevious(), findFirst()
+*/
+bool QtxTreeViewSearcher::findLast( const QString& text, QtxSearchTool* st )
+{
+  QModelIndexList found = findItems( text, st );
+
+  if ( found.count() > 0 )
+  {
+    showItem( found.last() );
+    return true;
+  }
+
+  return false;
+}
+
+/*!
+  \brief Get match flags to be used by the searcher.
+  \param st search tool widget
+*/
+Qt::MatchFlags QtxTreeViewSearcher::matchFlags( QtxSearchTool* st ) const
+{
+  Qt::MatchFlags fl = Qt::MatchRecursive;
+
+  if ( st->isCaseSensitive() )
+    fl = fl | Qt::MatchCaseSensitive;
+  if ( st->isRegExpSearch() )
+    fl = fl | Qt::MatchRegExp;
+  else
+    fl = fl | Qt::MatchContains;
+
+  return fl;
+}
+
+/*!
+  \brief Find all appropriate items.
+  \internal
+  \param text text to be found
+  \param st search tool widget
+*/
+QModelIndexList QtxTreeViewSearcher::findItems( const QString& text, QtxSearchTool* st )
+{
+  QString s = text;
+
+  Qt::MatchFlags fl = matchFlags( st );
+  if ( fl & Qt::MatchRegExp ) {
+    if ( !s.startsWith( "^" ) && !s.startsWith( ".*" ) )
+      s.prepend( ".*" );
+    if ( !s.endsWith( "$" ) && !s.endsWith( ".*" ) )
+      s.append( ".*" );
+  }
+
+  if ( myView->model() )
+    return myView->model()->match( myView->model()->index( 0, myColumn ),
+                                  Qt::DisplayRole,
+                                  s, -1, fl );
+  return QModelIndexList();
+}
+
+/*!
+  \brief Find model index from the list nearest to the specified index.
+  \internal
+  \param index model index for which a nearest item is searched
+  \param lst list of model indices
+  \param direction if \c true find next appropriate item, otherwise find privious
+  appropriate item
+*/
+QModelIndex QtxTreeViewSearcher::findNearest( const QModelIndex& index,
+                                             const QModelIndexList& lst,
+                                             bool direction )
+{
+  if ( direction )
+  {
+    QListIterator<QModelIndex> it( lst );
+    while ( it.hasNext() )
+    {
+      QModelIndex found = it.next();
+      if ( compareIndices( found, index ) > 0 )
+       return found;
+    }
+  }
+  else
+  {
+    QListIterator<QModelIndex> it( lst );
+    it.toBack();
+    while ( it.hasPrevious() )
+    {
+      QModelIndex found = it.previous();
+      if ( compareIndices( found, index ) < 0 )
+       return found;
+    }
+  }
+  return QModelIndex();
+}
+
+/*!
+  \brief Ensure the found item to become visible and selected.
+  \internal
+  \param index item to be shown
+*/
+void QtxTreeViewSearcher::showItem( const QModelIndex& index )
+{
+  if ( myView && index.isValid() && myView->selectionModel() )
+  {
+    QItemSelectionModel::SelectionFlags f =
+      QItemSelectionModel::Select | QItemSelectionModel::Rows | QItemSelectionModel::Clear;
+    myView->selectionModel()->select( index, f );
+    myView->scrollTo( index );
+    myIndex = index;
+  }
+}
+
+/*!
+  \brief Get unique item ID.
+  \internal
+  \param index model index
+  \return item ID
+*/
+QString QtxTreeViewSearcher::getId( const QModelIndex& index )
+{
+  QStringList ids;
+  QModelIndex p = index;
+  while ( p.isValid() )
+  {
+    ids.prepend( QString::number( p.row() ) );
+    p = p.parent();
+  }
+  ids.prepend( "0" );
+  return ids.join( ":" );
+}
+
+/*!
+  \brief Compare items.
+  \internal
+  \param left first model index to be compared
+  \param right last model index to be compared
+  \return 0 if items are equal, negative value if left item is less than right one
+  and positive value otherwise
+*/
+int QtxTreeViewSearcher::compareIndices( const QModelIndex& left,
+                                        const QModelIndex& right )
+{
+  QString leftId = getId( left );
+  QString rightId = getId( right );
+
+  QStringList idsLeft  = leftId.split( ":", QString::SkipEmptyParts );
+  QStringList idsRight = rightId.split( ":", QString::SkipEmptyParts );
+
+  for ( int i = 0; i < idsLeft.count() && i < idsRight.count(); i++ )
+  {
+    int lid = idsLeft[i].toInt();
+    int rid = idsRight[i].toInt();
+    if ( lid != rid )
+      return lid - rid;
+  }
+  return idsLeft.count() < idsRight.count() ? -1 :
+    ( idsLeft.count() == idsRight.count() ? 0 : 1 );
+}
diff --git a/src/Qtx/QtxSearchTool.h b/src/Qtx/QtxSearchTool.h
new file mode 100644 (file)
index 0000000..26afe38
--- /dev/null
@@ -0,0 +1,211 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : QtxSearchTool.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef QTXSEARCHTOOL_H
+#define QTXSEARCHTOOL_H
+
+#include "Qtx.h"
+#include <QFrame>
+#include <QList>
+#include <QMap>
+#include <QPersistentModelIndex>
+#include <QPointer>
+
+class QCheckBox;
+class QLineEdit;
+class QShortcut;
+class QTimer;
+class QToolButton;
+class QTreeView;
+
+class QTX_EXPORT QtxSearchTool : public QFrame
+{
+  Q_OBJECT
+
+  //! Find operation type
+  enum {
+    fAny,             //!< find any appropriate
+    fNext,            //!< find next appropriate
+    fPrevious,        //!< find previous appropriate
+    fFirst,           //!< find first appropriate
+    fLast             //!< find last appropriate
+  };
+
+public:
+  class Searcher;
+
+  //! Search tool controls
+  typedef enum { 
+    Search    = 0x00000001,                          //!< line edit field for searched text
+    Next      = 0x00000002,                          //!< 'find next' button
+    Prev      = 0x00000004,                          //!< 'find previous' button
+    First     = 0x00000008,                          //!< 'find first' button
+    Last      = 0x00000010,                          //!< 'find last' button
+    Close     = 0x00000020,                          //!< 'close' button
+    Case      = 0x00000040,                          //!< 'case sensitive search' check box
+    RegExp    = 0x00000080,                          //!< 'regular expression' check box
+    Wrap      = 0x00000100,                          //!< 'wrap search' check box
+    Basic     = Search   | Next   | Prev | Close,    //!< basic controls: text field, "next", "prev" and "close" buttons
+    Standard  = Basic    | First  | Last,            //!< standard controls: same as Basic plus "first" and "last" buttons
+    Modifiers = Case     | RegExp | Wrap,            //!< search modifiers check boxes 
+    All       = Standard | Modifiers                 //!< all controls
+  } Controls;
+
+  typedef enum {
+    None        = 0x00000000,                                 //!< search tool can be activated programmatically only
+    HotKey      = 0x00000001,                                 //!< search tool is activated by hot key
+    SlashKey    = 0x00000002,                                 //!< search tool is activated by splash key ( / )
+    StandardKey = 0x00000004,                                 //!< search tool is activated by standard key combination (e.g. F3)
+    PrintKey    = 0x00000008,                                 //!< search tool is activated when user types any print key
+    Any         = HotKey | SlashKey | StandardKey | PrintKey  //!< search tool is activated by any of above mentioned ways
+  } Activator;
+
+  QtxSearchTool( QWidget*, QWidget* = 0, int = All );
+  QtxSearchTool( QWidget*, int = All );
+  virtual ~QtxSearchTool();
+
+  QWidget*            watchedWidget() const;
+  void                setWatchedWidget( QWidget* );
+
+  Searcher*           searcher() const;
+  void                setSearcher( Searcher* );
+
+  int                 activators() const;
+  void                setActivators( const int );
+
+  int                 controls() const;
+  void                setControls( const int );
+
+  QList<QKeySequence> shortcuts() const;
+  void                setShortcuts( const QKeySequence& );
+  void                setShortcuts( const QList<QKeySequence>& );
+
+  int                 addCustomWidget( QWidget*, int = -1 );
+  QWidget*            customWidget( int ) const;
+  int                 customWidgetId( QWidget* ) const;
+
+  bool                isAutoHideEnabled() const;
+  void                enableAutoHide( bool );
+
+  bool                isCaseSensitive() const;
+  bool                isRegExpSearch() const;
+  bool                isSearchWrapped() const;
+
+  void                setCaseSensitive( bool );
+  void                setRegExpSearch( bool );
+  void                setSearchWrapped( bool );
+
+  virtual bool        event( QEvent* );
+  virtual bool        eventFilter( QObject*, QEvent* );
+
+public slots:
+  virtual void        find();
+  virtual void        findNext();
+  virtual void        findPrevious();
+  virtual void        findFirst();
+  virtual void        findLast();
+
+private slots:
+  void                find( const QString&, int = fAny );
+  void                modifierSwitched();
+
+private:
+  void                init();
+  bool                focused() const;
+  void                clearShortcuts();
+  void                initShortcuts( const QList<QKeySequence>& );
+  void                updateShortcuts();
+  void                updateControls();
+
+private:
+  typedef QPointer<QShortcut> ShortcutPtr;
+  typedef QList<ShortcutPtr>  ShortcutList;
+
+private:
+  QWidget*            myBtnWidget;
+  QWidget*            myModWidget;
+  QLineEdit*          myData;
+  QToolButton*        myToFirst;
+  QToolButton*        myToLast;
+  QToolButton*        myNext;
+  QToolButton*        myPrev;
+  QToolButton*        myClose;
+  QCheckBox*          myIsCaseSens;
+  QCheckBox*          myIsRegExp;
+  QCheckBox*          myWrap;
+  QWidget*            myWatched;
+  Searcher*           mySearcher;
+  int                 myControls;
+  int                 myActivators;
+  ShortcutList        myShortcuts;
+  QTimer*             myAutoHideTimer;
+  bool                myAutoHideEnabled;
+  QMap<int, QWidget*> myWidgets;
+};
+
+class QTX_EXPORT QtxSearchTool::Searcher
+{
+public:
+  Searcher();
+  virtual ~Searcher();
+
+  virtual bool find( const QString&, QtxSearchTool* ) = 0;
+  virtual bool findNext( const QString&, QtxSearchTool* ) = 0;
+  virtual bool findPrevious( const QString&, QtxSearchTool* ) = 0;
+  virtual bool findFirst( const QString&, QtxSearchTool* ) = 0;
+  virtual bool findLast( const QString&, QtxSearchTool* ) = 0;
+};
+
+class QTX_EXPORT QtxTreeViewSearcher : public QtxSearchTool::Searcher
+{
+public:
+  QtxTreeViewSearcher( QTreeView*, int = 0 );
+  virtual ~QtxTreeViewSearcher();
+
+  int                    searchColumn() const;
+  void                   setSearchColumn( int );
+  
+  virtual bool           find( const QString&, QtxSearchTool* );
+  virtual bool           findNext( const QString&, QtxSearchTool* );
+  virtual bool           findPrevious( const QString&, QtxSearchTool* );
+  virtual bool           findFirst( const QString&, QtxSearchTool* );
+  virtual bool           findLast( const QString&, QtxSearchTool* );
+
+protected:
+  virtual Qt::MatchFlags matchFlags( QtxSearchTool* ) const;
+  
+private:
+  QModelIndexList        findItems( const QString&, QtxSearchTool* );
+  QModelIndex            findNearest( const QModelIndex&, const QModelIndexList&, bool );
+  void                   showItem( const QModelIndex& );
+  QString                getId( const QModelIndex& );
+  int                    compareIndices( const QModelIndex&, const QModelIndex& );
+
+private:
+  QTreeView*             myView;
+  int                    myColumn;
+  QPersistentModelIndex  myIndex;
+};
+
+#endif // QTXSEARCHTOOL_H
index ff48080765945cb683b5e177b16aed42a222542e..e32a29aae24d7fae4a6032102565bb78e251ddbb 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : QtxSplash.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-// File:      QtxSplash.cxx
-// Author:    Vadim SANDLER
-
 #include "QtxSplash.h"
+#include "QtxResourceMgr.h"
 
-#include <qapplication.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qmessagebox.h>
-
-const int _PROGRESS_EVENT = QEvent::User + 10;
-const int _PROGRESS_WIDTH = 10;
+#include <QApplication>
+#include <QPainter>
+#include <QMessageBox>
+#include <QDesktopWidget>
 
 /*!
-  Class ProgressEvent [ internal ].
+  \class ProgressEvent
+  \internal
+  \brief Progress change custom event.
 */
-class ProgressEvent: public QCustomEvent
+
+class ProgressEvent: public QEvent
 {
 public:
-  ProgressEvent( const QString& msg, const int progress = 0 )
-    : QCustomEvent( id() ),
+  /*!
+    \brief Constructor.
+    \param msg progress message
+    \param progress current progress (for example, in %)
+  */
+  ProgressEvent( const QString& msg, const int progress )
+    : QEvent( (QEvent::Type)id() ),
       myMessage( msg ),
       myProgress( progress )
   {}
-  QString    message()  const { return myMessage;       } 
-  int        progress() const { return myProgress;      }
-  static int id()             { return _PROGRESS_EVENT; }
+  /*!
+    \brief Get progress message.
+    \return message
+  */
+  QString    message()  const { return myMessage; } 
+  /*!
+    \brief Get current progress.
+    \return current progress
+  */
+  int        progress() const { return myProgress; }
+  /*!
+    \brief Get message identifier.
+    \return custom message ID
+  */
+  static int id()             { return QEvent::User + 10; }
 
 private:
   QString myMessage;
   int     myProgress;
 };
 
-// Only one instance of splash screen is allowed
+/*!
+  \class QtxSplash
+  \brief The QtxSplash widget provides a splash screen that can be shown
+  during application startup.
+
+  A splash screen is a widget that is usually displayed when an application
+  is being started. 
+  Splash screens are often used for applications that have long start up times
+  to provide the user with feedback that the application is loading.
+
+  Only one instance of the QtxSplash widget can be created. To access the splash
+  screen widget, use static method QtxSplash::splash(), which creates an
+  instance of the QtxSplash widget (if it is not yet creaed) and returns a
+  pointer to it.
+  You should not destroy this instance - it is done automatically after
+  application main window is shown. Just use methods finish() to make splash
+  screen wait untill main window is shown.
+
+  The splash screen appears in the center of the screen. 
+  The most common usage is to show a splash screen before the main widget
+  is displayed on the screen. 
+  For example,
+  \code
+  int main(int argc, char *argv[])
+  {
+    QApplication app(argc, argv);
+    QPixmap pixmap(":/splash.png");
+    QtxSplash* splash = QtxsSplash::splash(pixmap);
+    splash->show();
+    app.processEvents();
+    ... // do application loading and initialization
+    MainWindow window;
+    window.show();
+    splash->finish(&window);
+    return app.exec();
+  }
+  \endcode
+  
+  The user can hide the splash screen by clicking on it with the mouse.
+  Since the splash screen is typically displayed before the event loop
+  has started running, it is necessary to periodically call
+  QApplication::processEvents() to receive the mouse clicks.
+  To activate the possibility of hiding the splash screen on the mouse
+  click, use setHideOnClick() method passing \c true as parameter.
+  By default, this feature is switched off.
+
+  It is sometimes useful to update the splash screen with any status messages
+  and/or progress information, for example, announcing connections established
+  or modules loaded as the application starts up.
+  QtxSplash class provides the functionality to show status messages
+  and(or) progress bar.
+
+  \code
+  QPixmap pixmap(":/splash.png");
+  QtxSplash* splash = QtxSplash::splash(pixmap);
+  splash->setProgress(0, 5); // progress from 0 to 5
+  splash->show();
+  app.processEvents();
+  // doing first step
+  splash->setMessage("Step 1");
+  splash->setProgress(1); // progress is 20%
+  qApp->processEvents();
+  // ... perform some actions
+  // doing second step
+  splash->setMessage("Step 2");
+  splash->setProgress(2); // progress is 40%
+  qApp->processEvents();
+  // ... perform some actions
+  ... et cetera
+  \endcode
+
+  There is a static function QtxSplash::setStatus() which allows to put the
+  next status message and current progress with one call.
+  It can substitue two calls: setMessage() and setProgress().
+
+  QtxSplash class provides also a lot of functions to customize its behavior.
+  Set progress bar width with setProgressWidth() method, its position and
+  direction with setProgressFlags().
+  It can be single-colored or gradient-colored. Use setProgressColors() methods
+  for this. You can even set your own gradient scale with QLinearGradient, 
+  QRadialGradient or QConicalGradient and use it for the progress
+  bar coloring. In addition, it is possible to enable/disable displaying
+  of the progress percentage with setPercentageVisible() method.
+
+  Displaying of the progress bar and status messages can be switched on/off with
+  setProgressVisible() and setMessageVisible() methods.
+
+  To change the progress bar and status message transparency, use
+  setOpacity() function. The methods setTextAlignment() and setTextColors()
+  can be used to change the attributes of the status messages.
+
+  The displayed message text can include constant info and status message.
+  The constant info is set by setConstantInfo() method and status message
+  is set by setMessage().
+
+  Sometimes it is useful to display an error message above the splash screen
+  window. For example, it can be necessary if an error occurs when loading
+  the application. Method setError() can be used to show the error message
+  and set the error code which can be then retrieved with the error() function.
+
+  There is one more helpful feature. The QtxSplash class can read all the
+  settings from the resource file with help of resource manager 
+  (QtxResourceMgr class). Refer to the method readSettings() for more details.
+*/
+
+//! The only one instance of splash screen
 QtxSplash* QtxSplash::mySplash = 0;
 
 /*!
+  \brief Constructor.
+  
   Construct a splash screen that will display the \a pixmap.
+  
+  \param pixmap splash screen pixmap
+  \sa setPixmap(), pixmap()
 */
 QtxSplash::QtxSplash( const QPixmap& pixmap )
-  : QWidget( 0, 0, WStyle_Customize | WStyle_StaysOnTop | WX11BypassWM | WStyle_NoBorder )
-{
-  myAlignment    = AlignBottom | AlignRight;
-  myColor        = white;
-  myHideOnClick  = false;
-  myProgress     = 0;
-  myTotal        = 0;
-  myGradientType = Vertical;
-  myError        = 0;
-  myStartColor   = red;
-  myMargin       = 5;
-
+: QWidget( 0, Qt::SplashScreen | Qt::WindowStaysOnTopHint ),
+  myAlignment( Qt::AlignBottom | Qt::AlignRight ),
+  myColor( Qt::white ),
+  myHideOnClick( false ),
+  myProgress( 0 ),
+  myTotal( 0 ),
+  myProgressWidth( 10 ),
+  myProgressFlags( BottomSide | LeftToRight ),
+  myMargin( 5 ),
+  myOpacity( 1.0 ),
+  myError( 0 ),
+  myShowPercent( true ),
+  myShowProgress( true ),
+  myShowMessage( true )
+{
+  setAttribute( Qt::WA_DeleteOnClose, true );
   setPixmap( pixmap );
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
 */
 QtxSplash::~QtxSplash()
 {
@@ -80,8 +215,14 @@ QtxSplash::~QtxSplash()
 }
 
 /*!
-  Returns an only instance of splash screen.
-  If \a px is valid sets this pixmap to the splash screen.
+  \brief Get the only instance of the splash screen widget.
+
+  If the splash screen widget does not exist yet, it is created with specified
+  pixmap. Otherwise, pixmap \a px is set to existing widget.
+
+  \param px splash screen pixmap
+  \return splash screen widget
+  \sa setPixmap(), pixmap()
 */
 QtxSplash* QtxSplash::splash( const QPixmap& px )
 {
@@ -93,24 +234,34 @@ QtxSplash* QtxSplash::splash( const QPixmap& px )
 }
 
 /*!
-  Sends the status message and (optionally) progress to the splash screen.
-  Can be used, for example, from the progress thread.
+  \brief Send the status message and (optionally) current progress 
+  to the splash screen.
+
+  If the second parameter is less than 0 (default) than it is ignored
+  and only the status message is changed. If you want to modify progress
+  also, pass positive value to the \a progress parameter explicitly.
+
+  \param msg progress status message
+  \param progress current progress
+  \sa setMessage(), setProgress()
 */
-void QtxSplash::setStatus( const QString& msg, 
-                          const int      progress )
+void QtxSplash::setStatus( const QString& msg, const int progress )
 {
   if ( mySplash ) {
     QApplication::postEvent( mySplash, new ProgressEvent( msg, progress ) );
-    qApp->processEvents();
+    QApplication::instance()->processEvents();
   }
 }
 
 /*!
-  Sets error status and shows error message box to the user.
+  \brief Set error status and show error message box to the user.
+  \param error error message
+  \param title message box title
+  \param code error code
+  \sa error()
 */
-void QtxSplash::error( const QString& error, const QString& title, const int code )
+void QtxSplash::setError( const QString& error, const QString& title, const int code )
 {
-  printf("QtxSplash::error: %s\n",error.latin1());
   if ( mySplash ) {
     mySplash->setError( code );
     QMessageBox::critical( mySplash, 
@@ -118,23 +269,42 @@ void QtxSplash::error( const QString& error, const QString& title, const int cod
                           error,
                           tr( "&OK" ) );
   }
+  else {
+    printf( "QtxSplash::error: %s\n",error.toLatin1().constData() );
+  }
 }
 
 /*!
-  Sets the pixmap that will be used as the splash screen's image to
-  \a pixmap.
+  \brief Set the pixmap that will be used as the splash screen's image.
+  \param pixmap spash screen image pixmap
+  \sa pixmap()
 */
 void QtxSplash::setPixmap( const QPixmap& pixmap )
 {
-  myPixmap = pixmap;
+  if ( pixmap.hasAlpha() ) {
+    QPixmap opaque( pixmap.size() );
+    QPainter p( &opaque );
+    p.fillRect( 0, 0, pixmap.width(), pixmap.height(), palette().background() );
+    p.drawPixmap( 0, 0, pixmap );
+    p.end();
+    myPixmap = opaque;
+  } 
+  else {
+    myPixmap = pixmap;
+  }
   QRect r( 0, 0, myPixmap.size().width(), myPixmap.size().height() );
   resize( myPixmap.size() );
   move( QApplication::desktop()->screenGeometry().center() - r.center() );
-  repaint();
+  if ( !isVisible() )
+    drawContents();
+  else
+    repaint();
 }
 
 /*!
-  Returns the pixmap that is used in the splash screen.
+  \brief Get the pixmap that is used as the splash screen's image.
+  \return spash screen image pixmap
+  \sa setPixmap()
 */
 QPixmap QtxSplash::pixmap() const
 {
@@ -142,14 +312,19 @@ QPixmap QtxSplash::pixmap() const
 }
 
 /*!
-  Sets/clear the 'hide on mouse click' flag.
-  Default is FALSE.
+  \brief Set/clear the 'hide on mouse click' flag.
+
   When this flag is set, user can hide the splash screen window
   by clicking on it with mouse.
   But for this to work it is necessary to call periodically
   QApplication::processEvents() in order to allow event loop to process
   events because usually main application loop is not yet started
   at that moment.
+
+  By default this flag is set to \c false.
+
+  \param on new flag state
+  \sa hideOnClick()
 */
 void QtxSplash::setHideOnClick( const bool on )
 {
@@ -157,7 +332,9 @@ void QtxSplash::setHideOnClick( const bool on )
 }
 
 /*!
-  Returns the 'hide on mouse click' flag.
+  \brief Get the 'hide on mouse click' flag.
+  \return 'hide on mouse click' flag
+  \sa setHideOnClick()
 */
 bool QtxSplash::hideOnClick() const
 {
@@ -165,7 +342,72 @@ bool QtxSplash::hideOnClick() const
 }
 
 /*!
-  Sets total progress steps to \a total.
+  \brief Enable/disable displaying of the progress bar.
+  \param on if \c true, progress bar will be enabled
+  \sa progressVisible(), setMessageVisible()
+*/
+void QtxSplash::setProgressVisible( const bool on )
+{
+  myShowProgress = on;
+  repaint();
+}
+
+/*!
+  \brief Check if the progress bar is displayed.
+  \return \c true if progress bar is enabled
+  \sa setProgressVisible()
+*/
+bool QtxSplash::progressVisible() const
+{
+  return myShowProgress;
+}
+
+/*!
+  \brief Enable/disable displaying of the status message.
+  \param on if \c true, status message will be enabled
+  \sa messageVisible(), setProgressVisible()
+*/
+void QtxSplash::setMessageVisible( const bool on )
+{
+  myShowMessage = on;
+  repaint();
+}
+
+/*!
+  \brief Check if the status message is displayed.
+  \return \c true if status message is enabled
+  \sa setMessageVisible()
+*/
+bool QtxSplash::messageVisible() const
+{
+  return myShowMessage;
+}
+
+/*!
+  \brief Enable/disable displaying progress percentage.
+  \param enable if \c true, percentage will be displayed
+  \sa percentageVisible()
+*/
+void QtxSplash::setPercentageVisible( const bool enable )
+{
+  myShowPercent = enable;
+  repaint();
+}
+
+/*!
+  \brief Check if the progress percentage is displayed.
+  \return \c true if percentage displaying is enabled
+  \sa setPercentageVisible()
+*/
+bool QtxSplash::percentageVisible() const
+{
+  return myShowPercent;
+}
+
+/*!
+  \brief Set total progress steps to \a total.
+  \param total total number of progress steps
+  \sa totalSteps(), setProgress(), progress()
 */
 void QtxSplash::setTotalSteps( const int total )
 {
@@ -174,8 +416,9 @@ void QtxSplash::setTotalSteps( const int total )
 }
 
 /*!
-  Return total progress steps number.
-  \sa setTotalSteps(), setProgress()
+  \brief Get total progress steps number.
+  \return total number of progress steps
+  \sa setTotalSteps(), setProgress(), progress()
 */
 int QtxSplash::totalSteps() const
 {
@@ -183,17 +426,20 @@ int QtxSplash::totalSteps() const
 }
     
 /*!
-  Sets progress to \a progress.
+  \brief Set current progress.
+  \param progress current progress
+  \sa progress(), setTotalSteps(), setTotalSteps(), 
 */
 void QtxSplash::setProgress( const int progress )
 {
-  myProgress = progress;
+  myProgress = progress > 0 ? progress : 0;
   repaint();
 }
 
 /*!
-  Return current progress.
-  \sa setProgress(), setTotalSteps()
+  \brief Get current progress.
+  \return current progress
+  \sa setProgress(), setTotalSteps(), setTotalSteps(), 
 */
 int QtxSplash::progress() const
 {
@@ -201,120 +447,252 @@ int QtxSplash::progress() const
 }
 
 /*!
-  Sets progress to \a progress and total progress steps to \a total.
+  \brief Set current progress to \a progress and total number of 
+  progress steps to \a total.
+  \param progress current progress
+  \param total total number of progress steps
 */
 void QtxSplash::setProgress( const int progress, const int total )
 {
   myTotal    = total;
-  myProgress = progress;
+  myProgress = progress > 0 ? progress : 0;
   repaint();
 }
 
 /*!
-  Sets progress bar colors to \a startColor and \a endColor.
-  If the colors differ the gradient color bar is drawed.
-  If the \a endColor is not valid, \a startColor is used instead.
-  \a gradientType sets the type of gradient to be used for progress
-  bar - horizontal or vertical. Default is vertical.
+  \brief Set splash window margin (a border width).
+
+  Note, that margin is used only for drawing the progress bar and status 
+  messages.
+
+  \param margin new margin width
+  \sa margin()
 */
-void QtxSplash::setProgressColors( const QColor& startColor, 
-                                  const QColor& endColor,
-                                  const int     gradientType )
+void QtxSplash::setMargin( const int margin )
 {
-  myStartColor   = startColor;
-  myEndColor     = endColor;
-  myGradientType = gradientType;
+  myMargin = margin > 0 ? margin : 0;
   repaint();
 }
 
 /*!
-  Return progress colors and gradient type (horizontal or vertical).
-  \sa setProgressColors()
+  \brief Get splash window margin (a border width).
+  \return current margin width
+  \sa setMargin()
 */
-int QtxSplash::progressColors( QColor& startColor, QColor& endColor )
+int QtxSplash::margin() const
 {
-  startColor = myStartColor;
-  endColor   = myEndColor;
-  return myGradientType;
+  return myMargin;
 }
 
 /*!
-  Sets message text alignment flags to \a alignment.
-  Default is AlignBottom | AlignRight.
+  \brief Set progress bar width.
+  \param width new progress bar width
+  \sa progressWidth()
 */
-void QtxSplash::setTextAlignment( const int alignment )
+void QtxSplash::setProgressWidth( const int width )
 {
-  myAlignment = alignment;
+  myProgressWidth = width > 0 ? width : 0;
   repaint();
 }
 
 /*!
-  Return message text alignment flags.
-  \sa setTextAlignment()
+  \brief Get progress bar width.
+  \return current progress bar width
+  \sa setProgressWidth()
 */
-int QtxSplash::textAlignment() const
+int QtxSplash::progressWidth() const
 {
-  return myAlignment;
+  return myProgressWidth;
+}
+
+/*!
+  \brief Set progress bar position and direction.
+
+  By default, progress bar is displayed at the bottom side and
+  shows progress from left to right but this behaviour can be changed.
+
+  \param flags ORed progress bar flags (QtxSplash::ProgressBarFlags)
+  \sa progressFlags()
+*/
+void QtxSplash::setProgressFlags( const int flags )
+{
+  myProgressFlags = flags;
+  if ( !( myProgressFlags & ( LeftSide | RightSide | TopSide | BottomSide ) ) )
+    myProgressFlags |= BottomSide;
+  if ( !( myProgressFlags & ( LeftToRight | RightToLeft ) ) )
+    myProgressFlags |= LeftToRight ;
+  repaint();
+}
+
+/*!
+  \brief Get progress bar flags: position and direction.
+  \return ORed progress bar flags (QtxSplash::ProgressBarFlags)
+  \sa setProgressFlags()
+*/
+int QtxSplash::progressFlags() const
+{
+  return myProgressFlags;
 }
 
 /*!
-  \brief Set margin.
+  \brief Set progress bar colors.
 
-  Margin is used when drawing progress bar and status messages.
+  If the colors differ the two-colored gradient bar is drawn.
   
-  \param m new margin
-  \sa margin()
+  If the \a endColor is not valid, \a startColor is used instead
+  (i.e. simple, one-colored progress bar is drawn).
+  
+  The parameter \a orientation defines the type of gradient 
+  to be drawn - horizontal or vertical. Default is vertical.
+
+  \param startColor start gradient color (or mono-color)
+  \param endColor end gradient color
+  \param orientation gradient type (Qt::Orientation)
+  \sa progressColors()
 */
-void QtxSplash::setMargin( const int m )
+void QtxSplash::setProgressColors( const QColor&         startColor, 
+                                  const QColor&         endColor,
+                                   const Qt::Orientation orientation )
 {
-  myMargin = m;
+  if ( !startColor.isValid() )
+    return;
+
+  QLinearGradient l;
+  if ( orientation == Qt::Vertical ) {
+    l.setStart( 0., 0. );
+    l.setFinalStop( 0., 1. );
+  }
+  else {
+    l.setStart( 0., 0. );
+    l.setFinalStop( 1., 0. );
+  }
+  l.setColorAt( 0., startColor );
+  l.setColorAt( 1., endColor.isValid() ? endColor : startColor );
+
+  setProgressColors( l );
+}
+
+/*!
+  \brief Set progress bar colors.
+
+  Use this method to display multi-colored gradient progress bar.
+  You have to use QLinearGradient, QRadialGradient or QConicalGradient
+  classes to define the gradient.
+
+  Note, that progress bar coordinates can be defined in absolute or
+  relative mode.
+  In absolute mode the actual coordinates of the gradient key points
+  (like start and final point for linear gradient, center and focal point
+  for radial gradient, etc) are calculated from the top-left progress bar's corner.
+  In relative mode you have to use values from 0 to 1 (including) to define
+  the key points positions.
+  
+  For example:
+  \code
+  QLinearGradient lg(0.5, 0, 1, 1);
+  lg.setColorAt(0.2, Qt::blue);
+  lg.setColorAt(0.6, Qt::red);
+  lg.setSpread(QGradient::RepeatSpread);
+  splash->setProgressGradient(lg);
+  \endcode
+  The above code creates linear gradient, which sets start stop to the
+  center of the progress bar; the final stop is assigned to its right-bottom corner.
+  The color scale (blue to red) is changed by the progress bar diagonal.
+
+  \param gradient color gradient to be used for progress bar coloring
+  \sa progressColors()
+*/
+void QtxSplash::setProgressColors( const QGradient& gradient )
+{
+  myGradient = gradient;
   repaint();
 }
 
 /*!
-  \brief Get margin.
-  \return current margin.
-  \sa setMargin()
+  \brief Get custom progress bar colors.
+  \return color gradient used for progress bar coloring
+  \sa setProgressColors()
 */
-int QtxSplash::margin() const
+const QGradient* QtxSplash::progressColors() const
 {
-  return myMargin;
+  return &myGradient;
 }
 
 /*!
-  Sets message text color to \a color.
-  Default is white.
-  \sa setTextColors()
+  \brief Set progress bar and status text message opacity.
+
+  The value should be in the range 0.0 to 1.0, where 0.0 is fully 
+  transparent and 1.0 is fully opaque.
+
+  \param opacity new opacity value
+  \sa opacity()
 */
-void QtxSplash::setTextColor( const QColor& color )
+void QtxSplash::setOpacity( const double opacity )
 {
-  myColor = color;
-  myShadowColor = QColor();
+  myOpacity = opacity < 0.0 ? 0.0 : ( opacity > 1.0 ? 1.0 : opacity );
   repaint();
 }
 
 /*!
-  Return message text color.
-  \sa setTextColor()
+  \brief Get progress bar and status text message opacity.
+  \return current opacity value
+  \sa setOpacity()
 */
-QColor QtxSplash::textColor() const
+double QtxSplash::opacity() const
 {
-  return myColor;
+  return myOpacity;
 }
 
 /*!
-  Sets message text color to \a color and text shadow color to \a shadow.
-  \sa setTextColor()
+  \brief Set message text alignment flags.
+
+  Default flags are Qt::AlignBottom | Qt::AlignRight.
+
+  \param alignment alignment flags (Qt::Alignment)
+  \sa textAlignment()
+*/
+void QtxSplash::setTextAlignment( const int alignment )
+{
+  myAlignment = alignment;
+  repaint();
+}
+
+/*!
+  \brief Get message text alignment flags.
+  \return alignment flags (Qt::Alignment)
+  \sa setTextAlignment()
+*/
+int QtxSplash::textAlignment() const
+{
+  return myAlignment;
+}
+
+/*!
+  \brief Set message text colors.
+
+  If \a shadow parameter is invalid color, the simple one-colored
+  text is drawn. Otherwise, second parameter is used to draw the text
+  shadow.
+
+  \param color message text color
+  \param shadow message text shadow color
+  \sa textColors()
 */
 void QtxSplash::setTextColors( const QColor& color, const QColor& shadow )
 {
-  myColor       = color;
+  if ( !myColor.isValid() )
+    return;
+
+  myColor = color;
   myShadowColor = shadow;
+
   repaint();
 }
 
 /*!
-  Return message text color and text shadow color.
+  \brief Get message text colors.
+  \param color message text color
+  \param shadow message text shadow color
   \sa setTextColors()
 */
 void QtxSplash::textColors( QColor& color, QColor& shadow ) const
@@ -324,7 +702,79 @@ void QtxSplash::textColors( QColor& color, QColor& shadow ) const
 }
 
 /*!
-  Returns current status message.
+  \brief Set constant info text to be displayed on the splash screen.
+
+  The displayed text includes constant info and status message.
+  The constant message is set by setConstantInfo() method and status
+  message is set by setMessage().
+
+  \param info constant info text
+  \sa constantInfo(), message(), setMessage(), option(), setOption()
+*/
+void QtxSplash::setConstantInfo( const QString& info )
+{
+  myInfo = info;
+  repaint();
+}
+
+/*!
+  \brief Get constant info text.
+  \return constant info text
+  \sa setConstantInfo(), message(), setMessage()
+*/
+QString QtxSplash::constantInfo() const
+{
+  return myInfo;
+}
+
+/*!
+  \brief Set constant information option value.
+
+  The option is a part of the constant information text,
+  which is replaced at the time of the displaying.
+
+  The following options are supported:
+  - \c \%A - could be used as application name
+  - \c \%V - could be used as application version
+  - \c \%L - could be used as application license information
+  - \c \%C - could be used as application copyright information
+
+  For example,
+  \code
+  splash->setContantInfo("%A [%V]\n%C");
+  splash->setOption("%A", "MyApplication" );
+  splash->setOption("%V", "Version 1.0" );
+  splash->setOption("%C", "Copyright (C) MyCompany 2008" );
+  \endcode
+  
+  \param name option name
+  \param option value
+  \sa option(), setConstantInfo(), constantInfo()
+*/
+void QtxSplash::setOption( const QString& name, const QString& value )
+{
+  myOptions[ name ] = value;
+  repaint();
+}
+
+/*!
+  \brief Get constant information option value.
+  \param name option name
+  \return option value or empty string if option is not set
+  \sa setOption(), setConstantInfo(), constantInfo()
+*/
+QString QtxSplash::option( const QString& name ) const
+{
+  QString val;
+  if ( myOptions.contains( name ) )
+    val = myOptions[ name ];
+  return val;
+}
+
+/*!
+  \brief Get current status message.
+  \return status message
+  \sa setMessage(), constantInfo(), setConstantInfo()
 */
 QString QtxSplash::message() const
 {
@@ -332,8 +782,14 @@ QString QtxSplash::message() const
 }
 
 /*!
-  Return error code. If no errors were occured returns 0.
-  Error code can be set by error( QString&, QString, int ).
+  \brief Get error code.
+
+  This function returns error code, set previously with 
+  setError() method.
+  If no error code has been set, 0 is returned.
+
+  \return last error code
+  \sa setError()
 */
 int QtxSplash::error() const
 {
@@ -341,22 +797,26 @@ int QtxSplash::error() const
 }
 
 /*!
-    Makes the splash screen wait until the widget \a mainWin is displayed
-    before calling close() on itself.
+  \brief Wait until widget \a mainWin is displayed.
+
+  Makes the splash screen wait until the widget \a mainWin is displayed
+  and then hide and close splash window.
+
+  \param mainWin application main window 
 */
 void QtxSplash::finish( QWidget* mainWin )
 {
   if ( mainWin ) {
 #if defined(Q_WS_X11)
-    extern void qt_wait_for_window_manager( QWidget* w );
-    qt_wait_for_window_manager( mainWin );
+    extern void qt_x11_wait_for_window_manager(QWidget *mainWin);
+    qt_x11_wait_for_window_manager(mainWin);
 #endif
   }
   close();
 }
 
 /*!
-  Repaint the splash screen.
+  \brief Repaint the splash screen.
 */
 void QtxSplash::repaint()
 {
@@ -366,168 +826,606 @@ void QtxSplash::repaint()
 }
 
 /*!
-  Draws the \a message text onto the splash screen with color \a
-  color and aligns the text according to the flags in \a alignment.
+  \brief Read splash settings from the resources manager.
+  
+  This method can be used to setup the splash screen look-n-feel.
+  By default, "splash" section of the resources file is used, but you can
+  use any other section.
+  All the splash screen parameters can be defined via resources file:
+  - \c "image" : splash screen image, see setPixmap()
+  - \c "margin" : splash window margin, see setMargin()
+  - \c "show_progress" : show progress bar flag, see setProgressVisible()
+  - \c "show_message" : show status messages flag, see setMessageVisible()
+  - \c "show_percents" : show progress percentage flag, see setPercentageVisible()
+  - \c "progress_width" : progress bar width(), see setProgressWidth()
+  - \c "progress_flags" : progress bar position and direction, see setProgressFlags()
+  - \c "constant_info" : status messages constant info, see setConstantInfo()
+  - \c "text_colors" : status messages color(s), see setTextColors()
+  - \c "progress_colors" : progress bar color(s), see setProgressColors()
+  - \c "opacity" : progress bar and status messages opacity, see setOpacity()
+  - \c "font" : status messages font
+  - \c "alignment" : status messages alignment flags, see setTextAlignment()
+  - \c "hide_on_click" : hide-on-click flag, see setHideOnClick()
+
+  \param resMgr resources manager
+  \param section resources file section name (if empty, the default "splash"
+  section is used).
+*/
+void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section )
+{
+  QString resSection = section.isEmpty() ? QString( "splash" ) : section;
+  
+  // pixmap
+  QString pxname;
+  if ( resMgr->value( resSection, "image", pxname ) ) {
+    QPixmap px( pxname );
+    if ( !px.isNull() )
+      setPixmap( px );
+  }
+
+  // hide-on-click
+#ifdef _DEBUG_
+  setHideOnClick( true );
+#else
+  bool bHide;
+  if ( resMgr->value( resSection, "hide_on_click", bHide ) ) {
+    setHideOnClick( bHide );
+  }
+#endif
+
+  // enable progress bar
+  bool bShowProgress;
+  if ( resMgr->value( resSection, "show_progress", bShowProgress ) ) {
+    setProgressVisible( bShowProgress );
+  }
+  
+  // enable status message
+  bool bShowMessage;
+  if ( resMgr->value( resSection, "show_message", bShowMessage ) ) {
+    setMessageVisible( bShowMessage );
+  }
+  
+  // margin
+  int m;
+  if ( resMgr->value( resSection, "margin", m ) ) {
+    setMargin( m );
+  }
+
+  // progress bar width
+  int pw;
+  if ( resMgr->value( resSection, "progress_width", pw ) ) {
+    setProgressWidth( pw );
+  }
+
+  // progress bar position and direction
+  QString pf;
+  if ( resMgr->value( resSection, "progress_flags", pf ) ) {
+    bool bOk;
+    int fl = pf.toInt( &bOk );
+    if ( !bOk ) {
+      fl = 0;
+      QStringList opts = pf.split( QRegExp( "," ), QString::SkipEmptyParts );
+      for ( int i = 0; i < opts.count(); i++ ) {
+       QString opt = opts[i].trimmed().toLower();
+       if ( opt == "left" )
+         fl = fl | LeftSide;
+       else if ( opt == "right" )
+         fl = fl | RightSide;
+       else if ( opt == "top" )
+         fl = fl | TopSide;
+       else if ( opt == "bottom" )
+         fl = fl | BottomSide;
+       else if ( opt == "left_to_right" )
+         fl = fl | LeftToRight;
+       else if ( opt == "right_to_left" )
+         fl = fl | RightToLeft;
+      }
+    }
+    setProgressFlags( fl );
+  }
+  
+  // opacity
+  double op;
+  if ( resMgr->value( resSection, "opacity", op ) ) {
+    setOpacity( op );
+  }
+
+  // font
+  QFont f;
+  if ( resMgr->value( resSection, "font", f ) ) {
+    setFont( f );
+  }
+
+  // text alignment
+  QString al;
+  if ( resMgr->value( resSection, "alignment", al ) ) {
+    bool bOk;
+    int fl = al.toInt( &bOk );
+    if ( !bOk ) {
+      fl = 0;
+      QStringList opts = al.split( QRegExp( "," ), QString::SkipEmptyParts );
+      for ( int i = 0; i < opts.count(); i++ ) {
+       QString opt = opts[i].trimmed().toLower();
+       if ( opt == "left" )
+         fl = fl | Qt::AlignLeft;
+       else if ( opt == "right" )
+         fl = fl | Qt::AlignRight;
+       else if ( opt == "top" )
+         fl = fl | Qt::AlignTop;
+       else if ( opt == "bottom" )
+         fl = fl | Qt::AlignBottom;
+       else if ( opt == "hcenter" )
+         fl = fl | Qt::AlignHCenter;
+       else if ( opt == "vcenter" )
+         fl = fl | Qt::AlignVCenter;
+       else if ( opt == "justify" )
+         fl = fl | Qt::AlignJustify;
+       else if ( opt == "center" )
+         fl = fl | Qt::AlignCenter;
+      }
+    }
+    setTextAlignment( fl );
+  }
+  // progress color(s)
+  QString pc;
+  QLinearGradient  lgrad;
+  QRadialGradient  rgrad;
+  QConicalGradient cgrad;
+  if ( resMgr->value( resSection, "progress_color",  lgrad ) || 
+       resMgr->value( resSection, "progress_colors", lgrad ) ) {
+    // linear gradient-colored progress bar
+    setProgressColors( lgrad );
+  }
+  else if ( resMgr->value( resSection, "progress_color",  rgrad ) || 
+           resMgr->value( resSection, "progress_colors", rgrad ) ) {
+    // radial gradient-colored progress bar
+    setProgressColors( rgrad );
+  }
+  else if ( resMgr->value( resSection, "progress_color",  cgrad ) || 
+           resMgr->value( resSection, "progress_colors", cgrad ) ) {
+    // conical gradient-colored progress bar
+    setProgressColors( cgrad );
+  }
+  else if ( resMgr->value( resSection, "progress_color",  pc ) || 
+           resMgr->value( resSection, "progress_colors", pc ) ) {
+    // one/two-colored progress bar
+    QStringList colors = pc.split( "|", QString::SkipEmptyParts );
+    QColor c1, c2;
+    Qt::Orientation o = Qt::Vertical;
+    if ( colors.count() > 0 ) c1 = QColor( colors[0] );
+    if ( colors.count() > 1 ) c2 = QColor( colors[1] );
+    int gt;
+    if ( colors.count() > 2 ) {
+      bool bOk;
+      gt = colors[2].toInt( &bOk );
+      if ( bOk ) {
+       if ( gt == 0 )
+         o = Qt::Horizontal;
+      }
+      else {
+       if ( colors[2].toLower().startsWith( "h" ) )
+         o = Qt::Horizontal;
+      }
+    }
+    setProgressColors( c1, c2, o );
+  }
+  // show percents
+  bool bPercent;
+  if ( resMgr->value( resSection, "show_percents", bPercent ) ) {
+    setPercentageVisible( bPercent );
+  }
+
+  // text color(s)
+  QString tc;
+  if ( resMgr->value( resSection, "text_color",  tc ) || 
+       resMgr->value( resSection, "text_colors", tc ) ) {
+    QStringList colors = tc.split( "|", QString::SkipEmptyParts );
+    QColor c1, c2;
+    if ( colors.count() > 0 )
+      c1 = QColor( colors[0] );
+    if ( colors.count() > 1 )
+      c2 = QColor( colors[1] );
+    setTextColors( c1, c2 );
+  }
+
+  // const info
+  QString cinfo;
+  if ( resMgr->value( resSection, "constant_info", cinfo, false ) ||
+       resMgr->value( resSection, "info", cinfo, false ) ) {
+    setConstantInfo( cinfo.split( "|", QString::KeepEmptyParts ).join( "\n" ) );
+  }
+}
+
+/*!
+  \brief Set status message for the splash screen and define its color 
+  and aligment flags.
+  \param msg status message
+  \param alignment message text alignment flags (Qt::Alignment)
+  \param color message text color
+  \sa message(), constantInfo(), setConstantInfo()
 */
-void QtxSplash::message( const QString& msg, 
-                        int            alignment,
-                        const QColor&  color )
+void QtxSplash::setMessage( const QString& msg, 
+                           int            alignment,
+                           const QColor&  color )
 {
   myMessage   = msg;
   myAlignment = alignment;
-  myColor     = color;
+  if ( color.isValid() )
+    myColor = color;
   repaint();
 }
 
 /*!
-  This is an overloaded member function, provided for convenience. 
-  It behaves essentially like the above function.
-  Draws the \a message text onto the splash screen with default color
-  and aligns the text according to the default alignment flags.
+  \overload
+  \brief Set status message for the splash screen.
+  \param msg status message
+  \sa message(), constantInfo(), setConstantInfo()
 */
-void QtxSplash::message( const QString& msg )
+void QtxSplash::setMessage( const QString& msg )
 {
   myMessage = msg;
   repaint();
 }
 
 /*!
-  Removes the message being displayed on the splash screen.
-  \sa message()
+  \brief Remove the message being displayed on the splash screen.
+
+  This is equivalent to setMessage("");
+
+  \sa message(), setMessage()
 */
 void QtxSplash::clear()
 {
-  myMessage = QString::null;
+  myMessage.clear();
   repaint();
 }
 
 /*!
-  Draw the contents of the splash screen using painter \a painter.
+  \brief Draw the contents of the splash screen.
+  \param p painter
 */
-void QtxSplash::drawContents( QPainter* painter )
+void QtxSplash::drawContents( QPainter* p )
 {
-  QRect r = rect();
-  int m = margin();
-  if ( myTotal > 0 ) {
-    // draw progress bar
-    if ( myGradientType == Horizontal ) {
-      int tng = r.width() - r.x() - m*2;
-      int ng = (int) ( 1.0 * tng * ( myProgress > 0 ? myProgress : 0 ) / myTotal ); 
-      int h1, h2, s1, s2, v1, v2;
-      myStartColor.hsv( &h1, &s1, &v1 );
-      myEndColor.isValid() ? myEndColor.hsv( &h2, &s2, &v2 ) :
-                            myStartColor.hsv( &h2, &s2, &v2 );
-      for ( int i = 0; i < ng; i++ ) {
-       painter->setPen( QColor( h1 + ((h2-h1)*i)/(tng-1),
-                                s1 + ((s2-s1)*i)/(tng-1),
-                                v1 + ((v2-v1)*i)/(tng-1), 
-                                QColor::Hsv ) );
-       painter->drawLine( r.x()+m+i,
-                          r.height()-m-_PROGRESS_WIDTH,
-                          r.x()+m+i,
-                          r.height()-m );
-      }
-    }
-    else {
-      int ng = (int) ( 1.0 * (r.width() - r.x() - m*2 - 1) * ( myProgress > 0 ? myProgress : 0 ) / myTotal ); 
-      int h1, h2, s1, s2, v1, v2;
-      myStartColor.hsv( &h1, &s1, &v1 );
-      myEndColor.isValid() ? myEndColor.hsv( &h2, &s2, &v2 ) :
-                            myStartColor.hsv( &h2, &s2, &v2 );
-      for ( int i = 0; i < _PROGRESS_WIDTH; i++ ) {
-       painter->setPen( QColor( h1 + ((h2-h1)*i)/(_PROGRESS_WIDTH-1),
-                                s1 + ((s2-s1)*i)/(_PROGRESS_WIDTH-1),
-                                v1 + ((v2-v1)*i)/(_PROGRESS_WIDTH-1), 
-                                QColor::Hsv ) );
-       painter->drawLine( r.x()+m,
-                          r.height()-m-_PROGRESS_WIDTH+i,
-                          r.x()+m+ng,
-                          r.height()-m-_PROGRESS_WIDTH+i );
-      }
-    }
-    // draw progress bar outline rectangle
-    painter->setPen( palette().active().dark() );
-    painter->drawLine( r.x()+m, 
-                      r.height()-m-_PROGRESS_WIDTH,
-                      r.width()-m,
-                      r.height()-m-_PROGRESS_WIDTH );
-    painter->drawLine( r.x()+m,
-                      r.height()-m-_PROGRESS_WIDTH,
-                      r.x()+m,
-                      r.height()-m );
-    painter->setPen( palette().active().light() );
-    painter->drawLine( r.x()+m,
-                      r.height()-m,
-                      r.width()-m,
-                      r.height()-m );
-    painter->drawLine( r.width()-m,
-                      r.height()-m-_PROGRESS_WIDTH,
-                      r.width()-m,
-                      r.height()-m );
-  }
-  // draw status
-  if ( !myMessage.isEmpty() ) {
-    QFontMetrics f( font() );
-    int spacing = f.lineSpacing();
-    int shift = myTotal > 0 ? _PROGRESS_WIDTH : _PROGRESS_WIDTH; // : 0
-    int i = myMessage.length() - 1;
-    while( i >= 0 && myMessage[ i-- ] == '\n' )
-      shift += spacing;
-    QRect r1( r.x() + m, r.y() + m, r.width() - m*2, r.height() - m*2 - shift );
-    QRect r2 = r1;
-    if ( myAlignment & Qt::AlignLeft   ) r2.setLeft  ( r2.left()   + 1 );
-    if ( myAlignment & Qt::AlignTop    ) r2.setTop   ( r2.top()    + 1 );
-    if ( myAlignment & Qt::AlignRight  ) r2.setRight ( r2.right()  + 1 );
-    if ( myAlignment & Qt::AlignBottom ) r2.setBottom( r2.bottom() + 1 );
-    if ( myShadowColor.isValid() ) {
-      painter->setPen( myShadowColor );
-      painter->drawText( r2, myAlignment, myMessage );
-    }
-    painter->setPen( myColor );
-    painter->drawText( r1, myAlignment, myMessage );
+  // draw progress bar
+  if ( myTotal > 0 && progressVisible() ) {
+    p->save();
+    drawProgressBar( p );
+    p->restore();
+  }
+
+  // draw status message
+  if ( !fullMessage().isEmpty() && messageVisible() ) {
+    p->save();
+    drawMessage( p );
+    p->restore();
   }
 }
 
 /*!
-  Mouse press event.
+  \brief Process mouse button pressing event.
+
   Hides splash screen if the 'hide on mouse click' flag is set.
-  \sa setHideOnClick()
+
+  \param me mouse event (not used)
+  \sa hideOnClick(), setHideOnClick()
 */
-void QtxSplash::mousePressEvent( QMouseEvent* )
+void QtxSplash::mousePressEvent( QMouseEvent* /*me*/ )
 {
   if ( myHideOnClick )
     hide();
 }
 
 /*!
-  Processes custom event sent by setStatus() method.
+  \brief Customize paint event.
+
+  This function is implemented to work-around the Qt bug
+  on some Linux distribututions when the drawing on the 
+  splash screen widget is not allowed.
+
+  \param pe paint event (not used)
+*/
+void QtxSplash::paintEvent( QPaintEvent* /*pe*/ )
+{
+  QPainter p( this );
+  QPixmap pix = palette().brush( backgroundRole() ).texture();
+  p.drawPixmap( 0, 0, pix );
+}
+
+/*!
+  \brief Process custom event sent by setStatus() method.
+  \param ce custom event
   \sa setStatus().
 */
-void QtxSplash::customEvent( QCustomEvent* ce )
+void QtxSplash::customEvent( QEvent* ce )
 {
   if ( ce->type() == ProgressEvent::id() ) {
     ProgressEvent* pe = (ProgressEvent*)ce;
-    pe->message().isEmpty() ? clear() : message( pe->message() );
-    setProgress( pe->progress() );
-    qApp->processEvents();
+    pe->message().isEmpty() ? clear() : setMessage( pe->message() );
+    if ( pe->progress() >= 0 )
+      setProgress( pe->progress() );
+    QApplication::instance()->processEvents();
+  }
+}
+
+/*!
+  \brief Check if the gradient is defined in the relative coordinates [static].
+  \internal
+  \return \c true if gradient is defined in the relative coordinates
+*/
+static bool checkGradient( const QGradient* g )
+{
+#define BOUNDED( a, min, max ) ( a >= min && a <= max )
+  if ( g->type() == QGradient::LinearGradient ) {
+    const QLinearGradient* lg = static_cast<const QLinearGradient*>( g );
+    return BOUNDED( lg->start().x(), 0.0, 1.0 ) && 
+           BOUNDED( lg->start().y(), 0.0, 1.0 ) && 
+           BOUNDED( lg->finalStop().x(), 0.0, 1.0 ) && 
+           BOUNDED( lg->finalStop().y(), 0.0, 1.0 );
+  }
+  if ( g->type() == QGradient::RadialGradient ) {
+    const QRadialGradient* rg = static_cast<const QRadialGradient*>( g );
+    return BOUNDED( rg->center().x(), 0.0, 1.0 ) && 
+           BOUNDED( rg->center().y(), 0.0, 1.0 ) && 
+           BOUNDED( rg->focalPoint().x(), 0.0, 1.0 ) && 
+           BOUNDED( rg->focalPoint().y(), 0.0, 1.0 ); // && BOUNDED( rg->radius(), 0.0, 1.0 );
   }
+  if ( g->type() == QGradient::ConicalGradient ) {
+    const QConicalGradient* cg = static_cast<const QConicalGradient*>( g );
+    return BOUNDED( cg->center().x(), 0.0, 1.0 ) && 
+           BOUNDED( cg->center().y(), 0.0, 1.0 );
+  }
+  return false;
 }
 
 /*!
-  Draws the splash screen window [ internal ].
+  \brief Draw progress bar.
+  \param p painter
+  \sa drawMessage()
+*/
+void QtxSplash::drawProgressBar( QPainter* p )
+{
+  // get rect, margin, progress bar width
+  QRect r = rect();
+  int m   = margin();
+  int pw  = progressWidth();
+
+  // calculate drawing rect
+  // ... first set default position (if none or wrong position is set)
+  if ( myProgressFlags & BottomSide )
+    r = QRect( r.x() + m, r.height() - (m + pw), r.width() - 2 * m, pw );
+  else if ( myProgressFlags & TopSide )
+    r = QRect( r.x() + m, r.y() + m, r.width() - 2 * m, pw );
+  else if ( myProgressFlags & LeftSide )
+    r = QRect( r.x() + m, r.y() + m, pw, r.height() - 2 * m );
+  else if ( myProgressFlags & RightSide )
+    r = QRect( r.width() - (m + pw), r.y() + m, pw, r.height() - 2 * m );
+
+  QRect cr = r;
+  if ( myProgressFlags & TopSide || myProgressFlags & BottomSide ) {
+    cr.setWidth( (int)( r.width() * ( myProgress > 0 ? myProgress : 0 ) / myTotal ) );
+    if ( myProgressFlags & RightToLeft )
+      cr.translate( r.width() - cr.width(), 0 );
+  }
+  else if ( myProgressFlags & LeftSide || myProgressFlags & RightSide ) {
+    cr.setHeight( (int)( r.height() * ( myProgress > 0 ? myProgress : 0 ) / myTotal ) );
+    if ( myProgressFlags & RightToLeft)
+      cr.translate( 0, r.height() - cr.height() );
+  }
+  QBrush b;
+  switch ( progressColors()->type() ) {
+    case QGradient::LinearGradient:
+    {
+      QLinearGradient lg;
+      const QLinearGradient* other = static_cast<const QLinearGradient*>( progressColors() );
+      if ( checkGradient( other ) ) {
+       // gradient is defined in relative coordinates [0.0 - 1.0]
+       lg.setStart( r.left() + r.width()  * other->start().x(), 
+                    r.top()  + r.height() * other->start().y() );
+       lg.setFinalStop( r.left() + r.width()  * other->finalStop().x(), 
+                        r.top()  + r.height() * other->finalStop().y() );
+      }
+      else {
+       // gradient is defined in absolute coordinates
+       // according to its dimensions
+       lg.setStart( r.topLeft() + other->start() );
+       lg.setFinalStop( r.topLeft() + other->finalStop() );
+      }
+      
+      lg.setStops( other->stops() );
+      lg.setSpread( other->spread() );
+      
+      b = QBrush( lg );
+      
+      break;
+    } // case QGradient::LinearGradient
+    case QGradient::RadialGradient:
+    {
+      QRadialGradient rg;
+      const QRadialGradient* other = static_cast<const QRadialGradient*>( progressColors() );
+      if ( checkGradient( other ) ) {
+       // gradient is defined in relative coordinates [0.0 - 1.0]
+       rg.setCenter( r.left() + r.width()  * other->center().x(),
+                     r.top()  + r.height() * other->center().y() );
+       rg.setFocalPoint( r.left() + r.width()  * other->focalPoint().x(),
+                         r.top()  + r.height() * other->focalPoint().y() );
+      }
+      else {
+       // gradient is defined in absolute coordinates
+       // according to its dimensions
+       rg.setCenter( r.topLeft() + other->center() );
+       rg.setFocalPoint( r.topLeft() + other->focalPoint() );
+      }
+      
+      // only width is taken into account for the radius in relative mode
+      rg.setRadius( other->radius() > 1.0 ? other->radius() : r.width() * other->radius() );
+      
+      rg.setStops( other->stops() );
+      rg.setSpread( other->spread() );
+      
+      b = QBrush( rg );
+      
+      break;
+    } // case QGradient::RadialGradient
+    case QGradient::ConicalGradient:
+    {
+      QConicalGradient cg;
+      const QConicalGradient* other = static_cast<const QConicalGradient*>( progressColors() );
+      if ( checkGradient( other ) ) {
+       // gradient is defined in relative coordinates [0.0 - 1.0]
+       cg.setCenter( r.left() + r.width()  * other->center().x(),
+                     r.top()  + r.height() * other->center().y() );
+      }
+      else {
+       // gradient is defined in absolute coordinates
+       // according to its dimensions
+       cg.setCenter( r.topLeft() + other->center() );
+      }
+
+      cg.setAngle( other->angle() );
+      cg.setStops( other->stops() );
+      cg.setSpread( other->spread() );
+      
+      b = QBrush( cg );
+      
+      break;
+    } // case QGradient::RadialGradient
+  default:
+    b = QBrush( Qt::red ); // default is simple red-colored progress bar
+    break;
+  }
+  
+  p->setOpacity( myOpacity );
+
+  // draw progress bar outline rectangle
+  p->setPen( palette().color( QPalette::Dark ) );
+  p->drawLine( r.left(), r.top(), r.right(), r.top() );
+  p->drawLine( r.left(), r.top(), r.left(), r.bottom() );
+  p->setPen( palette().color( QPalette::Light ) );
+  p->drawLine( r.left(), r.bottom(), r.right(), r.bottom() );
+  p->drawLine( r.right(), r.top(), r.right(), r.bottom() );
+
+  r.setCoords( r.left()+1, r.top()+1, r.right()-1, r.bottom()-1 );
+  p->setClipRect( cr );
+  p->fillRect( r, b );
+  p->setClipping( false );
+
+  if ( myShowPercent ) {
+    int percent = ( int )( ( myProgress > 0 ? myProgress : 0 ) * 100 / myTotal );
+    QFont f = font();
+    f.setPixelSize( r.height() - 4 );
+    p->setFont( f );
+    // draw shadow status text
+    if ( myShadowColor.isValid() ) {
+      QRect rs = r;
+      rs.moveTopLeft( rs.topLeft() + QPoint( 1,1 ) );
+      p->setPen( myShadowColor );
+      p->drawText( rs, Qt::AlignCenter, QString( "%1%" ).arg( percent ) );
+    }
+    p->setPen( myColor );
+    p->drawText( r, Qt::AlignCenter, QString( "%1%" ).arg( percent ) );
+  }
+}
+
+/*!
+  \brief Draw status message.
+  \param p painter
+  \sa drawProgressBar()
+*/
+void QtxSplash::drawMessage( QPainter* p )
+{
+  // get rect, margin, progress bar width
+  QRect r = rect();
+  int m   = margin();
+  int pw  = progressVisible() ? progressWidth() : 0;
+
+  // calculate drawing rect
+  QFontMetrics f( font() );
+  int spacing = f.lineSpacing();
+  // ... base rect
+  QRect r1( r.x() + m, r.y() + m, r.width() - 2 * m, r.height() - 2 * m );
+  r1.setY( r1.y() - f.leading() );
+  // ... take into account progress bar
+  if ( 1 ) {              // if ( myTotal > 0 ) : vsr changed: otherwise text is jumping
+    if ( myProgressFlags & BottomSide )
+      r1.setHeight( r1.height() - pw );
+    else if ( myProgressFlags & TopSide )
+      r1.setY( r1.y() + pw );
+    else if ( myProgressFlags & LeftSide )
+      r1.setX( r1.x() + pw );
+    else if ( myProgressFlags & RightSide )
+      r1.setWidth( r1.width() - pw );
+  }
+  
+  // ... take into account trailing '\n' symbols
+  int shift = 0;
+  QString msg = fullMessage();
+  int i = msg.length() - 1;
+  while( i >= 0 && msg[ i-- ] == '\n' )
+    shift += spacing;
+  r1.setHeight( r1.height() - shift );
+
+  p->setOpacity( myOpacity );
+
+  // draw shadow status text
+  if ( myShadowColor.isValid() ) {
+    QRect r2 = r1;
+    if ( myAlignment & Qt::AlignLeft   ) r2.setLeft  ( r2.left()   + 1 );
+    if ( myAlignment & Qt::AlignTop    ) r2.setTop   ( r2.top()    + 1 );
+    if ( myAlignment & Qt::AlignRight  ) r2.setRight ( r2.right()  + 1 );
+    if ( myAlignment & Qt::AlignBottom ) r2.setBottom( r2.bottom() + 1 );
+    p->setPen( myShadowColor );
+    p->drawText( r2, myAlignment, msg );
+  }
+
+  // draw foreground status text
+  p->setPen( myColor );
+  p->drawText( r1, myAlignment, msg );
+}
+
+/*!
+  \brief Draw the splash screen window contents.
+  \internal
 */
 void QtxSplash::drawContents()
 {
   QPixmap textPix = myPixmap;
-  QPainter painter( &textPix, this );
+  QPainter painter( &textPix );
+  painter.initFrom( this );
   drawContents( &painter );
-  setErasePixmap( textPix );
+  QPalette pal = palette();
+  pal.setBrush( backgroundRole(), QBrush( textPix ) );
+  setPalette( pal );
 }
 
 /*!
-  Sets error code [ internal ].
+  \brief Sets error code.
+  \param code error code
+  \internal
 */
 void QtxSplash::setError( const int code )
 {
   myError = code;
 }
+
+/*!
+  \brief Get full message which includes constant info and status message.
+  \return get fill message text
+  \sa constantInfo(), setConstantInfo(), message(), setMessage()
+  \internal
+*/
+QString QtxSplash::fullMessage() const
+{
+  QStringList info;
+
+  QString cinfo = myInfo;
+  cinfo = cinfo.replace( QRegExp( "%A" ), option( "%A" ) );
+  cinfo = cinfo.replace( QRegExp( "%V" ), option( "%V" ) );
+  cinfo = cinfo.replace( QRegExp( "%L" ), option( "%L" ) );
+  cinfo = cinfo.replace( QRegExp( "%C" ), option( "%C" ) );
+
+  if ( !cinfo.isEmpty() )
+    info << cinfo;
+  if ( !myMessage.isEmpty() )
+    info << myMessage;
+  return info.join( "\n" );
+}
index 05b7088a1f9d1c2be12c5b694b72a56a67f2bcb6..07475c65a6688ff89ee19d53cfcb0efde8d361ce 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : QtxSplash.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-// File:      QtxSplash.h
-// Author:    Vadim SANDLER
-
 #ifndef QTXSPLASH_H
 #define QTXSPLASH_H
 
 #include "Qtx.h"
 
-#include <qpixmap.h>
-#include <qwidget.h>
+#include <QWidget>
+#include <QPixmap>
+#include <QGradient>
+#include <QMap>
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
+class QtxResourceMgr;
+
 class QTX_EXPORT QtxSplash : public QWidget
 {
-    Q_OBJECT
+  Q_OBJECT
 
 private:
-    QtxSplash( const QPixmap& = QPixmap() );
+  QtxSplash( const QPixmap& );
 
 public:
-    enum { Horizontal, Vertical };
-
-    virtual ~QtxSplash();
-
-    static QtxSplash* splash( const QPixmap& = QPixmap() );
-    static void       setStatus( const QString&, const int = 0 );
-    static void       error( const QString&, const QString& = QString::null, const int = -1 );
-
-    void              setPixmap( const QPixmap& );
-    QPixmap           pixmap() const;
-
-    void              setHideOnClick( const bool );
-    bool              hideOnClick() const;
-
-    void              setTotalSteps( const int );
-    int               totalSteps() const;
-    void              setProgress( const int );
-    int               progress() const;
-    void              setProgress( const int, const int );
-    void              setProgressColors( const QColor&, 
-                                        const QColor& = QColor(),
-                                        const int     = Vertical );
-    int               progressColors( QColor&, QColor& );
-
-    void              setTextAlignment( const int );
-    int               textAlignment() const;
-
-    void              setMargin( const int );
-    int               margin() const;
-
-    void              setTextColor( const QColor& );
-    QColor            textColor() const;
-    void              setTextColors( const QColor&, const QColor& = QColor() );
-    void              textColors( QColor&, QColor& ) const;
-    
-    QString           message() const;
-
-    int               error() const;
-
-    void              finish( QWidget* );
-    void              repaint();
+  //! Progress bar position and direction
+  typedef enum {
+    LeftSide     = 0x0001,      //!< progress bar is displayed at the left side
+    RightSide    = 0x0002,      //!< progress bar is displayed at the right side
+    TopSide      = 0x0004,      //!< progress bar is displayed at the top side
+    BottomSide   = 0x0008,      //!< progress bar is displayed at the bottom side
+    LeftToRight  = 0x0010,      //!< show progress from left to right (from top to bottom)
+    RightToLeft  = 0x0020       //!< show progress from right to left (from bottom to top)
+  } ProgressBarFlags;
+  
+  virtual ~QtxSplash();
+  
+  static QtxSplash* splash( const QPixmap& = QPixmap() );
+  
+  static void       setStatus( const QString&, const int = -1 );
+  static void       setError( const QString&, const QString& = QString(), const int = -1 );
+  
+  void              setPixmap( const QPixmap& );
+  QPixmap           pixmap() const;
+  
+  void              setHideOnClick( const bool );
+  bool              hideOnClick() const;
+
+  void              setProgressVisible( const bool );
+  bool              progressVisible() const;
+
+  void              setMessageVisible( const bool );
+  bool              messageVisible() const;
+
+  void              setPercentageVisible( const bool );
+  bool              percentageVisible() const;
+
+  void              setTotalSteps( const int );
+  int               totalSteps() const;
+  
+  void              setProgress( const int );
+  void              setProgress( const int, const int );
+  int               progress() const;
+  
+  void              setMargin( const int );
+  int               margin() const;
+  
+  void              setProgressWidth( const int );
+  int               progressWidth() const; 
+
+  void              setProgressFlags( const int );
+  int               progressFlags() const;
+  
+  void              setProgressColors( const QColor&, 
+                                      const QColor& = QColor(),
+                                      const Qt::Orientation = Qt::Vertical );
+  void              setProgressColors( const QGradient& );
+  const QGradient*  progressColors() const;
+  
+  void              setOpacity( const double );
+  double            opacity() const;
+  
+  void              setTextAlignment( const int );
+  int               textAlignment() const;
+  
+  void              setTextColors( const QColor&, const QColor& = QColor() );
+  void              textColors( QColor&, QColor& ) const;
+  
+  void              setConstantInfo( const QString& info );
+  QString           constantInfo() const;
+
+  void              setOption( const QString&, const QString& );
+  QString           option( const QString& ) const;
+
+  QString           message() const;
+  
+  int               error() const;
+  
+  void              finish( QWidget* );
+  void              repaint();
+  
+  void              readSettings( QtxResourceMgr*, const QString& = QString() );
 
 public slots:
-    void              message( const QString&, 
-                              const int,
-                              const QColor& = white );
-    void              message( const QString& );
-    void              clear();
-
+  void              setMessage( const QString&, 
+                               const int,
+                               const QColor& = QColor() );
+  void              setMessage( const QString& );
+  void              clear();
+  
 protected:
-    virtual void      mousePressEvent( QMouseEvent* );
-    virtual void      customEvent( QCustomEvent* );
-    virtual void      drawContents( QPainter* );
+  virtual void      mousePressEvent( QMouseEvent* );
+  virtual void      customEvent( QEvent* );
+  virtual void      paintEvent( QPaintEvent* );
+
+  virtual void      drawContents( QPainter* );
+  
+  virtual void      drawProgressBar( QPainter* );
+  virtual void      drawMessage( QPainter* );
 
 private:
-    void              drawContents();
-    void              setError( const int );
+  void              drawContents();
+  void              setError( const int );
+  QString           fullMessage() const;
 
 private:
-    static QtxSplash* mySplash;
-
-    QPixmap           myPixmap;
-    QString           myMessage;
-    int               myAlignment;
-    QColor            myColor;
-    QColor            myShadowColor;
-    bool              myHideOnClick;
-    int               myProgress;
-    int               myTotal;
-    QColor            myStartColor;
-    QColor            myEndColor;
-    int               myGradientType;
-    int               myError;
-    int               myMargin;
+  typedef QMap<QString, QString> OptMap;
+      
+private:
+  static QtxSplash* mySplash;
+  
+  QPixmap           myPixmap;           //!< splash pixmap
+  QString           myInfo;             //!< constant info
+  QString           myMessage;          //!< current status message
+  int               myAlignment;        //!< text alignment flags (Qt::Alignment)
+  QColor            myColor;            //!< text color
+  QColor            myShadowColor;      //!< text shadow color
+  bool              myHideOnClick;      //!< 'hide on click' flag
+  int               myProgress;         //!< current progress
+  int               myTotal;            //!< total progress steps
+  QGradient         myGradient;         //!< progress bar custom gradient
+  int               myProgressWidth;    //!< progress bar width
+  int               myProgressFlags;    //!< progress bar flags (QtxSplash::ProgressBarFlags)
+  int               myMargin;           //!< margin (for progress bar and status message)
+  double            myOpacity;          //!< progress bar / status message opacity
+  int               myError;            //!< error code
+  OptMap            myOptions;          //!< constant info options
+  bool              myShowProgress;     //!< 'show progress bar' flag
+  bool              myShowMessage;      //!< 'show status message' flag
+  bool              myShowPercent;      //!< 'show percentage' flag
 };
 
 #endif
diff --git a/src/Qtx/QtxStdOperations.cxx b/src/Qtx/QtxStdOperations.cxx
deleted file mode 100644 (file)
index 8e0a33e..0000000
+++ /dev/null
@@ -1,833 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "QtxStdOperations.h"
-
-#include <math.h>
-#include <stdlib.h>
-
-/*!
-   Default constructor
-*/
-QtxStdOperations::QtxStdOperations()
-{
-}
-
-/*!
-   Destructor
-*/
-QtxStdOperations::~QtxStdOperations()
-{
-}
-
-/*!
-   Fills list of brackets treated as open (when 'open' is 'true') or close ('open' is 'false')
-*/
-void QtxStdOperations::bracketsList( QStringList& list, bool open ) const
-{
-    if( open )
-        list.append( "(" );
-    else
-        list.append( ")" );
-}
-
-/*!
-   Fills list with operation names by copying of internal list of operations
-*/
-void QtxStdOperations::opersList( QStringList& list ) const
-{
-  list += myOpers;
-}
-
-/*!
-   Add operation names from list to internal list of operations
-*/
-void QtxStdOperations::addOperations( const QStringList& list )
-{
-    QStringList::const_iterator anIt = list.begin(),
-                                aLast = list.end();
-    for( ; anIt!=aLast; anIt++ )
-        if( myOpers.contains( *anIt )==0 )
-            myOpers.append( *anIt );
-}
-
-/*!
-   Append operation names from 'list' to internal list of operations
-*/
-void QtxStdOperations::addTypes( const ListOfTypes& list )
-{
-    ListOfTypes::const_iterator anIt = list.begin(),
-                                aLast = list.end();
-    for( ; anIt!=aLast; anIt++ )
-        if( myTypes.contains( *anIt )==0 )
-            myTypes.append( *anIt );
-}
-
-/*!
-   \return whether values with passed types are valid for arguments of operation
-   \param op - name of operation
-   \param t1 - type of first argument
-   \param t2 - type of second argument
-*/
-QtxParser::Error QtxStdOperations::isValid( const QString& op,
-                                            const QVariant::Type t1,
-                                            const QVariant::Type t2 ) const
-{
-    if( ( t1==QVariant::Invalid || myTypes.contains( t1 ) ) &&
-        ( t2==QVariant::Invalid || myTypes.contains( t2 ) ) &&
-        ( t1!=QVariant::Invalid || t2!=QVariant::Invalid ) )
-        if( prior( op, t1!=QVariant::Invalid && t2!=QVariant::Invalid ) > 0 )
-            return QtxParser::OK;
-        else
-            return QtxParser::InvalidOperation;
-    else
-        return QtxParser::OperandsNotMatch;
-}
-
-
-
-
-
-
-
-
-/*!
-   Default constructor
-*/
-QtxArithmetics::QtxArithmetics()
-: QtxStdOperations()
-{
-    QStringList aList;
-    aList.append( "+" );
-    aList.append( "-" );
-    aList.append( "*" );
-    aList.append( "/" );
-    aList.append( "=" );
-    aList.append( "<" );
-    aList.append( ">" );
-    aList.append( "<=" );
-    aList.append( ">=" );
-    aList.append( "<>" );
-    aList.append( "!=" ); // same as "<>" - for C++ addicts
-    addOperations( aList );
-
-    ListOfTypes aTypes;
-    aTypes.append( QVariant::Int );
-    aTypes.append( QVariant::UInt );
-    aTypes.append( QVariant::Double );
-    addTypes( aTypes );
-}
-
-/*!
-   Destructor
-*/
-QtxArithmetics::~QtxArithmetics()
-{
-}
-
-/*!
-    Creates numbers by it's string representation [redefined virtual]
-*/
-bool QtxArithmetics::createValue( const QString& str, QtxValue& v ) const
-{
-    bool ok = false;
-    v = str.toInt( &ok );
-
-    if( !ok )
-    {
-        v = str.toDouble( &ok );
-        if( !ok )
-            ok = QtxStdOperations::createValue( str, v );
-    }
-    return ok;
-}
-
-/*!
-    \return priority of arithmetic operation 'op'.
-    \param isBin indicate whether the operation is binary
-*/
-int QtxArithmetics::prior( const QString& op, bool isBin ) const
-{
-    if( isBin )
-        if( op=="<" || op==">" || op=="=" || 
-            op=="<=" || op==">=" || op=="<>" || op=="!=" )
-            return 1;
-        else if( op=="+" || op=="-" )
-            return 2;
-        else if( op=="*" || op=="/" )
-            return 3;
-        else
-            return 0;
-    else if( op=="+" || op=="-" )
-        return 5;
-    else
-        return 0;
-}
-
-void set( QVariant& v1, bool v2 )
-{
-    v1 = QVariant( v2, 0 );
-}
-
-/*!
-    Calculates result of operation
-    \return one of error states
-    \param op - name of operation
-    \param v1 - first operation argument (must be used also to store result)
-    \param v2 - second operation argument
-*/
-QtxParser::Error QtxArithmetics::calculate( const QString& op, 
-                                                QtxValue& v1, QtxValue& v2 ) const
-{
-    QtxParser::Error err = QtxParser::OK;
-
-    if( v1.isValid() && v2.isValid() )
-        // binary operations
-        if( ( v1.type()==QVariant::Int || v1.type()==QVariant::UInt ) &&
-            ( v2.type()==QVariant::Int || v2.type()==QVariant::UInt ) )
-        {
-            int _v1 = v1.toInt(),
-                _v2 = v2.toInt();
-
-            if( op=="+" )
-                v1 = _v1 + _v2;
-            else if( op=="-" )
-                v1 = _v1 - _v2;
-            else if( op=="*" )
-                v1 = _v1 * _v2;
-            else if( op=="/" )
-                if( _v2!=0 )
-                    if( _v1%_v2==0 )
-                        v1 = _v1 / _v2;
-                    else
-                        v1 = double( _v1 ) / double( _v2 );
-                else
-                    err = QtxParser::InvalidResult;
-            else if( op=="<" )
-                set( v1, _v1<_v2 );
-            else if( op==">" )
-                set( v1, _v1>_v2 );
-            else if( op=="=" )
-                set( v1, _v1==_v2 );
-            else if( op=="<=" )
-                set( v1, _v1<=_v2 );
-            else if( op==">=" )
-                set( v1, _v1>=_v2 );
-            else if( op=="<>" || op=="!=" )
-                set( v1, _v1!=_v2 );
-        }
-        else if( ( v1.type()==QVariant::Int || v1.type()==QVariant::Double ) &&
-                 ( v2.type()==QVariant::Int || v2.type()==QVariant::Double ) )
-        {
-            double _v1 = v1.toDouble(),
-                   _v2 = v2.toDouble();
-
-            if( op=="+" )
-                v1 = _v1 + _v2;
-            else if( op=="-" )
-                v1 = _v1 - _v2;
-            else if( op=="*" )
-                v1 = _v1 * _v2;
-            else if( op=="/" )
-                if( _v2!=0 )
-                    v1 = _v1 / _v2;
-                else
-                    err = QtxParser::InvalidResult;
-            else if( op=="<" )
-                set( v1, _v1<_v2 );
-            else if( op==">" )
-                set( v1, _v1>_v2 );
-            else if( op=="=" )
-                set( v1, _v1==_v2 );
-            else if( op=="<=" )
-                set( v1, _v1<=_v2 );
-            else if( op==">=" )
-                set( v1, _v1>=_v2 );
-            else if( op=="<>" || op=="!=" )
-                set( v1, _v1!=_v2 );
-        }
-    else
-        // prefix operations
-        if( op=="-" )
-            if( v2.type()==QVariant::Int )
-                v2 = -v2.toInt();
-            else if( v2.type()==QVariant::Double )
-                v2 = -v2.toDouble();
-
-    return err;
-}
-
-
-
-
-
-
-
-
-
-
-
-/*!
-   Default constructor
-*/
-QtxLogic::QtxLogic()
-: QtxStdOperations()
-{
-    QStringList aList;
-    aList.append( "and" );
-    aList.append( "&&" );
-    aList.append( "or" );
-    aList.append( "||" );
-    aList.append( "xor" );
-    aList.append( "not" );
-    aList.append( "!" );
-    aList.append( "imp" );
-    aList.append( "=" );
-    addOperations( aList );
-
-    ListOfTypes aTypes;
-    aTypes.append( QVariant::Bool );
-    aTypes.append( QVariant::Int );
-    aTypes.append( QVariant::UInt );
-    addTypes( aTypes );
-}
-
-/*!
-   Destructor
-*/
-QtxLogic::~QtxLogic()
-{
-}
-
-/*!
-    Creates value 'true' or 'false' it's string representation [redefined virtual]
-*/
-bool QtxLogic::createValue( const QString& str, QtxValue& v ) const
-{
-    bool ok = true;
-    if( str.lower()=="true" )
-        v = QtxValue( true, 0 );
-    else if( str.lower()=="false" )
-        v = QtxValue( false, 0 );
-    else
-        ok = QtxStdOperations::createValue( str, v );
-
-    return ok;
-}
-
-/*!
-    \return priority of arithmetic operation 'op'.
-    \param isBin indicate whether the operation is binary
-*/
-int QtxLogic::prior( const QString& op, bool isBin ) const
-{
-    if( isBin )
-        if( op=="and" || op=="or" || op=="xor" ||
-            op=="&&"  || op=="||" ||
-            op=="imp" )
-            return 1;
-        else if( op=="=" )
-            return 2;
-        else 
-            return 0;
-    else if( op=="not" || op=="!" )
-            return 5;
-         else
-            return 0;
-}
-
-bool boolean_value( const QtxValue& v )
-{
-  if( v.type()==QVariant::Bool )
-    return v.toBool();
-  else if( v.type()==QVariant::Int )
-    return v.toInt()!=0;
-  else if( v.type()==QVariant::UInt )
-    return v.toUInt()!=0;
-  else
-    return false;
-}
-
-/*!
-    Calculates result of operation
-    \return one of error states
-    \param op - name of operation
-    \param v1 - first operation argument (must be used also to store result)
-    \param v2 - second operation argument
-*/
-QtxParser::Error QtxLogic::calculate( const QString& op,
-                                          QtxValue& v1, QtxValue& v2 ) const
-{
-    QtxParser::Error err = QtxParser::OK;
-    bool val1 = boolean_value( v1 ),
-         val2 = boolean_value( v2 );
-    if( v1.isValid() && v2.isValid() )
-    {
-        if( op=="and" || op=="&&" )
-            set( v1, val1 && val2 );
-        else if( op=="or" || op=="||" )
-            set( v1, val1 || val2 );
-        else if( op=="xor" )
-            set( v1, ( !val1 && val2 ) || ( val1 && !val2 ) );
-        else if( op=="imp" )
-            set( v1, !val1 || val2 );
-        else if( op=="=" )
-            set( v1, val1==val2 );
-    }
-    else
-        if( op=="not" || op=="!" )
-            set( v2, !val2 );
-
-    return err;
-}
-
-
-
-
-
-
-/*!
-   Default constructor
-*/
-QtxFunctions::QtxFunctions()
-: QtxStdOperations()
-{
-    QStringList aList;
-    aList.append( "sqrt" );
-    aList.append( "abs" );
-    aList.append( "sin" );
-    aList.append( "cos" );
-    aList.append( "rad2grad" );
-    aList.append( "grad2rad" );
-    addOperations( aList );
-
-    ListOfTypes aTypes;
-    aTypes.append( QVariant::Int );
-    aTypes.append( QVariant::Double );
-    addTypes( aTypes );
-}
-
-/*!
-   Destructor
-*/
-QtxFunctions::~QtxFunctions()
-{
-}
-
-/*!
-    Creates numbers by it's string representation [redefined virtual]
-*/
-bool QtxFunctions::createValue( const QString& str, QtxValue& v ) const
-{
-    bool ok = false;
-    v = str.toInt( &ok );
-
-    if( !ok )
-    {
-        v = str.toDouble( &ok );
-        if( !ok )
-            ok = QtxStdOperations::createValue( str, v );
-    }
-    return ok;
-}
-
-/*!
-    \return priority of arithmetic operation 'op'.
-    \param isBin indicate whether the operation is binary
-*/
-int QtxFunctions::prior( const QString& op, bool isBin ) const
-{
-    if( isBin )
-        return 0;
-    else if( op=="sqrt" || op=="abs" || op=="sin" || op=="cos" ||
-             op=="rad2grad" || op=="grad2rad" )
-        return 1;
-    else
-        return 0;
-}
-
-/*!
-    Calculates result of operation
-    \return one of error states
-    \param op - name of operation
-    \param v1 - first operation argument (must be used also to store result)
-    \param v2 - second operation argument
-*/
-QtxParser::Error QtxFunctions::calculate( const QString& op,
-                                          QtxValue& v1, QtxValue& v2 ) const
-{
-    QtxParser::Error err = QtxParser::OK;
-    double val = v2.toDouble();
-    if( op=="sqrt" )
-        if( val>=0 )
-            v2 = sqrt( val );
-        else
-            err = QtxParser::InvalidResult;
-    else if( op=="abs" )
-        if( v2.type()==QVariant::Int )
-            v2 = abs( v2.toInt() );
-        else 
-            v2 = fabs( v2.toDouble() );
-    else if( op=="sin" )
-        v2 = sin( val );
-    else if( op=="cos" )
-        v2 = cos( val );
-    else if( op=="grad2rad" )
-        v2 = val * 3.14159256 / 180.0;
-    else if( op=="rad2grad" )
-        v2 = val * 180.0 / 3.14159256;
-
-    return err;
-}
-
-
-
-
-
-
-
-
-/*!
-   Default constructor
-*/
-QtxStrings::QtxStrings()
-: QtxStdOperations()
-{
-    QStringList aList;
-    aList.append( "+" );
-    aList.append( "=" );
-    aList.append( "<" );
-    aList.append( ">" );
-    aList.append( "<=" );
-    aList.append( ">=" );
-    aList.append( "<>" );
-    aList.append( "!=" ); // same as "<>" - for C++ addicts
-    aList.append( "length" );
-    aList.append( "lower" );
-    aList.append( "upper" );
-    addOperations( aList );
-
-    ListOfTypes aTypes;
-    aTypes.append( QVariant::Int );
-    aTypes.append( QVariant::Double );
-    aTypes.append( QVariant::String );
-    aTypes.append( QVariant::CString );
-    addTypes( aTypes );
-}
-
-
-/*!
-   Destructor
-*/
-QtxStrings::~QtxStrings()
-{
-}
-
-/*!
-    Creates string QtxValue by it's Qt string representation [redefined virtual]
-*/
-bool QtxStrings::createValue( const QString& str, QtxValue& v ) const
-{
-    QChar st = str[0],
-          fin = str[ ( int )( str.length()-1 ) ];
-    if( st=="'" && fin=="'" )
-    {
-        v = str.mid( 1, str.length()-2 );
-        return true;
-    }
-    else
-        return QtxStdOperations::createValue( str, v );
-}
-
-/*!
-    \return priority of arithmetic operation 'op'.
-    \param isBin indicate whether the operation is binary
-*/
-int QtxStrings::prior( const QString& op, bool isBin ) const
-{
-    if( isBin )
-        if( op=="+" ) 
-            return 2;
-        else if( op=="="  || op=="<"  || op==">"  ||
-                 op=="<=" || op==">=" || op=="<>" || op=="!=" )
-            return 1;
-        else
-            return 0;
-    else
-        if( op=="length" || op=="lower" || op=="upper" )
-            return 5;
-        else
-            return 0;
-}
-
-/*!
-    Calculates result of operation
-    \return one of error states
-    \param op - name of operation
-    \param v1 - first operation argument (must be used also to store result)
-    \param v2 - second operation argument
-*/
-QtxParser::Error QtxStrings::calculate( const QString& op,
-                                            QtxValue& v1, QtxValue& v2 ) const
-{
-    QtxParser::Error err = QtxParser::OK;
-    if( v1.isValid() && v2.isValid() )
-    {
-        QString _v1 = v1.toString(),
-                _v2 = v2.toString();
-        if( op=="+" )
-            v1 = _v1 + _v2;
-        else if( op=="=" )
-            set( v1, _v1==_v2 );
-        else if( op=="<" )
-            set( v1, _v1<_v2 );
-        else if( op==">" )
-            set( v1, _v1>_v2 );
-        else if( op=="<>" || op=="!=" )
-            set( v1, _v1!=_v2 );
-        else if( op=="<=" )
-            set( v1, _v1<_v2 || _v1==_v2 );
-        else if( op==">=" )
-            set( v1, _v1>_v2 || _v1==_v2 );
-    }
-    else if( !v1.isValid() && v2.isValid() )
-    {
-        QString val = v2.toString();
-        if( op=="length" )
-            v2 = ( int )val.length();
-        else if( op=="lower" )
-            v2 = val.lower();
-        else if( op=="upper" )
-            v2 = val.upper();
-    }
-
-    return err;
-}
-
-
-
-
-
-
-/*!
-   Default constructor
-*/
-QtxSets::QtxSets()
-{
-    QStringList aList;
-    aList.append( "{" );
-    aList.append( "}" );
-    aList.append( "=" );
-    aList.append( "<>" );
-    aList.append( "!=" ); // same as "<>" - for C++ addicts
-    aList.append( "+" );
-    aList.append( "-" );
-    aList.append( "*" );
-    aList.append( "in" );
-    aList.append( "count" );
-    addOperations( aList );
-
-    ListOfTypes aTypes;
-    aTypes.append( QVariant::List );
-    addTypes( aTypes );
-}
-
-/*!
-   Destructor
-*/
-QtxSets::~QtxSets()
-{
-}
-
-/*!
-   Fills list of brackets treated as open (when 'open' is 'true') or close ('open' is 'false')
-*/
-void QtxSets::bracketsList( QStringList& list, bool open ) const
-{
-    if( open )
-        list.append( "{" );
-    else 
-        list.append( "}" );
-    QtxStdOperations::bracketsList( list, open );
-}
-
-/*!
-    Creates set of QtxValues by their string representation [redefined virtual]
-*/
-bool QtxSets::createValue( const QString& str, QtxValue& val ) const
-{
-    return QtxStdOperations::createValue( str, val );
-}
-
-/*!
-    \return priority of arithmetic operation 'op'.
-    \param isBin indicate whether the operation is binary
-*/
-int QtxSets::prior( const QString& op, bool isBin ) const
-{
-    if( isBin )
-        if( op=="=" || op=="<>" || op=="!=" )
-            return 1;
-        else if( op=="+" || op=="-" || op=="*" )
-            return 2;
-        else if( op=="in" )
-            return 3;
-        else
-            return 0;
-
-    else 
-        if( op=="{" || op=="}" )
-            return 5;
-        else if( op=="count" )
-            return 4;
-        else
-            return 0;
-}
-
-/*!
-   \return whether values with passed types are valid for arguments of operation
-   \param op - name of operation
-   \param t1 - type of first argument
-   \param t2 - type of second argument
-*/
-QtxParser::Error QtxSets::isValid( const QString& op,
-                                   const QVariant::Type t1,
-                                   const QVariant::Type t2 ) const
-{
-    if( op=="{" )
-        return QtxParser::OK;
-    else if( op=="in" )
-        if( t1!=QVariant::Invalid && t2==QVariant::List )
-            return QtxParser::OK;
-        else
-            return QtxParser::OperandsNotMatch;
-    else
-        return QtxStdOperations::isValid( op, t1, t2 );
-}
-
-/*!
-   Adds new value 'v' to set 'set' [static]
-*/
-void QtxSets::add( ValueSet& set, const QtxValue& v )
-{
-    if( v.isValid() && set.contains( v )==0 )
-        set.append( v );
-}
-
-/*!
-   Adds values from set 's2' to set 's1'
-*/
-void QtxSets::add( ValueSet& s1, const ValueSet& s2 )
-{
-    ValueSet::const_iterator anIt = s2.begin(),
-                             aLast = s2.end();
-    for( ; anIt!=aLast; anIt++ )
-        add( s1, *anIt );
-}
-
-/*!
-   Removes value 'v' from set 'set'
-*/
-void QtxSets::remove( ValueSet& set, const QtxValue& v )
-{
-    set.remove( v );
-}
-
-/*!
-   Removes values of set 's2' from set 's1'
-*/
-void QtxSets::remove( ValueSet& s1, const ValueSet& s2 )
-{
-    ValueSet::const_iterator anIt = s2.begin(),
-                             aLast = s2.end();
-    for( ; anIt!=aLast; anIt++ )
-        s1.remove( *anIt );
-}
-
-/*!
-    Calculates result of operation
-    \return one of error states
-    \param op - name of operation
-    \param v1 - first operation argument (must be used also to store result)
-    \param v2 - second operation argument
-*/
-QtxParser::Error QtxSets::calculate( const QString& op, QtxValue& v1, QtxValue& v2 ) const
-{
-    QtxParser::Error err = QtxParser::OK;
-
-    if( op!="{" )
-        if( op=="}" )
-        {
-            ValueSet aNewList;
-            add( aNewList, v1.toList() );
-            v1 = aNewList;
-        }
-
-        else if( op=="=" || op=="<>" || op=="!=" || op=="+" || op=="-" || op=="*" )
-        {
-            ValueSet aNewList;
-            add( aNewList, v1.toList() );
-
-            if( op=="=" || op=="<>" || op=="!=" || op=="-" )
-            {
-                remove( aNewList, v2.toList() );
-
-                if( op=="=" )
-                    set( v1, aNewList.isEmpty() && v1.toList().count()==v2.toList().count() );
-                else if( op=="<>" || op=="!=" )
-                    set( v1, !aNewList.isEmpty() || v1.toList().count()!=v2.toList().count() );
-                else
-                    v1 = aNewList;
-            }
-            else if( op=="+" )
-            {
-                add( aNewList, v2.toList() );
-                v1 = aNewList;
-            }
-            else if( op=="*" )
-            {
-                ValueSet toDelete;
-                add( toDelete, aNewList );
-                remove( toDelete, v2.toList() );
-                remove( aNewList, toDelete );
-                v1 = aNewList;
-            }
-        }
-        else if( op=="count" )
-            v2 = ( int )v2.toList().count();
-        else if( op=="in" )
-        {
-            if( v1.type()==QVariant::List )
-            {
-                bool res = true;
-                ValueSet::const_iterator anIt = v1.toList().begin(),
-                                         aLast = v1.toList().end();
-                for( ; anIt!=aLast && res; anIt++ )
-                    res = v2.toList().contains( *anIt )>0;
-
-                set( v1, res );
-            }
-            else
-           {
-             const QValueList< QVariant >& list = v2.toList();
-             v1 = ( bool )( list.find( v1 )!=list.end() );
-           }
-        }
-
-    return err;
-}
diff --git a/src/Qtx/QtxStdOperations.h b/src/Qtx/QtxStdOperations.h
deleted file mode 100644 (file)
index 3631d7b..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QtxStdOperations.h
-// Author:    Alexander SOLOVYOV
-
-#ifndef __QTX_STD_OPERATIONS_HEADER__
-#define __QTX_STD_OPERATIONS_HEADER__
-
-#include "Qtx.h"
-#include "QtxOperations.h"
-
-/*!
-  \class QtxStdOperations
-  Provides simplified interface for standard operations.
-  Conatins list of operation names, priority and possible types
-*/
-class QTX_EXPORT QtxStdOperations : public QtxOperations
-{
-public:
-    QtxStdOperations();
-    virtual ~QtxStdOperations();
-
-    virtual void opersList( QStringList& ) const;
-    virtual void bracketsList( QStringList&, bool open ) const;
-
-    virtual QtxParser::Error isValid( const QString&,
-                                      const QVariant::Type,
-                                      const QVariant::Type ) const;
-protected: 
-    typedef QValueList< QVariant::Type > ListOfTypes;
-
-    void addOperations( const QStringList& );
-    void addTypes( const ListOfTypes& );
-
-private:
-    QStringList myOpers;
-    ListOfTypes myTypes;
-};
-
-/*!
-  \class QtxArithmetics
-  Provides set of arithmetic operations for parser
-*/
-class QTX_EXPORT QtxArithmetics : public QtxStdOperations
-{
-public:
-    QtxArithmetics();
-    virtual ~QtxArithmetics();
-
-    virtual bool  createValue( const QString&, QtxValue& ) const;
-    virtual int   prior( const QString&, bool isBin ) const;
-    virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
-};
-
-/*!
-  \class QtxLogic
-  Provides set of logic operations for parser
-*/
-class QTX_EXPORT QtxLogic : public QtxStdOperations
-{
-public:
-    QtxLogic();
-    virtual ~QtxLogic();
-
-    virtual bool  createValue( const QString&, QtxValue& ) const;
-    virtual int   prior( const QString&, bool isBin ) const;
-    virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
-};
-
-/*!
-  \class QtxFunctions
-  Provides set of more complex operations for parser (sqrt, sin, cos, etc)
-*/
-class QTX_EXPORT QtxFunctions : public QtxStdOperations
-{
-public:
-    QtxFunctions();
-    virtual ~QtxFunctions();
-
-    virtual bool  createValue( const QString&, QtxValue& ) const;
-    virtual int   prior( const QString&, bool isBin ) const;
-    virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
-};
-
-/*!
-  \class QtxStrings
-  Provides set of string operations for parser
-*/
-class QTX_EXPORT QtxStrings : public QtxStdOperations
-{
-public:
-    QtxStrings();
-    virtual ~QtxStrings();
-
-    virtual bool  createValue( const QString&, QtxValue& ) const;
-    virtual int   prior( const QString&, bool isBin ) const;
-    virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
-};
-
-/*!
-  \class QtxSets
-  Provides set of operations with sets for parser
-*/
-class QTX_EXPORT QtxSets : public QtxStdOperations
-{
-public:
-    typedef QValueList< QtxValue > ValueSet;
-
-public:
-    QtxSets();
-    virtual ~QtxSets();
-
-    virtual void bracketsList( QStringList&, bool open ) const;
-    virtual bool createValue( const QString&, QtxValue& ) const;
-    virtual int  prior( const QString&, bool isBin ) const;
-    virtual QtxParser::Error isValid( const QString&,
-                                      const QVariant::Type,
-                                      const QVariant::Type ) const;
-    virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
-
-    static void add( ValueSet&, const QtxValue& );
-    static void add( ValueSet&, const ValueSet& );
-    static void remove( ValueSet&, const QtxValue& );
-    static void remove( ValueSet&, const ValueSet& );
-};
-
-
-#endif
index 1f7c0be558ff993ee1af7d6127c0624467f3df1f..fe2ba2ed86736dfb8091558eb8b57b433e82d500 100644 (file)
@@ -1,24 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxTable.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxTable.h"
 
 #ifndef QT_NO_TABLE
@@ -260,12 +263,12 @@ void QtxTable::endHeaderEdit( const bool accept )
   if ( !isHeaderEditing() )
     return;
 
-  QString oldTxt = myEditedHeader ? myEditedHeader->label( myEditedSection ) : QString::null;
+  QString oldTxt = myEditedHeader ? myEditedHeader->label( myEditedSection ) : QString();
 
   if ( accept && myEditedHeader )
     setHeaderContentFromEditor( myEditedHeader, myEditedSection, myHeaderEditor );
 
-  QString newTxt = myEditedHeader ? myEditedHeader->label( myEditedSection ) : QString::null;
+  QString newTxt = myEditedHeader ? myEditedHeader->label( myEditedSection ) : QString();
 
   int sec = myEditedSection;
   QHeader* hdr = myEditedHeader;
index b7175d08e1e2b8df14c4f932d75ba865383e583d..398b0305a11f209fd0b2268b6ba8b4e4f678f581 100644 (file)
@@ -1,26 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxTable.h
 // Author:    Sergey TELKOV
-
-#ifndef QTX_TABLE_H
-#define QTX_TABLE_H
+//
+#ifndef QTXTABLE_H
+#define QTXTABLE_H
 
 #include "Qtx.h"
 
@@ -85,4 +88,4 @@ private:
 
 #endif
 
-#endif
+#endif // QTXTABLE_H
index cf585db645c582341defcffccc4ea06b04c54952..6154653feafdadf3a983c29347c00961c22cc698 100644 (file)
@@ -1,36 +1,37 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxToolBar.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxToolBar.h"
 
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qdockarea.h>
-#include <qobjectlist.h>
-#include <qmainwindow.h>
-#include <qapplication.h>
+#include <QAction>
+#include <QMainWindow>
+#include <QApplication>
 
 /*!
-    Class: QtxToolBar::Watcher [Internal]
-    Descr: Internal object with event filter.
+  \class QtxToolBar::Watcher
+  \internal
+  \brief Internal class which goal is to watch parent toolbar state changing.
 */
 
 class QtxToolBar::Watcher : public QObject
@@ -39,12 +40,15 @@ public:
   Watcher( QtxToolBar* );
 
   void         shown( QtxToolBar* );
-  void         hided( QtxToolBar* );
+  void         hidden( QtxToolBar* );
 
   virtual bool eventFilter( QObject*, QEvent* );
 
+  bool           isEmpty() const;
+  bool           isVisible() const;
+
 protected:
-  virtual void customEvent( QCustomEvent* );
+  virtual void customEvent( QEvent* );
 
 private:
   enum { Install = QEvent::User, Update };
@@ -55,52 +59,50 @@ private:
   void         showContainer();
   void         hideContainer();
 
-  void         updateIcon();
-  void         updateCaption();
   void         updateVisibility();
 
+  void         setEmpty( const bool );
+  void         setVisible( const bool );
+
 private:
   QtxToolBar*  myCont;
   bool         myState;
   bool         myEmpty;
-  bool         myVisible;
 };
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param cont toolbar to be watched
 */
 QtxToolBar::Watcher::Watcher( QtxToolBar* cont )
 : QObject( cont ),
-myCont( cont ),
-myState( true ),
-myEmpty( true )
+  myCont( cont ),
+  myState( true ),
+  myEmpty( false )
 {
-  if ( myCont->mainWindow() )
-    myState = myCont->mainWindow()->appropriate( myCont );
+  setVisible( myCont->isVisibleTo( myCont->parentWidget() ) );
 
   myCont->installEventFilter( this );
-  myVisible = myCont->isVisibleTo( myCont->parentWidget() );
 
   installFilters();
 }
 
 /*!
-  Custom event filter
+  \brief Custom event filter.
+  \param o event receiver object
+  \param e event sent to object
+  \return \c true if further event processing should be stopped
 */
 bool QtxToolBar::Watcher::eventFilter( QObject* o, QEvent* e )
 {
-  if ( o == myCont && e->type() == QEvent::ChildInserted )
-    QApplication::postEvent( this, new QCustomEvent( Install ) );
-
-  if ( o != myCont && e->type() == QEvent::IconChange )
-    updateIcon();
-
-  if ( o != myCont && e->type() == QEvent::CaptionChange )
-    updateCaption();
+  if ( o == myCont && e->type() == QEvent::ChildAdded )
+    QApplication::postEvent( this, new QEvent( (QEvent::Type)Install ) );
 
   bool updVis = ( o != myCont && ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ||
                                    e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ) ) ||
-                ( o == myCont && ( e->type() == QEvent::ChildRemoved || e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ) );
+                ( o == myCont && ( e->type() == QEvent::ChildRemoved || e->type() == QEvent::Show ||
+                                  e->type() == QEvent::ShowToParent || e->type() == QEvent::ActionAdded ||
+                                  e->type() == QEvent::ActionRemoved ) );
 
   if ( updVis )
   {
@@ -108,100 +110,140 @@ bool QtxToolBar::Watcher::eventFilter( QObject* o, QEvent* e )
     myCont = 0;
     QApplication::sendPostedEvents( this, Update );
     myCont = cont;
-    QApplication::postEvent( this, new QCustomEvent( Update ) );
+    QApplication::postEvent( this, new QEvent( (QEvent::Type)Update ) );
   }
 
   return false;
 }
 
 /*!
-  Sets internal visibility state to true
+  \brief Set internal status to "shown"
+  \param tb toolbar
 */
 void QtxToolBar::Watcher::shown( QtxToolBar* tb )
 {
   if ( tb != myCont )
     return;
 
-  myVisible = true;
+  setVisible( true );
 }
 
 /*!
-  Sets internal visibility state to false
+  \brief Set internal status to "hidden"
+  \param tb toolbar
 */
-void QtxToolBar::Watcher::hided( QtxToolBar* tb )
+void QtxToolBar::Watcher::hidden( QtxToolBar* tb )
 {
   if ( tb != myCont )
     return;
 
-  myVisible = false;
+  setVisible( false );
+}
+
+bool QtxToolBar::Watcher::isEmpty() const
+{
+  return myEmpty;
+}
+
+bool QtxToolBar::Watcher::isVisible() const
+{
+  bool vis = false;
+  if ( myCont && myCont->toggleViewAction() )
+    vis = myCont->toggleViewAction()->isChecked();
+  return vis;
+}
+
+void QtxToolBar::Watcher::setEmpty( const bool on )
+{
+  myEmpty = on;
+}
+
+void QtxToolBar::Watcher::setVisible( const bool on )
+{
+  if ( !myCont || !myCont->toggleViewAction() )
+    return;
+
+  bool block = myCont->toggleViewAction()->signalsBlocked();
+  myCont->toggleViewAction()->blockSignals( true );
+  myCont->toggleViewAction()->setChecked( on );
+  myCont->toggleViewAction()->blockSignals( block );
 }
 
 /*!
-  Shows corresponding QtxToolBar
+  \brief Show the toolbar being watched
 */
 void QtxToolBar::Watcher::showContainer()
 {
   if ( !myCont )
     return;
 
+  bool vis = isVisible();
+
   QtxToolBar* cont = myCont;
   myCont = 0;
   cont->show();
   myCont = cont;
+
+  setVisible( vis );
 }
 
 /*!
-  Hides corresponding QtxToolBar
+  \brief Hide the toolbar being watched
 */
 void QtxToolBar::Watcher::hideContainer()
 {
   if ( !myCont )
     return;
 
+  bool vis = isVisible();
+
   QtxToolBar* cont = myCont;
   myCont = 0;
   cont->hide();
   myCont = cont;
+
+  setVisible( vis );
 }
 
 /*!
-  Event handler of custom events
+  \brief Proces custom events.
+  \param e custom event
 */
-void QtxToolBar::Watcher::customEvent( QCustomEvent* e )
+void QtxToolBar::Watcher::customEvent( QEvent* e )
 {
   switch ( e->type() )
   {
   case Install:
     installFilters();
-    updateIcon();
-    updateCaption();
+    break;
   case Update:
     updateVisibility();
+    break;
+  default:
+    break;
   }
 }
 
 /*!
-  Installs event filters
+  \brief Install this object as event dilter to all children widgets
+         of the toolbar being watched.
 */
 void QtxToolBar::Watcher::installFilters()
 {
   if ( !myCont )
     return;
 
-  const QObjectList* objList = myCont->children();
-  if ( !objList )
-    return;
-
-  for ( QObjectListIt it( *objList ); it.current(); ++it )
+  const QObjectList& objList = myCont->children();
+  for ( QObjectList::const_iterator it = objList.begin(); it != objList.end(); ++it )
   {
-    if ( it.current()->isWidgetType() &&
-         qstrcmp( "qt_dockwidget_internal", it.current()->name() ) )
-      it.current()->installEventFilter( this );
+    if ( (*it)->isWidgetType() && qstrcmp( "qt_dockwidget_internal", (*it)->objectName().toLatin1() ) )
+      (*it)->installEventFilter( this );
   }
 }
 
 /*!
-  Update visibility state
+  \brief Update visibility state of all children widgets of the toolbar
+         being watched.
 */
 void QtxToolBar::Watcher::updateVisibility()
 {
@@ -209,222 +251,148 @@ void QtxToolBar::Watcher::updateVisibility()
     return;
 
   bool vis = false;
-
-  const QObjectList* objList = myCont->children();
-  if ( objList )
+  QList<QAction*> actList = myCont->actions();
+  for ( QList<QAction*>::const_iterator it = actList.begin(); it != actList.end() && !vis; ++it )
   {
-    for ( QObjectListIt it( *objList ); it.current() && !vis; ++it )
-    {
-      if ( !it.current()->isWidgetType() ||
-           !qstrcmp( "qt_dockwidget_internal", it.current()->name() ) )
-        continue;
+    if ( (*it)->isSeparator() )
+      continue;
 
-      QWidget* wid = (QWidget*)it.current();
-      vis = wid->isVisibleTo( wid->parentWidget() );
-    }
+    vis = (*it)->isVisible();
   }
 
   QMainWindow* mw = myCont->mainWindow();
-  if ( mw && myEmpty == vis )
+  bool empty = isEmpty();
+  if ( mw && empty == vis )
   {
-    myEmpty = !vis;
-    if ( !myEmpty )
-      mw->setAppropriate( myCont, myState );
+    empty = !vis;
+    setEmpty( empty );
+    if ( !empty )
+      myCont->toggleViewAction()->setVisible( myState );
     else
     {
-      myState = mw->appropriate( myCont );
-      mw->setAppropriate( myCont, false );
+      myState = myCont->toggleViewAction()->isVisible();
+      myCont->toggleViewAction()->setVisible( false );
     }
   }
 
-  vis = !myEmpty && myVisible;
+  vis = !empty && isVisible();
   if ( vis != myCont->isVisibleTo( myCont->parentWidget() ) )
     vis ? showContainer() : hideContainer();
 }
 
 /*!
-  Updates icon
+  \class QtxToolBar
+  \brief Enhanced toolbar class.
 */
-void QtxToolBar::Watcher::updateIcon()
-{
-  if ( !myCont || !myCont->widget() )
-    return;
-  
-  const QPixmap* ico = myCont->widget()->icon();
-  myCont->setIcon( ico ? *ico : QPixmap() );
-}
 
 /*!
-  Updates caption
+  \brief Constructor.
+  \param watch if \c true the event filter is installed to watch toolbar state changes 
+         to update it properly
+  \param label toolbar title
+  \param parent parent widget
 */
-void QtxToolBar::Watcher::updateCaption()
-{
-  if ( myCont && myCont->widget() && !myCont->widget()->caption().isNull() )
-    myCont->setCaption( myCont->widget()->caption() );
-}
-
-/*!
-  Constructor
-*/
-QtxToolBar::QtxToolBar( const bool watch, const QString& label, QMainWindow* main,
-                        QWidget* parent, bool newLine, const char* name, WFlags f )
-: QToolBar( label, main, parent, newLine, name, f ),
-myWatcher( 0 ),
-myStretch( false )
+QtxToolBar::QtxToolBar( const bool watch, const QString& label, QWidget* parent )
+: QToolBar( label, parent ),
+  myWatcher( 0 ),
+  myStretch( false )
 {
   if ( watch )
     myWatcher = new Watcher( this );
+
+  if ( QMainWindow* mw = ::qobject_cast<QMainWindow*>( parent ) )
+    mw->addToolBar( this );
 }
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param label toolbar title
+  \param parent parent widget
 */
-QtxToolBar::QtxToolBar( const QString& label, QMainWindow* main,
-                        QWidget* parent, bool newLine, const char* name, WFlags f )
-: QToolBar( label, main, parent, newLine, name, f ),
-myWatcher( 0 ),
-myStretch( false )
+QtxToolBar::QtxToolBar( const QString& label, QWidget* parent )
+: QToolBar( label, parent ),
+  myWatcher( 0 ),
+  myStretch( false )
 {
+  if ( QMainWindow* mw = ::qobject_cast<QMainWindow*>( parent ) )
+    mw->addToolBar( this );
 }
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param watch if \c true the event filter is installed to watch toolbar state changes 
+         to update it properly
+  \param parent parent widget
 */
-QtxToolBar::QtxToolBar( const bool watch, QMainWindow* main, const char* name )
-: QToolBar( main, name ),
-myWatcher( 0 ),
-myStretch( false )
+QtxToolBar::QtxToolBar( const bool watch, QWidget* parent )
+: QToolBar( parent ),
+  myWatcher( 0 ),
+  myStretch( false )
 {
   if ( watch )
     myWatcher = new Watcher( this );
-}
 
-/*!
-  Constructor
-*/
-QtxToolBar::QtxToolBar( QMainWindow* main, const char* name )
-: QToolBar( main, name ),
-myWatcher( 0 ),
-myStretch( false )
-{
+  if ( QMainWindow* mw = ::qobject_cast<QMainWindow*>( parent ) )
+    mw->addToolBar( this );
 }
 
 /*!
-  Destructor
+  \brief Constructor.
+  \param parent parent widget
 */
-QtxToolBar::~QtxToolBar()
+QtxToolBar::QtxToolBar( QWidget* parent )
+: QToolBar( parent ),
+  myWatcher( 0 ),
+  myStretch( false )
 {
+  if ( QMainWindow* mw = ::qobject_cast<QMainWindow*>( parent ) )
+    mw->addToolBar( this );
 }
 
 /*!
-  Change the toolbar's main widget
-  \param wid - new main widget
-*/
-void QtxToolBar::setWidget( QWidget* wid )
-{
-  if ( wid )
-    wid->reparent( this, QPoint( 0, 0 ), wid->isVisibleTo( wid->parentWidget() ) );
-
-  QToolBar::setWidget( wid );
-
-  if ( !boxLayout() )
-    return;
-
-  for ( QLayoutIterator it = boxLayout()->iterator(); it.current(); ++it )
-  {
-    if ( it.current()->widget() == wid )
-    {
-      it.deleteCurrent();
-      break;
-    }
-  }
-}
-
-/*!
-  \return true if toolbar is stretchable
+  \brief Destructor.
 */
-bool QtxToolBar::isStretchable() const
+QtxToolBar::~QtxToolBar()
 {
-  return myStretch;
 }
 
 /*!
-  Sets stretchable state of toolbar
-  \param on - new state
+  \brief Show/hide the toolbar.
+  \param on new visibility state
 */
-void QtxToolBar::setStretchable( const bool on )
+void QtxToolBar::setVisible( bool visible )
 {
-  if ( myStretch == on )
-    return;
-
-  myStretch = on;
-
-  boxLayout()->setStretchFactor( widget(), myStretch ? 1 : 0 );
-
-  if ( myStretch != isHorizontalStretchable() ||
-       myStretch != isVerticalStretchable() )
-  {
-         if ( orientation() == Horizontal )
-           setHorizontalStretchable( myStretch );
-         else
-           setVerticalStretchable( myStretch );
-  }
-}
-
-/*!
-  \return the recommended size for the widget
-*/
-QSize QtxToolBar::sizeHint() const
-{
-  QSize sz = QToolBar::sizeHint();
-
-  if ( place() == InDock && isStretchable() && area() )
+  if ( myWatcher )
   {
-    if ( orientation() == Horizontal )
-      sz.setWidth( area()->width() );
+    if ( visible )
+      myWatcher->shown( this );
     else
-      sz.setHeight( area()->height() );
+      myWatcher->hidden( this );
   }
 
-  return sz;
+  QToolBar::setVisible( visible );
 }
 
 /*!
-  \return the recommended minimum size for the widget
+  \brief Get parent main window.
+  \return main window pointer
 */
-QSize QtxToolBar::minimumSizeHint() const
+QMainWindow* QtxToolBar::mainWindow() const
 {
-  QSize sz = QToolBar::minimumSizeHint();
-
-  if ( place() == InDock && isStretchable() && area() )
+  QMainWindow* mw = 0;
+  QWidget* wid = parentWidget();
+  while ( !mw && wid )
   {
-    if ( orientation() == Horizontal )
-      sz.setWidth( area()->width() );
-    else
-      sz.setHeight( area()->height() );
+    mw = ::qobject_cast<QMainWindow*>( wid );
+    wid = wid->parentWidget();
   }
-
-  return sz;
+  return mw;
 }
 
-/*!
-  Shows toolbar
-*/
-void QtxToolBar::show()
-{
-  if ( myWatcher )
-    myWatcher->shown( this );
-
-  QToolBar::show();
-}
-
-/*!
-  Hides toolbar
-*/
-void QtxToolBar::hide()
+bool QtxToolBar::event( QEvent* e )
 {
-  if ( myWatcher )
-    myWatcher->hided( this );
+  if ( e->type() == QEvent::WindowTitleChange && objectName().isEmpty() )
+    setObjectName( windowTitle() );
 
-  QToolBar::hide();
+  return QToolBar::event( e );
 }
index 57512f40dbfc62be4924c332bff1695fb281fa18..8b3044272618f942fc5804213f0d1d6419bd05d7 100644 (file)
@@ -1,27 +1,33 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxToolBar.h
 // Author:    Sergey TELKOV
+//
+#ifndef QTXTOOLBAR_H
+#define QTXTOOLBAR_H
 
 #include "Qtx.h"
 
-#include <qtoolbar.h>
+#include <QToolBar>
 
 class QTX_EXPORT QtxToolBar : public QToolBar
 {
@@ -30,25 +36,23 @@ class QTX_EXPORT QtxToolBar : public QToolBar
   class Watcher;
 
 public:
-  QtxToolBar( const bool, const QString&, QMainWindow*, QWidget*, bool = false, const char* = 0, WFlags = 0 );
-  QtxToolBar( const QString&, QMainWindow*, QWidget*, bool = false, const char* = 0, WFlags = 0 );
-  QtxToolBar( const bool, QMainWindow* = 0, const char* = 0 );
-  QtxToolBar( QMainWindow* = 0, const char* = 0 );
+  QtxToolBar( const bool, const QString&, QWidget* );
+  QtxToolBar( const QString&, QWidget* );
+  QtxToolBar( const bool, QWidget* = 0 );
+  QtxToolBar( QWidget* = 0 );
   virtual ~QtxToolBar();
 
-  virtual void  setWidget( QWidget* );
-
-  bool          isStretchable() const;
-  virtual void  setStretchable( const bool );
-
-  virtual QSize sizeHint() const;
-  virtual QSize minimumSizeHint() const;
+  QMainWindow*  mainWindow() const;
 
 public slots:
-  virtual void  show();
-  virtual void  hide();
+  virtual void  setVisible( bool );
+
+protected:
+  virtual bool  event( QEvent* );
 
 private:
-  Watcher*      myWatcher;
-  bool          myStretch;
+  Watcher*      myWatcher;   //!< watcher object
+  bool          myStretch;   //!< stretching toolbar flag (not used)
 };
+
+#endif // QTXTOOLBAR_H
index 530afca6dd87085f72c78cef466c9926e7146896..61007661b76411c1f33578563b0ff0b2b4804432 100755 (executable)
@@ -1,31 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxToolTip.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxToolTip.h"
 
-#include <qfont.h>
-#include <qtimer.h>
-#include <qcursor.h>
-#include <qfontmetrics.h>
-#include <qapplication.h>
+#include <QFont>
+#include <QTimer>
+#include <QCursor>
+#include <QFontMetrics>
+#include <QApplication>
+#include <QPalette>
+#include <QMouseEvent>
 
 #define TOOLTIP_SHOW_DELAY 0500
 #define TOOLTIP_HIDE_DELAY 7000
   Constructor
 */
 QtxToolTip::QtxToolTip( QWidget* parent )
-: QLabel( parent, "", WStyle_Customize | WStyle_NoBorder | WX11BypassWM | WStyle_Tool | WStyle_StaysOnTop | WType_TopLevel )
+: QLabel( parent, Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint | Qt::Tool | Qt::WindowStaysOnTopHint | Qt::Window )
 {
+  setObjectName( "" );
   setIndent( 3 );
-       setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
-       setBackgroundColor( QColor( 255, 255, 231 ) );
+  setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
+  QPalette palette;
+  palette.setColor( backgroundRole(), QColor( 255, 255, 231 ) );
+  setPalette( palette );
 
        myWidgetRegion = QRect( -1, -1, -1, -1 );
 
@@ -50,7 +58,9 @@ QtxToolTip::QtxToolTip( QWidget* parent )
        installEventFilter( this );
 
        mySleepTimer = new QTimer( this );
+        mySleepTimer->setSingleShot( true );
        myWakeUpTimer = new QTimer( this );
+        myWakeUpTimer->setSingleShot( true );
        connect( mySleepTimer,  SIGNAL( timeout() ), this, SLOT( onSleepTimeOut()  ) );
        connect( myWakeUpTimer, SIGNAL( timeout() ), this, SLOT( onWakeUpTimeOut() ) );
 
@@ -87,7 +97,7 @@ bool QtxToolTip::eventFilter( QObject* o, QEvent* e )
                if ( myWakeUpTimer->isActive() )
                {
                        myWakeUpTimer->stop();
-                       myWakeUpTimer->start( myWakeUpDelayTime, true );
+                       myWakeUpTimer->start( myWakeUpDelayTime );
                }
                if ( isVisible() )
                {
@@ -100,7 +110,7 @@ bool QtxToolTip::eventFilter( QObject* o, QEvent* e )
                else
                {
                        if ( !myWidgetRegion.isValid() || myWidgetRegion.contains( thePos ) )
-                               myWakeUpTimer->start( myWakeUpDelayTime, true );
+                               myWakeUpTimer->start( myWakeUpDelayTime );
                }
        }
        if ( e->type() == QEvent::KeyPress )
@@ -141,7 +151,7 @@ void QtxToolTip::showTip( const QRect& aRegion, const QString& text, const QRect
        myWidgetRegion = aWidgetRegion;
        setGeometry( aRegion );
        if ( myShowDelayTime != 0 )
-               mySleepTimer->start( myShowDelayTime, true );
+               mySleepTimer->start( myShowDelayTime );
        show();
 }
 
@@ -176,7 +186,7 @@ void QtxToolTip::maybeTip( const QPoint& pos )
                                         QSize( textRegion.width() + 2 * margin, textRegion.height() ) );
                QRect tipRegion( parentWidget()->mapToGlobal( dspRegion.topLeft() ), dspRegion.size() );
                if ( tipRegion.left() < 0 )
-                       tipRegion.moveBy( -1 * tipRegion.left(), 0 );
+                       tipRegion.translate( -1 * tipRegion.left(), 0 );
                showTip( tipRegion, text, theRegion );
        }
 }
@@ -211,7 +221,7 @@ void QtxToolTip::mousePressEvent( QMouseEvent* e )
        QWidget* reciever = parentWidget();
        QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonPress,
                                                                           reciever->mapFromGlobal( e->globalPos() ),
-                                                                          e->button(), e->state() );
+                                                                          e->button(), e->buttons(), Qt::KeypadModifier );
        QApplication::sendEvent( reciever, me );
 }
 
@@ -224,7 +234,7 @@ void QtxToolTip::mouseDoubleClickEvent( QMouseEvent* e )
        QWidget* reciever = parentWidget();
        QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonDblClick,
                                                                           reciever->mapFromGlobal( e->globalPos() ),
-                                                                          e->button(), e->state() );
+                                                                          e->button(), e->buttons(), Qt::KeypadModifier );
        QApplication::sendEvent( reciever, me );
 }
 
index c8b9d704b820e930007c425e4938f32f92329b99..1af9afe9a3e674609e1a03959433c75760f505c6 100755 (executable)
@@ -1,30 +1,33 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxToolTip.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXTOOLTIP_H
 #define QTXTOOLTIP_H
 
 #include "Qtx.h"
 
-#include <qlabel.h>
+#include <QLabel>
 
 class QTimer;
 
diff --git a/src/Qtx/QtxTranslator.cxx b/src/Qtx/QtxTranslator.cxx
new file mode 100644 (file)
index 0000000..624dfba
--- /dev/null
@@ -0,0 +1,81 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxTranslator.cxx
+// Author:    Alexander SOLOVYOV
+//
+#include "QtxTranslator.h"
+
+/*!
+  \class QtxTranslator
+  \brief Extended version of QTranslator
+
+  In addition to the functionality provided by QTranslator class, QtxTranslator
+  allows translating resources defined in the global context (i.e. common resources).
+  The QtxTranslator can be used to workaround QTranslator's limitation which 
+  does not allow to process messages with global context.
+
+  For the current moment global context should be specified in translation
+  (*.ts/*.qm) files as "@default" string. For example:
+  \verbatim
+  <!DOCTYPE TS><TS>
+  <context>
+    <name>@default</name>
+    <message>
+        <source>MY_MESSAGE</source>
+        <translation>My translated message</translation>
+    </message>
+  </context>
+  </TS>
+  \endverbatim
+*/
+
+#define GLOBAL_CONTEXT "@default"
+
+/*!
+  \brief Constructor.
+*/
+QtxTranslator::QtxTranslator( QObject* parent )
+: QTranslator( parent )
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxTranslator::~QtxTranslator()
+{
+}
+
+/*!
+  \brief Returns the translation for the key.
+  \param context message context
+  \param sourceText message source name
+  \param comment message comment (optional)
+  \return Translated text if found or \a sourceText otherwise
+*/
+QString QtxTranslator::translate( const char* context, const char* sourceText, const char* comment ) const
+{
+  QString res = QTranslator::translate( context, sourceText, comment );
+  if( res.isNull() )
+    res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment );
+  return res;
+}
diff --git a/src/Qtx/QtxTranslator.h b/src/Qtx/QtxTranslator.h
new file mode 100644 (file)
index 0000000..99d1d78
--- /dev/null
@@ -0,0 +1,38 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxTranslator.h
+// Author:    Alexander SOLOVYOV
+//
+#ifndef QTXTRANSLATOR_H
+#define QTXTRANSLATOR_H
+
+#include <QTranslator>
+
+class QtxTranslator : public QTranslator
+{
+public:
+  QtxTranslator( QObject* parent = 0 );
+  ~QtxTranslator();
+  virtual QString translate( const char*, const char*, const char* = 0 ) const;
+};
+
+#endif
diff --git a/src/Qtx/QtxTreeView.cxx b/src/Qtx/QtxTreeView.cxx
new file mode 100644 (file)
index 0000000..6e6ef8b
--- /dev/null
@@ -0,0 +1,398 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxTreeView.cxx
+// Author:    Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#include "QtxTreeView.h"
+
+#include <QHeaderView>
+#include <QMenu>
+#include <QMouseEvent>
+
+/*!
+  \class QtxTreeView::Header
+  \brief Custom tree view header class.
+  \internal
+*/
+
+class QtxTreeView::Header : public QHeaderView
+{
+public:
+  Header( const bool, QWidget* = 0 );
+  ~Header();
+
+  void     setSortMenuEnabled( const bool );
+  bool     sortMenuEnabled() const;
+
+protected:
+  void     contextMenuEvent( QContextMenuEvent* );
+
+private:
+  bool     myEnableSortMenu;
+};
+
+/*!
+  \brief Constructor
+  \param enableSortMenu show "Sorting" menu if \c true
+  \param parent parent widget
+  \internal
+*/
+QtxTreeView::Header::Header( const bool enableSortMenu, QWidget* parent )
+: QHeaderView( Qt::Horizontal, parent ),
+  myEnableSortMenu( enableSortMenu )
+{
+}
+
+/*!
+  \brief Destructor
+  \internal
+*/
+QtxTreeView::Header::~Header()
+{
+}
+
+/*
+  \brief Enable/disable "Sorting" popup menu command for the header.
+  \param enableSortMenu if \c true, enable "Sorting" menu command
+  \internal
+*/
+void QtxTreeView::Header::setSortMenuEnabled( const bool enableSortMenu )
+{
+  myEnableSortMenu = enableSortMenu;
+}
+
+/*
+  \brief Check if "Sorting" popup menu command for the header is enabled.
+  \return \c true if "Sorting" menu command is enabled
+  \internal
+*/
+bool QtxTreeView::Header::sortMenuEnabled() const
+{
+  return myEnableSortMenu;
+}
+
+/*!
+  \brief Customize context menu event.
+  \internal
+
+  Shows popup menu with the list of the available columns allowing the user to
+  show/hide the specified column.
+
+  \param e context menu event
+*/
+void QtxTreeView::Header::contextMenuEvent( QContextMenuEvent* e )
+{
+  QMenu menu;
+  QMap<QAction*, int> actionMap;
+  for ( int i = 0; i < count(); i++ ) {
+    QString  lab         = model()->headerData( i, orientation(), Qt::DisplayRole ).toString();
+    QVariant iconData    = model()->headerData( i, orientation(), Qt::DecorationRole );
+    QVariant appropriate = model()->headerData( i, orientation(), Qtx::AppropriateRole );
+    QIcon icon;
+    if ( iconData.isValid() ) {
+      if ( qVariantCanConvert<QIcon>( iconData ) )
+       icon = qVariantValue<QIcon>( iconData );
+      else if ( qVariantCanConvert<QPixmap>( iconData ) )
+       icon = qVariantValue<QPixmap>( iconData );
+    }
+    if( ( !lab.isEmpty() || !icon.isNull() ) && 
+           appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true )
+       {
+      QAction* a = menu.addAction( icon, lab );
+      a->setCheckable( true );
+      a->setChecked( !isSectionHidden( i ) );
+      actionMap.insert( a, i );
+    }
+  }
+  QAction* sortAction = 0;
+  if ( count() > 0 && myEnableSortMenu ) {
+    menu.addSeparator();
+    sortAction = menu.addAction( tr( "Enable sorting" ) );
+    sortAction->setCheckable( true );
+    sortAction->setChecked( isSortIndicatorShown() );
+  }
+  if ( !menu.isEmpty() ) {
+    Qtx::simplifySeparators( &menu );
+    QAction* a = menu.exec( e->globalPos() );
+    if ( a && actionMap.contains( a ) ) {
+      setSectionHidden( actionMap[ a ], !isSectionHidden( actionMap[ a ] ) );
+    }
+    else if ( a && a == sortAction ) {
+      setSortIndicatorShown( a->isChecked() );
+      setClickable( a->isChecked() );
+      QtxTreeView* view = qobject_cast<QtxTreeView*>( parent() );
+      if ( view ) {
+       view->emitSortingEnabled( a->isChecked() );
+       if ( a->isChecked() ) {
+         connect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) );
+         view->sortByColumn( sortIndicatorSection(), sortIndicatorOrder() );
+       }
+       else {
+         disconnect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) );
+         view->sortByColumn( 0, Qt::AscendingOrder );
+       }
+      }
+    }
+  }
+  e->accept();
+}
+
+
+/*!
+  \class QtxTreeView
+  \brief Tree view class with possibility to display columns popup menu.
+
+  The QtxTreeView class represents a customized tree view class. In addition to the
+  base functionality inherited from the QTreeView class, clicking at the tree view 
+  header with the right mouse button displays the popup menu allowing the user
+  to show/hide specified columns.
+
+  By default the popup menu contains items corresponding to all the tree view columns.
+  In order to disable some columns from being shown in the popup menu one may customize
+  the data model (see QAbstractItemModel class). The custom model should implement
+  headerData() method and return \c true for the Qtx::AppropriateRole role for
+  those columns which should be available in the popup menu and \c false for the columns
+  which should not be added to it. 
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+*/
+QtxTreeView::QtxTreeView( QWidget* parent )
+: QTreeView( parent )
+{
+  setHeader( new Header( false, this ) );
+  header()->setMovable( true );
+}
+
+/*!
+  \brief Constructor.
+  \param enableSortMenu show "Sorting" header menu command if \c true
+  \param parent parent widget
+*/
+QtxTreeView::QtxTreeView( const bool enableSortMenu, QWidget* parent )
+: QTreeView( parent )
+{
+  setHeader( new Header( enableSortMenu, this ) );
+  header()->setMovable( true );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxTreeView::~QtxTreeView()
+{
+}
+
+/*!
+  \brief Expand all branches for specified number of levels.
+  
+  If \c levels < 0, all branches are expanded (the same results can
+  be achieved with expandAll() method).
+
+  \param levels number of levels to be opened
+  \sa collapseLevels(), setOpened()
+*/
+void QtxTreeView::expandLevels( const int levels )
+{
+  setOpened( rootIndex(), levels+1, true );
+}
+
+/*!
+  \brief Collapse all branches for specified number of levels.
+  
+  If \c levels < 0, all branches are collapsed (the same results can
+  be achieved with collapseAll() method).
+
+  \param levels number of levels to be collapsed
+  \sa expandLevels(), setOpened()
+*/
+void QtxTreeView::collapseLevels( const int levels )
+{
+  setOpened( rootIndex(), levels+1, false );
+}
+
+/*!
+  \brief Expand the branch specifed by the \index and all its
+  children recursively.
+  \param index model index to be expanded
+  \sa collapseAll()
+*/
+void QtxTreeView::expandAll( const QModelIndex& index )
+{
+  setOpened( index, -1, true );
+}
+
+/*!
+  \brief Collapse the branch specifed by the \index and all its
+  children recursively.
+  \param index model index to be collapsed
+  \sa expandAll()
+*/
+void QtxTreeView::collapseAll( const QModelIndex& index )
+{
+  setOpened( index, -1, false );
+}
+
+/*
+  \brief Enable/disable "Sorting" popup menu command for the header.
+  \param enableSortMenu if \c true, enable "Sorting" menu command
+  \sa sortMenuEnabled()
+*/
+void QtxTreeView::setSortMenuEnabled( const bool enableSortMenu )
+{
+  Header* h = dynamic_cast<Header*>( header() );
+  if ( h )
+    h->setSortMenuEnabled( enableSortMenu );
+}
+
+/*
+  \brief Check if "Sorting" popup menu command for the header is enabled.
+  \return \c true if "Sorting" menu command is enabled
+  \sa setSortMenuEnabled()
+*/
+bool QtxTreeView::sortMenuEnabled() const
+{
+  Header* h = dynamic_cast<Header*>( header() );
+  return h ? h->sortMenuEnabled() : false;
+}
+
+/*!
+  \brief Resizes the given column in order to enclose its contents.
+  The size will be changed only if it is smaller than the size of
+  contents.
+  \param column number of column
+*/
+void QtxTreeView::resizeColumnToEncloseContents( int column )
+{
+  if (column < 0 || column >= header()->count())
+    return;
+
+  int contentsSizeHint = sizeHintForColumn(column);
+  int headerSizeHint = header()->isHidden() ? 0 : header()->sectionSizeHint(column);
+  int sizeHint = qMax(contentsSizeHint, headerSizeHint);
+
+  int currentSize = columnWidth( column );
+  if (currentSize < sizeHint)
+    setColumnWidth( column, sizeHint );
+}
+
+/*
+  \brief Called when the header section is clicked.
+  \param column header column index
+*/
+void QtxTreeView::onHeaderClicked( int column )
+{
+  sortByColumn( column, header()->sortIndicatorOrder() );
+}
+
+/*!
+  \brief Called when the selection is changed.
+  
+  Emits selectionChanged() signal.
+  
+  \param selected new selection
+  \param deselected previous selection
+*/
+void QtxTreeView::selectionChanged( const QItemSelection& selected, 
+                                   const QItemSelection& deselected )
+{
+  QTreeView::selectionChanged( selected, deselected );
+  emit( selectionChanged() );
+}
+
+/*!
+  \brief Called when rows are about to be removed.
+  \param parent model index
+  \param start first row to remove
+  \param end last row to remove
+*/
+void QtxTreeView::rowsAboutToBeRemoved( const QModelIndex& parent, int start, int end )
+{
+  setCurrentIndex( QModelIndex() );
+  QTreeView::rowsAboutToBeRemoved( parent, start, end );
+}
+
+/*!
+  \brief Expand/collapse the specified item (recursively).
+  \param index model index
+  \param levels number of levels to be expanded/collapsed
+  \param open if \c true, item is expanded, otherwise it is collapsed
+  \sa expandLevels(), collapseLevels()
+*/
+void QtxTreeView::setOpened( const QModelIndex& index, const int levels, bool open )
+{
+  if ( !levels )
+    return;
+
+  if ( !index.isValid() && index != rootIndex() )
+    return;
+
+  setExpanded( index, open );
+
+  for ( int i = 0; i < model()->rowCount( index ); i++ ) {
+    QModelIndex child = model()->index( i, 0, index );
+    setOpened( child, levels-1, open );
+  }
+}
+
+/*!
+  \fn QtxTreeView::sortingEnabled( bool on );
+  \brief Emitted when "Sorting" commans is enabled/disabled from the popup menu.
+  \param on \c true if sorting is enabled and \c false otherwise
+*/
+
+/*!
+  \fn QtxTreeView::selectionChanged();
+  \brief Emitted when selection is changed in the tree view.
+*/
+
+/*!
+  \brief Emit sortingEnabled(bool) signal.
+  \param enabled "enable sorting" flag state
+*/
+void QtxTreeView::emitSortingEnabled( bool enabled )
+{
+  emit( sortingEnabled( enabled ) );
+}
+
+void QtxTreeView::setModel( QAbstractItemModel* m )
+{
+  if( model() )
+    disconnect( model(), SIGNAL( headerDataChanged( Qt::Orientation, int, int ) ),
+                this, SLOT( onAppropriate( Qt::Orientation, int, int ) ) );
+  QTreeView::setModel( m );
+  if ( model() )
+    connect( model(), SIGNAL( headerDataChanged( Qt::Orientation, int, int ) ),
+            this, SLOT( onAppropriate( Qt::Orientation, int, int ) ) );
+}
+
+void QtxTreeView::onAppropriate( Qt::Orientation orient, int first, int last )
+{
+  if( orient==Qt::Horizontal )
+    for( int i=first; i<=last; i++ )
+       {
+         int appr = model()->headerData( i, orient, Qtx::AppropriateRole ).toInt();
+         header()->setSectionHidden( i, appr==Qtx::Hidden );
+       }
+}
diff --git a/src/Qtx/QtxTreeView.h b/src/Qtx/QtxTreeView.h
new file mode 100644 (file)
index 0000000..2a65382
--- /dev/null
@@ -0,0 +1,83 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxTreeView.h
+// Author:    Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef QTXTREEVIEW_H
+#define QTXTREEVIEW_H
+
+#include "Qtx.h"
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+#include <QTreeView>
+
+class QTX_EXPORT QtxTreeView : public QTreeView
+{
+  Q_OBJECT
+
+  class Header;
+
+public:
+  QtxTreeView( QWidget* = 0 );
+  QtxTreeView( const bool, QWidget* = 0 );
+  virtual ~QtxTreeView();
+
+  void     expandLevels( const int );
+  void     collapseLevels( const int );
+
+  void     expandAll( const QModelIndex& );
+  void     collapseAll( const QModelIndex& );
+
+  void     setSortMenuEnabled( const bool );
+  bool     sortMenuEnabled() const;
+
+  void     resizeColumnToEncloseContents( int );
+
+  virtual void setModel( QAbstractItemModel* );
+
+protected slots:
+  void     onHeaderClicked( int );
+  void     rowsAboutToBeRemoved( const QModelIndex&, int, int );
+  void     selectionChanged( const QItemSelection&, const QItemSelection& );
+  void     onAppropriate( Qt::Orientation, int, int );
+  
+protected:
+  void     setOpened( const QModelIndex&, const int, bool );
+
+signals:
+  void     sortingEnabled( bool );
+  void     selectionChanged();
+
+private:
+  void     emitSortingEnabled( bool );
+
+  friend class QtxTreeView::Header;
+};
+
+#ifdef WIN32
+#pragma warning( default:4251 )
+#endif
+
+#endif // QTXTREEVIEW_H
diff --git a/src/Qtx/QtxValidator.cxx b/src/Qtx/QtxValidator.cxx
new file mode 100644 (file)
index 0000000..6529d9e
--- /dev/null
@@ -0,0 +1,139 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxValidator.cxx
+// Author:    Alexandre SOLOVYOV
+//
+#include "QtxValidator.h"
+
+/*!
+  \class QtxIntValidator
+  \brief Validator for integer numbers with possibility to fix up the invalid value.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent object
+*/
+QtxIntValidator::QtxIntValidator( QObject* parent )
+: QIntValidator( parent )
+{
+}
+
+/*!
+  \brief Constructor.
+  \param bot minimum possible value
+  \param top maximum possible value
+  \param parent parent object
+*/
+QtxIntValidator::QtxIntValidator( const int bot, const int top, QObject* parent )
+: QIntValidator( bot, top, parent )
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxIntValidator::~QtxIntValidator()
+{
+}
+
+/*!
+  \brief Validate the input and fixup it if necessary.
+
+  If the string represents integer value less then minimum value, it becomes equal to the minimum.
+  if the string represents integer value more then mazimum value, it becomes equal to the maximum.
+  If the string is not evaluated as integer it becomes equal to \c 0.
+
+  \param str the string to be validated
+*/
+void QtxIntValidator::fixup( QString& str ) const
+{
+  bool ok = false;
+  int i = str.toInt( &ok );
+  if ( ok )
+  {
+    if ( i < bottom() )
+      str = QString::number( bottom() );
+    else if( i > top() )
+      str = QString::number( top() );
+  }
+  else
+    str = QString ( "0" );
+}
+
+/*!
+  \class QtxDoubleValidator
+  \brief Validator for double numbers with possibility to fix up the invalid value.
+*/
+
+/*!
+  \brief Constructor
+  \param parent parent object
+*/
+QtxDoubleValidator::QtxDoubleValidator( QObject* parent )
+: QDoubleValidator( parent )
+{
+}
+
+/*!
+  \brief Constructor.
+  \param bot minimum possible value
+  \param top maximum possible value
+  \param dec precision (number of digits after dot)
+  \param parent parent object
+*/
+QtxDoubleValidator::QtxDoubleValidator( const double bot, const double top,
+                                       const int dec, QObject* parent )
+: QDoubleValidator( bot, top, dec, parent )
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxDoubleValidator::~QtxDoubleValidator()
+{
+}
+
+/*!
+  \brief Validate the input and fixup it if necessary.
+
+  If the string represents double value less then minimum value, it becomes equal to the minimum.
+  if the string represents double value more then mazimum value, it becomes equal to the maximum.
+  If the string is not evaluated as double it becomes equal to \c 0.
+
+  \param str the string to be validated
+*/
+void QtxDoubleValidator::fixup( QString& str ) const
+{
+  bool ok = false;
+  double d = str.toDouble( &ok );
+  if ( ok )
+  {
+    if ( d < bottom() )
+      str = QString::number( bottom() );
+    else if ( d > top() )
+      str = QString::number( top() );
+  }
+  else
+    str = QString( "0" );
+}
diff --git a/src/Qtx/QtxValidator.h b/src/Qtx/QtxValidator.h
new file mode 100644 (file)
index 0000000..4f02deb
--- /dev/null
@@ -0,0 +1,56 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxValidator.h
+// Author:    Alexandre SOLOVYOV
+//
+#ifndef QTXVALIDATOR_H
+#define QTXVALIDATOR_H
+
+#include "Qtx.h"
+
+#include <QValidator>
+
+class QTX_EXPORT QtxIntValidator : public QIntValidator
+{
+  Q_OBJECT
+
+public:
+  QtxIntValidator( QObject* );
+  QtxIntValidator( const int, const int, QObject* );
+  virtual ~QtxIntValidator();
+
+  virtual void fixup( QString& ) const;
+};
+
+class QTX_EXPORT QtxDoubleValidator : public QDoubleValidator
+{
+  Q_OBJECT
+
+public:
+  QtxDoubleValidator( QObject* );
+  QtxDoubleValidator( const double, const double, const int, QObject* );
+  virtual ~QtxDoubleValidator();
+
+  virtual void fixup( QString& ) const;
+};
+
+#endif // QTXVALIDATOR_H
diff --git a/src/Qtx/QtxWorkspace.cxx b/src/Qtx/QtxWorkspace.cxx
new file mode 100644 (file)
index 0000000..90bef87
--- /dev/null
@@ -0,0 +1,140 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxWorkspace.cxx
+// Author:    Sergey TELKOV
+//
+#include "QtxWorkspace.h"
+
+#include <QWidgetList>
+
+/*!
+  \class QtxWorkspace
+  \brief A workspace widget which can be used in the MDI application
+         as top-level widget in the application main window.
+
+  Provides methods to tile child windows in horizontal or vertical
+  direction.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+*/
+QtxWorkspace::QtxWorkspace( QWidget* parent )
+: QWorkspace( parent )
+{
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxWorkspace::~QtxWorkspace()
+{
+}
+
+/*!
+  \brief Tiles child windows vertically.
+*/
+void QtxWorkspace::tileVertical()
+{
+  QWidgetList winList = windowList();
+  if ( winList.isEmpty() )
+    return;
+  
+  int count = 0;
+  for ( QWidgetList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr )
+    if ( !( (*itr)->windowState() & Qt::WindowMinimized ) )
+      count++;
+
+  if ( !count )
+    return;
+
+  if ( activeWindow() && ( activeWindow()->windowState() & Qt::WindowMaximized ) )
+    activeWindow()->showNormal();
+
+  int y = 0;
+  int heightForEach = height() / count;
+  for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it )
+  {
+    QWidget* win = *it;
+    if ( win->windowState() & Qt::WindowMinimized )
+      continue;
+    
+    if ( win->windowState() & Qt::WindowMaximized )
+    {
+      win->hide();
+      win->showNormal();
+    }
+    
+//    QApplication::sendPostedEvents( 0, QEvent::ShowNormal );
+
+    int prefH = win->minimumHeight() + win->parentWidget()->baseSize().height();
+    int actualH = qMax( heightForEach, prefH );
+
+    win->parentWidget()->setGeometry( 0, y, width(), actualH );
+    y += actualH;
+  }
+}
+
+/*!
+  \brief Tiles child windows horizontally.
+*/
+void QtxWorkspace::tileHorizontal()
+{
+  QWidgetList winList = windowList();
+  if ( winList.isEmpty() )
+    return;
+
+  int count = 0;
+  for ( QWidgetList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr )
+    if ( !( (*itr)->windowState() & Qt::WindowMinimized ) )
+      count++;
+
+  if ( !count )
+    return;
+
+  if ( activeWindow() && activeWindow()->windowState() & Qt::WindowMaximized )
+    activeWindow()->showNormal();
+  
+  int x = 0;
+  int widthForEach = width() / count;
+  for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it )
+  {
+    QWidget* win = *it;
+    if ( win->windowState() & Qt::WindowMinimized )
+      continue;
+    
+    if ( win->windowState() & Qt::WindowMaximized )
+    {
+      win->hide();
+      win->showNormal();
+    }
+
+//    QApplication::sendPostedEvents( 0, QEvent::ShowNormal );
+
+    int prefW = win->minimumWidth();
+    int actualW = qMax( widthForEach, prefW );
+    
+    win->parentWidget()->setGeometry( x, 0, actualW, height() );
+    x += actualW;
+  }
+}
diff --git a/src/Qtx/QtxWorkspace.h b/src/Qtx/QtxWorkspace.h
new file mode 100644 (file)
index 0000000..85bab25
--- /dev/null
@@ -0,0 +1,53 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      QtxWorkspace.h
+// Author:    Sergey TELKOV
+//
+#ifndef QTXWORKSPACE_H
+#define QTXWORKSPACE_H
+
+#include "Qtx.h"
+
+#include <QWorkspace>
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+class QTX_EXPORT QtxWorkspace : public QWorkspace
+{
+  Q_OBJECT
+
+public:
+  QtxWorkspace( QWidget* = 0 );
+  virtual ~QtxWorkspace();
+
+public slots:
+  void        tileVertical();
+  void        tileHorizontal();
+};
+
+#ifdef WIN32
+#pragma warning( default:4251 )
+#endif
+
+#endif
index f06c5c2a4ca84ba7b30f94960cbe1549331cc8b4..d2d517977ff91341659cb330944400bcaf73a98a 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxWorkspaceAction.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxWorkspaceAction.h"
 
-#include <qpopupmenu.h>
-#include <qworkspace.h>
-#include <qwidgetlist.h>
+#include "QtxWorkspace.h"
+
+#include <QMenu>
+#include <QWidgetList>
 
 /*!
-  Constructor
+  \class QtxWorkspaceAction
+  \brief Implements actions group for menu Windows with standard operations, like
+         "Cascade", "Tile", "Tile Horizontally", etc.
 */
-QtxWorkspaceAction::QtxWorkspaceAction( QWorkspace* ws, QObject* parent, const char* name )
-: QtxAction( tr( "Controls windows into workspace" ), tr( "Workspace management" ), 0, parent, name ),
-myFlags( Standard ),
-myWorkspace( ws )
-{
-  myItem.insert( Cascade, new QtxAction( tr( "Arranges the windows as overlapping tiles" ),
-                                         tr( "Cascade" ), 0, this, 0, false ) );
-  myItem.insert( Tile,    new QtxAction( tr( "Arranges the windows as nonoverlapping tiles" ),
-                                         tr( "Tile" ), 0, this, 0, false ) );
-  myItem.insert( HTile,   new QtxAction( tr( "Arranges the windows as nonoverlapping horizontal tiles" ),
-                                         tr( "Tile horizontally" ), 0, this, 0, false ) );
-  myItem.insert( VTile,   new QtxAction( tr( "Arranges the windows as nonoverlapping vertical tiles" ),
-                                         tr( "Tile vertically" ), 0, this, 0, false ) );
-
-  connect( myItem[Tile], SIGNAL( activated() ), this, SLOT( tile() ) );
-  connect( myItem[Cascade], SIGNAL( activated() ), this, SLOT( cascade() ) );
-  connect( myItem[HTile], SIGNAL( activated() ), this, SLOT( tileVertical() ) );
-  connect( myItem[VTile], SIGNAL( activated() ), this, SLOT( tileHorizontal() ) );
-}
 
 /*!
-  Destructor
+  \brief Constructor.
+  \param ws parent workspace
+  \param parent parent object (owner of the action)
 */
-QtxWorkspaceAction::~QtxWorkspaceAction()
+QtxWorkspaceAction::QtxWorkspaceAction( QtxWorkspace* ws, QObject* parent )
+: QtxActionSet( parent ),
+  myWorkspace( ws ),
+  myWindowsFlag( true )
 {
+  insertAction( new QtxAction( tr( "Arranges the windows as overlapping tiles" ),
+                               tr( "Cascade" ), 0, this ), Cascade );
+  insertAction( new QtxAction( tr( "Arranges the windows as nonoverlapping tiles" ),
+                               tr( "Tile" ), 0, this ), Tile );
+  insertAction( new QtxAction( tr( "Arranges the windows as nonoverlapping horizontal tiles" ),
+                               tr( "Tile horizontally" ), 0, this ), HTile );
+  insertAction( new QtxAction( tr( "Arranges the windows as nonoverlapping vertical tiles" ),
+                               tr( "Tile vertically" ), 0, this ), VTile );
+
+  connect( this, SIGNAL( triggered( int ) ), this, SLOT( onTriggered( int ) ) );
+
+  setMenuActions( Standard );
 }
 
 /*!
-  \return corresponding workspace
+  \brief Destructor.
 */
-QWorkspace* QtxWorkspaceAction::workspace() const
+QtxWorkspaceAction::~QtxWorkspaceAction()
 {
-  return myWorkspace;
 }
 
 /*!
-  \return set of action flags
+  \brief Get workspace.
+  \return parent workspace
 */
-int QtxWorkspaceAction::items() const
+QtxWorkspace* QtxWorkspaceAction::workspace() const
 {
-  return myFlags;
+  return myWorkspace;
 }
 
 /*!
-  Sets action flags
-  \param flags - new set of flags
+  \brief Set actions to be visible in the menu.
+  
+  Actions, which IDs are set in \a flags parameter, will be shown in the 
+  menu bar. Other actions will not be shown.
+
+  \param flags ORed together actions flags
 */
-void QtxWorkspaceAction::setItems( const int flags )
+void QtxWorkspaceAction::setMenuActions( const int flags )
 {
-  if ( !flags || flags == myFlags || !( flags & Operations ) )
-    return;
-
-  myFlags = flags;
+  action( Cascade )->setVisible( flags & Cascade );
+  action( Tile )->setVisible( flags & Tile );
+  action( VTile )->setVisible( flags & VTile );
+  action( HTile )->setVisible( flags & HTile );
+  myWindowsFlag = flags & Windows;
 }
 
 /*!
-  \return true if action contains all flags
-  \param flags - new set of flags
+  \brief Get menu actions which are currently visible in the menu bar.
+  \return ORed together actions flags
+  \sa setMenuActions()
 */
-bool QtxWorkspaceAction::hasItems( const int flags ) const
+int QtxWorkspaceAction::menuActions() const
 {
-  return ( myFlags & flags ) == flags;
+  int ret = 0;
+  ret = ret | ( action( Cascade )->isVisible() ? Cascade : 0 );
+  ret = ret | ( action( Tile )->isVisible() ? Tile : 0 );
+  ret = ret | ( action( VTile )->isVisible() ? VTile : 0 );
+  ret = ret | ( action( HTile )->isVisible() ? HTile : 0 );
+  ret = ret | ( myWindowsFlag ? Windows : 0 );
+  return ret;
 }
 
 /*!
-  \return accelerator of item
-  \param id - item id
+  \brief Get keyboard accelerator for the specified action.
+  \param id menu action ID
+  \return keyboard accelerator of menu item or 0 if there is no such action
 */
 int QtxWorkspaceAction::accel( const int id ) const
 {
   int a = 0;
-  if ( myItem.contains( id ) )
-    a = myItem[id]->accel();
+  if ( action( id ) )
+    a = action( id )->shortcut();
   return a;
 }
 
 /*!
-  \return icons of item
-  \param id - item id
+  \brief Get icon for the specified action.
+
+  If \a id is invalid, null icon is returned.
+
+  \param id menu action ID
+  \return menu item icon
 */
-QIconSet QtxWorkspaceAction::iconSet( const int id ) const
+QIcon QtxWorkspaceAction::icon( const int id ) const
 {
-  QIconSet ico;
-  if ( myItem.contains( id ) )
-    ico = myItem[id]->iconSet();
+  QIcon ico;
+  if ( action( id ) )
+    ico = action( id )->icon();
   return ico;
 }
 
 /*!
-  \return menu text of item
-  \param id - item id
+  \brief Get menu item text for the specified action.
+  \param id menu action ID
+  \return menu item text or null QString if there is no such action
 */
-QString QtxWorkspaceAction::menuText( const int id ) const
+QString QtxWorkspaceAction::text( const int id ) const
 {
   QString txt;
-  if ( myItem.contains( id ) )
-    txt = myItem[id]->menuText();
+  if ( action( id ) )
+    txt = action( id )->text();
   return txt;
 }
 
 /*!
-  \return status tip of item
-  \param id - item id
+  \brief Get status bar tip for the specified action.
+  \param id menu action ID
+  \return status bar tip menu item or null QString if there is no such action
 */
 QString QtxWorkspaceAction::statusTip( const int id ) const
 {
   QString txt;
-  if ( myItem.contains( id ) )
-    txt = myItem[id]->statusTip();
+  if ( action( id ) )
+    txt = action( id )->statusTip();
   return txt;
 }
 
 /*!
-  Changes accelerator of item
-  \param id - item id
-  \param a - new accelerator
+  \brief Set keyboard accelerator for the specified action.
+  \param id menu action ID
+  \param a new keyboard accelerator
 */
 void QtxWorkspaceAction::setAccel( const int id, const int a )
 {
-  if ( myItem.contains( id ) )
-    myItem[id]->setAccel( a );
+  if ( action( id ) )
+    action( id )->setShortcut( a );
 }
 
 /*!
-  Changes icons of item
-  \param id - item id
-  \param ico - new icons
+  \brief Set menu item icon for the specified action.
+  \param id menu action ID
+  \param ico new menu item icon
 */
-void QtxWorkspaceAction::setIconSet( const int id, const QIconSet& ico )
+void QtxWorkspaceAction::setIcon( const int id, const QIcon& icon )
 {
-  if ( myItem.contains( id ) )
-    myItem[id]->setIconSet( ico );
+  if ( action( id ) )
+    action( id )->setIcon( icon );
 }
 
 /*!
-  Changes menu text of item
-  \param id - item id
-  \param txt - new menu text
+  \brief Set menu item text for the specified action.
+  \param id menu action ID
+  \param txt new menu item text
 */
-void QtxWorkspaceAction::setMenuText( const int id, const QString& txt )
+void QtxWorkspaceAction::setText( const int id, const QString& txt )
 {
-  if ( myItem.contains( id ) )
-    myItem[id]->setMenuText( txt );
+  if ( action( id ) )
+    action( id )->setText( txt );
 }
 
 /*!
-  Changes status tip of item
-  \param id - item id
-  \param txt - new status tip
+  \brief Set menu item status bar tip for the specified action.
+  \param id menu action ID
+  \param txt new menu item status bar tip
 */
 void QtxWorkspaceAction::setStatusTip( const int id, const QString& txt )
 {
-  if ( myItem.contains( id ) )
-    myItem[id]->setStatusTip( txt );
-}
-
-/*!
-  Adds action to widget
-  \param wid - widget
-*/
-bool QtxWorkspaceAction::addTo( QWidget* wid )
-{
-  return addTo( wid, -1 );
-}
-
-/*!
-  Adds action to widget
-  \param wid - widget
-  \param idx - position
-*/
-bool QtxWorkspaceAction::addTo( QWidget* wid, const int idx )
-{
-  if ( !wid || !wid->inherits( "QPopupMenu" ) )
-    return false;
-
-  QPopupMenu* pm = (QPopupMenu*)wid;
-  checkPopup( pm );
-
-  if ( myMenu.contains( pm ) )
-    return false;
-
-  myMenu.insert( pm, QIntList() );
-  fillPopup( pm, idx );
-
-  connect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
-  connect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onPopupDestroyed( QObject* ) ) );
-
-  return true;
-}
-
-/*!
-  Removes action from widget
-  \param wid - widget
-*/
-bool QtxWorkspaceAction::removeFrom( QWidget* wid )
-{
-  if ( !wid || !wid->inherits( "QPopupMenu" ) )
-    return false;
-
-  QPopupMenu* pm = (QPopupMenu*)wid;
-  if ( !myMenu.contains( pm ) )
-    return false;
-
-  clearPopup( pm );
-
-  disconnect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
-  disconnect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onPopupDestroyed( QObject* ) ) );
-
-  myMenu.remove( pm );
-
-  return true;
+  if ( action( id ) )
+    action( id )->setStatusTip( txt );
 }
 
 /*!
-  Performs action
-  \param type - action type
+  \brief Process action activated by the user.
+  \param type action ID
 */
 void QtxWorkspaceAction::perform( const int type )
 {
@@ -265,23 +231,21 @@ void QtxWorkspaceAction::perform( const int type )
 }
 
 /*!
-  Performs tile action
+  \brief Tile child windows in the workspace.
 */
 void QtxWorkspaceAction::tile()
 {
-  QWorkspace* ws = workspace();
-  if ( !ws )
-    return;
-
-  ws->tile();
+  QtxWorkspace* ws = workspace();
+  if ( ws )
+    ws->tile();
 }
 
 /*!
-  Performs cascade action
+  \brief Cascade child windows in the workspace.
 */
 void QtxWorkspaceAction::cascade()
 {
-  QWorkspace* ws = workspace();
+  QtxWorkspace* ws = workspace();
   if ( !ws )
     return;
 
@@ -291,240 +255,162 @@ void QtxWorkspaceAction::cascade()
        int h = ws->height();
 
        QWidgetList winList = ws->windowList();
-       for ( QWidgetListIt it( winList ); it.current(); ++it )
-               it.current()->resize( int( w * 0.8 ), int( h * 0.8 ) );
+  for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it )
+               (*it)->resize( int( w * 0.8 ), int( h * 0.8 ) );
 }
 
 /*!
-  Performs tile vertical action
+  \brief Tile child windows in the workspace in the vertical direction.
 */
 void QtxWorkspaceAction::tileVertical()
 {
-  QWorkspace* wrkSpace = workspace();
-       if ( !wrkSpace )
-               return;
-       
-       QWidgetList winList = wrkSpace->windowList();
-       if ( winList.isEmpty() )
-    return;
-
-  int count = 0;
-       for ( QWidgetListIt itr( winList ); itr.current(); ++itr )
-    if ( !itr.current()->testWState( WState_Minimized ) )
-      count++;
-
-  if ( !count )
-    return;
-
-       int y = 0;
-
-       int heightForEach = wrkSpace->height() / count;
-       for ( QWidgetListIt it( winList ); it.current(); ++it )
-       {
-    QWidget* win = it.current();
-    if ( win->testWState( WState_Minimized ) )
-      continue;
-
-    if ( win->testWState( WState_Maximized ) )
-               {
-                       win->hide();
-                       win->showNormal();
-    }
-    int prefH = win->minimumHeight() + win->parentWidget()->baseSize().height();
-    int actualH = QMAX( heightForEach, prefH );
-
-    win->parentWidget()->setGeometry( 0, y, wrkSpace->width(), actualH );
-    y += actualH;
-       }
+  QtxWorkspace* ws = workspace();
+  if ( ws )
+    ws->tileVertical();
 }
 
 /*!
-  Performs tile horizontal action
+  \brief Tile child windows in the workspace in the horizontal direction.
 */
 void QtxWorkspaceAction::tileHorizontal()
 {
-  QWorkspace* wrkSpace = workspace();
-       if ( !wrkSpace )
-               return;
-
-       QWidgetList winList = wrkSpace->windowList();
-       if ( winList.isEmpty() )
-    return;
-
-  int count = 0;
-       for ( QWidgetListIt itr( winList ); itr.current(); ++itr )
-    if ( !itr.current()->testWState( WState_Minimized ) )
-      count++;
-
-  if ( !count )
-    return;
-
-       int x = 0;
-       int widthForEach = wrkSpace->width() / count;
-       for ( QWidgetListIt it( winList ); it.current(); ++it )
-       {
-    QWidget* win = it.current();
-    if ( win->testWState( WState_Minimized ) )
-      continue;
-
-    if ( win->testWState( WState_Maximized ) )
-               {
-                       win->hide();
-                       win->showNormal();
-    }
-    int prefW = win->minimumWidth();
-    int actualW = QMAX( widthForEach, prefW );
-        
-               win->parentWidget()->setGeometry( x, 0, actualW, wrkSpace->height() );
-    x += actualW;
-       }
+  QtxWorkspace* ws = workspace();
+  if ( ws )
+    ws->tileHorizontal();
 }
 
 /*!
-  SLOT: called just before the popup menu is displayed, updates popup
+  \brief Called when action is added to the menu bar.
+  \param w menu bar widget this action is being added to
 */
-void QtxWorkspaceAction::onAboutToShow()
+void QtxWorkspaceAction::addedTo( QWidget* w )
 {
-  const QObject* obj = sender();
-  if ( !obj || !obj->inherits( "QPopupMenu" ) )
-    return;
+  QtxActionSet::addedTo( w );
 
-  updatePopup( (QPopupMenu*)obj );
+  QMenu* pm = ::qobject_cast<QMenu*>( w );
+  if ( pm )
+    connect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
 }
 
 /*!
-  SLOT: called when popup menu is destroyed, removes it from menu
+  \brief Called when action is removed from the menu bar.
+  \param w menu bar widget this action is being removed from
 */
-void QtxWorkspaceAction::onPopupDestroyed( QObject* obj )
+void QtxWorkspaceAction::removedFrom( QWidget* w )
 {
-  myMenu.remove( (QPopupMenu*)obj );
-}
-
-/*!
-  Updates popup
-  \param pm - popup menu
-*/
-void QtxWorkspaceAction::checkPopup( QPopupMenu* pm )
-{
-  if ( !myMenu.contains( pm ) )
-    return;
-
-  QIntList updList;
-  for ( QIntList::const_iterator it = myMenu[pm].begin(); it != myMenu[pm].end(); ++it )
-  {
-    if ( pm->indexOf( *it ) != -1 )
-      updList.append( *it );
-  }
+  QtxActionSet::removedFrom( w );
 
-  myMenu.remove( pm );
-
-  if ( !updList.isEmpty() )
-    myMenu.insert( pm, updList );
-  else
-  {
+  QMenu* pm = ::qobject_cast<QMenu*>( w );
+  if ( pm )
     disconnect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
-    disconnect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onPopupDestroyed( QObject* ) ) );
-  }
 }
 
 /*!
-  Clears and refills popup and updates state of actions
-  \param pm - popup menu
+  \brief Update all menu action state.
 */
-void QtxWorkspaceAction::updatePopup( QPopupMenu* pm )
+void QtxWorkspaceAction::updateContent()
 {
-  if ( !myMenu.contains( pm ) )
-    return;
-
-  fillPopup( pm, clearPopup( pm ) );
-
   bool count = workspace() ? workspace()->windowList().count() : 0;
-  myItem[Cascade]->setEnabled( count );
-  myItem[Tile]->setEnabled( count );
-  myItem[HTile]->setEnabled( count );
-  myItem[VTile]->setEnabled( count );
-}
-
-/*!
-  Clears popup
-  \param pm - popup menu
-*/
-int QtxWorkspaceAction::clearPopup( QPopupMenu* pm )
-{
-  if ( !myMenu.contains( pm ) )
-    return -1;
+  action( Cascade )->setEnabled( count );
+  action( Tile )->setEnabled( count );
+  action( HTile )->setEnabled( count );
+  action( VTile )->setEnabled( count );
 
-  int idx = -1;
-  const QIntList& lst = myMenu[pm];
-  for ( QIntList::const_iterator it = lst.begin(); it != lst.end() && idx == -1; ++it )
-    idx = pm->indexOf( *it );
-
-  for ( ItemMap::ConstIterator mit = myItem.begin(); mit != myItem.end(); ++mit )
-    mit.data()->removeFrom( pm );
-
-  for ( QIntList::const_iterator itr = lst.begin(); itr != lst.end(); ++itr )
-    pm->removeItem( *itr );
-
-  return idx;
+  updateWindows();
 }
 
 /*!
-  Fills popup with items
-  \param pm - popup menu
-  \param idx - position
+  \brief Update actions which refer to the opened child windows.
 */
-void QtxWorkspaceAction::fillPopup( QPopupMenu* pm, const int idx )
+void QtxWorkspaceAction::updateWindows()
 {
-  if ( !pm )
+  QtxWorkspace* ws = workspace();
+  if ( !ws )
     return;
 
-  int index = idx < 0 ? pm->count() : QMIN( (int)pm->count(), idx );
+  QList<QAction*> lst = actions();
+  for ( QList<QAction*>::iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    int id = actionId( *it );
+    if ( id >= Windows )
+      removeAction( *it );
+  }
 
-  myMenu.insert( pm, QIntList() );
-  QIntList& lst = myMenu[pm];
+  bool base = action( Cascade )->isVisible() || action( Tile )->isVisible() ||
+              action( HTile )->isVisible() || action( VTile )->isVisible();
 
-  for ( ItemMap::ConstIterator mit = myItem.begin(); mit != myItem.end(); ++mit )
+  QList<QAction*> items;
+  QMap<QAction*, int> map;
+  if ( menuActions() & Windows )
   {
-    if ( !hasItems( mit.key() ) )
-      continue;
+    int index = 1;
+    QWidgetList wList = ws->windowList();
+    for ( QWidgetList::iterator it = wList.begin(); it != wList.end(); ++it, index++ )
+    {
+      QWidget* wid = *it;
+      QAction* a = new QtxAction( wid->windowTitle(), wid->windowTitle(), 0, this, true );
+      a->setChecked( wid == ws->activeWindow() );
+      items.append( a );
+      map.insert( a, Windows + index );
+    }
 
-    mit.data()->addTo( pm, index );
-    lst.append( pm->idAt( index++ ) );
+    if ( base && !items.isEmpty() )
+    {
+      QAction* sep = new QtxAction( this );
+      sep->setSeparator( true );
+      items.prepend( sep );
+      map.insert( sep, Windows );
+    }
   }
 
-  QWorkspace* ws = workspace();
-  if ( !ws || !hasItems( Windows ) )
-    return;
+  if ( !items.isEmpty() )
+    insertActions( items );
 
-  QWidgetList wList = ws->windowList();
-  if ( wList.isEmpty() )
-    return;
+  for ( QMap<QAction*, int>::const_iterator itr = map.begin(); itr != map.end(); ++itr )
+    setActionId( itr.key(), itr.value() );
+}
 
-  lst.append( pm->insertSeparator( index++ ) );
+/*!
+  \brief Called when parent menu is about to show.
 
-  int param = 0;
-  pm->setCheckable( true );
-  for ( QWidgetListIt it( wList ); it.current(); ++it )
-  {
-    int id = pm->insertItem( it.current()->caption(), this, SLOT( onItemActivated( int ) ), 0, -1, index++ );
-    pm->setItemParameter( id, param++ );
-    pm->setItemChecked( id, it.current() == ws->activeWindow() );
-    lst.append( id );
-  }
+  Updates all menu items.
+*/
+void QtxWorkspaceAction::onAboutToShow()
+{
+  QMenu* pm = ::qobject_cast<QMenu*>( sender() );
+  if ( pm )
+    updateContent();
 }
 
 /*!
-  SLOT: called when popup item corresponding to window is activated, activates window
+  \brief Called when menu item corresponding to some child window is activated.
+
+  Activates correposponding child window.
+
+  \param idx menu item index
 */
-void QtxWorkspaceAction::onItemActivated( int idx )
+void QtxWorkspaceAction::activateItem( const int idx )
 {
-  QWorkspace* ws = workspace();
+  QtxWorkspace* ws = workspace();
   if ( !ws )
     return;
 
   QWidgetList wList = ws->windowList();
-  if ( idx < 0 || idx >= (int)wList.count() )
-    return;
+  if ( idx >= 0 && idx < (int)wList.count() )
+    wList.at( idx )->setFocus();
+}
+
+/*!
+  \brief Called when menu item is activated by the user.
+  
+  Perform the corresponding action.
 
-  wList.at( idx )->setFocus();
+  \param id menu item identifier
+*/
+void QtxWorkspaceAction::onTriggered( int id )
+{
+  if ( id < Windows )
+    perform( id );
+  else
+    activateItem( id - Windows - 1 );
 }
index 2dfee9cdbf528638eac2e07b35489614b56fc414..0f5d89360530a1c692c2a9636c1dbe58cc80a823 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxWorkspaceAction.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXWORKSPACEACTION_H
 #define QTXWORKSPACEACTION_H
 
-#include "QtxAction.h"
+#include "QtxActionSet.h"
 
-class QWorkspace;
+class QtxWorkspace;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
-class QTX_EXPORT QtxWorkspaceAction : public QtxAction
+class QTX_EXPORT QtxWorkspaceAction : public QtxActionSet
 {
   Q_OBJECT
 
 public:
-  enum { Cascade    = 0x0001,
-         Tile       = 0x0002,
-         VTile      = 0x0004,
-         HTile      = 0x0008,
-         Windows    = 0x0010,
+  //! Actions (menu items) ID
+  enum { Cascade    = 0x0001,   //!< "Cascade child windows" operation
+         Tile       = 0x0002,   //!< "Tile child windows" operation
+         VTile      = 0x0004,   //!< "Tile child windows vertically" operation
+         HTile      = 0x0008,   //!< "Tile child windows horizontally" operation
+         Windows    = 0x0010,   //!< A list of child windows menu items
          Standard   = Cascade | Tile | Windows,
          Operations = Cascade | Tile | VTile | HTile,
          All        = Standard | HTile | VTile };
 
 public:
-  QtxWorkspaceAction( QWorkspace*, QObject* = 0, const char* = 0 );
+  QtxWorkspaceAction( QtxWorkspace*, QObject* = 0 );
   virtual ~QtxWorkspaceAction();
 
-  QWorkspace*  workspace() const;
-
-  int          items() const;
-  void         setItems( const int );
-  bool         hasItems( const int ) const;
+  QtxWorkspace* workspace() const;
 
-  int          accel( const int ) const;
-  QIconSet     iconSet( const int ) const;
-  QString      menuText( const int ) const;
-  QString      statusTip( const int ) const;
+  int           menuActions() const;
+  void          setMenuActions( const int );
 
-  void         setAccel( const int, const int );
-  void         setIconSet( const int, const QIconSet& );
-  void         setMenuText( const int, const QString& );
-  void         setStatusTip( const int, const QString& );
+  QIcon         icon( const int ) const;
+  QString       text( const int ) const;
+  int           accel( const int ) const;
+  QString       statusTip( const int ) const;
 
-  virtual bool addTo( QWidget* );
-  virtual bool addTo( QWidget*, const int );
-  virtual bool removeFrom( QWidget* );
+  void          setAccel( const int, const int );
+  void          setIcon( const int, const QIcon& );
+  void          setText( const int, const QString& );
+  void          setStatusTip( const int, const QString& );
 
-  void         perform( const int );
+  void          perform( const int );
 
 public slots:
-  void         tile();
-  void         cascade();
-  void         tileVertical();
-  void         tileHorizontal();
+  void          tile();
+  void          cascade();
+  void          tileVertical();
+  void          tileHorizontal();
 
 private slots:
-  void         onAboutToShow();
-  void         onItemActivated( int );
-  void         onPopupDestroyed( QObject* );
-
-private:
-  void         checkPopup( QPopupMenu* );
-  void         updatePopup( QPopupMenu* );
+  void          onAboutToShow();
+  void          onTriggered( int );
 
-  int          clearPopup( QPopupMenu* );
-  void         fillPopup( QPopupMenu*, const int );
+protected:
+  virtual void  addedTo( QWidget* );
+  virtual void  removedFrom( QWidget* );
 
 private:
-  typedef QMap<QPopupMenu*, QIntList> MenuMap;
-  typedef QMap<int, QtxAction*>       ItemMap;
+  void          updateContent();
+  void          updateWindows();
+  void          activateItem( const int );
 
 private:
-  MenuMap      myMenu;
-  ItemMap      myItem;
-  int          myFlags;
-  QWorkspace*  myWorkspace;
+  QtxWorkspace* myWorkspace;       //!< parent workspace
+  bool          myWindowsFlag;     //!< "show child windows items" flag
 };
 
 #ifdef WIN32
index 3cf22f41384375b6e1237c40fd8c6f83745555cd..f67e0cdb291380f5924448e6f4466eebd83f7cff 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxWorkstack.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxWorkstack.h"
 
-#include <qstyle.h>
-#include <qimage.h>
-#include <qaction.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qiconset.h>
-#include <qpainter.h>
-#include <qsplitter.h>
-#include <qpopupmenu.h>
-#include <qobjectlist.h>
-#include <qpushbutton.h>
-#include <qwidgetstack.h>
-#include <qapplication.h>
-#include <qinputdialog.h>
-#include <qevent.h>
-#include <qregexp.h>
+#include "QtxAction.h"
 
-#define DARK_COLOR_LIGHT      250
+#include <QMenu>
+#include <QStyle>
+#include <QRegExp>
+#include <QLayout>
+#include <QPainter>
+#include <QSplitter>
+#include <QFocusEvent>
+#include <QMouseEvent>
+#include <QRubberBand>
+#include <QApplication>
+#include <QStyleOption>
+#include <QInputDialog>
+#include <QStackedWidget>
+#include <QAbstractButton>
 
 /*!
-  Constructor
+  \class QtxWorkstackArea::WidgetEvent
+  \internal
+  \brief Internal class used to forward child widgets events to the workarea
 */
-QtxWorkstack::QtxWorkstack( QWidget* parent )
-: QWidget( parent ),
-myWin( 0 ),
-myArea( 0 ),
-myWorkWin( 0 ),
-myWorkArea( 0 )
+
+class QtxWorkstackArea::WidgetEvent : public QEvent
 {
-  myActionsMap.insert( SplitVertical,   new QAction( tr( "Split vertically" ),   0, this ) );
-  myActionsMap.insert( SplitHorizontal, new QAction( tr( "Split horizontally" ), 0, this ) );
-  myActionsMap.insert( Close,           new QAction( tr( "Close" ),       0, this ) );
-  myActionsMap.insert( Rename,          new QAction( tr( "Rename" ),      0, this ) );
+public:
+  WidgetEvent( Type t, QWidget* w = 0 ) : QEvent( t ), myWidget( w ) {};
 
-  connect( myActionsMap[SplitVertical], SIGNAL( activated() ), this, SLOT( splitVertical() ) );
-  connect( myActionsMap[SplitHorizontal], SIGNAL( activated() ), this, SLOT( splitHorizontal() ) );
-  connect( myActionsMap[Close], SIGNAL( activated() ), this, SLOT( onCloseWindow() ) );
-  connect( myActionsMap[Rename], SIGNAL( activated() ), this, SLOT( onRename() ) );
+  QWidget* widget() const { return myWidget; }
 
-  QVBoxLayout* base = new QVBoxLayout( this );
-  mySplit = new QSplitter( this );
-  mySplit->setChildrenCollapsible( false );
-  base->addWidget( mySplit );
-}
+private:
+  QWidget* myWidget;   // event receiver widget
+};
 
 /*!
-  Destructor
+  \class QtxWorkstackDrag
+  \internal
+  \brief Workstack drag object
 */
-QtxWorkstack::~QtxWorkstack()
+
+/*!
+  \brief Constructor.
+  \param ws parent workstack
+  \param child child widget container
+*/
+QtxWorkstackDrag::QtxWorkstackDrag( QtxWorkstack* ws, QtxWorkstackChild* child )
+: QObject( 0 ),
+  myWS( ws ),
+  myChild( child ),
+  myTab( -1 ),
+  myArea( 0 ),
+  myTabRect( 0 ),
+  myAreaRect( 0 )
 {
+  QApplication::instance()->installEventFilter( this );
 }
 
 /*!
-  \return list of all widgets in all areas
+  \brief Destructor.
 */
-QWidgetList QtxWorkstack::windowList() const
+QtxWorkstackDrag::~QtxWorkstackDrag()
 {
-  QPtrList<QtxWorkstackArea> lst;
-  areas( mySplit, lst, true );
+  QApplication::instance()->removeEventFilter( this );
 
-  QWidgetList widList;
-  for ( QPtrListIterator<QtxWorkstackArea> it( lst ); it.current(); ++it )
+  endDrawRect();
+}
+
+/*!
+  \brief Custom event filter.
+  \param o event receiver widget
+  \param e event
+  \return \c true if event should be filtered (stop further processing)
+*/
+bool QtxWorkstackDrag::eventFilter( QObject*, QEvent* e )
+{
+  switch ( e->type() )
   {
-    QWidgetList wids = it.current()->widgetList();
-    for ( QWidgetListIt itr( wids ); itr.current(); ++itr )
-      widList.append( itr.current() );
+  case QEvent::MouseMove:
+    updateTarget( ((QMouseEvent*)e)->globalPos() );
+    break;
+  case QEvent::MouseButtonRelease:
+    drawRect();
+    endDrawRect();
+    dropWidget();
+    deleteLater();
+    break;
+  default:
+    return false;
   }
-
-  return widList;
+  return true;
 }
 
 /*!
-  \return list of all widgets in active area
+  \brief Detect and set dropping target widget.
+  \param p current dragging position
 */
-QWidgetList QtxWorkstack::splitWindowList() const
+void QtxWorkstackDrag::updateTarget( const QPoint& p )
 {
-  return myArea ? myArea->widgetList() : QWidgetList();
+  int tab = -1;
+  QtxWorkstackArea* area = detectTarget( p, tab );
+  setTarget( area, tab );
 }
 
 /*!
-  \return active widget
+  \brief Detect dropping target.
+  \param p current dragging position
+  \param tab resulting target tab page index
+  \return target workarea or 0 if there is no correct drop target
 */
-QWidget* QtxWorkstack::activeWindow() const
+QtxWorkstackArea* QtxWorkstackDrag::detectTarget( const QPoint& p, int& tab ) const
 {
-  return myWin;
+  if ( p.isNull() )
+    return 0;
+
+  QtxWorkstackArea* area = myWS->areaAt( p );
+  if ( area )
+    tab = area->tabAt( p );
+  return area;
 }
 
 /*!
-  Splits widgets
-  \param o - orientation (Qt::Orientation)
+  \brief Set dropping target.
+  \param area new target workarea
+  \param tab target workarea's tab page index
 */
-void QtxWorkstack::split( const int o )
+void QtxWorkstackDrag::setTarget( QtxWorkstackArea* area, const int tab )
 {
-  QtxWorkstackArea* area = myWorkArea;
-  if ( !area )
-    area = activeArea();
-  if ( !area )
-    return;
-
-  if ( area->widgetList().count() < 2 )
+  if ( !area || ( myArea == area && tab == myTab ) )
     return;
 
-  QWidget* curWid = area->activeWidget();
-  if ( !curWid )
-    return;
+  startDrawRect();
 
-  QSplitter* s = splitter( area );
-  QPtrList<QtxWorkstackArea> areaList;
-  areas( s, areaList );
+  if ( myArea )
+    drawRect();
 
-  QPtrList<QSplitter> splitList;
-  splitters( s, splitList );
+  myTab = tab;
+  myArea = area;
 
-  QSplitter* trg = 0;
-  if ( areaList.count() + splitList.count() < 2 || s->orientation() == o )
-    trg = s;
+  if ( myArea )
+    drawRect();
+}
 
-  if ( !trg )
-    trg = wrapSplitter( area );
+/*!
+  \brief Called when drop operation is finished.
+  
+  Inserts dropped widget to the target workarea.
+*/
+void QtxWorkstackDrag::dropWidget()
+{
+  if ( myArea )
+    myArea->insertWidget( myChild->widget(), myTab );
+}
 
-  if ( !trg )
+/*!
+  \brief Draw floating rectangle.
+*/
+void QtxWorkstackDrag::drawRect()
+{
+  if ( !myArea )
     return;
 
-  trg->setOrientation( (Orientation)o );
+  QRect r = myArea->floatRect();
+  int m = 2;
 
-  QtxWorkstackArea* newArea = createArea( 0 );
-  insertWidget( newArea, trg, area );
+  r.setTop( r.top() + m + 2 );
+  r.setLeft( r.left() + m + 2 );
+  r.setRight( r.right() - m - 2 );
+  r.setBottom( r.bottom() - m - 2 );
 
-  area->removeWidget( curWid );
-  newArea->insertWidget( curWid );
+  if ( myAreaRect )
+  {
+    myAreaRect->setGeometry( r );
+    myAreaRect->setVisible( r.isValid() );
+  }
 
-  distributeSpace( trg );
+  QRect tr = myArea->floatTab( myTab );
 
-  curWid->show();
-  curWid->setFocus();
+  tr.setTop( tr.top() + m );
+  tr.setLeft( tr.left() + m );
+  tr.setRight( tr.right() - m );
+  tr.setBottom( tr.bottom() - m );
+
+  if ( myTabRect )
+  {
+    myTabRect->setGeometry( tr );
+    myTabRect->setVisible( tr.isValid() );
+  }
 }
 
 /*!
- \brief Split workarea of the given widget on two parts.
- \param wid  - widget, belonging to this workstack
- \param o    - orientation of splitting (Qt::Horizontal or Qt::Vertical)
- \param type - type of splitting, see <VAR>SplitType</VAR> enumeration
+  \brief Delete rubber band on the end on the dragging operation.
 */
-void QtxWorkstack::Split (QWidget* wid, const Qt::Orientation o, const SplitType type)
+void QtxWorkstackDrag::endDrawRect()
 {
-  if (!wid) return;
-
-  // find area of the given widget
-  QtxWorkstackArea* area = NULL;
-  QPtrList<QtxWorkstackArea> allAreas;
-  areas(mySplit, allAreas, true);
+  delete myAreaRect;
+  myAreaRect = 0;
 
-  QPtrListIterator<QtxWorkstackArea> it (allAreas);
-  for (; it.current() && !area; ++it) {
-    if (it.current()->contains(wid))
-      area = it.current();
-  }
-  if (!area) return;
+  delete myTabRect;
+  myTabRect = 0;
+}
 
-  QWidgetList wids = area->widgetList();
-  if (wids.count() < 2)
-    return;
+/*!
+  \brief Create rubber band to be drawn on the dragging operation.
+*/
+void QtxWorkstackDrag::startDrawRect()
+{
+  if ( !myTabRect )
+    myTabRect = new QRubberBand( QRubberBand::Rectangle );
 
-  QSplitter* s = splitter(area);
-  QPtrList<QtxWorkstackArea> areaList;
-  areas(s, areaList);
+  myTabRect->hide();
 
-  QPtrList<QSplitter> splitList;
-  splitters(s, splitList);
+  if ( !myAreaRect )
+    myAreaRect = new QRubberBand( QRubberBand::Rectangle );
 
-  QSplitter* trg = 0;
-  if (areaList.count() + splitList.count() < 2 || s->orientation() == o)
-    trg = s;
+  myAreaRect->hide();
+}
 
-  if (!trg) trg = wrapSplitter(area);
-  if (!trg) return;
 
-  trg->setOrientation(o);
+/*
+  \class CloseButton
+  \brief Workstack area close button.
+  \internal
+*/
+class CloseButton : public QAbstractButton
+{
+public:
+  CloseButton( QWidget* );
 
-  QtxWorkstackArea* newArea = createArea(0);
-  insertWidget(newArea, trg, area);
+  QSize        sizeHint() const;
+  QSize        minimumSizeHint() const;
 
-  switch (type) {
-  case SPLIT_STAY:
-    {
-      QWidgetListIt itr (wids);
-      for (; itr.current(); ++itr)
-      {
-        QWidget* wid_i = itr.current();
-        if (wid_i != wid) {
-          area->removeWidget(wid_i);
-          newArea->insertWidget(wid_i);
-        }
-      }
-    }
-    break;
-  case SPLIT_AT:
-    {
-      QWidgetListIt itr (wids);
-      for (; itr.current() && itr.current() != wid; ++itr) {
-      }
-      for (; itr.current(); ++itr) {
-        area->removeWidget(itr.current());
-        newArea->insertWidget(itr.current());
-      }
-    }
-    break;
-  case SPLIT_MOVE:
-    area->removeWidget(wid);
-    newArea->insertWidget(wid);
-    break;
-  }
+  void enterEvent( QEvent* );
+  void leaveEvent( QEvent* );
+  void paintEvent( QPaintEvent* );
+};
 
-  distributeSpace(trg);
+/*!
+  \brief Constructor
+  \internal
+  \param parent parent widget
+*/
+CloseButton::CloseButton( QWidget* parent )
+: QAbstractButton( parent )
+{
+ setFocusPolicy( Qt::NoFocus );
 }
 
 /*!
- \brief Put given widget on top of its workarea
- \param wid - widget, belonging to this workstack
+  \brief Get appropriate size for the button.
+  \internal
+  \return size value
 */
-/*
-void QtxWorkstack::OnTop (QWidget* wid)
+QSize CloseButton::sizeHint() const
 {
-  if ( !wid )
-    return;
-
-  // find area of the given widget
-  QtxWorkstackArea* area = 0;
-  QPtrList<QtxWorkstackArea> allAreas;
-  areas( mySplit, allAreas, true );
-  for ( QPtrListIterator<QtxWorkstackArea> it( allAreas ); it.current() && !area; ++it )
+  ensurePolished();
+  int dim = 0;
+  if( !icon().isNull() ) 
   {
-    if ( it.current()->contains( wid ) )
-      area = it.current();
+    const QPixmap pm = icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ),
+                                      QIcon::Normal );
+    dim = qMax( pm.width(), pm.height() );
   }
-
-  if ( area )
-    area->setActiveWidget( wid );
+  return QSize( dim + 4, dim + 4 );
 }
+
+/*!
+  \brief Get minimum appropriate size for the button.
+  \internal
+  \return minimum size value
 */
+QSize CloseButton::minimumSizeHint() const
+{ 
+  return sizeHint(); 
+}
 
 /*!
- \brief Move widget(s) from source workarea into target workarea
-        or just reorder widgets inside one workarea.
- \param wid1 - widget from target workarea
- \param wid2 - widget from source workarea
- \param all  - if this parameter is TRUE, all widgets from source workarea will
-               be moved into the target one, else only the \a wid2 will be moved
+  \brief Process mouse enter event.
+  \internal
+  \param event mouse enter event
+*/
+void CloseButton::enterEvent( QEvent *event )
+{
+  if ( isEnabled() )
+    update();
+  QAbstractButton::enterEvent( event );
+}
 
- Move \a wid2 in target workarea. Put it right after \a wid1.
- If value of boolean argument is TRUE, all widgets from source workarea
- will be moved together with \a wid2, source workarea will be deleted.
- If \a wid1 and \a wid2 belongs to one workarea, simple reordering will take place.
+/*!
+  \brief Process mouse leave event.
+  \internal
+  \param event mouse leave event
 */
-void QtxWorkstack::Attract ( QWidget* wid1, QWidget* wid2, const bool all )
+void CloseButton::leaveEvent( QEvent *event )
 {
-  if ( !wid1 || !wid2 )
-    return;
+  if( isEnabled() )
+    update();
+  QAbstractButton::leaveEvent( event );
+}
 
-  // find area of the widgets
-  QtxWorkstackArea *area1 = NULL, *area2 = NULL;
-  QPtrList<QtxWorkstackArea> allAreas;
-  areas(mySplit, allAreas, true);
-  QPtrListIterator<QtxWorkstackArea> it (allAreas);
-  for (; it.current() && !(area1 && area2); ++it) {
-    if (it.current()->contains(wid1))
-      area1 = it.current();
-    if (it.current()->contains(wid2))
-      area2 = it.current();
-  }
-  if (!area1 || !area2) return;
+/*!
+  \brief Process paint event.
+  \internal
+  \param event paint event
+*/
+void CloseButton::paintEvent( QPaintEvent* )
+{
+  QPainter p( this );
 
-  QWidget* curWid = area1->activeWidget();
-  if (!curWid) return;
+  QRect r = rect();
+  QStyleOption opt;
+  opt.init( this );
+  opt.state |= QStyle::State_AutoRaise;
+  if ( isEnabled() && underMouse() && !isChecked() && !isDown() )
+    opt.state |= QStyle::State_Raised;
+  if ( isChecked() )
+    opt.state |= QStyle::State_On;
+  if ( isDown() )
+    opt.state |= QStyle::State_Sunken;
+  style()->drawPrimitive( QStyle::PE_PanelButtonTool, &opt, &p, this );
 
-  if (area1 == area2) {
-    if (all) {
-      // Set wid1 at first position, wid2 at second
-      area1->insertWidget(wid1);
-      area1->insertWidget(wid2, 1);
-    } else {
-      // Set wid2 right after wid1
-      area1->removeWidget(wid2);
-      int wid1_ind = 0;
-      QWidgetList wids1 = area1->widgetList();
-      QWidgetListIt itr1 (wids1);
-      for (; itr1.current() && itr1.current() != wid1; ++itr1, ++wid1_ind);
-      area1->insertWidget(wid2, wid1_ind + 1);
-    }
-  } else {
-    int wid1_ind = 0;
-    QWidgetList wids1 = area1->widgetList();
-    QWidgetListIt itr1 (wids1);
-    for (; itr1.current() && itr1.current() != wid1; ++itr1, ++wid1_ind);
+  int shiftHorizontal = opt.state & QStyle::State_Sunken ? style()->pixelMetric( QStyle::PM_ButtonShiftHorizontal, &opt, this ) : 0;
+  int shiftVertical = opt.state & QStyle::State_Sunken ? style()->pixelMetric( QStyle::PM_ButtonShiftVertical, &opt, this ) : 0;
 
-    if (all) {
-      // Set wid2 right after wid1, other widgets from area2 right after wid2
-      QWidgetList wids2 = area2->widgetList();
-      QWidgetListIt itr2 (wids2);
-      for (int ind = wid1_ind + 1; itr2.current(); ++itr2, ++ind)
-      {
-        area2->removeWidget(itr2.current());
-        if (itr2.current() == wid2) {
-          area1->insertWidget(itr2.current(), wid1_ind + 1);
-        } else {
-          area1->insertWidget(itr2.current(), ind);
-        }
-      }
-    } else {
-      // Set wid2 right after wid1
-      area2->removeWidget(wid2);
-      area1->insertWidget(wid2, wid1_ind + 1);
-    }
-  }
+  r.adjust( 2, 2, -2, -2 );
+  r.translate( shiftHorizontal, shiftVertical );
 
-  area1->setActiveWidget( curWid );
+  QPixmap pm = icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ), isEnabled() ?
+                              underMouse() ? QIcon::Active : QIcon::Normal
+                             : QIcon::Disabled,
+                              isDown() ? QIcon::On : QIcon::Off );
+  style()->drawItemPixmap( &p, r, Qt::AlignCenter, pm );
 }
 
-static void setSizes (QIntList& szList, const int item_ind,
-                      const int new_near, const int new_this, const int new_farr)
-{
-  // set size to all items before an item # <item_ind>
-  int cur_pos = 0;
-  QIntList::iterator its = szList.begin();
-  for (; its != szList.end() && cur_pos < item_ind; ++its, ++cur_pos) {
-    *its = new_near;
-  }
-  if (its == szList.end()) return;
-  // set size to item # <item_ind>
-  *its = new_this;
-  ++its;
-  // set size to all items after an item # <item_ind>
-  for (; its != szList.end(); ++its) {
-    *its = new_farr;
-  }
-}
+/*!
+  \class QtxWorkstackArea
+  \internal
+  \brief Workstack widget workarea.
+*/
 
 /*!
-* \brief Set position of the widget relatively its splitter.
-* \param wid - widget to set position of
-* \param pos - position relatively splitter. Value in range [0..1].
-*
-* Orientation of positioning will correspond to the splitter orientation.
+  \brief Constructor.
+  \param parent parent widget
 */
-void QtxWorkstack::SetRelativePositionInSplitter( QWidget* wid, const double position )
+QtxWorkstackArea::QtxWorkstackArea( QWidget* parent )
+: QFrame( parent )
 {
-  if ( position < 0.0 || 1.0 < position)
-    return;
+  setFrameStyle( QFrame::Panel | QFrame::Sunken );
 
-  if ( !wid )
-    return;
+  QVBoxLayout* base = new QVBoxLayout( this );
+  base->setMargin( frameWidth() );
+  base->setSpacing( 0 );
 
-  // find area of the given widget
-  QtxWorkstackArea* area = NULL;
-  QPtrList<QtxWorkstackArea> allAreas;
-  areas(mySplit, allAreas, true);
-  for ( QPtrListIterator<QtxWorkstackArea> it( allAreas );
-       it.current() && !area;
-       ++it )
-  {
-    if (it.current()->contains(wid))
-      area = it.current();
-  }
+  QWidget* top = new QWidget( this );
+  base->addWidget( top );
 
-  if ( !area )
-    return;
+  QHBoxLayout* tl = new QHBoxLayout( top );
+  tl->setMargin( 0 );
 
-  QSplitter* split = splitter( area );
-  if ( !split )
-    return;
+  myBar = new QtxWorkstackTabBar( top );
+  tl->addWidget( myBar, 1 );
 
-  // find index of the area in its splitter
-  int item_ind = -1;
-  bool isFound = false;
-  const QObjectList* was = split->children();
-  for (QObjectListIt ito (*was); ito.current() && !isFound; ++ito, ++item_ind)
-  {
-    if (ito.current() == area)
-      isFound = true;
-  }
-  if (!isFound || item_ind == 0)
-    return;
+  CloseButton* close = new CloseButton( top );
+  close->setIcon( style()->standardIcon( QStyle::SP_TitleBarCloseButton ) );
+  myClose = close;
+  tl->addWidget( myClose );
 
-  QIntList szList = split->sizes();
-  int splitter_size = (split->orientation() == Horizontal ?
-                       split->width() : split->height());
-  int nb = szList.count();
+  myStack = new QStackedWidget( this );
+
+  base->addWidget( myStack, 1 );
+
+  connect( myClose, SIGNAL( clicked() ), this, SLOT( onClose() ) );
+  connect( myBar, SIGNAL( currentChanged( int ) ), this, SLOT( onCurrentChanged( int ) ) );
+  connect( myBar, SIGNAL( dragActiveTab() ), this, SLOT( onDragActiveTab() ) );
+  connect( myBar, SIGNAL( contextMenuRequested( QPoint ) ), this, SLOT( onContextMenuRequested( QPoint ) ) );
+
+  updateState();
 
-  int new_prev = int(splitter_size * position / item_ind);
-  int new_next  = int(splitter_size * (1.0 - position) / (nb - item_ind));
-  setSizes (szList, item_ind, new_prev, new_next, new_next);
-  split->setSizes(szList);
+  updateActiveState();
+
+  QApplication::instance()->installEventFilter( this );
 }
 
 /*!
-* \brief Set position of the widget relatively the entire workstack.
-* \param wid - widget to set position of
-* \param o   - orientation of positioning (Qt::Horizontal or Qt::Vertical).
-*              If o = Qt::Horizontal, horizontal position of \a wid will be changed.
-*              If o = Qt::Vertical, vertical position of \a wid will be changed.
-* \param pos - position relatively workstack. Value in range [0..1].
+  \brief Destructor.
 */
-void QtxWorkstack::SetRelativePosition( QWidget* wid, const Qt::Orientation o,
-                                        const double position )
+QtxWorkstackArea::~QtxWorkstackArea()
 {
-  if ( position < 0.0 || 1.0 < position )
-    return;
+  QApplication::instance()->removeEventFilter( this );
+}
+
+/*!
+  \brief Check if workarea contains any widgets.
+  \return \c true if area is null (havn't any child widgets)
+*/
+bool QtxWorkstackArea::isNull() const
+{
+  return myList.isEmpty();
+}
+
+/*!
+  \brief Check if workarea contains visible widgets.
+  \return \c true if area is empty (all child widgets are removed or now shown)
+*/
+bool QtxWorkstackArea::isEmpty() const
+{
+  bool res = false;
+  for ( WidgetInfoMap::ConstIterator it = myInfo.begin(); it != myInfo.end() && !res; ++it )
+    res = it.value().vis;
+  return !res;
+}
 
+/*!
+  \brief Add widget to the workarea.
+  \param wid widget to be added
+  \param idx position in the area widget to be added to
+  \param f widget flags
+  \return child widget container object (or 0 if index is invalid)
+*/
+QWidget* QtxWorkstackArea::insertWidget( QWidget* wid, const int idx, Qt::WindowFlags f )
+{
   if ( !wid )
-    return;
+    return 0;
 
-  int splitter_size = o == Horizontal ? mySplit->width() : mySplit->height();
-  int need_pos = int( position * splitter_size );
-  int splitter_pos = 0;
+  int pos = myList.indexOf( wid );
+  if ( pos != -1 && ( pos == idx || ( idx < 0 && pos == (int)myList.count() - 1 ) ) )
+    return 0;
 
-  if ( setPosition( wid, mySplit, o, need_pos, splitter_pos ) != 0 )
+  myList.removeAll( wid );
+  pos = idx < 0 ? myList.count() : idx;
+  myList.insert( qMin( pos, (int)myList.count() ), wid );
+  if ( !myInfo.contains( wid ) )
   {
-    // impossible to set required position
+    QtxWorkstackChild* child = new QtxWorkstackChild( wid, myStack, f );
+    myChild.insert( wid, child );
+    myInfo.insert( wid, WidgetInfo() );
+    myInfo[wid].id = generateId();
+    myInfo[wid].vis = wid->isVisibleTo( wid->parentWidget() );
+
+    connect( child, SIGNAL( destroyed( QObject* ) ), this, SLOT( onChildDestroyed( QObject* ) ) );
+    connect( wid, SIGNAL( destroyed() ), this, SLOT( onWidgetDestroyed() ) );
+    connect( child, SIGNAL( shown( QtxWorkstackChild* ) ), this, SLOT( onChildShown( QtxWorkstackChild* ) ) );
+    connect( child, SIGNAL( hidden( QtxWorkstackChild* ) ), this, SLOT( onChildHidden( QtxWorkstackChild* ) ) );
+    connect( child, SIGNAL( activated( QtxWorkstackChild* ) ), this, SLOT( onChildActivated( QtxWorkstackChild* ) ) );
+    connect( child, SIGNAL( captionChanged( QtxWorkstackChild* ) ), this, SLOT( onChildCaptionChanged( QtxWorkstackChild* ) ) );
   }
+
+  updateState();
+
+  setWidgetActive( wid );
+  wid->setFocus();
+
+  return myChild[wid];
 }
 
 /*!
-* \brief Sets the action's accelerator key to accel. 
-* \param id - the key of the action in the actions map.
-* \param accel - action's accelerator key.
+  \brief Create and show popup menu for the area.
+  \param p mouse pointer position at which popup menu should be shown
 */
-void QtxWorkstack::setAccel( const int id, const int accel )
+void QtxWorkstackArea::onContextMenuRequested( QPoint p )
 {
-  if ( !myActionsMap.contains( id ) )
+  const QtxWorkstackTabBar* bar = ::qobject_cast<const QtxWorkstackTabBar*>( sender() );
+  if ( !bar )
     return;
 
-  myActionsMap[id]->setAccel( accel );
+  QWidget* wid = 0;
+  int idx = tabAt( p );
+  if ( idx != -1 )
+    wid = widget( myBar->tabId( idx ) );
+
+  emit contextMenuRequested( wid, p );
 }
 
 /*!
-* \brief Returns the action's accelerator key.
-* \param id - the key of the action in the actions map.
-* \retval int  - action's accelerator key.
+  \brief Called when area's child widget is destroyed.
+
+  Removes child widget from the area.
 */
-int QtxWorkstack::accel( const int id ) const
+void QtxWorkstackArea::onWidgetDestroyed()
 {
-  int res = 0;
-  if ( myActionsMap.contains( id ) )
-    res = myActionsMap[id]->accel();
-  return res;
+  if ( sender() )
+    removeWidget( (QWidget*)sender(), false );
 }
 
-static int positionSimple (QIntList& szList, const int nb, const int splitter_size,
-                           const int item_ind, const int item_rel_pos,
-                           const int need_pos, const int splitter_pos)
+/*!
+  \brief Remove widget from workarea.
+  \param wid widget to be removed
+  \param del if \c true the widget should be also deleted
+*/
+void QtxWorkstackArea::removeWidget( QWidget* wid, const bool del )
 {
-  if (item_ind == 0) { // cannot move in this splitter
-    return (need_pos - splitter_pos);
-  }
+  if ( !myList.contains( wid ) )
+    return;
 
-  int delta = 0;
-  int new_prev = 0;
-  int new_this = szList[item_ind];
-  int new_next = 0;
+  if ( myBar->indexOf( widgetId( wid ) ) != -1 )
+    myBar->removeTab( myBar->indexOf( widgetId( wid ) ) );
 
-  bool isToCheck = false;
+  myStack->removeWidget( child( wid ) );
 
-  if (need_pos < splitter_pos) {
-    // Set size of all previous workareas to zero <--
-    if (item_ind == nb - 1) {
-      // item iz last in the splitter, it will occupy all the splitter
-      new_this = splitter_size;
-    } else {
-      // recompute size of next items in splitter
-      new_next = (splitter_size - new_this) / (nb - item_ind - 1);
-    }
-    delta = need_pos - splitter_pos;
+  myList.removeAll( wid );
+  myInfo.remove( wid );
+  myChild.remove( wid );
 
-  } else if (need_pos > (splitter_pos + splitter_size)) {
-    // Set size of all next workareas to zero -->
-    // recompute size of previous items in splitter
-    new_this = 0;
-    new_prev = (splitter_size - new_this) / item_ind;
-    delta = need_pos - (splitter_pos + splitter_size - new_this);
+  if ( del )
+    delete child( wid );
 
-  } else { // required position lays inside this splitter
-    // Move workarea inside splitter into required position <->
-    int new_item_rel_pos = need_pos - splitter_pos;
-    new_prev = new_item_rel_pos / item_ind;
-    if (need_pos < (splitter_pos + item_rel_pos)) {
-      // Make previous workareas smaller, next - bigger
-      // No problem to keep old size of the widget
-    } else {
-      // Make previous workareas bigger, next - smaller
-      if (new_this > splitter_size - new_item_rel_pos) {
-        new_this = splitter_size - new_item_rel_pos;
-      }
-      // jfa to do: in this case fixed size of next widgets could prevent right resizing
-      isToCheck = true;
-    }
-    if (item_ind == nb - 1) {
-      new_this = splitter_size - new_item_rel_pos;
-    } else {
-      new_next = (splitter_size - new_item_rel_pos - new_this) / (nb - item_ind - 1);
-    }
-    delta = 0;
+  if ( isNull() )
+    deleteLater();
+  else
+    updateState();
+}
+
+/*!
+  \brief Get all visible child widgets.
+  \return list of visible child widgets
+*/
+QWidgetList QtxWorkstackArea::widgetList() const
+{
+  QWidgetList lst;
+  for ( QWidgetList::const_iterator it = myList.begin(); it != myList.end(); ++it )
+  {
+    if ( widgetVisibility( *it ) )
+      lst.append( *it );
   }
+  return lst;
+}
 
-  setSizes (szList, item_ind, new_prev, new_this, new_next);
-  return delta;
+/*!
+  \brief Get active child widget.
+  \return active widget
+*/
+QWidget* QtxWorkstackArea::activeWidget() const
+{
+  return widget( myBar->tabId( myBar->currentIndex() ) );
 }
 
 /*!
-* \brief Set position of given widget.
-* \param wid          - widget to be moved
-* \param split        - currently processed splitter (goes from more common
-*                       to more particular splitter in recursion calls)
-* \param o            - orientation of positioning
-* \param need_pos     - required position of the given widget in pixels
-*                       (from top/left side of workstack area)
-* \param splitter_pos - position of the splitter \a split
-*                       (from top/left side of workstack area)
-* \retval int - returns difference between a required and a distinguished position.
-* 
-* Internal method. Recursively calls itself.
-* Is called from <VAR>SetRelativePosition</VAR> public method.
+  \brief Set active widget.
+  \param wid widget to be made active
 */
-int QtxWorkstack::setPosition( QWidget* wid, QSplitter* split, const Qt::Orientation o,
-                               const int need_pos, const int splitter_pos )
+void QtxWorkstackArea::setActiveWidget( QWidget* wid )
 {
-  if ( !wid || !split )
-    return need_pos - splitter_pos;
+  myBar->setCurrentIndex( myBar->indexOf( widgetId( wid ) ) );
+}
 
-  // Find corresponding sub-splitter.
-  // Find also index of appropriate item in current splitter.
-  int cur_ind = 0, item_ind = 0;
-  bool isBottom = false, isFound = false;
-  QSplitter* sub_split = NULL;
-  const QObjectList* objs = split->children();
-  if ( objs )
+/*!
+  \brief Check if area owns the specified widget.
+  \param wid widget to be checked
+  \return \c true if area contains widget
+*/
+bool QtxWorkstackArea::contains( QWidget* wid ) const
+{
+  return myList.contains( wid );
+}
+
+/*!
+  \brief Show/hide workarea.
+  \param on new visibility state
+*/
+void QtxWorkstackArea::setVisible( bool on )
+{
+  QMap<QWidget*, bool> map;
+  for ( QWidgetList::iterator it = myList.begin(); it != myList.end(); ++it )
   {
-    for (QObjectListIt it (*objs); it.current() && !isFound; ++it)
-    {
-      if (it.current()->inherits( "QtxWorkstackArea")) {
-        if (((QtxWorkstackArea*)it.current())->contains(wid)) {
-          item_ind = cur_ind;
-          isBottom = true;
-          isFound = true;
-        }
-        cur_ind++;
-      } else if (it.current()->inherits("QSplitter")) {
-        QPtrList<QtxWorkstackArea> areaList;
-        areas((QSplitter*)it.current(), areaList, true);
-        for (QPtrListIterator<QtxWorkstackArea> ita (areaList);
-             ita.current() && !isFound;
-             ++ita)
-        {
-          if (ita.current()->contains(wid)) {
-            item_ind = cur_ind;
-            isFound = true;
-            sub_split = (QSplitter*)it.current();
-          }
-        }
-        cur_ind++;
-      }
-    }
+    map.insert( *it, isBlocked( *it ) );
+    setBlocked( *it, true );
   }
-  if (!isFound)
-    return (need_pos - splitter_pos);
 
-  if (split->orientation() == o) {
-    // Find coordinates of near and far sides of the appropriate item relatively current splitter
-    int splitter_size = (o == Horizontal ? split->width() : split->height());
-    QIntList szList = split->sizes();
-    int nb = szList.count();
-    int item_rel_pos = 0; // position of near side of item relatively this splitter
-    for (int i = 0; i < item_ind; i++) {
-      item_rel_pos += szList[i];
-    }
-    int item_size = szList[item_ind]; // size of item
-    int item_pos = splitter_pos + item_rel_pos;
+  QFrame::setVisible( on );
 
-    // Resize splitter items to complete the conditions
-    if (isBottom) {
-      // I. Bottom of splitters stack reached
+  for ( QWidgetList::iterator itr = myList.begin(); itr != myList.end(); ++itr )
+    setBlocked( *itr, map.contains( *itr ) ? map[*itr] : false );
+}
 
-      int delta = positionSimple(szList, nb, splitter_size, item_ind, item_rel_pos, need_pos, splitter_pos);
-      split->setSizes(szList);
-      // Recompute delta, as some windows can reject given size
-      int new_item_rel_pos = 0;
-      QIntList szList1 = split->sizes();
-      for (int i = 0; i < item_ind; i++) {
-        new_item_rel_pos += szList1[i];
-      }
-      delta = need_pos - (splitter_pos + new_item_rel_pos);
-      return delta;
+/*!
+  \brief Check if workarea is active.
+  \return \c true if area is active
+*/
+bool QtxWorkstackArea::isActive() const
+{
+  QtxWorkstack* ws = workstack();
+  if ( !ws )
+    return false;
 
-    } else {
-      // II. Bottom of splitters stack is not yet reached
+  return ws->activeArea() == this;
+}
 
-      if (item_ind == 0) { // cannot move in this splitter
-        // Process in sub-splitter
-        return setPosition(wid, sub_split, o, need_pos, splitter_pos);
-      }
+/*!
+  \brief Update active tab bar state (active/inactive).
+*/
+void QtxWorkstackArea::updateActiveState()
+{
+  myBar->setActive( isActive() );
+}
 
-      int new_prev = 0;
-      int new_this = szList[item_ind];
-      int new_next = 0;
+/*!
+  \brief Get parent workstack
+  \return workstack owning this workarea
+*/
+QtxWorkstack* QtxWorkstackArea::workstack() const
+{
+  QtxWorkstack* ws = 0;
+  QWidget* wid = parentWidget();
+  while ( wid && !ws )
+  {
+    if ( wid->inherits( "QtxWorkstack" ) )
+      ws = (QtxWorkstack*)wid;
+    wid = wid->parentWidget();
+  }
+  return ws;
+}
 
-      if (need_pos < splitter_pos) {
-        // Set size of all previous workareas to zero <--
-        if (item_ind == nb - 1) {
-          new_this = splitter_size;
-        } else {
-          new_next = (splitter_size - new_this) / (nb - item_ind - 1);
-        }
-        setSizes (szList, item_ind, new_prev, new_this, new_next);
-        split->setSizes(szList);
-        // Recompute splitter_pos, as some windows can reject given size
-        int new_item_rel_pos = 0;
-        QIntList szList1 = split->sizes();
-        for (int i = 0; i < item_ind; i++) {
-          new_item_rel_pos += szList1[i];
-        }
-        // Process in sub-splitter
-        return setPosition(wid, sub_split, o, need_pos, splitter_pos + new_item_rel_pos);
-      } else if (need_pos > (splitter_pos + splitter_size)) {
-        // Set size of all next workareas to zero -->
-        new_prev = (splitter_size - new_this) / item_ind;
-        setSizes (szList, item_ind, new_prev, new_this, new_next);
-        split->setSizes(szList);
-        // Recompute splitter_pos, as some windows can reject given size
-        int new_item_rel_pos = 0;
-        QIntList szList1 = split->sizes();
-        for (int i = 0; i < item_ind; i++) {
-          new_item_rel_pos += szList1[i];
-        }
-        // Process in sub-splitter
-        return setPosition(wid, sub_split, o, need_pos, splitter_pos + new_item_rel_pos);
-      } else {
-        // Set appropriate size of all previous/next items <->
-        int new_item_rel_pos = item_rel_pos;
-        if (need_pos < item_pos || (item_pos + item_size) < need_pos) {
-          // Move item inside splitter into required position <->
-          int new_this = szList[item_ind];
-          int new_next = 0;
-          new_item_rel_pos = need_pos - splitter_pos;
-          if ((item_pos + item_size) < need_pos) {
-            //new_item_rel_pos = need_pos - (item_pos + item_size);
-            new_item_rel_pos = item_rel_pos + (need_pos - (item_pos + item_size));
-          }
-          int new_prev = new_item_rel_pos / item_ind;
-          if (need_pos < (splitter_pos + item_rel_pos)) {
-            // Make previous workareas smaller, next - bigger
-            // No problem to keep old size of the widget
-          } else {
-            // Make previous workareas bigger, next - smaller
-            if (new_this > splitter_size - new_item_rel_pos) {
-              new_this = splitter_size - new_item_rel_pos;
-            }
-          }
-          if (item_ind == nb - 1) {
-            new_this = splitter_size - new_item_rel_pos;
-          } else {
-            new_next = (splitter_size - new_item_rel_pos - new_this) / (nb - item_ind - 1);
-          }
-          setSizes (szList, item_ind, new_prev, new_this, new_next);
-          split->setSizes(szList);
-          // Recompute new_item_rel_pos, as some windows can reject given size
-          new_item_rel_pos = 0;
-          QIntList szList1 = split->sizes();
-          for (int i = 0; i < item_ind; i++) {
-            new_item_rel_pos += szList1[i];
-          }
-        } else {
-          // Do nothing
-        }
-        // Process in sub-splitter
-        int add_pos = setPosition(wid, sub_split, o, need_pos, splitter_pos + new_item_rel_pos);
-        if (add_pos == 0)
-          return 0;
+/*!
+  \brief Custom event filter.
 
-        // this can be if corresponding workarea is first in sub-splitter
-        // or sub-splitter has another orientation
+  Process events from child widgets.
 
-        // Resize ones again to reach precize position <->
-        int need_pos_1 = splitter_pos + new_item_rel_pos + add_pos;
+  \param o event receiver widget
+  \param e event
+  \return \c true if event should be filtered (stop further processing)
+*/
+bool QtxWorkstackArea::eventFilter( QObject* o, QEvent* e )
+{
+  if ( o->isWidgetType() )
+  {
+    QWidget* wid = (QWidget*)o;
+    if ( e->type() == QEvent::FocusIn || e->type() == QEvent::MouseButtonPress )
+    {
+      bool ok = false;
+      while ( !ok && wid && wid != myClose )
+      {
+        ok = wid == this;
+        wid = wid->parentWidget();
+      }
+      if ( ok )
+        QApplication::postEvent( this, new WidgetEvent( (QEvent::Type)( e->type() == QEvent::FocusIn ? ActivateWidget : FocusWidget ) ) );
+    }
+  }
+  return false;
+}
+
+/*!
+  \brief Get rectangle to be drawn when highlighting drop area.
+  \return area drop rectangle
+*/
+QRect QtxWorkstackArea::floatRect() const
+{
+  QRect r = myStack->geometry();
+  return QRect( mapToGlobal( r.topLeft() ), mapToGlobal( r.bottomRight() ) );
+}
+
+/*!
+  \brief Get rectangle to be drawn when highlighting drop area on tab bar.
+  \param idx tab index
+  \return tab bar drop rectrangle
+*/
+QRect QtxWorkstackArea::floatTab( const int idx ) const
+{
+  QRect r = myBar->tabRect( idx );
+  return QRect( myBar->mapToGlobal( r.topLeft() ), r.size() );
+}
+
+/*!
+  \brief Get tab index by point.
+  \param p point
+  \return tab covering point or -1 if there is no tab covering point
+*/
+int QtxWorkstackArea::tabAt( const QPoint& pnt ) const
+{
+  int idx = -1;
+  QPoint p = myBar->mapFromGlobal( pnt );
+  for ( int i = 0; i < myBar->count() && idx == -1; i++ )
+  {
+    QRect r = myBar->tabRect( i );
+    if ( r.isValid() && r.contains( p ) )
+      idx = i;
+  }
+  return idx;
+}
+
+/*!
+  \brief Event handler for custom events.
+  \param e custom event
+*/
+void QtxWorkstackArea::customEvent( QEvent* e )
+{
+  WidgetEvent* we = (WidgetEvent*)e;
+
+  switch ( we->type() )
+  {
+  case ActivateWidget:
+    myBar->updateActiveState();
+    emit activated( activeWidget() );
+    break;
+  case FocusWidget:
+    if ( activeWidget() )
+    {
+      if ( !activeWidget()->focusWidget() )
+        activeWidget()->setFocus();
+      else
+      {
+        if ( activeWidget()->focusWidget()->hasFocus() )
+        {
+          QFocusEvent in( QEvent::FocusIn );
+         QApplication::sendEvent( this, &in );
+       }
+        else {
+          activeWidget()->focusWidget()->setFocus();
+         myBar->updateActiveState();
+       }
+      }
+    }
+    break;
+  case RemoveWidget:
+    removeWidget( we->widget() );
+    break;
+  default:
+    break;
+  }
+}
+
+/*!
+  \brief Customize focus in event handler.
+  \param e focus in event
+*/
+void QtxWorkstackArea::focusInEvent( QFocusEvent* e )
+{
+  QFrame::focusInEvent( e );
+
+  myBar->updateActiveState();
+
+  emit activated( activeWidget() );
+}
+
+/*!
+  \brief Customize mouse press event handler.
+  \param e mouse press event
+*/
+void QtxWorkstackArea::mousePressEvent( QMouseEvent* e )
+{
+  QFrame::mousePressEvent( e );
+
+  emit activated( activeWidget() );
+}
+
+/*!
+  \brief Called when user presses "Close" button.
+*/
+void QtxWorkstackArea::onClose()
+{
+  QWidget* wid = activeWidget();
+  if ( wid )
+    wid->close();
+}
+
+/*!
+  \brief Called when user selects any tab page.
+  \param idx tab page index (not used)
+*/
+void QtxWorkstackArea::onCurrentChanged( int /*idx*/ )
+{
+  updateCurrent();
+
+  emit activated( activeWidget() );
+}
+
+/*!
+  \brief Called when user starts tab page dragging.
+*/
+void QtxWorkstackArea::onDragActiveTab()
+{
+  QtxWorkstackChild* c = child( activeWidget() );
+  if ( !c )
+    return;
+
+  new QtxWorkstackDrag( workstack(), c );
+}
+
+/*!
+  \brief Called when area's child widget container is destroyed.
+  \param obj widget container being destroyed
+*/
+void QtxWorkstackArea::onChildDestroyed( QObject* obj )
+{
+  QtxWorkstackChild* child = (QtxWorkstackChild*)obj;
+  myStack->removeWidget( child );
+
+  QWidget* wid = 0;
+  for ( ChildMap::ConstIterator it = myChild.begin(); it != myChild.end() && !wid; ++it )
+  {
+    if ( it.value() == child )
+      wid = it.key();
+  }
+
+  myChild.remove( wid );
+
+  QApplication::postEvent( this, new WidgetEvent( (QEvent::Type)RemoveWidget, wid ) );
+}
+
+/*!
+  \brief Called when child widget container is shown.
+  \param c child widget container being shown
+*/
+void QtxWorkstackArea::onChildShown( QtxWorkstackChild* c )
+{
+  setWidgetShown( c->widget(), true );
+}
+
+/*!
+  \brief Called when child widget container is hidden.
+  \param c child widget container being hidden
+*/
+void QtxWorkstackArea::onChildHidden( QtxWorkstackChild* c )
+{
+  setWidgetShown( c->widget(), false );
+}
+
+/*!
+  \brief Called when child widget container is activated.
+  \param c child widget container being activated
+*/
+void QtxWorkstackArea::onChildActivated( QtxWorkstackChild* c )
+{
+  setWidgetActive( c->widget() );
+}
+
+/*!
+  \brief Called when child widget container's title is changed.
+  \param c child widget container which title is changed
+*/
+void QtxWorkstackArea::onChildCaptionChanged( QtxWorkstackChild* c )
+{
+  updateTab( c->widget() );
+}
+
+/*!
+  \brief Update current child widget container.
+
+  Raises widget when active tab page is changed.
+*/
+void QtxWorkstackArea::updateCurrent()
+{
+  QMap<QWidget*, bool> map;
+  for ( QWidgetList::iterator it = myList.begin(); it != myList.end(); ++it )
+  {
+    map.insert( *it, isBlocked( *it ) );
+    setBlocked( *it, true );
+  }
+
+  QWidget* cur = child( widget( myBar->tabId( myBar->currentIndex() ) ) );
+  if ( cur )
+    myStack->setCurrentWidget( cur );
+
+  for ( QWidgetList::iterator itr = myList.begin(); itr != myList.end(); ++itr )
+    setBlocked( *itr, map.contains( *itr ) ? map[*itr] : false );
+}
+
+/*!
+  \brief Update tab bar.
+  \param wid tab page widget
+*/
+void QtxWorkstackArea::updateTab( QWidget* wid )
+{
+  int idx = myBar->indexOf( widgetId( wid ) );
+  if ( idx < 0 )
+    return;
+
+  myBar->setTabIcon( idx, wid->windowIcon() );
+  myBar->setTabText( idx, wid->windowTitle() );
+}
+
+/*!
+  \brief Get child widget by specified identifier.
+  \param id widget ID
+  \return widget or 0, if identifier in invalid
+*/
+QWidget* QtxWorkstackArea::widget( const int id ) const
+{
+  QWidget* wid = 0;
+  for ( WidgetInfoMap::ConstIterator it = myInfo.begin(); it != myInfo.end() && !wid; ++it )
+  {
+    if ( it.value().id == id )
+      wid = it.key();
+  }
+  return wid;
+}
+
+/*!
+  \brief Get child widget identifier.
+  \param wid widget
+  \return widget ID or -1 if widget is not found
+*/
+int QtxWorkstackArea::widgetId( QWidget* wid ) const
+{
+  int id = -1;
+  if ( myInfo.contains( wid ) )
+    id = myInfo[wid].id;
+  return id;
+}
+
+/*!
+  \brief Get child widget's visibility.
+  \param wid widget
+  \return \c true if widget is visible
+*/
+bool QtxWorkstackArea::widgetVisibility( QWidget* wid ) const
+{
+  bool res = false;
+  if ( myInfo.contains( wid ) )
+    res = myInfo[wid].vis;
+  return res;
+}
+
+/*!
+  \brief Set active child widget.
+  \param wid widget to be set active
+*/
+void QtxWorkstackArea::setWidgetActive( QWidget* wid )
+{
+  int id = widgetId( wid );
+  if ( id < 0 )
+    return;
+
+  myBar->setCurrentIndex( myBar->indexOf( id ) );
+}
+
+/*!
+  \brief Show/hide child widget.
+  \param wid widget
+  \param on new visibility state
+*/
+void QtxWorkstackArea::setWidgetShown( QWidget* wid, const bool on )
+{
+  if ( isBlocked( wid ) || !myInfo.contains( wid ) || myInfo[wid].vis == on )
+    return;
+
+  myInfo[wid].vis = on;
+  updateState();
+}
+
+/*!
+  \brief Update internal state.
+*/
+void QtxWorkstackArea::updateState()
+{
+  bool updBar = myBar->updatesEnabled();
+  bool updStk = myStack->updatesEnabled();
+  myBar->setUpdatesEnabled( false );
+  myStack->setUpdatesEnabled( false );
+
+  bool block = myBar->signalsBlocked();
+  myBar->blockSignals( true );
+
+  QWidget* prev = activeWidget();
+
+  int idx = 0;
+  for ( QWidgetList::iterator it = myList.begin(); it != myList.end(); ++it )
+  {
+    QWidget* wid = *it;
+    int id = widgetId( wid );
+
+    if ( id < 0 )
+      continue;
+
+    bool vis = widgetVisibility( wid );
+
+    int cIdx = myBar->indexOf( id );
+    if ( cIdx != -1 && ( !vis || myBar->indexOf( id ) != idx ) )
+      myBar->removeTab( cIdx );
+
+    if ( myBar->indexOf( id ) == -1 && vis )
+      myBar->setTabId( myBar->insertTab( idx, wid->windowTitle() ), id );
+
+    updateTab( wid );
+
+    bool block = isBlocked( wid );
+    setBlocked( wid, true );
+
+    QtxWorkstackChild* cont = child( wid );
+
+    if ( !vis )
+      myStack->removeWidget( cont );
+    else if ( myStack->indexOf( cont ) < 0 )
+      myStack->addWidget( cont );
+
+    if ( vis )
+      idx++;
+
+    setBlocked( wid, block );
+  }
+
+  int curId = widgetId( prev );
+  if ( myBar->indexOf( curId ) < 0 )
+  {
+    QWidget* wid = 0;
+    int pos = myList.indexOf( prev );
+    for ( int i = pos - 1; i >= 0 && !wid; i-- )
+    {
+      if ( widgetVisibility( myList.at( i ) ) )
+        wid = myList.at( i );
+    }
 
-        // Move workarea inside splitter into required position <->
-        int delta_1 = positionSimple(szList, nb, splitter_size, item_ind,
-                                     new_item_rel_pos, need_pos_1, splitter_pos);
-        split->setSizes(szList);
-        // Recompute new_item_rel_pos, as some windows can reject given size
-        new_item_rel_pos = 0;
-        QIntList szList1 = split->sizes();
-        for (int i = 0; i < item_ind; i++) {
-          new_item_rel_pos += szList1[i];
-        }
-        delta_1 = need_pos_1 - (splitter_pos + new_item_rel_pos);
-        return delta_1;
-      }
+    for ( int j = pos + 1; j < (int)myList.count() && !wid; j++ )
+    {
+      if ( widgetVisibility( myList.at( j ) ) )
+        wid = myList.at( j );
     }
-  } else {
-    return setPosition(wid, sub_split, o, need_pos, splitter_pos);
+
+    if ( wid )
+      curId = widgetId( wid );
   }
 
-  return 0;
+  myBar->setCurrentIndex( myBar->indexOf( curId ) );
+
+  myBar->blockSignals( block );
+
+  updateCurrent();
+
+  myBar->updateActiveState();
+
+  myBar->setUpdatesEnabled( updBar );
+  myStack->setUpdatesEnabled( updStk );
+  if ( updBar )
+    myBar->update();
+  if ( updStk )
+    myStack->update();
+
+  QResizeEvent re( myBar->size(), myBar->size() );
+  QApplication::sendEvent( myBar, &re );
+
+  myBar->updateGeometry();
+
+  if ( isEmpty() )
+  {
+    hide();
+    emit deactivated( this );
+  }
+  else
+  {
+    show();
+    if ( prev != activeWidget() )
+      emit activated( activeWidget() );
+  }
 }
 
 /*!
-  Redistributes space among widgets equally
+  \brief Generate unique widget identifier.
+  \return first non shared widget ID
 */
-void QtxWorkstack::distributeSpace( QSplitter* split ) const
+int QtxWorkstackArea::generateId() const
 {
-  if ( !split )
-    return;
+  QMap<int, int> map;
 
-  QIntList szList = split->sizes();
-  int size = ( split->orientation() == Horizontal ?
-               split->width() : split->height() ) / szList.count();
-  for ( QIntList::iterator it = szList.begin(); it != szList.end(); ++it )
-    *it = size;
-  split->setSizes( szList );
+  for ( WidgetInfoMap::const_iterator it = myInfo.begin(); it != myInfo.end(); ++it )
+    map.insert( it.value().id, 0 );
+
+  int id = 0;
+  while ( map.contains( id ) )
+    id++;
+
+  return id;
 }
 
 /*!
-  Splits widgets vertically
+  \brief Check if the child wiget is blocked.
+  \param wid widget
+  \return \c true if the widget is blocked
 */
-void QtxWorkstack::splitVertical()
+bool QtxWorkstackArea::isBlocked( QWidget* wid ) const
 {
-  split( Qt::Horizontal );
+  return myBlock.contains( wid );
 }
 
 /*!
-  Splits widgets horizontally
+  \brief Block widget.
+  \param wid widget
+  \param on new blocked state
 */
-void QtxWorkstack::splitHorizontal()
+void QtxWorkstackArea::setBlocked( QWidget* wid, const bool on )
 {
-  split( Qt::Vertical );
+  if ( on )
+    myBlock.insert( wid, 0 );
+  else
+    myBlock.remove( wid );
 }
 
 /*!
-  SLOT: called if action "Rename" is activated, changes caption of widget
+  \brief Get child widget container.
+  \param wid child widget
+  \return child widget container corresponding to the \a wid
 */
-void QtxWorkstack::onRename()
+QtxWorkstackChild* QtxWorkstackArea::child( QWidget* wid ) const
 {
-  if ( !myWorkWin )
-    return;
-
-  bool ok = false;
-  QString newName = QInputDialog::getText( tr( "Rename" ), tr( "Enter new name:" ), QLineEdit::Normal,
-                                           myWorkWin->caption(), &ok, topLevelWidget() );
-  if ( ok && !newName.isEmpty() )
-    myWorkWin->setCaption( newName );
+  QtxWorkstackChild* res = 0;
+  if ( myChild.contains( wid ) )
+    res = myChild[wid];
+  return res;
 }
 
 /*!
-  Wraps area into new splitter
-  \return new splitter
+  \fn void QtxWorkstackArea::activated( QWidget* w )
+  \brief Emitted when child widget is activated.
+  \param w child widget being activated
 */
-QSplitter* QtxWorkstack::wrapSplitter( QtxWorkstackArea* area )
-{
-  if ( !area )
-    return 0;
-
-  QSplitter* pSplit = splitter( area );
-  if ( !pSplit )
-    return 0;
-
-  bool upd = pSplit->isUpdatesEnabled();
-  pSplit->setUpdatesEnabled( false );
 
-  QIntList szList = pSplit->sizes();
+/*!
+  \fn void QtxWorkstackArea::contextMenuRequested( QWidget* w, QPoint p )
+  \brief Emitted when context popup menu is requested.
+  \param w child widget popup menu requested for
+  \param p point popup menu to be shown at
+*/
 
-  QSplitter* wrap = new QSplitter( 0 );
-#if defined QT_VERSION && QT_VERSION >= 0x30200
-  wrap->setChildrenCollapsible( false );
-#endif
-  insertWidget( wrap, pSplit, area );
-  area->reparent( wrap, QPoint( 0, 0 ), true );
+/*!
+  \fn void QtxWorkstackArea::deactivated( QtxWorkstackArea* wa )
+  \brief Emitted when workarea is deactivated.
+  \param wa workarea being deactivated
+*/
 
-  pSplit->setSizes( szList );
+/*!
+  \class QtxWorkstackChild
+  \internal
+  \brief Workarea child widget container.
+*/
 
-  pSplit->setUpdatesEnabled( upd );
+/*!
+  \brief Constructor.
+  \param wid child widget
+  \param parent parent widget
+  \param f widget flags
+*/
+QtxWorkstackChild::QtxWorkstackChild( QWidget* wid, QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent ),
+  myWidget( wid )
+{
+  myWidget->setParent( this, f );
+  myWidget->installEventFilter( this );
+  QVBoxLayout* base = new QVBoxLayout( this );
+  base->setMargin( 0 );
+  base->addWidget( myWidget );
 
-  return wrap;
+  connect( myWidget, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
 }
 
 /*!
-  Reparenst and adds widget
-  \param wid - widget
-  \param pWid - parent widget
-  \param after - after widget
+  \brief Destructor.
 */
-void QtxWorkstack::insertWidget( QWidget* wid, QWidget* pWid, QWidget* after )
+QtxWorkstackChild::~QtxWorkstackChild()
 {
-  if ( !wid || !pWid )
-    return;
+  QApplication::instance()->removeEventFilter( this );
 
-  QWidgetList moveList;
-  const QObjectList* lst = pWid->children();
-  if ( lst )
-  {
-    bool found = false;
-    for ( QObjectListIt it( *lst ); it.current(); ++it )
-    {
-      if ( found && ( it.current()->inherits( "QSplitter" ) ||
-                      it.current()->inherits( "QtxWorkstackArea" ) ) )
-        moveList.append( (QWidget*)it.current() );
-      if ( it.current() == after )
-        found = true;
-    }
-  }
+  if ( !widget() )
+    return;
 
-  QMap<QWidget*, bool> map;
-  for ( QWidgetListIt it( moveList ); it.current(); ++it )
-  {
-    map.insert( it.current(), it.current()->isVisibleTo( it.current()->parentWidget() ) );
-    it.current()->reparent( 0, QPoint( 0, 0 ), false );
-  }
+  disconnect( widget(), SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
 
-  wid->reparent( pWid, QPoint( 0, 0 ), true );
+  widget()->hide();
+  widget()->removeEventFilter( this );
 
-  for ( QWidgetListIt itr( moveList ); itr.current(); ++itr )
-    itr.current()->reparent( pWid, QPoint( 0, 0 ), map.contains( itr.current() ) ? map[itr.current()] : false );
+  widget()->setParent( 0 );
 }
 
 /*!
-* \brief Closes the active window.
+  \brief Get child widget.
+  \return child widget
 */
-void QtxWorkstack::onCloseWindow()
+QWidget* QtxWorkstackChild::widget() const
 {
-  if ( myWorkWin )
-    myWorkWin->close();
-  else if( activeWindow() )
-    activeWindow()->close();
+  return myWidget;
 }
 
 /*!
-  SLOT: called on area is destroyed
-  Sets focus to neighbour area
+  \brief Custom event filter.
+
+  Process events from child widgets.
+
+  \param o event receiver widget
+  \param e event
+  \return \c true if event should be filtered (stop further processing)
 */
-void QtxWorkstack::onDestroyed( QObject* obj )
+bool QtxWorkstackChild::eventFilter( QObject* o, QEvent* e )
 {
-  QtxWorkstackArea* area = (QtxWorkstackArea*)obj;
+  if ( o->isWidgetType() )
+  {
+    if ( e->type() == QEvent::WindowTitleChange || e->type() == QEvent::WindowIconChange )
+      emit captionChanged( this );
 
-  if ( area == myArea )
-    myArea = 0;
+    if ( !e->spontaneous() && e->type() == QEvent::ShowToParent )
+      emit shown( this );
 
-  if ( !myArea )
-  {
-    QtxWorkstackArea* cur = neighbourArea( area );
-    if ( cur )
-      cur->setFocus();
-  }
+    if ( !e->spontaneous() && e->type() == QEvent::HideToParent )
+      emit hidden( this );
 
-  QApplication::postEvent( this, new QCustomEvent( QEvent::User ) );
+    if ( e->type() == QEvent::FocusIn )
+      emit activated( this );
+  }
+  return QWidget::eventFilter( o, e );
 }
 
 /*!
-  SLOT: called on window activating
+  \brief Called when child widget is destroyed.
+  \param obj child widget being destroyed
 */
-void QtxWorkstack::onWindowActivated( QWidget* wid )
+void QtxWorkstackChild::onDestroyed( QObject* obj )
 {
-  const QObject* obj = sender();
-  if ( !obj->inherits( "QtxWorkstackArea" ) )
+  if ( obj != widget() )
     return;
 
-  setActiveArea( (QtxWorkstackArea*)obj );
+  myWidget = 0;
+  deleteLater();
 }
 
 /*!
-  SLOT: called on window deactivating
+  \brief Customize child event handler.
+  \param e child event
 */
-void QtxWorkstack::onDeactivated( QtxWorkstackArea* area )
+void QtxWorkstackChild::childEvent( QChildEvent* e )
 {
-  if ( myArea != area )
-    return;
-
-  QPtrList<QtxWorkstackArea> lst;
-  areas( mySplit, lst, true );
-
-  int idx = lst.find( area );
-  if ( idx == -1 )
-    return;
-
-  myWin = 0;
-  myArea = 0;
-
-  QtxWorkstackArea* newArea = neighbourArea( area );
-  if ( newArea && newArea->activeWidget() )
-    newArea->activeWidget()->setFocus();
-
-  QApplication::postEvent( this, new QCustomEvent( QEvent::User ) );
+  if ( e->removed() && e->child() == widget() )
+  {
+    myWidget = 0;
+    deleteLater();
+  }
+  QWidget::childEvent( e );
 }
 
 /*!
-  Creates and shows popup menu for area
-  \param w - area
-  \param p - popup position
+  \fn void QtxWorkstackChild::shown( QtxWorkstackChild* w )
+  \brief Emitted when child widget is shown.
+  \param w child widget container
 */
-void QtxWorkstack::onContextMenuRequested( QWidget* w, QPoint p )
-{
-  QtxWorkstackArea* anArea = ::qt_cast<QtxWorkstackArea*>( (QObject*)sender() );
-  if ( !anArea )
-    anArea = activeArea();
-
-  if ( !anArea )
-    return;
-
-  QWidgetList lst = anArea->widgetList();
-  if ( lst.isEmpty() )
-    return;
-
-  myWorkWin = w;
-  myWorkArea = anArea;
 
-  QPopupMenu* pm = new QPopupMenu();
-  
-  if ( lst.count() > 1 )
-  {
-    myActionsMap[SplitVertical]->addTo( pm );
-    myActionsMap[SplitHorizontal]->addTo( pm );
-    pm->insertSeparator();
-  }
+/*!
+  \fn void QtxWorkstackChild::hidden( QtxWorkstackChild* w )
+  \brief Emitted when child widget is hidden.
+  \param w child widget container
+*/
 
-  if ( w )
-  {
-    myActionsMap[Close]->addTo( pm );
-    myActionsMap[Rename]->addTo( pm );
-  }
+/*!
+  \fn void QtxWorkstackChild::activated( QtxWorkstackChild* w )
+  \brief Emitted when child widget is activated.
+  \param w child widget container
+*/
 
-  Qtx::simplifySeparators( pm );
+/*!
+  \fn void QtxWorkstackChild::captionChanged( QtxWorkstackChild* w )
+  \brief Emitted when child widget's title is changed.
+  \param w child widget container
+*/
 
-  if ( pm->count() )
-    pm->exec( p );
+/*!
+  \class QtxWorkstackTabBar
+  \internal
+  \brief Workstack tab bar widget
+*/
 
-  delete pm;
+/*!
+  \brief Constructor.
+  \param parent parent widget
+*/
+QtxWorkstackTabBar::QtxWorkstackTabBar( QWidget* parent )
+: QTabBar( parent ),
+  myId( -1 )
+{
+  setDrawBase( true );
+  setElideMode( Qt::ElideNone );
 
-  myWorkWin = 0;
-  myWorkArea = 0;
+  connect( this, SIGNAL( currentChanged( int ) ), this, SLOT( onCurrentChanged( int ) ) );
 }
 
 /*!
-  Custom child event handler, inserts widget to active or current area
+  \brief Destructor.
 */
-void QtxWorkstack::childEvent( QChildEvent* e )
+QtxWorkstackTabBar::~QtxWorkstackTabBar()
 {
-  if ( e->inserted() && e->child()->isWidgetType() )
-  {
-         QWidget* w = (QWidget*)e->child();
-         if ( w && w != mySplit )
-    {
-      targetArea()->insertWidget( w );
-      return;
-    }
-  }
-  QWidget::childEvent( e );
 }
 
 /*!
-  Handler of custom events
+  \brief Get tab page identifier.
+  \param index tab page index
+  \return tab page ID or -1 if \a index is out of range
 */
-void QtxWorkstack::customEvent( QCustomEvent* e )
+int QtxWorkstackTabBar::tabId( const int index ) const
 {
-  updateState();
+  QVariant v = tabData( index );
+  if ( !v.canConvert( QVariant::Int ) )
+    return -1;
+  return v.toInt();
 }
 
 /*!
-  \return splitter corresponding to area
-  \param area
+  \brief Set tab page identifier.
+  \param index tab page index
+  \param id tab page ID
 */
-QSplitter* QtxWorkstack::splitter( QtxWorkstackArea* area ) const
+void QtxWorkstackTabBar::setTabId( const int index, const int id )
 {
-  if ( !area )
-    return 0;
-
-  QSplitter* split = 0;
-
-  QWidget* wid = area->parentWidget();
-  if ( wid && wid->inherits( "QSplitter" ) )
-    split = (QSplitter*)wid;
+  setTabData( index, id );
+}
 
-  return split;
+/*!
+  \brief Get tab page index by specified identifier.
+  \param id tab page ID
+  \return tab page index or -1 if not found
+*/
+int QtxWorkstackTabBar::indexOf( const int id ) const
+{
+  int index = -1;
+  for ( int i = 0; i < (int)count() && index < 0; i++ )
+  {
+    if ( tabId( i ) == id )
+      index = i;
+  }
+  return index;
 }
 
 /*!
-  Fills list with children splitters
-  \param split - parent splitter
-  \param splitList - list to be filled with
-  \param rec - recursive search of children
+  \brief Check if the tab bar is active.
+  \return \c true if tab bar is active
 */
-void QtxWorkstack::splitters( QSplitter* split, QPtrList<QSplitter>& splitList, const bool rec ) const
+bool QtxWorkstackTabBar::isActive() const
 {
-  if ( !split )
-    return;
-
-  const QObjectList* objs = split->children();
-  if ( objs )
-  {
-    for ( QObjectListIt it( *objs ); it.current(); ++it )
-    {
-      if ( rec )
-        splitters( (QSplitter*)it.current(), splitList, rec );
-      if ( it.current()->inherits( "QSplitter" ) )
-        splitList.append( (QSplitter*)it.current() );
-    }
-  }
+  return myActive;
 }
 
 /*!
-  Fills list with children areas
-  \param split - parent splitter
-  \param areaList - list to be filled with
-  \param rec - recursive search of children
+  \brief Set tab bar active/inactive.
+  \param on new active state
 */
-void QtxWorkstack::areas( QSplitter* split, QPtrList<QtxWorkstackArea>& areaList, const bool rec ) const
+void QtxWorkstackTabBar::setActive( const bool on )
 {
-  if ( !split )
+  if ( myActive == on )
     return;
 
-  const QObjectList* objs = split->children();
-  if ( objs )
-  {
-    for ( QObjectListIt it( *objs ); it.current(); ++it )
-    {
-      if ( it.current()->inherits( "QtxWorkstackArea" ) )
-        areaList.append( (QtxWorkstackArea*)it.current() );
-      else if ( rec && it.current()->inherits( "QSplitter" ) )
-        areas( (QSplitter*)it.current(), areaList, rec );
-    }
-  }
+  myActive = on;
+  updateActiveState();
 }
 
 /*!
-  \return active area
+  \brief Update tab bar according to the 'active' state.
 */
-QtxWorkstackArea* QtxWorkstack::activeArea() const
+void QtxWorkstackTabBar::updateActiveState()
 {
-  return myArea;
+  QColor bc = palette().color( QPalette::Text );
+  QColor ac = isActive() ? palette().color( QPalette::Highlight ) : bc;
+  for ( int i = 0; i < (int)count(); i++ )
+    setTabTextColor( i, currentIndex() == i ? ac : bc );
 }
 
 /*!
-  \return active area or current area or create new area of there is no one
+  \brief Called when current tab page is changed.
+  \param idx tab page index (not used)
 */
-QtxWorkstackArea* QtxWorkstack::targetArea()
+void QtxWorkstackTabBar::onCurrentChanged( int /*index*/ )
 {
-  QtxWorkstackArea* area = activeArea();
-  if ( !area )
-    area = currentArea();
-  if ( !area )
-  {
-    QPtrList<QtxWorkstackArea> lst;
-    areas( mySplit, lst );
-    if ( !lst.isEmpty() )
-      area = lst.first();
-  }
-
-  if ( !area )
-    area = createArea( mySplit );
-
-  return area;
+  updateActiveState();
 }
 
 /*!
-  \return current area (that has focus)
+  \brief Customize mouse move event handler.
+  \param e mouse event
 */
-QtxWorkstackArea* QtxWorkstack::currentArea() const
+void QtxWorkstackTabBar::mouseMoveEvent( QMouseEvent* e )
 {
-  QtxWorkstackArea* area = 0;
-  QWidget* wid = focusWidget();
-  while ( wid && !area )
+  if ( myId != -1 && !tabRect( indexOf( myId ) ).contains( e->pos() ) )
   {
-    if ( wid->inherits( "QtxWorkstackArea" ) )
-      area = (QtxWorkstackArea*)wid;
-    wid = wid->parentWidget();
+    myId = -1;
+    emit dragActiveTab();
   }
 
-  return area;
+  QTabBar::mouseMoveEvent( e );
 }
 
 /*!
-  Creates new area
+  \brief Customize mouse press event handler.
+  \param e mouse event
 */
-QtxWorkstackArea* QtxWorkstack::createArea( QWidget* parent ) const
+void QtxWorkstackTabBar::mousePressEvent( QMouseEvent* e )
 {
-  QtxWorkstackArea* area = new QtxWorkstackArea( parent );
-
-  connect( area, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
-  connect( area, SIGNAL( activated( QWidget* ) ), this, SLOT( onWindowActivated( QWidget* ) ) );
-  connect( area, SIGNAL( contextMenuRequested( QWidget*, QPoint ) ),
-          this, SLOT( onContextMenuRequested( QWidget*, QPoint ) ) );
-  connect( area, SIGNAL( deactivated( QtxWorkstackArea* ) ), this, SLOT( onDeactivated( QtxWorkstackArea* ) ) );
+  QTabBar::mousePressEvent( e );
 
-  return area;
+  if ( e->button() == Qt::LeftButton )
+    myId = tabId( currentIndex() );
 }
 
 /*!
-  Sets area as active
-  \param area
+  \brief Customize mouse release event handler.
+  \param e mouse event
 */
-void QtxWorkstack::setActiveArea( QtxWorkstackArea* area )
+void QtxWorkstackTabBar::mouseReleaseEvent( QMouseEvent* e )
 {
-  QWidget* oldCur = myWin;
-
-  QtxWorkstackArea* oldArea = myArea;
-
-  myArea = area;
-
-  if ( myArea != oldArea )
-  {
-    if ( oldArea )
-      oldArea->updateActiveState();
-    if ( myArea )
-      myArea->updateActiveState();
-  }
+  QTabBar::mouseReleaseEvent( e );
 
-  if ( myArea )
-    myWin = myArea->activeWidget();
+  myId = -1;
 
-  if ( myWin && oldCur != myWin )
-    emit windowActivated( myWin );
+  if ( e->button() == Qt::RightButton )
+    emit contextMenuRequested( e->globalPos() );
 }
 
 /*!
-  \return neighbour area
-  \param area - area to search neighbour
+  \brief Customize context menu event handler.
+  \param e context menu event
 */
-QtxWorkstackArea* QtxWorkstack::neighbourArea( QtxWorkstackArea* area ) const
+void QtxWorkstackTabBar::contextMenuEvent( QContextMenuEvent* e )
 {
-  QPtrList<QtxWorkstackArea> lst;
-  areas( mySplit, lst, true );
-  int pos = lst.find( area );
-  if ( pos < 0 )
-    return 0;
-
-  QtxWorkstackArea* na = 0;
-  for ( int i = pos - 1; i >= 0 && !na; i-- )
-  {
-    if ( !lst.at( i )->isEmpty() )
-      na = lst.at( i );
-  }
-
-  for ( int j = pos + 1; j < (int)lst.count() && !na; j++ )
-  {
-    if ( !lst.at( j )->isEmpty() )
-        na = lst.at( j );
-  }
-  return na;
+  if ( e->reason() != QContextMenuEvent::Mouse )
+    emit contextMenuRequested( e->globalPos() );
 }
 
 /*!
-  \return area covering point
-  \param p - point
+  \brief Process widget change state events (style, palette, enable state changing, etc).
+  \param e change event (not used)
 */
-QtxWorkstackArea* QtxWorkstack::areaAt( const QPoint& p ) const
+void QtxWorkstackTabBar::changeEvent( QEvent* /*e*/ )
 {
-  QtxWorkstackArea* area = 0;
-  QPtrList<QtxWorkstackArea> lst;
-  areas( mySplit, lst, true );
-  for ( QPtrListIterator<QtxWorkstackArea> it( lst ); it.current() && !area; ++it )
+  updateActiveState();
+}
+
+/*
+void QtxWorkstackTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const
+{
+  if ( currentTab() != t->identifier() )
   {
-    QtxWorkstackArea* cur = it.current();
-    QRect r = cur->geometry();
-    if ( cur->parentWidget() )
-      r = QRect( cur->parentWidget()->mapToGlobal( r.topLeft() ), r.size() );
-    if ( r.contains( p ) )
-      area = cur;
+    QFont fnt = p->font();
+    fnt.setUnderline( false );
+    p->setFont( fnt );
   }
-  return area;
+  QTabBar::paintLabel( p, br, t, has_focus );
 }
+*/
 
 /*!
-  Update
+  \fn void QtxWorkstackTabBar::dragActiveTab()
+  \brief Emitted when dragging operation is started.
 */
-void QtxWorkstack::updateState()
-{
-  updateState( mySplit );
-}
 
 /*!
-  Update splitters
+  \fn void QtxWorkstackTabBar::contextMenuRequested( QPoint p )
+  \brief Emitted when context popup menu is requested.
+  \param p point popup menu to be shown at
 */
-void QtxWorkstack::updateState( QSplitter* split )
-{
-  QPtrList<QSplitter> recList;
-  splitters( split, recList, false );
-  for ( QPtrListIterator<QSplitter> itr( recList ); itr.current(); ++itr )
-    updateState( itr.current() );
 
-  QPtrList<QSplitter> splitList;
-  splitters( split, splitList, false );
-
-  QPtrList<QtxWorkstackArea> areaList;
-  areas( split, areaList, false );
-
-  bool vis = false;
-  for ( QPtrListIterator<QtxWorkstackArea> it( areaList ); it.current(); ++it )
-  {
-    if ( it.current()->isEmpty() )
-      it.current()->hide();
-    else
-    {
-      it.current()->show();
-      vis = true;
-    }
-  }
-
-  if ( split == mySplit )
-    return;
+/*!
+  \class QtxWorkstack
+  \brief Workstack widget.
 
-  for ( QPtrListIterator<QSplitter> iter( splitList ); iter.current() && !vis; ++iter )
-    vis = iter.current()->isVisibleTo( iter.current()->parentWidget() );
+  Organizes the child widgets in the tabbed space.
+  Allows splitting the working area to arrange the child widgets in 
+  arbitrary way. Any widgets can be moved to another working area with
+  drag-n-drop operation.
 
-  if ( areaList.isEmpty() && splitList.isEmpty() )
-    delete split;
-  else if ( vis )
-    split->show();
-  else
-    split->hide();
-}
+  This widget can be used as workspace of the application main window, 
+  for example, as kind of implementation of multi-document interface.
+*/
 
 /*!
-  Gets splitter info for debug
-  \param split - splitter
-  \param info - string to be filled with info
+  \brief Constructor.
+  \param parent parent widget
 */
-void QtxWorkstack::splitterInfo( QSplitter* split, QString& info ) const
-{
-  if ( !split )
-    return;
-
-  const QObjectList* objs = split->children();
-  if ( objs )
+QtxWorkstack::QtxWorkstack( QWidget* parent )
+: QWidget( parent ),
+  myWin( 0 ),
+  myArea( 0 ),
+  myWorkWin( 0 ),
+  myWorkArea( 0 )
+{
+  myActionsMap.insert( SplitVertical,   new QtxAction( QString(), tr( "Split vertically" ), 0, this ) );
+  myActionsMap.insert( SplitHorizontal, new QtxAction( QString(), tr( "Split horizontally" ), 0, this ) );
+  myActionsMap.insert( Close,           new QtxAction( QString(), tr( "Close" ), 0, this ) );
+  myActionsMap.insert( Rename,          new QtxAction( QString(), tr( "Rename" ), 0, this ) );
+
+  connect( myActionsMap[SplitVertical], SIGNAL( triggered( bool ) ), this, SLOT( splitVertical() ) );
+  connect( myActionsMap[SplitHorizontal], SIGNAL( triggered( bool ) ), this, SLOT( splitHorizontal() ) );
+  connect( myActionsMap[Close], SIGNAL( triggered( bool ) ), this, SLOT( onCloseWindow() ) );
+  connect( myActionsMap[Rename], SIGNAL( triggered( bool ) ), this, SLOT( onRename() ) );
+
+  // Action shortcut will work when action added in any widget.
+  for ( QMap<int, QAction*>::iterator it = myActionsMap.begin(); it != myActionsMap.end(); ++it )
   {
-    // make up a sizes string: integer values are separated by ':' char
-    QValueList<int> sizes = split->sizes();
-    QString sizesStr;
-    for ( QValueList<int>::Iterator sIt = sizes.begin(); sIt != sizes.end(); ++sIt ) {
-      if ( *sIt > 1 ) // size 1 pixel usually means empty Workstack area, which will NOT be re-created,
-       sizesStr += QString( ":%1" ).arg( *sIt );  // so we don't need to store its size
-    }
-    if ( !sizesStr.isEmpty() ) // cut the first ':'
-      sizesStr = sizesStr.right( sizesStr.length()-1 );    
-
-    // count all QSplitter-s and QtxWorkstackArea-s
-    //    int nChilds( 0 );
-    //    QObjectListIt it( *objs );
-    //    for ( ; it.current(); ++it )
-    //    {
-    //      if ( it.current()->inherits( "QSplitter" ) ||
-    //           it.current()->inherits( "QtxWorkstackArea" ) )
-    // nChilds++;
-    //    }
-      
-    info += QString( "(splitter orientation=%1 sizes=%3 " ).arg( split->orientation() ).arg( sizesStr );
-    
-    for ( QObjectListIt it( *objs ); it.current(); ++it )
-    {
-      if ( it.current()->inherits( "QSplitter" ) )
-       splitterInfo( (QSplitter*)it.current(), info );
-      else if ( it.current()->inherits( "QtxWorkstackArea" ) ) {
-       QtxWorkstackArea* area = (QtxWorkstackArea*)it.current();
-       if ( area->isEmpty() )
-         continue;
-       info += QString( "(views active='%1'" ).arg( area->activeWidget()->name() );
-       QWidgetList views = area->widgetList();
-       for ( QWidgetListIt wIt( views ); wIt.current(); ++wIt )
-         info += QString( " '%1'" ).arg( wIt.current()->name() );
-       info += ')';
-      }
-    }
+    addAction( it.value() );
+    it.value()->setShortcutContext( Qt::ApplicationShortcut );
   }
-  info += ')';
-}
 
+  QVBoxLayout* base = new QVBoxLayout( this );
+  base->setMargin( 0 );
 
-//Cuts starting '(' symbol and ending '(' symbol
-void cutBrackets( QString& parameters )
-{
-  QChar c1 = parameters[0];
-  QChar c2 = parameters[int(parameters.length()-1)];
-  if ( !parameters.isEmpty() && c1 == '(' && c2 == ')' )
-    parameters = parameters.mid( 1, parameters.length()-2 );
+  mySplit = new QSplitter( this );
+  mySplit->setChildrenCollapsible( false );
+  base->addWidget( mySplit );
 }
 
-/*
-  for strings like "(splitter orientation=0 children=2 sizes=332:478" returns values of
-  parameters.  For example, getValue( example, "children" ) returns "2"
-  getValue( example, "sizes" ) returns "332:478"
+/*!
+  \brief Destructor.
 */
-QString getValue( const QString& str, const QString& valName )
+QtxWorkstack::~QtxWorkstack()
 {
-  int i = str.find( valName );
-  if ( i != -1 ) {
-    int equal_i = str.find( '=', i );
-    if ( equal_i != -1 ) {
-      int space_i = str.find( ' ', ++equal_i );
-      if ( space_i != -1 )
-       return str.mid( equal_i, space_i-equal_i );
-    }
-  }
-  return QString( "" );
 }
 
-/*
-  checks format of splitter parameters string
+/*!
+  \brief Get list of all widgets in all areas or in specified area which given 
+         widget belongs to
+  \param wid widget specifying area if it is equal to null when widgets of all 
+         areas are retuned
+  \return list of widgets
 */
-bool checkFormat( const QString& parameters )
+QWidgetList QtxWorkstack::windowList( QWidget* wid ) const
 {
-  QString params( parameters );
-  // 1. begins and ends with brackets
-  QChar c1 = params[0];
-  QChar c2 = params[int(params.length()-1)];
-  bool ok = ( c1 == '(' && c2 == ')' );
-  if ( !ok ) return ok;
-  ::cutBrackets( params );
-  // 2. has splitter word
-  ok = ( params.left( 8 ) == "splitter" );
-  if ( !ok ) return ok;
-  // 3. has children?  = '(' is found
-  int i = params.find( '(' );
-  ok = i != -1;
-  if ( !ok ) return ok;
-  params = params.left( i ); // cut all children, they will be checked later
-  // 4. has orientation word and correct value
-  ::getValue( params, "orientation" ).toInt( &ok );
-  if ( !ok ) return ok;
-  // 5. has sizes word and values
-  ok = ! ::getValue( params, "sizes" ).isEmpty();
-  if ( !ok ) return ok;
-  // 6. check children -> number of '(' == number of ')' in original string
-  ok = ( parameters.contains( '(' ) == parameters.contains( ')' ) );
-  return ok;
-}
+  QList<QtxWorkstackArea*> lst;
+  if ( !wid )
+  {
+    areas( mySplit, lst, true );
+  }
+  else 
+  {
+    QtxWorkstackArea* area = wgArea( wid );
+    if ( area )
+      lst.append( area );
+  }
 
-/*
-  Returns children of splitter in a list.  Children are separated by '(' and ')' symbols
-*/
-QStringList getChildren( const QString& str )
-{
-  QStringList lst;
-  if ( !str.startsWith( "(" ) )
-    return lst;
-  
-  int i = 1,
-  nOpen = 1, // count brackets: '(' increments nOpen, ')' decrements
-  start = 0;
-  while ( i < (int)str.length() )
+  QWidgetList widList;
+  for ( QList<QtxWorkstackArea*>::iterator it = lst.begin(); it != lst.end(); ++it )
   {
-    if ( str[i] == '(' )
-    {
-      nOpen++;
-      if ( nOpen == 1 )
-       start = i;
-    }
-    else if ( str[i] == ')' )
-    {
-      nOpen--;
-      if ( nOpen == 0 ) 
-       lst.append( str.mid( start, i-start+1 ) );
-    }
-    i++;
+    QWidgetList wids = (*it)->widgetList();
+    for ( QWidgetList::iterator itr = wids.begin(); itr != wids.end(); ++itr )
+      widList.append( *itr );
   }
 
-  return lst;
+  return widList;
 }
 
-// for a string like "views active='AnotherView' 'GLView' 'AnotherView'"
-// getViewName( example, 0 ) returns "GLView", 
-// getViewName( example, 1 ) -> "AnotherView", etc.
-QString getViewName( const QString& str, int i )
+/*!
+  \brief Get all child widgets in the active workarea.
+  \return list of widgets in active workarea
+*/
+QWidgetList QtxWorkstack::splitWindowList() const
 {
-  QRegExp exp( "\\s'\\w+'" );
-  int start = 0; // start index of view name in the string
-  int num = 0 ; // index of found match
-  while ( ( start = exp.search( str, start ) ) != -1 && num < i ) {
-    start += exp.matchedLength();
-    num ++;
-  }
-  if ( start != -1 )      // +2 and -3 avoid starting space and starting and ending ' symbols
-    return str.mid( start+2, exp.matchedLength()-3 );
-
-  return QString( "" );
+  return myArea ? myArea->widgetList() : QWidgetList();
 }
 
-// returns widget with given name
-QWidget* getView( const QWidget* parent, const QString& aName )
+/*!
+  \brief Get active widget.
+  \return active widget
+*/
+QWidget* QtxWorkstack::activeWindow() const
 {
-  QWidget* view = 0;
-  QObjectList *l = parent->topLevelWidget()->queryList( "QWidget", aName, false, true );
-  if ( !l->isEmpty() )
-    view = ::qt_cast<QWidget*>( l->first() );
-  delete l;
-  return view;
+  return myWin;
 }
 
-/*!
-  Installs a splitter described by given parameters string
+/*!
+  \brief Split workstack.
+
+  Splitting is possible only if there are two or more widgets in the workarea.
+  This function splits current workarea to two new ones.
+
+  \param o splitting orientation (Qt::Orientation)
 */
-void QtxWorkstack::setSplitter( QSplitter* splitter, const QString& parameters, QMap< QSplitter*, QValueList<int> >& sMap )
+void QtxWorkstack::split( const int o )
 {
-  if ( !::checkFormat( parameters ) ) {
-    printf( "\nInvalid format of workstack parameters.  Positions of viewers can not be restored.\n" );
+  QtxWorkstackArea* area = myWorkArea;
+  if ( !area )
+    area = activeArea();
+  if ( !area )
     return;
-  }
 
-  QString params( parameters );
-  ::cutBrackets( params );
+  if ( area->widgetList().count() < 2 )
+    return;
 
-  // get splitter sizes and store it in the map for future setting
-  QValueList<int> sizes;
-  QStringList sizesLst = QStringList::split( ':', ::getValue( params, "sizes" ) );
-  QStringList::Iterator it;
-  for ( it = sizesLst.begin(); it != sizesLst.end(); ++it )
-    sizes.append( (*it).toInt() );
-  sMap[ splitter ] = sizes;
+  QWidget* curWid = area->activeWidget();
+  if ( !curWid )
+    return;
 
-  // set orientation of splitter
-  int orient = ::getValue( params, "orientation" ).toInt();
-  splitter->setOrientation( (Qt::Orientation)orient );
+  QSplitter* s = splitter( area );
+  QList<QtxWorkstackArea*> areaList;
+  areas( s, areaList );
 
-  // get children
-  QString options = params.left( params.find( '(' ) );
-  QString childrenStr = params.right( params.length()-options.length() );
-  QStringList children = ::getChildren( childrenStr );
+  QList<QSplitter*> splitList;
+  splitters( s, splitList );
 
-  // debug output..
-  //  printf (" splitter orient=%d, sizes_count=%d, children=%d\n", orient, sizes.count(), children.count() ); 
-  //  for ( QStringList::Iterator tit = children.begin(); tit != children.end(); ++tit ) 
-  //    printf ("   |-> child = [%s]\n", (*tit).latin1() );
+  QSplitter* trg = 0;
+  if ( areaList.count() + splitList.count() < 2 || s->orientation() == o )
+    trg = s;
 
-  for ( QStringList::Iterator it = children.begin(); it != children.end(); ++it ) {
-    if ( (*it).startsWith( "(splitter" ) ) {
-      QSplitter* newSplitter = new QSplitter( splitter );
-      setSplitter( newSplitter, *it, sMap );
-    }
-    else if ( (*it).startsWith( "(views" ) ) {
-      QtxWorkstackArea* newArea = createArea( splitter );
-      QString activeViewName = ::getValue( *it, "active" );
-      QWidget* activeView( 0 );
-      activeViewName = activeViewName.mid( 1, activeViewName.length()-2 ); // chop off ' symbols
-      int i = 0;
-      QString viewName = ::getViewName( *it, i );
-      while ( !viewName.isEmpty() ) {
-       if ( QWidget* view = ::getView( splitter, viewName ) ) {
-         newArea->insertWidget( view );
-         if ( activeViewName == view->name() )
-           activeView = view;
-       }
-       viewName = ::getViewName( *it, ++i );
-      }
-      if ( activeView )
-       newArea->setActiveWidget( activeView );
-    }
-  }
-}
+  if ( !trg )
+    trg = wrapSplitter( area );
 
-/*!
-  Restore workstack's configuration stored in 'parameters' string
-*/
-QtxWorkstack& QtxWorkstack::operator<<( const QString& parameters )
-{
-  // clear the main splitter - remove all child splitters and empty areas from it
-  QPtrList<QSplitter> splitList;
-  QPtrList<QtxWorkstackArea> areaList;
-  splitters( mySplit, splitList, false );
-  areas( mySplit, areaList, false );
-  for ( QPtrListIterator<QSplitter> iter( splitList ); iter.current(); ++iter )
-    delete iter.current();
-  for ( QPtrListIterator<QtxWorkstackArea> it( areaList ); it.current(); ++it ) 
-    if ( it.current()->isEmpty() )
-      delete it.current();
+  if ( !trg )
+    return;
 
-  // restore splitter recursively
-  QMap< QSplitter*, QValueList<int> > sMap;
-  setSplitter( mySplit, parameters, sMap );  
+  trg->setOrientation( (Qt::Orientation)o );
 
-  // now mySplit may contains empty area (where all views were located before restoring)
-  // in order setSize to work correctly we have to exclude this area
-  areaList.clear();
-  areas( mySplit, areaList, false );
-  for ( QPtrListIterator<QtxWorkstackArea> delIt( areaList ); delIt.current(); ++delIt ) 
-    if ( delIt.current()->isEmpty() )
-      delete delIt.current();
+  QtxWorkstackArea* newArea = createArea( 0 );
+  trg->insertWidget( trg->indexOf( area ) + 1, newArea );
 
-  qApp->processEvents();
+  area->removeWidget( curWid );
+  newArea->insertWidget( curWid );
 
-  // restore splitters' sizes (map of sizes is filled in setSplitters)
-  for ( QMap< QSplitter*, QValueList<int> >::Iterator itm = sMap.begin(); itm != sMap.end(); ++itm )
-    itm.key()->setSizes( itm.data() );
+  distributeSpace( trg );
 
-  return (*this);
+  curWid->show();
+  curWid->setFocus();
 }
 
 /*!
-  Example of string produced by operator>> :
-  "(splitter orientation=0 sizes=186:624 (views active='OCCViewer_0_0' 'OCCViewer_0_0')
-/ (views active='VTKViewer_0_0' 'VTKViewer_0_0'))"
-*/
-QtxWorkstack& QtxWorkstack::operator>>( QString& outParameters )
-{
-  splitterInfo( mySplit, outParameters );
-  return (*this);
-}
+  \brief Split workarea of the given widget on two parts.
 
+  Splitting is possible only if there are two or more widgets in the workarea.
+  This function splits current workarea to two new ones.
 
-/*!
-  Constructor
+  \param wid widget belonging to the workstack
+  \param o splitting orientation type (Qt::Orientation)
+  \param type splitting type (QtxWorkstack::SplitType)
 */
-QtxWorkstackArea::QtxWorkstackArea( QWidget* parent )
-: QWidget( parent )
+void QtxWorkstack::Split( QWidget* wid, const Qt::Orientation o, const SplitType type )
 {
-  QVBoxLayout* base = new QVBoxLayout( this );
+  if (!wid) return;
 
-  QHBox* top = new QHBox( this );
-  base->addWidget( top );
+  // find area of the given widget
+  QtxWorkstackArea* area = NULL;
+  QList<QtxWorkstackArea*> allAreas;
+  areas(mySplit, allAreas, true);
 
-  myBar = new QtxWorkstackTabBar( top );
 
-  QPushButton* close = new QPushButton( top );
-  close->setPixmap( style().stylePixmap( QStyle::SP_TitleBarCloseButton ) );
-  close->setAutoDefault( true );
-  close->setFlat( true );
-  myClose = close;
+  for ( QList<QtxWorkstackArea*>::iterator it = allAreas.begin(); it != allAreas.end() && !area; ++it )
+  {
+    if ( (*it)->contains( wid ) )
+      area = *it;
+  }
+
+  if ( !area )
+    return;
+
+  QWidgetList wids = area->widgetList();
+  if ( wids.count() < 2 )
+    return;
 
-  top->setStretchFactor( myBar, 1 );
+  QSplitter* s = splitter( area );
+  QList<QtxWorkstackArea*> areaList;
+  areas( s, areaList );
 
-  myStack = new QWidgetStack( this );
+  QList<QSplitter*> splitList;
+  splitters(s, splitList);
 
-  base->addWidget( myStack, 1 );
+  QSplitter* trg = 0;
+  if (areaList.count() + splitList.count() < 2 || s->orientation() == o)
+    trg = s;
 
-  connect( myClose, SIGNAL( clicked() ), this, SLOT( onClose() ) );
-  connect( myBar, SIGNAL( selected( int ) ), this, SLOT( onSelected( int ) ) );
-  connect( myBar, SIGNAL( dragActiveTab() ), this, SLOT( onDragActiveTab() ) );
-  connect( myBar, SIGNAL( contextMenuRequested( QPoint ) ), this, SLOT( onContextMenuRequested( QPoint ) ) );
+  if (!trg) trg = wrapSplitter(area);
+  if (!trg) return;
 
-  updateState();
+  trg->setOrientation(o);
 
-  updateActiveState();
+  QtxWorkstackArea* newArea = createArea(0);
+  insertWidget(newArea, trg, area);
+
+  switch ( type )
+  {
+  case SplitStay:
+    for ( QWidgetList::iterator itr = wids.begin(); itr != wids.end(); ++itr )
+    {
+      QWidget* wid_i = *itr;
+      if ( wid_i != wid )
+      {
+        area->removeWidget( wid_i );
+        newArea->insertWidget( wid_i );
+      }
+    }
+    break;
+  case SplitAt:
+    {
+      QWidgetList::iterator itr = wids.begin();
+      for ( ; itr != wids.end() && *itr != wid; ++itr )
+      {
+      }
+      for ( ; itr != wids.end(); ++itr )
+      {
+        area->removeWidget( *itr );
+        newArea->insertWidget( *itr );
+      }
+    }
+    break;
+  case SplitMove:
+    area->removeWidget( wid );
+    newArea->insertWidget( wid );
+    break;
+  }
 
-  qApp->installEventFilter( this );
+  distributeSpace( trg );
 }
 
 /*!
-  Destructor
+ \brief Move widget(s) from the source workarea into the target workarea
+        or reorder widgets inside one workarea.
+
+ Move \a wid2 in target workarea. Put it right after \a wid1.
+ If \a all parameter is \c true, all widgets from source workarea
+ will be moved including \a wid2 and source workarea will be deleted then.
+
+ If \a wid1 and \a wid2 belongs to one workarea, widgets will be just reordered
+ in that workarea.
+
+ \param wid1 widget from target workarea
+ \param wid2 widget from source workarea
+ \param all  if \c true, all widgets from source workarea will
+             be moved into the target one, else only the \a wid2 will be moved
 */
-QtxWorkstackArea::~QtxWorkstackArea()
+void QtxWorkstack::Attract( QWidget* wid1, QWidget* wid2, const bool all )
 {
-  qApp->removeEventFilter( this );
+  if ( !wid1 || !wid2 )
+    return;
+
+  // find area of the widgets
+  QtxWorkstackArea *area1 = 0, *area2 = 0;
+  QList<QtxWorkstackArea*> allAreas;
+  areas( mySplit, allAreas, true );
+  for ( QList<QtxWorkstackArea*>::iterator it = allAreas.begin(); it != allAreas.end() && !( area1 && area2 ); ++it )
+  {
+    if ( (*it)->contains( wid1 ) )
+      area1 = *it;
+
+    if ( (*it)->contains( wid2 ) )
+      area2 = *it;
+  }
+
+  if ( !area1 || !area2 )
+    return;
+
+  QWidget* curWid = area1->activeWidget();
+  if ( !curWid )
+    return;
+
+  if ( area1 == area2 )
+  {
+    if ( all )
+    {
+      // Set wid1 at first position, wid2 at second
+      area1->insertWidget( wid1 );
+      area1->insertWidget( wid2, 1 );
+    }
+    else
+    {
+      // Set wid2 right after wid1
+      area1->removeWidget( wid2 );
+      int wid1_ind = 0;
+      QWidgetList wids1 = area1->widgetList();
+      for ( QWidgetList::iterator itr1 = wids1.begin(); itr1 != wids1.end() && *itr1 != wid1; ++itr1, ++wid1_ind );
+      area1->insertWidget( wid2, wid1_ind + 1 );
+    }
+  }
+  else
+  {
+    int wid1_ind = 0;
+    QWidgetList wids1 = area1->widgetList();
+    for ( QWidgetList::iterator itr1 = wids1.begin(); itr1 != wids1.end() && *itr1 != wid1; ++itr1, ++wid1_ind );
+    if ( all )
+    {
+      // Set wid2 right after wid1, other widgets from area2 right after wid2
+      QWidgetList wids2 = area2->widgetList();
+      QWidgetList::iterator itr2 = wids2.begin();
+      for ( int ind = wid1_ind + 1; itr2 != wids2.end(); ++itr2, ++ind )
+      {
+        area2->removeWidget( *itr2 );
+        if ( *itr2 == wid2 )
+          area1->insertWidget( *itr2, wid1_ind + 1 );
+        else
+          area1->insertWidget( *itr2, ind );
+      }
+    }
+    else
+    {
+      // Set wid2 right after wid1
+      area2->removeWidget( wid2 );
+      area1->insertWidget( wid2, wid1_ind + 1 );
+    }
+  }
+
+  area1->setActiveWidget( curWid );
 }
 
 /*!
-  \return true if area is empty
+  \brief Calculate sizes of the splitter widget for the workarea.
+  \internal
 */
-bool QtxWorkstackArea::isEmpty() const
+static void setSizes (QIntList& szList, const int item_ind,
+                      const int new_near, const int new_this, const int new_farr)
 {
-  bool res = false;
-  for ( WidgetInfoMap::ConstIterator it = myInfo.begin(); it != myInfo.end() && !res; ++it )
-    res = it.data().vis;
-  return !res;
+  // set size to all items before an item # <item_ind>
+  int cur_pos = 0;
+  QIntList::iterator its = szList.begin();
+  for (; its != szList.end() && cur_pos < item_ind; ++its, ++cur_pos) {
+    *its = new_near;
+  }
+  if (its == szList.end()) return;
+  // set size to item # <item_ind>
+  *its = new_this;
+  ++its;
+  // set size to all items after an item # <item_ind>
+  for (; its != szList.end(); ++its) {
+    *its = new_farr;
+  }
 }
 
 /*!
-  Adds widget to area
-  \param wid - widget
-  \param idx - index
+  \brief Set position of the widget relatively to its parent splitter.
+
+  Orientation of positioning will correspond to the splitter orientation.
+
+  \param wid widget
+  \param pos position relatively to the splitter; value in the range [0..1]
 */
-void QtxWorkstackArea::insertWidget( QWidget* wid, const int idx )
+void QtxWorkstack::SetRelativePositionInSplitter( QWidget* wid, const double position )
 {
-  if ( !wid )
+  if ( position < 0.0 || 1.0 < position)
     return;
 
-  int pos = myList.find( wid );
-  if ( pos != -1 && ( pos == idx || ( idx < 0 && pos == (int)myList.count() - 1 ) ) )
+  if ( !wid )
     return;
 
-  myList.removeRef( wid );
-  pos = idx < 0 ? myList.count() : idx;
-  myList.insert( QMIN( pos, (int)myList.count() ), wid );
-  if ( !myInfo.contains( wid ) )
+  // find area of the given widget
+  QtxWorkstackArea* area = NULL;
+  QList<QtxWorkstackArea*> allAreas;
+  areas( mySplit, allAreas, true );
+  for ( QList<QtxWorkstackArea*>::iterator it = allAreas.begin(); it != allAreas.end() && !area; ++it )
   {
-    QtxWorkstackChild* child = new QtxWorkstackChild( wid, myStack );
-    myChild.insert( wid, child );
-    myInfo.insert( wid, WidgetInfo() );
-    myInfo[wid].id = generateId();
-    myInfo[wid].vis = wid->isVisibleTo( wid->parentWidget() );
-
-    connect( child, SIGNAL( destroyed( QObject* ) ), this, SLOT( onChildDestroyed( QObject* ) ) );
-    connect( wid, SIGNAL( destroyed() ), this, SLOT( onWidgetDestroyed() ) );
-    connect( child, SIGNAL( shown( QtxWorkstackChild* ) ), this, SLOT( onChildShown( QtxWorkstackChild* ) ) );
-    connect( child, SIGNAL( hided( QtxWorkstackChild* ) ), this, SLOT( onChildHided( QtxWorkstackChild* ) ) );
-    connect( child, SIGNAL( activated( QtxWorkstackChild* ) ), this, SLOT( onChildActivated( QtxWorkstackChild* ) ) );
-    connect( child, SIGNAL( captionChanged( QtxWorkstackChild* ) ), this, SLOT( onChildCaptionChanged( QtxWorkstackChild* ) ) );
+    if ( (*it)->contains( wid ) )
+      area = *it;
   }
 
-  updateState();
-
-  setWidgetActive( wid );
-  wid->setFocus();
-}
+  if ( !area )
+    return;
 
-/*!
-  Creates and shows popup menu for area
-  \param p - popup position
-*/
-void QtxWorkstackArea::onContextMenuRequested( QPoint p )
-{
-  const QtxWorkstackTabBar* bar = ::qt_cast<const QtxWorkstackTabBar*>( sender() );
-  if ( !bar )
+  QSplitter* split = splitter( area );
+  if ( !split )
     return;
 
-  QWidget* wid = 0;
-  QTab* tab = myBar->tabAt( tabAt( p ) );
-  if ( tab )
-    wid = widget( tab->identifier() );
+  // find index of the area in its splitter
+  int item_ind = -1;
+  bool isFound = false;
+  const QObjectList& was = split->children();
+  for ( QObjectList::const_iterator ito = was.begin(); ito != was.end() && !isFound; ++ito, ++item_ind )
+  {
+    if ( *ito == area )
+      isFound = true;
+  }
 
-  emit contextMenuRequested( wid, p );
-}
+  if ( !isFound || item_ind == 0 )
+    return;
 
-/*!
-  SLOT: called when widget added to area is destroyed, removes widget from area
-*/
-void QtxWorkstackArea::onWidgetDestroyed()
-{
-  if ( sender() )
-    removeWidget( (QWidget*)sender(), false );
+  QIntList szList = split->sizes();
+  int splitter_size = ( split->orientation() == Qt::Horizontal ? split->width() : split->height());
+  int nb = szList.count();
+
+  int new_prev = int( splitter_size * position / item_ind );
+  if (nb == item_ind) return;
+  int new_next = int( splitter_size * ( 1.0 - position ) / ( nb - item_ind ) );
+  setSizes( szList, item_ind, new_prev, new_next, new_next );
+  split->setSizes( szList );
 }
 
 /*!
-  Removes widget from area
-  \param wid - widget
-  \param del - auto deleting
+  \brief Set position of the widget relatively to the entire workstack.
+
+  If \a o is \c Qt::Horizontal, the horizontal position of \a wid will be changed.
+  If \a o is \c Qt::Vertical, the vertical position of \a wid will be changed.
+
+  \param wid widget
+  \param o   orientation of positioning (\c Qt::Horizontal or \c Qt::Vertical)
+  \param pos position relatively to the workstack; value in range [0..1]
 */
-void QtxWorkstackArea::removeWidget( QWidget* wid, const bool del )
+void QtxWorkstack::SetRelativePosition( QWidget* wid, const Qt::Orientation o,
+                                        const double position )
 {
-  if ( !myList.contains( wid ) )
+  if ( position < 0.0 || 1.0 < position )
     return;
 
-  if ( myBar->tab( widgetId( wid ) ) )
-    myBar->removeTab( myBar->tab( widgetId( wid ) ) );
-  myStack->removeWidget( child( wid ) );
+  if ( !wid )
+    return;
 
-  myList.remove( wid );
-  myInfo.remove( wid );
-  myChild.remove( wid );
+  int splitter_size = o == Qt::Horizontal ? mySplit->width() : mySplit->height();
+  int need_pos = int( position * splitter_size );
+  int splitter_pos = 0;
 
-  if( del )
+  if ( setPosition( wid, mySplit, o, need_pos, splitter_pos ) != 0 )
   {
-    delete child( wid );
-    if( myList.isEmpty() )
-      delete this;
-    else
-      updateState();
+    // impossible to set required position
   }
-  else
-    updateState();
 }
 
 /*!
-  \return list of visible widgets
+  \brief Set accelerator key-combination for the action with specified \a id.
+  \param id action ID
+  \param accel action accelerator
 */
-QWidgetList QtxWorkstackArea::widgetList() const
+void QtxWorkstack::setAccel( const int id, const int accel )
 {
-  QWidgetList lst;
-  for ( QWidgetListIt it( myList ); it.current(); ++it )
-  {
-    if ( widgetVisibility( it.current() ) )
-      lst.append( it.current() );
-  }
-  return lst;
-}
+  if ( !myActionsMap.contains( id ) )
+    return;
 
-/*!
-  \return active widget
-*/
-QWidget* QtxWorkstackArea::activeWidget() const
-{
-  return widget( myBar->currentTab() );
+  myActionsMap[id]->setShortcut( accel );
 }
 
 /*!
-  Sets widget as active
-  \param wid - widget
+  \brief Get the action's accelerator key-combination.
+  \param id action ID
+  \return action accelerator
 */
-void QtxWorkstackArea::setActiveWidget( QWidget* wid )
+int QtxWorkstack::accel( const int id ) const
 {
-  myBar->setCurrentTab( widgetId( wid ) );
+  int res = 0;
+  if ( myActionsMap.contains( id ) )
+    res = myActionsMap[id]->shortcut();
+  return res;
 }
 
 /*!
-  \return true if area contains widget
-  \param wid - widget
-*/
-bool QtxWorkstackArea::contains( QWidget* wid ) const
-{
-  return myList.contains( wid );
-}
+  \brief Get icon for the specified action.
 
-/*!
-  Shows area
+  If \a id is invalid, null icon is returned.
+
+  \param id menu action ID
+  \return menu item icon
 */
-void QtxWorkstackArea::show()
+QIcon QtxWorkstack::icon( const int id ) const
 {
-  QMap<QWidget*, bool> map;
-  for ( QWidgetListIt it( myList ); it.current(); ++it )
-  {
-    map.insert( it.current(), isBlocked( it.current() ) );
-    setBlocked( it.current(), true );
-  }
-
-  QWidget::show();
-
-  for ( QWidgetListIt itr( myList ); itr.current(); ++itr )
-    setBlocked( itr.current(), map.contains( itr.current() ) ? map[itr.current()] : false );
+  QIcon ico;
+  if ( myActionsMap.contains( id ) )
+    ico = myActionsMap[id]->icon();
+  return ico;
 }
 
 /*!
-  Hides area
+  \brief Set menu item icon for the specified action.
+  \param id menu action ID
+  \param ico new menu item icon
 */
-void QtxWorkstackArea::hide()
+void QtxWorkstack::setIcon( const int id, const QIcon& icon )
 {
-  QMap<QWidget*, bool> map;
-  for ( QWidgetListIt it( myList ); it.current(); ++it )
-  {
-    map.insert( it.current(), isBlocked( it.current() ) );
-    setBlocked( it.current(), true );
-  }
-
-  QWidget::hide();
+  if ( !myActionsMap.contains( id ) )
+    return;
 
-  for ( QWidgetListIt itr( myList ); itr.current(); ++itr )
-    setBlocked( itr.current(), map.contains( itr.current() ) ? map[itr.current()] : false );
+  myActionsMap[id]->setIcon( icon );
 }
 
 /*!
-  \return true if area is active
+  \brief Set actions to be visible in the context popup menu.
+  
+  Actions, which IDs are set in \a flags parameter, will be shown in the 
+  context popup menu. Other actions will not be shown.
+
+  \param flags ORed together actions flags
 */
-bool QtxWorkstackArea::isActive() const
+void QtxWorkstack::setMenuActions( const int flags )
 {
-  QtxWorkstack* ws = workstack();
-  if ( !ws )
-    return false;
-
-  return ws->activeArea() == this;
+  myActionsMap[SplitVertical]->setVisible( flags & SplitVertical );
+  myActionsMap[SplitHorizontal]->setVisible( flags & SplitHorizontal );
+  myActionsMap[Close]->setVisible( flags & Close );
+  myActionsMap[Rename]->setVisible( flags & Rename );
 }
 
 /*!
-  Update active state of tab bar
+  \brief Set actions to be visible in the context popup menu.
+  
+  Actions, which IDs are set in \a flags parameter, will be shown in the 
+  context popup menu. Other actions will not be shown.
+
+  \param flags ORed together actions flags
 */
-void QtxWorkstackArea::updateActiveState()
+int QtxWorkstack::menuActions() const
 {
-  myBar->setActive( isActive() );
+  int ret = 0;
+  ret = ret | ( myActionsMap[SplitVertical]->isVisible() ? SplitVertical : 0 );
+  ret = ret | ( myActionsMap[SplitHorizontal]->isVisible() ? SplitHorizontal : 0 );
+  ret = ret | ( myActionsMap[Close]->isVisible() ? Close : 0 );
+  ret = ret | ( myActionsMap[Rename]->isVisible() ? Rename : 0 );
+  return ret;
 }
 
 /*!
-  \return corresponding workstack
+  \brief Calculate sizes of the splitter widget for the workarea.
+  \internal
 */
-QtxWorkstack* QtxWorkstackArea::workstack() const
+static int positionSimple (QIntList& szList, const int nb, const int splitter_size,
+                           const int item_ind, const int item_rel_pos,
+                           const int need_pos, const int splitter_pos)
 {
-  QtxWorkstack* ws = 0;
-  QWidget* wid = parentWidget();
-  while ( wid && !ws )
-  {
-    if ( wid->inherits( "QtxWorkstack" ) )
-      ws = (QtxWorkstack*)wid;
-    wid = wid->parentWidget();
+  if (item_ind == 0) { // cannot move in this splitter
+    return (need_pos - splitter_pos);
   }
-  return ws;
+
+  int delta = 0;
+  int new_prev = 0;
+  int new_this = szList[item_ind];
+  int new_next = 0;
+
+  bool isToCheck = false;
+
+  if (need_pos < splitter_pos) {
+    // Set size of all previous workareas to zero <--
+    if (item_ind == nb - 1) {
+      // item iz last in the splitter, it will occupy all the splitter
+      new_this = splitter_size;
+    } else {
+      // recompute size of next items in splitter
+      new_next = (splitter_size - new_this) / (nb - item_ind - 1);
+    }
+    delta = need_pos - splitter_pos;
+
+  } else if (need_pos > (splitter_pos + splitter_size)) {
+    // Set size of all next workareas to zero -->
+    // recompute size of previous items in splitter
+    new_this = 0;
+    new_prev = (splitter_size - new_this) / item_ind;
+    delta = need_pos - (splitter_pos + splitter_size - new_this);
+
+  } else { // required position lays inside this splitter
+    // Move workarea inside splitter into required position <->
+    int new_item_rel_pos = need_pos - splitter_pos;
+    new_prev = new_item_rel_pos / item_ind;
+    if (need_pos < (splitter_pos + item_rel_pos)) {
+      // Make previous workareas smaller, next - bigger
+      // No problem to keep old size of the widget
+    } else {
+      // Make previous workareas bigger, next - smaller
+      if (new_this > splitter_size - new_item_rel_pos) {
+        new_this = splitter_size - new_item_rel_pos;
+      }
+      // jfa to do: in this case fixed size of next widgets could prevent right resizing
+      isToCheck = true;
+    }
+    if (item_ind == nb - 1) {
+      new_this = splitter_size - new_item_rel_pos;
+    } else {
+      new_next = (splitter_size - new_item_rel_pos - new_this) / (nb - item_ind - 1);
+    }
+    delta = 0;
+  }
+
+  setSizes (szList, item_ind, new_prev, new_this, new_next);
+  return delta;
 }
 
 /*!
-  Custom event filter
+  \brief Set position of the widget.
+
+  Called from SetRelativePosition() public method.
+
+  \param wid   widget to be moved
+  \param split currently processed splitter (goes from more common
+               to more particular splitter in recursion calls)
+  \param o     orientation of positioning
+  \param need_pos required position of the given widget in pixels
+               (from top/left side of workstack area)
+  \param splitter_pos position of the splitter \a split
+               (from top/left side of workstack area)
+  \return difference between a required and a distinguished position
 */
-bool QtxWorkstackArea::eventFilter( QObject* o, QEvent* e )
+int QtxWorkstack::setPosition( QWidget* wid, QSplitter* split, const Qt::Orientation o,
+                               const int need_pos, const int splitter_pos )
 {
-  if ( o->isWidgetType() )
+  if ( !wid || !split )
+    return need_pos - splitter_pos;
+
+  // Find corresponding sub-splitter.
+  // Find also index of appropriate item in current splitter.
+  int cur_ind = 0, item_ind = 0;
+  bool isBottom = false, isFound = false;
+  QSplitter* sub_split = NULL;
+  const QObjectList& objs = split->children();
+  for ( QObjectList::const_iterator it = objs.begin(); it != objs.end() && !isFound; ++it )
   {
-    QWidget* wid = (QWidget*)o;
-    if ( e->type() == QEvent::FocusIn || e->type() == QEvent::MouseButtonPress )
+    QtxWorkstackArea* area = ::qobject_cast<QtxWorkstackArea*>( *it );
+    if ( area )
     {
-      bool ok = false;
-      while ( !ok && wid && wid != myClose )
+      if ( area->contains( wid ) )
       {
-        ok = wid == this;
-        wid = wid->parentWidget();
+        item_ind = cur_ind;
+        isBottom = true;
+        isFound = true;
       }
-      if ( ok )
-        QApplication::postEvent( this, new QCustomEvent( (QEvent::Type)( e->type() == QEvent::FocusIn ? ActivateWidget : FocusWidget ) ) );
+      cur_ind++;
+    }
+    else if ( (*it)->inherits( "QSplitter" ) )
+    {
+      QList<QtxWorkstackArea*> areaList;
+      areas( (QSplitter*)(*it), areaList, true );
+      for ( QList<QtxWorkstackArea*>::iterator ita = areaList.begin(); ita != areaList.end() && !isFound; ++ita )
+      {
+        if ( (*ita)->contains( wid ) )
+        {
+          item_ind = cur_ind;
+          isFound = true;
+          sub_split = (QSplitter*)*it;
+        }
+      }
+      cur_ind++;
     }
   }
-  return false;
-}
 
-/*!
-  \return rectangle of area in order to draw drop rectangle on area
-*/
-QRect QtxWorkstackArea::floatRect() const
-{
-  QRect r = myStack->geometry();
-  return QRect( mapToGlobal( r.topLeft() ), mapToGlobal( r.bottomRight() ) );
-}
+  if ( !isFound )
+    return ( need_pos - splitter_pos );
+
+  if ( split->orientation() == o )
+  {
+    // Find coordinates of near and far sides of the appropriate item relatively current splitter
+    int splitter_size = ( o == Qt::Horizontal ? split->width() : split->height() );
+    QIntList szList = split->sizes();
+    int nb = szList.count();
+    int item_rel_pos = 0; // position of near side of item relatively this splitter
+    for (int i = 0; i < item_ind; i++) {
+      item_rel_pos += szList[i];
+    }
+    int item_size = szList[item_ind]; // size of item
+    int item_pos = splitter_pos + item_rel_pos;
+
+    // Resize splitter items to complete the conditions
+    if (isBottom) {
+      // I. Bottom of splitters stack reached
+
+      int delta = positionSimple(szList, nb, splitter_size, item_ind, item_rel_pos, need_pos, splitter_pos);
+      split->setSizes(szList);
+      // Recompute delta, as some windows can reject given size
+      int new_item_rel_pos = 0;
+      QIntList szList1 = split->sizes();
+      for (int i = 0; i < item_ind; i++) {
+        new_item_rel_pos += szList1[i];
+      }
+      delta = need_pos - (splitter_pos + new_item_rel_pos);
+      return delta;
+
+    } else {
+      // II. Bottom of splitters stack is not yet reached
+
+      if (item_ind == 0) { // cannot move in this splitter
+        // Process in sub-splitter
+        return setPosition(wid, sub_split, o, need_pos, splitter_pos);
+      }
+
+      int new_prev = 0;
+      int new_this = szList[item_ind];
+      int new_next = 0;
+
+      if (need_pos < splitter_pos) {
+        // Set size of all previous workareas to zero <--
+        if (item_ind == nb - 1) {
+          new_this = splitter_size;
+        } else {
+          new_next = (splitter_size - new_this) / (nb - item_ind - 1);
+        }
+        setSizes (szList, item_ind, new_prev, new_this, new_next);
+        split->setSizes(szList);
+        // Recompute splitter_pos, as some windows can reject given size
+        int new_item_rel_pos = 0;
+        QIntList szList1 = split->sizes();
+        for (int i = 0; i < item_ind; i++) {
+          new_item_rel_pos += szList1[i];
+        }
+        // Process in sub-splitter
+        return setPosition(wid, sub_split, o, need_pos, splitter_pos + new_item_rel_pos);
+      } else if (need_pos > (splitter_pos + splitter_size)) {
+        // Set size of all next workareas to zero -->
+        new_prev = (splitter_size - new_this) / item_ind;
+        setSizes (szList, item_ind, new_prev, new_this, new_next);
+        split->setSizes(szList);
+        // Recompute splitter_pos, as some windows can reject given size
+        int new_item_rel_pos = 0;
+        QIntList szList1 = split->sizes();
+        for (int i = 0; i < item_ind; i++) {
+          new_item_rel_pos += szList1[i];
+        }
+        // Process in sub-splitter
+        return setPosition(wid, sub_split, o, need_pos, splitter_pos + new_item_rel_pos);
+      } else {
+        // Set appropriate size of all previous/next items <->
+        int new_item_rel_pos = item_rel_pos;
+        if (need_pos < item_pos || (item_pos + item_size) < need_pos) {
+          // Move item inside splitter into required position <->
+          int new_this = szList[item_ind];
+          int new_next = 0;
+          new_item_rel_pos = need_pos - splitter_pos;
+          if ((item_pos + item_size) < need_pos) {
+            //new_item_rel_pos = need_pos - (item_pos + item_size);
+            new_item_rel_pos = item_rel_pos + (need_pos - (item_pos + item_size));
+          }
+          int new_prev = new_item_rel_pos / item_ind;
+          if (need_pos < (splitter_pos + item_rel_pos)) {
+            // Make previous workareas smaller, next - bigger
+            // No problem to keep old size of the widget
+          } else {
+            // Make previous workareas bigger, next - smaller
+            if (new_this > splitter_size - new_item_rel_pos) {
+              new_this = splitter_size - new_item_rel_pos;
+            }
+          }
+          if (item_ind == nb - 1) {
+            new_this = splitter_size - new_item_rel_pos;
+          } else {
+            new_next = (splitter_size - new_item_rel_pos - new_this) / (nb - item_ind - 1);
+          }
+          setSizes (szList, item_ind, new_prev, new_this, new_next);
+          split->setSizes(szList);
+          // Recompute new_item_rel_pos, as some windows can reject given size
+          new_item_rel_pos = 0;
+          QIntList szList1 = split->sizes();
+          for (int i = 0; i < item_ind; i++) {
+            new_item_rel_pos += szList1[i];
+          }
+        } else {
+          // Do nothing
+        }
+        // Process in sub-splitter
+        int add_pos = setPosition(wid, sub_split, o, need_pos, splitter_pos + new_item_rel_pos);
+        if (add_pos == 0)
+          return 0;
 
-/*!
-  \return rectangle of tab in order to draw drop rectangle on tab
-  \param idx - tab index
-*/
-QRect QtxWorkstackArea::floatTab( const int idx ) const
-{
-  return myBar->tabRect( idx );
-}
+        // this can be if corresponding workarea is first in sub-splitter
+        // or sub-splitter has another orientation
 
-/*!
-  \return tab covering point 
-  \param p - point
-*/
-int QtxWorkstackArea::tabAt( const QPoint& p ) const
-{
-  int idx = -1;
-  for ( int i = 0; i < myBar->count() && idx == -1; i++ )
-  {
-    QRect r = myBar->tabRect( i );
-    if ( r.isValid() && r.contains( p ) )
-      idx = i;
-  }
-  return idx;
-}
+        // Resize ones again to reach precize position <->
+        int need_pos_1 = splitter_pos + new_item_rel_pos + add_pos;
 
-/*!
-  Event handler for custom events
-*/
-void QtxWorkstackArea::customEvent( QCustomEvent* e )
-{
-  switch ( e->type() )
-  {
-  case ActivateWidget:
-    emit activated( activeWidget() );
-    break;
-  case FocusWidget:
-    if ( activeWidget() )
-    {
-      if ( !activeWidget()->focusWidget() )
-        activeWidget()->setFocus();
-      else {
-        if ( activeWidget()->focusWidget()->hasFocus()) {
-          QFocusEvent in(QEvent::FocusIn);
-         QApplication::sendEvent(this, &in);
-       }
-        else
-          activeWidget()->focusWidget()->setFocus();
+        // Move workarea inside splitter into required position <->
+        int delta_1 = positionSimple(szList, nb, splitter_size, item_ind,
+                                     new_item_rel_pos, need_pos_1, splitter_pos);
+        split->setSizes(szList);
+        // Recompute new_item_rel_pos, as some windows can reject given size
+        new_item_rel_pos = 0;
+        QIntList szList1 = split->sizes();
+        for (int i = 0; i < item_ind; i++) {
+          new_item_rel_pos += szList1[i];
+        }
+        delta_1 = need_pos_1 - (splitter_pos + new_item_rel_pos);
+        return delta_1;
       }
     }
-    break;
-  case RemoveWidget:
-    removeWidget( (QWidget*)e->data() );
-    break;
+  } else {
+    return setPosition(wid, sub_split, o, need_pos, splitter_pos);
   }
-}
-
-/*!
-  Custom focus in event handler
-*/
-void QtxWorkstackArea::focusInEvent( QFocusEvent* e )
-{
-  QWidget::focusInEvent( e );
 
-  emit activated( activeWidget() );
+  return 0;
 }
 
 /*!
-  Custom mouse press event handler
+  \brief Redistribute space among widgets equally.
+  \param split splitter
 */
-void QtxWorkstackArea::mousePressEvent( QMouseEvent* e )
+void QtxWorkstack::distributeSpace( QSplitter* split ) const
 {
-  QWidget::mousePressEvent( e );
+  if ( !split )
+    return;
 
-  emit activated( activeWidget() );
+  QIntList szList = split->sizes();
+  int size = ( split->orientation() == Qt::Horizontal ?
+               split->width() : split->height() ) / szList.count();
+  for ( QIntList::iterator it = szList.begin(); it != szList.end(); ++it )
+    *it = size;
+  split->setSizes( szList );
 }
 
 /*!
-  SLOT: called if button close is pressed
+  \brief Split widgets vertically.
 */
-void QtxWorkstackArea::onClose()
+void QtxWorkstack::splitVertical()
 {
-  QWidget* wid = activeWidget();
-  if ( wid )
-    wid->close();
+  split( Qt::Horizontal );
 }
 
 /*!
-  SLOT: called if tab page is selected
+  \brief Split widgets horizontally.
 */
-void QtxWorkstackArea::onSelected( int id )
+void QtxWorkstack::splitHorizontal()
 {
-  updateCurrent();
-
-  emit activated( activeWidget() );
+  split( Qt::Vertical );
 }
 
 /*!
-  SLOT: called if active tab page is dragged
+  \brief Called when user activates "Rename" menu item.
+
+  Changes widget title.
 */
-void QtxWorkstackArea::onDragActiveTab()
+void QtxWorkstack::onRename()
 {
-  QtxWorkstackChild* c = child( activeWidget() );
-  if ( !c )
+  if ( !myWorkWin )
     return;
 
-  new QtxWorkstackDrag( workstack(), c );
+  bool ok = false;
+  QString newName = QInputDialog::getText( topLevelWidget(),  tr( "Rename" ), tr( "Enter new name:" ),
+                                           QLineEdit::Normal, myWorkWin->windowTitle(), &ok );
+  if ( ok && !newName.isEmpty() )
+    myWorkWin->setWindowTitle( newName );
 }
 
 /*!
-  SLOT: called on child is destroyed, removes from area
+  \brief Wrap area into the new splitter.
+  \param workarea
+  \return new splitter
 */
-void QtxWorkstackArea::onChildDestroyed( QObject* obj )
+QSplitter* QtxWorkstack::wrapSplitter( QtxWorkstackArea* area )
 {
-  QtxWorkstackChild* child = (QtxWorkstackChild*)obj;
-  myStack->removeWidget( child );
+  if ( !area )
+    return 0;
 
-  QWidget* wid = 0;
-  for ( ChildMap::ConstIterator it = myChild.begin(); it != myChild.end() && !wid; ++it )
-  {
-    if ( it.data() == child )
-      wid = it.key();
-  }
+  QSplitter* pSplit = splitter( area );
+  if ( !pSplit )
+    return 0;
 
-  myChild.remove( wid );
+  bool upd = pSplit->updatesEnabled();
+  pSplit->setUpdatesEnabled( false );
 
-  QApplication::postEvent( this, new QCustomEvent( (QEvent::Type)RemoveWidget, wid ) );
-}
+  QIntList szList = pSplit->sizes();
 
-/*!
-  SLOT: called on child is shown
-*/
-void QtxWorkstackArea::onChildShown( QtxWorkstackChild* c )
-{
-  setWidgetShown( c->widget(), true );
-}
+  QSplitter* wrap = new QSplitter( 0 );
+  wrap->setChildrenCollapsible( false );
+  pSplit->insertWidget( pSplit->indexOf( area ) + 1, wrap );
+  wrap->setVisible( true );
+  wrap->addWidget( area );
 
-/*!
-  SLOT: called on child is hidden
-*/
-void QtxWorkstackArea::onChildHided( QtxWorkstackChild* c )
-{
-  setWidgetShown( c->widget(), false );
-}
+  pSplit->setSizes( szList );
 
-/*!
-  SLOT: called on child is activated
-*/
-void QtxWorkstackArea::onChildActivated( QtxWorkstackChild* c )
-{
-  setWidgetActive( c->widget() );
-}
+  pSplit->setUpdatesEnabled( upd );
 
-/*!
-  SLOT: called on child caption is changed
-*/
-void QtxWorkstackArea::onChildCaptionChanged( QtxWorkstackChild* c )
-{
-  updateTab( c->widget() );
+  return wrap;
 }
 
 /*!
-  Raises widget when active tab is changed
+  \brief Reparent and add widget.
+  \param wid widget
+  \param pWid parent widget
+  \param after widget after which \a wid should be added
 */
-void QtxWorkstackArea::updateCurrent()
+void QtxWorkstack::insertWidget( QWidget* wid, QWidget* pWid, QWidget* after )
 {
-  QMap<QWidget*, bool> map;
-  for ( QWidgetListIt it( myList ); it.current(); ++it )
+  if ( !wid || !pWid )
+    return;
+
+  QWidgetList moveList;
+  const QObjectList& lst = pWid->children();
+  bool found = false;
+  for ( QObjectList::const_iterator it = lst.begin(); it != lst.end(); ++it )
   {
-    map.insert( it.current(), isBlocked( it.current() ) );
-    setBlocked( it.current(), true );
+    if ( found && ( (*it)->inherits( "QSplitter" ) ||
+                    (*it)->inherits( "QtxWorkstackArea" ) ) )
+      moveList.append( (QWidget*)(*it) );
+    if ( *it == after )
+      found = true;
   }
 
-  myStack->raiseWidget( myBar->currentTab() );
-
-  for ( QWidgetListIt itr( myList ); itr.current(); ++itr )
-    setBlocked( itr.current(), map.contains( itr.current() ) ? map[itr.current()] : false );
-}
-
-/*!
-  Updates tab
-  \param wid - tab widget
-*/
-void QtxWorkstackArea::updateTab( QWidget* wid )
-{
-  QTab* tab = myBar->tab( widgetId( wid ) );
-  if ( !tab )
-    return;
-
-  QIconSet icoSet;
-  if ( wid->icon() )
+  QMap<QWidget*, bool> map;
+  for ( QWidgetList::iterator it = moveList.begin(); it != moveList.end(); ++it )
   {
-    QPixmap pix = *wid->icon();
-    pix.convertFromImage( pix.convertToImage().smoothScale( pix.width(), 16, QImage::ScaleMin ) );
-    icoSet = QIconSet( pix );
+    map.insert( *it, (*it)->isVisibleTo( (*it)->parentWidget() ) );
+    (*it)->setParent( 0 );
+    (*it)->hide();
   }
 
-  tab->setIconSet( icoSet );
-  tab->setText( wid->caption() );
-}
+  wid->setParent( pWid );
 
-/*!
-  \return widget
-  \param id - widget id
-*/
-QWidget* QtxWorkstackArea::widget( const int id ) const
-{
-  QWidget* wid = 0;
-  for ( WidgetInfoMap::ConstIterator it = myInfo.begin(); it != myInfo.end() && !wid; ++it )
+  for ( QWidgetList::iterator itr = moveList.begin(); itr != moveList.end(); ++itr )
   {
-    if ( it.data().id == id )
-      wid = it.key();
+    (*itr)->setParent( pWid );
+    (*itr)->setShown( map.contains( *itr ) ? map[*itr] : false );
   }
-  return wid;
 }
 
 /*!
-  \return widget id
-  \param wid - widget
+  \brief Close active window.
 */
-int QtxWorkstackArea::widgetId( QWidget* wid ) const
+void QtxWorkstack::onCloseWindow()
 {
-  int id = -1;
-  if ( myInfo.contains( wid ) )
-    id = myInfo[wid].id;
-  return id;
+  if ( myWorkWin )
+    myWorkWin->close();
+  else if( activeWindow() )
+    activeWindow()->close();
 }
 
 /*!
-  \return true if widget is visible
-  \param wid - widget
-*/
-bool QtxWorkstackArea::widgetVisibility( QWidget* wid ) const
-{
-  bool res = false;
-  if ( myInfo.contains( wid ) )
-    res = myInfo[wid].vis;
-  return res;
-}
+  \brief Called when workarea is destroyed.
 
-/*!
-  Sets widget as active
-  \param wid - widget
+  Set input focus to the neighbour area.
+
+  \param obj workarea being destroyed
 */
-void QtxWorkstackArea::setWidgetActive( QWidget* wid )
+void QtxWorkstack::onDestroyed( QObject* obj )
 {
-  int id = widgetId( wid );
-  if ( id < 0 )
-    return;
+  QtxWorkstackArea* area = (QtxWorkstackArea*)obj;
+
+  if ( area == myArea )
+    myArea = 0;
+
+  if ( !myArea )
+  {
+    QtxWorkstackArea* cur = neighbourArea( area );
+    if ( cur )
+      cur->setFocus();
+  }
 
-  myBar->setCurrentTab( id );
+  QApplication::postEvent( this, new QEvent( QEvent::User ) );
 }
 
 /*!
-  Shows/hides widget
-  \param wid - widget
-  \param on - new shown state
+  \brief Called on window activating.
+  \param area workarea being activated (not used)
 */
-void QtxWorkstackArea::setWidgetShown( QWidget* wid, const bool on )
+void QtxWorkstack::onWindowActivated( QWidget* /*area*/ )
 {
-  if ( isBlocked( wid ) || !myInfo.contains( wid ) || myInfo[wid].vis == on )
+  const QObject* obj = sender();
+  if ( !obj->inherits( "QtxWorkstackArea" ) )
     return;
 
-  myInfo[wid].vis = on;
-  updateState();
+  setActiveArea( (QtxWorkstackArea*)obj );
 }
 
 /*!
-  Update
+  \brief Called on window deactivating.
+  \param area workarea being deactivated
 */
-void QtxWorkstackArea::updateState()
+void QtxWorkstack::onDeactivated( QtxWorkstackArea* area )
 {
-  bool updBar = myBar->isUpdatesEnabled();
-  bool updStk = myStack->isUpdatesEnabled();
-  myBar->setUpdatesEnabled( false );
-  myStack->setUpdatesEnabled( false );
-
-  bool block = myBar->signalsBlocked();
-  myBar->blockSignals( true );
-
-  QWidget* prev = activeWidget();
+  if ( myArea != area )
+    return;
 
-  int idx = 0;
-  for ( QWidgetListIt it( myList ); it.current(); ++it )
-  {
-    QWidget* wid = it.current();
-    int id = widgetId( wid );
+  QList<QtxWorkstackArea*> lst;
+  areas( mySplit, lst, true );
 
-    if ( id < 0 )
-      continue;
+  int idx = lst.indexOf( area );
+  if ( idx == -1 )
+    return;
 
-    bool vis = widgetVisibility( wid );
+  myWin = 0;
+  myArea = 0;
 
-    if ( myBar->tab( id ) && ( !vis || myBar->indexOf( id ) != idx ) )
-      myBar->removeTab( myBar->tab( id ) );
+  QtxWorkstackArea* newArea = neighbourArea( area );
+  if ( newArea && newArea->activeWidget() )
+    newArea->activeWidget()->setFocus();
 
-    if ( !myBar->tab( id ) && vis )
-    {
-      QTab* tab = new QTab( wid->caption() );
-      myBar->insertTab( tab, idx );
-      tab->setIdentifier( id );
-    }
+  QApplication::postEvent( this, new QEvent( QEvent::User ) );
+}
 
-    updateTab( wid );
+/*!
+  \brief Create and show popup menu for workarea.
+  \param w workarea
+  \param p popup position
+*/
+void QtxWorkstack::onContextMenuRequested( QWidget* w, QPoint p )
+{
+  QtxWorkstackArea* anArea = ::qobject_cast<QtxWorkstackArea*>( (QObject*)sender() );
+  if ( !anArea )
+    anArea = activeArea();
 
-    bool block = isBlocked( wid );
-    setBlocked( wid, true );
+  if ( !anArea )
+    return;
 
-    QtxWorkstackChild* cont = child( wid );
+  QWidgetList lst = anArea->widgetList();
+  if ( lst.isEmpty() )
+    return;
 
-    if ( !vis )
-      myStack->removeWidget( cont );
-    else if ( !myStack->widget( id ) )
-      myStack->addWidget( cont, id );
+  myWorkWin = w;
+  myWorkArea = anArea;
 
-    if ( vis )
-      idx++;
+  QMenu* pm = new QMenu();
 
-    setBlocked( wid, block );
+  if ( lst.count() > 1 )
+  {
+    if ( myActionsMap[SplitVertical]->isEnabled() )
+      pm->addAction( myActionsMap[SplitVertical] );
+    if ( myActionsMap[SplitHorizontal]->isEnabled() )
+      pm->addAction( myActionsMap[SplitHorizontal] );
+    pm->addSeparator();
   }
 
-  int curId = widgetId( prev );
-  if ( !myBar->tab( curId ) )
+  if ( w )
   {
-    QWidget* wid = 0;
-    int pos = myList.find( prev );
-    for ( int i = pos - 1; i >= 0 && !wid; i-- )
-    {
-      if ( widgetVisibility( myList.at( i ) ) )
-        wid = myList.at( i );
-    }
-
-    for ( int j = pos + 1; j < (int)myList.count() && !wid; j++ )
-    {
-      if ( widgetVisibility( myList.at( j ) ) )
-        wid = myList.at( j );
-    }
-
-    if ( wid )
-      curId = widgetId( wid );
+    if ( myActionsMap[Close]->isEnabled() )
+      pm->addAction( myActionsMap[Close] );
+    if ( myActionsMap[Rename]->isEnabled() )
+      pm->addAction( myActionsMap[Rename] );
   }
 
-  myBar->setCurrentTab( curId );
+  Qtx::simplifySeparators( pm );
 
-  myBar->blockSignals( block );
+  if ( !pm->actions().isEmpty() )
+    pm->exec( p );
 
-  updateCurrent();
+  delete pm;
 
-  myBar->setUpdatesEnabled( updBar );
-  myStack->setUpdatesEnabled( updStk );
-  if ( updBar )
-    myBar->update();
-  if ( updStk )
-    myStack->update();
+  myWorkWin = 0;
+  myWorkArea = 0;
+}
 
-  QResizeEvent re( myBar->size(), myBar->size() );
-  QApplication::sendEvent( myBar, &re );
+/*!
+  \brief Add child widget.
+  \param w widget
+  \param f widget flags
+  \return child widget container
+*/
+QWidget* QtxWorkstack::addWindow( QWidget* w, Qt::WindowFlags f )
+{
+  if ( !w )
+    return 0;
 
-  if ( isEmpty() )
-  {
-    hide();
-    emit deactivated( this );
-  }
-  else
-  {
-    show();
-    if ( prev != activeWidget() )
-      emit activated( activeWidget() );
-  }
+  return targetArea()->insertWidget( w, -1, f );
 }
 
 /*!
-  \return first unshared widget id
+  \brief Handle custom events.
+  \param e custom event (not used)
 */
-int QtxWorkstackArea::generateId() const
+void QtxWorkstack::customEvent( QEvent* /*e*/ )
 {
-  QMap<int, int> map;
+  updateState();
+}
 
-  for ( WidgetInfoMap::ConstIterator it = myInfo.begin(); it != myInfo.end(); ++it )
-    map.insert( it.data().id, 0 );
+/*!
+  \brief Get splitter corresponding to the workarea.
+  \param workarea
+  \return splitter corresponding to the workarea
+*/
+QSplitter* QtxWorkstack::splitter( QtxWorkstackArea* area ) const
+{
+  if ( !area )
+    return 0;
 
-  int id = 0;
-  while ( map.contains( id ) )
-    id++;
+  QSplitter* split = 0;
 
-  return id;
+  QWidget* wid = area->parentWidget();
+  if ( wid && wid->inherits( "QSplitter" ) )
+    split = (QSplitter*)wid;
+
+  return split;
 }
 
 /*!
-  \return true if widget is blocked
-  \param wid - widget
+  \brief Get list of child splitters.
+  \param split parent splitter
+  \param splitList list to be filled with child splitters
+  \param rec if \c true, perform recursive search of children
 */
-bool QtxWorkstackArea::isBlocked( QWidget* wid ) const
+void QtxWorkstack::splitters( QSplitter* split, QList<QSplitter*>& splitList, const bool rec ) const
 {
-  return myBlock.contains( wid );
+  if ( !split )
+    return;
+
+  const QObjectList& objs = split->children();
+  for ( QObjectList::const_iterator it = objs.begin(); it != objs.end(); ++it )
+  {
+    if ( rec )
+      splitters( (QSplitter*)*it, splitList, rec );
+    if ( (*it)->inherits( "QSplitter" ) )
+      splitList.append( (QSplitter*)*it );
+  }
 }
 
 /*!
-  Blocks widget
-  \param wid - widget
-  \param on - new blocked state
+  \brief Get list of child workareas.
+  \param split parent splitter
+  \param areaList list to be filled with child workareas
+  \param rec if \c true, perform recursive search of children
 */
-void QtxWorkstackArea::setBlocked( QWidget* wid, const bool on )
+void QtxWorkstack::areas( QSplitter* split, QList<QtxWorkstackArea*>& areaList, const bool rec ) const
 {
-  if ( on )
-    myBlock.insert( wid, 0 );
-  else
-    myBlock.remove( wid );
+  if ( !split )
+    return;
+
+  const QObjectList& objs = split->children();
+  for ( QObjectList::const_iterator it = objs.begin(); it != objs.end(); ++it )
+  {
+    if ( (*it)->inherits( "QtxWorkstackArea" ) )
+      areaList.append( (QtxWorkstackArea*)*it );
+    else if ( rec && (*it)->inherits( "QSplitter" ) )
+      areas( (QSplitter*)*it, areaList, rec );
+  }
 }
 
 /*!
-  \return child corresponding to widget
-  \param wid - widget
+  \brief Get active workarea.
+  \return active workarea
 */
-QtxWorkstackChild* QtxWorkstackArea::child( QWidget* wid ) const
+QtxWorkstackArea* QtxWorkstack::activeArea() const
 {
-  QtxWorkstackChild* res = 0;
-  if ( myChild.contains( wid ) )
-    res = myChild[wid];
-  return res;
+  return myArea;
 }
 
 /*!
-  Constructor
+  \brief Get target area (for which the current operation should be done).
+
+  Returns active workarea or current area (if there is no active workarea).
+  If there are no workareas, create new workarea and return it.
+
+  \return workarea
 */
-QtxWorkstackChild::QtxWorkstackChild( QWidget* wid, QWidget* parent )
-: QHBox( parent ),
-myWidget( wid )
+QtxWorkstackArea* QtxWorkstack::targetArea()
 {
-  myWidget->reparent( this, QPoint( 0, 0 ), myWidget->isVisibleTo( myWidget->parentWidget() ) );
-  myWidget->installEventFilter( this );
+  QtxWorkstackArea* area = activeArea();
+  if ( !area )
+    area = currentArea();
+  if ( !area )
+  {
+    QList<QtxWorkstackArea*> lst;
+    areas( mySplit, lst );
+    if ( !lst.isEmpty() )
+      area = lst.first();
+  }
 
-  connect( myWidget, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+  if ( !area )
+    area = createArea( mySplit );
+
+  return area;
 }
 
 /*!
-  Destructor
+  \brief Get current workarea.
+
+  Current workarea is that one which has input focus.
+
+  \return current area
 */
-QtxWorkstackChild::~QtxWorkstackChild()
+QtxWorkstackArea* QtxWorkstack::currentArea() const
 {
-  qApp->removeEventFilter( this );
-
-  if ( !widget() )
-    return;
+  QtxWorkstackArea* area = 0;
+  QWidget* wid = focusWidget();
+  while ( wid && !area )
+  {
+    if ( wid->inherits( "QtxWorkstackArea" ) )
+      area = (QtxWorkstackArea*)wid;
+    wid = wid->parentWidget();
+  }
 
-  widget()->removeEventFilter( this );
-  widget()->reparent( 0, QPoint( 0, 0 ), false );
-  disconnect( widget(), SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+  return area;
 }
 
 /*!
-  \return corresponding widget
+  \brief Create new workarea.
+  \param parent parent widget
+  \return created workarea
 */
-QWidget* QtxWorkstackChild::widget() const
+QtxWorkstackArea* QtxWorkstack::createArea( QWidget* parent ) const
 {
-  return myWidget;
+  QtxWorkstackArea* area = new QtxWorkstackArea( parent );
+
+  connect( area, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+  connect( area, SIGNAL( activated( QWidget* ) ), this, SLOT( onWindowActivated( QWidget* ) ) );
+  connect( area, SIGNAL( contextMenuRequested( QWidget*, QPoint ) ),
+          this, SLOT( onContextMenuRequested( QWidget*, QPoint ) ) );
+  connect( area, SIGNAL( deactivated( QtxWorkstackArea* ) ), this, SLOT( onDeactivated( QtxWorkstackArea* ) ) );
+
+  return area;
 }
 
 /*!
-  Custom event filter
+  \brief Set active workarea.
+  \param workarea
 */
-bool QtxWorkstackChild::eventFilter( QObject* o, QEvent* e )
+void QtxWorkstack::setActiveArea( QtxWorkstackArea* area )
 {
-  if ( o->isWidgetType() )
-  {
-    if ( e->type() == QEvent::CaptionChange || e->type() == QEvent::IconChange )
-      emit captionChanged( this );
+  QWidget* oldCur = myWin;
 
-    if ( !e->spontaneous() && ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ) )
-      emit shown( this );
+  QtxWorkstackArea* oldArea = myArea;
 
-    if ( !e->spontaneous() && ( e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ) )
-      emit hided( this );
+  myArea = area;
 
-    if ( e->type() == QEvent::FocusIn )
-      emit activated( this );
+  if ( myArea != oldArea )
+  {
+    if ( oldArea )
+      oldArea->updateActiveState();
+    if ( myArea )
+      myArea->updateActiveState();
   }
-  return QHBox::eventFilter( o, e );
-}
 
-/*!
-  SLOT: called on object is destroyed
-*/
-void QtxWorkstackChild::onDestroyed( QObject* obj )
-{
-  if ( obj != widget() )
-    return;
+  if ( myArea )
+    myWin = myArea->activeWidget();
 
-  myWidget = 0;
-  deleteLater();
+  if ( myWin && oldCur != myWin )
+    emit windowActivated( myWin );
 }
 
 /*!
-  Custom child event handler
+  \brief Get workarea which is nearest to \a area.
+  \param area area for which neighbour is searched
+  \return neighbour area (or 0 if not found)
 */
-void QtxWorkstackChild::childEvent( QChildEvent* e )
+QtxWorkstackArea* QtxWorkstack::neighbourArea( QtxWorkstackArea* area ) const
 {
-  if ( e->type() == QEvent::ChildRemoved && e->child() == widget() )
+  QList<QtxWorkstackArea*> lst;
+  areas( mySplit, lst, true );
+  int pos = lst.indexOf( area );
+  if ( pos < 0 )
+    return 0;
+
+  QtxWorkstackArea* na = 0;
+  for ( int i = pos - 1; i >= 0 && !na; i-- )
   {
-    myWidget = 0;
-    deleteLater();
+    if ( !lst.at( i )->isEmpty() )
+      na = lst.at( i );
+  }
+
+  for ( int j = pos + 1; j < (int)lst.count() && !na; j++ )
+  {
+    if ( !lst.at( j )->isEmpty() )
+        na = lst.at( j );
   }
-  QHBox::childEvent( e );
+  return na;
 }
 
 /*!
-  Constructor
+  \brief Get workarea covering point.
+  \return workarea
+  \param p point
 */
-QtxWorkstackTabBar::QtxWorkstackTabBar( QWidget* parent )
-: QTabBar( parent ),
-myId( -1 )
+QtxWorkstackArea* QtxWorkstack::areaAt( const QPoint& p ) const
 {
+  QtxWorkstackArea* area = 0;
+  QList<QtxWorkstackArea*> lst;
+  areas( mySplit, lst, true );
+  for ( QList<QtxWorkstackArea*>::iterator it = lst.begin(); it != lst.end() && !area; ++it )
+  {
+    QtxWorkstackArea* cur = *it;
+    QRect r = cur->geometry();
+    if ( cur->parentWidget() )
+      r = QRect( cur->parentWidget()->mapToGlobal( r.topLeft() ), r.size() );
+    if ( r.contains( p ) )
+      area = cur;
+  }
+  return area;
 }
 
 /*!
-  Destructor
+  \brief Update internal state.
 */
-QtxWorkstackTabBar::~QtxWorkstackTabBar()
+void QtxWorkstack::updateState()
 {
+  updateState( mySplit );
 }
 
 /*!
-  Sets tab bar as active or inactive
-  \param on - new active state
+  \brief Update splitter state.
+  \param split splitter to be updated
 */
-void QtxWorkstackTabBar::setActive( const bool on )
+void QtxWorkstack::updateState( QSplitter* split )
 {
-  QFont aFont = font();
-  aFont.setUnderline( on );
-  QColorGroup aColGrp;
-  QPalette aPal = palette();
-  if ( !on ) {
-    aPal.setColor( QColorGroup::HighlightedText, aColGrp.foreground() );
-    aPal.setColor( QColorGroup::Highlight, colorGroup().dark().light( DARK_COLOR_LIGHT ) );
-    setPalette( aPal );
-  }
-  else {
-    aPal.setColor( QColorGroup::HighlightedText, aColGrp.highlightedText() );
-    aPal.setColor( QColorGroup::Highlight, aColGrp.highlight() );
-    unsetPalette();
+  QList<QSplitter*> recList;
+  splitters( split, recList, false );
+  for ( QList<QSplitter*>::iterator itr = recList.begin(); itr != recList.end(); ++itr )
+    updateState( *itr );
+
+  QList<QSplitter*> splitList;
+  splitters( split, splitList, false );
+
+  QList<QtxWorkstackArea*> areaList;
+  areas( split, areaList, false );
+
+  bool vis = false;
+  for ( QList<QtxWorkstackArea*>::iterator it = areaList.begin(); it != areaList.end(); ++it )
+  {
+    if ( (*it)->isEmpty() )
+      (*it)->hide();
+    else
+    {
+      (*it)->show();
+      vis = true;
+    }
   }
-  setFont( aFont );
 
-  update();
+  if ( split == mySplit )
+    return;
+
+  for ( QList<QSplitter*>::iterator iter = splitList.begin(); iter != splitList.end() && !vis; ++iter )
+    vis = (*iter)->isVisibleTo( (*iter)->parentWidget() );
+
+  if ( areaList.isEmpty() && splitList.isEmpty() )
+    delete split;
+  else if ( vis )
+    split->show();
+  else
+    split->hide();
 }
 
 /*!
-  \return tab rectangle
-  \param idx - tab index
+  \brief Get splitter info (for debug purposes)
+  \param split splitter
+  \param info string to be filled with splitter data.
 */
-QRect QtxWorkstackTabBar::tabRect( const int idx ) const
+void QtxWorkstack::splitterInfo( QSplitter* split, QString& info ) const
 {
-  QRect r;
-  QTab* t = tabAt( idx );
-  if ( t )
-  {
-    r = t->rect();
-    r.setLeft( QMAX( r.left(), 0 ) );
+  if ( !split )
+    return;
 
-    int x1 = tabAt( 0 )->rect().left();
-    int x2 = tabAt( count() - 1 )->rect().right();
+  /*const QObjectList& objs = */split->children(); // VSR: is it needed ???
 
-    int bw = 0;
-    if ( QABS( x2 - x1 ) > width() )
-#if defined QT_VERSION && QT_VERSION >= 0x30300
-      bw = 2 * style().pixelMetric( QStyle::PM_TabBarScrollButtonWidth, this );
-#else
-      bw = 2 * 16;
-#endif
+  QString sizesStr;
+  QList<int> sizes = split->sizes();
+  for ( QList<int>::iterator sIt = sizes.begin(); sIt != sizes.end(); ++sIt )
+  {
+    if ( *sIt > 1 ) // size 1 pixel usually means empty Workstack area, which will NOT be re-created,
+           sizesStr += QString( ":%1" ).arg( *sIt );  // so we don't need to store its size
+  }
 
-    int limit = width() - bw;
-    r.setRight( QMIN( r.right(), limit ) );
+  if ( !sizesStr.isEmpty() ) // cut the first ':'
+    sizesStr = sizesStr.right( sizesStr.length() - 1 );
 
-    r = QRect( mapToGlobal( r.topLeft() ), r.size() );
-  }
-  return r;
-}
+  info += QString( "(splitter orientation=%1 sizes=%3 " ).arg( split->orientation() ).arg( sizesStr );
 
-/*!
-  Custom mouse move event handler
-*/
-void QtxWorkstackTabBar::mouseMoveEvent( QMouseEvent* e )
-{
-  if ( myId != -1 && !tab( myId )->rect().contains( e->pos() ) )
+  for( int index = 0, count = split->count(); index < count; index++ )
   {
-    myId = -1;
-    emit dragActiveTab();
+    QObject* obj = split->widget( index );
+    if ( obj->inherits( "QSplitter" ) )
+           splitterInfo( (QSplitter*)obj, info );
+    else if ( obj->inherits( "QtxWorkstackArea" ) )
+    {
+           QtxWorkstackArea* area = (QtxWorkstackArea*)obj;
+           if ( area->isEmpty() )
+             continue;
+           info += QString( "(views active='%1'" ).arg( area->activeWidget()->objectName() );
+           QWidgetList views = area->widgetList();
+      for ( QWidgetList::iterator wIt = views.begin(); wIt != views.end(); ++wIt )
+             info += QString( " '%1'" ).arg( (*wIt)->objectName() );
+           info += ')';
+    }
   }
 
-  QTabBar::mouseMoveEvent( e );
+  info += ')';
+  printf( (const char*)QString( info + '\n' ).toLatin1() );
 }
 
 /*!
-  Custom mouse press event handler
+  \brief Remove round brackets symbols from the string.
+  \internal
+  \param parameters string to be processed
 */
-void QtxWorkstackTabBar::mousePressEvent( QMouseEvent* e )
+static void cutBrackets( QString& parameters )
 {
-  QTabBar::mousePressEvent( e );
-
-  if ( e->button() == LeftButton )
-    myId = currentTab();
+  QChar c1 = parameters[0];
+  QChar c2 = parameters[int(parameters.length()-1)];
+  if ( !parameters.isEmpty() && c1 == '(' && c2 == ')' )
+    parameters = parameters.mid( 1, parameters.length()-2 );
 }
 
 /*!
-  Custom mouse release event handler
-*/
-void QtxWorkstackTabBar::mouseReleaseEvent( QMouseEvent* e )
-{
-  QTabBar::mouseReleaseEvent( e );
-
-  myId = -1;
-
-  if ( e->button() == RightButton )
-    emit contextMenuRequested( e->globalPos() );
-}
+  \brief Parse string to get some parameter value.
+  \internal
 
-/*!
-  Custom context menu event handler
-*/
-void QtxWorkstackTabBar::contextMenuEvent( QContextMenuEvent* e )
-{
-  if ( e->reason() != QContextMenuEvent::Mouse )
-    emit contextMenuRequested( e->globalPos() );
-}
+  String \a str can contain the parameters description of kind "<param>=<value> ...".
+  For example:
+  \code
+  QString s = "splitter orientation=0 children=2 sizes=332:478";
+  QString orient_val = getValue( s, "children" ); // orient_val contains "2"
+  QString size_val   = getValue( s, "sizes" );    // val contains "332:478"
+  \endcode
 
-/*!
-  Draws label of tab bar
+  \param str string to be processed
+  \param valName parameter name
+  \return parameter value (or null QStrinhg if parameter is not found)
 */
-void QtxWorkstackTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const
+static QString getValue( const QString& str, const QString& valName )
 {
-  if ( currentTab() != t->identifier() )
+  int i = str.indexOf( valName );
+  if ( i != -1 )
   {
-    QFont fnt = p->font();
-    fnt.setUnderline( false );
-    p->setFont( fnt );
+    int equal_i = str.indexOf( '=', i );
+    if ( equal_i != -1 )
+    {
+      int space_i = str.indexOf( ' ', ++equal_i );
+      if ( space_i != -1 )
+             return str.mid( equal_i, space_i - equal_i );
+    }
   }
-  QTabBar::paintLabel( p, br, t, has_focus );
+  return QString();
 }
 
 /*!
-  Constructor
+  \brief Check format of splitter parameters string.
+  \internal
+  \param parameters splitter parameters description
+  \return \c true on success and \c false on error
 */
-QtxWorkstackDrag::QtxWorkstackDrag( QtxWorkstack* ws, QtxWorkstackChild* child )
-: QObject( 0 ),
-myWS( ws ),
-myTab( -1 ),
-myArea( 0 ),
-myPainter( 0 ),
-myChild( child )
+static bool checkFormat( const QString& parameters )
 {
-  qApp->installEventFilter( this );
+  QString params( parameters );
+  // 1. begins and ends with brackets
+  QChar c1 = params[0];
+  QChar c2 = params[int(params.length()-1)];
+  bool ok = ( c1 == '(' && c2 == ')' );
+  if ( !ok ) return ok;
+  ::cutBrackets( params );
+  // 2. has splitter word
+  ok = ( params.left( 8 ) == "splitter" );
+  if ( !ok ) return ok;
+  // 3. has children?  = '(' is found
+  int i = params.indexOf( '(' );
+  ok = i != -1;
+  if ( !ok ) return ok;
+  params = params.left( i ); // cut all children, they will be checked later
+  // 4. has orientation word and correct value
+  ::getValue( params, "orientation" ).toInt( &ok );
+  if ( !ok ) return ok;
+  // 5. has sizes word and values
+  ok = ! ::getValue( params, "sizes" ).isEmpty();
+  if ( !ok ) return ok;
+  // 6. check children -> number of '(' == number of ')' in original string
+  ok = ( parameters.contains( '(' ) == parameters.contains( ')' ) );
+  return ok;
 }
 
 /*!
-  Destructor
+  \brief Get splitter's children descriptions from the string.
+  \internal
+  
+  Child widgets descriptions are separated by '(' and ')' symbols.
+
+  \param str string to be processed
+  \return child widgets descriptions
 */
-QtxWorkstackDrag::~QtxWorkstackDrag()
+static QStringList getChildren( const QString& str )
 {
-  qApp->removeEventFilter( this );
+  QStringList lst;
+  if ( !str.startsWith( "(" ) )
+    return lst;
 
-  endDrawRect();
+  int i = 1,
+  nOpen = 1, // count brackets: '(' increments nOpen, ')' decrements
+  start = 0;
+  while ( i < (int)str.length() )
+  {
+    if ( str[i] == '(' )
+    {
+      nOpen++;
+      if ( nOpen == 1 )
+             start = i;
+    }
+    else if ( str[i] == ')' )
+    {
+      nOpen--;
+      if ( nOpen == 0 )
+             lst.append( str.mid( start, i-start+1 ) );
+    }
+    i++;
+  }
+
+  return lst;
 }
 
 /*!
-  Custom event filter
+  \brief Get view name by index.
+  \internal
+
+  Example:
+  \code
+  QString s  = "views active='AnotherView' 'GLView' 'AnotherView'";
+  QString a0 = getViewName( s, 0 ); // --> a0 contains "GLView"
+  QString a1 = getViewName( s, 1 ); // --> a1 contains "AnotherView"
+  \endcode
+
+  \param str string to be processed
+  \param i index
+  \return view name
 */
-bool QtxWorkstackDrag::eventFilter( QObject*, QEvent* e )
+static QString getViewName( const QString& str, int i )
 {
-  switch ( e->type() )
+  QRegExp exp( "\\s'\\w+'" );
+  int start = 0; // start index of view name in the string
+  int num = 0 ; // index of found match
+  while ( ( start = exp.indexIn( str, start ) ) != -1 && num < i )
   {
-  case QEvent::MouseMove:
-    updateTarget( ((QMouseEvent*)e)->globalPos() );
-    break;
-  case QEvent::MouseButtonRelease:
-    drawRect();
-    endDrawRect();
-    dropWidget();
-    deleteLater();
-    break;
-  default:
-    return false;
+    start += exp.matchedLength();
+    num ++;
   }
-  return true;
+  if ( start != -1 )      // +2 and -3 avoid starting space and starting and ending ' symbols
+    return str.mid( start + 2, exp.matchedLength() - 3 );
+
+  return QString();
 }
 
 /*!
-  Updates internal field with widget-target for dropping
-  \param p - current point of dragging
+  \brief Get child widget with specified name.
+  \internal
+  \param parent parent widget
+  \param aName child widget name
+  \return child widget or 0 if not found
 */
-void QtxWorkstackDrag::updateTarget( const QPoint& p )
+static QWidget* getView( const QWidget* parent, const QString& aName )
 {
-  int tab = -1;
-  QtxWorkstackArea* area = detectTarget( p, tab );
-  setTarget( area, tab );
+  QWidget* view = 0;
+  QList<QWidget*> l = qFindChildren<QWidget*>( parent->topLevelWidget(), aName );
+  if ( !l.isEmpty() )
+    view = ::qobject_cast<QWidget*>( l.first() );
+  return view;
 }
 
 /*!
-  \return target area for dropping by point
-  \param p - current point of dragging
-  \param tab - index of tab to dropping
+  \brief Setup splitter according to the specified parameters string.
+  \param splitter splitter to be set up
+  \param parameters splitter parameters description
+  \param sMap map containing resulting child splitters sizes
 */
-QtxWorkstackArea* QtxWorkstackDrag::detectTarget( const QPoint& p, int& tab ) const
+void QtxWorkstack::setSplitter( QSplitter* splitter, const QString& parameters, QMap<QSplitter*, QList<int> >& sMap )
 {
-  if ( p.isNull() )
-    return 0;
+  printf( QString( parameters + '\n' ).toLatin1() );
+  if ( !::checkFormat( parameters ) ) {
+    printf( "\nInvalid format of workstack parameters.  Positions of viewers can not be restored.\n" );
+    return;
+  }
 
-  QtxWorkstackArea* area = myWS->areaAt( p );
-  if ( area )
-    tab = area->tabAt( p );
-  return area;
+  QString params( parameters );
+  ::cutBrackets( params );
+
+  // get splitter sizes and store it in the map for future setting
+  QList<int> sizes;
+  QStringList sizesLst = ::getValue( params, "sizes" ).split( ':', QString::SkipEmptyParts );
+  QStringList::Iterator it;
+  for ( it = sizesLst.begin(); it != sizesLst.end(); ++it )
+    sizes.append( (*it).toInt() );
+  sMap[ splitter ] = sizes;
+
+  // set orientation of splitter
+  int orient = ::getValue( params, "orientation" ).toInt();
+  splitter->setOrientation( (Qt::Orientation)orient );
+
+  // get children
+  QString options = params.left( params.indexOf( '(' ) );
+  QString childrenStr = params.right( params.length()-options.length() );
+  QStringList children = ::getChildren( childrenStr );
+
+  // debug output..
+  //  printf (" splitter orient=%d, sizes_count=%d, children=%d\n", orient, sizes.count(), children.count() );
+  //  for ( QStringList::Iterator tit = children.begin(); tit != children.end(); ++tit )
+  //    printf ("   |-> child = [%s]\n", (*tit).latin1() );
+
+  for ( it = children.begin(); it != children.end(); ++it )
+  {
+    if ( (*it).startsWith( "(splitter" ) )
+    {
+      QSplitter* newSplitter = new QSplitter( splitter );
+      setSplitter( newSplitter, *it, sMap );
+    }
+    else if ( (*it).startsWith( "(views" ) )
+    {
+      QtxWorkstackArea* newArea = createArea( splitter );
+      QString activeViewName = ::getValue( *it, "active" );
+      QWidget* activeView = 0;
+      activeViewName = activeViewName.mid( 1, activeViewName.length()-2 ); // chop off ' symbols
+      int i = 0;
+      QString viewName = ::getViewName( *it, i );
+      while ( !viewName.isEmpty() )
+      {
+             if ( QWidget* view = ::getView( splitter, viewName ) )
+        {
+               newArea->insertWidget( view );
+               if ( activeViewName == view->objectName() )
+                 activeView = view;
+             }
+             viewName = ::getViewName( *it, ++i );
+      }
+      if ( activeView )
+       newArea->setActiveWidget( activeView );
+    }
+  }
 }
 
 /*!
-  Changes target area for dropping
-  \param area - new target area
-  \param tab - tab index
+  \brief Restore workstack configuration from the state description string.
+  \param parameters workstack state description
+  \return reference to this workstack
 */
-void QtxWorkstackDrag::setTarget( QtxWorkstackArea* area, const int tab )
+QtxWorkstack& QtxWorkstack::operator<<( const QString& parameters )
 {
-  if ( !area || ( myArea == area && tab == myTab ) )
-    return;
+  // clear the main splitter - remove all child splitters and empty areas from it
+  QList<QSplitter*> splitList;
+  QList<QtxWorkstackArea*> areaList;
+  splitters( mySplit, splitList, false );
+  areas( mySplit, areaList, false );
+  for ( QList<QSplitter*>::iterator iter = splitList.begin(); iter != splitList.end(); ++iter )
+    delete *iter;
 
-  startDrawRect();
+  for ( QList<QtxWorkstackArea*>::iterator it = areaList.begin(); it != areaList.end(); ++it )
+  {
+    if ( (*it)->isEmpty() )
+      delete *it;
+  }
 
-  if ( myArea )
-    drawRect();
+  // restore splitter recursively
+  QMap< QSplitter*, QList<int> > sMap;
+  setSplitter( mySplit, parameters, sMap );
 
-  myTab = tab;
-  myArea = area;
+  // now mySplit may contains empty area (where all views were located before restoring)
+  // in order setSize to work correctly we have to exclude this area
+  areaList.clear();
+  areas( mySplit, areaList, false );
+  for ( QList<QtxWorkstackArea*>::iterator delIt = areaList.begin(); delIt != areaList.end(); ++delIt )
+  {
+    if ( (*delIt)->isEmpty() )
+      delete *delIt;
+  }
 
-  if ( myArea )
-    drawRect();
+  QApplication::instance()->processEvents();
+
+  // restore splitters' sizes (map of sizes is filled in setSplitters)
+  for ( QMap< QSplitter*, QList<int> >::iterator itm = sMap.begin(); itm != sMap.end(); ++itm )
+    itm.key()->setSizes( itm.value() );
+
+  return (*this);
 }
 
 /*!
-  Called on widget drop, inserts dropped widget to area
+  \brief Dump workstack configuration to the state description string.
+  \param parameters resulting workstack state description
+  \return reference to this workstack
 */
-void QtxWorkstackDrag::dropWidget()
+QtxWorkstack& QtxWorkstack::operator>>( QString& outParameters )
 {
-  if ( myArea )
-    myArea->insertWidget( myChild->widget(), myTab );
+  splitterInfo( mySplit, outParameters );
+  return (*this);
 }
 
 /*!
-  Draws float rect
+  \fn void QtxWorkstack::windowActivated( QWidget* w )
+  \brief Emitted when the workstack's child widget \w is activated.
+  \param w widget being activated
 */
-void QtxWorkstackDrag::drawRect()
-{
-  if ( !myPainter || !myArea )
-    return;
-
-  QRect r = myArea->floatRect();
-  int m = myPainter->pen().width();
 
-  r.setTop( r.top() + m + 2 );
-  r.setLeft( r.left() + m + 2 );
-  r.setRight( r.right() - m - 2 );
-  r.setBottom( r.bottom() - m - 2 );
+/*!
+  \brief Gets area containing given widget
+  \param wid widget
+  \return pointer to QtxWorkstackArea* object
+*/
+QtxWorkstackArea* QtxWorkstack::wgArea( QWidget* wid ) const
+{
+  QtxWorkstackArea* resArea = 0;
 
-  myPainter->drawRect( r );
+  QList<QtxWorkstackArea*> areaList;
+  areas( mySplit, areaList, true );
 
-  QRect tr = myArea->floatTab( myTab );
-  tr.setTop( tr.top() + m );
-  tr.setLeft( tr.left() + m );
-  tr.setRight( tr.right() - m );
-  tr.setBottom( tr.bottom() - m );
+  QList<QtxWorkstackArea*>::ConstIterator it;
+  for ( it = areaList.begin(); it != areaList.end() && !resArea; ++it )
+  {
+    if ( (*it)->contains( wid ) )
+      resArea = *it;
+  }
 
-  myPainter->drawRect( tr );
+  return resArea;
 }
 
 /*!
-  Deletes internal painter
+  \brief Moves the first widget to the same area which the second widget belongs to
+  \param wid widget to be moved
+  \param wid_to widget specified the destination area
+  \param before specifies whether the first widget has to be moved before or after 
+         the second widget
+  \return TRUE if operation is completed successfully, FALSE otherwise 
 */
-void QtxWorkstackDrag::endDrawRect()
+bool QtxWorkstack::move( QWidget* wid, QWidget* wid_to, const bool before )
 {
-  delete myPainter;
-  myPainter = 0;
+  if ( wid && wid_to )
+  {
+    QtxWorkstackArea* area_src = wgArea( wid );
+    QtxWorkstackArea* area_to = wgArea( wid_to );
+    if ( area_src && area_to )
+    {
+      // find index of the second widget
+      QWidgetList wgList = area_to->widgetList();
+      QWidgetList::ConstIterator it;
+      int idx = 0;
+      for ( it = wgList.begin(); it != wgList.begin(); ++it, idx++ )
+      {
+        if ( *it == wid_to )
+          break;
+      }
+
+      if ( idx < wgList.count() ) // paranoidal check
+      {
+        if ( !before )
+          idx++;
+        area_src->removeWidget( wid, true );
+        area_to->insertWidget( wid, idx );
+        return true;
+      }
+    }
+  }
+  return false;
 }
 
 /*!
-  Initialize internal painter
+  \brief Group all windows in one area
+  \return TRUE if operation is completed successfully, FALSE otherwise 
 */
-void QtxWorkstackDrag::startDrawRect()
+void QtxWorkstack::stack()
 {
-  if ( myPainter )
-    return;
+  QWidgetList wgList = windowList();
+  if ( !wgList.count() )
+    return; // nothing to do
 
-  int scr = QApplication::desktop()->screenNumber( (QWidget*)this );
-  QWidget* paint_on = QApplication::desktop()->screen( scr );
+  QtxWorkstackArea* area_to = 0;
+  QWidgetList::ConstIterator it;
+  for ( it = wgList.begin(); it != wgList.end(); ++it )
+  {
+    QtxWorkstackArea* area_src = 0;
+    if ( !area_to )
+    {
+      area_to = wgArea( *it );
+      area_src = area_to;
+    }
+    else 
+      area_src = wgArea( *it );
 
-  myPainter = new QPainter( paint_on, true );
-  myPainter->setPen( QPen( gray, 3 ) );
-  myPainter->setRasterOp( XorROP );
+    if ( area_src != area_to )
+    {
+      area_src->removeWidget( *it, true );
+      area_to->insertWidget( *it, -1 );
+    }
+  }
 }
index c31479cc6b8055ac5c916bfbb1da51e1fa2b01fb..9d0a16bd52a358d24b3f536c0ececed7d403f140 100644 (file)
@@ -1,40 +1,43 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxWorkstack.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXWORKSTACK_H
 #define QTXWORKSTACK_H
 
 #include "Qtx.h"
 
-#include <qhbox.h>
-#include <qwidget.h>
-#include <qtabbar.h>
-#include <qwidgetlist.h>
+#include <QWidget>
+#include <QFrame>
+#include <QTabBar>
+#include <QEvent>
+#include <QMap>
 
 class QAction;
-class QTabBar;
-class QPainter;
 class QSplitter;
-class QPushButton;
-class QWidgetStack;
+class QStackedWidget;
+class QRubberBand;
+class QAbstractButton;
 
 class QtxWorkstackArea;
 class QtxWorkstackDrag;
@@ -50,20 +53,28 @@ class QTX_EXPORT QtxWorkstack : public QWidget
   Q_OBJECT
 
 public:
-  enum { SplitVertical, SplitHorizontal, Close, Rename };
+  //! Workstack actions (context menu items)
+  enum { SplitVertical    = 0x01,  //!< "Split vertically" menu item
+        SplitHorizontal  = 0x02,  //!< "Split horizontally" menu item
+        Close            = 0x04,  //!< "Close" menu item
+        Rename           = 0x08,  //!< "Rename" menu item
+        All = SplitVertical | SplitHorizontal | 
+              Close | Rename      //!< all menu items
+  };
     
+  //! Workstack splitting type
   enum SplitType
   {
-    SPLIT_STAY, //!< given widget stays in its workarea, others are moved into a new one
-    SPLIT_AT,   //!< widgets before a given widget stays in they workarea, others are moved into a new one
-    SPLIT_MOVE  //!< given widget is moved into a new workarea, others stay in an old one
+    SplitStay,  //!< selected widget stays in current workarea, others widgets are moved into a new workarea
+    SplitAt,    //!< all widgets before selected widget stay in current workarea, other widgess are moved into a new workarea
+    SplitMove   //!< selected widget is moved into a new workarea, all other widgets stay in an old workarea
   };
 
 public:
   QtxWorkstack( QWidget* = 0 );
   virtual ~QtxWorkstack();
 
-  QWidgetList         windowList() const;
+  QWidgetList         windowList( QWidget* = 0 ) const;
   QWidgetList         splitWindowList() const;
 
   QWidget*            activeWindow() const;
@@ -71,10 +82,17 @@ public:
   int                 accel( const int ) const;
   void                setAccel( const int, const int );
 
+  QIcon               icon( const int ) const;
+  void                setIcon( const int, const QIcon& );
+
+  void                setMenuActions( const int );
+  int                 menuActions() const;
+
   void                split( const int );
+  bool                move( QWidget* wid, QWidget* wid_to, const bool before );
+  void                stack();
 
-  // STV: Useless function. wid->setFocus() should be used instead.
-  // void OnTop( QWidget* wid);
+  QWidget*            addWindow( QWidget*, Qt::WindowFlags = 0 );
 
   void Split( QWidget* wid, const Qt::Orientation o, const SplitType type );
   void Attract( QWidget* wid1, QWidget* wid2, const bool all );
@@ -101,18 +119,18 @@ private slots:
   void                onDeactivated( QtxWorkstackArea* );
 
 protected:
-  virtual void        childEvent( QChildEvent* );
-  virtual void        customEvent( QCustomEvent* );
+  virtual void        customEvent( QEvent* );
 
 private:
   QSplitter*          splitter( QtxWorkstackArea* ) const;
-  void                splitters( QSplitter*, QPtrList<QSplitter>&, const bool = false ) const;
-  void                areas( QSplitter*, QPtrList<QtxWorkstackArea>&, const bool = false ) const;
+  void                splitters( QSplitter*, QList<QSplitter*>&, const bool = false ) const;
+  void                areas( QSplitter*, QList<QtxWorkstackArea*>&, const bool = false ) const;
 
   QSplitter*          wrapSplitter( QtxWorkstackArea* );
   void                insertWidget( QWidget*, QWidget*, QWidget* );
 
   QtxWorkstackArea*   areaAt( const QPoint& ) const;
+  QtxWorkstackArea*   wgArea( QWidget* ) const;
 
   QtxWorkstackArea*   targetArea();
   QtxWorkstackArea*   activeArea() const;
@@ -131,32 +149,35 @@ private:
                                                           const int need_pos, const int splitter_pos );
   
   void                splitterInfo( QSplitter*, QString& ) const;
-  void                setSplitter( QSplitter*, const QString&, QMap< QSplitter*,QValueList<int> >& );
+  void                setSplitter( QSplitter*, const QString&, QMap< QSplitter*, QList<int> >& );
   
 private:
-  QWidget*            myWin;
-  QtxWorkstackArea*   myArea;
-  QSplitter*          mySplit;
-  QWidget*            myWorkWin;
-  QtxWorkstackArea*   myWorkArea;
+  QWidget*            myWin;        //!< active widget
+  QtxWorkstackArea*   myArea;       //!< active workarea
+  QSplitter*          mySplit;      //!< tol-level splitter
+  QWidget*            myWorkWin;    //!< widget where popup menu is invoked (used internally)
+  QtxWorkstackArea*   myWorkArea;   //!< workarea where popup menu is invoked (used internally)
 
-  QMap<int, QAction*> myActionsMap; //!< The map of the actions. Allows to get the QAction object by the key.
+  QMap<int, QAction*> myActionsMap; //!< actions map
 
   friend class QtxWorkstackArea;
   friend class QtxWorkstackDrag;
 };
 
-class QtxWorkstackArea : public QWidget
+class QtxWorkstackArea : public QFrame
 {
   Q_OBJECT
 
+  class WidgetEvent;
+
 public:
   QtxWorkstackArea( QWidget* );
   virtual ~QtxWorkstackArea();
 
+  bool                isNull() const;
   bool                isEmpty() const;
 
-  void                insertWidget( QWidget*, const int = -1 );
+  QWidget*            insertWidget( QWidget*, const int = -1, Qt::WindowFlags = 0 );
   void                removeWidget( QWidget*, const bool = true );
 
   QWidget*            activeWidget() const;
@@ -184,18 +205,17 @@ signals:
   void                deactivated( QtxWorkstackArea* );
 
 public slots:
-  virtual void        show();
-  virtual void        hide();
+  virtual void        setVisible( bool );
 
 private slots:
   void                onClose();
-  void                onSelected( int );
+  void                onCurrentChanged( int );
 
   void                onWidgetDestroyed();
 
   void                onChildDestroyed( QObject* );
   void                onChildShown( QtxWorkstackChild* );
-  void                onChildHided( QtxWorkstackChild* );
+  void                onChildHidden( QtxWorkstackChild* );
   void                onChildActivated( QtxWorkstackChild* );
   void                onChildCaptionChanged( QtxWorkstackChild* );
 
@@ -203,12 +223,16 @@ private slots:
   void                onContextMenuRequested( QPoint );
 
 protected:
-  virtual void        customEvent( QCustomEvent* );
+  virtual void        customEvent( QEvent* );
   virtual void        focusInEvent( QFocusEvent* );
   virtual void        mousePressEvent( QMouseEvent* );
 
 private:
-  enum { ActivateWidget = QEvent::User, FocusWidget, RemoveWidget };
+  //! Custom events
+  enum { ActivateWidget = QEvent::User,   //!< activate widget event
+        FocusWidget,                     //!< focus receiving widget event
+        RemoveWidget                     //!< widget removing event
+  };
 
 private:
   void                updateState();
@@ -241,22 +265,22 @@ private:
   typedef QMap<QWidget*, WidgetInfo>         WidgetInfoMap;
 
 private:
-  QtxWorkstackTabBar* myBar;
-  QPushButton*        myClose;
-  QWidgetStack*       myStack;
-
-  QWidgetList         myList;
-  WidgetInfoMap       myInfo;
-  ChildMap            myChild;
-  BlockMap            myBlock;
+  QtxWorkstackTabBar* myBar;     //!< workarea tab bar header
+  QAbstractButton*    myClose;   //!< close button
+  QStackedWidget*     myStack;   //!< widget stack
+
+  QWidgetList         myList;    //!< child widgets list
+  WidgetInfoMap       myInfo;    //!< widgets states mp
+  ChildMap            myChild;   //!< child widget containers map
+  BlockMap            myBlock;   //!< blocked widgets
 };
 
-class QtxWorkstackChild : public QHBox
+class QtxWorkstackChild : public QWidget
 {
   Q_OBJECT
 
 public:
-  QtxWorkstackChild( QWidget*, QWidget* = 0 );
+  QtxWorkstackChild( QWidget*, QWidget* = 0, Qt::WindowFlags = 0 );
   virtual ~QtxWorkstackChild();
 
   QWidget*            widget() const;
@@ -265,7 +289,7 @@ public:
 
 signals:
   void                shown( QtxWorkstackChild* );
-  void                hided( QtxWorkstackChild* );
+  void                hidden( QtxWorkstackChild* );
   void                activated( QtxWorkstackChild* );
   void                captionChanged( QtxWorkstackChild* );
 
@@ -276,7 +300,7 @@ protected:
   virtual void        childEvent( QChildEvent* );
 
 private:
-  QWidget*            myWidget;
+  QWidget*            myWidget;   //!< child widget
 };
 
 class QtxWorkstackTabBar : public QTabBar
@@ -287,24 +311,34 @@ public:
   QtxWorkstackTabBar( QWidget* = 0 );
   virtual ~QtxWorkstackTabBar();
 
-  QRect               tabRect( const int ) const;
-
+  bool                isActive() const;
   void                setActive( const bool );
 
+  int                 tabId( const int ) const;
+  int                 indexOf( const int ) const;
+  void                setTabId( const int, const int );
+
+  void                updateActiveState();
+
 signals:
   void                dragActiveTab();
   void                contextMenuRequested( QPoint );
 
+private slots:
+  void                onCurrentChanged( int );
+
 protected:
   virtual void        mouseMoveEvent( QMouseEvent* );
   virtual void        mousePressEvent( QMouseEvent* );
   virtual void        mouseReleaseEvent( QMouseEvent* );
   virtual void        contextMenuEvent( QContextMenuEvent* );
+  virtual void        changeEvent( QEvent* );
 
-  virtual void        paintLabel( QPainter*, const QRect&, QTab*, bool ) const;
+//  virtual void        paintLabel( QPainter*, const QRect&, QTab*, bool ) const;
 
 private:
-  int                 myId;
+  int                 myId;         //!< current tab page index
+  bool                myActive;     //!< "active" status
 };
 
 class QtxWorkstackDrag : public QObject
@@ -329,17 +363,17 @@ private:
   void                startDrawRect();
 
 private:
-  QtxWorkstack*       myWS;
-  QtxWorkstackChild*  myChild;
+  QtxWorkstack*       myWS;          //!< parent workstack
+  QtxWorkstackChild*  myChild;       //!< workstack child widget container
 
-  int                 myTab;
-  QtxWorkstackArea*   myArea;
-  QPainter*           myPainter;
-  
+  int                 myTab;         //!< workarea tab page index
+  QtxWorkstackArea*   myArea;        //!< workarea
+  QRubberBand*        myTabRect;     //!< tab bar rubber band
+  QRubberBand*        myAreaRect;    //!< workarea rubber band
 };
 
 #ifdef WIN32
 #pragma warning( default:4251 )
 #endif
 
-#endif
+#endif   // QTXWORKSTACK_H
index a1dbcb974ec8393f94431e6744d7432be4361f6d..8e813797e170b5c77b4c5dc0cad842de40615ed2 100644 (file)
@@ -1,57 +1,70 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxWorkstackAction.cxx
 // Author:    Sergey TELKOV
-
+//
 #include "QtxWorkstackAction.h"
 
 #include "QtxWorkstack.h"
 
-#include <qpopupmenu.h>
-#include <qwidgetlist.h>
+#include <QMenu>
+#include <QWidgetList>
 
 /*!
-  Constructor
+  \class QtxWorkstackAction
+  \brief Implements actions group for menu Windows with standard operations, like
+         "Split vertical", "Split horizontal", etc.
 */
-QtxWorkstackAction::QtxWorkstackAction( QtxWorkstack* ws, QObject* parent, const char* name )
-: QtxAction( tr( "Controls windows into workstack" ), tr( "Workstack management" ), 0, parent, name ),
-myFlags( Standard ),
-myWorkstack( ws )
+
+/*!
+  \brief Constructor.
+  \param ws workstack
+  \param parent parent object (owner of the action)
+*/
+QtxWorkstackAction::QtxWorkstackAction( QtxWorkstack* ws, QObject* parent )
+: QtxActionSet( parent ),
+  myWorkstack( ws ),
+  myWindowsFlag( true )
 {
-  myItem.insert( VSplit, new QtxAction( tr( "Split the active window on two vertical parts" ),
-                                        tr( "Split vertically" ), 0, this, 0, false ) );
-  myItem.insert( HSplit, new QtxAction( tr( "Split the active window on two horizontal parts" ),
-                                        tr( "Split horizontally" ), 0, this, 0, false ) );
+  insertAction( new QtxAction( tr( "Split the active window on two vertical parts" ),
+                               tr( "Split vertically" ), 0, this ), SplitVertical );
+  insertAction( new QtxAction( tr( "Split the active window on two horizontal parts" ),
+                               tr( "Split horizontally" ), 0, this ), SplitHorizontal );
+
+  connect( this, SIGNAL( triggered( int ) ), this, SLOT( onTriggered( int ) ) );
 
-  connect( myItem[VSplit], SIGNAL( activated() ), ws, SLOT( splitVertical() ) );
-  connect( myItem[HSplit], SIGNAL( activated() ), ws, SLOT( splitHorizontal() ) );
+  setMenuActions( Standard );
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 QtxWorkstackAction::~QtxWorkstackAction()
 {
 }
 
 /*!
-  \return corresponding workstack
+  \brief Get workstack.
+  \return parent workstack
 */
 QtxWorkstack* QtxWorkstackAction::workstack() const
 {
@@ -59,349 +72,299 @@ QtxWorkstack* QtxWorkstackAction::workstack() const
 }
 
 /*!
-  \return set of action flags
-*/
-int QtxWorkstackAction::items() const
-{
-  return myFlags;
-}
+  \brief Set actions to be visible in the menu.
+  
+  Actions, which IDs are set in \a flags parameter, will be shown in the 
+  menu bar. Other actions will not be shown.
 
-/*!
-  Sets action flags
-  \param flags - new set of flags
+  \param flags ORed together actions flags
 */
-void QtxWorkstackAction::setItems( const int flags )
+void QtxWorkstackAction::setMenuActions( const int flags )
 {
-  if ( !flags || flags == myFlags || !( flags & Split ) )
-    return;
-
-  myFlags = flags;
+  action( SplitVertical )->setVisible( flags & SplitVertical );
+  action( SplitHorizontal )->setVisible( flags & SplitHorizontal );
+  myWindowsFlag = flags & Windows;
 }
 
 /*!
-  \return true if action contains all flags
-  \param flags - new set of flags
+  \brief Get menu actions which are currently visible in the menu bar.
+  \return ORed together actions flags
+  \sa setMenuActions()
 */
-bool QtxWorkstackAction::hasItems( const int flags ) const
+int QtxWorkstackAction::menuActions() const
 {
-  return ( myFlags & flags ) == flags;
+  int ret = 0;
+  ret = ret | ( action( SplitVertical )->isVisible() ? SplitVertical : 0 );
+  ret = ret | ( action( SplitHorizontal )->isVisible() ? SplitHorizontal : 0 );
+  ret = ret | ( myWindowsFlag ? Windows : 0 );
+  return ret;
 }
 
 /*!
-  \return accelerator of item
-  \param id - item id
+  \brief Get keyboard accelerator for the specified action.
+  \param id menu action ID
+  \return keyboard accelerator of menu item or 0 if there is no such action
 */
 int QtxWorkstackAction::accel( const int id ) const
 {
   int a = 0;
-  if ( myItem.contains( id ) )
-    a = myItem[id]->accel();
+  if ( action( id ) )
+    a = action( id )->shortcut();
   return a;
 }
 
 /*!
-  \return icons of item
-  \param id - item id
+  \brief Get icon for the specified action.
+
+  If \a id is invalid, null icon is returned.
+
+  \param id menu action ID
+  \return menu item icon
 */
-QIconSet QtxWorkstackAction::iconSet( const int id ) const
+QIcon QtxWorkstackAction::icon( const int id ) const
 {
-  QIconSet ico;
-  if ( myItem.contains( id ) )
-    ico = myItem[id]->iconSet();
+  QIcon ico;
+  if ( action( id ) )
+    ico = action( id )->icon();
   return ico;
 }
 
 /*!
-  \return menu text of item
-  \param id - item id
+  \brief Get menu item text for the specified action.
+  \param id menu action ID
+  \return menu item text or null QString if there is no such action
 */
-QString QtxWorkstackAction::menuText( const int id ) const
+QString QtxWorkstackAction::text( const int id ) const
 {
   QString txt;
-  if ( myItem.contains( id ) )
-    txt = myItem[id]->menuText();
+  if ( action( id ) )
+    txt = action( id )->text();
   return txt;
 }
 
 /*!
-  \return status tip of item
-  \param id - item id
+  \brief Get status bar tip for the specified action.
+  \param id menu action ID
+  \return status bar tip menu item or null QString if there is no such action
 */
 QString QtxWorkstackAction::statusTip( const int id ) const
 {
   QString txt;
-  if ( myItem.contains( id ) )
-    txt = myItem[id]->statusTip();
+  if ( action( id ) )
+    txt = action( id )->statusTip();
   return txt;
 }
 
 /*!
-  Changes accelerator of item
-  \param id - item id
-  \param a - new accelerator
+  \brief Set keyboard accelerator for the specified action.
+  \param id menu action ID
+  \param a new keyboard accelerator
 */
 void QtxWorkstackAction::setAccel( const int id, const int a )
 {
-  if ( myItem.contains( id ) )
-    myItem[id]->setAccel( a );
+  if ( action( id ) )
+    action( id )->setShortcut( a );
 }
 
 /*!
-  Changes icons of item
-  \param id - item id
-  \param ico - new icons
+  \brief Set menu item icon for the specified action.
+  \param id menu action ID
+  \param ico new menu item icon
 */
-void QtxWorkstackAction::setIconSet( const int id, const QIconSet& ico )
+void QtxWorkstackAction::setIcon( const int id, const QIcon& icon )
 {
-  if ( myItem.contains( id ) )
-    myItem[id]->setIconSet( ico );
+  if ( action( id ) )
+    action( id )->setIcon( icon );
 }
 
 /*!
-  Changes menu text of item
-  \param id - item id
-  \param txt - new menu text
+  \brief Set menu item text for the specified action.
+  \param id menu action ID
+  \param txt new menu item text
 */
-void QtxWorkstackAction::setMenuText( const int id, const QString& txt )
+void QtxWorkstackAction::setText( const int id, const QString& txt )
 {
-  if ( myItem.contains( id ) )
-    myItem[id]->setMenuText( txt );
+  if ( action( id ) )
+    action( id )->setText( txt );
 }
 
 /*!
-  Changes status tip of item
-  \param id - item id
-  \param txt - new status tip
+  \brief Set menu item status bar tip for the specified action.
+  \param id menu action ID
+  \param txt new menu item status bar tip
 */
 void QtxWorkstackAction::setStatusTip( const int id, const QString& txt )
 {
-  if ( myItem.contains( id ) )
-    myItem[id]->setStatusTip( txt );
-}
-
-/*!
-  Adds action to widget
-  \param wid - widget
-*/
-bool QtxWorkstackAction::addTo( QWidget* wid )
-{
-  return addTo( wid, -1 );
+  if ( action( id ) )
+    action( id )->setStatusTip( txt );
 }
 
 /*!
-  Adds action to widget
-  \param wid - widget
-  \param idx - position
-*/
-bool QtxWorkstackAction::addTo( QWidget* wid, const int idx )
-{
-  if ( !wid || !wid->inherits( "QPopupMenu" ) )
-    return false;
-
-  QPopupMenu* pm = (QPopupMenu*)wid;
-  checkPopup( pm );
-
-  if ( myMenu.contains( pm ) )
-    return false;
-
-  myMenu.insert( pm, QIntList() );
-  fillPopup( pm, idx );
-
-  connect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
-  connect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onPopupDestroyed( QObject* ) ) );
-
-  return true;
-}
-
-/*!
-  Removes action from widget
-  \param wid - widget
-*/
-bool QtxWorkstackAction::removeFrom( QWidget* wid )
-{
-  if ( !wid || !wid->inherits( "QPopupMenu" ) )
-    return false;
-
-  QPopupMenu* pm = (QPopupMenu*)wid;
-  if ( !myMenu.contains( pm ) )
-    return false;
-
-  clearPopup( pm );
-
-  disconnect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
-  disconnect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onPopupDestroyed( QObject* ) ) );
-
-  myMenu.remove( pm );
-
-  return true;
-}
-
-/*!
-  Performs action
-  \param type - action type
+  \brief Process action activated by the user.
+  \param type action ID
 */
 void QtxWorkstackAction::perform( const int type )
 {
   switch ( type )
   {
-  case VSplit:
-    workstack()->splitVertical();
+  case SplitVertical:
+    splitVertical();
     break;
-  case HSplit:
-    workstack()->splitHorizontal();
+  case SplitHorizontal:
+    splitHorizontal();
     break;
   }
 }
 
 /*!
-  SLOT: called just before the popup menu is displayed, updates popup
+  \brief Split the window area in the workstack in the vertical direction.
 */
-void QtxWorkstackAction::onAboutToShow()
+void QtxWorkstackAction::splitVertical()
 {
-  const QObject* obj = sender();
-  if ( !obj || !obj->inherits( "QPopupMenu" ) )
-    return;
-
   QtxWorkstack* ws = workstack();
-  if ( ws && myItem.contains( VSplit ) )
-    myItem[VSplit]->setAccel( ws->accel( QtxWorkstack::SplitVertical ) );
-  if ( ws && myItem.contains( HSplit ) )
-    myItem[HSplit]->setAccel( ws->accel( QtxWorkstack::SplitHorizontal ) );
-
-  updatePopup( (QPopupMenu*)obj );
+  if ( ws )
+    ws->splitVertical();
 }
 
 /*!
-  SLOT: called when popup menu is destroyed, removes it from menu
+  \brief Split the window area in the workstack in the horizontal direction.
 */
-void QtxWorkstackAction::onPopupDestroyed( QObject* obj )
+void QtxWorkstackAction::splitHorizontal()
 {
-  myMenu.remove( (QPopupMenu*)obj );
+  QtxWorkstack* ws = workstack();
+  if ( ws )
+    ws->splitHorizontal();
 }
 
 /*!
-  Updates popup
-  \param pm - popup menu
+  \brief Called when action is added to the menu bar.
+  \param w menu bar widget this action is being added to
 */
-void QtxWorkstackAction::checkPopup( QPopupMenu* pm )
+void QtxWorkstackAction::addedTo( QWidget* w )
 {
-  if ( !myMenu.contains( pm ) )
-    return;
+  QtxActionSet::addedTo( w );
 
-  QIntList updList;
-  for ( QIntList::const_iterator it = myMenu[pm].begin(); it != myMenu[pm].end(); ++it )
-  {
-    if ( pm->indexOf( *it ) != -1 )
-      updList.append( *it );
-  }
-
-  myMenu.remove( pm );
-
-  if ( !updList.isEmpty() )
-    myMenu.insert( pm, updList );
-  else
-  {
-    disconnect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
-    disconnect( pm, SIGNAL( destroyed( QObject* ) ), this, SLOT( onPopupDestroyed( QObject* ) ) );
-  }
+  QMenu* pm = ::qobject_cast<QMenu*>( w );
+  if ( pm )
+    connect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
 }
 
 /*!
-  Clears and refills popup and updates state of actions
-  \param pm - popup menu
+  \brief Called when action is removed from the menu bar.
+  \param w menu bar widget this action is being removed from
 */
-void QtxWorkstackAction::updatePopup( QPopupMenu* pm )
+void QtxWorkstackAction::removedFrom( QWidget* w )
 {
-  if ( !myMenu.contains( pm ) )
-    return;
-
-  fillPopup( pm, clearPopup( pm ) );
+  QtxActionSet::removedFrom( w );
 
-  int count = workstack() ? workstack()->splitWindowList().count() : 0;
-  myItem[VSplit]->setEnabled( count > 1 );
-  myItem[HSplit]->setEnabled( count > 1 );
+  QMenu* pm = ::qobject_cast<QMenu*>( w );
+  if ( pm )
+    disconnect( pm, SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
 }
 
 /*!
-  Clears popup
-  \param pm - popup menu
+  \brief Update all menu action state.
 */
-int QtxWorkstackAction::clearPopup( QPopupMenu* pm )
+void QtxWorkstackAction::updateContent()
 {
-  if ( !myMenu.contains( pm ) )
-    return -1;
-
-  int idx = -1;
-  const QIntList& lst = myMenu[pm];
-  for ( QIntList::const_iterator it = lst.begin(); it != lst.end() && idx == -1; ++it )
-    idx = pm->indexOf( *it );
-
-  for ( ItemMap::ConstIterator mit = myItem.begin(); mit != myItem.end(); ++mit )
-    mit.data()->removeFrom( pm );
+  bool count = workstack() ? workstack()->splitWindowList().count() > 1 : 0;
+  action( SplitVertical )->setEnabled( count );
+  action( SplitHorizontal )->setEnabled( count );
 
-  for ( QIntList::const_iterator itr = lst.begin(); itr != lst.end(); ++itr )
-    pm->removeItem( *itr );
-
-  return idx;
+  updateWindows();
 }
 
 /*!
-  Fills popup with items
-  \param pm - popup menu
-  \param idx - position
+  \brief Update actions which refer to the opened child windows.
 */
-void QtxWorkstackAction::fillPopup( QPopupMenu* pm, const int idx )
+void QtxWorkstackAction::updateWindows()
 {
-  if ( !pm )
+  QtxWorkstack* ws = workstack();
+  if ( !ws )
     return;
 
-  int index = idx < 0 ? pm->count() : QMIN( (int)pm->count(), idx );
+  QList<QAction*> lst = actions();
+  for ( QList<QAction*>::iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    int id = actionId( *it );
+    if ( id >= Windows )
+      removeAction( *it );
+  }
 
-  myMenu.insert( pm, QIntList() );
-  QIntList& lst = myMenu[pm];
+  bool base = action( SplitVertical )->isVisible() || action( SplitHorizontal )->isVisible();
 
-  for ( ItemMap::ConstIterator mit = myItem.begin(); mit != myItem.end(); ++mit )
+  QList<QAction*> items;
+  QMap<QAction*, int> map;
+  if ( menuActions() & Windows )
   {
-    if ( !hasItems( mit.key() ) )
-      continue;
-
-    mit.data()->addTo( pm, index );
-    lst.append( pm->idAt( index++ ) );
+    int index = 1;
+    QWidgetList wList = ws->windowList();
+    for ( QWidgetList::iterator it = wList.begin(); it != wList.end(); ++it, index++ )
+    {
+      QWidget* wid = *it;
+      QAction* a = new QtxAction( wid->windowTitle(), wid->windowTitle(), 0, this, true );
+      a->setChecked( wid == ws->activeWindow() );
+      items.append( a );
+      map.insert( a, Windows + index );
+    }
+
+    if ( base && !items.isEmpty() )
+    {
+      QAction* sep = new QtxAction( this );
+      sep->setSeparator( true );
+      items.prepend( sep );
+      map.insert( sep, Windows );
+    }
   }
 
-  QtxWorkstack* ws = workstack();
-  if ( !ws || !hasItems( Windows ) )
-    return;
+  if ( !items.isEmpty() )
+    insertActions( items );
 
-  QWidgetList wList = ws->windowList();
-  if ( wList.isEmpty() )
-    return;
+  for ( QMap<QAction*, int>::const_iterator itr = map.begin(); itr != map.end(); ++itr )
+    setActionId( itr.key(), itr.value() );
+}
 
-  lst.append( pm->insertSeparator( index++ ) );
+/*!
+  \brief Called when parent menu is about to show.
 
-  int param = 0;
-  pm->setCheckable( true );
-  for ( QWidgetListIt it( wList ); it.current(); ++it )
-  {
-    int id = pm->insertItem( it.current()->caption(), this, SLOT( onItemActivated( int ) ), 0, -1, index++ );
-    pm->setItemParameter( id, param++ );
-    pm->setItemChecked( id, it.current() == ws->activeWindow() );
-    lst.append( id );
-  }
+  Updates all menu items.
+*/
+void QtxWorkstackAction::onAboutToShow()
+{
+  QMenu* pm = ::qobject_cast<QMenu*>( sender() );
+  if ( pm )
+    updateContent();
 }
 
 /*!
-  SLOT: called when popup item corresponding to window is activated, activates window
+  \brief Called when menu item corresponding to some child window is activated.
+
+  Activates correposponding child window.
+
+  \param idx menu item index
 */
-void QtxWorkstackAction::onItemActivated( int idx )
+void QtxWorkstackAction::activateItem( const int idx )
 {
   QtxWorkstack* ws = workstack();
   if ( !ws )
     return;
 
   QWidgetList wList = ws->windowList();
-  if ( idx < 0 || idx >= (int)wList.count() )
-    return;
+  if ( idx >= 0 && idx < (int)wList.count() )
+    wList.at( idx )->setFocus();
+}
 
-  wList.at( idx )->setFocus();
+/*!
+  \brief Called when menu item is activated by the user.
+  
+  Perform the corresponding action.
+
+  \param id menu item identifier
+*/
+void QtxWorkstackAction::onTriggered( int id )
+{
+  if ( id < Windows )
+    perform( id );
+  else
+    activateItem( id - Windows - 1 );
 }
index 650184d24540bda9a56540b2e7bdb19718f49edd..aaa61b7863f9554e93faa927fc5444939ca80112 100644 (file)
@@ -1,28 +1,31 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      QtxWorkstackAction.h
 // Author:    Sergey TELKOV
-
+//
 #ifndef QTXWORKSTACKACTION_H
 #define QTXWORKSTACKACTION_H
 
-#include "QtxAction.h"
+#include "QtxActionSet.h"
 
 class QtxWorkstack;
 
@@ -30,64 +33,56 @@ class QtxWorkstack;
 #pragma warning( disable:4251 )
 #endif
 
-class QTX_EXPORT QtxWorkstackAction : public QtxAction
+class QTX_EXPORT QtxWorkstackAction : public QtxActionSet
 {
   Q_OBJECT
 
 public:
-  enum { VSplit     = 0x0001,
-         HSplit     = 0x0002,
-         Windows    = 0x0010,
-         Split      = VSplit | HSplit,
-         Standard   = Split | Windows };
-
-public:
-  QtxWorkstackAction( QtxWorkstack*, QObject* = 0, const char* = 0 );
+  //! Actions (menu items) ID
+  enum { SplitVertical   = 0x0001,   //!< "Split window vertically" operation
+         SplitHorizontal = 0x0002,   //!< "Split window horizontally" operation
+         Windows         = 0x0010,   //!< A list of child windows menu items
+         Split           = SplitVertical | SplitHorizontal,
+         Standard        = Split | Windows };
+
+  QtxWorkstackAction( QtxWorkstack*, QObject* = 0 );
   virtual ~QtxWorkstackAction();
 
   QtxWorkstack* workstack() const;
 
-  int           items() const;
-  void          setItems( const int );
-  bool          hasItems( const int ) const;
+  int           menuActions() const;
+  void          setMenuActions( const int );
 
+  QIcon         icon( const int ) const;
+  QString       text( const int ) const;
   int           accel( const int ) const;
-  QIconSet      iconSet( const int ) const;
-  QString       menuText( const int ) const;
   QString       statusTip( const int ) const;
 
   void          setAccel( const int, const int );
-  void          setIconSet( const int, const QIconSet& );
-  void          setMenuText( const int, const QString& );
+  void          setIcon( const int, const QIcon& );
+  void          setText( const int, const QString& );
   void          setStatusTip( const int, const QString& );
 
-  virtual bool  addTo( QWidget* );
-  virtual bool  addTo( QWidget*, const int );
-  virtual bool  removeFrom( QWidget* );
-
   void          perform( const int );
 
 private slots:
   void          onAboutToShow();
-  void          onItemActivated( int );
-  void          onPopupDestroyed( QObject* );
-
-private:
-  void          checkPopup( QPopupMenu* );
-  void          updatePopup( QPopupMenu* );
+  void          onTriggered( int );
 
-  int           clearPopup( QPopupMenu* );
-  void          fillPopup( QPopupMenu*, const int );
+protected:
+  virtual void  addedTo( QWidget* );
+  virtual void  removedFrom( QWidget* );
 
 private:
-  typedef QMap<QPopupMenu*, QIntList> MenuMap;
-  typedef QMap<int, QtxAction*>       ItemMap;
+  void          updateContent();
+  void          updateWindows();
+  void          splitVertical();
+  void          splitHorizontal();
+  void          activateItem( const int );
 
 private:
-  MenuMap       myMenu;
-  ItemMap       myItem;
-  int           myFlags;
-  QtxWorkstack* myWorkstack;
+  QtxWorkstack* myWorkstack;       //!< parent workstack
+  bool          myWindowsFlag;     //!< "show child windows items" flag
 };
 
 #ifdef WIN32
index b6e64e2c3047ddcf9d668aa43d39f37dd71ec34a..b684b26a77e1f38b07fbd075d2fbe890387eb981 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libQxGraph.la
 
-salomeinclude_HEADERS= \
-       QxGraph_ActiveItem.h \
-       QxGraph_Prs.h \
-       QxGraph_Canvas.h \
-       QxGraph_CanvasView.h \
-       QxGraph_ViewWindow.h \
-       QxGraph_ViewManager.h \
-       QxGraph_ViewModel.h \
-       QxGraph_Def.h \
+salomeinclude_HEADERS =                \
+       QxGraph_ActiveItem.h    \
+       QxGraph_Prs.h           \
+       QxGraph_Canvas.h        \
+       QxGraph_CanvasView.h    \
+       QxGraph_ViewWindow.h    \
+       QxGraph_ViewManager.h   \
+       QxGraph_ViewModel.h     \
+       QxGraph_Def.h           \
        QxGraph.h
 
-dist_libQxGraph_la_SOURCES= \
-       QxGraph_Prs.cxx \
-       QxGraph_Canvas.cxx \
-       QxGraph_CanvasView.cxx \
-       QxGraph_ViewWindow.cxx \
-       QxGraph_ViewManager.cxx \
+dist_libQxGraph_la_SOURCES =   \
+       QxGraph_Prs.cxx         \
+       QxGraph_Canvas.cxx      \
+       QxGraph_CanvasView.cxx  \
+       QxGraph_ViewWindow.cxx  \
+       QxGraph_ViewManager.cxx \
        QxGraph_ViewModel.cxx
 
-MOC_FILES= \
-       QxGraph_Canvas_moc.cxx \
-       QxGraph_CanvasView_moc.cxx \
-       QxGraph_ViewWindow_moc.cxx \
-       QxGraph_ViewManager_moc.cxx \
+MOC_FILES =                            \
+       QxGraph_Canvas_moc.cxx          \
+       QxGraph_CanvasView_moc.cxx      \
+       QxGraph_ViewWindow_moc.cxx      \
+       QxGraph_ViewManager_moc.cxx     \
        QxGraph_ViewModel_moc.cxx
 
-nodist_libQxGraph_la_SOURCES= $(MOC_FILES)
+nodist_libQxGraph_la_SOURCES = $(MOC_FILES)
 
-dist_salomeres_DATA= \
-       resources/view_fitall.png \
-       resources/view_fitarea.png \
-       resources/view_glpan.png \
-       resources/view_pan.png \
-       resources/view_reset.png \
-       resources/view_zoom.png
+dist_salomeres_DATA =                  \
+       resources/qx_view_fitall.png    \
+       resources/qx_view_fitarea.png   \
+       resources/qx_view_glpan.png     \
+       resources/qx_view_pan.png       \
+       resources/qx_view_reset.png     \
+       resources/qx_view_zoom.png
 
-nodist_salomeres_DATA= \
-       QxGraph_images.qm \
+nodist_salomeres_DATA =                \
+       QxGraph_images.qm       \
        QxGraph_msg_en.qm  
 
-libQxGraph_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
-       -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
-libQxGraph_la_LDFLAGS=$(QT_MT_LIBS) ../SUIT/libsuit.la
+libQxGraph_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
+                        -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
+libQxGraph_la_LDFLAGS  = $(QT_MT_LIBS) ../SUIT/libsuit.la
index e11d0f0afe3cde879be392f54e3b7d615612bcf1..f17edde9fa25ac91ebb58cb67ca3d1ecf47adc41 100644 (file)
@@ -1,25 +1,26 @@
-//  SALOME QxGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxGraph : build Supervisor viewer into desktop
 //
-
 #ifdef WNT
 #ifdef QXGRAPH_EXPORTS
 #define QXGRAPH_EXPORT __declspec(dllexport)
diff --git a/src/QxGraph/QxGraph.pro b/src/QxGraph/QxGraph.pro
new file mode 100644 (file)
index 0000000..deff370
--- /dev/null
@@ -0,0 +1,77 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = QxGraph
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
+
+INCLUDEPATH += $${QT_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT
+
+LIBS += $${QT_MT_LIBS} -L../../lib -lsuit
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += QXGRAPH_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = QxGraph_ActiveItem.h
+HEADERS += QxGraph_Prs.h
+HEADERS += QxGraph_Canvas.h
+HEADERS += QxGraph_CanvasView.h
+HEADERS += QxGraph_ViewWindow.h
+HEADERS += QxGraph_ViewManager.h
+HEADERS += QxGraph_ViewModel.h
+HEADERS += QxGraph_Def.h
+HEADERS += QxGraph.h
+
+SOURCES  = QxGraph_Prs.cxx
+SOURCES += QxGraph_Canvas.cxx
+SOURCES += QxGraph_CanvasView.cxx
+SOURCES += QxGraph_ViewWindow.cxx
+SOURCES += QxGraph_ViewManager.cxx
+SOURCES += QxGraph_ViewModel.cxx
+
+TRANSLATIONS = resources/QxGraph_images.ts \
+               resources/QxGraph_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index fc9f008e7b9dd299759f5c732849a59b35a562f5..aecf9294c1a0482e56ac3100ad1b8dc4b72c6d29 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QXGRAPH_ACTIVEITEM_H
 #define QXGRAPH_ACTIVEITEM_H
index f39c5f6b43461b2e44edaf49424ce55133f0258b..634f4d27d76a5ba6117766ef601e59bfbda5b165 100644 (file)
@@ -1,25 +1,26 @@
-//  SALOME QxGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxGraph : build Supervisor viewer into desktop
 //
-
 #include "QxGraph_Canvas.h"
 #include "QxGraph_Def.h"
 #include "QxGraph_Prs.h"
index 9dd6e2c10e818f144ebbe30e80c05283b77fadee..7425b46de6c7ea45f8725018a745a82df5767791 100644 (file)
@@ -1,25 +1,26 @@
-//  SALOME QxGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxGraph : build Supervisor viewer into desktop
 //
-
 #ifndef QXGRAPH_CANVAS_H
 #define QXGRAPH_CANVAS_H
 
index e7f726b13c72f999398e13da96d7aaf0e916c3c4..54ebc3b49492e3821d73daaa89ac140804f72fa1 100644 (file)
@@ -1,25 +1,26 @@
-//  SALOME QxGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxGraph : build Supervisor viewer into desktop
 //
-
 #include "QxGraph_CanvasView.h"
 #include "QxGraph_Canvas.h"
 #include "QxGraph_ViewWindow.h"
index 6aa5c3b799068f920cc3efe8aff0baec51c9df35..6c3a26cdc2324bc02ce1440529103a47b68ece43 100644 (file)
@@ -1,25 +1,26 @@
-//  SALOME QxGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxGraph : build Supervisor viewer into desktop
 //
-
 #ifndef QXGRAPH_CANVASVIEW_H
 #define QXGRAPH_CANVASVIEW_H
 
index 88937e32536d24c1f066cdce81aea54930eb0b8b..948fd964708d1c5d8e1b415634a67ffc343b9502 100644 (file)
@@ -1,25 +1,26 @@
-//  SALOME QxGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxGraph : build Supervisor viewer into desktop
 //
-
 #ifndef QXGRAPH_DEF_H
 #define QXGRAPH_DEF_H
 
index c9c6b219d3acaba0f6edec79d215ac1698072210..efe4687c0b8f79fc3f350793d5a94a8280d29814 100644 (file)
@@ -1,25 +1,26 @@
-//  SALOME QxGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxGraph : build Supervisor viewer into desktop
 //
-
 #include "QxGraph_Prs.h"
 
 #include "QxGraph_Canvas.h"
index 16161031433d7d5fad4014a2397b787c974b7781..83e49559f408b9b7bca6425eed8ffcc1ee1db018 100644 (file)
@@ -1,25 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QXGRAPH_PRS_H
 #define QXGRAPH_PRS_H
 
-#include <QxGraph.h>
+#include "QxGraph.h"
 
 #include <qcanvas.h>
 #include <map>
index 3709afc7e5d668511245feac9d442e74070aba7a..261a48429719a702e641ed3246529e9f673e2ff9 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QxGraph_ViewManager.h"
 
index 2e45cc3a641f2a06cfdf4efc1630f94c9c827773..4da3ef4fdb759d1b85e7a619e704cc60e8e2dbd3 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QXGRAPH_VIEWMANAGER_H
 #define QXGRAPH_VIEWMANAGER_H
index df49f0829458c483f7d017d420a02025e8ce79da..acaed5f410fdaefdcd1f21bfa29e65940d529ea8 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "QxGraph_ViewModel.h"
 #include "QxGraph_ViewWindow.h"
index e04fcb35eb6f3f7acae58a0b75c3f955f0c11e11..91e0fdf835aab4346d15ed48fcbf5d6aec9994b0 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef QXGRAPH_VIEWMODEL_H
 #define QXGRAPH_VIEWMODEL_H
index 1e64a8b064ce0539c22135561d9f941c8bde24fd..f6f9ed8cf65a7bdc2ea29a49a3df4b582231f713 100644 (file)
@@ -1,25 +1,26 @@
-//  SALOME QxGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxGraph : build Supervisor viewer into desktop
 //
-
 #include "QxGraph_ViewWindow.h"
 #include "QxGraph_Def.h"
 #include "QxGraph_Canvas.h"
index 88fe11bedae8d577077ab4dcb9c112dbe8af2735..2de18419a8b9cb7202eb9e109e003c4e2e01486f 100644 (file)
@@ -1,25 +1,26 @@
-//  SALOME QxGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxGraph : build Supervisor viewer into desktop
 //
-
 #ifndef QXGRAPH_VIEWWINDOW_H
 #define QXGRAPH_VIEWWINDOW_H
 
index 3b59f6125d7809f60060396efe92df60172421d5..377380548b96aa45b860cbf815f027d0977f5117 100644 (file)
@@ -1,25 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QxGraph_images.po
-// Created:   03/02/2007
-// Author:    Margarita Karpunina
-// Copyright (C) CEA 2007
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  File:      QxGraph_images.po
+#  Created:   03/02/2007
+#  Author:    Margarita Karpunina
 
 
 msgid "ICON_QXGRAPH_FITALL"
diff --git a/src/QxGraph/resources/QxGraph_images.ts b/src/QxGraph/resources/QxGraph_images.ts
new file mode 100644 (file)
index 0000000..0d2e33a
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>ICON_QXGRAPH_RESET</source>
+        <translation>qx_view_reset.png</translation>
+    </message>
+    <message>
+        <source>ICON_QXGRAPH_ZOOM</source>
+        <translation>qx_view_zoom.png</translation>
+    </message>
+    <message>
+        <source>ICON_QXGRAPH_GLOBALPAN</source>
+        <translation>qx_view_glpan.png</translation>
+    </message>
+    <message>
+        <source>ICON_QXGRAPH_PAN</source>
+        <translation>qx_view_pan.png</translation>
+    </message>
+    <message>
+        <source>ICON_QXGRAPH_FITALL</source>
+        <translation>qx_view_fitall.png</translation>
+    </message>
+    <message>
+        <source>ICON_QXGRAPH_FITAREA</source>
+        <translation>qx_view_fitarea.png</translation>
+    </message>
+</context>
+</TS>
index 670735b249b91d72d64bae04a144591975250241..6c16a4da0a6dffd54cb8f9a8596ca627e63ab03a 100644 (file)
@@ -1,25 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      QxGraph_msg_en.po
-// Created:   03/02/2007
-// Author:    Margarita Karpunina
-// Copyright (C) CEA 2007
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  File:      QxGraph_msg_en.po
+#  Created:   03/02/2007
+#  Author:    Margarita Karpunina
 
 msgid "LBL_TOOLBAR_LABEL"
 msgstr "View Operations"
diff --git a/src/QxGraph/resources/QxGraph_msg_en.ts b/src/QxGraph/resources/QxGraph_msg_en.ts
new file mode 100644 (file)
index 0000000..ba47798
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>MEN_CHANGE_BACKGROUND</source>
+        <translation>Change Background...</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panning</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Panning the view</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Reset</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Reset View Point</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>View Operations</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/QxGraph/resources/qx_view_fitall.png b/src/QxGraph/resources/qx_view_fitall.png
new file mode 100755 (executable)
index 0000000..87e001d
Binary files /dev/null and b/src/QxGraph/resources/qx_view_fitall.png differ
diff --git a/src/QxGraph/resources/qx_view_fitarea.png b/src/QxGraph/resources/qx_view_fitarea.png
new file mode 100755 (executable)
index 0000000..450dc56
Binary files /dev/null and b/src/QxGraph/resources/qx_view_fitarea.png differ
diff --git a/src/QxGraph/resources/qx_view_glpan.png b/src/QxGraph/resources/qx_view_glpan.png
new file mode 100644 (file)
index 0000000..28ab547
Binary files /dev/null and b/src/QxGraph/resources/qx_view_glpan.png differ
diff --git a/src/QxGraph/resources/qx_view_pan.png b/src/QxGraph/resources/qx_view_pan.png
new file mode 100755 (executable)
index 0000000..ec56cac
Binary files /dev/null and b/src/QxGraph/resources/qx_view_pan.png differ
diff --git a/src/QxGraph/resources/qx_view_reset.png b/src/QxGraph/resources/qx_view_reset.png
new file mode 100755 (executable)
index 0000000..66f81e6
Binary files /dev/null and b/src/QxGraph/resources/qx_view_reset.png differ
diff --git a/src/QxGraph/resources/qx_view_zoom.png b/src/QxGraph/resources/qx_view_zoom.png
new file mode 100755 (executable)
index 0000000..386c966
Binary files /dev/null and b/src/QxGraph/resources/qx_view_zoom.png differ
diff --git a/src/QxGraph/resources/view_fitall.png b/src/QxGraph/resources/view_fitall.png
deleted file mode 100755 (executable)
index c09ff94..0000000
Binary files a/src/QxGraph/resources/view_fitall.png and /dev/null differ
diff --git a/src/QxGraph/resources/view_fitarea.png b/src/QxGraph/resources/view_fitarea.png
deleted file mode 100755 (executable)
index 5b79594..0000000
Binary files a/src/QxGraph/resources/view_fitarea.png and /dev/null differ
diff --git a/src/QxGraph/resources/view_glpan.png b/src/QxGraph/resources/view_glpan.png
deleted file mode 100755 (executable)
index c23322a..0000000
Binary files a/src/QxGraph/resources/view_glpan.png and /dev/null differ
diff --git a/src/QxGraph/resources/view_pan.png b/src/QxGraph/resources/view_pan.png
deleted file mode 100644 (file)
index 038fba1..0000000
Binary files a/src/QxGraph/resources/view_pan.png and /dev/null differ
diff --git a/src/QxGraph/resources/view_reset.png b/src/QxGraph/resources/view_reset.png
deleted file mode 100644 (file)
index 1285064..0000000
Binary files a/src/QxGraph/resources/view_reset.png and /dev/null differ
diff --git a/src/QxGraph/resources/view_zoom.png b/src/QxGraph/resources/view_zoom.png
deleted file mode 100755 (executable)
index b465739..0000000
Binary files a/src/QxGraph/resources/view_zoom.png and /dev/null differ
diff --git a/src/QxScene/DebTrace.hxx b/src/QxScene/DebTrace.hxx
new file mode 100644 (file)
index 0000000..6350ae5
--- /dev/null
@@ -0,0 +1,33 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef __DEBTRACE_HXX__
+#define __DEBTRACE_HXX__
+
+#include <iostream>
+
+#ifdef _DEVDEBUG_
+#define DEBTRACE(msg) {std::cerr<<std::flush<<__FILE__<<" ["<<__LINE__<<"] : "<<msg<<std::endl<<std::flush;}
+#else
+#define DEBTRACE(msg)
+#endif
+
+#endif
diff --git a/src/QxScene/Makefile.am b/src/QxScene/Makefile.am
new file mode 100755 (executable)
index 0000000..86d9c2c
--- /dev/null
@@ -0,0 +1,68 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+lib_LTLIBRARIES = libQxScene.la
+
+salomeinclude_HEADERS= \
+       QxScene_ViewWindow.h \
+       QxScene_ViewManager.h \
+       QxScene_ViewModel.h \
+       QxScene_Def.h \
+       QxScene.h
+
+dist_libQxScene_la_SOURCES= \
+       QxScene_ViewWindow.cxx \
+       QxScene_ViewManager.cxx \
+       QxScene_ViewModel.cxx
+
+MOC_FILES= \
+       QxScene_ViewWindow_moc.cxx \
+       QxScene_ViewManager_moc.cxx \
+       QxScene_ViewModel_moc.cxx
+
+nodist_libQxScene_la_SOURCES= $(MOC_FILES)
+
+dist_salomeres_DATA= \
+       resources/qx_view_fitall.png \
+       resources/qx_view_fitarea.png \
+       resources/qx_view_glpan.png \
+       resources/qx_view_pan.png \
+       resources/qx_view_reset.png \
+       resources/qx_view_zoom.png
+
+# --- warnings: 
+#     QxSceneViewer prefix must be coherent with type defined in QxScene_ViewModel.h
+#                          (for translator loading)
+#     coherence also needed in LightApp.xml and SalomeApp.xml
+
+nodist_salomeres_DATA= \
+       QxSceneViewer_images.qm \
+       QxSceneViewer_msg_en.qm  
+
+libQxScene_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
+       -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
+libQxScene_la_LDFLAGS=$(QT_MT_LIBS) ../SUIT/libsuit.la
+
+# --- warning:
+#     this file is used for debug purposes only, to be removed later
+EXTRA_DIST += DebTrace.hxx
diff --git a/src/QxScene/QxScene.h b/src/QxScene/QxScene.h
new file mode 100644 (file)
index 0000000..858889b
--- /dev/null
@@ -0,0 +1,36 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxScene : build Supervisor viewer into desktop
+//
+#ifdef WNT
+#ifdef QXSCENE_EXPORTS
+#define QXSCENE_EXPORT __declspec(dllexport)
+#else
+#define QXSCENE_EXPORT __declspec(dllimport)
+#endif
+#else
+#define QXSCENE_EXPORT
+#endif
+
+#ifdef WNT
+#pragma warning ( disable:4251 )
+#endif
diff --git a/src/QxScene/QxScene_Def.h b/src/QxScene/QxScene_Def.h
new file mode 100644 (file)
index 0000000..369554a
--- /dev/null
@@ -0,0 +1,35 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxScene : build Supervisor viewer into desktop
+//
+#ifndef QXSCENE_DEF_H
+#define QXSCENE_DEF_H
+
+#define DEF_BACK_COLOR QColor(144, 208, 211)
+#define RECTANGLE_BODY QColor(255,249,147)
+
+#define GRAPH_WIDTH  1250
+#define GRAPH_HEIGHT 950
+
+#define GRAPH_MARGIN 50
+
+#endif
diff --git a/src/QxScene/QxScene_ViewManager.cxx b/src/QxScene/QxScene_ViewManager.cxx
new file mode 100644 (file)
index 0000000..d6846a4
--- /dev/null
@@ -0,0 +1,89 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "QxScene_ViewManager.h"
+#include "QxScene_ViewWindow.h"
+
+//#define _DEVDEBUG_
+#include "DebTrace.hxx"
+
+/*!
+  Constructor
+*/
+QxScene_ViewManager::QxScene_ViewManager( SUIT_Study* theStudy, 
+                                         SUIT_Desktop* theDesktop, 
+                                         SUIT_ViewModel* theViewModel )
+  : SUIT_ViewManager( theStudy, theDesktop, theViewModel )
+{
+  DEBTRACE("QxScene_ViewManager::QxScene_ViewManager");
+  setTitle( tr( "QXSCENE_VIEW_TITLE" ) );
+}
+
+/*!
+  Destructor
+*/
+QxScene_ViewManager::~QxScene_ViewManager()
+{
+  DEBTRACE("QxScene_ViewManager::~QxScene_ViewManager");
+}
+
+
+/*!
+  Adds new view
+  \param theView - view to be added
+*/
+bool QxScene_ViewManager::insertView( SUIT_ViewWindow* theView )
+{
+  DEBTRACE("QxScene_ViewManager::insertView");
+  bool res = SUIT_ViewManager::insertView( theView );
+  return res;
+}
+
+/*!
+  Creates new view
+*/
+void QxScene_ViewManager::createView()
+{
+  DEBTRACE("QxScene_ViewManager::createView");
+  createViewWindow();
+}
+
+/*!
+ *  Method redefined here to allow some housekeeping before closing
+ *  the view (delete a loded schema and everything related).
+ *  If this is not possible, the view is not closed 
+ */
+void QxScene_ViewManager::closeView(SUIT_ViewWindow* theView)
+{
+  DEBTRACE("QxScene_ViewManager::closeView");
+  QxScene_ViewWindow *qxview = dynamic_cast<QxScene_ViewWindow*>(theView);
+  bool OKToClose = true;
+  if (!qxview)
+    OKToClose = true;
+  else
+    OKToClose = qxview->closeRequested();
+   if (OKToClose)
+     {
+       DEBTRACE("SUIT View to close");
+       SUIT_ViewManager::closeView(theView);
+       DEBTRACE("SUIT View closed");
+     }
+}
diff --git a/src/QxScene/QxScene_ViewManager.h b/src/QxScene/QxScene_ViewManager.h
new file mode 100644 (file)
index 0000000..924084c
--- /dev/null
@@ -0,0 +1,48 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef QXSCENE_VIEWMANAGER_H
+#define QXSCENE_VIEWMANAGER_H
+
+#include "QxScene.h"
+
+#include "QxScene_ViewModel.h"
+#include "SUIT_ViewManager.h"
+
+class SUIT_Desktop;
+
+class QXSCENE_EXPORT QxScene_ViewManager : public SUIT_ViewManager
+{
+  Q_OBJECT
+
+public:
+  QxScene_ViewManager( SUIT_Study* theStudy, SUIT_Desktop* theDesktop, SUIT_ViewModel* theViewModel = 0 );
+  ~QxScene_ViewManager();
+
+protected:
+  bool         insertView(SUIT_ViewWindow* theView);
+  virtual void closeView(SUIT_ViewWindow* theView);
+public slots:
+  void         createView();
+
+};
+
+#endif
diff --git a/src/QxScene/QxScene_ViewModel.cxx b/src/QxScene/QxScene_ViewModel.cxx
new file mode 100644 (file)
index 0000000..5d2e675
--- /dev/null
@@ -0,0 +1,117 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "QxScene_ViewModel.h"
+#include "QxScene_ViewWindow.h"
+#include "QxScene_ViewManager.h"
+#include "QxScene_Def.h"
+
+#include "SUIT_Desktop.h"
+#include "SUIT_ViewWindow.h"
+#include "SUIT_Session.h"
+
+#include <qcolordialog.h>
+#include <QMenu>
+#include <QToolBar>
+
+//#define _DEVDEBUG_
+#include "DebTrace.hxx"
+
+/*!
+  Constructor
+*/
+QxScene_Viewer::QxScene_Viewer()
+  :SUIT_ViewModel()
+{
+  DEBTRACE("QxScene_Viewer::QxScene_Viewer");
+}
+
+/*!
+  Destructor
+*/
+QxScene_Viewer::~QxScene_Viewer() 
+{
+  DEBTRACE("QxScene_Viewer::~QxScene_Viewer");
+}
+
+void QxScene_Viewer::setViewManager( SUIT_ViewManager* mgr)
+{
+  DEBTRACE("QxScene_Viewer::setViewManager");
+   SUIT_ViewModel::setViewManager( mgr );
+}
+
+/*!
+  Start initialization of view window
+  \param view - view window to be initialized
+*/
+void QxScene_Viewer::initView( QxScene_ViewWindow* view )
+{
+  DEBTRACE("QxScene_Viewer::initView");
+  if ( view )
+  {
+    view->initLayout();
+  }
+}
+
+/*!
+  Creates new view window
+  \param theDesktop - main window of application
+*/
+SUIT_ViewWindow* QxScene_Viewer::createView(SUIT_Desktop* theDesktop)
+{
+  DEBTRACE("QxScene_Viewer::createView");
+  QxScene_ViewWindow* aRes = new QxScene_ViewWindow( theDesktop, this );
+  initView( aRes );
+  return aRes;
+}
+
+/*!
+  Builds popup for QxScene viewer
+*/
+void QxScene_Viewer::contextMenuPopup(QMenu* thePopup)
+{
+  DEBTRACE("QxScene_Viewer::contextMenuPopup");
+}
+
+/*!
+  SLOT: called if background color is to be changed changed, passes new color to current canvas view
+*/
+void QxScene_Viewer::onChangeBgColor()
+{
+  QxScene_ViewWindow* aView = (QxScene_ViewWindow*)(myViewManager->getActiveView());
+  if( !aView )
+    return;
+  QColor aColorActive = aView->backgroundColor();
+
+  QColor selColor = QColorDialog::getColor( aColorActive, aView);
+  if ( selColor.isValid() )
+    aView->setBackgroundColor(selColor);
+}
+
+/*!
+  SLOT: called when popup item "Show toolbar" is activated, shows toolbar of active view window
+*/
+void QxScene_Viewer::onShowToolbar()
+{
+  QxScene_ViewWindow* aView = (QxScene_ViewWindow*)(myViewManager->getActiveView());
+  if ( aView )
+    aView->getToolBar()->show();    
+}
diff --git a/src/QxScene/QxScene_ViewModel.h b/src/QxScene/QxScene_ViewModel.h
new file mode 100644 (file)
index 0000000..565532c
--- /dev/null
@@ -0,0 +1,57 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef QXSCENE_VIEWMODEL_H
+#define QXSCENE_VIEWMODEL_H
+
+#include "QxScene.h"
+
+#include "SUIT_ViewModel.h"
+
+class QxScene_ViewWindow;
+
+class QXSCENE_EXPORT QxScene_Viewer: public SUIT_ViewModel
+{
+  Q_OBJECT
+
+ public:
+  static QString Type() { return "QxSceneViewer"; }
+
+  QxScene_Viewer();
+  virtual ~QxScene_Viewer();
+
+  virtual void             setViewManager( SUIT_ViewManager* );
+  virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
+  virtual QString          getType() const { return Type(); }
+
+  virtual void             contextMenuPopup(QMenu*);
+
+ protected:
+  void initView(QxScene_ViewWindow* view);
+
+ protected slots:
+  void onShowToolbar();
+  void onChangeBgColor();
+
+ private:
+};
+
+#endif
diff --git a/src/QxScene/QxScene_ViewWindow.cxx b/src/QxScene/QxScene_ViewWindow.cxx
new file mode 100644 (file)
index 0000000..169694b
--- /dev/null
@@ -0,0 +1,283 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxScene : build Supervisor viewer into desktop
+//
+#include "QxScene_ViewWindow.h"
+#include "QxScene_Def.h"
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_Desktop.h>
+
+#include <QtxAction.h>
+#include <QtxMultiAction.h>
+#include <QtxActionToolMgr.h>
+
+//QT Include
+#include <QToolBar>
+#include <QGraphicsRectItem>
+
+//#define _DEVDEBUG_
+#include "DebTrace.hxx"
+
+using namespace std;
+
+/*!
+    Constructor
+*/
+QxScene_ViewWindow::QxScene_ViewWindow( SUIT_Desktop* theDesktop, QxScene_Viewer* theModel)
+  : SUIT_ViewWindow( theDesktop )
+{
+  DEBTRACE("Construct QxScene_ViewWindow");
+  myViewModel = theModel;
+  _scene = 0;
+  _sceneView = 0;
+}
+
+/*!
+  Initialization
+*/
+void QxScene_ViewWindow::initLayout()
+{
+  DEBTRACE("QxScene_ViewWindow::initLayout");
+  createActions();
+  createToolBar();
+  
+  // --- QGraphics test
+
+//   _scene = new QGraphicsScene();
+//   _sceneView = new QGraphicsView(this);
+//   setCentralWidget(_sceneView);
+//   _sceneView->setScene(_scene);
+//   QGraphicsRectItem *rect = _scene->addRect(QRectF(0, 0, 100, 100));
+//   _sceneView->show();
+}
+
+/*!
+  Creates actions of QxScene view window
+*/
+void QxScene_ViewWindow::createActions()
+{
+  DEBTRACE("QxScene_ViewWindow::createActions");
+  QtxActionToolMgr* mgr = toolMgr();
+  QtxAction* aAction;
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+
+  // 2. Scaling operations
+
+  // 2.1. Fit All
+  aAction = new QtxAction( tr( "MNU_FITALL" ),
+                           aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITALL" ) ),
+                           tr( "MNU_FITALL" ),
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_FITALL" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitAll() ) );
+  mgr->registerAction( aAction, FitAllId );
+
+  // 2.2. Fit Rect
+  aAction = new QtxAction( tr( "MNU_FITRECT" ),
+                           aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITAREA" ) ),
+                           tr( "MNU_FITRECT" ),
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_FITRECT" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitArea() ) );
+  mgr->registerAction( aAction, FitRectId );
+
+  // 2.3. Zoom
+  aAction = new QtxAction( tr( "MNU_ZOOM_VIEW" ),
+                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_ZOOM" ) ),
+                           tr( "MNU_ZOOM_VIEW" ),
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_ZOOM_VIEW" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewZoom() ) );
+  mgr->registerAction( aAction, ZoomId );
+
+  // 2.4. Create multi-action for scaling operations
+  QtxMultiAction* aScaleAction = new QtxMultiAction( this );
+  aScaleAction->insertAction( mgr->action( FitAllId  ) );
+  aScaleAction->insertAction( mgr->action( FitRectId ) );
+  aScaleAction->insertAction( mgr->action( ZoomId    ) );
+  mgr->registerAction( aScaleAction, ScaleOpId );
+
+  // 3. Moving operations
+
+  // 3.1. Panning
+  aAction = new QtxAction( tr( "MNU_PAN_VIEW" ),
+                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_PAN" ) ),
+                          tr( "MNU_PAN_VIEW" ), 
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_PAN_VIEW" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewPan() ) );
+  mgr->registerAction( aAction, PanId );
+
+  // 3.2. Global Panning
+  aAction = new QtxAction( tr( "MNU_GLOBALPAN_VIEW" ),
+                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_GLOBALPAN" ) ),
+                           tr( "MNU_GLOBALPAN_VIEW" ),
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_GLOBALPAN_VIEW" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewGlobalPan() ) );
+  mgr->registerAction( aAction, GlobalPanId );
+
+  // 3.3. Create multi-action for moving operations
+  QtxMultiAction* aPanAction = new QtxMultiAction( this );
+  aPanAction->insertAction( mgr->action( PanId ) );
+  aPanAction->insertAction( mgr->action( GlobalPanId ) );
+  mgr->registerAction( aPanAction, MoveOpId );
+
+  // reset
+  aAction = new QtxAction( tr( "MNU_RESET_VIEW" ),
+                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_RESET" ) ),
+                          tr( "MNU_RESET_VIEW" ), 
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_RESET_VIEW" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewReset() ) );
+  mgr->registerAction( aAction, ResetId );
+}
+
+/*!
+  Creates toolbar of QxScene view window
+*/
+void QxScene_ViewWindow::createToolBar()
+{
+  DEBTRACE("QxScene_ViewWindow::createToolBar");
+  QtxActionToolMgr* mgr = toolMgr();
+  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+  mgr->append( ScaleOpId, myToolBar );
+  mgr->append( MoveOpId, myToolBar );
+  mgr->append( ResetId, myToolBar );
+}
+
+/*!
+  \brief Get view window's toolbar.
+  \return toolbar
+*/
+QToolBar* QxScene_ViewWindow::getToolBar()
+{
+  DEBTRACE("QxScene_ViewWindow::getToolBar");
+  return toolMgr()->toolBar( myToolBar );
+}
+
+/*!
+  Destructor
+*/
+QxScene_ViewWindow::~QxScene_ViewWindow()
+{
+  DEBTRACE("destructor QxScene_ViewWindow");
+
+}
+
+/*!
+  Reset the active view
+*/
+void QxScene_ViewWindow::onViewReset()    
+{
+  DEBTRACE( "QxScene_ViewWindow::onViewReset" );
+}
+
+/*!
+  Sets a new center of the active view
+*/
+void QxScene_ViewWindow::onViewGlobalPan()
+{
+  DEBTRACE( "QxScene_ViewWindow::onViewGlobalPan" );
+}
+
+/*!
+  Zooms the active view
+*/
+void QxScene_ViewWindow::onViewZoom()
+{
+  DEBTRACE( "QxScene_ViewWindow::onViewZoom" );
+}
+
+/*!
+  Moves the active view
+*/
+void QxScene_ViewWindow::onViewPan()
+{
+  DEBTRACE( "QxScene_ViewWindow::onViewPan" );
+}
+
+/*!
+  Fits all obejcts within a rectangular area of the active view
+*/
+void QxScene_ViewWindow::onViewFitArea()
+{
+  DEBTRACE( "QxScene_ViewWindow::onViewFitArea" );
+}
+
+/*!
+  Fits all objects in the active view
+*/
+void QxScene_ViewWindow::onViewFitAll()
+{
+  DEBTRACE( "QxScene_ViewWindow::onViewFitAll" );
+}
+
+/*!
+    Set background of the viewport
+*/
+void QxScene_ViewWindow::setBackgroundColor( const QColor& color )
+{
+  DEBTRACE("QxScene_ViewWindow::setBackgroundColor");
+}
+
+/*!
+    Returns background of the viewport
+*/
+QColor QxScene_ViewWindow::backgroundColor() const
+{
+  DEBTRACE("QxScene_ViewWindow::backgroundColor");
+  QColor col;
+  return col;
+}
+
+/*!
+  Custom resize event handler
+*/
+void QxScene_ViewWindow::resizeEvent( QResizeEvent* theEvent )
+{
+  DEBTRACE("QxScene_ViewWindow::resizeEvent");
+}
+
+/*!
+  Get resource manager
+*/
+SUIT_ResourceMgr* QxScene_ViewWindow::resMgr() const
+{ 
+  DEBTRACE("QxScene_ViewWindow::resMgr");
+  return SUIT_Session::session()->resourceMgr(); 
+}
+
+/*!
+ *  emits a signal to ask to close the schema associated to the window.
+ *  A boolean in return indicates if it is OK to close.
+ */
+bool QxScene_ViewWindow::closeRequested()
+{
+  DEBTRACE("QxScene_ViewWindow::closeRequested");
+  bool isClosed = false;
+  emit tryClose(isClosed, this);
+  DEBTRACE("isClosed=" << isClosed);
+  return isClosed;
+}
diff --git a/src/QxScene/QxScene_ViewWindow.h b/src/QxScene/QxScene_ViewWindow.h
new file mode 100644 (file)
index 0000000..dd1f8aa
--- /dev/null
@@ -0,0 +1,105 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME QxScene : build Supervisor viewer into desktop
+//
+#ifndef QXSCENE_VIEWWINDOW_H
+#define QXSCENE_VIEWWINDOW_H
+
+#include "QxScene.h"
+#include "QxScene_ViewModel.h"
+
+#include "SUIT_ViewWindow.h"
+
+#include "QtxAction.h"
+
+#include <qaction.h>
+
+#include <QGraphicsScene>
+#include <QGraphicsView>
+
+#ifdef WIN32
+#pragma warning ( disable:4251 )
+#endif
+
+class SUIT_ResourceMgr;
+
+class QXSCENE_EXPORT QxScene_ViewWindow : public SUIT_ViewWindow {
+  Q_OBJECT
+
+ public:
+  //! Actions ID
+  enum { FitAllId, FitRectId, ZoomId, ScaleOpId, PanId, GlobalPanId, MoveOpId, ResetId };
+
+  QxScene_ViewWindow(SUIT_Desktop* theDesktop, QxScene_Viewer* theModel);
+  virtual ~QxScene_ViewWindow();
+
+  void              setBackgroundColor( const QColor& );
+  QColor            backgroundColor() const;
+
+  QToolBar*         getToolBar();
+
+  SUIT_ResourceMgr* resMgr() const;
+
+  QxScene_Viewer*   getViewModel() const { return myViewModel; }
+  void              setViewModel(QxScene_Viewer* theViewModel) { myViewModel = theViewModel; }
+
+  virtual void      initLayout();
+
+  void              contextPopupEvent(QContextMenuEvent* theEvent) { emit contextMenuRequested( theEvent); }
+  
+  void              setScene(QGraphicsScene* scene) { _scene = scene; }
+  QGraphicsScene*   getScene() { return _scene; }
+  void              setSceneView(QGraphicsView* sceneView){ _sceneView = sceneView; }
+  QGraphicsView*    getSceneView() { return _sceneView; }
+  virtual bool      closeRequested();
+
+ signals:
+  void              tryClose(bool &isClosed, QxScene_ViewWindow* window);
+
+ public slots:
+  void              onViewFitAll();
+  void              onViewFitArea();
+  void              onViewZoom();
+  void              onViewPan(); 
+  void              onViewGlobalPan(); 
+  void              onViewReset(); 
+  
+ protected:
+  void              resizeEvent( QResizeEvent* theEvent );
+
+  QGraphicsScene*   _scene;
+  QGraphicsView*    _sceneView;
+
+ private:
+  void              createActions();
+  void              createToolBar();
+
+  int               myToolBar;
+
+  QxScene_Viewer*   myViewModel;
+};
+
+#ifdef WIN32
+#pragma warning ( default:4251 )
+#endif
+
+#endif
diff --git a/src/QxScene/resources/QxSceneViewer_images.ts b/src/QxScene/resources/QxSceneViewer_images.ts
new file mode 100644 (file)
index 0000000..755bb16
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>ICON_QXSCENE_RESET</source>
+        <translation>qx_view_reset.png</translation>
+    </message>
+    <message>
+        <source>ICON_QXSCENE_ZOOM</source>
+        <translation>qx_view_zoom.png</translation>
+    </message>
+    <message>
+        <source>ICON_QXSCENE_GLOBALPAN</source>
+        <translation>qx_view_glpan.png</translation>
+    </message>
+    <message>
+        <source>ICON_QXSCENE_PAN</source>
+        <translation>qx_view_pan.png</translation>
+    </message>
+    <message>
+        <source>ICON_QXSCENE_FITALL</source>
+        <translation>qx_view_fitall.png</translation>
+    </message>
+    <message>
+        <source>ICON_QXSCENE_FITAREA</source>
+        <translation>qx_view_fitarea.png</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/QxScene/resources/QxSceneViewer_msg_en.ts b/src/QxScene/resources/QxSceneViewer_msg_en.ts
new file mode 100644 (file)
index 0000000..e8188cd
--- /dev/null
@@ -0,0 +1,59 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>MEN_CHANGE_BACKGROUND</source>
+        <translation>Change Background...</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panning</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Panning the view</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Reset</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Reset View Point</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>View Operations</translation>
+    </message>
+</context>
+<context>
+    <name>QxScene_ViewManager</name>
+    <message>
+        <source>QXSCENE_VIEW_TITLE</source>
+        <translation>QGraphics scene:%M - viewer:%V</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/QxScene/resources/QxScene_images.po b/src/QxScene/resources/QxScene_images.po
new file mode 100644 (file)
index 0000000..3ea39eb
--- /dev/null
@@ -0,0 +1,44 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  File:      QxScene_images.po
+#  Created:   03/02/2007
+#  Author:    Margarita Karpunina
+
+
+msgid "ICON_QXSCENE_FITALL"
+msgstr "qx_view_fitall.png"
+
+msgid "ICON_QXSCENE_FITAREA"
+msgstr "qx_view_fitarea.png"
+
+msgid "ICON_QXSCENE_ZOOM"
+msgstr "qx_view_zoom.png"
+
+msgid "ICON_QXSCENE_PAN"
+msgstr "qx_view_pan.png"
+
+msgid "ICON_QXSCENE_GLOBALPAN"
+msgstr "qx_view_glpan.png"
+
+msgid "ICON_QXSCENE_RESET"
+msgstr "qx_view_reset.png"
+
diff --git a/src/QxScene/resources/QxScene_msg_en.po b/src/QxScene/resources/QxScene_msg_en.po
new file mode 100644 (file)
index 0000000..44fba1f
--- /dev/null
@@ -0,0 +1,42 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  File:      QxScene_msg_en.po
+#  Created:   03/02/2007
+#  Author:    Margarita Karpunina
+
+msgid "LBL_TOOLBAR_LABEL"
+msgstr "View Operations"
+
+msgid "DSC_RESET_VIEW"
+msgstr "Reset View Point"
+
+msgid "MNU_RESET_VIEW"
+msgstr "Reset"
+
+msgid "DSC_PAN_VIEW"
+msgstr "Panning the view"
+
+msgid "MNU_PAN_VIEW"
+msgstr "Panning"
+
+msgid "MEN_CHANGE_BACKGROUND"
+msgstr "Change background..."
diff --git a/src/QxScene/resources/qx_view_fitall.png b/src/QxScene/resources/qx_view_fitall.png
new file mode 100755 (executable)
index 0000000..87e001d
Binary files /dev/null and b/src/QxScene/resources/qx_view_fitall.png differ
diff --git a/src/QxScene/resources/qx_view_fitarea.png b/src/QxScene/resources/qx_view_fitarea.png
new file mode 100755 (executable)
index 0000000..450dc56
Binary files /dev/null and b/src/QxScene/resources/qx_view_fitarea.png differ
diff --git a/src/QxScene/resources/qx_view_glpan.png b/src/QxScene/resources/qx_view_glpan.png
new file mode 100644 (file)
index 0000000..28ab547
Binary files /dev/null and b/src/QxScene/resources/qx_view_glpan.png differ
diff --git a/src/QxScene/resources/qx_view_pan.png b/src/QxScene/resources/qx_view_pan.png
new file mode 100755 (executable)
index 0000000..ec56cac
Binary files /dev/null and b/src/QxScene/resources/qx_view_pan.png differ
diff --git a/src/QxScene/resources/qx_view_reset.png b/src/QxScene/resources/qx_view_reset.png
new file mode 100755 (executable)
index 0000000..66f81e6
Binary files /dev/null and b/src/QxScene/resources/qx_view_reset.png differ
diff --git a/src/QxScene/resources/qx_view_zoom.png b/src/QxScene/resources/qx_view_zoom.png
new file mode 100755 (executable)
index 0000000..386c966
Binary files /dev/null and b/src/QxScene/resources/qx_view_zoom.png differ
diff --git a/src/RegistryDisplay/HelpWindow.cxx b/src/RegistryDisplay/HelpWindow.cxx
deleted file mode 100755 (executable)
index a947731..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-//  SALOME RegistryDisplay : GUI for Registry server implementation
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : HelpWindow.cxx
-//  Author : Pascale NOYRET, EDF
-//  Module : SALOME
-//  $Header$
-
-# include "HelpWindow.hxx"
-# include "utilities.h"
-
-# include <qtextview.h>
-# include <qpushbutton.h>
-# include <qtextstream.h> 
-# include <qfile.h> 
-
-using namespace std;
-
-/*!
-  Constructor
-*/
-HelpWindow::HelpWindow(QWidget* parent, const char* name ) 
-     : QMainWindow( parent, name, WType_TopLevel | WDestructiveClose )
-{
-  BEGIN_OF("Constructeur HelpWindow");
-  
-  setCaption( tr( "Help" ) );
-
-  myTextView = new QTextView( this, "myTextView" );
-  QPalette pal = myTextView->palette();
-  QColorGroup cg = pal.active();
-  cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
-  cg.setColor( QColorGroup::HighlightedText, Qt::white );
-  cg.setColor( QColorGroup::Base, QColor( 255,255,220 )  ); 
-  cg.setColor( QColorGroup::Text, Qt::black );
-  pal.setActive  ( cg );
-  cg = pal.inactive();
-  cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
-  cg.setColor( QColorGroup::HighlightedText, Qt::white );
-  cg.setColor( QColorGroup::Base, QColor( 255,255,220 )  ); 
-  cg.setColor( QColorGroup::Text, Qt::black );
-  pal.setInactive( cg );
-  cg = pal.disabled();
-  cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
-  cg.setColor( QColorGroup::HighlightedText, Qt::white );
-  cg.setColor( QColorGroup::Base, QColor( 255,255,220 )  ); 
-  cg.setColor( QColorGroup::Text, Qt::black );
-  pal.setDisabled( cg );
-  myTextView->setPalette( pal );
-  
-  setCentralWidget( myTextView );
-  setMinimumSize( 450, 250 );
-
-  QFile f ( "tmp.txt" );
-  if ( f.open( IO_ReadOnly ) )   
-    {
-      QTextStream t( &f ); 
-      while ( !t.eof() ) 
-       {
-         myTextView->append(t.readLine());
-       }
-    }
-  f.close();
-
-  END_OF("Constructeur HelpWindow");
-}
-
-/*!
-  Destructor
-*/
-HelpWindow::~HelpWindow()
-{
-  BEGIN_OF("Destructeur HelpWindow");
-  END_OF("Destructeur HelpWindow");
-};
-
-/*!
-  Sets text
-*/
-void HelpWindow::setText( const QString& text )
-{
-  myTextView->setText( text );
-}
-
-
diff --git a/src/RegistryDisplay/HelpWindow.hxx b/src/RegistryDisplay/HelpWindow.hxx
deleted file mode 100755 (executable)
index 31f6405..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//  SALOME RegistryDisplay : GUI for Registry server implementation
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : HelpWindow.hxx
-//  Author : Pascale NOYRET, EDF
-//  Module : SALOME
-//  $Header$
-
-#ifndef __HELPWINDOW_H__
-#define __HELPWINDOW_H__
-
-#include <qapplication.h>
-#include <qmainwindow.h>
-
-class QTextView;
-
-class HelpWindow : public QMainWindow
-{
-  Q_OBJECT
-
-public:
-  HelpWindow( QWidget* parent = 0, const char* name = 0);
-  ~HelpWindow();
-
-  void setText( const QString& text );
-  QTextView* textView() const { return myTextView; }
-
-private:
-  QTextView* myTextView;
-};
-
-#endif
diff --git a/src/RegistryDisplay/IntervalWindow.cxx b/src/RegistryDisplay/IntervalWindow.cxx
deleted file mode 100755 (executable)
index 780a876..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  SALOME RegistryDisplay : GUI for Registry server implementation
-//
-//  File   : IntervalWindow.cxx
-//  Author : Oksana TCHEBANOVA
-//  Module : SALOME
-
-#include <IntervalWindow.hxx>
-
-#include <qbuttongroup.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-# include "utilities.h"
-
-#define MARGIN_SIZE      11
-#define SPACING_SIZE      6
-#define MIN_SPIN_WIDTH  100 
-
-/*!
-  Constructor
-*/
-IntervalWindow::IntervalWindow ( QWidget* parent )
-     : QDialog( parent, "IntervalWindow" , true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
-{
-  BEGIN_OF("IntervalWindow constructor")
-  setCaption( tr( "Refresh Interval"  ) );
-  setSizeGripEnabled( true );
-
-  QGridLayout* topLayout = new QGridLayout( this );
-  topLayout->setSpacing( SPACING_SIZE );
-  topLayout->setMargin( MARGIN_SIZE );
-
-  QGroupBox* intervalGrp = new QGroupBox( this, "intervalGrp" );
-  intervalGrp->setColumnLayout( 0, Qt::Horizontal );//Vertical
-  intervalGrp->layout()->setSpacing( 0 );
-  intervalGrp->layout()->setMargin( 0 );
-  QGridLayout* intervalGrpLayout = new QGridLayout( intervalGrp->layout() );
-  intervalGrpLayout->setAlignment( Qt::AlignTop );
-  intervalGrpLayout->setSpacing( SPACING_SIZE );
-  intervalGrpLayout->setMargin( MARGIN_SIZE  );  
-
-  QHBoxLayout* aBtnLayout = new QHBoxLayout;
-  aBtnLayout->setSpacing( SPACING_SIZE );
-  aBtnLayout->setMargin( 0 );
-
-  myButtonOk = new QPushButton( this, "buttonOk" );
-  myButtonOk->setText( tr( "BUT_OK"  ) );
-  myButtonOk->setAutoDefault( TRUE );
-  myButtonOk->setDefault( TRUE );
-  
-  myButtonCancel = new QPushButton( this, "buttonCancel" );
-  myButtonCancel->setText( tr( "BUT_CANCEL"  ) );
-  myButtonCancel->setAutoDefault( TRUE );
-
-  QLabel* TextLabel = new QLabel( intervalGrp, "TextLabel" );
-  TextLabel->setText( tr( "Please, enter a number of seconds:"  ) );
-
-  mySpinBox = new QSpinBox( 1, 999999999, 1, intervalGrp, "SpinBox" );
-  mySpinBox->setValue( 100 );
-  mySpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-  mySpinBox->setMinimumWidth(MIN_SPIN_WIDTH);
-
-  intervalGrpLayout->addWidget(TextLabel, 0, 0);
-  intervalGrpLayout->addWidget(mySpinBox, 0, 1);
-
-  aBtnLayout->addWidget( myButtonOk );
-  aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
-  aBtnLayout->addWidget( myButtonCancel );
-
-  topLayout->addWidget( intervalGrp, 0, 0 );
-  topLayout->addLayout( aBtnLayout, 1, 0 ); 
-
-  END_OF("IntervalWindow constructor")
-}
-
-/*!
-  Destructor
-*/
-IntervalWindow::~IntervalWindow() {}
-
-/*!
-   Sets start interval size
-*/
-void IntervalWindow::setValue(const int size)
-{
-  mySpinBox->setValue(size);
-}
-
-/*!
-   Gets interval size
-*/
-int IntervalWindow::getValue()
-{
-  return mySpinBox->value();
-}
-
-/*!
-   gets a pointer to myButtonOk
-*/
-QPushButton* IntervalWindow::Ok()
-{
-  return myButtonOk;
-}
-
-/*!
-   gets a pointer to myButtonCancel
-*/
-QPushButton* IntervalWindow::Cancel()
-{
-  return myButtonCancel;
-}
diff --git a/src/RegistryDisplay/IntervalWindow.hxx b/src/RegistryDisplay/IntervalWindow.hxx
deleted file mode 100755 (executable)
index 420ce5a..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  SALOME RegistryDisplay : GUI for Registry server implementation
-//
-//  File   : IntervalWindow.hxx
-//  Author : Oksana TCHEBANOVA
-//  Module : SALOME
-
-#ifndef IntervalWindow_HeaderFile
-#define IntervalWindow_HeaderFile
-
-# include <qwidget.h>
-# include <qdialog.h>
-# include <qpushbutton.h>
-# include <qspinbox.h>
-
-#ifndef WNT
-using namespace std;
-#endif
-
-class IntervalWindow : public QDialog
-{
-  Q_OBJECT
-
-public:
-  IntervalWindow( QWidget* parent = 0 );
-  ~IntervalWindow();
-  
-  QPushButton* Ok();
-  QPushButton* Cancel();
-
-  int getValue();
-  void setValue( int );
-
-private:
-  QSpinBox* mySpinBox;
-  QPushButton* myButtonOk;
-  QPushButton* myButtonCancel;
-};
-
-#endif
diff --git a/src/RegistryDisplay/Makefile.am b/src/RegistryDisplay/Makefile.am
deleted file mode 100755 (executable)
index 2034b50..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#  SALOME RegistryDisplay : GUI for Registry server implementation
-#
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#
-#
-#  File   : Makefile.in
-#  Author : Paul RASCLE, EDF
-#  Module : SALOME
-#  $Header$
-
-include $(top_srcdir)/adm_local/unix/make_common_starter.am
-
-lib_LTLIBRARIES = libRegistryDisplay.la 
-
-salomeinclude_HEADERS= \
-       HelpWindow.hxx \
-       IntervalWindow.hxx \
-       RegWidget.h
-
-dist_libRegistryDisplay_la_SOURCES= \
-       HelpWindow.cxx \
-       RegWidget.cxx \
-       RegWidgetFactory.cxx \
-       IntervalWindow.cxx
-
-MOC_FILES = RegWidget_moc.cxx
-nodist_libRegistryDisplay_la_SOURCES= $(MOC_FILES)
-
-libRegistryDisplay_la_CPPFLAGS=$(QT_INCLUDES) @KERNEL_CXXFLAGS@ @CORBA_CXXFLAGS@ @CORBA_INCLUDES@\
-       -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl
-libRegistryDisplay_la_LDFLAGS=$(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSalomeNS -lOpUtil -lSalomeIDLKernel
diff --git a/src/RegistryDisplay/RegWidget.cxx b/src/RegistryDisplay/RegWidget.cxx
deleted file mode 100755 (executable)
index 413dca7..0000000
+++ /dev/null
@@ -1,820 +0,0 @@
-//  SALOME RegistryDisplay : GUI for Registry server implementation
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : RegWidget.cxx
-//  Author : Pascale NOYRET, EDF
-//  Module : SALOME
-//  $Header$
-
-# include <qpushbutton.h>
-# include <qlistview.h>
-# include <qtabwidget.h> 
-# include <qstatusbar.h>
-# include <qtextview.h>
-# include <qtimer.h>
-# include <qinputdialog.h>
-# include <qtoolbar.h>
-# include <qdir.h>
-# include <qtooltip.h>
-
-# include "SALOME_NamingService.hxx"
-# include "ServiceUnreachable.hxx"
-# include "Utils_SINGLETON.hxx"
-# include "Utils_CommException.hxx"
-
-# include "utilities.h"
-# include "OpUtil.hxx"
-
-# include "RegWidget.h"
-# include "HelpWindow.hxx" 
-# include "IntervalWindow.hxx"
-using namespace std;
-
-typedef int PIXELS;
-RegWidget* RegWidget::myRegWidgetPtr = 0;
-QString addSlash( const QString& );
-QString findFile( QString filename );
-
-#define BOLD( text ) ( QString( "<b>" ) + QString( text ) + QString( "</b>" ) )
-
-static const char* const time_data[] = { 
-"16 16 6 1",
-". c None",
-"b c None",
-"# c #000000",
-"a c #4c4c4c",
-"d c #878787",
-"c c #ffffff",
-".....#####ab....",
-"...##cc#dc##ab..",
-"..#ccc###dcc#ab.",
-".#ccccc#dcccc#a.",
-".#ccccc#dcccc#ab",
-"#cccccc#dccccc#a",
-"#cccccc#dccc#c#a",
-"#c##ccc########a",
-"#ccddcccdddd#d#a",
-"#cccccccccccdc#a",
-".#ccccccccccc#aa",
-".#ccccc#ccccc#a.",
-"..#cccc#dccc#aa.",
-"...##cccdc##aa..",
-".....#####aaa...",
-"......aaaaa....."};
-
-static const char* const close_data[] = { 
-"16 16 6 1",
-"d c None",
-". c None",
-"# c #000000",
-"a c #4c4c4c",
-"c c #5b5b5b",
-"b c #ffffff",
-".....#####a.....",
-"...##bbbbb##a...",
-"..#bbbbbbbbb#a..",
-".#b#cbbbbbb#d#a.",
-".#bc#cbbbb#cb#a.",
-"#bbbc#cbb#cbbb#a",
-"#bbbbc#c#cbbbb#a",
-"#bbbbbc#cbbbbb#a",
-"#bbbbc#c#cbbbb#a",
-"#bbb#ccbb##bbb#a",
-".#b#c#bbbbc#b#aa",
-".#bc#bbbbbb#c#a.",
-"..#bbbbbbbbb#aa.",
-"...##bbbbb##aa..",
-".....#####aaa...",
-"......aaaaa....."};
-
-static const char* const refresh_data[] = { 
-"16 16 5 1",
-". c None",
-"# c #000000",
-"a c #4c4c4c",
-"c c #878787",
-"b c #ffffff",
-".....#####a.....",
-"...##bb#bb##a...",
-"..#bbbbc#bbb#a..",
-".#bbbb####cbb#a.",
-".#bbb#cc#cbbb#a.",
-"#bbb#cb#cbbbbb#a",
-"#bb#cbbbbbb#bb#a",
-"#bb#cbbbbbb#cb#a",
-"#bb#cbbbbbb#cb#a",
-"#bbbbbb#bb#cbb#a",
-".#bbbb#cb#cbb#aa",
-".#bbb####cbbb#a.",
-"..#bbb#cbbbb#aa.",
-"...##bb#cb##aa..",
-".....#####aaa...",
-"......aaaaa....."};
-
-/*!
-  Creates components list
-*/
-
-Registry::Components_var MakeRegistry( CORBA::ORB_var &orb )
-{
-
-  const char *registryName="Registry" ;
-  
-  SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
-  naming.init_orb( orb ) ;
-  
-  // Recuperation de la reference de l'objet
-  CORBA::Object_var object = 0 ;
-  try
-    {
-      SCRUTE(registryName) ;
-      object = naming.Resolve( registryName ) ;
-      if(CORBA::is_nil(object)) throw CommException( "unable to find the RegistryService" ) ;
-    }
-  catch( const ServiceUnreachable &ex )
-    {
-      MESSAGE( ex.what() )
-      exit( EXIT_FAILURE ) ;
-    }
-  catch( const CORBA::Exception &exx )
-    {
-      exit( EXIT_FAILURE ) ;
-    }
-  
-  // Specialisation de l'objet generique
-  
-  return Registry::Components::_narrow( object ) ;
-}
-
-/*!
-  Only one global registry window should exist at the moment
-  This method creates registry window if necessary and returns it
-  [ static ] 
-*/
-RegWidget* RegWidget::GetRegWidget( CORBA::ORB_var &orb , QWidget *parent, const char *name )
-{
-  if ( !myRegWidgetPtr ) 
-    myRegWidgetPtr = new RegWidget( orb, parent, name );
-  return myRegWidgetPtr;
-}
-
-/*!
-  Constructor  
-*/
-RegWidget::RegWidget(CORBA::ORB_var &orb, QWidget *parent, const char *name ) 
-     : QMainWindow( parent, name, WType_TopLevel | WDestructiveClose ),
-       _VarComponents( MakeRegistry(orb) ),
-       _clients(0), _history(0), _parent( parent ),
-       _tabWidget(0), _refresh(0), _interval(0),
-       myInfoWindow(0), myHelpWindow(0), myIntervalWindow(0)
-{
-   QString aFile = findFile("default.png");
- /* char* dir = getenv( "CSF_ResourcesDefaults" );
-  QString path( "" );
-  if ( dir ) {
-    QDir qDir( dir );
-    path = qDir.filePath( "default.png" );
-  }*/
-  QPixmap pm ( aFile );
-  if ( !pm.isNull() )
-    setIcon( pm );
-
-  // pixmap for buttons
-  QPixmap image_refresh ( ( const char** ) refresh_data );
-  QPixmap image_interval( ( const char** ) time_data );
-  QPixmap image_close   ( ( const char** ) close_data );
-
-  // Buttons definition
-  QToolBar* topbar = new QToolBar( tr("Toolbar"), this );
-  setDockEnabled( topbar, DockTornOff, false );
-  setDockMenuEnabled( false );
-
-  _refresh = new QPushButton( tr( "Refresh" ), topbar );
-  _refresh->setIconSet( image_refresh );
-  _refresh->setFocusPolicy( NoFocus );
-  connect( _refresh, SIGNAL( clicked() ), this, SLOT( slotListeSelect() ) );
-  QToolTip::add( _refresh, "", toolTipGroup(), tr("Immediately updates list of components") );
-  
-  /* PAL5540 - this button is needless
-  QPushButton* help = new QPushButton( tr( "Help" ), topbar );
-  connect( help, SIGNAL( clicked() ), this, SLOT( slotHelp() ) );
-  QToolTip::add( help, "", toolTipGroup(), tr("Opens Help window") );
-  */
-  
-  _interval = new QPushButton( tr( "Interval" ), topbar );
-  _interval->setIconSet( image_interval );
-  _interval->setFocusPolicy( NoFocus );
-  connect( _interval, SIGNAL( clicked() ), this, SLOT( slotSelectRefresh() ) );
-  QToolTip::add( _interval, "", toolTipGroup(), tr("Changes refresh interval") );
-  
-  topbar->addSeparator();
-  _close = new QPushButton( tr("Close"), topbar );
-  _close->setIconSet( image_close );
-  _close->setFocusPolicy( NoFocus );
-  connect( _close, SIGNAL( clicked() ), this, SLOT( close() ) );
-  QToolTip::add( _close, "", toolTipGroup(), tr("Closes Registry window") );
-  
-  // Display area and associated slots definition
-  _tabWidget = new QTabWidget( this );
-  _clients   = new QListView( _tabWidget );
-  SetListe();
-  _history   = new QListView( _tabWidget );
-  SetListeHistory();
-  
-  _tabWidget->addTab( _clients, tr( "Running" ) );
-  _tabWidget->addTab( _history, tr( "History" ) );
-  connect( _tabWidget, SIGNAL( currentChanged( QWidget* )), this, SLOT( slotListeSelect() ) );
-  connect( _clients,   SIGNAL( clicked( QListViewItem* ) ),        this, SLOT( slotClientChanged( QListViewItem* ) ) );
-  connect( _history,   SIGNAL( clicked( QListViewItem* ) ),        this, SLOT( slotHistoryChanged( QListViewItem* ) ) );
-  setCentralWidget( _tabWidget );
-  
-  // Timer definition (used to automaticaly refresh the display area)
-  _counter = new QTimer( this );
-  connect( _counter, SIGNAL( timeout() ), this, SLOT( slotListeSelect() ) );
-  myRefreshInterval = 10;
-  _counter->start( myRefreshInterval * 1000 );
-  
-  PIXELS xpos    = 160 ;
-  PIXELS ypos    = 100 ;
-  PIXELS largeur = 800 ;
-  PIXELS hauteur = 350 ;
-  setGeometry( xpos, ypos, largeur, hauteur ) ;
-  setCaption( name ) ;
-  statusBar()->message("    ");
-}
-
-/*!
-  Destructor
-*/
-RegWidget::~RegWidget()
-{
-  MESSAGE("Debut du Destructeur");
-  _counter->stop();
-  myRegWidgetPtr = 0;
-};
-
-/*!
-  Event filter
-*/
-bool RegWidget::eventFilter( QObject* object, QEvent* event )
-{
-  if ( object ) {
-    if ( object == myHelpWindow && event->type() == QEvent::Close ) {
-      myHelpWindow = 0;
-    }
-    else if ( object == myInfoWindow && event->type() == QEvent::Close ) {
-      myInfoWindow = 0;
-    }
-    else if ( object == myIntervalWindow && event->type() == QEvent::Close ) {
-      myIntervalWindow = 0;
-    }
-    else if ( object == _clients && event->type() == QEvent::KeyPress ) {
-      QKeyEvent* ke = (QKeyEvent*)event;
-      if ( ke->key() == Key_Enter || ke->key() == Key_Return ) {
-       slotClientChanged( _clients->currentItem() );
-      }
-    }
-    else if ( object == _history && event->type() == QEvent::KeyPress ) {
-      QKeyEvent* ke = (QKeyEvent*)event;
-      if ( ke->key() == Key_Enter || ke->key() == Key_Return ) {
-       slotHistoryChanged( _history->currentItem() );
-      }
-    }
-  }
-  return QMainWindow::eventFilter( object, event );
-}
-
-/*!
-  Searches item in the list and returns it's index or -1 if not found
-*/
-int RegWidget::numitem(const QString &name, const QString &pid, const QString &machine,const Registry::AllInfos *listclient)
-{
-  BEGIN_OF("numitem");
-  for (CORBA::ULong i=0; i<listclient->length(); i++)
-    {       
-      const Registry::Infos & c_info=(*listclient)[i];
-      ASSERT( c_info.name!=NULL);
-      QString b;
-      b.setNum(int(c_info.pid));
-      if ( (name.compare(QString(c_info.name)) == 0) && 
-         (machine.compare(QString(c_info.machine)) == 0) && 
-         (pid.compare(b) == 0) )
-       {
-         END_OF("numitem");
-         return i;
-       }
-    }
-  END_OF("numitem");
-  return -1;
-}
-
-/*!
-  Returns text, containing information about client [ static ]
-*/
-QString RegWidget::setlongText( const Registry::Infos &c_info)
-{
-  BEGIN_OF("setlongText");
-  ASSERT( c_info.name != NULL );
-  QString a = QString( "<hr><h2>" ) + tr( "Code" ) + QString( " : " );
-  a.append( QString( c_info.name ) );
-  a.append( "</h1><hr><br>" );
-  a.append( tr( "Process Id" ) + QString( " : " ) );
-  a.append( BOLD( QString::number( int( c_info.pid ) ) ) );
-  a.append( QString( " " ) + tr( "on machine" ) + QString( " " ) );
-  a.append( BOLD( c_info.machine ) ); 
-  a.append( QString( " " ) + tr( "ip address" ) + QString( " : " ) );
-  a.append( BOLD( c_info.adip ) );
-  a.append( "<br>" );
-  
-  a.append( tr( "launched by user" ) + QString( " " ) );
-  a.append( BOLD( c_info.pwname ) );
-  a.append( QString( " ( " ) + tr( "pid" ) + QString( " : " ) );
-  a.append( BOLD( QString::number( int( c_info.uid ) ) ) );
-  a.append( QString( " )<br> " ) + tr( "in directory" ) + QString( " " ));
-  a.append( BOLD( c_info.cdir ) );
-  
-  time_t aTime;
-  a.append( QString( "<br>" ) + tr( "begins" ) + QString( " " ) );
-  aTime = time_t(c_info.tc_start);
-  char * t1 = (char * )duplicate(ctime(&aTime));
-  t1 [strlen(t1) -1 ] = ' ';
-  a.append( BOLD( t1 ) ); 
-  delete [] t1;
-  a.append( "<br>" );
-  
-  if (c_info.tc_hello != 0 )
-    {
-      aTime = time_t(c_info.tc_hello);
-      char * t2 = (char * )duplicate(ctime(&aTime));
-      t2 [strlen(t2) -1 ] = ' ';
-      a.append( tr( "last signal" ) + QString(" : ") ); 
-      a.append( BOLD( t2 ) ); 
-      a.append( "<br>" );
-      delete [] t2;
-    }
-  if ((c_info.tc_end - c_info.difftime) != 0)
-    {
-      aTime = time_t(c_info.tc_end);
-      char * t3 = (char * )duplicate(ctime(&aTime));
-      t3 [strlen(t3) -1 ] = ' ';
-      a.append( tr( "ends" ) + QString( " " ) ); 
-      a.append( BOLD( t3 ) ); 
-      a.append( "<br>" );
-      delete [] t3;
-    }
-  else
-    {
-      a.append( tr( "still running" ) + QString( "<br>" ) );
-    }
-  
-  SCRUTE(c_info.difftime);
-  if (c_info.difftime!= 0)
-    {
-      a.append( QString( "(" ) + tr( "Time on" ) + QString( " " ) ); 
-      a.append( BOLD( c_info.machine ) ); 
-      a.append( QString( " " ) + tr( "differs from server's time. The difference is" ) + QString( " " )); 
-      a.append( BOLD( QString::number( int( c_info.difftime ) ) ) );
-      a.append( QString( " " ) + tr( "seconds" ) + QString( ")<br>" ) );
-    }
-  END_OF("setlongText");  
-  return a;
-  
-}
-
-/*!
-  Close event
-*/
-void RegWidget::closeEvent( QCloseEvent *e)
-{
-  BEGIN_OF("closeEvent");
-  if ( myInfoWindow )
-    myInfoWindow->close();
-  if ( myHelpWindow )
-    myHelpWindow->close();
-  if (myIntervalWindow)
-    myIntervalWindow->close();
-  e->accept();
-  END_OF("closeEvent");
-};
-
-/*!
-  Setups Clients list
-*/
-void RegWidget::SetListe()
-{
-  BEGIN_OF("SetListe");
-  _clients->installEventFilter( this );
-  _clients->setAllColumnsShowFocus( true );
-  _clients->addColumn( tr( "Component" ), -1);
-  _clients->addColumn( tr( "PID" ), -1 );
-  _clients->addColumn( tr( "User Name" ), -1 );
-  _clients->addColumn( tr( "Machine" ), -1 );
-  _clients->addColumn( tr( "begins" ), -1 );
-  _clients->addColumn( tr( "hello" ) , -1 );
-  _clients->setColumnAlignment( 1, Qt::AlignRight );
-  END_OF("SetListe");
-}
-
-/*!
-  Setups History list
-*/
-void RegWidget::SetListeHistory()
-{
-   BEGIN_OF("SetListeHistory")
-  _history->installEventFilter( this );
-  _history->setAllColumnsShowFocus( true );
-  _history->addColumn( tr( "Component" ), -1);
-  _history->addColumn( tr( "PID" ), -1 );
-  _history->addColumn( tr( "User Name" ), -1 );
-  _history->addColumn( tr( "Machine" ), -1 );
-  _history->addColumn( tr( "begins" ), -1 );
-  _history->addColumn( tr( "ends" ), -1 );
-  _history->setColumnAlignment( 1, Qt::AlignRight );
-   END_OF("SetListeHistory")
-}
-
-/*!
-  Updates History list
-*/
-void RegWidget::InfoHistory()
-{
-
-  BEGIN_OF("InfoHistory")
-    _history->clear();
-  try
-    {
-      time_t aTime;
-      _serverhistory = _VarComponents->history();
-      for (CORBA::ULong i=0; i<_serverhistory->length(); i++)
-       {       
-         const Registry::Infos & c_info=(*_serverhistory)[i];
-         ASSERT( c_info.name!=NULL);
-         QString a;
-         a.setNum(int(c_info.pid));
-         aTime = time_t(c_info.tc_start);
-         char * t1 = (char * )duplicate(ctime(&aTime));
-         t1 [strlen(t1) -1 ] = ' ';
-         aTime = time_t(c_info.tc_end);
-         char * t2 = (char * )duplicate(ctime(&aTime));
-         t2 [strlen(t2) -1 ] = ' ';
-         QListViewItem * item = new QListViewItem(_history, QString(c_info.name),\
-                                                  a, QString(c_info.pwname), QString(c_info.machine), \
-                                                  QString(t1), QString(t2));
-         item=0 ;
-         delete [] t1;
-         delete [] t2;
-         
-       }
-    }
-  catch( ... )
-    {
-      _interval->setDisabled( TRUE ) ;
-      _refresh->setDisabled( TRUE ) ;
-      _counter->stop();
-      MESSAGE("Sorry, No more Registry Server") ;
-      statusBar()->message( tr( "Sorry, No more Registry Server" ) ) ;
-    }
-  END_OF("InfoHistory")
-}
-
-/*!
-  Updates clients list
-*/
-void RegWidget::InfoReg()
-{
-  BEGIN_OF("InfoReg")
-  _clients->clear();
-  try
-    {
-      time_t aTime;
-      _serverclients = _VarComponents->getall();
-      for (CORBA::ULong i=0; i<_serverclients->length(); i++)
-       {       
-         const Registry::Infos & c_info=(*_serverclients)[i];
-         ASSERT( c_info.name!=NULL);
-         QString a;
-         a.setNum(int(c_info.pid));
-         aTime = time_t(c_info.tc_start);
-         char * t1 = (char * )duplicate(ctime(&aTime));
-         t1 [strlen(t1) -1 ] = ' ';
-         aTime = time_t(c_info.tc_hello);
-         char * t2 = (char * )duplicate(ctime(&aTime));
-         t2 [strlen(t2) -1 ] = ' ';
-         QListViewItem * item = new QListViewItem(_clients, QString(c_info.name),\
-                                                  a, QString(c_info.pwname), QString(c_info.machine), \
-                                                  QString(t1), QString(t2));
-         item=0 ;
-         delete [] t1;
-         delete [] t2;
-         
-       }
-    }
-  catch( ... )
-    {
-      _interval->setDisabled( TRUE ) ;
-      _refresh->setDisabled( TRUE ) ;
-      _counter->stop();
-      MESSAGE("Sorry, No more Registry Server") ;
-      statusBar()->message( tr( "Sorry, No more Registry Server" ) ) ;
-    }
-  END_OF("InfoReg")
-}
-
-/*!
-  Called when <Refresh> button is clicked
-*/
-void RegWidget::slotListeSelect()
-{
-  try
-    {
-      ASSERT(_tabWidget->currentPage() != NULL);
-      if (_tabWidget->currentPage () == _clients) InfoReg();
-      else if (_tabWidget->currentPage () == _history) InfoHistory();
-    }
-  catch( ... )
-    {
-      MESSAGE("Sorry, No more Registry Server") ;
-      statusBar()->message( tr( "Sorry, No more Registry Server" ) ) ;
-    }
-}
-
-/*!
-  Called when <Interval> button is clicked (changing refresh interval)
-*/
-void RegWidget::slotSelectRefresh()
-{
-  BEGIN_OF("slotSelectRefresh");
-  myIntervalWindow = new IntervalWindow(this);
-  myIntervalWindow->installEventFilter( this );
-  myIntervalWindow->setValue(myRefreshInterval);
-  myIntervalWindow->show();
-  connect( myIntervalWindow->Cancel(), SIGNAL( clicked() ), myIntervalWindow, SLOT( close() ) );
-  connect( myIntervalWindow->Ok(), SIGNAL( clicked() ), this, SLOT( slotIntervalOk() ) );
-  END_OF("slotSelectRefresh");
-}
-
-/*!
-  SLOT: called when button OK is clicked in interval window
-*/
-void RegWidget::slotIntervalOk()
-{
-  BEGIN_OF("slotIntervalOk");
-  myRefreshInterval = myIntervalWindow->getValue();
-  _counter->changeInterval( myRefreshInterval * 1000 );
-  SCRUTE(myRefreshInterval);
-  myIntervalWindow->close();
-  END_OF("slotIntervalOk");
-}
-/*!
-  Called when <Help> button is clicked
-*/
-void RegWidget::slotHelp()
-{
-  BEGIN_OF("slotHelp()");
-
-  if ( !myHelpWindow ) {
-    myHelpWindow  = new HelpWindow( this );
-    myHelpWindow->installEventFilter( this );
-  }
-  myHelpWindow->show();
-  myHelpWindow->raise();
-  myHelpWindow->setActiveWindow();
-  
-  END_OF("slotHelp()") ;
-}
-
-/*!
-  Called when user clicks on item in <Running> list
-*/
-void RegWidget::slotClientChanged( QListViewItem* item )
-{
-  BEGIN_OF("slotClientChanged()") ;
-
-  if ( item <= 0)
-    return;
-
-  blockSignals( true ); // for sure that item will not be deleted when refreshing
-
-  int numeroItem = numitem(item->text(0), item->text(1), item->text(3), _serverclients);
-  SCRUTE(numeroItem) ;
-  SCRUTE(item->text(1)) ;
-  
-  ASSERT(numeroItem>=0) ;
-  ASSERT((size_t)numeroItem<_serverclients->length()) ;
-  const Registry::Infos & c_info=(*_serverclients)[numeroItem];
-  ASSERT( c_info.name!=NULL);
-  
-  if ( !myInfoWindow ) {
-    myInfoWindow  = new InfoWindow( this );
-    myInfoWindow->installEventFilter( this );
-  }
-  QString a = tr( "More about" ) + QString( " " ) + QString( c_info.name );
-  myInfoWindow->setCaption(a);
-  myInfoWindow->setText( RegWidget::setlongText( c_info) );
-  myInfoWindow->show();
-  myInfoWindow->raise();
-  myInfoWindow->setActiveWindow();
-
-  blockSignals( false ); // enabling signals again
-
-  END_OF("slotClientChanged()") ;
-  return ;
-}
-
-/*!
-  Called when user clicks on item in <History> list
-*/
-void RegWidget::slotHistoryChanged( QListViewItem* item )
-{
-
-  BEGIN_OF("slotHistoryChanged()") ;
-  
-  if ( item <= 0)
-    return;
-
-  blockSignals( true ); // for sure that item will not be deleted when refreshing
-
-  int numeroItem = numitem(item->text(0), item->text(1), item->text(3), _serverhistory);
-  
-  SCRUTE(numeroItem) ;
-  SCRUTE(item->text(1)) ;
-  ASSERT(numeroItem>=0) ;
-  ASSERT((size_t)numeroItem<_serverhistory->length()) ;
-  const Registry::Infos & c_info=(*_serverhistory)[numeroItem];
-  ASSERT( c_info.name!=NULL);
-  
-  if ( !myInfoWindow ) {
-    myInfoWindow  = new InfoWindow( this );
-    myInfoWindow->installEventFilter( this );
-  }
-  QString a = tr( "More about" ) + QString( " " ) + QString( c_info.name );
-  myInfoWindow->setCaption(a);
-  myInfoWindow->setText( RegWidget::setlongText( c_info ) );
-  myInfoWindow->show();
-  myInfoWindow->raise();
-  myInfoWindow->setActiveWindow();
-
-  blockSignals( false ); // enabling signals again
-
-  END_OF("slotHistoryChanged()") ;
-  return ;
-}
-
-/*!
-  Constructor
-*/
-InfoWindow::InfoWindow( QWidget* parent, const char* name )
-     : QMainWindow( parent, name, WType_TopLevel | WDestructiveClose )
-{
-  BEGIN_OF("InfoWindow");
-  myTextView = new QTextView( this, "myTextView" );
-  setCentralWidget( myTextView );
-  setMinimumSize( 450, 250 );
-  END_OF("InfoWindow");
-}
-
-/*!
-  Sets text
-*/
-void InfoWindow::setText( const QString& text )
-{
-  myTextView->setText( text );
-}
-
-/*!
-  Key press event
-*/
-void InfoWindow::keyPressEvent( QKeyEvent * e )
-{
-  QMainWindow::keyPressEvent( e );
-  if ( e->key() == Key_Escape )
-    close();
-}
-
-static const char* SEPARATOR    = ":";
-
-QString findFile( QString filename )
-{
-  QString dir;
-  char* cenv;
-  
-  // Try ${HOME}/.salome/resources directory
-  cenv = getenv( "HOME" );
-  if ( cenv ) {
-    dir.sprintf( "%s", cenv );
-    if ( !dir.isEmpty() ) {
-      dir = addSlash(dir) ;
-      dir = dir + ".salome" ;
-      dir = addSlash(dir) ;
-      dir = dir + "resources" ;
-      dir = addSlash(dir) ;
-      QFileInfo fileInfo( dir + filename );
-      if ( fileInfo.isFile() && fileInfo.exists() )
-       return fileInfo.filePath();
-    }
-  }
-  // Try ${SALOME_SITE_DIR}/share/salome/resources directory
-  cenv = getenv( "SALOME_SITE_DIR" );
-  if ( cenv ) {
-    dir.sprintf( "%s", cenv );
-    if ( !dir.isEmpty() ) {
-      dir = addSlash(dir) ;
-      dir = dir + "share" ;
-      dir = addSlash(dir) ;
-      cenv = getenv("SALOME_SITE_NAME");
-      if (cenv)  dir = dir + cenv;
-      else       dir = dir + "salome" ;
-      dir = addSlash(dir) ;
-      dir = dir + "resources" ;
-      dir = addSlash(dir) ;
-      QFileInfo fileInfo( dir + filename );
-      if ( fileInfo.isFile() && fileInfo.exists() )
-       return fileInfo.filePath();
-    }
-  }
-  // Try ${KERNEL_ROOT_DIR}/share/salome/resources directory
-  cenv = getenv( "KERNEL_ROOT_DIR" );
-  if ( cenv ) {
-    dir.sprintf( "%s", cenv );
-    if ( !dir.isEmpty() ) {
-      dir = addSlash(dir) ;
-      dir = dir + "share" ;
-      dir = addSlash(dir) ;
-      dir = dir + "salome" ;
-      dir = addSlash(dir) ;
-      dir = dir + "resources" ;
-      dir = addSlash(dir) ;
-      dir = dir + "kernel" ;
-      dir = addSlash(dir) ;
-      QFileInfo fileInfo( dir + filename );
-      if ( fileInfo.isFile() && fileInfo.exists() )
-       return fileInfo.filePath();
-    }
-  }
-
-  //SRN Added support for SALOMEGUI
-  cenv = getenv( "SALOMEGUI_ROOT_DIR" );
-  if ( cenv ) {
-    dir.sprintf( "%s", cenv );
-    if ( !dir.isEmpty() ) {
-      dir = addSlash(dir) ;
-      dir = dir + "share" ;
-      dir = addSlash(dir) ;
-      dir = dir + "salome" ;
-      dir = addSlash(dir) ;
-      dir = dir + "resources" ;
-      dir = addSlash(dir) ;
-      QFileInfo fileInfo( dir + filename );
-      if ( fileInfo.isFile() && fileInfo.exists() )
-       return fileInfo.filePath();
-    }
-  }
-
-  // Try CSF_SaloameResources env.var directory ( or directory list )
-  cenv = getenv( "CSF_SalomeResources" );
-  if ( cenv ) {
-    dir.sprintf( "%s", cenv );
-    if ( !dir.isEmpty() ) {
-      QStringList dirList = QStringList::split( SEPARATOR, dir, false ); // skip empty entries
-      for ( int i = 0; i < dirList.count(); i++ ) {
-       QFileInfo fileInfo( addSlash( dirList[ i ] ) + filename );
-       if ( fileInfo.isFile() && fileInfo.exists() )
-         return fileInfo.filePath();
-      }
-    }
-  }
-  return filename;
-}
-QString addSlash( const QString& path )
-{
-  if (!path.isNull()) {
-#ifdef WNT
-    QChar slash ('\\');
-#else
-    QChar slash ('/');
-#endif
-    if ( path.at(path.length()-1) != slash )
-      return path + slash;
-  }
-  return path;
-}
diff --git a/src/RegistryDisplay/RegWidget.h b/src/RegistryDisplay/RegWidget.h
deleted file mode 100755 (executable)
index 3a14317..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-//  SALOME RegistryDisplay : GUI for Registry server implementation
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : RegWidget.h
-//  Author : Pascale NOYRET, EDF
-//  Module : SALOME
-//  $Header$
-
-# ifndef __REGWIDGET_H__
-# define __REGWIDGET_H__
-# include <qapplication.h>
-# include <qmainwindow.h>
-
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(SALOME_Registry)
-
-#include <IntervalWindow.hxx>
-
-class QTabWidget;
-class QListView;
-class QListViewItem;
-class QWidget;
-class QTimer;
-class QCloseEvent;
-class QTextView;
-#if QT_VERSION > 300
-class QPushButton;
-#endif
-class HelpWindow;
-class InfoWindow;
-
-class RegWidget : public QMainWindow
-{
-  Q_OBJECT
-
-public:
-  RegWidget( CORBA::ORB_var &orb , QWidget *parent = 0, const char *name = 0 );
-  ~RegWidget();
-  void       SetListe();
-  void       SetListeHistory();
-  void       InfoReg();
-  void       InfoHistory();
-
-  bool       eventFilter( QObject* object, QEvent* event );
-
-  static RegWidget* GetRegWidget( CORBA::ORB_var &orb , QWidget *parent = 0, const char *name = 0 );
-
-public slots:
-  void       slotHelp();
-  void       slotListeSelect();
-  void       slotClientChanged( QListViewItem* );
-  void       slotHistoryChanged( QListViewItem* );
-  void       slotSelectRefresh();
-  void       slotIntervalOk();
-protected:  
-  static QString setlongText( const Registry::Infos &c_info );
-  int            numitem( const QString& name, const QString& pid, const QString& machine, const Registry::AllInfos* c_info );
-  void           closeEvent( QCloseEvent *e);
-   
-protected :
-  QListView*          _clients;
-  QListView*          _history;
-  QWidget*            _parent;
-  QTabWidget*         _tabWidget;
-  QPushButton*        _refresh;
-  QPushButton*        _interval;
-  QPushButton*        _close;
-  QTimer*             _counter;
-  Registry::AllInfos* _serverhistory;
-  Registry::AllInfos* _serverclients;
-  InfoWindow*         myInfoWindow;
-  HelpWindow*         myHelpWindow;
-  IntervalWindow*     myIntervalWindow;
-  int                 myRefreshInterval;
-
-private:
-  const      Registry::Components_var _VarComponents;
-  static     RegWidget* myRegWidgetPtr;
-};
-
-class InfoWindow : public QMainWindow {
-public:
-  InfoWindow( QWidget* parent = 0, const char* name = 0);
-
-  void setText( const QString& text );
-  QTextView* textView() const { return myTextView; }
-
-protected:
-  void keyPressEvent( QKeyEvent * e );
-
-private:
-  QTextView* myTextView;
-
-};
-
-#endif
diff --git a/src/RegistryDisplay/RegWidgetFactory.cxx b/src/RegistryDisplay/RegWidgetFactory.cxx
deleted file mode 100755 (executable)
index 7f285e6..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//  SALOME RegistryDisplay : GUI for Registry server implementation
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : RegWidgetFactory.cxx
-//  Author : Pascale NOYRET, EDF
-//  Module : SALOME
-//  $Header$
-
-# include "RegWidget.h"
-# include "utilities.h"
-
-using namespace std;
-
-extern "C"
-{
-
-void OnGUIEvent( CORBA::ORB_var &orb, QWidget *parent, const char *name )
-{
-  // N.B. parent can be 0
- RegWidget* ptrRegWidget = RegWidget::GetRegWidget( orb, parent, name );
- //ASSERT ( !ptrRegWidget );
- ptrRegWidget->show();
- ptrRegWidget->raise();
- ptrRegWidget->setActiveWindow();
- return;
-}
-
-}
index bc9d55ece78f87728c759d9cd70fb1573046da71..e2f33242633e88267028fed5d0f42e3bb84ae098 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-#  File   : Makefile.in
-#  Author : Vadim SANDLER (OCN)
-#  Module : SalomeApp
-#  $Header$
-
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-bin_PROGRAMS= ResourceExporter
-
-dist_ResourceExporter_SOURCES=ResourceExporter.cxx
+bin_PROGRAMS = ResourceExporter
 
-ResourceExporter_CPPFLAGS= $(QT_INCLUDES) -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
+dist_ResourceExporter_SOURCES = ResourceExporter.cxx
 
-ResourceExporter_LDFLAGS= $(QT_MT_LIBS) 
-ResourceExporter_LDADD= ../SUIT/libsuit.la ../Qtx/libqtx.la
+ResourceExporter_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
+ResourceExporter_LDFLAGS  = $(QT_MT_LIBS) 
+ResourceExporter_LDADD    = ../SUIT/libsuit.la ../Qtx/libqtx.la
diff --git a/src/ResExporter/ResExporter.pro b/src/ResExporter/ResExporter.pro
new file mode 100644 (file)
index 0000000..8d5157c
--- /dev/null
@@ -0,0 +1,38 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = 
+TARGET = ResourceExporter
+DESTDIR = ../../bin
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+INCLUDEPATH += ../../include ../Qtx ../SUIT
+LIBS += -L../../lib -lqtx -lsuit
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += 
+
+SOURCES  = ResourceExporter.cxx
+
index 7788f8b7c5ab95fcc4879bbe14f713fd54f40ceb..597059bded6400c33831c30d10c69b635a644f91 100644 (file)
@@ -1,27 +1,28 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-/*!
- File:      ResourceExporter.cxx
- Created:   27/06/05
- Author:    Vadim SANDLER
- Copyright (C) CEA 2005
-
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File    : ResourceExporter.cxx
+// Author  : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+/*
  This tool provides command-line interface allowing to modify user preferences.
  The tool can be used by the compilation procedures in order to set default preferences for the module.
 
 */
 
 #include "SUIT_ResourceMgr.h"
-#include <qfile.h>
-#include <qdir.h>
-#include <qstringlist.h>
-#include <qapplication.h>
+#include <QFile>
+#include <QDir>
+#include <QStringList>
+#include <QApplication>
 #include <iostream>
 
 /*!
@@ -59,23 +60,22 @@ static QString salomeVersion()
   path += QString( "bin/salome/VERSION" );
 
   QFile vf( path );
-  if ( !vf.open( IO_ReadOnly ) )
-    return QString::null;
+  if ( !vf.open( QIODevice::ReadOnly ) )
+    return QString();
 
-  QString line;
-  vf.readLine( line, 1024 );
+  QString line( vf.readLine( 1024 ) );
   vf.close();
 
   if ( line.isEmpty() )
-    return QString::null;
+    return QString();
 
   while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
     line.remove( line.length() - 1, 1 );
 
   QString ver;
-  int idx = line.findRev( ":" );
+  int idx = line.lastIndexOf( ":" );
   if ( idx != -1 )
-    ver = line.mid( idx + 1 ).stripWhiteSpace();
+    ver = line.mid( idx + 1 ).trimmed();
 
   return ver;
 }
@@ -117,34 +117,34 @@ int main( int argc, char** argv )
     resMgr->setCurrentFormat( QString( "xml" ) );
     resMgr->loadLanguage();
     for ( int i = 1; i < argc; i ++ ) {
-      QString anArg = QString( argv[i] ).stripWhiteSpace();
+      QString anArg = QString( argv[i] ).trimmed();
       if ( anArg.startsWith( "-" ) ) {
        anArg.remove( 0, 1 );
        if ( anArg.contains( ":" ) ) {
-         QStringList vals = QStringList::split( ":", anArg );
-         QString section  = vals[ 0 ].stripWhiteSpace();
-         QString param    = vals[ 1 ].stripWhiteSpace();
+         QStringList vals = anArg.split( ":", QString::SkipEmptyParts );
+         QString section  = vals[ 0 ].trimmed();
+         QString param    = vals[ 1 ].trimmed();
          if ( section.isEmpty() || param.isEmpty() ) continue;
          resMgr->remove( section, param );
        }
       }
       else if ( anArg.contains( "+=" ) ) {
-       QStringList vals = QStringList::split( "+=", anArg );
+       QStringList vals = anArg.split( "+=", QString::SkipEmptyParts );
        if ( vals[ 0 ].contains( ":" ) ) {
-         QStringList vals1 = QStringList::split( ":", vals[ 0 ] );
-         QString section  = vals1[ 0 ].stripWhiteSpace();
-         QString param    = vals1[ 1 ].stripWhiteSpace();
-         QString newValue = vals [ 1 ].stripWhiteSpace();
+         QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts );
+         QString section  = vals1[ 0 ].trimmed();
+         QString param    = vals1[ 1 ].trimmed();
+         QString newValue = vals [ 1 ].trimmed();
          QString separ    = ","; // default separator
          if ( newValue.contains( "|" ) ) {
-           QStringList vals2 = QStringList::split( "|", newValue );
-           newValue = vals2[ 0 ].stripWhiteSpace();
-           separ  = vals2[ 1 ].stripWhiteSpace();
+           QStringList vals2 = newValue.split( "|", QString::SkipEmptyParts );
+           newValue = vals2[ 0 ].trimmed();
+           separ  = vals2[ 1 ].trimmed();
          }
          if ( section.isEmpty() || param.isEmpty() || newValue.isEmpty() || separ.isEmpty() ) continue;
          QString value = resMgr->stringValue( section, param );
-         QStringList valsOld = QStringList::split( separ, value );
-         QStringList valsNew = QStringList::split( separ, newValue );
+         QStringList valsOld = value.split( separ, QString::SkipEmptyParts );
+         QStringList valsNew = newValue.split( separ, QString::SkipEmptyParts );
          for ( int i = 0; i < (int)valsNew.count(); i++ )
            if ( !valsOld.contains( valsNew[i] ) )
              valsOld.append( valsNew[i] );
@@ -152,12 +152,12 @@ int main( int argc, char** argv )
        }
       }
       else if ( anArg.contains( "=" ) ) {
-       QStringList vals = QStringList::split( "=", anArg );
+       QStringList vals = anArg.split( "=", QString::SkipEmptyParts );
        if ( vals[ 0 ].contains( ":" ) ) {
-         QStringList vals1 = QStringList::split( ":", vals[ 0 ] );
-         QString section  = vals1[ 0 ].stripWhiteSpace();
-         QString param    = vals1[ 1 ].stripWhiteSpace();
-         QString value = vals [ 1 ].stripWhiteSpace();
+         QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts );
+         QString section  = vals1[ 0 ].trimmed();
+         QString param    = vals1[ 1 ].trimmed();
+         QString value = vals [ 1 ].trimmed();
          if ( section.isEmpty() || param.isEmpty() ) continue;
          resMgr->setValue( section, param, value );
        }
index 6d94b90d4ebc1bfc272eb8a59d06445e632ce0e1..0b47543d3d7c639e77377bec45b333865a6e1426 100755 (executable)
@@ -1,37 +1,36 @@
-#  SALOME SALOME_PY : binding of VTK graphics and Python
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOME SALOME_PY : binding of VTK graphics and Python
 #  File   : Makefile.in
 #  Author : Paul RASCLE, EDF
 #  Module : SALOME
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-lib_LTLIBRARIES= libSalomePy.la
-dist_libSalomePy_la_SOURCES= SalomePy.cxx
+lib_LTLIBRARIES = libSalomePy.la
+dist_libSalomePy_la_SOURCES = SalomePy.cxx
 
-libSalomePy_la_CPPFLAGS=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) \
+libSalomePy_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) \
        $(OGL_INCLUDES) $(CAS_CXXFLAGS) $(BOOST_CPPFLAGS) @KERNEL_CXXFLAGS@ \
        -DHAVE_CONFIG_H -I$(srcdir)/../SalomeApp -I$(srcdir)/../LightApp \
        -I$(srcdir)/../Event -I$(srcdir)/../Session -I$(srcdir)/../SVTK \
@@ -39,6 +38,6 @@ libSalomePy_la_CPPFLAGS=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) \
        -I$(srcdir)/../STD -I$(srcdir)/../VTKViewer -I$(srcdir)/../OBJECT \
        @CAS_CPPFLAGS@ \
        -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
-libSalomePy_la_LDFLAGS=$(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) \
+libSalomePy_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) \
        ../SalomeApp/libSalomeApp.la \
        -lvtkCommonPythonD -lvtkGraphicsPythonD -lvtkImagingPythonD
index 6b8b62410026810c8b94884a746a2505d07f7d7a..d2812e8560bae86473fd73f273717526fd45b4bb 100755 (executable)
@@ -1,31 +1,28 @@
-//  SALOME SALOME_PY : binding of VTK graphics and Python
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOME_PY : binding of VTK graphics and Python
 //  File   : SalomePy.cxx
 //  Author : Paul RASCLE, EDF
-//  Module : SALOME
-//  $Header$
-
+//
 #include <Python.h>
 #include <vtkPythonUtil.h>
 
 #include <vtkRenderWindow.h>
 #include <vtkRenderWindowInteractor.h>
 
-#include "SALOME_Event.hxx"
+#include <SALOME_Event.h>
 
-#include "SUIT_Session.h"
-#include "SalomeApp_Application.h"
-#include "SalomeApp_Study.h"
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
 
-#include "SVTK_ViewManager.h"
-#include "SVTK_ViewWindow.h"
+#include <SVTK_ViewManager.h>
+#include <SVTK_ViewWindow.h>
 
-using namespace std;
+/*!
+  \brief Python wrappings for VTK viewer of the SALOME desktop.
+
+  All methods are implemented using Event mechanism. The module
+  provides the following functions:
+  - getRenderer()
+  - getRenderWindow()
+  - getRenderWindowInteractor()
+  - showTrihedron()
+  - fitAll()
+  - setView()
+  - resetView()
+
+  Usage in Python:
+  \code
+  import SalomePy
+  renderer = SalomePy.getRenderer()     # get VTK renderer
+  window   = SalomePy.getRenderWindow() # get render window
+  \endcode
+
+  The methods getRenderer(), getRenderWindow() and getRenderWindowInteractor()
+  open new VTK viewer if there is no one opened.
+  In case of any error these methods return None object to the Python.
+*/
 
 #define PUBLISH_ENUM(i)                              \
 {                                                    \
@@ -55,55 +75,59 @@ using namespace std;
   if ( rc < 0 ) return;                              \
 }
 
-// enumeration : view type
+//! View operation type
 enum {
-  ViewFront,     // fron view
-  ViewBack,      // back view
-  ViewTop,       // top view
-  ViewBottom,    // bottom view
-  ViewRight,     // right view
-  ViewLeft       // left view
+  ViewFront,     //!< front view
+  ViewBack,      //!< back view
+  ViewTop,       //!< top view
+  ViewBottom,    //!< bottom view
+  ViewRight,     //!< right view
+  ViewLeft       //!< left view
 };
 
-
 /*!
-  VSR : 19.04.05 : Reimplemented for new SALOME GUI (SUIT-based)
-  All methods are implemented using Event mechanism:
-  - getRenderer()
-  - getRenderWindow()
-  - getRenderWindowInteractor()
-  - showTrihedron()
-  These methods (except showTrihedron() ) open new VTK viewer
-  if there is no one opened.
-  In case of error all methods return None object in Python.
+  \brief Get Python class object by name
+  \internal
+  \param theClassName Python class name
+  \return Python class object or None object if class is not found
 */
-
-static PyObject* GetPyClass(const char* theClassName){
-  static PyObject *aVTKModule = NULL;
-  if(!aVTKModule){
-    if (VTK_MAJOR_VERSION > 3)
-      aVTKModule = PyImport_ImportModule("libvtkRenderingPython"); 
+static PyObject* GetPyClass( const char* theClassName ) 
+{
+  static PyObject* aVTKModule = 0;
+  PyObject* aPyClass = 0;
+  if( !aVTKModule ) {
+    if ( VTK_MAJOR_VERSION > 3 )
+      aVTKModule = PyImport_ImportModule( "libvtkRenderingPython" ); 
     else
-      aVTKModule = PyImport_ImportModule("libVTKGraphicsPython"); 
-    if(PyErr_Occurred()){
+      aVTKModule = PyImport_ImportModule( "libVTKGraphicsPython" ); 
+    if( PyErr_Occurred() ) {
       PyErr_Print();
-      return NULL;
     }
   }
-  PyObject* aVTKDict = PyModule_GetDict(aVTKModule);
-  char* aClassName = const_cast<char*>(theClassName);
-  PyObject* aPyClass = PyDict_GetItemString(aVTKDict,aClassName);
-  //Py_DECREF(aVTKModule);
+  if ( aVTKModule ) {
+    PyObject* aVTKDict = PyModule_GetDict( aVTKModule );
+    aPyClass = PyDict_GetItemString(aVTKDict, const_cast<char*>( theClassName ) );
+  }
   return aPyClass;
 }
 
-// internal enum: find or create VTK window
-enum { __Find,          // try to find only 
-       __FindOrCreate,  // try to find: if not found - create new 
-       __Create };      // try to find: if not found - create new 
+/*!
+  \brief VTK window find/create mode
+  \internal
+*/
+enum { 
+  __Find,          // try to find VTK window; if not found, do nothing
+  __FindOrCreate,  // try to find VTK window; if not found, create new one
+  __Create };      // create new VTK window
 
+/*!
+  \brief Find or create VTK window.
+  \internal
+  \param toCreate window find/create mode
+  \return VTK window pointer or 0 if it could not be found/created
+*/
 static SVTK_ViewWindow* GetVTKViewWindow( int toCreate = __FindOrCreate ) {
-  SVTK_ViewWindow* aVW = NULL;
+  SVTK_ViewWindow* aVW = 0;
   if ( SUIT_Session::session() ) {
     // get application
     SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
@@ -121,7 +145,7 @@ static SVTK_ViewWindow* GetVTKViewWindow( int toCreate = __FindOrCreate ) {
            // VSR : When new view window is created it can be not active yet at this moment,
            // so the following is a some workaround
            if ( !aVW && !aVM->getViews().isEmpty() )
-             aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[ 0 ] );
+             aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[0] );
          }
        }
        else {
@@ -131,7 +155,7 @@ static SVTK_ViewWindow* GetVTKViewWindow( int toCreate = __FindOrCreate ) {
            // VSR : When new view window is created it can be not active yet at this moment,
            // so the following is a some workaround
            if ( !aVW && !aVM->getViews().isEmpty() )
-             aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[ 0 ] );
+             aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[0] );
          }
        }
       }
@@ -141,30 +165,48 @@ static SVTK_ViewWindow* GetVTKViewWindow( int toCreate = __FindOrCreate ) {
 }
 
 /*!
-  Get VTK renderer.
-  Always opens new VTK window if <toCreate> parameter is non zero.
-  Otherwise opens new VTK window only if there is no one opened.
+  \fn PyObject* getRenderer( int toCreate = 0 );
+  \brief Get VTK renderer (vtkRenderer).
+  
+  If \a toCreate parameter is 0 (by default) the function tries to find
+  and reuse existing VTK window; if it is not found, the new VTK window
+  is opened.
+
+  If \a toCreate parameter is non-zero, the function always creates
+  new VTK window.
+
+  If VTK window could not be found and or created, the None Python object
+  is returned.
+
+  \param toCreate window creation mode
+  \return VTK window renderer object
 */
-class TGetRendererEvent: public SALOME_Event {
+
+class TGetRendererEvent: public SALOME_Event
+{
 public:
   typedef PyObject* TResult;
   TResult myResult;
   int     myCreate;
   TGetRendererEvent( bool toCreate )
-    : myResult( Py_None ), myCreate( toCreate )  {}
-  virtual void Execute() {
-    if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( myCreate ? __Create : __FindOrCreate ) ) {
-      PyObject* aPyClass = GetPyClass("vtkRenderer");
+    : myResult( Py_None ), myCreate( toCreate ) {}
+  virtual void Execute()
+  {
+    PyObject* aPyClass = ::GetPyClass( "vtkRenderer" );
+    SVTK_ViewWindow* aVTKViewWindow = 
+      ::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate );
+    if( aVTKViewWindow && aPyClass ) {
       vtkRenderer* aVTKObject = aVTKViewWindow->getRenderer();
-      myResult = PyVTKObject_New(aPyClass,aVTKObject);
+      myResult = PyVTKObject_New( aPyClass, aVTKObject );
     }
   }
 };
-extern "C" PyObject *libSalomePy_getRenderer(PyObject *self, PyObject *args)
+
+extern "C" PyObject* libSalomePy_getRenderer( PyObject* self, PyObject* args )
 {
   PyObject* aResult = Py_None;
   int toCreate = 0;
-  if ( !PyArg_ParseTuple(args, "|i:getRenderer", &toCreate) )
+  if ( !PyArg_ParseTuple( args, "|i:getRenderer", &toCreate ) )
     PyErr_Print();
   else
     aResult = ProcessEvent( new TGetRendererEvent( toCreate ) );
@@ -172,30 +214,48 @@ extern "C" PyObject *libSalomePy_getRenderer(PyObject *self, PyObject *args)
 }
 
 /*!
-  Get VTK render window.
-  Always opens new VTK window if <toCreate> parameter is non zero.
-  Otherwise opens new VTK window only if there is no one opened.
+  \fn PyObject* getRenderWindow( int toCreate = 0 );
+  \brief Get VTK render window (vtkRenderWindow).
+  
+  If \a toCreate parameter is 0 (by default) the function tries to find 
+  and reuse existing VTK window; if it is not found, the new VTK window
+  is opened.
+
+  If \a toCreate parameter is non-zero, the function always creates
+  new VTK window.
+
+  If VTK window could not be found and or created, the None Python object
+  is returned.
+
+  \param toCreate window creation mode
+  \return VTK window render window object
 */
-class TGetRenderWindowEvent: public SALOME_Event {
+
+class TGetRenderWindowEvent: public SALOME_Event
+{
 public:
   typedef PyObject* TResult;
   TResult myResult;
   int     myCreate;
   TGetRenderWindowEvent( bool toCreate )
-    : myResult( Py_None ), myCreate( toCreate )  {}
-  virtual void Execute() {
-    if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( myCreate ? __Create : __FindOrCreate ) ) {
-      PyObject* aPyClass = GetPyClass("vtkRenderWindow");
+    : myResult( Py_None ), myCreate( toCreate ) {}
+  virtual void Execute()
+  {
+    PyObject* aPyClass = ::GetPyClass( "vtkRenderWindow" );
+    SVTK_ViewWindow* aVTKViewWindow = 
+      ::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate );
+    if( aVTKViewWindow && aPyClass ) {
       vtkRenderWindow* aVTKObject = aVTKViewWindow->getRenderWindow();
-      myResult = PyVTKObject_New(aPyClass,aVTKObject);
+      myResult = PyVTKObject_New( aPyClass, aVTKObject );
     }
   }
 };
-extern "C" PyObject *libSalomePy_getRenderWindow(PyObject *self, PyObject *args)
+
+extern "C" PyObject* libSalomePy_getRenderWindow( PyObject* self, PyObject* args )
 {
   PyObject* aResult = Py_None;
   int toCreate = 0;
-  if ( !PyArg_ParseTuple(args, "|i:getRenderWindow", &toCreate) )
+  if ( !PyArg_ParseTuple( args, "|i:getRenderWindow", &toCreate ) )
     PyErr_Print();
   else
     aResult = ProcessEvent( new TGetRenderWindowEvent( toCreate ) );
@@ -203,30 +263,48 @@ extern "C" PyObject *libSalomePy_getRenderWindow(PyObject *self, PyObject *args)
 }
 
 /*!
-  Get VTK render window interactor.
-  Always opens new VTK window if <toCreate> parameter is non zero.
-  Otherwise opens new VTK window only if there is no one opened.
+  \fn PyObject* getRenderWindowInteractor( int toCreate = 0 );
+  \brief Get VTK render window interactor (getRenderWindowInteractor).
+  
+  If \a toCreate parameter is 0 (by default) the function tries to find 
+  and reuse existing VTK window; if it is not found, the new VTK window
+  is opened.
+
+  If \a toCreate parameter is non-zero, the function always creates
+  new VTK window.
+
+  If VTK window could not be found and or created, the None Python object
+  is returned.
+
+  \param toCreate window creation mode
+  \return VTK window render window interactor object
 */
-class TGetRenderWindowInteractorEvent: public SALOME_Event {
+
+class TGetRenderWindowInteractorEvent: public SALOME_Event
+{
 public:
   typedef PyObject* TResult;
   TResult myResult;
   int     myCreate;
   TGetRenderWindowInteractorEvent( bool toCreate )
-    : myResult( Py_None ), myCreate( toCreate )  {}
-  virtual void Execute() {
-    if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( myCreate ? __Create : __FindOrCreate ) ) {
-      PyObject* aPyClass = GetPyClass("vtkRenderWindowInteractor");
+    : myResult( Py_None ), myCreate( toCreate ) {}
+  virtual void Execute()
+  {
+    PyObject* aPyClass = ::GetPyClass( "vtkRenderWindowInteractor" );
+    SVTK_ViewWindow* aVTKViewWindow = 
+      ::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate );
+    if( aVTKViewWindow && aPyClass ) {
       vtkRenderWindowInteractor* aVTKObject = aVTKViewWindow->getInteractor();
-      myResult = PyVTKObject_New(aPyClass,aVTKObject);
+      myResult = PyVTKObject_New( aPyClass, aVTKObject );
     }
   }
 };
-extern "C" PyObject *libSalomePy_getRenderWindowInteractor(PyObject *self, PyObject *args)
+
+extern "C" PyObject* libSalomePy_getRenderWindowInteractor( PyObject* self, PyObject* args )
 {
   PyObject* aResult = Py_None;
   int toCreate = 0;
-  if ( !PyArg_ParseTuple(args, "|i:getRenderWindowInteractor", &toCreate) )
+  if ( !PyArg_ParseTuple( args, "|i:getRenderWindowInteractor", &toCreate ) )
     PyErr_Print();
   else
     aResult = ProcessEvent( new TGetRenderWindowInteractorEvent( toCreate ) );
@@ -234,16 +312,25 @@ extern "C" PyObject *libSalomePy_getRenderWindowInteractor(PyObject *self, PyObj
 }
 
 /*!
-  Show/hide trihedron in the current VTK viewer (if there is one)
+  \fn PyObject* showTrihedron( int show );
+  \brief Show/hide trihedron in the current VTK viewer.
+
+  If there is no active VTK viewer, nothing happens.
+  
+  \param show new trihedron visibility state
+  \return nothing (Py_None)
 */
-extern "C" PyObject *libSalomePy_showTrihedron(PyObject *self, PyObject *args)
+
+extern "C" PyObject* libSalomePy_showTrihedron( PyObject* self, PyObject* args )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     int myShow;
     TEvent( int bShow )
-      : myShow( bShow )  {}
-    virtual void Execute() {
+      : myShow( bShow ) {}
+    virtual void Execute()
+    {
       if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
        if ( aVTKViewWindow->isTrihedronDisplayed() != myShow )
          aVTKViewWindow->onViewTrihedron();
@@ -253,7 +340,7 @@ extern "C" PyObject *libSalomePy_showTrihedron(PyObject *self, PyObject *args)
   
   PyObject* aResult = Py_None;
   int bShow = 0;
-  if ( !PyArg_ParseTuple(args, "i:showTrihedron", &bShow) )
+  if ( !PyArg_ParseTuple( args, "i:showTrihedron", &bShow ) )
     PyErr_Print();
   else
     ProcessVoidEvent( new TEvent( bShow ) );
@@ -261,14 +348,22 @@ extern "C" PyObject *libSalomePy_showTrihedron(PyObject *self, PyObject *args)
 }
 
 /*!
-  Fit all the contents in the current VTK viewer (if there is one)
+  \fn PyObject* fitAll();
+  \brief Fit all the contents in the current VTK viewer.
+
+  If there is no active VTK viewer, nothing happens.
+
+  \return nothing (Py_None)
 */
-extern "C" PyObject *libSalomePy_fitAll(PyObject *self, PyObject *args)
+
+extern "C" PyObject* libSalomePy_fitAll( PyObject* self, PyObject* args )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     TEvent() {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
        aVTKViewWindow->onFitAll();
       }
@@ -280,15 +375,24 @@ extern "C" PyObject *libSalomePy_fitAll(PyObject *self, PyObject *args)
 }
 
 /*!
-  Set view type fot the current VTK viewer (if there is one)
+  \fn PyObject* setView( int type );
+  \brief Set view type for the current VTK viewer.
+
+  If there is no active VTK viewer, nothing happens.
+  
+  \param type view type
+  \return nothing (Py_None)
 */
-extern "C" PyObject *libSalomePy_setView(PyObject *self, PyObject *args)
+
+extern "C" PyObject* libSalomePy_setView( PyObject* self, PyObject* args )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     long myType;
     TEvent( long type ) : myType( type) {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
        switch( myType ) {
        case ViewFront:
@@ -312,7 +416,7 @@ extern "C" PyObject *libSalomePy_setView(PyObject *self, PyObject *args)
   };
   
   long type = -1;
-  if ( !PyArg_ParseTuple(args, "l:setView", &type) )
+  if ( !PyArg_ParseTuple( args, "l:setView", &type ) )
     PyErr_Print();
   else {
     ProcessVoidEvent( new TEvent( type ) );
@@ -323,15 +427,22 @@ extern "C" PyObject *libSalomePy_setView(PyObject *self, PyObject *args)
 }
 
 /*!
-  Reset contents of the current VTK viewer (if there is one)
-  to the default state
+  \fn PyObject* resetView();
+  \brief Reset contents of the current VTK viewer.
+
+  If there is no active VTK viewer, nothing happens.
+  
+  \return nothing (Py_None)
 */
-extern "C" PyObject *libSalomePy_resetView(PyObject *self, PyObject *args)
+
+extern "C" PyObject* libSalomePy_resetView( PyObject* self, PyObject* args )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     TEvent() {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
        aVTKViewWindow->onResetView();
       }
@@ -342,9 +453,6 @@ extern "C" PyObject *libSalomePy_resetView(PyObject *self, PyObject *args)
   return Py_None;
 }
 
-/*!
-  Library initialization
-*/
 static PyMethodDef Module_Methods[] = 
 {
   { "getRenderer",               libSalomePy_getRenderer,               METH_VARARGS },
@@ -357,20 +465,27 @@ static PyMethodDef Module_Methods[] =
   { NULL, NULL }
 };
 
+/*!
+  \brief Python module initialization.
+  \internal
+*/
 extern "C" void initlibSalomePy()
 {
-  static char modulename[] = "libSalomePy";
+  static char* modulename = "libSalomePy";
+
   // init module
-  PyObject* aModule = Py_InitModule(modulename, Module_Methods);
+  PyObject* aModule = Py_InitModule( modulename, Module_Methods );
   if( PyErr_Occurred() ) {
     PyErr_Print();
     return;
   }
+
   // get module's dictionary
   PyObject *aModuleDict = PyModule_GetDict( aModule );
   if ( aModuleDict == NULL )
     return;
-  // add View type enumeration
+
+  // export View type enumeration
   PUBLISH_ENUM( ViewFront );
   PUBLISH_ENUM( ViewBack );
   PUBLISH_ENUM( ViewTop );
index a96896abbd52175755db669521032be7eaf97559..8ef1904319623642eedfb45c18e1ed3d021ba073 100755 (executable)
@@ -1,29 +1,29 @@
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Patrick GOLDBRONN (CEA)
 #  Module : SALOME
 # $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 SUBDIRS = SALOME_PYQT_GUI SalomePyQt 
index cf5e4c9985e6b7b98b390a7de97c2e7fe0c0182c..a1561d992e5c7adcc06dabebbd60ebf4bfc44e95 100644 (file)
@@ -1,79 +1,82 @@
-# Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Nicolas REJNERI
 #  Module : SALOME
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-# Sip flags
-SIP_FLAGS = -t WS_X11 -t $(QT_VERS) $(PYQT_SIPFLAGS) -s ".cc" -c . -I $(PYQT_SIPS)
-
 ######################
 
-# Library target
-lib_LTLIBRARIES= libSalomePyQtGUI.la
+# library target
+lib_LTLIBRARIES = libSalomePyQtGUI.la
 
+# extra source files (generated by sip)
+SIP_SRC   = sipAPISalomePyQtGUI.h      \
+           sipSalomePyQtGUIcmodule.cc
 
-# Sip sources
-if IS_SIP_V4
-SIP_SRC   = sipSalomePyQtGUIcmodule.cc
-SIP_FILES = SALOME_PYQT_GUI.sip
-else !IS_SIP_V4
-SIP_SRC   = SalomePyQtGUIcmodule.cc
+# Sip definition file
 SIP_FILES = SALOME_PYQT_GUI.sip
-endif
 
-EXTRA_DIST+= $(SIP_FILES)
+# extra dist files
+EXTRA_DIST += $(SIP_FILES)
 
-salomeinclude_HEADERS = \
-       SALOME_PYQT_GUI.h \
-       SALOME_PYQT_PyInterp.h \
-       SALOME_PYQT_Module.h
+# extra clean files
+CLEANFILES = $(SIP_SRC)
 
-dist_libSalomePyQtGUI_la_SOURCES= \
-       SALOME_PYQT_PyInterp.cxx \
-       SALOME_PYQT_Module.cxx
-
-dist_libSalomePyQtGUI_la_SOURCES: $(SIP_SRC)
+# moc files (generated my moc)
+MOC_FILES = SALOME_PYQT_Module_moc.cxx
 
-# moc pre-processing
-MOC_FILES= SALOME_PYQT_Module_moc.cxx
-nodist_libSalomePyQtGUI_la_SOURCES= $(MOC_FILES) $(SIP_SRC)
+# exported header files
+salomeinclude_HEADERS =                \
+       SALOME_PYQT_GUI.h       \
+       SALOME_PYQT_PyInterp.h  \
+       SALOME_PYQT_Module.h
 
-libSalomePyQtGUI_la_CPPFLAGS= $(QT_INCLUDES) $(SIP_INCLUDES) $(PYTHON_INCLUDES) \
-       $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS) \
-       -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ -D__CALL_OLD_METHODS__ \
-       -I$(srcdir)/../../PyInterp -I$(srcdir)/../../SalomeApp \
-       -I$(srcdir)/../../SUIT -I$(srcdir)/../../Qtx -I$(srcdir)/../../LightApp \
-       -I$(srcdir)/../../SalomeApp -I$(srcdir)/../../CAM -I$(srcdir)/../../STD \
+# library sources
+dist_libSalomePyQtGUI_la_SOURCES =     \
+       SALOME_PYQT_PyInterp.cxx        \
+       SALOME_PYQT_Module.cxx
+nodist_libSalomePyQtGUI_la_SOURCES = $(MOC_FILES) $(SIP_SRC)
+
+# compilation flags
+libSalomePyQtGUI_la_CPPFLAGS = $(QT_INCLUDES) $(SIP_INCLUDES) $(PYTHON_INCLUDES)       \
+       $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS)               \
+       -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ -DCALL_OLD_METHODS                            \
+       -I@builddir@ -I$(srcdir)/../../PyInterp -I$(srcdir)/../../SalomeApp             \
+       -I$(srcdir)/../../SUIT -I$(srcdir)/../../Qtx -I$(srcdir)/../../LightApp         \
+       -I$(srcdir)/../../Plot2d -I$(srcdir)/../../OCCViewer                            \
+       -I$(srcdir)/../../SalomeApp -I$(srcdir)/../../CAM -I$(srcdir)/../../STD         \
        -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
-libSalomePyQtGUI_la_LIBADD= $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) \
-       $(OGL_LIBS) ../../PyInterp/libPyInterp.la ../../SalomeApp/libSalomeApp.la
 
-##################################
+# linkage flags
+libSalomePyQtGUI_la_LIBADD = $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS)       \
+       $(OGL_LIBS) ../../PyInterp/libPyInterp.la ../../SalomeApp/libSalomeApp.la       \
+       ../../OCCViewer/libOCCViewer.la ../../Plot2d/libPlot2d.la
 
 # Custom build step: generate C++ wrapping according to $(SIP_FILES)
-
 $(SIP_SRC): $(SIP_FILES)
-       $(SIP) $(SIP_FLAGS) $<
+       $(SIP) $(PYQT_SIPFLAGS) $<
 
+# extra dependency (SALOME_PYQT_Module.cxx depends on header files generated by sip)
 $(dist_libSalomePyQtGUI_la_SOURCES): $(SIP_SRC)
 
-###################################
index 8c436985ceba91553a1134d868aadf5bf5fb6162..ee67032a5d2a04b5951bf4c2b317906cd1fc9821 100644 (file)
@@ -1,43 +1,45 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SALOME_PYQT_GUI.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #if !defined ( SALOME_PYQT_GUI_H )
 #define SALOME_PYQT_GUI_H
 
 // ========================================================
 // set dllexport type for Win platform 
-#ifdef WNT
-
-#ifdef SALOME_PYQT_EXPORTS
-#define SALOME_PYQT_EXPORT __declspec(dllexport)
-#else
-#define SALOME_PYQT_EXPORT __declspec(dllimport)
-#endif
-
-#else   // WNT
-
-#define SALOME_PYQT_EXPORT
-
-#endif  // WNT
+#ifdef WIN32
+#  ifdef SALOME_PYQT_EXPORTS
+#    define SALOME_PYQT_EXPORT __declspec(dllexport)
+#  else
+#    define SALOME_PYQT_EXPORT __declspec(dllimport)
+#  endif
+#else   // WIN32
+#  define SALOME_PYQT_EXPORT
+#endif  // WIN32
 
 // ========================================================
 // avoid warning messages
-#ifdef WNT
+#ifdef WIN32
 #pragma warning (disable : 4786)
 #pragma warning (disable : 4251)
 #endif
index 2f0543851da4c72c8d43e574fcfc61473e6b1dc6..cbfcf330d13880023e032a86a175e7d8b1dbce03 100644 (file)
@@ -1,4 +1,30 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  File   : SALOME_PYQT_GUI.sip
+//  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+
 %Module SalomePyQtGUI
 
-%Import qtmod.sip
+%Import QtGuimod.sip
+%Import QtXmlmod.sip
 
index d7f8dc59c1d7a1314f3dc8ec3ca809c33b997942..0c86c7ae1563506e7c9426b91d2ea0902da49a18 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SALOME_PYQT_Module.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 
-#include "PyInterp_Dispatcher.h"
 #include "SALOME_PYQT_Module.h"
 
+#include <PyInterp_Dispatcher.h>
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_ViewModel.h>
+#include <SUIT_ViewWindow.h>
+#include <SUIT_ViewManager.h>
+#include <STD_MDIDesktop.h>
+#include <STD_TabDesktop.h>
+#include <LightApp_Preferences.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+
+#include <QtxWorkstack.h>
+#include <QtxWorkspace.h>
+#include <QtxActionGroup.h>
+#include <QtxActionMenuMgr.h>
+#include <QtxActionToolMgr.h>
 
-#include "SUIT_ResourceMgr.h"
-#include "STD_MDIDesktop.h"
-#include "STD_TabDesktop.h"
-#include "SalomeApp_Application.h"
-#include "SalomeApp_Study.h"
-#include "LightApp_Preferences.h"
-
-#include "QtxWorkstack.h"
-#include "QtxActionMenuMgr.h"
-#include "QtxActionToolMgr.h"
 #include <SALOME_LifeCycleCORBA.hxx>
 #include <Container_init_python.hxx>
 
-#include <qfile.h>
-#include <qdom.h>
-#include <qworkspace.h>
-#include <qmenubar.h>
-#include <qpopupmenu.h>
+#include <QFile>
+#include <QDomDocument>
+#include <QDomNode>
+#include <QDomElement>
+#include <QMenuBar>
+#include <QMenu>
+#include <QAction>
 
-#ifndef WIN32
-#include "SALOME_PYQT_SipDefs.h"
-#endif
 #include "sipAPISalomePyQtGUI.h"
 
 #include <sip.h>
 #if SIP_VERSION < 0x040700
-#include "sipqtQWidget.h"
-#include "sipqtQPopupMenu.h"
+#include "sipQtGuiQWidget.h"
+#include "sipQtGuiQMenu.h"
 #endif
 
-#include <CORBA.h>
-
-using namespace std;
-
 /*!
-  \var __DEFAULT_NAME__ - Default name of the module, replaced at the moment of module creation
+  \brief Default name of the module, replaced at the moment
+  of module creation.
+  \internal
 */
-const char* __DEFAULT_NAME__  = "SALOME_PYQT_Module";
+const char* DEFAULT_NAME  = "SALOME_PYQT_Module";
 
 /*!
-  \var __DEFAULT_GROUP__ - Default menu group number
+  \brief Default menu group number.
+  \internal
 */
-const int   __DEFAULT_GROUP__ = 40;
+const int DEFAULT_GROUP = 40;
 
-// If __CALL_OLD_METHODS__ macro is not defined the invoking of obsolete Python
-// module's methods like setSetting(), definePopup(), etc. is blocked.
-// This macro is defined by default (in Makefile)
-#ifdef __CALL_OLD_METHODS__
+/*!
+  \var IsCallOldMethods
+  \brief Allow calling obsolete callback methods.
+  \internal
+  
+  If the macro CALL_OLD_METHODS is not defined, the invoking
+  of obsolete Python module's methods like setSetting(), definePopup(), 
+  etc. is blocked.
+
+  CALL_OLD_METHODS macro can be defined for example by adding 
+  -DCALL_OLD_METHODS compilation option to the Makefile.
+*/
+#ifdef CALL_OLD_METHODS
 const bool IsCallOldMethods = true;
 #else
 const bool IsCallOldMethods = false;
 #endif
 
+/* Py_ssize_t for old Pythons */
+/* This code is as recommended by: */
+/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+# define PY_SSIZE_T_MAX INT_MAX
+# define PY_SSIZE_T_MIN INT_MIN
+#endif
+
+//
 // NB: Python requests.
 // General rule for Python requests created by SALOME_PYQT_Module:
 // all requests should be executed SYNCHRONOUSLY within the main GUI thread.
 // However, it is obligatory that ANY Python call is wrapped with a request object,
 // so that ALL Python API calls are serialized with PyInterp_Dispatcher.
+//
 
 /*!
-  \class SALOME_PYQT_XmlHandler
-  The class for parsing of the XML resource files.
-  Used for backward compatibility with existing Python modules.
+  \class SALOME_PYQT_Module::XmlHandler
+  \brief XML resource files parser.
+  \internal
+
+  This class is used to provide backward compatibility with
+  existing Python modules in which obsolete menu definition system
+  (via XML files) is used.
 */
-class SALOME_PYQT_XmlHandler
+
+class SALOME_PYQT_Module::XmlHandler
 {
 public:
-  SALOME_PYQT_XmlHandler( SALOME_PYQT_Module* module, const QString& fileName );
+  XmlHandler( SALOME_PYQT_Module* module, const QString& fileName );
   void createActions();
-  void clearActions();
-  void createPopup  ( QPopupMenu*    menu,
+  void createPopup  ( QMenu*         menu,
                      const QString& context,
                      const QString& parent,
                      const QString& object );
+  void activateMenus( bool );
 
 protected:
   void createToolBar   ( QDomNode&   parentNode );
   void createMenu      ( QDomNode&   parentNode,
                         const int   parentMenuId = -1,
-                        QPopupMenu* parentPopup = 0 );
+                        QMenu*      parentPopup = 0 );
 
   void insertPopupItems( QDomNode&   parentNode,
-                        QPopupMenu* menu );
+                        QMenu*      menu );
 
 private:
   SALOME_PYQT_Module* myModule;
   QDomDocument        myDoc;
-  QStringList         myMenuItems;
-  QStringList         myCurrentMenu;
-  bool                myMenuCreated;
+  QList<int>          myMenuItems;
 };
 
-// SALOME_PYQT_Module class implementation (implements CAM_Module API for
-// all Python-based SALOME module
-
-// While the SalomePyQtGUI library is not imported in Python it's initialization function
+//
+// NB: Library initialization
+// Since the SalomePyQtGUI library is not imported in Python it's initialization function
 // should be called manually (and only once) in order to initialize global sip data
 // and to get C API from sip : sipBuildResult for example
-#if defined(SIP_VERS_v4_old) || defined(SIP_VERS_v4_new)
+//
 #define INIT_FUNCTION initSalomePyQtGUI
 #if defined(SIP_STATIC_MODULE)
 extern "C" void INIT_FUNCTION();
 #else
 PyMODINIT_FUNC INIT_FUNCTION();
 #endif
-#else
-#define INIT_FUNCTION initlibSalomePyQtGUIc
-extern "C" void INIT_FUNCTION();
-#endif
 
 /*!
- * This function creates an instance of SALOME_PYQT_Module object by request
- * of and application object when the module is loaded.
- */
+  \fn CAM_Module* createModule()
+  \brief Module factory function.
+  \internal
+  
+  Creates an instance of SALOME_PYQT_Module object by request
+  of an application when the module is loaded and initialized.
+
+  \return new module object
+*/
+
 extern "C" {
   SALOME_PYQT_EXPORT CAM_Module* createModule() {
     static bool alreadyInitialized = false;
     if ( !alreadyInitialized ) {
-      // call only once (see above) !
+      // call only once (see comment above) !
       PyEval_RestoreThread( KERNEL_PYTHON::_gtstate );
       INIT_FUNCTION();
       PyEval_ReleaseThread( KERNEL_PYTHON::_gtstate );
@@ -150,14 +186,56 @@ extern "C" {
 }
 
 /*!
- * Static variables definition
- */
+  \class FuncMsg
+  \brief Function call in/out tracer.
+  \internal
+*/
+
+class FuncMsg
+{
+public:
+  FuncMsg( const QString& funcName )
+  {
+    myName = funcName;
+    MESSAGE( myName.toLatin1().constData() << " [ begin ]" );
+  }
+  ~FuncMsg()
+  {
+    MESSAGE( myName.toLatin1().constData() << " [ end ]" );
+  }
+  void message( const QString& msg )
+  {
+    MESSAGE( myName.toLatin1().constData() << " : " << msg.toLatin1().constData() );
+  }
+private:
+  QString myName;
+};
+
+/*!
+  \class SALOME_PYQT_Module
+  \brief This class implements module API for all the Python-based 
+  SALOME modules.
+*/
+
+//
+// Static variables definition
+//
 SALOME_PYQT_Module::InterpMap SALOME_PYQT_Module::myInterpMap;
 SALOME_PYQT_Module* SALOME_PYQT_Module::myInitModule = 0;
 
 /*!
- * Little trick : provide an access to being activated Python module from outside;
- * needed by the SalomePyQt library :(
+  \brief Get the module being initialized.
+  
+  This is a little trick :) needed to provide an access from Python
+  (SalomePyQt) to the module being currently activated. The problem
+  that during the process of module initialization (initialize() 
+  function) it is not yet available via application->activeModule()
+  call.
+  
+  This method returns valid pointer only if called in scope of
+  initialize() function.
+
+  \return the module being currently initialized
 */
 SALOME_PYQT_Module* SALOME_PYQT_Module::getInitModule()
 {
@@ -165,19 +243,20 @@ SALOME_PYQT_Module* SALOME_PYQT_Module::getInitModule()
 }
 
 /*!
* Constructor
- */
 \brief Constructor
+*/
 SALOME_PYQT_Module::SALOME_PYQT_Module()
-  : SalomeApp_Module( __DEFAULT_NAME__ ),
-    myModule( 0 ), 
-    myXmlHandler ( 0 ),
-    myLastActivateStatus( true )
+: SalomeApp_Module( DEFAULT_NAME ),
+  myInterp( 0 ),
+  myModule( 0 ), 
+  myXmlHandler ( 0 ),
+  myLastActivateStatus( true )
 {
 }
 
 /*!
* Destructor
- */
 \brief Destructor
+*/
 SALOME_PYQT_Module::~SALOME_PYQT_Module()
 {
   if ( myXmlHandler )
@@ -185,37 +264,56 @@ SALOME_PYQT_Module::~SALOME_PYQT_Module()
 }
 
 /*!
- * Initialization of the module.
- * Inherited from CAM_Module.
- *
- * This method is used for creation of the menus, toolbars and other staff.
- * There are two ways:
- * - for obsolete modules this method first tries to read <module>_<language>.xml
- *   resource file which contains a menu, toolbars and popup menus description.
- * - new modules can create menus by by calling the corresponding methods of SalomePyQt
- *   Python API in the Python module's initialize() method which is called from here.
- * NOTE: if postponed modules loading is not used, the active study might be not defined
- * yet at this stage, so initialize() method should not perform any study-based initialization.
- */
+  \brief Initialization of the module.
+  
+  This method can be used for creation of the menus, toolbars and 
+  other such staff.
+  
+  There are two ways to do this:
+  - for obsolete modules this method first tries to read
+  <module>_<language>.xml resource file which contains a menu,
+  toolbars and popup menus description;
+  - new modules can create menus by direct calling of the
+  corresponding methods of SalomePyQt Python API in the Python
+  module's initialize() method which is called from here.
+
+  NOTE: SALOME supports two modes of modules loading:
+  - immediate (all the modules are created and initialized 
+  immediately when the application object is created;
+  - postponed modules loading (used currently); in this mode
+  the module is loaded only be request.
+  If postponed modules loading is not used, the active
+  study might be not yet defined at this stage, so initialize()
+  method should not perform any study-based initialization.
+
+  \param app parent application object
+*/
 void SALOME_PYQT_Module::initialize( CAM_Application* app )
 {
-  MESSAGE( "SALOME_PYQT_Module::initialize" );
+  FuncMsg fmsg( "SALOME_PYQT_Module::initialize()" );
 
+  // call base implementation
   SalomeApp_Module::initialize( app );
 
-  // Try to get XML resource file name
+  // try to get XML resource file name
   SUIT_ResourceMgr* aResMgr = getApp()->resourceMgr();
-  QString aLang = aResMgr->stringValue( "language", "language", QString::null );
-  if ( aLang.isEmpty() ) aLang = QString( "en" );
-  QString aName = name( "" );
-  QString aFileName = aName + "_" + aLang + ".xml";
-  aFileName = aResMgr->path( "resources", aName, aFileName );
-
-  // create XML handler instance
-  if ( !myXmlHandler && !aFileName.isEmpty() && QFile::exists( aFileName ) )
-    myXmlHandler = new SALOME_PYQT_XmlHandler( this, aFileName );
+  if ( !myXmlHandler && aResMgr ) {
+    // get current language
+    QString aLang = aResMgr->stringValue( "language", "language", QString() );
+    if ( aLang.isEmpty() ) 
+      aLang = "en";
+    // define resource file name
+    QString aFileName = name() + "_" + aLang + ".xml";
+    aFileName = aResMgr->path( "resources", name(), aFileName );
+    // create XML handler instance
+    if ( !aFileName.isEmpty() && QFile::exists( aFileName ) )
+      myXmlHandler = new SALOME_PYQT_Module::XmlHandler( this, aFileName );
+    // create menus & toolbars from XML file if required
+    if ( myXmlHandler )
+      myXmlHandler->createActions();
+  }
 
-  // perform internal initialization and call module's initialize() method
+  // perform internal initialization and call module's initialize() funtion
   // InitializeReq: request class for internal init() operation
   class InitializeReq : public PyInterp_Request
   {
@@ -237,18 +335,28 @@ void SALOME_PYQT_Module::initialize( CAM_Application* app )
     SALOME_PYQT_Module* myObj;
   };
 
-  // Posting the request
+  // post request
   PyInterp_Dispatcher::Get()->Exec( new InitializeReq( app, this ) );
 }
 
 /*!
- * Activation of the module.
- * Inherited from CAM_Module.
- */
+  \brief Activation of the module.
+
+  This function is usually used in order to show the module's 
+  specific menus and toolbars, update actions state and perform
+  other such actions required when the module is activated.
+  
+  Note, that returning \c false in this function prevents the 
+  module activation.
+
+  \param theStudy parent study
+  \return \c true if activation is successful and \c false otherwise
+*/
 bool SALOME_PYQT_Module::activateModule( SUIT_Study* theStudy )
 {
-  MESSAGE( "SALOME_PYQT_Module::activateModule" );
+  FuncMsg fmsg( "SALOME_PYQT_Module::activateModule()" );
 
+  // call base implementation
   bool res = SalomeApp_Module::activateModule( theStudy );
 
   if ( !res )
@@ -257,6 +365,7 @@ bool SALOME_PYQT_Module::activateModule( SUIT_Study* theStudy )
   // reset the activation status to the default value
   myLastActivateStatus = true;
 
+  // perform internal activation
   // ActivateReq: request class for internal activate() operation
   class ActivateReq : public PyInterp_Request
   {
@@ -278,26 +387,23 @@ bool SALOME_PYQT_Module::activateModule( SUIT_Study* theStudy )
     SALOME_PYQT_Module* myObj;
   };
 
-  // Posting the request
+  // post request
   PyInterp_Dispatcher::Get()->Exec( new ActivateReq( theStudy, this ) );
 
+  // check activation status (set by activate())
   if ( !lastActivationStatus() )
     return false;
 
   // activate menus, toolbars, etc
+  if ( myXmlHandler ) myXmlHandler->activateMenus( true );
   setMenuShown( true );
   setToolShown( true );
 
-  if ( menuMgr() )
-    connect( menuMgr(), SIGNAL( menuHighlighted( int, int ) ),
-            this,      SLOT( onMenuHighlighted( int, int ) ) );
+  // connect preferences changing signal
   connect( getApp(), SIGNAL( preferenceChanged( const QString&, const QString&, const QString& ) ),
           this,     SLOT(   preferenceChanged( const QString&, const QString&, const QString& ) ) );
 
-  // create menus & toolbars from XML file if required
-  if ( myXmlHandler )
-    myXmlHandler->createActions();
-
+  // perform custom activation actions
   // CustomizeReq: request class for internal customize() operation
   class CustomizeReq : public PyInterp_Request
   {
@@ -319,39 +425,36 @@ bool SALOME_PYQT_Module::activateModule( SUIT_Study* theStudy )
     SALOME_PYQT_Module* myObj;
   };
 
-  // Posting the request
+  // post request
   PyInterp_Dispatcher::Get()->Exec( new CustomizeReq( theStudy, this ) );
 
   return true;
 }
 
 /*!
- * Deactivation of the module.
- * Inherited from CAM_Module.
- */
+  \brief Deactivation of the module.
+
+  This function is usually used in order to hide the module's 
+  specific menus and toolbars and perform other such actions
+  required when the module is deactivated.
+
+  \param theStudy parent study
+  \return \c true if deactivation is successful and \c false otherwise
+*/
 bool SALOME_PYQT_Module::deactivateModule( SUIT_Study* theStudy )
 {
-  MESSAGE( "SALOME_PYQT_Module::deactivateModule" );
+  FuncMsg fmsg( "SALOME_PYQT_Module::deactivateModule()" );
 
-  if ( menuMgr() )
-    disconnect( menuMgr(), SIGNAL( menuHighlighted( int, int ) ),
-               this,      SLOT( onMenuHighlighted( int, int ) ) );
+  // disconnect preferences changing signal
   disconnect( getApp(), SIGNAL( preferenceChanged( const QString&, const QString&, const QString& ) ),
              this,     SLOT(   preferenceChanged( const QString&, const QString&, const QString& ) ) );
 
-  // remove menus & toolbars created from XML file if required
-  if ( myXmlHandler )
-    myXmlHandler->clearActions();
-
-  // deactivate menus, toolbars, etc
-  setMenuShown( false );
-  setToolShown( false );
-
+  // perform internal deactivation
   // DeactivateReq: request class for internal deactivate() operation
   class DeactivateReq : public PyInterp_LockRequest
   {
   public:
-    DeactivateReq( PyInterp_base*      _py_interp,
+    DeactivateReq( PyInterp_Interp*    _py_interp,
                   SUIT_Study*         _study,
                   SALOME_PYQT_Module* _obj )
       : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
@@ -369,15 +472,22 @@ bool SALOME_PYQT_Module::deactivateModule( SUIT_Study* theStudy )
     SALOME_PYQT_Module* myObj;
   };
 
-  // Posting the request
+  // post request
   PyInterp_Dispatcher::Get()->Exec( new DeactivateReq( myInterp, theStudy, this ) );
 
+  // deactivate menus, toolbars, etc
+  if ( myXmlHandler ) myXmlHandler->activateMenus( false );
+  setMenuShown( false );
+  setToolShown( false );
+
+  // call base implementation
   return SalomeApp_Module::deactivateModule( theStudy );
 }
 
 /*!
- * Returns the status of last trying of module activation.
- * Before fisrt activation - status is false
+ \brief Get last activation status.
+ \return status of last module activation operation
+ \sa activateModule()
 */
 bool SALOME_PYQT_Module::lastActivationStatus() const
 {
@@ -385,19 +495,25 @@ bool SALOME_PYQT_Module::lastActivationStatus() const
 }
 
 /*!
-  Preferences changing (application) - called when preference is changed
+  \breif Process application preferences changing.
+
+  Called when any application setting is changed.
+
+  \param module preference module
+  \param section preference resource file section
+  \param setting preference resource name
 */
 void SALOME_PYQT_Module::preferenceChanged( const QString& module, 
                                            const QString& section, 
                                            const QString& setting )
 {
-  MESSAGE( "SALOME_PYQT_Module::preferenceChanged");
+  FuncMsg fmsg( "SALOME_PYQT_Module::preferenceChanged()" );
 
   // perform synchronous request to Python event dispatcher
   class Event : public PyInterp_LockRequest
   {
   public:
-    Event( PyInterp_base*      _py_interp,
+    Event( PyInterp_Interp*    _py_interp,
           SALOME_PYQT_Module* _obj,
           const QString&      _section,
           const QString&      _setting )
@@ -418,21 +534,25 @@ void SALOME_PYQT_Module::preferenceChanged( const QString& module,
   };
 
   if ( module != moduleName() ) {
-    // Module's preferences are processed by preferencesChanged() method
+    // module's own preferences are processed by preferencesChanged() method
     // ...
-    // Posting the request only if dispatcher is not busy!
-    // Executing the request synchronously
+    // post the request only if dispatcher is not busy!
+    // execute request synchronously
     if ( !PyInterp_Dispatcher::Get()->IsBusy() )
       PyInterp_Dispatcher::Get()->Exec( new Event( myInterp, this, section, setting ) );
   }
 }
 
 /*!
- * Called when study desktop is activated.
- * Used for notifying about changing of the active study.
- */
+  \brief Process study activation.
+  
+  Called when study desktop is activated. Used for notifying the Python
+  module about changing of the active study.
+*/
 void SALOME_PYQT_Module::studyActivated()
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::studyActivated()" );
+
   // StudyChangedReq: request class for internal studyChanged() operation
   class StudyChangedReq : public PyInterp_Request
   {
@@ -454,30 +574,32 @@ void SALOME_PYQT_Module::studyActivated()
     SALOME_PYQT_Module* myObj;
   };
 
-  // Posting the request
+  // post request
   PyInterp_Dispatcher::Get()->Exec( new StudyChangedReq( application()->activeStudy(), this ) );
 }
 
 /*!
- * Processes GUI action (from main menu, toolbar or context popup menu)
- */
+  \brief Process GUI action (from main menu, toolbar or 
+  context popup menu action).
+*/
 void SALOME_PYQT_Module::onGUIEvent()
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::onGUIEvent()" );
+
   // get sender action
-  const QObject* obj = sender();
-  if ( !obj || !obj->inherits( "QAction" ) )
+  QAction* action = qobject_cast<QAction*>( sender() );
+  if ( !action )
     return;
-  QAction* action = (QAction*)obj;
 
   // get action ID
   int id = actionId( action );
-  MESSAGE( "SALOME_PYQT_Module::onGUIEvent: id = " << id );
+  fmsg.message( QString( "action id = %1" ).arg( id ) );
 
   // perform synchronous request to Python event dispatcher
   class GUIEvent : public PyInterp_LockRequest
   {
   public:
-    GUIEvent( PyInterp_base*      _py_interp,
+    GUIEvent( PyInterp_Interp*    _py_interp,
              SALOME_PYQT_Module* _obj,
              int                 _id )
       : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
@@ -495,92 +617,35 @@ void SALOME_PYQT_Module::onGUIEvent()
     SALOME_PYQT_Module* myObj;
   };
 
-  // Posting the request
+  // post request
   PyInterp_Dispatcher::Get()->Exec( new GUIEvent( myInterp, this, id ) );
 }
 
 /*!
- * Processes GUI action (from context popup menu, only for XML-based actions!)
- */
-void SALOME_PYQT_Module::onGUIEvent( int id )
-{
-  // perform synchronous request to Python event dispatcher
-  class GUIEvent : public PyInterp_LockRequest
-  {
-  public:
-    GUIEvent( PyInterp_base*      _py_interp,
-             SALOME_PYQT_Module* _obj,
-             int                 _id )
-      : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
-        myId    ( _id  ),
-        myObj   ( _obj ) {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->guiEvent( myId );
-    }
-
-  private:
-    int                 myId;
-    SALOME_PYQT_Module* myObj;
-  };
-
-  // Posting the request
-  PyInterp_Dispatcher::Get()->Exec( new GUIEvent( myInterp, this, id ) );
-}
+  \brief Process context popup menu request.
+  
+  Called when user activates popup menu in some window
+  (view, object browser, etc).
 
-/*!
- * Menu highlight processing
- */
-void SALOME_PYQT_Module::onMenuHighlighted( int menu, int submenu )
+  \param theContext popup menu context (e.g. "ObjectBrowser")
+  \param thePopupMenu popup menu
+  \param title popup menu title (not used)
+*/
+void SALOME_PYQT_Module::contextMenuPopup( const QString& theContext, 
+                                          QMenu*         thePopupMenu, 
+                                          QString&       /*title*/ )
 {
-  if ( !action( menu ) && registered( menu, submenu ) ) {
-    // perform synchronous request to Python event dispatcher
-    class MenuHighlightEvent : public PyInterp_LockRequest
-    {
-    public:
-      MenuHighlightEvent( PyInterp_base*      _py_interp,
-                         SALOME_PYQT_Module* _obj,
-                         int                 _menu,
-                         int                 _submenu )
-       : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
-         myMenu   ( _menu ),
-         mySubMenu( _submenu ),
-         myObj    ( _obj ) {}
-
-    protected:
-      virtual void execute()
-      {
-       myObj->menuHighlight( myMenu, mySubMenu );
-      }
-
-    private:
-      int                 myMenu;
-      int                 mySubMenu;
-      SALOME_PYQT_Module* myObj;
-    };
-
-    // Posting the request
-    PyInterp_Dispatcher::Get()->Exec( new MenuHighlightEvent( myInterp, this, menu, submenu ) );
-  }
-}
+  FuncMsg fmsg( "SALOME_PYQT_Module::contextMenuPopup()" );
+  fmsg.message( QString( "context: %1" ).arg( theContext ) );
 
-/*!
-  Context popup menu request.
-  Called when user activates popup menu in some window (view, object browser, etc).
-  */
-void SALOME_PYQT_Module::contextMenuPopup( const QString& theContext, QPopupMenu* thePopupMenu, QString& /*title*/ )
-{
-  MESSAGE( "SALOME_PYQT_Module::contextMenuPopup : " << theContext.latin1() );
   // perform synchronous request to Python event dispatcher
   class PopupMenuEvent : public PyInterp_LockRequest
   {
   public:
-    PopupMenuEvent( PyInterp_base*     _py_interp,
+    PopupMenuEvent( PyInterp_Interp*    _py_interp,
                    SALOME_PYQT_Module* _obj,
                    const QString&      _context,
-                   QPopupMenu*        _popup )
+                   QMenu*        _popup )
       : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
         myContext( _context ),
         myPopup  ( _popup  ),
@@ -595,27 +660,29 @@ void SALOME_PYQT_Module::contextMenuPopup( const QString& theContext, QPopupMenu
   private:
     SALOME_PYQT_Module* myObj;
     QString             myContext;
-    QPopupMenu*         myPopup;
+    QMenu*         myPopup;
   };
 
-  // Posting the request only if dispatcher is not busy!
-  // Executing the request synchronously
+  // post request only if dispatcher is not busy!
+  // execute request synchronously
   if ( !PyInterp_Dispatcher::Get()->IsBusy() )
     PyInterp_Dispatcher::Get()->Exec( new PopupMenuEvent( myInterp, this, theContext, thePopupMenu ) );
 }
 
 /*!
- * Export preferences for the Python module.
- * Called only once when the first instance of the module is created.
- */
+  \brief Export preferences for the Python module.
+  
+  Called only once when the first instance of the module is created.
+*/
 void SALOME_PYQT_Module::createPreferences()
 {
-  MESSAGE( "SALOME_PYQT_Module::createPreferences");
+  FuncMsg fmsg( "SALOME_PYQT_Module::createPreferences()" );
+
   // perform synchronous request to Python event dispatcher
   class Event : public PyInterp_LockRequest
   {
   public:
-    Event( PyInterp_base*      _py_interp,
+    Event( PyInterp_Interp*    _py_interp,
           SALOME_PYQT_Module* _obj )
       : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
         myObj    ( _obj )   {}
@@ -630,52 +697,77 @@ void SALOME_PYQT_Module::createPreferences()
     SALOME_PYQT_Module* myObj;
   };
 
-  // Posting the request only if dispatcher is not busy!
-  // Executing the request synchronously
+  // post request only if dispatcher is not busy!
+  // execute request synchronously
   if ( !PyInterp_Dispatcher::Get()->IsBusy() )
     PyInterp_Dispatcher::Get()->Exec( new Event( myInterp, this ) );
 }
 
 /*!
- * Defines the dockable window associated with the module.
- * To fill the list of windows the correspondind Python module's windows()
- * method is called from SALOME_PYQT_Module::init() method.
- * By default, ObjectBrowser, PythonConsole and LogWindow are provided.
- */
+  \brief Define the dockable windows associated with the module.
+  
+  To fill the list of windows the correspondind Python module's windows()
+  method is called from SALOME_PYQT_Module::init() method.
+
+  By default, ObjectBrowser, PythonConsole and LogWindow windows are 
+  associated to the module.
+
+  Allowed dockable windows:
+  - SalomeApp_Application::WT_ObjectBrowser : object browser
+  - SalomeApp_Application::WT_PyConsole : python console
+  - SalomeApp_Application::WT_LogWindow : log messages output window
+
+  Dock area is defined by Qt::DockWidgetArea enumeration:
+  - Qt::TopDockWidgetArea : top dock area
+  - Qt::BottomDockWidgetArea : bottom dock area
+  - Qt::LeftDockWidgetArea : left dock area
+  - Qt::RightDockWidgetArea : right dock area
+
+  \param mappa map of dockable windows: { <window_type> : <dock_area> }
+*/
 void SALOME_PYQT_Module::windows( QMap<int, int>& mappa ) const
 {
-  // First clear the output parameters
-  QMap<int, int>::ConstIterator it;
-  for ( it = myWindowsMap.begin(); it != myWindowsMap.end(); ++it ) {
-    mappa[ it.key() ] = it.data();
-  }
+  FuncMsg fmsg( "SALOME_PYQT_Module::windows()" );
+
+  mappa = myWindowsMap;
 }
 
 /*!
- * Defines the compatible views which should be opened on module activation.
- * To fill the list of views the correspondind Python module's views()
- * method is called from SALOME_PYQT_Module::init() method.
- * By default, the list is empty.
- */
-void SALOME_PYQT_Module::viewManagers( QStringList& listik ) const
+  \brief Define the compatible view windows associated with the module.
+
+  The associated view windows are opened automatically when the module
+  is activated.
+
+  To fill the list of views the correspondind Python module's views()
+  method is called from SALOME_PYQT_Module::init() method.
+  By default, the list is empty.
+
+  \param listik list of view windows types
+*/
+void SALOME_PYQT_Module::viewManagers( QStringList& lst ) const
 {
-  for ( QStringList::ConstIterator it = myViewMgrList.begin(); it != myViewMgrList.end(); ++it ) {
-    listik.append( *it );
-  }
+  FuncMsg fmsg( "SALOME_PYQT_Module::viewManagers()" );
+
+  lst = myViewMgrList;
 }
 
 /*!
-  Preferences changing (module) - called when the module's preferences are changed
+  \brief Process module's preferences changing.
+
+  Called when the module's preferences are changed.
+  
+  \param section setting section
+  \param setting setting name
 */
 void SALOME_PYQT_Module::preferencesChanged( const QString& section, const QString& setting )
 {
-  MESSAGE( "SALOME_PYQT_Module::preferencesChanged");
+  FuncMsg fmsg( "SALOME_PYQT_Module::preferencesChanged()" );
 
   // perform synchronous request to Python event dispatcher
   class Event : public PyInterp_LockRequest
   {
   public:
-    Event( PyInterp_base*      _py_interp,
+    Event( PyInterp_Interp*    _py_interp,
           SALOME_PYQT_Module* _obj,
           const QString&      _section,
           const QString&      _setting )
@@ -695,24 +787,29 @@ void SALOME_PYQT_Module::preferencesChanged( const QString& section, const QStri
     QString mySection, mySetting;
   };
 
-  // Posting the request only if dispatcher is not busy!
-  // Executing the request synchronously
+  // post request only if dispatcher is not busy!
+  // execut request synchronously
   if ( !PyInterp_Dispatcher::Get()->IsBusy() )
     PyInterp_Dispatcher::Get()->Exec( new Event( myInterp, this, section, setting ) );
 }
 
-
 /*!
- * Performs internal initialization
- * - initializes/gets the Python interpreter (one per study)
- * - imports the Python module
- * - passes the workspace widget to the Python module
- * - calls Python module's initialize() method
- * - calls Python module's windows() method
- * - calls Python module's views() method
- */
+  \brief Internal module initialization:
+
+  Performs the following actions:
+  - initialize or get the Python interpreter (one per study)
+  - import the Python module
+  - pass the workspace widget to the Python module
+  - call Python module's initialize() method
+  - call Python module's windows() method
+  - call Python module's views() method
+
+  \param app parent application object
+*/
 void SALOME_PYQT_Module::init( CAM_Application* app )
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::init()" );
+
   // reset interpreter to NULL
   myInterp = NULL;
 
@@ -720,7 +817,6 @@ void SALOME_PYQT_Module::init( CAM_Application* app )
   SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( app );
   if ( !anApp )
     return;
-
   SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
   if ( !aStudy )
     return;
@@ -736,6 +832,7 @@ void SALOME_PYQT_Module::init( CAM_Application* app )
   if ( !myModule )
     return; // Error
 
+  // this module is being activated now!
   myInitModule = this;
 
   // then call Python module's initialize() method
@@ -743,22 +840,23 @@ void SALOME_PYQT_Module::init( CAM_Application* app )
   PyLockWrapper aLock = myInterp->GetLockWrapper();
   // ... (the Python module is already imported)
   // ... finally call Python module's initialize() method
-  if(PyObject_HasAttrString(myModule , "initialize")){
+  if ( PyObject_HasAttrString( myModule , "initialize" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, "initialize", "" ) );
-    if( !res ) {
+    if ( !res ) {
       PyErr_Print();
     }
   }
 
-  // get the windows list from the Python module by calling windows() method
+  // get required dockable windows list from the Python module 
+  // by calling windows() method
   // ... first put default values
-  myWindowsMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::DockLeft );
-  myWindowsMap.insert( SalomeApp_Application::WT_PyConsole,     Qt::DockBottom );
-  myWindowsMap.insert( SalomeApp_Application::WT_LogWindow,     Qt::DockBottom );
+  myWindowsMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
+  myWindowsMap.insert( SalomeApp_Application::WT_PyConsole,     Qt::BottomDockWidgetArea );
+  myWindowsMap.insert( SalomeApp_Application::WT_LogWindow,     Qt::BottomDockWidgetArea );
 
-  if(PyObject_HasAttrString(myModule , "windows")){
+  if ( PyObject_HasAttrString( myModule , "windows" ) ) {
     PyObjWrapper res1( PyObject_CallMethod( myModule, "windows", "" ) );
-    if( !res1 ) {
+    if ( !res1 ) {
       PyErr_Print();
     }
     else {
@@ -766,7 +864,7 @@ void SALOME_PYQT_Module::init( CAM_Application* app )
       if ( PyDict_Check( res1 ) ) {
         PyObject* key;
         PyObject* value;
-        int pos = 0;
+        Py_ssize_t pos = 0;
         while ( PyDict_Next( res1, &pos, &key, &value ) ) {
          // parse the return value
          // it should be a map: {integer:integer}
@@ -780,10 +878,12 @@ void SALOME_PYQT_Module::init( CAM_Application* app )
       }
     }
   }
-  // get the windows list from the Python module by calling views() method
-  if(PyObject_HasAttrString(myModule , "views")){
+
+  // get compatible view windows types from the Python module 
+  // by calling views() method
+  if ( PyObject_HasAttrString( myModule , "views" ) ) {
     PyObjWrapper res2( PyObject_CallMethod( myModule, "views", "" ) );
-    if( !res2 ) {
+    if ( !res2 ) {
       PyErr_Print();
     }
     else {
@@ -804,17 +904,24 @@ void SALOME_PYQT_Module::init( CAM_Application* app )
       }
     }
   }
+  // module is already activated!
   myInitModule = 0;
 }
 
 /*!
- * Performs internal activation:
- * - initializes/gets the Python interpreter (one per study)
- * - imports the Python GUI module
- * - calls Python module's activate() method (for new modules)
- */
+  \brief Internal activation:
+
+  Performs the following actions:
+  - initialize or get the Python interpreter (one per study)
+  - import the Python GUI module
+  - call Python module's activate() method
+
+  \param theStudy parent study object
+*/
 void SALOME_PYQT_Module::activate( SUIT_Study* theStudy )
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::activate()" );
+
   // get study Id
   SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( theStudy );
   int aStudyId = aStudy ? aStudy->studyDS()->StudyId() : 0;
@@ -833,28 +940,55 @@ void SALOME_PYQT_Module::activate( SUIT_Study* theStudy )
   PyLockWrapper aLock = myInterp->GetLockWrapper();
 
   // call Python module's activate() method (for the new modules)
-  if(PyObject_HasAttrString(myModule , "activate")){
+  if ( PyObject_HasAttrString( myModule , "activate" ) ) {
     PyObject* res1 = PyObject_CallMethod( myModule, "activate", "" );
     if ( !res1 || !PyBool_Check( res1 ) ) {
       PyErr_Print();
-      //= true: for support of old modules
+      // always true for old modules (no return value)
       myLastActivateStatus = true;
     }
     else {
-      //detect return status
+      // detect return status
       myLastActivateStatus = PyObject_IsTrue( res1 );
     }
+  } 
+  
+  // Connect the SUIT_Desktop signal windowActivated() to this->onActiveViewChanged()
+  SUIT_Desktop* aDesk = theStudy->application()->desktop();
+  if ( aDesk )
+  {
+    connect( aDesk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+            this,  SLOT( onActiveViewChanged( SUIT_ViewWindow* ) ) );
+    // If a active window exists send activeViewChanged
+    // If a getActiveView() in SalomePyQt available we no longer need this 
+    SUIT_ViewWindow* aView = aDesk->activeWindow();
+    if ( aView ) 
+      activeViewChanged( aView );
+    
+    // get all view currently opened in the study and connect their signals  to 
+    // the corresponding slots of the class.
+    QList<SUIT_ViewWindow*> wndList = aDesk->windows();
+    SUIT_ViewWindow* wnd;
+    foreach ( wnd, wndList )
+      connectView( wnd );
   }
 }
 
 /*!
- * Performs additional customization after module is activated:
- * - gets the Python interpreter (one per study)
- * - imports the Python GUI module
- * - calls Python module's setSettings() method (obsolete function, used for compatibility with old code)
- */
-void SALOME_PYQT_Module::customize ( SUIT_Study* theStudy )
+  \brief Additional customization after module is activated:
+
+  Performs the following actions:
+  - get the Python interpreter (one per study)
+  - import the Python GUI module
+  - call Python module's setSettings() method (obsolete function, 
+  used for compatibility with old code)
+
+  \param theStudy parent study object
+*/
+void SALOME_PYQT_Module::customize( SUIT_Study* theStudy )
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::customize()" );
+
   // get study Id
   SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( theStudy );
   int aStudyId = aStudy ? aStudy->studyDS()->StudyId() : 0;
@@ -869,53 +1003,74 @@ void SALOME_PYQT_Module::customize ( SUIT_Study* theStudy )
   if ( !myModule )
     return; // Error
 
-  if ( IsCallOldMethods ) { // __CALL_OLD_METHODS__
+  if ( IsCallOldMethods ) {
     // call Python module's setWorkspace() method
     setWorkSpace();
-  }                         //__CALL_OLD_METHODS__
+  }
 
   // get python lock
   PyLockWrapper aLock = myInterp->GetLockWrapper();
 
-  if ( IsCallOldMethods ) { //__CALL_OLD_METHODS__
+  if ( IsCallOldMethods ) {
     // call Python module's setSettings() method (obsolete)
-    if(PyObject_HasAttrString(myModule , "setSettings")){
+    if ( PyObject_HasAttrString( myModule , "setSettings" ) ) {
       PyObjWrapper res( PyObject_CallMethod( myModule, "setSettings", "" ) );
       if( !res ) {
         PyErr_Print();
       }
     }
-  }                         //__CALL_OLD_METHODS__
+  }
 }
 
 /*!
- * Performs internal deactivation:
- * - calls Python module's deactivate() method
- */
+  \brief Internal deactivation:
+
+  Performs the following actions:
+  - call Python module's deactivate() method
+
+  \param theStudy parent study object
+*/
 void SALOME_PYQT_Module::deactivate( SUIT_Study* theStudy )
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::deactivate()" );
+
   // check if the subinterpreter is initialized and Python module is imported
   if ( !myInterp || !myModule ) {
     // Error! Python subinterpreter should be initialized and module should be imported first!
     return;
   }
   // then call Python module's deactivate() method
-  if(PyObject_HasAttrString(myModule , "deactivate")){
+  if ( PyObject_HasAttrString( myModule , "deactivate" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, "deactivate", "" ) );
     if( !res ) {
       PyErr_Print();
     }
   }
+  
+  // Disconnect the SUIT_Desktop signal windowActivated()
+  SUIT_Desktop* aDesk = theStudy->application()->desktop();
+  if ( aDesk )
+  {
+    disconnect( aDesk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+                this,  SLOT( onActiveViewChanged( SUIT_ViewWindow* ) ) );      
+  }
 }
 
 /*!
- * Called when active the study is actived (user brings its desktop to top)
- * - initializes/gets the Python interpreter (one per study)
- * - imports the Python GUI module
- * - calls Python module's activeStudyChanged() method
- */
+  \brief Perform internal actions when active study is changed.
+
+  Called when active the study is actived (user brings its 
+  desktop to top):
+  - initialize or get the Python interpreter (one per study)
+  - import the Python GUI module
+  - call Python module's activeStudyChanged() method
+
+  \param theStudy study being activated
+*/
 void SALOME_PYQT_Module::studyChanged( SUIT_Study* theStudy )
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::studyChanged()" );
+
   // get study Id
   SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( theStudy );
   int aStudyId = aStudy ? aStudy->studyDS()->StudyId() : 0;
@@ -930,16 +1085,16 @@ void SALOME_PYQT_Module::studyChanged( SUIT_Study* theStudy )
   if ( !myModule )
     return; // Error
 
-  if ( IsCallOldMethods ) { // __CALL_OLD_METHODS__
+  if ( IsCallOldMethods ) {
     // call Python module's setWorkspace() method
     setWorkSpace();
-  }                         //__CALL_OLD_METHODS__
+  }
 
   // get python lock
   PyLockWrapper aLock = myInterp->GetLockWrapper();
 
   // call Python module's activeStudyChanged() method
-  if(PyObject_HasAttrString(myModule , "activeStudyChanged")){
+  if ( PyObject_HasAttrString( myModule , "activeStudyChanged" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, "activeStudyChanged", "i", aStudyId ) );
     if( !res ) {
       PyErr_Print();
@@ -948,43 +1103,61 @@ void SALOME_PYQT_Module::studyChanged( SUIT_Study* theStudy )
 }
 
 /*!
- * Get module engine, returns nil var if engine is not found in LifeCycleCORBA
- */
+  \brief Get module engine.
+
+  Returns nil var if engine is not found in LifeCycleCORBA.
+  
+  \return module's engine reference
+*/
 Engines::Component_var SALOME_PYQT_Module::getEngine() const
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::getEngine()" );
+
   Engines::Component_var comp;
-  // temporary solution
   try {
-    comp = getApp()->lcc()->FindOrLoad_Component( "FactoryServerPy", name( "" ) );
+    comp = getApp()->lcc()->FindOrLoad_Component( "FactoryServerPy", name().toLatin1() );
   }
-  catch (CORBA::Exception&) {
+  catch ( CORBA::Exception& ) {
   }
   return comp;
 }
 
 /*!
- * Get module engine IOR, returns empty string if engine is not found in LifeCycleCORBA
- */
+  \birief Get module engine IOR.
+
+  Returns empty string if engine is not found in LifeCycleCORBA.
+
+  \return module's engine IOR
+*/
 QString SALOME_PYQT_Module::engineIOR() const
 {
-  QString anIOR = QString::null;
+  FuncMsg fmsg( "SALOME_PYQT_Module::engineIOR()" );
+
+  QString anIOR = "";
   if ( !CORBA::is_nil( getEngine() ) )
-    return QString( getApp()->orb()->object_to_string( getEngine() ) );
-  return QString( "" );
+    anIOR = getApp()->orb()->object_to_string( getEngine() );
+  return anIOR;
 }
 
 /*!
- * Processes context popup menu request
- * - calls Python module's definePopup(...) method (obsolete function, used for compatibility with old code)
- *   to define the popup menu context
- * - parses XML resourses file (if exists) and fills the popup menu with the items)
- * - calls Python module's customPopup(...) method (obsolete function, used for compatibility with old code)
- *   to allow module to customize the popup menu
- * - for new modules calls createPopupMenu() function to allow the modules to build the popup menu
- *   by using insertItem(...) Qt functions.
- */
-void SALOME_PYQT_Module::contextMenu( const QString& theContext, QPopupMenu* thePopupMenu )
+  \brief Process (internally) context popup menu request.
+
+  Performs the following actions:
+  - calls Python module's definePopup(...) method (obsolete function, 
+  used for compatibility with old code) to define the popup menu context
+  - parses XML resourses file (if exists) and fills the popup menu with the items)
+  - calls Python module's customPopup(...) method (obsolete function, 
+  used for compatibility with old code) to allow module to customize the popup menu
+  - for new modules calls createPopupMenu() function to allow the 
+  modules to build the popup menu by using insertItem(...) Qt functions.
+
+  \param theContext popup menu context
+  \param thePopupMenu popup menu
+*/
+void SALOME_PYQT_Module::contextMenu( const QString& theContext, QMenu* thePopupMenu )
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::contextMenu()" );
+
   // Python interpreter should be initialized and Python module should be
   // import first
   if ( !myInterp || !myModule )
@@ -992,15 +1165,15 @@ void SALOME_PYQT_Module::contextMenu( const QString& theContext, QPopupMenu* the
 
   QString aContext( "" ), aObject( "" ), aParent( theContext );
 
-  if ( IsCallOldMethods && PyObject_HasAttrString(myModule , "definePopup") ) { //__CALL_OLD_METHODS__
+  if ( IsCallOldMethods && PyObject_HasAttrString( myModule , "definePopup" ) ) {
     // call definePopup() Python module's function
     // this is obsolete function, used only for compatibility reasons
-    PyObjWrapper res(PyObject_CallMethod( myModule,
-                                         "definePopup",
-                                         "sss",
-                                         aContext.latin1(),
-                                         aObject.latin1(),
-                                         aParent.latin1() ) );
+    PyObjWrapper res( PyObject_CallMethod( myModule,
+                                          "definePopup",
+                                          "sss",
+                                          aContext.toLatin1().constData(),
+                                          aObject.toLatin1().constData(),
+                                          aParent.toLatin1().constData() ) );
     if( !res ) {
       PyErr_Print();
     }
@@ -1013,55 +1186,61 @@ void SALOME_PYQT_Module::contextMenu( const QString& theContext, QPopupMenu* the
        aParent  = pa;
       }
     }
-  }                        //__CALL_OLD_METHODS__
+  } // if ( IsCallOldMethods ... )
 
   // first try to create menu via XML parser:
   // we create popup menus without help of QtxPopupMgr
   if ( myXmlHandler )
     myXmlHandler->createPopup( thePopupMenu, aContext, aParent, aObject );
 
-  PyObjWrapper sipPopup( sipBuildResult( 0, "M", thePopupMenu, sipClass_QPopupMenu ) );
+  PyObjWrapper sipPopup( sipBuildResult( 0, "M", thePopupMenu, sipClass_QMenu ) );
 
   // then call Python module's createPopupMenu() method (for new modules)
-  if ( PyObject_HasAttrString(myModule , "createPopupMenu") ) {
+  if ( PyObject_HasAttrString( myModule , "createPopupMenu" ) ) {
     PyObjWrapper res1( PyObject_CallMethod( myModule,
-                                         "createPopupMenu",
-                                         "Os",
-                                         sipPopup.get(),
-                                         aContext.latin1() ) );
+                                           "createPopupMenu",
+                                           "Os",
+                                           sipPopup.get(),
+                                           aContext.toLatin1().constData() ) );
     if( !res1 ) {
       PyErr_Print();
     }
   }
 
-  if ( IsCallOldMethods && PyObject_HasAttrString(myModule , "customPopup") ) { //__CALL_OLD_METHODS__
+  if ( IsCallOldMethods && PyObject_HasAttrString( myModule , "customPopup" ) ) {
     // call customPopup() Python module's function
     // this is obsolete function, used only for compatibility reasons
     PyObjWrapper res2( PyObject_CallMethod( myModule,
                                            "customPopup",
                                            "Osss",
                                            sipPopup.get(),
-                                           aContext.latin1(),
-                                           aObject.latin1(),
-                                           aParent.latin1() ) );
+                                           aContext.toLatin1().constData(),
+                                           aObject.toLatin1().constData(),
+                                           aParent.toLatin1().constData() ) );
     if( !res2 ) {
       PyErr_Print();
     }
-  }                        //__CALL_OLD_METHODS__
+  }
 }
 
 /*!
- * Processes GUI event
- * - calls Python module's OnGUIEvent() method
- */
+  \brief Internal GUI event handling.
+
+  Performs the following actions:
+  - calls Python module's OnGUIEvent() method
+
+  \param theId GUI action ID
+*/
 void SALOME_PYQT_Module::guiEvent( const int theId )
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::guiEvent()" );
+
   // Python interpreter should be initialized and Python module should be
   // import first
   if ( !myInterp || !myModule )
     return;
 
-  if ( PyObject_HasAttrString(myModule , "OnGUIEvent") ) {
+  if ( PyObject_HasAttrString( myModule , "OnGUIEvent" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, "OnGUIEvent", "i", theId ) );
     if( !res ) {
       PyErr_Print();
@@ -1070,30 +1249,15 @@ void SALOME_PYQT_Module::guiEvent( const int theId )
 }
 
 /*!
- * Menu highlight processing
- * - calls Python module's menuActivated(int,int) method
- */
-void SALOME_PYQT_Module::menuHighlight( const int menu, const int submenu )
-{
-  // Python interpreter should be initialized and Python module should be
-  // import first
-  if ( !myInterp || !myModule )
-    return;
-
-  if ( PyObject_HasAttrString(myModule , "menuHighlight") ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule, "menuHighlight", "ii", menu, submenu ) );
-    if( !res ) {
-      PyErr_Print();
-    }
-  }
-}
+  \brief Initialize (internally) preferences for the module.
 
-/*!
- *  Initialises preferences for the module
- *  - calls Python module's createPreferences() method
- */
+  Performs the following actions:
+  - calls Python module's createPreferences() method
+*/
 void SALOME_PYQT_Module::initPreferences()
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::initPreferences()" );
+
   // Python interpreter should be initialized and Python module should be
   // import first
   if ( !myInterp || !myModule )
@@ -1103,7 +1267,7 @@ void SALOME_PYQT_Module::initPreferences()
   // might be called during the module intialization process
   myInitModule = this;
 
-  if ( PyObject_HasAttrString(myModule , "createPreferences") ) {
+  if ( PyObject_HasAttrString( myModule , "createPreferences" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, "createPreferences", "" ) );
     if( !res ) {
       PyErr_Print();
@@ -1114,10 +1278,13 @@ void SALOME_PYQT_Module::initPreferences()
 }
 
 /*!
- *  Initialises python subinterpreter (one per study)
- */
+  \brief Initialize python subinterpreter (one per study).
+  \param theStudyId study ID
+*/
 void SALOME_PYQT_Module::initInterp( int theStudyId )
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::initInterp()" );
+
   // check study Id
   if ( !theStudyId ) {
     // Error! Study Id must not be 0!
@@ -1125,7 +1292,7 @@ void SALOME_PYQT_Module::initInterp( int theStudyId )
     return;
   }
   // try to find the subinterpreter
-  if( myInterpMap.find( theStudyId ) != myInterpMap.end() ) {
+  if( myInterpMap.contains( theStudyId ) ) {
     // found!
     myInterp = myInterpMap[ theStudyId ];
     return;
@@ -1161,11 +1328,14 @@ void SALOME_PYQT_Module::initInterp( int theStudyId )
 }
 
 /*!
- *  Imports Python GUI module and remember the reference to the module
- *  !!! initInterp() should be called first!!!
- */
+  \brief Import Python GUI module and remember the reference to the module.
+
+  Attention! initInterp() should be called first!!!
+*/
 void SALOME_PYQT_Module::importModule()
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::importModule()" );
+
   // check if the subinterpreter is initialized
   if ( !myInterp ) {
     // Error! Python subinterpreter should be initialized first!
@@ -1176,8 +1346,8 @@ void SALOME_PYQT_Module::importModule()
   // ... first get python lock
   PyLockWrapper aLock = myInterp->GetLockWrapper();
   // ... then import a module
-  QString aMod = QString( name("") ) + "GUI";
-  myModule = PyImport_ImportModule( (char*)( aMod.latin1() ) );
+  QString aMod = name() + "GUI";
+  myModule = PyImport_ImportModule( aMod.toLatin1().data() );
   if( !myModule ) {
     // Error!
     PyErr_Print();
@@ -1186,12 +1356,17 @@ void SALOME_PYQT_Module::importModule()
 }
 
 /*!
- *  Calls <module>.setWorkSpace() method with PyQt QWidget object to use with
- *  interpreter.
- *  !!! initInterp() and importModule() should be called first!!!
- */
+  \brief Set study workspace to the Python module.
+
+  Calls setWorkSpace() method of the Pythohn module with 
+  PyQt QWidget object to use with interpreter.
+
+  Attention! initInterp() and importModule() should be called first!!!
+*/
 void SALOME_PYQT_Module::setWorkSpace()
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::setWorkSpace()" );
+
   // check if the subinterpreter is initialized and Python module is imported
   if ( !myInterp || !myModule ) {
     // Error! Python subinterpreter should be initialized and module should be imported first!
@@ -1210,7 +1385,7 @@ void SALOME_PYQT_Module::setWorkSpace()
     return;
   }
 
-  if ( IsCallOldMethods ) { //__CALL_OLD_METHODS__
+  if ( IsCallOldMethods ) {
     // ... then get workspace object
     QWidget* aWorkspace = 0;
     if ( getApp()->desktop()->inherits( "STD_MDIDesktop" ) ) {
@@ -1225,32 +1400,39 @@ void SALOME_PYQT_Module::setWorkSpace()
     }
     PyObjWrapper pyws( sipBuildResult( 0, "M", aWorkspace, sipClass_QWidget ) );
     // ... and finally call Python module's setWorkspace() method (obsolete)
-    if ( PyObject_HasAttrString(myModule , "setWorkSpace") ) {
+    if ( PyObject_HasAttrString( myModule , "setWorkSpace" ) ) {
       PyObjWrapper res( PyObject_CallMethod( myModule, "setWorkSpace", "O", pyws.get() ) );
       if( !res ) {
         PyErr_Print();
       }
     }
-  }                         //__CALL_OLD_METHODS__
+  }
 }
 
 /*!
- *  Preference changing callback function
- * - calls Python module's preferenceChanged(string,string,string) method
- */
+  \brief Preference changing callback function (internal).
+
+  Performs the following actions:
+  - call Python module's preferenceChanged() method
+
+  \param section setting section name
+  \param setting setting name
+*/
 void SALOME_PYQT_Module::prefChanged( const QString& section, const QString& setting )
 {
+  FuncMsg fmsg( "SALOME_PYQT_Module::prefChanged()" );
+
   // Python interpreter should be initialized and Python module should be
   // import first
   if ( !myInterp || !myModule )
     return;
 
-  if ( PyObject_HasAttrString(myModule , "preferenceChanged") ) {
+  if ( PyObject_HasAttrString( myModule , "preferenceChanged" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule,
                                           "preferenceChanged", 
                                           "ss", 
-                                          section.latin1(), 
-                                          setting.latin1() ) );
+                                          section.toLatin1().constData(), 
+                                          setting.toLatin1().constData() ) );
     if( !res ) {
       PyErr_Print();
     }
@@ -1258,447 +1440,586 @@ void SALOME_PYQT_Module::prefChanged( const QString& section, const QString& set
 }
 
 /*!
- * Returns default menu group
- */
+  \brief Get default menu group identifier
+  \return menu group ID (40 by default)
+*/
 int SALOME_PYQT_Module::defaultMenuGroup()
 {
-  return __DEFAULT_GROUP__
+  return DEFAULT_GROUP
 }
 
-/*!
- * The next methods call the parent implementation.
- * This is done to open protected methods from CAM_Module class.
- * Also these methods are used to register created from outside menus
- * in order to enable dynamic menus handling.
- */
-
+//
+// The next methods call the parent implementation.
+// This is done to open protected methods from CAM_Module class.
+//
 
-/*! Create tool bar with name \a name, if it was't created before.
- * \retval -1 - if tool manager was't be created.
- */
+/*!
+  \brief Create toolbar with specified \a name.
+  \param name toolbar name
+  \return toolbar ID or -1 if toolbar creation is failed
+*/
 int SALOME_PYQT_Module::createTool( const QString& name )
 {
   return SalomeApp_Module::createTool( name );
 }
-/*! Create tool.
- * Insert QAction with id \a id from action map(myActionMap) to tool manager.
- *\param id   - integer
- *\param tBar - integer
- *\param idx  - integer
- *\retval integer id of new action in tool manager.
- *\retval Return -1 if something wrong.
- */
+
+/*! 
+  \brief Insert action with specified \a id to the toolbar.
+  \param id action ID
+  \param tBar toolbar ID
+  \param idx required index in the toolbar
+  \return action ID or -1 if action could not be added
+*/
 int SALOME_PYQT_Module::createTool( const int id, const int tBar, const int idx )
 {
   return SalomeApp_Module::createTool( id, tBar, idx );
 }
-/*! Create tool.
- * Insert QAction with id \a id from action map(myActionMap) to tool manager.
- *\param id   - integer
- *\param tBar - QString&
- *\param idx  - integer
- *\retval integer id of new action in tool manager.
- *\retval Return -1 if something wrong.
- */
+
+/*!
+  \brief Insert action with specified \a id to the toolbar.
+  \param id action ID
+  \param tBar toolbar name
+  \param idx required index in the toolbar
+  \return action ID or -1 if action could not be added
+*/
 int SALOME_PYQT_Module::createTool( const int id, const QString& tBar, const int idx )
 {
   return SalomeApp_Module::createTool( id, tBar, idx );
 }
-/*! Create tool. Register action \a a with id \a id.
- * Insert QAction to tool manager.
- *\param a - QAction
- *\param tBar - integer
- *\param id   - integer
- *\param idx  - integer
- *\retval integer id of new action in tool manager.
- *\retval Return -1 if something wrong.
- */
+
+/*!
+  \brief Insert action to the toolbar.
+  \param a action
+  \param tBar toolbar ID
+  \param id required action ID
+  \param idx required index in the toolbar
+  \return action ID or -1 if action could not be added
+*/
 int SALOME_PYQT_Module::createTool( QAction* a, const int tBar, const int id, const int idx )
 {
   return SalomeApp_Module::createTool( a, tBar, id, idx );
 }
-/*! Create tool. Register action \a a with id \a id.
- * Insert QAction to tool manager.
- *\param a - QAction
- *\param tBar - QString&
- *\param id   - integer
- *\param idx  - integer
- *\retval integer id of new action in tool manager.
- *\retval Return -1 if something wrong.
- */
+
+/*!
+  \brief Insert action to the toolbar.
+  \param a action
+  \param tBar toolbar name
+  \param id required action ID
+  \param idx required index in the toolbar
+  \return action ID or -1 if action could not be added
+*/
 int SALOME_PYQT_Module::createTool( QAction* a, const QString& tBar, const int id, const int idx )
 {
   return SalomeApp_Module::createTool( a, tBar, id, idx );
 }
 
-int SALOME_PYQT_Module::createMenu( const QString& subMenu, const int menu, const int id, const int group, const int idx, const bool constantMenu )
+/*!
+  \brief Create main menu.
+  \param subMenu menu name
+  \param menu parent menu ID
+  \param id required menu ID
+  \param group menu group ID
+  \param idx required index in the menu
+  \return menu ID or -1 if menu could not be added
+*/
+int SALOME_PYQT_Module::createMenu( const QString& subMenu, const int menu, const int id, const int group, const int idx )
 {
-  bool exists = hasMenu( subMenu, menu );
-  int regId = SalomeApp_Module::createMenu( subMenu, menu, id, group, idx, true );
-  if ( !exists )
-    registerMenu( regId, menu, constantMenu );
-  return regId;
+  return SalomeApp_Module::createMenu( subMenu, menu, id, group, idx );
 }
 
-int SALOME_PYQT_Module::createMenu( const QString& subMenu, const QString& menu, const int id, const int group, const int idx, const bool constantMenu )
+/*!
+  \brief Create main menu.
+  \param subMenu menu name
+  \param menu parent menu name (list of menu names separated by "|")
+  \param id required menu ID
+  \param group menu group ID
+  \param idx required index in the menu
+  \return menu ID or -1 if menu could not be added
+*/
+int SALOME_PYQT_Module::createMenu( const QString& subMenu, const QString& menu, const int id, const int group, const int idx )
 {
-  QStringList menus = QStringList::split( "|", menu, false );
-  int pid = -1;
-  for (int i = 0; i < menus.count(); i++ ) {
-    pid = createMenu( menus[i], pid, -1, -1, -1, constantMenu );
-    if ( pid == -1 ) break;
-  }
-  if ( pid != -1 )
-    pid = createMenu( subMenu, pid, id, group, idx, constantMenu );
-  return pid;
+  return SalomeApp_Module::createMenu( subMenu, menu, id, group, idx );
 }
 
-int SALOME_PYQT_Module::createMenu( const int id, const int menu, const int group, const int idx, const bool constantMenu )
+/*!
+  \brief Insert action to the main menu.
+  \param id action ID
+  \param menu parent menu ID
+  \param group menu group ID
+  \param idx required index in the menu
+  \return action ID or -1 if action could not be added
+*/
+int SALOME_PYQT_Module::createMenu( const int id, const int menu, const int group, const int idx )
 {
-  int regId = SalomeApp_Module::createMenu( id, menu, group, idx );
-  if ( regId != -1 )
-    registerMenu( regId, menu, constantMenu );
-  return regId;
+  return SalomeApp_Module::createMenu( id, menu, group, idx );
 }
 
-int SALOME_PYQT_Module::createMenu( const int id, const QString& menu, const int group, const int idx, const bool constantMenu )
+/*!
+  \brief Insert action to the main menu.
+  \param id action ID
+  \param menu parent menu name (list of menu names separated by "|")
+  \param group menu group ID
+  \param idx required index in the menu
+  \return action ID or -1 if action could not be added
+*/
+int SALOME_PYQT_Module::createMenu( const int id, const QString& menu, const int group, const int idx )
 {
-  QStringList menus = QStringList::split( "|", menu, false );
-  int pid = -1;
-  for (int i = 0; i < menus.count(); i++ ) {
-    pid = createMenu( menus[i], pid, -1, -1, -1, constantMenu );
-    if ( pid == -1 ) break;
-  }
-  if ( pid != -1 )
-    pid = createMenu( id, pid, group, idx, constantMenu );
-  return pid;
+  return SalomeApp_Module::createMenu( id, menu, group, idx );
 }
 
-int SALOME_PYQT_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int idx, const bool constantMenu )
+/*!
+  \brief Insert action to the main menu.
+  \param a action
+  \param menu parent menu ID
+  \param group menu group ID
+  \param idx required index in the menu
+  \return action ID or -1 if action could not be added
+*/
+int SALOME_PYQT_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int idx )
 {
-  int regId = SalomeApp_Module::createMenu( a, menu, id, group, idx );
-  if ( regId != -1 )
-    registerMenu( regId, menu, constantMenu );
-  return regId;
+  return SalomeApp_Module::createMenu( a, menu, id, group, idx );
 }
 
-int SALOME_PYQT_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int idx, const bool constantMenu )
+/*!
+  \brief Insert action to the main menu.
+  \param a action
+  \param menu parent menu name (list of menu names separated by "|")
+  \param group menu group ID
+  \param idx required index in the menu
+  \return action ID or -1 if action could not be added
+*/
+int SALOME_PYQT_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int idx )
 {
-  QStringList menus = QStringList::split( "|", menu, false );
-  int pid = -1;
-  for (int i = 0; i < menus.count(); i++ ) {
-    pid = createMenu( menus[i], pid, -1, -1, -1, constantMenu );
-    if ( pid == -1 ) break;
-  }
-  if ( pid != -1 )
-    pid = createMenu( a, pid, id, group, idx, constantMenu );
-  return pid;
+  return SalomeApp_Module::createMenu( a, menu, id, group, idx );
 }
 
-QAction* SALOME_PYQT_Module::createSeparator()
+/*!
+  \brief Create separator action which can be used in the menu or toolbar.
+  \return new separator action
+*/
+QAction* SALOME_PYQT_Module::separator()
 {
   return SalomeApp_Module::separator();
 }
 
+/*!
+  \brief Get action by specified \a id.
+  \return action or 0 if it is not found
+*/
 QAction* SALOME_PYQT_Module::action( const int id ) const
 {
-  return SalomeApp_Module::action( id );
+  QAction* a = SalomeApp_Module::action( id );
+  if ( !a ) {
+    // try menu
+    QMenu* m = menuMgr()->findMenu( id );
+    if ( m ) a = m->menuAction();
+  }
+  return a;
 }
 
+/*!
+  \brief Get action identifier.
+  \return action ID or -1 if action is not registered
+*/
 int SALOME_PYQT_Module::actionId( const QAction* a ) const
 {
   return SalomeApp_Module::actionId( a );
 }
 
+/*!
+  \brief Create new action.
+  
+  If the action with specified identifier already registered
+  it is not created, but its attributes are only modified.
+
+  \param id action ID
+  \param text tooltip text
+  \param icon icon
+  \param menu menu text
+  \param tip status tip
+  \param key keyboard shortcut
+  \param toggle \c true for checkable action
+  \return created action
+*/
 QAction* SALOME_PYQT_Module::createAction( const int id, const QString& text, const QString& icon,
                                           const QString& menu, const QString& tip, const int key,
-                                          const bool toggle )
+                                          const bool toggle, QObject* parent )
 {
-  QIconSet anIcon = loadIcon( icon );
+  QIcon anIcon = loadIcon( icon );
   QAction* a = action( id );
   if ( a ) {
-    if ( a->text().isEmpty()      && !text.isEmpty() )  a->setText( text );
-    if ( a->menuText().isEmpty()  && !menu.isEmpty() )  a->setMenuText( menu );
-    if ( a->iconSet().isNull()    && !anIcon.isNull() ) a->setIconSet( anIcon );
-    if ( a->statusTip().isEmpty() && !tip.isNull() )    a->setStatusTip( tip );
-    if ( a->accel().isEmpty()     && key )              a->setAccel( key );
-    if ( a->isToggleAction() != toggle )                a->setToggleAction( toggle );
-    disconnect( a, SIGNAL( activated() ), this, SLOT( onGUIEvent() ) );
-    connect(    a, SIGNAL( activated() ), this, SLOT( onGUIEvent() ) );
+    if ( a->toolTip().isEmpty()   && !text.isEmpty() )  a->setToolTip( text );
+    if ( a->text().isEmpty()      && !menu.isEmpty() )  a->setText( menu );
+    if ( a->icon().isNull()       && !anIcon.isNull() ) a->setIcon( anIcon );
+    if ( a->statusTip().isEmpty() && !tip.isEmpty() )   a->setStatusTip( tip );
+    if ( a->shortcut().isEmpty()  && key )              a->setShortcut( key );
+    if ( a->isCheckable() != toggle )                   a->setCheckable( toggle );
+    disconnect( a, SIGNAL( triggered( bool ) ), this, SLOT( onGUIEvent() ) );
+    connect(    a, SIGNAL( triggered( bool ) ), this, SLOT( onGUIEvent() ) );
   }
   else {
-    a = SalomeApp_Module::createAction( id, text, anIcon, menu, tip, key, getApp()->desktop(), toggle, this, SLOT( onGUIEvent() ) );
+    a = SalomeApp_Module::createAction( id, 
+                                       text, 
+                                       anIcon, 
+                                       menu, 
+                                       tip, 
+                                       key, 
+                                       parent ? parent : this, 
+                                       toggle, 
+                                       this, 
+                                       SLOT( onGUIEvent() ) );
   }
   return a;
 }
 
+/*!
+  \brief Create new action group.
+  
+  If the action with specified identifier already registered
+  it is not created, but its attributes are only modified.
+
+  \param id action ID
+  \param text tooltip text
+  \param icon icon
+  \param menu menu text
+  \param tip status tip
+  \param key keyboard shortcut
+  \param toggle \c true for checkable action
+  \return created action
+*/
+QtxActionGroup* SALOME_PYQT_Module::createActionGroup(const int id, const bool exclusive)
+{
+  QtxActionGroup* a = qobject_cast<QtxActionGroup*>( action( id ) );
+  if ( !a ) {
+    a = new QtxActionGroup( this );
+    SalomeApp_Module::registerAction( id, a );
+  }
+  a->setExclusive( exclusive );
+  return a;
+}
+
 /*! 
- * Load icon from resource file
- */
-QIconSet SALOME_PYQT_Module::loadIcon( const QString& fileName )
+  \brief Load icon from resource file.
+  \param fileName icon file name
+  \return icon (null icon if loading failed)
+*/
+QIcon SALOME_PYQT_Module::loadIcon( const QString& fileName )
 {
-  QIconSet anIcon;
+  QIcon anIcon;
   if ( !fileName.isEmpty() ) {
-    QPixmap pixmap  = getApp()->resourceMgr()->loadPixmap( name(""), tr( fileName ) );
+    QPixmap pixmap = getApp()->resourceMgr()->loadPixmap( name(), tr( fileName.toLatin1() ) );
     if ( !pixmap.isNull() )
-      anIcon = QIconSet( pixmap );
+      anIcon = QIcon( pixmap );
   }
   return anIcon;
 }
 
 /*!
- * Returns TRUE if menu already exists
- */
-bool SALOME_PYQT_Module::hasMenu( const QString& subMenu, const int menu )
+  \brief Add global application preference (for example, 
+  application specific section).
+  \param label preference name
+  \return preference ID
+*/
+int SALOME_PYQT_Module::addGlobalPreference( const QString& label )
 {
-  return menuMgr() && menuMgr()->containsMenu( subMenu, menu );
+  LightApp_Preferences* pref = preferences();
+  if ( !pref )
+    return -1;
+
+  return pref->addPreference( label, -1 );
 }
 
 /*!
- * Register the menu
- */
-void SALOME_PYQT_Module::registerMenu( const int id, const int menu, const bool constantMenu )
+  \brief Add preference.
+  \param label preference name
+  \return preference ID
+*/
+int SALOME_PYQT_Module::addPreference( const QString& label )
 {
-  QAction* a = action( id );
-  QAction* s = separator();
-  if ( a && a == s )
-    return;
-  if ( !registered( id, menu ) ) 
-    myMenus[menu].append( MenuId( id, constantMenu ) );
+  return SalomeApp_Module::addPreference( label );
+}
+                                      
+/*!
+  \brief Add preference.
+  \param label preference name
+  \param pId parent preference ID
+  \param type preference type
+  \param section resource file section name
+  \param param resource file setting name
+  \return preference ID
+*/
+int SALOME_PYQT_Module::addPreference( const QString& label, 
+                                      const int pId, const int type,
+                                      const QString& section,
+                                      const QString& param )
+{
+  return SalomeApp_Module::addPreference( label, pId, type, section, param );
 }
 
 /*!
- * Unregister the menu
- */
-void SALOME_PYQT_Module::unregisterMenu( const int id, const int menu )
+  \brief Get the preference property.
+  \param id preference ID
+  \param prop property name
+  \return property value (invalid QVariant() if property is not found)
+*/
+QVariant SALOME_PYQT_Module::preferenceProperty( const int id, 
+                                                const QString& prop ) const
 {
-  if ( myMenus.find( menu ) != myMenus.end() ) {
-    MenuIdList::iterator lit;
-    for ( lit = myMenus[menu].begin(); lit != myMenus[menu].end(); ++lit ) {
-      if ( (*lit).id == id ) {
-       myMenus[menu].remove( lit );
-       return;
-      }
-    }
-  }
+  QVariant v = SalomeApp_Module::preferenceProperty( id, prop );
+  return v;
 }
 
 /*!
- * Returns TRUE if the menu is registered
- */
-bool SALOME_PYQT_Module::registered( const int id, const int menu )
+  \brief Set the preference property.
+  \param id preference ID
+  \param prop property name
+  \param var property value
+*/
+void SALOME_PYQT_Module::setPreferenceProperty( const int id, 
+                                               const QString& prop, 
+                                               const QVariant& var )
 {
-  MenuMap::iterator mit;
-  for ( mit = myMenus.begin(); mit != myMenus.end(); ++mit ) {
-    MenuIdList::iterator lit;
-    for ( lit = mit.data().begin(); lit != mit.data().end(); ++lit ) {
-      if ( (*lit).id == id && ( menu == 0 || mit.key() == menu ) )
-       return true;
-    }
-  }
-  return false;
+  SalomeApp_Module::setPreferenceProperty( id, prop, var );
 }
 
+
 /*!
- * Returns TRUE if the menu is constant (not removed by clearMenu()).
- * This concerns the menus which are created from XML files.
- */
-bool SALOME_PYQT_Module::isConstantMenu( const int id, const int menu )
+  \brief Signal handler windowActivated(SUIT_ViewWindow*) of SUIT_Desktop
+  \param pview view being activated
+*/
+void SALOME_PYQT_Module::onActiveViewChanged( SUIT_ViewWindow* pview )
 {
-  if ( myMenus.find( menu ) != myMenus.end() ) {
-    MenuIdList& l = myMenus[ menu ];
-    MenuIdList::iterator lit;
-    for ( lit = l.begin(); lit != l.end(); ++lit ) {
-      if ( (*lit).id == id && (*lit).constantMenu )
-       return true;
+  class ActiveViewChange : public PyInterp_LockRequest
+  {
+  public:
+    ActiveViewChange( PyInterp_Interp* _py_interp, SALOME_PYQT_Module* _obj, const SUIT_ViewWindow* _pview )
+      : PyInterp_LockRequest( _py_interp, 0, true ),
+        myObj(_obj),myView(_pview) {}
+
+  protected:
+    virtual void execute()
+    {
+      myObj->activeViewChanged( myView );
     }
-  }
-  return false;
+
+  private:
+    SALOME_PYQT_Module* myObj;
+    const SUIT_ViewWindow * myView;
+  };
+  
+  PyInterp_Dispatcher::Get()->Exec( new ActiveViewChange( myInterp, this, pview ) ); 
 }
 
 /*!
- * Displays/hides the module's menus.
- */
-void SALOME_PYQT_Module::setMenuShown( const bool show )
+  \brief Processes the view changing, calls Python module's activeViewChanged() method 
+  \param pview view being activated
+*/
+void SALOME_PYQT_Module::activeViewChanged( const SUIT_ViewWindow* pview )
 {
-  QtxActionMenuMgr* mMgr = menuMgr();
-  if ( !mMgr )
+  if ( !myInterp || !myModule ) 
     return;
+  
+  // Do not use SUIT_ViewWindow::closing() signal here. View manager reacts on 
+  // this signal and deletes view. So our slot does not works if it is connected 
+  // on this signal. SUIT_ViewManager::deleteView(SUIT_ViewWindow*) is used here
+  
+  connectView( pview );
 
-  bool upd = mMgr->isUpdatesEnabled();
-  mMgr->setUpdatesEnabled( false );
-
-  SalomeApp_Module::setMenuShown( show );
+  if ( PyObject_HasAttrString( myModule, "activeViewChanged" ) ) 
+  {
+    if ( !pview ) 
+      return;   
 
-  for ( MenuMap::iterator mit = myMenus.begin(); mit != myMenus.end(); ++mit ) {
-    MenuIdList::iterator lit;
-    for ( lit = mit.data().begin(); lit != mit.data().end(); ++lit )
-      if ( !action( (*lit).id ) )
-       mMgr->setShown( (*lit).id, show );
+    PyObjWrapper res( PyObject_CallMethod( myModule, "activeViewChanged", "i" , pview->getId() ) );
+    if( !res )
+      PyErr_Print();
   }
-
-  mMgr->setUpdatesEnabled( upd );
-  if ( upd )
-    mMgr->update();
 }
 
 /*!
- * Displays/hides the module's toolbars.
- */
-void SALOME_PYQT_Module::setToolShown( const bool show )
+  \brief Signal handler cloneView() of OCCViewer_ViewWindow
+  \param pview view being cloned
+*/
+void SALOME_PYQT_Module::onViewCloned( SUIT_ViewWindow* pview )
 {
-  SalomeApp_Module::setToolShown( show );
+  class ViewClone : public PyInterp_LockRequest
+  {
+  public:
+    ViewClone( PyInterp_Interp* _py_interp, SALOME_PYQT_Module* _obj, const SUIT_ViewWindow* _pview )
+      : PyInterp_LockRequest( _py_interp, 0, true ),
+        myObj(_obj), myView(_pview) {}
+
+  protected:
+    virtual void execute()
+    {
+      myObj->viewCloned( myView );
+    }
+
+  private:
+    SALOME_PYQT_Module* myObj;    
+    const SUIT_ViewWindow* myView;
+  };
+  
+  PyInterp_Dispatcher::Get()->Exec( new ViewClone( myInterp, this, pview ) );
 }
 
 /*!
- * Clears the given menu.
- * If <id> = 0   : clear all items in the <menu> menu
- * If <menu> = 0 : clear all menus recursively starting from top-level.
- * If <removeActions> = 0 : also unregister all removed actions (not delete!).
- */
-bool SALOME_PYQT_Module::clearMenu( const int id, const int menu, const bool removeActions )
+  \brief Processes the view cloning, calls Python module's activeViewCloned() method
+  \param pview view being cloned
+*/
+void SALOME_PYQT_Module::viewCloned( const SUIT_ViewWindow* pview )
 {
-  QAction* a = action( id );
-  QAction* s = separator();
-  typedef QValueList<int> IntList;
-  if ( a && a != s ) {
-    // action
-    IntList menus;
-    if ( menu != 0 ) {
-      if ( registered( id, menu ) ) menus.append( menu );
-    }
-    else {
-      MenuMap::iterator mit;
-      for ( mit = myMenus.begin(); mit != myMenus.end(); ++mit )
-       if ( registered( id, mit.key() ) ) menus.append( mit.key() );
-    }
-    for ( int i = 0; i < menus.count(); i++ ) {
-      if ( !isConstantMenu( id, menus[i] ) ) {
-       menuMgr()->remove( menuMgr()->actionId( a ), menus[ i ] );
-       unregisterMenu( id, menus[i] );
-      }
-    }
-    if ( !registered( id ) && removeActions )
-      unregisterAction( id );
-  }
-  else {
-    // menu
-    if ( id == 0 ) {
-      if ( menu == 0 ) {
-       // clear all menus recursively starting from top-level (main menu)
-       IntList l = myMenus.keys();
-       IntList::iterator lit;
-       for ( lit = l.begin(); lit != l.end(); ++lit )
-         clearMenu( 0, *lit, removeActions );
-      }
-      else {
-       if ( myMenus.find( menu ) != myMenus.end() ) {
-         // remove all items in the parent menu
-         IntList l;
-         MenuIdList::iterator lit;
-         for ( lit = myMenus[menu].begin(); lit != myMenus[menu].end(); ++lit )
-           l.append( (*lit).id );
-         for ( int i = 0; i < l.count(); i++ )
-           clearMenu( l[i], menu, removeActions );
-         if ( myMenus[menu].empty() )
-           myMenus.remove( menu );
-       }
-      }
-    }
-    else {
-      MenuMap::iterator mit;
-      for ( mit = myMenus.begin(); mit != myMenus.end(); ++mit ) {
-       MenuIdList::iterator lit;
-       for ( lit = mit.data().begin(); lit != mit.data().end(); ++lit ) {
-         if ( (*lit).id == id && ( menu == 0 || mit.key() == menu ) ) {
-           clearMenu( 0, id, removeActions ); // first remove all sub-menus
-           if ( !isConstantMenu( id, mit.key() ) ) {
-             menuMgr()->remove( id, mit.key() );
-             mit.data().remove( lit );
-             break;
-           }
-         }
-       }
-      }
-    }
+  if ( !myInterp || !myModule || !pview ) 
+    return;  
+
+  if ( PyObject_HasAttrString( myModule, "viewCloned" ) ) 
+  {
+    PyObjWrapper res( PyObject_CallMethod( myModule, "viewCloned", "i", pview->getId() ) );
+    if( !res )
+      PyErr_Print();
   }
-  return false;
 }
 
 /*!
- * The next methods call the parent implementation.
- * This is done to open protected methods from LightApp_Module class.
- */
-
-int SALOME_PYQT_Module::addGlobalPreference( const QString& label )
+  \brief Signal handler closing(SUIT_ViewWindow*) of a view
+  \param pview view being closed
+*/
+void SALOME_PYQT_Module::onViewClosed( SUIT_ViewWindow* pview )
 {
-  LightApp_Preferences* pref = preferences();
-  if ( !pref )
-    return -1;
+  class ViewClose : public PyInterp_LockRequest
+  {
+  public:
+    ViewClose( PyInterp_Interp* _py_interp, SALOME_PYQT_Module* _obj, const SUIT_ViewWindow* _pview )
+      : PyInterp_LockRequest( _py_interp, 0, true ),
+        myObj(_obj),myView(_pview) {}
 
-  return pref->addPreference( label, -1 );
-}
+  protected:
+    virtual void execute()
+    {
+      myObj->viewClosed( myView );
+    }
 
-int SALOME_PYQT_Module::addPreference( const QString& label )
-{
-  return SalomeApp_Module::addPreference( label );
-}
-                                      
-int SALOME_PYQT_Module::addPreference( const QString& label, 
-                                      const int pId, const int type,
-                                      const QString& section,
-                                      const QString& param )
-{
-  return SalomeApp_Module::addPreference( label, pId, type, section, param );
+  private:
+    SALOME_PYQT_Module* myObj;
+    const SUIT_ViewWindow * myView;    
+  };
+
+  PyInterp_Dispatcher::Get()->Exec( new ViewClose( myInterp, this, pview ) );
 }
 
-QVariant SALOME_PYQT_Module::preferenceProperty( const int id, 
-                                                const QString& prop ) const
+/*!
+  \brief Processes the view closing, calls Python module's viewClosed() method
+  \param pview view being closed
+*/
+void SALOME_PYQT_Module::viewClosed( const SUIT_ViewWindow* pview )
 {
-  QVariant v = SalomeApp_Module::preferenceProperty( id, prop );
-  return v;
+  if ( !myInterp || !myModule ) 
+    return;  
+
+  if ( PyObject_HasAttrString( myModule, "viewClosed" ) ) 
+  {
+    PyObjWrapper res( PyObject_CallMethod( myModule, "viewClosed", "i", pview->getId() ) );
+    if ( !res )
+    {
+      PyErr_Print();
+    }
+  }
 }
 
-void SALOME_PYQT_Module::setPreferenceProperty( const int id, 
-                                               const QString& prop, 
-                                               const QVariant& var )
+/*!
+  \brief Connects or disconnects signals about activating and cloning view on the module slots
+  \param pview view which is connected/disconnected
+*/
+void SALOME_PYQT_Module::connectView( const SUIT_ViewWindow* pview )
 {
-  SalomeApp_Module::setPreferenceProperty( id, prop, var );
+  SUIT_ViewManager* viewMgr = pview->getViewManager();
+  SUIT_ViewModel* viewModel = viewMgr ? viewMgr->getViewModel() : 0;
+      
+  if ( viewMgr )
+  {
+    disconnect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
+               this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
+  
+    connect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
+             this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
+  }
+  
+  // Connect cloneView() signal of an OCC View
+  if ( pview->inherits( "OCCViewer_ViewWindow" ) )
+  {
+    disconnect( pview, SIGNAL( viewCloned( SUIT_ViewWindow* ) ), 
+                this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
+    connect( pview, SIGNAL( viewCloned( SUIT_ViewWindow* ) ), 
+             this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
+  }
+  // Connect cloneView() signal of Plot2d View manager
+  else if ( viewModel && viewModel->inherits( "Plot2d_Viewer" ) )
+  {
+    disconnect( viewModel, SIGNAL( viewCloned( SUIT_ViewWindow* ) ), 
+                this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
+    connect( viewModel, SIGNAL( viewCloned( SUIT_ViewWindow* ) ), 
+             this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
+  }
 }
 
-// SALOME_PYQT_XmlHandler class implementation
-
-// gets an tag name for the dom element [ static ]
-// returns an empty string if the element does not have tag name
-static QString tagName( const QDomElement& element ) {
-  return element.tagName().stripWhiteSpace();
+/*!
+  \brief Get tag name for the DOM element.
+  \param element DOM element
+  \return empty string if the element does not have tag name
+  \internal
+*/
+static QString tagName( const QDomElement& element )
+{
+  return element.tagName().trimmed();
 }
 
-// gets an attribute by it's name for the dom element [ static ]
-// returns an empty string if the element does not have such attribute
-static QString attribute( const QDomElement& element, const QString& attName ) {
-  return element.attribute( attName ).stripWhiteSpace();
+/*!
+  \brief Get DOM element's attribute by its name.
+  \param element DOM element
+  \param attName attribute name
+  \return empty string if the element does not have such attribute
+  \internal
+*/
+static QString attribute( const QDomElement& element, const QString& attName )
+{
+  return element.attribute( attName ).trimmed();
 }
 
-// checks the given value for the boolean value [ static ]
-// returns TRUE if string represents boolean value: 
-// - "true", "yes" or "1" for true
-// - "false", "no" or "0" for false
-// second parameter allows to check certain boolean value
-// - 1: true
-// - 0: false
-// - other value is not taken into account
-static bool checkBool( const QString& value, const int check = -1 ) {
-  QString v = value.lower();
-  if ( ( v == "true"  || v == "yes"  || v == "1" ) && ( check != 0 ) )
+/*!
+  \brief Inspect specified string for the boolean value.
+  
+  This function returns \c true if string represents boolean value: 
+  - "true", "yes" or "1" for \c true
+  - "false", "no" or "0" for \c false
+  Second parameter allows to specify what boolean value is expected:
+  - 1: \c true
+  - 0: \c false
+  - other value is not taken into account (return represented value)
+
+  \param value inspected string
+  \param check expected boolean value
+  \return boolean value represented by the string (\a check is not 1 or 0)
+          or \c true if value correspond to the specified \a check
+*/
+static bool checkBool( const QString& value, const int check = -1 )
+{
+  QString v = value.toLower();
+  if ( ( v == "true"  || v == "yes" || v == "1" ) && ( check != 0 ) )
     return true;
-  if ( ( v == "false" || v == "no" || v == "0" ) && ( check != 1 ) )
+  if ( ( v == "false" || v == "no"  || v == "0" ) && ( check == 0 ) )
     return true;
   return false;
 }
 
-// checks the given value for the integer value [ static ]
-// returns -1 if item is empty or presents and invalid number
+/*!
+  \brief Inspect specified string for the integer value.
+  
+  This function returns returns -1 if item is empty or represents
+  an invalid number.
+  \param value inspected string
+  \param def default value
+  \param shift shift value (it is added to the integer value to produce shifted result)
+*/
 static int checkInt( const QString& value, const int def = -1, const int shift = -1 )
 {
   bool bOk;
@@ -1710,35 +2031,33 @@ static int checkInt( const QString& value, const int def = -1, const int shift =
 }
 
 /*!
- * Constructor
- */
-SALOME_PYQT_XmlHandler::SALOME_PYQT_XmlHandler( SALOME_PYQT_Module* module, 
-                                               const QString&      fileName )
-  : myModule( module ),
-    myMenuCreated( false )
+  \brief Constructor
+  \internal
+  \param module parent module pointer
+  \param fileName XML file path
+*/
+SALOME_PYQT_Module::XmlHandler::XmlHandler( SALOME_PYQT_Module* module, 
+                                           const QString&      fileName )
+: myModule( module )
 {
-  if (fileName.isEmpty() ) 
+  if ( fileName.isEmpty() ) 
     return;
   QFile aFile( fileName );
-  if ( !aFile.open( IO_ReadOnly ) )
-    return;
-  if ( !myDoc.setContent( &aFile ) ) {
-    aFile.close();
+  if ( !aFile.open( QIODevice::ReadOnly ) )
     return;
-  }
+  myDoc.setContent( &aFile );
   aFile.close();
 }
 
 /*!
- * Called by SALOME_PYQT_Module::activate() in order to create actions
- * (menus, toolbars, popup menus)
- */
-void SALOME_PYQT_XmlHandler::createActions()
-{
-  // check flag : are menus already created?
-  if ( myMenuCreated && !IsCallOldMethods ) 
-    return;
+  \brief Parse XML file and create actions.
+  \internal
   
+  Called by SALOME_PYQT_Module::activate() in order to create actions
+  (menus, toolbars).
+*/
+void SALOME_PYQT_Module::XmlHandler::createActions()
+{
   // get document element
   QDomElement aDocElem = myDoc.documentElement();
 
@@ -1755,45 +2074,20 @@ void SALOME_PYQT_XmlHandler::createActions()
     QDomNode n = aToolsList.item( i );
     createToolBar( n );
   }
-  // set flag : menus are already created
-  myMenuCreated = true;
-}
-
-/*!
- * Called by SALOME_PYQT_Module::deactivate() in order to remove actions
- * (menus, toolbars, popup menus)
- */
-void SALOME_PYQT_XmlHandler::clearActions()
-{
-  for ( uint i = 0; i < myMenuItems.count(); i++ ) {
-    QMenuData* md = dynamic_cast<QMenuData*>( myModule->getApp()->desktop()->menuBar() );
-    QStringList menus = QStringList::split( ":", myMenuItems[ i ] );
-    for ( uint j = 0; j < menus.count(); j++) {
-      int id = menus[ j ].toInt();
-      QMenuData* smd;
-      QMenuItem* mi = md->findItem( id, &smd );
-      if ( mi && md == smd ) {
-       if ( j == menus.count()-1 || !mi->popup() ) { // last item or not popup
-         md->removeItem( id );
-         break;
-       }
-       else if ( mi->popup() )
-         md = dynamic_cast<QMenuData*>( mi->popup() );
-      }
-      else
-       break;
-    }
-  }
-  myMenuItems.clear();
 }
 
 /*!
- *  Creates popup menu
- */
-void SALOME_PYQT_XmlHandler::createPopup( QPopupMenu*    menu,
-                                         const QString& context,
-                                         const QString& parent,
-                                         const QString& object )
+  \brief Create popup menu.
+  \internal
+  \param menu popup menu
+  \param context popup menu context
+  \param context popup menu parent object name
+  \param context popup menu object name
+*/
+void SALOME_PYQT_Module::XmlHandler::createPopup( QMenu*         menu,
+                                                 const QString& context,
+                                                 const QString& parent,
+                                                 const QString& object )
 {
   // get document element
   QDomElement aDocElem = myDoc.documentElement();
@@ -1804,7 +2098,7 @@ void SALOME_PYQT_XmlHandler::createPopup( QPopupMenu*    menu,
     QDomNode n = aPopupList.item( i );
     if ( !n.isNull() && n.isElement() ) {
       QDomElement e = n.toElement();
-      QString lab = attribute( e, "label-id"   );
+      // QString lab = attribute( e, "label-id" ); // not used // 
       QString ctx = attribute( e, "context-id" );
       QString prt = attribute( e, "parent-id"  );
       QString obj = attribute( e, "object-id"  );
@@ -1817,18 +2111,34 @@ void SALOME_PYQT_XmlHandler::createPopup( QPopupMenu*    menu,
 }
 
 /*!
-  Create main menu with child actions
- */
-void SALOME_PYQT_XmlHandler::createMenu( QDomNode&   parentNode, 
-                                        const int   parentMenuId, 
-                                        QPopupMenu* parentPopup )
+  \brief Activate menus
+  \internal
+  \param enable if \c true menus are activated, otherwise menus are deactivated
+*/
+void SALOME_PYQT_Module::XmlHandler::activateMenus( bool enable )
 {
   if ( !myModule )
     return;
 
-  if ( parentNode.isNull() )
-    return;
+  QtxActionMenuMgr* mgr = myModule->menuMgr();
+  int id;
+  foreach( id, myMenuItems ) mgr->setEmptyEnabled( id, enable );
+}
 
+/*!
+  \brief Create main menu item and insert actions to it.
+  \internal
+  \param parentNode XML node with menu description
+  \param parentMenuId parent menu ID (-1 for top-level menu)
+  \param parentPopup parent popup menu (0 for top-level menu)
+*/
+void SALOME_PYQT_Module::XmlHandler::createMenu( QDomNode& parentNode, 
+                                                const int parentMenuId, 
+                                                QMenu*    parentPopup )
+{
+  if ( !myModule || parentNode.isNull() )
+    return;
+  
   QDomElement parentElement = parentNode.toElement();
   if ( !parentElement.isNull() ) {
     QString plabel = attribute( parentElement, "label-id" );
@@ -1837,52 +2147,15 @@ void SALOME_PYQT_XmlHandler::createMenu( QDomNode&   parentNode,
     int     group  = checkInt( attribute( parentElement, "group-id" ), 
                               myModule->defaultMenuGroup() );
     if ( !plabel.isEmpty() ) {
-      QPopupMenu* popup = 0;
+      QMenu* popup = 0;
       int menuId = -1;
       // create menu
-      if ( IsCallOldMethods ) { // __CALL_OLD_METHODS__
-       SUIT_Desktop* desktop = myModule->getApp()->desktop();
-       if ( parentMenuId == -1 ) { // top-level menu
-         QMenuBar* mb = desktop->menuBar();
-         QMenuItem* mi = mb->findItem( pid );
-         if ( mi ) popup = mi->popup();
-         if ( !popup ) {
-           popup = new QPopupMenu( desktop );
-           ppos = checkInt( attribute( parentElement, "pos-id" ), -1, mb->count() );
-           menuId = mb->insertItem( plabel, popup, pid, ppos );
-           myCurrentMenu.push_back( QString::number( menuId ) );
-           myMenuItems.append( myCurrentMenu.join( ":" ) );
-         }
-         else {
-           menuId = pid;
-           myCurrentMenu.push_back( QString::number( menuId ) );
-         }
-       }
-       else {
-         // parentPopup should not be 0 here!
-         QMenuItem* mi = parentPopup->findItem( pid );
-         if ( mi ) popup = mi->popup();
-         if ( !popup ) {
-           popup = new QPopupMenu( desktop );
-           ppos = checkInt( attribute( parentElement, "pos-id" ), -1, popup->count() );
-           menuId = parentPopup->insertItem( plabel, popup, pid, ppos );
-           myCurrentMenu.push_back( QString::number( menuId ) );
-           myMenuItems.append( myCurrentMenu.join( ":" ) );
-         }
-         else {
-           menuId = pid;
-           myCurrentMenu.push_back( QString::number( menuId ) );
-         }
-       }
-      }
-      else {                    //!__CALL_OLD_METHODS__
-       menuId = myModule->createMenu( plabel,         // label
-                                      parentMenuId,   // parent menu ID, should be -1 for main menu
-                                      pid,            // ID
-                                      group,          // group ID
-                                      ppos,           // position
-                                      true );         // create constant menu (not removed by clearMenu())
-      }                         // __CALL_OLD_METHODS__
+      menuId = myModule->createMenu( plabel,         // label
+                                    parentMenuId,   // parent menu ID, -1 for top-level menu
+                                    pid,            // ID
+                                    group,          // group ID
+                                    ppos );         // position
+      myMenuItems.append( menuId );
       QDomNode node = parentNode.firstChild();
       while ( !node.isNull() ) {
        if ( node.isElement() ) {
@@ -1898,49 +2171,23 @@ void SALOME_PYQT_XmlHandler::createMenu( QDomNode&   parentNode,
            QString tooltip = attribute( elem, "tooltip-id" );
            QString accel   = attribute( elem, "accel-id" );
            bool    toggle  = checkBool( attribute( elem, "toggle-id" ) );
-           ////QString execute = attribute( elem, "execute-action" );               // not used
 
            // -1 action ID is not allowed : it means that <item-id> attribute is missed in the XML file!
            // also check if the action with given ID is already created
            if ( id != -1 ) {
-             if ( IsCallOldMethods ) { // __CALL_OLD_METHODS__
-               QIconSet iconSet = myModule->loadIcon( icon );
-               pos = checkInt( attribute( elem, "pos-id" ), -1, popup->count() );
-               int aid = iconSet.isNull() ? popup->insertItem( label, 
-                                                               myModule,
-                                                               SLOT( onGUIEvent(int) ),
-                                                               QKeySequence( accel ),
-                                                               id,
-                                                               pos ) :
-                                            popup->insertItem( iconSet, 
-                                                               label, 
-                                                               myModule,
-                                                               SLOT( onGUIEvent(int) ),
-                                                               QKeySequence( accel ),
-                                                               id,
-                                                               pos );
-               myCurrentMenu.push_back( QString::number( aid ) );
-               myMenuItems.append( myCurrentMenu.join( ":" ) );
-               myCurrentMenu.pop_back();
-               if ( toggle )
-                 popup->setItemChecked( aid, checkBool( attribute( elem, "toggle-id" ), 1 ) );
-             }
-             else {                    //!__CALL_OLD_METHODS__
-               // create menu action
-               QAction* action = myModule->createAction( id,                               // ID
-                                                         tooltip,                          // tooltip
-                                                         icon,                             // icon
-                                                         label,                            // menu text
-                                                         tooltip,                          // status-bar text
-                                                         QKeySequence( accel ),            // keyboard accelerator
-                                                         toggle );                         // toogled action
-               myModule->createMenu( action,   // action
-                                     menuId,   // parent menu ID
-                                     id,       // ID (same as for createAction())
-                                     group,    // group ID
-                                     pos,      // position
-                                     true );   // create constant menu (not removed by clearMenu())
-             }                         // __CALL_OLD_METHODS__
+             // create menu action
+             QAction* action = myModule->createAction( id,                     // ID
+                                                       tooltip,                // tooltip
+                                                       icon,                   // icon
+                                                       label,                  // menu text
+                                                       tooltip,                // status-bar text
+                                                       QKeySequence( accel ),  // keyboard accelerator
+                                                       toggle );               // toogled action
+             myModule->createMenu( action,   // action
+                                   menuId,   // parent menu ID
+                                   id,       // ID (same as for createAction())
+                                   group,    // group ID
+                                   pos );    // position
            }
          }
          else if ( aTagName == "submenu" ) {
@@ -1949,44 +2196,31 @@ void SALOME_PYQT_XmlHandler::createMenu( QDomNode&   parentNode,
          }
          else if ( aTagName == "separator" ) {
            // create menu separator
-           int id    = checkInt( attribute( elem, "item-id" ) );     // separator can have ID
+           int id    = checkInt( attribute( elem, "item-id" ) ); // separator can have ID
            int pos   = checkInt( attribute( elem, "pos-id" ) );
            int group = checkInt( attribute( elem, "group-id" ), 
                                  myModule->defaultMenuGroup() );
-           if ( IsCallOldMethods ) { // __CALL_OLD_METHODS__
-             pos = checkInt( attribute( elem, "pos-id" ), -1, popup->count() );
-             int sid = popup->insertSeparator( pos );
-             myCurrentMenu.push_back( QString::number( sid ) );
-             myMenuItems.append( myCurrentMenu.join( ":" ) );
-             myCurrentMenu.pop_back();
-           }
-           else {                    //!__CALL_OLD_METHODS__
-             QAction* action = myModule->createSeparator();
-             myModule->createMenu( action,  // separator action
-                                   menuId,  // parent menu ID
-                                   id,      // ID
-                                   group,   // group ID
-                                   pos,     // position
-                                   true );  // create constant menu (not removed by clearMenu())
-           }                         // __CALL_OLD_METHODS__
+           QAction* action = myModule->separator();
+           myModule->createMenu( action,  // separator action
+                                 menuId,  // parent menu ID
+                                 id,      // ID
+                                 group,   // group ID
+                                 pos );   // position
          }
        }
        node = node.nextSibling();
       }
-      myCurrentMenu.pop_back();
     }
   }
 }
 
 /*!
-  Create a toolbar with child actions
- */
-void SALOME_PYQT_XmlHandler::createToolBar( QDomNode& parentNode )
+  \brief Create a toolbar and insert actions to it.
+  \param parentNode XML node with toolbar description
+*/
+void SALOME_PYQT_Module::XmlHandler::createToolBar( QDomNode& parentNode )
 {
-  if ( !myModule )
-    return;
-
-  if ( parentNode.isNull() )
+  if ( !myModule || parentNode.isNull() )
     return;
 
   QDomElement parentElement = parentNode.toElement();
@@ -2008,26 +2242,25 @@ void SALOME_PYQT_XmlHandler::createToolBar( QDomNode& parentNode )
            QString tooltip = attribute( elem, "tooltip-id" );
            QString accel   = attribute( elem, "accel-id" );
            bool    toggle  = checkBool( attribute( elem, "toggle-id" ) );
-           ////QString execute = attribute( elem, "execute-action" );               // not used
 
            // -1 action ID is not allowed : it means that <item-id> attribute is missed in the XML file!
            // also check if the action with given ID is already created
             if ( id != -1 ) {
              // create toolbar action
-             QAction* action = myModule->createAction( id,                               // ID
-                                                       tooltip,                          // tooltip
-                                                       icon,                             // icon
-                                                       label,                            // menu text
-                                                       tooltip,                          // status-bar text
-                                                       QKeySequence( accel ),            // keyboard accelerator
-                                                       toggle );                         // toogled action
+             QAction* action = myModule->createAction( id,                    // ID
+                                                       tooltip,               // tooltip
+                                                       icon,                  // icon
+                                                       label,                 // menu text
+                                                       tooltip,               // status-bar text
+                                                       QKeySequence( accel ), // keyboard accelerator
+                                                       toggle );              // toogled action
              myModule->createTool( action, tbId, -1, pos );
            }
          }
          else if ( aTagName == "separatorTB" || aTagName == "separator" ) {
            // create toolbar separator
-           int     pos     = checkInt( attribute( elem, "pos-id" ) );
-           QAction* action = myModule->createSeparator();
+           int pos = checkInt( attribute( elem, "pos-id" ) );
+           QAction* action = myModule->separator();
            myModule->createTool( action, tbId, -1, pos );
          }
        }
@@ -2038,68 +2271,71 @@ void SALOME_PYQT_XmlHandler::createToolBar( QDomNode& parentNode )
 }
 
 /*!
- * Fill popup menu with items
- */
-void SALOME_PYQT_XmlHandler::insertPopupItems( QDomNode& parentNode, QPopupMenu* menu )
+  \brief Fill popup menu with the items.
+  \param parentNode XML node with popup menu description
+  \param menu popup menu
+*/
+void SALOME_PYQT_Module::XmlHandler::insertPopupItems( QDomNode& parentNode, QMenu* menu )
 {
-  if ( !myModule )
-    return;
-
-  if ( parentNode.isNull() )
+  if ( !myModule && parentNode.isNull() )
     return;
 
   // we create popup menus without help of QtxPopupMgr
   QDomNode node = parentNode.firstChild();
-  while ( !node.isNull() ) {
+  while ( !node.isNull() ) { 
     if ( node.isElement() ) {
       QDomElement elem = node.toElement();
       QString aTagName = tagName( elem );
+      QList<QAction*> actions = menu->actions();
       if ( aTagName == "popup-item" ) {
        // insert a command item
        int     id      = checkInt( attribute( elem, "item-id" ) );
        int     pos     = checkInt( attribute( elem, "pos-id" ) );
        QString label   = attribute( elem, "label-id" );
        QString icon    = attribute( elem, "icon-id" );
-       /////QString tooltip = attribute( elem, "tooltip-id" );                   // not used
+       QString tooltip = attribute( elem, "tooltip-id" );
        QString accel   = attribute( elem, "accel-id" );
-       /////bool    toggle  = checkBool( attribute( elem, "toggle-id" ) );       // not used
-       /////QString execute = attribute( elem, "execute-action" );               // not used
-
-       QIconSet anIcon;
-       if ( !icon.isEmpty() ) {
-          QPixmap pixmap  = myModule->getApp()->resourceMgr()->loadPixmap( myModule->name(""), icon );
-         if ( !pixmap.isNull() )
-           anIcon = QIconSet( pixmap );
-        }
+       bool    toggle  = checkBool( attribute( elem, "toggle-id" ) );
 
        // -1 action ID is not allowed : it means that <item-id> attribute is missed in the XML file!
        // also check if the action with given ID is already created
        if ( id != -1 ) {
-         menu->insertItem( anIcon, label, myModule, SLOT( onGUIEvent(int) ), QKeySequence( accel ), id, pos );
+         QAction* action = myModule->createAction( id,                     // ID
+                                                   tooltip,                // tooltip
+                                                   icon,                   // icon
+                                                   label,                  // menu text
+                                                   tooltip,                // status-bar text
+                                                   QKeySequence( accel ),  // keyboard accelerator
+                                                   toggle );               // toogled action
+         QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0;
+         menu->insertAction( before, action );
        }
       }
       else if ( aTagName == "submenu" ) {
        // create sub-menu
-       int     id    = checkInt( attribute( elem, "item-id" ) );
+       ////int     id    = checkInt( attribute( elem, "item-id" ) ); // not used //
        int     pos   = checkInt( attribute( elem, "pos-id" ) );
        QString label = attribute( elem, "label-id" );
-       QString icon    = attribute( elem, "icon-id" );
+       QString icon  = attribute( elem, "icon-id" );
 
-       QIconSet anIcon;
+       QIcon anIcon;
        if ( !icon.isEmpty() ) {
-         QPixmap pixmap  = myModule->getApp()->resourceMgr()->loadPixmap( myModule->name(""), icon );
+         QPixmap pixmap  = myModule->getApp()->resourceMgr()->loadPixmap( myModule->name(), icon );
          if ( !pixmap.isNull() )
-           anIcon = QIconSet( pixmap );
+           anIcon = QIcon( pixmap );
         }
 
-       QPopupMenu* newPopup = new QPopupMenu( menu, label );
-       menu->insertItem( anIcon, label, newPopup, id, pos );
+       QMenu* newPopup = menu->addMenu( anIcon, label );
+       QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0;
+       menu->insertMenu( before, newPopup );
        insertPopupItems( node, newPopup );
       }
       else if ( aTagName == "separator" ) {
        // create menu separator
-       int     pos     = checkInt( attribute( elem, "pos-id" ) );
-       menu->insertSeparator( pos );
+       int pos = checkInt( attribute( elem, "pos-id" ) );
+       QAction* action = myModule->separator();
+       QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0;
+       menu->insertAction( before, action );
       }
     }
     node = node.nextSibling();
index 65def75f6289f823e55621a67a1bf4259b9b107a..3283416ad10dbbed4373d0cdd62a07bab5751f53 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SALOME_PYQT_Module.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-
 #ifndef SALOME_PYQT_MODULE_H
 #define SALOME_PYQT_MODULE_H
 
 #include "SALOME_PYQT_GUI.h"
+#include "SALOME_PYQT_PyInterp.h" // this include must be first (see PyInterp_Interp.h)!
 
-#include "SALOME_PYQT_PyInterp.h" // this include must be first (see PyInterp_base.h)!
-#include "SalomeApp_Module.h"
-#include <map>
-#include <qaction.h>
-#include <qptrlist.h>
-#include <qstringlist.h>
-#include <qmap.h>
+#include <SalomeApp_Module.h>
+
+#include <QStringList>
+#include <QList>
+#include <QMap>
+#include <QIcon>
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(SALOME_Component)
 
-class SALOME_PYQT_XmlHandler;
+class SALOME_PYQT_PyInterp;
+class SUIT_ViewWindow;
+class QAction;
+class QtxActionGroup;
+class QMenu;
 
 class SALOME_PYQT_EXPORT SALOME_PYQT_Module: public SalomeApp_Module
 {
   Q_OBJECT;
 
-  /******************************
-   * Data
-   ******************************/
-
 private:
-  typedef std::map<int, SALOME_PYQT_PyInterp*> InterpMap;
-
-  /* study-to-subinterpreter map */
-  static InterpMap                 myInterpMap;
-  /* current Python subinterpreter */
-  SALOME_PYQT_PyInterp*            myInterp;
-  /* Python GUI module loaded */
-  PyObjWrapper                     myModule;
-  /* Python GUI being initialized (not zero only during the initialization)*/
-  static SALOME_PYQT_Module*       myInitModule;
-
-  /* own menus list */
-  struct MenuId
-  {
-    int  id;
-    bool constantMenu;
-    MenuId() : id( -1 ), constantMenu( false ) {}
-    MenuId( const int _id, const bool _constantMenu )
-      : id( _id ), constantMenu( _constantMenu ) {}
-  };
-  typedef QValueList<MenuId>   MenuIdList;
-  typedef QMap<int,MenuIdList> MenuMap;
-  MenuMap                      myMenus;
-  /* XML resource file parser */
-  SALOME_PYQT_XmlHandler*          myXmlHandler;  
-  /* windows map*/
-  QMap<int, int>                   myWindowsMap;
-  /* compatible view managers list */
-  QStringList                      myViewMgrList;
-
-  /* status of last trying of module activation*/
-  bool                             myLastActivateStatus;
-  
-  /******************************
-   * Construction/destruction
-   ******************************/
+  class XmlHandler;
+
+  //! study to Python subinterpreter map
+  typedef QMap<int, SALOME_PYQT_PyInterp*> InterpMap;
+
+  static InterpMap           myInterpMap;  //!< study to Python subinterpreter map
+  SALOME_PYQT_PyInterp*      myInterp;     //!< current Python subinterpreter
+  PyObjWrapper               myModule;     //!< Python GUI module
+  static SALOME_PYQT_Module* myInitModule; //!< Python GUI being initialized (not zero only during the initialization)
+
+  XmlHandler*                myXmlHandler; //!< XML resource file parser
+  QMap<int, int>             myWindowsMap; //!< windows map
+  QStringList                myViewMgrList;//!< compatible view managers list
+
+  bool                       myLastActivateStatus; //!< latest module activation status
 
 public:
-  /* constructor */
   SALOME_PYQT_Module();
-  /* destructor */
   ~SALOME_PYQT_Module();
 
-  /* get module engine */
-  Engines::Component_var getEngine() const;
-
-  /******************************
-   * Inherited from SalomeApp_Module 
-   ******************************/
-
 public:
-  /* little trick : provide an access to being activated Python module from outside;
-     needed by the SalomePyQt library :(
-  */
   static SALOME_PYQT_Module* getInitModule();
 
-  /* initialization */
-  void            initialize  ( CAM_Application* );
-
-  /* getting windows list */
-  void            windows     ( QMap<int, int>& ) const;
-  /* getting compatible viewer managers list */
-  void            viewManagers( QStringList& ) const;
-
-  /* context popup menu request */
-  void            contextMenuPopup( const QString&, QPopupMenu*, QString& );
-
-  /* create preferences */
-  void            createPreferences();
-
-  /* get module engine IOR */
-  virtual QString engineIOR() const;
-
-  /* called when study desktop is activated */
-  virtual void    studyActivated();
-
-  /* returns default menu group */
-  static int             defaultMenuGroup();
-
-  /* working with toolbars : open protected methods */
-  int                    createTool( const QString& );
-  int                    createTool( const int, const int, const int = -1 );
-  int                    createTool( const int, const QString&, const int = -1 );
-  int                    createTool( QAction*, const int, const int = -1, const int = -1 );
-  int                    createTool( QAction*, const QString&, const int = -1, const int = -1 );
-
-  /* working with menus : open protected methods */
-  int                    createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1, const bool = false );
-  int                    createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1, const bool = false );
-  int                    createMenu( const int, const int, const int = -1, const int = -1, const bool = false );
-  int                    createMenu( const int, const QString&, const int = -1, const int = -1, const bool = false );
-  int                    createMenu( QAction*, const int, const int = -1, const int = -1, const int = -1, const bool = false );
-  int                    createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1, const bool = false );
-
-  /* clear given menu */
-  bool                   clearMenu( const int = 0, const int = 0, const bool = true );
-
-  /* create separator : open protected method */
-  QAction*               createSeparator();
-
-  /* working with actions : open protected methods */
-  QAction*               action( const int ) const;
-  int                    actionId( const QAction* ) const;
-  QAction*               createAction( const int, const QString&, const QString&, const QString&,
-                                       const QString&, const int, const bool = false );
-  /* load icon from resource file */
-  QIconSet               loadIcon( const QString& fileName );
-
-  /* working with preferences : open protected methods */
-  int                    addGlobalPreference( const QString& );
-  int                    addPreference( const QString& );
-  int                    addPreference( const QString&, const int, const int = -1,
-                                       const QString& = QString::null,
-                                       const QString& = QString::null );
-  QVariant               preferenceProperty( const int, const QString& ) const;
-  void                   setPreferenceProperty( const int, const QString&, const QVariant& );
-
-  /* Show/hide menus/toolbars */
-  void                   setMenuShown( const bool );
-  void                   setToolShown( const bool );
-
-  /* Preferences changing (module) */
-  void                   preferencesChanged( const QString&, const QString& );
+  void                       initialize( CAM_Application* );
+  void                       windows( QMap<int, int>& ) const;
+  void                       viewManagers( QStringList& ) const;
+  void                       contextMenuPopup( const QString&, QMenu*, QString& );
+  void                       createPreferences();
+  QString                    engineIOR() const;
+  void                       studyActivated();
+  void                       preferencesChanged( const QString&, const QString& );
+
+  static int                 defaultMenuGroup();
+
+  int                        createTool( const QString& );
+  int                        createTool( const int, const int, const int = -1 );
+  int                        createTool( const int, const QString&, const int = -1 );
+  int                        createTool( QAction*, const int, 
+                                        const int = -1, const int = -1 );
+  int                        createTool( QAction*, const QString&, 
+                                        const int = -1, const int = -1 );
+
+  int                        createMenu( const QString&, const int, 
+                                        const int = -1, const int = -1, const int = -1 );
+  int                        createMenu( const QString&, const QString&, 
+                                        const int = -1, const int = -1, const int = -1 );
+  int                        createMenu( const int, const int, 
+                                        const int = -1, const int = -1 );
+  int                        createMenu( const int, const QString&, 
+                                        const int = -1, const int = -1 );
+  int                        createMenu( QAction*, const int, 
+                                        const int = -1, const int = -1, const int = -1 );
+  int                        createMenu( QAction*, const QString&, 
+                                        const int = -1, const int = -1, const int = -1 );
+
+  QAction*                   separator();
+
+  QAction*                   action( const int ) const;
+  int                        actionId( const QAction* ) const;
+  QAction*                   createAction( const int, const QString&, const QString&, 
+                                          const QString&, const QString&, const int, 
+                                          const bool = false, QObject* = 0 );
+  QtxActionGroup*            createActionGroup( const int, const bool );
+
+
+  QIcon                      loadIcon( const QString& fileName );
+
+  int                        addGlobalPreference( const QString& );
+  int                        addPreference( const QString& );
+  int                        addPreference( const QString&, const int, const int = LightApp_Preferences::Auto,
+                                           const QString& = QString(),
+                                           const QString& = QString() );
+  QVariant                   preferenceProperty( const int, const QString& ) const;
+  void                       setPreferenceProperty( const int, const QString&, 
+                                                   const QVariant& );
 
 public slots:
-  /* activation */
-  virtual bool    activateModule( SUIT_Study* );
-  /* deactivation */
-  virtual bool    deactivateModule( SUIT_Study* );
-
-  /* Preferences changing (application) */
-  void            preferenceChanged( const QString&, const QString&, const QString& );
+  virtual bool               activateModule( SUIT_Study* );
+  virtual bool               deactivateModule( SUIT_Study* );
+  void                       preferenceChanged( const QString&, 
+                                               const QString&, 
+                                               const QString& );
+  void                       onGUIEvent();
 
-  /******************************
-   * Internal methods
-   ******************************/
-
-public slots:
-  /* GUI action processing slots */
-  void            onGUIEvent();
-  void            onGUIEvent( int );
+  void                       onActiveViewChanged( SUIT_ViewWindow* );
+  void                       onViewClosed( SUIT_ViewWindow* );
+  void                       onViewCloned( SUIT_ViewWindow* );
 
 protected:
-  /* Menu processing */
-  bool            hasMenu( const QString&, const int );
-  void            registerMenu( const int, const int, const bool = false );
-  void            unregisterMenu( const int, const int );
-  bool            registered( const int, const int = 0 );
-  bool            isConstantMenu( const int, const int );
-
-protected slots:
-  void            onMenuHighlighted( int, int );
+  Engines::Component_var     getEngine() const;
 
 private:
-  /* internal initizalition */ 
-  void            init        ( CAM_Application* );
-  /* internal activation */ 
-  void            activate    ( SUIT_Study* );
-
-  /* getting status of last module activation */
-  bool            lastActivationStatus() const;
-
-  /* internal deactivation */ 
-  void            deactivate  ( SUIT_Study* );
-  /* customization */ 
-  void            customize   ( SUIT_Study* );
-  /* study activation */ 
-  void            studyChanged( SUIT_Study* );
-  /* context popup menu processing */
-  void            contextMenu( const QString&, QPopupMenu* );
-  /* GUI event processing */
-  void            guiEvent( const int );
-  /* Menu highlight processing */
-  void            menuHighlight( const int, const int );
-  /* Init preferences */
-  void            initPreferences();
-
-  /* initialize a Python subinterpreter */
-  void            initInterp  ( int );
-  /* import a Python GUI module */
-  void            importModule();
-  /* set workspace to Python GUI module */
-  void            setWorkSpace();
-
-  /* preferences changing */
-  void            prefChanged( const QString&, const QString& );
-
-  friend class SALOME_PYQT_XmlHandler;
+  void                       init( CAM_Application* );
+  void                       activate( SUIT_Study* );
+  void                       deactivate( SUIT_Study* );
+  bool                       lastActivationStatus() const;
+  void                       customize( SUIT_Study* );
+  void                       studyChanged( SUIT_Study* );
+  void                       contextMenu( const QString&, QMenu* );
+  void                       guiEvent( const int );
+  void                       initPreferences();
+  void                       prefChanged( const QString&, const QString& );
+
+  void                       initInterp  ( int );
+  void                       importModule();
+  void                       setWorkSpace();
+  
+  void                       activeViewChanged( const SUIT_ViewWindow* );
+  void                       viewClosed( const SUIT_ViewWindow* );
+  void                       viewCloned( const SUIT_ViewWindow* );
+  void                       connectView( const SUIT_ViewWindow* );
+
+  friend class XmlHandler;
 };
 
 #endif // SALOME_PYQT_MODULE_H
index f25a2ca053f78ef8c8a26f481b82b1c9d605fcf4..15d1528602032486716b384c6f5af5e874403716 100644 (file)
@@ -1,41 +1,37 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SALOME_PYQT_PyInterp.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : SALOME_PYQT_PyInterp.cxx
-//  Author : Christian CAREMOLI, Paul RASCLE, EDF
-//  Module : SALOME
-//  $Header$
-
 #include "SALOME_PYQT_PyInterp.h" // this include must be first (see PyInterp_base.h)!
-#include "utilities.h"
-#include "Container_init_python.hxx"
-
-using namespace std;
-
+#include <utilities.h>
+#include <Container_init_python.hxx>
 
 /*!
  * constructor : the main SALOME Python interpreter is used for PyQt GUI.
  * calls initialize method defined in base class, which calls virtual methods
  * initstate & initcontext redefined here
  */
-SALOME_PYQT_PyInterp::SALOME_PYQT_PyInterp(): PyInterp_base()
+SALOME_PYQT_PyInterp::SALOME_PYQT_PyInterp(): PyInterp_Interp()
 {
 }
 
index 42ac5d2d7f76c8752d219e01bfb5e46c489fb6f1..3daf666641046de3003667b58f068c37134bc73c 100644 (file)
@@ -1,38 +1,43 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SALOME_PYQT_PyInterp.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-
 #ifndef SALOME_PYQT_PYINTERP_H
 #define SALOME_PYQT_PYINTERP_H
 
 #include "SALOME_PYQT_GUI.h"
 
-#include "PyInterp_base.h" // this include must be first (see PyInterp_base.h)!
+#include <PyInterp_Interp.h> // this include must be first (see PyInterp_base.h)!
 
-class SALOME_PYQT_EXPORT SALOME_PYQT_PyInterp : public PyInterp_base
+class SALOME_PYQT_EXPORT SALOME_PYQT_PyInterp : public PyInterp_Interp
 {
- public:
+public:
   SALOME_PYQT_PyInterp();
   ~SALOME_PYQT_PyInterp();
 
-  int run(const char *command);
-
- protected:
+  int run( const char* );
+  
+protected:
   virtual bool initState();
   virtual bool initContext();  
 };
diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_SipDefs.h.in b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_SipDefs.h.in
deleted file mode 100644 (file)
index 2a427ce..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#define SIP_VERS_@SIP_VERS@
index 50ee57d5c1931e667beec27941f83e02d009c760..5ca53871ecf446961730993ff0de2f336617b8dd 100644 (file)
-# Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Nicolas REJNERI
 #  Module : SALOME
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-# Sip flags
-SIP_FLAGS = -t WS_X11 -t $(QT_VERS) $(PYQT_SIPFLAGS) -s ".cc" -c . -I $(PYQT_SIPS)
-
-# Sip common sources
-SIP_SRC = sipSalomePyQtSalomePyQt.cc \
-         sipSalomePyQtSALOME_Selection.cc \
-          sipSalomePyQtQtxAction.cc
+# extra source files (generated by sip)
+SIP_SRC = sipAPISalomePyQt.h                   \
+         sipSalomePyQtSalomePyQt.cc            \
+         sipSalomePyQtSALOME_Selection.cc      \
+         sipSalomePyQtQtxAction.cc             \
+         sipSalomePyQtQtxActionGroup.cc        \
+         sipSalomePyQtQtxActionSet.cc          \
+         sipSalomePyQtcmodule.cc
 
-# Sip version-specific sources
-if IS_SIP_V4
-SIP_SRC  += sipSalomePyQtcmodule.cc
-else !IS_SIP_V4
-SIP_SRC  += SalomePyQtcmodule.cc
-endif
-
-# Sip/moc sources and Sip definition files
-if IS_SIP_V4
-if IS_SIP_NEW
-MOC_SRC   = 
-MOC_H     = 
-SIP_FILES = SalomePyQt_v4.sip
-else !IS_SIP_NEW
-MOC_SRC   = sipSalomePyQtcmodule_moc.cxx
-MOC_H     = sipSalomePyQtcmodule.h
-SIP_FILES = SalomePyQt_v4.sip
-endif
-else !IS_SIP_V4
+# Sip definition file
 SIP_FILES = SalomePyQt.sip
-if IS_SIP_NEW
-MOC_SRC   = SalomePyQtcmodule_moc.cxx
-MOC_H     = SalomePyQtcmodule.h
-else !IS_SIP_NEW
-MOC_SRC   = sipSalomePyQtProxySalomePyQt_moc.cxx
-MOC_H     = sipSalomePyQtProxySalomePyQt.h
-endif
-endif
-
-EXTRA_DIST+= SalomePyQt.sip SalomePyQt_v4.sip
-
-# Libraries targets
-MOC_FILES= SalomePyQt_moc.cxx
 
-COMMON_CPP_FLAGS=$(QT_INCLUDES) $(SIP_INCLUDES) $(PYTHON_INCLUDES) \
-       $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS) \
-       -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ -I$(top_builddir)/salomeadn/unix \
-       -I$(top_builddir)/idl \
-       -I$(srcdir)/../../SUIT -I$(srcdir)/../../CAM -I$(srcdir)/../../STD \
-       -I$(srcdir)/../../Qtx -I$(srcdir)/../../SalomeApp -I$(srcdir)/../../Event \
-       -I$(srcdir)/../../SalomeSession -I$(srcdir)/../../LogWindow \
-       -I$(srcdir)/../../VTKViewer -I$(srcdir)/../../TOOLSGUI \
-       -I$(srcdir)/../SALOME_PYQT_GUI -I$(srcdir)/../../PyInterp \
-       -I$(srcdir)/../../LightApp -I$(srcdir)/../../ObjBrowser \
-       -I$(srcdir)/../../OBJECT \
+# extra dist files
+EXTRA_DIST += $(SIP_FILES)
+
+# extra clean files
+CLEANFILES = $(SIP_SRC)
+
+# moc files (generated my moc)
+MOC_FILES = SalomePyQt_moc.cxx
+
+# compilation flags
+COMMON_CPP_FLAGS = $(QT_INCLUDES) $(QWT_INCLUDES) $(SIP_INCLUDES) $(PYTHON_INCLUDES)   \
+       $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS)               \
+       -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ -I$(top_builddir)/salomeadn/unix              \
+       -I$(srcdir) -I$(top_builddir)/idl                                               \
+       -I$(srcdir)/../../SUIT -I$(srcdir)/../../CAM -I$(srcdir)/../../STD              \
+       -I$(srcdir)/../../Qtx -I$(srcdir)/../../SalomeApp -I$(srcdir)/../../Event       \
+       -I$(srcdir)/../../SalomeSession -I$(srcdir)/../../LogWindow                     \
+       -I$(srcdir)/../../VTKViewer -I$(srcdir)/../../TOOLSGUI                          \
+       -I$(srcdir)/../../OCCViewer -I$(srcdir)/../../Plot2d                            \
+       -I$(srcdir)/../SALOME_PYQT_GUI -I$(srcdir)/../../PyInterp                       \
+       -I$(srcdir)/../../LightApp -I$(srcdir)/../../ObjBrowser                         \
+       -I$(srcdir)/../../OBJECT                                                        \
        -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
 
-COMMON_LIBS=$(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) \
-       $(OGL_LIBS) ../../SUIT/libsuit.la ../../CAM/libCAM.la ../../STD/libstd.la \
-       ../../Qtx/libqtx.la ../../SalomeApp/libSalomeApp.la ../../Event/libEvent.la \
-       ../../Session/libSalomeSession.la ../../LogWindow/libLogWindow.la \
-       ../../VTKViewer/libVTKViewer.la ../../TOOLSGUI/libToolsGUI.la \
-       ../SALOME_PYQT_GUI/libSalomePyQtGUI.la
-
-if IS_SIP_V4
+# linkage flags
+COMMON_LIBS = $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(QWT_LIBS)          \
+       $(OGL_LIBS) ../../SUIT/libsuit.la ../../CAM/libCAM.la ../../STD/libstd.la       \
+       ../../Qtx/libqtx.la ../../SalomeApp/libSalomeApp.la ../../Event/libEvent.la     \
+       ../../Session/libSalomeSession.la ../../LogWindow/libLogWindow.la               \
+       ../../VTKViewer/libVTKViewer.la ../../TOOLSGUI/libToolsGUI.la                   \
+       ../SALOME_PYQT_GUI/libSalomePyQtGUI.la ../../OCCViewer/libOCCViewer.la          \
+       ../../Plot2d/libPlot2d.la
 
+# libraries targets
 lib_LTLIBRARIES = libSalomePyQt.la
-dist_libSalomePyQt_la_SOURCES= SalomePyQt.cxx
-nodist_libSalomePyQt_la_SOURCES= $(MOC_FILES) $(SIP_SRC) $(MOC_SRC) 
+
+# library sources / rules
+dist_libSalomePyQt_la_SOURCES = SalomePyQt.cxx
+nodist_libSalomePyQt_la_SOURCES = $(MOC_FILES) $(SIP_SRC)
 libSalomePyQt_la_CPPFLAGS = $(COMMON_CPP_FLAGS)
 libSalomePyQt_la_LIBADD = $(COMMON_LIBS)
 
-else !IS_SIP_V4
-
-lib_LTLIBRARIES = libSalomePyQtcmodule.la
-dist_libSalomePyQtcmodule_la_SOURCES= SalomePyQt.cxx
-nodist_libSalomePyQtcmodule_la_SOURCES= $(MOC_FILES) $(SIP_SRC) $(MOC_SRC)
-libSalomePyQtcmodule_la_CPPFLAGS = $(MY_CPP_FLAGS)
-libSalomePyQtcmodule_la_LIBADD = $(COMMON_LIBS)
-
-endif
-
-if IS_SIP_V4
-else
-nodist_sharedpkgpython_PYTHON= SalomePyQt.py
-endif
-
-# Custom build step: generate C++ wrapping according to $(SIP_FILES)
+# custom build step: generate C++ wrapping according to $(SIP_FILES)
 $(SIP_SRC): $(SIP_FILES)
-       $(SIP) $(SIP_FLAGS) $<
-
-$(MOC_H): $(SIP_FILES)
-       $(SIP) $(SIP_FLAGS) $<
+       $(SIP) $(PYQT_SIPFLAGS) $<
 
-if IS_SIP_V4
-install-exec-hook: $(libdir)/SalomePyQt.so
-$(libdir)/SalomePyQt.so:
-       (cd $(libdir); ln -s libSalomePyQt.so SalomePyQt.so;)
-else !IS_SIP_V4
-install-exec-hook: $(libdir)/SalomePyQtcmodule.so
-$(libdir)/SalomePyQt.so:
-       (cd $(libdir); ln -sf libSalomePyQtcmodule.so SalomePyQt.so;)
-endif
+# custom install step: create symbolic link
+install-exec-hook: 
+       (cd $(DESTDIR)$(libdir); ln -sf libSalomePyQt.so SalomePyQt.so)
 
-$(SIP_SRC): $(MOC_SRC)
+# custom uninstall step: remove symbolic link
+uninstall-hook: 
+       rm -f $(DESTDIR)$(libdir)/SalomePyQt.so
index 15ee7c264881986af28e8d79d8f2a8f29ec06af6..e50f65e24e2c1f1b984a60495d43eae00f0a4e47 100644 (file)
@@ -1,59 +1,73 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-
-#include "SALOME_PYQT_Module.h" // this include must be first!!!
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SalomePyQt.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#include <SALOME_PYQT_Module.h> // this include must be first!!!
 #include "SalomePyQt.h"
 
-#include <qapplication.h>
-#include <qmenubar.h>
-#include <qwidget.h>
-#include <qpopupmenu.h>
-#include <qimage.h>
-#include <qstringlist.h>
-
-#include "SALOME_Event.hxx"
-
-#include "SUIT_Session.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Tools.h"
-#include "STD_MDIDesktop.h"
-#include "SalomeApp_Application.h"
-#include "SalomeApp_Study.h"
-#include "LightApp_SelectionMgr.h"
-#include "OB_Browser.h"
-#include "QtxAction.h"
-#include "LogWindow.h"
-
-using namespace std;
-
-/*!
-  \return active application object [ static ]
-*/
-static SalomeApp_Application* getApplication() {
+#include <QApplication>
+#include <QMenuBar>
+#include <QMenu>
+#include <QImage>
+#include <QStringList>
+#include <QAction>
+
+#include <SALOME_Event.h>
+
+#include <QtxActionMenuMgr.h>
+#include <QtxActionGroup.h>
+#include <QtxWorkstack.h>
+#include <SUIT_Session.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Tools.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_ViewWindow.h>
+#include <STD_TabDesktop.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <LightApp_SelectionMgr.h>
+#include <LogWindow.h>
+#include <OCCViewer_ViewWindow.h>
+#include <Plot2d_ViewManager.h>
+#include <Plot2d_ViewWindow.h>
+
+/*!
+  \brief Get the currently active application.
+  \internal
+  \return active application object or 0 if there is no any
+*/
+static SalomeApp_Application* getApplication()
+{
   if ( SUIT_Session::session() )
     return dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
-  return NULL;
+  return 0;
 }
 
 /*!
-  \return active study or 0 if there is no study opened [ static ]
+  \brief Get the currently active study.
+  \internal
+  \return active study or 0 if there is no study opened
 */
 static SalomeApp_Study* getActiveStudy()
 {
@@ -62,10 +76,41 @@ static SalomeApp_Study* getActiveStudy()
   return 0;
 }
 
+/*!
+  \brief Get the currently active module.
+  \internal
+  This function returns correct result only if Python-based
+  module is currently active. Otherwize, 0 is returned.
+*/
+static SALOME_PYQT_Module* getActiveModule()
+{
+  SALOME_PYQT_Module* module = 0;
+  if ( SalomeApp_Application* anApp = getApplication() ) {
+    module = SALOME_PYQT_Module::getInitModule();
+    if ( !module )
+      module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
+  }
+  return module;
+}
+
+/*!
+  \class SALOME_Selection
+  \brief The class represents selection which can be used in Python.
+*/
+
+/*!
+  \brief Map of created selection objects.
+  \internal
+*/
 static QMap<SalomeApp_Application*, SALOME_Selection*> SelMap;
 
 /*!
-  Creates or finds the selection object (one per study).
+  \brief Get the selection object for the specified application.
+
+  Finds or creates the selection object (one per study).
+
+  \param app application object
+  \return selection object or 0 if \a app is invalid
 */
 SALOME_Selection* SALOME_Selection::GetSelection( SalomeApp_Application* app )
 {
@@ -78,7 +123,8 @@ SALOME_Selection* SALOME_Selection::GetSelection( SalomeApp_Application* app )
 }
 
 /*!
-  Selection constructor.
+  \brief Constructor.
+  \param p parent object
 */
 SALOME_Selection::SALOME_Selection( QObject* p ) : QObject( p ), mySelMgr( 0 )
 {
@@ -90,7 +136,7 @@ SALOME_Selection::SALOME_Selection( QObject* p ) : QObject( p ), mySelMgr( 0 )
   }
 }
 /*!
-  Selection destructor. Removes selection object from the map.
+  \brief Destructor.
 */
 SALOME_Selection::~SALOME_Selection()
 {
@@ -100,7 +146,8 @@ SALOME_Selection::~SALOME_Selection()
 }
 
 /*!
-  Watches for the selection manager destroying when study is closed.
+  \brief Called when selection manager is destroyed (usually 
+  when the study is closed).
 */
 void SALOME_Selection::onSelMgrDestroyed()
 {
@@ -108,7 +155,7 @@ void SALOME_Selection::onSelMgrDestroyed()
 }
 
 /*!
-  Clears the selection.
+  \brief Clear the selection.
 */
 void SALOME_Selection::Clear()
 {
@@ -126,7 +173,7 @@ void SALOME_Selection::Clear()
 }
 
 /*!
-  Clears the selection.
+  \brief Clear the selection.
 */
 void SALOME_Selection::ClearIObjects()
 {
@@ -152,253 +199,315 @@ void SALOME_Selection::ClearFilters()
 }
 
 /*!
-  \return desktop (0 if error)
+  \class SalomePyQt
+  \brief The class provides utility functions which can be used in the Python
+  to operate with the SALOME GUI.
+
+  All the functionality of this class is implemented as static methods, so they
+  can be called with the class name prefixed or via creation of the class instance.
+  For example, next both ways of SalomePyQt class usage are legal:
+  \code
+  from SalomePyQt import *
+  sg = SalomePyQt()
+  # using SalomePyQt class instance
+  desktop = sg.getDesktop()
+  # using SalomePyQt class directly
+  menubar = SalomePyQt.getMainMenuBar()
+  \endcode
+*/
+
+/*!
+  \fn QWidget* SalomePyQt::getDesktop();
+  \brief Get the active application's desktop window.
+  \return desktop window or 0 if there is no any
 */
-class TGetDesktopEvent: public SALOME_Event {
+
+class TGetDesktopEvent: public SALOME_Event 
+{
 public:
   typedef QWidget* TResult;
   TResult myResult;
   TGetDesktopEvent() : myResult( 0 ) {}
-  virtual void Execute() {
+  virtual void Execute()
+  {
     if ( getApplication() )
       myResult = (QWidget*)( getApplication()->desktop() );
   }
 };
-
-/*!
-  \return desktop
-*/
 QWidget* SalomePyQt::getDesktop()
 {
   return ProcessEvent( new TGetDesktopEvent() );
 }
 
 /*!
-  \return workspace widget (0 if error)
+  \fn QWidget* SalomePyQt::getMainFrame();
+  \brief Get current application's main frame widget [obsolete].
+
+  Main frame widget is an internal widget of the application 
+  desktop window (workspace).
+
+  \return workspace widget (0 on any error)
 */
-class TGetMainFrameEvent: public SALOME_Event {
+
+class TGetMainFrameEvent: public SALOME_Event
+{
 public:
   typedef QWidget* TResult;
   TResult myResult;
   TGetMainFrameEvent() : myResult( 0 ) {}
-  virtual void Execute() {
+  virtual void Execute()
+  {
     if ( getApplication() ) {
       SUIT_Desktop* aDesktop = getApplication()->desktop();
       myResult = (QWidget*)( aDesktop->centralWidget() );
     }
   }
 };
-
-/*!
-  \return workspace widget (0 if error)
-*/
 QWidget* SalomePyQt::getMainFrame()
 {
   return ProcessEvent( new TGetMainFrameEvent() );
 }
 
 /*!
-  SalomePyQt::getMainMenuBar
-  Gets main menu. Returns 0 in error.
+  \fn QMenuBar* SalomePyQt::getMainMenuBar();
+  \brief Get current application desktop's main menu.
+  \return main menu object (0 on any error)
 */
-class TGetMainMenuBarEvent: public SALOME_Event {
+
+class TGetMainMenuBarEvent: public SALOME_Event
+{
 public:
   typedef QMenuBar* TResult;
   TResult myResult;
   TGetMainMenuBarEvent() : myResult( 0 ) {}
-  virtual void Execute() {
+  virtual void Execute()
+  {
     if ( SalomeApp_Application* anApp = getApplication() ) {
       myResult = anApp->desktop()->menuBar();
     }
   }
 };
-
-/*!
-  \return main menu
-  \retval 0 in error.
-*/
 QMenuBar* SalomePyQt::getMainMenuBar() 
 {
   return ProcessEvent( new TGetMainMenuBarEvent() );
 }
 
 /*!
-  SalomePyQt::getPopupMenu
-  Gets an main menu's child popup menu by its id
+  QMenu* SalomePyQt::getPopupMenu( const MenuName menu );
+  \brief Get main menu's child popup submenu by its identifier.
+  
+  This function is obsolete. 
+  Use QMenu* SalomePyQt::getPopupMenu( const QString& menu ) instead.
+
+  \param menu menu identifier
+  \return popup submenu object or 0 if it does not exist
+*/
+
+/*!
+  QMenu* SalomePyQt::getPopupMenu( const QString& menu );
+  \brief Get main menu's child popup submenu by its name.
+  
+  The function creates menu if it does not exist.
+
+  \param menu menu name
+  \return popup submenu object (0 on any error)
 */
-class TGetPopupMenuEvent: public SALOME_Event {
+
+class TGetPopupMenuEvent: public SALOME_Event
+{
 public:
-  typedef QPopupMenu* TResult;
-  TResult  myResult;
-  MenuName myMenuName;
-  TGetPopupMenuEvent( const MenuName menu ) : myResult( 0 ), myMenuName( menu ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      QMenuBar* menuBar = anApp->desktop()->menuBar();
-      if ( menuBar ) {
-        QString menu;
-        switch( myMenuName) {
-        case File:
-          menu = QObject::tr( "MEN_DESK_FILE" );        break;
-        case View:
-          menu = QObject::tr( "MEN_DESK_VIEW" );        break;
-        case Edit:
-          menu = QObject::tr( "MEN_DESK_EDIT" );        break;
-        case Preferences:
-          menu = QObject::tr( "MEN_DESK_PREFERENCES" ); break;
-        case Tools:
-          menu = QObject::tr( "MEN_DESK_TOOLS" );       break;
-        case Window:
-          menu = QObject::tr( "MEN_DESK_WINDOW" );      break;
-        case Help:
-          menu = QObject::tr( "MEN_DESK_HELP" );        break;
-        }
-        for ( int i = 0; i < menuBar->count() && !myResult; i++ ) {
-          QMenuItem* item = menuBar->findItem( menuBar->idAt( i ) );
-         if ( item && item->text() == menu && item->popup() )
-            myResult = item->popup();
-        }
-      }
+  typedef QMenu* TResult;
+  TResult myResult;
+  QString myMenuName;
+  TGetPopupMenuEvent( const QString& menu ) : myResult( 0 ), myMenuName( menu ) {}
+  virtual void Execute()
+  {
+    SalomeApp_Application* anApp = getApplication();
+    if ( anApp && !myMenuName.isEmpty() ) {
+      QtxActionMenuMgr* mgr = anApp->desktop()->menuMgr();
+      myResult = mgr->findMenu( myMenuName, -1, false ); // search only top menu
     }
   }
 };
 
-/*!
-  \return popup menu
-  \param menu - menu name
-*/
-QPopupMenu* SalomePyQt::getPopupMenu( const MenuName menu )
+static QString getMenuName( const QString& menuId )
+{
+  QStringList contexts;
+  contexts << "SalomeApp_Application" << "LightApp_Application" << "STD_TabDesktop" <<
+    "STD_MDIDesktop" << "STD_Application" << "SUIT_Application" << "";
+  QString menuName = menuId;
+  for ( int i = 0; i < contexts.count() && menuName == menuId; i++ )
+    menuName = QApplication::translate( contexts[i].toLatin1().data(), menuId.toLatin1().data() );
+  return menuName;
+}
+
+QMenu* SalomePyQt::getPopupMenu( const MenuName menu )
+{
+  QString menuName;
+  switch( menu ) {
+  case File:
+    menuName = getMenuName( "MEN_DESK_FILE" );        break;
+  case View:
+    menuName = getMenuName( "MEN_DESK_VIEW" );        break;
+  case Edit:
+    menuName = getMenuName( "MEN_DESK_EDIT" );        break;
+  case Preferences:
+    menuName = getMenuName( "MEN_DESK_PREFERENCES" ); break;
+  case Tools:
+    menuName = getMenuName( "MEN_DESK_TOOLS" );       break;
+  case Window:
+    menuName = getMenuName( "MEN_DESK_WINDOW" );      break;
+  case Help:
+    menuName = getMenuName( "MEN_DESK_HELP" );        break;
+  }
+  return ProcessEvent( new TGetPopupMenuEvent( menuName ) );
+}
+QMenu* SalomePyQt::getPopupMenu( const QString& menu )
 {
   return ProcessEvent( new TGetPopupMenuEvent( menu ) );
 }
 
 /*!
-  SalomePyQt::getStudyId
-  Returns active study's ID or 0 if there is no active study.
+  \fn int SalomePyQt::getStudyId();
+  \brief Get active study's identifier.
+  \return active study ID or 0 if there is no active study
 */
-class TGetStudyIdEvent: public SALOME_Event {
+
+class TGetStudyIdEvent: public SALOME_Event
+{
 public:
   typedef int TResult;
   TResult myResult;
   TGetStudyIdEvent() : myResult( 0 ) {}
-  virtual void Execute() {
+  virtual void Execute()
+  {
     if ( SalomeApp_Study* aStudy = getActiveStudy() ) {
       myResult = aStudy->studyDS()->StudyId();
     }
   }
 };
-
-/*!
-  SalomePyQt::getStudyId
-  Returns active study's ID or 0 if there is no active study.
-*/
 int SalomePyQt::getStudyId()
 {
   return ProcessEvent( new TGetStudyIdEvent() );
 }
 
 /*!
-  SalomePyQt::getSelection
-  Creates a Selection object (to provide a compatibility with previous SALOME GUI).
+  \fn SALOME_Selection* SalomePyQt::getSelection()
+  \brief Get the selection object for the current study.
+
+  Creates a Selection object if it has not been created yet.
+
+  \return selection object (0 on error)
 */
-class TGetSelectionEvent: public SALOME_Event {
+
+class TGetSelectionEvent: public SALOME_Event 
+{
 public:
   typedef SALOME_Selection* TResult;
   TResult myResult;
   TGetSelectionEvent() : myResult( 0 ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     myResult = SALOME_Selection::GetSelection( getApplication() );
   }
 };
-
-/*!
-  Creates a Selection object (to provide a compatibility with previous SALOME GUI).
-  \return just created selection object
-*/
 SALOME_Selection* SalomePyQt::getSelection()
 {
   return ProcessEvent( new TGetSelectionEvent() );
 }
 
 /*!
-  SalomePyQt::putInfo
-  Puts an information message to the desktop's status bar
-  (with optional delay parameter given in seconds)
+  \fn void SalomePyQt::putInfo( const QString& msg, const int sec )
+  \brief Put an information message to the current application's 
+  desktop status bar.
+
+  Optional second delay parameter (\a sec) can be used to specify
+  time of the message diplaying in seconds. If this parameter is less
+  or equal to zero, the constant message will be put.
+
+  \param msg message text 
+  \param sec message displaying time in seconds
 */
-class TPutInfoEvent: public SALOME_Event {
+
+class TPutInfoEvent: public SALOME_Event
+{
   QString myMsg;
   int     mySecs;
 public:
   TPutInfoEvent( const QString& msg, const int sec = 0 ) : myMsg( msg ), mySecs( sec ) {}
-  virtual void Execute() {
+  virtual void Execute()
+  {
     if ( SalomeApp_Application* anApp = getApplication() ) {
       anApp->putInfo( myMsg, mySecs * 1000 );
     }
   }
 };
-
-/*!
-  Puts an information message to the desktop's status bar
-  (with optional delay parameter given in seconds)
-  \param msg - message text 
-  \param sec - delay in seconds
-*/
 void SalomePyQt::putInfo( const QString& msg, const int sec )
 {
   ProcessVoidEvent( new TPutInfoEvent( msg, sec ) );
 }
 
 /*!
-  SalomePyQt::getActiveComponent
-  Returns an active component name or empty string if there is no active component
+  \fn const QString SalomePyQt::getActiveComponent();
+  \brief Get the currently active module name (for the current study).
+  \return active module name or empty string if there is no active module
 */
-class TGetActiveComponentEvent: public SALOME_Event {
+
+class TGetActiveComponentEvent: public SALOME_Event
+{
 public:
   typedef QString TResult;
   TResult myResult;
   TGetActiveComponentEvent() {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SalomeApp_Application* anApp = getApplication() ) {
       if ( CAM_Module* mod = anApp->activeModule() ) {
-        myResult = mod->name("");
+        myResult = mod->name();
       }
     }
   }
 };
-
-/*!
-  \return an active component name or empty string if there is no active component
-*/
 const QString SalomePyQt::getActiveComponent()
 {
   return ProcessEvent( new TGetActiveComponentEvent() );
 }
 
 /*!
-  SalomePyQt::updateObjBrowser
-  Updates an Object Browser of a given study.
-  If <studyId> <= 0 the active study's object browser is updated.
-  <updateSelection> parameter is obsolete parameter and currently not used. To be removed lately.
+  \brief Update an Object Browser of the specified (by identifier) study.
+
+  If \a studyId <= 0 the active study's object browser is updated.
+  The \a updateSelection parameter is obsolete and currently is not used. 
+  This parameter will be removed in future, so try to avoid its usage in 
+  your code.
+
+  \brief studyId study identifier
+  \brief updateSelection update selection flag (not used)
+  \sa getActiveStudy()
 */
 void SalomePyQt::updateObjBrowser( const int studyId, bool updateSelection )
 {  
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
     int  myStudyId;
     bool myUpdateSelection;
   public:
     TEvent( const int studyId, bool updateSelection ) 
       : myStudyId( studyId ), myUpdateSelection( updateSelection ) {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SUIT_Session::session() ) {
         if ( getActiveStudy() && myStudyId <= 0 )
           myStudyId = getActiveStudy()->id();
        if ( myStudyId > 0 ) {
-          QPtrList<SUIT_Application> apps = SUIT_Session::session()->applications();
-          QPtrListIterator<SUIT_Application> it( apps );
-         for( ; it.current(); ++it ) {
-            SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( it.current() );
-            if ( anApp && anApp->activeStudy() && anApp->activeStudy()->id() == myStudyId )
+          QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
+          QList<SUIT_Application*>::Iterator it;
+         for( it = apps.begin(); it != apps.end(); ++it ) {
+            SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( *it );
+            if ( anApp && anApp->activeStudy() && anApp->activeStudy()->id() == myStudyId ) {
              anApp->updateObjectBrowser();
+             return;
+           }
           }
         }
       }
@@ -407,17 +516,30 @@ void SalomePyQt::updateObjBrowser( const int studyId, bool updateSelection )
   ProcessVoidEvent( new TEvent( studyId, updateSelection ) );
 }
 
-const char* DEFAULT_SECTION = "SalomePyQt";
+/*!
+  \brief Default resource file section name.
+  \internal
+*/
+static const char* DEFAULT_SECTION = "SalomePyQt";
 
 /*!
-  SalomePyQt::addStringSetting
-  Adds a string setting to the application preferences
-  <autoValue> parameter is obsolete parameter and currently not used. To be removed lately.
-  This function is obsolete. Use addSetting() instead.
+  \brief Add string setting to the application preferences.
+
+  The parameter \a autoValue is obsolete parameter and currently is not used.
+  This parameter will be removed in future, so try to avoid its usage in 
+  your code.
+
+  This function is obsolete. Use one of addSetting() instead.
+
+  \param name setting name (it should be of kind <section:setting> where
+  \c section is resources section name and \c setting is setting name)
+  \param value new setting value
+  \param autoValue (not used)
 */
 void SalomePyQt::addStringSetting( const QString& name, const QString& value, bool autoValue )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
     QString myName;
     QString myValue;
     bool    myAutoValue;
@@ -427,9 +549,9 @@ void SalomePyQt::addStringSetting( const QString& name, const QString& value, bo
     virtual void Execute() {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       QStringList sl = QStringList::split( ":", myName );
-       QString _sec = sl.count() > 1 ? sl[ 0 ].stripWhiteSpace() : QString( DEFAULT_SECTION );
-       QString _nam = sl.count() > 1 ? sl[ 1 ].stripWhiteSpace() : sl.count() > 0 ? sl[ 0 ].stripWhiteSpace() : QString( "" );
+       QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+       QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+       QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
        if ( !_sec.isEmpty() && !_nam.isEmpty() )
           resMgr->setValue( _sec, _nam, myValue );
       }
@@ -439,26 +561,36 @@ void SalomePyQt::addStringSetting( const QString& name, const QString& value, bo
 }
 
 /*!
-  SalomePyQt::addIntSetting
-  Adds an integer setting to the application preferences
-  <autoValue> parameter is obsolete parameter and currently not used. To be removed lately.
-  This function is obsolete. Use addSetting() instead.
+  \brief Add integer setting to the application preferences.
+
+  The parameter \a autoValue is obsolete parameter and currently is not used.
+  This parameter will be removed in future, so try to avoid its usage in 
+  your code.
+
+  This function is obsolete. Use one of addSetting() instead.
+
+  \param name setting name (it should be of kind <section:setting> where
+  \c section is resources section name and \c setting is setting name)
+  \param value new setting value
+  \param autoValue (not used)
 */
 void SalomePyQt::addIntSetting( const QString& name, const int value, bool autoValue)
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event 
+  {
     QString myName;
     int     myValue;
     bool    myAutoValue;
   public:
     TEvent( const QString& name, const int value, bool autoValue ) 
       : myName( name ), myValue( value ), myAutoValue( autoValue ) {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       QStringList sl = QStringList::split( ":", myName );
-       QString _sec = sl.count() > 1 ? sl[ 0 ].stripWhiteSpace() : QString( DEFAULT_SECTION );
-       QString _nam = sl.count() > 1 ? sl[ 1 ].stripWhiteSpace() : sl.count() > 0 ? sl[ 0 ].stripWhiteSpace() : QString( "" );
+       QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+       QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+       QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
        if ( !_sec.isEmpty() && !_nam.isEmpty() )
           resMgr->setValue( _sec, _nam, myValue );
       }
@@ -468,26 +600,36 @@ void SalomePyQt::addIntSetting( const QString& name, const int value, bool autoV
 }
 
 /*!
-  SalomePyQt::addDoubleSetting
-  Adds an double setting to the application preferences
-  <autoValue> parameter is obsolete parameter and currently not used. To be removed lately.
-  This function is obsolete. Use addSetting() instead.
+  \brief Add double setting to the application preferences.
+
+  The parameter \a autoValue is obsolete parameter and currently is not used.
+  This parameter will be removed in future, so try to avoid its usage in 
+  your code.
+
+  This function is obsolete. Use one of addSetting() instead.
+
+  \param name setting name (it should be of kind <section:setting> where
+  \c section is resources section name and \c setting is setting name)
+  \param value new setting value
+  \param autoValue (not used)
 */
 void SalomePyQt::addDoubleSetting( const QString& name, const double value, bool autoValue )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event 
+  {
     QString myName;
     double  myValue;
     bool    myAutoValue;
   public:
     TEvent( const QString& name, const double value, bool autoValue ) 
       : myName( name ), myValue( value ), myAutoValue( autoValue ) {}
-    virtual void Execute() {
+    virtual void Execute() 
+    {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       QStringList sl = QStringList::split( ":", myName );
-       QString _sec = sl.count() > 1 ? sl[ 0 ].stripWhiteSpace() : QString( DEFAULT_SECTION );
-       QString _nam = sl.count() > 1 ? sl[ 1 ].stripWhiteSpace() : sl.count() > 0 ? sl[ 0 ].stripWhiteSpace() : QString( "" );
+       QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+       QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+       QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
        if ( !_sec.isEmpty() && !_nam.isEmpty() )
           resMgr->setValue( _sec, _nam, myValue );
       }
@@ -497,26 +639,36 @@ void SalomePyQt::addDoubleSetting( const QString& name, const double value, bool
 }
 
 /*!
-  SalomePyQt::addBoolSetting
-  Adds an boolean setting to the application preferences
-  <autoValue> parameter is obsolete parameter and currently not used. To be removed lately.
-  This function is obsolete. Use addSetting() instead.
+  \brief Add boolean setting to the application preferences.
+
+  The parameter \a autoValue is obsolete parameter and currently is not used.
+  This parameter will be removed in future, so try to avoid its usage in 
+  your code.
+
+  This function is obsolete. Use one of addSetting() instead.
+
+  \param name setting name (it should be of kind <section:setting> where
+  \c section is resources section name and \c setting is setting name)
+  \param value new setting value
+  \param autoValue (not used)
 */
 void SalomePyQt::addBoolSetting( const QString& name, const bool value, bool autoValue )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event 
+  {
     QString myName;
     bool    myValue;
     bool    myAutoValue;
   public:
     TEvent( const QString& name, const bool value, bool autoValue ) 
       : myName( name ), myValue( value ), myAutoValue( autoValue ) {}
-    virtual void Execute() {
+    virtual void Execute() 
+    {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       QStringList sl = QStringList::split( ":", myName );
-       QString _sec = sl.count() > 1 ? sl[ 0 ].stripWhiteSpace() : QString( DEFAULT_SECTION );
-       QString _nam = sl.count() > 1 ? sl[ 1 ].stripWhiteSpace() : sl.count() > 0 ? sl[ 0 ].stripWhiteSpace() : QString( "" );
+       QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+       QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+       QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
        if ( !_sec.isEmpty() && !_nam.isEmpty() )
           resMgr->setValue( _sec, _nam, myValue );
       }
@@ -526,9 +678,12 @@ void SalomePyQt::addBoolSetting( const QString& name, const bool value, bool aut
 }
 
 /*!
-  SalomePyQt::removeSettings
-  Removes a setting from the application preferences
+  \brief Remove setting from the application preferences.
+
   This function is obsolete. Use removeSetting() instead.
+
+  \param name setting name (it should be of kind <section:setting> where
+  \c section is resources section name and \c setting is setting name)
 */
 void SalomePyQt::removeSettings( const QString& name )
 {
@@ -539,9 +694,9 @@ void SalomePyQt::removeSettings( const QString& name )
     virtual void Execute() {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       QStringList sl = QStringList::split( ":", myName );
-       QString _sec = sl.count() > 1 ? sl[ 0 ].stripWhiteSpace() : QString( DEFAULT_SECTION );
-       QString _nam = sl.count() > 1 ? sl[ 1 ].stripWhiteSpace() : sl.count() > 0 ? sl[ 0 ].stripWhiteSpace() : QString( "" );
+       QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+       QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+       QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
        if ( !_sec.isEmpty() && !_nam.isEmpty() )
           resMgr->remove( _sec, _nam );
       }
@@ -551,52 +706,58 @@ void SalomePyQt::removeSettings( const QString& name )
 }
 
 /*!
-  SalomePyQt::getSetting
-  Gets a setting value (as string)
+  \fn QString SalomePyQt::getSetting( const QString& name );
+  \brief Get application setting value (as string represenation).
+
   This function is obsolete. Use stringSetting(), integerSetting(), 
   boolSetting(), stringSetting() or colorSetting() instead.
+
+  \param name setting name (it should be of kind <section:setting> where
+  \c section is resources section name and \c setting is setting name)
+  \return setting name (empty string if setting name is invalid)
 */
-class TGetSettingEvent: public SALOME_Event {
+
+class TGetSettingEvent: public SALOME_Event 
+{
 public:
   typedef QString TResult;
   TResult myResult;
   QString myName;
   TGetSettingEvent( const QString& name ) : myName( name ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SUIT_Session::session() ) {
       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-      QStringList sl = QStringList::split( ":", myName );
-      QString _sec = sl.count() > 1 ? sl[ 0 ].stripWhiteSpace() : QString( DEFAULT_SECTION );
-      QString _nam = sl.count() > 1 ? sl[ 1 ].stripWhiteSpace() : sl.count() > 0 ? sl[ 0 ].stripWhiteSpace() : QString( "" );
+      QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+      QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+      QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
       myResult = ( !_sec.isEmpty() && !_nam.isEmpty() ) ? resMgr->stringValue( _sec, _nam, "" ) : QString( "" );
     }
   }
 };
-
-/*!
-  \return a setting value (as string)
-  This function is obsolete. Use stringSetting(), integerSetting(), 
-  boolSetting(), stringSetting() or colorSetting() instead.
-*/
 QString SalomePyQt::getSetting( const QString& name )
 {
   return ProcessEvent( new TGetSettingEvent( name ) );
 }
 
 /*!
-  SalomePyQt::addSetting
-  Adds a double setting to the application preferences
+  \brief Add double setting to the application preferences.
+  \param section resources file section name 
+  \param name setting name
+  \param value new setting value
 */
 void SalomePyQt::addSetting( const QString& section, const QString& name, const double value )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event 
+  {
     QString mySection;
     QString myName;
     double  myValue;
   public:
     TEvent( const QString& section, const QString& name, double value ) 
       : mySection( section ), myName( name ), myValue( value ) {}
-    virtual void Execute() {
+    virtual void Execute() 
+    {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
@@ -608,19 +769,23 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const
 }
 
 /*!
-  SalomePyQt::addSetting
-  Adds an integer setting to the application preferences
+  \brief Add integer setting to the application preferences.
+  \param section resources file section name 
+  \param name setting name
+  \param value new setting value
 */
 void SalomePyQt::addSetting( const QString& section, const QString& name, const int value )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event 
+  {
     QString mySection;
     QString myName;
     int     myValue;
   public:
     TEvent( const QString& section, const QString& name, int value ) 
       : mySection( section ), myName( name ), myValue( value ) {}
-    virtual void Execute() {
+    virtual void Execute() 
+    {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
@@ -632,21 +797,25 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const
 }
 
 /*!
-  SalomePyQt::addSetting
-  Adds a boolean setting to the application preferences
-  (note: the last "dumb" parameter is used in order to avoid
-  sip compilation error because of conflicting int and bool types)
+  \brief Add boolean setting to the application preferences.
+  \param section resources file section name 
+  \param name setting name
+  \param value new setting value
+  \param dumb this parameter is used in order to avoid sip compilation error 
+  because of conflicting int and bool types
 */
-void SalomePyQt::addSetting( const QString& section, const QString& name, const bool value, const int )
+void SalomePyQt::addSetting( const QString& section, const QString& name, const bool value, const int /*dumb*/ )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event 
+  {
     QString mySection;
     QString myName;
     bool    myValue;
   public:
     TEvent( const QString& section, const QString& name, bool value ) 
       : mySection( section ), myName( name ), myValue( value ) {}
-    virtual void Execute() {
+    virtual void Execute() 
+    {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
@@ -658,19 +827,23 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const
 }
 
 /*!
-  SalomePyQt::addSetting
-  Adds a string setting to the application preferences
+  \brief Add string setting to the application preferences.
+  \param section resources file section name 
+  \param name setting name
+  \param value new setting value
 */
 void SalomePyQt::addSetting( const QString& section, const QString& name, const QString& value )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event 
+  {
     QString mySection;
     QString myName;
     QString myValue;
   public:
     TEvent( const QString& section, const QString& name, const QString& value ) 
       : mySection( section ), myName( name ), myValue( value ) {}
-    virtual void Execute() {
+    virtual void Execute() 
+    {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
@@ -682,19 +855,23 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const
 }
 
 /*!
-  SalomePyQt::addSetting
-  Adds a color setting to the application preferences
+  \brief Add color setting to the application preferences.
+  \param section resources file section name 
+  \param name setting name
+  \param value new setting value
 */
 void SalomePyQt::addSetting( const QString& section, const QString& name, const QColor& value )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event 
+  {
     QString mySection;
     QString myName;
     QColor  myValue;
   public:
     TEvent( const QString& section, const QString& name, const QColor& value ) 
       : mySection( section ), myName( name ), myValue( value ) {}
-    virtual void Execute() {
+    virtual void Execute() 
+    {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
@@ -706,10 +883,18 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const
 }
 
 /*!
-  SalomePyQt::integerSetting
-  Gets an integer setting from the application preferences
+  \fn int SalomePyQt::integerSetting( const QString& section, 
+                                      const QString& name, 
+                                     const int def );
+  \brief Get integer setting from the application preferences.
+  \param section resources file section name 
+  \param name setting name
+  \param def default value which is returned if the setting is not found
+  \return setting value
 */
-class TGetIntSettingEvent: public SALOME_Event {
+
+class TGetIntSettingEvent: public SALOME_Event 
+{
 public:
   typedef int TResult;
   TResult myResult;
@@ -718,27 +903,32 @@ public:
   TResult myDefault;
   TGetIntSettingEvent( const QString& section, const QString& name, const int def ) 
     : mySection( section ), myName( name ), myDefault( def ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SUIT_Session::session() ) {
       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
       myResult = ( !mySection.isEmpty() && !myName.isEmpty() ) ? resMgr->integerValue( mySection, myName, myDefault ) : myDefault;
     }
   }
 };
-
-/*!
-  \return an integer setting from the application preferences
-*/
 int SalomePyQt::integerSetting( const QString& section, const QString& name, const int def )
 {
   return ProcessEvent( new TGetIntSettingEvent( section, name, def ) );
 }
 
 /*!
-  SalomePyQt::doubleSetting
-  Gets a double setting from the application preferences
+  \fn double SalomePyQt::doubleSetting( const QString& section, 
+                                        const QString& name, 
+                                       const double def );
+  \brief Get double setting from the application preferences.
+  \param section resources file section name 
+  \param name setting name
+  \param def default value which is returned if the setting is not found
+  \return setting value
 */
-class TGetDblSettingEvent: public SALOME_Event {
+
+class TGetDblSettingEvent: public SALOME_Event 
+{
 public:
   typedef double TResult;
   TResult myResult;
@@ -747,27 +937,32 @@ public:
   TResult myDefault;
   TGetDblSettingEvent( const QString& section, const QString& name, const double def ) 
     : mySection( section ), myName( name ), myDefault( def ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SUIT_Session::session() ) {
       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
       myResult = ( !mySection.isEmpty() && !myName.isEmpty() ) ? resMgr->doubleValue( mySection, myName, myDefault ) : myDefault;
     }
   }
 };
-
-/*!
-  \return an double setting from the application preferences
-*/
 double SalomePyQt::doubleSetting( const QString& section, const QString& name, const double def )
 {
   return ProcessEvent( new TGetDblSettingEvent( section, name, def ) );
 }
 
 /*!
-  SalomePyQt::boolSetting
-  Gets a boolean setting from the application preferences
+  \fn bool SalomePyQt::boolSetting( const QString& section, 
+                                    const QString& name, 
+                                   const bool def );
+  \brief Get boolean setting from the application preferences.
+  \param section resources file section name 
+  \param name setting name
+  \param def default value which is returned if the setting is not found
+  \return setting value
 */
-class TGetBoolSettingEvent: public SALOME_Event {
+
+class TGetBoolSettingEvent: public SALOME_Event 
+{
 public:
   typedef bool TResult;
   TResult myResult;
@@ -776,27 +971,32 @@ public:
   TResult myDefault;
   TGetBoolSettingEvent( const QString& section, const QString& name, const bool def ) 
     : mySection( section ), myName( name ), myDefault( def ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SUIT_Session::session() ) {
       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
       myResult = ( !mySection.isEmpty() && !myName.isEmpty() ) ? resMgr->booleanValue( mySection, myName, myDefault ) : myDefault;
     }
   }
 };
-
-/*!
-  \return an boolean setting from the application preferences
-*/
 bool SalomePyQt::boolSetting( const QString& section, const QString& name, const bool def )
 {
   return ProcessEvent( new TGetBoolSettingEvent( section, name, def ) );
 }
 
 /*!
-  SalomePyQt::stringSetting
-  Gets a string setting from the application preferences
+  \fn QString SalomePyQt::stringSetting( const QString& section, 
+                                         const QString& name, 
+                                        const QString& def );
+  \brief Get string setting from the application preferences.
+  \param section resources file section name 
+  \param name setting name
+  \param def default value which is returned if the setting is not found
+  \return setting value
 */
-class TGetStrSettingEvent: public SALOME_Event {
+
+class TGetStrSettingEvent: public SALOME_Event
+{
 public:
   typedef QString TResult;
   TResult myResult;
@@ -805,27 +1005,32 @@ public:
   TResult myDefault;
   TGetStrSettingEvent( const QString& section, const QString& name, const QString& def ) 
     : mySection( section ), myName( name ), myDefault( def ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SUIT_Session::session() ) {
       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
       myResult = ( !mySection.isEmpty() && !myName.isEmpty() ) ? resMgr->stringValue( mySection, myName, myDefault ) : myDefault;
     }
   }
 };
-
-/*!
-  \return an string setting from the application preferences
-*/
 QString SalomePyQt::stringSetting( const QString& section, const QString& name, const QString& def )
 {
   return ProcessEvent( new TGetStrSettingEvent( section, name, def ) );
 }
 
 /*!
-  SalomePyQt::colorSetting
-  Gets a color setting from the application preferences
+  \fn QColor SalomePyQt::colorSetting( const QString& section, 
+                                       const QString& name, 
+                                      const QColor def );
+  \brief Get color setting from the application preferences.
+  \param section resources file section name 
+  \param name setting name
+  \param def default value which is returned if the setting is not found
+  \return setting value
 */
-class TGetColorSettingEvent: public SALOME_Event {
+
+class TGetColorSettingEvent: public SALOME_Event 
+{
 public:
   typedef QColor TResult;
   TResult myResult;
@@ -834,34 +1039,34 @@ public:
   TResult myDefault;
   TGetColorSettingEvent( const QString& section, const QString& name, const QColor& def ) 
     : mySection( section ), myName( name ), myDefault( def ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SUIT_Session::session() ) {
       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
       myResult = ( !mySection.isEmpty() && !myName.isEmpty() ) ? resMgr->colorValue( mySection, myName, myDefault ) : myDefault;
     }
   }
 };
-
-/*!
-  \return a color setting from the application preferences
-*/
 QColor SalomePyQt::colorSetting ( const QString& section, const QString& name, const QColor& def )
 {
   return ProcessEvent( new TGetColorSettingEvent( section, name, def ) );
 }
 
 /*!
-  SalomePyQt::removeSetting
-  Removes a setting from the application preferences
+  \brief Remove setting from the application preferences.
+  \param section resources file section name 
+  \param name setting name
 */
 void SalomePyQt::removeSetting( const QString& section, const QString& name )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event 
+  {
     QString mySection;
     QString myName;
   public:
     TEvent( const QString& section, const QString& name ) : mySection( section ), myName( name ) {}
-    virtual void Execute() {
+    virtual void Execute() 
+    {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
@@ -873,10 +1078,15 @@ void SalomePyQt::removeSetting( const QString& section, const QString& name )
 }
 
 /*!
-  SalomePyQt::hasSetting
-  Returns True if the settings exists
+  \fn bool SalomePyQt::hasSetting( const QString& section, const QString& name );
+  \brief Check setting existence in the application preferences.
+  \param section resources file section name 
+  \param name setting name
+  \return \c true if setting exists
 */
-class THasColorSettingEvent: public SALOME_Event {
+
+class THasColorSettingEvent: public SALOME_Event 
+{
 public:
   typedef bool TResult;
   TResult myResult;
@@ -884,7 +1094,8 @@ public:
   QString myName;
   THasColorSettingEvent( const QString& section, const QString& name ) 
     : mySection( section ), myName( name ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SUIT_Session::session() ) {
       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
       myResult = resMgr->hasValue( mySection, myName );
@@ -897,10 +1108,24 @@ bool SalomePyQt::hasSetting( const QString& section, const QString& name )
 }
 
 /*!
-  SalomePyQt::getFileName
-  Displays 'Open/Save file' dialog box and returns a user's choice (file name)
+  \fn QString SalomePyQt::getFileName( QWidget*           parent, 
+                                      const QString&     initial, 
+                                      const QStringList& filters, 
+                                      const QString&     caption,
+                                      bool               open );
+  \brief Show 'Open/Save file' dialog box for file selection 
+         and return a user's choice (selected file name).
+  \param parent parent widget
+  \param initial initial directory the dialog box to be opened in
+  \param filters list of files filters (wildcards)
+  \param caption dialog box title
+  \param open if \c true, "Open File" dialog box is shown; 
+         otherwise "Save File" dialog box is shown
+  \return selected file name (null string if user cancels operation)
 */
-class TGetFileNameEvent: public SALOME_Event {
+
+class TGetFileNameEvent: public SALOME_Event 
+{
 public:
   typedef QString TResult;
   TResult     myResult;
@@ -919,16 +1144,14 @@ public:
       myFilters( filters ), 
       myCaption( caption ), 
       myOpen ( open ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SalomeApp_Application* anApp = getApplication() ) {
-      myResult = anApp->getFileName( myOpen, myInitial, myFilters.join(";;"), myCaption, myParent );
+      myResult = anApp->getFileName( myOpen, myInitial, myFilters.join(";;"), 
+                                    myCaption, myParent );
     }
   }
 };
-
-/*!
-  Displays 'Open/Save file' dialog box and returns a user's choice (file name)
-*/
 QString SalomePyQt::getFileName( QWidget*           parent, 
                                 const QString&     initial, 
                                 const QStringList& filters, 
@@ -939,10 +1162,21 @@ QString SalomePyQt::getFileName( QWidget*           parent,
 }
 
 /*!
-  SalomePyQt::getOpenFileNames
-  Displays 'Open files' dialog box and returns a user's choice (a list of file names)
+  \fn QStringList SalomePyQt::getOpenFileNames( QWidget*           parent, 
+                                               const QString&     initial, 
+                                               const QStringList& filters, 
+                                               const QString&     caption );
+  \brief Show 'Open files' dialog box for multiple files selection
+         and return a user's choice (selected file names list).
+  \param parent parent widget
+  \param initial initial directory the dialog box to be opened in
+  \param filters list of files filters (wildcards)
+  \param caption dialog box title
+  \return selected file names list (empty list if user cancels operation)
 */
-class TGetOpenFileNamesEvent: public SALOME_Event {
+
+class TGetOpenFileNamesEvent: public SALOME_Event 
+{
 public:
   typedef QStringList TResult;
   TResult     myResult;
@@ -958,16 +1192,13 @@ public:
       myInitial( initial ), 
       myFilters( filters ), 
       myCaption( caption ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SalomeApp_Application* anApp = getApplication() ) {
       myResult = anApp->getOpenFileNames( myInitial, myFilters.join(";;"), myCaption, myParent );
     }
   }
 };
-
-/*!
-  Displays 'Open files' dialog box and returns a user's choice (a list of file names)
-*/
 QStringList SalomePyQt::getOpenFileNames( QWidget*           parent, 
                                          const QString&     initial, 
                                          const QStringList& filters, 
@@ -977,10 +1208,19 @@ QStringList SalomePyQt::getOpenFileNames( QWidget*           parent,
 }
 
 /*!
-  SalomePyQt::getExistingDirectory
-  Displays 'Get Directory' dialog box and returns a user's choice (a directory name)
+  \fn QString SalomePyQt::getExistingDirectory( QWidget*       parent,
+                                               const QString& initial,
+                                               const QString& caption );
+  \brief Show 'Get Directory' dialog box for the directory selection
+         and return a user's choice (selected directory name).
+  \param parent parent widget
+  \param initial initial directory the dialog box to be opened in
+  \param caption dialog box title
+  \return selected directory name (null string if user cancels operation)
 */
-class TGetExistingDirectoryEvent: public SALOME_Event {
+
+class TGetExistingDirectoryEvent: public SALOME_Event 
+{
 public:
   typedef QString TResult;
   TResult     myResult;
@@ -993,16 +1233,13 @@ public:
     : myParent ( parent ), 
       myInitial( initial ), 
       myCaption( caption ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SalomeApp_Application* anApp = getApplication() ) {
       myResult = anApp->getDirectory( myInitial, myCaption, myParent );
     }
   }
 };
-
-/*!
-  Displays 'Get Directory' dialog box and returns a user's choice (a directory name)
-*/
 QString SalomePyQt::getExistingDirectory( QWidget*       parent,
                                          const QString& initial,
                                          const QString& caption )
@@ -1011,21 +1248,27 @@ QString SalomePyQt::getExistingDirectory( QWidget*       parent,
 }
 
 /*!
-  SalomePyQt::helpContext
-  Opens external browser to display 'context help' information
-  current implementation does nothing.
+  \brief Open external browser to display context help information.
+  \todo
+
+  Current implementation does nothing.
+
+  \param source documentation (HTML) file name
+  \param context context (for example, HTML ancor name)
 */
-void SalomePyQt::helpContext( const QString& source, const QString& context ) {
-  class TEvent: public SALOME_Event {
+void SalomePyQt::helpContext( const QString& source, const QString& context ) 
+{
+  class TEvent: public SALOME_Event 
+  {
     QString mySource;
     QString myContext;
   public:
     TEvent( const QString& source, const QString& context ) 
       : mySource( source ), myContext( context ) {}
-    virtual void Execute() {
-      if ( /*SalomeApp_Application* anApp =*/ getApplication() ) {
-       // VSR: TODO
-        // anApp->helpContext( mySource, myContext );
+    virtual void Execute() 
+    {
+      if ( SalomeApp_Application* anApp = getApplication() ) {
+        anApp->onHelpContextModule( "", mySource, myContext );
       }
     }
   };
@@ -1033,18 +1276,28 @@ void SalomePyQt::helpContext( const QString& source, const QString& context ) {
 }
 
 /*!
-  SalomePyQt::dumpView
-  Dumps the contents of the currently active view to the image file 
-  in the given format (JPEG, PNG, BMP are supported)
+  \fn bool SalomePyQt::dumpView( const QString& filename );
+  \brief Dump the contents of the currently active view window 
+  to the image file in the specified format.
+
+  For the current moment JPEG, PNG and BMP images formats are supported.
+  The image format is defined automatically by the file name extension.
+  By default, BMP format is used.
+
+  \param filename image file name
+  \return operation status (\c true on success)
 */
-class TDumpViewEvent: public SALOME_Event {
+
+class TDumpViewEvent: public SALOME_Event 
+{
 public:
   typedef bool TResult;
   TResult myResult;
   QString myFileName;
   TDumpViewEvent( const QString& filename ) 
     : myResult ( false ), myFileName( filename ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     if ( SalomeApp_Application* anApp = getApplication() ) {
       SUIT_ViewManager* vm = anApp->activeViewManager();
       if ( vm ) { 
@@ -1052,58 +1305,44 @@ public:
        if ( vw ) {
           QImage im = vw->dumpView();
          if ( !im.isNull() && !myFileName.isEmpty() ) {
-            QString fmt = SUIT_Tools::extension( myFileName ).upper();
+            QString fmt = SUIT_Tools::extension( myFileName ).toUpper();
            if ( fmt.isEmpty() ) fmt = QString( "BMP" ); // default format
            if ( fmt == "JPG" )  fmt = "JPEG";
-           myResult = im.save( myFileName, fmt.latin1() );
+           myResult = im.save( myFileName, fmt.toLatin1() );
           }
        }
       }
     }
   }
 };
-
-/*!
-  Dumps the contents of the currently active view to the image file 
-  in the given format (JPEG, PNG, BMP are supported)
-*/
 bool SalomePyQt::dumpView( const QString& filename )
 {
   return ProcessEvent( new TDumpViewEvent( filename ) );
 }
 
 /*!
-  SalomePyQt::defaultMenuGroup
-  Returns default menu group
+  \fn int SalomePyQt::defaultMenuGroup();
+  \brief Get detault menu group identifier which can be used when 
+  creating menus (insert custom menu commands).
+  \return default menu group ID
 */
-class TDefMenuGroupEvent: public SALOME_Event {
+
+class TDefMenuGroupEvent: public SALOME_Event 
+{
 public:
   typedef int TResult;
   TResult myResult;
   TDefMenuGroupEvent() : myResult( -1 ) {}
-  virtual void Execute() {
+  virtual void Execute() 
+  {
     myResult = SALOME_PYQT_Module::defaultMenuGroup();
   }
 };
-
-/*!
-  \return default menu group
-*/
 int SalomePyQt::defaultMenuGroup()
 {
   return ProcessEvent( new TDefMenuGroupEvent() );
 }
 
-/*!
-  SalomePyQt::createTool
-  These methods allow operating with the toolbars:
-  - create a new toolbar or get the existing one (the toolbar name is passed as parameter);
-    this method returns an id of the toolbar;
-  - add action with given id (must be created previously) and optional index to the existing toolbar
-    (toobar is identified either by its id or by its name)
-    these methods return an id of the action.
-  If error occurs, the -1 value is returned.
-*/
 class CrTool
 {
 public:
@@ -1113,9 +1352,9 @@ public:
     : myCase( 1 ), myId( id ), myTbId( tBar ), myIndex( idx ) {}
   CrTool( const int id, const QString& tBar, const int idx )
     : myCase( 2 ), myId( id ), myTbName( tBar ), myIndex( idx ) {}
-  CrTool( QtxAction* action, const int tbId, const int id, const int idx )
+  CrTool( QAction* action, const int tbId, const int id, const int idx )
     : myCase( 3 ), myAction( action ), myTbId( tbId ), myId( id ), myIndex( idx ) {}
-  CrTool( QtxAction* action, const QString& tBar, const int id, const int idx )
+  CrTool( QAction* action, const QString& tBar, const int id, const int idx )
     : myCase( 4 ), myAction( action ), myTbName( tBar ), myId( id ), myIndex( idx ) {}
 
   int execute( SALOME_PYQT_Module* module ) const
@@ -1140,70 +1379,87 @@ private:
    int        myCase;
    QString    myTbName;
    int        myTbId;
-   QtxAction* myAction;
+   QAction*   myAction;
    int        myId;
    int        myIndex;
 };
-class TCreateToolEvent: public SALOME_Event {
+
+class TCreateToolEvent: public SALOME_Event 
+{
 public:
   typedef int TResult;
   TResult myResult;
   const CrTool& myCrTool;
   TCreateToolEvent( const CrTool& crTool ) 
     : myResult( -1 ), myCrTool( crTool ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-      if ( !module )
-        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
+  virtual void Execute() 
+  {
+    SALOME_PYQT_Module* module = getActiveModule();
+    if ( module )
       myResult = myCrTool.execute( module );
-    }
   }
 };
 
 /*!
-  create new toolbar or get existing by name 
+  \brief Create toolbar with specified name.
+  \param tBar toolbar name
+  \return toolbar ID or -1 if toolbar creation is failed
 */
 int SalomePyQt::createTool( const QString& tBar )
 {
   return ProcessEvent( new TCreateToolEvent( CrTool( tBar ) ) );
 }
-/*! add action with id and index to the existing tollbar
+
+/*! 
+  \brief Insert action with specified \a id to the toolbar.
+  \param id action ID
+  \param tBar toolbar ID
+  \param idx required index in the toolbar
+  \return action ID or -1 if action could not be added
 */
 int SalomePyQt::createTool( const int id, const int tBar, const int idx )
 {
   return ProcessEvent( new TCreateToolEvent( CrTool( id, tBar, idx ) ) );
 }
-/*! add action with id and index to the existing tollbar
+
+/*!
+  \brief Insert action with specified \a id to the toolbar.
+  \param id action ID
+  \param tBar toolbar name
+  \param idx required index in the toolbar
+  \return action ID or -1 if action could not be added
 */
 int SalomePyQt::createTool( const int id, const QString& tBar, const int idx )
 {
   return ProcessEvent( new TCreateToolEvent( CrTool( id, tBar, idx ) ) );
 }
-/*! add action with id and index to the existing tollbar
+
+/*!
+  \brief Insert action to the toolbar.
+  \param a action
+  \param tBar toolbar ID
+  \param id required action ID
+  \param idx required index in the toolbar
+  \return action ID or -1 if action could not be added
 */
-int SalomePyQt::createTool( QtxAction* a, const int tBar, const int id, const int idx )
+int SalomePyQt::createTool( QAction* a, const int tBar, const int id, const int idx )
 {
   return ProcessEvent( new TCreateToolEvent( CrTool( a, tBar, id, idx ) ) );
 }
-/*! add action with id and index to the existing tollbar
+
+/*!
+  \brief Insert action to the toolbar.
+  \param a action
+  \param tBar toolbar name
+  \param id required action ID
+  \param idx required index in the toolbar
+  \return action ID or -1 if action could not be added
 */
-int SalomePyQt::createTool( QtxAction* a, const QString& tBar, const int id, const int idx )
+int SalomePyQt::createTool( QAction* a, const QString& tBar, const int id, const int idx )
 {
   return ProcessEvent( new TCreateToolEvent( CrTool( a, tBar, id, idx ) ) );
 }
 
-/*!
-  SalomePyQt::createMenu
-  These methods allow operating with the main menu:
-  - create a new menu or submenu or get the existing one (the parent menu name or id is passed as parameter, 
-    if it is empty or -1, it means that main menu is created, otherwise submenu is created);
-    this method returns an id of the menu/submenu;
-  - add action with given id (must be created previously) and optional index and group number to the existing menu
-    or submenu (menu name or id us passed as parameter)
-    these methods return an id of the action.
-  If error occurs, the -1 value is returned.
-*/
 class CrMenu
 {
 public:
@@ -1215,9 +1471,9 @@ public:
     : myCase( 2 ), myId( id ), myMenuId( menu ), myGroup( group ), myIndex( idx ) {}
   CrMenu( const int id, const QString& menu, const int group, const int idx ) 
     : myCase( 3 ), myId( id ), myMenuName( menu ), myGroup( group ), myIndex( idx ) {}
-  CrMenu( QtxAction* action, const int menu, const int id, const int group, const int idx ) 
+  CrMenu( QAction* action, const int menu, const int id, const int group, const int idx ) 
     : myCase( 4 ), myAction( action ), myMenuId( menu ), myId( id ), myGroup( group ), myIndex( idx ) {}
-  CrMenu( QtxAction* action, const QString& menu, const int id, const int group, const int idx ) 
+  CrMenu( QAction* action, const QString& menu, const int id, const int group, const int idx ) 
     : myCase( 5 ), myAction( action ), myMenuName( menu ), myId( id ), myGroup( group ), myIndex( idx ) {}
 
   int execute( SALOME_PYQT_Module* module ) const
@@ -1246,95 +1502,154 @@ private:
    int        myMenuId;
    QString    mySubMenuName;
    int        myGroup;
-   QtxAction* myAction;
+   QAction*   myAction;
    int        myId;
    int        myIndex;
 };
-class TCreateMenuEvent: public SALOME_Event {
+
+class TCreateMenuEvent: public SALOME_Event
+{
 public:
   typedef int TResult;
   TResult myResult;
   const CrMenu& myCrMenu;
   TCreateMenuEvent( const CrMenu& crMenu ) 
     : myResult( -1 ), myCrMenu( crMenu ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-      if ( !module )
-        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
+  virtual void Execute()
+  {
+    SALOME_PYQT_Module* module = getActiveModule();
+    if ( module )
       myResult = myCrMenu.execute( module );
-    }
   }
 };
+
+/*!
+  \brief Create main menu.
+  \param subMenu menu name
+  \param menu parent menu ID
+  \param id required menu ID
+  \param group menu group ID
+  \param idx required index in the menu
+  \return menu ID or -1 if menu could not be added
+*/
 int SalomePyQt::createMenu( const QString& subMenu, const int menu, const int id, const int group, const int idx )
 {
   return ProcessEvent( new TCreateMenuEvent( CrMenu( subMenu, menu, id, group, idx ) ) );
 }
 
+/*!
+  \brief Create main menu.
+  \param subMenu menu name
+  \param menu parent menu name (list of menu names separated by "|")
+  \param id required menu ID
+  \param group menu group ID
+  \param idx required index in the menu
+  \return menu ID or -1 if menu could not be added
+*/
 int SalomePyQt::createMenu( const QString& subMenu, const QString& menu, const int id, const int group, const int idx )
 {
   return ProcessEvent( new TCreateMenuEvent( CrMenu( subMenu, menu, id, group, idx ) ) );
 }
 
-int SalomePyQt::createMenu( const int id, const int menu, const int group, const int idx )
+/*!
+  \brief Insert action to the main menu.
+  \param id action ID
+  \param menu parent menu ID
+  \param group menu group ID
+  \param idx required index in the menu
+  \return action ID or -1 if action could not be added
+*/
+int SalomePyQt::createMenu( const int id, const int menu, const int group, const int idx )
 {
   return ProcessEvent( new TCreateMenuEvent( CrMenu( id, menu, group, idx ) ) );
 }
 
+/*!
+  \brief Insert action to the main menu.
+  \param id action ID
+  \param menu parent menu name (list of menu names separated by "|")
+  \param group menu group ID
+  \param idx required index in the menu
+  \return action ID or -1 if action could not be added
+*/
 int SalomePyQt::createMenu( const int id, const QString& menu, const int group, const int idx )
 {
   return ProcessEvent( new TCreateMenuEvent( CrMenu( id, menu, group, idx ) ) );
 }
 
-int SalomePyQt::createMenu( QtxAction* a, const int menu, const int id, const int group, const int idx )
+/*!
+  \brief Insert action to the main menu.
+  \param a action
+  \param menu parent menu ID
+  \param group menu group ID
+  \param idx required index in the menu
+  \return action ID or -1 if action could not be added
+*/
+int SalomePyQt::createMenu( QAction* a, const int menu, const int id, const int group, const int idx )
 {
   return ProcessEvent( new TCreateMenuEvent( CrMenu( a, menu, id, group, idx ) ) );
 }
 
-int SalomePyQt::createMenu( QtxAction* a, const QString& menu, const int id, const int group, const int idx )
+/*!
+  \brief Insert action to the main menu.
+  \param a action
+  \param menu parent menu name (list of menu names separated by "|")
+  \param group menu group ID
+  \param idx required index in the menu
+  \return action ID or -1 if action could not be added
+*/
+int SalomePyQt::createMenu( QAction* a, const QString& menu, const int id, const int group, const int idx )
 {
   return ProcessEvent( new TCreateMenuEvent( CrMenu( a, menu, id, group, idx ) ) );
 }
 
 /*!
-  SalomePyQt::createSeparator
-  Create a separator action which can be then used in the menu or toolbar.
+  \fn QAction* SalomePyQt::createSeparator();
+  \brief Create separator action which can be used in the menu or toolbar.
+  \return new separator action
 */
-class TCreateSepEvent: public SALOME_Event {
+
+class TCreateSepEvent: public SALOME_Event 
+{
 public:
-  typedef QtxAction* TResult;
+  typedef QAction* TResult;
   TResult myResult;
   TCreateSepEvent() 
     : myResult( 0 ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-      if ( !module )
-        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
-      if ( module )
-        myResult = (QtxAction*)module->createSeparator();
-    }
+  virtual void Execute() 
+  {
+    SALOME_PYQT_Module* module = getActiveModule();
+    if ( module )
+      myResult = (QAction*)module->separator();
   }
 };
-QtxAction* SalomePyQt::createSeparator()
+QAction* SalomePyQt::createSeparator()
 {
   return ProcessEvent( new TCreateSepEvent() );
 }
 
 /*!
-  SalomePyQt::createAction
-  Create an action which can be then used in the menu or toolbar:
-  - id         : the unique id action to be registered to;
-  - menuText   : action text which should appear in menu;
-  - tipText    : text which should appear in the tooltip;
-  - statusText : text which should appear in the status bar when action is activated;
-  - icon       : the name of the icon file (the actual icon file name can be coded in the translation files);
-  - key        : the key accelrator for the action
-  - toggle     : if true the action is checkable
+  \fn QAction* SalomePyQt::createAction( const int      id,
+                                           const QString& menuText, 
+                                          const QString& tipText, 
+                                          const QString& statusText, 
+                                          const QString& icon,
+                                          const int      key, 
+                                          const bool     toggle )
+  \brief Create an action which can be then used in the menu or toolbar.
+  \param id the unique id action to be registered to
+  \param menuText action text which should appear in menu
+  \param tipText text which should appear in the tooltip
+  \param statusText text which should appear in the status bar when action is activated
+  \param icon the name of the icon file (the actual icon file name can be coded in the translation files)
+  \param key the key accelrator for the action
+  \param toggle if \c true the action is checkable
 */
-class TCreateActionEvent: public SALOME_Event {
+
+class TCreateActionEvent: public SALOME_Event 
+{
 public:
-  typedef QtxAction* TResult;
+  typedef QAction* TResult;
   TResult myResult;
   int     myId;
   QString myMenuText;
@@ -1347,17 +1662,14 @@ public:
                      const QString& statusText, const QString& icon, const int key, const bool toggle ) 
     : myResult( 0 ), myId( id ), myMenuText( menuText ), myTipText( tipText ),
       myStatusText( statusText ), myIcon( icon ), myKey( key ), myToggle( toggle ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-      if ( !module )
-        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
-      if ( module )
-        myResult = (QtxAction*)module->createAction( myId, myTipText, myIcon, myMenuText, myStatusText, myKey, myToggle );
-    }
+  virtual void Execute()
+  {
+    SALOME_PYQT_Module* module = getActiveModule();
+    if ( module )
+      myResult = (QAction*)module->createAction( myId, myTipText, myIcon, myMenuText, myStatusText, myKey, myToggle );
   }
 };
-QtxAction* SalomePyQt::createAction( const int id,           const QString& menuText, 
+QAction* SalomePyQt::createAction( const int id,           const QString& menuText, 
                                     const QString& tipText, const QString& statusText, 
                                     const QString& icon,    const int key, const bool toggle )
 {
@@ -1365,104 +1677,103 @@ QtxAction* SalomePyQt::createAction( const int id,           const QString& menu
 }
 
 /*!
-  SalomePyQt::action
-  Get an action by its id. Returns 0 if the action with such id was not registered.
+  \fn QtxActionGroup* SalomePyQt::createActionGroup( const int id, const bool exclusive )
+  \brief Create an action group which can be then used in the menu or toolbar
+  \param id         : the unique id action group to be registered to
+  \param exclusive  : if \c true the action group does exclusive toggling
 */
-class TActionEvent: public SALOME_Event {
+
+struct TcreateActionGroupEvent: public SALOME_Event {
+  typedef QtxActionGroup* TResult;
+  TResult myResult;
+  int     myId;
+  bool    myExclusive;
+  TcreateActionGroupEvent( const int id, const bool exclusive )
+    : myId( id ), myExclusive( exclusive ) {}
+  virtual void Execute()
+  {
+    SALOME_PYQT_Module* module = getActiveModule();
+    if ( module )
+      myResult = module->createActionGroup( myId, myExclusive );
+  }
+};
+QtxActionGroup* SalomePyQt::createActionGroup(const int id, const bool exclusive)
+{
+  return ProcessEvent( new TcreateActionGroupEvent( id, exclusive ) );
+}
+
+/*!
+  \fn QAction* SalomePyQt::action( const int id )
+  \brief Get action by specified identifier.
+  \return action or 0 if action is not registered
+*/
+
+class TActionEvent: public SALOME_Event 
+{
 public:
-  typedef QtxAction* TResult;
+  typedef QAction* TResult;
   TResult myResult;
   int     myId;
   TActionEvent( const int id )
     : myResult( 0 ), myId( id ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-      if ( !module )
-        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
-      if ( module )
-        myResult = (QtxAction*)module->action( myId );
-    }
+  virtual void Execute()
+  {
+    SALOME_PYQT_Module* module = getActiveModule();
+    if ( module )
+      myResult = (QAction*)module->action( myId );
   }
 };
-QtxAction* SalomePyQt::action( const int id )
+QAction* SalomePyQt::action( const int id )
 {
   return ProcessEvent( new TActionEvent( id ) );
 }
 
 /*!
-  SalomePyQt::actionId
-  Get an action id. Returns -1 if the action was not registered.
+  \fn int SalomePyQt::actionId( const QAction* a );
+  \brief Get an action identifier. 
+  \return action ID or -1 if action is not registered
 */
-class TActionIdEvent: public SALOME_Event {
+
+class TActionIdEvent: public SALOME_Event 
+{
 public:
   typedef  int TResult;
   TResult  myResult;
-  const QtxAction* myAction;
-  TActionIdEvent( const QtxAction* action )
+  const QAction* myAction;
+  TActionIdEvent( const QAction* action )
     : myResult( -1 ), myAction( action ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-      if ( !module )
-        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
-      if ( module )
-        myResult = module->actionId( myAction );
-    }
+  virtual void Execute()
+  {
+    SALOME_PYQT_Module* module = getActiveModule();
+    if ( module )
+      myResult = module->actionId( myAction );
   }
 };
-int SalomePyQt::actionId( const QtxAction* a )
+int SalomePyQt::actionId( const QAction* a )
 {
   return ProcessEvent( new TActionIdEvent( a ) );
 }
 
 /*!
-  SalomePyQt::clearMenu
-  Clears given menu (recursively if necessary)
+  \fn int SalomePyQt::addGlobalPreference( const QString& label );
+  \brief Add global (not module-related) preferences group.
+  \param label global preferences group name
+  \return preferences group identifier
 */
-class TClearMenuEvent: public SALOME_Event {
-public:
-  typedef  bool TResult;
-  TResult  myResult;
-  int      myId;
-  int      myMenu;
-  bool     myRemoveActions;
-  TClearMenuEvent( const int id, const int menu, const bool removeActions )
-    : myResult( false ), myId( id ), myMenu( menu ), myRemoveActions( removeActions ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-      if ( !module )
-        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
-      if ( module )
-        myResult = module->clearMenu( myId, myMenu, myRemoveActions );
-    }
-  }
-};
-bool SalomePyQt::clearMenu( const int id, const int menu, const bool removeActions )
-{
-  return ProcessEvent( new TClearMenuEvent( id, menu, removeActions ) );
-}
 
-/*!
-  SalomePyQt::addGlobalPreference
-  Adds global (not module) preferences group 
- */
-class TAddGlobalPrefEvent: public SALOME_Event {
+class TAddGlobalPrefEvent: public SALOME_Event
+{
 public:
   typedef int TResult;
   TResult myResult;
   QString myLabel;
   TAddGlobalPrefEvent( const QString& label )
     : myResult( -1 ), myLabel( label ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-      if ( !module )
-        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
-      if ( module )
-       myResult = module->addGlobalPreference( myLabel );
-    }
+  virtual void Execute() 
+  {
+    SALOME_PYQT_Module* module = getActiveModule();
+    if ( module )
+      myResult = module->addGlobalPreference( myLabel );
   }
 };
 int SalomePyQt::addGlobalPreference( const QString& label )
@@ -1471,24 +1782,25 @@ int SalomePyQt::addGlobalPreference( const QString& label )
 }
 
 /*!
-  SalomePyQt::addPreference
-  Adds preference 
- */
-class TAddPrefEvent: public SALOME_Event {
+  \fn int SalomePyQt::addPreference( const QString& label );
+  \brief Add module-related preferences group.
+  \param label preferences group name
+  \return preferences group identifier
+*/
+
+class TAddPrefEvent: public SALOME_Event 
+{
 public:
   typedef int TResult;
   TResult myResult;
   QString myLabel;
   TAddPrefEvent( const QString& label )
     : myResult( -1 ), myLabel( label ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-      if ( !module )
-        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
-      if ( module )
-       myResult = module->addPreference( myLabel );
-    }
+  virtual void Execute() 
+  {
+    SALOME_PYQT_Module* module = getActiveModule();
+    if ( module )
+      myResult = module->addPreference( myLabel );
   }
 };
 int SalomePyQt::addPreference( const QString& label )
@@ -1497,10 +1809,19 @@ int SalomePyQt::addPreference( const QString& label )
 }
 
 /*!
-  SalomePyQt::addPreference
-  Adds preference 
- */
-class TAddPrefParamEvent: public SALOME_Event {
+  \fn int SalomePyQt::addPreference( const QString& label, const int pId, const int type,
+                                    const QString& section, const QString& param );
+  \brief Add module-related preferences.
+  \param label preferences group name
+  \param pId parent preferences group id
+  \param type preferences type
+  \param section resources file section name
+  \param param resources file setting name
+  \return preferences identifier
+*/
+
+class TAddPrefParamEvent: public SALOME_Event
+{
 public:
   typedef int TResult;
   TResult myResult;
@@ -1516,14 +1837,11 @@ public:
     : myResult( -1 ),
       myLabel( label ), myPId( pId ), myType( type ), 
       mySection( section ), myParam ( param ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-      if ( !module )
-        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
-      if ( module )
-       myResult = module->addPreference( myLabel, myPId, myType, mySection, myParam );
-    }
+  virtual void Execute()
+  {
+    SALOME_PYQT_Module* module = getActiveModule();
+    if ( module )
+      myResult = module->addPreference( myLabel, myPId, myType, mySection, myParam );
   }
 };
 int SalomePyQt::addPreference( const QString& label, const int pId, const int type,
@@ -1533,28 +1851,27 @@ int SalomePyQt::addPreference( const QString& label, const int pId, const int ty
 }
 
 /*!
-  SalomePyQt::preferenceProperty
-  Gets the property value for the given (by id) preference
- */
-class TPrefPropEvent: public SALOME_Event {
+  \fn QVariant SalomePyQt::preferenceProperty( const int id, const QString& prop );
+  \brief Get the preferences property.
+  \param id preferences identifier
+  \param prop preferences property name
+  \return preferences property value or null QVariant if property is not set
+*/
+
+class TPrefPropEvent: public SALOME_Event
+{
 public:
   typedef QVariant TResult;
   TResult myResult;
   int     myId;
   QString myProp;
   TPrefPropEvent( const int id, const QString& prop )
-    : myId( id ), myProp( prop )
-  { 
-    myResult = QVariant();
-  }
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-      if ( !module )
-        module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
-      if ( module )
-       myResult = module->preferenceProperty( myId, myProp );
-    }
+    : myId( id ), myProp( prop ) {}
+  virtual void Execute()
+  {
+    SALOME_PYQT_Module* module = getActiveModule();
+    if ( module )
+      myResult = module->preferenceProperty( myId, myProp );
   }
 };
 QVariant SalomePyQt::preferenceProperty( const int id, const QString& prop )
@@ -1563,48 +1880,51 @@ QVariant SalomePyQt::preferenceProperty( const int id, const QString& prop )
 }
 
 /*!
-  SalomePyQt::setPreferenceProperty
-  Sets the property value for the given (by id) preference
- */
+  \brief Set the preferences property.
+  \param id preferences identifier
+  \param prop preferences property name
+  \param var preferences property value
+*/
 void SalomePyQt::setPreferenceProperty( const int id, 
                                        const QString& prop,
                                        const QVariant& var )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
     int      myId;
     QString  myProp;
     QVariant myVar;
   public:
     TEvent( const int id, const QString& prop, const QVariant& var ) 
       : myId( id ), myProp( prop ), myVar( var ) {}
-    virtual void Execute() {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-       if ( !module )
-         module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
-       if ( module )
-         module->setPreferenceProperty( myId, myProp, myVar );
-      }
+    virtual void Execute() 
+    {
+      SALOME_PYQT_Module* module = getActiveModule();
+      if ( module )
+       module->setPreferenceProperty( myId, myProp, myVar );
     }
   };
   ProcessVoidEvent( new TEvent( id, prop, var) );
 }
 
 /*!
-  SalomePyQt::addPreferenceProperty
-  Adds the property value to the list of values 
-  for the given (by id) preference
+  \brief Add the property value to the list of values.
 
-  This method allows creating properties which are QValueList<QVariant>
-  - there is no way to pass such values directly to QVariant parameter
-  from Python
- */
+  This method allows creating properties which are QList<QVariant>
+  - there is no way to pass such values directly to QVariant parameter with PyQt.
+
+  \param id preferences identifier
+  \param prop preferences property name
+  \param idx preferences property index
+  \param var preferences property value for the index \a idx
+*/
 void SalomePyQt::addPreferenceProperty( const int id, 
                                        const QString& prop,
                                        const int idx, 
                                        const QVariant& var )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
     int      myId;
     QString  myProp;
     int      myIdx;
@@ -1612,37 +1932,34 @@ void SalomePyQt::addPreferenceProperty( const int id,
   public:
     TEvent( const int id, const QString& prop, const int idx, const QVariant& var ) 
       : myId( id ), myProp( prop ), myIdx( idx), myVar( var ) {}
-    virtual void Execute() {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SALOME_PYQT_Module* module = SALOME_PYQT_Module::getInitModule();
-       if ( !module )
-         module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
-       if ( module ) {
-         QVariant var =  module->preferenceProperty( myId, myProp );
-         if ( var.isValid() ) {
-           if ( var.type() == QVariant::StringList ) {
-             QStringList sl = var.asStringList();
-             if ( myIdx >= 0 && myIdx < sl.count() ) 
-               sl[myIdx] = myVar.asString();
-             else
-               sl.append( myVar.asString() );
-             module->setPreferenceProperty( myId, myProp, sl );
-           }
-           else if ( var.type() == QVariant::List ) {
-             QValueList<QVariant> vl = var.asList();
-             if ( myIdx >= 0 && myIdx < vl.count() ) 
-               vl[myIdx] = myVar;
-             else
-               vl.append( myVar );
-             module->setPreferenceProperty( myId, myProp, vl );
-           }
+    virtual void Execute()
+    {
+      SALOME_PYQT_Module* module = getActiveModule();
+      if ( module ) {
+       QVariant var =  module->preferenceProperty( myId, myProp );
+       if ( var.isValid() ) {
+         if ( var.type() == QVariant::StringList ) {
+           QStringList sl = var.toStringList();
+           if ( myIdx >= 0 && myIdx < sl.count() ) 
+             sl[myIdx] = myVar.toString();
+           else
+             sl.append( myVar.toString() );
+           module->setPreferenceProperty( myId, myProp, sl );
          }
-         else {
-           QValueList<QVariant> vl;
-           vl.append( myVar );
+         else if ( var.type() == QVariant::List ) {
+           QList<QVariant> vl = var.toList();
+           if ( myIdx >= 0 && myIdx < vl.count() ) 
+             vl[myIdx] = myVar;
+           else
+             vl.append( myVar );
            module->setPreferenceProperty( myId, myProp, vl );
          }
        }
+       else {
+         QList<QVariant> vl;
+         vl.append( myVar );
+         module->setPreferenceProperty( myId, myProp, vl );
+       }
       }
     }
   };
@@ -1650,18 +1967,22 @@ void SalomePyQt::addPreferenceProperty( const int id,
 }
 
 /*!
-  SalomePyQt::message
-  Puts the message to the Log output window
- */
+  \brief Put the message to the Log messages output window
+  \param msg message text (it can be of simple rich text format)
+  \param addSeparator boolean flag which specifies if it is necessary 
+         to separate the message with predefined separator
+*/
 void SalomePyQt::message( const QString& msg, bool addSeparator )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
     QString  myMsg;
     bool     myAddSep;
   public:
     TEvent( const QString& msg, bool addSeparator ) 
       : myMsg( msg ), myAddSep( addSeparator ) {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        LogWindow* lw = anApp->logWindow();
        if ( lw )
@@ -1673,15 +1994,16 @@ void SalomePyQt::message( const QString& msg, bool addSeparator )
 }
 
 /*!
-  SalomePyQt::clearMessages
-  Removes all the messages from the Log output window
- */
+  \brief Remove all the messages from the Log messages output window.
+*/
 void SalomePyQt::clearMessages()
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     TEvent() {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        LogWindow* lw = anApp->logWindow();
        if ( lw )
@@ -1691,3 +2013,610 @@ void SalomePyQt::clearMessages()
   };
   ProcessVoidEvent( new TEvent() );
 }
+
+/*!
+  \brief Gets window with specified identifier 
+  \internal
+  \param id window identifier 
+  \return pointer on the window
+*/
+static SUIT_ViewWindow* getWnd( const int id )
+{
+  SUIT_ViewWindow* resWnd = 0;
+
+  SalomeApp_Application* app  = getApplication();
+  if ( app )
+  {
+    STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>( app->desktop() );
+    if ( tabDesk )
+    {
+      QList<SUIT_ViewWindow*> wndlist = tabDesk->windows();
+      SUIT_ViewWindow* wnd;
+      foreach ( wnd, wndlist )
+      {
+        if ( id == wnd->getId() )
+        {
+          resWnd = wnd;
+          break;
+        }
+      }
+    }
+  }
+
+  return resWnd;
+}
+
+/*!
+  \fn QList<int> SalomePyQt::getViews()
+  \brief Get list of integer identifiers of all the currently opened views
+  \return list of integer identifiers of all the currently opened views
+*/
+
+class TGetViews: public SALOME_Event
+{
+public:
+  typedef QList<int> TResult;
+  TResult myResult;
+  TGetViews() {}
+  virtual void Execute() 
+  {
+    myResult.clear();
+    SalomeApp_Application* app  = getApplication();
+    if ( app )
+    {
+      STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>( app->desktop() );
+      if ( tabDesk )
+      {
+        QList<SUIT_ViewWindow*> wndlist = tabDesk->windows();
+        SUIT_ViewWindow* wnd;
+        foreach ( wnd, wndlist )
+          myResult.append( wnd->getId() );
+      }
+    }
+  }
+};
+QList<int> SalomePyQt::getViews()
+{
+  return ProcessEvent( new TGetViews() );
+}
+
+/*!
+  \fn int SalomePyQt::getActiveView()
+  \brief Get integer identifier of the currently active view
+  \return integer identifier of the currently active view
+*/
+
+class TGetActiveView: public SALOME_Event
+{
+public:
+  typedef int TResult;
+  TResult myResult;
+  TGetActiveView()
+    : myResult( -1 ) {}
+  virtual void Execute() 
+  {
+    SalomeApp_Application* app = getApplication();
+    if ( app )
+    {
+      SUIT_ViewManager* viewMgr = app->activeViewManager();
+      if ( viewMgr )
+      {
+        SUIT_ViewWindow* wnd = viewMgr->getActiveView();
+        if ( wnd )
+          myResult = wnd->getId();
+      }
+    }
+  }
+};
+int SalomePyQt::getActiveView()
+{
+  return ProcessEvent( new TGetActiveView() );
+}
+
+/*!                      
+  \fn QString SalomePyQt::getViewType( const int id )
+  \brief Get type of the specified view, e.g. "OCCViewer"
+  \param id window identifier
+  \return view type
+*/ 
+
+class TGetViewType: public SALOME_Event
+{
+public:
+  typedef QString TResult;
+  TResult myResult;
+  int myWndId;
+  TGetViewType( const int id )
+    : myWndId( id ) {}
+  virtual void Execute() 
+  {
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    if ( wnd )
+    {
+      SUIT_ViewManager* viewMgr = wnd->getViewManager();
+      if ( viewMgr )
+        myResult = viewMgr->getType();
+    }
+  }
+};
+QString SalomePyQt::getViewType( const int id )
+{
+  return ProcessEvent( new TGetViewType( id ) );
+}
+
+/*!
+  \fn bool SalomePyQt::setViewTitle( const int id, const QString& title )
+  \brief Change view caption  
+  \param id window identifier
+  \param title new window title
+  \return \c true if operation is completed successfully and \c false otherwise 
+*/
+
+class TSetViewTitle: public SALOME_Event
+{
+public:
+  typedef bool TResult;
+  TResult myResult;
+  int myWndId;
+  QString myTitle;
+  TSetViewTitle( const int id, const QString& title )
+    : myResult( false ),
+      myWndId( id ),
+      myTitle( title ) {}
+  virtual void Execute() 
+  {
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    if ( wnd )
+    {
+      wnd->setWindowTitle( myTitle );
+      myResult = true;
+    }
+  }
+};
+bool SalomePyQt::setViewTitle( const int id, const QString& title )
+{
+  return ProcessEvent( new TSetViewTitle( id, title ) );
+}
+
+
+/*!
+  \fn QString SalomePyQt::getViewTitle( const int id )
+  \brief Get view caption  
+  \param id window identifier
+  \return view caption  
+*/
+
+class TGetViewTitle: public SALOME_Event
+{
+public:
+  typedef QString TResult;
+  TResult myResult;
+  int myWndId;
+  TGetViewTitle( const int id )
+    : myWndId( id ) {}
+  virtual void Execute() 
+  {
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    if ( wnd )
+      myResult = wnd->windowTitle();
+  }
+};
+QString SalomePyQt::getViewTitle( const int id )
+{
+  return ProcessEvent( new TGetViewTitle( id ) );
+}
+
+/*!
+  \fn QList<int> SalomePyQt::findViews( const QString& type )
+  \brief Get list of integer identifiers of all the 
+         currently opened views of the specified type
+  \param type viewer type
+  \return list of integer identifiers 
+*/
+
+class TFindViews: public SALOME_Event
+{
+public:
+  typedef QList<int> TResult;
+  TResult myResult;
+  QString myType;
+  TFindViews( const QString& type )
+    : myType( type ) {}
+  virtual void Execute() 
+  {
+    myResult.clear();
+    SalomeApp_Application* app  = getApplication();
+    if ( app )
+    {
+      ViewManagerList vmList;
+      app->viewManagers( myType, vmList );
+      SUIT_ViewManager* viewMgr;
+      foreach ( viewMgr, vmList )
+      {
+        QVector<SUIT_ViewWindow*> vec = viewMgr->getViews();
+        for ( int i = 0, n = vec.size(); i < n; i++ )
+        {
+          SUIT_ViewWindow* wnd = vec[ i ];
+          if ( wnd )
+            myResult.append( wnd->getId() );
+        }
+      }
+    }
+  }
+};
+QList<int> SalomePyQt::findViews( const QString& type )
+{
+  return ProcessEvent( new TFindViews( type ) );
+}
+
+/*!
+  \fn bool SalomePyQt::activateView( const int id )
+  \brief Activate view
+  \param id window identifier
+  \return \c true if operation is completed successfully and \c false otherwise 
+*/
+
+class TActivateView: public SALOME_Event
+{
+public:
+  typedef bool TResult;
+  TResult myResult;
+  int myWndId;
+  TActivateView( const int id )
+    : myResult( false ),
+      myWndId( id ) {}
+  virtual void Execute() 
+  {
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    if ( wnd )
+    {
+      wnd->setFocus();
+      myResult = true;
+    }
+  }
+};
+bool SalomePyQt::activateView( const int id )
+{
+  return ProcessEvent( new TActivateView( id ) );
+}
+
+/*!
+  \fn int SalomePyQt::createView( const QString& type )
+  \brief Create new view and activate it
+  \param type viewer type
+  \return integer identifier of created view (or -1 if view could not be created)
+*/
+
+class TCreateView: public SALOME_Event
+{
+public:
+  typedef int TResult;
+  TResult myResult;
+  QString myType;
+  TCreateView( const QString& theType )
+    : myResult( -1 ),
+      myType( theType ) {}
+  virtual void Execute() 
+  {
+    SalomeApp_Application* app  = getApplication();
+    if ( app )
+    {
+      SUIT_ViewManager* viewMgr = app->createViewManager( myType );
+      if ( viewMgr )
+      {
+        SUIT_ViewWindow* wnd = viewMgr->getActiveView();
+        if ( wnd )
+          myResult = wnd->getId();
+      }
+    }
+  }
+};
+int SalomePyQt::createView( const QString& type )
+{
+  return ProcessEvent( new TCreateView( type ) );
+}
+
+/*!
+  \fn bool SalomePyQt::closeView( const int id )
+  \brief Close view
+  \param id window identifier
+  \return \c true if operation is completed successfully and \c false otherwise 
+*/
+
+class TCloseView: public SALOME_Event
+{
+public:
+  typedef bool TResult;
+  TResult myResult;
+  int myWndId;
+  TCloseView( const int id )
+    : myResult( false ),
+      myWndId( id ) {}
+  virtual void Execute() 
+  {
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    if ( wnd )
+    {
+      SUIT_ViewManager* viewMgr = wnd->getViewManager();
+      if ( viewMgr )
+      {
+        wnd->close();
+        myResult = true;
+      }
+    }
+  }
+};
+bool SalomePyQt::closeView( const int id )
+{
+  return ProcessEvent( new TCloseView( id ) );
+}
+
+/*!
+  \fn int SalomePyQt::cloneView( const int id )
+  \brief Clone view (if this operation is supported for specified view type)
+  \param id window identifier
+  \return integer identifier of the cloned view or -1 or operation could not be performed
+*/
+
+class TCloneView: public SALOME_Event
+{
+public:
+  typedef int TResult;
+  TResult myResult;
+  int myWndId;
+  TCloneView( const int id )
+    : myResult( -1 ),
+      myWndId( id ) {}
+  virtual void Execute() 
+  {
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    if ( wnd )
+    {
+      SUIT_ViewManager* viewMgr = wnd->getViewManager();
+      if ( viewMgr )
+      {
+        if ( wnd->inherits( "OCCViewer_ViewWindow" ) )
+        {
+          OCCViewer_ViewWindow* occView = (OCCViewer_ViewWindow*)( wnd );
+          occView->onCloneView();
+
+          wnd = viewMgr->getActiveView();
+          if ( wnd )
+            myResult = wnd->getId();
+        }
+        else if ( wnd->inherits( "Plot2d_ViewWindow" ) ) 
+        {
+          Plot2d_ViewManager* viewMgr2d = dynamic_cast<Plot2d_ViewManager*>( viewMgr );
+          Plot2d_ViewWindow* srcWnd2d = dynamic_cast<Plot2d_ViewWindow*>( wnd );
+          if ( viewMgr2d && srcWnd2d )
+          {
+            Plot2d_ViewWindow* resWnd = viewMgr2d->cloneView( srcWnd2d );
+            myResult = resWnd->getId();
+          }
+        }
+      }
+    }
+  }
+};
+int SalomePyQt::cloneView( const int id )
+{
+  return ProcessEvent( new TCloneView( id ) );
+}
+
+/*!
+  \fn bool SalomePyQt::isViewVisible( const int id )
+  \brief Check whether view is visible ( i.e. it is on the top of the views stack)
+  \param id window identifier
+  \return \c true if view is visible and \c false otherwise 
+*/
+
+class TIsViewVisible: public SALOME_Event
+{
+public:
+  typedef bool TResult;
+  TResult myResult;
+  int myWndId;
+  TIsViewVisible( const int id )
+    : myResult( false ),
+      myWndId( id ) {}
+  virtual void Execute() 
+  {
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    if ( wnd )
+    {
+      QWidget* p = wnd->parentWidget();
+      myResult = ( p && p->isVisibleTo( p->parentWidget() ) );
+    }
+  }
+};
+bool SalomePyQt::isViewVisible( const int id )
+{
+  return ProcessEvent( new TIsViewVisible( id ) );
+}
+  
+/*!
+  \fn bool SalomePyQt::groupAllViews()
+  \brief Group all views to the single tab area
+  \return \c true if operation is completed successfully and \c false otherwise 
+*/
+
+class TGroupAllViews: public SALOME_Event
+{
+public:
+  typedef bool TResult;
+  TResult myResult;
+  TGroupAllViews()
+    : myResult( false ) {}
+  virtual void Execute() 
+  {
+    SalomeApp_Application* app  = getApplication();
+    if ( app )
+    {
+      STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>( app->desktop() );
+      if ( tabDesk )
+      {
+        QtxWorkstack* wStack = tabDesk->workstack();
+        if ( wStack )
+        {
+          wStack->stack();
+          myResult = true;
+        }
+      }
+    }
+  }
+};
+bool SalomePyQt::groupAllViews()
+{
+  return ProcessEvent( new TGroupAllViews() );
+}
+
+/*!
+  \fn bool SalomePyQt::splitView( const int id, const Orientation ori, const Action action )
+  \brief Split tab area to which view with identifier belongs to
+  \param id window identifier
+  \param ori orientation of split operation
+  \param action action to be performed
+  \return \c true if operation is completed successfully \c false otherwise 
+*/
+
+class TSplitView: public SALOME_Event
+{
+public:
+  typedef bool TResult;
+  TResult myResult;
+  int myWndId;
+  Orientation myOri;
+  Action myAction;
+  TSplitView( const int id, 
+              const Orientation ori, 
+              const Action action )
+    : myResult( false ),
+      myWndId( id ),
+      myOri( ori ),
+      myAction( action ) {}
+  virtual void Execute() 
+  {
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    if ( wnd )
+    {
+      // activate view
+      // wnd->setFocus(); ???
+
+      // split workstack
+      if ( getApplication() )
+      {
+        STD_TabDesktop* desk = 
+          dynamic_cast<STD_TabDesktop*>( getApplication()->desktop() );
+        if ( desk )
+        {
+          QtxWorkstack* wStack = desk->workstack();
+          if ( wStack )
+          {
+            Qt::Orientation qtOri = 
+              ( myOri == Horizontal ) ? Qt::Horizontal : Qt::Vertical;
+
+            QtxWorkstack::SplitType sType;
+            if ( myAction == MoveWidget )
+              sType = QtxWorkstack::SplitMove;
+            else if ( myAction == LeaveWidget )
+              sType = QtxWorkstack::SplitStay;
+            else 
+              sType = QtxWorkstack::SplitAt;
+
+            wStack->Split( wnd, qtOri, sType );
+            myResult = true;
+          }
+        }
+      }
+    }
+  }
+};
+bool SalomePyQt::splitView( const int id, const Orientation ori, const Action action )
+{
+  return ProcessEvent( new TSplitView( id, ori, action ) );
+}
+
+/*!
+  \fn bool SalomePyQt::moveView( const int id, const int id_to, const bool before )
+  \brief Move view with the first identifier to the same area which 
+         another view with the second identifier belongs to
+  \param id source window identifier
+  \param id_to destination window identifier  
+  param before specifies whether the first viewt has to be moved before or after 
+        the second view
+  \return \c true if operation is completed successfully and \c false otherwise 
+*/
+
+class TMoveView: public SALOME_Event
+{
+public:
+  typedef bool TResult;
+  TResult myResult;
+  int myWndId;
+  int myWndToId;
+  bool myIsBefore;
+  TMoveView( const int id, const int id_to, const bool before )
+    : myResult( false ),
+    myWndId( id ),
+    myWndToId( id_to ),
+    myIsBefore( before ) {}
+  virtual void Execute() 
+  {
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    SUIT_ViewWindow* wnd_to = getWnd( myWndToId );
+    if ( wnd && wnd_to )
+    {
+      QtxWorkstack* wStack = dynamic_cast<STD_TabDesktop*>( 
+        getApplication()->desktop() )->workstack();
+      if ( wStack )
+        myResult = wStack->move( wnd, wnd_to, myIsBefore );
+    }
+  }
+};
+bool SalomePyQt::moveView( const int id, const int id_to, const bool before )
+{
+  return ProcessEvent( new TMoveView( id, id_to, before ) );
+}
+
+/*!
+  \fn QList<int> SalomePyQt::neighbourViews( const int id )
+  \brief Get list of views identifiers that belongs to the same area as 
+         specified view (excluding it)
+  \param id window identifier
+  \return list of views identifiers
+*/
+
+class TNeighbourViews: public SALOME_Event
+{
+public:
+  typedef QList<int> TResult;
+  TResult myResult;
+  int myWndId;
+  TNeighbourViews( const int id )
+    : myWndId( id ) {}
+  virtual void Execute() 
+  {
+    myResult.clear();
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    if ( wnd )
+    {
+      QtxWorkstack* wStack = dynamic_cast<STD_TabDesktop*>( 
+        getApplication()->desktop() )->workstack();
+      if ( wStack )
+      {
+        QWidgetList wgList = wStack->windowList( wnd );
+        QWidget* wg;
+        foreach ( wg, wgList )
+        {
+          SUIT_ViewWindow* tmpWnd = dynamic_cast<SUIT_ViewWindow*>( wg );
+          if ( tmpWnd && tmpWnd != wnd )
+            myResult.append( tmpWnd->getId() );
+        }
+      }
+    }
+  }
+};
+QList<int> SalomePyQt::neighbourViews( const int id )
+{
+  return ProcessEvent( new TNeighbourViews( id ) );
+}
index d160c193caab818567983583b48dbe3567c252bc..2643b2112578b040bc52c8992b3b4c9742bad814 100644 (file)
@@ -1,28 +1,33 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SalomePyQt.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-
 #ifndef SALOME_PYQT_H
 #define SALOME_PYQT_H
 
-#include <qstring.h>
-#include <qobject.h>
-#include <qcolor.h>
+#include <QObject>
+#include <QString>
+#include <QColor>
 
 #include <LightApp_Application.h>
 #include <LightApp_Preferences.h>
 class LightApp_SelectionMgr;
 class SalomeApp_Application;
 class QMenuBar;
-class QPopupMenu;
+class QMenu;
 class QWidget;
-class QtxAction;
+class QAction;
+class QtxActionGroup;
 
 class SALOME_Selection : public QObject
 {
@@ -75,6 +81,7 @@ enum {
 };
 
 enum { 
+  PT_Auto     = LightApp_Preferences::Auto,
   PT_Space    = LightApp_Preferences::Space,
   PT_Bool     = LightApp_Preferences::Bool, 
   PT_Color    = LightApp_Preferences::Color,
@@ -85,10 +92,24 @@ enum {
   PT_Double   = LightApp_Preferences::Double, 
   PT_Integer  = LightApp_Preferences::Integer, 
   PT_GroupBox = LightApp_Preferences::GroupBox, 
+  PT_Tab      = LightApp_Preferences::Tab, 
+  PT_Frame    = LightApp_Preferences::Frame, 
   PT_Font     = LightApp_Preferences::Font, 
   PT_DirList  = LightApp_Preferences::DirList, 
   PT_File     = LightApp_Preferences::File, 
-  PT_User     = LightApp_Preferences::User
+};
+
+//! Orientation
+enum Orientation {
+  Horizontal = 0, //!< Horizontal orientation 
+  Vertical   = 1  //!< Vertical orientation
+};
+
+//! Action of splitting corresponding to QtxWorkstack::SplitType enumeration
+enum Action {
+  MoveWidget   = 0, //!< move specified widget to the new area, other views stay in the previous area
+  LeaveWidget  = 1, //!< specified widget stays in the old area, all other views are moved to the new area
+  SplitAt      = 2  //!< the view area is splitted in such a way, that specified view and all views which follow it, are moved to the new area
 };
 
 class SalomePyQt
@@ -97,7 +118,8 @@ public:
   static QWidget*          getDesktop();
   static QWidget*          getMainFrame();
   static QMenuBar*         getMainMenuBar();
-  static QPopupMenu*       getPopupMenu( const MenuName );
+  static QMenu*            getPopupMenu( const MenuName );
+  static QMenu*            getPopupMenu( const QString& );
   static SALOME_Selection* getSelection();
   static int               getStudyId();
   static void              putInfo( const QString&, const int = 0 );
@@ -117,33 +139,32 @@ public:
   static int               createTool( const QString& );
   static int               createTool( const int,  const int,      const int = -1 );
   static int               createTool( const int,  const QString&, const int = -1 );
-  static int               createTool( QtxAction*, const int,      const int = -1, const int = -1 );
-  static int               createTool( QtxAction*, const QString&, const int = -1, const int = -1 );
+  static int               createTool( QAction*, const int,      const int = -1, const int = -1 );
+  static int               createTool( QAction*, const QString&, const int = -1, const int = -1 );
 
   static int               createMenu( const QString&, const int = -1,
                                       const int = -1, const int = -1, const int = -1 );
-  static int               createMenu( const QString&, const QString& = QString::null
+  static int               createMenu( const QString&, const QString& = QString()
                                       const int = -1, const int = -1, const int = -1 );
   static int               createMenu( const int,      const int = -1,
                                       const int = -1, const int = -1 );
-  static int               createMenu( const int,      const QString& = QString::null
+  static int               createMenu( const int,      const QString& = QString()
                                       const int = -1, const int = -1 );
-  static int               createMenu( QtxAction*,     const int,      const int = -1, 
+  static int               createMenu( QAction*,     const int,      const int = -1, 
                                       const int = -1, const int = -1 );
-  static int               createMenu( QtxAction*,     const QString&, const int = -1, 
+  static int               createMenu( QAction*,     const QString&, const int = -1, 
                                       const int = -1, const int = -1 );
 
-  static QtxAction*        createSeparator();
-
-  static QtxAction*        createAction( const int, const QString&,
-                                        const QString& = QString::null, const QString& = QString::null, 
-                                        const QString& = QString::null, const int = 0, const bool = false );
+  static QAction*          createSeparator();
 
-  static QtxAction*        action( const int );
-  static int               actionId( const QtxAction* );
+  static QAction*          createAction( const int, const QString&,
+                                        const QString& = QString(), const QString& = QString(), 
+                                        const QString& = QString(), const int = 0, const bool = false );
+  
+  static QtxActionGroup*   createActionGroup( const int, const bool = true );
 
-  static bool              clearMenu( const int = 0, const int = 0,
-                                     const bool = true );
+  static QAction*          action( const int );
+  static int               actionId( const QAction* );
 
   static void              addSetting    ( const QString&, const QString&, const double );
   static void              addSetting    ( const QString&, const QString&, const int );
@@ -168,9 +189,9 @@ public:
   static int               addGlobalPreference( const QString& );
   static int               addPreference( const QString& );
   static int               addPreference( const QString&,
-                                          const int, const int = -1,
-                                          const QString& = QString::null,
-                                         const QString& = QString::null );
+                                          const int, const int = PT_Auto,
+                                          const QString& = QString(),
+                                         const QString& = QString() );
   static QVariant          preferenceProperty( const int, const QString& );
   static void              setPreferenceProperty( const int, 
                                                   const QString&,
@@ -182,6 +203,23 @@ public:
 
   static void              message( const QString&, bool = true );
   static void              clearMessages();
+  
+  static QList<int>        getViews();
+  static int               getActiveView();
+  static QString           getViewType( const int );
+  static bool              setViewTitle( const int, const QString& );
+  static QString           getViewTitle( const int );
+  static QList<int>        findViews( const QString& );
+  static bool              activateView( const int );
+  static int               createView( const QString& );
+  static bool              closeView( const int );
+  static int               cloneView( const int );
+  static bool              isViewVisible( const int id );
+  
+  static bool              groupAllViews();
+  static bool              splitView( const int, const Orientation, const Action );
+  static bool              moveView( const int, const int, const bool );
+  static QList<int>        neighbourViews( const int );
 };
 
 #endif // SALOME_PYQT_H
index f73f7b0ea0e5db98789cf3b46c528ec5d06b4d24..b4ff564440a1ab63f584d1aa189c472425d5b87b 100644 (file)
@@ -1,26 +1,50 @@
-//=============================================================================
-// File      : SalomePyQt.sip
-// Created   : 25/04/05
-// Author    : Vadim SANDLER
-// Project   : SALOME
-// Copyright : 2003-2005 CEA/DEN, EDF R&D
-// $Header   : $
-//=============================================================================
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SalomePyQt.sip
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
 
 %Module SalomePyQt
 
-%Import qtmod.sip
+%Import QtGuimod.sip
+%Import QtXmlmod.sip
+
+%ExportedHeaderCode
+#include <QtxAction.h>
+#include <QtxActionSet.h>
+#include <QtxActionGroup.h>
+#include <SalomePyQt.h>
+%End
 
 class SALOME_Selection : QObject
 {
-%HeaderCode
+%TypeHeaderCode
 #include <SalomePyQt.h>
 %End
 
 public:
-  void Clear();
-  void ClearIObjects();
-  void ClearFilters();
+  void Clear() /ReleaseGIL/ ;
+  void ClearIObjects() /ReleaseGIL/ ;
+  void ClearFilters() /ReleaseGIL/ ;
 
 private:
   SALOME_Selection( QObject* /TransferThis/ );
@@ -47,6 +71,7 @@ enum WindowType {
 };
 
 enum PrefType { 
+  PT_Auto,
   PT_Space,
   PT_Bool, 
   PT_Color,
@@ -57,115 +82,230 @@ enum PrefType {
   PT_Double, 
   PT_Integer, 
   PT_GroupBox, 
+  PT_Tab, 
+  PT_Frame, 
   PT_Font, 
   PT_DirList, 
   PT_File, 
-  PT_User
 };
 
-class QtxAction : QAction
+enum Orientation {
+  Horizontal = 0, 
+  Vertical   = 1  
+};
+
+enum Action {
+  MoveWidget   = 0, 
+  LeaveWidget  = 1, 
+  SplitAt      = 2  
+};
+
+class QtxAction : QWidgetAction
 {
 %TypeHeaderCode
 #include <QtxAction.h>
 %End
 
+%ConvertToSubClassCode
+    if ( qobject_cast<QtxAction*>( sipCpp ) )
+      sipClass = sipClass_QtxAction;
+    else
+      sipClass = NULL;
+%End
+
+public:
+  explicit QtxAction( QObject* /TransferThis/ = 0, bool = false );
+  QtxAction( const QString&, const QString&, int, QObject* /TransferThis/, bool = false );
+  QtxAction( const QString&, const QIcon&, const QString&, int, QObject* /TransferThis/, bool = false );
+  virtual ~QtxAction();
+
+private:
+  QtxAction( const QtxAction& );
+};
+
+class QtxActionSet : QtxAction
+{
+%TypeHeaderCode
+#include <QtxActionSet.h>
+%End
+
+%ConvertToSubClassCode
+    if ( qobject_cast<QtxActionSet*>( sipCpp ) )
+      sipClass = sipClass_QtxActionSet;
+    else
+      sipClass = NULL;
+%End
+
+public:
+  explicit QtxActionSet( QObject* /TransferThis/ = 0 );
+  virtual ~QtxActionSet();
+
+  QList<QAction*> actions() const;
+  void            setActions( const QList<QAction*>& );
+
+  void            insertActions( const QList<QAction*>&, const int = -1 );
+
+  int             insertAction( QAction*, const int id = -1, const int = -1 );
+  int             insertAction( const QString&, const int id = -1, const int = -1 );
+  int             insertAction( const QString&, const QIcon&, const int id = -1, const int = -1 );
+
+  void            removeAction( QAction* );
+  void            removeAction( const int );
+
+  void            clear();
+
+signals:
+  void            triggered( int );
+  void            triggered( QAction* );
+
+private:
+  QtxActionSet( const QtxActionSet& );
+};
+
+class QtxActionGroup : QtxActionSet
+{
+%TypeHeaderCode
+#include <QtxActionGroup.h>
+%End
+
+%ConvertToSubClassCode
+    if ( qobject_cast<QtxActionGroup*>( sipCpp ) )
+      sipClass = sipClass_QtxActionGroup;
+    else
+      sipClass = NULL;
+%End
+
+public:
+  explicit QtxActionGroup( QObject* /TransferThis/ = 0 );
+  QtxActionGroup( QObject* /TransferThis/, const bool );
+  virtual ~QtxActionGroup();
+
+  bool isExclusive() const;
+  bool usesDropDown() const;
+
+  void add( QAction* );
+
+public slots:
+  void setExclusive( const bool );
+  void setUsesDropDown( const bool );
+
+signals:
+  void selected( QAction* );
+
 private:
-  QtxAction(const QtxAction &);
+  QtxActionGroup( const QtxActionGroup& );
 };
 
 class SalomePyQt
 {
-%HeaderCode
+%TypeHeaderCode
 #include <SalomePyQt.h>
 %End
 
 public:
-  static QWidget*          getDesktop();
-  static QWidget*          getMainFrame();
-  static QMenuBar*         getMainMenuBar();
-  static QPopupMenu*       getPopupMenu( const MenuName );
-  static SALOME_Selection* getSelection() /Factory/;
-  static int               getStudyId();
-  static void              putInfo( const QString&, int = 0 );
-  static const QString     getActiveComponent();
-  static void              updateObjBrowser( int = 0, bool = true );
+  static QWidget*          getDesktop() /ReleaseGIL/ ;
+  static QWidget*          getMainFrame() /ReleaseGIL/ ;
+  static QMenuBar*         getMainMenuBar() /ReleaseGIL/ ;
+  static QMenu*            getPopupMenu( const MenuName ) /ReleaseGIL/ ;
+  static QMenu*            getPopupMenu( const QString& ) /ReleaseGIL/ ;
+  static SALOME_Selection* getSelection() /Factory,ReleaseGIL/ ;
+  static int               getStudyId() /ReleaseGIL/ ;
+  static void              putInfo( const QString&, const int = 0 ) /ReleaseGIL/ ;
+  static const QString     getActiveComponent() /ReleaseGIL/ ;
+  static void              updateObjBrowser( const int = 0, bool = true ) /ReleaseGIL/ ;
 
-  static QString           getFileName         ( QWidget*, const QString&, const QStringList&, const QString&, bool );
-  static QStringList       getOpenFileNames    ( QWidget*, const QString&, const QStringList&, const QString& );
-  static QString           getExistingDirectory( QWidget*, const QString&, const QString& );
+  static QString           getFileName         ( QWidget*, const QString&, const QStringList&, const QString&, bool ) /ReleaseGIL/ ;
+  static QStringList       getOpenFileNames    ( QWidget*, const QString&, const QStringList&, const QString& ) /ReleaseGIL/ ;
+  static QString           getExistingDirectory( QWidget*, const QString&, const QString& ) /ReleaseGIL/ ;
 
-  static void              helpContext( const QString&, const QString& );
+  static void              helpContext( const QString&, const QString& ) /ReleaseGIL/ ;
 
-  static bool              dumpView( const QString& );
+  static bool              dumpView( const QString& ) /ReleaseGIL/ ;
 
-  static int               defaultMenuGroup();
+  static int               defaultMenuGroup() /ReleaseGIL/ ;
 
-  static int               createTool( const QString& );
-  static int               createTool( const int,  const int,      int = -1 );
-  static int               createTool( const int,  const QString&, int = -1 );
-  static int               createTool( QtxAction*, const int,      int = -1, int = -1 );
-  static int               createTool( QtxAction*, const QString&, int = -1, int = -1 );
+  static int               createTool( const QString& ) /ReleaseGIL/ ;
+  static int               createTool( const int,  const int,      const int = -1 ) /ReleaseGIL/ ;
+  static int               createTool( const int,  const QString&, const int = -1 ) /ReleaseGIL/ ;
+  static int               createTool( QAction*,   const int,      const int = -1, const int = -1 ) /ReleaseGIL/ ;
+  static int               createTool( QAction*,   const QString&, const int = -1, const int = -1 ) /ReleaseGIL/ ;
 
   static int               createMenu( const QString&, const int,
-                                      int = -1, int = -1, int = -1 );
+                                      const int = -1, const int = -1, const int = -1 ) /ReleaseGIL/ ;
   static int               createMenu( const QString&, const QString&, 
-                                      int = -1, int = -1, int = -1 );
+                                      const int = -1, const int = -1, const int = -1 ) /ReleaseGIL/ ;
   static int               createMenu( const int,      const int,
-                                      int = -1,       int = -1 );
+                                      const int = -1, const int = -1 ) /ReleaseGIL/ ;
   static int               createMenu( const int,      const QString&, 
-                                      int = -1,       int = -1 );
-  static int               createMenu( QtxAction*,     const int,      int = -1, 
-                                      int = -1,       int = -1 );
-  static int               createMenu( QtxAction*,     const QString&, int = -1, 
-                                      int = -1,       int = -1 );
-
-  static QtxAction*        createSeparator();
-
-  static QtxAction*        createAction( const int, const QString&, 
-                                        const QString& = QString::null, const QString& = QString::null, 
-                                        const QString& = QString::null, int = 0, bool = false );
-
-  static QtxAction*        action( const int );
-  static int               actionId( const QtxAction* );
-
-  static bool              clearMenu( int = 0, int = 0,
-                                     bool = true  );
-
-  static void              addSetting    ( const QString&, const QString&, const double );
-  static void              addSetting    ( const QString&, const QString&, const int /Constrained/ );
-  static void              addSetting    ( const QString&, const QString&, const bool, const int );
-  static void              addSetting    ( const QString&, const QString&, const QString& );
-  static void              addSetting    ( const QString&, const QString&, const QColor& );
-  static int               integerSetting( const QString&, const QString&, int = 0 );
-  static double            doubleSetting ( const QString&, const QString&, double = 0 );
-  static bool              boolSetting   ( const QString&, const QString&, bool = false );
-  static QString           stringSetting ( const QString&, const QString&, const QString& = QString("") );
-  static QColor            colorSetting  ( const QString&, const QString&, const QColor& = QColor() );
-  static void              removeSetting ( const QString&, const QString& );
-  static bool              hasSetting    ( const QString&, const QString& );
+                                      const int = -1, const int = -1 ) /ReleaseGIL/ ;
+  static int               createMenu( QAction*,       const int,      const int = -1, 
+                                      const int = -1, const int = -1 ) /ReleaseGIL/ ;
+  static int               createMenu( QAction*,       const QString&, const int = -1, 
+                                      const int = -1, const int = -1 ) /ReleaseGIL/ ;
+  static QAction*          createSeparator() /ReleaseGIL/ ;
+
+  static QAction*          createAction( const int, const QString&, 
+                                        const QString& = QString(), const QString& = QString(), 
+                                        const QString& = QString(), const int = 0, const bool = false ) /ReleaseGIL/ ;
+
+  static QtxActionGroup*   createActionGroup( const int, const bool = true ) /ReleaseGIL/ ;
+
+  static QAction*          action( const int ) /ReleaseGIL/ ;
+  static int               actionId( const QAction* ) /ReleaseGIL/ ;
+
+  static void              addSetting    ( const QString&, const QString&, const double ) /ReleaseGIL/ ;
+  static void              addSetting    ( const QString&, const QString&, const int /Constrained/ ) /ReleaseGIL/ ;
+  static void              addSetting    ( const QString&, const QString&, const bool, const int ) /ReleaseGIL/ ;
+  static void              addSetting    ( const QString&, const QString&, const QString& ) /ReleaseGIL/ ;
+  static void              addSetting    ( const QString&, const QString&, const QColor& ) /ReleaseGIL/ ;
+  static int               integerSetting( const QString&, const QString&, const int = 0 ) /ReleaseGIL/ ;
+  static double            doubleSetting ( const QString&, const QString&, const double = 0 ) /ReleaseGIL/ ;
+  static bool              boolSetting   ( const QString&, const QString&, const bool = false ) /ReleaseGIL/ ;
+  static QString           stringSetting ( const QString&, const QString&, const QString& = QString("") ) /ReleaseGIL/ ;
+  static QColor            colorSetting  ( const QString&, const QString&, const QColor& = QColor() ) /ReleaseGIL/ ;
+  static void              removeSetting ( const QString&, const QString& ) /ReleaseGIL/ ;
+  static bool              hasSetting    ( const QString&, const QString& ) /ReleaseGIL/ ;
 
 // obsolete
-  static void              addStringSetting( const QString&, const QString&, bool = true );
-  static void              addIntSetting   ( const QString&, const int,      bool = true );
-  static void              addDoubleSetting( const QString&, const double,   bool = true );
-  static void              addBoolSetting  ( const QString&, const bool,     bool = true );
-  static void              removeSettings  ( const QString& );
-  static QString           getSetting      ( const QString& );
-
-  static int               addGlobalPreference( const QString& );
-  static int               addPreference( const QString& );
-  static int               addPreference( const QString&, const int, int = -1,
-                                         const QString& = QString::null,
-                                         const QString& = QString::null );
-  static QVariant          preferenceProperty( const int, const QString& );
+  static void              addStringSetting( const QString&, const QString&, bool = true ) /ReleaseGIL/ ;
+  static void              addIntSetting   ( const QString&, const int,      bool = true ) /ReleaseGIL/ ;
+  static void              addDoubleSetting( const QString&, const double,   bool = true ) /ReleaseGIL/ ;
+  static void              addBoolSetting  ( const QString&, const bool,     bool = true ) /ReleaseGIL/ ;
+  static void              removeSettings  ( const QString& ) /ReleaseGIL/ ;
+  static QString           getSetting      ( const QString& ) /ReleaseGIL/ ;
+
+  static int               addGlobalPreference( const QString& ) /ReleaseGIL/ ;
+  static int               addPreference( const QString& ) /ReleaseGIL/ ;
+  static int               addPreference( const QString&,
+                                          const int, const int = PT_Auto,
+                                          const QString& = QString(),
+                                         const QString& = QString() ) /ReleaseGIL/ ;
+  static QVariant          preferenceProperty( const int, const QString& ) /ReleaseGIL/ ;
   static void              setPreferenceProperty( const int, 
                                                   const QString&,
-                                                 const QVariant& );
+                                                  const QVariant& ) /ReleaseGIL/ ;
   static void              addPreferenceProperty( const int, 
-                                                  const QString&,
+                                                  const QString&, 
                                                  const int, 
-                                                 const QVariant& );
+                                                 const QVariant& ) /ReleaseGIL/ ;
 
-  static void              message( const QString&, bool = true );
-  static void              clearMessages();
+  static void              message( const QString&, bool = true ) /ReleaseGIL/ ;
+  static void              clearMessages() /ReleaseGIL/ ;
+  
+  static QList<int>        getViews() /ReleaseGIL/ ;
+  static int               getActiveView() /ReleaseGIL/ ;
+  static QString           getViewType( const int ) /ReleaseGIL/ ;
+  static bool              setViewTitle( const int, const QString& ) /ReleaseGIL/ ;
+  static QString           getViewTitle( const int ) /ReleaseGIL/ ;
+  static QList<int>        findViews( const QString& ) /ReleaseGIL/ ;
+  static bool              activateView( const int ) /ReleaseGIL/ ;
+  static int               createView( const QString& ) /ReleaseGIL/ ;
+  static bool              closeView( const int ) /ReleaseGIL/ ;
+  static int               cloneView( const int ) /ReleaseGIL/ ;
+  static bool              isViewVisible( const int id ) /ReleaseGIL/ ;
+  
+  static bool              groupAllViews() /ReleaseGIL/ ;
+  static bool              splitView( const int, Orientation, Action ) /ReleaseGIL/ ;
+  static bool              moveView( const int, const int, const bool ) /ReleaseGIL/ ;
+  static QList<int>        neighbourViews( const int ) /ReleaseGIL/ ;
 };
diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip b/src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip
deleted file mode 100644 (file)
index 9141936..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-//=============================================================================
-// File      : SalomePyQt_v4.sip
-// Created   : 25/04/05
-// Author    : Vadim SANDLER
-// Project   : SALOME
-// Copyright : 2003-2005 CEA/DEN, EDF R&D
-// $Header   : $
-//=============================================================================
-
-%Module SalomePyQt
-
-%Import qtmod.sip
-
-%ExportedHeaderCode
-#include <SalomePyQt.h>
-%End
-
-class SALOME_Selection : QObject
-{
-%TypeHeaderCode
-#include <SalomePyQt.h>
-%End
-
-public:
-  void Clear() /ReleaseGIL/ ;
-  void ClearIObjects() /ReleaseGIL/ ;
-  void ClearFilters() /ReleaseGIL/ ;
-
-private:
-  SALOME_Selection( QObject* /TransferThis/ );
-
-signals:
-  void currentSelectionChanged();
-};
-
-//%ExportedHeaderCode
-
-enum MenuName {
-  File        = 1,
-  View        = 2,
-  Edit        = 3,
-  Preferences = 4,
-  Tools       = 5,
-  Window      = 6,
-  Help        = 7  
-};
-
-enum WindowType {
-  WT_ObjectBrowser,
-  WT_PyConsole,
-  WT_LogWindow,
-  WT_User
-};
-
-enum PrefType { 
-  PT_Space,
-  PT_Bool, 
-  PT_Color,
-  PT_String, 
-  PT_Selector, 
-  PT_DblSpin, 
-  PT_IntSpin, 
-  PT_Double, 
-  PT_Integer, 
-  PT_GroupBox, 
-  PT_Font, 
-  PT_DirList, 
-  PT_File, 
-  PT_User
-};
-
-//%End
-
-class QtxAction : QAction
-{
-%TypeHeaderCode
-#include <QtxAction.h>
-%End
-private:
-  QtxAction(const QtxAction &);
-};
-
-class SalomePyQt
-{
-%TypeHeaderCode
-#include <SalomePyQt.h>
-%End
-
-public:
-  static QWidget*          getDesktop() /ReleaseGIL/ ;
-  static QWidget*          getMainFrame() /ReleaseGIL/ ;
-  static QMenuBar*         getMainMenuBar() /ReleaseGIL/ ;
-  static QPopupMenu*       getPopupMenu( const MenuName ) /ReleaseGIL/ ;
-  static SALOME_Selection* getSelection() /Factory,ReleaseGIL/ ;
-  static int               getStudyId() /ReleaseGIL/ ;
-  static void              putInfo( const QString&, const int = 0 ) /ReleaseGIL/ ;
-  static const QString     getActiveComponent() /ReleaseGIL/ ;
-  static void              updateObjBrowser( const int = 0, bool = true ) /ReleaseGIL/ ;
-
-  static QString           getFileName         ( QWidget*, const QString&, const QStringList&, const QString&, bool ) /ReleaseGIL/ ;
-  static QStringList       getOpenFileNames    ( QWidget*, const QString&, const QStringList&, const QString& ) /ReleaseGIL/ ;
-  static QString           getExistingDirectory( QWidget*, const QString&, const QString& ) /ReleaseGIL/ ;
-
-  static void              helpContext( const QString&, const QString& ) /ReleaseGIL/ ;
-
-  static bool              dumpView( const QString& ) /ReleaseGIL/ ;
-
-  static int               defaultMenuGroup() /ReleaseGIL/ ;
-
-  static int               createTool( const QString& ) /ReleaseGIL/ ;
-  static int               createTool( const int,  const int,      const int = -1 ) /ReleaseGIL/ ;
-  static int               createTool( const int,  const QString&, const int = -1 ) /ReleaseGIL/ ;
-  static int               createTool( QtxAction*, const int,      const int = -1, const int = -1 ) /ReleaseGIL/ ;
-  static int               createTool( QtxAction*, const QString&, const int = -1, const int = -1 ) /ReleaseGIL/ ;
-
-  static int               createMenu( const QString&, const int,
-                                      const int = -1, const int = -1, const int = -1 ) /ReleaseGIL/ ;
-  static int               createMenu( const QString&, const QString&, 
-                                      const int = -1, const int = -1, const int = -1 ) /ReleaseGIL/ ;
-  static int               createMenu( const int,      const int,
-                                      const int = -1, const int = -1 ) /ReleaseGIL/ ;
-  static int               createMenu( const int,      const QString&, 
-                                      const int = -1, const int = -1 ) /ReleaseGIL/ ;
-  static int               createMenu( QtxAction*,     const int,      const int = -1, 
-                                      const int = -1, const int = -1 ) /ReleaseGIL/ ;
-  static int               createMenu( QtxAction*,     const QString&, const int = -1, 
-                                      const int = -1, const int = -1 ) /ReleaseGIL/ ;
-  static QtxAction*        createSeparator() /ReleaseGIL/ ;
-
-  static QtxAction*        createAction( const int, const QString&, 
-                                        const QString& = QString::null, const QString& = QString::null, 
-                                        const QString& = QString::null, const int = 0, const bool = false ) /ReleaseGIL/ ;
-
-  static QtxAction*        action( const int ) /ReleaseGIL/ ;
-  static int               actionId( const QtxAction* ) /ReleaseGIL/ ;
-
-  static bool              clearMenu( const int = 0, const int = 0,
-                                     const bool = true ) /ReleaseGIL/ ;
-
-  static void              addSetting    ( const QString&, const QString&, const double ) /ReleaseGIL/ ;
-  static void              addSetting    ( const QString&, const QString&, const int /Constrained/ ) /ReleaseGIL/ ;
-  static void              addSetting    ( const QString&, const QString&, const bool, const int ) /ReleaseGIL/ ;
-  static void              addSetting    ( const QString&, const QString&, const QString& ) /ReleaseGIL/ ;
-  static void              addSetting    ( const QString&, const QString&, const QColor& ) /ReleaseGIL/ ;
-  static int               integerSetting( const QString&, const QString&, const int = 0 ) /ReleaseGIL/ ;
-  static double            doubleSetting ( const QString&, const QString&, const double = 0 ) /ReleaseGIL/ ;
-  static bool              boolSetting   ( const QString&, const QString&, const bool = false ) /ReleaseGIL/ ;
-  static QString           stringSetting ( const QString&, const QString&, const QString& = QString("") ) /ReleaseGIL/ ;
-  static QColor            colorSetting  ( const QString&, const QString&, const QColor& = QColor() ) /ReleaseGIL/ ;
-  static void              removeSetting ( const QString&, const QString& ) /ReleaseGIL/ ;
-  static bool              hasSetting    ( const QString&, const QString& ) /ReleaseGIL/ ;
-
-// obsolete
-  static void              addStringSetting( const QString&, const QString&, bool = true ) /ReleaseGIL/ ;
-  static void              addIntSetting   ( const QString&, const int,      bool = true ) /ReleaseGIL/ ;
-  static void              addDoubleSetting( const QString&, const double,   bool = true ) /ReleaseGIL/ ;
-  static void              addBoolSetting  ( const QString&, const bool,     bool = true ) /ReleaseGIL/ ;
-  static void              removeSettings  ( const QString& ) /ReleaseGIL/ ;
-  static QString           getSetting      ( const QString& ) /ReleaseGIL/ ;
-
-  static int               addGlobalPreference( const QString& ) /ReleaseGIL/ ;
-  static int               addPreference( const QString& ) /ReleaseGIL/ ;
-  static int               addPreference( const QString&,
-                                          const int, const int = -1,
-                                          const QString& = QString::null,
-                                         const QString& = QString::null ) /ReleaseGIL/ ;
-  static QVariant          preferenceProperty( const int, const QString& ) /ReleaseGIL/ ;
-  static void              setPreferenceProperty( const int, 
-                                                  const QString&,
-                                                  const QVariant& ) /ReleaseGIL/ ;
-  static void              addPreferenceProperty( const int, 
-                                                  const QString&, 
-                                                 const int, 
-                                                 const QVariant& ) /ReleaseGIL/ ;
-
-  static void              message( const QString&, bool = true ) /ReleaseGIL/ ;
-  static void              clearMessages() /ReleaseGIL/ ;
-};
-
index 404ee4dfc8b1c2166bd8e634c2edf7a4490ee6fa..1de235ea2f4a3b263d84d3676ba3e053520d522b 100755 (executable)
@@ -1,29 +1,29 @@
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-#  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Help.py
 #  Author : Paul RASCLE, EDF
 #  Module : SALOME
 #  $Header$
-
+#
 class SalomeDoc:
     def __init__(self, aDoc):
         self.doc = aDoc
index f5a184e4296bf0a6465c7244fb601aabf40424d8..7719d37a1fc6e52206dee041adbc9d3507a33605 100755 (executable)
@@ -1,29 +1,29 @@
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Paul RASCLE, EDF
 #  Module : SALOME
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 # ===============================================================
@@ -33,8 +33,7 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 #
 # Step 1: build the wrapping source files with swig
 #
-# libSALOME_LifeCycleCORBA.i -- swig --> swig_wrap.cpp
-#                                        libSALOME_Swig.py
+# libSALOME_Swig.i -- swig --> swig_wrap.cpp libSALOME_Swig.py
 #
 # Step 2: build the dynamic library from cpp built source files and
 #         dependant libraries.
@@ -43,47 +42,44 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 #                          +              |
 #                          dependant libs |
 #
-# The file libSALOME_Swigcmodule.py will be installed in
-# <prefix>/lib/python<version>/site-package/salome.
-# The library will be installed in the same place.
+# The file libSALOME_Swig.py will be installed in the
+# <prefix>/lib/python<version>/site-package/salome folder.
+# The library _libSALOME_Swig.so will be installed in 
+# the <prefix>/lib/salome folder.
 #
 
-# this option puts it to dist
-#BUILT_SOURCES = swig_wrap.cpp
-
 SWIG_FLAGS    = @SWIG_FLAGS@ -I$(srcdir)
 SWIG_SOURCES  = libSALOME_Swig.i
 
-nodist_pkgpython_DATA = libSALOME_Swig.py
 libSALOME_Swig.py: swig_wrap.cpp
 
 # library
-lib_LTLIBRARIES = libSALOME_Swigcmodule.la
-libSALOME_Swigcmodule_la_SOURCES  = $(BUILT_SOURCES) $(SWIG_SOURCES) SALOMEGUI_Swig.cxx
-nodist_libSALOME_Swigcmodule_la_SOURCES = swig_wrap.cpp
-salomeinclude_HEADERS= SALOMEGUI_Swig.hxx SALOMEGUI_Swig.i
-
-libSALOME_Swigcmodule_la_CPPFLAGS =\
-       $(QT_INCLUDES) $(PYTHON_INCLUDES) $(CAS_CPPFLAGS) $(VTK_INCLUDES) \
-       $(OGL_INCLUDES) $(BOOST_CPPFLAGS) -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ \
-       -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl \
-       -I$(srcdir)/../SalomeApp -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT \
-       -I$(srcdir)/../ObjBrowser -I$(srcdir)/../LightApp -I$(srcdir)/../SOCC \
-       -I$(srcdir)/../SVTK -I$(srcdir)/../Event -I$(srcdir)/../OBJECT \
-       -I$(srcdir)/../CAM -I$(srcdir)/../STD -I$(srcdir)/../OCCViewer \
-       -I$(srcdir)/../Prs -I$(srcdir)/../VTKViewer -I$(srcdir)/../SPlot2d \
-       -I$(srcdir)/../Plot2d \
+lib_LTLIBRARIES = _libSALOME_Swig.la
+_libSALOME_Swig_la_SOURCES = $(SWIG_SOURCES) SALOMEGUI_Swig.cxx
+nodist__libSALOME_Swig_la_SOURCES = swig_wrap.cpp
+salomeinclude_HEADERS = $(SWIG_SOURCES) SALOMEGUI_Swig.hxx SALOMEGUI_Swig.i
+
+_libSALOME_Swig_la_CPPFLAGS = \
+       $(QT_INCLUDES) $(QWT_INCLUDES) $(PYTHON_INCLUDES) $(CAS_CPPFLAGS) $(VTK_INCLUDES)       \
+       $(OGL_INCLUDES) $(BOOST_CPPFLAGS) -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@                     \
+       -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl -I$(srcdir)                     \
+       -I$(srcdir)/../SalomeApp -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT                         \
+       -I$(srcdir)/../ObjBrowser -I$(srcdir)/../LightApp -I$(srcdir)/../SOCC                   \
+       -I$(srcdir)/../SVTK -I$(srcdir)/../Event -I$(srcdir)/../OBJECT                          \
+       -I$(srcdir)/../CAM -I$(srcdir)/../STD -I$(srcdir)/../OCCViewer                          \
+       -I$(srcdir)/../Prs -I$(srcdir)/../VTKViewer -I$(srcdir)/../SPlot2d                      \
+       -I$(srcdir)/../Plot2d                                                                   \
        @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
 
-libSALOME_Swigcmodule_la_LDFLAGS  = -module
-libSALOME_Swigcmodule_la_LIBADD   = \
-       ../SalomeApp/libSalomeApp.la \
+_libSALOME_Swig_la_LDFLAGS  = -module
+_libSALOME_Swig_la_LIBADD   =          \
+       ../SalomeApp/libSalomeApp.la    \
        @PYTHON_LIBS@
 
 swig_wrap.cpp : $(SWIG_SOURCES)
        $(SWIG) $(SWIG_FLAGS) -o $@ $<
 
-CLEANFILES = swig_wrap.cpp
+CLEANFILES = swig_wrap.cpp libSALOME_Swig.py
 
 #
 # ===============================================================
@@ -92,25 +88,16 @@ CLEANFILES = swig_wrap.cpp
 #
 
 # Scripts to be installed.
-dist_salomescript_DATA= \
-       examplevtk1.py \
-       test_table.py \
-       test_big_table.py \
-       test_many_objects.py \
-       test_remove_ref.py \
-       libSALOME_Swig.py
-
-nodist_salomescript_DATA= \
-       supervisionexample.py \
+dist_salomescript_DATA =       \
+       examplevtk1.py          \
+       test_table.py           \
+       test_big_table.py       \
+       test_many_objects.py    \
+       test_remove_ref.py
+
+nodist_salomescript_DATA =             \
+       libSALOME_Swig.py               \
+       supervisionexample.py           \
        supervisiongeomexample.py
 
-EXTRA_DIST+= \
-       supervisionexample.py.in \
-       supervisiongeomexample.py.in
-
-sharedpkgpython_PYTHON= SALOMEGUI_shared_modules.py
-
-install-exec-hook: $(libdir)/_libSALOME_Swig.so
-
-$(libdir)/_libSALOME_Swig.so:
-       (cd $(libdir); ln -sf libSALOME_Swigcmodule.so _libSALOME_Swig.so;)
+sharedpkgpython_PYTHON = SALOMEGUI_shared_modules.py
index 3e0133d894efee6120f6bd7969dccefb6a906ca6..311c4b391f8ef017189c0ae8e53d85bb0e4a438f 100755 (executable)
@@ -1,29 +1,29 @@
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-#  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : PyInterp.py
 #  Author : Paul RASCLE, EDF
 #  Module : SALOME
 #  $Header$
-
+#
 import sys
 from omniORB import CORBA
 from LifeCycleCORBA import *
index d56fafe083388b288bd2ffa72256a0b72d80d327..51e670e468a96498952894e1a9e0bce87f501442 100644 (file)
@@ -1,72 +1,95 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+// File   : SALOMEGUI_Swig.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : SALOMEGUI_Swig.cxx
-//  Author : Vadim SANDLER
-//  Module : SALOME
-//  $Header$
-
 #include "SALOMEGUI_Swig.hxx"
 
-#include "SUIT_Session.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_DataObjectIterator.h"
-#include "OB_Browser.h"
-#include "SalomeApp_Application.h"
-#include "SalomeApp_Study.h"
-#include "SalomeApp_Module.h"
-#include "SalomeApp_DataObject.h"
-#include "LightApp_SelectionMgr.h"
-#include "SALOME_Prs.h"
-#include "SOCC_ViewModel.h"
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SOCC_ViewWindow.h"
-#include "SPlot2d_ViewWindow.h"
-
-#include "SALOME_Event.hxx"
-#include "SALOME_ListIO.hxx"
-#include "SALOME_InteractiveObject.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
-
-//#include "utilities.h"
+#include <SUIT_Session.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_ViewWindow.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_DataObjectIterator.h>
+#include <CAM_DataModel.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SalomeApp_Module.h>
+#include <SalomeApp_DataObject.h>
+#include <LightApp_SelectionMgr.h>
+#include <LightApp_DataOwner.h>
+#include <SALOME_Prs.h>
+#include <SOCC_ViewModel.h>
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SOCC_ViewWindow.h>
+#include <SPlot2d_ViewWindow.h>
+
+#include <SALOME_Event.h>
+#include <SALOME_ListIO.hxx>
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
+
+/*!
+  \class SALOMEGUI_Swig
+  \brief Python interface module for SALOME GUI.
+
+  This module provides an access to the SALOME GUI implementing set of functions
+  which can be used from Python. This module is implemented using SWIG wrappings
+  for some GUI functionality:
+  - getActiveStudyId(), getActiveStudyName() : get active study identifier and name
+  - updateObjBrowser() : update contents of the Object Browser
+  - SelectedCount() : get number of currently selected items
+  - getSelected() : get entry of the speicified selected item
+  - ClearIObjects() : clear selection
+  - Display(), DisplayOnly(), Erase() : display/erase objects
+  - etc.
 
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
+  Instance of this class is created every time "import salome" line is typed 
+  - in IAPP embedded Python interpretor  (SALOME_Session_Server executable)
+  - in inline Python nodes in Supervisor (in SALOME_Container executable)
+  - in stand-alone Python console outside any executable
+
+  SALOME GUI (desktop and other objects) is only available in SALOME_Session_Server.
+  It means that it can not be accessed from the external Python console.
+
+  The usage in Python:
+  \code
+  import libSALOME_Swig
+  sg = libSALOME_Swig.SALOMEGUI_Swig()
+  if sg.hasDesktop():
+      selcount = sg.SelectedCount()
+      if selcount > 0:
+          sg.Erase( sg.getSelected( 0 ) )
+      pass
+  \endcode
+*/
 
-using namespace std;
+/*
+  --- INTERNAL COMMENTS SECTION ---
 
-/*!
-  asv : 3.12.04 : added checking for NULL GUI objects in almost all methods.
+  ASV : 03.12.04 : added checking for NULL GUI objects in almost all methods.
   In the scope of fixing bug PAL6869.
 
-  (PR : modify comments)
-  Instance of this class is created every time "import salome" line is typed 
-  - in IAPP embedded Python interpretor  (SALOME_Session_Server executable),
-  - in inline Python nodes in Supervisor (in SALOME_Container executable),
-  - in stand-alone Python console outside any executable.
-  SALOME GUI(desktop and other objects) is only available in SALOME_Session_Server
-
   VSR : 19.04.05 : Reimplemented for new SALOME GUI (SUIT-based)
   All methods are implemeted using Event mechanism.
   Display/Erase methods use SALOME_Prs/SALOME_View mechanism. It is currently
@@ -74,18 +97,21 @@ using namespace std;
 */
 
 /*!
-  getApplication()
-  Returns active application object [ static ]
+  \brief Get active application object
+  \internal
+  \return active application or 0 if there is no any
 */
-static SalomeApp_Application* getApplication() {
+static SalomeApp_Application* getApplication()
+{
   if ( SUIT_Session::session() )
     return dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
-  return NULL;
+  return 0;
 }
 
 /*!
-  getActiveStudy()
-  Gets active study or 0 if there is no study opened [ static ]
+  \brief Get active study object
+  \internal
+  \return active study or 0 if there is no study opened
 */
 static SalomeApp_Study* getActiveStudy()
 {
@@ -95,54 +121,53 @@ static SalomeApp_Study* getActiveStudy()
 }
 
 /*!
-  SALOMEGUI_Swig::SALOMEGUI_Swig
-  Constructor
+  \brief Constructor.
 */
 SALOMEGUI_Swig::SALOMEGUI_Swig()
 {
 }
 
 /*!
-  SALOMEGUI_Swig::~SALOMEGUI_Swig
-  Destructor
+  \brief Destructor
 */
 SALOMEGUI_Swig::~SALOMEGUI_Swig()
 {
 }
 
 /*!
-  SALOMEGUI_Swig::hasDesktop
-  Returns TRUE if GUI is available.
+  \fn bool SALOMEGUI_Swig::hasDesktop()
+  \brief Check GUI availability.
+  \return \c true if GUI is available
 */
-class THasDesktopEvent: public SALOME_Event {
+
+class THasDesktopEvent: public SALOME_Event
+{
 public:
   typedef bool TResult;
   TResult myResult;
   THasDesktopEvent() : myResult( false ) {}
-  virtual void Execute() {
+  virtual void Execute()
+  {
     myResult = (bool)( getApplication() && getApplication()->desktop() );
   }
 };
-
-/*!
-  \return true if GUI is available.
-*/
 bool SALOMEGUI_Swig::hasDesktop()
 {
   return ProcessEvent( new THasDesktopEvent() );
 }
 
 /*!
-  SALOMEGUI_Swig::updateObjBrowser
-  Updates active study's Object Browser.
-  VSR: updateSelection parameter is currently not used. Will be implemented or removed lately.
+  \brief Update active study's Object Browser.
+  \param updateSelection this parameter is obsolete
 */
 void SALOMEGUI_Swig::updateObjBrowser( bool /*updateSelection*/ )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     TEvent() {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        anApp->updateObjectBrowser();
        anApp->updateActions(); //SRN: added in order to update the toolbar
@@ -153,198 +178,168 @@ void SALOMEGUI_Swig::updateObjBrowser( bool /*updateSelection*/ )
 }
 
 /*!
-  SALOMEGUI_Swig::getActiveStudyId
-  Returns active study's ID or 0 if there is no active study.
+  \fn int SALOMEGUI_Swig::getActiveStudyId()
+  \brief Get active study identifier
+  \return active study's ID or 0 if there is no active study
 */
-class TGetActiveStudyIdEvent: public SALOME_Event {
+
+class TGetActiveStudyIdEvent: public SALOME_Event
+{
 public:
   typedef int TResult;
   TResult myResult;
   TGetActiveStudyIdEvent() : myResult( 0 ) {}
-  virtual void Execute() {
+  virtual void Execute()
+  {
     if ( SalomeApp_Study* aStudy = getActiveStudy() ) {
       myResult = aStudy->studyDS()->StudyId();
     }
   }
 };
-
-/*!
-  \return active study's ID or 0 if there is no active study.
-*/
 int SALOMEGUI_Swig::getActiveStudyId()
 {
   return ProcessEvent( new TGetActiveStudyIdEvent() );
 }
 
 /*!
-  SALOMEGUI_Swig::getActiveStudyName
-  Returns active study's name or NULL if there is no active study.
+  \fn const char* SALOMEGUI_Swig::getActiveStudyName()
+  \brief Get active study name
+  \return active study's name or null string if there is no active study
 */
-class TGetActiveStudyNameEvent: public SALOME_Event {
+
+class TGetActiveStudyNameEvent: public SALOME_Event
+{
 public:
-  typedef string TResult;
+  typedef std::string TResult;
   TResult myResult;
   TGetActiveStudyNameEvent() {}
-  virtual void Execute() {
+  virtual void Execute()
+  {
     if ( SalomeApp_Study* aStudy = getActiveStudy() ) {
       myResult = aStudy->studyDS()->Name();
     }
   }
 };
-
-/*!
-  \return active study's name or NULL if there is no active study.
-*/
 const char* SALOMEGUI_Swig::getActiveStudyName()
 {
-  string result = ProcessEvent( new TGetActiveStudyNameEvent() );
-  return result.empty() ? NULL : result.c_str();
+  std::string result = ProcessEvent( new TGetActiveStudyNameEvent() );
+  return result.empty() ? 0 : result.c_str();
 }
 
 /*!
-  SALOMEGUI_Swig::getComponentName
-  Returns the name of the component by its user name.
+  \fn const char* SALOMEGUI_Swig::getComponentName( const char* componentUserName )
+  \brief Get name of the component by its title (user name)
+  \param componentUserName component title (user name)
+  \return component name or null string if component title is invalid
 */
-class TGetModulCatalogEvent: public SALOME_Event {
-public:
-  typedef CORBA::Object_var TResult;
-  TResult myResult;
-  TGetModulCatalogEvent() : myResult(CORBA::Object::_nil()) {}
-  virtual void Execute() {
-    if (SalomeApp_Application* anApp = getApplication())
-      myResult = anApp->namingService()->Resolve("/Kernel/ModulCatalog");
-  }
-};
 
 /*!
-  \return the name of the component by its user name.
+  \fn const char* SALOMEGUI_Swig::getComponentUserName( const char* componentName )
+  \brief Get title (user name) of the component by its name
+  \param componentName component name
+  \return component title or null string if component name is invalid
 */
-const char* SALOMEGUI_Swig::getComponentName( const char* componentUserName )
+
+class TGetComponentNameEvent: public SALOME_Event
 {
-  CORBA::Object_var anObject = ProcessEvent(new TGetModulCatalogEvent());
-  if (!CORBA::is_nil(anObject)) {
-    SALOME_ModuleCatalog::ModuleCatalog_var aCatalogue =
-      SALOME_ModuleCatalog::ModuleCatalog::_narrow( anObject );
-    SALOME_ModuleCatalog::ListOfIAPP_Affich_var aModules = aCatalogue->GetComponentIconeList();
-    for ( unsigned int ind = 0; ind < aModules->length(); ind++ ) {
-      CORBA::String_var aModuleName     = aModules[ ind ].modulename;
-      CORBA::String_var aModuleUserName = aModules[ ind ].moduleusername;
-      if ( strcmp(componentUserName, aModuleUserName.in()) == 0 )
-        return aModuleName._retn();
+public:
+  typedef QString TResult;
+  TResult myResult;
+  QString myName;
+  bool    myIsUserName;
+  TGetComponentNameEvent( const QString& name, bool isUserName )
+    : myName( name ), myIsUserName( isUserName ) {}
+  virtual void Execute()
+  {
+    if ( SalomeApp_Application* app = getApplication() ) {
+      myResult = myIsUserName ? app->moduleTitle( myName ) : app->moduleName( myName );
     }
   }
-  return 0;
+};
+const char* SALOMEGUI_Swig::getComponentName( const char* componentUserName )
+{
+  QString result = ProcessEvent( new TGetComponentNameEvent( componentUserName, false ) );
+  return result.isEmpty() ? 0 : strdup( result.toLatin1().constData() );
 }
-
-/*!
-  SALOMEGUI_Swig::getComponentUserName
-  Returns the user name of the component by its name.
-*/
 const char* SALOMEGUI_Swig::getComponentUserName( const char* componentName )
 {
-  CORBA::Object_var anObject = ProcessEvent(new TGetModulCatalogEvent());
-  if (!CORBA::is_nil(anObject)) {
-    SALOME_ModuleCatalog::ModuleCatalog_var aCatalogue =
-      SALOME_ModuleCatalog::ModuleCatalog::_narrow( anObject );
-    SALOME_ModuleCatalog::ListOfIAPP_Affich_var aModules = aCatalogue->GetComponentIconeList();
-    for ( unsigned int ind = 0; ind < aModules->length(); ind++ ) {
-      CORBA::String_var aModuleName     = aModules[ ind ].modulename;
-      CORBA::String_var aModuleUserName = aModules[ ind ].moduleusername;
-      if ( strcmp(componentName, aModuleName.in()) == 0 )
-        return aModuleUserName._retn();
-    }
-  }
-  return 0;
+  QString result = ProcessEvent( new TGetComponentNameEvent( componentName, true ) );
+  return result.isEmpty() ? 0 : strdup( result.toLatin1().constData() );
 }
 
 /*!
-  SALOMEGUI_Swig::SelectedCount
-  Returns the number of selected objects.
+  \fn int SALOMEGUI_Swig::SelectedCount()
+  \brief Get number of selected items
+  \return number of selected items in the active study
 */
-class TSelectedCountEvent: public SALOME_Event {
-public:
-  typedef int TResult;
-  TResult myResult;
-  TSelectedCountEvent() : myResult( 0 ) {}
-  virtual void Execute() {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SalomeApp_Study*       aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
-      LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
-      if ( aStudy && aSelMgr ) {
-       SALOME_ListIO anIOList;
-       aSelMgr->selectedObjects( anIOList );
-       myResult = anIOList.Extent();
-      }
-    }
-  }
-};
 
 /*!
-  \return the number of selected objects.
+  \fn const char* SALOMEGUI_Swig::getSelected( int index )
+  \brief Get entry of the specified selected item
+  \param index selected object index
+  \return selected object entry (null string if index is invalid)
 */
-int SALOMEGUI_Swig::SelectedCount()
-{
-  return ProcessEvent( new TSelectedCountEvent() );
-}
 
-/*!
-  SALOMEGUI_Swig::getSelected
-  Returns the selected object entry by the given index.
-*/
-class TGetSelectedEvent: public SALOME_Event {
+class TGetSelectedEvent: public SALOME_Event
+{
 public:
-  typedef QString TResult;
+  typedef QStringList TResult;
   TResult myResult;
-  int     myIndex;
-  TGetSelectedEvent( int theIndex ) : myIndex( theIndex ) {}
-  virtual void Execute() {
+  TGetSelectedEvent() {}
+  virtual void Execute()
+  {
     if ( SalomeApp_Application* anApp = getApplication() ) {
-      SalomeApp_Study*       aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
+      SalomeApp_Study* aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
       LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
       if ( aStudy && aSelMgr ) {
-       SALOME_ListIO anIOList;
-       aSelMgr->selectedObjects( anIOList );
-       if ( myIndex < anIOList.Extent() ) {
-         int index = 0;
-         SALOME_ListIteratorOfListIO anIter( anIOList );
-         for( ; anIter.More(); anIter.Next(), index++ ) {
-           Handle(SALOME_InteractiveObject) anIO = anIter.Value();
-           if ( myIndex == index ) {
-             myResult = anIO->getEntry();
-             return;
-           }
-         }
+       SUIT_DataOwnerPtrList aList;
+       aSelMgr->selected( aList );
+
+       for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); 
+             itr != aList.end(); ++itr ) {
+         const LightApp_DataOwner* owner = 
+           dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
+         if( !owner )
+           continue;
+         QString entry = owner->entry();
+         if( !myResult.contains( entry ) )
+           myResult.append( entry );
        }
       }
     }
   }
 };
-
-/*!
-  \return the selected object entry by the given index.
-*/
+int SALOMEGUI_Swig::SelectedCount()
+{
+  QStringList selected = ProcessEvent( new TGetSelectedEvent() );
+  return selected.count();
+}
 const char* SALOMEGUI_Swig::getSelected( int index )
 {
-  QString result = ProcessEvent( new TGetSelectedEvent( index ) );
-  return result.isEmpty() ? NULL : strdup(result.latin1());
+  QStringList selected = ProcessEvent( new TGetSelectedEvent() );
+  return index >= 0 && index < selected.count() ? 
+    strdup( selected[ index ].toLatin1().constData() ) : 0;
 }
 
 /*!
-  Adds an object with the given entry to the selection.
+  \brief Add an object to the current selection.
+  \param theEntry object entry
 */
 void SALOMEGUI_Swig::AddIObject( const char* theEntry )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     QString myEntry;
     TEvent( const char* theEntry ) : myEntry( theEntry ) {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        SalomeApp_Study*       aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
        LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
        if ( aStudy && aSelMgr ) {
          SALOME_ListIO anIOList;
-         anIOList.Append( new SALOME_InteractiveObject( myEntry, "", "" ) );
+         anIOList.Append( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) );
          aSelMgr->setSelectedObjects( anIOList, true );
        }
       }
@@ -354,17 +349,20 @@ void SALOMEGUI_Swig::AddIObject( const char* theEntry )
 }
 
 /*!
-  Removes the object with the given entry from the selection.
+  \brief Remove the object from the selection.
+  \param theEntry object entry
 */
 void SALOMEGUI_Swig::RemoveIObject( const char* theEntry )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     QString myEntry;
     TEvent( const char* theEntry ) : myEntry( theEntry ) {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
-       SalomeApp_Study*       aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
+       SalomeApp_Study* aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
        LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
        if ( aStudy && aSelMgr ) {
          SALOME_ListIO anIOList;
@@ -376,7 +374,7 @@ void SALOMEGUI_Swig::RemoveIObject( const char* theEntry )
          aSelMgr->selectedObjects( anIOList );
          SALOME_ListIteratorOfListIO anIter( anIOList );
          for( ; anIter.More(); anIter.Next() ) {
-           if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry, "", "" ) ) ) { 
+           if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ) ) { 
              anIOList.Remove( anIter );
              aSelMgr->setSelectedObjects( anIOList, true );
              return;
@@ -390,16 +388,18 @@ void SALOMEGUI_Swig::RemoveIObject( const char* theEntry )
 }
 
 /*!
-  Clears selection.
+  \brief Clear selection (unselect all objects).
 */
 void SALOMEGUI_Swig::ClearIObjects()
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     TEvent() {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
-       SalomeApp_Study*       aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
+       SalomeApp_Study* aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
        LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
        if ( aStudy && aSelMgr )
          aSelMgr->clearSelected();
@@ -410,13 +410,19 @@ void SALOMEGUI_Swig::ClearIObjects()
 }
 
 /*!
-  Displays an object in the current view window
-  (the presentable object should be previously created and displayed in this viewer).
-  VSR: For the current moment implemented for OCC and VTK viewers only.
+  \brief Display an object in the current view window.
+
+  The presentable object should be previously created and
+  displayed in this viewer.
+
+  For the current moment implemented for OCC and VTK viewers only.
+
+  \param theEntry object entry
 */             
 void SALOMEGUI_Swig::Display( const char* theEntry )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
     QString myEntry;
   public:
     TEvent( const char* theEntry ) : myEntry( theEntry ) {}
@@ -426,7 +432,7 @@ void SALOMEGUI_Swig::Display( const char* theEntry )
        if ( window ) {
          SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
          if ( view )
-           view->Display( view->CreatePrs( myEntry ) );
+           view->Display( view->CreatePrs( myEntry.toLatin1() ) );
        }
       }
     }
@@ -435,24 +441,32 @@ void SALOMEGUI_Swig::Display( const char* theEntry )
 }
 
 /*!
-  Displays an object in the current view window and erases all other
-  (the presentable object should be previously created and displayed in this viewer).
-  VSR: For the current moment implemented for OCC and VTK viewers only.
+  \brief Displays an object in the current view window and 
+  erases all other ones.
+
+  The presentable object should be previously created and 
+  displayed in this viewer.
+
+  For the current moment implemented for OCC and VTK viewers only.
+  
+  \param theEntry object entry
 */
 void SALOMEGUI_Swig::DisplayOnly( const char* theEntry )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
     QString myEntry;
   public:
     TEvent( const char* theEntry ) : myEntry( theEntry ) {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
        if ( window ) {
          SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
          if ( view ) {
            view->EraseAll( false );
-           view->Display( view->CreatePrs( myEntry ) );
+           view->Display( view->CreatePrs( myEntry.toLatin1() ) );
          }
        }
       }
@@ -462,23 +476,30 @@ void SALOMEGUI_Swig::DisplayOnly( const char* theEntry )
 }
 
 /*!
-  Erases an object in the current view window
-  (the presentable object should be previously created and displayed in this viewer).
-  VSR: For the current moment implemented for OCC and VTK viewers only.
+  \brief Erase an object in the current view window.
+
+  The presentable object should be previously created and 
+  displayed in this viewer.
+
+  For the current moment implemented for OCC and VTK viewers only.
+
+  \param theEntry object entry
 */             
 void SALOMEGUI_Swig::Erase( const char* theEntry )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
     QString myEntry;
   public:
     TEvent( const char* theEntry ) : myEntry( theEntry ) {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
        if ( window ) {
          SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
          if ( view )
-           view->Erase( view->CreatePrs( myEntry ) );
+           view->Erase( view->CreatePrs( myEntry.toLatin1() ) );
        }
       }
     }
@@ -487,16 +508,22 @@ void SALOMEGUI_Swig::Erase( const char* theEntry )
 }
 
 /*!
-  Displays all active module's child objects in the current view window
-  (the presentable objects should be previously created and displayed in this viewer).
-  VSR: For the current moment implemented for OCC and VTK viewers only.
+  \brief Display all active module's presentable 
+  child objects in the current view window.
+  
+  The presentable objects should be previously created and
+  displayed in this viewer.
+
+  For the current moment implemented for OCC and VTK viewers only.
 */
 void SALOMEGUI_Swig::DisplayAll()
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     TEvent() {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        SalomeApp_Study*  study        = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
        SUIT_ViewWindow*  window       = anApp->desktop()->activeWindow();
@@ -507,7 +534,7 @@ void SALOMEGUI_Swig::DisplayAll()
            for ( SUIT_DataObjectIterator it( activeModule->dataModel()->root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) {
              SalomeApp_DataObject* obj = dynamic_cast<SalomeApp_DataObject*>( it.current() );
              if ( obj && !obj->entry().isEmpty() )
-               view->Display( view->CreatePrs( obj->entry() ) );
+               view->Display( view->CreatePrs( obj->entry().toLatin1() ) );
            }
          }
        }
@@ -518,15 +545,18 @@ void SALOMEGUI_Swig::DisplayAll()
 }
 
 /*!
-  Erases all objects from the current view window
-  VSR: For the current moment implemented for OCC and VTK viewers only.
+  \brief Erase all objects from the current view window.
+  
+  For the current moment implemented for OCC and VTK viewers only.
 */
 void SALOMEGUI_Swig::EraseAll()
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     TEvent() {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
        if ( window ) {
@@ -541,47 +571,53 @@ void SALOMEGUI_Swig::EraseAll()
 }
 
 /*!
-  Returns TRUE if the object with given entry is in the current viewer.
+  \fn bool SALOMEGUI_Swig::IsInCurrentView( const char* theEntry )
+  \brief Check it the object is displayed in the current view window.
+
   VSR: For the current moment implemented for OCC and VTK viewers only.
+
+  \param theEntry object entry
+  \return \c true if the object with given entry is displayed 
+          in the current viewer
 */
-class TIsInViewerEvent: public SALOME_Event {
+
+class TIsInViewerEvent: public SALOME_Event
+{
   QString myEntry;
 public:
   typedef bool TResult;
   TResult myResult;
   TIsInViewerEvent( const char* theEntry ) : myEntry( theEntry ), myResult( false ) {}
-  virtual void Execute() {
+  virtual void Execute()
+  {
     if ( SalomeApp_Application* anApp = getApplication() ) {
       SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
       if ( window ) {
        SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
        if ( view ) {
-         SALOME_Prs* aPrs = view->CreatePrs( myEntry );
+         SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() );
          myResult = !aPrs->IsNull();
        }
       }
     }
   }
 };
-
-/*!
-  \return TRUE if the object with given entry is in the current viewer.
-  VSR: For the current moment implemented for OCC and VTK viewers only.
-*/
 bool SALOMEGUI_Swig::IsInCurrentView( const char* theEntry )
 {
   return ProcessEvent( new TIsInViewerEvent( theEntry ) );
 }
 
 /*!
-  Updates (repaint) current view
+  \brief Update (repaint) current view window.
 */
 void SALOMEGUI_Swig::UpdateView()
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     TEvent() {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
        if ( window ) {
@@ -596,23 +632,25 @@ void SALOMEGUI_Swig::UpdateView()
 }
 
 /*!
-  Fit all the contents of the current view window
- */
+  \brief Fit current view window to display all its contents.
+*/
 void SALOMEGUI_Swig::FitAll()
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     TEvent() {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
        if ( window ) {
          if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
-           (dynamic_cast<SVTK_ViewWindow*>( window ))->onFitAll();
+           ( dynamic_cast<SVTK_ViewWindow*>( window ) )->onFitAll();
          else if ( dynamic_cast<SOCC_ViewWindow*>( window ) )
-           (dynamic_cast<SOCC_ViewWindow*>( window ))->onFitAll();
+           ( dynamic_cast<SOCC_ViewWindow*>( window ) )->onFitAll();
          else if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
-           (dynamic_cast<SPlot2d_ViewWindow*>( window ))->onFitAll();
+           ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )->onFitAll();
        }
       }
     }
@@ -621,14 +659,16 @@ void SALOMEGUI_Swig::FitAll()
 }
 
 /*!
-  Reset current view window to the default state.
- */
+  \brief Reset current view window to the default state.
+*/
 void SALOMEGUI_Swig::ResetView()
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   public:
     TEvent() {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
        if ( window ) {
@@ -647,23 +687,34 @@ void SALOMEGUI_Swig::ResetView()
   ProcessVoidEvent( new TEvent() );
 }
 
+/*!
+  \brief View operation type.
+  \internal
+*/
 enum {
-  __ViewTop,
-  __ViewBottom,
-  __ViewLeft,
-  __ViewRight,
-  __ViewFront,
-  __ViewBack
+  __ViewTop,          //!< view top side
+  __ViewBottom,       //!< view bottom side
+  __ViewLeft,         //!< view left side
+  __ViewRight,        //!< view right side
+  __ViewFront,        //!< view front side
+  __ViewBack          //!< view back side
 };
 
-void setView( int view )
+/*!
+  \brief Change the view of the current view window.
+  \internal
+  \param view view operation type
+*/
+static void setView( int view )
 {
-  class TEvent: public SALOME_Event {
+  class TEvent: public SALOME_Event
+  {
   private:
     int myView;
   public:
     TEvent( int view ) : myView( view ) {}
-    virtual void Execute() {
+    virtual void Execute()
+    {
       if ( SalomeApp_Application* anApp = getApplication() ) {
        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
        if ( window ) {
@@ -711,48 +762,48 @@ void setView( int view )
 }
 
 /*!
-  Switch current view window to show top view
- */
+  \brief Switch current view window to show the top view.
+*/
 void SALOMEGUI_Swig::ViewTop()
 {
   setView( __ViewTop );
 }
 
 /*!
-  Switch current view window to show bottom view
- */
+  \brief Switch current view window to show the bottom view
+*/
 void SALOMEGUI_Swig::ViewBottom()
 {
   setView( __ViewBottom );
 }
 
 /*!
-  Switch current view window to show left view
- */
+  \brief Switch current view window to show the left view
+*/
 void SALOMEGUI_Swig::ViewLeft()
 {
   setView( __ViewLeft );
 }
 
 /*!
-  Switch current view window to show right view
- */
+  \brief Switch current view window to show the right view
+*/
 void SALOMEGUI_Swig::ViewRight()
 {
   setView( __ViewRight );
 }
 
 /*!
-  Switch current view window to show front view
- */
+  \brief Switch current view window to show the front view
+*/
 void SALOMEGUI_Swig::ViewFront()
 {
   setView( __ViewFront );
 }
 
 /*!
-  Switch current view window to show back view
- */
+  \brief Switch current view window to show the back view
+*/
 void SALOMEGUI_Swig::ViewBack()
 {
   setView( __ViewBack );
index 97e09fa28f137062849afa7a736188f73ba31bac..02eced3736086e4a62a7b5ad3f9a3bfe3c44a32a 100644 (file)
@@ -1,68 +1,61 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+// File   : SALOMEGUI_Swig.hxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : SALOMEGUI_Swig.hxx
-//  Author : Vadim SANDLER
-//  Module : SALOME
-//  $Header$
-
 #ifndef SALOMEGUI_SWIG_HXX
 #define SALOMEGUI_SWIG_HXX
 
 class SALOMEGUI_Swig
 {
 public:
-  /* construction/destruction */
   SALOMEGUI_Swig();
   ~SALOMEGUI_Swig();
 
-  /* check GUI */
   bool             hasDesktop();
 
-  /* update object browser*/
-  void             updateObjBrowser( bool updateSelection );
+  void             updateObjBrowser( bool );
 
-  /* get active study */
   int              getActiveStudyId();
   const char*      getActiveStudyName();
 
-  /* selection processing */
+  const char*      getComponentName( const char* );
+  const char*      getComponentUserName( const char* );
+
   int              SelectedCount();
-  const char*      getSelected(int i);
-  void             AddIObject( const char *Entry );
-  void             RemoveIObject( const char *Entry );
+  const char*      getSelected( int i );
+  void             AddIObject( const char );
+  void             RemoveIObject( const char );
   void             ClearIObjects();
 
-  /* display/erase */          
-  void             Display( const char *Entry );
-  void             DisplayOnly( const char *Entry );
-  void             Erase( const char *Entry );
+  void             Display( const char* );
+  void             DisplayOnly( const char* );
+  void             Erase( const char* );
   void             DisplayAll();
   void             EraseAll();
-  bool             IsInCurrentView( const char *Entry );
+  bool             IsInCurrentView( const char* );
   void             UpdateView();
 
-  /* view operations */
   void             FitAll();
   void             ResetView();
   void             ViewTop();
@@ -71,10 +64,6 @@ public:
   void             ViewRight();
   void             ViewFront();
   void             ViewBack();
-
-  /* get component name/username */
-  const char*      getComponentName( const char* ComponentUserName );
-  const char*      getComponentUserName( const char* ComponentName );
 };
 
 #endif // SALOMEGUI_SWIG_HXX
index 7db1de9098f0b7d01ff1e2210fd17b09ac95450d..b53eca5137143c9d6cd0af37b0ff3bf4e01973a3 100644 (file)
@@ -1,31 +1,28 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOMEGUI_Swig.i
 //  Author : Paul RASCLE, EDF
-//  Module : SALOME
-//  $Header$
-
+//
 %{
 #include "SALOMEGUI_Swig.hxx"
 %}
@@ -39,9 +36,9 @@
     // Py_BEGIN_ALLOW_THREADS
     PyAllowThreadsGuard() { _save = PyEval_SaveThread(); }
     // Py_END_ALLOW_THREADS
-    ~PyAllowThreadsGuard() { PyEval_RestoreThread(_save); }
+    ~PyAllowThreadsGuard() { PyEval_RestoreThread( _save ); }
    private:
-    PyThreadState *_save;
+    PyThreadState_save;
   };
 
   PyAllowThreadsGuard guard;
 
 class SALOMEGUI_Swig
 {
- public:
-/* construction/destruction */
+public:
   SALOMEGUI_Swig();
-  ~SALOMEGUI_Swig();
+  virtual ~SALOMEGUI_Swig();
 
-/* check GUI */
+  /* check GUI */
   bool hasDesktop();
 
-/* update object browser*/
+  /* update object browser*/
   void updateObjBrowser(bool);
 
-/* get active study */
+  /* get active study */
   int getActiveStudyId();
   const char *getActiveStudyName();
 
-/* selection processing */
+  /* get component name/username */
+  const char* getComponentName( const char* ComponentUserName );
+  const char* getComponentUserName( const char* ComponentName );
+
+  /* selection processing */
   int SelectedCount();
   const char *getSelected(int i);
   void AddIObject(const char *Entry);
   void RemoveIObject(const char *Entry);
   void ClearIObjects();
 
-/* display/erase */
+  /* display/erase */
   void Display(const char *Entry);
   void DisplayOnly(const char *Entry);
   void Erase(const char *Entry);
@@ -82,7 +82,7 @@ class SALOMEGUI_Swig
   bool IsInCurrentView(const char *Entry);
   void UpdateView();
 
-/* view operations */
+  /* view operations */
   void FitAll();
   void ResetView();
   void ViewTop();
@@ -91,8 +91,4 @@ class SALOMEGUI_Swig
   void ViewRight();
   void ViewFront();
   void ViewBack();
-
-/* get component name/username */
-  const char* getComponentName( const char* ComponentUserName );
-  const char* getComponentUserName( const char* ComponentName );
 };
index 25170ebfd9db25ca7495ca1096f8b905d707e77d..02b161770d9024facbbd333c7c1741bdc318c512 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
@@ -14,7 +17,7 @@
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 """
 
index e214bedf808386cb5810a1668238144a14fbb99a..1fededccb5aa5969867957c3a1f1942fc5a593ec 100755 (executable)
@@ -1,27 +1,27 @@
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : examplevtk1.py
 #  Module : SALOME
-
+#
 import libSalomePy
 ren=libSalomePy.renderer
 #iren=libSalomePy.interactor
index a96601f7e395e06f9d52870e9775dc0496586730..14e318090d21d17095b5a3b29f568fc0623059f9 100755 (executable)
@@ -1,29 +1,29 @@
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : libSALOME_Swig.i
 //  Author : Paul RASCLE, EDF
 //  Module : SALOME
 //  $Header$
-
+//
 %module libSALOME_Swig
 
 //%include "SALOME_NamingService.i"
index 9d45865db4dcbee1c1ce40609c671a340de07534..06a4c5b45c7a45f20ea3e22fa76f119647a20c92 100755 (executable)
@@ -1,29 +1,29 @@
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-#  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : salome.py
 #  Author : Paul RASCLE, EDF
 #  Module : SALOME
 #  $Header$
-
+#
 from omniORB import CORBA
 from LifeCycleCORBA import *
 from libSALOME_Swig import *
index 66974aeb6200c3cabc62babb2296f877a90744e9..36a97cc412d2227f365d8dc20ee11b2f5241947f 100755 (executable)
@@ -1,9 +1,29 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 #==============================================================================
 #  File      : supervisionexample.py
 #  Created   : 23 nov 2001
 #  Author    : Jean Rahuel
 #  Project   : SALOME
-#  Copyright : CEA
 #==============================================================================
 
 from SuperV import *
index 8c56bb1f2efc86a77288b9060205ae8927fd7c83..09a2bf40dc43774119f34ddaf42ccf1fbe665158 100755 (executable)
@@ -1,3 +1,24 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
 # Generated python file of Graph GraphGeom2Essai
 
index 78fa2e347599147f47a48c50b92c0c643bca23ce..4ac3761fd0fcc4b20231feece907099f3398c171 100755 (executable)
@@ -1,26 +1,27 @@
-# Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# File   : test_big_table.py
+# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 #
-#  File   : test_big_table.py
-#  Author : Vadim SANDLER
-#  Module : SALOME
-#  $Header$
-
 import salome
 import math
 import SALOMEDS
index 98de03f1e8351cba38fc977184243e40797f68a5..2f4f5b5212a155665b1993e5695b8039fd8a4955 100755 (executable)
@@ -1,26 +1,27 @@
-# Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# File   : visu_many_objects.py
+# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 #
-#  File   : visu_many_objects.py
-#  Author : Vadim SANDLER
-#  Module : SALOME
-#  $Header$
-
 import salome
 import SALOMEDS
 
index dcc18c92211bf38046c061824095b378fce17f65..1a5720f10e06cf44d6a570c6cc7cd9c3444ae8f6 100755 (executable)
@@ -1,4 +1,6 @@
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : test_remove_ref.py
 #  Module : SALOMEDS     
-
+#
 from salome import *
 
 myBuilder = myStudy.NewBuilder()
index 0727594ceb20a542693959c843dc9e32130a6080..e3cd71d65270bbecd5284e926ad9118c228d6c0b 100755 (executable)
@@ -1,26 +1,27 @@
-# Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either 
-# version 2.1 of the License.
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-# This library is distributed in the hope that it will be useful 
-# but WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-# Lesser General Public License for more details.
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-# You should have received a copy of the GNU Lesser General Public  
-# License along with this library; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# File   : test_table.py
+# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 #
-#  File   : test_table.py
-#  Author : Vadim SANDLER
-#  Module : SALOME
-#  $Header$
-
 import salome
 import math
 import SALOMEDS
index 25db606727b6c28a22389c550a0c63850e4e818a..077604f77c15e220886b37af6951e362d2cd947d 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Alexander Solovyov(OCN)
 #  Module : SOCC
 # $Header: /dn06/SALOME_CVS/GUI_SRC/src/SOCC/Makefile.in,v 1.1
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-lib_LTLIBRARIES=libSOCC.la
+lib_LTLIBRARIES = libSOCC.la
 
-salomeinclude_HEADERS= \
-       SOCC.h \
-       SOCC_ViewModel.h \
-       SOCC_Prs.h \
+salomeinclude_HEADERS =                \
+       SOCC.h                  \
+       SOCC_ViewModel.h        \
+       SOCC_Prs.h              \
        SOCC_ViewWindow.h
 
-dist_libSOCC_la_SOURCES= \
-       SOCC_ViewModel.cxx \
-       SOCC_Prs.cxx \
+dist_libSOCC_la_SOURCES =      \
+       SOCC_ViewModel.cxx      \
+       SOCC_Prs.cxx            \
        SOCC_ViewWindow.cxx
 
-MOC_FILES= \
-       SOCC_ViewModel_moc.cxx \
+MOC_FILES =                    \
+       SOCC_ViewModel_moc.cxx  \
        SOCC_ViewWindow_moc.cxx
-nodist_libSOCC_la_SOURCES= $(MOC_FILES)
+nodist_libSOCC_la_SOURCES = $(MOC_FILES)
 
-libSOCC_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) $(BOOST_CPPFLAGS) \
-       -I$(srcdir)/../SUIT -I$(srcdir)/../OBJECT -I$(srcdir)/../Prs \
-       -I$(srcdir)/../OCCViewer -I$(srcdir)/../Qtx
+libSOCC_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(BOOST_CPPFLAGS)                 \
+                     -I$(srcdir)/../SUIT -I$(srcdir)/../OBJECT -I$(srcdir)/../Prs      \
+                     -I$(srcdir)/../OCCViewer -I$(srcdir)/../Qtx
 
-libSOCC_la_LDFLAGS=$(QT_MT_LIBS)
-libSOCC_la_LIBADD= ../SUIT/libsuit.la ../OBJECT/libSalomeObject.la \
-       ../Prs/libSalomePrs.la ../OCCViewer/libOCCViewer.la
+libSOCC_la_LDFLAGS  = $(QT_MT_LIBS)
+libSOCC_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../OBJECT/libSalomeObject.la \
+                     ../Prs/libSalomePrs.la ../OCCViewer/libOCCViewer.la
index 99e77291a09b1821e7ecf3688bb3966275ea955e..9e7794c80b76ae080c280506d4f3848ef6eb9e75 100755 (executable)
@@ -1,22 +1,25 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#ifdef WNT
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifdef WIN32
 #ifdef SOCC_EXPORTS
 #define SOCC_EXPORT __declspec(dllexport)
 #else
@@ -26,6 +29,6 @@
 #define SOCC_EXPORT
 #endif
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
diff --git a/src/SOCC/SOCC.pro b/src/SOCC/SOCC.pro
new file mode 100644 (file)
index 0000000..1caf6c2
--- /dev/null
@@ -0,0 +1,54 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = SOCC
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+INCLUDEPATH += ../../include $${CAS_CPPFLAGS} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../OBJECT ../Prs ../OCCViewer
+LIBS += -L../../lib -lqtx -lsuit -lSalomeObject -lSalomePrs -lOCCViewer
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += SOCC_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = SOCC.h
+HEADERS += SOCC_ViewModel.h
+HEADERS += SOCC_Prs.h
+HEADERS += SOCC_ViewWindow.h
+
+SOURCES  = SOCC_ViewModel.cxx
+SOURCES += SOCC_Prs.cxx
+SOURCES += SOCC_ViewWindow.cxx
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+INSTALLS += includes
index eb2cb6821bdfe493c4af96a80e8084845c5ba1cc..1f4c379d5d006aa3069e402c89de4f2bc7ea427e 100644 (file)
@@ -1,32 +1,34 @@
-//  SALOME OCCViewer : build OCC Viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2004  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME OCCViewer : build OCC Viewer into Salome desktop
 //  File   : SOCC_Prs.cxx
 //  Author : Sergey ANIKIN
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SOCC_Prs.h"
+
+#include <AIS_InteractiveObject.hxx>
+
 using namespace std;
 
 /*!
@@ -69,6 +71,14 @@ void SOCC_Prs::AddObject( const Handle(AIS_InteractiveObject)& obj )
   myObjects.Append( obj ); 
 }
 
+/*!
+  Remove all interactive objects
+*/
+void SOCC_Prs::Clear()
+{
+  myObjects.Clear();
+}
+
 /*!
   \return 0 if list of the interactive objects is empty [ Reimplemented from SALOME_Prs ]
 */
index 06fbce141a890e131b8cc45405fce4ccb69e7356..007a68f90ac7806063e62fc26b76f057f9a9ad0c 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME OCCViewer : build OCC Viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2004  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME OCCViewer : build OCC Viewer into Salome desktop
 //  File   : SOCC_Prs.h
 //  Author : Sergey ANIKIN
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SOCC_Prs_H
 #define SOCC_Prs_H
 
 
 #include <SALOME_Prs.h>
 
-#include <AIS_InteractiveObject.hxx>
 #include <AIS_ListOfInteractive.hxx>
 
+class Handle(AIS_InteractiveObject);
+
 class SOCC_EXPORT SOCC_Prs : public SALOME_OCCPrs
 {
 public:
@@ -51,6 +51,9 @@ public:
   void AddObject( const Handle(AIS_InteractiveObject)& obj );
   // Add interactive object
 
+  void Clear();
+  // Remove all interactive objects
+
   bool IsNull() const;
   // Reimplemented from SALOME_Prs
 
index 8d27c10a7f94d19a83938200a8eb4c5dba11a2b0..49d9e53d2ea2d60baedfc597add1f5e9d6efc133 100755 (executable)
@@ -1,28 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SOCC_ViewModel.h"
 
 #include "SOCC_Prs.h"
 #include "SOCC_ViewWindow.h"
 
+#include "OCCViewer_Trihedron.h"
+
 #include "SUIT_Session.h"
-#include "SUIT_Application.h"
+#include "SUIT_ResourceMgr.h"
+//#include "SUIT_Application.h"
 
 //#include "ToolsGUI.h"
 
@@ -37,6 +43,7 @@
 
 #include <SALOME_AISShape.hxx>
 #include <SALOME_AISObject.hxx>
+#include <SALOME_InteractiveObject.hxx>
 
 // Temporarily commented to avoid awful dependecy on SALOMEDS
 // TODO: better mechanism of storing display/erse status in a study
@@ -289,7 +296,7 @@ void SOCC_Viewer::rename( const Handle(SALOME_InteractiveObject)& obj,
         Handle(SALOME_InteractiveObject) IO = aSh->getIO();
         if ( IO->isSame( obj ) )
         {
-          aSh->setName( (char*)name.latin1() );
+          aSh->setName( name.toLatin1().data() );
           break;
         }
       }
@@ -500,7 +507,8 @@ void SOCC_Viewer::EraseAll( const bool forced )
   ic->DisplayedObjects( aList );
   AIS_ListIteratorOfListOfInteractive anIter( aList );
   for ( ; anIter.More(); anIter.Next() ) {
-    if ( isTrihedronDisplayed && anIter.Value()->DynamicType() == STANDARD_TYPE( AIS_Trihedron ) )
+    if ( isTrihedronDisplayed && anIter.Value()->DynamicType() == STANDARD_TYPE( AIS_Trihedron ) ||
+        anIter.Value()->DynamicType() == STANDARD_TYPE( OCCViewer_Trihedron ))
       continue;
 
     // erase an object
index 6d2d040258bbdba80f30c9e67bfdc751962237f5..9eb1a0398b977bc21e9c65851038fa5b4b11f29b 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SOCC_VIEWMODEL_H
 #define SOCC_VIEWMODEL_H
@@ -26,7 +29,8 @@
 #include "SOCC.h"
 #include "SALOME_Prs.h"
 #include "OCCViewer_ViewModel.h"
-#include "SALOME_InteractiveObject.hxx"
+
+class Handle(SALOME_InteractiveObject);
 
 class SOCC_EXPORT SOCC_Viewer: public OCCViewer_Viewer, public SALOME_View
 {
index d7c4edb81916b4116943d91fffac741746760f8b..4fdb39108531ae9aa26313d2d29dca17041c7353 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SOCC_ViewWindow.h"
 
index e30afe5110997c20e13d8acb62b22cd14591ef0d..656f2d3a5f6719eccfd588295634a5d8a0e25b2c 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SOCC_VIEWWINDOW_H
 #define SOCC_VIEWWINDOW_H
index 17dc25b37d1601d1c1c9698ac9556316157cf2a8..1f4b4033a9660d2913a98c3a82360c4196fe796c 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSPlot2d.la
 
-salomeinclude_HEADERS = \
-       SPlot2d.h \
-       SPlot2d_Curve.h \
-       SPlot2d_Prs.h \
-       SPlot2d_ViewModel.h \
+salomeinclude_HEADERS =                \
+       SPlot2d.h               \
+       SPlot2d_Curve.h         \
+       SPlot2d_Prs.h           \
+       SPlot2d_ViewModel.h     \
        SPlot2d_ViewWindow.h
 
-dist_libSPlot2d_la_SOURCES = \
-       SPlot2d_Curve.cxx \
-       SPlot2d_Prs.cxx \
-       SPlot2d_ViewModel.cxx \
+dist_libSPlot2d_la_SOURCES =   \
+       SPlot2d_Curve.cxx       \
+       SPlot2d_Prs.cxx         \
+       SPlot2d_ViewModel.cxx   \
        SPlot2d_ViewWindow.cxx
 
-MOC_FILES = \
-       SPlot2d_ViewModel_moc.cxx \
+MOC_FILES =                            \
+       SPlot2d_ViewModel_moc.cxx       \
        SPlot2d_ViewWindow_moc.cxx
 nodist_libSPlot2d_la_SOURCES = $(MOC_FILES)
 
-nodist_salomeres_DATA = SPlot2d_msg_en.qm
-
-libSPlot2d_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) $(QWT_INCLUDES) $(BOOST_CPPFLAGS) \
-       -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../Plot2d -I$(srcdir)/../Prs \
-       -I$(srcdir)/../OBJECT
-libSPlot2d_la_LDFLAGS=$(QT_MT_LIBS) $(QWT_LIBS) ../SUIT/libsuit.la ../Plot2d/libPlot2d.la ../Prs/libSalomePrs.la
+libSPlot2d_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(QWT_INCLUDES) $(BOOST_CPPFLAGS)      \
+                        -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../Plot2d           \
+                        -I$(srcdir)/../Prs -I$(srcdir)/../OBJECT
+libSPlot2d_la_LDFLAGS  = $(QT_MT_LIBS) $(CAS_KERNEL) $(QWT_LIBS) ../SUIT/libsuit.la ../Plot2d/libPlot2d.la ../Prs/libSalomePrs.la ../OBJECT/libSalomeObject.la
 
 
 
index 39e4c1245dd0b4742db04636d337afe0abd8014f..320c0e5716701811da499e90f8aaa3e4a9e916e5 100644 (file)
@@ -1,22 +1,25 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#ifdef WNT
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifdef WIN32
 #ifdef SPLOT2D_EXPORTS
 #define SPLOT2D_EXPORT __declspec(dllexport)
 #else
@@ -26,6 +29,6 @@
 #define SPLOT2D_EXPORT
 #endif
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
diff --git a/src/SPlot2d/SPlot2d.pro b/src/SPlot2d/SPlot2d.pro
new file mode 100644 (file)
index 0000000..faf945c
--- /dev/null
@@ -0,0 +1,66 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = SPlot2d
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
+
+QWTHOME=$$(QWTHOME)
+QWTINC=$${QWTHOME}/include
+QWTLIB=$${QWTHOME}/lib
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+INCLUDEPATH += ../../include $${CAS_CPPFLAGS} ../../include $${QWTINC} $${BOOST_CPPFLAGS}
+INCLUDEPATH += ../Qtx ../SUIT ../Plot2d ../Prs ../OBJECT
+unix:LIBS  += -L$${QWTLIB} -lqwt
+win32:LIBS += /LIBPATH:$$(QWTLIB)
+LIBS += -L../../lib -lsuit -lPlot2d -lSalomePrs
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += SPLOT2D_EXPORTS
+
+HEADERS  = SPlot2d.h
+HEADERS  = SPlot2d_Curve.h
+HEADERS  = SPlot2d_Prs.h
+HEADERS  = SPlot2d_ViewModel.h
+HEADERS  = SPlot2d_ViewWindow.h
+
+SOURCES   = SPlot2d_Curve.cxx
+SOURCES  += SPlot2d_Curve.cxx
+SOURCES  += SPlot2d_Prs.cxx
+SOURCES  += SPlot2d_ViewModel.cxx
+SOURCES  += SPlot2d_ViewWindow.cxx
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+INSTALLS += includes
index 87439441fe26e010215289adc0b8f5fc8e18f3d9..95c17a520e0c282df790f3468f8788900a336ec9 100644 (file)
@@ -1,26 +1,32 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SPlot2d_Curve.cxx
 //  Author : Sergey RUIN
 //  Module : SUIT
-
+//
 #include "SPlot2d_Curve.h"
+#include <QString>
+#include <QColor>
+
 using namespace std;
 
 /*!
index f75519ead0557f12f6ebb8c5364aa4c83d91ae53..444fddda71b2dbfb3685e3e79538ab07a02da1cb 100644 (file)
@@ -1,25 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SPlot2d_Curve.h
 //  Author : Sergey RUIN
 //  Module : SUIT
-
+//
 #ifndef SPlot2d_Curve_h
 #define SPlot2d_Curve_h
 
 
 #include "Plot2d_Curve.h"
 
-#include <qstring.h>
-#include <qcolor.h>
-#include <qmemarray.h>
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
 #include <Handle_SALOME_InteractiveObject.hxx>
 #endif
 #include "SALOME_InteractiveObject.hxx"
 
+class QString;
+class QColor;
+
 class SPLOT2D_EXPORT SPlot2d_Curve : public Plot2d_Curve
 {
 public:
index 68739a0c6f3d61c12ca8ec6e24b2eaf54903bbd6..e96b2cc2829968f85ae44524944dcfb366513376 100644 (file)
@@ -1,27 +1,30 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SPlot2d_Prs.cxx
 //  Author : Sergey RUIN
 //  Module : SUIT
-
+//
 #include "SPlot2d_Prs.h"
-#ifndef WNT
+#ifndef WIN32
 using namespace std;
 #endif
 
index 77e878172034a7a6c28912631f5e1c8d3954b6a4..67b79b0980d4071744d1b173271e9715980c903f 100644 (file)
@@ -1,25 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SPlot2d_Prs.h
 //  Author : Sergey RUIN
 //  Module : SUIT
-
+//
 #ifndef SPLOT2D_PRS_H
 #define SPLOT2D_PRS_H
 
@@ -27,8 +30,6 @@
 #include "SALOME_Prs.h"
 #include "Plot2d_Prs.h"
 
-#include <qptrlist.h>
-
 class Plot2d_Curve;
 
 class SPLOT2D_EXPORT SPlot2d_Prs : public SALOME_Prs2d, public Plot2d_Prs
index 527a8a135209102df824e0c2c7442265b3444b83..10afaed7ce3984292f4aa1cb956daa46e522d64b 100644 (file)
@@ -1,25 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SPlot2d_Viewer.cxx
 //  Author : Sergey RUIN
 //  Module : SUIT
-
+//
 #include "SPlot2d_ViewModel.h"
 
 #include "SPlot2d_ViewWindow.h"
 #include "SPlot2d_Prs.h"
 #include "SUIT_Session.h"
 #include "SUIT_Application.h"
+#include "SUIT_ViewManager.h"
+
+#include "SALOME_ListIO.hxx"
 
-//#include "utilities.h"
-#include "qapplication.h"
-#include <qtoolbar.h>
-#include <qtoolbutton.h>
-#include <qcursor.h>
-#include <qcolordialog.h>
-#include <qwt_math.h>
+#include <QApplication>
+#include <QToolBar>
+#include <QToolButton>
+#include <QCursor>
+#include <QColorDialog>
+
+//#include <qwt_math>
 #include <qwt_plot_canvas.h>
+#include <qwt_plot_curve.h>
 #include <stdlib.h>
 
 using namespace std;
@@ -90,20 +97,19 @@ void SPlot2d_Viewer::rename( const Handle(SALOME_InteractiveObject)& IObject,
   if( !aViewFrame )
     return;
 
-  QIntDictIterator<Plot2d_Curve> it( aViewFrame->getCurves() );
-  for( ; it.current(); ++it )
+  CurveDict aCurves = aViewFrame->getCurves();
+  CurveDict::Iterator it = aCurves.begin();
+  for( ; it != aCurves.end(); ++it )
   {
-    SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>( it.current() );
+    SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>( it.value() );
     if( aCurve && aCurve->hasIO() && aCurve->getIO()->isSame( IObject ) )
     {
       aCurve->setVerTitle( newName );
-      int key = aViewFrame->hasCurve( aCurve );
-      if( key )
-       aViewFrame->setCurveTitle( key, newName );
+      it.key()->setTitle( newName );
     }
 
     if( aCurve && aCurve->hasTableIO() && aCurve->getTableIO()->isSame( IObject ) )
-      aCurve->getTableIO()->setName( newName.latin1() );
+      aCurve->getTableIO()->setName( newName.toLatin1() );
   }
   aViewFrame->updateTitles();
 }
@@ -118,7 +124,8 @@ void SPlot2d_Viewer::renameAll( const Handle(SALOME_InteractiveObject)& IObj, co
   SUIT_ViewManager* vm = getViewManager();
   if ( vm )
   {
-    const QPtrVector<SUIT_ViewWindow>& wnds = vm->getViews();
+    const QVector<SUIT_ViewWindow*>& wnds = vm->getViews();
+
     for ( uint i = 0; i < wnds.size(); i++ )
     {
       Plot2d_ViewWindow* pwnd = dynamic_cast<Plot2d_ViewWindow*>( wnds.at( i ) );
@@ -139,10 +146,11 @@ bool SPlot2d_Viewer::isInViewer( const Handle(SALOME_InteractiveObject)& IObject
     return 1;
   else{
     if(!IObject.IsNull()){
-      QIntDictIterator<Plot2d_Curve> it(aViewFrame->getCurves());
-      for(; it.current();++it) {
-       SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>(it.current()); 
-       if(aCurve->hasIO() && aCurve->getTableIO()->isSame(IObject))
+      CurveDict aCurves = aViewFrame->getCurves();
+      CurveDict::Iterator it = aCurves.begin();
+      for( ; it != aCurves.end(); ++it ) {
+        SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>( it.value() );
+       if(aCurve && aCurve->hasIO() && aCurve->getTableIO()->isSame(IObject))
          return 1;
       }
     }
@@ -174,9 +182,10 @@ void SPlot2d_Viewer::DisplayOnly( const Handle(SALOME_InteractiveObject)& IObjec
   if(aViewFrame == NULL) return;
 
   Plot2d_Curve* curve = getCurveByIO( IObject );
-  QIntDictIterator<Plot2d_Curve> it( aViewFrame->getCurves() );
-  for ( ; it.current(); ++it ) {
-    if(it.current() != curve)
+  CurveDict aCurves = aViewFrame->getCurves();
+  CurveDict::Iterator it = aCurves.begin();
+  for( ; it != aCurves.end(); ++it ) {
+    if(it.value() != curve)
       aViewFrame->eraseCurve( curve );
     else
       aViewFrame->updateCurve( curve, false );
@@ -308,10 +317,11 @@ Handle(SALOME_InteractiveObject) SPlot2d_Viewer::FindIObject( const char* Entry
   Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
   if(aViewFrame == NULL) return anIO;
 
-  QIntDictIterator<Plot2d_Curve> it( aViewFrame->getCurves() );
-  for ( ; it.current(); ++it ) {
-    SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>(it.current()); 
-    if ( aCurve->hasIO() && !strcmp( aCurve->getIO()->getEntry(), Entry ) ) {
+  CurveDict aCurves = aViewFrame->getCurves();
+  CurveDict::Iterator it = aCurves.begin();
+  for( ; it != aCurves.end(); ++it ) {
+    SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>(it.value()); 
+    if ( aCurve && aCurve->hasIO() && !strcmp( aCurve->getIO()->getEntry(), Entry ) ) {
       anIO = aCurve->getIO();
       break;
     }
@@ -345,9 +355,10 @@ SPlot2d_Curve* SPlot2d_Viewer::getCurveByIO( const Handle(SALOME_InteractiveObje
   if ( !theIObject.IsNull() ) {
     Plot2d_ViewFrame* aViewFrame = fr ? fr : getActiveViewFrame();
     if(aViewFrame) {
-      QIntDictIterator<Plot2d_Curve> it( aViewFrame->getCurves() );
-      for ( ; it.current(); ++it ) {
-       SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>(it.current()); 
+      CurveDict aCurves = aViewFrame->getCurves();
+      CurveDict::Iterator it = aCurves.begin();
+      for( ; it != aCurves.end(); ++it ) {
+        SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>( it.value() );
        if(aCurve) {
          if ( aCurve->hasIO() && aCurve->getIO()->isSame( theIObject ) )
            return aCurve;
@@ -358,30 +369,6 @@ SPlot2d_Curve* SPlot2d_Viewer::getCurveByIO( const Handle(SALOME_InteractiveObje
   return NULL;
 }
 
-/*!
-  SLOT: called when action "Clone view" is activated
-*/
-void SPlot2d_Viewer::onCloneView( Plot2d_ViewFrame* clonedVF, Plot2d_ViewFrame* newVF )
-{
-  if( !clonedVF || !newVF )
-    return;
-
-  // 1) Copy all properties of view
-
-  newVF->copyPreferences( clonedVF );
-
-  // 2) Display all curves displayed in cloned view
-
-  QList<Plot2d_Curve> aCurves;
-  clonedVF->getCurves( aCurves );
-  QList<Plot2d_Curve>::const_iterator anIt = aCurves.begin(), aLast = aCurves.end();
-
-  for( ; anIt!=aLast; anIt++ )
-    if( clonedVF->isVisible( *anIt ) )
-      newVF->displayCurve( *anIt, false );
-  newVF->Repaint();
-}
-
 /*!
   create SPlot2d_ViewWindow
 */
@@ -392,3 +379,29 @@ SUIT_ViewWindow* SPlot2d_Viewer::createView( SUIT_Desktop* theDesktop )
     aPlot2dView->getViewFrame()->Display(getPrs());
   return aPlot2dView;
 }
+
+/*!
+  SLOT: called when action "Legend Clicked" is activated.
+  override "onLegendClicked" method from Plot2d_ViewModel.
+*/
+void SPlot2d_Viewer::onLegendClicked( QwtPlotItem* plotItem )
+{
+  Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
+  if(aViewFrame == NULL) return;
+
+  CurveDict aCurves = aViewFrame->getCurves();
+  SPlot2d_Curve* aSCurve;
+  CurveDict::Iterator it = aCurves.begin();
+  for( ; it != aCurves.end(); ++it )
+  {
+    if ( it.key() == plotItem ) {
+      aSCurve = dynamic_cast<SPlot2d_Curve*>( it.value() );
+      break;
+    }
+  }
+  // Highlight curve in Object Browser
+  if(aSCurve && aSCurve->hasIO()) {
+    QString anEntry = aSCurve->getIO()->getEntry();
+    emit legendSelected( anEntry );
+  }
+}
index 7182def582893641f2b72880c7e3f65035c49691..2fc3491e029209c700ab003d8eada2b5b97ffcab 100644 (file)
@@ -1,25 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SPlot2d_ViewModel.h
 //  Author : Sergey RUIN
 //  Module : SUIT
-
+//
 #ifndef SPlot2d_ViewModel_H
 #define SPlot2d_ViewModel_H
 
@@ -77,7 +80,10 @@ public:
   Handle(SALOME_InteractiveObject) FindIObject( const char* Entry );
 
 protected slots:
-  virtual void onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* );
+  virtual void onLegendClicked( QwtPlotItem* plotItem );
+
+signals:
+  void legendSelected( const QString& );
 };
 
 
index 0e0a376b29423ebbf4513d8326e0257fe3eba303..ce235bfd92b0b372bdaed96c06a3d550c31305d7 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SPlot2d_ViewWindow.h"
 
index a11b45a643aa84328ecf50ad8e2fb6b15cdf5e32..1f9ba0b8014ade3e25c06e8a620bfad0a5cab3d5 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SPLOT2D_VIEWWINDOW_H
 #define SPLOT2D_VIEWWINDOW_H
index b5ec921bef52858184298f13e64688b10cb466d4..ccf18169c2640c74f1d3f1ae5f2b9f64ede2b359 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. translating
 # from French to English, "Foo::Bar" would be translated to "Pub",
 # not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
index 74268363283cfce9c3728a10583b9b7aaa4dac49..fa5aa382a6dc6cbad81fccb790b6f57cddb97307 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : STD
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libstd.la
 
-salomeinclude_HEADERS= \
-       STD_Application.h \
-       STD.h \
-       STD_MDIDesktop.h \
-       STD_SDIDesktop.h \
-       STD_TabDesktop.h \
-       STD_LoadStudiesDlg.h
+salomeinclude_HEADERS =                \
+       STD.h                   \
+       STD_Application.h       \
+       STD_MDIDesktop.h        \
+       STD_SDIDesktop.h        \
+       STD_TabDesktop.h
 
-dist_libstd_la_SOURCES=\
-       STD_Application.cxx \
-       STD_MDIDesktop.cxx \
-       STD_SDIDesktop.cxx \
-       STD_TabDesktop.cxx \
-       STD_LoadStudiesDlg.cxx
+dist_libstd_la_SOURCES =       \
+       STD_Application.cxx     \
+       STD_MDIDesktop.cxx      \
+       STD_SDIDesktop.cxx      \
+       STD_TabDesktop.cxx
 
-MOC_FILES= \
-       STD_Application_moc.cxx \
-       STD_MDIDesktop_moc.cxx \
-       STD_SDIDesktop_moc.cxx \
-       STD_TabDesktop_moc.cxx \
-       STD_LoadStudiesDlg_moc.cxx
+MOC_FILES =                            \
+       STD_Application_moc.cxx         \
+       STD_MDIDesktop_moc.cxx          \
+       STD_SDIDesktop_moc.cxx          \
+       STD_TabDesktop_moc.cxx
 
-nodist_libstd_la_SOURCES= $(MOC_FILES)
+nodist_libstd_la_SOURCES = $(MOC_FILES)
 
-dist_salomeres_DATA=\
-       resources/config \
-       resources/cut.png \
-       resources/copy.png \
-       resources/close.png \
-       resources/cursor_rotate.png \
-       resources/cursor_zoom.png \
-       resources/help.png \
-       resources/new.png \
-       resources/open.png \
-       resources/print.png \
-       resources/paste.png \
-       resources/redo.png \
-       resources/reset.png \
-       resources/save.png \
-       resources/undo_arrow.png \
-       resources/undo.png \
+dist_salomeres_DATA =                  \
+       resources/cascade.png           \
+       resources/close.png             \
+       resources/copy.png              \
+       resources/cut.png               \
+       resources/delete.png            \
+       resources/help.png              \
+       resources/htile.png             \
+       resources/new.png               \
+       resources/open.png              \
+       resources/paste.png             \
+       resources/print.png             \
+       resources/redo.png              \
+       resources/reset.png             \
+       resources/save.png              \
+       resources/undo.png              \
+       resources/vtile.png             \
        resources/std.ini
 
-nodist_salomeres_DATA=\
-       STD_images.qm \
+nodist_salomeres_DATA =        \
+       STD_images.qm   \
        STD_msg_en.qm
 
-libstd_la_CPPFLAGS=$(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
-libstd_la_LDFLAGS=$(QT_MT_LIBS)
-libstd_la_LIBADD=../SUIT/libsuit.la
+libstd_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+libstd_la_LDFLAGS  = $(QT_MT_LIBS)
+libstd_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la
index caeee3b3fa21a3976ba25bfc1568140c24a7e58d..6569cff7fb96dc1b0ccacfcc4316ee87d4d614c1 100755 (executable)
@@ -1,36 +1,35 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef STD_H
 #define STD_H
 
-#if defined STD_EXPORTS
-#if defined WNT
-#define STD_EXPORT             __declspec( dllexport )
+#if defined WIN32
+#  if defined STD_EXPORTS
+#    define STD_EXPORT  __declspec( dllexport )
+#  else
+#    define STD_EXPORT  __declspec( dllimport )
+#  endif
 #else
-#define STD_EXPORT
-#endif
-#else
-#if defined WNT
-#define STD_EXPORT             __declspec( dllimport )
-#else
-#define STD_EXPORT
-#endif
+#  define STD_EXPORT
 #endif
 
 #if defined SOLARIS
@@ -39,7 +38,7 @@
 #define true  1
 #endif
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
 
diff --git a/src/STD/STD.pro b/src/STD/STD.pro
new file mode 100644 (file)
index 0000000..0917122
--- /dev/null
@@ -0,0 +1,59 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = std
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+INCLUDEPATH += ../../include ../Qtx ../SUIT
+LIBS += -L../../lib -lqtx -lsuit
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += STD_EXPORTS
+
+HEADERS  = STD.h
+HEADERS += STD_Application.h
+HEADERS += STD_MDIDesktop.h
+HEADERS += STD_SDIDesktop.h
+HEADERS += STD_TabDesktop.h
+
+SOURCES  = STD_Application.cxx
+SOURCES += STD_MDIDesktop.cxx
+SOURCES += STD_SDIDesktop.cxx
+SOURCES += STD_TabDesktop.cxx
+
+TRANSLATIONS = resources/STD_images.ts \
+               resources/STD_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm resources/*.xml resources/*.ini
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 177dd82956e15c8ceeeeccd78125ac21447f2415..eefdd5165818556bfb57c471d6e26f25c13fdb2c 100755 (executable)
@@ -1,48 +1,46 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "STD_Application.h"
 
 #include "STD_MDIDesktop.h"
 
 #include <SUIT_Tools.h>
+#include <SUIT_Study.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_Session.h>
-#include <SUIT_ViewModel.h>
-#include <SUIT_Operation.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_ViewManager.h>
 #include <SUIT_ResourceMgr.h>
-#include <SUIT_MsgDlg.h>
 
 #include <QtxDockAction.h>
+#include <QtxMenu.h>
 #include <QtxActionMenuMgr.h>
 #include <QtxActionToolMgr.h>
-#include <QtxPopupMenu.h>
-
-#include <qmenubar.h>
-#include <qtoolbar.h>
-#include <qpopupmenu.h>
-#include <qstatusbar.h>
-#include <qfiledialog.h>
-#include <qapplication.h>
-#include <qmessagebox.h>
 
-#include <iostream>
+#include <QMenu>
+#include <QStatusBar>
+#include <QCloseEvent>
+#include <QFileDialog>
+#include <QApplication>
 
 /*!Create and return new instance of STD_Application*/
 extern "C" STD_EXPORT SUIT_Application* createApplication()
@@ -57,9 +55,7 @@ STD_Application::STD_Application()
   myExitConfirm( true ),
   myEditEnabled( true )
 {
-  STD_MDIDesktop* desk = new STD_MDIDesktop();
-
-  setDesktop( desk );
+  setDesktop( new STD_MDIDesktop() );
 }
 
 /*!Destructor.*/
@@ -109,15 +105,20 @@ void STD_Application::closeApplication()
     savePreferences();
   SUIT_Study* study = activeStudy();
 
-  if ( study ){
+  if ( study )
+  {
+    beforeCloseDoc( study );
+
     study->closeDocument();
 
     setActiveStudy( 0 );
     delete study;
+
+    afterCloseDoc();
   }
 
   setDesktop( 0 );
-  
+
   SUIT_Application::closeApplication();
 }
 
@@ -153,57 +154,62 @@ void STD_Application::createActions()
   createAction( FileNewId, tr( "TOT_DESK_FILE_NEW" ),
                 resMgr->loadPixmap( "STD", tr( "ICON_FILE_NEW" ) ),
                 tr( "MEN_DESK_FILE_NEW" ), tr( "PRP_DESK_FILE_NEW" ),
-                CTRL+Key_N, desk, false, this, SLOT( onNewDoc() ) );
+                Qt::CTRL+Qt::Key_N, desk, false, this, SLOT( onNewDoc() ) );
 
   createAction( FileOpenId, tr( "TOT_DESK_FILE_OPEN" ),
                 resMgr->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
                 tr( "MEN_DESK_FILE_OPEN" ), tr( "PRP_DESK_FILE_OPEN" ),
-                CTRL+Key_O, desk, false, this, SLOT( onOpenDoc() ) );
+                Qt::CTRL+Qt::Key_O, desk, false, this, SLOT( onOpenDoc() ) );
 
   createAction( FileCloseId, tr( "TOT_DESK_FILE_CLOSE" ),
                 resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ),
                 tr( "MEN_DESK_FILE_CLOSE" ), tr( "PRP_DESK_FILE_CLOSE" ),
-                CTRL+Key_W, desk, false, this, SLOT( onCloseDoc() ) );
+                Qt::CTRL+Qt::Key_W, desk, false, this, SLOT( onCloseDoc() ) );
 
-  createAction( FileExitId, tr( "TOT_DESK_FILE_EXIT" ), QIconSet(),
+  createAction( FileExitId, tr( "TOT_DESK_FILE_EXIT" ), QIcon(),
                 tr( "MEN_DESK_FILE_EXIT" ), tr( "PRP_DESK_FILE_EXIT" ),
-                CTRL+Key_Q, desk, false, this, SLOT( onExit() ) );
+                Qt::CTRL+Qt::Key_Q, desk, false, this, SLOT( onExit() ) );
 
   createAction( FileSaveId, tr( "TOT_DESK_FILE_SAVE" ),
                 resMgr->loadPixmap( "STD", tr( "ICON_FILE_SAVE" ) ),
                 tr( "MEN_DESK_FILE_SAVE" ), tr( "PRP_DESK_FILE_SAVE" ),
-                CTRL+Key_S, desk, false, this, SLOT( onSaveDoc() ) );
+                Qt::CTRL+Qt::Key_S, desk, false, this, SLOT( onSaveDoc() ) );
 
-  createAction( FileSaveAsId, tr( "TOT_DESK_FILE_SAVEAS" ), QIconSet(),
+  createAction( FileSaveAsId, tr( "TOT_DESK_FILE_SAVEAS" ), QIcon(),
                 tr( "MEN_DESK_FILE_SAVEAS" ), tr( "PRP_DESK_FILE_SAVEAS" ),
-                CTRL+Key_A, desk, false, this, SLOT( onSaveAsDoc() ) );
+                Qt::CTRL+Qt::Key_A, desk, false, this, SLOT( onSaveAsDoc() ) );
 
   createAction( EditCopyId, tr( "TOT_DESK_EDIT_COPY" ),
                 resMgr->loadPixmap( "STD", tr( "ICON_EDIT_COPY" ) ),
                 tr( "MEN_DESK_EDIT_COPY" ), tr( "PRP_DESK_EDIT_COPY" ),
-                CTRL+Key_C, desk, false, this, SLOT( onCopy() ) );
+                Qt::CTRL+Qt::Key_C, desk, false, this, SLOT( onCopy() ) );
 
   createAction( EditPasteId, tr( "TOT_DESK_EDIT_PASTE" ),
                 resMgr->loadPixmap( "STD", tr( "ICON_EDIT_PASTE" ) ),
                 tr( "MEN_DESK_EDIT_PASTE" ), tr( "PRP_DESK_EDIT_PASTE" ),
-                CTRL+Key_V, desk, false, this, SLOT( onPaste() ) );
+                Qt::CTRL+Qt::Key_V, desk, false, this, SLOT( onPaste() ) );
 
   QAction* a = createAction( ViewStatusBarId, tr( "TOT_DESK_VIEW_STATUSBAR" ),
-                             QIconSet(), tr( "MEN_DESK_VIEW_STATUSBAR" ),
-                             tr( "PRP_DESK_VIEW_STATUSBAR" ), SHIFT+Key_S, desk, true );
-  a->setOn( desk->statusBar()->isVisibleTo( desk ) );
+                             QIcon(), tr( "MEN_DESK_VIEW_STATUSBAR" ),
+                             tr( "PRP_DESK_VIEW_STATUSBAR" ), Qt::SHIFT+Qt::Key_S, desk, true );
+  a->setChecked( desk->statusBar()->isVisibleTo( desk ) );
   connect( a, SIGNAL( toggled( bool ) ), this, SLOT( onViewStatusBar( bool ) ) );
 
-  createAction( NewWindowId, tr( "TOT_DESK_NEWWINDOW" ), QIconSet(),
+  createAction( NewWindowId, tr( "TOT_DESK_NEWWINDOW" ), QIcon(),
                 tr( "MEN_DESK_NEWWINDOW" ), tr( "PRP_DESK_NEWWINDOW" ), 0, desk  );
 
-  createAction( HelpAboutId, tr( "TOT_DESK_HELP_ABOUT" ), QIconSet(),
+  createAction( HelpAboutId, tr( "TOT_DESK_HELP_ABOUT" ), QIcon(),
                 tr( "MEN_DESK_HELP_ABOUT" ), tr( "PRP_DESK_HELP_ABOUT" ),
-                SHIFT+Key_A, desk, false, this, SLOT( onHelpAbout() ) );
+                Qt::SHIFT+Qt::Key_A, desk, false, this, SLOT( onHelpAbout() ) );
+
+
+  QtxDockAction* dwa = new QtxDockAction( tr( "TOT_DOCKWINDOWS" ), tr( "MEN_DESK_VIEW_DOCKWINDOWS" ), desk );
+  dwa->setDockType( QtxDockAction::DockWidget );
+  registerAction( ViewWindowsId, dwa );
 
-  QtxDockAction* da = new QtxDockAction( tr( "TOT_DOCK_WINDOWS" ), tr( "MEN_DOCK_WINDOWS" ), desk );
-  registerAction( ViewWindowsId, da );
-  da->setAutoPlace( false );
+  QtxDockAction* tba = new QtxDockAction( tr( "TOT_TOOLBARS" ), tr( "MEN_DESK_VIEW_TOOLBARS" ), desk );
+  tba->setDockType( QtxDockAction::ToolBar );
+  registerAction( ViewToolBarsId, tba );
 
   // Create menus
 
@@ -216,11 +222,11 @@ void STD_Application::createActions()
 
   createMenu( FileNewId,    fileMenu, 0 );
   createMenu( FileOpenId,   fileMenu, 0 );
-  createMenu( FileCloseId,  fileMenu, 0 );
-  createMenu( separator(),  fileMenu, -1, 0 );
-  createMenu( FileSaveId,   fileMenu, 0 );
-  createMenu( FileSaveAsId, fileMenu, 0 );
-  createMenu( separator(),  fileMenu, -1, 0 );
+  createMenu( FileCloseId,  fileMenu, 5 );
+  createMenu( separator(),  fileMenu, -1, 5 );
+  createMenu( FileSaveId,   fileMenu, 5 );
+  createMenu( FileSaveAsId, fileMenu, 5 );
+  createMenu( separator(),  fileMenu, -1, 5 );
 
   createMenu( separator(),  fileMenu );
   createMenu( FileExitId,   fileMenu );
@@ -229,6 +235,7 @@ void STD_Application::createActions()
   createMenu( EditPasteId, editMenu );
   createMenu( separator(), editMenu );
 
+  createMenu( ViewToolBarsId,  viewMenu, 0 );
   createMenu( ViewWindowsId,   viewMenu, 0 );
   createMenu( separator(),     viewMenu, -1, 10 );
   createMenu( ViewStatusBarId, viewMenu, 10 );
@@ -255,34 +262,52 @@ void STD_Application::createActions()
 /*!Opens new application*/
 void STD_Application::onNewDoc()
 {
-  QApplication::setOverrideCursor( Qt::waitCursor );
+  onNewDoc( QString() );
+}
+
+/*!Opens new application*/
+bool STD_Application::onNewDoc( const QString& name )
+{
+  QApplication::setOverrideCursor( Qt::WaitCursor );
 
+  bool res = true;
   if ( !activeStudy() )
   {
     createEmptyStudy();
-    activeStudy()->createDocument();
-    studyCreated( activeStudy() );
+    res = activeStudy()->createDocument( name );
+    if ( res )
+      studyCreated( activeStudy() );
+    else
+    {
+      SUIT_Study* st = activeStudy();
+      setActiveStudy( 0 );
+      delete st;
+    }
   }
   else
   {
     SUIT_Application* aApp = startApplication( 0, 0 );
     if ( aApp->inherits( "STD_Application" ) )
-      ((STD_Application*)aApp)->onNewDoc();
+      res = ((STD_Application*)aApp)->onNewDoc( name );
     else
     {
       aApp->createEmptyStudy();
-      aApp->activeStudy()->createDocument();
+      res = aApp->activeStudy()->createDocument( name );
     }
+    if ( !res )
+      aApp->closeApplication();
   }
 
   QApplication::restoreOverrideCursor();
+
+  return res;
 }
 
 /*!Put file name from file dialog to onOpenDoc(const QString&) function*/
 void STD_Application::onOpenDoc()
 {
   // It is preferrable to use OS-specific file dialog box here !!!
-  QString aName = getFileName( true, QString::null, getFileFilter(), QString::null, 0 );
+  QString aName = getFileName( true, QString(), getFileFilter(), QString(), 0 );
   if ( aName.isNull() )
     return;
 
@@ -292,78 +317,15 @@ void STD_Application::onOpenDoc()
 /*! \retval true, if document was opened successful, else false.*/
 bool STD_Application::onOpenDoc( const QString& aName )
 {
-  QApplication::setOverrideCursor( Qt::waitCursor );
-
-  bool res = true;
-  if ( !activeStudy() )
-  {
-    // if no study - open in current desktop
-    res = useFile( aName );
-  }
-  else
-  {
-    // if study exists - open in new desktop. Check: is the same file is opened?
-    SUIT_Session* aSession = SUIT_Session::session();
-    QPtrList<SUIT_Application> aAppList = aSession->applications();
-    bool isAlreadyOpen = false;
-    SUIT_Application* aApp = 0;
-    for ( QPtrListIterator<SUIT_Application> it( aAppList ); it.current() && !isAlreadyOpen; ++it )
-    {
-      aApp = it.current();
-      if ( aApp->activeStudy()->studyName() == aName )
-        isAlreadyOpen = true;
-    }
-    if ( !isAlreadyOpen )
-    {
-      aApp = startApplication( 0, 0 );
-      if ( aApp )
-        res = aApp->useFile( aName );
-      if ( !res )
-        aApp->closeApplication();
-    }
-    else
-      aApp->desktop()->setActiveWindow();
-  }
+  QApplication::setOverrideCursor( Qt::WaitCursor );
 
+  bool res = openAction( openChoice( aName ), aName );
+  
   QApplication::restoreOverrideCursor();
 
   return res;
 }
 
-/*! \retval true, if document was loaded successful, else false.*/
-bool STD_Application::onLoadDoc( const QString& aName )
-{
-  bool res = true;
-  if ( !activeStudy() )
-  {
-    // if no study - load in current desktop
-    res = useStudy( aName );
-  }
-  else
-  {
-    // if study exists - load in new desktop. Check: is the same file is loaded?
-    SUIT_Session* aSession = SUIT_Session::session();
-    QPtrList<SUIT_Application> aAppList = aSession->applications();
-    bool isAlreadyOpen = false;
-    SUIT_Application* aApp = 0;
-    for ( QPtrListIterator<SUIT_Application> it( aAppList ); it.current() && !isAlreadyOpen; ++it )
-    {
-      aApp = it.current();
-      if ( aApp->activeStudy()->studyName() == aName )
-        isAlreadyOpen = true;
-    }
-    if ( !isAlreadyOpen )
-    {
-      aApp = startApplication( 0, 0 );
-      if ( aApp )
-        res = aApp->useStudy( aName );
-    }
-    else
-      aApp->desktop()->setActiveWindow();
-  }
-  return res;
-}
-
 /*!Virtual function. Not implemented here.*/
 void STD_Application::beforeCloseDoc( SUIT_Study* )
 {
@@ -392,15 +354,12 @@ void STD_Application::onCloseDoc( bool ask )
   clearViewManagers();
 
   setActiveStudy( 0 );
-  delete study;
 
   int aNbStudies = 0;
-  QPtrList<SUIT_Application> apps = SUIT_Session::session()->applications();
-  for ( unsigned i = 0; i < apps.count(); i++ )
+  QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
+  for ( int i = 0; i < apps.count(); i++ )
     aNbStudies += apps.at( i )->getNbStudies();
 
-  // STV: aNbStudies - number of currently existing studies (exclude currently closed)
-  // STV: aNbStudies should be compared with 0.
   if ( aNbStudies )
   {
     savePreferences();
@@ -412,6 +371,9 @@ void STD_Application::onCloseDoc( bool ask )
     updateCommandsStatus();
   }
 
+  // IPAL19532: deleting study should be performed after calling setDesktop(0)
+  delete study;
+
   afterCloseDoc();
 
   if ( !desktop() )
@@ -428,36 +390,28 @@ bool STD_Application::isPossibleToClose( bool& closePermanently )
     activeStudy()->abortAllOperations();
     if ( activeStudy()->isModified() )
     {
-      QString sName = activeStudy()->studyName().stripWhiteSpace();
+      QString sName = activeStudy()->studyName().trimmed();
       return closeAction( closeChoice( sName ), closePermanently );
     }
   }
   return true;
 }
 
-/*!
-  \brief Show dialog box to propose possible user actions when study is closed.
-  \param docName study name
-  \return chosen action ID
-  \sa closeAction()
-*/
 int STD_Application::closeChoice( const QString& docName )
 {
-  SUIT_MsgDlg dlg( desktop(), tr( "CLOSE_DLG_CAPTION" ), tr ( "CLOSE_DLG_DESCRIPTION" ),
-                  QMessageBox::standardIcon( QMessageBox::Information ) );
-  dlg.addButton( tr ( "CLOSE_DLG_SAVE_CLOSE" ), CloseSave );
-  dlg.addButton( tr ( "CLOSE_DLG_CLOSE" ), CloseDiscard );
+  int answer = SUIT_MessageBox::question( desktop(), tr( "CLOSE_STUDY" ), tr( "CLOSE_QUESTION" ).arg( docName ),
+                                          SUIT_MessageBox::Save | SUIT_MessageBox::Discard | SUIT_MessageBox::Cancel,
+                                          SUIT_MessageBox::Save );
 
-  return dlg.exec();
+  int res = CloseCancel;
+  if ( answer == SUIT_MessageBox::Save )
+    res = CloseSave;
+  else if ( answer == SUIT_MessageBox::Discard )
+    res = CloseDiscard;
+
+  return res;
 }
 
-/*!
-  \brief Process user actions selected from the dialog box when study is closed.
-  \param choice chosen action ID
-  \param closePermanently "forced study closing" flag
-  \return operation status
-  \sa closeChoice()
-*/
 bool STD_Application::closeAction( const int choice, bool& closePermanently )
 {
   bool res = true;
@@ -479,6 +433,58 @@ bool STD_Application::closeAction( const int choice, bool& closePermanently )
   return res;
 }
 
+int STD_Application::openChoice( const QString& aName )
+{
+  SUIT_Session* aSession = SUIT_Session::session();
+
+  bool isAlreadyOpen = false;
+  QList<SUIT_Application*> aAppList = aSession->applications();
+  for ( QList<SUIT_Application*>::iterator it = aAppList.begin(); it != aAppList.end() && !isAlreadyOpen; ++it )
+    isAlreadyOpen = (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName;
+  return isAlreadyOpen ? OpenExist : OpenNew;
+}
+
+bool STD_Application::openAction( const int choice, const QString& aName )
+{
+  bool res = true;
+  switch ( choice )
+  {
+  case OpenExist:
+    {
+      SUIT_Application* aApp = 0;
+      SUIT_Session* aSession = SUIT_Session::session();
+      QList<SUIT_Application*> aAppList = aSession->applications();
+      for ( QList<SUIT_Application*>::iterator it = aAppList.begin(); it != aAppList.end() && !aApp; ++it )
+      {
+       if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName )
+         aApp = *it;
+      }
+      if ( aApp )
+       aApp->desktop()->activateWindow();
+      else
+       res = false;
+    }
+    break;
+  case OpenNew:
+    if ( !activeStudy() )
+      res = useFile( aName );
+    else
+    {
+      SUIT_Application* aApp = startApplication( 0, 0 );
+      if ( aApp )
+       res = aApp->useFile( aName );
+      if ( !res )
+       aApp->closeApplication();
+    }
+    break;
+  case OpenCancel:
+  default:
+    res = false;
+  }
+
+  return res;
+}
+
 /*!Save document if all ok, else error message.*/
 void STD_Application::onSaveDoc()
 {
@@ -490,7 +496,7 @@ void STD_Application::onSaveDoc()
   {
     putInfo( tr( "INF_DOC_SAVING" ) + activeStudy()->studyName() );
 
-    QApplication::setOverrideCursor( Qt::waitCursor );
+    QApplication::setOverrideCursor( Qt::WaitCursor );
 
     isOk = activeStudy()->saveDocument();
 
@@ -500,10 +506,8 @@ void STD_Application::onSaveDoc()
     {
       putInfo( "" );
       // displaying a message box as SUIT_Validator in case file can't be written (the most frequent case)
-      SUIT_MessageBox::error1( desktop(), 
-                              tr( "ERR_ERROR" ),
-                              tr( "ERR_PERMISSION_DENIED" ).arg( activeStudy()->studyName() ),
-                              tr( "BUT_OK" ) );
+      SUIT_MessageBox::critical( desktop(), tr( "ERR_ERROR" ),
+                                 tr( "ERR_PERMISSION_DENIED" ).arg( activeStudy()->studyName() ) );
     }
     else
       putInfo( tr( "INF_DOC_SAVED" ).arg( "" ) );
@@ -525,11 +529,11 @@ bool STD_Application::onSaveAsDoc()
   bool isOk = false;
   while ( !isOk )
   {
-    QString aName = getFileName( false, study->studyName(), getFileFilter(), QString::null, 0 );
+    QString aName = getFileName( false, study->studyName(), getFileFilter(), QString(), 0 );
     if ( aName.isNull() )
       return false;
 
-    QApplication::setOverrideCursor( Qt::waitCursor );
+    QApplication::setOverrideCursor( Qt::WaitCursor );
 
     putInfo( tr( "INF_DOC_SAVING" ) + aName );
     isOk = study->saveDocumentAs( aName );
@@ -539,9 +543,7 @@ bool STD_Application::onSaveAsDoc()
     QApplication::restoreOverrideCursor();
 
     if ( !isOk )
-      SUIT_MessageBox::error1( desktop(), tr( "ERROR" ),
-                              tr( "INF_DOC_SAVING_FAILS" ).arg( aName ), 
-                              tr( "BUT_OK" ) );
+      SUIT_MessageBox::critical( desktop(), tr( "ERROR" ), tr( "INF_DOC_SAVING_FAILS" ).arg( aName ) );
   }
 
   studySaved( activeStudy() );
@@ -552,14 +554,12 @@ bool STD_Application::onSaveAsDoc()
 /*!Closing session.*/
 void STD_Application::onExit()
 {
-  if ( !exitConfirmation() || 
-       SUIT_MessageBox::info2( desktop(), 
-                              tr( "INF_DESK_EXIT" ), 
-                              tr( "QUE_DESK_EXIT" ),
-                              tr( "BUT_OK" ),
-                              tr( "BUT_CANCEL" ), 1, 2, 2 ) == 1 ) {
+  int aAnswer = SUIT_MessageBox::Ok;
+  if ( exitConfirmation() )
+    aAnswer = SUIT_MessageBox::question( desktop(), tr( "INF_DESK_EXIT" ), tr( "QUE_DESK_EXIT" ),
+                                         SUIT_MessageBox::Ok | SUIT_MessageBox::Cancel, SUIT_MessageBox::Cancel );
+  if ( aAnswer == SUIT_MessageBox::Ok )
     SUIT_Session::session()->closeSession();
-  }
 }
 
 /*!Virtual slot. Not implemented here.*/
@@ -608,12 +608,12 @@ void STD_Application::updateDesktopTitle()
 
   if ( activeStudy() )
   {
-    QString sName = SUIT_Tools::file( activeStudy()->studyName().stripWhiteSpace(), false );
+    QString sName = SUIT_Tools::file( activeStudy()->studyName().trimmed(), false );
     if ( !sName.isEmpty() )
       aTitle += QString( " - [%1]" ).arg( sName );
   }
 
-  desktop()->setCaption( aTitle );
+  desktop()->setWindowTitle( aTitle );
 }
 
 /*!Update commands status.*/
@@ -640,10 +640,10 @@ void STD_Application::updateCommandsStatus()
 SUIT_ViewManager* STD_Application::viewManager( const QString& vmType ) const
 {
   SUIT_ViewManager* vm = 0;
-  for ( QPtrListIterator<SUIT_ViewManager> it( myViewMgrs ); it.current() && !vm; ++it )
+  for ( QList<SUIT_ViewManager*>::const_iterator it = myViewMgrs.begin(); it != myViewMgrs.end() && !vm; ++it )
   {
-    if ( it.current()->getType() == vmType )
-      vm = it.current();
+    if ( (*it)->getType() == vmType )
+      vm = *it;
   }
   return vm;
 }
@@ -653,16 +653,18 @@ SUIT_ViewManager* STD_Application::viewManager( const QString& vmType ) const
  */
 void STD_Application::viewManagers( const QString& vmType, ViewManagerList& lst ) const
 {
-  for ( QPtrListIterator<SUIT_ViewManager> it( myViewMgrs ); it.current(); ++it )
-    if ( it.current()->getType() == vmType )
-      lst.append( it.current() );
+  for ( QList<SUIT_ViewManager*>::const_iterator it = myViewMgrs.begin(); it != myViewMgrs.end(); ++it )
+  {
+    if ( (*it)->getType() == vmType )
+      lst.append( *it );
+  }
 }
 
 /*!\param lst - output list of all view managers.*/
 void STD_Application::viewManagers( ViewManagerList& lst ) const
 {
-  for ( QPtrListIterator<SUIT_ViewManager> it( myViewMgrs ); it.current(); ++it )
-    lst.append( it.current() );
+  for ( QList<SUIT_ViewManager*>::const_iterator it = myViewMgrs.begin(); it != myViewMgrs.end(); ++it )
+    lst.append( *it );
 }
 
 /*!\retval ViewManagerList - const list of all view managers.*/
@@ -713,7 +715,7 @@ void STD_Application::removeViewManager( SUIT_ViewManager* vm )
   vm->disconnectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
   disconnect( vm, SIGNAL( activated( SUIT_ViewManager* ) ),
              this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) );
-  myViewMgrs.removeRef( vm );
+  myViewMgrs.removeAll( vm );
 
   if ( myActiveViewMgr == vm )
     myActiveViewMgr = 0;
@@ -725,8 +727,9 @@ void STD_Application::clearViewManagers()
   ViewManagerList lst;
   viewManagers( lst );
 
-  for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
-    QGuardedPtr<SUIT_ViewManager> vm = it.current();
+  for ( QList<SUIT_ViewManager*>::iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    QPointer<SUIT_ViewManager> vm = *it;
     removeViewManager( vm );
     delete vm;
   }
@@ -735,7 +738,7 @@ void STD_Application::clearViewManagers()
 /*!\retval TRUE, if view manager \a vm, already in view manager list (\a myViewMgrs).*/
 bool STD_Application::containsViewManager( SUIT_ViewManager* vm ) const
 {
-  return myViewMgrs.contains( vm ) > 0;
+  return myViewMgrs.contains( vm );
 }
 
 /*!Private slot, sets active manager to \vm, if \vm in view managers list.*/
@@ -756,7 +759,7 @@ void STD_Application::onViewStatusBar( bool on )
 /*!Call SUIT_MessageBox::info1(...) with about information.*/
 void STD_Application::onHelpAbout()
 {
-  SUIT_MessageBox::info1( desktop(), tr( "About" ), tr( "ABOUT_INFO" ), "&OK" );
+  SUIT_MessageBox::information( desktop(), tr( "About" ), tr( "ABOUT_INFO" ) );
 }
 
 /*!Create empty study. \n
@@ -765,10 +768,6 @@ void STD_Application::onHelpAbout()
 void STD_Application::createEmptyStudy()
 {
   SUIT_Application::createEmptyStudy();
-
-  SUIT_ViewManager* vm = new SUIT_ViewManager( activeStudy(), desktop(), new SUIT_ViewModel() );
-
-  addViewManager( vm );
 }
 
 /*!Sets active manager to \vm, if \vm in view managers list.*/
@@ -784,25 +783,23 @@ void STD_Application::setActiveViewManager( SUIT_ViewManager* vm )
 /*!Public slot. */
 void STD_Application::onConnectPopupRequest( SUIT_PopupClient* client, QContextMenuEvent* e )
 {
-  QtxPopupMenu* popup = new QtxPopupMenu();
+  QtxMenu* popup = new QtxMenu();
   // fill popup by own items
   QString title;
   contextMenuPopup( client->popupClientType(), popup, title );
   popup->setTitleText( title );
 
-  popup->insertSeparator();
+  popup->addSeparator();
   // add items from popup client
   client->contextMenuPopup( popup );
 
   SUIT_Tools::simplifySeparators( popup );
 
-  if ( popup->count() )
+  if ( !popup->actions().isEmpty() )
     popup->exec( e->globalPos() );
   delete popup;
 }
 
-#include <qregexp.h>
-
 /*!\retval QString - return file name from dialog.*/
 QString STD_Application::getFileName( bool open, const QString& initial, const QString& filters,
                                      const QString& caption, QWidget* parent )
@@ -810,9 +807,7 @@ QString STD_Application::getFileName( bool open, const QString& initial, const Q
   if ( !parent )
     parent = desktop();
   if ( open )
-  {
-    return QFileDialog::getOpenFileName( initial, filters, parent, 0, caption );
-  }
+    return QFileDialog::getOpenFileName( parent, caption, initial, filters );
   else
   {
     QString aName;
@@ -823,45 +818,45 @@ QString STD_Application::getFileName( bool open, const QString& initial, const Q
     while ( !isOk )
     {
       // It is preferrable to use OS-specific file dialog box here !!!
-      aName = QFileDialog::getSaveFileName( anOldPath, filters, parent, 0, caption, &aUsedFilter );
+      aName = QFileDialog::getSaveFileName( parent, caption, anOldPath, filters, &aUsedFilter );
 
       if ( aName.isNull() )
         isOk = true;
       else
       {
-             int aEnd = aUsedFilter.findRev( ')' );
-             int aStart = aUsedFilter.findRev( '(', aEnd );
-             QString wcStr = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 );
+       int aEnd = aUsedFilter.lastIndexOf( ')' );
+       int aStart = aUsedFilter.lastIndexOf( '(', aEnd );
+       QString wcStr = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 );
 
         int idx = 0;
         QStringList extList;
         QRegExp rx( "[\b\\*]*\\.([\\w]+)" );
-        while ( ( idx = rx.search( wcStr, idx ) ) != -1 )
+        while ( ( idx = rx.indexIn( wcStr, idx ) ) != -1 )
         {
           extList.append( rx.cap( 1 ) );
           idx += rx.matchedLength();
         }
 
-        if ( !extList.isEmpty() && !extList.contains( QFileInfo( aName ).extension() ) )
+        if ( !extList.isEmpty() && !extList.contains( SUIT_Tools::extension( aName ) ) )
           aName += QString( ".%1" ).arg( extList.first() );
 
-             if ( QFileInfo( aName ).exists() )
+       if ( QFileInfo( aName ).exists() )
         {
-               int aAnswer = SUIT_MessageBox::warn3( desktop(), tr( "TIT_FILE_SAVEAS" ),
-                                                                             tr( "MSG_FILE_EXISTS" ).arg( aName ),
-                                                                             tr( "BUT_YES" ), tr( "BUT_NO" ), tr( "BUT_CANCEL" ), 1, 2, 3, 1 );
-               if ( aAnswer == 3 )
+         int aAnswer = SUIT_MessageBox::question( desktop(), tr( "TIT_FILE_SAVEAS" ),
+                                                  tr( "MSG_FILE_EXISTS" ).arg( aName ),
+                                                  SUIT_MessageBox::Yes | SUIT_MessageBox::No | SUIT_MessageBox::Cancel, SUIT_MessageBox::Yes );
+         if ( aAnswer == SUIT_MessageBox::Cancel )
           {     // cancelled
-            aName = QString::null;
-                 isOk = true;
+            aName = QString();
+           isOk = true;
           }
-               else if ( aAnswer == 2 ) // not save to this file
-                 anOldPath = aName;             // not to return to the same initial dir at each "while" step
-               else                     // overwrite the existing file
-                 isOk = true;
+         else if ( aAnswer == SUIT_MessageBox::No ) // not save to this file
+           anOldPath = aName;             // not to return to the same initial dir at each "while" step
+         else                     // overwrite the existing file
+           isOk = true;
         }
-             else
-               isOk = true;
+       else
+         isOk = true;
       }
     }
     return aName;
@@ -873,7 +868,8 @@ QString STD_Application::getDirectory( const QString& initial, const QString& ca
 {
   if ( !parent )
     parent = desktop();
-  return QFileDialog::getExistingDirectory( initial, parent, 0, caption, true );
+
+  return QFileDialog::getExistingDirectory( parent, caption, initial );
 }
 
 /*!
index 13ff29e641197d670efedad2d42bc8802b1c3811..41ba71a88e36fae21e035f31af268eca79c67268 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef STD_APPLICATION_H
 #define STD_APPLICATION_H
 
 #include <SUIT_Application.h>
 
-#include <SUIT_Desktop.h>
-#include <SUIT_ViewManager.h>
+#include <QList>
 
-#include <qmap.h>
-#include <qptrlist.h>
+class QMenu;
+class QCloseEvent;
+class QContextMenuEvent;
 
 class QToolBar;
 class QtxAction;
-class QPopupMenu;
 class SUIT_Operation;
 class SUIT_ViewWindow;
 class SUIT_ToolWindow;
+class SUIT_Desktop;
+class SUIT_ViewManager;
+class SUIT_PopupClient;
 
-typedef QPtrList<SUIT_ViewManager> ViewManagerList;
+typedef QList<SUIT_ViewManager*> ViewManagerList;
 
 #if defined WIN32
 #pragma warning( disable: 4251 )
@@ -47,6 +52,14 @@ class STD_EXPORT STD_Application : public SUIT_Application
   Q_OBJECT
 
 public:
+  enum { MenuFileId, FileNewId, FileOpenId, FileCloseId, FileSaveId, FileSaveAsId, FileExitId,
+         MenuViewId, ViewWindowsId, ViewToolBarsId, ViewStatusBarId, NewWindowId,
+         MenuEditId, EditCutId, EditCopyId, EditPasteId,
+         MenuHelpId, HelpAboutId,
+         UserID
+  };
+
+ public:
   STD_Application();
   virtual ~STD_Application();
 
@@ -73,20 +86,22 @@ public:
   void                  viewManagers( ViewManagerList& ) const;
   void                  viewManagers( const QString&, ViewManagerList& ) const;
 
-  virtual QString       getFileFilter() const { return QString::null; }
-  virtual QString       getFileName( bool open, const QString& initial, const QString& filters, 
-                                    const QString& caption, QWidget* parent );
+  virtual QString       getFileFilter() const { return QString(); }
+  virtual QString       getFileName( bool open, const QString& initial, const QString& filters,
+                                                            const QString& caption, QWidget* parent );
   QString               getDirectory( const QString& initial, const QString& caption, QWidget* parent );
 
   virtual void          start();
 
   virtual void          closeApplication();
 
-  virtual void          contextMenuPopup( const QString&, QPopupMenu*, QString& ) {}
+  virtual void          contextMenuPopup( const QString&, QMenu*, QString& ) {}
 
   bool                  exitConfirmation() const;
   void                  setExitConfirmation( const bool );
 
+  virtual void          updateDesktopTitle();
+
 signals:
   /*!emit that view manager added*/
   void                  viewManagerAdded( SUIT_ViewManager* );
@@ -97,6 +112,8 @@ signals:
 
 public slots:
   virtual void          onNewDoc();
+  virtual bool          onNewDoc( const QString& );
+
   virtual void          onCloseDoc( bool ask = true );
   virtual void          onSaveDoc();
   virtual bool          onSaveAsDoc();
@@ -104,8 +121,6 @@ public slots:
   virtual void          onOpenDoc();
   virtual bool          onOpenDoc( const QString& );
 
-  virtual bool          onLoadDoc( const QString& );
-
   virtual void          onExit();
 
   virtual void          onCopy();
@@ -122,25 +137,11 @@ private slots:
   virtual void          onViewManagerActivated( SUIT_ViewManager* );
 
 protected:
-  enum {  MenuFileId = 1,
-          MenuViewId = 2,
-          MenuEditId = 3,
-          MenuHelpId = 7
-       };
-
-  enum {  FileNewId,   FileOpenId,   FileCloseId,
-         FileSaveId,  FileSaveAsId, FileExitId, 
-         ViewStatusBarId, ViewWindowsId, NewWindowId,
-          EditCutId, EditCopyId, EditPasteId,
-          HelpAboutId,
-         UserID
-       };
+  enum { OpenCancel, OpenNew, OpenExist };
   enum { CloseCancel, CloseSave, CloseDiscard };
 
 protected:
   virtual void          createActions();
-  virtual void          updateDesktopTitle();
   virtual void          updateCommandsStatus();
 
   virtual void          setDesktop( SUIT_Desktop* );
@@ -157,8 +158,11 @@ protected:
 
   virtual void          setActiveViewManager( SUIT_ViewManager* );
 
-  virtual bool          closeAction( const int, bool& );
+  virtual int           openChoice( const QString& );
+  virtual bool          openAction( const int, const QString& );
+
   virtual int           closeChoice( const QString& );
+  virtual bool          closeAction( const int, bool& );
 
 private:
   ViewManagerList       myViewMgrs;
diff --git a/src/STD/STD_LoadStudiesDlg.cxx b/src/STD/STD_LoadStudiesDlg.cxx
deleted file mode 100644 (file)
index 5dc4c0d..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "STD_LoadStudiesDlg.h"
-
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlistbox.h>
-#include <qpushbutton.h>
-
-#define SPACING_SIZE             6
-#define MARGIN_SIZE             11
-#define MIN_LISTBOX_WIDTH      150
-#define MIN_LISTBOX_HEIGHT     100
-
-/*!
-* \brief creates a Load study dialog box
-* \param parent a parent widget
-* \param modal bool argument, if true the dialog box is a modal dialog box
-* \param f style flags
-*/
-
-STD_LoadStudiesDlg::STD_LoadStudiesDlg( QWidget* parent,  bool modal, WFlags fl )
-: QDialog( parent, "STD_LoadStudiesDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
-{
-    resize( 321, 181 ); 
-    setCaption( tr("DLG_LOAD_STUDY_CAPTION") );
-    setSizeGripEnabled( TRUE );
-
-    QGridLayout* aTopLayout = new QGridLayout(this);
-    aTopLayout->setMargin(MARGIN_SIZE);
-    aTopLayout->setSpacing(SPACING_SIZE);
-
-    TextLabel1 = new QLabel( this, "TextLabel1" );
-    TextLabel1->setGeometry( QRect( 11, 12, 297, 16 ) ); 
-    TextLabel1->setText( tr( "MEN_STUDIES_CHOICE"  ) );
-
-    QHBoxLayout* aBtnLayout = new QHBoxLayout;
-    aBtnLayout->setSpacing( SPACING_SIZE );
-    aBtnLayout->setMargin( 0 );
-    
-    buttonOk = new QPushButton( this, "buttonOk" );
-    buttonOk->setText( tr( "BUT_OK"  ) );
-    buttonOk->setAutoDefault( true );
-    buttonOk->setDefault( true );
-    
-    buttonCancel = new QPushButton( this, "buttonCancel" );
-    buttonCancel->setText( tr( "BUT_CANCEL"  ) );
-    buttonCancel->setAutoDefault( true ); 
-  
-    aBtnLayout->addWidget( buttonOk );
-    aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
-    aBtnLayout->addWidget( buttonCancel );
-
-    ListComponent = new QListBox( this, "ListComponent" );
-    ListComponent->setVScrollBarMode(QListBox::AlwaysOn);
-    ListComponent->setMinimumSize(MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT);
-    ListComponent->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
-    ListComponent->setSelectionMode(QListBox::Single);
-
-    aTopLayout->addWidget(TextLabel1,    0, 0);
-    aTopLayout->addWidget(ListComponent, 1, 0);
-    aTopLayout->addLayout(aBtnLayout,    2, 0);
-
-    // signals and slots connections
-    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
-    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
-}
-
diff --git a/src/STD/STD_LoadStudiesDlg.h b/src/STD/STD_LoadStudiesDlg.h
deleted file mode 100644 (file)
index 268b161..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef STD_LOADSTUDIESDLG_H
-#define STD_LOADSTUDIESDLG_H
-
-#include <STD.h>
-
-#include <qdialog.h>
-#include <qvariant.h>
-
-class QLabel;
-class QListBox;
-class QPushButton;
-class QVBoxLayout; 
-class QHBoxLayout; 
-class QGridLayout; 
-class QListBoxItem;
-
-/*!\class STD_LoadStudiesDlg
- * \brief Describes a dialog box that gives a list of opened studies.
- * 
- */
-class STD_EXPORT STD_LoadStudiesDlg : public QDialog
-{ 
-   Q_OBJECT
-
-public:
-   STD_LoadStudiesDlg( QWidget* parent = 0, bool modal = FALSE, WFlags fl = 0 );
-   ~STD_LoadStudiesDlg() {}
-
-  /*!\var TextLabel1
-   * \brief stores a dialog text label
-   */
-  QLabel* TextLabel1;
-  
-  /*!\var buttonOk
-   * \brief stores a dialog button OK
-   */
-  QPushButton* buttonOk;
-
-  /*!\var buttonCancel
-   * \brief stores a dialog button Cancel
-   */  
-  QPushButton* buttonCancel;
-
-  /*!\var ListComponent
-   * \brief stores a dialog list compoent
-   */ 
-   QListBox* ListComponent;
-
-};
-
-#endif // STD_LOADSTUDIESDLG_H
index 9a446ab64da6664db95ce41ecf7e3dd395edcc3f..de0dcf8802f9728a9a94518d4c836398b0450bcf 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "STD_MDIDesktop.h"
 
 #include <SUIT_ViewWindow.h>
 #include <SUIT_ResourceMgr.h>
 
-#include <QtxAction.h>
+#include <QtxWorkspace.h>
 #include <QtxActionMenuMgr.h>
 #include <QtxWorkspaceAction.h>
 
-#include <qvbox.h>
-#include <qmenubar.h>
-#include <qworkspace.h>
-#include <qobjectlist.h>
+#include <QFrame>
+#include <QVBoxLayout>
 
 #include <stdarg.h>
 
-/*!Constructor.*/
+/*!
+  Constructor.
+*/
 STD_MDIDesktop::STD_MDIDesktop()
 : SUIT_Desktop(),
 myWorkspace( 0 ),
 myWorkspaceAction( 0 )
 {
-  QVBox* base = new QVBox( this );
+  QFrame* base = new QFrame( this );
+  QVBoxLayout* main = new QVBoxLayout( base );
+  main->setMargin( 0 );
   base->setFrameStyle( QFrame::Panel | QFrame::Sunken );
 
   setCentralWidget( base );
 
-  myWorkspace = new QWorkspace( base );
+  myWorkspace = new QtxWorkspace( base );
+  main->addWidget( myWorkspace );
 
   connect( myWorkspace, SIGNAL( windowActivated( QWidget* ) ),
            this, SLOT( onWindowActivated( QWidget* ) ) );
@@ -52,12 +58,16 @@ myWorkspaceAction( 0 )
   createActions();
 }
 
-/*!destructor.*/
+/*!
+  Destructor.
+*/
 STD_MDIDesktop::~STD_MDIDesktop()
 {
 }
 
-/*!\retval SUIT_ViewWindow - return const active window.*/
+/*!
+  \retval SUIT_ViewWindow - return const active window.
+*/
 SUIT_ViewWindow* STD_MDIDesktop::activeWindow() const
 {
   SUIT_ViewWindow* wnd = 0;
@@ -69,25 +79,33 @@ SUIT_ViewWindow* STD_MDIDesktop::activeWindow() const
   return wnd;
 }
 
-/*!\retval QPtrList<SUIT_ViewWindow> - return const active window list.*/
-QPtrList<SUIT_ViewWindow> STD_MDIDesktop::windows() const
+/*!
+  \retval QList<SUIT_ViewWindow> - return const active window list.
+*/
+QList<SUIT_ViewWindow*> STD_MDIDesktop::windows() const
 {
-  QPtrList<SUIT_ViewWindow> winList;
+  QList<SUIT_ViewWindow*> winList;
 
   QWidgetList children = myWorkspace->windowList();
-  for ( QWidgetListIt it( children ); it.current(); ++it )
+  for ( QWidgetList::iterator it = children.begin(); it != children.end(); ++it )
   {
-    if ( it.current()->inherits( "SUIT_ViewWindow" ) )
-      winList.append( (SUIT_ViewWindow*)it.current() );
+    SUIT_ViewWindow* vw = ::qobject_cast<SUIT_ViewWindow*>( *it );
+    if ( vw )
+      winList.append( vw );
   }
 
   return winList;
 }
 
-/*!\retval QWidget - pointer to work space.*/
-QWidget* STD_MDIDesktop::parentArea() const
+/*!
+  Add the new widget into desktop.
+*/
+void STD_MDIDesktop::addWindow( QWidget* w )
 {
-  return workspace();
+  if ( !w || !workspace() )
+    return;
+
+  workspace()->addWindow( w );
 }
 
 /*!Call method perform for operation \a type.*/
@@ -100,45 +118,51 @@ void STD_MDIDesktop::windowOperation( const int type )
 void STD_MDIDesktop::setWindowOperations( const int first, ... )
 {
   va_list ints;
-       va_start( ints, first );
-
-       QValueList<int> typeList;
+  va_start( ints, first );
 
-       int cur = first;
-       while ( cur )
-       {
-         typeList.append( cur );
-               cur = va_arg( ints, int );
+  QList<int> typeList;
+  
+  int cur = first;
+  while ( cur )
+  {
+    typeList.append( cur );
+    cur = va_arg( ints, int );
   }
 
-       setWindowOperations( typeList );
+  setWindowOperations( typeList );
 }
 
 /*!Sets window operations by variable \a opList - operation list.*/
-void STD_MDIDesktop::setWindowOperations( const QValueList<int>& opList )
+void STD_MDIDesktop::setWindowOperations( const QList<int>& opList )
 {
   int flags = 0;
 
-  for ( QValueList<int>::const_iterator it = opList.begin(); it != opList.end(); ++it )
+  for ( QList<int>::const_iterator it = opList.begin(); it != opList.end(); ++it )
     flags = flags | operationFlag( *it );
 
-  myWorkspaceAction->setItems( flags );
+  myWorkspaceAction->setMenuActions( flags );
 }
 
-/*!\retval QWorkspace pointer - work space.*/
-QWorkspace* STD_MDIDesktop::workspace() const
+/*!
+  \retval QtxWorkspace pointer - work space.
+*/
+QtxWorkspace* STD_MDIDesktop::workspace() const
 {
   return myWorkspace;
 }
 
-/*!Emit window activated.*/
+/*!
+  Emit window activated.
+*/
 void STD_MDIDesktop::onWindowActivated( QWidget* w )
 {
   if ( w && w->inherits( "SUIT_ViewWindow" ) )
     emit windowActivated( (SUIT_ViewWindow*)w );
 }
 
-/*!Create actions: cascade, Tile, Tile Horizontal, Tile Vertical*/
+/*!
+  Create actions: cascade, Tile, Tile Horizontal, Tile Vertical
+*/
 void STD_MDIDesktop::createActions()
 {
   if ( myWorkspaceAction )
@@ -150,40 +174,39 @@ void STD_MDIDesktop::createActions()
 
   myWorkspaceAction = new QtxWorkspaceAction( workspace(), this );
 
-  myWorkspaceAction->setItems( QtxWorkspaceAction::Cascade | QtxWorkspaceAction::Tile |
-                               QtxWorkspaceAction::HTile | QtxWorkspaceAction::VTile |
-                               QtxWorkspaceAction::Windows );
+  myWorkspaceAction->setMenuActions( QtxWorkspaceAction::Cascade | QtxWorkspaceAction::Tile  |
+                                    QtxWorkspaceAction::HTile   | QtxWorkspaceAction::VTile |
+                                    QtxWorkspaceAction::Windows );
 
   // Cascade
-  myWorkspaceAction->setIconSet( QtxWorkspaceAction::Cascade,
-                                 resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_CASCADE" ) ) );
-  myWorkspaceAction->setMenuText( QtxWorkspaceAction::Cascade, tr( "MEN_DESK_WINDOW_CASCADE" ) );
+  myWorkspaceAction->setIcon( QtxWorkspaceAction::Cascade,
+                              resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_CASCADE" ) ) );
+  myWorkspaceAction->setText( QtxWorkspaceAction::Cascade, tr( "MEN_DESK_WINDOW_CASCADE" ) );
   myWorkspaceAction->setStatusTip( QtxWorkspaceAction::Cascade, tr( "PRP_DESK_WINDOW_CASCADE" ) );
 
   // Tile
-  myWorkspaceAction->setIconSet( QtxWorkspaceAction::Tile,
-                                 resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_TILE" ) ) );
-  myWorkspaceAction->setMenuText( QtxWorkspaceAction::Tile, tr( "MEN_DESK_WINDOW_TILE" ) );
+  myWorkspaceAction->setIcon( QtxWorkspaceAction::Tile,
+                              resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_TILE" ) ) );
+  myWorkspaceAction->setText( QtxWorkspaceAction::Tile, tr( "MEN_DESK_WINDOW_TILE" ) );
   myWorkspaceAction->setStatusTip( QtxWorkspaceAction::Tile, tr( "PRP_DESK_WINDOW_TILE" ) );
 
   // Tile Horizontal
-  myWorkspaceAction->setIconSet( QtxWorkspaceAction::HTile,
-                                 resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HTILE" ) ) );
-  myWorkspaceAction->setMenuText( QtxWorkspaceAction::HTile, tr( "MEN_DESK_WINDOW_HTILE" ) );
+  myWorkspaceAction->setIcon( QtxWorkspaceAction::HTile,
+                              resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HTILE" ) ) );
+  myWorkspaceAction->setText( QtxWorkspaceAction::HTile, tr( "MEN_DESK_WINDOW_HTILE" ) );
   myWorkspaceAction->setStatusTip( QtxWorkspaceAction::HTile, tr( "PRP_DESK_WINDOW_HTILE" ) );
 
   // Tile Vertical
-  myWorkspaceAction->setIconSet( QtxWorkspaceAction::VTile,
-                                 resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VTILE" ) ) );
-  myWorkspaceAction->setMenuText( QtxWorkspaceAction::VTile, tr( "MEN_DESK_WINDOW_VTILE" ) );
+  myWorkspaceAction->setIcon( QtxWorkspaceAction::VTile,
+                              resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VTILE" ) ) );
+  myWorkspaceAction->setText( QtxWorkspaceAction::VTile, tr( "MEN_DESK_WINDOW_VTILE" ) );
   myWorkspaceAction->setStatusTip( QtxWorkspaceAction::VTile, tr( "PRP_DESK_WINDOW_VTILE" ) );
 
-
   QtxActionMenuMgr* mMgr = menuMgr();
   if ( !mMgr )
     return;
 
-  int winMenuId = mMgr->insert( tr( "MEN_DESK_WINDOW" ), -1, 100, MenuWindowId );
+  int winMenuId = mMgr->insert( tr( "MEN_DESK_WINDOW" ), -1, 100 );
   mMgr->insert( myWorkspaceAction, winMenuId, -1 );
   mMgr->insert( QtxActionMenuMgr::separator(), winMenuId, -1 );
 }
index f4136444d4088d23353cf44a27e86479d5727a82..a229ab713d0c0f7fc7f3ef373e2491eb0c9643a9 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef STD_MDIDESKTOP_H
 #define STD_MDIDESKTOP_H
 
 #include <SUIT_Desktop.h>
 
-class QtxAction;
-class QPopupMenu;
-class QWorkspace;
+class QtxWorkspace;
 class QtxWorkspaceAction;
 
-#if defined WNT
+#if defined WIN32
 #pragma warning( disable: 4251 )
 #endif
 
@@ -37,7 +38,6 @@ class STD_EXPORT STD_MDIDesktop: public SUIT_Desktop
   Q_OBJECT
 
 public:
-  enum { MenuWindowId = 6 };
   enum { Cascade, Tile, HTile, VTile };
 
 public:
@@ -45,31 +45,31 @@ public:
   virtual ~STD_MDIDesktop();
 
   virtual SUIT_ViewWindow* activeWindow() const;
-  virtual QPtrList<SUIT_ViewWindow> windows() const;
+  virtual QList<SUIT_ViewWindow*> windows() const;
 
   void                     windowOperation( const int );
 
   void                     setWindowOperations( const int, ... );
-  void                     setWindowOperations( const QValueList<int>& );
+  void                     setWindowOperations( const QList<int>& );
 
-  QWorkspace*              workspace() const;
+  QtxWorkspace*            workspace() const;
 
 private slots:
   void                     onWindowActivated( QWidget* );
 
 protected:
   void                     createActions();
-  virtual QWidget*         parentArea() const;
+  virtual void             addWindow( QWidget* );
 
 private:
   int                      operationFlag( const int ) const;
 
 private:
-  QWorkspace*              myWorkspace;
+  QtxWorkspace*            myWorkspace;
   QtxWorkspaceAction*      myWorkspaceAction;
 };
 
-#if defined WNT
+#if defined WIN32
 #pragma warning( default: 4251 )
 #endif
 
index 9bcc92a5625e5da44192680984146f40be676910..87a65307a90cf7ea9cb93cc7c2a9f90ff06fdee0 100755 (executable)
@@ -1,35 +1,40 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "STD_SDIDesktop.h"
 
 #include <SUIT_ViewWindow.h>
 
-#include <qvbox.h>
-#include <qmenubar.h>
-#include <qobjectlist.h>
+#include <QFrame>
+#include <QVBoxLayout>
 
 /*!Constructor. Create instance of QVBox*/
 STD_SDIDesktop::STD_SDIDesktop()
 : SUIT_Desktop()
 {
-  myMainWidget = new QVBox( this );
+  myMainWidget = new QFrame( this );
   myMainWidget->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+  QVBoxLayout* main = new QVBoxLayout( myMainWidget );
+  main->setMargin( 0 );
 
   setCentralWidget( myMainWidget );
 }
@@ -42,40 +47,42 @@ STD_SDIDesktop::~STD_SDIDesktop()
 /*!\retval SUIT_ViewWindow - return const active window.*/
 SUIT_ViewWindow* STD_SDIDesktop::activeWindow() const
 {
-  const QObjectList* children = myMainWidget->children();
-  if ( !children )
-    return 0;
-
-  QPtrList<SUIT_ViewWindow> winList;
-  for ( QObjectListIt it( *children ); it.current(); ++it )
+  const QObjectList& lst = myMainWidget->children();
+  QList<SUIT_ViewWindow*> winList;
+  for ( QObjectList::const_iterator it = lst.begin(); it != lst.end(); ++it )
   {
-    if ( it.current()->inherits( "SUIT_ViewWindow" ) )
-      winList.append( (SUIT_ViewWindow*)it.current() );
+    SUIT_ViewWindow* vw = ::qobject_cast<SUIT_ViewWindow*>( *it );
+    if ( vw )
+      winList.append( vw );
   }
 
   SUIT_ViewWindow* win = 0;
-  for ( QPtrListIterator<SUIT_ViewWindow> itr( winList ); itr.current() && !win; ++itr )
+  for ( QList<SUIT_ViewWindow*>::iterator itr = winList.begin(); itr != winList.end() && !win; ++itr )
   {
-    if ( itr.current()->isActiveWindow() )
-      win = itr.current();
+    if ( (*itr)->isActiveWindow() )
+      win = *itr;
   }
 
   if ( !win && !winList.isEmpty() )
-    win = winList.getFirst();
+    win = winList.first();
 
   return win;
 }
 
 /*!\retval QPtrList<SUIT_ViewWindow> - return const active window list.*/
-QPtrList<SUIT_ViewWindow> STD_SDIDesktop::windows() const
+QList<SUIT_ViewWindow*> STD_SDIDesktop::windows() const
 {
-  QPtrList<SUIT_ViewWindow> winList;
-      winList.append( activeWindow() );
+  QList<SUIT_ViewWindow*> winList;
+  winList.append( activeWindow() );
   return winList;
 }
 
-/*!\retval QWidget - pointer to main window.*/
-QWidget* STD_SDIDesktop::parentArea() const
+/*! add new widget into desktop.*/
+void STD_SDIDesktop::addWindow( QWidget* w )
 {
-  return myMainWidget;
+  if ( !w || !centralWidget() || !centralWidget()->layout() )
+    return;
+
+  w->setParent( centralWidget() );
+  centralWidget()->layout()->addWidget( w );
 }
index 78b1bb78d2a7f58d0ff531c8262eee0933dbe54c..d5e17e891968b506cbd213adc8aef326586162d5 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef STD_SDIDESKTOP_H
 #define STD_SDIDESKTOP_H
@@ -23,7 +26,7 @@
 
 #include <SUIT_Desktop.h>
 
-class QVBox;
+class QFrame;
 
 class STD_EXPORT STD_SDIDesktop: public SUIT_Desktop 
 {
@@ -34,13 +37,13 @@ public:
   virtual ~STD_SDIDesktop();
 
   virtual SUIT_ViewWindow* activeWindow() const;
-  virtual QPtrList<SUIT_ViewWindow> windows() const;
+  virtual QList<SUIT_ViewWindow*> windows() const;
 
 protected:
-  virtual QWidget*         parentArea() const;
+  virtual void             addWindow( QWidget* );
 
 private:
-  QVBox*                   myMainWidget;
+  QFrame*                  myMainWidget;
 };
 
 #endif
index 64518803523ec5598c2f4835b6840e9f53ad38ac..f63f36e7ee85f5373c5edbf84393c6ed6ca90531 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "STD_TabDesktop.h"
 
 #include <SUIT_ViewWindow.h>
 #include <SUIT_ResourceMgr.h>
 
-#include <QtxAction.h>
 #include <QtxWorkstack.h>
 #include <QtxActionMenuMgr.h>
 #include <QtxWorkstackAction.h>
 
-#include <qvbox.h>
-#include <qmenubar.h>
-#include <qworkspace.h>
-#include <qobjectlist.h>
+#include <QFrame>
+#include <QVBoxLayout>
 
 #include <stdarg.h>
 
@@ -40,20 +40,34 @@ STD_TabDesktop::STD_TabDesktop()
 myWorkstack( 0 ),
 myWorkstackAction( 0 )
 {
-  QVBox* base = new QVBox( this );
+  QFrame* base = new QFrame( this );
   base->setFrameStyle( QFrame::Panel | QFrame::Sunken );
 
+  QVBoxLayout* main = new QVBoxLayout( base );
+  main->setMargin( 0 );
+
   setCentralWidget( base );
 
   myWorkstack = new QtxWorkstack( base );
+  main->addWidget( myWorkstack );
   // setting Expanding size policy for central workstack.  If there are several widgets
   // in central area of Desktop, other widgets will be added below the workstack (CATHARE, TRIPOLI modules).  
   // But the workstack must occupy as much space as possible -- set Expanding for it.
   myWorkstack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
 
-  myWorkstack->setAccel(QtxWorkstack::SplitVertical,   SHIFT + Key_V);
-  myWorkstack->setAccel(QtxWorkstack::SplitHorizontal, SHIFT + Key_H);
-  myWorkstack->setAccel(QtxWorkstack::Close,           SHIFT + Key_C);
+  myWorkstack->setAccel( QtxWorkstack::SplitVertical,   Qt::SHIFT + Qt::Key_V );
+  myWorkstack->setAccel( QtxWorkstack::SplitHorizontal, Qt::SHIFT + Qt::Key_H );
+  myWorkstack->setAccel( QtxWorkstack::Close,           Qt::SHIFT + Qt::Key_C );
+
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  if ( resMgr ) {
+    myWorkstack->setIcon( QtxWorkstack::SplitVertical,   
+                         resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
+    myWorkstack->setIcon( QtxWorkstack::SplitHorizontal,
+                         resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
+    myWorkstack->setIcon( QtxWorkstack::Close,
+                         resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ));
+  }
 
   connect( myWorkstack, SIGNAL( windowActivated( QWidget* ) ),
            this, SLOT( onWindowActivated( QWidget* ) ) );
@@ -61,12 +75,16 @@ myWorkstackAction( 0 )
   createActions();
 }
 
-/*!Destructor.*/
+/*!
+  Destructor.
+*/
 STD_TabDesktop::~STD_TabDesktop()
 {
 }
 
-/*!\retval SUIT_ViewWindow - return const active window.*/
+/*!
+  \retval SUIT_ViewWindow - return const active window.
+*/
 SUIT_ViewWindow* STD_TabDesktop::activeWindow() const
 {
   SUIT_ViewWindow* wnd = 0;
@@ -78,40 +96,51 @@ SUIT_ViewWindow* STD_TabDesktop::activeWindow() const
   return wnd;
 }
 
-/*!\retval QPtrList<SUIT_ViewWindow> - return const active window list.*/
-QPtrList<SUIT_ViewWindow> STD_TabDesktop::windows() const
+/*!
+  \retval QPtrList<SUIT_ViewWindow> - return const active window list.
+*/
+QList<SUIT_ViewWindow*> STD_TabDesktop::windows() const
 {
-  QPtrList<SUIT_ViewWindow> winList;
+  QList<SUIT_ViewWindow*> winList;
 
   QWidgetList children = myWorkstack->windowList();
-  for ( QWidgetListIt it( children ); it.current(); ++it )
+  for ( QWidgetList::iterator it = children.begin(); it != children.end(); ++it )
   {
-    if ( it.current()->inherits( "SUIT_ViewWindow" ) )
-      winList.append( (SUIT_ViewWindow*)it.current() );
+    if ( (*it)->inherits( "SUIT_ViewWindow" ) )
+      winList.append( (SUIT_ViewWindow*)*it );
   }
 
   return winList;
 }
 
-/*!\retval QWidget pointer - QT work stack.*/
-QWidget* STD_TabDesktop::parentArea() const
+/*!
+  Insert new widget into desktop.
+*/
+void STD_TabDesktop::addWindow( QWidget* w )
 {
-  return workstack();
+  if ( !w || !workstack() )
+    return;
+
+  workstack()->addWindow( w );
 }
 
-/*!Call method perform for operation \a type.*/
+/*!
+  Call method perform for operation \a type.
+*/
 void STD_TabDesktop::windowOperation( const int type )
 {
   myWorkstackAction->perform( operationFlag( type ) );
 }
 
-/*!Sets window operations by \a first ... parameters.*/
+/*!
+  Sets window operations by \a first ... parameters.
+*/
 void STD_TabDesktop::setWindowOperations( const int first, ... )
 {
   va_list ints;
        va_start( ints, first );
 
-       QValueList<int> typeList;
+       QList<int> typeList;
 
        int cur = first;
        while ( cur )
@@ -123,31 +152,39 @@ void STD_TabDesktop::setWindowOperations( const int first, ... )
        setWindowOperations( typeList );
 }
 
-/*!Sets window operations by variable \a opList - operation list.*/
-void STD_TabDesktop::setWindowOperations( const QValueList<int>& opList )
+/*!
+  Sets window operations by variable \a opList - operation list.
+*/
+void STD_TabDesktop::setWindowOperations( const QList<int>& opList )
 {
   int flags = 0;
 
-  for ( QValueList<int>::const_iterator it = opList.begin(); it != opList.end(); ++it )
+  for ( QList<int>::const_iterator it = opList.begin(); it != opList.end(); ++it )
     flags = flags | operationFlag( *it );
 
-  myWorkstackAction->setItems( flags );
+//  myWorkstackAction->setItems( flags );
 }
 
-/*!\retval QtxWorkstack pointer - QT work stack.*/
+/*!
+  \retval QtxWorkstack pointer - Qt work stack.
+*/
 QtxWorkstack* STD_TabDesktop::workstack() const
 {
   return myWorkstack;
 }
 
-/*!Emit window activated.*/
+/*!
+  Emit window activated.
+*/
 void STD_TabDesktop::onWindowActivated( QWidget* w )
 {
   if ( w && w->inherits( "SUIT_ViewWindow" ) )
     emit windowActivated( (SUIT_ViewWindow*)w );
 }
 
-/*!Create actions for window.*/
+/*!
+  Create actions for window.
+*/
 void STD_TabDesktop::createActions()
 {
   if ( myWorkstackAction )
@@ -159,41 +196,46 @@ void STD_TabDesktop::createActions()
 
   myWorkstackAction = new QtxWorkstackAction( workstack(), this );
 
-  myWorkstackAction->setItems( QtxWorkstackAction::Split | QtxWorkstackAction::Windows );
+  myWorkstackAction->setMenuActions( QtxWorkstackAction::Split | QtxWorkstackAction::Windows );
 
   // Split Horizontal
-  myWorkstackAction->setIconSet( QtxWorkstackAction::HSplit,
-                                 resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
-  myWorkstackAction->setMenuText( QtxWorkstackAction::HSplit, tr( "MEN_DESK_WINDOW_HSPLIT" ) );
-  myWorkstackAction->setStatusTip( QtxWorkstackAction::HSplit, tr( "PRP_DESK_WINDOW_HSPLIT" ) );
+  myWorkstackAction->setIcon( QtxWorkstackAction::SplitHorizontal,
+                              resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
+  myWorkstackAction->setText( QtxWorkstackAction::SplitHorizontal, tr( "MEN_DESK_WINDOW_HSPLIT" ) );
+  myWorkstackAction->setStatusTip( QtxWorkstackAction::SplitHorizontal, tr( "PRP_DESK_WINDOW_HSPLIT" ) );
+  myWorkstackAction->setAccel( QtxWorkstackAction::SplitHorizontal, Qt::SHIFT + Qt::Key_H );
 
   // Split Vertical
-  myWorkstackAction->setIconSet( QtxWorkstackAction::VSplit,
-                                 resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
-  myWorkstackAction->setMenuText( QtxWorkstackAction::VSplit, tr( "MEN_DESK_WINDOW_VSPLIT" ) );
-  myWorkstackAction->setStatusTip( QtxWorkstackAction::VSplit, tr( "PRP_DESK_WINDOW_VSPLIT" ) );
+  myWorkstackAction->setIcon( QtxWorkstackAction::SplitVertical,
+                              resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
+  myWorkstackAction->setText( QtxWorkstackAction::SplitVertical, tr( "MEN_DESK_WINDOW_VSPLIT" ) );
+  myWorkstackAction->setStatusTip( QtxWorkstackAction::SplitVertical, tr( "PRP_DESK_WINDOW_VSPLIT" ) );
+  myWorkstackAction->setAccel( QtxWorkstackAction::SplitVertical,   Qt::SHIFT + Qt::Key_V );
 
   QtxActionMenuMgr* mMgr = menuMgr();
   if ( !mMgr )
     return;
 
-  int winMenuId = mMgr->insert( tr( "MEN_DESK_WINDOW" ), -1, 100, MenuWindowId );
+  int winMenuId = mMgr->insert( tr( "MEN_DESK_WINDOW" ), -1, 100 );
   mMgr->insert( myWorkstackAction, winMenuId, -1 );
   mMgr->insert( QtxActionMenuMgr::separator(), winMenuId, -1 );
 }
 
-/*!Convert STD_TabDesktop enumerations to QtxWorkstackAction*/
+/*!
+  Convert STD_TabDesktop enumerations to QtxWorkstackAction
+*/
 int STD_TabDesktop::operationFlag( const int type ) const
 {
   int res = 0;
   switch ( type )
   {
-  case VSplit:
-    res = QtxWorkstackAction::VSplit;
+  case SplitVertical:
+    res = QtxWorkstackAction::SplitVertical;
     break;
-  case HSplit:
-    res = QtxWorkstackAction::HSplit;
+  case SplitHorizontal:
+    res = QtxWorkstackAction::SplitHorizontal;
     break;
   }
+
   return res;
 }
index aa63db0654800971b76cc86ef8a8d9ad7b21a699..57d5195ad8fa5a2cf61db0363156b0570864f60d 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef STD_TABDESKTOP_H
 #define STD_TABDESKTOP_H
 
 #include <SUIT_Desktop.h>
 
-class QtxAction;
-class QPopupMenu;
-class QWorkspace;
 class QtxWorkstack;
 class QtxWorkstackAction;
 
-#if defined WNT
+#if defined WIN32
 #pragma warning( disable: 4251 )
 #endif
 
@@ -38,20 +38,19 @@ class STD_EXPORT STD_TabDesktop: public SUIT_Desktop
   Q_OBJECT
 
 public:
-  enum { MenuWindowId = 6 };
-  enum { VSplit, HSplit };
+  enum { SplitVertical, SplitHorizontal };
 
 public:
   STD_TabDesktop();
   virtual ~STD_TabDesktop();
 
   virtual SUIT_ViewWindow* activeWindow() const;
-  virtual QPtrList<SUIT_ViewWindow> windows() const;
+  virtual QList<SUIT_ViewWindow*> windows() const;
 
   void                     windowOperation( const int );
 
   void                     setWindowOperations( const int, ... );
-  void                     setWindowOperations( const QValueList<int>& );
+  void                     setWindowOperations( const QList<int>& );
 
   QtxWorkstack*            workstack() const;
 
@@ -60,7 +59,7 @@ private slots:
 
 protected:
   void                     createActions();
-  virtual QWidget*         parentArea() const;
+  virtual void             addWindow( QWidget* );
 
 private:
   int                      operationFlag( const int ) const;
@@ -70,7 +69,7 @@ private:
   QtxWorkstackAction*      myWorkstackAction;
 };
 
-#if defined WNT
+#if defined WIN32
 #pragma warning( default: 4251 )
 #endif
 
index 71e0a99479bfa961491ea177c0c9ea60a5909998..066c68622204a61c87ede448a4f0924527f860fd 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
diff --git a/src/STD/resources/STD_images.ts b/src/STD/resources/STD_images.ts
new file mode 100644 (file)
index 0000000..216ea3f
--- /dev/null
@@ -0,0 +1,104 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>ICON_FILE_NEW</source>
+        <translation>new.png</translation>
+    </message>
+    <message>
+        <source>ICON_DESK_WINDOW_TILE</source>
+        <translation>tile.png</translation>
+    </message>
+    <message>
+        <source>ICON_PRINT</source>
+        <translation>print.png</translation>
+    </message>
+    <message>
+        <source>ICON_RESET</source>
+        <translation>reset.png</translation>
+    </message>
+    <message>
+        <source>ICON_HELP</source>
+        <translation>help.png</translation>
+    </message>
+    <message>
+        <source>ICON_EDIT_CUT</source>
+        <translation>cut.png</translation>
+    </message>
+    <message>
+        <source>ICON_DESK_WINDOW_CASCADE</source>
+        <translation>cascade.png</translation>
+    </message>
+    <message>
+        <source>ICON_EDIT_COPY</source>
+        <translation>copy.png</translation>
+    </message>
+    <message>
+        <source>ICON_FILE_SAVE</source>
+        <translation>save.png</translation>
+    </message>
+    <message>
+        <source>ICON_FILE_OPEN</source>
+        <translation>open.png</translation>
+    </message>
+    <message>
+        <source>ICON_DESK_WINDOW_HSPLIT</source>
+        <translation>htile.png</translation>
+    </message>
+    <message>
+        <source>ICON_EDIT_REDO</source>
+        <translation>redo.png</translation>
+    </message>
+    <message>
+        <source>ICON_EDIT_UNDO</source>
+        <translation>undo.png</translation>
+    </message>
+    <message>
+        <source>ICON_EDIT_DELETE</source>
+        <translation>delete.png</translation>
+    </message>
+    <message>
+        <source>ICON_DESK_WINDOW_VSPLIT</source>
+        <translation>vtile.png</translation>
+    </message>
+    <message>
+        <source>ICON_DESK_WINDOW_HTILE</source>
+        <translation>htile.png</translation>
+    </message>
+    <message>
+        <source>ICON_DESK_WINDOW_VTILE</source>
+        <translation>vtile.png</translation>
+    </message>
+    <message>
+        <source>ICON_EDIT_PASTE</source>
+        <translation>paste.png</translation>
+    </message>
+    <message>
+        <source>ICON_FILE_CLOSE</source>
+        <translation>close.png</translation>
+    </message>
+</context>
+</TS>
index c70c031cc60f31bde781235ab22ffc44ff4e6bb4..c96e51b57f715b8f30a0384a6c40d60fdaf1af0f 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
 "POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 2007-11-07 18:43+0300\n"
+"PO-Revision-Date: 1999-02-23 15:38+0200\n"
 "Last-Translator: \n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 
@@ -140,6 +144,9 @@ msgstr "&View"
 msgid "MEN_DESK_VIEW_TOOLBARS"
 msgstr "T&oolbars"
 
+msgid "MEN_DESK_VIEW_DOCKWINDOWS"
+msgstr "W&indows"
+
 msgid "MEN_DESK_VIEW_STATUSBAR"
 msgstr "&Status Bar"
 
@@ -192,7 +199,7 @@ msgid "PRP_DESK_VIEW_STDTOOLBAR"
 msgstr "Toggles standard toolbar on/off"
 
 msgid "QUE_DESK_EXIT"
-msgstr "Are you sure you want to quit SALOME?"
+msgstr "Do you really want to quit ?"
 
 msgid "TOT_DESK_FILE_NEW"
 msgstr "New document"
@@ -344,15 +351,6 @@ msgstr "Saving study "
 msgid "STD_Application::INF_DOC_SAVING_FAILS"
 msgstr "Can't save file \"%1\".\nPossible reason is permission denied or disc full.\nTry to use another file name."
 
-msgid "CLOSE_DLG_SAVE_CLOSE"
-msgstr "&Save && Close"
-
-msgid "CLOSE_DLG_CLOSE"
-msgstr "C&lose w/o saving"
-
-msgid "CLOSE_DLG_UNLOAD"
-msgstr "&Unload"
-
 msgid "TOT_DESK_FILE_LOAD"
 msgstr "Load document"
 
@@ -362,12 +360,6 @@ msgstr "Load a document"
 msgid "MEN_DESK_FILE_LOAD"
 msgstr "Conn&ect..."    
 
-msgid "CLOSE_DLG_CAPTION"
-msgstr "Close active study"
-
-msgid "CLOSE_DLG_DESCRIPTION"
-msgstr "Study is modified. Do you want to save it?"
-
 msgid "DLG_LOAD_STUDY_CAPTION"
 msgstr "Load Study"
 
diff --git a/src/STD/resources/STD_msg_en.ts b/src/STD/resources/STD_msg_en.ts
new file mode 100644 (file)
index 0000000..cfa9e93
--- /dev/null
@@ -0,0 +1,490 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>TOT_DESK_EDIT_CUT</source>
+        <translation>Cut</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_EDIT_CUT</source>
+        <translation>Cuts the selection and puts it to the Clipboard</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_EDIT_CUT</source>
+        <translation>Cu&amp;t</translation>
+    </message>
+    <message>
+        <source>ERR_APP_NOAPP</source>
+        <translation>No application</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW</source>
+        <translation>&amp;Window</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_EDIT_COPY</source>
+        <translation>Copy</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_CASCADE</source>
+        <translation>&amp;Cascade</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_EDIT_COPY</source>
+        <translation>Copy the selection to the Clipboard</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_CASCADE</source>
+        <translation>Arranges the windows as overlapping tiles</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_SAVEAS</source>
+        <translation>Save document as...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_EDIT_COPY</source>
+        <translation>&amp;Copy</translation>
+    </message>
+    <message>
+        <source>MSG_CANT_SAVE</source>
+        <translation>Can&apos;t save file &quot;%1&quot;.</translation>
+    </message>
+    <message>
+        <source>INF_DESK_TOOLBAR_STANDARD</source>
+        <translation>Standard</translation>
+    </message>
+    <message>
+        <source>ALL_FILES</source>
+        <translation>All Files (*.*)</translation>
+    </message>
+    <message>
+        <source>DESK_DEFAULTTITLE</source>
+        <translation>Qt Application Desktop</translation>
+    </message>
+    <message>
+        <source>QUE_DESK_EXIT</source>
+        <translation>Are you sure you want to quit?</translation>
+    </message>
+    <message>
+        <source>INF_INFO</source>
+        <translation>Information</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_UNKNOWNTYPE_OPEN</source>
+        <translation>You are trying to open a document of an unknown type
+( %1 )</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_UNKNOWNTYPE_SAVE</source>
+        <translation>You are trying to save this document under an unknown type
+( %1 )</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_NEWWINDOW</source>
+        <translation>Create new Window</translation>
+    </message>
+    <message>
+        <source>BUT_CANCEL</source>
+        <translation>&amp;Cancel</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_HELP_ABOUT</source>
+        <translation>&amp;About...</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_NEWWINDOW</source>
+        <translation>Create new Window</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_VIEW_STATUSBAR</source>
+        <translation>&amp;Status Bar</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_NEWWINDOW</source>
+        <translation>&amp;New Window</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_VIEW_STATUSBAR</source>
+        <translation>Toggles status bar view on/off</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_DIRWITHNAMEEXIST_SAVE</source>
+        <translation>Can not save file %1.
+Directory with this name exist on disc. Try to use another name</translation>
+    </message>
+    <message>
+        <source>BUT_NO</source>
+        <translation>&amp;No</translation>
+    </message>
+    <message>
+        <source>BUT_OK</source>
+        <translation>&amp;Ok</translation>
+    </message>
+    <message>
+        <source>FILTER_FILES</source>
+        <translation>%1 Files (%2)</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_ACTIVATE</source>
+        <translation>Activates this window</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_PRINT</source>
+        <translation>Print document</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_CLOSE</source>
+        <translation>Close document</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_NEW</source>
+        <translation>New document</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_NEW</source>
+        <translation>Creates a new document</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_MRU</source>
+        <translation>Opens a document</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_NEW</source>
+        <translation>&amp;New</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_MRU</source>
+        <translation>Recent &amp;Files</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_EDIT_PASTE</source>
+        <translation>Paste</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_VIEW_DOCKWINDOWS</source>
+        <translation>W&amp;indows</translation>
+    </message>
+    <message>
+        <source>BUT_YES</source>
+        <translation>&amp;Yes</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_VIEW</source>
+        <translation>&amp;View</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_HELP_ABOUT</source>
+        <translation>Shows &apos;About&apos; dialog</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE</source>
+        <translation>&amp;File</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_EDIT</source>
+        <translation>&amp;Edit</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_HELP</source>
+        <translation>&amp;Help</translation>
+    </message>
+    <message>
+        <source>ERR_ERROR</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>ERR_DESK_NOAPP</source>
+        <translation>No applications registered</translation>
+    </message>
+    <message>
+        <source>INF_DESK_DOC_CREATE</source>
+        <translation>Create a new document</translation>
+    </message>
+    <message>
+        <source>QUE_DOC_ALREADYOPEN</source>
+        <translation>The document %1 is already open.
+Do you want to reload it ?</translation>
+    </message>
+    <message>
+        <source>BUT_APPLY</source>
+        <translation>&amp;Apply</translation>
+    </message>
+    <message>
+        <source>BUT_CLOSE</source>
+        <translation>&amp;Close</translation>
+    </message>
+    <message>
+        <source>INF_DESK_EXIT</source>
+        <translation>Exit</translation>
+    </message>
+    <message>
+        <source>ERR_UNKNOWN</source>
+        <translation>Unknown error</translation>
+    </message>
+    <message>
+        <source>BUT_HELP</source>
+        <translation>&amp;Help</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_CLOSE</source>
+        <translation>Closes the active document</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_PRINT</source>
+        <translation>Prints the active document</translation>
+    </message>
+    <message>
+        <source>WRN_WARNING</source>
+        <translation>Warning</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_HELP_ABOUT</source>
+        <translation>About...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_VIEW_TOOLBARS</source>
+        <translation>T&amp;oolbars</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_HSPLIT</source>
+        <translation>Splits the active window on two horizontal parts</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_HSPLIT</source>
+        <translation>Split &amp;Horizontally</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_EDIT_PASTE</source>
+        <translation>Inserts the Clipboard content at the insertion point</translation>
+    </message>
+    <message>
+        <source>DLG_LOAD_STUDY_CAPTION</source>
+        <translation>Load Study</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_HELP_SEARCH</source>
+        <translation>Searches help for a topic</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_SAVEAS</source>
+        <translation>Saves the active document with a new name</translation>
+    </message>
+    <message>
+        <source>INF_READY</source>
+        <translation>Ready</translation>
+    </message>
+    <message>
+        <source>INF_CANCELLED</source>
+        <translation>Cancelled</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_VSPLIT</source>
+        <translation>Splits the active window on two vertical parts</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_VSPLIT</source>
+        <translation>Split &amp;Vertically</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_TILE</source>
+        <translation>Arranges the windows as nonoverlapping tiles</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_HELP_CONTENTS</source>
+        <translation>&amp;Contents</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_HELP_CONTENTS</source>
+        <translation>Shows the whole help contents</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_HTILE</source>
+        <translation>Tile &amp;Horizontally</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_VTILE</source>
+        <translation>Tile &amp;Vertically</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_PERMISSIONDENIED_SAVE</source>
+        <translation>Can not save file %1. Permission denied</translation>
+    </message>
+    <message>
+        <source>INF_DESK_DOCALREADYOPEN</source>
+        <translation>A document cannot be saved under a name of a document already opened.
+Please, type another name for the document you want to save.
+( %1 )</translation>
+    </message>
+    <message>
+        <source>TIT_FILE_SAVEAS</source>
+        <translation>Save As</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_CLOSE</source>
+        <translation>&amp;Close</translation>
+    </message>
+    <message>
+        <source>MSG_FILE_EXISTS</source>
+        <translation>File &quot;%1&quot; already exists.
+Do you want to overwrite it?</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_PRINT</source>
+        <translation>&amp;Print</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_HELP_SEARCH</source>
+        <translation>&amp;Search...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_VIEW_STDTOOLBAR</source>
+        <translation>&amp;Standard</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_SAVEAS</source>
+        <translation>Save &amp;As...</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_VIEW_STDTOOLBAR</source>
+        <translation>Toggles standard toolbar on/off</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_SAVE</source>
+        <translation>Save document</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_EXIT</source>
+        <translation>Exit from application</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_LOAD</source>
+        <translation>Load document</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_OPEN</source>
+        <translation>Open document</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_EXIT</source>
+        <translation>Exits the application</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_OPEN</source>
+        <translation>Opens an existing document</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_SAVE</source>
+        <translation>Saves the active document</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_LOAD</source>
+        <translation>Load a document</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_HTILE</source>
+        <translation>Arranges the windows as nonoverlapping horizontal tiles</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_VTILE</source>
+        <translation>Arranges the windows as nonoverlapping vertical tiles</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_TILE</source>
+        <translation>&amp;Tile</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_EXIT</source>
+        <translation>E&amp;xit</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_OPEN</source>
+        <translation>&amp;Open...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_LOAD</source>
+        <translation>Conn&amp;ect...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_SAVE</source>
+        <translation>&amp;Save</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_EDIT_PASTE</source>
+        <translation>&amp;Paste</translation>
+    </message>
+    <message>
+        <source>MEN_STUDIES_CHOICE</source>
+        <translation>Choose Existent Study.</translation>
+    </message>
+</context>
+<context>
+    <name>STD_Application</name>
+    <message>
+        <source>INF_DOC_MODIFIED</source>
+        <translation>Document has been modified.
+Do you want to save changes?</translation>
+    </message>
+    <message>
+        <source>INF_DOC_SAVING</source>
+        <translation>Saving study </translation>
+    </message>
+    <message>
+        <source>INF_DOC_SAVED</source>
+        <translation>Study %1 saved</translation>
+    </message>
+    <message>
+        <source>TOT_DOCK_WINDOWS</source>
+        <translation>Show / hide dockable windows and toolbars</translation>
+    </message>
+    <message>
+        <source>MEN_DOCK_WINDOWS</source>
+        <translation>Windows and Toolbars</translation>
+    </message>
+    <message>
+        <source>ABOUT_INFO</source>
+        <translation>SUIT Std application</translation>
+    </message>
+    <message>
+        <source>INF_DOC_SAVING_FAILS</source>
+        <translation>Can&apos;t save file &quot;%1&quot;.
+Possible reason is permission denied or disc full.
+Try to use another file name.</translation>
+    </message>
+    <message>
+        <source>INF_DOCUMENT_MODIFIED</source>
+        <translation>Document &quot;%1&quot; has been modified.
+Do you want to save changes?</translation>
+    </message>
+    <message>
+        <source>CLOSE_STUDY</source>
+        <translation>Close active study</translation>
+    </message>
+    <message>
+        <source>CLOSE_QUESTION</source>
+        <translation>Do you want to save study before closing?</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/STD/resources/cascade.png b/src/STD/resources/cascade.png
new file mode 100644 (file)
index 0000000..3111e55
Binary files /dev/null and b/src/STD/resources/cascade.png differ
index b7126e002d7aa7ab3a7c9a9265a9f283f1ecfa20..4364ce7fe7d8ef363f0560fb0b4042fee232e748 100755 (executable)
Binary files a/src/STD/resources/close.png and b/src/STD/resources/close.png differ
diff --git a/src/STD/resources/config b/src/STD/resources/config
deleted file mode 100755 (executable)
index e347112..0000000
+++ /dev/null
@@ -1 +0,0 @@
-language=en
index 1e43a09c2f80427d80e154e552661e4cf9596317..a26b641984355b66dcf8a638b34e4e3dcd8205d0 100755 (executable)
Binary files a/src/STD/resources/copy.png and b/src/STD/resources/copy.png differ
diff --git a/src/STD/resources/cursor_rotate.png b/src/STD/resources/cursor_rotate.png
deleted file mode 100755 (executable)
index a3cb0c1..0000000
Binary files a/src/STD/resources/cursor_rotate.png and /dev/null differ
diff --git a/src/STD/resources/cursor_zoom.png b/src/STD/resources/cursor_zoom.png
deleted file mode 100755 (executable)
index 0020fea..0000000
Binary files a/src/STD/resources/cursor_zoom.png and /dev/null differ
index b35200830ca593d5f55a151525f9f9125caa44f3..055c27ea6a73f494b87fbe64868df09e01024597 100755 (executable)
Binary files a/src/STD/resources/cut.png and b/src/STD/resources/cut.png differ
diff --git a/src/STD/resources/delete.png b/src/STD/resources/delete.png
new file mode 100644 (file)
index 0000000..93d1663
Binary files /dev/null and b/src/STD/resources/delete.png differ
index 452b45f62a547640e2a9de3ad3870bbdcf8c0a44..c8dd11c140d8a19e79d8f1e7d0e6a9f84e234262 100755 (executable)
Binary files a/src/STD/resources/help.png and b/src/STD/resources/help.png differ
diff --git a/src/STD/resources/htile.png b/src/STD/resources/htile.png
new file mode 100644 (file)
index 0000000..42af00c
Binary files /dev/null and b/src/STD/resources/htile.png differ
index 953757a62f594c7591c7cdcfe8e51cdde41bfa45..68555d2211d1f80a63dab34e873a943b4f128bc5 100755 (executable)
Binary files a/src/STD/resources/new.png and b/src/STD/resources/new.png differ
index d9953b6a7d36d4983f2cd609ef10976ac221215f..8ed143ebddf46107de32a68f5b95d4c0c90f26d6 100755 (executable)
Binary files a/src/STD/resources/open.png and b/src/STD/resources/open.png differ
index c7446259534a83a6e06232c80c732b459919cd15..b2b5c95ac6a45af84b1f6de1b259e5e4ca890134 100755 (executable)
Binary files a/src/STD/resources/paste.png and b/src/STD/resources/paste.png differ
index 37ca7c24d941032c079bb45cfd377d1d07c85882..69bae957d19a7c332608629612ddfcb786d364d0 100755 (executable)
Binary files a/src/STD/resources/print.png and b/src/STD/resources/print.png differ
index ac72e5c27cb02fdb6aebd6fdf3a8f08b4a4bb2fb..3753bb923cd9e03192cfe0d8cb013ae6813ddd51 100755 (executable)
Binary files a/src/STD/resources/redo.png and b/src/STD/resources/redo.png differ
index ccda81cb117fd14d8ba2279f5de2aa03b55e1b90..761af7368d1abbee4f38dfbcbedca5bbe3efabb1 100755 (executable)
Binary files a/src/STD/resources/reset.png and b/src/STD/resources/reset.png differ
index 330493fa2ae0c510e9ccd70d2f923b1220b9dde5..be10e0cf8817b7532548560cd558d72c0f0f8560 100755 (executable)
Binary files a/src/STD/resources/save.png and b/src/STD/resources/save.png differ
index 61b19777e4f9527d8961358b7dde84d4af2d16e6..9b60fbd5d01059c8cc35f2dfa10f27626a498577 100755 (executable)
Binary files a/src/STD/resources/undo.png and b/src/STD/resources/undo.png differ
diff --git a/src/STD/resources/undo_arrow.png b/src/STD/resources/undo_arrow.png
deleted file mode 100755 (executable)
index 717e0e6..0000000
Binary files a/src/STD/resources/undo_arrow.png and /dev/null differ
diff --git a/src/STD/resources/vtile.png b/src/STD/resources/vtile.png
new file mode 100644 (file)
index 0000000..9ad8814
Binary files /dev/null and b/src/STD/resources/vtile.png differ
index 84543711bbe711d93147e94205180c835ef64ac2..2c2646522b9fe37a331d5b3d90f6baed4b49a391 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : suit
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libsuit.la
 
-salomeinclude_HEADERS= \
-       SUIT.h \
-       SUIT_ActionOperation.h \
-       SUIT_Application.h \
-       SUIT_Convertor.h \
-       SUIT_DataObject.h \
-       SUIT_DataObjectIterator.h \
-       SUIT_DataObjectKey.h \
-       SUIT_DataOwner.h \
-       SUIT_Desktop.h \
-       SUIT_ExceptionHandler.h \
-       SUIT_FileDlg.h \
-       SUIT_FileValidator.h \
-       SUIT_MessageBox.h \
-       SUIT_MsgDlg.h \
-       SUIT_Operation.h \
-       SUIT_OverrideCursor.h \
-       SUIT_ParserSettings.h \
-       SUIT_PopupClient.h \
-       SUIT_ResourceMgr.h \
-       SUIT_SelectionMgr.h \
-       SUIT_Selector.h \
-       SUIT_Session.h \
-       SUIT_SmartPtr.h \
-       SUIT_Study.h \
-       SUIT_ToolButton.h \
-       SUIT_Tools.h \
-       SUIT_ViewManager.h \
-       SUIT_ViewModel.h \
-       SUIT_ViewWindow.h \
-       SUIT_SelectionFilter.h \
-       SUIT_Accel.h \
-       SUIT_TreeSync.h
+salomeinclude_HEADERS =                        \
+       SUIT.h                          \
+       SUIT_Accel.h                    \
+       SUIT_ActionOperation.h          \
+       SUIT_Application.h              \
+       SUIT_DataBrowser.h              \
+       SUIT_DataObject.h               \
+       SUIT_DataObjectIterator.h       \
+       SUIT_DataObjectKey.h            \
+       SUIT_DataOwner.h                \
+       SUIT_Desktop.h                  \
+       SUIT_ExceptionHandler.h         \
+       SUIT_FileDlg.h                  \
+       SUIT_FileValidator.h            \
+       SUIT_LicenseDlg.h               \
+       SUIT_MessageBox.h               \
+       SUIT_Operation.h                \
+       SUIT_OverrideCursor.h           \
+       SUIT_PopupClient.h              \
+       SUIT_PreferenceMgr.h            \
+       SUIT_ResourceMgr.h              \
+       SUIT_SelectionFilter.h          \
+       SUIT_SelectionMgr.h             \
+       SUIT_Selector.h                 \
+       SUIT_Session.h                  \
+       SUIT_SmartPtr.h                 \
+       SUIT_Study.h                    \
+       SUIT_Tools.h                    \
+       SUIT_TreeSync.h                 \
+       SUIT_TreeModel.h                \
+       SUIT_ViewManager.h              \
+       SUIT_ViewModel.h                \
+       SUIT_ViewWindow.h
 
-dist_libsuit_la_SOURCES= \
-       SUIT_ActionOperation.cxx \
-       SUIT_Application.cxx \
-       SUIT_DataObject.cxx \
-       SUIT_DataObjectIterator.cxx \
-       SUIT_DataObjectKey.cxx \
-       SUIT_DataOwner.cxx \
-       SUIT_Desktop.cxx \
-       SUIT_ExceptionHandler.cxx \
-       SUIT_FileDlg.cxx \
-       SUIT_FileValidator.cxx \
-       SUIT_MessageBox.cxx \
-       SUIT_MsgDlg.cxx \
-       SUIT_Operation.cxx \
-       SUIT_OverrideCursor.cxx \
-       SUIT_ParserSettings.cxx \
-       SUIT_PopupClient.cxx \
-       SUIT_ResourceMgr.cxx \
-       SUIT_SelectionMgr.cxx \
-       SUIT_Selector.cxx \
-       SUIT_Session.cxx \
-       SUIT_Study.cxx \
-       SUIT_ToolButton.cxx \
-       SUIT_Tools.cxx \
-       SUIT_ViewManager.cxx \
-       SUIT_ViewModel.cxx \
-       SUIT_ViewWindow.cxx \
-       SUIT_SelectionFilter.cxx \
-       SUIT_Accel.cxx
+dist_libsuit_la_SOURCES =              \
+       SUIT_Accel.cxx                  \
+       SUIT_ActionOperation.cxx        \
+       SUIT_Application.cxx            \
+       SUIT_DataBrowser.cxx            \
+       SUIT_DataObject.cxx             \
+       SUIT_DataObjectIterator.cxx     \
+       SUIT_DataObjectKey.cxx          \
+       SUIT_DataOwner.cxx              \
+       SUIT_Desktop.cxx                \
+       SUIT_ExceptionHandler.cxx       \
+       SUIT_FileDlg.cxx                \
+       SUIT_LicenseDlg.cxx             \
+       SUIT_FileValidator.cxx          \
+       SUIT_MessageBox.cxx             \
+       SUIT_Operation.cxx              \
+       SUIT_OverrideCursor.cxx         \
+       SUIT_PopupClient.cxx            \
+       SUIT_PreferenceMgr.cxx          \
+       SUIT_ResourceMgr.cxx            \
+       SUIT_SelectionFilter.cxx        \
+       SUIT_SelectionMgr.cxx           \
+       SUIT_Selector.cxx               \
+       SUIT_Session.cxx                \
+       SUIT_Study.cxx                  \
+       SUIT_Tools.cxx                  \
+       SUIT_TreeModel.cxx              \
+       SUIT_ViewManager.cxx            \
+       SUIT_ViewModel.cxx              \
+       SUIT_ViewWindow.cxx
 
-MOC_FILES= \
-       SUIT_ActionOperation_moc.cxx \
-       SUIT_Application_moc.cxx \
-       SUIT_DataObject_moc.cxx \
-       SUIT_Desktop_moc.cxx \
-       SUIT_FileDlg_moc.cxx \
-       SUIT_MsgDlg_moc.cxx \
-       SUIT_Operation_moc.cxx \
-       SUIT_PopupClient_moc.cxx \
-       SUIT_Session_moc.cxx \
-       SUIT_Study_moc.cxx \
-       SUIT_ToolButton_moc.cxx \
-       SUIT_ViewModel_moc.cxx \
-       SUIT_ViewWindow_moc.cxx \
-       SUIT_ViewManager_moc.cxx \
-       SUIT_SelectionMgr_moc.cxx \
-       SUIT_Selector_moc.cxx \
-       SUIT_Accel_moc.cxx
-nodist_libsuit_la_SOURCES=$(MOC_FILES)
+MOC_FILES =                            \
+       SUIT_Accel_moc.cxx              \
+       SUIT_ActionOperation_moc.cxx    \
+       SUIT_Application_moc.cxx        \
+       SUIT_DataBrowser_moc.cxx        \
+       SUIT_DataObject_moc.cxx         \
+       SUIT_Desktop_moc.cxx            \
+       SUIT_LicenseDlg_moc.cxx         \
+       SUIT_FileDlg_moc.cxx            \
+       SUIT_Operation_moc.cxx          \
+       SUIT_PopupClient_moc.cxx        \
+       SUIT_PreferenceMgr_moc.cxx      \
+       SUIT_SelectionMgr_moc.cxx       \
+       SUIT_Selector_moc.cxx           \
+       SUIT_Session_moc.cxx            \
+       SUIT_Study_moc.cxx              \
+       SUIT_TreeModel_moc.cxx          \
+       SUIT_ViewManager_moc.cxx        \
+       SUIT_ViewModel_moc.cxx          \
+       SUIT_ViewWindow_moc.cxx
 
-dist_salomeres_DATA = \
-       resources/cascade.png \
-       resources/htile.png \
-       resources/vtile.png
+nodist_libsuit_la_SOURCES = $(MOC_FILES)
 
-nodist_salomeres_DATA = \
-       SUIT_images.qm \
+nodist_salomeres_DATA =                        \
        SUIT_msg_en.qm
 
-libsuit_la_CPPFLAGS=$(QT_INCLUDES) -I$(srcdir)/../Qtx
-libsuit_la_LDFLAGS=$(QT_MT_LIBS)
-libsuit_la_LIBADD=../Qtx/libqtx.la
+libsuit_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../Qtx -I$(srcdir)/../ObjBrowser
+
+if ENABLE_TESTRECORDER
+  libsuit_la_CPPFLAGS+= -DENABLE_TESTRECORDER $(TESTRECORDER_INCLUDES)
+endif
+
+libsuit_la_LDFLAGS  = $(QT_MT_LIBS)
+
+if ENABLE_TESTRECORDER
+  libsuit_la_LDFLAGS+= $(TESTRECORDER_LIBS)
+endif
+
+libsuit_la_LIBADD   = ../Qtx/libqtx.la ../ObjBrowser/libObjBrowser.la
index 82940286ad934effc76e4d8aa5a8b7de6a85d692..2d52a79f6b3613819fc3ebd892f18976db3f9aeb 100755 (executable)
@@ -1,36 +1,38 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SUIT.h
+// Author : 
 //
 #ifndef SUIT_H
 #define SUIT_H
 
-#if defined SUIT_EXPORTS
-#if defined WNT
-#define SUIT_EXPORT __declspec( dllexport )
+#if defined WIN32
+#  if defined SUIT_EXPORTS
+#    define SUIT_EXPORT __declspec( dllexport )
+#  else
+#    define SUIT_EXPORT __declspec( dllimport )
+#  endif
 #else
-#define SUIT_EXPORT
-#endif
-#else
-#if defined WNT
-#define SUIT_EXPORT __declspec( dllimport )
-#else
-#define SUIT_EXPORT
-#endif
+#  define SUIT_EXPORT
 #endif
 
 #if defined SOLARIS
@@ -39,7 +41,7 @@
 #define true  1
 #endif
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
 
@@ -52,4 +54,4 @@
 #define SUIT_ASSERT(x)
 #endif
 
-#endif
+#endif  // SUIT_H
diff --git a/src/SUIT/SUIT.pro b/src/SUIT/SUIT.pro
new file mode 100644 (file)
index 0000000..9161aed
--- /dev/null
@@ -0,0 +1,105 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = suit
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+INCLUDEPATH += ../../include ../Qtx
+LIBS += -L../../lib -lqtx
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += SUIT_EXPORTS
+
+HEADERS  = SUIT.h
+HEADERS += SUIT_Accel.h
+HEADERS += SUIT_ActionOperation.h
+HEADERS += SUIT_Application.h
+HEADERS += SUIT_DataObject.h
+HEADERS += SUIT_DataObjectIterator.h
+HEADERS += SUIT_DataObjectKey.h
+HEADERS += SUIT_DataOwner.h
+HEADERS += SUIT_Desktop.h
+HEADERS += SUIT_ExceptionHandler.h
+HEADERS += SUIT_FileDlg.h
+HEADERS += SUIT_FileValidator.h
+HEADERS += SUIT_LicenseDlg.h
+HEADERS += SUIT_MessageBox.h
+HEADERS += SUIT_Operation.h
+HEADERS += SUIT_OverrideCursor.h
+HEADERS += SUIT_PopupClient.h
+HEADERS += SUIT_ResourceMgr.h
+HEADERS += SUIT_SelectionFilter.h
+HEADERS += SUIT_SelectionMgr.h
+HEADERS += SUIT_Selector.h
+HEADERS += SUIT_Session.h
+HEADERS += SUIT_SmartPtr.h
+HEADERS += SUIT_Study.h
+HEADERS += SUIT_Tools.h
+HEADERS += SUIT_TreeSync.h
+HEADERS += SUIT_ViewManager.h
+HEADERS += SUIT_ViewModel.h
+HEADERS += SUIT_ViewWindow.h
+
+SOURCES  = SUIT_Accel.cxx
+SOURCES += SUIT_ActionOperation.cxx
+SOURCES += SUIT_Application.cxx
+SOURCES += SUIT_DataObject.cxx
+SOURCES += SUIT_DataObjectIterator.cxx
+SOURCES += SUIT_DataObjectKey.cxx
+SOURCES += SUIT_DataOwner.cxx
+SOURCES += SUIT_Desktop.cxx
+SOURCES += SUIT_ExceptionHandler.cxx
+SOURCES += SUIT_FileDlg.cxx
+SOURCES += SUIT_FileValidator.cxx
+SOURCES += SUIT_LicenseDlg.cxx
+SOURCES += SUIT_MessageBox.cxx
+SOURCES += SUIT_Operation.cxx
+SOURCES += SUIT_OverrideCursor.cxx
+SOURCES += SUIT_PopupClient.cxx
+SOURCES += SUIT_ResourceMgr.cxx
+SOURCES += SUIT_SelectionFilter.cxx
+SOURCES += SUIT_SelectionMgr.cxx
+SOURCES += SUIT_Selector.cxx
+SOURCES += SUIT_Session.cxx
+SOURCES += SUIT_Study.cxx
+SOURCES += SUIT_Tools.cxx
+SOURCES += SUIT_ViewManager.cxx
+SOURCES += SUIT_ViewModel.cxx
+SOURCES += SUIT_ViewWindow.cxx
+
+TRANSLATIONS = resources/SUIT_images.ts \
+               resources/SUIT_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 7bc7b5167d5a6865851fd0ba03efe82c1228df94..f7babbb3fbd0b7d0c11acec7b30edf8c49622ea7 100644 (file)
@@ -1,40 +1,48 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // SUIT_Accel.cxx: implementation of the SUIT_Accel class.
-
+//
 #include "SUIT_Accel.h"
+
 #include "SUIT_ViewWindow.h"
 #include "SUIT_ViewManager.h"
 #include "SUIT_ViewModel.h"
 
-#include <qobjectlist.h>
-#include <qapplication.h>
-#include <qnamespace.h>
+#include <QCoreApplication>
+#include <QEvent>
+#include <QKeyEvent>
 
+/*!
+  \class SUIT_Accel
+  \brief Manager of keyboard accelerator bindings.
+*/
 
 SUIT_Accel* SUIT_Accel::myself = 0;
 
 /*! Constructor [private].*/
 SUIT_Accel::SUIT_Accel()
-  : QObject( qApp, "SUIT_Accel" )
+: QObject( QCoreApplication::instance() )
 {
-  qApp->installEventFilter( this );
+  QCoreApplication::instance()->installEventFilter( this );
 }
 
 /*! getAccel() : public interface for SUIT_Accel object.  Only one instance is created and returned. */
@@ -61,10 +69,12 @@ void SUIT_Accel::setActionKey( const int action, const int key, const QString& t
 /*! unsetActionKey() : unregister a certain key accelerator */
 void SUIT_Accel::unsetActionKey( const int key, const QString& type )
 {
-  if ( myMap.contains( type ) ) {
+  if ( myMap.contains( type ) )
+  {
     IdActionMap idActionMap = myMap[type];
-    if ( idActionMap.contains( key ) ) {
-      idActionMap.erase( key );
+    if ( idActionMap.contains( key ) )
+    {
+      idActionMap.remove( key );
       myMap[type] = idActionMap;
     }
   }
@@ -73,7 +83,8 @@ void SUIT_Accel::unsetActionKey( const int key, const QString& type )
 /*! getParentViewWindow() : returns given object or any of its parents-grandparents-.. if it is a SUIT_ViewWindow */ 
 SUIT_ViewWindow* getParentViewWindow( const QObject* obj )
 {
-  if ( obj ) {
+  if ( obj )
+  {
     if ( obj->inherits( "SUIT_ViewWindow" ) )
       return (SUIT_ViewWindow*)obj;
     else
@@ -83,22 +94,25 @@ SUIT_ViewWindow* getParentViewWindow( const QObject* obj )
 }
 
 /*! getKey() : returns integer key code (with modifiers) made of key pressed 'inside' given event */
-int getKey( QKeyEvent *keyEvent )
+int getKey( QKeyEventkeyEvent )
 {
-  int key = keyEvent->key(), 
-    state = keyEvent->state();
-  if ( state & Qt::ShiftButton )   
+  int key = keyEvent->key(), state = keyEvent->modifiers();
+  if ( state & Qt::ShiftModifier )   
     key += Qt::SHIFT;
-  if ( state & Qt::ControlButton ) 
+  if ( state & Qt::ControlModifier )
     key += Qt::CTRL;
-  if ( state & Qt::AltButton )     
+  if ( state & Qt::AltModifier )
     key += Qt::ALT;
-  if ( state & Qt::MetaButton )    
+  if ( state & Qt::MetaModifier )
     key += Qt::META;
   return key;
 }
 
-/*! getAccelKey() : returns key pressed if 1) event was KeyPress 2) pressed key is a registered accelerator */ 
+/*! 
+  Returns key pressed if 
+  -# event was KeyPress 
+  -# pressed key is a registered accelerator
+*/
 int SUIT_Accel::getAccelKey( QEvent *event )
 {
   if ( event && event->type() == QEvent::KeyPress ) {
index fdc9cd384c97bc4055bdb29243d26817ef395845..b3b0886f1d7e615520e911a025b317af6d50ccda 100644 (file)
@@ -1,36 +1,35 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // SUIT_Accel.h: interface for the SUIT_Accel class.
-
-#ifndef SUIT_Accel_h 
-#define SUIT_Accel_h
+//
+#ifndef SUIT_ACELL_H
+#define SUIT_ACELL_H
 
 #include "SUIT.h"
 
-#include <qobject.h>
-#include <qstring.h>
-#include <qmap.h>
+#include <QMap>
+#include <QObject>
+#include <QString>
 
-/*!
-  \class SUIT_Accel
-  Manager of keyboard accelerator bindings
-*/
 class SUIT_EXPORT SUIT_Accel: public QObject
 {
   Q_OBJECT
@@ -63,15 +62,16 @@ protected:
 private:
   SUIT_Accel();
 
-  int getAccelKey( QEvent* ); // returns key pressed if 1) event was KeyPress 
-                              // 2) pressed key is a registered accelerator 
+  int getAccelKey( QEvent* );
 
-  typedef QMap<int, int> IdActionMap; // key - to - action_id map
-  typedef QMap<QString, IdActionMap> ViewerTypeIdActionMap; // viewer_type - to - IdActionMap
-  ViewerTypeIdActionMap myMap;
+  typedef QMap<int, int> IdActionMap; //!< maps key to action id
+  typedef QMap<QString, IdActionMap> 
+               ViewerTypeIdActionMap; //!< maps viewer type to IdActionMap
+  ViewerTypeIdActionMap myMap;        //!< viewer actions map
 
-  QMap<int, bool> myOptMap; // key - to - <not_used> map, used for optimazation.  all registered keys (accelerators)
-                            // are stored in this map.
+  //! Maps key to <not_used> flag map, used for optimization.
+  //! All registered keys (accelerators) are stored in this map.
+  QMap<int, bool> myOptMap;
 
   static SUIT_Accel* myself;
 };
index d56f01705fc1310dbb6a30be466f4511aef82b18..f3f40ee5913cc4e1b06b83994d08b9774ad73000 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_ActionOperation.h"
 
@@ -49,20 +52,20 @@ QtxAction* SUIT_ActionOperation::action() const
 /*!Set action.
  * Create new instance of QtxAction and set.
  */
-void SUIT_ActionOperation::setAction( const QString& text, const QIconSet& icon,
-                                     const QString& menuText, QKeySequence accel,
-                                      QObject* parent, const char* name, bool toggle )
+void SUIT_ActionOperation::setAction( const QString& text, const QIcon& icon,
+                                                             const QString& menuText, QKeySequence accel,
+                                      QObject* parent, bool toggle )
 {
-  setAction( new QtxAction( text, icon, menuText, accel, parent, name, toggle ) );
+  setAction( new QtxAction( text, icon, menuText, accel, parent, toggle ) );
 }
 
 /*!Set action.
  * Create new instance of QtxAction and set.
  */
 void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText,
-                                     QKeySequence accel, QObject* parent, const char* name, bool toggle )
+                                                             QKeySequence accel, QObject* parent, bool toggle )
 {
-  setAction( new QtxAction(text, menuText, accel, parent, name, toggle ) );
+  setAction( new QtxAction( text, menuText, accel, parent, toggle ) );
 }
 
 /*!Set action.
@@ -76,7 +79,7 @@ void SUIT_ActionOperation::setAction( QtxAction* a )
   myAction = a;
 
   myAction->setEnabled( application()->activeStudy() );
-  connect( myAction, SIGNAL( activated() ), SLOT( start() ) );
+  connect( myAction, SIGNAL( triggered() ), SLOT( start() ) );
 }
 
 /*! Add action to widget \a wid.
@@ -87,18 +90,8 @@ bool SUIT_ActionOperation::addTo( QWidget* wid )
   if ( !action() )
     return false;
 
-  return action()->addTo( wid );
-}
-
-/*! Add action to widget \a wid.
- *\retval TRUE - successful, FALSE - not successful.
- */
-bool SUIT_ActionOperation::addTo( QWidget* wid, int idx )
-{
-  if ( !action() )
-    return false;
-
-  return action()->addTo( wid, idx );
+  wid->addAction( action() );
+  return true;
 }
 
 /*! Set status tip for action.
index bed11e318b3be184d977bf49295a4afe7dc10153..f4f8e895188fea7e2bb4ea17eef6fa185390497c 100644 (file)
@@ -1,58 +1,62 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_ACTIONOPERATION_H
 #define SUIT_ACTIONOPERATION_H
 
 #include "SUIT_Operation.h"
 
-class QtxAction;
+#include <QKeySequence>
+
+class QIcon;
 class QString;
-class QIconSet;
-class QKeySequence;
 class QWidget;
 
+class QtxAction;
+
 /*!Provide support QtxAction*/
 class SUIT_EXPORT SUIT_ActionOperation : public SUIT_Operation
 {
        Q_OBJECT
 
 public:
-       SUIT_ActionOperation( SUIT_Application* theApp );
+       SUIT_ActionOperation( SUIT_Application* );
        virtual ~SUIT_ActionOperation();
 
        QtxAction*   action() const;
 
        /** @name GUI management*/
        //@{
-       virtual void setAction( const QString& text, const QIconSet& icon, const QString& menuText,
-                               QKeySequence accel, QObject* parent, const char* name = 0, bool toggle = false );
+       virtual void setAction( const QString& text, const QIcon& icon, const QString& menuText,
+                                                 QKeySequence accel, QObject* parent, bool toggle = false );
 
-       virtual void setAction( const QString& text, const QString& menuText, QKeySequence accel,
-                               QObject* parent, const char* name = 0, bool toggle = false );
+       virtual void setAction( const QString& text, const QString& menuText,
+                          QKeySequence accel, QObject* parent, bool toggle = false );
        virtual void setAction( QtxAction* theAction );
        
        bool         addTo( QWidget* theWidget );
-       bool         addTo( QWidget* theWidget, int thePos );
-       
+
        void         setStatusTip( const QString& theTip );
        //@}
-       
+
 private:
        QtxAction*   myAction;
 
index e6400595ce50f490dbd8f6dd410701f565b0a0e5..042b6fc8c11492c3b2bd5bae5c13c2271535d035 100755 (executable)
@@ -1,54 +1,74 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_Application.h"
 
+#include "SUIT_Study.h"
 #include "SUIT_Session.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_ResourceMgr.h"
 
-#include <qlabel.h>
-#include <qtimer.h>
-#include <qstatusbar.h>
-#include <qapplication.h>
+#include <QTimer>
+#include <QLabel>
+#include <QStatusBar>
+#include <QApplication>
+#include <QSize>
 
 #include <QtxAction.h>
 #include <QtxActionMenuMgr.h>
 #include <QtxActionToolMgr.h>
 
+/*!
+  \class StatusLabel
+  \brief Status bar customization label. Used to workaroubd desktop resizing bug.
+  \internal
+*/
+class StatusLabel : public QLabel
+{
+public:
+  StatusLabel( QWidget* parent ) : QLabel( parent ) {}
+  QSize minimumSizeHint () const { return QSize( 0, QLabel::minimumSizeHint().height() ); }
+};
+
 /*!
   Default constructor
 */
 SUIT_Application::SUIT_Application()
-  : QObject( 0 ),
-    myStudy( 0 ),
-    myDesktop( 0 ),
-    myStatusLabel( 0 )
+: QObject( 0 ),
+  myStudy( 0 ),
+  myDesktop( 0 ),
+  myStatusLabel( 0 )
 {
+  if ( SUIT_Session::session() )
+    SUIT_Session::session()->insertApplication( this );
 }
 
 /*!
   Destructor
 */
-SUIT_Application::~SUIT_Application() 
+SUIT_Application::~SUIT_Application()
 {
+  SUIT_Study* s = myStudy;
   setActiveStudy( 0 );
-  delete myStudy;
+  delete s;
 
   setDesktop( 0 );
 }
@@ -62,7 +82,7 @@ SUIT_Desktop* SUIT_Application::desktop()
 }
 
 /*!
-   \return FALSE if application can not be closed (because of non saved data for example). 
+   \return FALSE if application can not be closed (because of non saved data for example).
    This method called by SUIT_Session whin closing of application was requested.
 */
 bool SUIT_Application::isPossibleToClose( bool& )
@@ -92,7 +112,7 @@ SUIT_Study* SUIT_Application::activeStudy() const
 */
 QString SUIT_Application::applicationVersion() const
 {
-  return QString::null;
+  return QString();
 }
 
 /*!
@@ -124,15 +144,6 @@ bool SUIT_Application::useFile( const QString& theFileName )
   return status;
 }
 
-/*!
-  Opens other study into active Study. If Study is empty - creates it.
-  \param theName - name of study
-*/
-bool SUIT_Application::useStudy( const QString& theName )
-{
-  return false;
-}
-
 /*!
   Creates new empty Study if active Study = 0
 */
@@ -143,7 +154,7 @@ void SUIT_Application::createEmptyStudy()
 }
 
 /*!
-  \return number of Studies. 
+  \return number of Studies.
   Must be redefined in Applications which support several studies for one Application instance.
 */
 int SUIT_Application::getNbStudies() const
@@ -165,7 +176,7 @@ SUIT_ResourceMgr* SUIT_Application::resourceMgr() const
 #define DEFAULT_MESSAGE_DELAY 3000
 
 /*!
-  Puts the message to the status bar  
+  Puts the message to the status bar
   \param msg - text of message
   \param msec - time in milliseconds, after that the status label will be cleared
 */
@@ -176,7 +187,7 @@ void SUIT_Application::putInfo( const QString& msg, const int msec )
 
   if ( !myStatusLabel )
   {
-    myStatusLabel = new QLabel( desktop()->statusBar() );
+    myStatusLabel = new StatusLabel( desktop()->statusBar() );
     desktop()->statusBar()->addWidget( myStatusLabel, 1 );
     myStatusLabel->show();
   }
@@ -202,14 +213,15 @@ void SUIT_Application::onInfoClear()
   bool changed = !myStatusLabel->text().isEmpty();
   myStatusLabel->clear();
   if ( changed )
-    emit infoChanged( QString::null );
+    emit infoChanged( QString() );
 }
 
 /*!
-  Updates status of the registerd actions
+  Update status of the registerd actions
 */
 void SUIT_Application::updateCommandsStatus()
-{}
+{
+}
 
 /*!
   Initialize with application arguments
@@ -218,7 +230,7 @@ void SUIT_Application::updateCommandsStatus()
 */
 SUIT_Application* SUIT_Application::startApplication( int argc, char** argv ) const
 {
-  return startApplication( name(), argc, argv );
+  return startApplication( objectName(), argc, argv );
 }
 
 /*!
@@ -273,12 +285,13 @@ void SUIT_Application::setActiveStudy( SUIT_Study* study )
   if ( myStudy == study )
     return;
 
-  if(myStudy)
-    disconnect(myStudy, SIGNAL( studyModified( SUIT_Study* ) ), this, SLOT( updateCommandsStatus() ) );
+  if ( myStudy )
+    disconnect( myStudy, SIGNAL( studyModified( SUIT_Study* ) ),
+               this, SLOT( updateCommandsStatus() ) );
+  if ( study )
+    connect( study, SIGNAL( studyModified( SUIT_Study* ) ),
+            this, SLOT( updateCommandsStatus() ) );
 
-  if(study)
-    connect(study, SIGNAL( studyModified( SUIT_Study* ) ), this, SLOT( updateCommandsStatus() ) );
-           
   myStudy = study;
 }
 
@@ -478,7 +491,12 @@ int SUIT_Application::createMenu( const int id, const QString& menu, const int g
 */
 void SUIT_Application::setMenuShown( QAction* a, const bool on )
 {
-  setMenuShown( actionId( a ), on );
+  if ( !a || !desktop() )
+    return;
+
+  QtxActionMenuMgr* mMgr = desktop()->menuMgr();
+  if ( mMgr )
+    mMgr->setShown( mMgr->actionId( a ), on );
 }
 
 /*!
@@ -488,8 +506,7 @@ void SUIT_Application::setMenuShown( QAction* a, const bool on )
 */
 void SUIT_Application::setMenuShown( const int id, const bool on )
 {
-  if ( desktop() && desktop()->menuMgr() )
-    desktop()->menuMgr()->setShown( id, on );
+  setMenuShown( action( id ), on );
 }
 
 /*!
@@ -499,7 +516,12 @@ void SUIT_Application::setMenuShown( const int id, const bool on )
 */
 void SUIT_Application::setToolShown( QAction* a, const bool on )
 {
-  setToolShown( actionId( a ), on );
+  if ( !a || !desktop() )
+    return;
+
+  QtxActionToolMgr* tMgr = desktop()->toolMgr();
+  if ( tMgr )
+    tMgr->setShown( tMgr->actionId( a ), on );
 }
 
 /*!
@@ -509,8 +531,7 @@ void SUIT_Application::setToolShown( QAction* a, const bool on )
 */
 void SUIT_Application::setToolShown( const int id, const bool on )
 {
-  if ( desktop() && desktop()->toolMgr() )
-    desktop()->toolMgr()->setShown( id, on );
+  setToolShown( action( id ), on );
 }
 
 /*!
@@ -554,15 +575,24 @@ QAction* SUIT_Application::action( const int id ) const
 int SUIT_Application::actionId( const QAction* a ) const
 {
   int id = -1;
-  for ( QMap<int, QAction*>::ConstIterator it = myActionMap.begin(); 
-       it != myActionMap.end() && id == -1;
-       ++it ) {
-    if ( it.data() == a )
+  for ( QMap<int, QAction*>::ConstIterator it = myActionMap.begin(); it != myActionMap.end() && id == -1; ++it )
+  {
+    if ( it.value() == a )
       id = it.key();
   }
   return id;
 }
 
+QList<QAction*> SUIT_Application::actions() const
+{
+  return myActionMap.values();
+}
+
+QList<int> SUIT_Application::actionIds() const
+{
+  return myActionMap.keys();
+}
+
 /*!
   Creates action and registers it both in menu manager and tool manager
   \return new instance of action
@@ -577,15 +607,15 @@ int SUIT_Application::actionId( const QAction* a ) const
   \param reciever - object that contains slot
   \param member - slot to be called when action is activated
 */
-QAction* SUIT_Application::createAction( const int id, const QString& text, const QIconSet& icon,
+QAction* SUIT_Application::createAction( const int id, const QString& text, const QIcon& icon,
                                          const QString& menu, const QString& tip, const int key,
                                          QObject* parent, const bool toggle, QObject* reciever, const char* member )
 {
-  QtxAction* a = new QtxAction( text, icon, menu, key, parent, 0, toggle );
+  QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle );
   a->setStatusTip( tip );
 
   if ( reciever && member )
-    connect( a, SIGNAL( activated() ), reciever, member );
+    connect( a, SIGNAL( triggered( bool ) ), reciever, member );
 
   registerAction( id, a );
 
@@ -606,7 +636,7 @@ int SUIT_Application::registerAction( const int id, QAction* a )
   static int generatedId = -1;
   ident = id == -1 ? --generatedId : id;
 
-  if ( action( ident ) ) 
+  if ( action( ident ) )
     qWarning( "Action registration id is already in use: %d", ident );
 
   myActionMap.insert( ident, a );
@@ -617,6 +647,9 @@ int SUIT_Application::registerAction( const int id, QAction* a )
   if ( desktop() && desktop()->toolMgr() )
     desktop()->toolMgr()->registerAction( a );
 
+  if ( desktop() )
+    desktop()->addAction( a );
+
   return ident;
 }
 
@@ -640,8 +673,8 @@ void SUIT_Application::onDesktopActivated()
 /*!
   SLOT: is used for Help browsing
 */
-
-void SUIT_Application::onHelpContextModule (const QString& /*theComponentName*/,
-                                            const QString& /*theFileName*/)
+void SUIT_Application::onHelpContextModule( const QString& /*theComponentName*/,
+                                            const QString& /*theFileName*/,
+                                           const QString& /*theContext*/ )
 {
 }
index 14d4854ab23a5af04ab65632c98e38eab797e546..98141edc52277ff0a7ef1717af2c4bec688e6ce4 100755 (executable)
@@ -1,38 +1,42 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_APPLICATION_H
 #define SUIT_APPLICATION_H
 
 #include "SUIT.h"
-#include "SUIT_Study.h"
 
-#include <qobject.h>
-#include <qwidget.h>
+#include <QObject>
+#include <QMap>
 
+class QIcon;
 class QLabel;
 class QString;
 class QAction;
-class QIconSet;
+class QWidget;
+
 class SUIT_Desktop;
-class SUIT_Convertor;
 class SUIT_ViewModel;
 class SUIT_ResourceMgr;
+class SUIT_Study;
 
 #ifdef WIN32
 #pragma warning ( disable:4251 )
@@ -83,9 +87,6 @@ public:
   //! Opens document <theFileName> into active Study. If Study is empty - creates it.
   virtual bool          useFile( const QString& theFileName);
 
-  //! Loads document <theName> into active Study. If Study is empty - creates it.
-  virtual bool          useStudy( const QString& theName);
-
   //! Creates new empty Study if active Study = 0
   virtual void          createEmptyStudy();
 
@@ -95,10 +96,6 @@ public:
 
   SUIT_ResourceMgr*     resourceMgr() const;
 
-  /*! Returns instance of data object Convertor class according to given Viewer. 
-      If convertation is not supported returns 0. */
-  virtual SUIT_Convertor* getConvertor(const SUIT_ViewModel* theViewer) { return 0; }
-
   //! Puts the message to the status bar  
   void putInfo ( const QString&, const int = 0 );
 
@@ -116,7 +113,7 @@ signals:
 
 public slots:
   virtual void          updateCommandsStatus();
-  virtual void          onHelpContextModule( const QString&, const QString& );
+  virtual void          onHelpContextModule( const QString&, const QString&, const QString& = QString() );
 
 private slots:
   void                  onInfoClear();
@@ -159,8 +156,12 @@ protected:
   static QAction*       separator();
   QAction*              action( const int ) const;
   int                   actionId( const QAction* ) const;
+
+  QList<QAction*>       actions() const;
+  QList<int>            actionIds() const;
+
   int                   registerAction( const int, QAction* );
-  QAction*              createAction( const int, const QString&, const QIconSet&, const QString&,
+  QAction*              createAction( const int, const QString&, const QIcon&, const QString&,
                                       const QString&, const int, QObject* = 0,
                                       const bool = false, QObject* = 0, const char* = 0 );
 
diff --git a/src/SUIT/SUIT_Convertor.h b/src/SUIT/SUIT_Convertor.h
deleted file mode 100755 (executable)
index fd37969..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// SUIT_Convertor.h: interface for the SUIT_Convertor class.
-//
-
-#if !defined(AFX_SUIT_CONVERTOR_H__4C27F4C7_DC7C_4BEF_9DC1_EFB97B387EBF__INCLUDED_)
-#define AFX_SUIT_CONVERTOR_H__4C27F4C7_DC7C_4BEF_9DC1_EFB97B387EBF__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "SUIT.h"
-#include "SUIT_DataObject.h"
-#include "SUIT_ViewModel.h"
-
-/*! Provides convertation of selected object of specified viewer into SUIT_DataObject.
- *  Instance of Convertor class is created by Application according to data type and viewers used.
- */
-class SUIT_Convertor  
-{
-public:
-  virtual DataObjectList getSelectedObjects(const SUIT_ViewModel* theViewer) = 0;
-  virtual void highlight(const SUIT_ViewModel* theViewer, const DataObjectList& theObjList) = 0;
-};
-
-#endif // !defined(AFX_SUIT_CONVERTOR_H__4C27F4C7_DC7C_4BEF_9DC1_EFB97B387EBF__INCLUDED_)
diff --git a/src/SUIT/SUIT_DataBrowser.cxx b/src/SUIT/SUIT_DataBrowser.cxx
new file mode 100644 (file)
index 0000000..715f3a6
--- /dev/null
@@ -0,0 +1,408 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SUIT_DataBrowser.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#include "SUIT_DataBrowser.h"
+#include "SUIT_TreeModel.h"
+#include <QtxTreeView.h>
+
+#include <QShortcut>
+
+/*!
+  \class SUIT_DataBrowser
+  \brief Object browser customization.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+*/
+SUIT_DataBrowser::SUIT_DataBrowser( QWidget* parent )
+: OB_Browser( parent )
+{
+  init( 0 );
+}
+
+/*!
+  \brief Constructor.
+  \param root root data object
+  \param parent parent widget
+*/
+SUIT_DataBrowser::SUIT_DataBrowser( SUIT_DataObject* root, QWidget* parent )
+: OB_Browser( parent )
+{
+  init( root );
+}
+
+/*!
+  \brief Destructor.
+*/
+SUIT_DataBrowser::~SUIT_DataBrowser()
+{
+}
+
+/*!
+  \brief Get popup menu client type.
+  \return popup client type
+*/
+QString SUIT_DataBrowser::popupClientType() const
+{
+  return "ObjectBrowser";
+}
+
+/*!
+  \brief Get root object.
+  \return root object
+*/
+SUIT_DataObject* SUIT_DataBrowser::root() const
+{
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+  return m ? m->root() : 0;
+}
+
+/*!
+  \brief Set root object.
+  \param r new root object
+*/
+void SUIT_DataBrowser::setRoot( SUIT_DataObject* r )
+{
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+  if ( m ) 
+    m->setRoot( r );
+}
+
+/*!
+  \brief Get 'auto-update tree' flag value.
+  \return 'auto-update tree' flag value
+  \sa setAutoUpdate(), updateTree()
+*/
+bool SUIT_DataBrowser::autoUpdate() const
+{
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+  return m ? m->autoUpdate() : false;
+}
+
+/*!
+  \brief Set 'auto-update tree' flag value.
+
+  If this flag is set to \c true (by default), the object browser is updated
+  automatically when data tree is changed.
+
+  \param on 'auto-update tree' flag value
+  \sa autoUpdate(), updateTree()
+*/
+void SUIT_DataBrowser::setAutoUpdate( const bool on )
+{
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+  if ( m ) 
+    m->setAutoUpdate( on );
+}
+
+/*!
+  \brief Update object browser starting from the object \obj;
+  open all branches automatically if \a autoOpen is \c true.
+  \param obj starting object for updating
+  \param autoOpen if \c true automatically open branches
+*/
+void SUIT_DataBrowser::updateTree( SUIT_DataObject* obj, const bool autoOpen )
+{
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+  if ( m ) {
+    m->updateTree( obj );
+    openLevels();
+
+    if (myAutoSizeFirstColumn)
+      adjustFirstColumnWidth();
+    if (myAutoSizeColumns)
+      adjustColumnsWidth();
+  }
+}
+
+/*!
+  \brief Get current key accelerator used for the 
+  object browser update operation.
+  \return current key accelerator
+  \sa setUpdateKey(), requestUpdate()
+*/
+int SUIT_DataBrowser::updateKey() const
+{
+  return myShortcut->key();
+}
+
+/*!
+  \brief Assign the key accelerator to be used for the 
+  object browser update operation.
+
+  By default, \c [F5] key is assigned for the update operation.
+  To disable the accelerator, pass 0 to this method.
+
+  \param key new key accelerator
+  \sa updateKey(), requestUpdate()
+*/
+void SUIT_DataBrowser::setUpdateKey( const int key )
+{
+  myShortcut->setKey( key );
+}
+
+/*!
+  \brief Get list of selected data objects.
+  \return list of the currently selected data objects
+*/
+DataObjectList SUIT_DataBrowser::getSelected() const
+{
+  DataObjectList lst;
+  getSelected( lst );
+  return lst;
+}
+
+/*!
+  \brief Get list of selected data objects.
+  \overload
+  \param lst list to be filled with the currently selected data objects
+*/
+void SUIT_DataBrowser::getSelected( DataObjectList& lst ) const
+{
+  lst.clear();
+
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+
+  if ( m ) {
+    QModelIndexList sel = selectedIndexes();
+    QModelIndex idx;
+  
+    foreach( idx, sel ) {
+      SUIT_DataObject* obj = m->object( idx );
+      if ( obj )
+       lst.append( obj );
+    }
+  }
+}
+
+/*!
+  \brief Set selected object.
+  \param obj data object to set selected
+  \param append if \c true, the object is added to the current selection;
+  otherwise the previous selection is first cleared
+*/
+void SUIT_DataBrowser::setSelected( const SUIT_DataObject* obj, const bool append )
+{
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+
+  if ( m ) {
+    QModelIndex index = m->index( obj );
+    if ( index.isValid() )
+      select( index, true, append );
+  }
+}
+
+/*!
+  \brief Set list of selected data objects.
+  \param lst list of the data object to set selected
+  \param append if \c true, the objects are added to the current selection;
+  otherwise the previous selection is first cleared
+*/
+void SUIT_DataBrowser::setSelected( const DataObjectList& lst, const bool append )
+{
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+
+  if ( m ) {
+    QModelIndexList indexes;
+    SUIT_DataObject* obj;
+
+    foreach( obj, lst ) {
+      QModelIndex index = m->index( obj );
+      if ( index.isValid() )
+       indexes.append( index );
+    }
+    select( indexes, true, append ); // if !indexes.isEmpty() ???
+  }
+}
+
+/*!
+  \brief Add custom actions to the popup menu.
+  \param menu popup menu
+*/
+void SUIT_DataBrowser::contextMenuPopup( QMenu* menu )
+{
+  createPopupMenu( menu );
+}
+
+/*!
+  \brief Set 'auto-size first column' flag value.
+
+  If this flag is set to \c true (by default), the first column width is resized
+  to its contents.
+
+  \param on 'auto-size first column' flag value
+  \sa setAutoSizeColumns()
+*/
+void SUIT_DataBrowser::setAutoSizeFirstColumn( const bool on )
+{
+  myAutoSizeFirstColumn = on;
+}
+
+/*!
+  \brief Set 'auto-size columns' flag value.
+
+  If this flag is set to \c true (by default is false), columns width except 
+  the first column is resized to its contents.
+
+  \param on 'auto-size columns' flag value
+  \sa setAutoSizeFirstColumn()
+*/
+void SUIT_DataBrowser::setAutoSizeColumns( const bool on )
+{
+  myAutoSizeColumns = on;
+}
+
+/*!
+  \brief Process context menu request event.
+  \param e context menu event
+*/
+void SUIT_DataBrowser::contextMenuEvent( QContextMenuEvent* e )
+{
+  contextMenuRequest( e );
+}
+
+/*!
+  \brief Set 'resize on expand item' flag value.
+
+  If this flag is set to \c true (by default is false), after
+  expanding an item columns will be resized to its contents.
+
+  \param on 'resize on expand item' flag value
+*/
+void SUIT_DataBrowser::setResizeOnExpandItem( const bool on )
+{
+  myResizeOnExpandItem = on;
+}
+
+/*!
+  \brief Initialize object browser.
+  \param root root data object
+*/
+void SUIT_DataBrowser::init( SUIT_DataObject* root )
+{
+  SUIT_ProxyModel* m = new SUIT_ProxyModel( root, this );
+  connect( m, SIGNAL( modelUpdated() ), this, SLOT( onModelUpdated() ) );
+  
+  setModel( m );
+  setItemDelegate( qobject_cast<SUIT_ProxyModel*>( model() )->delegate() );
+  connect( treeView(), SIGNAL( sortingEnabled( bool ) ), 
+          model(),    SLOT( setSortingEnabled( bool ) ) );
+  connect( treeView(), SIGNAL( clicked( const QModelIndex& ) ), 
+          this,       SLOT( onClicked( const QModelIndex& ) ) );
+  connect( treeView(), SIGNAL( doubleClicked( const QModelIndex& ) ), 
+          this,       SLOT( onDblClicked( const QModelIndex& ) ) );
+  connect( treeView(), SIGNAL( expanded( const QModelIndex& ) ), 
+          this,       SLOT( onExpanded( const QModelIndex& ) ) );
+  myShortcut = new QShortcut( Qt::Key_F5, this, SIGNAL( requestUpdate() ), SIGNAL( requestUpdate() ) );
+
+  myAutoSizeFirstColumn = true;
+  myAutoSizeColumns = false;
+  myResizeOnExpandItem = false;
+}
+
+/*!
+  \fn void SUIT_DataBrowser::requestUpdate();
+  \brief The signal is emitted when the key accelerator
+  assigned for the update operation is pressed by the user.
+
+  By default, \c [F5] key is assigned for the update operation.
+  The key accelerator can be changed with the setUpdateKey() method.
+
+  \sa updateKey(), setUpdateKey()
+*/
+
+/*!
+  \fn void SUIT_DataBrowser::clicked( SUIT_DataObject* o );
+  \brief This signal is emitted when a mouse button is clicked.
+
+  The data object the mouse was clicked on is specified by \a o.
+  The signal is only emitted when the object is valid.
+
+  \param o data object which is clicked
+*/
+
+/*!
+  \fn void SUIT_DataBrowser::doubleClicked( SUIT_DataObject* o );
+  \brief This signal is emitted when a mouse button is double-clicked.
+
+  The data object the mouse was double-clicked on is specified by \a o.
+  The signal is only emitted when the object is valid.
+
+  \param o data object which is double-clicked
+*/
+
+/*!
+  \brief Update internal modification time just after data model update
+*/
+void SUIT_DataBrowser::onModelUpdated()
+{
+  setModified();
+}
+
+/*!
+  \brief Called when item is clicked in the tree view
+  \internal
+  
+  Emits signal clicked( SUIT_DataObject* );
+*/
+void SUIT_DataBrowser::onClicked( const QModelIndex& index )
+{
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+
+  if ( m ) {
+    SUIT_DataObject* obj = m->object( index );
+    if ( obj ) emit( clicked( obj ) );
+  }
+}
+
+/*!
+  \brief Called when item is double-clicked in the tree view
+  \internal
+  
+  Emits signal doubleClicked( SUIT_DataObject* );
+*/
+void SUIT_DataBrowser::onDblClicked( const QModelIndex& index )
+{
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+
+  if ( m ) {
+    SUIT_DataObject* obj = m->object( index );
+    if ( obj ) emit( doubleClicked( obj ) );
+  }
+}
+
+/*!
+  \brief Called when item specified by index is expanded.
+  \internal
+*/
+void SUIT_DataBrowser::onExpanded( const QModelIndex& index )
+{
+  if (myResizeOnExpandItem) {
+    adjustFirstColumnWidth();
+    adjustColumnsWidth();
+  }
+}
+
diff --git a/src/SUIT/SUIT_DataBrowser.h b/src/SUIT/SUIT_DataBrowser.h
new file mode 100644 (file)
index 0000000..f619e4f
--- /dev/null
@@ -0,0 +1,94 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SUIT_DataBrowser.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef SUIT_DATABROWSER_H
+#define SUIT_DATABROWSER_H
+
+#include "SUIT.h"
+#include "SUIT_PopupClient.h"
+#include "SUIT_DataObject.h"
+#include <OB_Browser.h>
+
+class QShortcut;
+
+class SUIT_EXPORT SUIT_DataBrowser : public OB_Browser, public SUIT_PopupClient
+{
+  Q_OBJECT
+
+public:
+  SUIT_DataBrowser( QWidget* = 0 );
+  SUIT_DataBrowser( SUIT_DataObject*, QWidget* = 0 );
+  ~SUIT_DataBrowser();
+
+  virtual QString  popupClientType() const;
+
+  SUIT_DataObject* root() const;
+  void             setRoot( SUIT_DataObject* );
+
+  bool             autoUpdate() const;
+  void             setAutoUpdate( const bool );
+
+  void             updateTree( SUIT_DataObject* = 0, const bool = true );
+
+  int              updateKey() const;
+  void             setUpdateKey( const int );
+
+  DataObjectList   getSelected() const;
+  void             getSelected( DataObjectList& ) const;
+
+  void             setSelected( const SUIT_DataObject*, const bool = false );
+  void             setSelected( const DataObjectList&, const bool = false );
+
+  virtual void     contextMenuPopup( QMenu* );
+
+  void             setAutoSizeFirstColumn( const bool on );
+  void             setAutoSizeColumns( const bool on );
+  void             setResizeOnExpandItem( const bool on );
+
+protected:
+  virtual void     contextMenuEvent( QContextMenuEvent* );
+
+private:
+  void             init( SUIT_DataObject* );
+
+signals:
+  void             requestUpdate();
+  void             clicked( SUIT_DataObject* );
+  void             doubleClicked( SUIT_DataObject* );
+
+private slots:
+  void             onModelUpdated();
+  void             onClicked( const QModelIndex& );
+  void             onDblClicked( const QModelIndex& );
+  void             onExpanded( const QModelIndex& );
+
+private:
+  QShortcut*       myShortcut;
+
+  bool             myAutoSizeFirstColumn;
+  bool             myAutoSizeColumns;
+  bool             myResizeOnExpandItem;
+};
+
+#endif // SUIT_BROWSER_H
index 1082579fc137817c41e73b3aab5100de6ca489e5..7f4f1db88d9a37548efc39583db083c5e10f7ad2 100755 (executable)
@@ -1,46 +1,63 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SUIT_DataObject.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #include "SUIT_DataObject.h"
-
-#include <qobject.h>
-
 #include "SUIT_DataObjectKey.h"
 
+SUIT_DataObject::Signal* SUIT_DataObject::mySignal = 0;
+
 /*!
-    Constructor
+  \class SUIT_DataObject
+  \brief Data object representing the data instance in the tree-like hierarchy.
+
+  Data object represents uniform data tree structure recommended to use in the
+  SUIT-based applications.
 */
 
+/*!
+  \brief Constructor.
+
+  Creates the data object with the specified parent.
+  To create the top-level object, pass 0 as parameter.
+
+  \param p parent object
+*/
 SUIT_DataObject::SUIT_DataObject( SUIT_DataObject* p )
 : myParent( 0 ),
-  mySignal( 0 ),
   myOpen( false ),
-  myCheck( false )
+  myCheck( false ),
+  myAutoDel( true )
 {
-  myChildren.setAutoDelete( true );
-
   setParent( p );
+  signal()->emitCreated( this );
 }
 
 /*!
-    Destructor
-*/
+  \brief Destructor.
 
+  Destroys all the children if "auto-delete children" flag is set.
+*/
 SUIT_DataObject::~SUIT_DataObject()
 {
   SUIT_DataObject* p = myParent;
@@ -50,100 +67,94 @@ SUIT_DataObject::~SUIT_DataObject()
   if ( p )
     p->removeChild( this );
 
-  if ( mySignal )
-  {
-    mySignal->emitSignal();
-    mySignal->setOwner( 0 );
-  }
+  signal()->emitDestroyed( this );
 
-  for ( QPtrListIterator<SUIT_DataObject> it( myChildren ); it.current(); ++it )
-    it.current()->myParent = 0;
+  for ( DataObjectList::iterator it = myChildren.begin(); it != myChildren.end(); ++it )
+    (*it)->myParent = 0;
 
-  delete mySignal;
+  if ( autoDeleteChildren() )
+  {
+    for ( DataObjectList::iterator itr = myChildren.begin(); itr != myChildren.end(); ++itr )
+      delete *itr;
+  }
 }
 
 /*!
-    Returns the root object.
+  \brief Get the root object.
+  \return root object of the data tree
 */
-
 SUIT_DataObject* SUIT_DataObject::root() const
 {
   return parent() ? parent()->root() : (SUIT_DataObject*)this;
 }
 
 /*!
-    Returns the first child object.
+  \brief Get the first child object.
+  \return first child object or 0 if there are no children
+  \sa lastChild()
 */
-
 SUIT_DataObject* SUIT_DataObject::firstChild() const
 {
   SUIT_DataObject* child = 0;
   if ( !myChildren.isEmpty() )
-    child = myChildren.getFirst();
+    child = myChildren.first();
   return child;
 }
 
 /*!
-    Returns the last child object.
+  \brief Get the last child object.
+  \return last child object or 0 if there are no children
+  \sa firstChild()
 */
-
 SUIT_DataObject* SUIT_DataObject::lastChild() const
 {
   SUIT_DataObject* child = 0;
   if ( !myChildren.isEmpty() )
-    child = myChildren.getLast();
+    child = myChildren.last();
   return child;
 }
 
 /*!
-    Returns the number of the child objects.
+  \brief Get the number of the child objects.
+  \return number of the children
 */
-
 int SUIT_DataObject::childCount() const
 {
   return myChildren.count();
 }
 
 /*!
-    Returns the index of the specified object in the child list or -1.
+  \brief Get the index of the specified object in the child list.
+  \param obj child object
+  \return subobject position or -1 if it does not belong to this object
 */
-
 int SUIT_DataObject::childPos( const SUIT_DataObject* obj ) const
 {
-  int res = -1;
-
-  int i = 0;
-  for ( DataObjectListIterator it( myChildren ); it.current() && res == -1; ++it, i++ )
-  {
-    if ( it.current() == obj )
-      res = i;
-  }
-
-  return res;
+  return myChildren.indexOf( (SUIT_DataObject*)obj );
 }
 
 /*!
-    Returns the child object with specified index.
+  \brief Get child object by the specified index.
+  \param idx child object index
+  \return child object or 0 if index is out of range
 */
-
 SUIT_DataObject* SUIT_DataObject::childObject( const int idx ) const
 {
   SUIT_DataObject* child = 0;
 
-  if ( idx>= 0 && idx < (int)myChildren.count() )
-  {
-    SUIT_DataObject* that = (SUIT_DataObject*)this;
-    child = that->myChildren.at( idx );
-  }
+  if ( idx >= 0 && idx < myChildren.count() )
+    child = myChildren.at( idx );
 
   return child;
 }
 
 /*!
-    Returns the level of the object in the data tree.
-    0 means that object is top-level.
-*/
+  \brief Get the object level in the tree structure.
 
+  Root object has level 0.
+
+  \return object level.
+*/
 int SUIT_DataObject::level() const
 {
   int lev = 0;
@@ -156,59 +167,87 @@ int SUIT_DataObject::level() const
 }
 
 /*!
-    Returns the next data object in the child list of the parent.
+  \brief Get the position of the data object in its parent's children list
+  \return data object position
 */
+int SUIT_DataObject::position() const
+{
+  return myParent ? myParent->childPos( this ) : 0;
+}
 
+/*!
+  \brief Get the next sibling data object in the children list.
+  \return child object or 0 if there is no next sibling
+  \sa prevBrother()
+*/
 SUIT_DataObject* SUIT_DataObject::nextBrother() const
 {
   return myParent ? myParent->childObject( myParent->childPos( this ) + 1 ) : 0;
 }
 
 /*!
-    Returns the previous data object in the child list of the parent.
+  \brief Get the previous sibling data object in the children list.
+  \return child object or 0 if there is no previous sibling
+  \sa nextBrother()
 */
-
 SUIT_DataObject* SUIT_DataObject::prevBrother() const
 {
   return myParent ? myParent->childObject( myParent->childPos( this ) - 1 ) : 0;
 }
 
 /*!
-    Returns 'true' if the object will delete children during destroying
+  \brief Get "auto-delete children" flag.
+  \return \c true if the object should delete all its children on destroying
+  \sa setAutoDeleteChildren()
 */
-
 bool SUIT_DataObject::autoDeleteChildren() const
 {
-  return myChildren.autoDelete();
+  return myAutoDel;
 }
 
 /*!
-    Specify should the object delete children during destroying
-*/
+  \brief Set "auto-delete children" flag.
+
+  If this flag is on (default), the object will delete
+  all its children on destroying.
 
+  \param on new flag value
+  \sa autoDeleteChildren()
+*/
 void SUIT_DataObject::setAutoDeleteChildren( const bool on )
 {
-  myChildren.setAutoDelete( on );
+  myAutoDel = on;
 }
 
 /*!
-    Returns the list of the child objects. if 'rec' is 'true' then function get all sub children.
-*/
+  \brief Get all children.
+
+  If parameter \a rec is \c true then function collects all
+  the children recursively.
 
+  \param lst returning list of children
+  \param rec if \c true collect all children recursively
+*/
 void SUIT_DataObject::children( DataObjectList& lst, const bool rec ) const
 {
-  for ( DataObjectListIterator it( myChildren ); it.current(); ++it )
+  for ( DataObjectList::const_iterator it = myChildren.begin(); it != myChildren.end(); ++it )
   {
-    lst.append( it.current() );
+    lst.append( *it );
     if ( rec )
-      it.current()->children( lst, rec );
+      (*it)->children( lst, rec );
   }
 }
 
 /*!
-    Returns the list of the child objects. if 'rec' is 'true' then function get all sub children.
-*/
+  \brief Get all children.
+  \override
 
+  If parameter \a rec is \c true then function collects all
+  the children recursively.
+
+  \param rec if \c true collect all children recursively
+  \return list of children
+*/
 DataObjectList SUIT_DataObject::children( const bool rec )
 {
   DataObjectList lst;
@@ -217,50 +256,56 @@ DataObjectList SUIT_DataObject::children( const bool rec )
 }
 
 /*!
-    Append new child object to the end of the children list
+  \brief Add new child object to the end of the children list.
+  \param obj child object being added
 */
-
-void SUIT_DataObject::appendChild( SUIT_DataObject* theObj ) 
+void SUIT_DataObject::appendChild( SUIT_DataObject* obj )
 {
-  insertChild( theObj, myChildren.count() );
+  insertChild( obj, myChildren.count() );
 }
 
 /*!
-    Insert new child object to the children list at specified position
+  \brief Insert new child object to the list of the children.
+  \param obj child object being added
+  \param position child position
 */
-
-void SUIT_DataObject::insertChild( SUIT_DataObject* theObj, int thePosition )
+void SUIT_DataObject::insertChild( SUIT_DataObject* obj, int position )
 {
-  if ( !theObj || myChildren.find( theObj ) != -1 )
+  if ( !obj || myChildren.contains( obj ) )
     return;
 
-  int pos = thePosition < 0 ? myChildren.count() : thePosition;
-  myChildren.insert( QMIN( pos, (int)myChildren.count() ), theObj );
-  theObj->setParent( this );
+  int pos = position < 0 ? myChildren.count() : position;
+  myChildren.insert( qMin( pos, (int)myChildren.count() ), obj );
+  obj->setParent( this );
+  signal()->emitInserted( obj, this );
 }
 
 /*!
-    Removes the specified child object reference.
+  \brief Remove the specified child object reference.
+  \param obj child object being removed
+  \param del if \c true, the child object is destroyed
 */
-
-void SUIT_DataObject::removeChild( SUIT_DataObject* theObj )
+void SUIT_DataObject::removeChild( SUIT_DataObject* obj, const bool del )
 {
-  if ( !theObj )
+  if ( !obj )
     return;
 
-  bool ad = myChildren.autoDelete();
-  myChildren.setAutoDelete( false );
-
-  if ( myChildren.remove( theObj ) )
-    theObj->setParent( 0 );
+  if ( myChildren.removeAll( obj ) ) {
+    signal()->emitRemoved( obj, this );
+    obj->setParent( 0 );
 
-  myChildren.setAutoDelete( ad );
+    if ( del )
+      obj->deleteLater();
+  }
 }
 
 /*!
-    Replaces the specified child object by another object.
+  \brief Replace the specified child object by another object.
+  \param src child object being replaced
+  \param trg new child object
+  \param del if \c true, the previous object is destroyed
+  \return \c true if the object has been replaced
 */
-
 bool SUIT_DataObject::replaceChild( SUIT_DataObject* src, SUIT_DataObject* trg, const bool del )
 {
   if ( !src || !trg )
@@ -287,9 +332,9 @@ bool SUIT_DataObject::replaceChild( SUIT_DataObject* src, SUIT_DataObject* trg,
 }
 
 /*!
-    Transfer the all children from specified object 'obj' to self.
+  \brief Change the parent for all children from specified object to this one.
+  \param obj object which children to be reparented
 */
-
 void SUIT_DataObject::reparentChildren( const SUIT_DataObject* obj )
 {
   if ( !obj )
@@ -297,175 +342,291 @@ void SUIT_DataObject::reparentChildren( const SUIT_DataObject* obj )
 
   DataObjectList lst;
   obj->children( lst );
-  for ( DataObjectListIterator it( lst ); it.current(); ++it )
-    it.current()->setParent( this );
+  for ( DataObjectList::iterator it = lst.begin(); it != lst.end(); ++it )
+    (*it)->setParent( this );
 }
 
 /*!
-    Set the parent object. Remove itself from current parent children
-    and append itself to the new parent children list.
+  \brief Get the parent object.
+  \return parent object or 0 if this is top-level item
 */
+SUIT_DataObject* SUIT_DataObject::parent() const
+{
+  return myParent;
+}
 
-void SUIT_DataObject::setParent( SUIT_DataObject* theParent )
+/*!
+  \brief Change the parent object.
+  \param p new parent object
+*/
+void SUIT_DataObject::setParent( SUIT_DataObject* p )
 {
-  if ( theParent == parent() )
+  if ( p == parent() )
     return;
 
   if ( parent() )
     parent()->removeChild( this );
 
-  myParent = theParent;
+  myParent = p;
 
   if ( parent() )
     parent()->appendChild( this );
 }
 
 /*!
-    Returns the parent object.
-*/
+  \brief Get data object name.
 
-SUIT_DataObject* SUIT_DataObject::parent() const
+  This method should be re-implemented in the subclasses.
+  Default implementation returns null string.
+
+  \return object name
+*/
+QString SUIT_DataObject::name() const
 {
-  return myParent;
+  return QString();
 }
 
-
 /*!
-    Connect to signal destroyed( SUIT_DataObject* ).
-*/
+  \brief Get object text data for the specified column.
 
-bool SUIT_DataObject::connect( QObject* reciever, const char* slot )
-{
-  if ( !reciever || !slot )
-    return false;
+  This method can be re-implemented in the subclasses.
+  Default implementation returns null string.
 
-  if ( !mySignal )
-    mySignal = new Signal( this );
+  Column with \a id = 0 (NameId) is supposed to be used
+  to get the object name (as it does the default implementation).
 
-  QObject::disconnect( mySignal, SIGNAL( destroyed( SUIT_DataObject* ) ), reciever, slot );
-  return QObject::connect( mySignal, SIGNAL( destroyed( SUIT_DataObject* ) ), reciever, slot );
+  \param id column id
+  \return object text data
+*/
+QString SUIT_DataObject::text( const int id ) const
+{
+  return id == NameId ? name() : QString();
 }
 
 /*!
-    Disconnect from signal destroyed( SUIT_DataObject* ).
-*/
+  \brief Get data object icon for the specified column.
 
-bool SUIT_DataObject::disconnect( QObject* reciever, const char* slot )
-{
-  if ( !reciever || !slot )
-    return false;
+  This method can be re-implemented in the subclasses.
+  Default implementation returns null pixmap.
 
-  if ( !mySignal )
-    return true;
+  The parameter \a id specifies the column identificator
 
-  return QObject::disconnect( mySignal, SIGNAL( destroyed( SUIT_DataObject* ) ), reciever, slot );
+  \param id column id
+  \return object icon for the specified column
+*/
+QPixmap SUIT_DataObject::icon( const int /*id*/ ) const
+{
+  return QPixmap();
 }
 
 /*!
-    Returns object name
-*/
+  \brief Get data object color for the specified column.
 
-void SUIT_DataObject::deleteLater()
+  This method can be re-implemented in the subclasses.
+  Default implementation returns null color.
+
+  The parameter \a id specifies the column identificator
+
+  \param role color role
+  \param id column id
+  \return object color for the specified column
+*/
+QColor SUIT_DataObject::color( const ColorRole /*role*/, const int /*id*/ ) const
 {
-  if ( !mySignal )
-    mySignal = new Signal( this );
-  
-  mySignal->emitSignal();
-  mySignal->deleteLater();
+  return QColor();
 }
 
 /*!
-    Returns object name
-*/
+  \brief Get data object tooltip for the specified column.
 
-QString SUIT_DataObject::name() const
+  This method can be re-implemented in the subclasses.
+  Default implementation returns null string.
+
+  The parameter \a id specifies the column identificator
+  (to display, for example, in the tree view widget).
+
+  \param id column id
+  \return object tooltip for the specified column
+*/
+QString SUIT_DataObject::toolTip( const int /*id*/ ) const
 {
-  return QString::null;
+  return QString();
 }
 
 /*!
-    Returns object icon
-*/
+  \brief Get data object status tip for the specified column.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns null string.
 
-QPixmap SUIT_DataObject::icon() const
+  The parameter \a id specifies the column identificator
+
+  \param id column id
+  \return object status tip for the specified column
+*/
+QString SUIT_DataObject::statusTip( const int /*id*/ ) const
 {
-  return QPixmap();
+  return QString();
 }
 
 /*!
-    Returns object text
-*/
+  \brief Get data object "what's this" information for the
+         specified column.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns null string.
 
-QString SUIT_DataObject::text( const int ) const
+  The parameter \a id specifies the column identificator
+
+  \param id column id
+  \return object "what's this" information for the specified column
+*/
+QString SUIT_DataObject::whatsThis( const int /*id*/ ) const
 {
-  return QString::null;
+  return QString();
 }
 
 /*!
-    Returns object color
-*/
+  \brief Get data object font for the specified column.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns application default font.
 
-QColor SUIT_DataObject::color( const ColorRole ) const
+  The parameter \a id specifies the column identificator
+
+  \param id column id
+  \return object font for the specified column
+*/
+QFont SUIT_DataObject::font( const int /*id*/ ) const
 {
-  return QColor();
+  return QFont();
 }
 
 /*!
-    Returns object tool tip
-*/
+  \brief Get data object text alignment for the specified column.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns default alignment which
+  is Qt:AlignLeft.
 
-QString SUIT_DataObject::toolTip() const
+  The parameter \a id specifies the column identificator
+  (to display, for example, in the tree view widget).
+
+  \param id column id
+  \return object text alignment flags for the specified column
+*/
+int SUIT_DataObject::alignment( const int /*id*/ ) const
 {
-  return QString::null;
+  return Qt::AlignLeft;
 }
 
 /*!
-    Returns 'true' if it is possible to drag this object
-*/
+  \brief Check if the object is draggable.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns \c false (all objects could not be dragged).
 
+  \return \c true if it is possible to drag this object
+*/
 bool SUIT_DataObject::isDragable() const
 {
   return false;
 }
 
 /*!
-    Returns 'true' if it is possible to drop an object "obj" to this object.
+  \brief Check if the drop operation fo this object is possible.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns \c false (drop operation is not allowed).
+
+  \param obj object being dropped
+  \return \c true if it is possible to drop an object \c obj
+          to this object
 */
 
-bool SUIT_DataObject::isDropAccepted( SUIT_DataObject* )
+bool SUIT_DataObject::isDropAccepted( SUIT_DataObject* /*obj*/ )
 {
   return false;
 }
 
 /*!
-    Returns type of check possibility.
-*/
+  \brief Check if this object is enabled.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns \c true (all objects are enabled).
 
-SUIT_DataObject::CheckType SUIT_DataObject::checkType() const
+  \return \c true if the user can interact with the item
+*/
+bool SUIT_DataObject::isEnabled() const
 {
-  return None;
+  return true;
 }
 
 /*!
-    Returns the checked state of the object.
+  \brief Check if this object is selectable.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns \c true (all objects are selectable).
+
+  \return \c true if the item can be selected
 */
+bool SUIT_DataObject::isSelectable() const
+{
+  return true;
+}
 
-bool SUIT_DataObject::isOn() const
+/*!
+  \brief Check if this object is checkable for the specified column.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns \c false (all objects are not checkable).
+
+  \param id column id
+  \return \c true if the item can be checked or unchecked by the user
+  \sa isOn(), setOn()
+*/
+bool SUIT_DataObject::isCheckable( const int /*id*/ ) const
 {
-  return myCheck;
+  return false;
 }
 
 /*!
-    Sets the checked state of the object.
+  \brief Get the checked state of the object (if it is checkable)
+  for the specified column.
+
+  Default implementation supports the checked state for the first
+  ("Name") column only.
+
+  \param id column id
+  \return checked state of the object for the specified column
+  \sa setOn(), isCheckable()
 */
+bool SUIT_DataObject::isOn( const int id ) const
+{
+  return id == NameId && myCheck;
+}
+
+/*!
+  \brief Set the checked state of the object (if it is checkable)
+  for the specified column.
+
+  Default implementation supports the checked state for the first
+  ("Name") column only.
 
-void SUIT_DataObject::setOn( const bool on )
+  \param on new checked state of the object for the specified column
+  \param id column id
+  \sa isOn(), isCheckable()
+*/
+void SUIT_DataObject::setOn( const bool on, const int id )
 {
-  myCheck = on;
+  if( id == NameId )
+    myCheck = on;
 }
 
 /*!
-    \return the opened state of the object (used in Object Browser).
+  \brief Get the "opened" state of the object.
+  \return "opened" state of the object
+  \sa setOpen()
 */
 bool SUIT_DataObject::isOpen() const
 {
@@ -473,7 +634,9 @@ bool SUIT_DataObject::isOpen() const
 }
 
 /*!
-    Sets the opened state of the object (used in Object Browser).
+  \brief Set the "opened" state of the object.
+  \param on new "opened" state of the object
+  \sa isOpen()
 */
 void SUIT_DataObject::setOpen( const bool on )
 {
@@ -481,62 +644,279 @@ void SUIT_DataObject::setOpen( const bool on )
 }
 
 /*!
-    Returns object personal indentification key.
+  \brief Check if the specified column supports custom sorting.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns false ("Name" column does not require
+  custom sorting).
+
+  \param id column id
+  \return \c true if column sorting should be customized
+  \sa compare()
 */
+bool SUIT_DataObject::customSorting( const int /*id*/ ) const
+{
+  return false;
+}
 
+/*!
+  \brief Compares data from two items for sorting purposes.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns false ("Name" column does not require
+  custom sorting).
+
+  This method is called only for those columns for which customSorting()
+  method returns \c true.
+
+  \param left first data to compare
+  \param right second data to compare
+  \param id column id
+  \return result of the comparison
+  \sa customSorting()
+*/
+bool SUIT_DataObject::compare( const QVariant& /*left*/, const QVariant& /*right*/,
+                              const int /*id*/ ) const
+{
+  return false;
+}
+
+/*!
+  \brief Get the object unique indentification key.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns 0.
+
+  \return object key
+*/
 SUIT_DataObjectKey* SUIT_DataObject::key() const
 {
   return 0;
 }
 
 /*!
-   Dump this data object and its children to cout
+  \brief Get global signal handler.
+  \return the only instance of the signal handler
+*/
+SUIT_DataObject::Signal* SUIT_DataObject::signal()
+{
+  if ( !mySignal )
+    mySignal = new Signal();
+  return mySignal;
+}
+
+/*!
+  \brief Connect to the signal handlerx
+  \param sig signal name
+  \param reciever signal receiver object
+  \param slot slot name
+  \return \c true if connection is successfull
+*/
+bool SUIT_DataObject::connect( const char* sig, QObject* reciever, const char* slot )
+{
+  if ( !reciever || !slot )
+    return false;
+
+  signal()->disconnect( signal(), sig, reciever, slot );
+  return signal()->connect( signal(), sig, reciever, slot );
+}
+
+/*!
+  \brief Disconnect from the signal handler
+  \param sig signal name
+  \param reciever signal receiver object
+  \param slot slot name
+  \return \c true if disconnection is successfull
+*/
+bool SUIT_DataObject::disconnect( const char* sig, QObject* reciever, const char* slot )
+{
+  if ( !reciever || !slot )
+    return false;
+  return signal()->disconnect( signal(), sig, reciever, slot );
+}
+
+/*!
+  \brief Schedule this object for the late deleting.
+
+  The object will be deleted when control returns to the event loop.
+  Note that entering and leaving a new event loop (e.g., by opening
+  a modal dialog) will not perform the deferred deletion; for the object
+  to be deleted, the control must return to the event loop from which
+  deleteLater() was called.
+*/
+void SUIT_DataObject::deleteLater()
+{
+  if ( parent() )
+    parent()->removeChild( this, false ); // to avoid infinite loop!
+  signal()->deleteLater( this );
+}
+
+/*!
+  \brief Dump the object tree recursively to the standard output.
+  \param indent current indentation level
 */
 void SUIT_DataObject::dump( const int indent ) const
 {
-  QString strIndent = QString().fill( ' ', indent ); // indentation string 
-  printf( "%s%s\n", strIndent.latin1(), name().latin1() );
-  for ( DataObjectListIterator it( myChildren ); it.current(); ++it ) // iterate all children
-    it.current()->dump( indent + 2 );  // dump every child with indent + 2 spaces
+  QString strIndent = QString().fill( ' ', indent ); // indentation string
+  printf( "%s%s\n", strIndent.toLatin1().data(), name().toLatin1().data() );
+  for ( DataObjectList::const_iterator it = myChildren.begin(); it != myChildren.end(); ++it )
+    (*it)->dump( indent + 2 );
 }
 
 /*!
-  Class: SUIT_DataObject::Signal [Internal]
+  \class SUIT_DataObject::Signal
+  \brief Watcher class, responsible for the emitting signals on behalf of
+  the data objects.
+
+  SUIT_DataObject class does not inherit from QObject for the performance
+  reasons, so it can not use signals/slots mechanism directly.
+  Instead it uses the only Signal object to emit the signals when the data
+  object is created, destroyed, inserted to the parent object or removed
+  from it.
+
+  If some object needs to handle, for example, data object destroying, it can
+  use SUIT_DataObject::signal() method to connect the signal:
+  \code
+  MyHandler* h = new MyHandler();
+  h->connect( SUIT_DataObject::signal(), SIGNAL(destroyed(SUIT_DataObject*)),
+              h, SLOT(onDestroyed(SUIT_DataObject*)) );
+  \endcode
+  The same can be done by using static method SUIT_DataObject::connect().
+  For example,
+  \code
+  MyHandler* h = new MyHandler();
+  SUIT_DataObject::connect( SIGNAL(destroyed(SUIT_DataObject*)),
+                            h, SLOT(onDestroyed(SUIT_DataObject*)));
+  \endcode
 */
 
-SUIT_DataObject::Signal::Signal( SUIT_DataObject* o )
-: QObject(),
-myOwner( o )
+/*!
+  \brief Constructor.
+*/
+SUIT_DataObject::Signal::Signal()
+: QObject()
 {
 }
 
 /*!
-  Destructor.
+  \brief Destructor.
+
+  Destroys data object which are scheduled for the deleting with the deleteLater().
 */
 SUIT_DataObject::Signal::~Signal()
 {
-  SUIT_DataObject* o = myOwner;
-  myOwner = 0;
-  if ( o )
-  {
-    o->mySignal = 0;
-    delete o;
+  for ( DataObjectList::Iterator it = myDelLaterObjects.begin();
+       it != myDelLaterObjects.end(); ++it ) {
+    delete *it;
   }
+  myDelLaterObjects.clear();
 }
 
 /*!
-  Set owner \a o.
+  \brief Emit signal about data object creation.
+  \param object data object being created
 */
-void SUIT_DataObject::Signal::setOwner( SUIT_DataObject* o )
+void SUIT_DataObject::Signal::emitCreated( SUIT_DataObject* object )
 {
-  myOwner = o;
+  if ( object )
+    emit created( object );
 }
 
 /*!
-  emit signal destroed owner.
+  \brief Emit signal about data object destroying.
+  \param object data object being destroyed
 */
-void SUIT_DataObject::Signal::emitSignal()
+void SUIT_DataObject::Signal::emitDestroyed( SUIT_DataObject* object )
 {
-  if ( myOwner )
-    emit destroyed( myOwner );
+  if ( object ) {
+    if ( myDelLaterObjects.contains( object ) )
+      // object is being destroyed after calling deleteLater():
+      // the signal has been already emitted from deleteLater()
+      // we should avoid repeating of the object destroying from
+      // the Signal destructor
+      myDelLaterObjects.removeAll( object );
+    else
+      // object is being destroyed directly or via deleteLater()
+      emit destroyed( object );
+  }
 }
+
+/*!
+  \brief Emit signal about data object adding to the parent data object.
+  \param object data object being added
+  \param parent parent data object
+*/
+void SUIT_DataObject::Signal::emitInserted( SUIT_DataObject* object, SUIT_DataObject* parent )
+{
+  emit( inserted( object, parent ) );
+}
+
+/*!
+  \brief Emit signal about data object removed from the parent data object.
+  \param object data object being removed
+  \param parent parent data object
+*/
+void SUIT_DataObject::Signal::emitRemoved( SUIT_DataObject* object, SUIT_DataObject* parent )
+{
+  emit( removed( object, parent ) );
+}
+
+/*!
+  \brief Schedule data object for the late deleting.
+  \param object data object to be deleted later
+*/
+void SUIT_DataObject::Signal::deleteLater( SUIT_DataObject* object )
+{
+  if ( !myDelLaterObjects.contains( object ) ) {
+    emitDestroyed( object );
+    myDelLaterObjects.append( object );
+  }
+}
+
+/*!
+  \brief Updates necessary internal fields of data object
+*/
+void SUIT_DataObject::update()
+{
+}
+
+/*!
+  \brief return unique group identificator
+
+  Groups of data objects are used for column information search.
+  Each column of data model has one or several registered group id
+  If object has the same group id as one of registered, the information
+  will be shown; the custom id of column will be passed into data() method
+  in order to identify column from point of view of data object
+
+ */
+int SUIT_DataObject::groupId() const
+{
+  return 0;
+}
+
+/*!
+  \fn void SUIT_DataObject::Signal::created( SUIT_DataObject* object );
+  \brief Emitted when data object is created.
+  \param object data object being created
+*/
+
+/*!
+  \fn void SUIT_DataObject::Signal::destroyed( SUIT_DataObject* object );
+  \brief Emitted when data object is destroyed.
+  \param object data object being destroyed
+*/
+
+/*!
+  \fn void SUIT_DataObject::Signal::inserted( SUIT_DataObject* object, SUIT_DataObject* parent );
+  \brief Emitted when data object is inserted to the parent data object.
+  \param object data object being created
+  \param parent parent data object
+*/
+
+/*!
+  \fn void SUIT_DataObject::Signal::removed( SUIT_DataObject* object, SUIT_DataObject* parent );
+  \brief Emitted when data object is removed from the parent data object.
+  \param object data object being removed
+  \param parent parent data object
+*/
index 01f0ffa599545604e7aa0cc7c9cfa8bbdc40fffc..8e06fad064460a5b95932f3567e427e9f0cda3cb 100755 (executable)
@@ -1,53 +1,67 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SUIT_DataObject.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #ifndef SUIT_DATAOBJECT_H
 #define SUIT_DATAOBJECT_H
 
-#include <qobject.h>
-#include <qstring.h>
-#include <qpixmap.h>
-#include <qptrlist.h>
-
 #include "SUIT.h"
 
+#include <QList>
+#include <QObject>
+#include <QString>
+#include <QPixmap>
+#include <QFont>
+
 class SUIT_DataObject;
 class SUIT_DataObjectKey;
 
-typedef QPtrList<SUIT_DataObject>         DataObjectList;
-typedef QPtrListIterator<SUIT_DataObject> DataObjectListIterator;
+typedef QList<SUIT_DataObject*> DataObjectList;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
-/*!
-  \class SUIT_DataObject
-  Data Object represents uniform data tree structure recommended to use in SUIT-based applications
-  Many of standard classes (DataModel,ObjectBrowser) deal with SUIT_DataObjects
-*/
 class SUIT_EXPORT SUIT_DataObject  
 {
 public:
   class Signal;
 
-  typedef enum { None, RadioButton, CheckBox } CheckType;
-  typedef enum { Text, Base, Foreground, Background, Highlight, HighlightedText } ColorRole;
+  //! Color role
+  typedef enum { 
+    Text,              //!< editor foreground (text) color
+    Base,              //!< editor background color
+    Foreground,        //!< foreground (text) color
+    Background,        //!< background color
+    Highlight,         //!< highlight background color
+    HighlightedText    //!< highlighted foreground (text) color
+  } ColorRole;
+
+  //! Column id
+  enum
+  { 
+    NameId            //!< name column
+  };
 
   SUIT_DataObject( SUIT_DataObject* = 0 );
   virtual ~SUIT_DataObject();
@@ -60,6 +74,7 @@ public:
   int                         childPos( const SUIT_DataObject* ) const;
   SUIT_DataObject*            childObject( const int ) const;
   int                         level() const;
+  int                         position() const;
 
   SUIT_DataObject*            nextBrother() const;
   SUIT_DataObject*            prevBrother() const;
@@ -71,80 +86,96 @@ public:
   virtual DataObjectList      children( const bool = false );
   
   void                        appendChild( SUIT_DataObject* );
-  virtual void                removeChild( SUIT_DataObject* );
-  virtual void                insertChild( SUIT_DataObject*, int thePosition );
+  virtual void                insertChild( SUIT_DataObject*, int );
+  virtual void                removeChild( SUIT_DataObject*, const bool = false );
   bool                        replaceChild( SUIT_DataObject*, SUIT_DataObject*, const bool = false );
 
   void                        reparentChildren( const SUIT_DataObject* );
 
-  virtual QString             text( const int ) const;
-  virtual QColor              color( const ColorRole ) const;
-
-  virtual QString             name() const;
-  virtual QPixmap             icon() const;
-  virtual QString             toolTip() const;
-
   virtual SUIT_DataObject*    parent() const;
   virtual void                setParent( SUIT_DataObject* );
 
+  virtual QString             name() const;
+  virtual QString             text( const int = NameId ) const;
+  virtual QPixmap             icon( const int = NameId ) const;
+  virtual QColor              color( const ColorRole, const int = NameId ) const;
+  virtual QString             toolTip( const int = NameId ) const;
+  virtual QString             statusTip( const int = NameId ) const;
+  virtual QString             whatsThis( const int = NameId ) const;
+  virtual QFont               font( const int = NameId ) const;
+  virtual int                 alignment( const int = NameId ) const;
+
   virtual bool                isDragable() const;
   virtual bool                isDropAccepted( SUIT_DataObject* obj );
 
-  virtual CheckType           checkType() const;
+  virtual bool                isEnabled() const;
+  virtual bool                isSelectable() const;
+  virtual bool                isCheckable( const int = NameId ) const;
 
-  virtual bool                isOn() const;
-  virtual void                setOn( const bool );
+  virtual bool                isOn( const int = NameId ) const;
+  virtual void                setOn( const bool, const int = NameId );
 
   virtual bool                isOpen() const;
   virtual void                setOpen( const bool );
 
+  virtual void                update();
+  virtual bool                customSorting( const int = NameId ) const;
+  virtual bool                compare( const QVariant&, const QVariant&, const int = NameId ) const;
+
   virtual SUIT_DataObjectKey* key() const;
+  virtual int groupId() const;
 
-  bool                        connect( QObject*, const char* );
-  bool                        disconnect( QObject*, const char* );
+  static Signal*              signal();
+  static bool                 connect( const char*, QObject*, const char* );
+  static bool                 disconnect( const char*, QObject*, const char* );
 
   void                        deleteLater();
-  
+
   void                        dump( const int indent = 2 ) const; // dump to cout
 
 private:
+  SUIT_DataObject*            myParent;
   bool                        myOpen;
   bool                        myCheck;
-  Signal*                     mySignal;
-  SUIT_DataObject*            myParent;
+  bool                        myAutoDel;
   DataObjectList              myChildren;
 
+  static Signal*              mySignal;
+
   friend class SUIT_DataObject::Signal;
   friend class SUIT_DataObjectIterator;
 };
 
-/*!
-  \class SUIT_DataObject::Signal
-  Auxiliary class providing functionality to use signals of data object state change
-  SUIT_DataObject cannot have signals, because it isn't QObject, but
-  methods connect/disconnect of SUIT_DataObject with help of this it is possible
-  to emulate Qt signal processing
-*/
-class SUIT_DataObject::Signal : public QObject
+class SUIT_EXPORT SUIT_DataObject::Signal : public QObject
 {
   Q_OBJECT
 
 public:
-  Signal( SUIT_DataObject* );
+  Signal();
   virtual ~Signal();
 
-  void                        emitSignal();
-  void                        setOwner( SUIT_DataObject* o );
+private:
+  void emitCreated( SUIT_DataObject* );
+  void emitDestroyed( SUIT_DataObject* );
+  void emitInserted( SUIT_DataObject*, SUIT_DataObject* );
+  void emitRemoved( SUIT_DataObject*, SUIT_DataObject* );
+
+  void deleteLater( SUIT_DataObject* );
 
 signals:
-  void                        destroyed( SUIT_DataObject* );
+  void created( SUIT_DataObject* );
+  void destroyed( SUIT_DataObject* );
+  void inserted( SUIT_DataObject*, SUIT_DataObject* );
+  void removed( SUIT_DataObject*, SUIT_DataObject* );
+
+  friend class SUIT_DataObject;
 
 private:
-  SUIT_DataObject*            myOwner;
+  DataObjectList myDelLaterObjects;
 };
 
 #ifdef WIN32
 #pragma warning( default:4251 )
 #endif
 
-#endif
+#endif  // SUIT_DATAOBJECT_H
index c5f66be5cee0a34c9e45e940d9b4b4bb6d693e75..145c0bd71ab0a9bed9c373fb8f06fd56b258af9c 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_DataObjectIterator.h"
 
@@ -74,11 +77,11 @@ void SUIT_DataObjectIterator::operator++()
         }
         else
         {
-          aParent->myChildren.find( myCurrent );
+          int idx = aParent->myChildren.indexOf( myCurrent );
           if ( myDetourType == DepthLeft )
-            myCurrent = aParent->myChildren.next();
+            myCurrent = idx < aParent->myChildren.count() - 1 ? aParent->myChildren[idx + 1] : 0;
           else
-            myCurrent = aParent->myChildren.prev();
+            myCurrent = idx > 0 ? aParent->myChildren[idx - 1] : 0;
           if ( !myCurrent )
           {
             myCurrent = aParent;
@@ -146,9 +149,9 @@ SUIT_DataObject* SUIT_DataObjectIterator::globalSibling( SUIT_DataObject* obj, b
 
   if ( obj && ( par = parent( obj ) ) )
   {
-    par->myChildren.find( obj );
-    if ( par->myChildren.next() )
-      return par->myChildren.current();
+    int idx = par->myChildren.indexOf( obj );
+    if ( idx < par->myChildren.count() - 1 )
+      return par->myChildren[idx + 1];
     else
     {
       for ( ; par; par = globalSibling( par, next ) )
@@ -170,9 +173,9 @@ SUIT_DataObject* SUIT_DataObjectIterator::globalSibling( SUIT_DataObject* obj, b
 SUIT_DataObject* SUIT_DataObjectIterator::extreme( DataObjectList& aList, bool FromLeft ) const
 {
   if ( FromLeft )
-    return aList.getFirst();
+    return aList.first();
   else
-    return aList.getLast();
+    return aList.last();
 }
 
 /*!
index e51a23abfdb3fad64370ad1647357ddda27e9623..b17ba2e1b25b0f9be8696649f0f44bda4adab2da 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_DATAOBJECT_ITERATOR_H
 #define SUIT_DATAOBJECT_ITERATOR_H
index 01a91404ab3c2a14676e1dedc4fee1ade74a995e..ac17c9152caf61c791bf6a0636ca924c9fbaea86 100755 (executable)
@@ -1,26 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_DataObjectKey.h"
 
-#include <qobject.h>
+#include <string.h>
 
-#ifndef WNT
+#ifndef WIN32
 #include <typeinfo>
 #define _typeinfo std::type_info
 #else
index 053e1abe738d45f6738c7c092271b1fe4a02ce5b..00ac5ffd2ee787b9918893c6778dba9288d4c239 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_DATAOBJECTKEY_H
 #define SUIT_DATAOBJECTKEY_H
index a0aa525c4fd1eb614c9dae7b1f0bb0884da8452d..300a88e7c0295975a0e8b21a08c5fa57d3e25953 100755 (executable)
@@ -1,25 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "SUIT_DataOwner.h"
 
-#ifndef WNT
+#ifndef WIN32
 #include <typeinfo>
 #define _typeinfo std::type_info
 #else
@@ -45,9 +47,7 @@ bool operator==( const SUIT_DataOwnerPtr& p1, const SUIT_DataOwnerPtr& p2 )
   return p1.isNull() && p2.isNull();
 }
 
-// *** jfa: The below function has been put here 14.02.2007 from branch BR_Dev_For_4_0
-// *** and also improved for better comparison of DataOwners with DataSubOwners.
-// *** This comment is to be removed after merging with BR_Dev_For_4_0.
+
 /*! Operator < allows to order suit data owners for map */
 bool operator<( const SUIT_DataOwnerPtr& p1, const SUIT_DataOwnerPtr& p2 )
 {
@@ -60,7 +60,6 @@ bool operator<( const SUIT_DataOwnerPtr& p1, const SUIT_DataOwnerPtr& p2 )
 
   return (p1->keyString() < p2->keyString());
 }
-// *** end
 
 /*!
   \class SUIT_DataOwnerPtrList 
@@ -72,8 +71,8 @@ bool operator<( const SUIT_DataOwnerPtr& p1, const SUIT_DataOwnerPtr& p2 )
   Constructor (default)
 */
 SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList()
-  : QValueList<SUIT_DataOwnerPtr>(),
-    mySkipEqual( true )
+: QList<SUIT_DataOwnerPtr>(),
+mySkipEqual( true )
 {
 }
 
@@ -81,8 +80,8 @@ SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList()
   Constructor (default)
 */
 SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList( const bool skipAllEqual )
-  : QValueList<SUIT_DataOwnerPtr>(),
-    mySkipEqual( skipAllEqual )
+: QList<SUIT_DataOwnerPtr>(),
+mySkipEqual( skipAllEqual )
 {
 }
 
@@ -90,8 +89,8 @@ SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList( const bool skipAllEqual )
   Constructor (copy)
 */
 SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList( const SUIT_DataOwnerPtrList& l )
-  : QValueList<SUIT_DataOwnerPtr>( l ),
-    mySkipEqual( true )
+: QList<SUIT_DataOwnerPtr>( l ),
+mySkipEqual( true )
 {
 }
 
@@ -99,8 +98,8 @@ SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList( const SUIT_DataOwnerPtrList& l )
   Constructor (copy)
 */
 SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList( const SUIT_DataOwnerPtrList& l, const bool skipAllEqual )
-  : QValueList<SUIT_DataOwnerPtr>(),
-    mySkipEqual( skipAllEqual )
+: QList<SUIT_DataOwnerPtr>(),
+mySkipEqual( skipAllEqual )
 {
   if ( skipAllEqual == l.mySkipEqual )
     operator =( l );
@@ -108,51 +107,23 @@ SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList( const SUIT_DataOwnerPtrList& l, co
   {
     SUIT_DataOwnerPtrList::const_iterator beginIt = l.begin();
     SUIT_DataOwnerPtrList::const_iterator endIt = l.end();
-    for( ; beginIt != endIt; ++beginIt )
+    for ( ; beginIt != endIt; ++beginIt )
       append( *beginIt );
   }
 }
 
-#ifndef QT_NO_STL
-/*!
-  Constructor (from stl)
-*/
-SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList( const std::list<SUIT_DataOwnerPtr>& l )
-  : QValueList<SUIT_DataOwnerPtr>( l ),
-    mySkipEqual( true )
-{
-}
-#endif
-
-#ifndef QT_NO_STL
-/*!
-  Constructor (from stl)
-*/
-SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList( const std::list<SUIT_DataOwnerPtr>& l, const bool skipAllEqual )
-  : QValueList<SUIT_DataOwnerPtr>(),
-    mySkipEqual( skipAllEqual )
-{
-  std::list<SUIT_DataOwnerPtr>::const_iterator beginIt = l.begin();
-  std::list<SUIT_DataOwnerPtr>::const_iterator endIt = l.begin();
-  for( ; beginIt != endIt; ++beginIt )
-    append( *beginIt );
-}
-#endif
-
 /*!
   Appends an item to the list
 */
-SUIT_DataOwnerPtrList::iterator SUIT_DataOwnerPtrList::append( const SUIT_DataOwnerPtr& x )
+void SUIT_DataOwnerPtrList::append( const SUIT_DataOwnerPtr& x )
 {
   if ( mySkipEqual && myMap.contains( x ) ) //contains uses SUIT_DataOwnerPtr::operator==
-    return myMap[ x ];
-
-  iterator it = QValueList<SUIT_DataOwnerPtr>::append( x );
+    return;
 
-   if ( mySkipEqual )
-    myMap.insert( x, it );
+  QList<SUIT_DataOwnerPtr>::append( x );
 
-  return it;
+  if ( mySkipEqual )
+    myMap.insert( x, 0 );
 }
 
 /*!
@@ -160,9 +131,10 @@ SUIT_DataOwnerPtrList::iterator SUIT_DataOwnerPtrList::append( const SUIT_DataOw
 */
 void SUIT_DataOwnerPtrList::clear()
 {
-  if( mySkipEqual )
+  if ( mySkipEqual )
     myMap.clear();
-  QValueList<SUIT_DataOwnerPtr>::clear();
+
+  QList<SUIT_DataOwnerPtr>::clear();
 }
 
 /*!
@@ -170,7 +142,8 @@ void SUIT_DataOwnerPtrList::clear()
 */
 uint SUIT_DataOwnerPtrList::remove(const SUIT_DataOwnerPtr& x )
 {
-  if( mySkipEqual && myMap.contains(x) )
-    myMap.remove(x);
-  return QValueList<SUIT_DataOwnerPtr>::remove( x );
+  if ( mySkipEqual && myMap.contains(x) )
+    myMap.remove( x );
+
+  return QList<SUIT_DataOwnerPtr>::removeAll( x );
 }
index 7e88c58ff9e7738e8066080ec371633c70ffa751..9136041f1d5ba791d34d32d023cb2522ced6f864 100755 (executable)
@@ -1,28 +1,32 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_DATAOWNER_H
 #define SUIT_DATAOWNER_H
 
 #include "SUIT_SmartPtr.h"
 
-#include <qvaluelist.h>
-#include <qmap.h>
+#include <QMap>
+#include <QList>
+#include <QString>
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -40,8 +44,6 @@ class SUIT_EXPORT SUIT_DataOwner : public RefCount
 public:
   SUIT_DataOwner();//!< constructor
   virtual ~SUIT_DataOwner();//!< destructor
-  // *** jfa: The below line has been put here 14.02.2007.
-  // *** It cancels modifications from branch BR_Dev_For_4_0
   virtual QString keyString() const = 0;//!< used for comparison
 };
 
@@ -60,21 +62,17 @@ bool operator==( const SUIT_DataOwnerPtr&, const SUIT_DataOwnerPtr& );
 /*! \class SUIT_DataOwnerPtrList
  * \brief Manage list of SUIT_DataOwnerPtr.
  */
-class SUIT_EXPORT SUIT_DataOwnerPtrList : public QValueList<SUIT_DataOwnerPtr> 
+class SUIT_EXPORT SUIT_DataOwnerPtrList : public QList<SUIT_DataOwnerPtr>
 {
 public:
   SUIT_DataOwnerPtrList();                         //!< constructor
   SUIT_DataOwnerPtrList( const bool skipAllEqual );//!< constructor
   SUIT_DataOwnerPtrList( const SUIT_DataOwnerPtrList& l );                         //!< copy constructor
   SUIT_DataOwnerPtrList( const SUIT_DataOwnerPtrList& l, const bool skipAllEqual );//!< copy constructor
-#ifndef QT_NO_STL
-  SUIT_DataOwnerPtrList( const std::list<SUIT_DataOwnerPtr>& l );                         //!< copy constructor for STL list
-  SUIT_DataOwnerPtrList( const std::list<SUIT_DataOwnerPtr>& l, const bool skipAllEqual );//!< copy constructor for STL list
-#endif
 
-  iterator append      ( const SUIT_DataOwnerPtr& x );//!< append function
+  void     append      ( const SUIT_DataOwnerPtr& x );//!< append function
   void     clear       ();
-  uint     remove      (const SUIT_DataOwnerPtr& x );
+  uint     remove      ( const SUIT_DataOwnerPtr& x );
 
 private:
   // hide this methods: only append() should be used to add items to the list
@@ -84,8 +82,8 @@ private:
   void push_back  ( const SUIT_DataOwnerPtr& x );//!< hide method
 
 private:
-  bool                              mySkipEqual;
-  QMap<SUIT_DataOwnerPtr, iterator> myMap;
+  QMap<SUIT_DataOwnerPtr, int> myMap;
+  bool                         mySkipEqual;
 };
 
 #ifdef WIN32
index 8b2c63202b75a2613329ee91f1939a8a535bd05a..e7019f4677e70ae6d6d7e7e57333a6ab0fd27427 100755 (executable)
@@ -1,30 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_Desktop.h"
 
-#include "SUIT_Tools.h"
 #include "SUIT_ViewWindow.h"
 
 #include <QtxLogoMgr.h>
 #include <QtxActionMenuMgr.h>
 #include <QtxActionToolMgr.h>
 
+#include <QPointer>
+#include <QCloseEvent>
+#include <QApplication>
+
 /*!\class SUIT_Desktop
  * Provide desktop management:\n
  * \li menu manager
  * \li windows
  */
 
+class SUIT_Desktop::ReparentEvent : public QEvent
+{
+public:
+  ReparentEvent( Type t, QObject* obj ) : QEvent( t ), myObj( obj ) {};
+
+  QObject* object() const { return myObj; }
+
+private:
+  QPointer<QObject> myObj;
+};
+
 /*!
   Constructor.
 */
@@ -66,6 +83,8 @@ bool SUIT_Desktop::event( QEvent* e )
   case QEvent::WindowDeactivate:
     emit deactivated();
     break;
+  default:
+    break;
   }
 
   return QMainWindow::event( e );
@@ -85,18 +104,29 @@ void SUIT_Desktop::closeEvent( QCloseEvent* e )
 */
 void SUIT_Desktop::childEvent( QChildEvent* e )
 {
-  if ( e->type() == QEvent::ChildInserted && parentArea() &&
-       e->child()->isWidgetType() && e->child()->inherits( "SUIT_ViewWindow" ) )
-  {
-    QWidget* wid = (QWidget*)e->child();
-    bool vis = wid->isVisibleTo( wid->parentWidget() );
-    wid->reparent( parentArea(), QPoint( 0, 0 ), vis );
-    wid->setShown( vis );
-  }
+  if ( e->type() == QEvent::ChildAdded && e->child()->isWidgetType() )
+    QApplication::postEvent( this, new ReparentEvent( QEvent::Type( Reparent ), e->child() ) );
   else
     QtxMainWindow::childEvent( e );
 }
 
+void SUIT_Desktop::customEvent( QEvent* e )
+{
+  if ( (int)e->type() != Reparent )
+    return;
+
+  ReparentEvent* re = (ReparentEvent*)e;
+  SUIT_ViewWindow* wid = ::qobject_cast<SUIT_ViewWindow*>( re->object() );
+  if ( wid )
+  {
+    bool invis = wid->testAttribute( Qt::WA_WState_ExplicitShowHide ) &&
+                 wid->testAttribute( Qt::WA_WState_Hidden );
+
+    addWindow( wid );
+    wid->setShown( !invis );
+  }
+}
+
 /*!
   Gets menu manager.
 */
@@ -113,11 +143,21 @@ QtxActionToolMgr* SUIT_Desktop::toolMgr() const
   return myToolMgr;
 }
 
+/*!
+  Gets logo manager.
+*/
+QtxLogoMgr* SUIT_Desktop::logoMgr() const
+{
+  return myLogoMgr;
+}
+
 /*!
   Returns the count of the existed logos.
 */
 int SUIT_Desktop::logoCount() const
 {
+  return 0;
+
   if ( !myLogoMgr )
     return 0;
   else
@@ -125,23 +165,12 @@ int SUIT_Desktop::logoCount() const
 }
 
 /*!
-  Adds new logo to the menu bar area.
-  Obsolete. Not should be used.
-  Use SUIT_Desktop::logoInsert();
-*/
-void SUIT_Desktop::addLogo( const QString& id, const QPixmap& pix )
-{
-  logoInsert( id, pix );
-}
-
-/*!
-  Removes a logo.
-  Obsolete. Not should be used.
-  Use SUIT_Desktop::logoRemove();
+  Adds new logo to the menu bar area
 */
-void SUIT_Desktop::removeLogo( const QString& id )
+void SUIT_Desktop::logoInsert( const QString& logoID, QMovie* logo, const int idx )
 {
-  logoRemove( id );
+  if ( myLogoMgr )
+    myLogoMgr->insert( logoID, logo, idx );
 }
 
 /*!
index e3acceb62f3621646107c89d2d8ff995614ba576..ad49bd55e5462240f27173eb38f98ba86e813877 100755 (executable)
@@ -1,36 +1,42 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_DESKTOP_H
 #define SUIT_DESKTOP_H
 
 #include "SUIT.h"
 
-#include <qmap.h>
-#include <qpixmap.h>
+#include <QList>
+#include <QEvent>
+
 #include <QtxMainWindow.h>
 
-class QPopupMenu;
+class QMovie;
+
 class QtxLogoMgr;
-class SUIT_ViewWindow;
 class QtxActionMenuMgr;
 class QtxActionToolMgr;
 
+class SUIT_ViewWindow;
+
 /*!
   \class SUIT_Desktop
   Provides standard desktop: main window with
@@ -40,23 +46,26 @@ class SUIT_EXPORT SUIT_Desktop : public QtxMainWindow
 {
   Q_OBJECT
 
+  class ReparentEvent;
+
+  enum { Reparent = QEvent::User };
+
 public:
   SUIT_Desktop();
   virtual ~SUIT_Desktop();
 
   QtxActionMenuMgr*        menuMgr() const;
   QtxActionToolMgr*        toolMgr() const;
+  QtxLogoMgr*              logoMgr() const;
 
   virtual SUIT_ViewWindow* activeWindow() const = 0;
-  virtual QPtrList<SUIT_ViewWindow> windows() const = 0;
-
-  void                     addLogo( const QString&, const QPixmap& ); // Not should be used. Will be removed.
-  void                     removeLogo( const QString& );              // Not should be used. Will be removed.
+  virtual QList<SUIT_ViewWindow*> windows() const = 0;
 
   int                      logoCount() const;
 
   void                     logoClear();
   void                     logoRemove( const QString& );
+  void                     logoInsert( const QString&, QMovie*, const int = -1 );
   void                     logoInsert( const QString&, const QPixmap&, const int = -1 );
 
   void                     emitActivated();
@@ -71,10 +80,11 @@ signals:
 
 protected:
   virtual bool             event( QEvent* );
+  virtual void             customEvent( QEvent* );
   virtual void             closeEvent( QCloseEvent* );
   virtual void             childEvent( QChildEvent* );
 
-  virtual QWidget*         parentArea() const = 0;
+  virtual void             addWindow( QWidget* ) = 0;
 
 private:
   QtxActionMenuMgr*        myMenuMgr;
index 7a5083c91799c3f4d1e45147f3c2fdc1d7fa9065..8793c96311c38adb359ac98f5d11c8b1eceee091 100755 (executable)
@@ -1,26 +1,33 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_ExceptionHandler.h"
 
 #include "SUIT_MessageBox.h"
 
-#include <qapplication.h>
+#ifdef ENABLE_TESTRECORDER
+  #include <TestApplication.h>
+#endif
+
+#include <QApplication>
 
 /*!\class SUIT_ExceptionHandler
  * Show exception message on error handler.
@@ -39,7 +46,12 @@ bool SUIT_ExceptionHandler::handle( QObject* o, QEvent* e )
 */
 bool SUIT_ExceptionHandler::internalHandle( QObject* o, QEvent* e )
 {
+#ifdef ENABLE_TESTRECORDER
+  TestApplication* aTApp = qobject_cast<TestApplication*>(qApp);
+  return aTApp ? aTApp->TestApplication::notify( o, e ) : false;
+#else
   return qApp ? qApp->QApplication::notify( o, e ) : false;
+#endif
 }
 
 /*!
@@ -53,5 +65,5 @@ void SUIT_ExceptionHandler::showMessage( const QString& title, const QString& ms
   while ( QApplication::overrideCursor() )
     QApplication::restoreOverrideCursor();
   
-  SUIT_MessageBox::error1( qApp->mainWidget(), title, msg, "OK" );
+  SUIT_MessageBox::critical( 0, title, msg );
 }
index d3c48455cd7f083d40eef7b7ebf14a35b7cfe3d8..ccc53e91d275087b2ec687f35570d146f2f02d8a 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_EXCEPTIONHANDLER_H
 #define SUIT_EXCEPTIONHANDLER_H
index 7fb1ee7c6a4b424fc09d75bc84a464736ea5bfe4..a3cb690f339196b6b9bf9aa4a7591ffdd56bfa49 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SUIT_FileDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-
 /*!
-  SUIT_FileDlg class is the extension of the Qt's Open/Save file dialog box.
-  To get the file/directory name(s) call static methods:
-
-  to invoke "Open file" or "Save file" dialog box
-  static QString getFileName(QWidget* parent, const QString& initial, const QStringList& filters, 
-                               const QString& caption, const bool open, const bool showQuickDir = true,
-                               SUIT_FileValidator* validator = 0);
-
-  to invoke "Open files" dialog box (to get the multiple file selection)
-  static QStringList getOpenFileNames(QWidget* parent, const QString& initial, const QStringList& filters, 
-                                        const QString& caption, bool showQuickDir = true, 
-                                        SUIT_FileValidator* validator = 0);
-
- to invoke "Select directory" dialog box
-    static QString getExistingDirectory(QWidget* parent, const QString& initial,
-                                        const QString& caption, const bool showQuickDir = true);
-
- The parameters:
- - parent        parent widget (if 0, the current desktop is used)
- - initial       starting directory or file name (if null, last visited directory is used)
- - filters       file filters list; patterns inside the filter can be separated by ';','|' or ' ' 
-                 symbols
- - caption       dialog box's caption: if null, the default one is used
- - open          open flag - true for "Open File" and false for "Save File" dialog box
- - showQuickDir  this flag enables/disables "Quick directory list" controls
- - validator     you can provide custom file validator with this parameter
-
- Examples:
-   ...
-   QStringList flist;
-   flist.append( "Image files (*.bmp *.gif *.jpg )" );
-   flist.append( "All files (*.*)" );
-   QMyFileValidator* v = new QMyFileValidator( 0 );
-   QString fileName =  SUIT_FileDlg::getFileName( 0, QString::null, flist, "Dump view", false, true, v );
-   if ( !fileName.isEmpty() ) {
-      ... writing image to the file 
-   }
-   ...
-   QStringList flist;
-   flist.append( "*.cpp | *.cxx | *.c++" );
-   flist.append( "*.h | *.hpp | *.hxx" );
-   QString fileName =  SUIT_FileDlg::getFileName( desktop(), QString::null, flist, QString::null, true, true );
+  \class SUIT_FileDlg
+  \brief An extension of the Qt Open/Save file dialog box.
+
+  The class SUIT_FileDlg provides a set of static methods which canbe used
+  for file or directories selection:
+  - getFileName() for single file opening or saving
+  - getOpenFileNames() for mulktiple files opening
+  - getExistingDirectory() for existing directory selection
+
+  Examples:
+  \code
+  // select file to dump contents of the view
+  QStringList filters;
+  filters << "Image files (*.bmp *.gif *.jpg )" << "All files (*)";
+  QString fileName = SUIT_FileDlg::getFileName( desktop(), 
+                                                QString(), 
+                                               filters, 
+                                               "Dump view",
+                                               false );
+  if ( !fileName.isEmpty() ) {
+    ... writing image to the file 
+  }
+
+  // select list of files to open in the editor windows
+  QStringList filters;
+  filters << "*.cpp | *.cxx | *.c++" << "*.h | *.hpp | *.hxx";
+  QStringList fileNames = SUIT_FileDlg::getOpenFileName( desktop(),
+                                                         QString(), 
+                                                        filters, 
+                                                        QString() );
+  if ( !fileNames.isEmpty() ) {
+    ... open files
+  }
+  \endcode
+
+  The class SUIT_FileDlg can be subclassed to implement custom file 
+  dialog boxes. The class provides a set of methods which can be used
+  in subclasses:
+  - setCheckPermissions() - to enable/disable check of files/directories
+    permissions
+  - setValidator() - to use custom file validator
+  - addWidgets() - to add custom widgets to the lower part of the 
+    dialog box
+  - getLastVisitedDirectory() - to get last visited directory
+  - acceptData() - can be used ti customize user selection validation
+
+  \sa SUIT_FileValidator class.
 */
 
 #include "SUIT_FileDlg.h"
 
 #include "SUIT_Tools.h"   
 #include "SUIT_Session.h"
-#include "SUIT_Desktop.h"
 #include "SUIT_MessageBox.h"
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_FileValidator.h"
 
-#include <qdir.h>
-#include <qlabel.h>
-#include <qregexp.h>
-#include <qpalette.h>
-#include <qobjectlist.h>
-#include <qcombobox.h>
-#include <qpushbutton.h>
-#include <qapplication.h>
+#include <QDir>
+#include <QEvent>
+#include <QRegExp>
+#include <QLabel>
+#include <QComboBox>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QApplication>
+#include <QListView>
+#include <QLineEdit>
 
-#define MIN_COMBO_SIZE 100
+/*!
+  \brief Defines extension behavior.
 
-/*! If the selected file name has extension which does not match the selected filter
- * this extension is ignored (and new one will be added). See below for details.
- */
+  If the selected file name has extension which does not match the selected filter
+  and this variable is set to \c true, the file extension is ignored and new one
+  (from current file filter will be added.
+  \sa addExtension()
+*/
 const bool IGNORE_NON_MATCHING_EXTENSION = true;
 
 QString SUIT_FileDlg::myLastVisitedPath;
 
-/*! Constructor */
-SUIT_FileDlg::SUIT_FileDlg( QWidget* parent, bool open, bool showQuickDir, bool modal ) :
-QFileDialog( parent, 0, modal ),
-myValidator( 0 ),
-myQuickCombo( 0 ), myQuickButton( 0 ), myQuickLab( 0 ),
-myOpen( open )//,
-//myAccepted( false )
-{    
-  const QObjectList* child = children();
-  QObjectList::const_iterator anIt = child->begin(), aLast = child->end();
-  for( ; anIt!=aLast; anIt++ )
-    if( (*anIt)->inherits( "QPushButton" ) )
-    {
-      QPushButton* bt = ( QPushButton* )( *anIt );
-      bt->setDefault( false );
-      bt->setAutoDefault( false );
-    }
-
-  if ( parent->icon() )
-    setIcon( *parent->icon() );       
+/*!
+  \brief Constructor.
+  \param parent parent widget
+  \param open if \c true dialog box is used for file opening, otherwise - for saving
+  \param showQuickDir if \c true the quick directory list widgets will be shown
+  \param modal if \c true the dialog box will be modal
+*/
+SUIT_FileDlg::SUIT_FileDlg( QWidget* parent, bool open, bool showQuickDir, bool modal )
+: QFileDialog( parent ),
+  myValidator( 0 ),
+  myQuickLab( 0 ),
+  myQuickCombo( 0 ),
+  myQuickButton( 0 ),
+  myCheckPermissions( true )
+{
+  setModal( modal );
   setSizeGripEnabled( true );
-  
+  if ( parent )
+    setWindowIcon( parent->windowIcon() );
+
+  // add quick directories widgets
   if ( showQuickDir ) {
-    // inserting quick dir combo box
-    myQuickLab  = new QLabel(tr("LAB_QUICK_PATH"), this);
-    myQuickCombo = new QComboBox(false, this);
-    myQuickCombo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-    myQuickCombo->setMinimumSize(MIN_COMBO_SIZE, 0);
+    myQuickLab    = new QLabel( tr( "LAB_QUICK_PATH" ), this );
+    myQuickCombo  = new QComboBox( this );
+    myQuickButton = new QPushButton( tr( "BUT_ADD_PATH" ), this );
     
-    myQuickButton = new QPushButton(tr("BUT_ADD_PATH"), this);
+    if ( addWidgets( myQuickLab, myQuickCombo, myQuickButton ) ) {
+      connect( myQuickCombo,  SIGNAL( activated( const QString& ) ), this, SLOT( quickDir( const QString& ) ) );
+      connect( myQuickButton, SIGNAL( clicked() ),                   this, SLOT( addQuickDir() ) );
 
-    connect(myQuickCombo,  SIGNAL(activated(const QString&)), this, SLOT(quickDir(const QString&)));
-    connect(myQuickButton, SIGNAL(clicked()),                 this, SLOT(addQuickDir()));
-    addWidgets(myQuickLab, myQuickCombo, myQuickButton);
+      // retrieve directories list from the resources
+      QStringList dirList;
+  
+      SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+      if ( resMgr )
+       dirList = resMgr->stringValue( "FileDlg", QString( "QuickDirList" ) ).split( ';', QString::SkipEmptyParts );
 
-    // getting dir list from settings
-    QString dirs;
-    SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-    if ( resMgr )
-      dirs = resMgr->stringValue( "FileDlg", QString( "QuickDirList" ) );
+      if ( dirList.isEmpty() ) 
+       dirList << QDir::homePath();
 
-    QStringList dirList = QStringList::split(';', dirs, false);
-    if (dirList.count() > 0) {
-      for (unsigned i = 0; i < dirList.count(); i++)
-        myQuickCombo->insertItem(dirList[i]);
+      for ( int i = 0; i < dirList.count(); i++ )
+       myQuickCombo->addItem( dirList[i] );
     }
     else {
-      myQuickCombo->insertItem(QDir::homeDirPath());
+      delete myQuickLab;    myQuickLab = 0;
+      delete myQuickCombo;  myQuickCombo = 0;
+      delete myQuickButton; myQuickButton = 0;
     }
   }
-  setMode( myOpen ? ExistingFile : AnyFile );     
-  setCaption( myOpen ? tr( "INF_DESK_DOC_OPEN" ) : tr( "INF_DESK_DOC_SAVE" ) );
+
+  setAcceptMode( open ? AcceptOpen: AcceptSave );
+  setWindowTitle( open ? tr( "INF_DESK_DOC_OPEN" ) : tr( "INF_DESK_DOC_SAVE" ) );
 
   // If last visited path doesn't exist -> switch to the first preferred path
   if ( !myLastVisitedPath.isEmpty() ) {
     if ( !processPath( myLastVisitedPath ) && showQuickDir )
-      processPath( myQuickCombo->text( 0 ) );
+      processPath( myQuickCombo->itemText( 0 ) );
+  }
+  else if ( showQuickDir ) {
+    processPath( myQuickCombo->itemText( 0 ) );
   }
-  else {
-    if ( showQuickDir )
-      processPath(myQuickCombo->text( 0 ) );
-  } 
 
   // set default file validator
-  myValidator = new SUIT_FileValidator(this);
+  myValidator = new SUIT_FileValidator( this );
 }
 
-/*! Destructor*/
+/*!
+  \brief Destructor.
+*/
 SUIT_FileDlg::~SUIT_FileDlg() 
 {
   setValidator( 0 );
 }
 
-/*! Redefined from QFileDialog.*/
-void SUIT_FileDlg::polish()
+
+/*! 
+  \brief Check if the dialog box is used for opening or saving the file.
+  \return \c true if dialog is used for file opening and \c false otherwise
+*/
+bool SUIT_FileDlg::isOpenDlg() const
 {
-  QFileDialog::polish();
-  if ( myQuickButton && myQuickLab ) {
-    // the following is a workaround for proper layouting of custom widgets
-    QValueList<QPushButton*> buttonList;
-    QValueList<QLabel*> labelList;
-    const QObjectList *list = children();
-    QObjectListIt it(*list);
-    int maxButWidth = myQuickLab->sizeHint().width();
-    int maxLabWidth = myQuickButton->sizeHint().width();
-    
-    for (; it.current() ; ++it) {
-      if ( it.current()->isA( "QLabel" ) ) {
-       int tempW = ((QLabel*)it.current())->minimumWidth();
-       if ( maxLabWidth < tempW ) maxLabWidth = tempW;
-       labelList.append( (QLabel*)it.current() );
-      }
-      else if( it.current()->isA("QPushButton") ) {
-       int tempW = ((QPushButton*)it.current())->minimumWidth();
-       if ( maxButWidth < tempW ) maxButWidth = tempW;
-       buttonList.append( (QPushButton*)it.current() );
-      }
-    }
-    if (maxButWidth > 0) {
-      QValueList<QPushButton*>::Iterator bListIt;
-      for ( bListIt = buttonList.begin(); bListIt != buttonList.end(); ++bListIt )
-       (*bListIt)->setFixedWidth( maxButWidth );
-    }
-    if (maxLabWidth > 0) {
-      QValueList<QLabel*>::Iterator lListIt;
-      for ( lListIt = labelList.begin(); lListIt != labelList.end(); ++lListIt )
-       (*lListIt)->setFixedWidth( maxLabWidth );
-    }
-  }
+  return acceptMode() == AcceptOpen;
+}
+
+/*!
+  \brief Get 'check file permissions' flag.
+  \return flag value
+  \sa setCheckPermissions()
+*/
+bool SUIT_FileDlg::checkPermissions() const
+{
+  return myCheckPermissions;
 }
 
-/*! Sets validator for file names to open/save
- * Deletes previous validator if the dialog owns it.
- */
+/*!
+  \brief Set 'check file permissions' flag.
+  If this flag is set and file validator is not null,
+  the validator will check the file permissions also.
+
+  \param checkPerm new flag value
+  \sa checkPermissions()
+*/
+void SUIT_FileDlg::setCheckPermissions( const bool checkPerm )
+{
+  myCheckPermissions = checkPerm;
+}
+
+/*!
+  \brief Get file validator.
+  \return current file validator
+  \sa setValidator()
+*/
+SUIT_FileValidator* SUIT_FileDlg::validator() const
+{
+  return myValidator;
+}
+
+/*!
+  \brief Set file validator.
+  Destroys previous validator if the dialog owns it.
+
+  \param v new file validator
+  \sa validator()
+*/
 void SUIT_FileDlg::setValidator( SUIT_FileValidator* v )
 {
   if ( myValidator && myValidator->parent() == this )
@@ -210,113 +236,266 @@ void SUIT_FileDlg::setValidator( SUIT_FileValidator* v )
   myValidator = v;
 }
 
-/*! Returns the selected file */
+/*!
+  \brief Adds the specified widgets to the bottom of the file dialog. 
+  
+  The first widget (usually label) \a l is placed underneath the "file name" 
+  and the "file types" labels. 
+  The widget \a w is placed underneath the file types combobox.
+  The last widget (usually button) \a b is placed underneath the Cancel push button. 
+
+  In general, the widgets can be arbitrary. This method is added to support 
+  the functionality provided by the Qt series 3.x.
+
+  If you don't want to have one of the widgets added, pass 0 in that widget's position. 
+  Every time this function is called, a new row of widgets is added to the bottom of the 
+  file dialog. 
+
+  \param l first widget (e.g. text label)
+  \param w second widget (e.g. combo box)
+  \param b third widget (e.g. push button)
+  \return \c true if widgets have been added successfully
+*/
+bool SUIT_FileDlg::addWidgets( QWidget* l, QWidget* w, QWidget* b )
+{
+  QGridLayout* grid = ::qobject_cast<QGridLayout*>( layout() );
+  if ( grid ) {
+    int row = grid->rowCount();
+    int columns = grid->columnCount();
+    if ( l ) 
+      grid->addWidget( l, row, 0 );
+    if ( w )
+      grid->addWidget( w, row, 1, 1, columns-2 );
+    if ( b )
+      grid->addWidget( b, row, columns-1 );
+    return true;
+  }
+  return false;
+}
+
+/*!
+  \brief Get list of selected files.
+  \return selected file names
+*/
+QStringList SUIT_FileDlg::selectedFiles() const
+{
+  QStringList files = QFileDialog::selectedFiles();
+  if ( fileMode() != DirectoryOnly && fileMode() != Directory ) {
+    QMutableListIterator<QString> it( files );
+    while ( it.hasNext() ) {
+      QString f = it.next();
+      QFileInfo finfo( f );
+      if ( !finfo.isDir() )
+       it.setValue( addExtension( f ) );
+    }
+  }
+  return files;
+}
+
+/*!
+  \brief Get selected file.
+  \return selected file name or null string if file is not selected
+*/
 QString SUIT_FileDlg::selectedFile() const
 {
-  return mySelectedFile;
+  QStringList files = selectedFiles();
+  return files.count() > 0 ? files[0] : QString();
 }
 
-/*! Returns 'true' if this is 'Open File' dialog 
- *  and 'false' if 'Save File' dialog
- */
-bool SUIT_FileDlg::isOpenDlg() const
+/*!
+  \brief Get last visited directory.
+
+  Note, that last visited path is memorized only if the 
+  dialog box is accepted.
+
+  \return last visited directory
+*/
+QString SUIT_FileDlg::getLastVisitedDirectory()
 {
-  return myOpen;
+  return myLastVisitedPath;
 }
 
-/*! Closes this dialog and sets the return code to 'Accepted'
- * if the selected name is valid ( see 'acceptData()' )
- */
-void SUIT_FileDlg::accept()
+/*!
+  \brief Customize events processing.
+  \param e event
+  \return \c true if the event e was recognized and processed
+*/
+bool SUIT_FileDlg::event( QEvent* e )
 {
-  /* myAccepted 
-   * flag is used to warkaround the Qt 2.2.2 BUG: 
-   * accept() method is called twice if user presses 'Enter' key 
-   * in file name editor while file name is not acceptable by acceptData()
-   * (e.g. permission denied)
-   */
-//  if ( !myAccepted ) {
-    if ( mode() != ExistingFiles ) {
-      mySelectedFile = QFileDialog::selectedFile();
-      addExtension();
-    }
+  bool res = QFileDialog::event( e );
 
-    if ( acceptData() ) {
-      myLastVisitedPath = dirPath();
-      QFileDialog::accept();        
-//      myAccepted = true;
-    }
-//  }
-//  myAccepted = !myAccepted;
+  if ( e->type() == QEvent::Polish )
+    polish();
+
+  return res;
 }
 
-/*! Closes this dialog and sets the return code to 'Rejected' */
-void SUIT_FileDlg::reject()
+/*!
+  \brief Get line edit which is used to enter file name.
+  \return line edit widget or0 if it could not be found
+*/
+QLineEdit* SUIT_FileDlg::lineEdit() const
 {
-  mySelectedFile = QString::null;
-  QFileDialog::reject();        
+  QLineEdit* ebox = 0;
+  QList<QLineEdit*> editBoxes = findChildren<QLineEdit*>();
+  QGridLayout* grid = ::qobject_cast<QGridLayout*>( layout() );
+  if ( grid ) {
+    int idx = 10000;
+    for ( int i = 0; i < editBoxes.count(); i++ ) {
+      int widx = grid->indexOf( editBoxes[ i ] );
+      if ( widx >= 0 )
+       idx = qMin( idx, widx );
+    }
+    if ( grid->itemAt( idx )  )
+      ebox = qobject_cast<QLineEdit*>( grid->itemAt( idx )->widget() );
+  }
+  return ebox;
 }
 
-/*! Returns 'true' if selected file is valid.
- * The validity is checked by a file validator, 
- * if there is no validator the file is always
- * considered as valid    
- */
+/*! 
+  \brief Validate user selection.
+
+  The validation is done by calling the corresponding methods
+  of the validator. If the validator is not set, this method
+  always returns \c true.
+
+  This method can be re-implemented in the subclasses to customize
+  the file dialog behavior.
+  Another solution could be implementing own file validator class.
+
+  \return \c true if user selection (file(s) or directory) is valid
+  \sa SUIT_FileValidator class, validator(), setValidator()
+*/
 bool SUIT_FileDlg::acceptData()
 {    
-  if ( myValidator )
-  {
-    if ( isOpenDlg() )
+  QStringList files = selectedFiles();
+  if ( files.isEmpty() )
+    return false;
+
+  // special case for ".."
+  if ( lineEdit() ) {
+    QString txt = lineEdit()->text();
+    if ( txt == ".." ) {
+      QDir dir = directory();
+      if ( dir.cdUp() ) {
+       setDirectory( dir );
+       bool block = lineEdit()->blockSignals( true );
+       lineEdit()->setText( ".." );
+       lineEdit()->selectAll();
+       lineEdit()->setFocus( Qt::OtherFocusReason );
+       lineEdit()->blockSignals( block );
+       return false;
+      }
+    }
+    else if ( fileMode() != DirectoryOnly ) {
+      QStringList fs = txt.split( " ", QString::SkipEmptyParts );
+      for ( int i = 0; i < fs.count(); i++ ) {
+       QString wc = fs.at( i );
+       if ( wc.startsWith( "\"" ) && wc.endsWith( "\"" ) )
+         wc = wc.mid( 1, wc.length()-2 );
+       if ( hasWildCards( wc ) ) {
+         addFilter( wc );
+         lineEdit()->clear();
+         return false;
+       }
+      }
+    }
+  }
+
+  // special case for wildcards
+  for ( int i = 0; i < files.count(); ++i ) {
+  }
+
+  bool bOk = true;
+
+  switch ( fileMode() ) {
+  case DirectoryOnly:
+  case Directory: 
+    {
+      QString fn = files.first();
+      if ( validator() ) {
+       bOk = isOpenDlg() ? validator()->canReadDir( fn, checkPermissions() ) : 
+                           validator()->canWriteDir( fn, checkPermissions() );
+      }
+      break;
+    }
+  case AnyFile: 
     {
-      if ( mode() == ExistingFiles )
-      {
-             QStringList fileNames = selectedFiles();
-             for ( int i = 0; i < (int)fileNames.count(); i++ )
-        {
-               if ( !myValidator->canOpen( fileNames[i] ) )
-                 return false;
-             }
-             return true;
+      QString fn = files.first();
+      QFileInfo info( fn );
+      if ( info.isDir() ) {
+       setDirectory( info.absoluteFilePath() );
+       if ( lineEdit() ) {
+         lineEdit()->selectAll();
+         lineEdit()->setFocus( Qt::OtherFocusReason );
+       }
+       return false;
       }
-      else
-      {
-             return myValidator->canOpen( selectedFile() );
+      // validation is not required
+      if ( validator() ) {
+       bOk = isOpenDlg() ? validator()->canOpen( fn, checkPermissions() ) : 
+                           validator()->canSave( fn, checkPermissions() );
       }
+      break;
+    }
+  case ExistingFile:
+  case ExistingFiles: 
+    {
+      for ( int i = 0; i < files.count(); ++i ) {
+       QFileInfo info( files.at( i ) );
+       if ( info.isDir() ) {
+         setDirectory( info.absoluteFilePath() );
+         if ( lineEdit() ) {
+           lineEdit()->selectAll();
+           lineEdit()->setFocus( Qt::OtherFocusReason );
+         }
+         return false;
+       }
+       if ( validator() ) {
+         bOk = isOpenDlg() ? validator()->canOpen( files.at( i ), checkPermissions() ) : 
+                             validator()->canSave( files.at( i ), checkPermissions() );
+       if ( !bOk )
+         return false;
+       }
+      }
+      break;
     }
-    else
-      return myValidator->canSave( selectedFile() );
   }
-  return true;
+
+  if ( bOk )
+    emit filesSelected( files );
+
+  return bOk;
 }
 
-/*! Adds an extension to the selected file name
- * if the file has not it.
- * The extension is extracted from the active filter.
- */
-void SUIT_FileDlg::addExtension()
+/*!
+  \brief Add an extension to the specified file name.
+  The extension is extracted from the active filter.
+
+  \param fileName file name to be processed
+  \return fileName with the extension added
+*/
+QString SUIT_FileDlg::addExtension( const QString& fileName ) const
 {
+  QString fname = fileName.trimmed();
+
   // check if file name entered is empty
-  if ( mySelectedFile.stripWhiteSpace().isEmpty() )
-    return;
+  if ( fname.isEmpty() )
+    return fileName;
 
   // current file extension
-  QString anExt = "." + SUIT_Tools::extension( mySelectedFile.stripWhiteSpace() ).stripWhiteSpace();
+  QString anExt = "." + SUIT_Tools::extension( fname ).trimmed();
 
   // If the file already has extension and it does not match the filter there are two choices:
   // - to leave it 'as is'
   // - to ignore it
   // The behavior is defined by IGNORE_NON_MATCHING_EXTENSION constant
   if ( anExt != "." && !IGNORE_NON_MATCHING_EXTENSION )
-    return;
+    return fileName;
 
-  // get selected file filter
-#if QT_VERSION < 0x030000
-  QRegExp r( QString::fromLatin1("(?[a-zA-Z0-9.*? +;#|]*)?$") );
-  int len, index = r.match( selectedFilter().stripWhiteSpace(), 0, &len );
-#else
   QRegExp r( QString::fromLatin1("\\(?[a-zA-Z0-9.*? +;#|]*\\)?$") );
-  int index = r.search( selectedFilter().stripWhiteSpace() );
-#endif
+  int index = r.indexIn( selectedFilter().trimmed() );
 
   if ( index >= 0 ) {            
     // Create wildcard regular expression basing on selected filter 
@@ -324,23 +503,19 @@ void SUIT_FileDlg::addExtension()
     // Due to transformations from the filter list (*.txt *.*xx *.c++ SUIT*.* ) we 
     // will have the pattern (\.txt|\..*xx|\.c\+\+|\..*) (as we validate extension only, 
     // we remove everything except extension mask from the pattern
-#if QT_VERSION < 0x030000
-    QString wildcard = selectedFilter().mid( index, len ).stripWhiteSpace();
-#else
-    QString wildcard = selectedFilter().mid( index, r.matchedLength() ).stripWhiteSpace();
-#endif
+    QString wildcard = selectedFilter().mid( index, r.matchedLength() ).trimmed();
     // replace '|' and ';' separators by space symbol and also brackets if there are some
     wildcard.replace( QRegExp( "[\\|;|(|)]" )," " ); 
 
-    QString aPattern = wildcard.replace( QRegExp( "(^| )(\\s*)[0-9a-zA-Z*_?]*\\."), " \\." ).stripWhiteSpace().
+    QString aPattern = wildcard.replace( QRegExp( "(^| )(\\s*)[0-9a-zA-Z*_?]*\\."), " \\." ).trimmed().
                                          replace( QRegExp( "\\s+" ), "|" ).replace( QRegExp( "[?]" ),".?" ).
                                          replace( QRegExp( "[*]" ),".*" ).replace( QRegExp( "[+]" ),"\\+" );
 
     // now we get the list of all extension masks and remove all which does not contain wildcard symbols
-    QStringList extList = QStringList::split( "|",aPattern );
-    for( int i = extList.count() - 1; i >= 0; i-- ) {
+    QStringList extList = aPattern.split( "|", QString::SkipEmptyParts );
+    for ( int i = extList.count() - 1; i >= 0; i-- ) {
       if ( !extList[i].contains( "." ) )
-        extList.remove( extList.at( i ) );
+        extList.removeAt( i );
     }
     aPattern = extList.join( "|" );
 
@@ -348,192 +523,463 @@ void SUIT_FileDlg::addExtension()
     QRegExp anExtRExp( "^("+ aPattern + ")$" );
 
     // Check if the current file extension matches the pattern
-    if ( anExtRExp.match( anExt ) < 0 )
-    {
+    if ( !anExtRExp.exactMatch( anExt ) ) {
       // find first appropriate extension in the selected filter 
       // (it should be without wildcard symbols)
-      for ( int i = 0; i < (int)extList.count(); i++ )
-      {
+      for ( int i = 0; i < extList.count(); i++ ) {
         QString newExt = extList[i].replace( QRegExp( "[\\\\][+]" ),"+" );
-        int res = newExt.findRev( '.' );
+        int res = newExt.lastIndexOf( '.' );
         if ( res >= 0 )
           newExt = newExt.mid( res + 1 );
-        if ( newExt.find( QRegExp("[*|?]" ) ) < 0 )
-        {
-          mySelectedFile.stripWhiteSpace();
-          mySelectedFile += mySelectedFile.endsWith(".") ? newExt : QString(".") + newExt;
-          break;
+        if ( newExt.indexOf( QRegExp("[*|?]" ) ) < 0 ) {
+          fname += fname.endsWith( "." ) ? newExt : QString( "." ) + newExt;
+          return fname;
         }
       }
     }
   }
+  return fileName;
 }
 
-/*! Processes selection : tries to set given path or filename as selection */
+/*!
+  \brief Processes selection : tries to set specified sirectory or filename
+  as current file dialog selection.
+  \param path file or directory path
+  \return \c true if \a path is processed correctly and \c false otherwise
+*/
 bool SUIT_FileDlg::processPath( const QString& path )
 {
   if ( !path.isNull() ) {
     QFileInfo fi( path );
     if ( fi.exists() ) {
       if ( fi.isFile() )
-       setSelection( path );
+       selectFile( path );
       else if ( fi.isDir() )
-       setDir( path );
+       setDirectory( path );
       return true;
     }
-    else {
-      if ( QFileInfo( fi.dirPath() ).exists() ) {
-       setDir( fi.dirPath() );
-       setSelection( path );
-       return true;
-      }
+    else if ( QFileInfo( SUIT_Tools::dir( path ) ).exists() ) {
+      setDirectory( SUIT_Tools::dir( path ) );
+      selectFile( path );
+      return true;
     }
   }
   return false;
 }
-/*! Called when user selects item from "Quick Dir" combo box */
-void SUIT_FileDlg::quickDir(const QString& dirPath)
+
+/*!
+  \brief Add file filter and activates it.
+  \param filter new file filter
+*/
+void SUIT_FileDlg::addFilter( const QString& filter )
+{
+  QStringList flist = filters();
+  if ( !flist.contains( filter ) ) {
+    flist << filter;
+    setFilters( flist );
+  }
+  selectFilter( filter );
+}
+
+/*!
+  \brief Check if the string contains wildcard symbols.
+  \param s string to be checked (for example, file name)
+  \return \c true if string contains "*" or "?" symbols
+*/
+bool SUIT_FileDlg::hasWildCards( const QString& s )
+{
+  return s.contains( QRegExp("[*|?]") );
+}
+
+/*!
+  \brief Called when the user presses "Open"or "Save" button.
+
+  Verifies the user choice and closes dialog box, setting the return code to QDialog::Accepted
+
+  \sa acceptData()
+*/
+void SUIT_FileDlg::accept()
 {
-  QString aPath = dirPath;
-  if ( !QDir(aPath).exists() ) {
-    aPath = QDir::homeDirPath();
-    SUIT_MessageBox::error1(this, 
-                  tr("ERR_ERROR"),
-                  tr("ERR_DIR_NOT_EXIST").arg(dirPath), 
-                  tr("BUT_OK"));    
+  if ( acceptData() ) {
+    myLastVisitedPath = directory().path();
+    QDialog::accept();        
   }
+}
+
+/*!
+  \brief Called when user selects directory from the "Quick Dir" combo box.
+
+  Browses the file dialog to the specified directory (if it is valid).
+
+  \param dirPath selected directory
+*/
+void SUIT_FileDlg::quickDir( const QString& dirPath )
+{
+  if ( !QDir( dirPath ).exists() )
+    SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "ERR_DIR_NOT_EXIST" ).arg( dirPath ) );
   else
-  processPath(aPath);
+    processPath( dirPath );
 }
+
 /*!
-  Called when user presses "Add" button - adds current directory to quick directory
-  list and to the preferences
+  \brief Called when user presses "Quick Dir Add" button.
+  
+  Adds current directory to the quick directories list and to the preferences.
 */
 void SUIT_FileDlg::addQuickDir()
 {
-  QString dp = dirPath();
+  QString dp = directory().path();
   if ( !dp.isEmpty() ) {
     QDir dir( dp );
-    // getting dir list from settings
-    QString dirs;
+
+    QStringList dirList;
+
     SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
     if ( resMgr )
-      dirs = resMgr->stringValue( "FileDlg", QString( "QuickDirList" ) );
-    QStringList dirList = QStringList::split(';', dirs, false);
+      dirList = resMgr->stringValue( "FileDlg", QString( "QuickDirList" ) ).split( ';', QString::SkipEmptyParts );
+
     bool found = false;
     bool emptyAndHome = false;
     if ( dirList.count() > 0 ) {
-      for ( unsigned i = 0; i < dirList.count(); i++ ) {
+      for ( int i = 0; i < dirList.count() && !found; i++ )  {
        QDir aDir( dirList[i] );
-       if ( aDir.canonicalPath().isNull() && dirList[i] == dir.absPath() ||
-           !aDir.canonicalPath().isNull() && aDir.exists() && aDir.canonicalPath() == dir.canonicalPath() ) {
+       if ( aDir.canonicalPath().isNull() && dirList[i] == dir.absolutePath() ||
+            !aDir.canonicalPath().isNull() && aDir.exists() && 
+            aDir.canonicalPath() == dir.canonicalPath() ) {
          found = true;
-         break;
        }
       }
     }
     else {
-      emptyAndHome = dir.canonicalPath() == QDir(QDir::homeDirPath()).canonicalPath();
+      emptyAndHome = dir.canonicalPath() == QDir( QDir::homePath() ).canonicalPath();
     }
+
     if ( !found ) {
       dirList.append( dp );
-      resMgr->setValue( "FileDlg", QString( "QuickDirList" ), dirList.join(";") );
+      resMgr->setValue( "FileDlg", QString( "QuickDirList" ), dirList.join( ";" ) );
       if ( !emptyAndHome )
-       myQuickCombo->insertItem( dp );
+       myQuickCombo->addItem( dp );
     }
   }
 }
+
+/*!
+  \brief Polish the dialog box.
+*/
+void SUIT_FileDlg::polish()
+{
+  QList<QPushButton*> buttons = findChildren<QPushButton*>();
+
+  int maxBtnWidth = 0;
+
+  for ( QList<QPushButton*>::const_iterator it = buttons.begin(); 
+       it != buttons.end(); ++it )
+    maxBtnWidth = qMax( maxBtnWidth, (*it)->sizeHint().width() );
+
+  for ( QList<QPushButton*>::const_iterator it = buttons.begin(); 
+       it != buttons.end(); ++it ) {
+    (*it)->setDefault( false );
+    (*it)->setAutoDefault( false );
+    (*it)->setFixedWidth( maxBtnWidth );
+  }
+
+  QList<QListView*> views = findChildren<QListView*>();
+  for ( QList<QListView*>::const_iterator it = views.begin(); 
+       it != views.end(); ++it ) {
+    (*it)->setViewMode( QListView::ListMode );
+  }
+}
+
 /*!
-  Returns the file name for Open/Save [ static ]
+  \brief Show dialog box for the file opening/saving.
+
+  This method can be used to select the file for opening
+  or saving. The behavior is defined by the \a open parameter.
+  Note, that selection validation depends on the dialog mode used.
+
+  If \a initial parameter is not null string it is used as starting directory
+  or file at which dialog box is opened.
+  
+  The parameter \a filters defines file filters (wildcards) to be used.
+  If filters list is empty, "All files (*)" is used by default.
+  
+  The parameter \a caption is used as dialog box title. If it is
+  is empty, the default title is used.
+  
+  The parameter \a showQuickDir specifies if it is necessary to 
+  show additional quick directories list controls in the bottom part
+  of the dialog box.
+
+  The validation of the user selection is done with help of the file 
+  validator (SUIT_FileValidator class). The last parameter \a validator
+  can be used to pass the custom file validator to the dialog box.
+  
+  \param parent parent widget
+  \param initial initial file (or directory) dialog box to be opened on
+  \param filters file filters list
+  \param caption dialog box title
+  \param open if \c true dialog box is used for file opening, otherwise - for saving
+  \param showQuickDir if \c true the quick directory list widgets will be shown
+  \param validator custom file validator
+  \return selected file name or null string if dialog box is cancelled
+  \sa getOpenFileNames(), getExistingDirectory()
 */
-QString SUIT_FileDlg::getFileName( QWidget*            parent, 
-                                  const QString&      initial, 
-                                   const QStringList&  filters, 
-                                   const QString&      caption,
-                                   bool                open,
-                                  bool                showQuickDir, 
-                                  SUIT_FileValidator* validator )
+QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial, 
+                                  const QStringList& filters, const QString& caption, 
+                                  const bool open, const bool showQuickDir,
+                                   SUIT_FileValidator* validator )
 {            
-  SUIT_FileDlg* fd = new SUIT_FileDlg( parent, open, showQuickDir, true );    
+  SUIT_FileDlg fd( parent, open, showQuickDir, true );    
+
+  fd.setFileMode( open ? ExistingFile : AnyFile );
+
+  QString tmpfilename = initial;
+  tmpfilename = tmpfilename.simplified();
+  tmpfilename = tmpfilename.replace(QRegExp("\\*"), "" ).replace(QRegExp("\\?"), "" );
+
+  if ( filters.isEmpty() )
+    fd.setFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
+  else
+    fd.setFilters( filters );
+
   if ( !caption.isEmpty() )
-    fd->setCaption( caption );
-  if ( !initial.isEmpty() ) { 
-    fd->processPath( initial ); // VSR 24/03/03 check for existing of directory has been added to avoid QFileDialog's bug
-  }
-  fd->setFilters( filters );        
+    fd.setWindowTitle( caption );
+
+  if ( !tmpfilename.isEmpty() )
+    fd.processPath( tmpfilename );
+
   if ( validator )
-    fd->setValidator( validator );
-  fd->exec();
-  QString filename = fd->selectedFile();
-  delete fd;
-  qApp->processEvents();
+    fd.setValidator( validator );
+
+  QString filename;
+
+  if ( fd.exec() == QDialog::Accepted )
+    filename = fd.selectedFile();
+
+  QApplication::processEvents();
+
   return filename;
 }
 
+/*!
+  \brief Show dialog box for the file opening/saving.
+  \overload
+
+  This method can be used to select the file for opening
+  or saving. The behavior is defined by the \a open parameter.
+  Note, that selection validation depends on the dialog mode used.
+
+  If \a initial parameter is not null string it is used as starting directory
+  or file at which dialog box is opened.
+  
+  The parameter \a filters defines file filters (wildcards) to be used.
+  This is the list of wildcards, separated by the ";;" symbols.
+  If filters list is empty, "All files (*)" is used by default.
+  
+  The parameter \a caption is used as dialog box title. If it is
+  is empty, the default title is used.
+  
+  The parameter \a showQuickDir specifies if it is necessary to 
+  show additional quick directories list controls in the bottom part
+  of the dialog box.
+
+  The validation of the user selection is done with help of the file 
+  validator (SUIT_FileValidator class). The last parameter \a validator
+  can be used to pass the custom file validator to the dialog box.
+  
+  \param parent parent widget
+  \param initial initial file (or directory) dialog box to be opened on
+  \param filters file filters separated by ";;"
+  \param caption dialog box title
+  \param open if \c true dialog box is used for file opening, otherwise - for saving
+  \param showQuickDir if \c true the quick directory list widgets will be shown
+  \param validator custom file validator
+  \return selected file name or null string if dialog box is cancelled
+  \sa getOpenFileNames(), getExistingDirectory()
+*/
+QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial, 
+                                  const QString& filters, const QString& caption, 
+                                  const bool open, const bool showQuickDir,
+                                   SUIT_FileValidator* validator )
+{
+  return getFileName( parent, initial, filters.split( ";;", QString::SkipEmptyParts ), 
+                     caption, open, showQuickDir, validator );
+}
 
 /*!
-  Returns the list of files to be opened [ static ]
+  \brief Show dialog box for the multiple files selection.
+
+  If \a initial parameter is not null string it is used as starting directory
+  or file at which dialog box is opened.
+  
+  The parameter \a filters defines file filters (wildcards) to be used.
+  If filters list is empty, "All files (*)" is used by default.
+  
+  The parameter \a caption is used as dialog box title. If it is
+  is empty, the default title is used.
+  
+  The parameter \a showQuickDir specifies if it is necessary to 
+  show additional quick directories list controls in the bottom part
+  of the dialog box.
+
+  The validation of the user selection is done with help of the file 
+  validator (SUIT_FileValidator class). The last parameter \a validator
+  can be used to pass the custom file validator to the dialog box.
+  
+  \param parent parent widget
+  \param initial initial file (or directory) dialog box to be opened on
+  \param filters file filters list
+  \param caption dialog box title
+  \param showQuickDir if \c true the quick directory list widgets will be shown
+  \param validator custom file validator
+  \return selected file names or empty list if dialog box is cancelled
+  \sa getFileName(), getExistingDirectory()
 */
-QStringList SUIT_FileDlg::getOpenFileNames( QWidget*            parent, 
-                                           const QString&      initial, 
-                                           const QStringList&  filters, 
-                                           const QString&      caption,
-                                           bool                showQuickDir, 
+QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& initial,
+                                           const QStringList& filters, const QString& caption,
+                                           const bool showQuickDir, 
                                            SUIT_FileValidator* validator )
 {            
-  SUIT_FileDlg* fd = new SUIT_FileDlg( parent, true, showQuickDir, true );    
-  fd->setMode( ExistingFiles );     
+  SUIT_FileDlg fd( parent, true, showQuickDir, true );
+
+  fd.setFileMode( ExistingFiles );
+
+  if ( filters.isEmpty() )
+    fd.setFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
+  else
+    fd.setFilters( filters );
+
   if ( !caption.isEmpty() )
-    fd->setCaption( caption );
-  if ( !initial.isEmpty() ) { 
-    fd->processPath( initial ); // VSR 24/03/03 check for existing of directory has been added to avoid QFileDialog's bug
-  }
-  fd->setFilters( filters );        
+    fd.setWindowTitle( caption );
+
+  if ( !initial.isEmpty() )
+    fd.processPath( initial );
+
   if ( validator )
-    fd->setValidator( validator );
-  fd->exec();
-  QStringList filenames = fd->selectedFiles();
-  delete fd;
-  qApp->processEvents();
+    fd.setValidator( validator );
+
+  QStringList filenames;
+
+  if ( fd.exec() == QDialog::Accepted )
+    filenames = fd.selectedFiles();
+
+  QApplication::processEvents();
+
   return filenames;
 }
 
 /*!
-  Existing directory selection dialog [ static ]
+  \brief Show dialog box for the multiple file opening.
+  \overload
+
+  If \a initial parameter is not null string it is used as starting directory
+  or file at which dialog box is opened.
+  
+  The parameter \a filters defines file filters (wildcards) to be used.
+  This is the list of wildcards, separated by the ";;" symbols.
+  If filters list is empty, "All files (*)" is used by default.
+  
+  The parameter \a caption is used as dialog box title. If it is
+  is empty, the default title is used.
+  
+  The parameter \a showQuickDir specifies if it is necessary to 
+  show additional quick directories list controls in the bottom part
+  of the dialog box.
+
+  The validation of the user selection is done with help of the file 
+  validator (SUIT_FileValidator class). The last parameter \a validator
+  can be used to pass the custom file validator to the dialog box.
+  
+  \param parent parent widget
+  \param initial initial file (or directory) dialog box to be opened on
+  \param filters file filters separated by ";;"
+  \param caption dialog box title
+  \param showQuickDir if \c true the quick directory list widgets will be shown
+  \param validator custom file validator
+  \return selected file names or empty list if dialog box is cancelled
+  \sa getFileName(), getExistingDirectory()
 */
-QString SUIT_FileDlg::getExistingDirectory( QWidget*       parent,
-                                           const QString& initial,
-                                           const QString& caption, 
-                                           bool           showQuickDir )
+QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& initial,
+                                           const QString& filters, const QString& caption,
+                                           const bool showQuickDir,
+                                           SUIT_FileValidator* validator )
 {
-  SUIT_FileDlg* fd = new SUIT_FileDlg( parent, true, showQuickDir, true);
+  return getOpenFileNames( parent, initial, filters.split( ";;", QString::SkipEmptyParts ), 
+                          caption, showQuickDir, validator );
+}
+
+/*!
+  \brief Show dialog box for the existing directory selection.
+
+  If \a initial parameter is not null string it is used as starting directory
+  at which dialog box is opened.
+  
+  The parameter \a caption is used as dialog box title. If it is
+  is empty, the default title is used.
+  
+  The parameter \a showQuickDir specifies if it is necessary to 
+  show additional quick directories list controls in the bottom part
+  of the dialog box.
+
+  The validation of the user selection is done with help of the file 
+  validator (SUIT_FileValidator class). The last parameter \a validator
+  can be used to pass the custom file validator to the dialog box.
+  
+  \param parent parent widget
+  \param initial initial directory dialog box to be opened on
+  \param caption dialog box title
+  \param showQuickDir if \c true the quick directory list widgets will be shown
+  \param validator custom file validator
+  \return selected directory name or null string if dialog box is cancelled
+  \sa getFileName(), getOpenFileNames()
+*/
+QString SUIT_FileDlg::getExistingDirectory( QWidget* parent, const QString& initial,
+                                            const QString& caption, const bool showQuickDir,
+                                           SUIT_FileValidator* validator )
+{
+  SUIT_FileDlg fd( parent, true, showQuickDir, true );
+
+  fd.setFileMode( DirectoryOnly );
+
   if ( !caption.isEmpty() )
-    fd->setCaption( caption );
-  if ( !initial.isEmpty() ) {
-    fd->processPath( initial ); // VSR 24/03/03 check for existing of directory has been added to avoid QFileDialog's bug
-  }
-  fd->setMode( DirectoryOnly );
-  fd->setFilters(tr("INF_DIRECTORIES_FILTER"));
-  fd->exec();
-  QString dirname = fd->selectedFile();
-  delete fd;
-  qApp->processEvents();
-  return dirname;
+    fd.setWindowTitle( caption );
+
+  if ( !initial.isEmpty() )
+    fd.processPath( initial );
   
+  if ( validator )
+    fd.setValidator( validator );
+
+  QString dirname;
+
+  if ( fd.exec() == QDialog::Accepted )
+    dirname = fd.selectedFile();
+
+  QApplication::processEvents();
+
+  return dirname;
 }
 
 /*!
-  QFileDialog::dirPath() has a bug on Linux Debian (1 level up from correct
-  directory is returned).  This function fixes the bug. 
+  \brief Get last visited path
+  \return last visited path
 */
-QString SUIT_FileDlg::dirPath() const
+QString SUIT_FileDlg::getLastVisitedPath()
 {
-  if ( !mySelectedFile.isNull() )
-    return QFileInfo( mySelectedFile ).dirPath();
+  return myLastVisitedPath;
+}
 
-  const QDir* aDir = dir();
-  if ( aDir->exists() )
-    return aDir->absPath();
+/*!
+  \brief Selects current file
+
+  This version of selectFile() methods works similar to Qt version 3.x:
+  it selects the given file as current and it changes the current file dialog's directory
+  to the directory of the file
   
-  return QFileDialog::dirPath();
+  \param f - new current file name 
+*/
+void SUIT_FileDlg::selectFile( const QString& f )
+{
+  QFileDialog::selectFile( QFileInfo( f ).baseName() );
+  setDirectory( QFileInfo( f ).absoluteDir() );
 }
index 04418800333ee7b1da6c509bb94efb98e91c840a..2e0d02d99f851edfe1a5e8673522282d0e85e84a 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#ifndef SUIT_FILEDIALOG_H
-#define SUIT_FILEDIALOG_H
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SUIT_FileDlg.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef SUIT_FILEDLG_H
+#define SUIT_FILEDLG_H
 
 #include "SUIT.h"
 
-#include <qfiledialog.h>
+#include <QFileDialog>
 
 class QLabel;
+class QLineEdit;
 class QComboBox;
 class QPushButton;
 class SUIT_FileValidator;
 
-/*! \class QFileDialog
- *  For more information see <a href="http://doc.trolltech.com">QT documentation</a>.
-*/
 class SUIT_EXPORT SUIT_FileDlg : public QFileDialog
 {
   Q_OBJECT
 
 public:
-  SUIT_FileDlg( QWidget*, bool open, bool showQuickDir = true, bool modal = true );
+  SUIT_FileDlg( QWidget*, bool, bool = true, bool = true );
   virtual ~SUIT_FileDlg();
 
-public:    
   bool                isOpenDlg()    const;    
-  QString             selectedFile() const;
+  
+  bool                checkPermissions() const;
+  void                setCheckPermissions( const bool );
 
+  SUIT_FileValidator* validator() const;
   void                setValidator( SUIT_FileValidator* );
 
-  QString             dirPath() const; // QFileDialog::dirPath() has a bug on Linux Debian (1 level up from correct 
-                                       // directory is returned).  This redefinition fixes the bug.  
+  bool                addWidgets( QWidget*, QWidget*, QWidget* );
 
-  static QString      getFileName( QWidget* parent, const QString& initial, const QStringList& filters, 
-                                  const QString& caption, const bool open, const bool showQuickDir = true,
-                                   SUIT_FileValidator* validator = 0 );
-  static QStringList  getOpenFileNames( QWidget* parent, const QString& initial, const QStringList& filters, 
-                                       const QString& caption, bool showQuickDir = true, 
-                                       SUIT_FileValidator* validator = 0 );
-  static QString      getExistingDirectory( QWidget* parent, const QString& initial,
-                                            const QString& caption, const bool showQuickDir = true );
+  QStringList         selectedFiles() const;
+  QString             selectedFile() const;
 
-public slots:
-  void                polish();
+  void selectFile( const QString& );
 
-private:
-  bool                acceptData();
-  void                addExtension();
-  bool                processPath( const QString& path );
+  static QString      getLastVisitedDirectory();
+
+  static QString      getFileName( QWidget*, 
+                                  const QString&, 
+                                  const QStringList&, 
+                                  const QString& = QString(), 
+                                  const bool = true, 
+                                  const bool = true,
+                                   SUIT_FileValidator* = 0 );
+  static QString      getFileName( QWidget*, 
+                                  const QString&, 
+                                  const QString&,
+                                  const QString& = QString(), 
+                                  const bool = true,
+                                  const bool = true,
+                                   SUIT_FileValidator* = 0 );
+
+  static QStringList  getOpenFileNames( QWidget*, 
+                                       const QString&,
+                                       const QStringList&, 
+                                       const QString& = QString(),
+                                       const bool = true, 
+                                       SUIT_FileValidator* = 0 );
+  static QStringList  getOpenFileNames( QWidget*, 
+                                       const QString&,
+                                       const QString&, 
+                                       const QString& = QString(),
+                                       const bool = true, 
+                                       SUIT_FileValidator* = 0 );
+
+  static QString      getExistingDirectory( QWidget*, 
+                                           const QString&,
+                                            const QString& = QString(), 
+                                           const bool = true,
+                                           SUIT_FileValidator* = 0 );
+
+  static QString      getLastVisitedPath();
+
+protected:
+  virtual bool        event( QEvent* );
+  QLineEdit*          lineEdit() const;
+  virtual bool        acceptData();
+  QString             addExtension( const QString& ) const;
+  bool                processPath( const QString& );
+  void                addFilter( const QString& );
+  static bool         hasWildCards( const QString& );
 
 protected slots:
   void                accept();        
-  void                reject(); 
   void                quickDir( const QString& );
   void                addQuickDir();
 
-protected:
-  bool                myOpen;             //!< open/save selector
-  QString             mySelectedFile;     //!< selected filename
+private:
+  void                polish();
+
+private:
   SUIT_FileValidator* myValidator;        //!< file validator
   QLabel*             myQuickLab;         //!< quick dir combo box
   QComboBox*          myQuickCombo;       //!< quick dir combo box
   QPushButton*        myQuickButton;      //!< quick dir add button
-  
-  /*! \var myAccepted
-   * \brief flag is used to warkaround the Qt 2.2.2
-   * \bug accept() method is called twice if user presses 'Enter' key 
-   * in file name editor while file name is not acceptable by acceptData()
-   * (e.g. permission denied)
-   */
-//  bool                myAccepted;
-  /*! ASL: this bug can be fixed with help of call setDefault( false ) 
-   *       and setAutoDefault( false ) methods for all QPushButtons of this dialog
-   */
-
+  bool                myCheckPermissions; //!< check permissions option
   static QString      myLastVisitedPath;  //!< last visited path
 };
 
-#endif
+#endif  // SUIT_FILEDLG_H
index ab09fc6654fa4b7a2959db6f92013e6c162fb4b9..d2afda00ed9c4f00d25d96294bfa3d0698eb7726 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SUIT_FileValidator.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : SUIT_FileValidator.cxx
-//  Module : SALOME
-//  $Header$
-
 #include "SUIT_FileValidator.h"
 #include "SUIT_MessageBox.h"
-#include "SUIT_Session.h"
+#include "SUIT_Tools.h"   
+#include <QFileInfo>
 
-#include <qfile.h>
-#include <qfileinfo.h>
+/*!
+  \class SUIT_FileValidator
+  \brief Provides functionality to check the file or directory
+  existance and permissions.
+  \sa SUIT_FileDlg class
+*/
 
-/*! constructor */
-SUIT_FileValidator::SUIT_FileValidator(QWidget* parent) :
-myParent(parent) 
+/*!
+  \brief Constructor.
+  \param parent parent widget (used as parent when displaying 
+  information message boxes)
+*/
+SUIT_FileValidator::SUIT_FileValidator( QWidget* parent )
+: myParent( parent ) 
 {
 }
   
-/*! returns false if can't open file */
-bool SUIT_FileValidator::canOpen( const QString& file ) 
+/*!
+  \brief Check if the specified file exists and (optionally) can be read.
+
+  If file does not exists or can not be read (if \a checkPermission is \c true)
+  and parent() is not null, shows error message box.
+
+  \param fileName file path
+  \param checkPermission if \c true (default) check also file permissions
+  \return \c false if file does not exist or if it does not have 
+  read permissions (if \a checkPermission is \c true)
+*/
+bool SUIT_FileValidator::canOpen( const QString& fileName, bool checkPermission ) 
 {
-  if ( !QFile::exists( file ) ) {
-    SUIT_MessageBox::error1( myParent,
-          QObject::tr( "ERR_ERROR" ),
-          QObject::tr( "ERR_FILE_NOT_EXIST" ).arg( file ),
-          QObject::tr( "BUT_OK" ) );
-      return false;
-    }
-  if ( !QFileInfo( file ).isReadable() ) {
-    SUIT_MessageBox::error1( myParent,
-          QObject::tr( "ERR_ERROR" ),
-          QObject::tr( "ERR_PERMISSION_DENIED" ).arg( file ),
-          QObject::tr( "BUT_OK" ) );
+  if ( !QFile::exists( fileName ) ) {
+    if ( parent() )
+      SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
+                                QObject::tr( "ERR_FILE_NOT_EXIST" ).arg( fileName ) );
+    return false;
+  }
+  if ( checkPermission && !QFileInfo( fileName ).isReadable() ) {
+    if ( parent() )
+      SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
+                                QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
     return false; 
   }
   return true;
 }
 
-/*! returns false if can't save file */
-bool SUIT_FileValidator::canSave( const QString& file ) 
+/*!
+  \brief Check if the specified file can be written.
+
+  If file already exists and parent() is not null, prompts
+  question message box to the user to confirm file overwriting.
+
+  If file can not be written (if \a checkPermission is \c true)
+  and parent() is not null, shows error message box.
+
+  \param fileName file path
+  \param checkPermission if \c true (default) check also file permissions
+  \return \c false if file exists and user rejects file overwriting 
+  or if file does not have write permissions (if \a checkPermission is \c true)
+*/
+bool SUIT_FileValidator::canSave( const QString& fileName, bool checkPermission ) 
 {
-  if ( QFile::exists( file ) ) {
-    // if file exists - raise warning...
-    if ( SUIT_MessageBox::warn2( myParent,
-              QObject::tr( "WRN_WARNING" ),
-              QObject::tr( "QUE_DOC_FILEEXISTS" ).arg( file ),
-              QObject::tr( "BUT_YES" ), 
-              QObject::tr( "BUT_NO" ),
-              SUIT_YES, 
-              SUIT_NO, 
-              SUIT_NO ) == SUIT_NO ) {
-      return false;
-    }
-    // ... and if user wants to overwrite file, check it for writeability
-    if ( !QFileInfo( file ).isWritable() ) {
-      SUIT_MessageBox::error1( myParent,
-            QObject::tr( "ERR_ERROR" ),
-            QObject::tr( "ERR_PERMISSION_DENIED" ).arg( file ),
-            QObject::tr( "BUT_OK" ) );
+  if ( QFile::exists( fileName ) ) {
+    if ( parent() )
+      if ( SUIT_MessageBox::question( parent(), QObject::tr( "WRN_WARNING" ),
+                                     QObject::tr( "QUE_DOC_FILEEXISTS" ).arg( fileName ),
+                                     SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                     SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
+       return false;
+    
+    if ( checkPermission && !QFileInfo( fileName ).isWritable() ) {
+      if ( parent() ) 
+       SUIT_MessageBox::critical( myParent, QObject::tr( "ERR_ERROR" ),
+                                  QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
       return false; 
     }
   }
   else {
-    // if file doesn't exist - try to create it
-    QFile qf( file );
-    if ( !qf.open( IO_WriteOnly ) ) {
-      SUIT_MessageBox::error1( myParent,
-            QObject::tr( "ERR_ERROR" ),
-            QObject::tr( "ERR_PERMISSION_DENIED" ).arg( file ),
-            QObject::tr( "BUT_OK" ) );
+    QString dirName = SUIT_Tools::dir( fileName );
+    if ( checkPermission && !QFileInfo( dirName ).isWritable() ) {
+      if ( parent() )
+       SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
+                                  QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
       return false;
     }
-    else {
-      // remove just created file
-      qf.close();
-      qf.remove();
-    }
   }
   return true;
 }
 
+/*!
+  \brief Check if the specified directory exists and (optionally) can be read.
+
+  If directory does not exists or can not be read (if \a checkPermission is \c true)
+  and parent() is not null, shows error message box.
+
+  \param dirName directory path
+  \param checkPermission if \c true (default) check also directory permissions
+  \return \c false if directory does not exist or if it does not have 
+  read permissions (if \a checkPermission is \c true)
+*/
+bool SUIT_FileValidator::canReadDir( const QString& dirName, bool checkPermission )
+{
+  QFileInfo info( dirName );
+  if ( !info.exists() ) {
+    if ( parent() )
+      SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
+                                QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
+    return false;
+  }
+  if ( !info.isDir() ) {
+    if ( parent() )
+      SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
+                                QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) );
+    return false;
+  }
+  if ( checkPermission && !info.isReadable() ) {
+    if ( parent() )
+      SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
+                                QObject::tr( "ERR_PERMISSION_DENIED" ).arg( dirName ) );
+    return false; 
+  }
+  return true;
+}
+
+/*!
+  \brief Check if the specified directory can be written.
+
+  If directory does not exists or can not be modified (if \a checkPermission is \c true)
+  and parent() is not null, shows error message box.
+
+  \param dirName directory path
+  \param checkPermission if \c true (default) check also directory permissions
+  \return \c false if directory does not exist or if it does not have 
+  write permissions (if \a checkPermission is \c true)
+*/
+bool SUIT_FileValidator::canWriteDir( const QString& dirName, bool checkPermission )
+{
+  QFileInfo info( dirName );
+  if ( !info.exists() ) {
+    if ( parent() )
+      SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
+                                QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
+    return false;
+  }
+  if ( !info.isDir() ) {
+    if ( parent() )
+      SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
+                                QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) );
+    return false;
+  }
+  if ( checkPermission && !info.isWritable() ) {
+    if ( parent() )
+      SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
+                                QObject::tr( "ERR_PERMISSION_DENIED" ).arg( dirName ) );
+    return false; 
+  }
+  return true;
+}
+
+/*!
+  \brief Get parent widget.
+  \return parent widget
+*/
+QWidget* SUIT_FileValidator::parent() const
+{ 
+  return myParent; 
+}
index 197f6a2abd853637bc86771f6c8f815d3ed7a374..2f1c06ae842fda8bcc0c224062b520becc00dd21 100755 (executable)
@@ -1,50 +1,50 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SUIT_FileValidator.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : SUIT_FileValidator.h
-//  Module : SALOME
-
 #ifndef SUIT_FILEVALIDATOR_H
 #define SUIT_FILEVALIDATOR_H
 
-#include <qwidget.h>
 #include "SUIT.h"
 
-/*!
-  \class SUIT_FileValidator
-  Provides functionality to check file
-*/
+class QWidget;
+class QString;
+
 class SUIT_EXPORT SUIT_FileValidator
 {
 public:
-  SUIT_FileValidator(QWidget* parent = 0);
+  SUIT_FileValidator( QWidget* = 0 );
   
-  virtual bool    canOpen( const QString& file );
-  virtual bool    canSave( const QString& file );
+  virtual bool    canOpen( const QString&, bool = true );
+  virtual bool    canSave( const QString&, bool = true );
 
-  //! Return parent widget
-  QWidget*        parent() const { return myParent; }
-  
- private:
+  virtual bool    canReadDir( const QString&, bool = true );
+  virtual bool    canWriteDir( const QString&, bool = true );
+
+  QWidget*        parent() const;
   
+private:
   QWidget*        myParent;
 };
 
-#endif
+#endif // SUIT_FILEVALIDATOR_H
diff --git a/src/SUIT/SUIT_LicenseDlg.cxx b/src/SUIT/SUIT_LicenseDlg.cxx
new file mode 100755 (executable)
index 0000000..08358f5
--- /dev/null
@@ -0,0 +1,217 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "SUIT_LicenseDlg.h"
+
+#include <QApplication>
+#include <QTextEdit>
+#include <QLayout> 
+#include <QPushButton>
+#include <QTextStream> 
+#include <QFile>
+#include <QPrinter>
+//#include <QSimpleRichText>
+#include <QTextDocument>
+#include <QPainter>
+
+#include <math.h>
+
+#ifdef WIN32
+#include <UserEnv.h>
+#endif
+
+
+/*!
+  Constructor
+  Construct a dialog with specified parent and name.
+  \param modal define modal status of dialog (default modal dialog created).
+*/
+SUIT_LicenseDlg::SUIT_LicenseDlg( bool firstShow, QWidget* parent, const char* name, bool modal )
+ : QDialog( parent )
+{
+  setObjectName( name );
+  setModal( modal );
+  QString env;
+  if ( ::getenv( "TRIPOLI_ROOT_DIR" ) )
+    env = ::getenv( "TRIPOLI_ROOT_DIR" );
+  QFile file( env + "/share/salome/resources/License.txt" ); // Read the text from a file
+  
+  if ( !file.exists() || !file.open( QIODevice::ReadOnly ) )
+    return;
+  
+  setWindowTitle( tr( "License" ) );
+  
+  // Create text editor
+  myTextEdit = new QTextEdit( this );
+  QTextStream stream( &file );
+  myTextEdit->setText( stream.readAll() );
+  file.close();
+  myTextEdit->setReadOnly( true );
+  //myTextEdit->ensureVisible(0, 0);
+  
+  // Create buttons
+  QPushButton* anAgreeBtn = new QPushButton( tr( "Agree" ), this );
+  if (firstShow) {
+    anAgreeBtn->setAutoDefault( true );
+    anAgreeBtn->setFocus();
+  }
+  else
+    anAgreeBtn->hide();
+  QPushButton* aCancelBtn = new QPushButton( this );
+  aCancelBtn->setText( firstShow ? tr( "Cancel" ) : tr( "Close" ) );
+  if ( !firstShow )
+    aCancelBtn->setFocus();
+
+  QPushButton* aPrintBtn = new QPushButton( tr( "Print..." ), this );
+
+  // Layouting
+  QVBoxLayout* aBaseLayout = new QVBoxLayout( this );
+  aBaseLayout->setMargin( 5 );
+  aBaseLayout->setSpacing( 5 );
+  aBaseLayout->addWidget( myTextEdit );
+  
+  QHBoxLayout* aButtonsLayout = new QHBoxLayout();
+  aBaseLayout->addLayout( aButtonsLayout );
+  if (firstShow)
+    aButtonsLayout->addWidget( anAgreeBtn );
+  
+  aButtonsLayout->addWidget( aCancelBtn );
+  aButtonsLayout->addStretch();
+  aButtonsLayout->addWidget( aPrintBtn );
+  // Connections
+  connect( anAgreeBtn, SIGNAL( clicked() ), this, SLOT( onAgree( ) ) );
+  connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( onCancel( ) ) );
+  connect( aPrintBtn,  SIGNAL( clicked() ), this, SLOT( onPrint( ) ) );
+  
+  resize( 640, 480 );
+}
+
+/*!
+       Name: ~SUIT_LicenseDlg [public]
+       Desc: Destructor
+*/
+
+SUIT_LicenseDlg::~SUIT_LicenseDlg()
+{
+}
+
+void SUIT_LicenseDlg::onAgree()
+{
+  QString env;
+#ifdef WIN32
+    DWORD aLen=1024;
+  char aStr[1024];
+  HANDLE aToken=0;
+  HANDLE hProcess = GetCurrentProcess();
+  OpenProcessToken(hProcess,TOKEN_QUERY,&aToken);
+  if( ! GetUserProfileDirectory( aToken, aStr, &aLen ) )
+    reject();
+
+  env = aStr;
+#else
+  if( ! ::getenv( "HOME" ) )
+    reject();
+  env = ::getenv( "HOME" );
+#endif
+  QFile file( env + "/ReadLicense.log" ); // Read the text from a file
+
+  file.open( QIODevice::WriteOnly );
+
+  QTextStream ts( &file );
+  ts << "OK" << endl;
+  //file.writeBlock( "OK", (Q_ULONG)qstrlen( "OK" ) );
+  file.close();
+
+  accept();
+}
+
+void SUIT_LicenseDlg::onCancel()
+{
+  reject();
+}
+
+void SUIT_LicenseDlg::onPrint()
+{
+  QPrinter aPrinter( QPrinter::HighResolution );
+  aPrinter.setFullPage(true);
+  
+  if ( true /*aPrinter.pageSetup( this )*/ ) {
+    QPainter aPainter( &aPrinter );
+    if( !aPainter.isActive() ) // starting printing failed
+      return;
+        
+    // define fonts
+    QFont aBodyFont = myTextEdit->currentFont();
+    QFont aFooterFont = aBodyFont;
+
+    // calculate margin
+    QPaintDevice* aMetrics = aPainter.device();
+    int aDpiY = aMetrics->logicalDpiY();
+    int aMargin = (int) ( (2/2.54)*aDpiY ); // 2 cm margins
+
+    QRect aBody( aMargin, aMargin, aMetrics->width() - 2*aMargin, aMetrics->height() - 2*aMargin );
+
+    // convert text to rich text format
+    QString aFormattedText = Qt::convertFromPlainText( myTextEdit->toPlainText() );
+       
+    QTextDocument aRichText( aFormattedText );
+    aRichText.setDefaultFont( aBodyFont );
+
+
+    /*QSimpleRichText aRichText( aFormattedText,
+                              aBodyFont,
+                              myTextEdit->context(),
+                              myTextEdit->styleSheet(),
+                              myTextEdit->mimeSourceFactory(),
+                              aBody.height() );
+    */
+    aRichText.setPageSize( QSize( aBody.width(), aRichText.pageSize().height() ) );
+       //aRichText.setWidth( &aPainter, aBody.width() );
+    
+    QRect aView( aBody );
+    
+    int aPageIndex = 1;
+    
+    do {
+      // print page text
+      aRichText.drawContents( &aPainter, aView );
+         //aRichText.draw( &aPainter, aBody.left(), aBody.top(), aView, colorGroup() );
+      aView.translate( 0, aBody.height() );
+      aPainter.translate( 0 , -aBody.height() );
+      
+      // print page number
+      aPainter.setPen(Qt::gray);
+      aPainter.setFont(aFooterFont);
+      QString aFooter = QString("Page ") + QString::number(aPageIndex);
+      aPainter.drawText( aView.right() - aPainter.fontMetrics().width( aFooter ),
+                        aView.bottom() + aPainter.fontMetrics().ascent() + 5, aFooter );
+      
+      if ( aView.top() >= aRichText.size().height() )
+       break;
+      aPrinter.newPage();
+      aPageIndex++;
+    } while (true);
+  }
+}
diff --git a/src/SUIT/SUIT_LicenseDlg.h b/src/SUIT/SUIT_LicenseDlg.h
new file mode 100755 (executable)
index 0000000..cc9e79f
--- /dev/null
@@ -0,0 +1,54 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef SUIT_LICENSEDLG_H
+#define SUIT_LICENSEDLG_H
+
+#include "SUIT.h"
+
+#include <QDialog>
+class QTextEdit;
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+class SUIT_EXPORT SUIT_LicenseDlg :public QDialog
+{
+  Q_OBJECT
+public:
+  SUIT_LicenseDlg( bool firstShow = true, QWidget* = 0, const char* = 0, bool = true );
+  virtual ~SUIT_LicenseDlg();
+
+private slots:
+    void             onAgree();
+    void             onCancel();
+    void             onPrint();
+
+private:
+    QTextEdit* myTextEdit; 
+};
+
+#ifdef WIN32
+#pragma warning( default:4251 )
+#endif
+
+#endif
index e80ff74f04ae6a3b65b36242688e8ef03f6d46b5..46dfe4f730160a5f9ab58f263a187e416a0424c5 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "SUIT_MessageBox.h"
+
+#include "SUIT_OverrideCursor.h"
+
+#include <QMessageBox>
+#include <QPushButton>
+#include <QApplication>
+#include <QString>
+
+#include <stdarg.h>
 
 /*!
-  \class:   SUIT_MessageBox
-  Message dialog box for SUIT-based application
-  Module:  SUIT
-  Created: UI team, 02.10.00
+  \class SUIT_MessageBox
+  \brief Message dialog box for SUIT-based application
+
+  The class provides a modal dialog with a short message, an icon, 
+  and buttons laid out depending on the current style.
+  
+  Message boxes are used to provide informative messages and to ask 
+  simple questions.
+
+  The easiest way to pop up a message box is to call one of the static
+  functions information(), question(), critical(), and warning().
+
+  The class provides the static functions to show message boxes with
+  standard buttons (like \c Ok, \c Cancel, \c Apply, \c Close, \c Yes, 
+  \c No, \c Abort, \c Retry, etc). These methods accept ORed buttons
+  flags as one of the parameters. The buttons layouting type and order
+  is system-dependant and defined by the current style. In addition,
+  these methods allow to define default button (where input focus is
+  set by default and which is clicked when user presses \c Enter key).
+
+  Another set of static functions allows to show message boxes with 
+  up to four user-defined buttons. It is possible to define default 
+  and escape buttons using additional parameters.
+
+  And finally, the last group of static functions allow displaying
+  the message boxes with an arbitrary number of buttons.
+
+  For example:
+  \code
+  // show question message box with two standard buttons
+  int result = SUIT_MessageBox::question(desktop(), "Error",
+                                         "File already exists? Overwrite?",
+                                        SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                        SUIT_MessageBox::No );
+  if ( result == SUIT_MessageBox::Yes )
+    overwriteFileFunction();
+
+  // show critical message box with user-defined buttons
+  // default is second button and escape is third button
+  int result = SUIT_MessageBox::critical(desktop(), "Hazard!",
+                                         "The situation is critical! What to do?",
+                                        "Hide", "Run Away", "Stand still", 1, 2);
+  switch ( result )
+  {
+  case 0:
+    hideMyself(); break;
+  case 1:
+    runAwayFromHere(); break;
+  case 2:
+    sitDownAndPray(); break;
+  default:
+    break;
+  }
+
+  // show message box with 6 buttons
+  // both default and escape buttons are set to first button ("Zero")
+  int result = SUIT_MessageBox::information(desktop(), "Question",
+                                            "Select your favourite number",
+                                           0, 0,
+                                           "Zero", "One", "Two", "Three", "Four", "Five");
+  useMyFavouriteNumberSomewhere( result );
+  \endcode
 */
 
-#include "SUIT_MessageBox.h"
-#include "SUIT_OverrideCursor.h"
+/*!
+  \brief Constructor.
+  \param parent parent widget
+*/
+SUIT_MessageBox::SUIT_MessageBox( QWidget* parent )
+: QMessageBox( parent )
+{
+}
 
-#include <qmessagebox.h>
-#include <qapplication.h>
+/*!
+  \brief Constructor.
+  \param icon message box icon (QMessageBox::Icon)
+  \param title message box title
+  \param text message box text
+  \param buttons ORed message box standard buttons (QMessageBox::StandardButton)
+  \param parent parent widget
+  \param f window flags
+*/
+SUIT_MessageBox::SUIT_MessageBox( Icon icon, const QString& title, const QString& text,
+                                  StandardButtons buttons, QWidget* parent, Qt::WindowFlags f )
+: QMessageBox( icon, title, text, buttons, parent, f )
+{
+}
 
 /*!
-    Shows info message box with one button [ static ]
+  \brief Destructor.
 */
-int SUIT_MessageBox::info1( QWidget* parent, 
-                           const QString& caption, 
-                           const QString& text,
-                           const QString& textButton0 )
+SUIT_MessageBox::~SUIT_MessageBox()
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-  int ret = QMessageBox::information( parent, caption, text, textButton0,
-                                     QString::null, QString::null, 0, 0 );
-  qApp->processEvents();
-  return ret;
 }
 
 /*!
-    Shows warning message box with one button [ static ]
+  \brief Get the standard button text.
+  \param btn standard button id
+  \return button text
 */
-int SUIT_MessageBox::warn1( QWidget* parent, 
-                           const QString& caption, 
-                           const QString& text,
-                           const QString& textButton0 )
+QString SUIT_MessageBox::buttonText( StandardButton btn ) const
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-  int ret = QMessageBox::warning( parent, caption, text, textButton0,
-                                 QString::null, QString::null, 0, 0 );
-  qApp->processEvents();
-  return ret;
+  QString res;
+  QAbstractButton* b = button( btn );
+  if ( b )
+    res = b->text();
+  return res;
 }
 
 /*!
-    Shows error message box with one button [ static ]
+  \brief Set the standard button text.
+  \param btn standard button id
+  \param text new button text
 */
-int SUIT_MessageBox::error1( QWidget* parent, 
-                            const QString& caption,
-                            const QString& text,
-                            const QString& textButton0 )
+void SUIT_MessageBox::setButtonText( StandardButton btn, const QString& text )
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-  int ret = QMessageBox::critical( parent, caption, text, textButton0,
-                                  QString::null, QString::null, 0, 0 );
-  qApp->processEvents();
-  return ret;
+  QAbstractButton* b = button( btn );
+  if ( b )
+    b->setText( text );
 }
 
 /*!
-    Shows question message box with one button [ static ]
+  \brief Show critical message box with specified standard buttons.
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param buttons ORed message box buttons (QMessageBox::StandardButton)
+  \param defaultButton default button (QMessageBox::StandardButton)
+  \return button id clicked by the user (QMessageBox::StandardButton)
 */
-int SUIT_MessageBox::question1( QWidget* parent, 
-                               const QString& caption,
-                               const QString& text, 
-                               const QString& textButton0 )
+SUIT_MessageBox::StandardButton SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
+                                                           StandardButtons buttons, StandardButton defaultButton )
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-  int ret = QMessageBox::question( parent, caption, text, textButton0,
-                                  QString::null, QString::null, 0, 0 );
-  qApp->processEvents();
-  return ret;
+  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::ArrowCursor );
+  return QMessageBox::critical( parent, title, text, buttons, defaultButton );
 }
 
 /*!
-    Shows info message box with two buttons.
-    Returns id of the pressed button or -1 if escaped [ static ]
+  \brief Show warning message box with specified standard buttons.
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param buttons ORed message box buttons (QMessageBox::StandardButton)
+  \param defaultButton default button (QMessageBox::StandardButton)
+  \return button id clicked by the user (QMessageBox::StandardButton)
 */
-int SUIT_MessageBox::info2( QWidget* parent, 
-                           const QString& caption,
-                           const QString& text, 
-                           const QString& textButton0,
-                           const QString& textButton1, 
-                           int idButton0, int idButton1, int idDefault )
+SUIT_MessageBox::StandardButton SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
+                                                          SUIT_MessageBox::StandardButtons buttons, StandardButton defaultButton )
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-  if ( idDefault == idButton0 )
-    idDefault = 0;
-  else if ( idDefault == idButton1 )
-    idDefault = 1;
-  else
-    idDefault = 0;
-  
-  int ret = QMessageBox::information( parent, caption, text, textButton0,
-                                     textButton1, QString::null, idDefault );
-  qApp->processEvents();
-  return ( ret == 0 ? idButton0 : idButton1 );
+  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::ArrowCursor );
+  return QMessageBox::warning( parent, title, text, buttons, defaultButton );
 }
 
 /*!
-  Shows warning message box with two buttons.
-    Returns id of the pressed button or -1 if escaped [ static ]
+  \brief Show information message box with specified standard buttons.
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param buttons ORed message box buttons (QMessageBox::StandardButton)
+  \param defaultButton default button (QMessageBox::StandardButton)
+  \return button id clicked by the user (QMessageBox::StandardButton)
 */
-int SUIT_MessageBox::warn2( QWidget* parent, 
-                           const QString& caption,
-                           const QString& text,
-                           const QString& textButton0, 
-                           const QString& textButton1,
-                           int idButton0, int idButton1, int idDefault )
+SUIT_MessageBox::StandardButton SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
+                                                              StandardButtons buttons, StandardButton defaultButton )
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-  
-  if ( idDefault == idButton0 )
-    idDefault = 0;
-  else if ( idDefault == idButton1 )
-    idDefault = 1;
-  else
-    idDefault = 0;
-  
-  int ret = QMessageBox::warning( parent, caption, text, textButton0,
-                                 textButton1, QString::null, idDefault );
-  qApp->processEvents();
-  return ( ret == 0 ? idButton0 : idButton1 );
+  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::ArrowCursor );
+  return QMessageBox::information( parent, title, text, buttons, defaultButton );
 }
 
 /*!
-    Shows error message box with two buttons
-    Returns id of the pressed button or -1 if escaped [ static ]
+  \brief Show question message box with specified standard buttons.
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param buttons ORed message box buttons (QMessageBox::StandardButton)
+  \param defaultButton default button (QMessageBox::StandardButton)
+  \return button id clicked by the user (QMessageBox::StandardButton)
 */
-int SUIT_MessageBox::error2( QWidget* parent, 
-                            const QString& caption, 
-                            const QString& text,
-                            const QString& textButton0, 
-                            const QString& textButton1,
-                            int idButton0, int idButton1, int idDefault )
+SUIT_MessageBox::StandardButton SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
+                                                           StandardButtons buttons, StandardButton defaultButton )
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-  
-  if ( idDefault == idButton0 )
-    idDefault = 0;
-  else if ( idDefault == idButton1 )
-    idDefault = 1;
-  else
-    idDefault = 0;
-  
-  int ret = QMessageBox::critical( parent, caption, text, textButton0,
-                                  textButton1, QString::null, idDefault );
-  qApp->processEvents();
-  return ( ret == 0 ? idButton0 : idButton1 );
+  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::ArrowCursor );
+  return QMessageBox::question( parent, title, text, buttons, defaultButton );
 }
 
 /*!
-    Shows question message box with two buttons
-    Returns id of the pressed button or -1 if escaped [ static ]
+  \brief Show critical message box with one custom button.
+
+  Specified button becomes "default" button and "escape" button, i.e.
+  pressing \c Return or \c Enter and \c Escape keys is equivalent to clicking
+  this button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button button text
+  \return button id clicked by the user (QMessageBox::StandardButton)
 */
-int SUIT_MessageBox::question2( QWidget* parent, 
-                               const QString& caption, 
-                               const QString& text,
-                               const QString& textButton0, 
-                               const QString& textButton1,
-                               int idButton0, int idButton1, int idDefault )
+int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
+                              const QString& button )
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-  
-  if ( idDefault == idButton0 )
-    idDefault = 0;
-  else if ( idDefault == idButton1 )
-    idDefault = 1;
-  else
-    idDefault = 0;
+  ButtonInfos lst;
+  lst.append( ButtonInfo( 0, button ) );
+  return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst );
+}
+
+/*!
+  \brief Show warning message box with one custom button.
   
-  int ret = QMessageBox::question( parent, caption, text, textButton0,
-                                  textButton1, QString::null, idDefault );
-  qApp->processEvents();
-  return ( ret == 0 ? idButton0 : idButton1 );
+  Specified button becomes "default" button and "escape" button, i.e.
+  pressing \c Return or \c Enter and \c Escape keys is equivalent to clicking
+  this button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button button text
+  \return button id clicked by the user (QMessageBox::StandardButton)
+*/
+int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
+                             const QString& button )
+{
+  ButtonInfos lst;
+  lst.append( ButtonInfo( 0, button ) );
+  return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst );
 }
 
 /*!
-    Shows info message box with three buttons.
-    Returns id of the pressed button or -1 if escaped [ static ]
+  \brief Show information message box with one custom button.
+
+  Specified button becomes "default" button and "escape" button, i.e.
+  pressing \c Return or \c Enter and \c Escape keys is equivalent to clicking
+  this button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button button text
+  \return button id clicked by the user (QMessageBox::StandardButton)
 */
-int SUIT_MessageBox::info3( QWidget* parent, 
-                           const QString& caption,
-                           const QString& text,
-                           const QString& textButton0, 
-                           const QString& textButton1,
-                           const QString& textButton2, 
-                           int idButton0, int idButton1,
-                           int idButton2, int idDefault )
+int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button )
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-  
-  if ( idDefault == idButton0 )
-    idDefault = 0;
-  else if ( idDefault == idButton1 )
-    idDefault = 1;
-  else if ( idDefault == idButton2 )
-    idDefault = 2;
-  else
-    idDefault = 0;
-  
-  int ret = QMessageBox::information( parent, caption, text, textButton0,
-                                     textButton1, textButton2, idDefault );
-  qApp->processEvents();
-  switch ( ret )
-    {
-    case 0:
-      return idButton0;
-    case 1:
-      return idButton1;
-    case 2:
-      return idButton2;
-    }
-  return -1;
+  ButtonInfos lst;
+  lst.append( ButtonInfo( 0, button ) );
+  return messageBox( SUIT_MessageBox::Information, parent, title, text, lst );
+}
+
+/*!
+  \brief Show question message box with one custom button.
+
+  \warning This function does not make a lot of sense because it provides
+  message box with only one  button, i.e. it is impossible to give several
+  answers for the question (at least 'yes'/'no').
+  This function is implemented only for completeness.
+
+  Specified button becomes "default" button and "escape" button, i.e.
+  pressing \c Return or \c Enter and \c Escape keys is equivalent to clicking
+  this button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button button text
+  \return button id clicked by the user (QMessageBox::StandardButton)
+*/
+int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
+                              const QString& button )
+{
+  ButtonInfos lst;
+  lst.append( ButtonInfo( 0, button ) );
+  return messageBox( SUIT_MessageBox::Question, parent, title, text, lst );
 }
 
 /*!
-    Shows warning message box with three buttons.
-    Returns id of the pressed button or -1 if escaped [ static ]
+  \brief Show critical message box with two custom buttons.
+
+  Parameters \a button1 and \a button2 specify the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the second one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
 */
-int SUIT_MessageBox::warn3( QWidget* parent, 
-                           const QString& caption, 
-                           const QString& text,
-                           const QString& textButton0, 
-                           const QString& textButton1,
-                           const QString& textButton2, 
-                           int idButton0, int idButton1,
-                           int idButton2, int idDefault )
+int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
+                              const QString& button1, const QString& button2,
+                              const int defaultButton, const int escapeButton )
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-  
-  if ( idDefault == idButton0 )
-    idDefault = 0;
-  else if ( idDefault == idButton1 )
-    idDefault = 1;
-  else if ( idDefault == idButton2 )
-    idDefault = 2;
-  else
-    idDefault = 0;
-  
-  int ret = QMessageBox::warning( parent, caption, text, textButton0,
-                                 textButton1, textButton2, idDefault );
-  qApp->processEvents();
-  switch ( ret )
-    {
-    case 0:
-      return idButton0;
-    case 1:
-      return idButton1;
-    case 2:
-      return idButton2;
-    }
-  return -1;
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst, 
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show warning message box with two custom buttons.
+
+  Parameters \a button1 and \a button2 specify the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the second one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
+*/
+int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
+                             const QString& button1, const QString& button2,
+                             const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst, 
+                    defaultButton, escapeButton );
 }
 
 /*!
-    Shows error message box with three buttons.
-    Returns id of the pressed button or -1 if escaped [ static ]
+  \brief Show information message box with two custom buttons.
+
+  Parameters \a button1 and \a button2 specify the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the second one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
 */
-int SUIT_MessageBox::error3( QWidget* parent, 
-                            const QString& caption, 
-                            const QString& text,
-                            const QString& textButton0, 
-                            const QString& textButton1,
-                            const QString& textButton2, 
-                            int idButton0, int idButton1,
-                            int idButton2, int idDefault )
+int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button1, const QString& button2,
+                                 const int defaultButton, const int escapeButton )
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-  
-  if ( idDefault == idButton0 )
-    idDefault = 0;
-  else if ( idDefault == idButton1 )
-    idDefault = 1;
-  else if ( idDefault == idButton2 )
-    idDefault = 2;
-  else
-    idDefault = 0;
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  return messageBox( SUIT_MessageBox::Information, parent, title, text, lst, 
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show question message box with two custom buttons.
+
+  Parameters \a button1 and \a button2 specify the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the second one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
+*/
+int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
+                              const QString& button1, const QString& button2,
+                              const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  return messageBox( SUIT_MessageBox::Question, parent, title, text, lst, 
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show critical message box with three custom buttons.
+
+  Parameters \a button1, \a button2 and \a button3 specify the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param button3 third button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
+*/
+int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
+                              const QString& button1, const QString& button2, 
+                              const QString& button3,
+                              const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  lst.append( ButtonInfo( id++, button3 ) );
+  return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst, 
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show warning message box with three custom buttons.
+
+  Parameters \a button1, \a button2 and \a button3 specify the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param button3 third button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
+*/
+int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
+                             const QString& button1, const QString& button2,
+                             const QString& button3,
+                             const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  lst.append( ButtonInfo( id++, button3 ) );
+  return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst, 
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show information message box with three custom buttons.
+
+  Parameters \a button1, \a button2 and \a button3 specify the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param button3 third button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
+*/
+int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button1, const QString& button2,
+                                 const QString& button3,
+                                 const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  lst.append( ButtonInfo( id++, button3 ) );
+  return messageBox( SUIT_MessageBox::Information, parent, title, text, lst, 
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show question message box with three custom buttons.
+
+  Parameters \a button1, \a button2 and \a button3 specify the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param button3 third button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
+*/
+int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
+                              const QString& button1, const QString& button2,
+                              const QString& button3,
+                              const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  lst.append( ButtonInfo( id++, button3 ) );
+  return messageBox( SUIT_MessageBox::Question, parent, title, text, lst, 
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show critical message box with four custom buttons.
+
+  Parameters \a button1, \a button2, \a button3 and \a button4 specify 
+  the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param button3 third button text
+  \param button4 fourth button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
+*/
+int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
+                              const QString& button1, const QString& button2, 
+                              const QString& button3, const QString& button4,
+                              const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  lst.append( ButtonInfo( id++, button3 ) );
+  lst.append( ButtonInfo( id++, button4 ) );
+  return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst, 
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show warning message box with four custom buttons.
+
+  Parameters \a button1, \a button2, \a button3 and \a button4 specify 
+  the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param button3 third button text
+  \param button4 fourth button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
+*/
+int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
+                             const QString& button1, const QString& button2, 
+                             const QString& button3, const QString& button4,
+                             const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  lst.append( ButtonInfo( id++, button3 ) );
+  lst.append( ButtonInfo( id++, button4 ) );
+  return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst, 
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show information message box with four custom buttons.
+
+  Parameters \a button1, \a button2, \a button3 and \a button4 specify 
+  the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param button3 third button text
+  \param button4 fourth button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
+*/
+int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button1, const QString& button2, 
+                                 const QString& button3, const QString& button4,
+                                 const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  lst.append( ButtonInfo( id++, button3 ) );
+  lst.append( ButtonInfo( id++, button4 ) );
+  return messageBox( SUIT_MessageBox::Information, parent, title, text, lst, 
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show question message box with four custom buttons.
+
+  Parameters \a button1, \a button2, \a button3 and \a button4 specify 
+  the buttons text.
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param button1 first button text
+  \param button2 second button text
+  \param button3 third button text
+  \param button4 fourth button text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
+*/
+int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
+                              const QString& button1, const QString& button2, 
+                              const QString& button3, const QString& button4,
+                              const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  lst.append( ButtonInfo( id++, button1 ) );
+  lst.append( ButtonInfo( id++, button2 ) );
+  lst.append( ButtonInfo( id++, button3 ) );
+  lst.append( ButtonInfo( id++, button4 ) );
+  return messageBox( SUIT_MessageBox::Question, parent, title, text, lst, 
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show critical message box with arbitrary number of user-specified
+         buttons.
+
+  The function accepts arbitrary number of parameters. Each parameter starting
+  from \a btn should be of type const char* to specify the button text.
+  After the last button parameter and additional 0 (zero) value should be 
+  specified.
   
-  int ret = QMessageBox::critical( parent, caption, text, textButton0,
-                                  textButton1, textButton2, idDefault );
-  qApp->processEvents();
-  switch ( ret )
-    {
-    case 0:
-      return idButton0;
-    case 1:
-      return idButton1;
-    case 2:
-      return idButton2;
-    }
-  return -1;
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \param btn first button text
+  \return button used button id
+*/
+int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text, 
+                              const int defaultButton, const int escapeButton, 
+                              char* btn, ... )
+{
+  va_list args;
+  va_start( args, btn );
+  return messageBox( SUIT_MessageBox::Critical, parent, title, text,
+                     messageList( btn, args ),
+                    defaultButton, escapeButton );
 }
 
 /*!
-    Shows question message box with three buttons.
-    Returns id of the pressed button or -1 if escaped [ static ]
+  \brief Show warning message box with arbitrary number of user-specified
+         buttons.
+
+  The function accepts arbitrary number of parameters. Each parameter starting
+  from \a btn should be of type const char* to specify the button text.
+  After the last button parameter and additional 0 (zero) value should be 
+  specified.
+  
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \param btn first button text
+  \return button used button id
 */
-int SUIT_MessageBox::question3( QWidget* parent, 
-                               const QString& caption, 
-                               const QString& text,
-                               const QString& textButton0, 
-                               const QString& textButton1,
-                               const QString& textButton2, 
-                               int idButton0, int idButton1,
-                               int idButton2, int idDefault )
+int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text, 
+                             const int defaultButton, const int escapeButton, 
+                             char* btn, ... )
 {
-  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+  va_list args;
+  va_start( args, btn );
+  return messageBox( SUIT_MessageBox::Warning, parent, title, text,
+                     messageList( btn, args ),
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show information message box with arbitrary number of user-specified
+         buttons.
+
+  The function accepts arbitrary number of parameters. Each parameter starting
+  from \a btn should be of type const char* to specify the button text.
+  After the last button parameter and additional 0 (zero) value should be 
+  specified.
   
-  if ( idDefault == idButton0 )
-    idDefault = 0;
-  else if ( idDefault == idButton1 )
-    idDefault = 1;
-  else if ( idDefault == idButton2 )
-    idDefault = 2;
-  else
-    idDefault = 0;
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \param btn first button text
+  \return button used button id
+*/
+int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text, 
+                                 const int defaultButton, const int escapeButton, 
+                                 char* btn, ... )
+{
+  va_list args;
+  va_start( args, btn );
+  return messageBox( SUIT_MessageBox::Information, parent, title, text,
+                     messageList( btn, args ),
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show question message box with arbitrary number of user-specified
+         buttons.
+
+  The function accepts arbitrary number of parameters. Each parameter starting
+  from \a btn should be of type const char* to specify the button text.
+  After the last button parameter and additional 0 (zero) value should be 
+  specified.
   
-  int ret = QMessageBox::question( parent, caption, text, textButton0,
-                                  textButton1, textButton2, idDefault );
-  qApp->processEvents();
-  switch ( ret )
-    {
-    case 0:
-      return idButton0;
-    case 1:
-      return idButton1;
-    case 2:
-      return idButton2;
-    }
-  return -1;
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \param btn first button text
+  \return button used button id
+*/
+int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text, 
+                              const int defaultButton, const int escapeButton, 
+                              char* btn, ... )
+{
+  va_list args;
+  va_start( args, btn );
+  return messageBox( SUIT_MessageBox::Question, parent, title, text,
+                     messageList( btn, args ),
+                    defaultButton, escapeButton );
+}
+
+/*!
+  \brief Parse arbitrary arguments list.
+
+  The last parameter in a sequence should be 0 (zero) value.
+
+  \param txt first argument which starts arbitrary sequence
+  \param args arguments list from the stack
+  \return list of buttons infos
+*/
+SUIT_MessageBox::ButtonInfos SUIT_MessageBox::messageList( char* txt, va_list& args )
+{
+  int i = 0;
+  ButtonInfos lst;
+  char* cur = txt;
+  while ( cur )
+  {
+    lst.append( ButtonInfo( i++, cur ) );
+    cur = va_arg( args, char* );
+  }
+
+  va_end( args );
+
+  return lst;
 }
+
+/*!
+  \brief Create and show the message box.
+  \param icon icon type
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param lst list of buttons infos
+  \param defaultButton default button
+  \param escapeButton escape button
+  \return button used button id
+*/
+int SUIT_MessageBox::messageBox( Icon icon, QWidget* parent, 
+                                const QString& title, const QString& text, 
+                                const ButtonInfos& lst, 
+                                const int defaultButton, 
+                                const int escapeButton )
+{
+  SUIT_MessageBox msgBox( icon, title, text, NoButton, parent );
+
+  QMap<QAbstractButton*, int> bm;
+  for ( int i = 0; i < lst.count(); i++ )
+  {
+    int btn         = lst[i].id();
+    QString txt     = lst[i].text();
+    ButtonRole role = lst[i].role();
+
+    QPushButton* pb = msgBox.addButton( txt, role );
+    bm.insert( pb, btn );
+
+    if ( defaultButton == -1 && i == 0 || btn == defaultButton )
+      msgBox.setDefaultButton( pb );
+    if ( escapeButton == -1 && i == lst.count() - 1 || btn == escapeButton )
+      msgBox.setEscapeButton( pb );
+  }
+    
+  SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::ArrowCursor );
+
+  int res = msgBox.exec();
+  if ( res != -1 )
+    res = bm[msgBox.clickedButton()];
+
+  QApplication::processEvents();
+
+  return res;
+}
+
index 24b350605f06d5d5e6ef0c1b7a144df2e2a3056c..6fb2e5164811aee3ecd22e46291bfcc8f9d09642 100755 (executable)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef SUIT_MESSAGEBOX_H
 #define SUIT_MESSAGEBOX_H
 
 #include "SUIT.h"
 
-#include <qstring.h>
-#include <qwidget.h>
-
-#define SUIT_OK                      1
-#define SUIT_CANCEL                  2
-#define SUIT_YES                     3
-#define SUIT_NO                      4
-#define SUIT_HELP                    5
+#include <QMap>
+#include <QList>
+#include <QMessageBox>
 
-/*!
-  \class SUIT_MessageBox
-  \brief Message dialog box for SUIT-based application
-*/
-class SUIT_EXPORT SUIT_MessageBox
+class SUIT_EXPORT SUIT_MessageBox : public QMessageBox
 {
 public:
-    
-    /** @name One button message boxes.*/
-    //@{
-    static int info1 ( QWidget* parent, const QString& caption, const QString& text,
-                       const QString& textButton0 );
-    static int warn1 ( QWidget* parent, const QString& caption, const QString& text,
-                       const QString& textButton0 );
-    static int error1 ( QWidget* parent, const QString& caption, const QString& text,
-                       const QString& textButton0 );
-    static int question1 ( QWidget* parent, const QString& caption, const QString& text,
-                          const QString& textButton0 );
-    //@}
+  // construction/destruction
+  SUIT_MessageBox( QWidget* = 0 );
+  SUIT_MessageBox( Icon, const QString&, const QString&, StandardButtons buttons = NoButton,
+                   QWidget* = 0, Qt::WindowFlags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint );
+  ~SUIT_MessageBox();
+
+  // customize the standard buttons text
+  QString               buttonText( StandardButton ) const;
+  void                  setButtonText( StandardButton, const QString& );
+
+  // message box with standard buttons
+  static StandardButton critical( QWidget* parent, const QString& title, const QString& text,
+                                  StandardButtons buttons = Ok, StandardButton defaultButton = NoButton );
+  static StandardButton warning( QWidget* parent, const QString& title, const QString& text,
+                                 StandardButtons buttons = Ok, StandardButton defaultButton = NoButton );
+  static StandardButton information( QWidget* parent, const QString& title, const QString& text,
+                                     StandardButtons buttons = Ok, StandardButton defaultButton = NoButton );
+  static StandardButton question( QWidget* parent, const QString& title, const QString& text,
+                                  StandardButtons buttons = Ok, StandardButton defaultButton = NoButton );
+  
+  // message boxes with one custom button
+  static int            critical( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button );
+  static int            warning( QWidget* parent, const QString& title, const QString& text,
+                                const QString& button );
+  static int            information( QWidget* parent, const QString& title, const QString& text,
+                                    const QString& button );
+  static int            question( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button );
+
+  // message boxes with two custom buttons
+  static int            critical( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button1, const QString& button2, 
+                                 const int defaultButton = -1, const int escapeButton = -1 );
+  static int            warning( QWidget* parent, const QString& title, const QString& text,
+                                const QString& button1, const QString& button2, 
+                                const int defaultButton = -1, const int escapeButton = -1 );
+  static int            information( QWidget* parent, const QString& title, const QString& text,
+                                    const QString& button1, const QString& button2, 
+                                    const int defaultButton = -1, const int escapeButton = -1 );
+  static int            question( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button1, const QString& button2, 
+                                 const int defaultButton = -1, const int escapeButton = -1 );
+  
+  // message boxes with three custom buttons
+  static int            critical( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button1, const QString& button2, const QString& button3,
+                                 const int defaultButton = -1, const int escapeButton = -1 );
+  static int            warning( QWidget* parent, const QString& title, const QString& text,
+                                const QString& button1, const QString& button2, const QString& button3,
+                                const int defaultButton = -1, const int escapeButton = -1 );
+  static int            information( QWidget* parent, const QString& title, const QString& text,
+                                    const QString& button1, const QString& button2, const QString& button3,
+                                    const int defaultButton = -1, const int escapeButton = -1 );
+  static int            question( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button1, const QString& button2, const QString& button3,
+                                 const int defaultButton = -1, const int escapeButton = -1 );
+  
+  // message boxes with four custom buttons
+  static int            critical( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button1, const QString& button2,
+                                 const QString& button3, const QString& button4,
+                                 const int defaultButton = -1, const int escapeButton = -1 );
+  static int            warning( QWidget* parent, const QString& title, const QString& text,
+                                const QString& button1, const QString& button2,
+                                const QString& button3, const QString& button4,
+                                const int defaultButton = -1, const int escapeButton = -1 );
+  static int            information( QWidget* parent, const QString& title, const QString& text,
+                                    const QString& button1, const QString& button2,
+                                    const QString& button3, const QString& button4,
+                                    const int defaultButton = -1, const int escapeButton = -1 );
+  static int            question( QWidget* parent, const QString& title, const QString& text,
+                                 const QString& button1, const QString& button2,
+                                 const QString& button3, const QString& button4,
+                                 const int defaultButton = -1, const int escapeButton = -1 );
+  
+  // message boxes with arbitrary number of buttons
+  static int            critical( QWidget* parent, const QString& title, const QString& text, 
+                                 const int defaultButton, const int escapeButton, 
+                                 char*, ... );
+  static int            warning( QWidget* parent, const QString& title, const QString& text,
+                                const int defaultButton, const int escapeButton, 
+                                char*, ... );
+  static int            information( QWidget* parent, const QString& title, const QString& text,
+                                    const int defaultButton, const int escapeButton, 
+                                    char*, ... );
+  static int            question( QWidget* parent, const QString& title, const QString& text,
+                                 const int defaultButton, const int escapeButton, 
+                                 char*, ... );
+
+private:
+  class ButtonInfo
+  {
+  public:
+    ButtonInfo( const int id, 
+               const QString& text, 
+               const ButtonRole role = ActionRole )
+      : myId( id ), myText( text ), myRole( role ) {}
+    int        id()   const { return myId;   }
+    QString    text() const { return myText; }
+    ButtonRole role() const { return myRole; }
+  private:
+    int        myId;      //!< button id
+    QString    myText;    //!< button text
+    ButtonRole myRole;    //!< button role
+  };
 
-    /** @name Two buttons message boxes.*/
-    //@{
-    static int info2 ( QWidget* parent, const QString& caption, const QString& text,
-                       const QString& textButton0, const QString& textButton1,
-                       int idButton0, int idButton1, int idDefault );
-    static int warn2 ( QWidget* parent, const QString& caption, const QString& text,
-                       const QString& textButton0, const QString& textButton1,
-                       int idButton0, int idButton1, int idDefault );
-    static int error2 ( QWidget* parent, const QString& caption, const QString& text,
-                       const QString& textButton0, const QString& textButton1,
-                       int idButton0, int idButton1, int idDefault );
-    static int question2 ( QWidget* parent, const QString& caption, const QString& text,
-                          const QString& textButton0, const QString& textButton1,
-                          int idButton0, int idButton1, int idDefault );
-    //@}
+  typedef QList<ButtonInfo> ButtonInfos;
 
-    /** @name Three buttons message boxes.*/
-    //@{
-    static int info3 ( QWidget* parent, const QString& caption, const QString& text,
-                       const QString& textButton0, const QString& textButton1,
-                       const QString& textButton2, int idButton0, int idButton1,
-                       int idButton2, int idDefault );
-    static int warn3 ( QWidget* parent, const QString& caption, const QString& text,
-                       const QString& textButton0, const QString& textButton1,
-                       const QString& textButton2, int idButton0, int idButton1,
-                       int idButton2, int idDefault );
-    static int error3 ( QWidget* parent, const QString& caption, const QString& text,
-                       const QString& textButton0, const QString& textButton1,
-                       const QString& textButton2, int idButton0, int idButton1,
-                       int idButton2, int idDefault );
-    static int question3 ( QWidget* parent, const QString& caption, const QString& text,
-                          const QString& textButton0, const QString& textButton1,
-                          const QString& textButton2, int idButton0, int idButton1,
-                          int idButton2, int idDefault );
-    //@}
+private:
+  static int          messageBox( SUIT_MessageBox::Icon icon, QWidget* parent, 
+                                 const QString& title, const QString& text, 
+                                 const ButtonInfos& lst, 
+                                 const int defaultButton = -1, 
+                                 const int escapeButton  = -1 );
+  static ButtonInfos  messageList( char*, va_list& );
 };
 
 #endif
diff --git a/src/SUIT/SUIT_MsgDlg.cxx b/src/SUIT/SUIT_MsgDlg.cxx
deleted file mode 100644 (file)
index b19372c..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File   : SUIT_MsgDlg.cxx
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-
-#include "SUIT_MsgDlg.h"
-
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-
-/*!
-  \class SUIT_MsgDlg
-  \brief Information message dialog box with custom number of buttons.
-
-  The class provides a functionality to display message box with the custom number
-  of buttons. Each button is identified by the unique non-zero number which can 
-  be tested after dialog box finishes its execution. Pressing each button except
-  causes dialog box to finish execution with return status equal to the button
-  identifier. In addition, pressing "Cancel" button finishes dialog box execution
-  wih return status 0.
-
-  It is also possible to display custom pixmap or icon at the left side of the
-  dialog box. Pass the required pixmap to the constructor or use method setPixmap().
-
-  The typical usage of the dialog box:
-  \code
-  SUIT_MsgDlg dlg( this, tr( "Warning!" ), 
-                   tr( "File %s exists. Overwrite?" ).arg( files[i] ),
-                  QMessageBox::standardIcon( QMessageBox::Warning ) );
-  dlg.addButton( "Yes", YesId );
-  dlg.addButton( "No", NoId );
-  dlg.addButton( "Yes to all", YesAllId );
-  dlg.addButton( "No to all", NoAllId );
-  int ret = dlg.exec();
-  switch( ret ) {
-  case YesId:
-    // process one file
-    processOneFile();
-    break;
-  case NoId:
-    // skip current file processing and proceed to the next file
-    break;
-  case YesAllId:
-    // process all files
-    processAllFiles();
-    stopped = true;
-    break;
-  case NoAllId:
-    // skip all process all files
-    processAllFiles();
-    break;
-  default:
-    // operation is cancelled
-    break;
-  }
-  \endcode
-
-  \sa addButton(), setPixmap()
-*/
-
-/*!
-  \brief Constructor.
-  \param parent parent widget
-  \param title dialog box caption
-  \param msg dialog box message
-  \param icon dialog box icon
-*/
-SUIT_MsgDlg::SUIT_MsgDlg( QWidget*       parent, 
-                         const QString& title, 
-                         const QString& msg, 
-                         const QPixmap& icon )
-: QDialog ( parent, "SUIT_MsgDlg", true )
-{
-  // title
-  setCaption( title );
-  
-  // icon
-  myIconLab = new QLabel( this );
-  myIconLab->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
-  myIconLab->setScaledContents( false );
-  myIconLab->setAlignment( Qt::AlignCenter );
-
-  if ( !icon.isNull() )
-    myIconLab->setPixmap( icon );
-
-  // info message
-  myMsgLab = new QLabel( msg, this );
-  myMsgLab->setTextFormat( Qt::RichText );
-  myMsgLab->setAlignment( Qt::AlignCenter );
-  
-  // Buttons
-  myButtonLayout = new QHBoxLayout(); 
-  myButtonLayout->setMargin( 0 ); 
-  myButtonLayout->setSpacing( 6 );
-
-  // <Cancel>
-  QPushButton* cancelBtn = new QPushButton( tr( "CANCEL" ), this );
-  myButtonLayout->addSpacing( 20 );
-  myButtonLayout->addStretch();
-  myButtonLayout->addWidget( cancelBtn );
-
-  QGridLayout* layout = new QGridLayout( this ); 
-  layout->setMargin( 11 );
-  layout->setSpacing( 6 );
-
-  layout->addWidget( myIconLab, 0, 0 );
-  layout->addWidget( myMsgLab,  0, 1 );
-  layout->addMultiCellLayout( myButtonLayout, 1, 1, 0, 1 );
-
-  // signals and slots connections
-  connect( cancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
-}
-
-/*!
-  \brief Destructor.
-*/
-SUIT_MsgDlg::~SUIT_MsgDlg()
-{
-}
-
-/*!
-  \brief Add operation button to the dialog box.
-
-  If the parameter \a id is equal to -1, then the 
-  button identifier is generated automatically.
-
-  \param btext button text
-  \param id button identifier
-  \return button identifier
-*/
-int SUIT_MsgDlg::addButton( const QString& btext, const int id )
-{
-  static int lastId = 0;
-  int bid = id == -1 ? --lastId : id;
-
-  QPushButton* b = button( bid );
-  if ( b ) {
-    myButtons.remove( b );
-    delete b;
-  }
-
-  QPushButton* newButton = new QPushButton( btext, this );
-
-  myButtonLayout->insertWidget( myButtons.count(), newButton );
-  myButtons.insert( newButton, bid );
-  connect( newButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
-
-  return bid;
-}
-
-/*!
-  \brief Set icon to the dialog box
-  \param icon pixmap
-*/
-void SUIT_MsgDlg::setPixmap( const QPixmap& icon )
-{
-  myIconLab->setPixmap( icon );
-}
-
-
-/*!
-  \brief Called when any dialog button (except \c Cancel) 
-  is clicked.
-  
-  Closes the dialog and sets its result code to the identifier
-  of the button clicked by the user.
-*/
-void SUIT_MsgDlg::accept()
-{
-  QPushButton* btn = ( QPushButton* )sender();
-  done( myButtons[ btn ] );
-}
-
-/*!
-  \brief Search button with the specified identifier.
-  \param id button identifier
-  \return button or 0 if \a id is invalid
-*/
-QPushButton* SUIT_MsgDlg::button( const int id ) const
-{
-  QPushButton* btn = 0;
-  for ( ButtonMap::ConstIterator it = myButtons.begin(); 
-       it != myButtons.end() && !btn; ++it ) {
-    if ( it.data() == id )
-      btn = it.key();
-  }
-  return btn;
-}
-
-/*!
-  \brief Get information icon label.
-  \return information icon label
-*/
-QLabel* SUIT_MsgDlg::iconLabel() const
-{
-  return myIconLab;
-}
-
-/*!
-  \brief Get information message label.
-  \return information message label
-*/
-QLabel* SUIT_MsgDlg::messageLabel() const
-{
-  return myMsgLab;
-}
diff --git a/src/SUIT/SUIT_MsgDlg.h b/src/SUIT/SUIT_MsgDlg.h
deleted file mode 100644 (file)
index e7f0e81..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File   : SUIT_MsgDlg.h
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-
-#ifndef SUIT_MSGDLG_H
-#define SUIT_MSGDLG_H
-
-#include "SUIT.h"
-
-#include <qdialog.h> 
-#include <qpixmap.h>
-#include <qmap.h>
-
-class QLabel;
-class QPushButton;
-class QHBoxLayout;
-
-class SUIT_EXPORT SUIT_MsgDlg : public QDialog
-{
-  Q_OBJECT
-
-public:
-  SUIT_MsgDlg( QWidget*, const QString&, const QString&, const QPixmap& = QPixmap() ) ;
-  ~SUIT_MsgDlg();
-
-  int  addButton( const QString&, const int = -1);
-  void setPixmap( const QPixmap& );
-
-public slots:
-  void accept();
-
-protected:
-  QPushButton* button( const int ) const;
-  QLabel*      iconLabel() const;
-  QLabel*      messageLabel() const;
-
-private:
-  typedef QMap<QPushButton*,int> ButtonMap;
-
-private:
-  ButtonMap    myButtons;
-  QHBoxLayout* myButtonLayout;
-  QLabel*      myIconLab;
-  QLabel*      myMsgLab;
-};
-
-#endif // SUIT_MSGDLG_H
-
index 2df0b7d240840c03341269ffbc4a5eb911c49406..3088a5c4f2cab1aa6c92073f37e618153e0d379f 100755 (executable)
@@ -1,37 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
-/*!
-  SALOME SalomeApp
-
-  Copyright (C) 2005  CEA/DEN, EDF R&D
-
-  File   : SUIT_Operation.h
-  Author : Unknown
-  Module : SALOME
-*/
-
 #include "SUIT_Operation.h"
 
 #include "SUIT_Study.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_MessageBox.h"
 #include "SUIT_Application.h"
 
 /*!
@@ -46,9 +36,9 @@
 SUIT_Operation::SUIT_Operation( SUIT_Application* app )
 : QObject(),
 myApp( app ),
+myFlags( Transaction ),
 myStudy( 0 ),
-myState( Waiting ),
-myFlags( Transaction )
+myState( Waiting )
 {
 }
 
@@ -166,7 +156,7 @@ bool SUIT_Operation::testFlags( const int f ) const
 */
 QString SUIT_Operation::operationName() const
 {
-  return QString::null;
+  return QString();
 }
 
 /*!
index 3d15f058c5774367fd2f3bb050f13898519e4357..1137949c46bbc731c3598238509fcd13ddd9c796 100755 (executable)
@@ -1,29 +1,31 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef SUIT_OPERATION_H
 #define SUIT_OPERATION_H
 
 #include "SUIT.h"
 
-#include <qobject.h>
-#include <qguardedptr.h>
+#include <QObject>
+#include <QPointer>
 
 class SUIT_Study;
 class SUIT_Application;
@@ -107,6 +109,8 @@ public:
 
   virtual QString   operationName() const;
 
+  int               execStatus() const;
+
 signals:
   void              started( SUIT_Operation* );
   void              aborted( SUIT_Operation* );
@@ -138,9 +142,8 @@ protected:
   virtual bool      openTransaction();
   virtual bool      abortTransaction();
   virtual bool      hasTransaction() const;
-  virtual bool      commitTransaction( const QString& = QString::null );
+  virtual bool      commitTransaction( const QString& = QString() );
 
-  int               execStatus() const;
   void              setExecStatus( const int );
 
   void              setState( const OperationState );
@@ -148,7 +151,7 @@ protected:
   void              start( SUIT_Operation*, const bool = false );
 
 private:
-  typedef QGuardedPtr<SUIT_Study> StudyPtr;
+  typedef QPointer<SUIT_Study> StudyPtr;
 
 private:
   SUIT_Application* myApp;        //!< application for this operation
index 0dab97a5869350a9bf4a9bc67885fb13d4ea5c70..d5718b729a5a050fc86484e84e630c3d3c25e8aa 100755 (executable)
@@ -1,23 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_OverrideCursor.h"
 
+#include <QApplication>
+
 /*!Constructor. Initialize wait cursor.*/
 SUIT_OverrideCursor::SUIT_OverrideCursor()
 {
@@ -61,7 +66,7 @@ void SUIT_OverrideCursor::resume()
   if ( isActive() )
     return;
 
-  for ( QValueList<QCursor>::const_iterator it = myCursors.begin(); it != myCursors.end(); ++it )
+  for ( QList<QCursor>::const_iterator it = myCursors.begin(); it != myCursors.end(); ++it )
     QApplication::setOverrideCursor( *it );
 
   myCursors.clear();
index ee89235d6105dc09f2c2bb53329505ba05af7e77..95e56c1afc98ebe136217865c7e97027ae0c1c96 100755 (executable)
@@ -1,29 +1,32 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_OVERRIDECURSOR_H
 #define SUIT_OVERRIDECURSOR_H
 
-#include <qapplication.h>
-#include <qcursor.h>
-
 #include "SUIT.h"
 
+#include <QList>
+#include <QCursor>
+
 /*! \brief Class used for management cursors.*/
 class SUIT_EXPORT SUIT_OverrideCursor
 {
@@ -37,7 +40,7 @@ public:
   void resume();
 
 private:
-  QValueList<QCursor> myCursors;
+  QList<QCursor> myCursors;
 };
 
 #endif
diff --git a/src/SUIT/SUIT_ParserSettings.cxx b/src/SUIT/SUIT_ParserSettings.cxx
deleted file mode 100755 (executable)
index fa3768f..0000000
+++ /dev/null
@@ -1,341 +0,0 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : SUIT_ParserSettings.cxx
-//  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-
-#include "SUIT_ParserSettings.h"
-
-#include <stdio.h>
-
-// QT Includes
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qtextstream.h>
-
-
-/*! Constructor. Do nothing.*/
-SUIT_ParserSettings::SUIT_ParserSettings()
-{
-}
-
-
-/*!
-    Destructor. Do nothing.
-*/
-SUIT_ParserSettings::~SUIT_ParserSettings()
-{
-}
-
-
-/*!
-    Gets the contents of a file.
-*/
-QString SUIT_ParserSettings::getContents(QString fileName, bool comments,
-                                       bool sections, bool whiteSpace,
-                                       bool htmlComments)
-{
-  QFileInfo fi(fileName);
-  QFile f(fi.absFilePath());
-  QString s="";                   // Buffer for the whole file
-
-  if(f.open(IO_ReadOnly)) {       // file opened successfully
-    QTextStream t(&f);            // use a text stream
-
-    s = t.read();                 // The whole file in a string
-    f.close();
-
-    if(!comments)     s = SUIT_ParserSettings::removeComments(s);
-    if(!sections)     s = SUIT_ParserSettings::removeSections(s);
-    if(!whiteSpace)   s = s.simplifyWhiteSpace();
-    if(!htmlComments) s = SUIT_ParserSettings::removeHtmlComments(s);
-  }
-  else {
-    // Can't open file
-  }
-
-  return s;
-}
-
-
-/*!
-    Gets the body of a section from a string.
-*/
-QString SUIT_ParserSettings::getSection(QString s, QString sectionName)
-{
-  QString result="";
-
-  QChar ch;                     // A single byte of the file
-  int bracketCounter=1;         // Bracket counter (increase on '{' and decrese on '}'.
-  int i;                        // Current index
-  int l=0;                      // Length of current part we must have
-
-  if((i=s.find(sectionName, 0, false)) >= 0 &&       // Jump to section [styles]
-     (i=s.find('{', i))                >= 0    ) {
-
-    ++i;
-
-    while(i+l<(int)s.length()) {
-      ch = s.at(i+l);           // Single byte
-
-      ++l;
-
-      if(ch=='{') ++bracketCounter;
-      if(ch=='}') --bracketCounter;
-
-      if(bracketCounter==0) break;
-    }
-
-    result = s.mid(i, l-1);
-  }
-
-  return result;
-}
-
-
-
-/*!
-    Gets the HTML comments out of a file.
-*/
-QString SUIT_ParserSettings::getHtmlComment(QString s)
-{
-  QString result="";
-  int length;              // length of the sub string
-  int ind=0;
-
-  if((ind =s.find("<!--", ind))>=0 &&
-     (ind+=4) &&
-     (length=s.find("-->",  ind)-ind)!=0) {
-
-    result=s.mid(ind, length-3);
-  }
-
-  return result;
-}
-
-
-
-/*! 
-    Gets the next String between two given characters. The index-parameter gets moved to the character after
-    the stopper or to -1 if the starter / stopper were not found.
-*/
-QString SUIT_ParserSettings::getNextStringBetween(QString s, int& startIndex, 
-                                                QChar starter, QChar stopper)
-{
-  QString result="";
-  int length=0;              // length of the sub string
-
-  if((startIndex =s.find(starter, startIndex))>=0 &&
-     (length=s.find(stopper, startIndex+1)-startIndex)!=0) {
-
-    result=s.mid(startIndex+1, length-1);
-    startIndex+=2;
-  }
-
-  return result;
-}
-
-
-/*!
-    Gets the next String between the given index and a given stopper character. The index-parameter gets moved to
-    the character after the stopper or to -1 if the stopper was not found.
-*/
-QString SUIT_ParserSettings::getNextStringUntil(QString s, int& startIndex, QChar stopper)
-{
-  QString result="";
-  int length;              // length of the sub string
-
-  if((length=s.find(stopper, startIndex)-startIndex)!=0) {
-    result=s.mid(startIndex, length);
-    startIndex++;
-  }
-
-  return result;
-}
-
-
-/*!
-    Removes all comments (between '/ *' and '* /').
-*/
-QString SUIT_ParserSettings::removeComments(QString s)
-{
-  QString result="";
-  int i1=0, i2;
-
-  while((i2=s.find("/*", i1))>=0) {
-    result += s.mid(i1, i2-i1);
-
-    i1+=2;
-    i1=s.find("*/", i1);
-    i1+=2;
-  }
-
-  result += s.mid(i1, s.length()-i1);
-
-  return result;
-}
-
-
-
-/*!
-    Removes all HTML comments (between '<!--' and '-->') \image html html_comments.gif
-*/
-QString SUIT_ParserSettings::removeHtmlComments(QString s)
-{
-  QString result="";
-  int i1=0, i2;
-
-  while((i2=s.find("<!--", i1))>=0) {
-    result += s.mid(i1, i2-i1);
-
-    i1+=4;
-    i1=s.find("-->", i1);
-    i1+=3;
-  }
-
-  result += s.mid(i1, s.length()-i1);
-
-  return result;
-}
-
-
-
-/*!
-    Removes all sections ('[section] { }').
-*/
-QString SUIT_ParserSettings::removeSections(QString s)
-{
-  QString result="";
-
-  QChar ch;                     // A single byte of the file
-  int bracketCounter;           // Bracket counter (increase on '{' and decrese on '}'.
-  int i=0;                      // Current index
-
-  while(i<(int)s.length()) {
-    ch = s.at(i);           // Single byte
-
-    if(ch=='[') {
-      bracketCounter=1;
-      while(i<(int)s.length() && ch!=']') { ch = s.at(i); ++i; }
-      ++i;
-      while(i<(int)s.length() && ch!='{') { ch = s.at(i); ++i; }
-      ++i;
-
-      while(i<(int)s.length() && bracketCounter!=0) {
-        ch = s.at(i);
-        if(ch=='{') ++bracketCounter;
-        if(ch=='}') --bracketCounter;
-        ++i;
-      }
-      ++i;
-    }
-    else {
-      result+=ch;
-    }
-
-    ++i;
-  }
-
-  return result;
-}
-
-
-/*!
-    Format plain text into HTML-code with a given maximal width.
-    Spaces get replaced with non breaking spaces. Tabulators get filled up
-    with non breaking spaces.
-*/
-QString SUIT_ParserSettings::plainTextToHtml(QString s, int autoBreak)
-{
-  QString result="\n";
-
-  if(!s.isEmpty()) {
-    int col=1, i;
-
-    for(i=0; i<(int)s.length(); ++i) {
-      // Line feed:
-      //
-      if(s[i]=='\n') {
-        result+="<BR>\n";
-        col=1;
-      }
-
-      // Auto break:
-      //
-      else if(col==autoBreak && autoBreak!=0) {
-        result+="<BR>\n";
-        result+=s[i];
-        col=1;
-      }
-
-      // Tab:
-      //
-      else if(s[i]=='\t') {
-        while(col%8!=0) { result+="&nbsp;"; ++col; }
-        result+="&nbsp;";
-        ++col;
-      }
-
-      // Space:
-      //
-      else if(s[i]==' ') {
-        result+="&nbsp;";
-        ++col;
-      }
-
-      // Normal char / special code:
-      //
-      else {
-        if(s[i].isLetter() || s[i].isNumber()) {
-          result+=s[i];
-        }
-        else {
-          result+=charToHtml(s[i]);
-        }
-        ++col;
-      }
-    }
-
-    result+="\n";
-  }
-
-  return result;
-}
-
-
-/*!
-    Converts a special character to html code (e.g.: '»' to "&#187;")
-*/
-QString SUIT_ParserSettings::charToHtml(QChar c)
-{
-  QString s;
-  QString uc;
-  uc.setNum(c.unicode());
-  s = "&#" + uc + ";";
-  return s;
-}
-
-
-// EOF
diff --git a/src/SUIT/SUIT_ParserSettings.h b/src/SUIT/SUIT_ParserSettings.h
deleted file mode 100755 (executable)
index 16d74a2..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : SUIT_ParserSettings.h
-//  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-
-#ifndef SUIT_PARSERSETTINGS_H
-#define SUIT_PARSERSETTINGS_H
-
-#include <qstring.h>
-#include "SUIT.h"
-/*! \brief Text Parser.*/
-class SUIT_EXPORT SUIT_ParserSettings
-{
-public:
-  SUIT_ParserSettings();
-  ~SUIT_ParserSettings();
-
-  static QString getContents(QString fileName, bool comments=true, 
-                            bool sections=true, bool whitespace=true, 
-                            bool htmlComments=true);
-  static QString getSection(QString s, QString sectionName);
-  static QString getHtmlComment(QString s);
-  static QString getNextStringBetween(QString s, int& startIndex, QChar starter, QChar stopper);
-  static QString getNextStringUntil(QString s, int& startIndex, QChar stopper);
-  static QString removeComments(QString s);
-  static QString removeHtmlComments(QString s);
-  static QString removeSections(QString s);
-  static QString plainTextToHtml(QString s, int autoBreak);
-  static QString charToHtml(QChar c);
-
-};
-
-#endif
index fd2c40d9f2ba5a4aab87ee626a3c074b1183fd4f..5f79a5352c5096dbcd358beee877bb1cfccf13ca 100644 (file)
@@ -1,25 +1,26 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_PopupClient.h"
 
-#include <qevent.h>
-
 /*! constructor. initialize mySignal.*/
 SUIT_PopupClient::SUIT_PopupClient()
 : mySignal( 0 )
index f65bc9f1245c92a7ac7bb6f67ca22326b8913671..eab6c722326650df16b3bc383f5c132f10cb91fb 100644 (file)
@@ -1,29 +1,32 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_POPUPCLIENT_H
 #define SUIT_POPUPCLIENT_H
 
 #include "SUIT.h"
 
-#include <qobject.h>
+#include <QObject>
 
-class QPopupMenu;
+class QMenu;
 class QContextMenuEvent;
 
 /*!\class SUIT_PopupClient
@@ -42,7 +45,7 @@ public:
   bool            disconnectPopupRequest( QObject* reciever, const char* slot );
 
   virtual QString popupClientType() const = 0;
-  virtual void    contextMenuPopup( QPopupMenu* ) {}
+  virtual void    contextMenuPopup( QMenu* ) {}
 
 protected:
   void    contextMenuRequest( QContextMenuEvent* e );
diff --git a/src/SUIT/SUIT_PreferenceMgr.cxx b/src/SUIT/SUIT_PreferenceMgr.cxx
new file mode 100644 (file)
index 0000000..512fdaf
--- /dev/null
@@ -0,0 +1,171 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      SUIT_PreferenceMgr.cxx
+// Author:    Sergey TELKOV
+//
+#include "SUIT_PreferenceMgr.h"
+
+SUIT_PreferenceMgr::SUIT_PreferenceMgr( QtxResourceMgr* resMgr, QWidget* parent )
+: QtxPagePrefMgr( resMgr, parent ),
+myRoot( 0 )
+{
+}
+
+SUIT_PreferenceMgr::~SUIT_PreferenceMgr()
+{
+}
+
+QIcon SUIT_PreferenceMgr::itemIcon( const int id ) const
+{
+  const QtxPreferenceItem* item = 0;
+  if ( id == -1 )
+    item = this;
+  else
+    item = findItem( id, true );
+  return item ? item->icon() : QIcon();
+}
+
+void SUIT_PreferenceMgr::setItemIcon( const int id, const QIcon& ico )
+{
+  QtxPreferenceItem* item = id == -1 ? this : findItem( id, true );
+  if ( item )
+    item->setIcon( ico );
+}
+
+QVariant SUIT_PreferenceMgr::itemProperty( const QString& prop, const int id ) const
+{
+  const QtxPreferenceItem* item = 0;
+  if ( id == -1 )
+    item = this;
+  else
+    item = findItem( id, true );
+  return item ? item->option( prop ) : QVariant();
+}
+
+void SUIT_PreferenceMgr::setItemProperty( const QString& prop, const QVariant& val, const int id )
+{
+  QtxPreferenceItem* item = id == -1 ? this : findItem( id, true );
+  if ( item )
+    item->setOption( prop, val );
+}
+
+int SUIT_PreferenceMgr::addItem( const QString& title, const int pId,
+                                 const SUIT_PreferenceMgr::PrefItemType type,
+                                 const QString& sect, const QString& param )
+{
+  QtxPreferenceItem* parent = pId == -1 ? this : findItem( pId, true );
+
+  if ( !parent )
+    return -1;
+
+  QtxPreferenceItem* item = parent->findItem( title, true );
+
+  if ( item && item->depth() < 5 )
+    return item->id();
+
+  if ( pId == -1 )
+  {
+    if ( !myRoot )
+      myRoot = new QtxPagePrefListItem( QString( "root" ), this );
+    parent = myRoot;
+  }
+
+  switch( type )
+  {
+  case Auto:
+    switch ( parent->depth() )
+    {
+    case 1:
+      item = new QtxPagePrefTabsItem( title, parent, sect, param );
+      break;
+    case 2:
+      item = new QtxPagePrefFrameItem( title, parent, sect, param );
+      break;
+    case 3:
+      item = new QtxPagePrefGroupItem( title, parent, sect, param );
+      break;
+    }
+    break;
+  case Space:
+    item = new QtxPagePrefSpaceItem( parent );
+    break;
+  case Bool:
+    item = new QtxPagePrefCheckItem( title, parent, sect, param );
+    break;
+  case Color:
+    item = new QtxPagePrefColorItem( title, parent, sect, param );
+    break;
+  case String:
+    item = new QtxPagePrefEditItem( QtxPagePrefEditItem::String, title, parent, sect, param );
+    break;
+  case Selector:
+    item = new QtxPagePrefSelectItem( title, parent, sect, param );
+    break;
+  case DblSpin:
+    item = new QtxPagePrefSpinItem( QtxPagePrefSpinItem::Double, title, parent, sect, param );
+    break;
+  case IntSpin:
+    item = new QtxPagePrefSpinItem( QtxPagePrefSpinItem::Integer, title, parent, sect, param );
+    break;
+  case Double:
+    item = new QtxPagePrefEditItem( QtxPagePrefEditItem::Double, title, parent, sect, param );
+    break;
+  case Integer:
+    item = new QtxPagePrefEditItem( QtxPagePrefEditItem::Integer, title, parent, sect, param );
+    break;
+  case GroupBox:
+    item = new QtxPagePrefGroupItem( title, parent, sect, param );
+    break;
+  case Tab:
+    item = new QtxPagePrefTabsItem( title, parent, sect, param );
+    break;
+  case Frame:
+    item = new QtxPagePrefFrameItem( title, parent, sect, param );
+    break;
+  case Font:
+    item = new QtxPagePrefFontItem( title, parent, sect, param );
+    break;
+  case File:
+    item = new QtxPagePrefPathItem( Qtx::PT_OpenFile, title, parent, sect, param );
+    break;
+  case DirList:
+    item = new QtxPagePrefPathListItem( Qtx::PT_Directory, title, parent, sect, param );
+    break;
+  }
+
+  return item ? item->id() : -1;
+}
+
+QVariant SUIT_PreferenceMgr::optionValue( const QString& name ) const
+{
+  QVariant val = QtxPagePrefMgr::optionValue( name );
+  if ( !val.isValid() && myRoot )
+    val = myRoot->option( name );
+  return val;
+}
+
+void SUIT_PreferenceMgr::setOptionValue( const QString& name, const QVariant& val )
+{
+  QtxPagePrefMgr::setOptionValue( name, val );
+  if ( myRoot )
+    myRoot->setOption( name, val );
+}
diff --git a/src/SUIT/SUIT_PreferenceMgr.h b/src/SUIT/SUIT_PreferenceMgr.h
new file mode 100644 (file)
index 0000000..f698725
--- /dev/null
@@ -0,0 +1,65 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      SUIT_PreferenceMgr.h
+// Author:    Sergey TELKOV
+//
+#ifndef SUIT_PREFERENCEMGR_H
+#define SUIT_PREFERENCEMGR_H
+
+// This class is obsoleted.
+// It was created for backward compatibility with ResourceEdit from Salome version 3.x.x
+
+#include "SUIT.h"
+
+#include "QtxPagePrefMgr.h"
+
+class SUIT_EXPORT SUIT_PreferenceMgr : public QtxPagePrefMgr
+{
+  Q_OBJECT
+
+public:
+  typedef enum { Auto, Space, Bool, Color, String, Selector,
+                 DblSpin, IntSpin, Double, Integer,
+                 GroupBox, Tab, Frame, Font, DirList, File } PrefItemType;
+
+public:
+  SUIT_PreferenceMgr( QtxResourceMgr*, QWidget* = 0 );
+  virtual ~SUIT_PreferenceMgr();
+
+  QIcon              itemIcon( const int ) const;
+  void               setItemIcon( const int, const QIcon& );
+
+  QVariant           itemProperty( const QString&, const int = -1 ) const;
+  void               setItemProperty( const QString&, const QVariant&, const int = -1 );
+
+  int                addItem( const QString&, const int pId = -1, const PrefItemType = Auto,
+                              const QString& = QString(), const QString& = QString() );
+
+protected:
+  virtual QVariant   optionValue( const QString& ) const;
+  virtual void       setOptionValue( const QString&, const QVariant& );
+
+private:
+  QtxPreferenceItem* myRoot;
+};
+
+#endif
index b076babd36c82b23d1856034151a91f3e22334fe..f134e733279e4edfa421c3faa0cadf05885088b1 100755 (executable)
@@ -1,27 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_ResourceMgr.h"
 
-#include <qfileinfo.h>
-#include <qdir.h>
-#include <qapplication.h>
-#include <qregexp.h>
+#include <QDir>
+#include <QFileInfo>
+#include <QApplication>
+#include <QRegExp>
+
+#ifndef WIN32
+#include <unistd.h>
+#endif
 
 /*!
     Constructor
@@ -66,9 +73,6 @@ QString SUIT_ResourceMgr::loadDoc( const QString& prefix, const QString& id ) co
   return path( docSection, prefix, id );
 }
 
-#ifndef WIN32
-#include <unistd.h>
-#endif
 /*!
     Returns the user file name for specified application
 */
@@ -76,13 +80,14 @@ QString SUIT_ResourceMgr::userFileName( const QString& appName, const bool for_l
 {
   QString pathName;
 
+  QStringList arguments = QApplication::arguments();
   // Try config file, given in arguments
-  for (int i = 1; i < qApp->argc(); i++) {
+  for (int i = 1; i < arguments.count(); i++) {
     QRegExp rx ("--resources=(.+)");
-    if ( rx.search( QString(qApp->argv()[i]) ) >= 0 && rx.capturedTexts().count() > 1 ) {
-      QString file = rx.capturedTexts()[1];
+    if ( rx.indexIn( arguments[i] ) >= 0 && rx.numCaptures() > 1 ) {
+      QString file = rx.cap(1);
       QFileInfo fi (file);
-      pathName = fi.absFilePath();
+      pathName = fi.absoluteFilePath();
     }
   }
 
@@ -110,7 +115,7 @@ QString SUIT_ResourceMgr::userFileName( const QString& appName, const bool for_l
 */
 QString SUIT_ResourceMgr::findAppropriateUserFile( const QString& fname ) const
 {
-  QDir d( QFileInfo( fname ).dir( true ) );
+  QDir d( QFileInfo( fname ).dir() );
   d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
   QStringList l = d.entryList();
   QString appr_file;
@@ -127,7 +132,7 @@ QString SUIT_ResourceMgr::findAppropriateUserFile( const QString& fname ) const
     if( appr < 0 || abs( id-id0 ) < abs( appr-id0 ) )
     {
       appr = id;
-      appr_file = d.absFilePath( *anIt );
+      appr_file = d.absoluteFilePath( *anIt );
     }
   }
   return appr_file;
index db0eda7119c5881d9053fc69c2f687bf741b5e5f..e0ff7ce17bcfe57b5298870539b70f346bb550e0 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_RESOURCEMGR_H
 #define SUIT_RESOURCEMGR_H
@@ -26,7 +29,7 @@
 class SUIT_EXPORT SUIT_ResourceMgr : public QtxResourceMgr
 {
 public:
-  SUIT_ResourceMgr( const QString&, const QString& = QString::null );
+  SUIT_ResourceMgr( const QString&, const QString& = QString() );
   virtual ~SUIT_ResourceMgr();
 
   virtual QString version() const;
index f4cd983a251ca4562c7b5275a156b94cc9fc5f82..85f8d7d99a05a994107b2fe19b226e47ae7764bd 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_SelectionFilter.h"
 
index bc63de032acef57d3eb9baf4e9583cc9b809f998..862a0d114e269ce7581cf356ce1c6f5b7790d30d 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_SELECTIONFILTER_H
 #define SUIT_SELECTIONFILTER_H
index 895486f218845f6ea34312b65a5cafa33d72a2af..5b8595b8c24e52c1638ab2dbe92fe179e76d94f1 100755 (executable)
@@ -1,23 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_SelectionMgr.h"
 
+#include "SUIT_Selector.h"
+#include "SUIT_SelectionFilter.h"
+
 /*!\class SUIT_SelectionMgr
  * Provide selection manager. Manipulate by selection filters, modes, data owners.
  */
@@ -26,6 +32,7 @@
 SUIT_SelectionMgr::SUIT_SelectionMgr( const bool Feedback, QObject* p )
 : QObject( p ),
 myIterations( Feedback ? 1 : 0 ),
+myAutoDelFilter( false ),
 myIsSelChangeEnabled( true )
 {
 }
@@ -33,7 +40,8 @@ myIsSelChangeEnabled( true )
 /*!destructor. mySelectors auto delete.*/
 SUIT_SelectionMgr::~SUIT_SelectionMgr()
 {
-  mySelectors.setAutoDelete( true );
+  for ( SelectorList::iterator it = mySelectors.begin(); it != mySelectors.end(); ++it )
+    delete *it;
 }
 
 /*!Add selector \a sel to selectors list,if it's not exists in list.*/
@@ -46,25 +54,25 @@ void SUIT_SelectionMgr::installSelector( SUIT_Selector* sel )
 /*!Remove selector \a sel from list.*/
 void SUIT_SelectionMgr::removeSelector( SUIT_Selector* sel )
 {
-  mySelectors.remove( sel );
+  mySelectors.removeAll( sel );
 }
 
 /*!Gets selectors list to \a lst.*/
-void SUIT_SelectionMgr::selectors( QPtrList<SUIT_Selector>& lst ) const
+void SUIT_SelectionMgr::selectors( QList<SUIT_Selector*>& lst ) const
 {
   lst.clear();
-  for ( SelectorListIterator it( mySelectors ); it.current(); ++it )
-    lst.append( it.current() );
+  for ( SelectorList::const_iterator it = mySelectors.begin(); it != mySelectors.end(); ++it )
+    lst.append( *it );
 }
 
 /*!Gets selectors list to \a lst with type \a typ.*/
-void SUIT_SelectionMgr::selectors( const QString& typ, QPtrList<SUIT_Selector>& lst ) const
+void SUIT_SelectionMgr::selectors( const QString& typ, QList<SUIT_Selector*>& lst ) const
 {
   lst.clear();
-  for ( SelectorListIterator it( mySelectors ); it.current(); ++it )
+  for ( SelectorList::const_iterator it = mySelectors.begin(); it != mySelectors.end(); ++it )
   {
-    if ( it.current()->type() == typ )
-      lst.append( it.current() );
+    if ( (*it)->type() == typ )
+      lst.append( *it );
   }
 }
 
@@ -72,10 +80,10 @@ void SUIT_SelectionMgr::selectors( const QString& typ, QPtrList<SUIT_Selector>&
 */
 void SUIT_SelectionMgr::setEnabled( const bool on, const QString& typ )
 {
-  for ( SelectorListIterator it( mySelectors ); it.current(); ++it )
+  for ( SelectorList::const_iterator it = mySelectors.begin(); it != mySelectors.end(); ++it )
   {
-    if ( typ.isEmpty() || it.current()->type() == typ )
-      it.current()->setEnabled( on );
+    if ( typ.isEmpty() || (*it)->type() == typ )
+      (*it)->setEnabled( on );
   }
 }
 
@@ -85,12 +93,13 @@ void SUIT_SelectionMgr::selected( SUIT_DataOwnerPtrList& lst, const QString& typ
 {
   lst.clear();
 
-  for ( SelectorListIterator it( mySelectors ); it.current(); ++it )
+  for ( SelectorList::const_iterator it = mySelectors.begin(); it != mySelectors.end(); ++it )
   {
-    if ( !type.isEmpty() && it.current()->type() != type )
+    if ( !type.isEmpty() && (*it)->type() != type )
       continue;
+
     SUIT_DataOwnerPtrList curList;
-    it.current()->selected( curList );
+    (*it)->selected( curList );
     for ( SUIT_DataOwnerPtrList::const_iterator itr = curList.begin(); itr != curList.end(); ++itr )
       lst.append( *itr );
   }
@@ -103,16 +112,16 @@ void SUIT_SelectionMgr::setSelected( const SUIT_DataOwnerPtrList& lst, const boo
   SUIT_DataOwnerPtrList owners;
   filterOwners( lst, owners );
 
-  for ( SelectorListIterator it( mySelectors ); it.current(); ++it )
+  for ( SelectorList::const_iterator it = mySelectors.begin(); it != mySelectors.end(); ++it )
   {
     if ( append )
     {
       SUIT_DataOwnerPtrList current;
-      it.current()->selected( current );
+      (*it)->selected( current );
       for ( SUIT_DataOwnerPtrList::const_iterator it = current.begin(); it != current.end(); ++it )
         owners.append( *it );
     }
-    it.current()->setSelected( owners );
+    (*it)->setSelected( owners );
   }
 }
 
@@ -140,11 +149,11 @@ void SUIT_SelectionMgr::selectionChanged( SUIT_Selector* sel )
 
   for ( int i = 0; i < myIterations; i++ )
   {
-    for ( SUIT_Selector* aSel = mySelectors.first(); aSel; aSel = mySelectors.next() )
+    for ( SelectorList::iterator it = mySelectors.begin(); it != mySelectors.end(); ++it )
     {
       // Temporary action(to avoid selection of the objects which don't pass the filters):
-      //if ( aSel != sel )
-           aSel->setSelected( newOwners );
+      //if ( *it != sel )
+       (*it)->setSelected( newOwners );
     }
   }
   myIsSelChangeEnabled = true;
@@ -170,7 +179,7 @@ bool SUIT_SelectionMgr::hasSelectionMode( const int mode ) const
 
 /*! Gets selection modes to list \a vals.
 */
-void SUIT_SelectionMgr::selectionModes( QValueList<int>& vals ) const
+void SUIT_SelectionMgr::selectionModes( QList<int>& vals ) const
 {
   vals = mySelModes;
 }
@@ -179,14 +188,14 @@ void SUIT_SelectionMgr::selectionModes( QValueList<int>& vals ) const
 */
 void SUIT_SelectionMgr::setSelectionModes( const int mode )
 {
-  QValueList<int> lst;
+  QList<int> lst;
   lst.append( mode );
   setSelectionModes( lst );
 }
 
 /*! Sets selection modes list from \a lst.
 */
-void SUIT_SelectionMgr::setSelectionModes( const QValueList<int>& lst )
+void SUIT_SelectionMgr::setSelectionModes( const QList<int>& lst )
 {
   mySelModes = lst;
 }
@@ -195,20 +204,20 @@ void SUIT_SelectionMgr::setSelectionModes( const QValueList<int>& lst )
 */
 void SUIT_SelectionMgr::appendSelectionModes( const int mode )
 {
-  QValueList<int> lst;
+  QList<int> lst;
   lst.append( mode );
   appendSelectionModes( lst );
 }
 
 /*! Append selection modes \a lst list.
 */
-void SUIT_SelectionMgr::appendSelectionModes( const QValueList<int>& lst )
+void SUIT_SelectionMgr::appendSelectionModes( const QList<int>& lst )
 {
   QMap<int, int> map;
-  for ( QValueList<int>::const_iterator it = mySelModes.begin(); it != mySelModes.end(); ++it )
+  for ( QList<int>::const_iterator it = mySelModes.begin(); it != mySelModes.end(); ++it )
     map.insert( *it, 0 );
 
-  for ( QValueList<int>::const_iterator itr = lst.begin(); itr != lst.end(); ++itr )
+  for ( QList<int>::const_iterator itr = lst.begin(); itr != lst.end(); ++itr )
   {
     if ( !map.contains( *itr ) )
       mySelModes.append( *itr );
@@ -219,20 +228,20 @@ void SUIT_SelectionMgr::appendSelectionModes( const QValueList<int>& lst )
 */
 void SUIT_SelectionMgr::removeSelectionModes( const int mode )
 {
-  QValueList<int> lst;
+  QList<int> lst;
   lst.append( mode );
   removeSelectionModes( lst );
 }
 
 /*! Remove selection modea \a lst from list.
 */
-void SUIT_SelectionMgr::removeSelectionModes( const QValueList<int>& lst )
+void SUIT_SelectionMgr::removeSelectionModes( const QList<int>& lst )
 {
   QMap<int, int> map;
-  for ( QValueList<int>::const_iterator it = mySelModes.begin(); it != mySelModes.end(); ++it )
+  for ( QList<int>::const_iterator it = mySelModes.begin(); it != mySelModes.end(); ++it )
     map.insert( *it, 0 );
 
-  for ( QValueList<int>::const_iterator itr = lst.begin(); itr != lst.end(); ++itr )
+  for ( QList<int>::const_iterator itr = lst.begin(); itr != lst.end(); ++itr )
     map.remove( *itr );
 
   mySelModes.clear();
@@ -248,8 +257,8 @@ bool SUIT_SelectionMgr::isOk( const SUIT_DataOwner* owner ) const
     return false;
 
   bool ok = true;
-  for ( SelFilterListIterator it( myFilters ); it.current() && ok; ++it )
-    ok = it.current()->isOk( owner );
+  for ( SelFilterList::const_iterator it = myFilters.begin(); it != myFilters.end() && ok; ++it )
+    ok = (*it)->isOk( owner );
 
   return ok;
 }
@@ -292,13 +301,25 @@ void SUIT_SelectionMgr::installFilter( SUIT_SelectionFilter* f, const bool updat
 */
 void SUIT_SelectionMgr::removeFilter( SUIT_SelectionFilter* f )
 {
-  myFilters.remove( f );
+  if ( !myFilters.contains( f ) )
+    return;
+
+  myFilters.removeAll( f );
+
+  if ( autoDeleteFilter() )
+    delete f;
 }
 
 /*! Clear filters list.
 */
 void SUIT_SelectionMgr::clearFilters()
 {
+  if ( autoDeleteFilter() )
+  {
+    for ( SelFilterList::const_iterator it = myFilters.begin(); it != myFilters.end(); ++it )
+      delete *it;
+  }
+
   myFilters.clear();
 }
 
@@ -306,14 +327,14 @@ void SUIT_SelectionMgr::clearFilters()
 */
 bool SUIT_SelectionMgr::autoDeleteFilter() const
 {
-  return myFilters.autoDelete();
+  return myAutoDelFilter;
 }
 
 /*! Sets auto delete filter to \a on.
 */
 void SUIT_SelectionMgr::setAutoDeleteFilter( const bool on )
 {
-  myFilters.setAutoDelete( on );
+  myAutoDelFilter = on;
 }
 
 /*! Gets good data owners list to \a out from \a in.
index 79576568f38d49f8ed6855f0b0f2c8acdf097c1f..19b6bb60bcc5696c6982ef3ff9b653b38fdcc13a 100755 (executable)
@@ -1,31 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_SELECTIONMGR_H
 #define SUIT_SELECTIONMGR_H
 
-#include "SUIT_Selector.h"
 #include "SUIT_DataOwner.h"
-#include "SUIT_SelectionFilter.h"
 
-#include <qobject.h>
-#include <qptrlist.h>
-#include <qvaluelist.h>
+#include <QList>
+#include <QObject>
+
+class SUIT_Selector;
+class SUIT_SelectionFilter;
 
 #ifdef WIN32
 #pragma warning ( disable : 4251 )
@@ -40,27 +43,27 @@ public:
   virtual ~SUIT_SelectionMgr();
 
   void            clearSelected();
-  virtual void    selected( SUIT_DataOwnerPtrList&, const QString& = QString::null ) const;
+  virtual void    selected( SUIT_DataOwnerPtrList&, const QString& = QString() ) const;
   virtual void    setSelected( const SUIT_DataOwnerPtrList&, const bool = false );
 
-  void            selectors( QPtrList<SUIT_Selector>& ) const;
-  void            selectors( const QString&, QPtrList<SUIT_Selector>& ) const;
+  void            selectors( QList<SUIT_Selector*>& ) const;
+  void            selectors( const QString&, QList<SUIT_Selector*>& ) const;
 
 
-  void            setEnabled( const bool, const QString& = QString::null );
+  void            setEnabled( const bool, const QString& = QString() );
 
 
   bool            hasSelectionMode( const int ) const;
-  void            selectionModes( QValueList<int>& ) const;
+  void            selectionModes( QList<int>& ) const;
 
   void            setSelectionModes( const int );
-  virtual void    setSelectionModes( const QValueList<int>& );
+  virtual void    setSelectionModes( const QList<int>& );
 
   void            appendSelectionModes( const int );
-  virtual void    appendSelectionModes( const QValueList<int>& );
+  virtual void    appendSelectionModes( const QList<int>& );
 
   void            removeSelectionModes( const int );
-  virtual void    removeSelectionModes( const QValueList<int>& );
+  virtual void    removeSelectionModes( const QList<int>& );
 
 
   bool            isOk( const SUIT_DataOwner* ) const;
@@ -83,25 +86,21 @@ signals:
 protected:
   virtual void    selectionChanged( SUIT_Selector* );
 
-  typedef QPtrListIterator<SUIT_Selector>        SelectorListIterator;
-
   virtual void    installSelector( SUIT_Selector* );
   virtual void    removeSelector( SUIT_Selector* );
 
 private:
   void            filterOwners( const SUIT_DataOwnerPtrList&, SUIT_DataOwnerPtrList& ) const;
 
-  typedef QPtrList<SUIT_Selector>                SelectorList;
-  typedef QPtrList<SUIT_SelectionFilter>         SelFilterList;
-  typedef QPtrListIterator<SUIT_SelectionFilter> SelFilterListIterator;
-
-protected:
-  SelectorList    mySelectors;
+  typedef QList<SUIT_Selector*>        SelectorList;
+  typedef QList<SUIT_SelectionFilter*> SelFilterList;
 
 private:
   SelFilterList   myFilters;
-  QValueList<int> mySelModes;
+  QList<int>      mySelModes;
+  SelectorList    mySelectors;
   int             myIterations;
+  bool            myAutoDelFilter;
   bool            myIsSelChangeEnabled;
 
   friend class SUIT_Selector;
index ebda6a065ac5be3f6973adb2a3c10821a1586684..553d6ab62fdb449a3e0e706dea89a99897ffa371 100755 (executable)
@@ -1,25 +1,71 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_Selector.h"
 
 #include "SUIT_SelectionMgr.h"
 
+#include <QObject>
+
+/*!\class SUIT_Selector::Destroyer
+  Class provide the watching for qobject parent class of the selector.
+*/
+
+class SUIT_Selector::Destroyer : public QObject
+{
+public:
+  Destroyer( SUIT_Selector*, QObject* = 0 );
+  virtual ~Destroyer();
+
+  SUIT_Selector* selector() const;
+  void           setSelector( SUIT_Selector* );
+
+private:
+  SUIT_Selector* mySelector;
+};
+
+SUIT_Selector::Destroyer::Destroyer( SUIT_Selector* s, QObject* p )
+: QObject( p ),
+  mySelector( s )
+{
+}
+
+SUIT_Selector::Destroyer::~Destroyer()
+{
+  SUIT_Selector* s = mySelector;
+  mySelector = 0;
+  if ( s )
+    delete s;
+}
+
+SUIT_Selector* SUIT_Selector::Destroyer::selector() const
+{
+  return mySelector;
+}
+
+void SUIT_Selector::Destroyer::setSelector( SUIT_Selector* s )
+{
+  mySelector = s;
+}
+
 /*!\class SUIT_Selector
  * Class provide selector for data owners.
  */
 /*!
   Constructor.
 */
-SUIT_Selector::SUIT_Selector( SUIT_SelectionMgr* selMgr, QObject* parent ) :
-QObject( parent ), 
-mySelMgr( selMgr ),
+SUIT_Selector::SUIT_Selector( SUIT_SelectionMgr* selMgr, QObject* parent )
+: mySelMgr( selMgr ),
 myBlock( false ),
 myEnabled( true ),
-myAutoBlock( true )
+myAutoBlock( true ),
+myDestroyer( 0 )
 {
   if ( selMgr )
     selMgr->installSelector( this );
+
+  if ( parent )
+    myDestroyer = new Destroyer( this, parent );
 }
 
 /*!
@@ -45,6 +94,12 @@ SUIT_Selector::~SUIT_Selector()
 {
   if ( selectionMgr() )
     selectionMgr()->removeSelector( this );
+
+  if ( myDestroyer && myDestroyer->selector() == this )
+  {
+    myDestroyer->setSelector( 0 );
+    delete myDestroyer;
+  }
 }
 
 /*!
@@ -135,7 +190,7 @@ bool SUIT_Selector::hasSelectionMode( const int mode ) const
 /*!
   Puts to list \a lst selection modes from selection manager.
 */
-void SUIT_Selector::selectionModes( QValueList<int>& lst ) const
+void SUIT_Selector::selectionModes( QList<int>& lst ) const
 {
   if ( selectionMgr() )
     selectionMgr()->selectionModes( lst );
index 058506d24620ab334a32e9a6d41e72fc8a7b1889..5be859d77349a1fdefe753d4d75ad5d104124d41 100755 (executable)
@@ -1,28 +1,32 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_SELECTOR_H
 #define SUIT_SELECTOR_H
 
 #include "SUIT.h"
 
-#include <qvaluelist.h>
-#include <qobject.h>
+#include <QList>
+
+class QObject;
 
 class SUIT_SelectionMgr;
 class SUIT_DataOwnerPtrList;
@@ -34,9 +38,11 @@ class SUIT_DataOwnerPtrList;
   (ObjectBrowser, viewers, etc)
   Used by selection manager for selection synhronizing
 */
-class SUIT_EXPORT SUIT_Selector : public QObject
+
+class SUIT_EXPORT SUIT_Selector
 {
-  Q_OBJECT
+  class Destroyer;
+
 public:
   SUIT_Selector( SUIT_SelectionMgr*, QObject* = 0 );
   virtual ~SUIT_Selector();
@@ -55,7 +61,7 @@ public:
   void               setSelected( const SUIT_DataOwnerPtrList& );
 
   bool               hasSelectionMode( const int ) const;
-  void               selectionModes( QValueList<int>& ) const;
+  void               selectionModes( QList<int>& ) const;
 
 protected:
   void               selectionChanged();
@@ -63,10 +69,11 @@ protected:
   virtual void       setSelection( const SUIT_DataOwnerPtrList& ) = 0;
 
 private:
-  bool               myBlock;
   SUIT_SelectionMgr* mySelMgr;
+  bool               myBlock;
   bool               myEnabled;
   bool               myAutoBlock;
+  Destroyer*         myDestroyer;
 };
 
 #endif
index 6ea09564821da65837fd0d776feb0e9b6417708f..8848a2c868d24a35207f8ea42bc3413163d38442 100755 (executable)
@@ -1,33 +1,33 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_Session.h"
 
+#include "SUIT_Study.h"
 #include "SUIT_Tools.h"
-#include "SUIT_Desktop.h"
 #include "SUIT_MessageBox.h"
-#include "SUIT_ViewWindow.h"
-#include "SUIT_ViewManager.h"
 #include "SUIT_ExceptionHandler.h"
+#include "SUIT_ResourceMgr.h"
 
-#include <qtextcodec.h>
-#include <qmessagebox.h>
-#include <qapplication.h>
+#include <QApplication>
 
 #ifdef WIN32
 #include <windows.h>
 #include <dlfcn.h>
 #endif
 
-static bool   SUIT_Session_IsPythonExecuted = false;
-static QMutex SUIT_Session_PythonMutex;
-
 SUIT_Session* SUIT_Session::mySession = 0;
 
 /*! Constructor.*/
 
 SUIT_Session::SUIT_Session()
 : QObject(),
-myResMgr( 0 ),
-myHandler( 0 ),
-myActiveApp( 0 ),
-myExitStatus( NORMAL ),
-myExitFlags ( 0 )
+  myResMgr( 0 ),
+  myActiveApp( 0 ),
+  myHandler( 0 ),
+  myExitStatus( NORMAL ),
+  myExitFlags ( 0 )
 {
   SUIT_ASSERT( !mySession )
 
   mySession = this;
-
-  myAppList.setAutoDelete( true );
 }
 
 /*!destructor. Clear applications list and set mySession to zero.*/
 SUIT_Session::~SUIT_Session()
 {
+  for ( AppList::iterator it = myAppList.begin(); it != myAppList.end(); ++it )
+    delete *it;
+
   myAppList.clear();
 
-  if (myResMgr) {
+  if ( myResMgr )
+  {
     delete myResMgr;
     myResMgr = 0;
   }
@@ -79,7 +78,7 @@ SUIT_Session* SUIT_Session::session()
   Starts new application using "createApplication" function of loaded DLL.
 */
 
-SUIT_Application* SUIT_Session::startApplication( const QString& name, int args, char** argv )
+SUIT_Application* SUIT_Session::startApplication( const QString& name, int /*args*/, char** /*argv*/ )
 {
   AppLib libHandle = 0;
 
@@ -93,8 +92,8 @@ SUIT_Application* SUIT_Session::startApplication( const QString& name, int args,
 
   if ( !libHandle )
   {
-    SUIT_MessageBox::warn1( 0, tr( "Error" ),
-                            tr( "Can not load application library \"%1\": %2").arg( lib ).arg( lastError() ), tr( "Ok" ) );
+    SUIT_MessageBox::warning( 0, tr( "Error" ),
+                              tr( "Can not load application library \"%1\": %2").arg( lib ).arg( lastError() ) );
     return 0;
   }
 
@@ -104,15 +103,15 @@ SUIT_Application* SUIT_Session::startApplication( const QString& name, int args,
   APP_CREATE_FUNC crtInst = 0;
 
 #ifdef WIN32
-  crtInst = (APP_CREATE_FUNC)::GetProcAddress( libHandle, APP_CREATE_NAME );
+  crtInst = (APP_CREATE_FUNC)::GetProcAddress( (HINSTANCE)libHandle, APP_CREATE_NAME );
 #else
   crtInst = (APP_CREATE_FUNC)dlsym( libHandle, APP_CREATE_NAME );
 #endif
 
   if ( !crtInst )
   {
-    SUIT_MessageBox::warn1( 0, tr( "Error" ),
-                            tr( "Can not find function \"%1\": %2" ).arg( APP_CREATE_NAME ).arg( lastError() ), tr( "Ok" ) );
+    SUIT_MessageBox::warning( 0, tr( "Error" ),
+                              tr( "Can not find function \"%1\": %2" ).arg( APP_CREATE_NAME ).arg( lastError() ) );
     return 0;
   }
 
@@ -127,24 +126,19 @@ SUIT_Application* SUIT_Session::startApplication( const QString& name, int args,
   SUIT_Application* anApp = crtInst();
   if ( !anApp )
   {
-    SUIT_MessageBox::warn1( 0, tr( "Error" ), tr( "Can not create application \"%1\": %2").arg( appName ).arg( lastError() ), tr( "Ok" ) );
+    SUIT_MessageBox::warning( 0, tr( "Error" ), tr( "Can not create application \"%1\": %2").arg( appName ).arg( lastError() ) );
     return 0;
   }
 
-  anApp->setName( appName );
+  anApp->setObjectName( appName );
 
-  connect( anApp, SIGNAL( applicationClosed( SUIT_Application* ) ),
-           this, SLOT( onApplicationClosed( SUIT_Application* ) ) );
-  connect( anApp, SIGNAL( activated( SUIT_Application* ) ), 
-                this, SLOT( onApplicationActivated( SUIT_Application* ) ) );
-
-  myAppList.append( anApp );
+  insertApplication( anApp );
 
   if ( !myHandler )
   {
     APP_GET_HANDLER_FUNC crtHndlr = 0;
 #ifdef WIN32
-    crtHndlr = (APP_GET_HANDLER_FUNC)::GetProcAddress( libHandle, APP_GET_HANDLER_NAME );
+    crtHndlr = (APP_GET_HANDLER_FUNC)::GetProcAddress( (HINSTANCE)libHandle, APP_GET_HANDLER_NAME );
 #else
     crtHndlr = (APP_GET_HANDLER_FUNC)dlsym( libHandle, APP_GET_HANDLER_NAME );
 #endif
@@ -164,15 +158,22 @@ SUIT_Application* SUIT_Session::startApplication( const QString& name, int args,
 /*!
   Gets the list of all applications
 */
-QPtrList<SUIT_Application> SUIT_Session::applications() const
+QList<SUIT_Application*> SUIT_Session::applications() const
 {
-  QPtrList<SUIT_Application> apps;
-  apps.setAutoDelete( false );
+  return myAppList;
+}
 
-  for ( AppListIterator it( myAppList ); it.current(); ++it )
-    apps.append( it.current() );
+void SUIT_Session::insertApplication( SUIT_Application* app )
+{
+  if ( !app || myAppList.contains( app ) )
+    return;
 
-  return apps;
+  myAppList.append( app );
+
+  connect( app, SIGNAL( applicationClosed( SUIT_Application* ) ),
+           this, SLOT( onApplicationClosed( SUIT_Application* ) ) );
+  connect( app, SIGNAL( activated( SUIT_Application* ) ), 
+                this, SLOT( onApplicationActivated( SUIT_Application* ) ) );
 }
 
 /*!
@@ -224,14 +225,16 @@ void SUIT_Session::onApplicationClosed( SUIT_Application* theApp )
 {
   emit applicationClosed( theApp );
 
-  myAppList.remove( theApp );
+  myAppList.removeAll( theApp );
+  delete theApp;
+
   if ( theApp == myActiveApp )
     myActiveApp = 0;
 
   if ( myAppList.isEmpty() )
   {
-    printf( "Calling QApplication::exit() with exit code = %d\n", myExitStatus );
-    qApp->exit( myExitStatus );
+    //printf( "Calling QApplication::exit() with exit code = %d\n", myExitStatus );
+    QApplication::instance()->exit( myExitStatus );
   }
 }
 
@@ -240,9 +243,10 @@ void SUIT_Session::onApplicationClosed( SUIT_Application* theApp )
 */
 void SUIT_Session::closeSession( int mode, int flags )
 {
-  while ( !myAppList.isEmpty() )
+  AppList apps = myAppList;
+  for ( AppList::const_iterator it = apps.begin(); it != apps.end(); ++it )
   {
-    SUIT_Application* app = myAppList.getFirst();
+    SUIT_Application* app = *it;
     bool closePermanently;
     if ( mode == ASK && !app->isPossibleToClose( closePermanently ) )
       return;
@@ -250,7 +254,7 @@ void SUIT_Session::closeSession( int mode, int flags )
     {
       SUIT_Study* study = app->activeStudy();
       if ( study->isModified() && study->isSaved() )
-       study->saveDocument();
+             study->saveDocument();
     }
     else if ( mode == DONT_SAVE )
     {
@@ -259,6 +263,7 @@ void SUIT_Session::closeSession( int mode, int flags )
 
     app->closeApplication();
   }
+
   myExitFlags = flags;
 }
 
@@ -286,11 +291,12 @@ SUIT_ExceptionHandler* SUIT_Session::handler() const
 QString SUIT_Session::lastError() const
 {
   QString str;
-#ifdef WNT
+#ifdef WIN32
   LPVOID lpMsgBuf;
   ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
                    FORMAT_MESSAGE_IGNORE_INSERTS, 0, ::GetLastError(), 0, (LPTSTR)&lpMsgBuf, 0, 0 );
-  str = QString( (LPTSTR)lpMsgBuf );
+  LPTSTR msg = (LPTSTR)lpMsgBuf;
+  str = QString( SUIT_Tools::toQString( msg ) );
   LocalFree( lpMsgBuf );
 #else
   str = QString( dlerror() );
@@ -310,10 +316,16 @@ SUIT_Session::AppLib SUIT_Session::loadLibrary( const QString& name, QString& li
     return 0;
 
   AppLib lib = 0;
+  QByteArray bid = libFile.toLatin1();
 #ifdef WIN32
-  lib = ::LoadLibrary( (char*)libFile.latin1() );
+#ifdef UNICODE
+  LPTSTR str = (LPTSTR)libFile.utf16();
+#else
+  LPTSTR str = (LPTSTR)(const char*)bid;
+#endif
+  lib = ::LoadLibrary( str );
 #else
-  lib = dlopen( (char*)libFile.latin1(), RTLD_LAZY | RTLD_GLOBAL  );
+  lib = dlopen( (const char*)libFile.toLatin1(), RTLD_LAZY | RTLD_GLOBAL  );
 #endif
   return lib;
 }
@@ -342,32 +354,7 @@ SUIT_ResourceMgr* SUIT_Session::createResourceMgr( const QString& appName ) cons
 /*!
   Slot, called on activation of some application's desktop
 */
-void SUIT_Session::onApplicationActivated( SUIT_Application* app )
+void SUIT_Session::onApplicationActivated( SUIT_Application* app ) 
 {
   myActiveApp = app;
 }
-
-/*!
-  \retval Return TRUE, if a command is currently executed in Python Console,
-                 FALSE otherwise.
-*/
-bool SUIT_Session::IsPythonExecuted()
-{
-  bool ret;
-  SUIT_Session_PythonMutex.lock();
-  ret = SUIT_Session_IsPythonExecuted;
-  SUIT_Session_PythonMutex.unlock();
-  return ret;
-}
-
-/*!
-  Set value of boolean flag, being returned by method \a IsPythonExecuted().
-  It is supposed to set the flag to TRUE when any python command starts
-  and reset it to FALSE when the command finishes.
-*/
-void SUIT_Session::SetPythonExecuted(bool isPythonExecuted)
-{
-  SUIT_Session_PythonMutex.lock();
-  SUIT_Session_IsPythonExecuted = isPythonExecuted;
-  SUIT_Session_PythonMutex.unlock();
-}
index 7b16ea1832427b96cc319122b9d9245592865da4..479e5bd0e68abb11f777798cbb5d2ad4c7eac991 100755 (executable)
@@ -1,34 +1,37 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_SESSION_H
 #define SUIT_SESSION_H
 
 #include "SUIT.h"
-
 #include "SUIT_Application.h"
-#include "SUIT_ResourceMgr.h"
 
-#include <qmutex.h>
-#include <qobject.h>
-#include <qptrlist.h>
-#include <qptrvector.h>
-#include <qstringlist.h>
+#include <QList>
+#include <QObject>
+#include <QString>
+
+#ifdef WIN32
+#include <windows.h>
+#endif
 
 #ifdef WIN32
 #define LIB_HANDLE HINSTANCE
@@ -39,7 +42,7 @@
 class SUIT_ResourceMgr;
 class SUIT_ExceptionHandler;
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 /*!
@@ -47,7 +50,7 @@ class SUIT_ExceptionHandler;
   by static function "createApplication" in external library. The Library must be loaded with \n
   loadLibrary method and after that application can be started.
 */
-class SUIT_EXPORT SUIT_Session: public QObject
+class SUIT_EXPORT SUIT_Session : public QObject
 {
   Q_OBJECT
 
@@ -65,7 +68,7 @@ public:
 
   SUIT_Application*            startApplication( const QString&, int = 0, char** = 0 );
 
-  QPtrList<SUIT_Application>   applications() const;
+  QList<SUIT_Application*>     applications() const;
   SUIT_Application*            activeApplication() const;
 
   SUIT_ResourceMgr*            resourceMgr() const;
@@ -75,9 +78,7 @@ public:
 
   SUIT_ExceptionHandler*       handler() const;
 
-  // To lock GUI user actions during python command execution (PAL12651)
-  static bool                  IsPythonExecuted();
-  static void                  SetPythonExecuted(bool isPythonExecuted);
+  void                         insertApplication( SUIT_Application* );
 
 signals:
   void                         applicationClosed( SUIT_Application* );
@@ -90,9 +91,8 @@ private slots:
   void                         onApplicationActivated( SUIT_Application* ); 
 
 private:
-  typedef QPtrList<SUIT_Application>         AppList;
-  typedef QMap<QString, AppLib>              AppLibMap;
-  typedef QPtrListIterator<SUIT_Application> AppListIterator;
+  typedef QList<SUIT_Application*> AppList;
+  typedef QMap<QString, AppLib>    AppLibMap;
 
 private:
   QString                      lastError() const;
index ee28cf5e1c201a212d1f5e01616ce040cf617dfe..dc3fb52b09bff2913cd1a5ecf5621699c509d6ac 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #if !defined(__SUIT_SMARTPTR_H)
 #define __SUIT_SMARTPTR_H
index 801d9ecb0a6ba2495fca660659ad70c016adebba..845b2faba3e379ef2c3306b3108671f5bae15b72 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_Study.h"
 
@@ -23,7 +26,6 @@
 #include "SUIT_DataObject.h"
 #include "SUIT_MessageBox.h"
 #include "SUIT_Application.h"
-#include <qvaluevector.h>
 
 /*!\class SUIT_Study
  * Support study management. Object management. Operation management.
@@ -33,9 +35,9 @@
 SUIT_Study::SUIT_Study( SUIT_Application* app )
 : QObject(),
 myApp( app ),
+myName( "" ),
 myIsSaved( false ),
 myIsModified( false ),
-myName( "" ),
 myBlockChangeState( false )
 {
   static int _id = 0;
@@ -43,8 +45,6 @@ myBlockChangeState( false )
   myId = ++_id;
 
   myRoot = new SUIT_DataObject();
-  myOperations.setAutoDelete( false );
-  myOperations.setAutoDelete( false );
 }
 
 /*!Destructor.*/
@@ -91,7 +91,7 @@ QString SUIT_Study::studyName() const
  */
 SUIT_Operation* SUIT_Study::activeOperation() const
 {
-  return myOperations.count() > 0 ? myOperations.getLast() : 0;
+  return myOperations.count() > 0 ? myOperations.last() : 0;
 }
 
 /*!
@@ -113,7 +113,7 @@ bool SUIT_Study::isModified() const
 /*!
  *Close document. NOT IMPLEMENTED.
  */
-void SUIT_Study::closeDocument(bool permanently)
+void SUIT_Study::closeDocument(bool /*permanently*/)
 {
 }
 
@@ -121,8 +121,9 @@ void SUIT_Study::closeDocument(bool permanently)
   Custom document initialization to be performed \n
    within onNewDoc() handler can be put here
 */
-void SUIT_Study::createDocument()
+bool SUIT_Study::createDocument( const QString& )
 {
+  return true;
 }
 
 /*!
@@ -163,8 +164,8 @@ bool SUIT_Study::saveDocument()
 void SUIT_Study::abortAllOperations()
 {
   myBlockChangeState = true;
-  for( SUIT_Operation* op = myOperations.first(); op; op = myOperations.next() )
-    op->abort();
+  for ( Operations::iterator it = myOperations.begin(); it != myOperations.end(); ++it )
+    (*it)->abort();
   myBlockChangeState = false;
   myOperations.clear();
 }
@@ -205,7 +206,7 @@ void SUIT_Study::setIsModified( const bool on )
  */
 void SUIT_Study::Modified()
 {
-  setIsModified( TRUE );
+  setIsModified( true );
   sendChangesNotification();
 }
 
@@ -248,9 +249,10 @@ SUIT_Operation* SUIT_Study::blockingOperation( SUIT_Operation* theOp ) const
     return 0;
 
   Operations tmpOps( myOperations );
-  SUIT_Operation* anOp = 0;
-  for ( anOp = tmpOps.last(); anOp; anOp = tmpOps.prev() )
+  for ( Operations::const_iterator it = tmpOps.end(); it != tmpOps.begin(); )
   {
+    it--;
+    SUIT_Operation* anOp = *it;
     if ( anOp != 0 && anOp!= theOp && !anOp->isValid( theOp ) )
       return anOp;
   }
@@ -271,7 +273,7 @@ SUIT_Operation* SUIT_Study::blockingOperation( SUIT_Operation* theOp ) const
 */
 bool SUIT_Study::start( SUIT_Operation* theOp, const bool toCheck )
 {
-  if ( !theOp || myOperations.find( theOp ) >= 0 )
+  if ( !theOp || myOperations.contains( theOp ) )
     return false;
 
   theOp->setExecStatus( SUIT_Operation::Rejected );
@@ -282,11 +284,11 @@ bool SUIT_Study::start( SUIT_Operation* theOp, const bool toCheck )
 
   if ( toCheck )
   {
-    while( SUIT_Operation* anOp = blockingOperation( theOp ) )
+    while ( SUIT_Operation* anOp = blockingOperation( theOp ) )
     {
-      int anAnsw = SUIT_MessageBox::warn2( application()->desktop(),
-                                           tr( "OPERATION_LAUNCH" ), tr( "PREVIOUS_NOT_FINISHED" ),
-                                           tr( "CONTINUE" ), tr( "CANCEL" ), 0, 1, 1 );
+      int anAnsw = SUIT_MessageBox::question( application()->desktop(),
+                                              tr( "OPERATION_LAUNCH" ), tr( "PREVIOUS_NOT_FINISHED" ),
+                                             tr( "CONTINUE" ), tr( "CANCEL" ) );
 
       if ( anAnsw == 1 )
         return false;
@@ -322,7 +324,7 @@ bool SUIT_Study::start( SUIT_Operation* theOp, const bool toCheck )
 */
 bool SUIT_Study::abort( SUIT_Operation* theOp )
 {
-  if ( !theOp || myOperations.find( theOp ) == -1 )
+  if ( !theOp || !myOperations.contains( theOp ) )
     return false;
 
   theOp->setExecStatus( SUIT_Operation::Rejected );
@@ -346,7 +348,7 @@ bool SUIT_Study::abort( SUIT_Operation* theOp )
 */
 bool SUIT_Study::commit( SUIT_Operation* theOp )
 {
-  if ( !theOp || myOperations.find( theOp ) == -1 )
+  if ( !theOp || !myOperations.contains( theOp ) )
     return false;
 
   theOp->setExecStatus( SUIT_Operation::Accepted );
@@ -372,7 +374,7 @@ bool SUIT_Study::commit( SUIT_Operation* theOp )
 */
 bool SUIT_Study::suspend( SUIT_Operation* theOp )
 {
-  if ( !theOp || myOperations.find( theOp ) == -1 || theOp->state() == SUIT_Operation::Suspended )
+  if ( !theOp || !myOperations.contains( theOp ) || theOp->state() == SUIT_Operation::Suspended )
     return false;
 
   theOp->setState( SUIT_Operation::Suspended );
@@ -391,7 +393,7 @@ bool SUIT_Study::suspend( SUIT_Operation* theOp )
 */
 bool SUIT_Study::resume( SUIT_Operation* theOp )
 {
-  if ( !theOp || myOperations.find( theOp ) == -1 ||
+  if ( !theOp || !myOperations.contains( theOp ) ||
        theOp->state() == SUIT_Operation::Running ||
        blockingOperation( theOp ) != 0 )
     return false;
@@ -405,7 +407,7 @@ bool SUIT_Study::resume( SUIT_Operation* theOp )
   // Move operation at the end of list in order to sort it in the order of activation.
   // As result active operation is a last operation of list, operation which was active
   // before currently active operation is located before it and so on
-  myOperations.remove( theOp );
+  myOperations.removeAll( theOp );
   myOperations.append( theOp );
 
   emit theOp->resumed( theOp );
@@ -422,12 +424,16 @@ bool SUIT_Study::resume( SUIT_Operation* theOp )
 void SUIT_Study::stop( SUIT_Operation* theOp )
 {
   theOp->setState( SUIT_Operation::Waiting );
-  myOperations.remove( theOp );
+  myOperations.removeAll( theOp );
 
   // get last operation which can be resumed
-  SUIT_Operation* anOp, *aResultOp = 0;
-  for ( anOp = myOperations.last(); anOp; anOp = myOperations.prev() )
+  SUIT_Operation* aResultOp = 0;
+
+  QListIterator<SUIT_Operation*> it (myOperations);
+  it.toBack();
+  while( it.hasPrevious() )
   {
+    SUIT_Operation* anOp = it.previous();
     if ( anOp && anOp != theOp && blockingOperation( anOp ) == 0 )
     {
       aResultOp = anOp;
@@ -447,7 +453,7 @@ void SUIT_Study::stop( SUIT_Operation* theOp )
  * \brief Get all started operations
   * \return List of all started operations
 */
-const QPtrList<SUIT_Operation>& SUIT_Study::operations() const
+const QList<SUIT_Operation*>& SUIT_Study::operations() const
 {
   return myOperations;
 }
@@ -520,12 +526,10 @@ bool SUIT_Study::hasTransaction() const
 {
   return false;
 }
+
 /*!
  * \brief Restores the study state.
  */
-void SUIT_Study::restoreState(int savePoint)
+void SUIT_Study::restoreState(int /*savePoint*/)
 {
-  // Redefined in SalomeApp_Study.
-  // Called from SALOME_Session_i::restoreVisualState(CORBA::Long theSavePoint)
 }
index 15f78a351c3e75f3676dc7b3473808147523957a..c442ec1bfb8c38f6c9cdb4bea51f4ecb2837631e 100755 (executable)
@@ -1,34 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_STUDY_H
 #define SUIT_STUDY_H
 
 #include "SUIT.h"
 
-#include "SUIT_Operation.h"
-
-#include <qobject.h>
-#include <qptrlist.h>
+#include <QList>
+#include <QObject>
+#include <QListIterator>
 
 class SUIT_DataObject;
 class SUIT_Application;
-class QDialog;
+class SUIT_Operation;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -52,9 +54,9 @@ public:
   virtual bool      isModified() const;
   virtual void      Modified();
 
-  virtual void      createDocument();
   virtual void      closeDocument( bool = true );
   virtual bool      openDocument( const QString& );
+  virtual bool      createDocument( const QString& );
 
   bool              saveDocument();
   virtual bool      saveDocumentAs( const QString& );
@@ -66,7 +68,7 @@ public:
   // Operation management
   SUIT_Operation*   activeOperation() const;
   virtual void      abortAllOperations();
-  const QPtrList<SUIT_Operation>& operations() const;
+  const QList<SUIT_Operation*>& operations() const;
   
   virtual SUIT_Operation* blockingOperation( SUIT_Operation* ) const;
 
@@ -87,18 +89,18 @@ protected:
   virtual void      setRoot( SUIT_DataObject* );
   virtual void      setStudyName( const QString& );
 
-       virtual void      operationStarted( SUIT_Operation* );
-       virtual void      operationAborted( SUIT_Operation* );
-       virtual void      operationStopped( SUIT_Operation* );
-       virtual void      operationCommited( SUIT_Operation* );
+  virtual void      operationStarted( SUIT_Operation* );
+  virtual void      operationAborted( SUIT_Operation* );
+  virtual void      operationStopped( SUIT_Operation* );
+  virtual void      operationCommited( SUIT_Operation* );
 
   virtual bool      openTransaction();
   virtual bool      abortTransaction();
   virtual bool      hasTransaction() const;
-  virtual bool      commitTransaction( const QString& = QString::null );
+  virtual bool      commitTransaction( const QString& = QString() );
 
 private:
-  typedef QPtrList<SUIT_Operation> Operations;
+  typedef QList<SUIT_Operation*> Operations;
   void              stop( SUIT_Operation* );
 
 private:
diff --git a/src/SUIT/SUIT_ToolButton.cxx b/src/SUIT/SUIT_ToolButton.cxx
deleted file mode 100755 (executable)
index 35e009c..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "SUIT_ToolButton.h"
-
-#include <qpopupmenu.h>
-#include <qstyle.h>
-
-/*!Constructor.*/
-SUIT_ToolButton::SUIT_ToolButton( QWidget *parent, 
-                                        const char *name,
-                                        bool changeItemAfterClick)
- : QToolButton(  parent, name ),
-   myChangeItemAfterClick( changeItemAfterClick )
-{
-  initialize();
-}
-
-/*!Constructor.*/
-SUIT_ToolButton::SUIT_ToolButton( const QPixmap & pm,
-                                        const QString &textLabel,
-                                        const QString& grouptext,
-                                        QObject * receiver,
-                                        const char* slot,
-                                        QToolBar * parent,
-                                        const char* name,
-                                        bool changeItemAfterClick)
- :QToolButton(pm, textLabel, grouptext, receiver, slot, parent, name),
-  myChangeItemAfterClick( changeItemAfterClick )
-{
-  initialize();
-}
-
-
-/*!Initialize tool buttons.*/
-void SUIT_ToolButton::initialize()
-{
-  mySignal = NULL;
-  myPopup = new QPopupMenu( this );
-  setPopup(myPopup);
-  connect( myPopup, SIGNAL(activated(int)), SLOT(OnSelectAction(int)) );
-  setPopupDelay(250);
-}
-
-/*!drawButton is redefined to draw DownArrow*/
-void SUIT_ToolButton::drawButton( QPainter * p )
-{
-  QToolButton::drawButton(p);
-
-//draw DownArrow
-  int x, y, w, h;
-  QStyle::visualRect(QRect(0, 0, width(), height()), this).rect( &x, &y, &w, &h );
-  style().drawPrimitive( QStyle::PE_ArrowDown,
-    p, QRect(x+w/2+3, y+h/2+3, w/2, h/2),   //QRect(x+(w-x)/2, y+(h-y)/2, w, h)
-    colorGroup(), isEnabled() );
-}
-
-
-/*! Add action into popup*/
-void SUIT_ToolButton::AddAction(QAction* theAction)
-{
-  bool aIsFirst = false;
-  if ( myPopup->count() == 0 ) 
-  {
-    aIsFirst = true;
-    setPixmap(theAction->iconSet().pixmap());
-    setTextLabel(theAction->text());
-    theAction->addTo( myPopup );
-    QMenuItem* aItem = myPopup->findItem(myPopup->idAt(0));
-    if (aItem != NULL) 
-    {
-      mySignal = aItem->signal();
-    }
-  }
-  else
-    theAction->addTo( myPopup );
-}
-
-/*! Sets myPopup item with theIndex as current*/
-void SUIT_ToolButton::SetItem(int theIndex)
-{
-  int anId = myPopup->idAt(theIndex);
-  if (anId != -1)
-  {
-    // Protection against unexpected null pointers returned
-    if ( myPopup->iconSet(anId) )
-      setPixmap(myPopup->iconSet(anId)->pixmap());
-    setTextLabel(myPopup->text(anId));
-    QMenuItem* aItem = myPopup->findItem(anId);
-    if (aItem != NULL) 
-    {
-      mySignal = aItem->signal();
-    }
-  }
-}
-
-/*!Public SLOT.
- * On select action (icon and text set with id = \a theItemID)
- */
-void SUIT_ToolButton::OnSelectAction(int theItemID)
-{
-  if (myChangeItemAfterClick)
-  {
-    // Protection against unexpected null pointers returned
-    if ( myPopup->iconSet(theItemID) )
-      setPixmap(myPopup->iconSet(theItemID)->pixmap());
-    setTextLabel(myPopup->text(theItemID));
-    QMenuItem* aItem = myPopup->findItem(theItemID);
-    if (aItem != NULL) 
-    {
-      mySignal = aItem->signal();
-    }
-  }
-}
-
-
-
-/*!On mouse release event.*/
-void SUIT_ToolButton::mouseReleaseEvent ( QMouseEvent * theEvent)
-{
-  QToolButton::mouseReleaseEvent(theEvent);
-  if (mySignal != NULL) 
-  {
-    mySignal->activate();
-  }
-}
-
-
diff --git a/src/SUIT/SUIT_ToolButton.h b/src/SUIT/SUIT_ToolButton.h
deleted file mode 100755 (executable)
index 10abe26..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef SUIT_TOOLBUTTON_H
-#define SUIT_TOOLBUTTON_H
-
-#include <qtoolbutton.h>
-#include <qaction.h>
-
-#include "SUIT.h"
-
-/*! To draw down arrow on toolbutton.*/
-class SUIT_EXPORT SUIT_ToolButton : public QToolButton
-{
-  Q_OBJECT
-
-public:
-  /*! @name constructors*/
-  //@{
-  SUIT_ToolButton( QWidget *parent = 0, 
-                   const char *name = 0,
-                   bool changeItemAfterClick = true );
-  SUIT_ToolButton(  const QPixmap & pm, const QString &textLabel,
-                    const QString& grouptext,
-                    QObject * receiver, const char* slot,
-                    QToolBar * parent, const char* name = 0,
-                    bool changeItemAfterClick = true );
-  //@}
-
-  void drawButton( QPainter * pQPainter);
-
-  void AddAction(QAction* theAction);
-
-  void SetItem(int theIndex);
-
-public slots:
-  void OnSelectAction(int theItemID);
-
-protected:
-  void  mouseReleaseEvent (QMouseEvent * theEvent);
-
-private:
-  void initialize();
-
-  QPopupMenu* myPopup;
-  QSignal* mySignal;
-  bool myChangeItemAfterClick;
-
-};
-
-#endif
-
index 953de65d4f20c4ac8bcb5df183f2331e499c7b8c..6a72ad284b3769a6ebbb86f8f87f318588154b7e 100755 (executable)
@@ -1,24 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_Tools.h"
 
-#include <qdir.h>
+#include <QDir>
 
 #include <stdio.h>
 #include <stdarg.h>
@@ -37,7 +40,7 @@ void SUIT_Tools::trace( const char* lpszLog, const char* lpszFormat, ... )
   tmpPath += QString( "Salome_trace" );
 
   FILE*        pStream;
-  pStream = fopen( lpszLog ? lpszLog : tmpPath.latin1(), "a" );
+  pStream = fopen( lpszLog ? lpszLog : (const char*)tmpPath.toLatin1(), "a" );
   if ( pStream ) 
   {    
     va_list argptr;
@@ -55,7 +58,7 @@ void SUIT_Tools::trace( const char* lpszLog, const char* lpszFormat, ... )
 */     
 QRect SUIT_Tools::makeRect( const int x1, const int y1, const int x2, const int y2 )
 {  
-  return QRect( QMIN( x1, x2 ), QMIN( y1, y2 ), QABS( x2 - x1 ), QABS( y2 - y1 ) );
+  return QRect( qMin( x1, x2 ), qMin( y1, y2 ), qAbs( x2 - x1 ), qAbs( y2 - y1 ) );
 }
 
 /*!
@@ -64,7 +67,7 @@ QRect SUIT_Tools::makeRect( const int x1, const int y1, const int x2, const int
 QFont SUIT_Tools::stringToFont( const QString& fontDescription )
 {
   QFont font;
-  if ( fontDescription.stripWhiteSpace().isEmpty() || !font.fromString( fontDescription ) )
+  if ( fontDescription.trimmed().isEmpty() || !font.fromString( fontDescription ) )
     font = QFont( "Courier", 11 );
   return font;
 }
index 62bc8d1633b08f7d94580b2f39337a19ce6eb100..ec252782682906afeefadb4957e3d42fb90144fd 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_TOOLS_H
 #define SUIT_TOOLS_H
@@ -23,9 +26,9 @@
 
 #include <Qtx.h>
 
-#include <qrect.h>
-#include <qfont.h>
-#include <qstring.h>
+#include <QRect>
+#include <QString>
+#include <QFont>
 
 /*!
   \class SUIT_Tools
diff --git a/src/SUIT/SUIT_TreeModel.cxx b/src/SUIT/SUIT_TreeModel.cxx
new file mode 100755 (executable)
index 0000000..718d425
--- /dev/null
@@ -0,0 +1,1674 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:   SUIT_TreeModel.cxx
+// Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#include "SUIT_TreeModel.h"
+#include "SUIT_TreeSync.h"
+#include "SUIT_DataObject.h"
+
+#include <QApplication>
+#include <QHash>
+
+SUIT_AbstractModel::SUIT_AbstractModel()
+{
+}
+
+SUIT_AbstractModel::operator const QAbstractItemModel*() const
+{
+  return dynamic_cast<const QAbstractItemModel*>( this );
+}
+
+SUIT_AbstractModel::operator QAbstractItemModel*()
+{
+  return dynamic_cast<QAbstractItemModel*>( this );
+}
+
+SUIT_AbstractModel::operator const QObject*() const
+{
+  return dynamic_cast<const QObject*>( this );
+}
+
+
+
+
+
+
+/*!
+  \class SUIT_TreeModel::TreeItem
+  \brief Internal class used for tree view synchronizaton with data object tree.
+  \internal
+*/
+
+class SUIT_TreeModel::TreeItem
+{
+public:
+  TreeItem( SUIT_DataObject* obj, TreeItem* parent = 0, TreeItem* after = 0 );
+  ~TreeItem();
+
+  void                  insertChild( TreeItem* child, TreeItem* after = 0 );
+  void                  removeChild( TreeItem* child );
+  SUIT_DataObject*      dataObject() const;
+  TreeItem*             parent() const;
+  int                   position() const;
+  int                   childCount() const;
+  TreeItem*             child( const int i );
+  QList<TreeItem*>      children() const;
+  TreeItem*             nextSibling() const;
+  TreeItem*             prevSibling() const;
+  
+private:
+  TreeItem*             myParent;
+  QList<TreeItem*>      myChildren;
+  SUIT_DataObject*      myObj;
+};
+
+/*!
+  \brief Constructor.
+  \internal
+  \param obj data object
+  \param parent parent item
+  \param after tree item after each this one should be inserted
+*/
+SUIT_TreeModel::TreeItem::TreeItem( SUIT_DataObject*          obj, 
+                                   SUIT_TreeModel::TreeItem* parent,
+                                   SUIT_TreeModel::TreeItem* after )
+: myParent( parent ),
+  myObj( obj )
+{
+  // Add <this> to the parent's children list
+  if ( myParent )
+    myParent->insertChild( this, after );
+}
+
+/*!
+  \brief Destructor. Deletes all child items recursively.
+  \internal
+*/
+SUIT_TreeModel::TreeItem::~TreeItem()
+{
+  // Ensure that all children are deleted;
+  // each child removes itself from the children list
+  while( myChildren.count() )
+    delete myChildren.at( 0 );
+
+  // Remove this item from the parent's children list
+  if ( myParent )
+    myParent->removeChild( this );
+}
+
+/*!
+  \brief Insert child item.
+  \internal
+  \param child child item being inserted
+  \param after tree item after each \a child should be inserted
+*/
+void SUIT_TreeModel::TreeItem::insertChild( SUIT_TreeModel::TreeItem* child, 
+                                           SUIT_TreeModel::TreeItem* after )
+{
+  if ( !child )
+    return;
+
+  int index = after ? myChildren.indexOf( after ) + 1 : 0;
+  myChildren.insert( index, child );
+}
+
+/*!
+  \brief Remove child item.
+  \internal
+  \param child child item being removed
+*/
+void SUIT_TreeModel::TreeItem::removeChild( SUIT_TreeModel::TreeItem* child )
+{
+  if ( !child )
+    return;
+  myChildren.removeAll( child );
+}
+
+/*!
+  \brief Get data object.
+  \internal
+  \return data object this item is associated to
+*/
+SUIT_DataObject* SUIT_TreeModel::TreeItem::dataObject() const
+{
+  return myObj;
+}
+
+/*!
+  \brief Get parent item.
+  \internal
+  \return parent item
+*/
+SUIT_TreeModel::TreeItem* SUIT_TreeModel::TreeItem::parent() const
+{
+  return myParent;
+}
+
+/*!
+  \brief Get position of this item in its parent's children list.
+  \internal
+  \return item position
+*/
+int SUIT_TreeModel::TreeItem::position() const
+{
+  return myParent ? myParent->myChildren.indexOf( (TreeItem*)this ) : -1;
+}
+
+/*!
+  \brief Get number of child items.
+  \internal
+  \return number of children
+*/
+int SUIT_TreeModel::TreeItem::childCount() const
+{
+  return myChildren.count();
+}
+
+/*!
+  \brief Get child item by specified index.
+  \internal
+  \param i child item index
+  \return child item or 0 if \a i is out of range
+*/
+SUIT_TreeModel::TreeItem* SUIT_TreeModel::TreeItem::child( const int i )
+{
+  return i >= 0 && i < myChildren.count() ? myChildren.at( i ) : 0;
+}
+
+/*!
+  \brief Get all child items.
+  \internal
+  \return list of child items
+*/
+QList<SUIT_TreeModel::TreeItem*> SUIT_TreeModel::TreeItem::children() const
+{
+  return myChildren;
+}
+
+/*!
+  \brief Get next sibling item.
+  \internal
+  \return next sibling item or 0 if there are no any
+*/
+SUIT_TreeModel::TreeItem* SUIT_TreeModel::TreeItem::nextSibling() const
+{
+  return parent() ? parent()->child( position()+1 ) : 0;
+}
+
+/*!
+  \brief Get previous sibling item.
+  \internal
+  \return previous sibling item or 0 if there are no any
+*/
+SUIT_TreeModel::TreeItem* SUIT_TreeModel::TreeItem::prevSibling() const
+{
+  return parent() ? parent()->child( position()-1 ) : 0;
+}
+
+/*!
+  \class SUIT_TreeModel::TreeSync
+  \brief Functor class for synchronizing data tree and tree model 
+         when the data tree is changed outside the model.
+  \internal
+*/
+
+class SUIT_TreeModel::TreeSync
+{
+public:
+  TreeSync( SUIT_TreeModel* );
+  bool              isEqual( const ObjPtr&, const ItemPtr& ) const;
+  ObjPtr            nullSrc() const;
+  ItemPtr           nullTrg() const;
+  ItemPtr           createItem( const ObjPtr&, const ItemPtr&, const ItemPtr& ) const;
+  void              updateItem( const ObjPtr&, const ItemPtr& ) const;
+  void              deleteItemWithChildren( const ItemPtr& ) const;
+  QList<ObjPtr>     children( const ObjPtr& ) const;
+  QList<ItemPtr>    children( const ItemPtr& ) const;
+  ItemPtr           parent( const ItemPtr& ) const;
+private:
+  bool              needUpdate( const ItemPtr& ) const;
+  SUIT_TreeModel*   myModel;
+};
+
+/*!
+  \brief Constructor.
+  \internal
+  \param model tree model
+*/
+SUIT_TreeModel::TreeSync::TreeSync( SUIT_TreeModel* model )
+: myModel( model )
+{
+}
+
+/*!
+  \brief Check if item corresponds to the specified data object.
+  \internal
+  \param obj data object
+  \param item tree item 
+  \return \c true if item corresponds to the data object
+*/
+bool SUIT_TreeModel::TreeSync::isEqual( const ObjPtr& obj, const ItemPtr& item ) const
+{
+  bool isRoot = obj == myModel->root() && item == myModel->rootItem(),
+       isEq   = obj && item && item->dataObject() == obj;
+  return isRoot || ( !obj && !item ) || isEq;
+}
+
+/*!
+  \brief Get null data object.
+  \internal
+  \return null data object
+*/
+SUIT_TreeModel::ObjPtr SUIT_TreeModel::TreeSync::nullSrc() const
+{
+  return 0;
+}
+
+/*!
+  \brief Get null tree item.
+  \internal
+  \return null tree item
+*/
+SUIT_TreeModel::ItemPtr SUIT_TreeModel::TreeSync::nullTrg() const
+{
+  return 0;
+}
+
+/*!
+  \brief Create an item corresponding to the specified data object.
+  \internal
+  \param obj data object
+  \param parent parent tree item
+  \param after tree item after each new one should be inserted
+  \return created item
+*/
+SUIT_TreeModel::ItemPtr SUIT_TreeModel::TreeSync::createItem( const ObjPtr&  obj,
+                                                             const ItemPtr& parent, 
+                                                             const ItemPtr& after ) const
+{
+  ItemPtr item = myModel ? myModel->createItem( obj, parent, after ) : 0;
+
+  // Additional actions that can't be performed by the model, e.g. expanded state
+  if( item )
+    obj->update();
+  return item;
+}
+
+/*!
+  \brief Update tree item.
+  \internal
+  \param obj reference data object
+  \param item tree item to be updated
+*/
+void SUIT_TreeModel::TreeSync::updateItem( const ObjPtr& obj, const ItemPtr& item ) const
+{
+  if( obj )
+    obj->update();
+  if ( item && needUpdate( item ) ) 
+    myModel->updateItem( item );
+}
+
+/*!
+  \brief Delete item with all children recursively.
+  \internal
+  \param item tree item
+*/
+void SUIT_TreeModel::TreeSync::deleteItemWithChildren( const ItemPtr& item ) const
+{
+  // NOTE: item is deleted inside removeItem()!
+  myModel->removeItem( item );
+}
+
+/*!
+  \brief Get all the children of the specified data object.
+  \internal
+  \param obj data object
+  \return list of the children
+*/
+QList<SUIT_TreeModel::ObjPtr> SUIT_TreeModel::TreeSync::children( const ObjPtr& obj ) const
+{
+  QList<ObjPtr> ch;
+  if ( obj )
+    ch = obj->children();
+  return ch;
+}
+
+/*!
+  \brief Get all the children of the specified tree item.
+  \internal
+  \param item tree item
+  \return list of the children
+*/
+QList<SUIT_TreeModel::ItemPtr> SUIT_TreeModel::TreeSync::children( const ItemPtr& item ) const
+{
+  QList<ItemPtr> ch;
+  if ( item ) 
+    ch = item->children();
+  return ch;
+}
+
+/*!
+  \brief Get item which is the parent for the specified item.
+  \internal
+  \param item tree item
+  \return parent item
+*/
+SUIT_TreeModel::ItemPtr SUIT_TreeModel::TreeSync::parent( const ItemPtr& item ) const
+{
+  return item ? item->parent() : 0;
+}
+
+/*!
+  \brief Check if the tree item needs updating.
+  \internal
+  \param item tree item to be checked
+  \return \c true if item needs updating
+
+  \todo finalize this method
+*/
+bool SUIT_TreeModel::TreeSync::needUpdate( const ItemPtr& item ) const
+{
+  bool update = false;
+  if ( item ) {
+    SUIT_DataObject* obj = item->dataObject();
+    if ( obj ) {
+      // TODO: find simplified way to check if an item is not up-to-date:
+      // - use check-sum of various item data
+      // - use "LastModified" time stamp in data objects and tree items - hardly possible, for sometimes data objects do not know that data changes...
+      // ...
+      update = true; // TEMPORARY!!!
+      // 1. check text
+/*      update = ( item->text( 0 ) != obj->name() ) || myBrowser->needToUpdateTexts( item );
+
+      if ( !update ) { 
+       // 2. check pixmap (compare serialNumber()-s)
+       QPixmap objPix = obj->icon();
+       const QPixmap* itemPix = item->pixmap( 0 );
+       update = (  objPix.isNull() && (  itemPix && !itemPix->isNull() ) ) || 
+                ( !objPix.isNull() && ( !itemPix ||  itemPix->isNull() ) ); 
+       if ( !update && !objPix.isNull() && itemPix && !itemPix->isNull() ) {
+         int aIconW = objPix.width();
+         if( aIconW > 20 ) {
+           QWMatrix aM;
+           double aScale = 20.0 / aIconW;
+           aM.scale( aScale, aScale );
+           objPix = objPix.xForm( aM );
+         }
+         update = ( objPix.serialNumber() != itemPix->serialNumber() );
+       }
+      }*/
+    }
+  }
+  return update;
+}
+
+/*!
+  \class SUIT_TreeModel
+  \brief Implementation of the model/view API based on the tree of SUIT_DataObject class
+  instances.
+
+  The SUIT_TreeModel class does not support insertion/removal of rows. It is synchronized 
+  automatically with the tree of data objects used by SUIT-based applications to 
+  expose their data in a hierarchical form to the user.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent object
+*/
+SUIT_TreeModel::SUIT_TreeModel( QObject* parent )
+: QAbstractItemModel( parent ),
+  myRoot( 0 ),
+  myRootItem( 0 ),
+  myAutoDeleteTree( false ),
+  myAutoUpdate( true )
+{
+  initialize();
+}
+
+/*!
+  \brief Constructor.
+  \param root root data object
+  \param parent parent object
+*/
+SUIT_TreeModel::SUIT_TreeModel( SUIT_DataObject* root, QObject* parent )
+: QAbstractItemModel( parent ),
+  myRoot( root ),
+  myRootItem( 0 ),
+  myAutoDeleteTree( false ),
+  myAutoUpdate( true )
+{
+  initialize();
+}
+
+/*!
+  \brief Destructor
+*/
+SUIT_TreeModel::~SUIT_TreeModel()
+{
+  if ( autoDeleteTree() ) {
+    SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
+                                this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+    SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
+                                this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+    delete myRoot;
+  }
+
+  delete myRootItem;
+}
+
+/*!
+  \brief Register new column in the model
+  \param group_id - unique data object group identificator
+  \param name - translated column name
+  \param custom_id - custom column id that should be passed into method SUIT_DataObject::data()
+ */
+void SUIT_TreeModel::registerColumn( const int group_id, const QString& name, const int custom_id )
+{
+  bool found = false;
+  for( int i=0, n=myColumns.size(); i<n && !found; i++ )
+    if( name==myColumns[i].myName )
+       {
+         myColumns[i].myIds.insert( group_id, custom_id );
+         found = true;
+       }
+  if( !found )
+  {
+       ColumnInfo inf;
+       inf.myName = name;
+       inf.myIds.insert( group_id, custom_id );
+       inf.myAppropriate = Qtx::Shown;
+       int n = myColumns.size();
+       myColumns.resize( n+1 );
+       myColumns[n] = inf;
+       reset();
+  }
+}
+
+/*!
+  \brief Remove column from the model
+
+  Please take into account that column is removed only for given group_id, it means
+  that information of data objects with such group_id won't be shown.
+  If there is not any registered group_id for this column after removing, the column will be hidden
+  otherwise it continue to be shown
+
+  \param group_id - unique data object identificator allowing the classification of objects 
+  \param name - translated column name
+ */
+void SUIT_TreeModel::unregisterColumn( const int group_id, const QString& name )
+{
+  for( int i=0, n=myColumns.size(); i<n; i++ )
+    if( myColumns[i].myName==name )
+       {
+         myColumns[i].myIds.remove( group_id );
+         if( myColumns[i].myIds.isEmpty() )
+         {
+           myColumns.remove( i );
+               reset();
+         }
+         break;
+    }
+}
+
+/*!
+  \brief Change column icon.
+
+  \param name - column name
+  \param icon - new icon of the specified column
+*/
+void SUIT_TreeModel::setColumnIcon( const QString& name, const QPixmap& icon )
+{
+  for( int i=0, n=myColumns.size(); i<n; i++ )
+    if( myColumns[i].myName==name )
+       {
+         myColumns[i].myIcon = icon;
+         break;
+       }
+}
+
+/*!
+  \brief Get column icon.
+
+  \param name - column name
+  \return icon of the specified column
+*/
+QPixmap SUIT_TreeModel::columnIcon( const QString& name ) const
+{
+  QPixmap res;
+  for( int i=0, n=myColumns.size(); i<n; i++ )
+    if( myColumns[i].myName==name )
+       {
+         res = myColumns[i].myIcon;
+         break;
+       }
+  return res;
+}
+
+/*!
+  \brief Change appropriate status
+  
+  Appropriate status determines if the column should appear in the tree view header popup menu
+  (to show/hide the column).
+
+  If appropriate status is not specified yet, the \c Shown value is taken,
+  it means that column should be always visible.
+
+  \param name - column name
+  \param appr - new appropriate status
+*/
+void SUIT_TreeModel::setAppropriate( const QString& name, const Qtx::Appropriate appr )
+{
+  for( int i=0, n=myColumns.size(); i<n; i++ )
+    if( myColumns[i].myName==name )
+       {
+         myColumns[i].myAppropriate = appr;
+         emit headerDataChanged( Qt::Horizontal, i, i );
+         break;
+       }
+}
+
+/*!
+  \brief Check if the column should appear in the tree view header popup menu
+  (to show/hide the column).
+
+  Default implementation (if appropriate status is not specified yet)
+  returns \c Shown, it means that column should be always visible.
+
+  \param name - column name
+  \return appropriate status
+*/
+Qtx::Appropriate SUIT_TreeModel::appropriate( const QString& name ) const
+{
+  Qtx::Appropriate appr = Qtx::Shown;
+  for( int i=0, n=myColumns.size(); i<n; i++ )
+    if( myColumns[i].myName==name )
+       {
+         appr = myColumns[i].myAppropriate;
+         break;
+       }
+  return appr;
+}
+
+
+/*!
+  \brief Get data tree root object.
+  \return data tree root
+  \sa setRoot()
+*/
+SUIT_DataObject* SUIT_TreeModel::root() const
+{
+  return myRoot;
+}
+
+/*!
+  \brief Set data tree root object.
+  \param r new data tree root
+  \sa root()
+*/
+void SUIT_TreeModel::setRoot( SUIT_DataObject* r )
+{
+  if ( root() == r )
+    return;
+
+  if ( autoDeleteTree() ) {
+    SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
+                                this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+    SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
+                                this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+    delete myRoot;
+  }
+
+  myRoot = r;
+
+  //initialize();
+  reset();
+  emit modelUpdated();
+}
+
+/*!
+  \brief Get data for the specified model index and data role.
+  \param index model index
+  \param role data role
+  \return requested data
+  \sa setData()
+*/
+QVariant SUIT_TreeModel::data( const QModelIndex& index, int role ) const
+{
+  if ( !index.isValid() )
+    return QVariant();
+
+  SUIT_DataObject* obj = object( index );
+
+  QColor c;
+  QVariant val;
+
+  int obj_group_id = obj->groupId();
+  const ColumnInfo& inf = myColumns[index.column()];
+
+  int id = -1;
+  if( inf.myIds.contains( 0 ) )
+    id = inf.myIds[0];
+  if( inf.myIds.contains( obj_group_id ) )
+    id = inf.myIds[obj_group_id];
+
+  if( id<0 )
+    return QVariant();
+
+  if ( obj )
+  {
+    switch ( role )
+       {
+    case DisplayRole:
+      // data object text for the specified column
+      val = obj->text( id ); 
+      break;
+    case DecorationRole:
+      // data object icon for the specified column
+      val = obj->icon( id ); 
+      break;
+    case ToolTipRole:
+      // data object tooltip for the specified column
+      val = obj->toolTip( id ); 
+      break;
+    case StatusTipRole:
+      // data object status tip for the specified column
+      val = obj->statusTip( id ); 
+      break;
+    case WhatsThisRole:
+      // data object what's this info for the specified column
+      val = obj->whatsThis( id ); 
+      break;
+    case FontRole:
+      // data object font for the specified column
+      val = obj->font( id ); 
+      break;
+    case TextAlignmentRole:
+      // data object text alignment for the specified column
+      val = obj->alignment( id ); 
+      break;
+    case BackgroundRole:
+      // data background color for the specified column
+      c = obj->color( SUIT_DataObject::Background, id );
+      if( !c.isValid() ) // default value
+           c = QApplication::palette().color( QPalette::Base );
+      c.setAlpha( 0 );
+      val = c; 
+      break;
+    case ForegroundRole:
+      // data foreground (text) color for the specified column
+      c = obj->color( SUIT_DataObject::Foreground, id );
+      if( !c.isValid() ) // default value
+           c = QApplication::palette().color( QPalette::Foreground );
+      val = c; 
+      break;
+    case BaseColorRole:
+      // editor background color for the specified column
+      c = obj->color( SUIT_DataObject::Base, id );
+      if( !c.isValid() ) // default value
+           c = QApplication::palette().color( QPalette::Base );
+      val = c; 
+      break;
+    case TextColorRole:
+      // editor foreground (text) color for the specified column
+      c = obj->color( SUIT_DataObject::Text, id );
+      if( !c.isValid() ) // default value
+           c = QApplication::palette().color( QPalette::Text );
+      val = c; 
+      break;
+    case HighlightRole:
+      // adta object highlighted background color for the specified column
+      c = obj->color( SUIT_DataObject::Highlight, id );
+      if( !c.isValid() ) // default value
+           c = QApplication::palette().color( QPalette::Highlight );
+      val = c; 
+      break;
+    case HighlightedTextRole:
+      // data object highlighted foreground (text) color for the specified column
+      c = obj->color( SUIT_DataObject::HighlightedText, id );
+      if( !c.isValid() ) // default value
+           c = QApplication::palette().color( QPalette::HighlightedText );
+      val = c; 
+      break;
+    case CheckStateRole:
+      // data object checked state for the specified column
+      // NOTE! three-state check is not supported currently
+      if( obj->isCheckable( id ) )
+           val = obj->isOn( id ) ? Qt::Checked : Qt::Unchecked; 
+      break;
+    case SizeHintRole:
+      // data size hint
+      // NOTE! not supported currently
+      break;
+    default:
+      break;
+    } // ... switch ( role ) ...
+  } // ... if ( obj ) ...
+  return val;
+}
+
+/*!
+  \brief Set data for the specified model index and data role.
+  \param index model index
+  \param value new data value
+  \param role data role
+  \return \c true if data is set
+  \sa data()
+*/
+bool SUIT_TreeModel::setData( const QModelIndex& index, 
+                             const QVariant& value, int role )
+{
+  if ( index.isValid() && value.isValid() ) {
+    SUIT_DataObject* obj = object( index );
+    if ( obj ) {
+      // NOTE! only 'check state' data is supported by default
+      switch ( role ) {
+      case CheckStateRole:
+       // checked state
+       if ( obj->isCheckable( index.column() ) ) {
+         obj->setOn( value.toBool(), index.column() );
+         emit( dataChanged( index, index ) );
+         return true;
+       }
+       break;
+      default:
+       break;
+      }
+    }
+  }
+  return QAbstractItemModel::setData( index, value, role );
+}
+
+/*!
+  \brief Get data flags for specified model index.
+  \param index model index
+  \return data flags
+*/
+Qt::ItemFlags SUIT_TreeModel::flags( const QModelIndex& index ) const
+{
+  if ( !index.isValid() )
+    return 0;
+
+  SUIT_DataObject* obj = object( index );
+  Qt::ItemFlags f = 0;
+
+  if ( obj ) {
+    // data object is enabled
+    if ( obj->isEnabled() )
+      f = f | Qt::ItemIsEnabled;
+
+    // data object is selectable
+    if ( obj->isSelectable() )
+      f = f | Qt::ItemIsSelectable;
+
+    // data object is checkable
+    if ( obj->isCheckable( index.column() ) )
+      f = f | Qt::ItemIsUserCheckable;
+  }
+  return f;
+}
+
+/*!
+  \brief Get header data (can be used in any data view).
+  \param column column number
+  \param orientation header orientation
+  \param role data role
+  \return header data
+*/
+QVariant SUIT_TreeModel::headerData( int column, Qt::Orientation orientation, int role ) const
+{
+  QVariant d;
+  // NOTE! only horizontal header is supported
+  if ( root() && orientation == Qt::Horizontal )
+  {
+    switch ( role )
+       {
+    case DisplayRole:
+      // column title
+      d = myColumns[column].myName;
+      break;
+    case DecorationRole:
+      // column icon
+      d = myColumns[column].myIcon;
+      break;
+    case AppropriateRole:
+      // appropriate flag (can column be hidden via context popup menu)
+      d = myColumns[column].myAppropriate;
+      break;
+    default:
+      break;
+    }
+  }
+  return d;
+}
+
+/*!
+  \brief Create model index.
+  \param row data row
+  \param column data column
+  \param parent parent model index
+  \return model index
+*/
+QModelIndex SUIT_TreeModel::index( int row, int column, 
+                                  const QModelIndex& parent ) const
+{
+  if( hasIndex( row, column, parent ) )
+  {
+    TreeItem* parentItem = treeItem( parent );
+    if( parentItem )
+    {
+      TreeItem* childItem = parentItem->child( row );
+      if( childItem )
+       return createIndex( row, column, childItem );
+    }
+  }
+  return QModelIndex();
+}
+
+/*!
+  \brief Get parent model index.
+  \param index model index
+  \return parent model index
+*/
+QModelIndex SUIT_TreeModel::parent( const QModelIndex& index ) const
+{
+  if ( !index.isValid() )
+    return QModelIndex();
+
+  TreeItem* childItem = treeItem( index );
+  TreeItem* parentItem = childItem ? childItem->parent() : 0;
+
+  if ( !parentItem || parentItem == rootItem() )
+    return QModelIndex();
+
+  return createIndex( parentItem->position(), 0, parentItem );
+}
+
+/*!
+  \brief Get number of data columns.
+  \param parent parent model index (not used)
+  \return data columns number
+  \sa rowCount()
+*/
+int SUIT_TreeModel::columnCount( const QModelIndex& /*parent*/ ) const
+{
+  return myColumns.size();
+}
+
+/*!
+  \brief Get number of data rows (children of the specified model index).
+  \param parent parent model index
+  \return data rows (children) number
+  \sa columnCount()
+*/
+int SUIT_TreeModel::rowCount( const QModelIndex& parent ) const
+{
+  if ( parent.column() > 0 )
+    return 0;
+
+  TreeItem* parentItem = treeItem( parent );
+
+  return parentItem ? parentItem->childCount() : 0;
+}
+
+/*!
+  \brief Get data object by the specified model index.
+  \param index model index
+  \return data object corresponding to the model index
+*/
+SUIT_DataObject* SUIT_TreeModel::object( const QModelIndex& index ) const
+{
+  return object( treeItem( index ) );
+}
+
+/*!
+  \brief Get model index by the specified data object.
+  \param obj data object
+  \param column data object column
+  \return model index
+*/
+QModelIndex SUIT_TreeModel::index( const SUIT_DataObject* obj, int column ) const
+{
+  if ( obj == root() )
+    return QModelIndex();
+
+  TreeItem* item = treeItem( obj );
+
+  return item ? createIndex( item->position(), column, item ) : QModelIndex();
+}
+
+/*!
+  \brief Get 'auto-delete data tree' flag value.
+  \return 'auto-delete data tree' flag value
+  \sa setAutoDeleteTree()
+*/
+bool SUIT_TreeModel::autoDeleteTree() const
+{
+  return myAutoDeleteTree;
+}
+
+/*!
+  \brief Set 'auto-delete data tree' flag value.
+
+  If this flag is set to \c true, the data tree is deleted when
+  the tree model is destroyed. Default value for this flag is \c false.
+
+  \param on 'auto-delete data tree' flag value
+  \sa autoDeleteTree()
+*/
+void SUIT_TreeModel::setAutoDeleteTree( const bool on )
+{
+  myAutoDeleteTree = on;
+}
+
+/*!
+  \brief Get 'auto-update tree' flag value.
+  \return 'auto-update tree' flag value
+  \sa setAutoUpdate(), updateTree()
+*/
+bool SUIT_TreeModel::autoUpdate() const
+{
+  return myAutoUpdate;
+}
+
+/*!
+  \brief Set 'auto-update tree' flag value.
+
+  If this flag is set to \c true (by default), the model is updated
+  automatically when data tree is changed.
+
+  \param on 'auto-update tree' flag value
+  \sa autoUpdate(), updateTree()
+*/
+void SUIT_TreeModel::setAutoUpdate( const bool on )
+{
+  if ( myAutoUpdate == on )
+    return;
+
+  SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
+                              this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+  SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
+                              this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+  myAutoUpdate = on;
+
+  if ( myAutoUpdate ) {
+    SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
+                             this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+    SUIT_DataObject::connect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
+                             this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+
+    updateTree();
+  }
+}
+
+
+/*!
+  \brief Check if the specified column supports custom sorting.
+  \param column column index on which data is being sorted
+  \return \c true if column requires custom sorting
+  \sa lessThan()
+*/
+bool SUIT_TreeModel::customSorting( const int column ) const
+{
+  return root() ? root()->customSorting( column ) : false;
+}
+
+/*!
+  \brief Compares two model indexes for the sorting purposes.
+
+  This method is called only for those columns for which customSorting()
+  method returns \c true.
+
+  \param left first index to compare
+  \param right second index to compare
+  \return result of the comparison
+  \sa customSorting()
+*/
+bool SUIT_TreeModel::lessThan( const QModelIndex& left, const QModelIndex& right ) const
+{
+  QVariant ldata = data( left );
+  QVariant rdata = data( right );
+  return root() ? root()->compare( ldata, rdata, left.column() ) : false;
+}
+
+/*!
+  \brief Get item delegate for the model.
+  \return new item delegate
+*/
+QAbstractItemDelegate* SUIT_TreeModel::delegate() const
+{
+  return new SUIT_ItemDelegate( const_cast<SUIT_TreeModel*>( this ) );
+}
+
+/*!
+  \brief Update tree model.
+
+  Call this method when data tree is changed outside the model.
+  If the 'auto-update' flag is set to \c true, the model
+  is updated automatically when the data tree is changed.
+
+  \param index starting index for the updating
+  \sa setAutoUpdate()
+*/
+void SUIT_TreeModel::updateTree( const QModelIndex& index )
+{
+  updateTree( object( index ) );
+}
+
+/*!
+  \brief Update tree model.
+
+  Call this method when data tree is changed outside the model.
+  If the 'auto-update' flag is set to \c true, the model
+  is updated automatically when the data tree is changed.
+
+  \param obj starting data object for the updating
+  \sa setAutoUpdate()
+*/
+void SUIT_TreeModel::updateTree( SUIT_DataObject* obj )
+{
+  if ( !obj )
+    obj = root();
+
+  else if ( obj->root() != root() )
+    return;
+
+  synchronize<ObjPtr,ItemPtr,SUIT_TreeModel::TreeSync>( obj, 
+                                                       treeItem( obj ), 
+                                                       SUIT_TreeModel::TreeSync( this ) );
+  emit modelUpdated();
+}
+
+/*!
+  \brief Initialize tree model.
+*/
+void SUIT_TreeModel::initialize()
+{
+  SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
+                              this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+  SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
+                              this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+  if ( autoUpdate() ) {
+    SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
+                             this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+    SUIT_DataObject::connect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
+                             this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+  }
+
+  myItems.clear(); // ????? is it really necessary
+
+  if ( !myRootItem )
+    myRootItem = new TreeItem( 0 );
+
+  registerColumn( 0, QObject::tr( "NAME_COLUMN" ), SUIT_DataObject::NameId );
+  updateTree();
+}
+
+/*!
+  \brief Get root tree item.
+  \return root tree item
+*/
+SUIT_TreeModel::TreeItem* SUIT_TreeModel::rootItem() const
+{
+  return myRootItem;
+}
+
+/*!
+  \brief Get tree item corresponding to the specified model index.
+  \param index model index
+  \return tree item or root item if index is invalid
+*/
+SUIT_TreeModel::TreeItem* SUIT_TreeModel::treeItem( const QModelIndex& index ) const
+{
+  return index.isValid() ? static_cast<TreeItem*>( index.internalPointer() ) : rootItem();
+}
+
+/*!
+  \brief Get tree item corresponding to the specified data object.
+  \param obj data object
+  \return tree item or 0 if there is no tree item corresponding to \a obj
+*/
+SUIT_TreeModel::TreeItem* SUIT_TreeModel::treeItem( const SUIT_DataObject* obj ) const
+{
+  TreeItem* item = 0;
+
+  if ( obj == root() )
+    item = rootItem();
+  else if ( myItems.contains( const_cast<SUIT_DataObject*>( obj ) ) )
+    item = myItems[ const_cast<SUIT_DataObject*>( obj ) ];
+
+  return item;
+}
+
+/*!
+  \brief Get data object corresponding to the specified tree item.
+  \param item tree item
+  \return data object or 0 if there is no data object corresponding to \a item
+*/
+SUIT_DataObject* SUIT_TreeModel::object( const SUIT_TreeModel::TreeItem* item ) const
+{
+  if ( item == rootItem() )
+    return root();
+  SUIT_DataObject* obj = item ? item->dataObject() : 0;
+  return myItems.contains( obj ) ? obj : 0;
+}
+
+/*!
+  \brief Create an item corresponding to the data object.
+  \param obj source data object
+  \param parent parent tree item
+  \param after tree item after which new item should be inserted
+  \return created tree item or 0 if item could not be created
+*/
+SUIT_TreeModel::TreeItem* SUIT_TreeModel::createItem( SUIT_DataObject* obj,
+                                                     SUIT_TreeModel::TreeItem* parent, 
+                                                     SUIT_TreeModel::TreeItem* after )
+{
+  if ( !obj )
+    return 0;
+
+  SUIT_DataObject* parentObj = object( parent );
+  QModelIndex parentIdx = index( parentObj );
+
+  SUIT_DataObject* afterObj = after ? object( after ) : 0;
+  int row = afterObj ? afterObj->position() + 1 : 0;
+
+  beginInsertRows( parentIdx, row, row );
+
+  myItems[ obj ] = new TreeItem( obj, parent, after );
+
+  endInsertRows();
+
+  return myItems[ obj ];
+}
+
+/*!
+  \brief Update tree item.
+  \param item tree item to be updated
+*/
+void SUIT_TreeModel::updateItem( SUIT_TreeModel::TreeItem* item )
+{
+  if ( !item )
+    return;
+  
+  SUIT_DataObject* obj = object( item );
+  if ( !obj )
+    return;
+  
+  // update all columns corresponding to the given data object
+  QModelIndex firstIdx = index( obj, 0 );
+  QModelIndex lastIdx  = index( obj, columnCount() - 1 );
+  emit dataChanged( firstIdx, lastIdx );
+}
+
+/*!
+  \brief Remove tree item (recursively).
+  \param item tree item to be removed
+*/
+void SUIT_TreeModel::removeItem( SUIT_TreeModel::TreeItem* item )
+{
+  if ( !item )
+    return;
+
+  // Remove list view items from <myItems> recursively for all children.
+  // Otherwise, "delete item" line below will destroy all item's children,
+  // and <myItems> will contain invalid pointers
+  while( item->childCount() )
+    removeItem( item->child( 0 ) );
+
+  SUIT_DataObject* obj = object( item );
+  
+  // Warning! obj can be deleted at this point!
+
+  SUIT_DataObject* parentObj = object( item->parent() );
+  QModelIndex parentIdx = index( parentObj, 0 );
+  int row = item->position();
+  
+  beginRemoveRows( parentIdx, row, row );
+  myItems.remove( obj );
+
+  if ( obj == root() )
+    setRoot( 0 );
+  else if ( item->parent() )
+    item->parent()->removeChild( item );
+
+  delete item;
+
+  endRemoveRows();
+}
+
+/*!
+  \brief Called when the data object is inserted to the tree.
+  \param object data object being inserted
+  \param parent parent data object
+*/
+void SUIT_TreeModel::onInserted( SUIT_DataObject* /*object*/, SUIT_DataObject* parent )
+{
+  if ( autoUpdate() )
+    updateTree( parent );
+}
+
+/*!
+  \brief Called when the data object is removed from the tree.
+  \param object data object being removed
+  \param parent parent data object
+*/
+void SUIT_TreeModel::onRemoved( SUIT_DataObject* /*object*/, SUIT_DataObject* parent )
+{
+  if ( autoUpdate() )
+    updateTree( parent );
+}
+
+/*!
+  \class SUIT_ProxyModel
+  \brief Proxy model which can be used above the SUIT_TreeMovel class
+  to enable custom sorting/filtering of the data.
+
+  The SUIT_TreeModel class does not support custom sorting/filtering of the data.
+  To use these features, the SUIT_ProxyModel class can be used as top-level
+  wrapper for the SUIT_DataObject-based data tree model.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent object
+*/
+SUIT_ProxyModel::SUIT_ProxyModel( QObject* parent )
+: QSortFilterProxyModel( parent ),
+  mySortingEnabled( true )
+{
+  SUIT_TreeModel* model = new SUIT_TreeModel( this );
+  connect( model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) );
+  setSourceModel( model );
+}
+
+/*!
+  \brief Constructor.
+  \param root root data object
+  \param parent parent object
+*/
+SUIT_ProxyModel::SUIT_ProxyModel( SUIT_DataObject* root, QObject* parent )
+: QSortFilterProxyModel( parent ),
+  mySortingEnabled( true )
+{
+  SUIT_TreeModel* model = new SUIT_TreeModel( root, this );
+  connect( model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) );
+  setSourceModel( model );
+}
+
+/*!
+  \brief Constructor.
+  \param model tree model
+  \param parent parent object
+*/
+SUIT_ProxyModel::SUIT_ProxyModel( SUIT_AbstractModel* model, QObject* parent )
+: QSortFilterProxyModel( parent ),
+  mySortingEnabled( true )
+{
+  connect( *model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) );
+  setSourceModel( *model );
+}
+
+/*!
+  \brief Destructor.
+*/
+SUIT_ProxyModel::~SUIT_ProxyModel()
+{
+}
+
+/*!
+  \brief Get data tree root object.
+  \return data tree root
+  \sa setRoot()
+*/
+SUIT_DataObject* SUIT_ProxyModel::root() const
+{
+  return treeModel() ? treeModel()->root() : 0;
+}
+
+/*!
+  \brief Set data tree root object.
+  \param r new data tree root
+  \sa root()
+*/
+void SUIT_ProxyModel::setRoot( SUIT_DataObject* r )
+{
+  if ( treeModel() )
+    treeModel()->setRoot( r );
+}
+
+/*!
+  \brief Get data object by the specified model index.
+  \param index model index
+  \return data object corresponding to the model index
+*/
+SUIT_DataObject* SUIT_ProxyModel::object( const QModelIndex& index ) const
+{
+  return treeModel() ? treeModel()->object( mapToSource( index ) ) : 0;
+}
+
+/*!
+  \brief Get model index by the specified data object.
+  \param obj data object
+  \param column data object column
+  \return model index
+*/
+QModelIndex SUIT_ProxyModel::index( const SUIT_DataObject* obj, int column ) const
+{
+  return treeModel() ? mapFromSource( treeModel()->index( obj, column ) ) : QModelIndex();
+}
+
+/*!
+  \brief Get 'auto-delete data tree' flag value.
+  \return 'auto-delete data tree' flag value
+  \sa setAutoDeleteTree()
+*/
+bool SUIT_ProxyModel::autoDeleteTree() const
+{
+  return treeModel() ? treeModel()->autoDeleteTree() : false;
+}
+
+/*!
+  \brief Set 'auto-delete data tree' flag value.
+
+  If this flag is set to \c true, the data tree is deleted when
+  the tree model is destroyed. Default value for this flag is \c false.
+
+  \param on 'auto-delete data tree' flag value
+  \sa autoDeleteTree()
+*/
+void SUIT_ProxyModel::setAutoDeleteTree( const bool on )
+{
+  if ( treeModel() )
+    treeModel()->setAutoDeleteTree( on );
+}
+
+/*!
+  \brief Get 'auto-update tree' flag value.
+  \return 'auto-update tree' flag value
+  \sa setAutoUpdate(), updateTree()
+*/
+bool SUIT_ProxyModel::autoUpdate() const
+{
+  return treeModel() ? treeModel()->autoUpdate() : false;
+}
+
+/*!
+  \brief Set 'auto-update tree' flag value.
+
+  If this flag is set to \c true (by default), the model is updated
+  automatically when data tree is changed.
+
+  \param on 'auto-update tree' flag value
+  \sa autoUpdate(), updateTree()
+*/
+void SUIT_ProxyModel::setAutoUpdate( const bool on )
+{
+  if ( treeModel() )
+    treeModel()->setAutoUpdate( on );
+}
+
+/*!
+  \brief Check if sorting is enabled.
+  \return \c true if sorting is enabled
+  \sa setSortingEnabled()
+*/
+bool SUIT_ProxyModel::isSortingEnabled() const
+{
+  return mySortingEnabled;
+}
+
+/*!
+  \brief Get item delegate for the model.
+  \return new item delegate
+*/
+QAbstractItemDelegate* SUIT_ProxyModel::delegate() const
+{
+  return treeModel() ? treeModel()->delegate() : 0;
+}
+
+/*!
+  \brief Update tree model.
+
+  Call this method when data tree is changed outside the model.
+  If the 'auto-update' flag is set to \c true, the model
+  is updated automatically when the data tree is changed.
+
+  \param index starting index for the updating
+  \sa setAutoUpdate()
+*/
+void SUIT_ProxyModel::updateTree( const QModelIndex& index )
+{
+  if ( treeModel() )
+    treeModel()->updateTree( mapToSource( index ) );
+}
+
+/*!
+  \brief Update tree model.
+
+  Call this method when data tree is changed outside the model.
+  If the 'auto-update' flag is set to \c true, the model
+  is updated automatically when the data tree is changed.
+
+  \param obj starting data object for the updating
+  \sa setAutoUpdate()
+*/
+void SUIT_ProxyModel::updateTree( SUIT_DataObject* obj )
+{
+  if ( treeModel() )
+    treeModel()->updateTree( obj );
+}
+
+/*!
+  \brief Compares two model indexes for the sorting purposes.
+  \param left first index to compare
+  \param right second index to compare
+  \return result of the comparison
+*/
+bool SUIT_ProxyModel::lessThan( const QModelIndex& left, const QModelIndex& right ) const
+{
+  if ( !isSortingEnabled() && left.isValid() && right.isValid() ) {
+    return left.row() < right.row();
+  }
+  if ( treeModel() && treeModel()->customSorting( left.column() ) ) {
+    return treeModel()->lessThan( left, right );
+  }
+  return QSortFilterProxyModel::lessThan( left, right );
+}
+
+/*!
+  \brief Check if the specified column supports custom sorting.
+  \param column column index on which data is being sorted
+  \return \c true if column requires custom sorting
+  \sa lessThan()
+*/
+bool SUIT_ProxyModel::customSorting( const int column ) const
+{
+  return treeModel() ? treeModel()->customSorting( column ) : false;
+}
+
+/*!
+  \brief Enable/disable sorting.
+  \param enabled new flag state
+  \sa isSortingEnabled()
+*/
+void SUIT_ProxyModel::setSortingEnabled( bool enabled )
+{
+  mySortingEnabled = enabled;
+  clear();
+}
+
+/*
+  \brief Get tree model.
+  \return tree model
+*/
+SUIT_AbstractModel* SUIT_ProxyModel::treeModel() const
+{
+  return dynamic_cast<SUIT_AbstractModel*>( sourceModel() );
+}
+
+/*!
+  \brief Register new column in the model
+  \param group_id - unique data object identificator allowing the classification of objects 
+  \param name - translated column name
+  \param custom_id - custom column id that should be passed into method SUIT_DataObject::data()
+ */
+void SUIT_ProxyModel::registerColumn( const int group_id, const QString& name, const int custom_id )
+{
+  if( treeModel() )
+    treeModel()->registerColumn( group_id, name, custom_id );
+}
+
+/*!
+  \brief Remove column from the model
+
+  Please take into account that column is removed only for given group_id, it means
+  that information of data objects with such group_id won't be shown.
+  If there is not any registered group_id for this column after removing, the column will be hidden
+  otherwise it continue to be shown
+
+  \param group_id - unique data object identificator allowing the classification of objects 
+  \param name - translated column name
+ */
+void SUIT_ProxyModel::unregisterColumn( const int group_id, const QString& name )
+{
+  if( treeModel() )
+    treeModel()->unregisterColumn( group_id, name );
+}
+
+/*!
+  \brief Change column icon.
+
+  \param name - column name
+  \param icon - new icon of the specified column
+*/
+void SUIT_ProxyModel::setColumnIcon( const QString& name, const QPixmap& icon )
+{
+  if( treeModel() )
+    treeModel()->setColumnIcon( name, icon );
+}
+
+/*!
+  \brief Get column icon.
+
+  \param name - column name
+  \return icon of the specified column
+*/
+QPixmap SUIT_ProxyModel::columnIcon( const QString& name ) const
+{
+  return treeModel() ? treeModel()->columnIcon( name ) : QPixmap();
+}
+
+/*!
+  \brief Change appropriate status
+  
+  Appropriate status determines if the column should appear in the tree view header popup menu
+  (to show/hide the column).
+
+  If appropriate status is not specified yet, the \c Shown value is taken,
+  it means that column should be always visible.
+
+  \param name - column name
+  \param appr - new appropriate status
+*/
+void SUIT_ProxyModel::setAppropriate( const QString& name, const Qtx::Appropriate appr )
+{
+  if( treeModel() )
+    treeModel()->setAppropriate( name, appr );
+}
+
+/*!
+  \brief Check if the column should appear in the tree view header popup menu
+  (to show/hide the column).
+
+  Default implementation (if appropriate status is not specified yet)
+  returns \c Shown, it means that column should be always visible.
+
+  \param name - column name
+  \return appropriate status
+*/
+Qtx::Appropriate SUIT_ProxyModel::appropriate( const QString& name ) const
+{
+  return treeModel() ? treeModel()->appropriate( name ) : Qtx::Shown;
+}
+
+
+
+
+
+
+/*!
+  \class SUIT_ItemDelegate
+  \brief An SUIT_DataObject-based item delegate class.
+
+  This class can be used to render the SUIT_DataObject-based item
+  in the widgets like QTreeView and others.
+  Refer to the Qt 4 documentation, model/view architecture 
+  section for more details).
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent object
+*/
+SUIT_ItemDelegate::SUIT_ItemDelegate( QObject* parent )
+: QItemDelegate( parent )
+{
+}
+
+/*!
+  \brief Render the item in the widget.
+
+  Customizes the item colors for the specific roles.
+
+  \param painter painter
+  \param option painting option
+  \param index model index being rendered
+*/
+void SUIT_ItemDelegate::paint( QPainter* painter, 
+                              const QStyleOptionViewItem& option,
+                              const QModelIndex& index ) const
+{
+  QStyleOptionViewItem opt = option;
+  if ( index.isValid() ) {
+    // Note: we check into account only custom roles; other roles are process
+    //       correctly by the QItemDelegate class
+    QVariant val = index.data( SUIT_TreeModel::BaseColorRole );
+    if ( val.isValid() && val.value<QColor>().isValid() ) {
+      QColor aBase = val.value<QColor>();
+      aBase.setAlpha( 0 );
+      opt.palette.setBrush( QPalette::Base, val.value<QColor>() );
+    }
+    val = index.data( SUIT_TreeModel::TextColorRole );
+    if ( val.isValid() && val.value<QColor>().isValid() )
+      opt.palette.setBrush( QPalette::Text, val.value<QColor>() );
+    val = index.data( SUIT_TreeModel::HighlightRole );
+    if ( val.isValid() && val.value<QColor>().isValid() )
+      opt.palette.setBrush( QPalette::Highlight, val.value<QColor>() );
+    val = index.data( SUIT_TreeModel::HighlightedTextRole );
+    if ( val.isValid() && val.value<QColor>().isValid() )
+      opt.palette.setBrush( QPalette::HighlightedText, val.value<QColor>() );
+  }
+  QItemDelegate::paint( painter, opt, index );
+}
diff --git a/src/SUIT/SUIT_TreeModel.h b/src/SUIT/SUIT_TreeModel.h
new file mode 100755 (executable)
index 0000000..e355703
--- /dev/null
@@ -0,0 +1,257 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:   SUIT_TreeModel.h
+// Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+#ifndef SUIT_TREEMODEL_H
+#define SUIT_TREEMODEL_H
+
+#include "SUIT.h"
+
+#include <Qtx.h>
+
+#include <QAbstractItemModel>
+#include <QSortFilterProxyModel>
+#include <QModelIndex>
+#include <QItemDelegate>
+#include <QVariant>
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+class SUIT_DataObject;
+class SUIT_TreeModel;
+
+class SUIT_EXPORT SUIT_AbstractModel
+{
+public:
+  SUIT_AbstractModel();
+
+  operator const QAbstractItemModel*() const;
+  operator QAbstractItemModel*();
+  operator const QObject*() const;
+
+  virtual SUIT_DataObject* root() const = 0;
+  virtual void             setRoot( SUIT_DataObject* ) = 0;
+  virtual SUIT_DataObject* object( const QModelIndex& = QModelIndex() ) const = 0;
+  virtual QModelIndex      index( const SUIT_DataObject*, int = 0 ) const = 0;
+  virtual bool             autoDeleteTree() const = 0;
+  virtual void             setAutoDeleteTree( const bool ) = 0;
+  virtual bool             autoUpdate() const = 0;
+  virtual void             setAutoUpdate( const bool ) = 0;
+  virtual QAbstractItemDelegate* delegate() const = 0;
+  virtual bool             customSorting( const int ) const = 0;
+  virtual bool             lessThan( const QModelIndex& left, const QModelIndex& right ) const = 0;
+
+  virtual void             updateTree( const QModelIndex& ) = 0;
+  virtual void             updateTree( SUIT_DataObject* = 0 ) = 0;
+
+  virtual void             registerColumn( const int group_id, const QString& name, const int custom_id ) = 0;
+  virtual void             unregisterColumn( const int group_id, const QString& name ) = 0;
+  virtual void             setColumnIcon( const QString& name, const QPixmap& icon ) = 0;
+  virtual QPixmap          columnIcon( const QString& name ) const = 0;
+  virtual void             setAppropriate( const QString& name, const Qtx::Appropriate appr ) = 0;
+  virtual Qtx::Appropriate appropriate( const QString& name ) const = 0;
+};
+
+
+class SUIT_EXPORT SUIT_TreeModel : public QAbstractItemModel, public SUIT_AbstractModel
+{
+  Q_OBJECT
+
+private:
+  class TreeItem;
+  class TreeSync;
+  typedef SUIT_DataObject*          ObjPtr;
+  typedef SUIT_TreeModel::TreeItem* ItemPtr;
+public:
+  //! Data role
+  typedef enum {
+    DisplayRole         = Qt::DisplayRole,       //!< text label
+    DecorationRole      = Qt::DecorationRole,    //!< icon
+    EditRole            = Qt::EditRole,          //!< edit mode
+    ToolTipRole         = Qt::ToolTipRole,       //!< tooltip
+    StatusTipRole       = Qt::StatusTipRole,     //!< status tip
+    WhatsThisRole       = Qt::WhatsThisRole,     //!< what's this info
+    FontRole            = Qt::FontRole,          //!< font
+    TextAlignmentRole   = Qt::TextAlignmentRole, //!< text alignment
+    BackgroundRole      = Qt::BackgroundRole,    //!< background color
+    ForegroundRole      = Qt::ForegroundRole,    //!< text color
+    CheckStateRole      = Qt::CheckStateRole,    //!< check state
+    SizeHintRole        = Qt::SizeHintRole,      //!< size hint
+    BaseColorRole       = Qt::UserRole,          //!< (editor) background color
+    TextColorRole,                               //!< (editor) text color    (Qt::UserRole + 1)
+    HighlightRole,                               //!< highlight color        (Qt::UserRole + 2)
+    HighlightedTextRole,                         //!< highlighted text color (Qt::UserRole + 3)
+    AppropriateRole     = Qtx::AppropriateRole   //!< appropriate flag       (Qt::UserRole + 100)
+  } Role;
+
+  SUIT_TreeModel( QObject* = 0 );
+  SUIT_TreeModel( SUIT_DataObject*, QObject* = 0 );
+  ~SUIT_TreeModel();
+
+  SUIT_DataObject*       root() const;
+  void                   setRoot( SUIT_DataObject* );
+
+  virtual QVariant       data( const QModelIndex&, int = DisplayRole ) const;
+  virtual bool           setData( const QModelIndex&, const QVariant&, int = EditRole );
+  virtual Qt::ItemFlags  flags( const QModelIndex& ) const;
+  virtual QVariant       headerData( int, Qt::Orientation, int = Qt::DisplayRole ) const;
+
+  virtual QModelIndex    index( int, int, const QModelIndex& = QModelIndex() ) const;
+  virtual QModelIndex    parent( const QModelIndex& ) const;
+
+  virtual int              columnCount( const QModelIndex& = QModelIndex() ) const;
+  virtual int              rowCount( const QModelIndex& = QModelIndex() ) const;
+  virtual void             registerColumn( const int group_id, const QString& name, const int custom_id );
+  virtual void             unregisterColumn( const int group_id, const QString& name );
+  virtual void             setColumnIcon( const QString& name, const QPixmap& icon );
+  virtual QPixmap          columnIcon( const QString& name ) const;
+  virtual void             setAppropriate( const QString& name, const Qtx::Appropriate appr );
+  virtual Qtx::Appropriate appropriate( const QString& name ) const;
+
+  SUIT_DataObject*       object( const QModelIndex& = QModelIndex() ) const;
+  QModelIndex            index( const SUIT_DataObject*, int = 0 ) const;
+
+  bool                   autoDeleteTree() const;
+  void                   setAutoDeleteTree( const bool );
+
+  bool                   autoUpdate() const;
+  void                   setAutoUpdate( const bool );
+
+  virtual bool           customSorting( const int ) const;
+  virtual bool           lessThan( const QModelIndex& left, const QModelIndex& right ) const;
+
+  QAbstractItemDelegate* delegate() const;
+
+public slots:
+  virtual void           updateTree( const QModelIndex& );
+  virtual void           updateTree( SUIT_DataObject* = 0 );
+
+signals:
+  void modelUpdated();
+
+private:
+  void                   initialize();
+
+  TreeItem*              rootItem() const;
+  TreeItem*              treeItem( const QModelIndex& ) const;
+  TreeItem*              treeItem( const SUIT_DataObject* ) const;
+  SUIT_DataObject*       object( const TreeItem* ) const;
+
+  TreeItem*              createItem( SUIT_DataObject*, TreeItem* = 0, TreeItem* = 0 );
+  void                   updateItem( TreeItem* );
+  void                   removeItem( TreeItem* );
+
+private slots:
+  void                   onInserted( SUIT_DataObject*, SUIT_DataObject* );
+  void                   onRemoved( SUIT_DataObject*, SUIT_DataObject* );
+
+private:
+  typedef QMap<SUIT_DataObject*, TreeItem*> ItemMap;
+  typedef struct
+  {
+    QString myName;
+       QMap<int,int> myIds;
+       QPixmap myIcon;
+       Qtx::Appropriate myAppropriate;
+
+  } ColumnInfo;
+  
+  SUIT_DataObject*    myRoot;
+  TreeItem*           myRootItem;
+  ItemMap             myItems;
+  bool                myAutoDeleteTree;
+  bool                myAutoUpdate;
+  QVector<ColumnInfo> myColumns;
+
+  friend class SUIT_TreeModel::TreeSync;
+};
+
+class SUIT_EXPORT SUIT_ProxyModel : public QSortFilterProxyModel, public SUIT_AbstractModel
+{
+  Q_OBJECT
+
+public:
+  SUIT_ProxyModel( QObject* = 0 );
+  SUIT_ProxyModel( SUIT_DataObject*, QObject* = 0 );
+  SUIT_ProxyModel( SUIT_AbstractModel*, QObject* = 0 );
+  ~SUIT_ProxyModel();
+
+  SUIT_DataObject*       root() const;
+  void                   setRoot( SUIT_DataObject* );
+
+  SUIT_DataObject*       object( const QModelIndex& = QModelIndex() ) const;
+  QModelIndex            index( const SUIT_DataObject*, int = 0 ) const;
+
+  bool                   autoDeleteTree() const;
+  void                   setAutoDeleteTree( const bool );
+
+  bool                   autoUpdate() const;
+  void                   setAutoUpdate( const bool );
+  bool                   isSortingEnabled() const;
+  bool                   customSorting( const int ) const;
+
+  virtual bool             lessThan( const QModelIndex&, const QModelIndex& ) const;
+  virtual void             registerColumn( const int group_id, const QString& name, const int custom_id );
+  virtual void             unregisterColumn( const int group_id, const QString& name );
+  virtual void             setColumnIcon( const QString& name, const QPixmap& icon );
+  virtual QPixmap          columnIcon( const QString& name ) const;
+  virtual void             setAppropriate( const QString& name, const Qtx::Appropriate appr );
+  virtual Qtx::Appropriate appropriate( const QString& name ) const;
+
+  QAbstractItemDelegate* delegate() const;
+
+public slots:
+  virtual void           updateTree( const QModelIndex& );
+  virtual void           updateTree( SUIT_DataObject* = 0 );
+  void                   setSortingEnabled( bool );
+
+signals:
+  void modelUpdated();
+
+protected:
+  SUIT_AbstractModel*    treeModel() const;
+
+private:
+  bool                   mySortingEnabled;
+};
+
+class SUIT_EXPORT SUIT_ItemDelegate : public QItemDelegate
+{
+  Q_OBJECT
+
+public:
+  SUIT_ItemDelegate( QObject* = 0 );
+  
+  virtual void paint( QPainter*, const QStyleOptionViewItem&,
+                     const QModelIndex& ) const;
+};
+
+#ifdef WIN32
+#pragma warning( default:4251 )
+#endif
+
+#endif // SUIT_TREEMODEL_H
index 61d8fde064081ab4b271bda586b0668aaa4661bb..1369fde22b819cac0aa26a16e67592e207d97492 100644 (file)
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SUIT_TreeSync.h
+// Author : Alexander SOLOVYOV
+//
+#ifndef SUIT_TREESYNC_H
+#define SUIT_TREESYNC_H
 
-#ifndef SUIT_TREE_SYNC_HEADER
-#define SUIT_TREE_SYNC_HEADER
-
-#include <qptrlist.h>
-#include <qvaluelist.h>
+#include <QList>
 
 /*!
-  \struct DiffItem
-  \brief Struct representing difference between items
+  \brief The structure representing difference between source and destination items.
+
+  The different combinations of source and target items values imply the different actions 
+  to be performed in the target data tree:
+  - source item is null, target item is not null : the item should be removed from the target tree
+  - source item is not null, target item is null : new item should be added to the target tree
+  - both source and target items are not null : the target item can be updated if necessary
+  - both source and target items are null : error   
 */
 template <class SrcItem, class TrgItem>
 struct DiffItem
 {
-  SrcItem  mySrc;
-  /*! 
-    \var mySrc
-    if it is null, then this item is to deleted
-  */
-  TrgItem  myTrg;
-  /*!
-    \var myTrg
-    if it is null, then this item is to added
-    if both fields aren't null, then this item is to update
-  */
+  SrcItem  mySrc;      //!< source tree item
+  TrgItem  myTrg;      //!< target tree item
 };
 
-/*!
-  \brief synchronizes two trees
-*/
+
+//
+// Function prototypes.
+//
+
 template <class SrcItem, class TrgItem, class TreeData>
 TrgItem synchronize( const SrcItem&, const TrgItem&, const TreeData& );
 
-/*!
-  \brief compares children 
-*/
 template <class SrcItem, class TrgItem, class TreeData>
-void diffSiblings( const SrcItem&, const TrgItem&,
-                   QValueList < DiffItem < SrcItem,TrgItem > >&,
-                   const TreeData& );
+QList< DiffItem<SrcItem,TrgItem> > diffSiblings( const SrcItem&, 
+                                                const TrgItem&, 
+                                                const TreeData& );
 
-/*!
-  \brief create item with children (subtree)
-*/
 template <class SrcItem, class TrgItem, class TreeData>
-TrgItem createSubTree( const SrcItem&, const TrgItem&, const TrgItem&, const bool, const TreeData& );
+TrgItem createSubTree( const SrcItem&, const TrgItem&, const TrgItem&, const TreeData& );
 
-/*!
-  \brief find equal element in list
-*/
 template <class SrcItem, class TrgItem, class TreeData>
-const typename QValueList<TrgItem>::const_iterator findEqual( const QValueList<TrgItem>& l,
-                                                             const typename QValueList<TrgItem>::const_iterator& first,
-                                                             const SrcItem& it,
-                                                             const TreeData& td );
-
+const typename QList<TrgItem>::const_iterator findEqual( const SrcItem& it,
+                                                        const typename QList<TrgItem>::const_iterator& first,
+                                                        const typename QList<TrgItem>::const_iterator& last,
+                                                        const TreeData& td );
 
 
+//
+// Function imlpementation.
+//
 
 /*!
-  Synchronizes two trees by comparing corresponding items
-  \param r1 - start item from first tree
-  \param r2 - start item from second tree
-  \param td - auxiliary class providing following methods:
-  <ul>
-  <li> bool     isEqual( const SrcItem&, const TrgItem& ) const - returns true if items are equal
-  <li> SrcItem  nullSrc() const - returns null SrcItem
-  <li> TrgItem  nullTrg() const - returns null TrgItem
-  <li> TrgItem  createItem( 
-    <ol>
-      <li> const SrcItem& src,    - corresponding SrcItem
-      <li> const TrgItem& parent, - parent TrgItem
-      <li> const TrgItem& after,  - TrgItem after that new item must be added
-      <li> const bool prepend     - whether new item must be added as first 
-    </ol>
-    ) const - creates new TrgItem
-  <li> void     updateItem( const TrgItem& ) const - updates TrgItem without recreation
-  <li> void     deleteItemWithChildren( const TrgItem& ) const - deletes TrgItem with all children
-  <li> void     children( const SrcItem&, QValueList<SrcItem>& ) const - fills list with children
-  <li> void     children( const TrgItem&, QValueList<TrgItem>& ) const - fills list with children
-  <li> SrcItem  parent( const SrcItem& ) const - return parent SrcItem
-  <li> TrgItem  parent( const TrgItem& ) const - return parent SrcItem
-  </ul>
+  \brief Synchronize two data trees by recurive comparing of the corresponding items.
+
+  \param r1 starting item from the source  data tree
+  \param r2 starting item from the target data tree
+  \param td functor class
+  \return the target tree item (updated or just created) corresponding to the starting
+     data object
+
+  Actual comparing of the items and the syncronization of the trees is performed by the
+  functor class which is passed as the last parameter of the function.
+  The functor class should implement the following methods:
+  - \b bool \b isEqual( \b const \b SrcItem& \p src, \b const \b TrgItem& \p tgt ) \b const;
+    - \a src source tree item 
+    - \a tgt target tree item
+    - compares items and returns \c true if the items are equal (correspond to each other)
+  - \b SrcItem \b nullSrc() \b const;
+    - returns null source tree itemm
+  - \b TrgItem \b nullTrg() \b const
+    - returns null target tree item
+  - \b TrgItem \b createItem( \b const \b SrcItem& \p src, \b const \b TrgItem& \p parent, \b const \b TrgItem& \p after ) \b const;
+    - \a src source item
+    - \a parent parent target item
+    - \a after target tree item after which new item shoud be inserted (if null, the item is added to the end)
+    - creates new ite in the target tree which correspond to the source item and returns created item
+  - \b void \b updateItem( \b const \b SrcItem& \p src, \b const \b TrgItem& \p tgt ) \b const;
+    - \a src source tree item 
+    - \a tgt the item in the target tree to be updated
+    - updates target treeitem
+  - \b void \b deleteItemWithChildren( \b const \b TrgItem& \p tgt ) \b const;
+    - \a tgt the item in the target tree to be removed
+    - deletes target tree item (recursively)
+  - \b QList<SrcItem> \b children( \b const \b SrcItem& \p parent ) \b const;
+    - \a parent the parent item in the source tree
+    - returns the child items list
+  - \b QList<TrgItem> \b children( \b const \b TrgItem& \p parent ) \b const;
+    - \a parent the parent item in the target tree
+    - returns the child items list
+  - \b TrgItem \b parent( \b const \b TrgItem& \p tgt ) \b const;
+    - \a tgt target tree item
+    - returns the item which is parent for the specified source tree item
 */
 template <class SrcItem, class TrgItem, class TreeData>
 TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td )
 {
-  if( td.isEqual( r1, r2 ) )
-  {
+  if ( td.isEqual( r1, r2 ) ) {
     // update items themselves
     td.updateItem( r1, r2 );
-
-    // iterate 'siblings' (direct children) 
-    QValueList< DiffItem< SrcItem, TrgItem > > d;
-    diffSiblings( r1, r2, d, td );
-
-    typename QValueList< DiffItem< SrcItem, TrgItem > >::const_iterator anIt = d.begin(), aLast = d.end();
+    
+    // iterate through children
+    QList< DiffItem< SrcItem, TrgItem > > d =  diffSiblings( r1, r2, td );
+    
+    typename QList< DiffItem< SrcItem, TrgItem > >::const_iterator anIt = d.begin(), aLast = d.end();
     TrgItem lastItem = td.nullTrg();
-    //    TrgItem tail = td.nullTrg();
-    for( ; anIt!=aLast; anIt++ )
-    {
+
+    for ( ; anIt != aLast; anIt++ ) {
       const DiffItem<SrcItem,TrgItem>& item = *anIt;
-      if( item.mySrc==td.nullSrc() )
-       if( item.myTrg==td.nullTrg() )
+      if ( item.mySrc == td.nullSrc() ) {
+       if ( item.myTrg == td.nullTrg() )
          qDebug( "error: both null" );
         else
-         //to delete
+         // delete item
          td.deleteItemWithChildren( item.myTrg );
+      }
       else {
-       if( item.myTrg==td.nullTrg() )
-       {
-         //to add
-         TrgItem nitem = createSubTree( item.mySrc, r2, lastItem, lastItem==td.nullTrg(), td );
-         if( nitem!=td.nullTrg() )
+       if ( item.myTrg == td.nullTrg() ) {
+         // add item (recursively)
+         TrgItem nitem = createSubTree( item.mySrc, r2, lastItem, td );
+         if ( nitem != td.nullTrg() )
            lastItem = nitem;
        }
-        else
-       {
-         //to update
-         td.updateItem( item.mySrc, item.myTrg );
+        else {
+         // update item
          synchronize( item.mySrc, item.myTrg, td );
          lastItem = item.myTrg;
        }
       }
     }
-
     return r2;
   }
-  else
-  {
-    TrgItem new_r2 = createSubTree( r1, td.parent( r2 ), r2, false, td );
-    if( r2!=td.nullTrg() )
+  else {
+    TrgItem new_r2 = td.nullTrg();
+    if ( r1 != td.nullSrc() ) {
+      // add new item (recursively)
+      new_r2 = createSubTree( r1, td.parent( r2 ), r2, td );
+    }
+    if ( r2 != td.nullTrg() ) {
+      // delete old one (if it is not null)
       td.deleteItemWithChildren( r2 );
+    }
     return new_r2;
   }
 }
 
 /*!
-  Finds equal element in list
-  \return iterator
-  \param l - list to search
-  \param first - start iterator 
-  \param it - item to be found
-  \param td - tree data object (provides auxiliary methods)
+  \brief Find the item in the target tree which correspond to the specified source tree item.
+  \param it source item for which correspondence is to be found
+  \param first iterator pointing to the item in the list \a l from which search shoud be started
+  \param last iterator pointing to the item in the list \a l the search to be finished at
+  \param td functor class
+  \return iterator pointing to the item in the list \l if the correspondence is found or iterator
+     \a last if the correspondence is not found
+  \sa synchronize()
 */
 template <class SrcItem, class TrgItem, class TreeData>
-const typename QValueList<TrgItem>::const_iterator findEqual( const QValueList<TrgItem>& l,
-                                                             const typename QValueList<TrgItem>::const_iterator& first,
-                                                             const SrcItem& it,
-                                                             const TreeData& td )
+const typename QList<TrgItem>::const_iterator findEqual( const SrcItem& it,
+                                                        const typename QList<TrgItem>::const_iterator& first,
+                                                        const typename QList<TrgItem>::const_iterator& last,
+                                                        const TreeData& td )
 {
-  typename QValueList<TrgItem>::const_iterator cur = first, last = l.end();
-  for( ; cur!=last; cur++ )
-    if( td.isEqual( it, *cur ) )
+  typename QList<TrgItem>::const_iterator cur = first;
+  for ( ; cur != last; cur++ ) {
+    if ( td.isEqual( it, *cur ) )
       return cur;
+  }
   return last;
 }
 
 /*!
-  Compares children of objects src and trg
-  \param src - SrcItem to be checked
-  \param trg - TrgItem to be checked
-  \param d - map of difference to be filled
-  \param td - tree data object (provides auxiliary methods)
+  \brief Compare children of the source and target trees to find differences.
+  \param src parent source item
+  \param trg parent target item
+  \param td functor class
+  \return list of the differences
+  \sa synchronize()
 */
 template <class SrcItem, class TrgItem, class TreeData>
-void diffSiblings( const SrcItem& src, const TrgItem& trg,
-                  QValueList < DiffItem < SrcItem,TrgItem > >& d,
-                  const TreeData& td )
+QList< DiffItem<SrcItem,TrgItem> > diffSiblings( const SrcItem& src, const TrgItem& trg,
+                                                const TreeData& td )
 {
   //if( src==td.nullSrc() || trg==td.nullTrg() )
   //  return;
+  
+  QList< DiffItem<SrcItem,TrgItem> > d;
+   
+  QList<SrcItem> src_ch = td.children( src );
+  QList<TrgItem> trg_ch = td.children( trg );
 
-  QValueList<SrcItem> src_ch;
-  QValueList<TrgItem> trg_ch;
-  td.children( src, src_ch );
-  td.children( trg, trg_ch );
-
-  typename QValueList<SrcItem>::const_iterator src_it = src_ch.begin(), src_last = src_ch.end();
-  typename QValueList<TrgItem>::const_iterator cur = trg_ch.begin(), trg_last = trg_ch.end();
+  typename QList<SrcItem>::const_iterator src_it = src_ch.begin(), src_last = src_ch.end();
+  typename QList<TrgItem>::const_iterator cur    = trg_ch.begin(), trg_last = trg_ch.end();
 
-  for( ; src_it!=src_last; src_it++ )
-  {
-    typename QValueList<TrgItem>::const_iterator f =
-      findEqual<SrcItem, TrgItem, TreeData>( trg_ch, cur, *src_it, td );
-    if( f!=trg_last )  //is found
-    {
-      //mark all items before found as "to be deleted"
-      for( typename QValueList<TrgItem>::const_iterator it = cur; it!=f; it++ )
-      {
+  for ( ; src_it != src_last; src_it++ ) {
+    typename QList<TrgItem>::const_iterator f =
+      findEqual<SrcItem, TrgItem, TreeData>( *src_it, cur, trg_last, td );
+    if ( f != trg_last )  { 
+      // target is found
+      // mark all items before found one as "to be deleted"
+      for ( typename QList<TrgItem>::const_iterator it = cur; it != f; it++ ) {
        DiffItem<SrcItem,TrgItem> ndiff;
        ndiff.mySrc = td.nullSrc();
-       ndiff.myTrg = *it; //to delete;
+       ndiff.myTrg = *it;        // delete item
        d.append( ndiff );
       }
       cur = f;
       DiffItem<SrcItem,TrgItem> ndiff;
       ndiff.mySrc = *src_it;
-      ndiff.myTrg = *cur; //update this item
+      ndiff.myTrg = *cur;         // update this (found) item
       d.append( ndiff );
       cur++;
     }
-    else //not found
-    {
+    else {
+      // target is not found
       DiffItem<SrcItem,TrgItem> ndiff;
       ndiff.mySrc = *src_it;
-      ndiff.myTrg = td.nullTrg(); //add this item
+      ndiff.myTrg = td.nullTrg(); // add item
       d.append( ndiff );
     }
   }
-  for( ; cur!=trg_last; cur++ )
-  {
+  // delete rest items
+  for ( ; cur != trg_last; cur++ ) {
     DiffItem<SrcItem,TrgItem> ndiff;
     ndiff.mySrc = td.nullSrc();
-    ndiff.myTrg = *cur; //to delete;
+    ndiff.myTrg = *cur;           // delete item
     d.append( ndiff );
   }
+  
+  return d;
 }
 
 /*!
-  Creates sub-tree
-  \return root of just created sub-tree
-  \param src - corresponding SrcItem
-  \param parent - parent of new TrgItem
-  \param after - TrgItem, after that new item must be added
-  \param asFirst - true if TrgItem must be added as first
-  \param td - tree data object (provides auxiliary methods)
+  \brief Create an item with all its children recursively in the target tree.
+  \param src source tree item
+  \param parent parent item in the target tree
+  \param after item in the target tree after which new item shoud be inserted
+  \param td functor class
+  \return created item
+  \sa synchronize()
 */
 template <class SrcItem, class TrgItem, class TreeData>
 TrgItem createSubTree( const SrcItem& src, const TrgItem& parent,
-                      const TrgItem& after, const bool asFirst,
-                      const TreeData& td )
+                      const TrgItem& after, const TreeData& td )
 {
-  if( src==td.nullSrc() )
+  if ( src == td.nullSrc() )
     return td.nullTrg();
 
-  TrgItem nitem = td.createItem( src, parent, after, asFirst );
-  if( nitem==td.nullTrg() )
+  TrgItem nitem = td.createItem( src, parent, after );
+  if ( nitem == td.nullTrg() )
     return nitem;
 
-  QValueList<SrcItem> ch;
-  td.children( src, ch );
-  typename QValueList<SrcItem>::const_iterator anIt = ch.begin(), aLast = ch.end();
-  for( ; anIt!=aLast; anIt++ )
-    createSubTree( *anIt, nitem, td.nullTrg(), false, td );
+  QList<SrcItem> ch = td.children( src );
+  typename QList<SrcItem>::const_iterator anIt = ch.begin(), aLast = ch.end();
+  TrgItem last = td.nullTrg();
+  for( ; anIt != aLast; anIt++ )
+    last = createSubTree( *anIt, nitem, last, td );
 
   return nitem;
 }
 
-#endif
+#endif // SUIT_TREESYNC_H
index 9d2e7e18619cdd04f16bd00d33734716b7b91d20..c3ff10c41508c1d40f3e3eea98d1c2362680dd71 100755 (executable)
@@ -1,32 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUIT_ViewManager.h"
 
 #include "SUIT_Desktop.h"
 #include "SUIT_ViewModel.h"
+#include "SUIT_ViewWindow.h"
 #include "SUIT_Study.h"
 
-#include <qcursor.h>
-#include <qregexp.h>
-#include <qmessagebox.h>
+#include <QMap>
+#include <QRegExp>
+#include <QIcon>
 
-#ifdef WNT
+#ifdef WIN32
 #include <windows.h>
 #endif
 
@@ -51,7 +55,7 @@ myStudy( NULL )
 
   myId = useNewId( getType() );
 
-  connect( theDesktop, SIGNAL( windowActivated( SUIT_ViewWindow* ) ), 
+  connect( theDesktop, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
            this,       SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
 
   myStudy = theStudy;
@@ -85,12 +89,19 @@ void SUIT_ViewManager::setTitle( const QString& theTitle )
     return;
 
   myTitle = theTitle;
-  for ( uint i = 0; i < myViews.count(); i++ )
+  for ( int i = 0; i < myViews.count(); i++ )
     setViewName( myViews[i] );
 }
 
+void SUIT_ViewManager::setIcon( const QPixmap& theIcon )
+{
+  myIcon = theIcon;
+  for ( int i = 0; i < myViews.count(); i++ )
+    myViews[i]->setWindowIcon( QIcon( myIcon ) );
+}
+
 /*!Sets view model \a theViewModel to view manager.*/
-void SUIT_ViewManager::setViewModel(SUIT_ViewModel* theViewModel) 
+void SUIT_ViewManager::setViewModel(SUIT_ViewModel* theViewModel)
 {
   if (myViewModel && myViewModel != theViewModel) {
     myViewModel->setViewManager(0);
@@ -104,8 +115,8 @@ void SUIT_ViewManager::setViewModel(SUIT_ViewModel* theViewModel)
 /*!Sets view name for view window \a theView.*/
 void SUIT_ViewManager::setViewName( SUIT_ViewWindow* theView )
 {
-  QString title = prepareTitle( getTitle(), myId + 1, myViews.find( theView ) + 1 );
-  theView->setCaption( title );
+  QString title = prepareTitle( getTitle(), myId + 1, myViews.indexOf( theView ) + 1 );
+  theView->setWindowTitle( title );
 }
 
 QString SUIT_ViewManager::prepareTitle( const QString& title, const int mId, const int vId )
@@ -113,7 +124,7 @@ QString SUIT_ViewManager::prepareTitle( const QString& title, const int mId, con
   QString res = title;
   QRegExp re( "%[%MV]" );
   int i = 0;
-  while ( ( i = re.search( res, i ) ) != -1 )
+  while ( ( i = re.indexIn( res, i ) ) != -1 )
   {
     QString rplc;
     QString str = res.mid( i, re.matchedLength() );
@@ -138,14 +149,15 @@ SUIT_ViewWindow* SUIT_ViewManager::createViewWindow()
     delete aView;
     return 0;
   }
-  
+
   setViewName( aView );
+  aView->setWindowIcon( QIcon( myIcon ) );
+
   //myDesktop->addViewWindow( aView );
   //it is done automatically during creation of view
 
-  aView->setViewManager(this);
-
-  emit viewCreated(aView);
+  aView->setViewManager( this );
+  emit viewCreated( aView );
 
   // Special treatment for the case when <aView> is the first one in this view manager
   // -> call onWindowActivated() directly, because somebody may always want
@@ -156,27 +168,43 @@ SUIT_ViewWindow* SUIT_ViewManager::createViewWindow()
   return aView;
 }
 
+/*! Get identifier */
+int SUIT_ViewManager::getId() const
+{
+  return myId;
+}
+
 /*!Create view window.*/
 void SUIT_ViewManager::createView()
 {
   createViewWindow();
 }
 
+QVector<SUIT_ViewWindow*> SUIT_ViewManager::getViews() const
+{
+  QVector<SUIT_ViewWindow*> res;
+  for ( int i = 0; i < myViews.count(); i++ )
+  {
+    if ( myViews[i] )
+      res.append( myViews[i] );
+  }
+
+  return res;
+}
+
 /*!Insert view window to view manager.
  *\retval false - if something wrong, else true.
  */
 bool SUIT_ViewManager::insertView(SUIT_ViewWindow* theView)
 {
   unsigned int aSize = myViews.size();
-  unsigned int aNbItems = myViews.count()+1;
-  if (aNbItems > aSize) {
-    if (!myViews.resize(aNbItems)) {
-      QMessageBox::critical(myDesktop, tr("Critical error"), tr("There is no memory for the new view!!!"));
-      return false;
-    }
+  unsigned int aNbItems = myViews.count() + 1;
+  if ( aNbItems > aSize )
+  {
+    myViews.resize( aNbItems );
     aSize = myViews.size();
   }
-  
+
   connect(theView, SIGNAL(closing(SUIT_ViewWindow*)),
           this,    SLOT(onClosingView(SUIT_ViewWindow*)));
 
@@ -204,9 +232,11 @@ bool SUIT_ViewManager::insertView(SUIT_ViewWindow* theView)
   connect(theView, SIGNAL(contextMenuRequested( QContextMenuEvent * )),
           this,    SLOT  (onContextMenuRequested( QContextMenuEvent * )));
 
-  for (uint i = 0; i < aSize; i++) {
-    if (myViews[i]==0) {
-      myViews.insert(i, theView);
+  for ( uint i = 0; i < aSize; i++ )
+  {
+    if ( myViews[i] == 0 )
+    {
+      myViews[i] = theView;
       return true;
     }
   }
@@ -228,11 +258,11 @@ void SUIT_ViewManager::closeView( SUIT_ViewWindow* theView )
   if ( !theView )
     return;
 
-  QGuardedPtr<SUIT_ViewWindow> view( theView );
+  QPointer<SUIT_ViewWindow> view( theView );
 
   view->hide();
 
-  if ( !view->testWFlags( WDestructiveClose ) )
+  if ( !view->testAttribute( Qt::WA_DeleteOnClose ) )
     return;
 
   emit deleteView( view );
@@ -245,15 +275,14 @@ void SUIT_ViewManager::closeView( SUIT_ViewWindow* theView )
 /*!Remove view window \a theView from view manager.
  *And close the last view, if it has \a theView.
 */
-void SUIT_ViewManager::removeView(SUIT_ViewWindow* theView) 
+void SUIT_ViewManager::removeView( SUIT_ViewWindow* theView )
 {
-  theView->disconnect(this);
-  myViews.remove(myViews.find(theView));
-  if (myActiveView == theView)
+  theView->disconnect( this );
+  myViews.remove( myViews.indexOf( theView ) );
+  if ( myActiveView == theView )
     myActiveView = 0;
-  int aNumItems = myViews.count();
-  if (aNumItems == 0)
-    emit lastViewClosed(this);
+  if ( !myViews.count() )
+    emit lastViewClosed( this );
 }
 
 /*!
@@ -261,7 +290,7 @@ void SUIT_ViewManager::removeView(SUIT_ViewWindow* theView)
 */
 void SUIT_ViewManager::setDestructiveClose( const bool on )
 {
-  for ( uint i = 0; i < myViews.count(); i++ )
+  for ( int i = 0; i < myViews.count(); i++ )
     myViews[i]->setDestructiveClose( on );
 }
 
@@ -271,7 +300,7 @@ void SUIT_ViewManager::setDestructiveClose( const bool on )
 bool SUIT_ViewManager::isVisible() const
 {
   bool res = false;
-  for ( uint i = 0; i < myViews.count() && !res; i++ )
+  for ( int i = 0; i < myViews.count() && !res; i++ )
     res = myViews[i]->isVisibleTo( myViews[i]->parentWidget() );
   return res;
 }
@@ -281,7 +310,7 @@ bool SUIT_ViewManager::isVisible() const
 */
 void SUIT_ViewManager::setShown( const bool on )
 {
-  for ( uint i = 0; i < myViews.count(); i++ )
+  for ( int i = 0; i < myViews.count(); i++ )
     myViews.at( i )->setShown( on );
 }
 
@@ -311,7 +340,7 @@ void SUIT_ViewManager::onWindowActivated(SUIT_ViewWindow* view)
 */
 void SUIT_ViewManager::closeAllViews()
 {
-  for ( uint i = 0; i < myViews.size(); i++ )
+  for ( int i = 0; i < myViews.size(); i++ )
     delete myViews[i];
   myViews.clear();
 }
@@ -320,8 +349,8 @@ void SUIT_ViewManager::closeAllViews()
  *\retval QString - type of view model.
  */
 QString SUIT_ViewManager::getType() const
-{ 
-  return (!myViewModel)? "": myViewModel->getType(); 
+{
+  return (!myViewModel)? "": myViewModel->getType();
 }
 
 /*!
@@ -347,7 +376,7 @@ void SUIT_ViewManager::onContextMenuRequested( QContextMenuEvent* e )
 }
 
 /*!Context menu popup for \a popup.*/
-void SUIT_ViewManager::contextMenuPopup( QPopupMenu* popup )
+void SUIT_ViewManager::contextMenuPopup( QMenu* popup )
 {
   SUIT_ViewModel* vm = getViewModel();
   if ( vm )
index ced80a1c7fa0c80a9d51f099d02744d638b9936e..9126290a63fb5ecda6f2dff52e6294e5c3821233 100755 (executable)
@@ -1,36 +1,45 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_VIEWMANAGER_H
 #define SUIT_VIEWMANAGER_H
 
 #include "SUIT.h"
-#include "SUIT_ViewWindow.h"
+
 #include "SUIT_PopupClient.h"
 
-#include <qobject.h>
-#include <qptrvector.h>
+#include <QObject>
+#include <QPixmap>
+#include <QVector>
+#include <QPointer>
+
+class QMenu;
+class QMouseEvent;
+class QWheelEvent;
+class QKeyEvent;
 
 class SUIT_Study;
 class SUIT_Desktop;
 class SUIT_ViewModel;
-
-class QPopupMenu;
+class SUIT_ViewWindow;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -46,34 +55,37 @@ public:
   virtual ~SUIT_ViewManager();
 
   virtual QString  popupClientType() const { return getType(); }
-  virtual void     contextMenuPopup( QPopupMenu* );
-  
+  virtual void     contextMenuPopup( QMenu* );
+
   void             setViewModel(SUIT_ViewModel* theViewModel);
   SUIT_ViewModel*  getViewModel() { return myViewModel; }
-  
+
   SUIT_Study*      study() const;
 
-  QString          getType() const; 
+  QString          getType() const;
   SUIT_ViewWindow* getActiveView() { return myActiveView; }
-  
+
   int              getViewsCount() { return myViews.count(); }
-  QPtrVector<SUIT_ViewWindow> getViews() { return myViews; }  
+  QVector<SUIT_ViewWindow*> getViews() const;
 
   QString          getTitle() const { return myTitle; }
   virtual void     setTitle( const QString& );
 
+  QPixmap          getIcon() const { return myIcon; }
+  virtual void     setIcon( const QPixmap& );
+
   SUIT_ViewWindow* createViewWindow();
 
   bool             isVisible() const;
   virtual void     setShown( const bool );
   virtual void     setDestructiveClose( const bool );
 
-  int              getId() const { return myId; }
+  int              getId() const;
 
 public slots:
   void             createView();
   void             closeAllViews();
-  
+
 signals:
   void             lastViewClosed(SUIT_ViewManager*);
   void             deleteView(SUIT_ViewWindow*);
@@ -86,7 +98,7 @@ signals:
   void             keyPress(SUIT_ViewWindow*, QKeyEvent*);
   void             keyRelease(SUIT_ViewWindow*, QKeyEvent*);
   void             activated(SUIT_ViewManager*);
-  
+
 protected slots:
   void             onWindowActivated(SUIT_ViewWindow*);
   void             onClosingView( SUIT_ViewWindow* );
@@ -95,32 +107,36 @@ protected slots:
 
 private slots:
   void             onContextMenuRequested( QContextMenuEvent* e );
-  
+
 protected:
   /*! Inserts the View into internal Views Vector.\n
    *  Returns true if view has been added successfully
    */
   virtual bool     insertView(SUIT_ViewWindow* theView);
-  
+
   /*! Removes the View from internal Views Vector.*/
   virtual void     removeView(SUIT_ViewWindow* theView);
-  
+
   /*! Close the specified View.*/
   virtual void     closeView(SUIT_ViewWindow* theView);
-  
+
   /*! Used to set unique name for the view.*/
-  virtual void     setViewName(SUIT_ViewWindow* theView);
+  virtual void     setViewName(SUIT_ViewWindow* theView );
   QString          prepareTitle( const QString&, const int, const int );
 
   static int       useNewId( const QString& );
 
+protected:
+  typedef QPointer<SUIT_ViewWindow> ViewWindow;
+
 protected:
   SUIT_Desktop*               myDesktop;
   SUIT_ViewModel*             myViewModel;
-  QPtrVector<SUIT_ViewWindow> myViews;
+  QVector<ViewWindow>         myViews;
   SUIT_ViewWindow*            myActiveView;
 
   int                         myId;
+  QPixmap                     myIcon;
   QString                     myTitle;
   SUIT_Study*                 myStudy;
 
index 86c0f00993990218304efa4dd2bd10f4e2342f5c..4061961857d147fc5efe7d862f7c73f01d7a8e96 100755 (executable)
@@ -1,25 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // SUIT_ViewModel.cxx: implementation of the SUIT_ViewModel class.
 //
-
 #include "SUIT_ViewModel.h"
+#include "SUIT_ViewWindow.h"
 
 SUIT_ViewModel::StatesMap SUIT_ViewModel::myStateMap;
 SUIT_ViewModel::ButtonsMap SUIT_ViewModel::myButtonMap;
@@ -29,19 +32,20 @@ static bool isInitialized = false;
 /*!Constructor.*/
 SUIT_ViewModel::SUIT_ViewModel()
 {
-  if (!isInitialized) {
+  if ( !isInitialized )
+  {
     isInitialized = true;
 
-    SUIT_ViewModel::myStateMap[ZOOM]  = Qt::ControlButton;
+    SUIT_ViewModel::myStateMap[ZOOM]  = Qt::ControlModifier;
     SUIT_ViewModel::myButtonMap[ZOOM] = Qt::LeftButton;
 
-    SUIT_ViewModel::myStateMap[PAN]   = Qt::ControlButton;
+    SUIT_ViewModel::myStateMap[PAN]   = Qt::ControlModifier;
     SUIT_ViewModel::myButtonMap[PAN]  = Qt::MidButton;
 
-    SUIT_ViewModel::myStateMap[ROTATE]  = Qt::ControlButton;
+    SUIT_ViewModel::myStateMap[ROTATE]  = Qt::ControlModifier;
     SUIT_ViewModel::myButtonMap[ROTATE] = Qt::RightButton;
 
-    SUIT_ViewModel::myStateMap[FIT_AREA]  = Qt::ControlButton;
+    SUIT_ViewModel::myStateMap[FIT_AREA]  = Qt::ControlModifier;
     SUIT_ViewModel::myButtonMap[FIT_AREA] = Qt::RightButton;
   }
   myViewManager = 0;
@@ -60,13 +64,28 @@ SUIT_ViewWindow* SUIT_ViewModel::createView(SUIT_Desktop* theDesktop)
   return new SUIT_ViewWindow(theDesktop);
 }
 
+/*!Set view manager.
+  \param theViewManager view manager
+ */
+void SUIT_ViewModel::setViewManager(SUIT_ViewManager* theViewManager)
+{
+  myViewManager = theViewManager;
+}
+
+/*!Get view manager.
+  \return view manager
+ */
+SUIT_ViewManager* SUIT_ViewModel::getViewManager() const
+{
+  return myViewManager;
+}
+
 /*! Sets hot button
  *\param theOper - hot operation
  *\param theState - adding state to state map operations.
  *\param theButton - adding state to button map operations.
  */
-void SUIT_ViewModel::setHotButton(HotOperation theOper, Qt::ButtonState theState,
-                                 Qt::ButtonState theButton)
+void SUIT_ViewModel::setHotButton( HotOperation theOper, Qt::KeyboardModifier theState, Qt::MouseButton theButton )
 {
   myStateMap[theOper]  = theState;
   myButtonMap[theOper] = theButton;
@@ -77,8 +96,7 @@ void SUIT_ViewModel::setHotButton(HotOperation theOper, Qt::ButtonState theState
  *\param theState - output state from state map operations.
  *\param theButton - output state from button map operations.
 */
-void SUIT_ViewModel::getHotButton(HotOperation theOper, Qt::ButtonState& theState,
-                                 Qt::ButtonState& theButton)
+void SUIT_ViewModel::getHotButton( HotOperation theOper, Qt::KeyboardModifier& theState, Qt::MouseButton& theButton )
 {
   theState  = myStateMap[theOper];
   theButton = myButtonMap[theOper];
index 4be9fd777d9e65bacaeb11599a01c34047ead3cb..baff2049ef9375f87d0539d085884e2a1a616caf 100755 (executable)
@@ -1,31 +1,37 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUIT_VIEWMODEL_H
 #define SUIT_VIEWMODEL_H
 
 #include "SUIT.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_ViewWindow.h"
-#include "SUIT_ViewManager.h"
 
-#include <qobject.h>
-#include <qcursor.h>
+#include <QObject>
+#include <QMap>
+
+class QMenu;
+
+class SUIT_Desktop;
+class SUIT_ViewWindow;
+class SUIT_ViewManager;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -42,28 +48,28 @@ class SUIT_EXPORT SUIT_ViewModel : public QObject
 public:
   enum HotOperation { PAN, ZOOM, ROTATE, FIT_AREA };
 
-  typedef QMap<HotOperation, Qt::ButtonState> StatesMap;
-  typedef QMap<HotOperation, Qt::ButtonState> ButtonsMap;
+  typedef QMap<HotOperation, Qt::KeyboardModifier> StatesMap;
+  typedef QMap<HotOperation, Qt::MouseButton>      ButtonsMap;
   
-       SUIT_ViewModel();
-       virtual ~SUIT_ViewModel();
+  SUIT_ViewModel();
+  virtual ~SUIT_ViewModel();
 
-       virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
+  virtual SUIT_ViewWindow* createView( SUIT_Desktop* theDesktop );
 
-       virtual void      setViewManager(SUIT_ViewManager* theViewManager) { myViewManager = theViewManager; }
-       SUIT_ViewManager* getViewManager() const { return myViewManager; }
+  virtual void      setViewManager(SUIT_ViewManager* theViewManager);
+  SUIT_ViewManager* getViewManager() const;
 
   virtual QString   getType() const { return "SUIT_ViewModel"; }
 
-  virtual void      contextMenuPopup(QPopupMenu*) {}
+  virtual void      contextMenuPopup( QMenu* ) {}
 
-  static void       setHotButton(HotOperation theOper, Qt::ButtonState theState,
-                                                       Qt::ButtonState theButton);
-  static void       getHotButton(HotOperation theOper, Qt::ButtonState& theState,
-                                                       Qt::ButtonState& theButton);
+  static void       setHotButton( HotOperation theOper, Qt::KeyboardModifier theState,
+                                 Qt::MouseButton theButton );
+  static void       getHotButton( HotOperation theOper, Qt::KeyboardModifier& theState,
+                                 Qt::MouseButton& theButton );
 
 protected:
-       SUIT_ViewManager* myViewManager;
+  SUIT_ViewManager* myViewManager;
 
 public:
   static StatesMap  myStateMap;
index faf064fb51486b4cdbf093c3a33d3379263b1d38..cb7045eee7d7dca2be79e4dcf253ee278c103002 100755 (executable)
@@ -1,35 +1,40 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // SUIT_ViewWindow.cxx: implementation of the SUIT_ViewWindow class.
 //
-
 #include "SUIT_ViewWindow.h"
+
+#include "SUIT_Tools.h"
+#include "SUIT_Study.h"
 #include "SUIT_Desktop.h"
+#include "SUIT_MessageBox.h"
 #include "SUIT_Application.h"
-#include "SUIT_Study.h"
 #include "SUIT_ViewManager.h"
-#include "SUIT_Tools.h"
-#include "SUIT_MessageBox.h"
-#include <qhbox.h>
-#include <qpopupmenu.h>
-#include <qapplication.h>
-#include <qimage.h>
+#include "QtxActionToolMgr.h"
+
+#include <QEvent>
+#include <QIcon>
+#include <QApplication>
+#include <QContextMenuEvent>
 
 /*!\class SUIT_ViewWindow
  * Class provide view window.
 const int DUMP_EVENT = QEvent::User + 123;
 
 /*! Constructor.*/
-SUIT_ViewWindow::SUIT_ViewWindow(SUIT_Desktop* theDesktop)
-: QMainWindow( theDesktop, "SUIT_ViewWindow", Qt::WDestructiveClose )
+SUIT_ViewWindow::SUIT_ViewWindow( SUIT_Desktop* theDesktop )
+: QMainWindow( theDesktop )
 {
   myDesktop = theDesktop;
 
-  if ( myDesktop->icon() )
-    setIcon( *myDesktop->icon() );
+  setWindowIcon( myDesktop->windowIcon() );
+
+  setAttribute( Qt::WA_DeleteOnClose );
+
+  myToolMgr = new QtxActionToolMgr( this );
 }
 
 /*! Destructor.*/
@@ -87,7 +95,7 @@ QImage SUIT_ViewWindow::dumpView()
 bool SUIT_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileName, const QString& format )
 {
   if( img.isNull() )
-    return false; 
+    return false;
 
   QString fmt = format;
   if( fmt.isEmpty() )
@@ -95,8 +103,8 @@ bool SUIT_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileNa
   else if( fmt == "JPG" )
     fmt = "JPEG";
 
-  QApplication::setOverrideCursor( Qt::waitCursor );
-  bool res = img.save( fileName, fmt.latin1() );
+  QApplication::setOverrideCursor( Qt::WaitCursor );
+  bool res = img.save( fileName, fmt.toLatin1() );
   QApplication::restoreOverrideCursor();
   return res;
 }
@@ -116,24 +124,28 @@ bool SUIT_ViewWindow::dumpViewToFormat( const QString& fileName, const QString&
 */
 void SUIT_ViewWindow::setDestructiveClose( const bool on )
 {
-  if ( on )
-    setWFlags( WDestructiveClose );
-  else
-    clearWFlags( WDestructiveClose );
+  setAttribute( Qt::WA_DeleteOnClose, on );
 }
 
 /*! Close event \a theEvent.
 */
-void SUIT_ViewWindow::closeEvent(QCloseEvent* theEvent)
+void SUIT_ViewWindow::closeEvent( QCloseEvent* e )
 {
-//  QMainWindow::closeEvent( theEvent );
+  e->ignore();
   emit closing( this );
 }
 
 /*! Context menu requested for event \a e.
 */
-void SUIT_ViewWindow::contextMenuEvent ( QContextMenuEvent * e )
+void SUIT_ViewWindow::contextMenuEvent( QContextMenuEvent* e )
 {
+  e->ignore();
+
+  QMainWindow::contextMenuEvent( e );
+
+  if ( e->isAccepted() )
+    return;
+
   if ( e->reason() != QContextMenuEvent::Mouse )
     emit contextMenuRequested( e );
 }
@@ -142,8 +154,8 @@ void SUIT_ViewWindow::contextMenuEvent ( QContextMenuEvent * e )
 */
 void SUIT_ViewWindow::onDumpView()
 {
-  qApp->postEvent( this, new QPaintEvent( QRect( 0, 0, width(), height() ), TRUE ) );
-  qApp->postEvent( this, new QCustomEvent( DUMP_EVENT ) );
+  QApplication::postEvent( this, new QPaintEvent( QRect( 0, 0, width(), height() ) ) );
+  QApplication::postEvent( this, new QEvent( (QEvent::Type)DUMP_EVENT ) );
 }
 
 /*!
@@ -167,21 +179,19 @@ bool SUIT_ViewWindow::event( QEvent* e )
 
       // get file name
       SUIT_Application* app = myManager->study()->application();
-      QString fileName = app->getFileName( false, QString::null, filter(), tr( "TLT_DUMP_VIEW" ), 0 );
-      if( !fileName.isEmpty() )
+      QString fileName = app->getFileName( false, QString(), filter(), tr( "TLT_DUMP_VIEW" ), 0 );
+      if ( !fileName.isEmpty() )
       {
-       QString fmt = SUIT_Tools::extension( fileName ).upper();
-       bOk = dumpViewToFormat( im, fileName, fmt );
+             QString fmt = SUIT_Tools::extension( fileName ).toUpper();
+             bOk = dumpViewToFormat( im, fileName, fmt );
       }
       else
-      {
-       bOk = true; // cancelled
-      }
-    }
-    if ( !bOk ) {
-      SUIT_MessageBox::error1( this, tr( "ERROR" ), tr( "ERR_CANT_DUMP_VIEW" ), tr( "BUT_OK" ) );
+             bOk = true; // cancelled
     }
-    return TRUE;
+    if ( !bOk )
+      SUIT_MessageBox::critical( this, tr( "ERROR" ), tr( "ERR_CANT_DUMP_VIEW" ) );
+
+    return true;
   }
   return QMainWindow::event( e );
 }
@@ -211,7 +221,23 @@ QString   SUIT_ViewWindow::getVisualParameters()
 /*!
   Sets visual parameters of window by its string representation
   \param parameters - string with visual parameters
-*/ 
-void SUIT_ViewWindow::setVisualParameters( const QString& parameters )
+*/
+void SUIT_ViewWindow::setVisualParameters( const QString& /*parameters*/ )
+{
+}
+
+/*!
+  \return associated tool bar manager
+*/
+QtxActionToolMgr* SUIT_ViewWindow::toolMgr() const
+{
+  return myToolMgr;
+}
+
+/*!
+  \return window unique identifier  
+*/
+int SUIT_ViewWindow::getId() const
 {
+  return int(long(this));
 }
index 6a6a6f86920a840d25c2f6915f6b607141d9903f..8fcf5102dfb00df8f5229603a3848a7e01e18f31 100755 (executable)
@@ -1,37 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // SUIT_ViewWindow.h: interface for the SUIT_ViewWindow class.
 //
-
-#if !defined(AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_)
-#define AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
+#ifndef SUIT_VIEWWINDOW_H
+#define SUIT_VIEWWINDOW_H
 
 #include "SUIT.h"
 
-#include <qmainwindow.h>
+#include <QMainWindow>
 
 class SUIT_Desktop;
 class SUIT_ViewManager;
+class QtxActionToolMgr;
 class QImage;
 
 class SUIT_EXPORT SUIT_ViewWindow: public QMainWindow 
@@ -55,6 +54,10 @@ public:
   virtual void      setVisualParameters( const QString& parameters );
 
   void              setDestructiveClose( const bool );
+  
+  int               getId() const;
+
+  QtxActionToolMgr* toolMgr() const;
 
 public slots:
   virtual void      onDumpView();
@@ -79,6 +82,9 @@ protected:
 
   SUIT_Desktop*     myDesktop;
   SUIT_ViewManager* myManager;
+
+private:
+  QtxActionToolMgr* myToolMgr;
 };
 
 #endif // !defined(AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_)
index 88441a5f197edbf224afef3496a678c0c2d89697..5be9df3e7ac1711a712fcae17c58619d0ebcba8c 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
index 480ab305b4adeda43d10b02975be2e8654a1404f..9eb98eedf1bb2b0f5ac2c22459a3aa7641af1aaf 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 # This is a Qt message file in .po format.  Each msgid starts with
 # a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
 # would be translated to "Pub", not "Foo::Pub".
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
diff --git a/src/SUIT/resources/SUIT_msg_en.ts b/src/SUIT/resources/SUIT_msg_en.ts
new file mode 100644 (file)
index 0000000..feb7e2a
--- /dev/null
@@ -0,0 +1,157 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>MEN_DESK_WINDOW</source>
+        <translation>&amp;Window</translation>
+    </message>
+    <message>
+        <source>ERR_CANT_DUMP_VIEW</source>
+        <translation>Can&apos;t dump view contents to the file.</translation>
+    </message>
+    <message>
+        <source>TLT_IMAGE_FILES</source>
+        <translation>Images Files (*.bmp *.png *.jpg *.jpeg)</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_CASCADE</source>
+        <translation>&amp;Cascade</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_CASCADE</source>
+        <translation>Arranges the windows as overlapping tiles</translation>
+    </message>
+    <message>
+        <source>ERR_DIR_NOT_EXIST</source>
+        <translation>The directory &quot;%1&quot; does not exist!</translation>
+    </message>
+    <message>
+        <source>ERR_FILE_NOT_DIR</source>
+        <translation>&quot;%1&quot; is not a directory!</translation>
+    </message>
+    <message>
+        <source>CONTINUE</source>
+        <translation>Continue</translation>
+    </message>
+    <message>
+        <source>CANCEL</source>
+        <translation>Cancel</translation>
+    </message>
+    <message>
+        <source>ERR_FILE_NOT_EXIST</source>
+        <translation>The file &quot;%1&quot; does not exist!</translation>
+    </message>
+    <message>
+        <source>QUE_DOC_FILEEXISTS</source>
+        <translation>The file %1 already exists.
+Do you want to overwrite it ?</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_ACTIVATE</source>
+        <translation>Activates this window</translation>
+    </message>
+    <message>
+        <source>ERR_PERMISSION_DENIED</source>
+        <translation>Can&apos;t save file &quot;%1&quot;.
+Permission denied.</translation>
+    </message>
+    <message>
+        <source>ERR_ERROR</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>QUE_FILE_EXISTS</source>
+        <translation>The file &quot;%1&quot; already exists.
+Do you want to overwrite it?</translation>
+    </message>
+    <message>
+        <source>WRN_WARNING</source>
+        <translation>Warning</translation>
+    </message>
+    <message>
+        <source>TLT_DUMP_VIEW</source>
+        <translation>Dump View to File</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_TILE</source>
+        <translation>Arranges the windows as nonoverlapping tiles</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_VTILE</source>
+        <translation>Tile &amp;Vertically</translation>
+    </message>
+    <message>
+        <source>INF_DIRECTORIES_FILTER</source>
+        <translation>Directories</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_VTILE</source>
+        <translation>Arranges the windows as nonoverlapping vertical tiles</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_TILE</source>
+        <translation>&amp;Tile</translation>
+    </message>
+    <message>
+        <source>NAME_COLUMN</source>
+        <translation>Name</translation>
+    </message>
+</context>
+<context>
+    <name>SUIT_Study</name>
+    <message>
+        <source>OPERATION_LAUNCH</source>
+        <translation>Operation launch</translation>
+    </message>
+    <message>
+        <source>PREVIOUS_NOT_FINISHED</source>
+        <translation>Previous operation is not finished and will be aborted</translation>
+    </message>
+</context>
+<context>
+    <name>SUIT_FileDlg</name>
+    <message>
+        <source>LAB_QUICK_PATH</source>
+        <translation>Quick path:</translation>
+    </message>
+    <message>
+        <source>BUT_ADD_PATH</source>
+        <translation>Add path</translation>
+    </message>
+    <message>
+        <source>INF_DESK_DOC_OPEN</source>
+        <translation>Open File</translation>
+    </message>
+    <message>
+        <source>INF_DESK_DOC_SAVE</source>
+        <translation>Save File</translation>
+    </message>
+    <message>
+        <source>ALL_FILES_FILTER</source>
+        <translation>All files (*)</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/SUIT/resources/cascade.png b/src/SUIT/resources/cascade.png
deleted file mode 100755 (executable)
index 9cd1715..0000000
Binary files a/src/SUIT/resources/cascade.png and /dev/null differ
diff --git a/src/SUIT/resources/htile.png b/src/SUIT/resources/htile.png
deleted file mode 100755 (executable)
index b838286..0000000
Binary files a/src/SUIT/resources/htile.png and /dev/null differ
diff --git a/src/SUIT/resources/vtile.png b/src/SUIT/resources/vtile.png
deleted file mode 100755 (executable)
index 1965d64..0000000
Binary files a/src/SUIT/resources/vtile.png and /dev/null differ
diff --git a/src/SUIT/utilities.h b/src/SUIT/utilities.h
deleted file mode 100755 (executable)
index a82d317..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-//  SALOME Utils : general SALOME's definitions and tools
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : utilities.h
-//  Author : Antoine YESSAYAN, Paul RASCLE, EDF
-//  Module : SALOME
-//  $Header$
-
-/*! ---  Definition macros file to print informations if _DEBUG_ is defined --- */
-
-#ifndef UTILITIES_H
-#define UTILITIES_H
-
-#include <iostream>
-#include <sstream>
-#include <cstdlib>
-
-
-#include "LocalTraceBufferPool.hxx"
-
-/*! \file utilities.h
- * For each message to put in the trace, a specific ostingstream object is \n
- * created and destroyed automatically at the end of the message macro. \n
- * The insert function of LocalTraceBufferPool class gets a buffer in a \n
- * buffer pool (unique with the help of mutexes and semaphores) and copy the \n
- * message in the buffer.\n
- * This buffer is read later by a specific thread in charge of trace print.\n
- * Order of trace entries is globally respected. Nevertheless, if there are \n
- * several threads waiting for a free buffer to trace, the order of \n
- * thread waken up is not garanteed (no fifo or priority rules in Linux Kernel)
- */
-
-#define MESS_INIT(deb) std::ostringstream os; os<<deb
-#define MESS_BEGIN(deb) MESS_INIT(deb)<<__FILE__ <<" ["<<__LINE__<<"] : "
-#define MESS_END std::endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, os.str().c_str());
-#define MESS_ABORT std::endl; LocalTraceBufferPool::instance()->insert(ABORT_MESS, os.str().c_str());
-
-// --- Some macros are always defined (without _DEBUG_): for use with release version
-
-#define INFOS(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END}
-#define PYSCRIPT(msg) {MESS_INIT("---PYSCRIPT--- ") << msg << MESS_END}
-#define INTERRUPTION(msg) {MESS_BEGIN("- INTERRUPTION: ")<< msg << MESS_ABORT}
-#define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
-                               std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << flush; \
-                               std::cerr << "ABORT return code= "<< code << std::endl; \
-                               std::exit(code);}
-
-/*! --- To print date and time of compilation of current source --- */
-
-#if defined ( __GNUC__ )
-#define COMPILER               "g++" 
-#elif defined ( __sun )
-#define COMPILER               "CC" 
-#elif defined ( __KCC )
-#define COMPILER               "KCC" 
-#elif defined ( __PGI )
-#define COMPILER               "pgCC" 
-#elif defined ( __alpha )
-#define COMPILER               "cxx" 
-#else
-#define COMPILER               "undefined" 
-#endif
-
-#ifdef INFOS_COMPILATION
-#error INFOS_COMPILATION already defined
-#endif
-
-#define INFOS_COMPILATION { MESS_BEGIN("COMPILED with ") << COMPILER \
-                                      << ", " << __DATE__ \
-                                      << " at " << __TIME__ << MESS_END }
-#ifdef _DEBUG_
-
-/*! @name the following MACROS are useful at debug time*/
-//@{
-#define MESSAGE(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END}
-#define SCRUTE(var)  {MESS_BEGIN("- Trace ") << #var << "=" << var <<MESS_END}
-
-#define REPERE ("------- ")
-#define BEGIN_OF(msg) {MESS_BEGIN(REPERE) << "Begin of: "      << msg << MESS_END} 
-#define END_OF(msg)   {MESS_BEGIN(REPERE) << "Normal end of: " << msg << MESS_END} 
-
-#ifndef ASSERT
-#define ASSERT(condition) \
-        if (!(condition)){INTERRUPTION("CONDITION "<<#condition<<" NOT VERIFIED")}
-#endif /* ASSERT */
-//@}
-
-#else /* ifdef _DEBUG_*/
-
-#define MESSAGE(msg) {}
-#define SCRUTE(var) {}
-#define REPERE
-#define BEGIN_OF(msg) {}
-#define END_OF(msg) {}
-
-#ifndef ASSERT
-#define ASSERT(condition) {}
-#endif /* ASSERT */
-
-#endif /* ifdef _DEBUG_*/
-
-#endif /* ifndef UTILITIES_H */
index 6e76029de0180f78ce4247329f3c438f9c74aa71..fae3df008cdaec07d85a04b9b5a19412f0c65f4d 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : suitApp
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSUITApp.la
 
-salomeinclude_HEADERS= SUITApp_Application.h
+salomeinclude_HEADERS =                \
+       SUITApp_Application.h
 
-dist_libSUITApp_la_SOURCES= \
-       SUITApp.cxx \
+dist_libSUITApp_la_SOURCES =   \
+       SUITApp.cxx             \
        SUITApp_Application.cxx 
 
-MOC_FILES=SUITApp_Application_moc.cxx
-nodist_libSUITApp_la_SOURCES= $(MOC_FILES)
+MOC_FILES =                            \
+       SUITApp_Application_moc.cxx
 
-nodist_salomeres_DATA= SUITApp_msg_en.qm
+nodist_libSUITApp_la_SOURCES = $(MOC_FILES)
 
-libSUITApp_la_CPPFLAGS=$(QT_INCLUDES) $(PYTHON_INCLUDES) \
-                       -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+nodist_salomeres_DATA = SUITApp_msg_en.qm
 
-libSUITApp_la_LDFLAGS=$(QT_MT_LIBS) 
-libSUITApp_la_LIBADD= ../SUIT/libsuit.la ../Qtx/libqtx.la
+libSUITApp_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) \
+                         -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx -I$(srcdir)/../Style
+
+if ENABLE_TESTRECORDER
+  libSUITApp_la_CPPFLAGS+= -DENABLE_TESTRECORDER $(TESTRECORDER_INCLUDES)
+  MOC_FLAGS = -DENABLE_TESTRECORDER
+endif
+
+libSUITApp_la_LDFLAGS  = $(QT_MT_LIBS) 
+
+if ENABLE_TESTRECORDER
+  libSUITApp_la_LDFLAGS+= $(TESTRECORDER_LIBS)
+endif
+
+libSUITApp_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../Style/libSalomeStyle.la
 
 if ENABLE_PYCONSOLE
-libSUITApp_la_LDFLAGS+= -Xlinker -export-dynamic $(PYTHON_LIBS)
+libSUITApp_la_LDFLAGS += -Xlinker -export-dynamic $(PYTHON_LIBS)
 endif
 
 # Executable
-bin_PROGRAMS= SUITApp
+bin_PROGRAMS = SUITApp
+
+dist_SUITApp_SOURCES = SUITApp.cxx
 
-dist_SUITApp_SOURCES=SUITApp.cxx
+SUITApp_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) \
+                   -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx -I$(srcdir)/../Style
 
-SUITApp_CPPFLAGS=$(QT_INCLUDES) $(PYTHON_INCLUDES) \
-                 -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+if ENABLE_TESTRECORDER
+  SUITApp_CPPFLAGS+= -DENABLE_TESTRECORDER $(TESTRECORDER_INCLUDES)
+endif
+
+SUITApp_LDADD    = libSUITApp.la  ../Qtx/libqtx.la ../SUIT/libsuit.la ../Style/libSalomeStyle.la
 
-SUITApp_LDADD= libSUITApp.la ../SUIT/libsuit.la ../Qtx/libqtx.la
+if ENABLE_TESTRECORDER
+  SUITApp_LDADD+= $(TESTRECORDER_LIBS)
+endif
index db686afad5aed13d88ee3c5c83f35d1afe012e8d..9fefe90f0813d8f3328eb86481459a7b9b49311f 100644 (file)
@@ -1,49 +1,66 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#if defined WNT
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#if defined WIN32
 
+#ifdef SUIT_ENABLE_PYTHON
 #undef SUIT_ENABLE_PYTHON
-//#else
-//#include "SUITconfig.h"
 #endif
 
+#else //#if defined WIN32
+
+#ifndef SUIT_ENABLE_PYTHON
+// NOTE: DO NOT DELETE THIS DEFINITION ON LINUX
+// or make sure Python is initialized in main() in any case
+// Otherwise, application based on light SALOME and using Python 
+// are unlikely to work properly.
+#define SUIT_ENABLE_PYTHON
+#include <Python.h>
+#endif
+
+#endif //#if defined WIN32
+
 #include "SUITApp_Application.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_ResourceMgr.h>
-
+#include <Style_Salome.h>
 #include <QtxSplash.h>
 
-#ifdef SUIT_ENABLE_PYTHON
-#include <Python.h>
-#endif
+#include <SUIT_LicenseDlg.h>
 
-#include <qdir.h>
-#include <qfile.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qregexp.h>
+#include <QDir>
+#include <QFile>
+#include <QRegExp>
+#include <QString>
+#include <QStringList>
 
 #include <stdlib.h>
 
-QString salomeVersion()
+#ifdef WIN32
+#include <UserEnv.h>
+#endif
+
+static QString salomeVersion()
 {
   QString path( ::getenv( "GUI_ROOT_DIR" ) );
   if ( !path.isEmpty() )
@@ -52,27 +69,49 @@ QString salomeVersion()
   path += QString( "bin/salome/VERSION" );
 
   QFile vf( path );
-  if ( !vf.open( IO_ReadOnly ) )
-    return QString::null;
+  if ( !vf.open( QFile::ReadOnly ) )
+    return QString();
 
-  QString line;
-  vf.readLine( line, 1024 );
+  QString line = vf.readLine( 1024 );
   vf.close();
 
   if ( line.isEmpty() )
-    return QString::null;
+    return QString();
 
   while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
     line.remove( line.length() - 1, 1 );
 
   QString ver;
-  int idx = line.findRev( ":" );
+  int idx = line.lastIndexOf( ":" );
   if ( idx != -1 )
-    ver = line.mid( idx + 1 ).stripWhiteSpace();
+    ver = line.mid( idx + 1 ).trimmed();
 
   return ver;
 }
 
+static void MessageOutput( QtMsgType type, const char* msg )
+{
+  switch ( type )
+  {
+  case QtDebugMsg:
+#ifdef _DEBUG_
+    printf( "Debug: %s\n", msg );
+#endif
+    break;
+  case QtWarningMsg:
+#ifdef _DEBUG_
+    printf( "Warning: %s\n", msg );
+#endif
+    break;
+  case QtFatalMsg:
+#ifdef _DEBUG_
+    printf( "Fatal: %s\n", msg );
+#endif
+    break;
+  default:
+    break;
+  }
+}
 
 /* XPM */
 static const char* pixmap_not_found_xpm[] = {
@@ -108,7 +147,7 @@ public:
     SUIT_ResourceMgr* resMgr = 0;
     if ( myIniFormat )
     {
-      resMgr = new SUIT_ResourceMgr( appName );
+      resMgr = new SUIT_ResourceMgr( appName, QString( "%1Config" ) );
       resMgr->setCurrentFormat( "ini" );
     }
     else
@@ -131,18 +170,26 @@ private:
   bool  myIniFormat;
 };
 
-int main( int args, char* argv[] )
+int main( int argc, char* argv[] )
 {
 #ifdef SUIT_ENABLE_PYTHON
-  Py_Initialize();
-  PySys_SetArgv( args, argv );
+  // First of all initialize Python, as in complex multi-component applications
+  // someone else might initialize it some way unsuitable for light SALOME!
+  Py_SetProgramName( argv[0] );
+  Py_Initialize(); // Initialize the interpreter
+  PySys_SetArgv( argc,  argv );
+  PyEval_InitThreads(); // Create (and acquire) the interpreter lock
+  PyEval_ReleaseLock(); // Let the others use Python API until we need it again
 #endif
 
+  //qInstallMsgHandler( MessageOutput );
+
   QStringList argList;
   bool noExceptHandling = false;
   bool iniFormat        = false;
   bool noSplash         = false;
-  for ( int i = 1; i < args /*&& !noExceptHandling*/; i++ )
+  bool useLicense       = false;
+  for ( int i = 1; i < argc /*&& !noExceptHandling*/; i++ )
   {
     if ( !strcmp( argv[i], "--noexcepthandling" ) )
       noExceptHandling = true;
@@ -150,83 +197,92 @@ int main( int args, char* argv[] )
       iniFormat = true;
     else if ( !strcmp( argv[i], "--nosplash") )
       noSplash = true;
-    else
+       else if ( !strcmp( argv[i], "--uselicense" ) )
+      useLicense = true;
+       else
       argList.append( QString( argv[i] ) );
   }
 
-  SUITApp_Application app( args, argv );
+  SUITApp_Application app( argc, argv );
 
   int result = -1;
+
+  if ( useLicense ) {
+    QString env;
+
+#ifdef WIN32
+    DWORD aLen=1024;
+    char aStr[1024];
+    HANDLE aToken=0;
+    HANDLE hProcess = GetCurrentProcess();
+    OpenProcessToken(hProcess,TOKEN_QUERY,&aToken);
+    if( GetUserProfileDirectory( aToken, aStr, &aLen ) )
+      env = aStr;
+
+#else
+    if ( ::getenv( "HOME" ) )
+      env = ::getenv( "HOME" );
+#endif
+    QFile file( env + "/ReadLicense.log" ); // Read the text from a file    
+    if( !file.exists() ) {
+      SUIT_LicenseDlg aLicense;
+      if ( aLicense.exec() != QDialog::Accepted ) 
+        return result;
+    }
+  }
+
   if ( !argList.isEmpty() )
   {
     SUITApp_Session* aSession = new SUITApp_Session( iniFormat );
     QtxSplash* splash = 0;
-    if ( !noSplash ) {
-      SUIT_ResourceMgr* resMgr = aSession->createResourceMgr( argList.first() );
-      if ( resMgr ) {
-       resMgr->loadLanguage();
-       QString appName    = QObject::tr( "APP_NAME" ).stripWhiteSpace();
-       QString appVersion = QObject::tr( "APP_VERSION" ).stripWhiteSpace();
-       if ( appVersion == "APP_VERSION" ) {
-         if ( appName == "APP_NAME" || appName.lower() == "salome" )
-           appVersion = salomeVersion();
-         else
-           appVersion = "";
+    SUIT_ResourceMgr* resMgr = aSession->createResourceMgr( argList.first() );
+    if ( !noSplash ) 
+    {
+      if ( resMgr )
+      {
+       resMgr->loadLanguage( false );
+
+       splash = QtxSplash::splash( QPixmap() );
+       splash->readSettings( resMgr );
+       if ( splash->pixmap().isNull() ) {
+         delete splash;
+         splash = 0;
        }
-       QString splashIcon;
-       resMgr->value( "splash", "image", splashIcon );
-       QPixmap px( splashIcon );
-       if ( !px.isNull() ) {
-         splash = QtxSplash::splash( px );
-         int splashMargin;
-         if ( resMgr->value( "splash", "margin", splashMargin ) && splashMargin > 0 ) {
-           splash->setMargin( splashMargin );
-         }
-         QString splashTextColors;
-         if ( resMgr->value( "splash", "text_colors", splashTextColors ) && !splashTextColors.isEmpty() ) {
-           QStringList colors = QStringList::split( "|", splashTextColors );
-           QColor c1, c2;
-           if ( colors.count() > 0 ) c1 = QColor( colors[0] );
-           if ( colors.count() > 1 ) c2 = QColor( colors[1] );
-           splash->setTextColors( c1, c2 );
-         }
-         else {
-           splash->setTextColors( Qt::white, Qt::black );
-         }
-#ifdef _DEBUG_
-         splash->setHideOnClick( true );
-#endif
-         QFont f = splash->font();
-         f.setBold( true );
-         splash->setFont( f );
-         QString splashInfo;
-         if ( resMgr->value( "splash", "info", splashInfo, false ) && !splashInfo.isEmpty() ) {
-           splashInfo.replace( QRegExp( "%A" ),  appName );
-           splashInfo.replace( QRegExp( "%V" ),  QObject::tr( "ABOUT_VERSION" ).arg( appVersion ) );
-           splashInfo.replace( QRegExp( "%L" ),  QObject::tr( "ABOUT_LICENSE" ) );
-           splashInfo.replace( QRegExp( "%C" ),  QObject::tr( "ABOUT_COPYRIGHT" ) );
-           splashInfo.replace( QRegExp( "\\\\n" ), "\n" );
-           splash->message( splashInfo );
+       else {
+         QString appName    = QObject::tr( "APP_NAME" ).trimmed();
+         QString appVersion = QObject::tr( "APP_VERSION" ).trimmed();
+         if ( appVersion == "APP_VERSION" )
+         {
+           if ( appName == "APP_NAME" || appName.toLower() == "salome" )
+             appVersion = salomeVersion();
+           else
+             appVersion = "";
          }
+         splash->setOption( "%A", appName );
+         splash->setOption( "%V", QObject::tr( "ABOUT_VERSION" ).arg( appVersion ) );
+         splash->setOption( "%L", QObject::tr( "ABOUT_LICENSE" ) );
+         splash->setOption( "%C", QObject::tr( "ABOUT_COPYRIGHT" ) );
          splash->show();
-         qApp->processEvents();
+         QApplication::instance()->processEvents();
        }
       }
     }
+
     SUIT_Application* theApp = aSession->startApplication( argList.first() );
     if ( theApp )
     {
+      Style_Salome::initialize( theApp->resourceMgr() );
+      if ( theApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) )
+       Style_Salome::apply();
+
       if ( !noExceptHandling )
         app.setHandler( aSession->handler() );
 
-//      if ( !app.mainWidget() )
-//        app.setMainWidget( theApp->desktop() );
       if ( splash )
        splash->finish( theApp->desktop() );
 
       result = app.exec();
-      if ( splash )
-       delete splash;
     }
     delete aSession;
   }
diff --git a/src/SUITApp/SUITApp.pro b/src/SUITApp/SUITApp.pro
new file mode 100644 (file)
index 0000000..cd5f85f
--- /dev/null
@@ -0,0 +1,39 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = app
+TARGET = SUITApp
+DESTDIR = ../../bin
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+INCLUDEPATH += ../../include ../Qtx ../SUIT
+LIBS += -L../../lib -lqtx -lsuit
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+
+HEADERS  = SUITApp_Application.h
+
+SOURCES  = SUITApp.cxx
+SOURCES += SUITApp_Application.cxx
index bf32979dea0b74650c171d9529389c82b1573c04..b0c4f91675599668a61d6f237b82230ef3c2cfba 100644 (file)
@@ -1,29 +1,31 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUITApp_Application.h"
 
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_ExceptionHandler.h"
+#include <SUIT_Tools.h>
+#include <SUIT_ExceptionHandler.h>
 
-#include <qdir.h>
-#include <qfileinfo.h>
+#include <QDir>
+#include <QTranslator>
 
 #ifdef WIN32
 #include <windows.h>
   Constructor
 */
 SUITApp_Application::SUITApp_Application( int& argc, char** argv, SUIT_ExceptionHandler* hand )
-: QApplication( argc, argv ),
+#ifdef ENABLE_TESTRECORDER
+  : TestApplication( argc, argv ),
+#else
+  : QApplication( argc, argv ),
+#endif
 myExceptHandler( hand )
 {
-  QString path = QFileInfo( argv[0] ).dirPath() + QDir::separator() + "../../resources";
+  QString path = SUIT_Tools::dir( argv[0] ) + QDir::separator() + "../../resources";
   path = QDir::convertSeparators( QDir( path ).canonicalPath() );
 
   QTranslator* strTbl = new QTranslator( 0 );
@@ -53,7 +59,11 @@ myExceptHandler( hand )
   Constructor
 */
 SUITApp_Application::SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* hand )
-: QApplication( argc, argv, type ),
+#ifdef ENABLE_TESTRECORDER
+  : TestApplication( argc, argv ),
+#else
+  : QApplication( argc, argv, type ),
+#endif
 myExceptHandler( hand )
 {
     QTranslator* strTbl = new QTranslator( 0 );
@@ -69,22 +79,12 @@ myExceptHandler( hand )
 */
 bool SUITApp_Application::notify( QObject* receiver, QEvent* e )
 {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) < 0x060101
-  // Disable GUI user actions while python command is executed
-  if (SUIT_Session::IsPythonExecuted()) {
-    // Disable mouse and keyboard events
-    QEvent::Type aType = e->type();
-    if (aType == QEvent::MouseButtonPress || aType == QEvent::MouseButtonRelease ||
-        aType == QEvent::MouseButtonDblClick || aType == QEvent::MouseMove ||
-        aType == QEvent::Wheel || aType == QEvent::ContextMenu ||
-        aType == QEvent::KeyPress || aType == QEvent::KeyRelease ||
-        aType == QEvent::Accel || aType == QEvent::AccelOverride)
-      return false;
-  }
-#endif
-
   return myExceptHandler ? myExceptHandler->handle( receiver, e ) :
+#ifdef ENABLE_TESTRECORDER
+                           TestApplication::notify( receiver, e );
+#else
                            QApplication::notify( receiver, e );
+#endif
 }
 
 /*!
index 479f07a20fffae6b3ebca33091c1d58053aa914b..17b41cd5d7adf84454e38a5538b3482ed0588bcb 100644 (file)
@@ -1,29 +1,50 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUITAPP_APPLICATION_H
 #define SUITAPP_APPLICATION_H
 
-#include <qapplication.h>
+#ifdef ENABLE_TESTRECORDER
+  #include <TestApplication.h>
+#else
+  #include <QApplication>
+#endif
 
 class SUIT_ExceptionHandler;
 
-class SUITApp_Application : public QApplication
+#ifdef WNT
+#  ifdef SUITAPP_EXPORTS
+#    define SUITAPP_EXPORT __declspec(dllexport)
+#  else
+#   define SUITAPP_EXPORT __declspec(dllimport)
+#  endif
+#else
+#  define SUITAPP_EXPORT
+#endif
+
+#ifdef ENABLE_TESTRECORDER
+  class SUITAPP_EXPORT SUITApp_Application : public TestApplication
+#else
+  class SUITAPP_EXPORT SUITApp_Application : public QApplication
+#endif
 {
   Q_OBJECT
 
index 3e268b6cf0d0b46f77b0a5ea2e42c13ce1079aa3..7801991b73c16f68639fadfdae4b73265e85b77d 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
@@ -14,9 +17,8 @@
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
 msgid "APP_ERROR"
 msgstr "Error"
 
diff --git a/src/SUITApp/resources/SUITApp_msg_en.ts b/src/SUITApp/resources/SUITApp_msg_en.ts
new file mode 100644 (file)
index 0000000..c355758
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>APP_OK</source>
+        <translation>Ok</translation>
+    </message>
+    <message>
+        <source>APP_ERROR</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>APP_UNK_EXCEPTION</source>
+        <translation>Unknown exception</translation>
+    </message>
+</context>
+</TS>
index c82a4dca4fb1770a64ce882f4d388ccdc42eebb0..621001bb865bbb1f50d51ee9ac02d2b0e68e636d 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSUPERVGraph.la
 
-salomeinclude_HEADERS= \
-       SUPERVGraph_ViewFrame.h \
-       SUPERVGraph_ViewManager.h \
-       SUPERVGraph_ViewModel.h \
+salomeinclude_HEADERS =                        \
+       SUPERVGraph_ViewFrame.h         \
+       SUPERVGraph_ViewManager.h       \
+       SUPERVGraph_ViewModel.h         \
        SUPERVGraph.h
 
-dist_libSUPERVGraph_la_SOURCES= \
-       SUPERVGraph.cxx \
-       SUPERVGraph_ViewFrame.cxx \
-       SUPERVGraph_ViewManager.cxx \
+dist_libSUPERVGraph_la_SOURCES =       \
+       SUPERVGraph.cxx                 \
+       SUPERVGraph_ViewFrame.cxx       \
+       SUPERVGraph_ViewManager.cxx     \
        SUPERVGraph_ViewModel.cxx 
 
-MOC_FILES= \
-       SUPERVGraph_moc.cxx \
-       SUPERVGraph_ViewFrame_moc.cxx \
-       SUPERVGraph_ViewManager_moc.cxx \
+MOC_FILES =                            \
+       SUPERVGraph_moc.cxx             \
+       SUPERVGraph_ViewFrame_moc.cxx   \
+       SUPERVGraph_ViewManager_moc.cxx \
        SUPERVGraph_ViewModel_moc.cxx 
-nodist_libSUPERVGraph_la_SOURCES= $(MOC_FILES)
+nodist_libSUPERVGraph_la_SOURCES = $(MOC_FILES)
 
-dist_salomeres_DATA= \
-       resources/view_pan.png \
-       resources/view_reset.png
+dist_salomeres_DATA =                  \
+       resources/superv_view_pan.png   \
+       resources/superv_view_reset.png
 
-nodist_salomeres_DATA= \
-       SUPERVGraph_images.qm \
+nodist_salomeres_DATA =                \
+       SUPERVGraph_images.qm   \
        SUPERVGraph_msg_en.qm  
 
-libSUPERVGraph_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
-       -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../OBJECT
-libSUPERVGraph_la_LDFLAGS=$(QT_MT_LIBS) ../SUIT/libsuit.la
+libSUPERVGraph_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
+                            -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../OBJECT
+libSUPERVGraph_la_LDFLAGS  = $(QT_MT_LIBS) ../SUIT/libsuit.la ../OBJECT/libSalomeObject.la
index d570c614a15a59d85b8fe54b226264cd392845b6..2a923e09e4db19bfc2ddcec450bad5f0908cf89c 100755 (executable)
@@ -1,34 +1,36 @@
-//  SALOME SUPERVGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME SUPERVGraph : build Supervisor viewer into desktop
 //  File   : SUPERVGraph.cxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SUPERVGraph.h"
 #include "SUPERVGraph_ViewFrame.h"
 
+#include "SUIT_Desktop.h"
+#include "SUIT_ViewWindow.h"
+
 using namespace std;
 
 /*!
@@ -36,7 +38,7 @@ using namespace std;
 */
 SUIT_ViewWindow* SUPERVGraph::createView(SUIT_Desktop* parent)
 {
-  return new SUPERVGraph_ViewFrame( parent/*, "vtkView"*/ ); 
+  return new SUPERVGraph_ViewFrame( parent ); 
 }
 
 extern "C"
index eef17b99834e805f4c90cb2afddaec7479dfad94..dcc9eaf4d89297041d3abac7a784f40ffb52c6bc 100755 (executable)
@@ -1,38 +1,34 @@
-//  SALOME SUPERVGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SUPERVGraph : build Supervisor viewer into desktop
 //  File   : SUPERVGraph.h
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SUPERVGraph_HeaderFile
 #define SUPERVGraph_HeaderFile
 
-#include "SUIT_Desktop.h"
-#include "SUIT_ViewWindow.h"
-
-#ifdef WNT
+#ifdef WIN32
 #ifdef SUPERVGRAPH_EXPORTS
 #define SUPERVGRAPH_EXPORT __declspec(dllexport)
 #else
 #define SUPERVGRAPH_EXPORT
 #endif
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
 
+#include <QObject>
+
+class SUIT_Desktop;
+class SUIT_ViewWindow;
+
 class SUPERVGRAPH_EXPORT SUPERVGraph : public QObject
 {
   Q_OBJECT
 
 public :
 
-    /*Standard_EXPORT*/ static SUIT_ViewWindow* createView ( SUIT_Desktop* parent);
+    static SUIT_ViewWindow* createView ( SUIT_Desktop* parent);
   
 };
 
diff --git a/src/SUPERVGraph/SUPERVGraph.pro b/src/SUPERVGraph/SUPERVGraph.pro
new file mode 100644 (file)
index 0000000..e0e1884
--- /dev/null
@@ -0,0 +1,70 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = SUPERVGraph
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
+
+INCLUDEPATH += $${QT_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../OBJECT
+
+LIBS += $${QT_MT_LIBS} -L../../lib -lsuit
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += SUPERVGRAPH_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = SUPERVGraph_ViewFrame.h
+HEADERS += SUPERVGraph_ViewManager.h
+HEADERS += SUPERVGraph_ViewModel.h
+HEADERS += SUPERVGraph.h
+
+SOURCES  = SUPERVGraph.cxx
+SOURCES += SUPERVGraph_ViewFrame.cxx
+SOURCES += SUPERVGraph_ViewManager.cxx
+SOURCES += SUPERVGraph_ViewModel.cxx
+
+TRANSLATIONS = resources/SUPERVGraph_images.ts \
+               resources/SUPERVGraph_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index e20b59768f619c1c862ef1df042310df1ff1e7c5..6cabb4e4efa0d7a9e06e78031ae25b267097d986 100755 (executable)
@@ -1,39 +1,38 @@
-//  SALOME SUPERVGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME SUPERVGraph : build Supervisor viewer into desktop
 //  File   : SUPERVGraph_ViewFrame.cxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SUPERVGraph_ViewFrame.h"
 
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 
 //QT Include
-#include <qlayout.h>
-#include <qcolordialog.h>
+#include <QVBoxLayout>
+#include <QToolBar>
 
 using namespace std;
 
@@ -57,7 +56,7 @@ SUPERVGraph_View::SUPERVGraph_View( SUPERVGraph_View* theParent ): QWidget( theP
 /*!
   Builds popup for SUPERVGraph viewer
 */
-void SUPERVGraph_View::contextMenuPopup( QPopupMenu* )
+void SUPERVGraph_View::contextMenuPopup( QMenu* )
 {
   // to be implemented
 }
@@ -94,8 +93,8 @@ SUPERVGraph_ViewFrame::SUPERVGraph_ViewFrame( SUIT_Desktop* theDesktop )
   setBackgroundColor(QColor(R,G,B));*/
 
   myToolBar = new QToolBar(this);
-  myToolBar->setCloseMode(QDockWindow::Undocked);
-  myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+  //myToolBar->setCloseMode(QDockWindow::Undocked);
+  myToolBar->setWindowTitle(tr("LBL_TOOLBAR_LABEL"));
   createActions();
   createToolBar();
 }
@@ -107,18 +106,18 @@ void SUPERVGraph_ViewFrame::createActions()
 {
   if (!myActionsMap.isEmpty()) return;
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-  QAction* aAction;
+  QtxAction* aAction;
 
   // Panning
-  aAction = new QAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_PAN" ) ),
-                       tr( "MNU_PAN_VIEW" ), 0, this);
+  aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_PAN" ) ),
+                         tr( "MNU_PAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_PAN_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
   myActionsMap[ PanId ] = aAction;
 
   // Reset
-  aAction = new QAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_RESET" ) ),
-                       tr( "MNU_RESET_VIEW" ), 0, this);
+  aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_RESET" ) ),
+                         tr( "MNU_RESET_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_RESET_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
   myActionsMap[ ResetId ] = aAction;
@@ -129,8 +128,8 @@ void SUPERVGraph_ViewFrame::createActions()
 */
 void SUPERVGraph_ViewFrame::createToolBar()
 {
-  myActionsMap[PanId]->addTo(myToolBar);
-  myActionsMap[ResetId]->addTo(myToolBar);
+  myToolBar->addAction( myActionsMap[PanId] );
+  myToolBar->addAction( myActionsMap[ResetId] );
 }
 
 /*!
@@ -278,8 +277,11 @@ void SUPERVGraph_ViewFrame::onViewFitAll()
 */
 void SUPERVGraph_ViewFrame::setBackgroundColor( const QColor& color )
 {
-    if (myView)
-      myView->setPaletteBackgroundColor(color);
+  if (myView) {
+    QPalette palette;
+    palette.setColor(myView->backgroundRole(), color);
+    myView->setPalette(palette);
+  }
 }
 
 /*!
@@ -288,8 +290,8 @@ void SUPERVGraph_ViewFrame::setBackgroundColor( const QColor& color )
 QColor SUPERVGraph_ViewFrame::backgroundColor() const
 {
   if (myView)
-    return myView->paletteBackgroundColor();
-  return QMainWindow::backgroundColor();
+    return myView->palette().color( myView->backgroundRole() );
+  return palette().color( backgroundRole() );
 }
 
 /*!
index 2a5e7f03b39dbbb410383c69ac6fb72fb6bda5fb..8f5dc645cef71bd668a9d1bbd8912ee780ad479b 100755 (executable)
@@ -1,31 +1,30 @@
-//  SALOME SUPERVGraph : build Supervisor viewer into desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SUPERVGraph : build Supervisor viewer into desktop
 //  File   : SUPERVGraph_ViewFrame.h
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SUPERVGraph_ViewFrame_H
 #define SUPERVGraph_ViewFrame_H
 
@@ -35,7 +34,7 @@
 #include "SUIT_PopupClient.h"
 #include "SUIT_ViewWindow.h"
 
-#include <qaction.h>
+#include <QtxAction.h>
 
 #ifdef WIN32
 #pragma warning ( disable:4251 )
@@ -54,7 +53,7 @@ class SUPERVGRAPH_EXPORT SUPERVGraph_View: public QWidget, public SUIT_PopupClie
 
   /* redefine functions from SUIT_PopupClient */
   virtual QString popupClientType() const { return Type(); }
-  virtual void    contextMenuPopup( QPopupMenu* );
+  virtual void    contextMenuPopup( QMenu* );
   
   virtual void resizeView( QResizeEvent* theEvent ) {};
   
@@ -125,7 +124,7 @@ class SUPERVGRAPH_EXPORT SUPERVGraph_ViewFrame : public SUIT_ViewWindow {
 
   //! Actions ID
   enum { PanId, ResetId };
-  typedef QMap<int, QAction*> ActionsMap;
+  typedef QMap<int, QtxAction*> ActionsMap;
 
   ActionsMap       myActionsMap;
   QToolBar*        myToolBar;
index 0f890c4b564a1ac81870d5aa77ca9cfdc33fd875..cf50f7e26ee262e43e4206053e5d8cddc17cde16 100644 (file)
@@ -1,23 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUPERVGraph_ViewManager.h"
 
+#include "SUIT_ViewWindow.h"
+
 int SUPERVGraph_ViewManager::myMaxId = 0;
 
 /*!
@@ -44,15 +49,15 @@ SUPERVGraph_ViewManager::~SUPERVGraph_ViewManager()
 */
 void SUPERVGraph_ViewManager::setViewName(SUIT_ViewWindow* theView)
 {
-  int aPos = myViews.find(theView);
-  theView->setCaption( QString( "SUPERVISION  scene:%1 - viewer:%2" ).arg( myId ).arg(aPos+1));
+  int aPos = myViews.indexOf(theView);
+  theView->setWindowTitle( QString( "SUPERVISION  scene:%1 - viewer:%2" ).arg( myId ).arg(aPos+1));
 }
 
 /*!
   Fills popup menu with custom actions
  \param popup - popup menu to be filled with
 */
-void SUPERVGraph_ViewManager::contextMenuPopup( QPopupMenu* thePopup)
+void SUPERVGraph_ViewManager::contextMenuPopup( QMenu* thePopup)
 {
   SUIT_ViewManager::contextMenuPopup( thePopup );
   // to be implemented
index 94c5a850df26ef5936aecc53e6dc2dd4cdec7d50..30998a8e7a624d23232a0073a0671436562c5f02 100644 (file)
@@ -1,27 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUPERVGRAPH_VIEWMANAGER_H
 #define SUPERVGRAPH_VIEWMANAGER_H
 
 #include "SUPERVGraph.h"
 
-#include "SUPERVGraph_ViewModel.h"
 #include "SUIT_ViewManager.h"
 
 class SUIT_Desktop;
@@ -34,7 +36,7 @@ public:
   SUPERVGraph_ViewManager( SUIT_Study* theStudy, SUIT_Desktop* theDesktop, SUIT_ViewModel* theViewModel = 0 );
   ~SUPERVGraph_ViewManager();
 
-  virtual void      contextMenuPopup( QPopupMenu* thePopup );
+  virtual void      contextMenuPopup( QMenu* thePopup );
 
 protected:
   void              setViewName(SUIT_ViewWindow* theView);
index a9911da3e4af1ab32c4b6df838be8091d0ffed18..59120a3fa443ed3f207c7c9e2863290d2c58ae64 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SUPERVGraph_ViewModel.h"
 #include "SUPERVGraph_ViewFrame.h"
index 9de2ffa509516184e648a1cf1b11c8b25a9f2237..7b62c8cea39cc33772a3c14525fd4c5a92d63bd0 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SUPERVGRAPH_VIEWMODEL_H
 #define SUPERVGRAPH_VIEWMODEL_H
index 97cab3fd6d7ec47a3ab725f10ed657157fbc8bdb..9787ad6d94d683e06f9307b7992b5c215b3f2b2a 100644 (file)
@@ -1,25 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      SUPERVGraph_images.po
-// Created:   11/22/2005 10:52:37 PM
-// Author:    Margarita Karpunina
-// Copyright (C) CEA 2005
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  File:      SUPERVGraph_images.po
+#  Created:   11/22/2005 10:52:37 PM
+#  Author:    Margarita Karpunina
 
 msgid "ICON_SUPERVGraph_PAN"
 msgstr "view_pan.png"
diff --git a/src/SUPERVGraph/resources/SUPERVGraph_images.ts b/src/SUPERVGraph/resources/SUPERVGraph_images.ts
new file mode 100644 (file)
index 0000000..5d7cf3b
--- /dev/null
@@ -0,0 +1,36 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>ICON_SUPERVGraph_PAN</source>
+        <translation>superv_view_pan.png</translation>
+    </message>
+    <message>
+        <source>ICON_SUPERVGraph_RESET</source>
+        <translation>superv_view_reset.png</translation>
+    </message>
+</context>
+</TS>
index 1bad63bd6690c67ad39bc0e93c266e9ddb23c496..83edc981711946b70a3baa867013a0930ea87d2d 100644 (file)
@@ -1,25 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      SUPERVGraph_msg_en.po
-// Created:   11/22/2005 10:55:36 PM
-// Author:    Margarita Karpunina
-// Copyright (C) CEA 2005
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  File:      SUPERVGraph_msg_en.po
+#  Created:   11/22/2005 10:55:36 PM
+#  Author:    Margarita Karpunina
 
 msgid "LBL_TOOLBAR_LABEL"
 msgstr "View Operations"
diff --git a/src/SUPERVGraph/resources/SUPERVGraph_msg_en.ts b/src/SUPERVGraph/resources/SUPERVGraph_msg_en.ts
new file mode 100644 (file)
index 0000000..145326d
--- /dev/null
@@ -0,0 +1,48 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panning</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Panning the view</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Reset</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Reset View Point</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>View Operations</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/SUPERVGraph/resources/superv_view_pan.png b/src/SUPERVGraph/resources/superv_view_pan.png
new file mode 100644 (file)
index 0000000..ec56cac
Binary files /dev/null and b/src/SUPERVGraph/resources/superv_view_pan.png differ
diff --git a/src/SUPERVGraph/resources/superv_view_reset.png b/src/SUPERVGraph/resources/superv_view_reset.png
new file mode 100644 (file)
index 0000000..66f81e6
Binary files /dev/null and b/src/SUPERVGraph/resources/superv_view_reset.png differ
diff --git a/src/SUPERVGraph/resources/view_pan.png b/src/SUPERVGraph/resources/view_pan.png
deleted file mode 100644 (file)
index 038fba1..0000000
Binary files a/src/SUPERVGraph/resources/view_pan.png and /dev/null differ
diff --git a/src/SUPERVGraph/resources/view_reset.png b/src/SUPERVGraph/resources/view_reset.png
deleted file mode 100644 (file)
index 1285064..0000000
Binary files a/src/SUPERVGraph/resources/view_reset.png and /dev/null differ
index a1c1c484d30b2cf062fb332a569d26b6de72893d..4fd59aa4a111e9c280e720a5999969c0f01c8e0e 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Alexander Solovyov(OCN)
 #  Module : SVTK
 # $Header: 
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSVTK.la
@@ -36,13 +39,13 @@ salomeinclude_HEADERS= \
        SVTK_FontWidget.h \
        SVTK_CubeAxesActor2D.h \
        SVTK_Functor.h \
-       SVTK_MainWindow.h \
        SVTK_View.h \
        SVTK_ViewManager.h \
        SVTK_ViewModel.h \
        SVTK_ViewWindow.h \
        SVTK_Renderer.h \
        SVTK_InteractorStyle.h \
+       SVTK_KeyFreeInteractorStyle.h \
        SVTK_RenderWindowInteractor.h \
        SVTK_GenericRenderWindowInteractor.h \
        SVTK_Selector.h \
@@ -52,7 +55,13 @@ salomeinclude_HEADERS= \
        SVTK_Event.h \
        SVTK_ViewModelBase.h \
        SVTK_SetRotationPointDlg.h \
-       SVTK_Extension.h
+       SVTK_ViewParameterDlg.h \
+       SVTK_ComboAction.h \
+       SVTK_Extension.h \
+       SVTK_Recorder.h \
+       SVTK_RecorderDlg.h \
+       SVTK_ImageWriter.h \
+       SVTK_ImageWriterMgr.h
 
 dist_libSVTK_la_SOURCES= \
        SVTK_Prs.cxx \
@@ -67,21 +76,29 @@ dist_libSVTK_la_SOURCES= \
        SVTK_DialogBase.cxx \
        SVTK_FontWidget.cxx \
        SVTK_Trihedron.cxx \
-       SVTK_MainWindow.cxx \
        SVTK_View.cxx \
        SVTK_ViewManager.cxx \
        SVTK_ViewModel.cxx \
        SVTK_Renderer.cxx \
        SVTK_ViewWindow.cxx \
        SVTK_InteractorStyle.cxx \
+       SVTK_KeyFreeInteractorStyle.cxx \
        SVTK_RenderWindowInteractor.cxx \
        SVTK_GenericRenderWindowInteractor.cxx \
        SVTK_SpaceMouse.cxx \
        SVTK_Selector.cxx \
        SVTK_SetRotationPointDlg.cxx \
-       SVTK_Extension.cxx
+       SVTK_ViewParameterDlg.cxx \
+       SVTK_ComboAction.cxx \
+       SVTK_Extension.cxx \
+       SVTK_Recorder.cxx \
+       SVTK_RecorderDlg.cxx \
+       SVTK_ImageWriter.cxx \
+       SVTK_ImageWriterMgr.cxx
 
-EXTRA_DIST+= SVTK_SelectorDef.h SVTK_Trihedron.h
+
+# internal headers
+EXTRA_DIST += SVTK_SelectorDef.h SVTK_Trihedron.h
 
 MOC_FILES= \
        SVTK_GenericRenderWindowInteractor_moc.cxx \
@@ -94,41 +111,56 @@ MOC_FILES= \
        SVTK_ViewModelBase_moc.cxx \
        SVTK_ViewManager_moc.cxx \
        SVTK_ViewWindow_moc.cxx \
-       SVTK_MainWindow_moc.cxx \
        SVTK_ViewModel_moc.cxx \
        SVTK_View_moc.cxx \
-       SVTK_SetRotationPointDlg_moc.cxx
+       SVTK_SetRotationPointDlg_moc.cxx \
+       SVTK_ViewParameterDlg_moc.cxx \
+       SVTK_ComboAction_moc.cxx \
+       SVTK_RecorderDlg_moc.cxx
 nodist_libSVTK_la_SOURCES= $(MOC_FILES)
 
-nodist_salomeres_DATA= \
-       SVTK_msg_en.qm \
+dist_salomeres_DATA=\
+       resources/vtk_view_graduated_axes.png \
+       resources/vtk_view_scaling.png \
+       resources/vtk_view_update_rate.png \
+       resources/vtk_view_rotation_point.png \
+       resources/vtk_view_parallel.png \
+       resources/vtk_view_perspective.png \
+       resources/vtk_view_parameters.png \
+       resources/vtk_view_style_switch.png \
+       resources/vtk_view_recording_start.png \
+       resources/vtk_view_recording_play.png \
+       resources/vtk_view_recording_pause.png \
+       resources/vtk_view_recording_stop.png
+
+nodist_salomeres_DATA =        \
+       SVTK_msg_en.qm  \
        SVTK_images.qm
 
-libSVTK_la_CPPFLAGS= \
-       $(QT_INCLUDES) \
-       $(CAS_CPPFLAGS) \
-       $(VTK_INCLUDES) \
-       $(QWT_INCLUDES) \
-       $(BOOST_CPPFLAGS) \
-       -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../STD \
-       -I$(srcdir)/../CAM -I$(srcdir)/../OBJECT -I$(srcdir)/../Prs \
+libSVTK_la_CPPFLAGS =          \
+       $(QT_INCLUDES)          \
+       $(CAS_CPPFLAGS)         \
+       $(VTK_INCLUDES)         \
+       $(BOOST_CPPFLAGS)       \
+       -I$(srcdir)/../Qtx      \
+       -I$(srcdir)/../SUIT     \
+       -I$(srcdir)/../OBJECT   \
+       -I$(srcdir)/../Prs      \
        -I$(srcdir)/../VTKViewer
 
-libSVTK_la_LDFLAGS= \
-       $(VTK_LIBS) \
-       $(QT_MT_LIBS) \
-       $(CAS_KERNEL) $(CAS_VIEWER) \
-       $(QWT_LIBS)
+libSVTK_la_LDFLAGS =                   \
+       $(QT_MT_LIBS)                   \
+       $(CAS_KERNEL) $(CAS_VIEWER)     \
+       $(VTK_LIBS) $(OGL_LIBS)
 
-libSVTK_la_LIBADD= ../Qtx/libqtx.la ../SUIT/libsuit.la ../STD/libstd.la \
-                  ../CAM/libCAM.la ../OBJECT/libSalomeObject.la \
-                  ../Prs/libSalomePrs.la ../VTKViewer/libVTKViewer.la
+libSVTK_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la ../OBJECT/libSalomeObject.la \
+                   ../Prs/libSalomePrs.la ../VTKViewer/libVTKViewer.la
 
 # Executable
 bin_PROGRAMS = SVTK
 
-dist_SVTK_SOURCES= SVTK.cxx
+dist_SVTK_SOURCES = SVTK.cxx
 
-SVTK_CPPFLAGS=$(libSVTK_la_CPPFLAGS)
-SVTK_LDFLAGS=$(libSVTK_la_LDFLAGS)
-SVTK_LDADD=libSVTK.la $(libSVTK_la_LIBADD)
+SVTK_CPPFLAGS = $(libSVTK_la_CPPFLAGS)
+SVTK_LDFLAGS  = $(libSVTK_la_LDFLAGS)
+SVTK_LDADD    = libSVTK.la $(libSVTK_la_LIBADD)
index b9597c30c1fb3fc0bc9ed43b6743e4ff320dff3c..0fc168c054edfbe675d91b87d167fa426214c30b 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_Actor.cxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 /*!
   \class SALOME_Actor SALOME_Actor.h
   \brief Abstract class of SALOME Objects in VTK.
@@ -33,6 +32,7 @@
 
 
 #include "SALOME_Actor.h"
+#include "SALOME_InteractiveObject.hxx"
 
 #include "VTKViewer_Transform.h"
 #include "VTKViewer_TransformFilter.h"
@@ -418,7 +418,7 @@ SALOME_Actor
 {
   if ( !GetPickable() )
     return false;
-
+      
   vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer();
   //
   myPreHighlightActor->SetVisibility( false );
@@ -508,7 +508,7 @@ SALOME_Actor
          if(myIsPreselected){
            const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
            int anExtent = aMapIndex.Extent();
-           anIsChanged |= (anExtent == 0);
+           anIsChanged |= (anExtent == 0 || anExtent == 1);
            anIsChanged |= (anExtent == 2 && (anObjId != aMapIndex(1) || anEdgeId != aMapIndex(2)));
            if(anIsChanged){
              TColStd_IndexedMapOfInteger aMapIndex;
index a44acc9fd35a369ded98aec4110e9889dc4572a3..a8c9ac999134dd011d9694ad704b4e8de281cfac 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_Actor.h
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SALOME_ACTOR_H
 #define SALOME_ACTOR_H
 
@@ -33,7 +32,7 @@
 #include "SVTK_Selector.h"
 #include "SVTK.h"
 
-#include "SALOME_InteractiveObject.hxx"
+class Handle(SALOME_InteractiveObject);
 
 // undefining min and max because CASCADE's defines them and
 // it clashes with std::min(), std::max()
@@ -54,8 +53,8 @@ class SVTK_Actor;
 class SVTK_RectPicker;
 class SVTK_InteractorStyle;
 
-extern int SALOME_POINT_SIZE;
-extern int SALOME_LINE_WIDTH;
+SVTK_EXPORT extern int SALOME_POINT_SIZE;
+SVTK_EXPORT extern int SALOME_LINE_WIDTH;
 
 #ifdef WIN32
 #pragma warning ( disable:4251 )
index 674714f7751ac9322e6373695f54ad7621ea1ee0..1d9850573a02455a6b075f003f527ec7f2fe833c 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   :
 //  Author :
 //  Module :
 //  $Header$
-
+//
 #include "SVTK.h"
 #include "SVTK_Prs.h"
 #include "SVTK_Actor.h"
@@ -35,8 +34,7 @@
 #include "SVTK_CubeAxesActor2D.h"
 #include "SVTK_Functor.h"
 #include "SVTK_View.h"
-#include "SVTK_MainWindow.h"
-#include "SVTK_MainWindow.h"
+//#include "SVTK_MainWindow.h"
 #include "SVTK_NonIsometricDlg.h"
 #include "SVTK_CubeAxesDlg.h"
 #include "SVTK_FontWidget.h"
index b07763c0b41008e425db98c6916be7d879b6c2af..8cd598065086af2c0681618ad340ad2559849c45 100755 (executable)
@@ -1,27 +1,30 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SVTK_H
 #define SVTK_H
 
 #include "VTKViewer.h"
 
-#ifdef WNT
+#ifdef WIN32
 #  ifdef SVTK_EXPORTS
 #    define SVTK_EXPORT __declspec(dllexport)
 #  else
@@ -31,7 +34,7 @@
 #  define SVTK_EXPORT
 #endif
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #pragma warning ( disable: 4786 )
 #endif
diff --git a/src/SVTK/SVTK.pro b/src/SVTK/SVTK.pro
new file mode 100644 (file)
index 0000000..8567a08
--- /dev/null
@@ -0,0 +1,118 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = SVTK
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+VTKHOME = $$(VTKHOME)
+VTK_INCLUDES = $${VTKHOME}/include/vtk
+
+VTK_LIBS = -L$${VTKHOME}/lib/vtk -L$${VTKHOME}/lib/vtk/python -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets   -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+OCC_LIBS = 
+
+INCLUDEPATH += ../../include $${CAS_CPPFLAGS} $${VTK_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../OBJECT ../Prs ../VTKViewer
+LIBS += -L../../lib -lqtx -lsuit -lSalomeObject -lSalomePrs -lVTKViewer $${OCC_LIBS} $${VTK_LIBS}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += SVTK_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = SVTK.h
+HEADERS += SVTK_Prs.h
+HEADERS += SVTK_Actor.h
+HEADERS += SALOME_Actor.h
+HEADERS += SVTK_RectPicker.h
+HEADERS += SVTK_DeviceActor.h
+HEADERS += SVTK_DialogBase.h
+HEADERS += SVTK_FontWidget.h
+HEADERS += SVTK_CubeAxesActor2D.h
+HEADERS += SVTK_Functor.h
+HEADERS += SVTK_View.h
+HEADERS += SVTK_ViewManager.h
+HEADERS += SVTK_ViewModel.h
+HEADERS += SVTK_ViewWindow.h
+HEADERS += SVTK_Renderer.h
+HEADERS += SVTK_InteractorStyle.h
+HEADERS += SVTK_KeyFreeInteractorStyle.h
+HEADERS += SVTK_RenderWindowInteractor.h
+HEADERS += SVTK_GenericRenderWindowInteractor.h
+HEADERS += SVTK_Selector.h
+HEADERS += SVTK_Selection.h
+HEADERS += SVTK_SelectionEvent.h
+HEADERS += SVTK_SpaceMouse.h
+HEADERS += SVTK_Event.h
+HEADERS += SVTK_ViewModelBase.h
+HEADERS += SVTK_SetRotationPointDlg.h
+HEADERS += SVTK_ViewParametersDlg.h
+HEADERS += SVTK_ComboAction.h
+HEADERS += SVTK_Extension.h
+
+SOURCES  = SVTK_Prs.cxx
+SOURCES += SVTK_Actor.cxx
+SOURCES += SALOME_Actor.cxx
+SOURCES += SVTK_RectPicker.cxx
+SOURCES += SVTK_DeviceActor.cxx
+SOURCES += SVTK_CubeAxesActor2D.cxx
+SOURCES += SVTK_NonIsometricDlg.cxx
+SOURCES += SVTK_UpdateRateDlg.cxx
+SOURCES += SVTK_CubeAxesDlg.cxx
+SOURCES += SVTK_DialogBase.cxx
+SOURCES += SVTK_FontWidget.cxx
+SOURCES += SVTK_Trihedron.cxx
+SOURCES += SVTK_View.cxx
+SOURCES += SVTK_ViewManager.cxx
+SOURCES += SVTK_ViewModel.cxx
+SOURCES += SVTK_Renderer.cxx
+SOURCES += SVTK_ViewWindow.cxx
+SOURCES += SVTK_InteractorStyle.cxx
+SOURCES += SVTK_KeyFreeInteractorStyle.cxx
+SOURCES += SVTK_RenderWindowInteractor.cxx
+SOURCES += SVTK_GenericRenderWindowInteractor.cxx
+SOURCES += SVTK_SpaceMouse.cxx
+SOURCES += SVTK_Selector.cxx
+SOURCES += SVTK_SetRotationPointDlg.cxx
+SOURCES += SVTK_ViewParametersDlg.cxx
+SOURCES += SVTK_ComboAction.cxx
+SOURCES += SVTK_Extension.cxx
+
+TRANSLATIONS = resources/SVTK_images.ts \
+               resources/SVTK_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 1d32a1c2b1f099d19fb54268ed880cc76671e4ad..220b8e450456c810d39061f0ef037bc90a579102 100644 (file)
@@ -1,4 +1,6 @@
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 #include "SVTK_Actor.h"
 #include "SALOME_Actor.h"
 
+#include "SALOME_InteractiveObject.hxx"
+
 // VTK Includes
 #include <vtkObjectFactory.h>
 #include <vtkUnstructuredGrid.h>
@@ -143,11 +147,13 @@ SVTK_Actor
   if(int aNbOfParts = theMapIndex.Extent()){
     vtkPoints *aPoints = vtkPoints::New();
     aPoints->SetNumberOfPoints(aNbOfParts);
-    for(int i = 0; i < aNbOfParts; i++){
+    for(vtkIdType i = 0; i < aNbOfParts; i++){
       int aPartId = theMapIndex( i+1 );
       if(vtkFloatingPointType* aCoord = theMapActor->GetNodeCoord(aPartId)){
        aPoints->SetPoint(i,aCoord);
-       myUnstructuredGrid->InsertNextCell(VTK_VERTEX,1,&i);
+       // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
+       // from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON
+       myUnstructuredGrid->InsertNextCell(VTK_VERTEX,(vtkIdType) 1,&i);
       }
     }
     myUnstructuredGrid->SetPoints(aPoints);
index e0a8afc0297e825a62145403234cce2c6dbb7512..eda8e2e3a558d3e3a787f3e15ef3ee0834dff75b 100644 (file)
@@ -1,22 +1,24 @@
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 #ifndef SVTK_ACTOR_H
 #define SVTK_ACTOR_H
 
diff --git a/src/SVTK/SVTK_ComboAction.cxx b/src/SVTK/SVTK_ComboAction.cxx
new file mode 100644 (file)
index 0000000..bec4331
--- /dev/null
@@ -0,0 +1,122 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  File   : 
+//  Author : 
+//  Module : SALOME
+//  $Header: 
+//
+#include "SVTK_ComboAction.h"
+
+#include <QComboBox>
+#include <QHBoxLayout>
+
+SVTK_ComboAction::SVTK_ComboAction( QObject* parent )
+  : QWidgetAction( parent )
+{
+  myCurId = -1;
+}
+
+SVTK_ComboAction::SVTK_ComboAction( const QString& text, QObject* parent )
+  : QWidgetAction( parent )
+{
+  setToolTip( text );
+  myCurId = -1;
+}
+
+SVTK_ComboAction::~SVTK_ComboAction()
+{
+  myIcons.clear();
+}
+
+void SVTK_ComboAction::insertItem( const QIcon& icon, const int index )
+{
+  if ( index < 0 || index > myIcons.size() )
+    myIcons.append( icon );
+  else
+    myIcons.insert( index, icon );
+
+  update();
+}
+
+void SVTK_ComboAction::clear()
+{
+  myIcons.clear();
+  update();
+}
+
+void SVTK_ComboAction::setCurrentIndex( const int id )
+{
+  if ( myCurId != id ) 
+  {
+    myCurId = id;
+    update();
+  }
+}
+
+int SVTK_ComboAction::currentIndex() const
+{
+  return myCurId;
+}
+
+QWidget* SVTK_ComboAction::createWidget( QWidget* parent )
+{
+  QWidget* w = 0;
+  if ( parent->inherits("QToolBar") )
+  {
+    w = new QWidget( parent );
+    QHBoxLayout* l = new QHBoxLayout( w );
+    l->setSpacing(0); l->setMargin(0);
+    QComboBox* combo = new QComboBox( w );
+    combo->setFocusPolicy( Qt::NoFocus );
+    combo->setSizeAdjustPolicy( QComboBox::AdjustToContents );
+    l->addSpacing( 3 );
+    l->addWidget( combo );
+    l->addSpacing( 3 );
+
+    updateCombo( combo );
+    connect( combo, SIGNAL( activated( int ) ), this, SIGNAL( triggered( int ) ) );
+  }
+  return w;
+}
+
+void SVTK_ComboAction::update()
+{
+  QList<QWidget*> aList = createdWidgets();
+  for ( QList<QWidget*>::const_iterator it = aList.begin(); it != aList.end(); ++it )
+    updateCombo( qFindChild<QComboBox*>(*it) );
+}
+
+void SVTK_ComboAction::updateCombo( QComboBox* combo )
+{
+  if ( !combo ) return;
+
+  combo->clear();
+
+  for ( QList<QIcon>::const_iterator it = myIcons.begin(); it != myIcons.end(); ++it )
+    combo->addItem( *it, "" );
+
+  if ( combo->count() > 0 ) {
+    if ( myCurId < 0 ) myCurId = 0;
+    combo->setCurrentIndex( myCurId );
+  }
+}
diff --git a/src/SVTK/SVTK_ComboAction.h b/src/SVTK/SVTK_ComboAction.h
new file mode 100644 (file)
index 0000000..245b132
--- /dev/null
@@ -0,0 +1,65 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  File   : 
+//  Author : 
+//  Module : SALOME
+//  $Header:
+//
+#ifndef SVTK_COMBOACTION_H
+#define SVTK_COMBOACTION_H
+
+#include "SVTK.h"
+
+#include <QWidgetAction>
+
+class QComboBox;
+class SVTK_EXPORT SVTK_ComboAction : public QWidgetAction
+{
+  Q_OBJECT
+
+public:
+  SVTK_ComboAction( QObject* = 0 );
+  SVTK_ComboAction( const QString&, QObject* = 0 );
+  virtual ~SVTK_ComboAction();
+
+  void insertItem( const QIcon&, const int = -1  );
+  void clear();
+
+  void setCurrentIndex( const int );
+  int  currentIndex() const;
+
+signals:
+  void triggered( int );
+
+protected:
+  virtual QWidget* createWidget( QWidget* );
+
+  virtual void update();
+  virtual void updateCombo( QComboBox* );
+
+private:
+  QList<QIcon> myIcons;
+  int myCurId;
+};
+
+#endif // SVTK_COMBOACTION_H
index 823c072240e1facfc0669003870d7740e94ceb95..51c1e956e14bb3b6e329c88fa69f11a739967183 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME OBJECT : kernel of SALOME component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : kernel of SALOME component
 //  File   : SVTK_CubeAxesActor2D.cxx
 //  Author : Eugeny Nikolaev
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SVTK_CubeAxesActor2D.h"
 #include "VTKViewer_Transform.h"
 
@@ -205,11 +204,7 @@ static void ChangeValues(vtkFloatingPointType* aArray1,
     for (int i=0; i<4; i++){
       tmp = aArray1[i]; aArray1[i] = aArray2[i]; aArray2[i] = tmp;
     }
-#ifndef WNT
     for(int i=0;i<2; i++){
-#else
-    for(i=0;i<2; i++){
-#endif
       tmp = aRange1[i]; aRange1[i] = aRange2[i]; aRange2[i] = tmp;
     }
   }
@@ -450,31 +445,19 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport)
 
   // XCoords coordinates for X grid
   vtkFloatArray *XCoords = vtkFloatArray::New();
-#ifndef WNT
   for(int i=0;i<numOfLabelsX;i++){
-#else
-  for(i=0;i<numOfLabelsX;i++){
-#endif
     vtkFloatingPointType val = bounds[0]+i*(bounds[1]-bounds[0])/(numOfLabelsX-1);
     XCoords->InsertNextValue(val);
   }
   // YCoords coordinates for Y grid
   vtkFloatArray *YCoords = vtkFloatArray::New();
-#ifndef WNT
   for(int i=0;i<numOfLabelsX;i++){
-#else
-  for(i=0;i<numOfLabelsX;i++){
-#endif
     vtkFloatingPointType val = bounds[2]+i*(bounds[3]-bounds[2])/(numOfLabelsY-1);
     YCoords->InsertNextValue(val);
   }
   // ZCoords coordinates for Z grid
   vtkFloatArray *ZCoords = vtkFloatArray::New();
-#ifndef WNT
   for(int i=0;i<numOfLabelsZ;i++){
-#else
-  for(i=0;i<numOfLabelsZ;i++){
-#endif
     vtkFloatingPointType val = bounds[4]+i*(bounds[5]-bounds[4])/(numOfLabelsZ-1);
     ZCoords->InsertNextValue(val);
   }
@@ -534,11 +517,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport)
   p[5][1] = YCoords->GetValue(numOfLabelsY-1);
   p[5][2] = aMiddleZ;
 
-#ifndef WNT
   for(int i=0;i<3;i++) 
-#else
-  for(i=0;i<3;i++) 
-#endif
     for(int j=0;j<6;j++) vecs[j][i] = p[j][i] - aCPosition[i];
 
   if ( vtkMath::Dot(vecs[0],aCDirection) < vtkMath::Dot(vecs[1],aCDirection))
index 445f6d71e744ab0ed2fe832a0d29c66790715dcb..75b084c8c9228ba81faa9206123b18beb24ba32e 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME OBJECT : kernel of SALOME component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : kernel of SALOME component
 //  File   : SVTK_CubeAxesActor2D.h
 //  Author : Eugeny Nikolaev
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef __SVTK_CubeAxesActor2D_h
 #define __SVTK_CubeAxesActor2D_h
 
@@ -48,7 +47,7 @@ class VTKViewer_Transform;
 #pragma warning ( disable:4251 )
 #endif
 
-#ifndef WNT
+#ifndef WIN32
 class VTK_HYBRID_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D
 #else
 class SVTK_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D
index 94e4af88f0957e40d178debaf8e38164f8343ad9..bcf79ef490095880823d580bedf851d6c14c2cd7 100644 (file)
@@ -1,6 +1,6 @@
-//  VISU VISUGUI : GUI for SMESH component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  VISU VISUGUI : GUI for SMESH component
 //  File   : SVTK_CubeAxesDlg.cxx
 //  Author : Sergey LITONIN
 //  Module : VISU
-
+//
 #include "SVTK_CubeAxesDlg.h"
 
-#include "SVTK_MainWindow.h"
+#include "SVTK_ViewWindow.h"
 #include "SVTK_FontWidget.h"
 
 #include "SVTK_CubeAxesActor2D.h"
 #include "QtxAction.h"
 #include "QtxIntSpinBox.h"
 
-#include <qlayout.h>
-#include <qframe.h>
-#include <qpushbutton.h>
-#include <qtabwidget.h>
-#include <qcheckbox.h>
-#include <qgroupbox.h>
-#include <qlineedit.h>
-#include <qlabel.h>
-#include <qobjectlist.h>
-#include <qvalidator.h>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QPushButton>
+#include <QTabWidget>
+#include <QCheckBox>
+#include <QGroupBox>
+#include <QLineEdit>
+#include <QLabel>
 
 #include <vtkAxisActor2D.h>
 #include <vtkTextProperty.h>
 
 /*!
- * Class       : AxisWg
- * Description : Tab of dialog
- */
+  \class SVTK_CubeAxesDlg::AxisWidget
+  \brief Axis tab widget of the "Graduated axis" dialog box
+  \internal
+*/
+
+class SVTK_CubeAxesDlg::AxisWidget : public QFrame
+{
+public:
+  AxisWidget( QWidget* );
+  ~AxisWidget();
+
+  void             UseName( const bool );
+  void             SetName( const QString& );
+  void             SetNameFont( const QColor&, const int, const bool, const bool, const bool );
+  bool             ReadData( vtkAxisActor2D* );
+  bool             Apply( vtkAxisActor2D* );
+
+private:
+  // name
+  QGroupBox*       myNameGrp;
+  QLineEdit*       myAxisName;
+  SVTK_FontWidget* myNameFont;
+
+  // labels
+  QGroupBox*       myLabelsGrp;
+  QtxIntSpinBox*   myLabelNumber;
+  QtxIntSpinBox*   myLabelOffset;
+  SVTK_FontWidget* myLabelsFont;
+
+  // tick marks
+  QGroupBox*       myTicksGrp;
+  QtxIntSpinBox*   myTickLength;
+
+  friend class SVTK_CubeAxesDlg;
+};
 
 /*!
   Constructor
 */
-SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
+SVTK_CubeAxesDlg::AxisWidget::AxisWidget (QWidget* theParent)
 :  QFrame(theParent)
 {
-  QValueList< QLabel* > aLabels;
+  QList< QLabel* > aLabels;
 
   // "Name" grp
 
-  myNameGrp = new QGroupBox(3, Qt::Vertical, tr("AXIS_NAME"), this);
-  myIsNameVisible = new QCheckBox(tr("IS_VISIBLE"), myNameGrp);
+  myNameGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("AXIS_NAME"), this);
+  myNameGrp->setCheckable( true );
 
-  QHBox* aHBox = new QHBox(myNameGrp);
+  QVBoxLayout* aVBox = new QVBoxLayout;
+  
+  QHBoxLayout* aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  QLabel* aLabel = new QLabel(tr("NAME"), aHBox);
-  myAxisName = new QLineEdit(aHBox);
+  QLabel* aLabel = new QLabel(SVTK_CubeAxesDlg::tr("NAME"));
+  aHBox->addWidget(aLabel);
+  myAxisName = new QLineEdit;
+  aHBox->addWidget(myAxisName);
   aLabels.append(aLabel);
+  aVBox->addLayout(aHBox);
 
-  aHBox = new QHBox(myNameGrp);
+  aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  aLabel = new QLabel(tr("FONT"), aHBox);
-  myNameFont = new SVTK_FontWidget(aHBox);
+  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("FONT"));
+  aHBox->addWidget(aLabel);
+  myNameFont = new SVTK_FontWidget(myNameGrp);
+  aHBox->addWidget(myNameFont);
   aLabels.append(aLabel);
+  aVBox->addLayout(aHBox);
 
+  myNameGrp->setLayout(aVBox);
 
   // "Labels" grp
 
-  myLabelsGrp = new QGroupBox(4, Qt::Vertical, tr("LABELS"), this);
-  myIsLabelsVisible = new QCheckBox(tr("IS_VISIBLE"), myLabelsGrp);
+  myLabelsGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("LABELS"), this);
+  myLabelsGrp->setCheckable( true );
 
-  aHBox = new QHBox(myLabelsGrp);
+  aVBox = new QVBoxLayout;
+
+  aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  aLabel = new QLabel(tr("NUMBER"), aHBox);
-  myLabelNumber = new QtxIntSpinBox(0,25,1,aHBox,"SpinBoxLabelNumber");
+  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("NUMBER"));
+  aHBox->addWidget(aLabel);
+  myLabelNumber = new QtxIntSpinBox(0,25,1,myLabelsGrp);
+  aHBox->addWidget(myLabelNumber);
   aLabels.append(aLabel);
+  aVBox->addLayout(aHBox);
 
-  aHBox = new QHBox(myLabelsGrp);
+  aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  aLabel = new QLabel(tr("OFFSET"), aHBox);
-  myLabelOffset = new QtxIntSpinBox(0,100,1,aHBox,"SpinBoxLabellOffset");
+  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("OFFSET"));
+  aHBox->addWidget(aLabel);
+  myLabelOffset = new QtxIntSpinBox(0,100,1,myLabelsGrp);
+  aHBox->addWidget(myLabelOffset);
   aLabels.append(aLabel);
+  aVBox->addLayout(aHBox);
 
-  aHBox = new QHBox(myLabelsGrp);
+  aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  aLabel = new QLabel(tr("FONT"), aHBox);
-  myLabelsFont = new SVTK_FontWidget(aHBox);
+  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("FONT"));
+  aHBox->addWidget(aLabel);
+  myLabelsFont = new SVTK_FontWidget(myLabelsGrp);
+  aHBox->addWidget(myLabelsFont);
   aLabels.append(aLabel);
+  aVBox->addLayout(aHBox);
+
+  myLabelsGrp->setLayout(aVBox);
 
   // "Tick marks" grp
 
-  myTicksGrp = new QGroupBox(2, Qt::Vertical, tr("TICK_MARKS"), this);
-  myIsTicksVisible = new QCheckBox(tr("IS_VISIBLE"), myTicksGrp);
+  myTicksGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("TICK_MARKS"), this);
+  myTicksGrp->setCheckable( true );
 
-  aHBox = new QHBox(myTicksGrp);
+  aVBox = new QVBoxLayout;
+
+  aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  aLabel = new QLabel(tr("LENGTH"), aHBox);
-  myTickLength = new QtxIntSpinBox(0,100,1,aHBox,"SpinBoxTickLength");
-  
+  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("LENGTH"));
+  aHBox->addWidget(aLabel);
+  myTickLength = new QtxIntSpinBox(0,100,1,myTicksGrp);
+  aHBox->addWidget(myTickLength);
   aLabels.append(aLabel);
+  aVBox->addLayout(aHBox);
+
+  myTicksGrp->setLayout(aVBox);
 
   // Layout
 
-  QVBoxLayout* aLay = new QVBoxLayout(this, 0, 5);
+  QVBoxLayout* aLay = new QVBoxLayout(this);
+  aLay->setMargin(5);
+  aLay->setSpacing(5);
   aLay->addWidget(myNameGrp);
   aLay->addWidget(myLabelsGrp);
   aLay->addWidget(myTicksGrp);
 
   // init
-  myIsNameVisible->setChecked(true);
-  myIsLabelsVisible->setChecked(true);
-  myIsTicksVisible->setChecked(true);
-  updateControlState();
+  myNameGrp->setChecked( true );
+  myLabelsGrp->setChecked( true );
+  myTicksGrp->setChecked( true );
 
   // Adjust label widths
-  QValueList< QLabel* >::iterator anIter;
+  QList< QLabel* >::iterator anIter;
   int aMaxWidth = 0;
   for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++)
-    aMaxWidth = QMAX(aMaxWidth, (*anIter)->sizeHint().width());
+    aMaxWidth = qMax(aMaxWidth, (*anIter)->sizeHint().width());
   for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++)
     (*anIter)->setFixedWidth(aMaxWidth);
-
-  // connect signals and slots
-  connect(myIsNameVisible, SIGNAL(stateChanged(int)), SLOT(onNameChecked()));
-  connect(myIsLabelsVisible, SIGNAL(stateChanged(int)), SLOT(onLabelsChecked()));
-  connect(myIsTicksVisible, SIGNAL(stateChanged(int)), SLOT(onTicksChecked()));
 }
 
 /*!
   Destructor
 */
-SVTK_AxisWidget::~SVTK_AxisWidget()
+SVTK_CubeAxesDlg::AxisWidget::~AxisWidget()
 {
 }
 
-void SVTK_AxisWidget::updateControlState()
+void SVTK_CubeAxesDlg::AxisWidget::UseName(const bool toUse)
 {
-  onNameChecked();
-  onLabelsChecked();
-  onTicksChecked();
+  myNameGrp->setChecked(toUse);
 }
 
-void SVTK_AxisWidget::setEnabled(QGroupBox* theGrp, const bool theState)
-{
-  QObjectList aChildren(*theGrp->children());
-  QObject* anObj;
-  for(anObj = aChildren.first(); anObj !=0; anObj = aChildren.next())
-    if (anObj !=0 && anObj->inherits("QHBox"))
-      ((QHBox*)anObj)->setEnabled(theState);
-}
-
-void SVTK_AxisWidget::onLabelsChecked()
-{
-  setEnabled(myLabelsGrp, myIsLabelsVisible->isChecked());
-}
-
-void SVTK_AxisWidget::onTicksChecked()
-{
-  setEnabled(myTicksGrp, myIsTicksVisible->isChecked());
-}
-
-void SVTK_AxisWidget::onNameChecked()
-{
-  setEnabled(myNameGrp, myIsNameVisible->isChecked());
-}
-
-void SVTK_AxisWidget::UseName(const bool toUse)
-{
-  myIsNameVisible->setChecked(toUse);
-}
-
-void SVTK_AxisWidget::SetName(const QString& theName)
+void SVTK_CubeAxesDlg::AxisWidget::SetName(const QString& theName)
 {
   myAxisName->setText(theName);
 }
 
-void SVTK_AxisWidget::SetNameFont(const QColor& theColor,
-                                  const int theFont,
-                                  const bool theIsBold,
-                                  const bool theIsItalic,
-                                  const bool theIsShadow)
+void SVTK_CubeAxesDlg::AxisWidget::SetNameFont(const QColor& theColor,
+                                              const int theFont,
+                                              const bool theIsBold,
+                                              const bool theIsItalic,
+                                              const bool theIsShadow)
 {
   myNameFont->SetData(theColor, theFont, theIsBold, theIsItalic, theIsShadow);
 }
 
-bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor)
+bool SVTK_CubeAxesDlg::AxisWidget::ReadData(vtkAxisActor2D* theActor)
 {
   if (theActor == 0)
     return false;
@@ -227,7 +249,7 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor)
     isTitleShadow = aTitleProp->GetShadow() ? true : false;
   }
 
-  myIsNameVisible->setChecked(useName);
+  myNameGrp->setChecked(useName);
   myAxisName->setText(aTitle);
   myNameFont->SetData(aTitleColor, aTitleFontFamily, isTitleBold, isTitleItalic, isTitleShadow);
 
@@ -255,7 +277,7 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor)
     isLabelsShadow = aLabelsProp->GetShadow() ? true : false;
   }
 
-  myIsLabelsVisible->setChecked(useLabels);
+  myLabelsGrp->setChecked(useLabels);
   myLabelNumber->setValue(nbLabels);
   myLabelOffset->setValue(anOffset);
   myLabelsFont->SetData(aLabelsColor, aLabelsFontFamily, isLabelsBold, isLabelsItalic, isLabelsShadow);
@@ -264,21 +286,21 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor)
   bool useTickMarks = theActor->GetTickVisibility();
   int aTickLength = theActor->GetTickLength();
 
-  myIsTicksVisible->setChecked(useTickMarks);
+  myTicksGrp->setChecked(useTickMarks);
   myTickLength->setValue(aTickLength);
 
   return true;
 }
 
-bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor)
+bool SVTK_CubeAxesDlg::AxisWidget::Apply(vtkAxisActor2D* theActor)
 {
    if (theActor == 0)
     return false;
 
   // Name
 
-  theActor->SetTitleVisibility(myIsNameVisible->isChecked() ? 1 : 0);
-  theActor->SetTitle(myAxisName->text().latin1());
+  theActor->SetTitleVisibility(myNameGrp->isChecked() ? 1 : 0);
+  theActor->SetTitle(myAxisName->text().toLatin1());
 
   QColor aTitleColor(255, 255, 255);
   int aTitleFontFamily = VTK_ARIAL;
@@ -304,7 +326,7 @@ bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor)
 
   // Labels
 
-  theActor->SetLabelVisibility(myIsLabelsVisible->isChecked() ? 1 : 0);
+  theActor->SetLabelVisibility(myLabelsGrp->isChecked() ? 1 : 0);
 
   int nbLabels = myLabelNumber->value();
   theActor->SetNumberOfLabels(nbLabels);
@@ -337,7 +359,7 @@ bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor)
 
 
   // Tick marks
-  theActor->SetTickVisibility(myIsTicksVisible->isChecked());
+  theActor->SetTickVisibility(myTicksGrp->isChecked());
   int aTickLength = myTickLength->value();
   theActor->SetTickLength(aTickLength);
 
@@ -353,16 +375,18 @@ bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor)
   Constructor
 */
 SVTK_CubeAxesDlg::SVTK_CubeAxesDlg(QtxAction* theAction,
-                                  SVTK_MainWindow* theParent,
+                                  SVTK_ViewWindow* theParent,
                                   const char* theName):
   SVTK_DialogBase(theAction,
                  theParent, 
                  theName),
   myMainWindow(theParent)
 {
-  setCaption(tr("CAPTION"));
+  setWindowTitle(tr("CAPTION"));
 
-  QVBoxLayout* aLay = new QVBoxLayout(this, 5, 5);
+  QVBoxLayout* aLay = new QVBoxLayout(this);
+  aLay->setMargin(5);
+  aLay->setSpacing(5);
   aLay->addWidget(createMainFrame(this));
   aLay->addWidget(createButtonFrame(this));
 
@@ -379,19 +403,19 @@ QWidget* SVTK_CubeAxesDlg::createMainFrame(QWidget* theParent)
 
   myTabWg = new QTabWidget(aFrame);
 
-  myAxes[ 0 ] = new SVTK_AxisWidget(myTabWg);
-  myAxes[ 1 ] = new SVTK_AxisWidget(myTabWg);
-  myAxes[ 2 ] = new SVTK_AxisWidget(myTabWg);
+  myAxes[ 0 ] = new AxisWidget(myTabWg);
+  myAxes[ 1 ] = new AxisWidget(myTabWg);
+  myAxes[ 2 ] = new AxisWidget(myTabWg);
 
   myTabWg->addTab(myAxes[ 0 ], tr("X_AXIS"));
   myTabWg->addTab(myAxes[ 1 ], tr("Y_AXIS"));
   myTabWg->addTab(myAxes[ 2 ], tr("Z_AXIS"));
 
-  myTabWg->setMargin(5);
-
   myIsVisible = new QCheckBox(tr("IS_VISIBLE"), aFrame);
 
-  QVBoxLayout* aLay = new QVBoxLayout(aFrame, 0, 5);
+  QVBoxLayout* aLay = new QVBoxLayout(aFrame);
+  aLay->setMargin(0);
+  aLay->setSpacing(5);
   aLay->addWidget(myTabWg);
   aLay->addWidget(myIsVisible);
 
@@ -412,7 +436,9 @@ QWidget* SVTK_CubeAxesDlg::createButtonFrame(QWidget* theParent)
 
   QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
 
-  QHBoxLayout* aLay = new QHBoxLayout(aFrame, 5, 5);
+  QHBoxLayout* aLay = new QHBoxLayout(aFrame);
+  aLay->setMargin(5);
+  aLay->setSpacing(5);
 
   aLay->addWidget(myOkBtn);
   aLay->addWidget(myApplyBtn);
index c4277db69363cdd4aa6783cd9c3d7600f5c4936a..e481d0b49466280b0024dab8e2827e6c9ce724d2 100644 (file)
@@ -1,4 +1,6 @@
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SVTK_CubeAxesDlg.h
 //  Author : Sergey LITONIN
 //  Module : VISU
-
-
+//
 #ifndef SVTK_CubeAxesDlg_H
 #define SVTK_CubeAxesDlg_H
 
 #include "SVTK_DialogBase.h"
 
-#include <qframe.h>
-
 class QWidget;
-class QFrame;
 class QPushButton;
 class QTabWidget;
 class QCheckBox;
-class QLineEdit;
-class QGroupBox;
 
 class QtxAction;
-class QtxIntSpinBox;
-
-class vtkAxisActor2D;
 class SVTK_CubeAxesActor2D;
 
 class SVTK_FontWidget;
 class SVTK_AxisWidget;
-class SVTK_MainWindow;
+class SVTK_ViewWindow;
 
 /*!
  * Class       : SVTK_CubeAxesDlg
@@ -57,9 +48,11 @@ class SVTK_CubeAxesDlg : public SVTK_DialogBase
 {
   Q_OBJECT
 
+  class AxisWidget;
+
 public:
                   SVTK_CubeAxesDlg(QtxAction* theAction,
-                                  SVTK_MainWindow* theParent,
+                                  SVTK_ViewWindow* theParent,
                                   const char* theName);
   virtual         ~SVTK_CubeAxesDlg();
 
@@ -76,7 +69,7 @@ private:
   bool            isValid() const;
 
 private:
-  SVTK_MainWindow *myMainWindow;
+  SVTK_ViewWindow *myMainWindow;
   SVTK_CubeAxesActor2D* myActor;
 
   QTabWidget*     myTabWg;
@@ -85,56 +78,7 @@ private:
   QPushButton*    myOkBtn;
   QPushButton*    myApplyBtn;
   QPushButton*    myCloseBtn;
-  SVTK_AxisWidget* myAxes[ 3 ];
-};
-
-/*!
- * Class       : SVTK_AxisWidget
- * Description : Tab of dialog
- */
-class SVTK_AxisWidget : public QFrame
-{
-  Q_OBJECT
-
-public:
-                  SVTK_AxisWidget( QWidget* );
-                  ~SVTK_AxisWidget();
-
-  void            UseName( const bool );
-  void            SetName( const QString& );
-  void            SetNameFont( const QColor&, const int, const bool, const bool, const bool );
-  bool            ReadData( vtkAxisActor2D* );
-  bool            Apply( vtkAxisActor2D* );
-
-private slots:
-  void            onNameChecked();
-  void            onLabelsChecked();
-  void            onTicksChecked();
-
-private:
-  void            updateControlState();
-  void            setEnabled( QGroupBox*, const bool );
-
-private:
-  // name
-  QGroupBox*      myNameGrp;
-  QCheckBox*      myIsNameVisible;
-  QLineEdit*      myAxisName;
-  SVTK_FontWidget* myNameFont;
-
-  // labels
-  QGroupBox*      myLabelsGrp;
-  QCheckBox*      myIsLabelsVisible;
-  QtxIntSpinBox*  myLabelNumber;
-  QtxIntSpinBox*  myLabelOffset;
-  SVTK_FontWidget* myLabelsFont;
-
-  // tick marks
-  QGroupBox*      myTicksGrp;
-  QCheckBox*      myIsTicksVisible;
-  QtxIntSpinBox*  myTickLength;
-
-  friend class SVTK_CubeAxesDlg;
+  AxisWidget*     myAxes[ 3 ];
 };
 
 #endif
index a3bb037730cf4a8d353b54196fd75b41c5ec9c0c..786add6006705674385e2d974df73f5859b90e71 100644 (file)
@@ -1,32 +1,30 @@
-//  SVTK OBJECT : interactive object for SVTK visualization
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SVTK OBJECT : interactive object for SVTK visualization
 //  File   : SVTK_DeviceActor.cxx
 //  Author : 
 //  Module : 
 //  $Header$
-
-
+//
 #include "SVTK_DeviceActor.h"
 
 #include "VTKViewer_Transform.h"
@@ -36,6 +34,7 @@
 // VTK Includes
 #include <vtkObjectFactory.h>
 #include <vtkShrinkFilter.h>
+#include <vtkFeatureEdges.h>
 
 #include <vtkPolyData.h>
 #include <vtkUnstructuredGrid.h>
@@ -58,6 +57,9 @@ SVTK_DeviceActor
   myIsShrunk = false;
   myIsShrinkable = true;
 
+  myIsFeatureEdgesAllowed = false;
+  myIsFeatureEdgesEnabled = false;
+
   myIsShaded = true;
   myProperty = vtkProperty::New();
   myRepresentation = SVTK::Representation::Surface;
@@ -70,6 +72,8 @@ SVTK_DeviceActor
 
   myShrinkFilter = vtkShrinkFilter::New();
 
+  myFeatureEdges = vtkFeatureEdges::New();
+
   myGeomFilter = VTKViewer_GeometryFilter::New();
 
   myTransformFilter = VTKViewer_TransformFilter::New();
@@ -94,6 +98,8 @@ SVTK_DeviceActor
 
   myShrinkFilter->Delete();
 
+  myFeatureEdges->Delete();
+
   for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++)
     myPassFilter[i]->Delete();
 }
@@ -192,6 +198,9 @@ SVTK_DeviceActor
   if(myIsShrunk)
     mTime = max(mTime,myShrinkFilter->GetMTime());
 
+  if(myIsFeatureEdgesEnabled)
+    mTime = max(mTime,myFeatureEdges->GetMTime());
+
   for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++)
     max(mTime,myPassFilter[i]->GetMTime());
 
@@ -300,6 +309,148 @@ SVTK_DeviceActor
   myShrinkFilter->SetShrinkFactor(theValue);
 }
 
+/*!
+  \return true if feature edges are allowed for this actor
+*/
+bool
+SVTK_DeviceActor
+::IsFeatureEdgesAllowed() 
+{ 
+  return myIsFeatureEdgesAllowed;
+}
+
+/*!
+  Allows feature edges for this actor on or off
+  \param theIsFeatureEdgesAllowed - flag which allows feature edges for this actor on or off
+*/
+void
+SVTK_DeviceActor
+::SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
+{
+  myIsFeatureEdgesAllowed = theIsFeatureEdgesAllowed;
+}
+
+/*!
+  \return true if feature edges are enabled
+*/
+bool
+SVTK_DeviceActor
+::IsFeatureEdgesEnabled()
+{
+  return myIsFeatureEdgesEnabled;
+}
+
+/*!
+  Enables feature edges on or off
+  \param theIsFeatureEdgesEnabled - flag which enables feature edges on or off
+*/
+void
+SVTK_DeviceActor
+::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
+{
+  if ( !myIsFeatureEdgesAllowed || myIsFeatureEdgesEnabled == theIsFeatureEdgesEnabled ) 
+    return;
+
+  if ( vtkPolyData* aPolyData = myPassFilter[ 2 ]->GetPolyDataOutput() )
+  {
+    if( theIsFeatureEdgesEnabled )
+    {
+      aPolyData->Update();
+      myFeatureEdges->SetInput( aPolyData );
+      myPassFilter[ 3 ]->SetInput( myFeatureEdges->GetOutput() );
+      myIsFeatureEdgesEnabled = true;
+    }
+    else
+    {
+      myPassFilter[3]->SetInput( aPolyData );
+      myIsFeatureEdgesEnabled = false;
+    }
+    myIsFeatureEdgesEnabled = theIsFeatureEdgesEnabled;
+  }
+}
+
+/*!
+  \return angle of feature edges' filter
+*/
+vtkFloatingPointType
+SVTK_DeviceActor
+::GetFeatureEdgesAngle()
+{
+  return myFeatureEdges->GetFeatureAngle();
+}
+
+/*!
+  Sets angle of feature edges' filter
+  \param theAngle angle of feature edges' filter
+*/
+void
+SVTK_DeviceActor
+::SetFeatureEdgesAngle(vtkFloatingPointType theAngle)
+{
+  myFeatureEdges->SetFeatureAngle(theAngle);
+}
+
+/*!
+  Gets information about kinds of edges which are displayed by feature edges' filter
+  \param theIsFeatureEdges flag which shows whether feature edges are displayed
+  \param theIsBoundaryEdges flag which shows whether boundary edges are displayed
+  \param theIsManifoldEdges flag which shows whether manifold edges are displayed
+  \param theIsNonManifoldEdges flag which shows whether non-manifold edges are displayed
+*/
+void
+SVTK_DeviceActor
+::GetFeatureEdgesFlags(bool& theIsFeatureEdges,
+                      bool& theIsBoundaryEdges,
+                      bool& theIsManifoldEdges,
+                      bool& theIsNonManifoldEdges)
+{
+  theIsFeatureEdges = myFeatureEdges->GetFeatureEdges();
+  theIsBoundaryEdges = myFeatureEdges->GetBoundaryEdges();
+  theIsManifoldEdges = myFeatureEdges->GetManifoldEdges();
+  theIsNonManifoldEdges = myFeatureEdges->GetNonManifoldEdges();
+}
+
+/*!
+  Sets different kinds of edges to be displayed by feature edges' filter
+  \param theIsFeatureEdges flag which displays feature edges
+  \param theIsBoundaryEdges flag which displays boundary edges
+  \param theIsManifoldEdges flag which displays manifold edges
+  \param theIsNonManifoldEdges flag which displays non-manifold edges
+*/
+void
+SVTK_DeviceActor
+::SetFeatureEdgesFlags(bool theIsFeatureEdges,
+                      bool theIsBoundaryEdges,
+                      bool theIsManifoldEdges,
+                      bool theIsNonManifoldEdges)
+{
+  myFeatureEdges->SetFeatureEdges(theIsFeatureEdges);
+  myFeatureEdges->SetBoundaryEdges(theIsBoundaryEdges);
+  myFeatureEdges->SetManifoldEdges(theIsManifoldEdges);
+  myFeatureEdges->SetNonManifoldEdges(theIsNonManifoldEdges);
+}
+
+/*!
+  \return feature edges' coloring flag
+*/
+bool
+SVTK_DeviceActor
+::GetFeatureEdgesColoring()
+{
+  return myFeatureEdges->GetColoring();
+}
+
+/*!
+  Sets feature edges' coloring flag
+  \param theIsColoring feature edges' coloring flag
+*/
+void
+SVTK_DeviceActor
+::SetFeatureEdgesColoring(bool theIsColoring)
+{
+  myFeatureEdges->SetColoring(theIsColoring);
+}
+
 /*!
   Set representation (VTK_SURFACE, VTK_POINTS, VTK_WIREFRAME and so on)
   param theMode - new mode
index 47fc3e12d1e7e1f847d719b6569a4fe7953cf0b0..95949133be2793a0bfeeb780f06ed60c6bc13135 100644 (file)
@@ -1,31 +1,30 @@
-//  SVTK OBJECT : interactive object for SVTK visualization
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SVTK OBJECT : interactive object for SVTK visualization
 //  File   : SVTK_DeviceActor.h
 //  Author : 
 //  Module : 
 //  $Header$
-
+//
 #ifndef SVTK_DEVICE_ACTOR_H
 #define SVTK_DEVICE_ACTOR_H
 
@@ -44,6 +43,7 @@ class VTKViewer_GeometryFilter;
 class vtkCell;
 class vtkDataSet;
 class vtkShrinkFilter;
+class vtkFeatureEdges;
 class vtkDataSetMapper;
 class vtkPassThroughFilter;
 
@@ -148,6 +148,54 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
   UnShrink(); 
   //@}
 
+  /** @name For feature edges management purpose */
+  //@{
+  virtual
+  bool
+  IsFeatureEdgesAllowed();
+
+  virtual
+  void
+  SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+
+  virtual
+  bool
+  IsFeatureEdgesEnabled();
+
+  virtual
+  void
+  SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
+
+  virtual
+  vtkFloatingPointType
+  GetFeatureEdgesAngle();
+
+  virtual
+  void
+  SetFeatureEdgesAngle(vtkFloatingPointType theAngle); 
+
+  virtual
+  void
+  GetFeatureEdgesFlags(bool& theIsFeatureEdges,
+                      bool& theIsBoundaryEdges,
+                      bool& theIsManifoldEdges,
+                      bool& theIsNonManifoldEdges);
+  virtual
+  void
+  SetFeatureEdgesFlags(bool theIsFeatureEdges,
+                      bool theIsBoundaryEdges,
+                      bool theIsManifoldEdges,
+                      bool theIsNonManifoldEdges);
+
+  virtual
+  bool
+  GetFeatureEdgesColoring();
+
+  virtual
+  void
+  SetFeatureEdgesColoring(bool theIsColoring);
+  //@}
+
   /** @name For representation mamnagement purpose */
   virtual
   void 
@@ -190,11 +238,15 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
   VTKViewer_TransformFilter *myTransformFilter;
   std::vector<vtkPassThroughFilter*> myPassFilter;
   vtkShrinkFilter* myShrinkFilter;
+  vtkFeatureEdges* myFeatureEdges;
   vtkDataSetMapper* myMapper;
 
   bool myIsShrinkable;
   bool myIsShrunk;
   
+  bool myIsFeatureEdgesAllowed;
+  bool myIsFeatureEdgesEnabled;
+
   bool myIsResolveCoincidentTopology;
   vtkFloatingPointType myPolygonOffsetFactor;
   vtkFloatingPointType myPolygonOffsetUnits;
index 9cf3432bfc6a51674fadab39c0b47edc80fae2a4..faf49c9628343218ba7350507b6de663c64f336d 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SVTK_DialogBase.h"
 
 #include "QtxAction.h"
@@ -38,13 +37,14 @@ SVTK_DialogBase
                  QWidget* theParent,
                  const char* theName, 
                  bool theModal, 
-                 WFlags theWFalgs):
+                 Qt::WindowFlags theWFalgs):
   QDialog(theParent, 
-         theName, 
-         theModal, 
-         theWFalgs | WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+         theWFalgs | Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
   myAction(theAction)
 {
+  setObjectName(theName);
+  setModal(theModal);
+
   connect(theParent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow()));
   connect(theParent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide()));
 }
@@ -62,7 +62,7 @@ void
 SVTK_DialogBase
 ::onParentShow()
 {
-  if(myAction->isOn())
+  if(myAction->isChecked())
     show();
   else
     hide();
@@ -79,6 +79,6 @@ void
 SVTK_DialogBase
 ::done( int r )
 {
-  myAction->setOn( false );
+  myAction->setChecked( false );
   QDialog::done( r );
 }
index 5c0b87eb585ed6c72744b6fc72034af11a23a4da..815f8ddf3108a53279e5ca789cab2d285ba10d6a 100644 (file)
@@ -1,37 +1,36 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_DIALOGBASE_H
 #define SVTK_DIALOGBASE_H
 
 #include "SVTK.h"
 
-#include <qdialog.h>
+#include <QDialog>
 
 class QtxAction;
 
@@ -44,7 +43,7 @@ public:
                  QWidget* theParent,
                  const char* theName = "", 
                  bool theModal = FALSE, 
-                 WFlags theWFalgs = 0);
+                 Qt::WindowFlags theWFalgs = 0);
 
   ~SVTK_DialogBase();
 
index 00a9e2c0fbb68da9c80937ebf60d3583729353cc..751c8103e52f182e36b9b29226a84288b8213ce6 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : Alexander SLADKOV
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_Event_h
 #define SVTK_Event_h
 
@@ -62,12 +61,17 @@ namespace SVTK
     StartFitArea,
 
     SetRotateGravity,
-    StartPointSelection,
     SetRotateSelected,
+    StartPointSelection,
     
     BBCenterChanged,
     RotationPointChanged,
     ChangeRotationPoint,
+
+    SetFocalPointGravity,
+    SetFocalPointSelected,
+    StartFocalPointSelection,
+    FocalPointChanged,
         
     LastEvent
   };
index a26dac111ae3ef985ecb9ee58a914d1587f1b3a2..a3ac8255ba6fc9920cf2f8f45140e7c8c6d801b9 100755 (executable)
@@ -1,30 +1,29 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2004  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.salome-platform.org or email : webmaster.salome@opencascade.org 
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_Extension.cxx
 //  Author : Sergey ANIKIN
 //  Module : SALOME
-
+//
 #include "SVTK_Extension.h"
 
 #ifdef WIN32
index 0b39e59f2afaa233cd4ef8dba97823814c4f0130..cafd2f04458f85a0b769f3b0eb818d56663d64df 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SVTK_Extension_H
 #define SVTK_Extension_H
@@ -24,7 +27,7 @@
   Functions of loading OpenGL extensions.
 */
 
-#include <SVTK.h>
+#include "SVTK.h"
 
 namespace SVTK
 {
index 4269b5b6b2e68fd916169c1971287dd3e41deabb..679b8257e18f1a8dfb86391746e92da72dc04717 100644 (file)
@@ -1,6 +1,6 @@
-//  VISU VISUGUI : GUI for SMESH component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  VISU VISUGUI : GUI for SMESH component
 //  File   : 
 //  Author : Sergey LITONIN
 //  Module : 
-
+//
 #include "SVTK_FontWidget.h"
 
-#include <qtoolbutton.h>
-#include <qcombobox.h>
-#include <qcolordialog.h>
-#include <qcheckbox.h>
+#include <QToolButton>
+#include <QComboBox>
+#include <QColorDialog>
+#include <QCheckBox>
+#include <QHBoxLayout>
 
 #include <vtkTextProperty.h>
 
   Constructor
 */
 SVTK_FontWidget::SVTK_FontWidget( QWidget* theParent )
-: QHBox( theParent )
+: QWidget( theParent )
 {
-  setSpacing( 5 );
   myColorBtn = new QToolButton( this );
   myColorBtn->setMinimumWidth( 20 );
 
   myFamily = new QComboBox( this );
-  myFamily->insertItem( tr( "ARIAL" ) );
-  myFamily->insertItem( tr( "COURIER" ) );
-  myFamily->insertItem( tr( "TIMES" ) );
+  myFamily->insertItem( myFamily->count(), tr( "ARIAL" ) );
+  myFamily->insertItem( myFamily->count(), tr( "COURIER" ) );
+  myFamily->insertItem( myFamily->count(), tr( "TIMES" ) );
 
   myBold = new QCheckBox( tr( "BOLD" ), this );
   myItalic = new QCheckBox( tr( "ITALIC" ), this );
   myShadow = new QCheckBox( tr( "SHADOW" ), this );
 
+  QHBoxLayout* aHBLayout = new QHBoxLayout;
+  aHBLayout->setSpacing( 5 );
+  aHBLayout->addWidget(myColorBtn);
+  aHBLayout->addWidget(myFamily);
+  aHBLayout->addWidget(myBold);
+  aHBLayout->addWidget(myItalic);
+  aHBLayout->addWidget(myShadow);
+  this->setLayout(aHBLayout);
+
   connect( myColorBtn, SIGNAL( clicked() ), SLOT( onColor() ) );
 }
 
@@ -70,12 +78,14 @@ SVTK_FontWidget::~SVTK_FontWidget()
 
 void SVTK_FontWidget::SetColor( const QColor& theColor )
 {
-  myColorBtn->setPaletteBackgroundColor( theColor );
+  QPalette palette;
+  palette.setColor(myColorBtn->backgroundRole(), theColor);
+  myColorBtn->setPalette(palette);
 }
 
 QColor SVTK_FontWidget::GetColor() const
 {
-  return myColorBtn->paletteBackgroundColor();
+  return myColorBtn->palette().color( myColorBtn->backgroundRole() );
 }
 
 void SVTK_FontWidget::onColor()
@@ -94,11 +104,11 @@ void SVTK_FontWidget::SetData( const QColor& theColor,
   SetColor( theColor );
 
   if ( theFamily == VTK_ARIAL )
-    myFamily->setCurrentItem( 0 );
+    myFamily->setCurrentIndex( 0 );
   else if ( theFamily == VTK_COURIER )
-    myFamily->setCurrentItem( 1 );
+    myFamily->setCurrentIndex( 1 );
   else
-    myFamily->setCurrentItem( 2 );
+    myFamily->setCurrentIndex( 2 );
 
   myBold->setChecked( theBold );
   myItalic->setChecked( theItalic );
@@ -113,7 +123,7 @@ void SVTK_FontWidget::GetData( QColor& theColor,
 {
   theColor = GetColor();
 
-  int anItem =myFamily->currentItem();
+  int anItem =myFamily->currentIndex();
   if ( anItem == 0 )
     theFamily = VTK_ARIAL;
   else if ( anItem == 1 )
index 953072a9446e6bb5c4291a8285ae9c09b3888aa5..653a4ee42b8e737b61defd8737425b1725918aff 100644 (file)
@@ -1,4 +1,6 @@
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : 
 //  Author : Sergey LITONIN
 //  Module : 
-
-
+//
 #ifndef SVTK_FontWidget_H
 #define SVTK_FontWidget_H
 
 #include "SVTK.h"
 
-#include <qhbox.h>
+#include <QWidget>
 
 class QToolButton;
 class QComboBox;
@@ -41,7 +40,7 @@ class QColor;
  * Class       : SVTK_FontWidget
  * Description : Dialog for specifynig font
  */
-class SVTK_EXPORT SVTK_FontWidget : public QHBox
+class SVTK_EXPORT SVTK_FontWidget : public QWidget
 {
   Q_OBJECT
 
index d76a9354898900d22a5bcfef791af36c7db2f183..eab12cb14a4542935abfe152c7b6da33a323a447 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SVTK_Functor_H
 #define SVTK_Functor_H
index ecb406b1ba0a67a6e4a4fd3fe92531f23cc29e63..e00c8dabba627c0370dbb923df1d5bf53a6b9eae 100644 (file)
@@ -1,38 +1,37 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SVTK_GenericRenderWindowInteractor.h"
 #include "SVTK_Selector.h"
 
 #include <vtkObjectFactory.h>
 #include <vtkCommand.h>
 
-#include <qtimer.h>
+#include <QTimer>
 
 using namespace std;
 
@@ -80,7 +79,8 @@ QVTK_GenericRenderWindowInteractor
   // Start a one-shot timer for <DELAY> ms. 
   //
   static int DELAY = 1;
-  myTimer->start(DELAY,TRUE);
+  myTimer->setSingleShot(TRUE);
+  myTimer->start(DELAY);
   return 1;
 }
 
@@ -133,7 +133,7 @@ SVTK_Selector*
 SVTK_GenericRenderWindowInteractor
 ::GetSelector()
 {
-  return mySelector.GetPointer();
+  return mySelector;
 }
 
 /*!
index ff5b6cb713d1549aab1c9aa7e87d80c3dd40c651..f85df59ba5c019ca3e56e4a30a28c4bd59067cfa 100644 (file)
@@ -1,37 +1,36 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_GenericRenderWindowInteractor_h
 #define SVTK_GenericRenderWindowInteractor_h
 
 #include "SVTK.h"
 
-#include <qobject.h>
+#include <QObject>
 #include <vtkGenericRenderWindowInteractor.h>
 #include <vtkSmartPointer.h>
 
@@ -39,7 +38,7 @@ class QTimer;
 class QWidget;
 
 class SVTK_Selector;
-class SVTK_Renderer;
+//class SVTK_Renderer;
 
 #ifdef WIN32
 #pragma warning ( disable:4251 )
@@ -122,7 +121,7 @@ class SVTK_EXPORT SVTK_GenericRenderWindowInteractor: public QVTK_GenericRenderW
   SVTK_GenericRenderWindowInteractor();
   ~SVTK_GenericRenderWindowInteractor();
 
-  vtkSmartPointer<SVTK_Selector> mySelector; //!< Keeps a pointer to SVTK_Selector
+  SVTK_Selector* mySelector; //!< Keeps a pointer to SVTK_Selector
   QWidget* myRenderWidget; //!< Keeps a pointer to QWidget, where vtkRenderWindow maps to.
 };
 
diff --git a/src/SVTK/SVTK_ImageWriter.cxx b/src/SVTK/SVTK_ImageWriter.cxx
new file mode 100755 (executable)
index 0000000..1d5eb76
--- /dev/null
@@ -0,0 +1,106 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "SVTK_ImageWriter.h"
+
+#include <QSemaphore>
+
+#include <vtkImageData.h>
+#include <vtkImageClip.h>
+#include <vtkJPEGWriter.h>
+#include <vtkSmartPointer.h>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+
+//----------------------------------------------------------------------------
+SVTK_ImageWriter
+::SVTK_ImageWriter(QSemaphore* theSemaphore,
+                  vtkImageData* theImageData,
+                  const std::string& theName,
+                  int theProgressive,
+                  int theQuality):
+  mySemaphore(theSemaphore),
+  myImageData(theImageData),
+  myName(theName),
+  myProgressive(theProgressive),
+  myQuality(theQuality),
+  myConstraint16Flag(true)
+{}
+
+//----------------------------------------------------------------------------
+SVTK_ImageWriter
+::~SVTK_ImageWriter()
+{
+  if(MYDEBUG) cout<<"SVTK_ImageWriter::~SVTK_ImageWriter - this = "<<this<<endl;
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_ImageWriter
+::run()
+{
+  vtkJPEGWriter *aWriter = vtkJPEGWriter::New();
+  vtkImageData *anImageData = myImageData;
+  vtkSmartPointer<vtkImageClip> anImageClip;
+  //
+  if(myConstraint16Flag){ 
+    int uExtent[6];
+    myImageData->UpdateInformation();
+    myImageData->GetUpdateExtent(uExtent);
+    unsigned int width = uExtent[1] - uExtent[0] + 1;
+    unsigned int height = uExtent[3] - uExtent[2] + 1;
+    width = (width / 16) * 16;
+    height= (height / 16) * 16;
+    uExtent[1] = uExtent[0] + width - 1;
+    uExtent[3] = uExtent[2] + height - 1;
+    //
+    anImageClip = vtkImageClip::New();
+    anImageClip->Delete();
+
+    anImageClip->SetInput(myImageData);
+    anImageClip->SetOutputWholeExtent(uExtent);
+    anImageClip->ClipDataOn();
+    anImageData = anImageClip->GetOutput();
+  }
+  //
+  aWriter->WriteToMemoryOff();
+  aWriter->SetFileName(myName.c_str());
+  aWriter->SetQuality(myQuality);
+  aWriter->SetProgressive(myProgressive);
+  aWriter->SetInput(anImageData);
+  aWriter->Write();
+
+  aWriter->Delete();
+  myImageData->Delete();
+
+  if(MYDEBUG) cout<<"SVTK_ImageWriter::run "<<
+               "- this = "<<this<<
+               //"; total = "<<mySemaphore->total()<<
+               "; available = "<<mySemaphore->available()<<endl;
+  mySemaphore->release();
+}
+
diff --git a/src/SVTK/SVTK_ImageWriter.h b/src/SVTK/SVTK_ImageWriter.h
new file mode 100755 (executable)
index 0000000..a3d16b8
--- /dev/null
@@ -0,0 +1,56 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef SVTK_IMAGEWRITER_H
+#define SVTK_IMAGEWRITER_H
+
+#include <QThread>
+#include <string>
+
+class vtkImageData;
+class QSemaphore;
+
+class SVTK_ImageWriter : public QThread 
+{
+public:
+  SVTK_ImageWriter(QSemaphore* theSemaphore,
+                  vtkImageData* theImageData,
+                  const std::string& theName,
+                  int theProgressive,
+                  int theQuality);
+
+  ~SVTK_ImageWriter();
+
+ protected:
+  virtual
+  void
+  run();
+  
+ protected:
+  QSemaphore* mySemaphore;
+  vtkImageData *myImageData;
+  std::string myName;
+  int   myProgressive;
+  int   myQuality;
+  bool  myConstraint16Flag;
+};
+
+#endif
diff --git a/src/SVTK/SVTK_ImageWriterMgr.cxx b/src/SVTK/SVTK_ImageWriterMgr.cxx
new file mode 100755 (executable)
index 0000000..0983a6a
--- /dev/null
@@ -0,0 +1,98 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "SVTK_ImageWriterMgr.h"
+#include "SVTK_ImageWriter.h"
+
+#include <vtkImageData.h>
+
+#include <QSemaphore>
+
+#include <limits>
+
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+//----------------------------------------------------------------------------
+SVTK_ImageWriterMgr
+::SVTK_ImageWriterMgr()
+{
+  int aMax = std::numeric_limits<int>::max() / 2;
+  mySemaphore = new QSemaphore(aMax);
+  mySemaphore->acquire( aMax );
+  if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::SVTK_ImageWriterMgr "<<
+               //"- total = "<<mySemaphore->total()<<
+               "; available = "<<mySemaphore->available()<<endl;
+}
+
+
+//----------------------------------------------------------------------------
+SVTK_ImageWriterMgr
+::~SVTK_ImageWriterMgr()
+{
+  Stop();
+  delete mySemaphore;
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_ImageWriterMgr
+::StartImageWriter(vtkImageData *theImageData,
+                  const std::string& theName,
+                  const int theProgressive,
+                  const int theQuality)
+{
+  SVTK_ImageWriter *anImageWriter = 
+    new SVTK_ImageWriter(mySemaphore,
+                        theImageData,
+                        theName,
+                        theProgressive,
+                        theQuality);
+  myThreads.push_back(anImageWriter);
+
+  anImageWriter->start();
+
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_ImageWriterMgr
+::Stop()
+{
+  if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::Stop "<<
+               //"- total = "<<mySemaphore->total()<<
+               "; available = "<<mySemaphore->available()<<endl;
+  if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size()<<endl;
+  mySemaphore->acquire( myThreads.size() );
+
+  for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++){
+    SVTK_ImageWriter* anImageWriter = myThreads[anId];
+    anImageWriter->wait();
+    delete anImageWriter;
+  }
+  myThreads.clear();
+}
diff --git a/src/SVTK/SVTK_ImageWriterMgr.h b/src/SVTK/SVTK_ImageWriterMgr.h
new file mode 100755 (executable)
index 0000000..0167f72
--- /dev/null
@@ -0,0 +1,57 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef SVTK_IMAGEWRITERMGR_H
+#define SVTK_IMAGEWRITERMGR_H
+
+#include <string>
+#include <vector>
+
+class QString;
+class vtkImageData;
+class SVTK_ImageWriter;
+class QSemaphore;
+
+class SVTK_ImageWriterMgr
+{
+ public:
+  SVTK_ImageWriterMgr();
+  ~SVTK_ImageWriterMgr();
+  
+  void
+  StartImageWriter(vtkImageData *theImageData,
+                  const std::string& theName,
+                  const int theProgressive,
+                  const int theQuality);
+
+  void
+  Stop();
+
+  typedef std::vector<SVTK_ImageWriter*> TWriterThreads;
+
+ protected:
+  TWriterThreads myThreads;
+
+  QSemaphore* mySemaphore;
+};
+
+#endif
+
index 1f662ca7b49c96f8c3a96011dfbb931b31968f3a..6c8a04fd09d11ede478ee8226c6d2de0d4f794fa 100644 (file)
@@ -1,32 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
-
+//
 #include "SVTK_InteractorStyle.h"
 
 #include "VTKViewer_Utilities.h"
@@ -41,6 +39,7 @@
 #include "VTKViewer_Algorithm.h"
 #include "SVTK_Functor.h"
 
+#include "SUIT_Tools.h"
 #include "SALOME_Actor.h"
 
 #include <vtkObjectFactory.h>
 #include <vtkPerspectiveTransform.h> 
 #include <vtkMatrix4x4.h>
 
-#include <qapplication.h>
-#include <qpixmap.h>
-//VRV: porting on Qt 3.0.5
-#if QT_VERSION >= 0x030005
-#include <qpainter.h>
-#endif
-//VRV: porting on Qt 3.0.5
-#include <algorithm>
+#include <QPixmap>
+#include <QWidget>
+#include <QRubberBand>
 
+#include <algorithm>
 #include <iostream>
 
 using namespace std;
 
 namespace
 {
-  inline 
-  void
-  GetEventPosition(vtkRenderWindowInteractor* theInteractor,
-                  int& theX, 
-                  int& theY)
+  inline void GetEventPosition(vtkRenderWindowInteractor* theInteractor,
+                              int& theX, 
+                              int& theY)
   {
     theInteractor->GetEventPosition(theX,theY);
     theY = theInteractor->GetSize()[1] - theY - 1;
@@ -90,15 +83,15 @@ vtkStandardNewMacro(SVTK_InteractorStyle);
 /*!
   Constructor
 */
-SVTK_InteractorStyle
-::SVTK_InteractorStyle():
+SVTK_InteractorStyle::SVTK_InteractorStyle():
   mySelectionEvent(new SVTK_SelectionEvent()),
   myPointPicker(vtkPointPicker::New()),
   myLastHighlitedActor(NULL),
   myLastPreHighlitedActor(NULL),
   myControllerIncrement(SVTK_ControllerIncrement::New()),
   myControllerOnKeyDown(SVTK_ControllerOnKeyDown::New()),
-  myHighlightRotationPointActor(SVTK_Actor::New())
+  myHighlightSelectionPointActor(SVTK_Actor::New()),
+  myRectBand(0)
 {
   myPointPicker->Delete();
 
@@ -125,14 +118,17 @@ SVTK_InteractorStyle
   myCurrRotationPointType = SVTK::SetRotateGravity;
   myPrevRotationPointType = myCurrRotationPointType;
 
-  myHighlightRotationPointActor->Delete();
-  myHighlightRotationPointActor->Initialize();
-  myHighlightRotationPointActor->PickableOff();
-  myHighlightRotationPointActor->SetVisibility( false );
+  myCurrFocalPointType = SVTK::SetFocalPointSelected;
+  myPrevFocalPointType = myCurrFocalPointType;
+
+  myHighlightSelectionPointActor->Delete();
+  myHighlightSelectionPointActor->Initialize();
+  myHighlightSelectionPointActor->PickableOff();
+  myHighlightSelectionPointActor->SetVisibility( false );
   
-  myHighlightRotationPointActor->GetProperty()->SetPointSize(SALOME_POINT_SIZE+2);
-  myHighlightRotationPointActor->GetProperty()->SetLineWidth(SALOME_LINE_WIDTH+2);
-  myHighlightRotationPointActor->GetProperty()->SetRepresentationToPoints();
+  myHighlightSelectionPointActor->GetProperty()->SetPointSize(SALOME_POINT_SIZE+2);
+  myHighlightSelectionPointActor->GetProperty()->SetLineWidth(SALOME_LINE_WIDTH+2);
+  myHighlightSelectionPointActor->GetProperty()->SetRepresentationToPoints();
 
   myBBFirstCheck = true;
 }
@@ -140,17 +136,15 @@ SVTK_InteractorStyle
 /*!
   Destructor
 */
-SVTK_InteractorStyle
-::~SVTK_InteractorStyle() 
+SVTK_InteractorStyle::~SVTK_InteractorStyle() 
 {
+  endDrawRect();
 }
 
 /*!
   \return widget for rendering
 */
-QWidget*
-SVTK_InteractorStyle
-::GetRenderWidget()
+QWidget* SVTK_InteractorStyle::GetRenderWidget()
 {
   return myInteractor->GetRenderWidget();
 }
@@ -158,9 +152,7 @@ SVTK_InteractorStyle
 /*!
   \return selector
 */
-SVTK_Selector*
-SVTK_InteractorStyle
-::GetSelector() 
+SVTK_Selector* SVTK_InteractorStyle::GetSelector() 
 {
   return myInteractor->GetSelector();
 }
@@ -168,9 +160,7 @@ SVTK_InteractorStyle
 /*!
   Generate special SVTK_SelectionEvent
 */
-SVTK_SelectionEvent*
-SVTK_InteractorStyle
-::GetSelectionEvent()
+SVTK_SelectionEvent* SVTK_InteractorStyle::GetSelectionEvent()
 {
   mySelectionEvent->mySelectionMode = GetSelector()->SelectionMode();
 
@@ -188,9 +178,7 @@ SVTK_InteractorStyle
 /*!
   Generate special SVTK_SelectionEvent with flipped Y coordinate
 */
-SVTK_SelectionEvent*
-SVTK_InteractorStyle
-::GetSelectionEventFlipY()
+SVTK_SelectionEvent* SVTK_InteractorStyle::GetSelectionEventFlipY()
 {
   mySelectionEvent->mySelectionMode = GetSelector()->SelectionMode();
 
@@ -205,9 +193,7 @@ SVTK_InteractorStyle
   return mySelectionEvent.get();
 }
 
-void
-SVTK_InteractorStyle
-::RotateXY(int dx, int dy)
+void SVTK_InteractorStyle::RotateXY(int dx, int dy)
 {
   /*   if(GetCurrentRenderer() == NULL)
     return;
@@ -284,18 +270,13 @@ SVTK_InteractorStyle
   this->Render();
 }
 
-void
-SVTK_InteractorStyle
-::PanXY(int x, int y, int oldX, int oldY)
+void SVTK_InteractorStyle::PanXY(int x, int y, int oldX, int oldY)
 {
   TranslateView(x, y, oldX, oldY);   
   this->Render();
 }
 
-
-void 
-SVTK_InteractorStyle
-::DollyXY(int dx, int dy)
+void SVTK_InteractorStyle::DollyXY(int dx, int dy)
 {
   if (GetCurrentRenderer() == NULL) 
     return;
@@ -309,16 +290,14 @@ SVTK_InteractorStyle
   if (aCam->GetParallelProjection())
     aCam->SetParallelScale(aCam->GetParallelScale()/zoomFactor);
   else{
-    aCam->Dolly(zoomFactor);
+    aCam->Dolly(zoomFactor); // Move camera in/out along projection direction
     GetCurrentRenderer()->ResetCameraClippingRange(); 
   }
 
   this->Render();
 }
 
-void 
-SVTK_InteractorStyle
-::SpinXY(int x, int y, int oldX, int oldY)
+void SVTK_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY)
 {
   vtkCamera *cam;
 
@@ -344,9 +323,7 @@ SVTK_InteractorStyle
 /*!
   To reset reset view
 */
-void
-SVTK_InteractorStyle
-::OnConfigure() 
+void SVTK_InteractorStyle::OnConfigure() 
 {
   this->FindPokedRenderer(0,0);
   this->GetCurrentRenderer()->InvokeEvent(vtkCommand::ConfigureEvent,NULL);
@@ -355,9 +332,7 @@ SVTK_InteractorStyle
 /*!
   To handle mouse move event
 */
-void
-SVTK_InteractorStyle
-::OnMouseMove() 
+void SVTK_InteractorStyle::OnMouseMove() 
 {
   int x, y;
   GetEventPosition( this->Interactor, x, y );
@@ -369,9 +344,7 @@ SVTK_InteractorStyle
 /*!
   To handle left mouse button down event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnLeftButtonDown()
+void SVTK_InteractorStyle::OnLeftButtonDown()
 {
   int x, y;
   GetEventPosition( this->Interactor, x, y );
@@ -383,9 +356,7 @@ SVTK_InteractorStyle
 /*!
   To handle left mouse button up event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnLeftButtonUp()
+void SVTK_InteractorStyle::OnLeftButtonUp()
 {
   int x, y;
   GetEventPosition( this->Interactor, x, y );
@@ -397,9 +368,7 @@ SVTK_InteractorStyle
 /*!
   To handle middle mouse button down event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnMiddleButtonDown() 
+void SVTK_InteractorStyle::OnMiddleButtonDown() 
 {
   int x, y;
   GetEventPosition( this->Interactor, x, y );
@@ -411,9 +380,7 @@ SVTK_InteractorStyle
 /*!
   To handle middle mouse button up event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnMiddleButtonUp()
+void SVTK_InteractorStyle::OnMiddleButtonUp()
 {
   int x, y;
   GetEventPosition( this->Interactor, x, y );
@@ -425,9 +392,7 @@ SVTK_InteractorStyle
 /*!
   To handle right mouse button down event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnRightButtonDown() 
+void SVTK_InteractorStyle::OnRightButtonDown() 
 {
   int x, y;
   GetEventPosition( this->Interactor, x, y );
@@ -439,9 +404,7 @@ SVTK_InteractorStyle
 /*!
   To handle right mouse button up event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnRightButtonUp()
+void SVTK_InteractorStyle::OnRightButtonUp()
 {
   int x, y;
   GetEventPosition( this->Interactor, x, y );
@@ -453,11 +416,9 @@ SVTK_InteractorStyle
 /*!
   To handle mouse move event
 */
-void
-SVTK_InteractorStyle
-::OnMouseMove(int vtkNotUsed(ctrl), 
-             int shift,
-             int x, int y) 
+void SVTK_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl), 
+                                      int shift,
+                                      int x, int y) 
 {
   myShiftState = shift;
   if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
@@ -469,10 +430,8 @@ SVTK_InteractorStyle
 /*!
   To handle left mouse button down event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnLeftButtonDown(int ctrl, int shift, 
-                  int x, int y) 
+void SVTK_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, 
+                                           int x, int y) 
 {
   this->FindPokedRenderer(x, y);
   if(GetCurrentRenderer() == NULL)
@@ -490,7 +449,8 @@ SVTK_InteractorStyle
   } else {
     if (ctrl)
       startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
-    else if ( myCurrRotationPointType == SVTK::StartPointSelection )
+    else if ( myCurrRotationPointType == SVTK::StartPointSelection ||
+             myCurrFocalPointType == SVTK::StartFocalPointSelection )
     {
       SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
 
@@ -508,28 +468,50 @@ SVTK_InteractorStyle
          int anObjId = anActor->GetNodeObjId( aVtkId );
          vtkFloatingPointType* aCoords = anActor->GetNodeCoord(anObjId);
          
-         myCurrRotationPointType = SVTK::SetRotateSelected;
+         if (myCurrRotationPointType == SVTK::StartPointSelection) {
+           myCurrRotationPointType = SVTK::SetRotateSelected;
          
-         // invoke event for update coordinates in SVTK_SetRotationPointDlg
-         InvokeEvent(SVTK::RotationPointChanged,(void*)aCoords);
+           // invoke event for update coordinates in SVTK_SetRotationPointDlg
+           InvokeEvent(SVTK::RotationPointChanged,(void*)aCoords);
+         }
+         else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
+           myCurrFocalPointType = SVTK::SetFocalPointSelected;
+         
+           // invoke event for update coordinates in SVTK_ViewParameterDlg
+           InvokeEvent(SVTK::FocalPointChanged,(void*)aCoords);
+         }
        }
        else
        {
-         // invoke event with no data (for SVTK_SetRotationPointDlg)
-         InvokeEvent(SVTK::RotationPointChanged,0);
-         myCurrRotationPointType = myPrevRotationPointType;
+         if (myCurrRotationPointType == SVTK::StartPointSelection) {
+           // invoke event with no data (for SVTK_SetRotationPointDlg)
+           InvokeEvent(SVTK::RotationPointChanged,0);
+           myCurrRotationPointType = myPrevRotationPointType;
+         }
+         else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
+           // invoke event with no data (for SVTK_ViewParameterDlg)
+           InvokeEvent(SVTK::FocalPointChanged,0);
+           myCurrFocalPointType = myPrevFocalPointType;
+         }
        }
       }
       else
       {
-       // invoke event with no data (for SVTK_SetRotationPointDlg)
-       InvokeEvent(SVTK::RotationPointChanged,0);
-       myCurrRotationPointType = myPrevRotationPointType;
+       if (myCurrRotationPointType == SVTK::StartPointSelection) {
+         // invoke event with no data (for SVTK_SetRotationPointDlg)
+         InvokeEvent(SVTK::RotationPointChanged,0);
+         myCurrRotationPointType = myPrevRotationPointType;
+       }
+       else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
+         // invoke event with no data (for SVTK_ViewParameterDlg)
+         InvokeEvent(SVTK::FocalPointChanged,0);
+         myCurrFocalPointType = myPrevFocalPointType;
+       }
       }
     
-      myHighlightRotationPointActor->SetVisibility( false );
+      myHighlightSelectionPointActor->SetVisibility( false );
       if(GetCurrentRenderer() != NULL)
-       GetCurrentRenderer()->RemoveActor( myHighlightRotationPointActor.GetPointer() );
+       GetCurrentRenderer()->RemoveActor( myHighlightSelectionPointActor.GetPointer() );
 
       GetRenderWidget()->setCursor(myDefCursor); 
     }
@@ -543,12 +525,10 @@ SVTK_InteractorStyle
 /*!
   To handle left mouse button up event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnLeftButtonUp(int vtkNotUsed(ctrl),
-                int shift, 
-                int vtkNotUsed(x),
-                int vtkNotUsed(y))
+void SVTK_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl),
+                                         int shift, 
+                                         int vtkNotUsed(x),
+                                         int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -561,11 +541,9 @@ SVTK_InteractorStyle
 /*!
   To handle middle mouse button down event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnMiddleButtonDown(int ctrl,
-                    int shift, 
-                    int x, int y) 
+void SVTK_InteractorStyle::OnMiddleButtonDown(int ctrl,
+                                             int shift, 
+                                             int x, int y) 
 {
   this->FindPokedRenderer(x, y);
   if(GetCurrentRenderer() == NULL)
@@ -591,12 +569,10 @@ SVTK_InteractorStyle
 /*!
   To handle middle mouse button up event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnMiddleButtonUp(int vtkNotUsed(ctrl),
-                  int shift, 
-                  int vtkNotUsed(x),
-                  int vtkNotUsed(y))
+void SVTK_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl),
+                                           int shift, 
+                                           int vtkNotUsed(x),
+                                           int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -610,11 +586,9 @@ SVTK_InteractorStyle
 /*!
   To handle right mouse button down event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnRightButtonDown(int ctrl,
-                   int shift, 
-                   int x, int y) 
+void SVTK_InteractorStyle::OnRightButtonDown(int ctrl,
+                                            int shift, 
+                                            int x, int y) 
 {
   this->FindPokedRenderer(x, y);
   if(GetCurrentRenderer() == NULL)
@@ -639,12 +613,10 @@ SVTK_InteractorStyle
 /*!
   To handle right mouse button up event (reimplemented from vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::OnRightButtonUp(int vtkNotUsed(ctrl),
-                 int shift, 
-                 int vtkNotUsed(x),
-                 int vtkNotUsed(y))
+void SVTK_InteractorStyle::OnRightButtonUp(int vtkNotUsed(ctrl),
+                                          int shift, 
+                                          int vtkNotUsed(x),
+                                          int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -735,9 +707,7 @@ const char* imageRotateCursor[] = {
 /*!
   loads cursors for viewer operations - zoom, pan, etc...
 */
-void
-SVTK_InteractorStyle
-::loadCursors()
+void SVTK_InteractorStyle::loadCursors()
 {
   myDefCursor       = QCursor(Qt::ArrowCursor);
   myHandCursor      = QCursor(Qt::PointingHandCursor);
@@ -753,9 +723,7 @@ SVTK_InteractorStyle
 /*!
   Starts Zoom operation (e.g. through menu command)
 */
-void
-SVTK_InteractorStyle
-::startZoom()
+void SVTK_InteractorStyle::startZoom()
 {
   if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
   {
@@ -770,9 +738,7 @@ SVTK_InteractorStyle
 /*!
   Starts Pan operation (e.g. through menu command)
 */
-void
-SVTK_InteractorStyle
-::startPan()
+void SVTK_InteractorStyle::startPan()
 {
   if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
   {
@@ -786,9 +752,7 @@ SVTK_InteractorStyle
 /*!
   Starts Rotate operation (e.g. through menu command)
 */
-void 
-SVTK_InteractorStyle
-::startRotate()
+void SVTK_InteractorStyle::startRotate()
 {
   if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
   {
@@ -802,19 +766,36 @@ SVTK_InteractorStyle
 /*!
   Set rotation point selected by user
 */
-void 
-SVTK_InteractorStyle
-::startPointSelection()
+void SVTK_InteractorStyle::startPointSelection()
 {
   myCurrRotationPointType = SVTK::StartPointSelection;
 
   if(GetCurrentRenderer() != NULL) {
-    GetCurrentRenderer()->AddActor( myHighlightRotationPointActor.GetPointer() );
+    GetCurrentRenderer()->AddActor( myHighlightSelectionPointActor.GetPointer() );
     vtkFloatingPointType aColor[3];
     GetCurrentRenderer()->GetBackground( aColor );
-    myHighlightRotationPointActor->GetProperty()->SetColor(1. - aColor[0],
-                                                          1. - aColor[1],
-                                                          1. - aColor[2]);
+    myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0],
+                                                           1. - aColor[1],
+                                                           1. - aColor[2]);
+  }
+
+  setCursor(VTK_INTERACTOR_STYLE_CAMERA_NONE);
+}
+
+/*!
+  Set focal point selected by user
+*/
+void SVTK_InteractorStyle::startFocalPointSelection()
+{
+  myCurrFocalPointType = SVTK::StartFocalPointSelection;
+
+  if(GetCurrentRenderer() != NULL) {
+    GetCurrentRenderer()->AddActor( myHighlightSelectionPointActor.GetPointer() );
+    vtkFloatingPointType aColor[3];
+    GetCurrentRenderer()->GetBackground( aColor );
+    myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0],
+                                                           1. - aColor[1],
+                                                           1. - aColor[2]);
   }
 
   setCursor(VTK_INTERACTOR_STYLE_CAMERA_NONE);
@@ -823,9 +804,7 @@ SVTK_InteractorStyle
 /*! 
   Starts Spin operation (e.g. through menu command)
 */
-void
-SVTK_InteractorStyle
-::startSpin()
+void SVTK_InteractorStyle::startSpin()
 {
   if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
   {
@@ -841,9 +820,7 @@ SVTK_InteractorStyle
 /*!
   Starts Fit Area operation (e.g. through menu command)
 */
-void
-SVTK_InteractorStyle
-::startFitArea()
+void SVTK_InteractorStyle::startFitArea()
 {
   if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
   {
@@ -858,9 +835,7 @@ SVTK_InteractorStyle
 /*!
   Starts Global Panning operation (e.g. through menu command)
 */
-void
-SVTK_InteractorStyle
-::startGlobalPan()
+void SVTK_InteractorStyle::startGlobalPan()
 {
   if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
   {
@@ -882,12 +857,10 @@ SVTK_InteractorStyle
 /*!
   Fits viewer contents to rect
 */
-void
-SVTK_InteractorStyle
-::fitRect(const int left, 
-         const int top, 
-         const int right, 
-         const int bottom)
+void SVTK_InteractorStyle::fitRect(const int left, 
+                                  const int top, 
+                                  const int right, 
+                                  const int bottom)
 {
   if (GetCurrentRenderer() == NULL) 
     return;
@@ -920,9 +893,7 @@ SVTK_InteractorStyle
 /*!
   Starts viewer operation (!internal usage!)
 */
-void
-SVTK_InteractorStyle
-::startOperation(int operation)
+void SVTK_InteractorStyle::startOperation(int operation)
 {
   switch(operation)
   { 
@@ -952,9 +923,7 @@ SVTK_InteractorStyle
 /*!
   Sets proper cursor for window when viewer operation is activated
 */
-void
-SVTK_InteractorStyle
-::setCursor(const int operation)
+void SVTK_InteractorStyle::setCursor(const int operation)
 {
   if (!GetRenderWidget()) return;
   switch (operation)
@@ -986,7 +955,8 @@ SVTK_InteractorStyle
       break;
     case VTK_INTERACTOR_STYLE_CAMERA_NONE:
     default:
-      if ( myCurrRotationPointType == SVTK::StartPointSelection )
+      if ( myCurrRotationPointType == SVTK::StartPointSelection ||
+          myCurrFocalPointType == SVTK::StartFocalPointSelection )
        GetRenderWidget()->setCursor(myHandCursor);
       else
        GetRenderWidget()->setCursor(myDefCursor); 
@@ -999,9 +969,7 @@ SVTK_InteractorStyle
 /*!
   Called when viewer operation started (!put necessary initialization here!)
 */
-void
-SVTK_InteractorStyle
-::onStartOperation()
+void SVTK_InteractorStyle::onStartOperation()
 {
   if (!GetRenderWidget()) 
     return;
@@ -1014,10 +982,7 @@ SVTK_InteractorStyle
     case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
     case VTK_INTERACTOR_STYLE_CAMERA_FIT:
     {
-      QPainter p(GetRenderWidget());
-      p.setPen(Qt::lightGray);
-      p.setRasterOp(Qt::XorROP);
-      p.drawRect(QRect(myPoint, myOtherPoint));
+      drawRect();
       break;
     }
     case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
@@ -1033,9 +998,7 @@ SVTK_InteractorStyle
 /*!
   Called when viewer operation finished (!put necessary post-processing here!)
 */
-void
-SVTK_InteractorStyle
-::onFinishOperation() 
+void SVTK_InteractorStyle::onFinishOperation() 
 {
   if (!GetRenderWidget()) 
     return;
@@ -1050,12 +1013,9 @@ SVTK_InteractorStyle
     case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
     case VTK_INTERACTOR_STYLE_CAMERA_FIT:
     {
-      QPainter aPainter(GetRenderWidget());
-      aPainter.setPen(Qt::lightGray);
-      aPainter.setRasterOp(Qt::XorROP);
+      endDrawRect();
       QRect aRect(myPoint, myOtherPoint);
-      aPainter.drawRect(aRect);
-      aRect = aRect.normalize();
+      aRect = aRect.normalized();
 
       if (State == VTK_INTERACTOR_STYLE_CAMERA_FIT) {
         // making fit rect opeation 
@@ -1075,7 +1035,7 @@ SVTK_InteractorStyle
            Interactor->StartPickCallback();
            
            SALOME_Actor* anActor = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
-           
+
            aSelectionEvent->myIsRectangle = false;
 
            if(!myShiftState)
@@ -1089,8 +1049,8 @@ SVTK_InteractorStyle
              {
                if(myLastHighlitedActor.GetPointer() && myLastHighlitedActor.GetPointer() != anActor)
                  myLastHighlitedActor->Highlight( this, aSelectionEvent, false );
-               myLastHighlitedActor = anActor;
              }
+           myLastHighlitedActor = anActor;
          } 
        else 
          {
@@ -1144,9 +1104,7 @@ SVTK_InteractorStyle
 /*!
   Called during viewer operation when user moves mouse (!put necessary processing here!)
 */
-void
-SVTK_InteractorStyle
-::onOperation(QPoint mousePos) 
+void SVTK_InteractorStyle::onOperation(QPoint mousePos) 
 {
   if (!GetRenderWidget()) 
     return;
@@ -1187,12 +1145,8 @@ SVTK_InteractorStyle
     }
   case VTK_INTERACTOR_STYLE_CAMERA_FIT:
     {
-      QPainter p(GetRenderWidget());
-      p.setPen(Qt::lightGray);
-      p.setRasterOp(Qt::XorROP);
-      p.drawRect(QRect(myPoint, myOtherPoint));
       myOtherPoint = mousePos;
-      p.drawRect(QRect(myPoint, myOtherPoint));
+      drawRect();
       break;
     }
   }
@@ -1202,21 +1156,20 @@ SVTK_InteractorStyle
   Called when user moves mouse inside viewer window and there is no active viewer operation 
   (!put necessary processing here!)
 */
-void
-SVTK_InteractorStyle
-::onCursorMove(QPoint mousePos) 
+void SVTK_InteractorStyle::onCursorMove(QPoint mousePos) 
 {
   // processing highlighting
-   SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
+  SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
   this->FindPokedRenderer(aSelectionEvent->myX,aSelectionEvent->myY);
 
   bool anIsChanged = false;
 
   SALOME_Actor *anActor = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
-  
-  if ( myCurrRotationPointType == SVTK::StartPointSelection )
+
+  if ( myCurrRotationPointType == SVTK::StartPointSelection ||
+       myCurrFocalPointType == SVTK::StartFocalPointSelection )
   {
-    myHighlightRotationPointActor->SetVisibility( false );
+    myHighlightSelectionPointActor->SetVisibility( false );
 
     if ( anActor )
     {
@@ -1227,9 +1180,9 @@ SVTK_InteractorStyle
 
        TColStd_IndexedMapOfInteger aMapIndex;
        aMapIndex.Add( anObjId );
-       myHighlightRotationPointActor->MapPoints( anActor, aMapIndex );
+       myHighlightSelectionPointActor->MapPoints( anActor, aMapIndex );
 
-       myHighlightRotationPointActor->SetVisibility( true );
+       myHighlightSelectionPointActor->SetVisibility( true );
        anIsChanged = true;
       }
     }
@@ -1253,9 +1206,7 @@ SVTK_InteractorStyle
 /*!
   Called on finsh GlobalPan operation 
 */
-void
-SVTK_InteractorStyle
-::Place(const int theX, const int theY) 
+void SVTK_InteractorStyle::Place(const int theX, const int theY) 
 {
   if (GetCurrentRenderer() == NULL)
     return;
@@ -1280,9 +1231,7 @@ SVTK_InteractorStyle
 /*!
   Translates view from Point to Point
 */
-void
-SVTK_InteractorStyle
-::TranslateView(int toX, int toY, int fromX, int fromY)
+void SVTK_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY)
 {
   vtkCamera *cam = GetCurrentRenderer()->GetActiveCamera();
   double viewFocus[4], focalDepth, viewPoint[3];
@@ -1313,23 +1262,17 @@ SVTK_InteractorStyle
                   motionVector[2] + viewPoint[2]);
 }
 
-void
-SVTK_InteractorStyle
-::IncrementalPan( const int incrX, const int incrY )
+void SVTK_InteractorStyle::IncrementalPan( const int incrX, const int incrY )
 {
   this->PanXY( incrX, incrY, 0, 0 );
 }
 
-void
-SVTK_InteractorStyle
-::IncrementalZoom( const int incr )
+void SVTK_InteractorStyle::IncrementalZoom( const int incr )
 {
   this->DollyXY( incr, incr );
 }
 
-void
-SVTK_InteractorStyle
-::IncrementalRotate( const int incrX, const int incrY )
+void SVTK_InteractorStyle::IncrementalRotate( const int incrX, const int incrY )
 {
   this->RotateXY( incrX, -incrY );
 }
@@ -1337,9 +1280,7 @@ SVTK_InteractorStyle
 /*!
   Redefined in order to add an observer (callback) for custorm event (space mouse event)
 */
-void
-SVTK_InteractorStyle
-::SetInteractor( vtkRenderWindowInteractor* theInteractor )
+void SVTK_InteractorStyle::SetInteractor( vtkRenderWindowInteractor* theInteractor )
 {
   // register EventCallbackCommand as observer of standard events (keypress, mousemove, etc)
   Superclass::SetInteractor( theInteractor );
@@ -1378,15 +1319,17 @@ SVTK_InteractorStyle
     theInteractor->AddObserver( SVTK::StartPointSelection, EventCallbackCommand, Priority );
 
     theInteractor->AddObserver( SVTK::ChangeRotationPoint, EventCallbackCommand, Priority );
+
+    theInteractor->AddObserver( SVTK::SetFocalPointGravity, EventCallbackCommand, Priority );
+    theInteractor->AddObserver( SVTK::StartFocalPointSelection, EventCallbackCommand, Priority );
+    theInteractor->AddObserver( SVTK::SetFocalPointSelected, EventCallbackCommand, Priority );
   }
 }
 
 /*!
   To implement cached rendering
 */
-void
-SVTK_InteractorStyle
-::OnTimer() 
+void SVTK_InteractorStyle::OnTimer() 
 {
   //vtkInteractorStyle::OnTimer();
   this->Interactor->Render();
@@ -1419,16 +1362,12 @@ SVTK_InteractorStyle
 /*!
   To invoke #vtkRenderWindowInteractor::CreateTimer
 */
-void
-SVTK_InteractorStyle
-::Render() 
+void SVTK_InteractorStyle::Render() 
 {
   this->Interactor->CreateTimer(VTKI_TIMER_FIRST);
 }
 
-void
-SVTK_InteractorStyle
-::onSpaceMouseMove( double* data )
+void SVTK_InteractorStyle::onSpaceMouseMove( double* data )
 {
   // general things, do SetCurrentRenderer() within FindPokedRenderer() 
   int x, y;
@@ -1441,9 +1380,7 @@ SVTK_InteractorStyle
   IncrementalRotate( (int)data[3], 0  );   // 5. tilt the control forward/backward = rotate around X axis (Z axis of local coordinate system of space mouse)
 }
 
-void
-SVTK_InteractorStyle
-::onSpaceMouseButton( int button )
+void SVTK_InteractorStyle::onSpaceMouseButton( int button )
 {
   if( mySMDecreaseSpeedBtn == button ) {   
     ControllerIncrement()->Decrease();
@@ -1455,22 +1392,47 @@ SVTK_InteractorStyle
     DominantCombinedSwitch();
 }
 
-void
-SVTK_InteractorStyle
-::DominantCombinedSwitch()
+void SVTK_InteractorStyle::DominantCombinedSwitch()
 {
   printf( "\n--DominantCombinedSwitch() NOT IMPLEMENTED--\n" );
 }
 
+/*!
+  Draws rectangle by starting and current points
+*/
+void SVTK_InteractorStyle::drawRect()
+{
+  if ( !myRectBand ) {
+    myRectBand = new QRubberBand( QRubberBand::Rectangle, GetRenderWidget() );
+    QPalette palette;
+    palette.setColor(myRectBand->foregroundRole(), Qt::white);
+    myRectBand->setPalette(palette);
+  }
+  myRectBand->hide();
+
+  QRect aRect = SUIT_Tools::makeRect(myPoint.x(), myPoint.y(), myOtherPoint.x(), myOtherPoint.y());
+  myRectBand->setGeometry( aRect );
+  myRectBand->setVisible( aRect.isValid() );
+}
+
+/*!
+  \brief Delete rubber band on the end on the dragging operation.
+*/
+void SVTK_InteractorStyle::endDrawRect()
+{
+  if ( myRectBand ) myRectBand->hide();
+
+  delete myRectBand;
+  myRectBand = 0;
+}
+
 /*!
   Main process event method (reimplemented from #vtkInteractorStyle)
 */
-void
-SVTK_InteractorStyle
-::ProcessEvents( vtkObject* object,
-                unsigned long event,
-                void* clientData, 
-                void* callData )
+void SVTK_InteractorStyle::ProcessEvents( vtkObject* object,
+                                         unsigned long event,
+                                         void* clientData, 
+                                         void* callData )
 {
   if ( clientData ) {
     vtkObject* anObject = reinterpret_cast<vtkObject*>( clientData );
@@ -1555,9 +1517,9 @@ SVTK_InteractorStyle
       case SVTK::SetRotateGravity:
        if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
        {
-         self->myHighlightRotationPointActor->SetVisibility( false );
+         self->myHighlightSelectionPointActor->SetVisibility( false );
          if( self->GetCurrentRenderer() != NULL )
-           self->GetCurrentRenderer()->RemoveActor( self->myHighlightRotationPointActor.GetPointer() );
+           self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
          self->GetRenderWidget()->setCursor(self->myDefCursor); 
        }
        self->myPrevRotationPointType = self->myCurrRotationPointType;
@@ -1573,9 +1535,9 @@ SVTK_InteractorStyle
       case SVTK::ChangeRotationPoint:
        if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
        {
-         self->myHighlightRotationPointActor->SetVisibility( false );
+         self->myHighlightSelectionPointActor->SetVisibility( false );
          if( self->GetCurrentRenderer() != NULL )
-           self->GetCurrentRenderer()->RemoveActor( self->myHighlightRotationPointActor.GetPointer() );
+           self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
          self->GetRenderWidget()->setCursor(self->myDefCursor); 
        }
        self->myPrevRotationPointType = self->myCurrRotationPointType;
@@ -1585,6 +1547,36 @@ SVTK_InteractorStyle
        self->myRotationPointY = aSelectedPoint[1];
        self->myRotationPointZ = aSelectedPoint[2];
        return;
+
+      case SVTK::SetFocalPointGravity:
+       if ( self->myCurrFocalPointType == SVTK::StartPointSelection )
+       {
+         self->myHighlightSelectionPointActor->SetVisibility( false );
+         if( self->GetCurrentRenderer() != NULL )
+           self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+         self->GetRenderWidget()->setCursor(self->myDefCursor); 
+       }
+       self->myCurrFocalPointType = SVTK::SetFocalPointGravity;
+       if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) ) {
+         // invoke event for update coordinates in SVTK_ViewParameterDlg
+         self->InvokeEvent(SVTK::FocalPointChanged,(void*)aCenter);
+       }
+       return;
+      case SVTK::StartFocalPointSelection:
+       self->startFocalPointSelection();
+       return;
+
+      case SVTK::SetFocalPointSelected:
+       if ( self->myCurrFocalPointType == SVTK::StartFocalPointSelection )
+       {
+         self->myHighlightSelectionPointActor->SetVisibility( false );
+         if( self->GetCurrentRenderer() != NULL )
+           self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+         self->GetRenderWidget()->setCursor(self->myDefCursor); 
+       }
+       self->myPrevFocalPointType = self->myCurrFocalPointType;
+       self->myCurrFocalPointType = SVTK::SetFocalPointSelected;
+       return;
       }
     }
   }
@@ -1597,6 +1589,11 @@ SVTK_InteractorStyle
 */
 void SVTK_InteractorStyle::OnChar()
 {
+  char key = GetInteractor()->GetKeyCode();
+  switch ( key ) {
+  case '+': ControllerIncrement()->Increase(); break;
+  case '-': ControllerIncrement()->Decrease(); break;
+  }
 }
 
 /*!
@@ -1643,13 +1640,29 @@ SVTK_ControllerOnKeyDown* SVTK_InteractorStyle::ControllerOnKeyDown()
 }
 
 /*!
-  To get current increment controller
+  To set current increment controller
 */
 void SVTK_InteractorStyle::SetControllerIncrement(SVTK_ControllerIncrement* theController)
 {
   myControllerIncrement=theController;
 }
 
+/*!
+  To modify current increment controller
+*/
+void SVTK_InteractorStyle::SetIncrementSpeed(const int theValue, const int theMode)
+{
+  SVTK_ControllerIncrement* c = 0;
+  switch (theMode) {
+  case 0: c = SVTK_ControllerIncrement::New(); break;
+  case 1: c = SVTK_GeomControllerIncrement::New(); break;
+  }
+  c->SetStartValue(theValue);
+
+  SetControllerIncrement(c);
+  c->Delete();
+}
+
 /*!
   To get current increment controller 
 */
@@ -1687,6 +1700,27 @@ int SVTK_ControllerIncrement::Decrease()
   return myIncrement;
 }
 
+vtkStandardNewMacro(SVTK_GeomControllerIncrement);
+SVTK_GeomControllerIncrement::SVTK_GeomControllerIncrement()
+{
+}
+SVTK_GeomControllerIncrement::~SVTK_GeomControllerIncrement()
+{
+}
+int SVTK_GeomControllerIncrement::Increase()
+{
+  myIncrement*=2;
+  return myIncrement;
+}
+int SVTK_GeomControllerIncrement::Decrease()
+{
+  myIncrement/=2;
+  if (myIncrement<1){
+    myIncrement=1;
+  }
+  return myIncrement;
+}
+
 vtkStandardNewMacro(SVTK_ControllerOnKeyDown);
 
 /*!
index 3ce8ba2f43e643da3b66a973f20f3e03b892265c..9053b430d34518836a77335d2e971f15bbd4778b 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_InteractorStyle.h
 //  Author : Christophe ATTANASIO
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef __SVTK_InteractorStyle_h
 #define __SVTK_InteractorStyle_h
 
@@ -38,8 +37,7 @@
 #include <vtkInteractorStyle.h>
 #include <vtkSmartPointer.h>
 
-#include <qcursor.h>
-#include <qevent.h>
+#include <QCursor>
 
 #include <map>
 
 #endif
 
 //
-//! Control the value of increment  in SALOME way.
+//! Control the value of increment  in arithmetic progression mode.
 /*!
   This class controls of value of increment,
-  for pan/rotate/zoom operations in SALOME way
+  for pan/rotate/zoom operations in arithmetic progression mode
 */
 class SVTK_EXPORT SVTK_ControllerIncrement : public vtkObject{
  public:
@@ -80,6 +78,30 @@ class SVTK_EXPORT SVTK_ControllerIncrement : public vtkObject{
   SVTK_ControllerIncrement(const SVTK_ControllerIncrement&);//Not implemented
   void operator=(const SVTK_ControllerIncrement&);          //Not implemented
 };
+
+//
+//! Control the value of increment  in geometric progression mode.
+/*!
+  This class controls of value of increment,
+  for pan/rotate/zoom operations in geometric progression mode.
+*/
+class SVTK_EXPORT SVTK_GeomControllerIncrement : public SVTK_ControllerIncrement{
+ public:
+  vtkTypeMacro(SVTK_GeomControllerIncrement, SVTK_ControllerIncrement);
+  static SVTK_GeomControllerIncrement* New();
+
+  //! Increace the increment value by add 1
+  virtual int Increase();
+
+  //! Decreace the increment value by subtract 1
+  virtual int Decrease();
+ protected:
+  SVTK_GeomControllerIncrement();
+  virtual ~SVTK_GeomControllerIncrement();
+ private:
+  SVTK_GeomControllerIncrement(const SVTK_GeomControllerIncrement&);//Not implemented
+  void operator=(const SVTK_GeomControllerIncrement&);              //Not implemented
+};
 //
 //! Control the behaviour of KeyDown event in SALOME way.
 /*!
@@ -103,7 +125,6 @@ class SVTK_EXPORT SVTK_ControllerOnKeyDown : public vtkObject{
   void operator=(const SVTK_ControllerOnKeyDown&);          //Not implemented
 };
 
-class vtkCell;
 class vtkPointPicker;
 
 class SALOME_Actor;
@@ -112,6 +133,8 @@ class SVTK_Selector;
 class SVTK_GenericRenderWindowInteractor;
 class SVTK_Actor;
 
+class QRubberBand;
+
 #define VTK_INTERACTOR_STYLE_CAMERA_NONE    0
 #define VTK_INTERACTOR_STYLE_CAMERA_ROTATE  1
 #define VTK_INTERACTOR_STYLE_CAMERA_PAN     2
@@ -138,78 +161,53 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
   
 
   //! Generate special #SVTK_SelectionEvent
-  virtual
-  SVTK_SelectionEvent*
-  GetSelectionEvent();
+  virtual SVTK_SelectionEvent* GetSelectionEvent();
 
   //! Generate special #SVTK_SelectionEvent with flipped Y coordinate
-  virtual
-  SVTK_SelectionEvent*
-  GetSelectionEventFlipY();
+  virtual SVTK_SelectionEvent* GetSelectionEventFlipY();
 
   //! Redefined in order to add an observer (callback) for custom event (space mouse event)
-  virtual
-  void
-  SetInteractor( vtkRenderWindowInteractor* );
+  virtual void SetInteractor( vtkRenderWindowInteractor* );
 
   //! To invoke #vtkRenderWindowInteractor::CreateTimer
-  virtual 
-  void
-  Render();
+  virtual void Render();
 
   //! To implement cached rendering
-  virtual
-  void
-  OnTimer();
+  virtual void OnTimer();
 
   //! To reset reset view
-  virtual
-  void
-  OnConfigure();
+  virtual void OnConfigure();
 
   //! To handle mouse move event
-  virtual 
-  void
-  OnMouseMove();
+  virtual void OnMouseMove();
 
   //! To handle left mouse button down event (reimplemented from #vtkInteractorStyle)
-  virtual
-  void
-  OnLeftButtonDown();
+  virtual void OnLeftButtonDown();
 
   //! To handle left mouse button up event (reimplemented from #vtkInteractorStyle)
-  virtual
-  void
-  OnLeftButtonUp();
+  virtual void OnLeftButtonUp();
 
   //! To handle middle mouse button down event (reimplemented from #vtkInteractorStyle)
-  virtual
-  void
-  OnMiddleButtonDown();
+  virtual void OnMiddleButtonDown();
 
   //! To handle middle mouse button up event (reimplemented from #vtkInteractorStyle)
-  virtual
-  void
-  OnMiddleButtonUp();
+  virtual void OnMiddleButtonUp();
 
   //! To handle right mouse button down event (reimplemented from #vtkInteractorStyle)
-  virtual
-  void
-  OnRightButtonDown();
+  virtual void OnRightButtonDown();
 
   //! To handle right mouse button up event (reimplemented from #vtkInteractorStyle)
-  virtual
-  void
-  OnRightButtonUp();
+  virtual void OnRightButtonUp();
 
   //! To handle keyboard event (reimplemented from #vtkInteractorStyle)
-  virtual
-  void
-  OnChar();
+  virtual void OnChar();
 
   //! To set current increment controller 
   void SetControllerIncrement(SVTK_ControllerIncrement*);
 
+  //! To modify current increment controller 
+  void SetIncrementSpeed(const int, const int = 0);
+
   //! To get current increment controller 
   SVTK_ControllerIncrement* ControllerIncrement();
  
@@ -227,6 +225,8 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
   
   SVTK_Selector* GetSelector();
 
+  int   CurrentState() const { return State; }
+
   protected:
   SVTK_InteractorStyle();
   ~SVTK_InteractorStyle();
@@ -281,6 +281,7 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
   void startSpin();
 
   void startPointSelection();
+  void startFocalPointSelection();
 
  protected:
   void loadCursors();
@@ -296,6 +297,9 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
 
   void DominantCombinedSwitch();
   
+  void drawRect();
+  void endDrawRect();
+
  protected:
   QCursor                   myDefCursor;
   QCursor                   myPanCursor;
@@ -331,15 +335,20 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
   unsigned long                   myCurrRotationPointType;
   unsigned long                   myPrevRotationPointType;
 
+  unsigned long                   myCurrFocalPointType;
+  unsigned long                   myPrevFocalPointType;
+
   double                          myRotationPointX;
   double                          myRotationPointY;
   double                          myRotationPointZ;
 
-  vtkSmartPointer<SVTK_Actor>     myHighlightRotationPointActor;
+  vtkSmartPointer<SVTK_Actor>     myHighlightSelectionPointActor;
   vtkSmartPointer<vtkPointPicker> myPointPicker;
   
   vtkFloatingPointType            myBBCenter[3];
   bool                            myBBFirstCheck;
+
+  QRubberBand*                    myRectBand; //!< selection rectangle rubber band
 };
 
 #ifdef WIN32
diff --git a/src/SVTK/SVTK_KeyFreeInteractorStyle.cxx b/src/SVTK/SVTK_KeyFreeInteractorStyle.cxx
new file mode 100644 (file)
index 0000000..2ffeddd
--- /dev/null
@@ -0,0 +1,160 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  File   : SVTK_KeyFreeInteractorStyle.cxx
+//  Author : Christophe ATTANASIO
+//  Module : SALOME
+//  $Header$
+//
+#include "SVTK_KeyFreeInteractorStyle.h"
+#include "SVTK_Selector.h"
+
+#include <vtkObjectFactory.h>
+#include <vtkRenderWindowInteractor.h>
+#include <vtkCallbackCommand.h>
+#include <vtkCommand.h>
+#include <vtkRenderer.h>
+#include <vtkCamera.h>
+
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(SVTK_KeyFreeInteractorStyle);
+//----------------------------------------------------------------------------
+
+SVTK_KeyFreeInteractorStyle::SVTK_KeyFreeInteractorStyle():
+  myIsMidButtonDown( false ),
+  myIsLeftButtonDown( false )
+{
+}
+
+//----------------------------------------------------------------------------
+SVTK_KeyFreeInteractorStyle::~SVTK_KeyFreeInteractorStyle() 
+{
+}
+
+//----------------------------------------------------------------------------
+void SVTK_KeyFreeInteractorStyle::OnLeftButtonDown(int ctrl, int shift, 
+                                                  int x, int y) 
+{
+  myIsLeftButtonDown = true;
+
+  if (this->HasObserver(vtkCommand::LeftButtonPressEvent)) {
+    this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
+    return;
+  }
+  this->FindPokedRenderer(x, y);
+  if (this->CurrentRenderer == NULL) {
+    return;
+  }
+  myShiftState = shift;
+  // finishing current viewer operation
+  if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
+    onFinishOperation();
+    startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
+  }
+  myOtherPoint = myPoint = QPoint(x, y);
+  if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
+    startOperation(ForcedState);
+  } 
+  else {
+    if (!(ctrl||shift)){
+      if (myIsMidButtonDown){
+       startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
+      }
+      else{
+       startOperation(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
+      }
+    }
+  }
+  return;
+}
+
+//----------------------------------------------------------------------------
+void SVTK_KeyFreeInteractorStyle::OnMiddleButtonDown(int ctrl,
+                                                    int shift, 
+                                                    int x, int y) 
+{
+  myIsMidButtonDown = true;
+
+  if (this->HasObserver(vtkCommand::MiddleButtonPressEvent))  {
+    this->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);
+    return;
+  }
+  this->FindPokedRenderer(x, y);
+  if (this->CurrentRenderer == NULL)    {
+    return;
+  }
+  myShiftState = shift;
+  // finishing current viewer operation
+  if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
+    onFinishOperation();
+    startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
+  }
+  myOtherPoint = myPoint = QPoint(x, y);
+  if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
+    startOperation(ForcedState);
+  }
+  else {
+    if (!(ctrl||shift)){
+      if ( myIsLeftButtonDown ){
+       startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
+      }
+      else{
+       startOperation(VTK_INTERACTOR_STYLE_CAMERA_PAN);
+      }
+    }
+  }
+}
+
+//----------------------------------------------------------------------------
+void SVTK_KeyFreeInteractorStyle::OnLeftButtonUp(int ctrl, int shift, int x, int y)
+{
+  myIsLeftButtonDown = false;
+  SVTK_InteractorStyle::OnLeftButtonUp( ctrl, shift, x, y );
+
+  if ( myIsMidButtonDown )
+    OnMiddleButtonDown( ctrl, shift, x, y );
+}
+
+//----------------------------------------------------------------------------
+void SVTK_KeyFreeInteractorStyle::OnMiddleButtonUp(int ctrl, int shift, int x, int y)
+{
+  myIsMidButtonDown = false;
+  SVTK_InteractorStyle::OnMiddleButtonUp( ctrl, shift, x, y );
+
+  if ( myIsLeftButtonDown )
+    OnLeftButtonDown( ctrl, shift, x, y );
+}
+
+//----------------------------------------------------------------------------
+void SVTK_KeyFreeInteractorStyle::OnChar()
+{
+  char key = GetInteractor()->GetKeyCode();
+  switch (key) {
+  case 's':
+  case 'S':
+    ActionPicking();
+    EventCallbackCommand->AbortFlagOn();
+    return;
+  }
+  SVTK_InteractorStyle::OnChar();
+}
diff --git a/src/SVTK/SVTK_KeyFreeInteractorStyle.h b/src/SVTK/SVTK_KeyFreeInteractorStyle.h
new file mode 100644 (file)
index 0000000..3b44baa
--- /dev/null
@@ -0,0 +1,71 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  File   : SVTK_KeyFreeInteractorStyle.h
+//  Author : Christophe ATTANASIO
+//  Module : SALOME
+//  $Header$
+//
+#ifndef __SVTK_KeyFreeInteractorStyle_h
+#define __SVTK_KeyFreeInteractorStyle_h
+
+
+#include "SVTK.h"
+
+#include "SVTK_InteractorStyle.h"
+
+//! Introduce new style of interaction (keyboard free)
+class SVTK_EXPORT SVTK_KeyFreeInteractorStyle : public SVTK_InteractorStyle
+{
+ public:
+  static SVTK_KeyFreeInteractorStyle *New();
+  vtkTypeMacro(SVTK_KeyFreeInteractorStyle,SVTK_InteractorStyle);
+  
+ protected:
+  SVTK_KeyFreeInteractorStyle();
+  ~SVTK_KeyFreeInteractorStyle();
+
+  SVTK_KeyFreeInteractorStyle(const SVTK_KeyFreeInteractorStyle&); // Not implemented
+  void operator=(const SVTK_KeyFreeInteractorStyle&); // Not implemented
+
+  // Generic event bindings must be overridden in subclasses
+
+  //! Redefine SVTK_InteractorStyle::OnLeftButtonDown
+  virtual void OnLeftButtonDown(int ctrl, int shift, int x, int y);
+
+  //! Redefine SVTK_InteractorStyle::OnMiddleButtonDown
+  virtual void OnMiddleButtonDown(int ctrl, int shift, int x, int y);
+
+  //! Redefine SVTK_InteractorStyle::OnLeftButtonUp
+  virtual void OnLeftButtonUp(int ctrl, int shift, int x, int y);
+
+  //! Redefine SVTK_InteractorStyle::OnMiddleButtonUp
+  virtual void OnMiddleButtonUp(int ctrl, int shift, int x, int y);
+
+  //! Redefine SVTK_InteractorStyle::OnChar
+  virtual void OnChar();
+  
+  bool myIsMidButtonDown;
+  bool myIsLeftButtonDown;
+};
+
+#endif
diff --git a/src/SVTK/SVTK_MainWindow.cxx b/src/SVTK/SVTK_MainWindow.cxx
deleted file mode 100644 (file)
index 045a054..0000000
+++ /dev/null
@@ -1,900 +0,0 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : 
-//  Author : 
-//  Module : SALOME
-//  $Header$
-
-#include "SALOME_Actor.h"
-
-#include <vtkGenericRenderWindowInteractor.h>
-#include <vtkRenderer.h>
-
-#include "QtxAction.h"
-
-#include "SUIT_ToolButton.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_ViewWindow.h"
-
-#include "SUIT_Tools.h"
-#include "SUIT_ResourceMgr.h"
-#include "SVTK_NonIsometricDlg.h"
-#include "SVTK_UpdateRateDlg.h"
-#include "SVTK_CubeAxesDlg.h"
-#include "SVTK_SetRotationPointDlg.h"
-
-#include "SVTK_MainWindow.h"
-#include "SVTK_Event.h"
-#include "SVTK_Renderer.h"
-#include "SVTK_RenderWindowInteractor.h"
-#include "SVTK_InteractorStyle.h"
-
-#include "SVTK_Selector.h"
-
-#include <qimage.h>
-
-/*!
-  Constructor
-*/
-SVTK_MainWindow
-::SVTK_MainWindow(QWidget* theParent, 
-                 const char* theName,
-                 SUIT_ResourceMgr* theResourceMgr,
-                 SUIT_ViewWindow* theViewWindow) :
-  QMainWindow(theParent,theName,0),
-  myViewWindow(theViewWindow)
-{
-  myToolBar = new QToolBar(this);
-  myToolBar->setCloseMode(QDockWindow::Undocked);
-  myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
-
-  createActions(theResourceMgr);
-  createToolBar();
-}
-
-/*!
-  To initialize the class
-*/
-void
-SVTK_MainWindow
-::Initialize(SVTK_RenderWindowInteractor* theInteractor)
-{
-  myInteractor = theInteractor;
-  SetEventDispatcher(myInteractor->GetDevice());
-
-  setCentralWidget(myInteractor);
-  myInteractor->setBackgroundMode(Qt::NoBackground);
-
-  myInteractor->setFocusPolicy(StrongFocus);
-  myInteractor->setFocus();
-  setFocusProxy(myInteractor);
-
-  myUpdateRateDlg = new SVTK_UpdateRateDlg(myActionsMap[UpdateRate],this,"SVTK_UpdateRateDlg");
-  myNonIsometricDlg = new SVTK_NonIsometricDlg(myActionsMap[NonIsometric],this,"SVTK_NonIsometricDlg");
-  myCubeAxesDlg = new SVTK_CubeAxesDlg(myActionsMap[GraduatedAxes],this,"SVTK_CubeAxesDlg");
-  mySetRotationPointDlg = new SVTK_SetRotationPointDlg(myActionsMap[ChangeRotationPointId],this,"SVTK_SetRotationPointDlg");
-}
-
-/*!
-  Destructor
-*/
-SVTK_MainWindow
-::~SVTK_MainWindow()
-{
-}
-
-/*!
-  \return used SVTK_RenderWindowInteractor
-*/
-SVTK_RenderWindowInteractor*
-SVTK_MainWindow
-::GetInteractor()
-{
-  return myInteractor;
-}
-
-/*!
-  \return used #vtkRenderWindowInteractor (obsolete)
-*/
-vtkRenderWindowInteractor*
-SVTK_MainWindow
-::getInteractor()
-{
-  return GetInteractor()->GetDevice();
-}
-
-/*!
-  \return used vtkRenderWindow (obsolete)
-*/
-vtkRenderWindow*
-SVTK_MainWindow
-::getRenderWindow()
-{
-  return GetInteractor()->getRenderWindow();
-}
-
-/*!
-  To repaint the view
-  \param theUpdateTrihedron - adjust trihedron
-*/
-void
-SVTK_MainWindow
-::Repaint(bool theUpdateTrihedron)
-{
-  if(theUpdateTrihedron) 
-    GetRenderer()->OnAdjustTrihedron();
-
-  GetInteractor()->update();
-
-  if ( (SVTK_InteractorStyle*)GetInteractorStyle() )
-    ((SVTK_InteractorStyle*)GetInteractorStyle())->OnTimer();
-}
-
-/*!
-  To invoke a VTK event on SVTK_RenderWindowInteractor instance
-*/
-void
-SVTK_MainWindow
-::InvokeEvent(unsigned long theEvent, void* theCallData)
-{
-  GetInteractor()->InvokeEvent(theEvent,theCallData);
-}
-
-/*!
-  Redirect the request to SVTK_RenderWindowInteractor::GetInteractorStyle
-*/
-vtkInteractorStyle*
-SVTK_MainWindow
-::GetInteractorStyle()
-{
-  return GetInteractor()->GetInteractorStyle();
-}
-
-/*!
-  Redirect the request to SVTK_RenderWindowInteractor::PushInteractorStyle
-*/
-void
-SVTK_MainWindow
-::PushInteractorStyle(vtkInteractorStyle* theStyle)
-{
-  GetInteractor()->PushInteractorStyle(theStyle);
-}
-
-/*!
-  Redirect the request to SVTK_RenderWindowInteractor::PopInteractorStyle
-*/
-void
-SVTK_MainWindow
-::PopInteractorStyle()
-{
-  GetInteractor()->PopInteractorStyle();
-}
-
-/*!
-  Redirect the request to SVTK_RenderWindowInteractor::GetSelector
-*/
-SVTK_Selector*
-SVTK_MainWindow
-::GetSelector()
-{
-  return GetInteractor()->GetSelector();
-}
-
-/*!
-  Redirect the request to SVTK_RenderWindowInteractor::SelectionMode
-*/
-Selection_Mode
-SVTK_MainWindow
-::SelectionMode()
-{
-  return GetSelector()->SelectionMode();
-}
-
-/*!
-  Redirect the request to SVTK_RenderWindowInteractor::SetSelectionMode
-*/
-void
-SVTK_MainWindow
-::SetSelectionMode(Selection_Mode theMode)
-{
-  GetSelector()->SetSelectionMode(theMode);
-}
-
-/*!
-  Redirect the request to SVTK_RenderWindowInteractor::GetRenderer
-*/
-SVTK_Renderer* 
-SVTK_MainWindow
-::GetRenderer()
-{
-  return GetInteractor()->GetRenderer();
-}
-
-/*!
-  Redirect the request to SVTK_RenderWindowInteractor::getRenderer
-*/
-vtkRenderer* 
-SVTK_MainWindow
-::getRenderer()
-{
-  return GetInteractor()->getRenderer();
-}
-
-/*!
-  Sets background color of the view
-  \param theColor - new background color
-*/
-void
-SVTK_MainWindow
-::SetBackgroundColor(const QColor& theColor)
-{
-  getRenderer()->SetBackground(theColor.red()/255.0, 
-                              theColor.green()/255.0,
-                              theColor.blue()/255.0);
-}
-
-/*!
-  \return background color of the view
-*/
-QColor
-SVTK_MainWindow
-::BackgroundColor()
-{
-  vtkFloatingPointType aBackgroundColor[3];
-  getRenderer()->GetBackground(aBackgroundColor);
-  return QColor(int(aBackgroundColor[0]*255), 
-               int(aBackgroundColor[1]*255), 
-               int(aBackgroundColor[2]*255));
-}
-
-/*!
-  Redirect the request to SVTK_Renderer::GetScale
-*/
-void
-SVTK_MainWindow
-::GetScale( double theScale[3] ) 
-{
-  GetRenderer()->GetScale( theScale );
-}
-
-/*!
-  Redirect the request to SVTK_Renderer::SetScale
-*/
-void
-SVTK_MainWindow
-::SetScale( double theScale[3] ) 
-{
-  GetRenderer()->SetScale( theScale );
-  Repaint();
-}
-
-/*!
-  Redirect the request to SVTK_Renderer::AddActor
-*/
-void
-SVTK_MainWindow
-::AddActor(VTKViewer_Actor* theActor, 
-          bool theIsUpdate)
-{
-  GetRenderer()->AddActor(theActor);
-  if(theIsUpdate) 
-    Repaint();
-}
-
-/*!
-  Redirect the request to SVTK_Renderer::RemoveActor
-*/
-void
-SVTK_MainWindow
-::RemoveActor(VTKViewer_Actor* theActor, 
-             bool theIsUpdate)
-{
-  GetRenderer()->RemoveActor(theActor);
-  if(theIsUpdate) 
-    Repaint();
-}
-
-/*!
-  Redirect the request to SVTK_Renderer::GetTrihedronSize
-*/
-vtkFloatingPointType
-SVTK_MainWindow
-::GetTrihedronSize()
-{
-  return GetRenderer()->GetTrihedronSize();
-}
-
-/*!
-  Redirect the request to SVTK_Renderer::SetTrihedronSize
-*/
-void 
-SVTK_MainWindow
-::SetTrihedronSize( const vtkFloatingPointType theSize, const bool theRelative )
-{
-  GetRenderer()->SetTrihedronSize(theSize, theRelative);
-  Repaint();
-}
-
-
-/*! If parameter theIsForcedUpdate is true, recalculate parameters for
- *  trihedron and cube axes, even if trihedron and cube axes is invisible.
- */
-void
-SVTK_MainWindow
-::AdjustActors()
-{
-  GetRenderer()->AdjustActors();
-  Repaint();
-}
-
-/*!
-  Redirect the request to SVTK_Renderer::IsTrihedronDisplayed
-*/
-bool
-SVTK_MainWindow
-::IsTrihedronDisplayed()
-{
-  return GetRenderer()->IsTrihedronDisplayed();
-}
-
-/*!
-  Redirect the request to SVTK_Renderer::IsCubeAxesDisplayed
-*/
-bool
-SVTK_MainWindow
-::IsCubeAxesDisplayed()
-{
-  return GetRenderer()->IsCubeAxesDisplayed();
-}
-
-/*!
-  Redirect the request to SVTK_Renderer::GetTrihedron
-*/
-VTKViewer_Trihedron*  
-SVTK_MainWindow
-::GetTrihedron() 
-{ 
-  return GetRenderer()->GetTrihedron(); 
-}
-
-/*!
-  Redirect the request to SVTK_Renderer::GetCubeAxes
-*/
-SVTK_CubeAxesActor2D* 
-SVTK_MainWindow
-::GetCubeAxes() 
-{ 
-  return GetRenderer()->GetCubeAxes(); 
-}
-
-/*!
-  \return toolbar of svtk main window
-*/
-QToolBar* 
-SVTK_MainWindow
-::getToolBar()
-{
-  return myToolBar;
-}
-
-void
-SVTK_MainWindow
-::SetEventDispatcher(vtkObject* theDispatcher)
-{
-  myEventDispatcher = theDispatcher;
-}
-
-#if defined(WIN32) && !defined(_DEBUG)
-#pragma optimize( "", off )
-#endif
-
-/*!
-  Creates all actions of svtk main window
-*/
-void
-SVTK_MainWindow
-::createActions(SUIT_ResourceMgr* theResourceMgr)
-{
-  if(!myActionsMap.isEmpty()) 
-    return;
-  
-  QtxAction* anAction;
-
-  // Dump view
-  anAction = new QtxAction(tr("MNU_DUMP_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
-                          tr( "MNU_DUMP_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_DUMP_VIEW"));
-  connect(anAction, SIGNAL(activated()), myViewWindow, SLOT(onDumpView()));
-  myActionsMap[ DumpId ] = anAction;
-
-  // FitAll
-  anAction = new QtxAction(tr("MNU_FITALL"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
-                          tr( "MNU_FITALL" ), 0, this);
-  anAction->setStatusTip(tr("DSC_FITALL"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(onFitAll()));
-  myActionsMap[ FitAllId ] = anAction;
-
-  // FitRect
-  anAction = new QtxAction(tr("MNU_FITRECT"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
-                          tr( "MNU_FITRECT" ), 0, this);
-  anAction->setStatusTip(tr("DSC_FITRECT"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(activateWindowFit()));
-  myActionsMap[ FitRectId ] = anAction;
-
-  // Zoom
-  anAction = new QtxAction(tr("MNU_ZOOM_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
-                          tr( "MNU_ZOOM_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(activateZoom()));
-  myActionsMap[ ZoomId ] = anAction;
-
-  // Panning
-  anAction = new QtxAction(tr("MNU_PAN_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
-                          tr( "MNU_PAN_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_PAN_VIEW"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(activatePanning()));
-  myActionsMap[ PanId ] = anAction;
-
-  // Global Panning
-  anAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
-                          tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning()));
-  myActionsMap[ GlobalPanId ] = anAction;
-
-  // Change rotation point
-  anAction = new QtxAction(tr("MNU_CHANGINGROTATIONPOINT_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATION_POINT" ) ),
-                          tr( "MNU_CHANGINGROTATIONPOINT_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_CHANGINGROTATIONPOINT_VIEW"));
-  anAction->setToggleAction(true);
-  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onChangeRotationPoint(bool)));
-  myActionsMap[ ChangeRotationPointId ] = anAction;
-
-  // Rotation
-  anAction = new QtxAction(tr("MNU_ROTATE_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
-                          tr( "MNU_ROTATE_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(activateRotation()));
-  myActionsMap[ RotationId ] = anAction;
-
-  // Projections
-  anAction = new QtxAction(tr("MNU_FRONT_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
-                          tr( "MNU_FRONT_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_FRONT_VIEW"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(onFrontView()));
-  myActionsMap[ FrontId ] = anAction;
-
-  anAction = new QtxAction(tr("MNU_BACK_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
-                          tr( "MNU_BACK_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_BACK_VIEW"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(onBackView()));
-  myActionsMap[ BackId ] = anAction;
-
-  anAction = new QtxAction(tr("MNU_TOP_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
-                          tr( "MNU_TOP_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_TOP_VIEW"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(onTopView()));
-  myActionsMap[ TopId ] = anAction;
-
-  anAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
-                          tr( "MNU_BOTTOM_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(onBottomView()));
-  myActionsMap[ BottomId ] = anAction;
-
-  anAction = new QtxAction(tr("MNU_LEFT_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
-                          tr( "MNU_LEFT_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_LEFT_VIEW"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(onLeftView()));
-  myActionsMap[ LeftId ] = anAction;
-
-  anAction = new QtxAction(tr("MNU_RIGHT_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
-                          tr( "MNU_RIGHT_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(onRightView()));
-  myActionsMap[ RightId ] = anAction;
-
-  // Reset
-  anAction = new QtxAction(tr("MNU_RESET_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
-                          tr( "MNU_RESET_VIEW" ), 0, this);
-  anAction->setStatusTip(tr("DSC_RESET_VIEW"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(onResetView()));
-  myActionsMap[ ResetId ] = anAction;
-
-  // onViewTrihedron: Shows - Hides Trihedron
-  anAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
-                          tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
-  anAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(onViewTrihedron()));
-  myActionsMap[ ViewTrihedronId ] = anAction;
-
-  // onNonIsometric: Manage non-isometric params
-  anAction = new QtxAction(tr("MNU_SVTK_SCALING"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SCALING" ) ),
-                          tr( "MNU_SVTK_SCALING" ), 0, this);
-  anAction->setStatusTip(tr("DSC_SVTK_SCALING"));
-  anAction->setToggleAction(true);
-  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onNonIsometric(bool)));
-  myActionsMap[ NonIsometric ] = anAction;
-
-  // onGraduatedAxes: Manage graduated axes params
-  anAction = new QtxAction(tr("MNU_SVTK_GRADUATED_AXES"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_GRADUATED_AXES" ) ),
-                          tr( "MNU_SVTK_GRADUATED_AXES" ), 0, this);
-  anAction->setStatusTip(tr("DSC_SVTK_GRADUATED_AXES"));
-  anAction->setToggleAction(true);
-  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onGraduatedAxes(bool)));
-  myActionsMap[ GraduatedAxes ] = anAction;
-
-  // onGraduatedAxes: Manage graduated axes params
-  anAction = new QtxAction(tr("MNU_SVTK_UPDATE_RATE"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_UPDATE_RATE" ) ),
-                          tr( "MNU_SVTK_UPDATE_RATE" ), 0, this);
-  anAction->setStatusTip(tr("DSC_SVTK_UPDATE_RATE"));
-  anAction->setToggleAction(true);
-  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onUpdateRate(bool)));
-  myActionsMap[ UpdateRate ] = anAction;
-}
-
-#if defined(WIN32) && !defined(_DEBUG)
-#pragma optimize( "", on )
-#endif
-
-/*!
-  Creates toolbar of svtk main window
-*/
-void
-SVTK_MainWindow
-::createToolBar()
-{
-  myActionsMap[DumpId]->addTo(myToolBar);
-  myActionsMap[ViewTrihedronId]->addTo(myToolBar);
-
-  SUIT_ToolButton* aScaleBtn = new SUIT_ToolButton(myToolBar);
-  aScaleBtn->AddAction(myActionsMap[FitAllId]);
-  aScaleBtn->AddAction(myActionsMap[FitRectId]);
-  aScaleBtn->AddAction(myActionsMap[ZoomId]);
-
-  SUIT_ToolButton* aPanningBtn = new SUIT_ToolButton(myToolBar);
-  aPanningBtn->AddAction(myActionsMap[PanId]);
-  aPanningBtn->AddAction(myActionsMap[GlobalPanId]);
-
-  myActionsMap[ChangeRotationPointId]->addTo(myToolBar);
-
-  myActionsMap[RotationId]->addTo(myToolBar);
-
-  SUIT_ToolButton* aViewsBtn = new SUIT_ToolButton(myToolBar);
-  aViewsBtn->AddAction(myActionsMap[FrontId]);
-  aViewsBtn->AddAction(myActionsMap[BackId]);
-  aViewsBtn->AddAction(myActionsMap[TopId]);
-  aViewsBtn->AddAction(myActionsMap[BottomId]);
-  aViewsBtn->AddAction(myActionsMap[LeftId]);
-  aViewsBtn->AddAction(myActionsMap[RightId]);
-
-  myActionsMap[ResetId]->addTo(myToolBar);
-
-  myActionsMap[UpdateRate]->addTo(myToolBar);
-  myActionsMap[NonIsometric]->addTo(myToolBar);
-  myActionsMap[GraduatedAxes]->addTo(myToolBar);
-}
-
-/*!
-  Custom show event handler
-*/
-void
-SVTK_MainWindow
-::showEvent( QShowEvent * theEvent ) 
-{
-  emit Show( theEvent );
-}
-
-/*!
-  Custom hide event handler
-*/
-void
-SVTK_MainWindow
-::hideEvent( QHideEvent * theEvent ) 
-{
-  emit Hide( theEvent );
-}
-
-/*!
-  Starts zoom transformation
-*/
-void
-SVTK_MainWindow
-::activateZoom()
-{
-  myEventDispatcher->InvokeEvent(SVTK::StartZoom,0);
-}
-
-/*!
-  Starts panning transformation
-*/
-void
-SVTK_MainWindow
-::activatePanning()
-{
-  myEventDispatcher->InvokeEvent(SVTK::StartPan,0);
-}
-
-/*!
-  Starts rotation transformation
-*/
-void
-SVTK_MainWindow
-::activateRotation()
-{
-  myEventDispatcher->InvokeEvent(SVTK::StartRotate,0);
-}
-
-/*!
-  Change rotation point
-*/
-void
-SVTK_MainWindow
-::onChangeRotationPoint(bool theIsActivate)
-{
-  if(theIsActivate){
-    mySetRotationPointDlg->addObserver();
-    if ( mySetRotationPointDlg->IsFirstShown() )
-      activateSetRotationGravity();
-    mySetRotationPointDlg->show();
-  }else
-    mySetRotationPointDlg->hide();
-}
-
-/*!
-  Set the gravity center as a rotation point
-*/
-void
-SVTK_MainWindow
-::activateSetRotationGravity()
-{
-  myEventDispatcher->InvokeEvent(SVTK::SetRotateGravity,0);
-}
-
-/*!
-  Set the selected point as a rotation point
-*/
-void
-SVTK_MainWindow
-::activateSetRotationSelected(void* theData)
-{
-  myEventDispatcher->InvokeEvent(SVTK::ChangeRotationPoint,theData);
-}
-
-/*!
-  Set the point selected by user as a rotation point
-*/
-void
-SVTK_MainWindow
-::activateStartPointSelection()
-{
-  myEventDispatcher->InvokeEvent(SVTK::StartPointSelection,0);
-}
-
-/*!
-  Starts global panning transformation
-*/
-void
-SVTK_MainWindow
-::activateGlobalPanning()
-{
-  myEventDispatcher->InvokeEvent(SVTK::StartGlobalPan,0);
-}
-
-/*!
-  Starts window fit transformation
-*/
-void
-SVTK_MainWindow
-::activateWindowFit()
-{
-  myEventDispatcher->InvokeEvent(SVTK::StartFitArea,0);
-}
-
-/*!
-  Processes transformation "front view"
-*/
-void
-SVTK_MainWindow
-::onFrontView()
-{
-  GetRenderer()->OnFrontView();
-  Repaint();
-}
-
-/*!
-  Processes transformation "back view"
-*/
-void
-SVTK_MainWindow
-::onBackView()
-{
-  GetRenderer()->OnBackView();
-  Repaint();
-}
-
-/*!
-  Processes transformation "top view"
-*/
-void
-SVTK_MainWindow
-::onTopView()
-{
-  GetRenderer()->OnTopView();
-  Repaint();
-}
-
-/*!
-  Processes transformation "bottom view"
-*/
-void
-SVTK_MainWindow
-::onBottomView()
-{
-  GetRenderer()->OnBottomView();
-  Repaint();
-}
-
-/*!
-  Processes transformation "left view"
-*/
-void
-SVTK_MainWindow
-::onLeftView()
-{
-  GetRenderer()->OnLeftView();
-  Repaint();
-}
-
-/*!
-  Processes transformation "right view"
-*/
-void
-SVTK_MainWindow
-::onRightView()
-{
-  GetRenderer()->OnRightView();
-  Repaint();
-}
-
-/*!
-  Processes transformation "reset view": sets default orientation of viewport camera
-*/
-void
-SVTK_MainWindow
-::onResetView()
-{
-  GetRenderer()->OnResetView();
-  Repaint();
-}
-
-/*!
-  Processes transformation "fit all"
-*/
-void
-SVTK_MainWindow
-::onFitAll()
-{
-  GetRenderer()->OnFitAll();
-  Repaint();
-}
-
-/*!
-  Shows trihedron
-*/
-void 
-SVTK_MainWindow
-::onViewTrihedron()
-{
-  GetRenderer()->OnViewTrihedron();
-  Repaint();
-}
-
-/*!
-  Shows cube axes
-*/
-void
-SVTK_MainWindow
-::onViewCubeAxes()
-{
-  GetRenderer()->OnViewCubeAxes();
-  Repaint();
-}
-
-void
-SVTK_MainWindow
-::onUpdateRate(bool theIsActivate)
-{
-  if(theIsActivate){
-    myUpdateRateDlg->Update();
-    myUpdateRateDlg->show();
-  }else
-    myUpdateRateDlg->hide();
-}
-
-void
-SVTK_MainWindow
-::onNonIsometric(bool theIsActivate)
-{
-  if(theIsActivate){
-    myNonIsometricDlg->Update();
-    myNonIsometricDlg->show();
-  }else
-    myNonIsometricDlg->hide();
-}
-
-void
-SVTK_MainWindow
-::onGraduatedAxes(bool theIsActivate)
-{
-  if(theIsActivate){
-    myCubeAxesDlg->Update();
-    myCubeAxesDlg->show();
-  }else
-    myCubeAxesDlg->hide();
-}
-
-void
-SVTK_MainWindow
-::onAdjustTrihedron()
-{   
-  GetRenderer()->OnAdjustTrihedron();
-}
-
-void
-SVTK_MainWindow
-::onAdjustCubeAxes()
-{   
-  GetRenderer()->OnAdjustCubeAxes();
-}
-
-/*!
-  \return QImage, containing all scene rendering in window
-*/
-QImage
-SVTK_MainWindow
-::dumpView()
-{
-  QPixmap px = QPixmap::grabWindow( GetInteractor()->winId() );
-  return px.convertToImage();
-}
diff --git a/src/SVTK/SVTK_MainWindow.h b/src/SVTK/SVTK_MainWindow.h
deleted file mode 100644 (file)
index 1be95b6..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef SVTK_MAINWINDOW_H
-#define SVTK_MAINWINDOW_H
-
-#ifdef WIN32
-#pragma warning( disable:4251 )
-#endif
-
-#include "SVTK.h"
-#include "SVTK_Selection.h"
-
-#include <vtkSmartPointer.h>
-
-#include <qmainwindow.h>
-
-class QtxAction;
-
-class vtkObject;
-class vtkRenderer;
-class vtkRenderWindow;
-class vtkInteractorStyle;
-class vtkRenderWindowInteractor;
-
-class SUIT_ResourceMgr;
-class SUIT_ViewWindow;
-
-class SVTK_RenderWindowInteractor;
-class SVTK_NonIsometricDlg;
-class SVTK_UpdateRateDlg;
-class SVTK_CubeAxesActor2D;
-class SVTK_CubeAxesDlg;
-class SVTK_SetRotationPointDlg;
-
-class VTKViewer_Trihedron;
-class VTKViewer_Transform;
-class VTKViewer_Actor;
-
-class SVTK_Renderer;
-class SVTK_Selector;
-
-
-//! The class is a container for #SVTK_RenderWindowInteractor.
-/*!
-  The class contains #SVTK_RenderWindowInteractor instance and
-  adds predefined viewer actions and toolbar for user interaction.
-*/
-class SVTK_EXPORT SVTK_MainWindow: public QMainWindow
-{
-  Q_OBJECT;
-
-public:
-  SVTK_MainWindow(QWidget* theParent, 
-                 const char* theName,
-                 SUIT_ResourceMgr* theResourceMgr,
-                 SUIT_ViewWindow* theViewWindow);
-  
-  //! To initialize the class
-  virtual
-  void
-  Initialize(SVTK_RenderWindowInteractor* theInteractor);
-
-  virtual
-  ~SVTK_MainWindow();
-
-  //----------------------------------------------------------------------------
-  //! Get used #SVTK_RenderWindowInteractor
-  SVTK_RenderWindowInteractor*
-  GetInteractor();
-
-  //! Get used #vtkRenderWindowInteractor (obsolete)
-  vtkRenderWindowInteractor*
-  getInteractor();
-
-  //! Get used #vtkRenderWindow (obsolete)
-  vtkRenderWindow*
-  getRenderWindow();
-
-  //! To repaint the view
-  void
-  Repaint(bool theUpdateTrihedron = true);
-
-  //! To invoke a VTK event on #SVTK_RenderWindowInteractor instance
-  void
-  InvokeEvent(unsigned long theEvent, void* theCallData);
-
-  //----------------------------------------------------------------------------
-  //! Redirect the request to #SVTK_RenderWindowInteractor::GetInteractorStyle
-  vtkInteractorStyle* 
-  GetInteractorStyle();
-
-  //! Redirect the request to #SVTK_RenderWindowInteractor::PushInteractorStyle
-  void
-  PushInteractorStyle(vtkInteractorStyle* theStyle);
-
-  //! Redirect the request to #SVTK_RenderWindowInteractor::PopInteractorStyle
-  void
-  PopInteractorStyle();
-
-  //----------------------------------------------------------------------------
-  //! Redirect the request to #SVTK_RenderWindowInteractor::GetSelector
-  SVTK_Selector* 
-  GetSelector();
-
-  //! Redirect the request to #SVTK_RenderWindowInteractor::SelectionMode
-  Selection_Mode
-  SelectionMode();
-
-  //! Redirect the request to #SVTK_RenderWindowInteractor::SetSelectionMode
-  void 
-  SetSelectionMode(Selection_Mode theMode);
-
-  //----------------------------------------------------------------------------
-  //! Redirect the request to #SVTK_RenderWindowInteractor::GetRenderer
-  SVTK_Renderer* 
-  GetRenderer();
-
-  //! Redirect the request to #SVTK_RenderWindowInteractor::getRenderer
-  vtkRenderer* 
-  getRenderer();
-
-  //! Set background color to the view
-  void
-  SetBackgroundColor(const QColor& theColor);
-
-  //! Get background color of the view
-  QColor 
-  BackgroundColor();
-
-  //! Redirect the request to #SVTK_Renderer::SetScale
-  void
-  SetScale(double theScale[3]);
-
-  //! Redirect the request to #SVTK_Renderer::GetScale
-  void
-  GetScale(double theScale[3]);
-
-  //! Redirect the request to #SVTK_Renderer::AddActor
-  virtual
-  void 
-  AddActor(VTKViewer_Actor* theActor, 
-          bool theIsUpdate = false);
-
-  //! Redirect the request to #SVTK_Renderer::RemoveActor
-  virtual
-  void 
-  RemoveActor(VTKViewer_Actor* theActor, 
-             bool theIsUpdate = false);
-
-  //! Redirect the request to #SVTK_Renderer::GetTrihedronSize
-  vtkFloatingPointType  
-  GetTrihedronSize();
-
-  //! Redirect the request to #SVTK_Renderer::SetTrihedronSize
-  void
-  SetTrihedronSize(const vtkFloatingPointType theSize, const bool theRelative = true);
-
-  //! Redirect the request to #SVTK_Renderer::AdjustActors
-  void 
-  AdjustActors();
-
-  //! Redirect the request to #SVTK_Renderer::IsTrihedronDisplayed
-  bool
-  IsTrihedronDisplayed();
-  //! Redirect the request to #SVTK_Renderer::IsCubeAxesDisplayed
-  bool
-  IsCubeAxesDisplayed();
-
-  //! Redirect the request to #SVTK_Renderer::GetTrihedron
-  VTKViewer_Trihedron* 
-  GetTrihedron();
-
-  //! Redirect the request to #SVTK_Renderer::GetCubeAxes
-  SVTK_CubeAxesActor2D*
-  GetCubeAxes();
-
-  //----------------------------------------------------------------------------
-  QToolBar* getToolBar();
-
- signals:
-  void Show( QShowEvent * );
-  void Hide( QHideEvent * );
-  
- public slots:
-  virtual void showEvent( QShowEvent * );
-  virtual void hideEvent( QHideEvent * );
-
-  void activateZoom();
-  void activateWindowFit();
-  void activateRotation();
-  void activatePanning(); 
-  void activateGlobalPanning(); 
-
-  void onChangeRotationPoint(bool theIsActivate);
-
-  void activateSetRotationGravity();
-  void activateSetRotationSelected(void* theData);
-  void activateStartPointSelection();
-
-  void onFrontView(); 
-  void onBackView(); 
-  void onTopView();
-  void onBottomView();
-  void onRightView(); 
-  void onLeftView();     
-
-  void onResetView();     
-  void onFitAll();
-
-  void onViewTrihedron(); 
-  void onViewCubeAxes();
-
-  void onUpdateRate(bool theIsActivate);
-  void onNonIsometric(bool theIsActivate);
-  void onGraduatedAxes(bool theIsActivate);
-
-  void onAdjustTrihedron();
-  void onAdjustCubeAxes();
-
- public:
-  QImage dumpView();
-
- protected:  
-  void
-  createActions(SUIT_ResourceMgr* theResourceMgr);
-
-  void
-  createToolBar();
-
-  void
-  SetEventDispatcher(vtkObject* theDispatcher);
-
-  enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, 
-        ChangeRotationPointId, RotationId,
-         FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, 
-        ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate};
-  typedef QMap<int, QtxAction*> TActionsMap;
-
-  SUIT_ViewWindow* myViewWindow;
-
-  SVTK_NonIsometricDlg* myNonIsometricDlg;
-  SVTK_UpdateRateDlg* myUpdateRateDlg;
-  SVTK_CubeAxesDlg* myCubeAxesDlg;
-  SVTK_SetRotationPointDlg* mySetRotationPointDlg;
-
-  vtkSmartPointer<vtkObject> myEventDispatcher;
-  TActionsMap myActionsMap;  
-  QToolBar* myToolBar;
-
-  SVTK_RenderWindowInteractor* myInteractor;
-};
-
-#ifdef WIN32
-#pragma warning( default:4251 )
-#endif
-
-#endif
index 7b99f2c9c1d31d0691954537bd73c9ec261129b4..9596001ca7c00c0c7f3c72c0c0fa49bfde4f874d 100644 (file)
@@ -1,42 +1,41 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SVTK_NonIsometricDlg.h"
-#include "SVTK_MainWindow.h"
+#include "SVTK_ViewWindow.h"
 #include "SVTK_Renderer.h"
 
-#include "QtxDblSpinBox.h"
+#include "QtxDoubleSpinBox.h"
 #include "QtxAction.h"
 
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
 
 using namespace std;
 
@@ -45,14 +44,14 @@ using namespace std;
 */
 SVTK_NonIsometricDlg
 ::SVTK_NonIsometricDlg(QtxAction* theAction,
-                      SVTK_MainWindow* theParent,
+                      SVTK_ViewWindow* theParent,
                       const char* theName):
   SVTK_DialogBase(theAction,
                  theParent, 
                  theName),
   m_MainWindow(theParent)
 {
-  setCaption(tr("DLG_TITLE"));
+  setWindowTitle(tr("DLG_TITLE"));
   setSizeGripEnabled(TRUE);
 
   // Create layout for this dialog
@@ -61,34 +60,39 @@ SVTK_NonIsometricDlg
   layoutDlg->setMargin(11);
 
   // Create croup box with grid layout
-  QGroupBox* aGroupBox = new QGroupBox(this, "GroupBox");
+  QGroupBox* aGroupBox = new QGroupBox(this);
+  aGroupBox->setObjectName("GroupBox");
   QHBoxLayout* aHBoxLayout = new QHBoxLayout(aGroupBox);
   aHBoxLayout->setMargin(11);
   aHBoxLayout->setSpacing(6);
 
   // "X" scaling
-  QLabel* TextLabelX = new QLabel (tr("LBL_X"), aGroupBox, "TextLabelX");
+  QLabel* TextLabelX = new QLabel (tr("LBL_X"), aGroupBox);
+  TextLabelX->setObjectName("TextLabelX");
   TextLabelX->setFixedWidth(15);
-  m_sbXcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+  m_sbXcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
   m_sbXcoeff->setMinimumWidth(80);
   m_sbXcoeff->setValue(1.0);
 
   // "Y" scaling
-  QLabel* TextLabelY = new QLabel (tr("LBL_Y"), aGroupBox, "TextLabelY");
+  QLabel* TextLabelY = new QLabel (tr("LBL_Y"), aGroupBox);
+  TextLabelY->setObjectName("TextLabelY");
   TextLabelY->setFixedWidth(15);
-  m_sbYcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+  m_sbYcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
   m_sbYcoeff->setMinimumWidth(80);
   m_sbYcoeff->setValue(1.0);
 
   // "Z" scaling
-  QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), aGroupBox, "TextLabelZ");
+  QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), aGroupBox);
+  TextLabelZ->setObjectName("TextLabelZ");
   TextLabelZ->setFixedWidth(15);
-  m_sbZcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+  m_sbZcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
   m_sbZcoeff->setMinimumWidth(80);
   m_sbZcoeff->setValue(1.0);
 
   // Create <Reset> button
-  m_bReset = new QPushButton(tr("&Reset"), aGroupBox, "m_bReset");
+  m_bReset = new QPushButton(tr("&Reset"), aGroupBox);
+  m_bReset->setObjectName("m_bReset");
 
   // Layout widgets in the group box
   aHBoxLayout->addWidget(TextLabelX);
@@ -106,14 +110,17 @@ SVTK_NonIsometricDlg
   aHBoxLayout2->setMargin(11);
   aHBoxLayout2->setSpacing(6);
   // Create <OK> button
-  QPushButton* m_bOk = new QPushButton(tr("O&K"), aGroupBox2, "m_bOk");
+  QPushButton* m_bOk = new QPushButton(tr("O&K"), aGroupBox2);
+  m_bOk->setObjectName("m_bOk");
   m_bOk->setDefault(TRUE);
   m_bOk->setAutoDefault(TRUE);
   // Create <Apply> button
-  QPushButton* m_bApply = new QPushButton(tr("&Apply"), aGroupBox2, "m_bApply");
+  QPushButton* m_bApply = new QPushButton(tr("&Apply"), aGroupBox2);
+  m_bApply->setObjectName("m_bApply");
   m_bApply->setAutoDefault(TRUE);
   // Create <Cancel> button
-  QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aGroupBox2, "m_bCancel");
+  QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aGroupBox2);
+  m_bCancel->setObjectName("m_bCancel");
   m_bCancel->setAutoDefault(TRUE);
 
   // Layout buttons
index 66be82a3957d147d95b230f9e5ec2db94010f346..7958fc24adf27721bff6a9fa4061b3eb010ce70d 100644 (file)
@@ -1,39 +1,38 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_NONISOMETRICDLG_H
 #define SVTK_NONISOMETRICDLG_H
 
 #include "SVTK_DialogBase.h"
 
-class SVTK_MainWindow;
+class SVTK_ViewWindow;
 
-class QtxDblSpinBox;
+class QtxDoubleSpinBox;
 class QtxAction;
 
 class QPushButton;
@@ -45,7 +44,7 @@ class SVTK_NonIsometricDlg : public SVTK_DialogBase
 
 public:
   SVTK_NonIsometricDlg(QtxAction* theAction,
-                      SVTK_MainWindow* theParent,
+                      SVTK_ViewWindow* theParent,
                       const char* theName);
 
   ~SVTK_NonIsometricDlg();
@@ -53,11 +52,11 @@ public:
   void Update();
 
 protected:
-  SVTK_MainWindow *m_MainWindow;
+  SVTK_ViewWindow *m_MainWindow;
 
-  QtxDblSpinBox* m_sbXcoeff;
-  QtxDblSpinBox* m_sbYcoeff;
-  QtxDblSpinBox* m_sbZcoeff;
+  QtxDoubleSpinBox* m_sbXcoeff;
+  QtxDoubleSpinBox* m_sbYcoeff;
+  QtxDoubleSpinBox* m_sbZcoeff;
   QPushButton* m_bReset;
 
 protected slots:
index 11e4b20f5e0c56bc4ba4b381261d1b8a866bded9..34651fe477be8a513f3c6890d11e4eb95bb57c23 100644 (file)
@@ -1,32 +1,34 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2004  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_Prs.cxx
 //  Author : Sergey ANIKIN
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SVTK_Prs.h"
+
+#include <vtkActorCollection.h>
+
 using namespace std;
 
 /*!
index 218a9f101764d42f5aa41fbe159449a0c47b86fc..e867f5c8b7948f35aa4f08b0b3c29c92178c4ae5 100644 (file)
@@ -1,38 +1,38 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2004  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_Prs.h
 //  Author : Sergey ANIKIN
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_Prs_H
 #define SVTK_Prs_H
 
-#include <SVTK.h>
+#include "SVTK.h"
 #include "SALOME_Prs.h"
 
-#include <vtkActorCollection.h>
+class vtkActorCollection;
+class vtkActor;
 
 class SVTK_EXPORT SVTK_Prs : public SALOME_VTKPrs
 {
diff --git a/src/SVTK/SVTK_Recorder.cxx b/src/SVTK/SVTK_Recorder.cxx
new file mode 100755 (executable)
index 0000000..52b08a1
--- /dev/null
@@ -0,0 +1,481 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "SVTK_Recorder.h"
+
+#include "SVTK_ImageWriter.h"
+#include "SVTK_ImageWriterMgr.h"
+
+#include <vtkObjectFactory.h>
+#include <vtkObject.h>
+#include <vtkCallbackCommand.h>
+#include <vtkRenderWindow.h>
+#include <vtkTimerLog.h>
+#include <vtkWindowToImageFilter.h>
+#include <vtkJPEGWriter.h>
+#include <vtkImageData.h>
+
+#include <sstream>
+#include <iomanip>
+#include <iostream>
+
+#ifndef WIN32
+#include <unistd.h>
+#endif
+
+#include <QApplication>
+#include <QFileInfo>
+#include <QDir>
+
+//#include "utilities.h"
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+
+namespace
+{
+  //----------------------------------------------------------------------------
+  inline
+  void
+  GetNameJPEG(const std::string& thePreffix,  
+             const int theIndex,
+             std::string& theName)
+  {
+    using namespace std;
+    ostringstream aStream;
+    aStream<<thePreffix<<"_"<<setw(6)<<setfill('0')<<theIndex<<".jpeg";
+    theName = aStream.str();
+  }
+}
+
+//----------------------------------------------------------------------------
+vtkCxxRevisionMacro(SVTK_Recorder,"$Revision$");
+vtkStandardNewMacro(SVTK_Recorder);
+
+
+//----------------------------------------------------------------------------
+SVTK_Recorder
+::SVTK_Recorder():
+  myRenderWindow(NULL),
+  myState(SVTK_Recorder_Stop),
+  myNbFPS(5.5),
+  myQuality(100),
+  myProgressiveMode(true),
+  myUseSkippedFrames(true),
+  myErrorStatus(0),
+  myCommand(vtkCallbackCommand::New()),
+  myPriority(0.0),
+  myTimeStart(0.0),
+  myFrameIndex(0),
+  myPaused(0),
+  myFilter(vtkWindowToImageFilter::New()),
+  myWriterMgr(new SVTK_ImageWriterMgr),
+  myNbWrittenFrames(0),
+  myNameAVIMaker("jpeg2yuv")
+{
+  myCommand->SetClientData(this); 
+  myCommand->SetCallback(SVTK_Recorder::ProcessEvents);
+}
+
+
+//----------------------------------------------------------------------------
+SVTK_Recorder
+::~SVTK_Recorder()
+{
+  myCommand->Delete();
+  myFilter->Delete();
+  delete myWriterMgr;
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::CheckExistAVIMaker()
+{
+  myErrorStatus = 0;
+  using namespace std;
+  ostringstream aStream;
+  aStream<<"which "<<myNameAVIMaker<<" >& /dev/null";
+  std::string anAVIMakeCheck = aStream.str();
+  int iErr = system(anAVIMakeCheck.c_str());
+  if(iErr != 0)
+    myErrorStatus = 127;
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::SetName(const char* theName)
+{
+  myName = theName;
+}
+
+const char* 
+SVTK_Recorder::Name() const
+{
+  return myName.c_str();
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::SetNbFPS(const double theNbFPS)
+{
+  myNbFPS = theNbFPS;
+}
+
+double
+SVTK_Recorder
+::NbFPS() const
+{
+  return myNbFPS;
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::SetQuality(int theQuality)
+{
+  myQuality = theQuality;
+}
+
+int
+SVTK_Recorder
+::GetQuality() const
+{
+  return myQuality;
+}
+
+
+//----------------------------------------------------------------------------
+void 
+SVTK_Recorder
+::SetRenderWindow(vtkRenderWindow* theRenderWindow)
+{
+  myRenderWindow = theRenderWindow;
+}
+
+vtkRenderWindow* 
+SVTK_Recorder
+::RenderWindow()
+{
+  return myRenderWindow;
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::SetProgressiveMode(bool theProgressiveMode)
+{
+  myProgressiveMode = theProgressiveMode;
+}
+
+bool
+SVTK_Recorder
+::GetProgressiveMode() const
+{
+  return myProgressiveMode;
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::SetUseSkippedFrames(bool theUseSkippedFrames)
+{
+  myUseSkippedFrames = theUseSkippedFrames;
+}
+
+bool
+SVTK_Recorder
+::UseSkippedFrames() const
+{
+  return myUseSkippedFrames;
+}
+
+
+//----------------------------------------------------------------------------
+int
+SVTK_Recorder
+::ErrorStatus() const
+{
+  return myErrorStatus;
+}
+
+int
+SVTK_Recorder
+::State() const
+{
+  return myState;
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::ProcessEvents(vtkObject* vtkNotUsed(theObject), 
+               unsigned long theEvent,
+               void* theClientData, 
+               void* vtkNotUsed(theCallData))
+{
+  if(vtkObject* anObj = reinterpret_cast<vtkObject*>(theClientData)){ 
+    if(SVTK_Recorder* aSelf = dynamic_cast<SVTK_Recorder*>(anObj)){
+      if(theEvent==vtkCommand::EndEvent){
+       if(aSelf->State() == SVTK_Recorder::SVTK_Recorder_Record){
+         aSelf->DoRecord();
+       }
+      }
+    }
+  }
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::Record()
+{
+  if(myState == SVTK_Recorder_Stop){
+    if(myRenderWindow){
+      myState = SVTK_Recorder_Record;
+      myFilter->SetInput(myRenderWindow);
+      myFrameIndex = -1;
+      myNbWrittenFrames = 0;
+      myRenderWindow->RemoveObserver(myCommand);
+      myRenderWindow->AddObserver(vtkCommand::EndEvent,
+                                  myCommand,
+                                  myPriority);
+      myRenderWindow->Render();
+    }
+  }
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::Stop()
+{
+  QApplication::setOverrideCursor( Qt::WaitCursor );
+
+  if(myState == SVTK_Recorder_Record){ 
+    if(!myPaused)
+      DoRecord();
+
+    myWriterMgr->Stop();
+
+    if(myUseSkippedFrames)
+      AddSkippedFrames();
+
+    myFrameIndexes.clear();
+
+    MakeFileAVI();
+  }
+  myState = SVTK_Recorder_Stop;
+  myPaused = 0;
+
+  QApplication::restoreOverrideCursor();
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::Pause()
+{
+  myPaused = myPaused ? 0 : 1;
+  if(myPaused && !myFrameIndexes.empty()){
+    myFrameIndexes.back() *= -1;
+    if(MYDEBUG) cout<<"SVTK_Recorder::Pause - myFrameIndexes.back() = "<<myFrameIndexes.back()<<endl;
+  }
+}
+
+
+//----------------------------------------------------------------------------
+inline 
+int
+GetFrameIndex(double theStartTime,
+             double theFPS)
+{
+  double aTimeNow = vtkTimerLog::GetCurrentTime();
+  double aDelta = aTimeNow - theStartTime;
+  return int(aDelta*theFPS);
+}
+
+void
+SVTK_Recorder
+::DoRecord()
+{
+  if(myPaused)
+    return;
+
+  if(myFrameIndex < 0){
+    myFrameIndex = 0;
+    myTimeStart = vtkTimerLog::GetCurrentTime();
+  }else{
+    int aFrameIndex = GetFrameIndex(myTimeStart,myNbFPS);
+    if(aFrameIndex <= myFrameIndex)
+      return;
+
+    // If there was a "pause" we correct the myTimeStart
+    int aLastFrameIndex = myFrameIndexes.back();
+    if(aLastFrameIndex < 0){
+      myFrameIndexes.back() = abs(myFrameIndexes.back());
+      double aPauseTime = fabs((double)(aFrameIndex - myFrameIndex - 1)) / myNbFPS;
+      if(MYDEBUG) 
+       cout<<"SVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
+         "; aPauseTime = "<<aPauseTime<<endl;
+      myTimeStart += aPauseTime;
+    }
+
+    aFrameIndex = GetFrameIndex(myTimeStart,myNbFPS);
+    if(aFrameIndex <= myFrameIndex)
+      return;
+
+    myFrameIndex = aFrameIndex;
+  }
+
+  myFrameIndexes.push_back(myFrameIndex);
+  if(MYDEBUG) cout<<"SVTK_Recorder::DoRecord - myFrameIndex = "<<myFrameIndex<<endl;
+
+  myRenderWindow->RemoveObserver(myCommand);
+  myFilter->Modified();
+
+  std::string aName;
+  GetNameJPEG(myName,myFrameIndex,aName);
+
+  PreWrite();
+
+  vtkImageData *anImageData = vtkImageData::New(); 
+  anImageData->DeepCopy(myFilter->GetOutput());
+
+  myWriterMgr->StartImageWriter(anImageData,aName,myProgressiveMode,myQuality);
+  myNbWrittenFrames++;
+
+  myRenderWindow->AddObserver(vtkCommand::EndEvent,
+                              myCommand,
+                              myPriority);
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::PreWrite()
+{
+  vtkImageData *anImageData = myFilter->GetOutput();
+  //
+  if(!anImageData){
+    myErrorStatus = 20;
+    return;
+  }
+  anImageData->UpdateInformation();
+  int *anExtent = anImageData->GetWholeExtent();
+  anImageData->SetUpdateExtent(anExtent[0], anExtent[1],
+                              anExtent[2], anExtent[3],
+                              0,0);
+  anImageData->UpdateData();
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::AddSkippedFrames()
+{
+  myErrorStatus = 0;
+
+  if(myFrameIndexes.size() < 2)
+    return;
+
+  size_t anId = 0, anEnd = myFrameIndexes.size() - 1;
+  for(; anId < anEnd; anId++){
+    int aStartIndex = myFrameIndexes[anId];
+    if(aStartIndex < 0)
+      continue;
+
+    int aFinishIndex = abs(myFrameIndexes[anId + 1]);
+    if(aStartIndex + 1 == aFinishIndex)
+      continue;
+
+    std::string anInitialName;
+    std::ostringstream aStream;
+    GetNameJPEG(myName,aStartIndex,anInitialName);
+    for(int anIndex = aStartIndex + 1; anIndex < aFinishIndex; anIndex++){
+      myNbWrittenFrames++;
+      std::string anCurrentName;
+      GetNameJPEG(myName,anIndex,anCurrentName);
+      aStream<<"ln -s "<< anInitialName<<" "<<anCurrentName<<";";
+      if(anIndex + 1 < aFinishIndex)
+       aStream<<" \\";
+      aStream<<endl;
+    }
+    std::string aString(aStream.str());
+    system(aString.c_str());
+    if(MYDEBUG) cout<<"SVTK_Recorder::AddSkippedFrames - "<<aString<<endl;
+  }
+}
+
+
+//----------------------------------------------------------------------------
+void
+SVTK_Recorder
+::MakeFileAVI()
+{
+  myErrorStatus = 0;
+  std::ostringstream aStream;
+  aStream<<myNameAVIMaker<<
+    " -I p"<<
+    " -v 0"<<
+    //" -f "<<int(myNbFPS)<<" "<<
+    " -f "<<myNbFPS<<" "<<
+    " -n "<<myNbWrittenFrames<<" "<<
+    " -j "<<myName<<"_\%06d.jpeg "<<
+    "| yuv2lav"<<
+    " -o "<<myName;
+   
+  std::string aString(aStream.str());
+  myErrorStatus = system(aString.c_str());
+
+  if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<aString<<endl;
+
+  QFileInfo aFileInfo(myName.c_str());
+  QString aDirPath = aFileInfo.absoluteDir().path();
+  QString aBaseName = aFileInfo.fileName();
+  QString aCommand = 
+    QString("(cd ") + aDirPath + 
+    "; ls " +
+    " | egrep '" + aBaseName + "_[0-9]*.jpeg'" +
+    " | xargs rm " +
+    ")";
+
+  if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<(const char*)aCommand.toLatin1()<<endl;
+  system((const char*)aCommand.toLatin1());
+}
diff --git a/src/SVTK/SVTK_Recorder.h b/src/SVTK/SVTK_Recorder.h
new file mode 100755 (executable)
index 0000000..4369747
--- /dev/null
@@ -0,0 +1,159 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef SVTK_RECORDER_H
+#define SVTK_RECORDER_H
+
+#include <list>
+#include <string>
+#include <vector>
+
+#include <vtkObject.h>
+
+class vtkRenderWindow;
+class vtkCallbackCommand;
+class vtkWindowToImageFilter;
+class SVTK_ImageWriterMgr;
+
+class SVTK_Recorder : public vtkObject 
+{
+ protected:
+  enum State {
+    SVTK_Recorder_Unknown=0,
+    SVTK_Recorder_Record,
+    SVTK_Recorder_Stop
+  };
+  
+ public:
+  static SVTK_Recorder *New();
+  vtkTypeRevisionMacro(SVTK_Recorder,vtkObject);
+
+  void
+  SetRenderWindow(vtkRenderWindow* theRenderWindow);
+
+  vtkRenderWindow* 
+  RenderWindow();
+
+  void 
+  SetName(const char *theName);
+
+  const char* 
+  Name() const;
+
+  void
+  SetNbFPS(const double theNbFPS);
+
+  double
+  NbFPS() const;
+
+  void
+  SetQuality(int theQuality);
+
+  int
+  GetQuality() const;
+
+  void
+  SetProgressiveMode(bool theProgressiveMode);
+
+  bool
+  GetProgressiveMode() const;
+
+  void
+  SetUseSkippedFrames(bool theUseSkippedFrames);
+
+  bool
+  UseSkippedFrames() const;
+
+  void
+  Record();
+
+  void
+  Pause();
+
+  void
+  Stop();
+
+  int
+  State() const;
+
+  int  
+  ErrorStatus() const;
+
+  void
+  CheckExistAVIMaker();
+
+protected :
+  SVTK_Recorder();
+
+  ~SVTK_Recorder();
+
+  void
+  DoRecord();
+
+  void
+  MakeFileAVI();
+
+  void
+  AddSkippedFrames();
+
+  void
+  PreWrite();
+
+  static
+  void
+  ProcessEvents(vtkObject* theObject, 
+               unsigned long theEvent,
+               void* theClientData, 
+               void* theCallData);
+
+protected :
+  int myState;
+  int myPaused;
+  int myErrorStatus;
+
+  float myPriority;
+  double myTimeStart;
+
+  int myFrameIndex;
+  int myNbWrittenFrames;
+
+  double myNbFPS;
+  int myQuality;
+  bool myProgressiveMode;
+
+  typedef std::vector<int> TFrameIndexes;
+  TFrameIndexes myFrameIndexes;
+  bool myUseSkippedFrames;
+
+  std::string myName;
+  std::string myNameAVIMaker;
+
+  vtkCallbackCommand *myCommand;
+  vtkRenderWindow *myRenderWindow;
+  vtkWindowToImageFilter *myFilter;
+  SVTK_ImageWriterMgr *myWriterMgr;
+
+private:
+  SVTK_Recorder(const SVTK_Recorder&);  //Not implemented
+  void operator=(const SVTK_Recorder&); //Not implemented
+};
+
+#endif
diff --git a/src/SVTK/SVTK_RecorderDlg.cxx b/src/SVTK/SVTK_RecorderDlg.cxx
new file mode 100644 (file)
index 0000000..3f76101
--- /dev/null
@@ -0,0 +1,211 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "SVTK_RecorderDlg.h"
+#include "SVTK_Recorder.h"
+
+#include <SUIT_FileDlg.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+#include <QtxDoubleSpinBox.h>
+#include <QtxIntSpinBox.h>
+
+#include <QCheckBox>
+#include <QComboBox>
+#include <QGroupBox>
+#include <QKeyEvent>
+#include <QLabel>
+#include <QLayout>
+#include <QLineEdit>
+#include <QPushButton>
+
+/*!
+ * Constructor
+ */
+SVTK_RecorderDlg::SVTK_RecorderDlg( QWidget* theParent, SVTK_Recorder* theRecorder ):
+  QDialog( theParent ),
+  myRecorder( theRecorder )
+{
+  setWindowTitle( tr( "DLG_RECORDER_TITLE" ) );
+
+  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+
+  QVBoxLayout* aTopLayout = new QVBoxLayout( this );
+  aTopLayout->setSpacing( 6 );
+  aTopLayout->setMargin( 6 );
+
+  // Settings
+  QGroupBox* mySettingsBox = new QGroupBox( tr( "SETTINGS" ), this );
+
+  QGridLayout* aSettingsLayout = new QGridLayout( mySettingsBox );
+  aSettingsLayout->setSpacing( 6 );
+  aSettingsLayout->setMargin( 11 );
+
+  QLabel* aFileNameLabel = new QLabel( tr( "FILE_NAME" ), mySettingsBox );
+  myFileNameLineEdit = new QLineEdit( mySettingsBox );
+  myFileNameLineEdit->setMinimumWidth( 250 );
+  myFileNameLineEdit->setReadOnly( true );
+
+  QLabel* aRecordingModeLabel = new QLabel( tr( "RECORDING_MODE" ), mySettingsBox );
+  myRecordingModeComboBox = new QComboBox( mySettingsBox );
+  myRecordingModeComboBox->addItem( tr( "SKIPPED_FRAMES" ) );
+  myRecordingModeComboBox->addItem( tr( "ALL_DISLPAYED_FRAMES" ) );
+  myRecordingModeComboBox->setCurrentIndex( aResourceMgr->integerValue( "VTKViewer", "recorder_mode", 1 ) );
+
+  QLabel* aFPSLabel = new QLabel( tr( "FPS" ), mySettingsBox );
+  myFPSSpinBox = new QtxDoubleSpinBox( 0.1, 100.0, 1.0, mySettingsBox );
+  myFPSSpinBox->setValue( aResourceMgr->doubleValue( "VTKViewer", "recorder_fps", 10.0 ) );
+
+  QLabel* aQualityLabel = new QLabel( tr( "QUALITY" ), mySettingsBox );
+  myQualitySpinBox = new QtxIntSpinBox( 1, 100, 1, mySettingsBox );
+  myQualitySpinBox->setValue( aResourceMgr->integerValue( "VTKViewer", "recorder_quality", 80 ) );
+
+  myProgressiveCheckBox = new QCheckBox( tr( "PROGRESSIVE" ), mySettingsBox );
+  myProgressiveCheckBox->setChecked( aResourceMgr->booleanValue( "VTKViewer", "recorder_progressive", false ) );
+
+  aSettingsLayout->addWidget( aFileNameLabel, 0, 0 );
+  aSettingsLayout->addWidget( myFileNameLineEdit, 1, 0, 1, 2 );
+  aSettingsLayout->addWidget( aRecordingModeLabel, 2, 0 );
+  aSettingsLayout->addWidget( myRecordingModeComboBox, 2, 1 );
+  aSettingsLayout->addWidget( aFPSLabel, 3, 0 );
+  aSettingsLayout->addWidget( myFPSSpinBox, 3, 1 );
+  aSettingsLayout->addWidget( aQualityLabel, 4, 0 );
+  aSettingsLayout->addWidget( myQualitySpinBox, 4, 1 );
+  aSettingsLayout->addWidget( myProgressiveCheckBox, 5, 0 );
+
+  aTopLayout->addWidget( mySettingsBox );
+
+  // Start / Close
+  QGroupBox* CommonGroup = new QGroupBox( this );
+  QGridLayout* CommonGroupLayout = new QGridLayout( CommonGroup );
+  CommonGroupLayout->setAlignment( Qt::AlignTop );
+  CommonGroupLayout->setSpacing( 6 );
+  CommonGroupLayout->setMargin( 11 );
+
+  QPushButton* aStartButton = new QPushButton( tr( "START" ), CommonGroup );
+  aStartButton->setAutoDefault( true );
+  aStartButton->setDefault( true );
+  CommonGroupLayout->addWidget( aStartButton, 0, 0 );
+  CommonGroupLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
+
+  QPushButton* aCloseButton = new QPushButton( tr( "CLOSE" ), CommonGroup );
+  aCloseButton->setAutoDefault( true );
+  CommonGroupLayout->addWidget( aCloseButton, 0, 2 );
+
+  //QPushButton* aHelpButton = new QPushButton( tr( "HELP" ), CommonGroup );
+  //aHelpButton->setAutoDefault( true );
+  //CommonGroupLayout->addWidget( aHelpButton, 0, 3 );
+
+  aTopLayout->addWidget( CommonGroup );
+
+  connect( aStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) );
+  connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) );
+  //connect( aHelpButton,  SIGNAL( clicked() ), this, SLOT( onHelp() ) );
+}
+
+SVTK_RecorderDlg::~SVTK_RecorderDlg()
+{
+}
+
+void SVTK_RecorderDlg::onStart()
+{
+  if( myFileName.isNull() )
+    return;
+
+  myRecorder->SetName( (const char*)myFileName.toLatin1() );
+
+  myRecorder->SetUseSkippedFrames( myRecordingModeComboBox->currentIndex() == 0 );
+  myRecorder->SetNbFPS( myFPSSpinBox->value() );
+  myRecorder->SetQuality( myQualitySpinBox->value() );
+  myRecorder->SetProgressiveMode( myProgressiveCheckBox->isChecked() );
+
+  accept();
+
+}
+
+void SVTK_RecorderDlg::onClose()
+{
+  reject();
+}
+
+void SVTK_RecorderDlg::onHelp()
+{
+  /*
+  QString aHelpFileName = "animation_in_gauss_viewer.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+  else {
+               QString platform;
+#ifdef WIN32
+               platform = "winapplication";
+#else
+               platform = "application";
+#endif
+    SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
+                            QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                            arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
+  }
+  */
+}
+
+bool SVTK_RecorderDlg::onBrowseFile()
+{
+  QStringList aFilter;
+  aFilter.append( tr( "FLT_AVI_FILES" ) );
+  aFilter.append( tr( "FLT_ALL_FILES" ) );
+
+  QString aFileName = SUIT_FileDlg::getFileName( this, getenv( "HOME" ), aFilter,
+                                                tr( "FILE_NAME" ), false );
+
+  if( aFileName.isNull() )
+    return false;
+
+  myFileName = aFileName;
+  myFileNameLineEdit->setText( aFileName.section( '/', -1 ) );
+
+  return true;
+}
+
+int SVTK_RecorderDlg::exec()
+{
+  if( !onBrowseFile() )
+  {
+    reject();
+    return 0;
+  }
+  return QDialog::exec();
+}
+
+void SVTK_RecorderDlg::keyPressEvent( QKeyEvent* e )
+{
+  QDialog::keyPressEvent( e );
+  if ( e->isAccepted() )
+    return;
+
+  if ( e->key() == Qt::Key_F1 )
+    {
+      e->accept();
+      onHelp();
+    }
+}
diff --git a/src/SVTK/SVTK_RecorderDlg.h b/src/SVTK/SVTK_RecorderDlg.h
new file mode 100644 (file)
index 0000000..5f14683
--- /dev/null
@@ -0,0 +1,74 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef SVTK_RECORDERDLG_H
+#define SVTK_RECORDERDLG_H
+
+#include <QDialog>
+
+class QCheckBox;
+class QComboBox;
+class QGroupBox;
+class QLCDNumber;
+class QLineEdit;
+class QPushButton;
+class QTimer;
+
+class QtxDoubleSpinBox;
+class QtxIntSpinBox;
+
+class SVTK_Recorder;
+
+class SVTK_RecorderDlg : public QDialog
+{
+  Q_OBJECT
+
+public:
+  SVTK_RecorderDlg( QWidget*, SVTK_Recorder* );
+  ~SVTK_RecorderDlg();
+
+  int              exec();
+
+  QString          fileName() const { return myFileName; }
+
+private:
+  virtual void     keyPressEvent( QKeyEvent* );
+
+protected slots:
+  void             onStart();
+  void             onClose();
+  void             onHelp();
+
+  bool             onBrowseFile();
+
+private:
+  SVTK_Recorder*   myRecorder;
+  QString          myFileName;
+
+  QLineEdit*       myFileNameLineEdit;
+
+  QComboBox*        myRecordingModeComboBox;
+  QtxDoubleSpinBox* myFPSSpinBox;
+  QtxIntSpinBox*    myQualitySpinBox;
+  QCheckBox*        myProgressiveCheckBox;
+};
+
+#endif
index fb5ced7f2d69f69b7189c30c00af63869f90ff85..1030e3db388b46e1a629e305cee3aced9dcdea19 100644 (file)
@@ -1,30 +1,29 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_RectPicker.cxx
 //  Author : 
 //  Module : SALOME
-
+//
 #include "SVTK_RectPicker.h"
 
 #include <set>
@@ -261,7 +260,7 @@ namespace
     // and handle the transformation ourselves.
     vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
     aMatrix->DeepCopy(theRenderer->GetActiveCamera()->
-                     GetCompositePerspectiveTransformMatrix(1,0,1));
+                     GetCompositePerspectiveTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) );
 
     for(vtkIdType aCellId = 0; aCellId < aNumCells; aCellId++){
       vtkCell* aCell = theInput->GetCell(aCellId);
index 3a6576edb04ec5eef0dbfbb9d3ffb230fc941978..a7c2a3934721356f2a24ae80d7cdb226c334f368 100644 (file)
@@ -1,30 +1,29 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_RectPicker.h
 //  Author : 
 //  Module : SALOME
-
+//
 #ifndef __SVTK_RectPicker_h
 #define __SVTK_RectPicker_h
 
index 647fbc5548f9f6f30cba258da30982a255c21bb8..5493554750fb3faf98e0680230fe2deaa7ed679a 100644 (file)
@@ -1,39 +1,46 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SVTK_RenderWindowInteractor.h"
-#include "SVTK_GenericRenderWindowInteractor.h"
+//#include "SVTK_GenericRenderWindowInteractor.h"
 
 #include "SVTK_InteractorStyle.h"
 #include "SVTK_Renderer.h"
 #include "SVTK_Functor.h"
 #include "SALOME_Actor.h"
 
+// QT Includes
+// Put Qt includes before the X11 includes which #define the symbol None
+// (see SVTK_SpaceMouse.h) to avoid the compilation error.
+#ifndef WIN32
+# include <QX11Info>
+#endif
+#include <QMouseEvent>
+
 #include "SVTK_SpaceMouse.h" 
 #include "SVTK_Event.h" 
 
 #include <vtkPicker.h>
 #include <vtkCamera.h>
 
-// QT Includes
-#include <qtimer.h>
-#include <qapplication.h>
-#include <qcolordialog.h>
-#include <qpaintdevice.h>
-
 using namespace std;
 
 static bool GENERATE_SUIT_EVENTS = false;
@@ -67,16 +68,21 @@ static bool FOCUS_UNDER_MOUSE = false;
 QVTK_RenderWindowInteractor
 ::QVTK_RenderWindowInteractor(QWidget* theParent, 
                              const char* theName):
-  QWidget(theParent,theName,Qt::WNoAutoErase),
+  QWidget(theParent),
   myRenderWindow(vtkRenderWindow::New())
 {
+  setAttribute( Qt::WA_PaintOnScreen );
+  setAttribute( Qt::WA_NoSystemBackground );
+
+  setObjectName(theName);
+
   setMouseTracking(true);
 
   myRenderWindow->Delete();
   myRenderWindow->DoubleBufferOn();
 
-#ifndef WNT
-  myRenderWindow->SetDisplayId((void*)x11Display());
+#ifndef WIN32
+  myRenderWindow->SetDisplayId((void*)QX11Info::display());
 #endif
   myRenderWindow->SetWindowId((void*)winId());
 }
@@ -106,7 +112,7 @@ QVTK_RenderWindowInteractor
 #ifndef WIN32
   SVTK_SpaceMouse* aSpaceMouse = SVTK_SpaceMouse::getInstance();
   if ( aSpaceMouse && aSpaceMouse->isSpaceMouseOn() )
-    aSpaceMouse->close( x11Display() );
+    aSpaceMouse->close( QX11Info::display() );
 #endif
 }
 
@@ -240,8 +246,8 @@ QVTK_RenderWindowInteractor
 {
   GetDevice()->SetEventInformationFlipY(event->x(), 
                                        event->y(),
-                                       event->state() & ControlButton,
-                                       event->state() & ShiftButton);
+                                       event->modifiers() & Qt::ControlModifier,
+                                       event->modifiers() & Qt::ShiftModifier);
   GetDevice()->MouseMoveEvent();
 }
 
@@ -255,13 +261,13 @@ QVTK_RenderWindowInteractor
 {
   GetDevice()->SetEventInformationFlipY(event->x(), 
                                        event->y(),
-                                       event->state() & ControlButton,
-                                       event->state() & ShiftButton);
-  if( event->button() & LeftButton )
+                                       event->modifiers() & Qt::ControlModifier,
+                                       event->modifiers() & Qt::ShiftModifier);
+  if( event->button() & Qt::LeftButton )
     GetDevice()->LeftButtonPressEvent();
-  else if( event->button() & MidButton )
+  else if( event->button() & Qt::MidButton )
     GetDevice()->MiddleButtonPressEvent();
-  else if( event->button() & RightButton )
+  else if( event->button() & Qt::RightButton )
     GetDevice()->RightButtonPressEvent();
 }
 
@@ -275,14 +281,14 @@ QVTK_RenderWindowInteractor
 {
   GetDevice()->SetEventInformationFlipY(event->x(), 
                                        event->y(),
-                                       event->state() & ControlButton,
-                                       event->state() & ShiftButton);
+                                       event->modifiers() & Qt::ControlModifier,
+                                       event->modifiers() & Qt::ShiftModifier);
 
-  if( event->button() & LeftButton )
+  if( event->button() & Qt::LeftButton )
     GetDevice()->LeftButtonReleaseEvent();
-  else if( event->button() & MidButton )
+  else if( event->button() & Qt::MidButton )
     GetDevice()->MiddleButtonReleaseEvent();
-  else if( event->button() & RightButton )
+  else if( event->button() & Qt::RightButton )
     GetDevice()->RightButtonReleaseEvent();
 }
 
@@ -303,7 +309,7 @@ void
 QVTK_RenderWindowInteractor
 ::wheelEvent( QWheelEvent* event )
 {
-  setActiveWindow();
+  activateWindow();
   setFocus();
 }
 
@@ -315,8 +321,8 @@ void
 QVTK_RenderWindowInteractor
 ::keyPressEvent( QKeyEvent* event ) 
 {
-  GetDevice()->SetKeyEventInformation(event->state() & ControlButton,
-                                     event->state() & ShiftButton,
+  GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier,
+                                     event->modifiers() & Qt::ShiftModifier,
                                      event->key());
   GetDevice()->KeyPressEvent();
   GetDevice()->CharEvent();
@@ -329,8 +335,8 @@ void
 QVTK_RenderWindowInteractor
 ::keyReleaseEvent( QKeyEvent * event ) 
 {
-  GetDevice()->SetKeyEventInformation(event->state() & ControlButton,
-                                     event->state() & ShiftButton,
+  GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier,
+                                     event->modifiers() & Qt::ShiftModifier,
                                      event->key());
   GetDevice()->KeyReleaseEvent();
 }
@@ -344,7 +350,7 @@ QVTK_RenderWindowInteractor
 ::enterEvent( QEvent* event )
 {
   if(FOCUS_UNDER_MOUSE){
-    setActiveWindow();
+    activateWindow();
     setFocus();
   }
   GetDevice()->EnterEvent();
@@ -378,9 +384,9 @@ QVTK_RenderWindowInteractor
   {
     if ( !aSpaceMouse->isSpaceMouseOn() )
       // initialize 3D space mouse driver 
-      aSpaceMouse->initialize( x11Display(), winId() );
+      aSpaceMouse->initialize( QX11Info::display(), winId() );
     else
-      aSpaceMouse->setWindow( x11Display(), winId() );
+      aSpaceMouse->setWindow( QX11Info::display(), winId() );
   }
 #endif
 }
@@ -399,7 +405,7 @@ QVTK_RenderWindowInteractor
   // unregister set space mouse events receiver
   SVTK_SpaceMouse* aSpaceMouse = SVTK_SpaceMouse::getInstance();
   if ( aSpaceMouse && aSpaceMouse->isSpaceMouseOn() )
-    aSpaceMouse->setWindow( x11Display(), 0 );
+    aSpaceMouse->setWindow( QX11Info::display(), 0 );
 #endif
 }
 
@@ -409,10 +415,10 @@ QVTK_RenderWindowInteractor
 /*!
   To handle native Win32 events (from such devices as SpaceMouse)
 */
-bool QVTK_RenderWindowInteractor::winEvent( MSG* msg )
+bool QVTK_RenderWindowInteractor::winEvent( MSG* msg, long* result )
 {
   // TODO: Implement event handling for SpaceMouse
-  return QWidget::winEvent( msg );
+  return QWidget::winEvent( msg, result);
 }
 
 #else
@@ -430,7 +436,7 @@ QVTK_RenderWindowInteractor
     if ( aSpaceMouse->isSpaceMouseOn() && xEvent->type == ClientMessage )
     {
       SVTK_SpaceMouse::MoveEvent anEvent;
-      int type = aSpaceMouse->translateEvent( x11Display(), xEvent, &anEvent, 1.0, 1.0 );
+      int type = aSpaceMouse->translateEvent( QX11Info::display(), xEvent, &anEvent, 1.0, 1.0 );
       switch ( type )
       {
       case SVTK_SpaceMouse::SpaceMouseMove:
@@ -706,8 +712,22 @@ void
 SVTK_RenderWindowInteractor
 ::mouseReleaseEvent( QMouseEvent *event )
 {
+  bool aRightBtn = event->button() == Qt::RightButton;
+  bool isOperation = false;
+  if( aRightBtn && GetInteractorStyle()) {
+    SVTK_InteractorStyle* style = dynamic_cast<SVTK_InteractorStyle*>( GetInteractorStyle() );
+    if ( style )
+      isOperation = style->CurrentState() != VTK_INTERACTOR_STYLE_CAMERA_NONE;
+  }
+
   QVTK_RenderWindowInteractor::mouseReleaseEvent(event);
 
+  if ( aRightBtn && !isOperation && !( event->modifiers() & Qt::ControlModifier ) &&
+       !( event->modifiers() & Qt::ShiftModifier ) ) {
+    QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
+                              event->pos(), event->globalPos() );
+    emit contextMenuRequested( &aEvent );
+  }
   if(GENERATE_SUIT_EVENTS)
     emit MouseButtonReleased( event );
 }
@@ -771,13 +791,3 @@ SVTK_RenderWindowInteractor
     emit KeyReleased( event );
 }
 
-/*!
-  Custom context menu event handler
-*/
-void
-SVTK_RenderWindowInteractor
-::contextMenuEvent( QContextMenuEvent* event )
-{
-  if( !( event->state() & KeyButtonMask ) )
-    emit contextMenuRequested( event );
-}
index dd6a525027712eb317fbbd0035323b7a0444af83..53aabeb2e1c211afcbf8d878ba665df037c9f54b 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_RenderWindowInteractor_h
 #define SVTK_RenderWindowInteractor_h
 
@@ -33,7 +32,7 @@
 #include "SVTK_Selection.h"
 
 #include <vtkSmartPointer.h>
-#include <qwidget.h>
+#include <QWidget>
 
 // undefining min and max because CASCADE's defines them and
 // it clashes with std::min(), std::max()
@@ -122,7 +121,7 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget
 
   //! To handle native events (from such devices as SpaceMouse)
 #ifdef WIN32
-  virtual bool winEvent( MSG* );
+  virtual bool winEvent( MSG*, long* );
 #else
   virtual bool x11Event( XEvent *e );
 #endif
@@ -221,7 +220,6 @@ class SVTK_EXPORT SVTK_RenderWindowInteractor: public QVTK_RenderWindowInteracto
   virtual void wheelEvent( QWheelEvent* );
   virtual void keyPressEvent( QKeyEvent* );
   virtual void keyReleaseEvent( QKeyEvent* );
-  virtual void contextMenuEvent( QContextMenuEvent * e );
 
   void
   SetRenderer(SVTK_Renderer *theRenderer);
index cab5ca695e67649dce67d9cff6276d5d3f4bd29f..369520b1ece46540132695bffbfee35a805758e3 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   :
 //  Author :
 //  Module :
 //  $Header$
-
+//
 #include "SVTK_Renderer.h"
 
 #include "SVTK_Trihedron.h"
@@ -309,6 +308,13 @@ SVTK_Renderer
 {
   myTransform->SetMatrixScale( theScale[0], theScale[1], theScale[2] );
   AdjustActors();
+
+  vtkActorCollection* anActors = GetDevice()->GetActors();
+  anActors->InitTraversal();
+  while(vtkActor* anAct = anActors->GetNextActor())
+    if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct))
+      if(anActor->isHighlighted() && !anActor->IsInfinitive())
+       anActor->highlight(true);
 }
 
 /*!
index 5c24cefa13b315a4a25202a2deaa174d9bd751c5..2d53e263f22d040bde73c0d64c47ffec7e58f28a 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_Renderer_h
 #define SVTK_Renderer_h
 
index 4b0b4f55d6266bf64cef88b523264fb394361800..8e087f4caac56d5d5ac68cecd07eedfce959424e 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Selection.h
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_SELECTION_H
 #define SVTK_SELECTION_H
 
index 75d01316f0ddbc9dd9b824c3725af908d3adaf7f..22fc91e5e3d34e00883d524e67379be7f75c465e 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SVTK_SelectionEvent.h
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_SELECTIONEVENT_H
 #define SVTK_SELECTIONEVENT_H
 
index fe5a930470c1bbf2c9585722dacbe98c23e1624a..6bbf7d15eccf6548685e32f6633b1fe01fedeac1 100644 (file)
@@ -1,36 +1,39 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Selection.cxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
-
+//
 #include "SVTK_SelectorDef.h"
 
+#include <VTKViewer_Filter.h>
+
 #include "SALOME_Actor.h"
 
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
 
@@ -545,15 +548,24 @@ SALOME_Actor*
 SVTK_SelectorDef
 ::Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const
 {
-  myCellPicker->Pick(theEvent->myX,
-                    theEvent->myY, 
-                    0.0,
-                    theRenderer);
-  
-  vtkActorCollection* aListActors = myCellPicker->GetActors();
-  SALOME_Actor* anActor = GetLastSALOMEActor(aListActors);
+  bool anAdvancedSelectionAlgorithm = true;
+  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+  if ( aResourceMgr )
+    anAdvancedSelectionAlgorithm = aResourceMgr->booleanValue( "VTKViewer", "use_advanced_selection_algorithm", true );
+
+  SALOME_Actor* anActor = NULL;
+  vtkActorCollection* aListActors = NULL;
+  if ( anAdvancedSelectionAlgorithm ) {
+    myCellPicker->Pick(theEvent->myX,
+                      theEvent->myY, 
+                      0.0,
+                      theRenderer);
   
-  if (! anActor) {
+    aListActors = myCellPicker->GetActors();
+    anActor = GetLastSALOMEActor(aListActors);
+  }
+
+  if ( !anActor ) {
     myPicker->Pick(theEvent->myX,
                   theEvent->myY, 
                   0.0,
index f72ba8adc042bf24618eba25dad43bf51d8afb14..d6d3bfc509b3159ed3f34a81279288dc2c1403d4 100644 (file)
@@ -1,51 +1,48 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Selection.h
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_SELECTOR_H
 #define SVTK_SELECTOR_H
 
 #include "SVTK.h"
 #include "SVTK_Selection.h"
 #include "SALOME_ListIO.hxx"
-#include "VTKViewer_Filter.h"
-#include "SALOME_InteractiveObject.hxx"
 
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
 
 #include <vtkObject.h>
 
-class SALOME_Actor;
+class Handle(VTKViewer_Filter);
 
+class SALOME_Actor;
 class SVTK_SelectionEvent;
-
 class vtkRenderer;
-
+class Handle(SALOME_InteractiveObject);
 
 //! Define an abstract interface for selection in SVTK package
 /*!
@@ -214,7 +211,7 @@ public:
   //----------------------------------------------------------------------------
   virtual
   SALOME_Actor*
-  Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const =0;
+  Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const = 0;
 
   virtual
   void
index 634d7297bf2a62b4539877823a9c41317038b920..bbb513c772d63b5b7fbe0974a9ae40f84b83be14 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Selection.h
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_SELECTORDEF_H
 #define SVTK_SELECTORDEF_H
 
 #include <TColStd_MapOfInteger.hxx>
 #include <vtkSmartPointer.h>
 
+#include "SALOME_InteractiveObject.hxx"
+
 #include "SVTK_Selector.h"
 
 class SALOME_Actor;
 
 class SVTK_Viewer;
 class SVTK_ViewWindow;
-
 class vtkPicker;
 class vtkCellPicker;
 
index d98efaa21ab4571c58773f3e7b630af0171dfb08..f7d2fafd3426c6306f84cd9b5457504621d7e07e 100755 (executable)
@@ -1,33 +1,32 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SVTK_SetRotationPointDlg.h"
-#include "SVTK_MainWindow.h"
+#include "SVTK_ViewWindow.h"
 #include "SVTK_RenderWindowInteractor.h"
 #include "SVTK_Event.h"
 #include "SVTK_InteractorStyle.h"
 
 #include "QtxAction.h"
 
-#include <qlineedit.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qvalidator.h>
-#include <qbuttongroup.h>
-#include <qobjectlist.h>
-#include <qcheckbox.h>
-#include <qhbox.h>
+#include <QLineEdit>
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QDoubleValidator>
+#include <QCheckBox>
 
 #include <vtkCallbackCommand.h>
 
@@ -56,7 +52,7 @@ using namespace std;
 */
 SVTK_SetRotationPointDlg
 ::SVTK_SetRotationPointDlg(QtxAction* theAction,
-                          SVTK_MainWindow* theParent,
+                          SVTK_ViewWindow* theParent,
                           const char* theName):
   SVTK_DialogBase(theAction,
                  theParent, 
@@ -66,7 +62,7 @@ SVTK_SetRotationPointDlg
   myEventCallbackCommand(vtkCallbackCommand::New()),
   myRWInteractor(theParent->GetInteractor())
 {
-  setCaption(tr("DLG_TITLE"));
+  setWindowTitle(tr("DLG_TITLE"));
   setSizeGripEnabled(TRUE);
 
   // Create layout for this dialog
@@ -75,35 +71,42 @@ SVTK_SetRotationPointDlg
   layoutDlg->setMargin(11);
 
   // Create check box "Use Bounding Box Center"
-  QHBox* aCheckBox = new QHBox(this);
+  QHBoxLayout* aCheckBox = new QHBoxLayout;
 
-  myIsBBCenter = new QCheckBox(tr("USE_BBCENTER"), aCheckBox);
+  myIsBBCenter = new QCheckBox(tr("USE_BBCENTER"));
   myIsBBCenter->setChecked(true);
+  aCheckBox->addWidget(myIsBBCenter);
   connect(myIsBBCenter, SIGNAL(stateChanged(int)), SLOT(onBBCenterChecked()));
 
   // Create croup button with radio buttons
-  myGroupSelButton = new QButtonGroup(2,Qt::Vertical,"",this);
-  myGroupSelButton->setMargin(11);
+  myGroupBoxSel = new QGroupBox( "", this );
+  QVBoxLayout *vbox = new QVBoxLayout( myGroupBoxSel );
+  vbox->setMargin(11);
+  vbox->addStretch(1);
   
   // Create "Set to Origin" button
-  myToOrigin = new QPushButton(myGroupSelButton);
+  myToOrigin = new QPushButton(myGroupBoxSel);
   myToOrigin->setText(tr("LBL_TOORIGIN"));
+  vbox->addWidget(myToOrigin);
   connect(myToOrigin, SIGNAL(clicked()), this, SLOT(onToOrigin()));
 
   // Create "Select Point from View" button
-  mySelectPoint = new QPushButton(myGroupSelButton);
+  mySelectPoint = new QPushButton(myGroupBoxSel);
   mySelectPoint->setText(tr("LBL_SELECTPOINT"));
-  mySelectPoint->setToggleButton(true);
+  mySelectPoint->setCheckable(true);
+  vbox->addWidget(mySelectPoint);
   connect(mySelectPoint, SIGNAL(clicked()), this, SLOT(onSelectPoint()));
 
   // Create croup box with grid layout
-  myGroupBoxCoord = new QGroupBox(this, "GroupBox");
+  myGroupBoxCoord = new QGroupBox(this);
+  myGroupBoxCoord->setObjectName("GroupBox");
   QHBoxLayout* aHBoxLayout = new QHBoxLayout(myGroupBoxCoord);
   aHBoxLayout->setMargin(11);
   aHBoxLayout->setSpacing(6);
 
   // "X" coordinate
-  QLabel* TextLabelX = new QLabel (tr("LBL_X"), myGroupBoxCoord, "TextLabelX");
+  QLabel* TextLabelX = new QLabel (tr("LBL_X"), myGroupBoxCoord );
+  TextLabelX->setObjectName("TextLabelX");
   TextLabelX->setFixedWidth(15);
   myX = new QLineEdit(myGroupBoxCoord);
   myX->setValidator(new QDoubleValidator(myX));
@@ -111,7 +114,8 @@ SVTK_SetRotationPointDlg
   connect(myX, SIGNAL(textChanged(const QString&)), this, SLOT(onCoordChanged()));
 
   // "Y" coordinate
-  QLabel* TextLabelY = new QLabel (tr("LBL_Y"), myGroupBoxCoord, "TextLabelY");
+  QLabel* TextLabelY = new QLabel (tr("LBL_Y"), myGroupBoxCoord );
+  TextLabelY->setObjectName("TextLabelY");
   TextLabelY->setFixedWidth(15);
   myY = new QLineEdit(myGroupBoxCoord);
   myY->setValidator(new QDoubleValidator(myY));
@@ -119,7 +123,8 @@ SVTK_SetRotationPointDlg
   connect(myY, SIGNAL(textChanged(const QString&)), this, SLOT(onCoordChanged()));
 
   // "Z" coordinate
-  QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), myGroupBoxCoord, "TextLabelZ");
+  QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), myGroupBoxCoord );
+  TextLabelZ->setObjectName("TextLabelZ");
   TextLabelZ->setFixedWidth(15);
   myZ = new QLineEdit(myGroupBoxCoord);
   myZ->setValidator(new QDoubleValidator(myZ));
@@ -140,7 +145,8 @@ SVTK_SetRotationPointDlg
   aHBoxLayout2->setMargin(11);
   aHBoxLayout2->setSpacing(6);
 
-  QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox, "m_bClose");
+  QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox );
+  m_bClose->setObjectName("m_bClose");
   m_bClose->setAutoDefault(TRUE);
   m_bClose->setFixedSize(m_bClose->sizeHint());
   connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose()));
@@ -149,12 +155,12 @@ SVTK_SetRotationPointDlg
   aHBoxLayout2->addWidget(m_bClose);
 
   // Layout top level widgets
-  layoutDlg->addWidget(aCheckBox,0,0);
-  layoutDlg->addWidget(myGroupSelButton,1,0);
+  layoutDlg->addLayout(aCheckBox,0,0);
+  layoutDlg->addWidget(myGroupBoxSel,1,0);
   layoutDlg->addWidget(myGroupBoxCoord,2,0);
   layoutDlg->addWidget(aGroupBox,3,0);
   
-  setEnabled(myGroupSelButton,!myIsBBCenter->isChecked());
+  setEnabled(myGroupBoxSel,!myIsBBCenter->isChecked());
   setEnabled(myGroupBoxCoord,!myIsBBCenter->isChecked());
 
   this->resize(400, this->sizeHint().height());
@@ -240,10 +246,11 @@ void
 SVTK_SetRotationPointDlg
 ::setEnabled(QGroupBox* theGrp, const bool theState)
 {
-  QObjectList aChildren(*theGrp->children());
+  QObjectList aChildren(theGrp->children());
   QObject* anObj;
-  for(anObj = aChildren.first(); anObj !=0; anObj = aChildren.next())
+  for(int i = 0; i < aChildren.size(); i++)
   {
+    anObj = aChildren.at(i);
     if (anObj !=0 && anObj->inherits("QLineEdit"))
       ((QLineEdit*)anObj)->setReadOnly(!theState);
     if (anObj !=0 && anObj->inherits("QPushButton"))
@@ -256,12 +263,12 @@ void
 SVTK_SetRotationPointDlg
 ::onBBCenterChecked()
 {
-  setEnabled(myGroupSelButton,!myIsBBCenter->isChecked());
+  setEnabled(myGroupBoxSel,!myIsBBCenter->isChecked());
   setEnabled(myGroupBoxCoord,!myIsBBCenter->isChecked());
   
   if ( myIsBBCenter->isChecked() )
   { 
-    if ( mySelectPoint->state() == QButton::On )
+    if ( mySelectPoint->isChecked() )
       mySelectPoint->toggle();
     // activate mode : the rotation point is the center of the bounding box
     // send the data to the SVTK_InteractorStyle: set the type of the rotation point
@@ -280,7 +287,7 @@ void
 SVTK_SetRotationPointDlg
 ::onToOrigin()
 {
-  if ( mySelectPoint->state() == QButton::On )
+  if ( mySelectPoint->isChecked() )
     mySelectPoint->toggle();
   myX->setText(QString::number(0.0));
   myY->setText(QString::number(0.0));
@@ -291,7 +298,7 @@ void
 SVTK_SetRotationPointDlg
 ::onSelectPoint()
 {
-  if ( mySelectPoint->state() == QButton::On )
+  if ( mySelectPoint->isChecked() )
     myMainWindow->activateStartPointSelection();
   else
     mySelectPoint->toggle();
@@ -302,7 +309,7 @@ SVTK_SetRotationPointDlg
 ::onCoordChanged()
 {
   if ( !myIsBBCenter->isChecked() ) {
-    if ( mySelectPoint->state() == QButton::On
+    if ( mySelectPoint->isChecked()
         &&
         ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
       mySelectPoint->toggle();
index a598affc7b3633c2316f2f16797a79d12bcbc75b..c1611cbf581ae01d3f5058d12e08b565c3462633 100755 (executable)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_SETROTATIONPOINTDLG_H
 #define SVTK_SETROTATIONPOINTDLG_H
 
@@ -35,7 +34,7 @@
 
 #include <vtkSmartPointer.h>
 
-class SVTK_MainWindow;
+class SVTK_ViewWindow;
 class SVTK_RenderWindowInteractor;
 
 class QtxAction;
@@ -43,7 +42,6 @@ class QtxAction;
 class QLineEdit;
 class QPushButton;
 class QGroupBox;
-class QButtonGroup;
 class QCheckBox;
 
 class vtkCallbackCommand;
@@ -55,7 +53,7 @@ class SVTK_EXPORT SVTK_SetRotationPointDlg : public SVTK_DialogBase
 
 public:
   SVTK_SetRotationPointDlg(QtxAction* theAction,
-                          SVTK_MainWindow* theParent,
+                          SVTK_ViewWindow* theParent,
                           const char* theName);
 
   ~SVTK_SetRotationPointDlg();
@@ -64,13 +62,13 @@ public:
   bool IsFirstShown();
   
 protected:
-  SVTK_MainWindow *myMainWindow;
+  SVTK_ViewWindow *myMainWindow;
   SVTK_RenderWindowInteractor* myRWInteractor;
   bool myIsObserverAdded;
   
   QCheckBox*    myIsBBCenter;
 
-  QButtonGroup* myGroupSelButton;
+  QGroupBox   * myGroupBoxSel;
   QPushButton*  myToOrigin;
   QPushButton*  mySelectPoint;
 
index 7d858a7809b2aff7fe0b5152e0f2227eb5ef3c5c..c8a99ee07691fcad1cc2605040ea90406cc83a83 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_SpaceMouse.cxx
 //  Author : Alexander SLADKOV
 //  Module : SALOME
 //  $Header$
-
+//
 #include <string.h>
 #include <math.h>
 #include <stdio.h>
index f920bf44a9ed4e5d273f93a60a89b5058b31595a..2d8e289589a7c74113e21133ac8ad596935cc168 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_SpaceMouse.h
 //  Author : Alexander SLADKOV
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_SpaceMouse_h
 #define SVTK_SpaceMouse_h
 
index 45751cfec523a7e16a2337c203dd95a162b3e113..ed6ad07d130369c259a89f298fd2b83edfd3ae8d 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SVTK_Trihedron.h"
 #include "SALOME_Actor.h"
index 3f410cde1210a790949166ab7ceb2fc49df805bc..847301c72561c7d60d8f0864fa0be65cab8d1c8a 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SVTK_TRIHEDRON_H
 #define SVTK_TRIHEDRON_H
index 7f31fb2b93354d63514ae8d25006e2866bb5bbf2..eaf1be83bdb5a3e60a088afd79be9afbd31bd902 100644 (file)
@@ -1,48 +1,47 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SVTK_UpdateRateDlg.h"
 
-#include "SVTK_MainWindow.h"
+#include "SVTK_ViewWindow.h"
 #include "SVTK_RenderWindowInteractor.h"
 #include "VTKViewer_Algorithm.h"
 #include "SALOME_Actor.h"
 
-#include "QtxDblSpinBox.h"
+#include "QtxDoubleSpinBox.h"
 #include "QtxAction.h"
 
 #include <sstream>
 
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qlineedit.h>
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QLineEdit>
 
 #include <vtkGenericRenderWindowInteractor.h>
 #include <vtkCallbackCommand.h>
@@ -165,7 +164,7 @@ namespace
 */
 SVTK_UpdateRateDlg
 ::SVTK_UpdateRateDlg(QtxAction* theAction,
-                    SVTK_MainWindow* theParent,
+                    SVTK_ViewWindow* theParent,
                     const char* theName):
   SVTK_DialogBase(theAction,
                  theParent, 
@@ -178,25 +177,26 @@ SVTK_UpdateRateDlg
   vtkRenderWindowInteractor* aRWI = myRWInteractor->GetDevice();
   bool anIsEnabledUpdateRate = false;
 
-  setCaption(tr("DLG_TITLE"));
-  QVBoxLayout* aVBoxLayout = new QVBoxLayout(this, 5, 5);
+  setWindowTitle(tr("DLG_TITLE"));
+  QVBoxLayout* aVBoxLayout = new QVBoxLayout(this);
+  aVBoxLayout->setMargin(5);
+  aVBoxLayout->setSpacing(5);
   {
     QGroupBox* aGroupBox = new QGroupBox(tr("INPUT_FRAME_TITLE"), this);
-    aGroupBox->setColumnLayout(0, Qt::Vertical );
-    aGroupBox->layout()->setSpacing( 6 );
-    aGroupBox->layout()->setMargin( 11 );
 
     aGroupBox->setCheckable(true);
     aGroupBox->setChecked(anIsEnabledUpdateRate);
     myIsEnableUpdateRateGroupBox = aGroupBox;
 
-    QGridLayout* aGridLayout = new QGridLayout(aGroupBox->layout());
+    QGridLayout* aGridLayout = new QGridLayout(aGroupBox);
+    aGridLayout->setSpacing( 6 );
+    aGridLayout->setMargin( 11 );
     {
       QLabel* aLabel = new QLabel(tr("DESIRED"), aGroupBox);
       aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
       aGridLayout->addWidget(aLabel, 0, 0);
 
-      QtxDblSpinBox* aDblSpinBox = new QtxDblSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
+      QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
       aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
       aGridLayout->addWidget(aDblSpinBox, 0, 1);
 
@@ -210,7 +210,7 @@ SVTK_UpdateRateDlg
       aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
       aGridLayout->addWidget(aLabel, 1, 0);
 
-      QtxDblSpinBox* aDblSpinBox = new QtxDblSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
+      QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
       aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
       aGridLayout->addWidget(aDblSpinBox, 1, 1);
 
@@ -223,11 +223,10 @@ SVTK_UpdateRateDlg
   }
   {
     QGroupBox* aGroupBox = new QGroupBox(tr("INFORMATION_FRAME_TITLE"), this);
-    aGroupBox->setColumnLayout(0, Qt::Vertical );
-    aGroupBox->layout()->setSpacing( 6 );
-    aGroupBox->layout()->setMargin( 11 );
-
-    QGridLayout* aGridLayout = new QGridLayout(aGroupBox->layout());
+    
+    QGridLayout* aGridLayout = new QGridLayout(aGroupBox);
+    aGridLayout->layout()->setSpacing( 6 );
+    aGridLayout->layout()->setMargin( 11 );
     {
       QLabel* aLabel = new QLabel(tr("CURRENT_FPS"), aGroupBox);
       aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
index 388d66600f46e6792f7ca9dfee5a97b05f70095e..1357b6434c5f901068ee26f8b40ee4f4944d3b66 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SVTK_UPDATERATEDLG_H
 #define SVTK_UPDATERATEDLG_H
 
 
 #include <vtkSmartPointer.h>
 
-class SVTK_MainWindow;
+class SVTK_ViewWindow;
 class SVTK_RenderWindowInteractor;
 
-class QtxDblSpinBox;
+class QtxDoubleSpinBox;
 class QtxAction;
 
 class QGroupBox;
@@ -52,7 +51,7 @@ class SVTK_UpdateRateDlg : public SVTK_DialogBase
 
 public:
   SVTK_UpdateRateDlg(QtxAction* theAction,
-                    SVTK_MainWindow* theParent,
+                    SVTK_ViewWindow* theParent,
                     const char* theName);
 
   ~SVTK_UpdateRateDlg();
@@ -61,8 +60,8 @@ public:
 
 protected:
   SVTK_RenderWindowInteractor* myRWInteractor;
-  QtxDblSpinBox* myDesiredUpdateRateSblSpinBox;
-  QtxDblSpinBox* myStillUpdateRateSblSpinBox;
+  QtxDoubleSpinBox* myDesiredUpdateRateSblSpinBox;
+  QtxDoubleSpinBox* myStillUpdateRateSblSpinBox;
   QGroupBox* myIsEnableUpdateRateGroupBox;
 
   QLineEdit* myCurrentUpdateRateLineEdit;
index 34ea473009411a804fdadbc7a1182fefdd093e58..8174f0c4f5e23ab963563e3247ec7b4331e835f9 100644 (file)
@@ -1,36 +1,35 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SALOME_Actor.h"
 
 #include "SVTK_View.h"
 #include "SVTK_Renderer.h"
-#include "SVTK_MainWindow.h"
+#include "SVTK_ViewWindow.h"
 #include "SVTK_RenderWindowInteractor.h"
 #include "SALOME_ListIteratorOfListIO.hxx"
 
@@ -44,7 +43,7 @@
   Constructor
 */
 SVTK_SignalHandler
-::SVTK_SignalHandler(SVTK_MainWindow* theMainWindow):
+::SVTK_SignalHandler(SVTK_ViewWindow* theMainWindow):
   QObject(theMainWindow),
   myMainWindow(theMainWindow)
 {
@@ -79,7 +78,7 @@ SVTK_SignalHandler
 /*!
   \return corresponding svtk main window
 */
-SVTK_MainWindow*
+SVTK_ViewWindow*
 SVTK_SignalHandler
 ::GetMainWindow()
 {
@@ -88,7 +87,7 @@ SVTK_SignalHandler
 
 
 /*!
-  Redirect the request to #SVTK_MainWindow::Repaint (just for flexibility)
+  Redirect the request to #SVTK_ViewWindow::Repaint (just for flexibility)
 */
 void
 SVTK_SignalHandler
@@ -98,7 +97,7 @@ SVTK_SignalHandler
 }
 
 /*!
-  Redirect the request to #SVTK_MainWindow::GetRenderer (just for flexibility)
+  Redirect the request to #SVTK_ViewWindow::GetRenderer (just for flexibility)
 */
 SVTK_Renderer* 
 SVTK_SignalHandler
@@ -108,7 +107,7 @@ SVTK_SignalHandler
 }
 
 /*!
-  Redirect the request to #SVTK_MainWindow::getRenderer (just for flexibility)
+  Redirect the request to #SVTK_ViewWindow::getRenderer (just for flexibility)
 */
 vtkRenderer* 
 SVTK_SignalHandler
@@ -164,7 +163,7 @@ SVTK_SignalHandler
   Constructor
 */
 SVTK_View
-::SVTK_View(SVTK_MainWindow* theMainWindow) :
+::SVTK_View(SVTK_ViewWindow* theMainWindow) :
   SVTK_SignalHandler(theMainWindow)
 {
 }
@@ -262,7 +261,7 @@ SVTK_View
                        const double& theTolCell,
                        const double& theTolObjects)
 {
-  GetRenderer()->SetSelectionTolerance(theTolNodes,theTolCell, theTolObjects);
+  GetRenderer()->SetSelectionTolerance(theTolNodes, theTolCell, theTolObjects);
 }
 
 /*!
@@ -308,8 +307,8 @@ SVTK_View
   using namespace SVTK;
   ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
                          TIsSameIObject<SALOME_Actor>(theIObject),
-                         TSetFunction<SALOME_Actor,const char*,QString>
-                         (&SALOME_Actor::setName,theName.latin1()));
+                         TSetFunction<SALOME_Actor,const char*,const char*>
+                         (&SALOME_Actor::setName,theName.toLatin1().data()));
 }
 
 /*!
index c7cc984b9aa39ed24b0579882fe1c2ce24b5ef87..7f3bf8a64fc857a9d06bed315854efb76eff45a1 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SVTK_VIEW_H
 #define SVTK_VIEW_H
 #include "SVTK.h"
 #include "SALOME_InteractiveObject.hxx"
 
-#include <qobject.h>
+#include <QObject>
 
 class vtkActorCollection;
 class vtkRenderer;
 
-class SVTK_MainWindow;
+class SVTK_ViewWindow;
 class SVTK_Renderer;
 
 class SALOME_Actor;
 
-//! Main purpose of the class is to provide a way to customize #SVTK_MainWindow.
+class QMouseEvent;
+class QWheelEvent;
+class QKeyEvent;
+class QContextMenuEvent;
+class QColor;
+
+
+//! Main purpose of the class is to provide a way to customize #SVTK_ViewWindow.
 /*!
-  This class is initialized by #SVTK_MainWindow and just pass Qt signals from 
-  corresponding #SVTK_RenderWindowInteractor of the #SVTK_MainWindow.
-  Its main purpose is to provide a simple and flexible way to customize the #SVTK_MainWindow.
-  So, in your own viewer it is possible to derive new #SVTK_MainWindow and 
+  This class is initialized by #SVTK_ViewWindow and just pass Qt signals from 
+  corresponding #SVTK_RenderWindowInteractor of the #SVTK_ViewWindow.
+  Its main purpose is to provide a simple and flexible way to customize the #SVTK_ViewWindow.
+  So, in your own viewer it is possible to derive new #SVTK_ViewWindow and 
   use existing functionality without any modifications.
  */
 class SVTK_EXPORT SVTK_SignalHandler : public QObject
@@ -49,26 +59,26 @@ class SVTK_EXPORT SVTK_SignalHandler : public QObject
   Q_OBJECT;
 
 public:
-  SVTK_SignalHandler(SVTK_MainWindow* theMainWindow);
+  SVTK_SignalHandler(SVTK_ViewWindow* theMainWindow);
 
   virtual
   ~SVTK_SignalHandler();
 
-  //! Get reference to its #SVTK_MainWindow
-  SVTK_MainWindow*
+  //! Get reference to its #SVTK_ViewWindow
+  SVTK_ViewWindow*
   GetMainWindow();
 
   //----------------------------------------------------------------------------
-  //! Redirect the request to #SVTK_MainWindow::Repaint (just for flexibility)
+  //! Redirect the request to #SVTK_ViewWindow::Repaint (just for flexibility)
   void
   Repaint(bool theUpdateTrihedron = true);
 
   //----------------------------------------------------------------------------
-  //! Redirect the request to #SVTK_MainWindow::GetRenderer (just for flexibility)
+  //! Redirect the request to #SVTK_ViewWindow::GetRenderer (just for flexibility)
   SVTK_Renderer* 
   GetRenderer();
 
-  //! Redirect the request to #SVTK_MainWindow::getRenderer (just for flexibility)
+  //! Redirect the request to #SVTK_ViewWindow::getRenderer (just for flexibility)
   vtkRenderer* 
   getRenderer();
 
@@ -91,7 +101,7 @@ public:
   void selectionChanged();
 
  protected:
-  SVTK_MainWindow* myMainWindow;
+  SVTK_ViewWindow* myMainWindow;
 };
 
 
@@ -106,7 +116,7 @@ class SVTK_EXPORT SVTK_View : public SVTK_SignalHandler
   Q_OBJECT;
 
 public:
-  SVTK_View(SVTK_MainWindow* theMainWindow);
+  SVTK_View(SVTK_ViewWindow* theMainWindow);
 
   virtual
   ~SVTK_View();
index b7856fdc7e22a225621233ec698f090e9bf64451..2b25de28ae54046dbb0259c22a84876d9bd6fa02 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SVTK_ViewManager.h"
 #include "SVTK_ViewModel.h"
index 8ff4efcc97545af264e2e59be6a20ff9ed3990ae..7ac3fd35644dd57bc2be862c97e0347a44326145 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SVTK_VIEWMANAGER_H
 #define SVTK_VIEWMANAGER_H
index 0624c7d47988a2cf37dd867c3874cc9916e69481..f49b3ebd1921ecf54ed5c7a2c27687275c6404a6 100644 (file)
@@ -1,41 +1,48 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-#include <qpopupmenu.h>
-#include <qcolordialog.h>
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include <QMenu>
+#include <QColorDialog>
+#include <QToolBar>
 
 #include <vtkCamera.h>
 #include <vtkRenderer.h>
 #include <vtkActorCollection.h>
 
-#include "SUIT_Session.h"
-
+//#include "SUIT_Session.h"
 #include "SVTK_Selection.h"
 #include "SVTK_ViewModel.h"
 #include "SVTK_ViewWindow.h"
 #include "SVTK_View.h"
-#include "SVTK_MainWindow.h"
+//#include "SVTK_MainWindow.h"
 #include "SVTK_Prs.h"
 
 #include "VTKViewer_ViewModel.h"
 
-#include <SALOME_Actor.h>
-#include <SALOME_InteractiveObject.hxx>
+#include "SUIT_ViewModel.h"
+#include "SUIT_ViewManager.h"
+
+#include "SALOME_Actor.h"
+
+#include <QtxActionToolMgr.h>
 
 // in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
 // SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from 
@@ -66,6 +73,13 @@ SVTK_Viewer::SVTK_Viewer()
 {
   myTrihedronSize = 105;
   myTrihedronRelative = true;
+  myIncrementSpeed = 10;
+  myIncrementMode = 0;
+  myProjMode = 0;
+  myStyle = 0;
+  mySpaceBtn[0] = 1;
+  mySpaceBtn[1] = 2;
+  mySpaceBtn[2] = 9;
 }
 
 /*!
@@ -78,9 +92,7 @@ SVTK_Viewer::~SVTK_Viewer()
 /*!
   \return background color
 */
-QColor
-SVTK_Viewer
-::backgroundColor() const
+QColor SVTK_Viewer::backgroundColor() const
 {
   return myBgColor;
 }
@@ -89,14 +101,12 @@ SVTK_Viewer
   Changes background color
   \param theColor - new background color
 */
-void
-SVTK_Viewer
-::setBackgroundColor( const QColor& theColor )
+void SVTK_Viewer::setBackgroundColor( const QColor& theColor )
 {
   if ( !theColor.isValid() )
     return;
 
-  QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+  QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
   for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
     if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){
       if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)){
@@ -111,15 +121,22 @@ SVTK_Viewer
 /*!Create new instance of view window on desktop \a theDesktop.
  *\retval SUIT_ViewWindow* - created view window pointer.
  */
-SUIT_ViewWindow*
-SVTK_Viewer::
-createView( SUIT_Desktop* theDesktop )
+SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop )
 {
   TViewWindow* aViewWindow = new TViewWindow(theDesktop);
   aViewWindow->Initialize(this);
 
   aViewWindow->setBackgroundColor( backgroundColor() );
   aViewWindow->SetTrihedronSize( trihedronSize(), trihedronRelative() );
+  aViewWindow->SetProjectionMode( projectionMode() );
+  aViewWindow->SetInteractionStyle( interactionStyle() );
+  aViewWindow->SetIncrementalSpeed( incrementalSpeed(), incrementalSpeedMode() );
+  aViewWindow->SetSpacemouseButtons( spacemouseBtn(1), spacemouseBtn(2), spacemouseBtn(3) );
+
+  connect(aViewWindow, SIGNAL( actorAdded(VTKViewer_Actor*) ), 
+         this,  SLOT(onActorAdded(VTKViewer_Actor*)));
+  connect(aViewWindow, SIGNAL( actorRemoved(VTKViewer_Actor*) ), 
+         this,  SLOT(onActorRemoved(VTKViewer_Actor*)));
 
   return aViewWindow;
 }
@@ -151,7 +168,7 @@ void SVTK_Viewer::setTrihedronSize( const vtkFloatingPointType theSize, const bo
   myTrihedronRelative = theRelative;
 
   if (SUIT_ViewManager* aViewManager = getViewManager()) {
-    QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
+    QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
     for ( uint i = 0; i < aViews.count(); i++ )
     {
       if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
@@ -160,6 +177,129 @@ void SVTK_Viewer::setTrihedronSize( const vtkFloatingPointType theSize, const bo
   }
 }
 
+
+/*!
+  \return projection mode
+*/
+int SVTK_Viewer::projectionMode() const
+{
+  return myProjMode;
+}
+
+
+/*!
+  Sets projection mode: 0 - orthogonal, 1 - perspective projection
+  \param theMode - new projection mode
+*/
+void SVTK_Viewer::setProjectionMode( const int theMode )
+{
+  if ( myProjMode != theMode ) {
+    myProjMode = theMode;
+
+    if (SUIT_ViewManager* aViewManager = getViewManager()) {
+      QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+      for ( uint i = 0; i < aViews.count(); i++ )
+      {
+       if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+         aView->SetProjectionMode( theMode );
+      }
+    }
+  }
+}
+
+/*!
+  \return interaction style
+*/
+int SVTK_Viewer::interactionStyle() const
+{
+  return myStyle;
+}
+
+/*!
+  Sets interaction style: 0 - standard, 1 - keyboard free interaction
+  \param theStyle - new interaction style
+*/
+void SVTK_Viewer::setInteractionStyle( const int theStyle )
+{
+  myStyle = theStyle;
+  
+  if (SUIT_ViewManager* aViewManager = getViewManager()) {
+    QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+    for ( uint i = 0; i < aViews.count(); i++ )
+    {
+      if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+       aView->SetInteractionStyle( theStyle );
+    }
+  }
+}
+
+/*!
+  \return incremental speed value
+*/
+int SVTK_Viewer::incrementalSpeed() const
+{
+  return myIncrementSpeed;
+}
+
+/*!
+  \return modification mode of the incremental speed 
+*/
+int SVTK_Viewer::incrementalSpeedMode() const
+{
+  return myIncrementMode;
+}
+
+/*!
+  Set the incremental speed value and modification mode
+  \param theValue - new value
+  \param theMode - new mode: 0 - arithmetic, 1 - geometrical progression
+*/
+void SVTK_Viewer::setIncrementalSpeed( const int theValue, const int theMode )
+{
+  myIncrementSpeed = theValue;
+  myIncrementMode = theMode;
+
+  if (SUIT_ViewManager* aViewManager = getViewManager()) {
+    QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+    for ( uint i = 0; i < aViews.count(); i++ )
+    {
+      if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+       aView->SetIncrementalSpeed( theValue, theMode );
+    }
+  }
+}
+
+/*!
+  \return spacemouse button assigned to the specified function
+  \param theIndex - function by number (from 1 to 3)
+*/
+int SVTK_Viewer::spacemouseBtn( const int theIndex ) const
+{
+  if ( theIndex < 1 || theIndex > 3 ) 
+    return -1;
+  return mySpaceBtn[theIndex-1];
+}
+
+/*!
+  Set the spacemouse buttons
+  \param theBtn1, theBtn2, theBtn3 - new buttons
+*/
+void SVTK_Viewer::setSpacemouseButtons( const int theBtn1, const int theBtn2, const int theBtn3 )
+{
+  mySpaceBtn[0] = theBtn1;
+  mySpaceBtn[1] = theBtn2;
+  mySpaceBtn[2] = theBtn3;
+
+  if (SUIT_ViewManager* aViewManager = getViewManager()) {
+    QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+    for ( uint i = 0; i < aViews.count(); i++ )
+    {
+      if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+       aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 );
+    }
+  }
+}
+
 /*!
   Sets new view manager
   \param theViewManager - new view manager
@@ -184,19 +324,19 @@ void SVTK_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
 /*!
   Builds popup for vtk viewer
 */
-void
-SVTK_Viewer
-::contextMenuPopup( QPopupMenu* thePopup )
+void SVTK_Viewer::contextMenuPopup( QMenu* thePopup )
 {
-  thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
-  thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+  thePopup->addAction( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
+  thePopup->addAction( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
 
-  thePopup->insertSeparator();
+  thePopup->addSeparator();
 
   if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
-    if ( !aView->getMainWindow()->getToolBar()->isVisible() ){
-      thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
-    }
+    //Support of several toolbars in the popup menu
+    QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
+    QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
+    for( ; it!=last; it++ )
+      thePopup->addAction( (*it)->toggleViewAction() );
     aView->RefreshDumpImage();
   }
 }
@@ -204,34 +344,26 @@ SVTK_Viewer
 /*!
   SLOT: called on mouse button press, empty implementation
 */
-void 
-SVTK_Viewer
-::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
+void SVTK_Viewer::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
 {}
 
 /*!
   SLOT: called on mouse move, empty implementation
 */
-void 
-SVTK_Viewer
-::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event)
+void SVTK_Viewer::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event)
 {}
 
 /*!
   SLOT: called on mouse button release, empty implementation
 */
-void 
-SVTK_Viewer
-::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
+void SVTK_Viewer::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
 {}
 
 /*!
   Enables/disables selection
   \param isEnabled - new state
 */
-void 
-SVTK_Viewer
-::enableSelection(bool isEnabled)
+void SVTK_Viewer::enableSelection(bool isEnabled)
 {
   mySelectionEnabled = isEnabled;
   //!! To be done for view windows
@@ -241,9 +373,7 @@ SVTK_Viewer
   Enables/disables selection of many object
   \param isEnabled - new state
 */
-void
-SVTK_Viewer
-::enableMultiselection(bool isEnable)
+void SVTK_Viewer::enableMultiselection(bool isEnable)
 {
   myMultiSelectionEnabled = isEnable;
   //!! To be done for view windows
@@ -252,9 +382,7 @@ SVTK_Viewer
 /*!
   SLOT: called on dump view operation is activated, stores scene to raster file
 */
-void
-SVTK_Viewer
-::onDumpView()
+void SVTK_Viewer::onDumpView()
 {
   if(SUIT_ViewWindow* aView = myViewManager->getActiveView())
     aView->onDumpView();
@@ -263,9 +391,7 @@ SVTK_Viewer
 /*!
   SLOT: called if background color is to be changed changed, passes new color to view port
 */
-void
-SVTK_Viewer
-::onChangeBgColor()
+void SVTK_Viewer::onChangeBgColor()
 {
   if(SUIT_ViewWindow* aView = myViewManager->getActiveView()){
     QColor aColor = QColorDialog::getColor( backgroundColor(), aView);
@@ -273,28 +399,11 @@ SVTK_Viewer
   }
 }
 
-/*!
-  SLOT: called when popup item "Show toolbar" is activated, shows toolbar of active view window
-*/
-void
-SVTK_Viewer
-::onShowToolbar() 
-{
-  QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
-  for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
-    if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at(i))){
-      aView->getMainWindow()->getToolBar()->show();
-    }
-  }
-}
-
 /*!
   Display presentation
   \param prs - presentation
 */
-void
-SVTK_Viewer
-::Display( const SALOME_VTKPrs* prs )
+void SVTK_Viewer::Display( const SALOME_VTKPrs* prs )
 {
   // try do downcast object
   if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>( prs )){
@@ -318,7 +427,7 @@ SVTK_Viewer
          //  ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this);
          //}
          // just display the object
-         QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+         QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
          for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
            if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
              if(SVTK_View* aView = aViewWindow->getView()){
@@ -341,9 +450,7 @@ SVTK_Viewer
   \param prs - presentation
   \param forced - removes object from view
 */
-void
-SVTK_Viewer
-::Erase( const SALOME_VTKPrs* prs, const bool forced )
+void SVTK_Viewer::Erase( const SALOME_VTKPrs* prs, const bool forced )
 {
   // try do downcast object
   if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>( prs )){
@@ -367,7 +474,7 @@ SVTK_Viewer
          //  ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
          //}
          // just display the object
-         QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+         QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
          for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
            if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
              if(SVTK_View* aView = aViewWindow->getView())
@@ -385,15 +492,13 @@ SVTK_Viewer
   Erase all presentations
   \param forced - removes all objects from view
 */
-void
-SVTK_Viewer
-::EraseAll( const bool forced )
+void SVTK_Viewer::EraseAll( const bool forced )
 {
   // Temporarily commented to avoid awful dependecy on SALOMEDS
   // TODO: better mechanism of storing display/erse status in a study
   // should be provided...
   //_PTR(Study) aStudy(getStudyDS());
-  QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+  QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
   for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
     if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
       if(SVTK_View* aView = aViewWindow->getView()){
@@ -433,9 +538,7 @@ SVTK_Viewer
   Create presentation corresponding to the entry
   \param entry - entry
 */
-SALOME_Prs* 
-SVTK_Viewer
-::CreatePrs( const char* entry )
+SALOME_Prs* SVTK_Viewer::CreatePrs( const char* entry )
 {
   SVTK_Prs* prs = new SVTK_Prs();
   if ( entry ) {
@@ -459,9 +562,7 @@ SVTK_Viewer
 /*!
   Auxiliary method called before displaying of objects
 */
-void
-SVTK_Viewer
-::BeforeDisplay( SALOME_Displayer* d )
+void SVTK_Viewer::BeforeDisplay( SALOME_Displayer* d )
 {
   d->BeforeDisplay( this, SALOME_VTKViewType() );
 }
@@ -469,8 +570,7 @@ SVTK_Viewer
 /*!
   Auxiliary method called after displaying of objects
 */
-void
-SVTK_Viewer::AfterDisplay( SALOME_Displayer* d )
+void SVTK_Viewer::AfterDisplay( SALOME_Displayer* d )
 {
   d->AfterDisplay( this, SALOME_VTKViewType() );
 }
@@ -479,11 +579,9 @@ SVTK_Viewer::AfterDisplay( SALOME_Displayer* d )
   \return true if object is displayed in viewer
   \param obj - object to be checked
 */
-bool
-SVTK_Viewer
-::isVisible( const Handle(SALOME_InteractiveObject)& io )
+bool SVTK_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& io )
 {
-  QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+  QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
   for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
     if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
       if(TViewWindow* aViewWnd = dynamic_cast<TViewWindow*>(aViewWindow))
@@ -497,14 +595,23 @@ SVTK_Viewer
 /*!
   Updates current viewer
 */
-void 
-SVTK_Viewer
-::Repaint()
+void SVTK_Viewer::Repaint()
 {
 //  if (theUpdateTrihedron) onAdjustTrihedron();
-  QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+  QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
   for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
     if(TViewWindow* aViewWindow = dynamic_cast<TViewWindow*>(aViews.at(i)))
       if(SVTK_View* aView = aViewWindow->getView())
        aView->Repaint();
 }
+
+void SVTK_Viewer::onActorAdded(VTKViewer_Actor* theActor)
+{
+  emit actorAdded((SVTK_ViewWindow*)sender(), theActor);
+}
+
+void SVTK_Viewer::onActorRemoved(VTKViewer_Actor* theActor)
+{
+  emit actorRemoved((SVTK_ViewWindow*)sender(), theActor);
+}
index ec61193b2363b83e00397c71d77515ffb24a7f6f..1dda8f65a0cea301ce0702191f95690fa5b67356 100644 (file)
@@ -1,34 +1,40 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SVTK_VIEWMODEL_H
 #define SVTK_VIEWMODEL_H
 
 #include "SVTK.h"
-#include "SUIT_ViewModel.h"
 #include "SVTK_ViewModelBase.h"
 
 #include "SALOME_Prs.h"
 #include "SALOME_InteractiveObject.hxx"
 
-#include <qcolor.h>
+#include <QColor>
+#include <QMap>
+
+class QMouseEvent;
 
 class SVTK_ViewWindow;
+class VTKViewer_Actor;
 
 //! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View 
 class SVTK_EXPORT SVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View 
@@ -51,7 +57,7 @@ public:
   virtual void setViewManager(SUIT_ViewManager* theViewManager);
 
   //! See #SUIT_ViewModel::contextMenuPopup
-  virtual void contextMenuPopup( QPopupMenu* );
+  virtual void contextMenuPopup( QMenu* );
 
   //! See #SUIT_ViewModel::getType
   virtual QString getType() const { return Type(); }
@@ -71,6 +77,33 @@ public:
   //! Set size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
   void setTrihedronSize( const vtkFloatingPointType, const bool = true );
 
+  //! Gets projection mode
+  int projectionMode() const;
+
+  //! Sets projection mode
+  void setProjectionMode( const int );
+
+  //! Gets interaction style
+  int interactionStyle() const;
+
+  //! Sets interaction style
+  void setInteractionStyle( const int );
+
+  //! Get incremental speed (see #SVTK_InteractorStyle::ControllerIncrement)
+  int incrementalSpeed() const;
+
+  //! Returns modification mode of incremental speed (see #SVTK_InteractorStyle::ControllerIncrement)
+  int incrementalSpeedMode() const;
+
+  //! Set the incremental speed for view operation (see #SVTK_InteractorStyle::ControllerIncrement)
+  void setIncrementalSpeed( const int, const int = 0 );
+
+  //! Gets spacemouse button for specified function
+  int spacemouseBtn( const int ) const;
+
+  //! Sets spacemouse buttons
+  void setSpacemouseButtons( const int, const int, const int );
+
 public:
   void enableSelection(bool isEnabled);
   bool isSelectionEnabled() const { return mySelectionEnabled; }
@@ -106,21 +139,35 @@ public:
   //! See #SALOME_View::Repaint()
   virtual void Repaint();
 
+ signals:
+  void actorAdded(SVTK_ViewWindow*, VTKViewer_Actor*);
+  void actorRemoved(SVTK_ViewWindow*, VTKViewer_Actor*);
+
 protected slots:
   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
 
   void onDumpView();
-  void onShowToolbar();
   void onChangeBgColor();
 
+  void onActorAdded(VTKViewer_Actor*);
+  void onActorRemoved(VTKViewer_Actor*);
+
 private:
+  void updateToolBars();
+
+
   QColor myBgColor;
   vtkFloatingPointType myTrihedronSize;
   bool   myTrihedronRelative;
   bool   mySelectionEnabled;
   bool   myMultiSelectionEnabled;
+  int    myIncrementSpeed;
+  int    myIncrementMode;
+  int    myProjMode;
+  int    myStyle;
+  int    mySpaceBtn[3];
 };
 
 #endif
index 49f335e664616348db9c41088c9884fdd537539e..f1bfcceb71329b00b3fbc26fe31fb5b3c8cfcbbc 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SVTK_SELECTIONCHANGED_H
 #define SVTK_SELECTIONCHANGED_H
diff --git a/src/SVTK/SVTK_ViewParameterDlg.cxx b/src/SVTK/SVTK_ViewParameterDlg.cxx
new file mode 100755 (executable)
index 0000000..b4c4cab
--- /dev/null
@@ -0,0 +1,742 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  File   : 
+//  Author : 
+//  Module : SALOME
+//  $Header: 
+//
+#include "SVTK_ViewParameterDlg.h"
+#include "SVTK_ViewWindow.h"
+#include "SVTK_RenderWindowInteractor.h"
+#include "SVTK_Event.h"
+#include "SVTK_InteractorStyle.h"
+
+#include "VTKViewer_Utilities.h"
+
+#include "QtxAction.h"
+
+#include <QLineEdit>
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QDoubleValidator>
+#include <QCheckBox>
+#include <QRadioButton>
+#include <QButtonGroup>
+
+#include <vtkCallbackCommand.h>
+#include <vtkRenderer.h>
+#include <vtkCamera.h>
+#include <vtkGenericRenderWindowInteractor.h>
+
+using namespace std;
+
+/*!
+  Constructor
+*/
+SVTK_ViewParameterDlg::SVTK_ViewParameterDlg(QtxAction* theAction,
+                                            SVTK_ViewWindow* theParent,
+                                            const char* theName):
+  SVTK_DialogBase(theAction, theParent, theName),
+  myMainWindow(theParent),
+  myPriority(0.0),
+  myEventCallbackCommand(vtkCallbackCommand::New()),
+  myRWInteractor(theParent->GetInteractor())
+{
+  setWindowTitle(tr("DLG_TITLE"));
+  setSizeGripEnabled(TRUE);
+
+  // Top layout
+  QVBoxLayout* aTopLayout = new QVBoxLayout(this);
+  aTopLayout->setSpacing(6);
+  aTopLayout->setMargin(11);
+
+  // Projection mode
+  QGroupBox* aGroupBoxMode = new QGroupBox(tr("PROJECTION_MODE"), this);
+  QHBoxLayout* aLayout1 = new QHBoxLayout(aGroupBoxMode);
+
+  QRadioButton* aOrtho = new QRadioButton(tr("ORTHOGONAL_MODE"), aGroupBoxMode);
+  QRadioButton* aPersp = new QRadioButton(tr("PERSPECTIVE_MODE"), aGroupBoxMode);
+
+  aLayout1->addWidget(aOrtho);
+  aLayout1->addWidget(aPersp);
+
+  myProjectionMode = new QButtonGroup(aGroupBoxMode);
+  myProjectionMode->addButton(aOrtho, 0);
+  myProjectionMode->addButton(aPersp, 1);
+  connect(myProjectionMode, SIGNAL(buttonClicked(int)), SLOT(onProjectionModeChanged(int)));
+
+  // Focal point
+  QGroupBox* aGroupBoxFocal = new QGroupBox(tr("FOCAL_POINT"), this);
+  QVBoxLayout* aLayout2 = new QVBoxLayout(aGroupBoxFocal);
+
+  myToBBCenter = new QPushButton(aGroupBoxFocal);
+  myToBBCenter->setText(tr("LBL_TOBBCENTER"));
+  aLayout2->addWidget(myToBBCenter);
+  connect(myToBBCenter, SIGNAL(clicked()), this, SLOT(onToBBCenter()));
+
+  myToOrigin = new QPushButton(aGroupBoxFocal);
+  myToOrigin->setText(tr("LBL_TOORIGIN"));
+  aLayout2->addWidget(myToOrigin);
+  connect(myToOrigin, SIGNAL(clicked()), this, SLOT(onToOrigin()));
+
+  mySelectPoint = new QPushButton(aGroupBoxFocal);
+  mySelectPoint->setText(tr("LBL_SELECTPOINT"));
+  mySelectPoint->setCheckable(true);
+  aLayout2->addWidget(mySelectPoint);
+  connect(mySelectPoint, SIGNAL(clicked()), this, SLOT(onSelectPoint()));
+
+  // Focal point coordinates
+  myFocalCoords = new QFrame(aGroupBoxFocal);
+  myFocalCoords->setObjectName("FocalPointCoordinates");
+
+  QHBoxLayout* aCoordLayout = new QHBoxLayout(myFocalCoords);
+  aCoordLayout->setSpacing(6);
+  aCoordLayout->setMargin(0);
+  
+  QLabel* aLabelX = new QLabel(tr("LBL_X"), myFocalCoords);
+  aLabelX->setFixedWidth(25);
+  myFocalX = new QLineEdit(myFocalCoords);
+  myFocalX->setValidator(new QDoubleValidator(myFocalX));
+  myFocalX->setText(QString::number(0.0));
+  connect(myFocalX, SIGNAL(textChanged(const QString&)), SLOT(onFocalCoordChanged()));
+  
+  QLabel* aLabelY = new QLabel(tr("LBL_Y"), myFocalCoords);
+  aLabelY->setFixedWidth(25);
+  myFocalY = new QLineEdit(myFocalCoords);
+  myFocalY->setValidator(new QDoubleValidator(myFocalY));
+  myFocalY->setText(QString::number(0.0));
+  connect(myFocalY, SIGNAL(textChanged(const QString&)), SLOT(onFocalCoordChanged()));
+
+  QLabel* aLabelZ = new QLabel(tr("LBL_Z"), myFocalCoords);
+  aLabelZ->setFixedWidth(25);
+  myFocalZ = new QLineEdit(myFocalCoords);
+  myFocalZ->setValidator(new QDoubleValidator(myFocalZ));
+  myFocalZ->setText(QString::number(0.0));
+  connect(myFocalZ, SIGNAL(textChanged(const QString&)), SLOT(onFocalCoordChanged()));
+
+  aCoordLayout->addWidget(aLabelX);
+  aCoordLayout->addWidget(myFocalX);
+  aCoordLayout->addWidget(aLabelY);
+  aCoordLayout->addWidget(myFocalY);
+  aCoordLayout->addWidget(aLabelZ);
+  aCoordLayout->addWidget(myFocalZ);
+  aLayout2->addWidget(myFocalCoords);
+
+  // Camera position
+  QGroupBox* aGroupBoxCamera = new QGroupBox(tr("CAMERA_POSITION"), this);
+  QVBoxLayout* aLayout3 = new QVBoxLayout(aGroupBoxCamera);
+
+  QRadioButton* aWorld = new QRadioButton(tr("WORLD_COORDINATES"), aGroupBoxCamera);
+  QRadioButton* aRelative = new QRadioButton(tr("FOCAL_RELATIVE"), aGroupBoxCamera);
+
+  QHBoxLayout* aHLayout = new QHBoxLayout;
+  aHLayout->addWidget(aWorld);
+  aHLayout->addWidget(aRelative);
+  aLayout3->addLayout(aHLayout);
+
+  myCameraPositionMode = new QButtonGroup(aGroupBoxCamera);
+  myCameraPositionMode->addButton(aWorld, 0);
+  myCameraPositionMode->addButton(aRelative, 1);
+  connect(myCameraPositionMode, SIGNAL(buttonClicked(int)), SLOT(onPositionModeChanged(int)));
+
+  // Camera coordinates
+  myCameraCoords = new QFrame(aGroupBoxCamera);
+  myCameraCoords->setObjectName("CameraCoordinates");
+
+  aCoordLayout = new QHBoxLayout(myCameraCoords);
+  aCoordLayout->setSpacing(6);
+  aCoordLayout->setMargin(0);
+
+  aLabelX = new QLabel(tr("LBL_X"), myCameraCoords);
+  aLabelX->setFixedWidth(25);
+  myCameraX = new QLineEdit(myCameraCoords);
+  myCameraX->setValidator(new QDoubleValidator(myCameraX));
+  myCameraX->setText(QString::number(0.0));
+  connect(myCameraX, SIGNAL(textChanged(const QString&)), SLOT(onCameraCoordChanged()));
+
+  aLabelY = new QLabel(tr("LBL_Y"), myCameraCoords);
+  aLabelY->setFixedWidth(25);
+  myCameraY = new QLineEdit(myCameraCoords);
+  myCameraY->setValidator(new QDoubleValidator(myCameraY));
+  myCameraY->setText(QString::number(0.0));
+  connect(myCameraY, SIGNAL(textChanged(const QString&)), SLOT(onCameraCoordChanged()));
+
+  aLabelZ = new QLabel(tr("LBL_Z"), myCameraCoords);
+  aLabelZ->setFixedWidth(25);
+  myCameraZ = new QLineEdit(myCameraCoords);
+  myCameraZ->setValidator(new QDoubleValidator(myCameraZ));
+  myCameraZ->setText(QString::number(1.0));
+  connect(myCameraZ, SIGNAL(textChanged(const QString&)), SLOT(onCameraCoordChanged()));
+
+  aCoordLayout->addWidget(aLabelX);
+  aCoordLayout->addWidget(myCameraX);
+  aCoordLayout->addWidget(aLabelY);
+  aCoordLayout->addWidget(myCameraY);
+  aCoordLayout->addWidget(aLabelZ);
+  aCoordLayout->addWidget(myCameraZ);
+  aLayout3->addWidget(myCameraCoords);
+
+  // Projection direction
+  QFrame* line1 = new QFrame(aGroupBoxCamera);
+  line1->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+  aLayout3->addWidget(line1);
+
+  QLabel* aLabel = new QLabel(tr("PROJECTION_DIRECTION"), aGroupBoxCamera);
+  aLayout3->addWidget(aLabel);
+
+  myProjDirection = new QFrame(aGroupBoxCamera);
+  myProjDirection->setObjectName("ProjectionDirection");
+
+  aCoordLayout = new QHBoxLayout(myProjDirection);
+  aCoordLayout->setSpacing(6);
+  aCoordLayout->setMargin(0);
+
+  aLabelX = new QLabel(tr("LBL_DX"), myProjDirection);
+  aLabelX->setFixedWidth(25);
+  myProjDirX = new QLineEdit(myProjDirection);
+  myProjDirX->setValidator(new QDoubleValidator(myProjDirX));
+  myProjDirX->setText(QString::number(0.0));
+  connect(myProjDirX, SIGNAL(textChanged(const QString&)), SLOT(onDirectionChanged()));
+
+  aLabelY = new QLabel(tr("LBL_DY"), myProjDirection);
+  aLabelY->setFixedWidth(25);
+  myProjDirY = new QLineEdit(myProjDirection);
+  myProjDirY->setValidator(new QDoubleValidator(myProjDirY));
+  myProjDirY->setText(QString::number(0.0));
+  connect(myProjDirY, SIGNAL(textChanged(const QString&)), SLOT(onDirectionChanged()));
+
+  aLabelZ = new QLabel(tr("LBL_DZ"), myProjDirection);
+  aLabelZ->setFixedWidth(25);
+  myProjDirZ = new QLineEdit(myProjDirection);
+  myProjDirZ->setValidator(new QDoubleValidator(myProjDirZ));
+  myProjDirZ->setText(QString::number(-1.0));
+  connect(myProjDirZ, SIGNAL(textChanged(const QString&)), SLOT(onDirectionChanged()));
+
+  aCoordLayout->addWidget(aLabelX);
+  aCoordLayout->addWidget(myProjDirX);
+  aCoordLayout->addWidget(aLabelY);
+  aCoordLayout->addWidget(myProjDirY);
+  aCoordLayout->addWidget(aLabelZ);
+  aCoordLayout->addWidget(myProjDirZ);
+  aLayout3->addWidget(myProjDirection);
+
+  // Distance to focal point
+  QHBoxLayout* aHorLayout = new QHBoxLayout;
+  aHorLayout->setSpacing(6);
+
+  aLabel = new QLabel(tr("FOCAL_DISTANCE"), aGroupBoxCamera);
+  myDistance = new QLineEdit(aGroupBoxCamera);
+  QDoubleValidator* aVal = new QDoubleValidator(myDistance);
+  aVal->setBottom(0.0002); // VTK minimal distance
+  myDistance->setValidator(aVal);
+  myDistance->setText(QString::number(1.0));
+  connect(myDistance, SIGNAL(textChanged(const QString&)), SLOT(onDistanceChanged()));
+  
+  aHorLayout->addWidget(aLabel);
+  aHorLayout->addWidget(myDistance);
+  aLayout3->addLayout(aHorLayout);
+
+  // View Up direction
+  QFrame* line2 = new QFrame(aGroupBoxCamera);
+  line2->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+  aLayout3->addWidget(line2);
+
+  aLabel = new QLabel(tr("VIEW_UP_DIRECTION"), aGroupBoxCamera);
+  aLayout3->addWidget(aLabel);
+
+  myViewDirection = new QFrame(aGroupBoxCamera);
+  myViewDirection->setObjectName("ViewUpDirection");
+  aLayout3->addWidget(myViewDirection);
+
+  aCoordLayout = new QHBoxLayout(myViewDirection);
+  aCoordLayout->setSpacing(6);
+  aCoordLayout->setMargin(0);
+
+  aLabelX = new QLabel(tr("LBL_DX"), myViewDirection);
+  aLabelX->setFixedWidth(25);
+  myViewDirX = new QLineEdit(myViewDirection);
+  myViewDirX->setValidator(new QDoubleValidator(myViewDirX));
+  myViewDirX->setText(QString::number(0.0));
+  connect(myViewDirX, SIGNAL(textChanged(const QString&)), SLOT(onViewDirectionChanged()));
+
+  aLabelY = new QLabel(tr("LBL_DY"), myViewDirection);
+  aLabelY->setFixedWidth(25);
+  myViewDirY = new QLineEdit(myViewDirection);
+  myViewDirY->setValidator(new QDoubleValidator(myViewDirY));
+  myViewDirY->setText(QString::number(1.0));
+  connect(myViewDirY, SIGNAL(textChanged(const QString&)), SLOT(onViewDirectionChanged()));
+
+  aLabelZ = new QLabel(tr("LBL_DZ"), myViewDirection);
+  aLabelZ->setFixedWidth(25);
+  myViewDirZ = new QLineEdit(myViewDirection);
+  myViewDirZ->setValidator(new QDoubleValidator(myViewDirZ));
+  myViewDirZ->setText(QString::number(0.0));
+  connect(myViewDirZ, SIGNAL(textChanged(const QString&)), SLOT(onViewDirectionChanged()));
+
+  aCoordLayout->addWidget(aLabelX);
+  aCoordLayout->addWidget(myViewDirX);
+  aCoordLayout->addWidget(aLabelY);
+  aCoordLayout->addWidget(myViewDirY);
+  aCoordLayout->addWidget(aLabelZ);
+  aCoordLayout->addWidget(myViewDirZ);
+
+  // Zooming
+  QGroupBox* aGroupBoxZoom = new QGroupBox(tr("ZOOMING"), this);
+  QVBoxLayout* aLayout4 = new QVBoxLayout(aGroupBoxZoom);
+
+  // Parallel scale
+  myScaleBox = new QFrame(aGroupBoxZoom);
+  myScaleBox->setObjectName("ScaleValue");
+
+  aHorLayout = new QHBoxLayout(myScaleBox);
+  aHorLayout->setSpacing(6);
+  aHorLayout->setMargin(0);
+
+  aLabel = new QLabel(tr("LBL_SCALE"), myScaleBox);
+  myScale = new QLineEdit(myScaleBox);
+  QDoubleValidator* aVal2 = new QDoubleValidator(myScale);
+  aVal2->setBottom(0.000001); // VTK minimal scale
+  myScale->setValidator(aVal2);
+  myScale->setText(QString::number(1.0));
+  connect(myScale, SIGNAL(textChanged(const QString&)), SLOT(onZoomChanged()));
+
+  aHorLayout->addWidget(aLabel);
+  aHorLayout->addWidget(myScale);
+  aLayout4->addWidget(myScaleBox);
+
+  // View Angle
+  myViewAngleBox = new QFrame(aGroupBoxZoom);
+  myViewAngleBox->setObjectName("ViewAngle");
+
+  aHorLayout = new QHBoxLayout(myViewAngleBox);
+  aHorLayout->setSpacing(6);
+  aHorLayout->setMargin(0);
+
+  aLabel = new QLabel(tr("LBL_VIEW_ANGLE"), myViewAngleBox);
+  myViewAngle = new QLineEdit(myViewAngleBox);
+  QDoubleValidator* aVal3 = new QDoubleValidator(myViewAngle);
+  aVal3->setBottom(0.000001); // VTK minimal scale
+  aVal3->setTop(179); // VTK minimal scale
+  myViewAngle->setValidator(aVal3);
+  myViewAngle->setText(QString::number(30.0));
+  connect(myViewAngle, SIGNAL(textChanged(const QString&)), SLOT(onZoomChanged()));
+
+  aHorLayout->addWidget(aLabel);
+  aHorLayout->addWidget(myViewAngle);
+  aLayout4->addWidget(myViewAngleBox);
+
+  // "Close" button
+  QGroupBox* aGroupBox = new QGroupBox(this);
+  QHBoxLayout* aHBoxLayout2 = new QHBoxLayout(aGroupBox);
+  aHBoxLayout2->setMargin(11);
+  aHBoxLayout2->setSpacing(6);
+
+  QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox );
+  m_bClose->setObjectName("m_bClose");
+  m_bClose->setAutoDefault(TRUE);
+  m_bClose->setFixedSize(m_bClose->sizeHint());
+  connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose()));
+
+  // Layout buttons
+  aHBoxLayout2->addWidget(m_bClose);
+
+  // Layout top level widgets
+  aTopLayout->addWidget(aGroupBoxMode);
+  aTopLayout->addWidget(aGroupBoxFocal);
+  aTopLayout->addWidget(aGroupBoxCamera);
+  aTopLayout->addWidget(aGroupBoxZoom);
+  aTopLayout->addWidget(aGroupBox);
+  aTopLayout->addStretch();
+
+  // initial state
+  myProjectionMode->button(0)->setChecked(true);
+  myCameraPositionMode->button(0)->setChecked(true);
+
+  setEnabled(myCameraCoords, myCameraPositionMode->checkedId() == 0);
+
+  myScaleBox->setVisible(myProjectionMode->checkedId() == 0);
+  myViewAngleBox->setVisible(myProjectionMode->checkedId() == 1);
+
+  updateData();
+
+  this->resize(400, this->sizeHint().height());
+
+  myEventCallbackCommand->Delete();
+  myEventCallbackCommand->SetClientData(this);
+  myEventCallbackCommand->SetCallback(SVTK_ViewParameterDlg::ProcessEvents);
+  myIsObserverAdded = false;
+  myBusy = false;
+}
+
+/*
+ *  Destroys the object and frees any allocated resources
+ */
+SVTK_ViewParameterDlg::~SVTK_ViewParameterDlg()
+{
+  // no need to delete child widgets, Qt does it all for us
+}
+
+void SVTK_ViewParameterDlg::addObserver()
+{
+  if ( !myIsObserverAdded ) {
+    vtkInteractorStyle* aIStyle = myRWInteractor->GetInteractorStyle();
+    aIStyle->AddObserver(SVTK::FocalPointChanged, myEventCallbackCommand.GetPointer(), myPriority);
+
+    vtkRenderer *aRenderer = myRWInteractor->getRenderer();
+    aRenderer->AddObserver(vtkCommand::EndEvent, myEventCallbackCommand.GetPointer(), myPriority);
+
+    myIsObserverAdded = true;
+  }
+}
+
+/*!
+  Processes events
+*/
+void SVTK_ViewParameterDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject), 
+                                         unsigned long theEvent,
+                                         void* theClientData, 
+                                         void* theCallData)
+{
+  SVTK_ViewParameterDlg* self = reinterpret_cast<SVTK_ViewParameterDlg*>(theClientData);
+  vtkFloatingPointType* aCoord;
+  switch ( theEvent ) {
+  case SVTK::FocalPointChanged:
+    if ( theCallData )
+    {
+      aCoord = (vtkFloatingPointType*)theCallData;
+      self->myBusy = true;
+      self->myFocalX->setText( QString::number(aCoord[0]) );
+      self->myFocalY->setText( QString::number(aCoord[1]) );
+      self->myFocalZ->setText( QString::number(aCoord[2]) );
+      self->myBusy = false;
+      self->onFocalCoordChanged();
+    }
+    break;
+  case vtkCommand::EndEvent:
+    if ( self->myRWInteractor->getRenderer()->GetActiveCamera()->GetMTime() > self->myCameraMTime )
+      self->updateData();
+    break;
+  }
+}
+
+void SVTK_ViewParameterDlg::updateData()
+{
+  myBusy = true;
+  vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+
+  int aParallel = aCamera->GetParallelProjection();
+  myProjectionMode->button(aParallel?0:1)->setChecked(true);
+  onProjectionModeChanged( myProjectionMode->checkedId() );
+
+  double focal[3], pos[3], vup[3], proj[3], dist, scale, angle;
+
+  aCamera->GetFocalPoint(focal);
+  myFocalX->setText(QString::number(focal[0]));
+  myFocalY->setText(QString::number(focal[1]));
+  myFocalZ->setText(QString::number(focal[2]));
+
+  aCamera->GetPosition(pos);
+  myCameraX->setText(QString::number(pos[0]));
+  myCameraY->setText(QString::number(pos[1]));
+  myCameraZ->setText(QString::number(pos[2]));
+
+  aCamera->GetDirectionOfProjection(proj);
+  myProjDirX->setText(QString::number(proj[0]));
+  myProjDirY->setText(QString::number(proj[1]));
+  myProjDirZ->setText(QString::number(proj[2]));
+
+  aCamera->GetViewUp(vup);
+  myViewDirX->setText(QString::number(vup[0]));
+  myViewDirY->setText(QString::number(vup[1]));
+  myViewDirZ->setText(QString::number(vup[2]));
+
+  dist = aCamera->GetDistance();
+  myDistance->setText(QString::number(dist));
+
+  scale = aCamera->GetParallelScale();
+  myScale->setText(QString::number(scale));
+
+  angle = aCamera->GetViewAngle();
+  myViewAngle->setText(QString::number(angle));
+
+  myCameraMTime.Modified();
+  myBusy = false;
+}
+
+void SVTK_ViewParameterDlg::setEnabled(QFrame* theWidget, const bool theState)
+{
+  QObjectList aChildren(theWidget->children());
+  QObject* anObj;
+  for(int i = 0; i < aChildren.size(); i++)
+  {
+    anObj = aChildren.at(i);
+    if (anObj !=0 && anObj->inherits("QLineEdit"))
+      ((QLineEdit*)anObj)->setReadOnly(!theState);
+    if (anObj !=0 && anObj->inherits("QPushButton"))
+      ((QLineEdit*)anObj)->setEnabled(theState);
+  }
+  
+}
+
+void SVTK_ViewParameterDlg::onProjectionModeChanged(int mode)
+{
+  int aBtn = myProjectionMode->checkedId();
+
+  vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+  aCamera->SetParallelProjection(aBtn == 0);
+
+  myMainWindow->activateProjectionMode(aBtn);
+
+  // update view
+  myRWInteractor->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
+
+  if ( aBtn == 0 ) {
+    myViewAngleBox->setVisible(false);
+    myScaleBox->setVisible(true);
+  }
+  else {
+    myScaleBox->setVisible(false);
+    myViewAngleBox->setVisible(true);
+  }
+}
+
+void SVTK_ViewParameterDlg::onPositionModeChanged(int mode)
+{
+  setEnabled(myCameraCoords, myCameraPositionMode->checkedId() == 0);
+}
+
+void SVTK_ViewParameterDlg::onToBBCenter()
+{
+  if ( mySelectPoint->isChecked() )
+    mySelectPoint->toggle();
+
+  myMainWindow->activateSetFocalPointGravity();
+}
+
+void SVTK_ViewParameterDlg::onToOrigin()
+{
+  if ( mySelectPoint->isChecked() )
+    mySelectPoint->toggle();
+
+  myBusy = true;
+  myFocalX->setText(QString::number(0.0));
+  myFocalY->setText(QString::number(0.0));
+  myFocalZ->setText(QString::number(0.0));
+  myBusy = false;
+
+  onFocalCoordChanged();
+}
+
+void SVTK_ViewParameterDlg::onSelectPoint()
+{
+  if ( mySelectPoint->isChecked() )
+    myMainWindow->activateStartFocalPointSelection();
+  else
+    mySelectPoint->toggle();
+}
+
+void SVTK_ViewParameterDlg::onFocalCoordChanged()
+{
+  if ( myBusy ) return;
+
+  if ( mySelectPoint->isChecked() )
+    mySelectPoint->toggle();
+
+  vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+  aCamera->SetFocalPoint(myFocalX->text().toDouble(),
+                        myFocalY->text().toDouble(),
+                        myFocalZ->text().toDouble());
+
+  aCamera->OrthogonalizeViewUp();
+  myRWInteractor->getRenderer()->ResetCameraClippingRange();
+
+  // update view
+  myRWInteractor->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
+
+  myMainWindow->activateSetFocalPointSelected();
+
+  //updateProjection();
+}
+
+void SVTK_ViewParameterDlg::onCameraCoordChanged()
+{
+  if ( myBusy ) return;
+
+  vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+  aCamera->SetPosition(myCameraX->text().toDouble(),
+                      myCameraY->text().toDouble(),
+                      myCameraZ->text().toDouble());
+
+  aCamera->OrthogonalizeViewUp();
+  myRWInteractor->getRenderer()->ResetCameraClippingRange();
+
+  // update view
+  myRWInteractor->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
+
+  //updateProjection();
+}
+
+void SVTK_ViewParameterDlg::onDirectionChanged()
+{
+  if ( myBusy ) return;
+
+  updateCoordinates();
+}
+
+void SVTK_ViewParameterDlg::onDistanceChanged()
+{
+  if ( myBusy ) return;
+
+  updateCoordinates();
+}
+
+void SVTK_ViewParameterDlg::onViewDirectionChanged()
+{
+  if ( myBusy ) return;
+
+  vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+  aCamera->SetViewUp(myViewDirX->text().toDouble(),
+                    myViewDirY->text().toDouble(),
+                    myViewDirZ->text().toDouble());
+
+  // update view
+  myRWInteractor->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
+}
+
+void SVTK_ViewParameterDlg::onZoomChanged()
+{
+  if ( myBusy ) return;
+
+  vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+
+  switch( myProjectionMode->checkedId() ) {
+  case 0:
+    aCamera->SetParallelScale(myScale->text().toDouble());
+    break;
+  case 1:
+    aCamera->SetViewAngle(myViewAngle->text().toDouble());
+    break;
+  }
+
+  // update view
+  myRWInteractor->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
+}
+
+void SVTK_ViewParameterDlg::onClickClose()
+{
+  reject();
+}
+
+void SVTK_ViewParameterDlg::updateProjection()
+{
+  double pnt[3], pos[3], dir[3], dist;
+
+  pnt[0] = myFocalX->text().toDouble();
+  pnt[1] = myFocalY->text().toDouble();
+  pnt[2] = myFocalZ->text().toDouble();
+
+  pos[0] = myCameraX->text().toDouble();
+  pos[1] = myCameraY->text().toDouble();
+  pos[2] = myCameraZ->text().toDouble();
+
+  dir[0] = pnt[0] - pos[0];
+  dir[1] = pnt[1] - pos[1];
+  dir[2] = pnt[2] - pos[2];
+
+  dist = sqrt( dir[0]*dir[0] + dir[1]*dir[1] + dir[2]*dir[2] );
+
+  if ( dist > 0.0002 ) {
+    dir[0] = dir[0] / dist;
+    dir[1] = dir[1] / dist;
+    dir[2] = dir[2] / dist;
+  }
+
+  myBusy = true;
+  myProjDirX->setText(QString::number(dir[0]));
+  myProjDirY->setText(QString::number(dir[1]));
+  myProjDirZ->setText(QString::number(dir[2]));
+
+  myDistance->setText(QString::number(dist));
+  myBusy = false;
+}
+
+void SVTK_ViewParameterDlg::updateCoordinates()
+{
+  double pnt[3], pos[3], dir[3], dist;
+
+  pnt[0] = myFocalX->text().toDouble();
+  pnt[1] = myFocalY->text().toDouble();
+  pnt[2] = myFocalZ->text().toDouble();
+
+  pos[0] = myCameraX->text().toDouble();
+  pos[1] = myCameraY->text().toDouble();
+  pos[2] = myCameraZ->text().toDouble();
+
+  dir[0] = myProjDirX->text().toDouble();
+  dir[1] = myProjDirY->text().toDouble();
+  dir[2] = myProjDirZ->text().toDouble();
+
+  dist = myDistance->text().toDouble();
+
+  if (myCameraPositionMode->checkedId() == 1) {
+    // recompute camera position
+    dir[0] = -dir[0]; dir[1] = -dir[1]; dir[2] = -dir[2];
+    if (computePoint(pnt, dir, dist, pos)) {
+      myBusy = true;
+      myCameraX->setText(QString::number(pos[0]));
+      myCameraY->setText(QString::number(pos[1]));
+      myCameraZ->setText(QString::number(pos[2]));
+      myBusy = false;
+      onCameraCoordChanged();
+    }
+  }
+  else {
+    // recompute focal point
+    if (computePoint(pos, dir, dist, pnt)) {
+      if (mySelectPoint->isChecked())
+       mySelectPoint->toggle();
+      myBusy = true;
+      myFocalX->setText(QString::number(pnt[0]));
+      myFocalY->setText(QString::number(pnt[1]));
+      myFocalZ->setText(QString::number(pnt[2]));
+      myBusy = false;
+      onFocalCoordChanged();
+    }
+  }
+}
+
+bool SVTK_ViewParameterDlg::computePoint(const double start[3], 
+                                        const double dir[3], 
+                                        const double dist, 
+                                        double result[3])
+{
+  double d = sqrt(dir[0]*dir[0]+dir[1]*dir[1]+dir[2]*dir[2]);
+  if ( d < 0.0002 ) return false;
+
+  for (int i = 0; i < 3; i++)
+    result[i] = start[i] + dir[i] * dist / d;
+
+  return true;
+}
diff --git a/src/SVTK/SVTK_ViewParameterDlg.h b/src/SVTK/SVTK_ViewParameterDlg.h
new file mode 100755 (executable)
index 0000000..3a6f3e8
--- /dev/null
@@ -0,0 +1,152 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  File   : 
+//  Author : 
+//  Module : SALOME
+//  $Header:
+//
+#ifndef SVTK_VIEWPARAMETERDLG_H
+#define SVTK_VIEWPARAMETERDLG_H
+
+#include "SVTK.h"
+
+#include "SVTK_DialogBase.h"
+
+#include <vtkSmartPointer.h>
+#include <vtkTimeStamp.h>
+
+class SVTK_ViewWindow;
+class SVTK_RenderWindowInteractor;
+
+class QtxAction;
+
+class QLineEdit;
+class QPushButton;
+class QFrame;
+class QCheckBox;
+class QButtonGroup;
+
+class vtkCallbackCommand;
+class vtkObject;
+
+class SVTK_EXPORT SVTK_ViewParameterDlg : public SVTK_DialogBase
+{
+  Q_OBJECT;
+
+public:
+  SVTK_ViewParameterDlg(QtxAction* theAction,
+                       SVTK_ViewWindow* theParent,
+                       const char* theName);
+
+  ~SVTK_ViewParameterDlg();
+  
+  void addObserver();
+  
+protected:
+  SVTK_ViewWindow *myMainWindow;
+  SVTK_RenderWindowInteractor* myRWInteractor;
+  bool myIsObserverAdded;
+  bool myBusy;
+  
+  QButtonGroup* myProjectionMode;
+
+  QPushButton*  myToBBCenter;
+  QPushButton*  myToOrigin;
+  QPushButton*  mySelectPoint;
+
+  QFrame*       myFocalCoords;
+  QLineEdit*    myFocalX;
+  QLineEdit*    myFocalY;
+  QLineEdit*    myFocalZ;
+  
+  QButtonGroup* myCameraPositionMode;
+
+  QFrame*       myCameraCoords;
+  QLineEdit*    myCameraX;
+  QLineEdit*    myCameraY;
+  QLineEdit*    myCameraZ;
+
+  QFrame*       myProjDirection;
+  QLineEdit*    myProjDirX;
+  QLineEdit*    myProjDirY;
+  QLineEdit*    myProjDirZ;
+
+  QLineEdit*    myDistance;
+
+  QFrame*       myViewDirection;
+  QLineEdit*    myViewDirX;
+  QLineEdit*    myViewDirY;
+  QLineEdit*    myViewDirZ;
+
+  QFrame*       myScaleBox;
+  QLineEdit*    myScale;
+
+  QFrame*       myViewAngleBox;
+  QLineEdit*    myViewAngle;
+
+  void setEnabled(QFrame* theWidget, const bool theState);
+  bool computePoint(const double start[3], const double dir[3], 
+                   const double dist, double result[3]);
+  void updateProjection();
+  void updateCoordinates();
+
+  void updateData();
+
+  //----------------------------------------------------------------------------
+  // Priority at which events are processed
+  vtkFloatingPointType myPriority;
+
+  // Used to process events
+  vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
+
+  // Used to update camera
+  vtkTimeStamp myCameraMTime;
+
+  // Description:
+  // Main process event method
+  static void ProcessEvents(vtkObject* object, 
+                            unsigned long event,
+                            void* clientdata, 
+                            void* calldata);
+
+protected slots:
+  void onProjectionModeChanged(int);
+  void onPositionModeChanged(int);
+  
+  void onToBBCenter();
+  void onToOrigin();
+  void onSelectPoint();
+
+  void onFocalCoordChanged();
+  void onCameraCoordChanged();
+  void onDirectionChanged();
+  void onDistanceChanged();
+  void onViewDirectionChanged();
+
+  void onZoomChanged();
+
+  void onClickClose();
+
+};
+
+#endif // SVTK_VIEWPARAMETERDLG_H
index 56317d592ac77caed86d5de45252ad9ed90f9cfb..b5b67ddc70039a84d004374bd5053e0e0758fa06 100755 (executable)
@@ -1,25 +1,37 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "SVTK_NonIsometricDlg.h"
+#include "SVTK_UpdateRateDlg.h"
+#include "SVTK_CubeAxesDlg.h"
+#include "SVTK_SetRotationPointDlg.h"
+#include "SVTK_ViewParameterDlg.h"
+
 #include "SALOME_Actor.h"
 
-#include <qapplication.h>
-#include <qimage.h>
+#include <QToolBar>
+#include <QEvent>
+#include <QXmlStreamWriter>
+#include <QXmlStreamReader>
+#include <QXmlStreamAttributes>
 
 #include <vtkTextProperty.h>
 #include <vtkActorCollection.h>
 #include <vtkCellPicker.h>
 #include <vtkAxisActor2D.h>
 #include <vtkGL2PSExporter.h>
+#include <vtkInteractorStyle.h>
 
 #include "QtxAction.h"
 
 #include "SUIT_Session.h"
-#include "SUIT_ToolButton.h"
 #include "SUIT_MessageBox.h"
 #include "SUIT_Accel.h"
-
 #include "SUIT_Tools.h"
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_Accel.h"
+#include "SUIT_OverrideCursor.h"
+#include "QtxActionToolMgr.h"
+#include "QtxMultiAction.h"
 
 #include "VTKViewer_Utilities.h"
+#include "VTKViewer_Trihedron.h"
 
 #include "SVTK_View.h"
-#include "SVTK_MainWindow.h"
+//#include "SVTK_MainWindow.h"
 #include "SVTK_Selector.h"
 
 #include "SVTK_Event.h"
 #include "SVTK_RenderWindowInteractor.h"
 #include "SVTK_GenericRenderWindowInteractor.h"
 #include "SVTK_CubeAxesActor2D.h"
+#include "SVTK_ComboAction.h"
+#include "SVTK_KeyFreeInteractorStyle.h"
+#include "SVTK_Selector.h"
+#include "SVTK_Recorder.h"
+#include "SVTK_RecorderDlg.h"
 
 #include "SALOME_ListIteratorOfListIO.hxx"
 
@@ -90,63 +110,85 @@ namespace SVTK
 /*!
   Constructor
 */
-SVTK_ViewWindow
-::SVTK_ViewWindow(SUIT_Desktop* theDesktop):
+SVTK_ViewWindow::SVTK_ViewWindow(SUIT_Desktop* theDesktop):
   SUIT_ViewWindow(theDesktop),
-  myMainWindow(NULL),
   myView(NULL),
-  myDumpImage(QImage())
-{}
+  myDumpImage(QImage()),
+  myKeyFreeInteractorStyle(SVTK_KeyFreeInteractorStyle::New())
+{
+  setWindowFlags( windowFlags() & ~Qt::Window );
+  // specific of vtkSmartPointer
+  myKeyFreeInteractorStyle->Delete();
+}
 
 /*!
   To initialize #SVTK_ViewWindow instance
 */
-void
-SVTK_ViewWindow
-::Initialize(SVTK_ViewModelBase* theModel)
+void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
 {
-  if(SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr()){
-    myMainWindow = new SVTK_MainWindow(this,"SVTK_MainWindow",aResourceMgr,this);
-
-    SVTK_RenderWindowInteractor* anIteractor = 
-      new SVTK_RenderWindowInteractor(myMainWindow,"SVTK_RenderWindowInteractor");
-
-    SVTK_Selector* aSelector = SVTK_Selector::New();
-
-    SVTK_GenericRenderWindowInteractor* aDevice = 
-      SVTK_GenericRenderWindowInteractor::New();
-    aDevice->SetRenderWidget(anIteractor);
-    aDevice->SetSelector(aSelector);
-
-    SVTK_Renderer* aRenderer = SVTK_Renderer::New();
-    aRenderer->Initialize(aDevice,aSelector);
-
-    anIteractor->Initialize(aDevice,aRenderer,aSelector);
-
-    aDevice->Delete();
-    aRenderer->Delete();
-    aSelector->Delete();
-
-    myMainWindow->Initialize(anIteractor);
-
-    SVTK_InteractorStyle* aStyle = SVTK_InteractorStyle::New();
-    anIteractor->PushInteractorStyle(aStyle);
-    aStyle->Delete();
-
-    setCentralWidget(myMainWindow);
-    
-    myView = new SVTK_View(myMainWindow);
-    Initialize(myView,theModel);
-  }
+  myInteractor = new SVTK_RenderWindowInteractor(this,"SVTK_RenderWindowInteractor");
+  
+  SVTK_Selector* aSelector = SVTK_Selector::New();
+  
+  SVTK_GenericRenderWindowInteractor* aDevice = SVTK_GenericRenderWindowInteractor::New();
+  aDevice->SetRenderWidget(myInteractor);
+  aDevice->SetSelector(aSelector);
+  
+  SVTK_Renderer* aRenderer = SVTK_Renderer::New();
+  aRenderer->Initialize(aDevice,aSelector);
+  
+  myInteractor->Initialize(aDevice,aRenderer,aSelector);
+  
+  aDevice->Delete();
+  aRenderer->Delete();
+  aSelector->Delete();
+  
+  myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), -1, this );
+  myRecordingToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_RECORD_LABEL"), -1, this );
+  
+  createActions( SUIT_Session::session()->activeApplication()->resourceMgr() );
+  createToolBar();
+  
+  SetEventDispatcher(myInteractor->GetDevice());
+  myInteractor->setBackgroundRole( QPalette::NoRole );//NoBackground
+  myInteractor->setFocusPolicy(Qt::StrongFocus);
+  myInteractor->setFocus();
+  setFocusProxy(myInteractor);
+  
+  myUpdateRateDlg = new SVTK_UpdateRateDlg( getAction( UpdateRate ), this, "SVTK_UpdateRateDlg" );
+  myNonIsometricDlg = new SVTK_NonIsometricDlg( getAction( NonIsometric ), this, "SVTK_NonIsometricDlg" );
+  myCubeAxesDlg = new SVTK_CubeAxesDlg( getAction( GraduatedAxes ), this, "SVTK_CubeAxesDlg" );
+  mySetRotationPointDlg = new SVTK_SetRotationPointDlg
+    ( getAction( ChangeRotationPointId ), this, "SVTK_SetRotationPointDlg" );
+  myViewParameterDlg = new SVTK_ViewParameterDlg
+    ( getAction( ViewParametersId ), this, "SVTK_ViewParameterDlg" );
+  
+  SVTK_InteractorStyle* aStyle = SVTK_InteractorStyle::New();
+  myInteractor->PushInteractorStyle(aStyle);
+  aStyle->Delete();
+  
+  myRecorder = SVTK_Recorder::New();
+  
+  myRecorder->SetNbFPS( 17.3 );
+  myRecorder->SetQuality( 100 );
+  myRecorder->SetProgressiveMode( true );
+  myRecorder->SetUseSkippedFrames( true );
+  myRecorder->SetRenderWindow( myInteractor->getRenderWindow() );
+  
+  setCentralWidget(myInteractor);
+  
+  myView = new SVTK_View(this);
+  Initialize(myView,theModel);
+  
+  myInteractor->getRenderWindow()->Render();
+  onResetView();
 }
 
 /*!
   To initialize #SVTK_ViewWindow instance
 */
-void
-SVTK_ViewWindow
-::Initialize(SVTK_View* theView,
-            SVTK_ViewModelBase* theModel)
+void SVTK_ViewWindow::Initialize(SVTK_View* theView,
+                                SVTK_ViewModelBase* theModel)
 {
   connect(theView,SIGNAL(KeyPressed(QKeyEvent*)),
           this,SLOT(onKeyPressed(QKeyEvent*)) );
@@ -169,157 +211,142 @@ SVTK_ViewWindow
 /*!
   Destructor
 */
-SVTK_ViewWindow
-::~SVTK_ViewWindow()
+SVTK_ViewWindow::~SVTK_ViewWindow()
 {}
 
 
 /*!
   \return corresponding view
 */
-SVTK_View* 
-SVTK_ViewWindow
-::getView() 
+SVTK_View* SVTK_ViewWindow::getView() 
 { 
   return myView; 
 }
 
 /*!
-  \return corresponding vtk main window
+  \return corresponding vtk render window
 */
-SVTK_MainWindow* 
-SVTK_ViewWindow
-::getMainWindow() 
-{ 
-  return myMainWindow; 
+vtkRenderWindow* SVTK_ViewWindow::getRenderWindow()
+{
+  return GetInteractor()->getRenderWindow();
 }
 
 /*!
-  \return corresponding vtk render window
+  \return corresponding vtk render window interactor
 */
-vtkRenderWindow*
-SVTK_ViewWindow
-::getRenderWindow()
+SVTK_RenderWindowInteractor* SVTK_ViewWindow::GetInteractor() const
 {
-  return getMainWindow()->getRenderWindow();
+  return myInteractor;
 }
 
 /*!
   \return corresponding vtk render window interactor
 */
-vtkRenderWindowInteractor*
-SVTK_ViewWindow
-::getInteractor()
+vtkRenderWindowInteractor* SVTK_ViewWindow::getInteractor() const
 {
-  return getMainWindow()->getInteractor();
+  return myInteractor->GetDevice();
 }
 
 /*!
   \return corresponding vtk renderer
 */
-vtkRenderer*
-SVTK_ViewWindow
-::getRenderer()
+vtkRenderer* SVTK_ViewWindow::getRenderer() const
 {
-  return myMainWindow->getRenderer();
+  return GetInteractor()->getRenderer();
+}
+
+/*!
+  Redirect the request to SVTK_RenderWindowInteractor::GetRenderer
+*/
+SVTK_Renderer* SVTK_ViewWindow::GetRenderer() const
+{
+  return GetInteractor()->GetRenderer();
 }
 
 /*!
   \return corresponding vtk selector
 */
-SVTK_Selector* 
-SVTK_ViewWindow
-::GetSelector() 
+SVTK_Selector* SVTK_ViewWindow::GetSelector() const
 { 
-  return myMainWindow->GetSelector(); 
+  return GetInteractor()->GetSelector(); 
 }
 
 /*!
   Processes transformation "front view"
 */
-void
-SVTK_ViewWindow
-::onFrontView()
+void SVTK_ViewWindow::onFrontView()
 {
-  myMainWindow->onFrontView();
+  GetRenderer()->OnFrontView();
+  Repaint();
 }
 
 /*!
   Processes transformation "back view"
 */
-void
-SVTK_ViewWindow
-::onBackView()
+void SVTK_ViewWindow::onBackView()
 {
-  myMainWindow->onBackView();
+  GetRenderer()->OnBackView();
+  Repaint();
 }
 
 /*!
   Processes transformation "top view"
 */
-void
-SVTK_ViewWindow
-::onTopView()
+void SVTK_ViewWindow::onTopView()
 {
-  myMainWindow->onTopView();
+  GetRenderer()->OnTopView();
+  Repaint();
 }
 
 /*!
   Processes transformation "bottom view"
 */
-void
-SVTK_ViewWindow
-::onBottomView()
+void SVTK_ViewWindow::onBottomView()
 {
-  myMainWindow->onBottomView();
+  GetRenderer()->OnBottomView();
+  Repaint();
 }
 
 /*!
   Processes transformation "left view"
 */
-void
-SVTK_ViewWindow
-::onLeftView()
+void SVTK_ViewWindow::onLeftView()
 {
-  myMainWindow->onLeftView();
+  GetRenderer()->OnLeftView();
+  Repaint();
 }
 
 /*!
   Processes transformation "right view"
 */
-void
-SVTK_ViewWindow
-::onRightView()
+void SVTK_ViewWindow::onRightView()
 {
-  myMainWindow->onRightView();
+  GetRenderer()->OnRightView();
+  Repaint();
 }
 
 /*!
   Processes transformation "reset view": sets default orientation of viewport camera
 */
-void
-SVTK_ViewWindow
-::onResetView()
+void SVTK_ViewWindow::onResetView()
 {
-  myMainWindow->onResetView();
+  GetRenderer()->OnResetView();
+  Repaint();
 }
 
 /*!
   Processes transformation "fit all"
 */
-void
-SVTK_ViewWindow
-::onFitAll()
+void SVTK_ViewWindow::onFitAll()
 {
-  myMainWindow->onFitAll();
+  GetRenderer()->OnFitAll();
+  Repaint();
 }
 
 /*!
   SLOT: called if selection is changed
 */
-void
-SVTK_ViewWindow
-::onSelectionChanged()
+void SVTK_ViewWindow::onSelectionChanged()
 {
   myView->onSelectionChanged();
 }
@@ -328,29 +355,23 @@ SVTK_ViewWindow
   Change selection mode
   \param theMode - new selection mode
 */
-void
-SVTK_ViewWindow
-::SetSelectionMode(Selection_Mode theMode)
+void SVTK_ViewWindow::SetSelectionMode(Selection_Mode theMode)
 {
-  myMainWindow->SetSelectionMode( theMode );
+  GetSelector()->SetSelectionMode(theMode);
 }
 
 /*!
   \return selection mode
 */
-Selection_Mode
-SVTK_ViewWindow
-::SelectionMode() const
+Selection_Mode SVTK_ViewWindow::SelectionMode() const
 {
-  return myMainWindow->SelectionMode();
+  return GetSelector()->SelectionMode();
 }
 
 /*!
   Unhilights all objects in viewer
 */
-void 
-SVTK_ViewWindow
-::unHighlightAll() 
+void SVTK_ViewWindow::unHighlightAll() 
 {
   myView->unHighlightAll();
 }
@@ -361,11 +382,9 @@ SVTK_ViewWindow
   \param theIsHighlight - if it is true, object will be hilighted, otherwise it will be unhilighted
   \param theIsUpdate - update current viewer
 */
-void
-SVTK_ViewWindow
-::highlight(const Handle(SALOME_InteractiveObject)& theIO, 
-           bool theIsHighlight, 
-           bool theIsUpdate ) 
+void SVTK_ViewWindow::highlight(const Handle(SALOME_InteractiveObject)& theIO, 
+                               bool theIsHighlight, 
+                               bool theIsUpdate ) 
 {
   myView->highlight( theIO, theIsHighlight, theIsUpdate );
 }
@@ -374,9 +393,7 @@ SVTK_ViewWindow
   \return true if object is in viewer or in collector
   \param theIO - object to be checked
 */
-bool
-SVTK_ViewWindow
-::isInViewer( const Handle(SALOME_InteractiveObject)& theIO ) 
+bool SVTK_ViewWindow::isInViewer( const Handle(SALOME_InteractiveObject)& theIO ) 
 {
   return myView->isInViewer( theIO );
 }
@@ -385,9 +402,7 @@ SVTK_ViewWindow
   \return true if object is displayed in viewer
   \param theIO - object to be checked
 */
-bool
-SVTK_ViewWindow
-::isVisible( const Handle(SALOME_InteractiveObject)& theIO ) 
+bool SVTK_ViewWindow::isVisible( const Handle(SALOME_InteractiveObject)& theIO ) 
 {
   return myView->isVisible( theIO );
 }
@@ -396,9 +411,7 @@ SVTK_ViewWindow
   Display object
   \param theEntry - entry that corresponds to intractive objects
 */
-Handle(SALOME_InteractiveObject)
-SVTK_ViewWindow
-::FindIObject(const char* theEntry) 
+Handle(SALOME_InteractiveObject) SVTK_ViewWindow::FindIObject(const char* theEntry) 
 {
   return myView->FindIObject(theEntry);
 }
@@ -408,10 +421,8 @@ SVTK_ViewWindow
   \param theIO - object
   \param theImmediatly - update viewer
 */
-void
-SVTK_ViewWindow
-::Display(const Handle(SALOME_InteractiveObject)& theIO,
-         bool theImmediatly) 
+void SVTK_ViewWindow::Display(const Handle(SALOME_InteractiveObject)& theIO,
+                             bool theImmediatly) 
 {
   myView->Display(theIO,theImmediatly);
 }
@@ -421,10 +432,8 @@ SVTK_ViewWindow
   \param theIO - object
   \param theImmediatly - update viewer
 */
-void
-SVTK_ViewWindow
-::Erase(const Handle(SALOME_InteractiveObject)& theIO,
-         bool theImmediatly) 
+void SVTK_ViewWindow::Erase(const Handle(SALOME_InteractiveObject)& theIO,
+                           bool theImmediatly) 
 {
   myView->Erase(theIO,theImmediatly);
 }
@@ -433,9 +442,7 @@ SVTK_ViewWindow
   Display only passed object
   \param theIO - object
 */
-void
-SVTK_ViewWindow
-::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIO) 
+void SVTK_ViewWindow::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIO) 
 {
   myView->DisplayOnly(theIO);
 }
@@ -443,9 +450,7 @@ SVTK_ViewWindow
 /*!
   Display all objects in view
 */
-void 
-SVTK_ViewWindow
-::DisplayAll() 
+void SVTK_ViewWindow::DisplayAll() 
 {
   myView->DisplayAll();
 }
@@ -453,9 +458,7 @@ SVTK_ViewWindow
 /*!
   Erase all objects in view
 */
-void 
-SVTK_ViewWindow
-::EraseAll() 
+void SVTK_ViewWindow::EraseAll() 
 {
   myView->EraseAll();
 }
@@ -464,122 +467,248 @@ SVTK_ViewWindow
   Sets background color
   \param color - new background color
 */
-void
-SVTK_ViewWindow
-::setBackgroundColor( const QColor& color )
+void SVTK_ViewWindow::setBackgroundColor( const QColor& theColor )
 {
-  myMainWindow->SetBackgroundColor( color );
-  SUIT_ViewWindow::setBackgroundColor( color );
+  getRenderer()->SetBackground(theColor.red()/255.0, 
+                              theColor.green()/255.0,
+                              theColor.blue()/255.0);
 }
 
 /*!
   \return background color of viewer
 */
-QColor
-SVTK_ViewWindow
-::backgroundColor() const
+QColor SVTK_ViewWindow::backgroundColor() const
+{
+  vtkFloatingPointType aBackgroundColor[3];
+  getRenderer()->GetBackground(aBackgroundColor);
+  return QColor(int(aBackgroundColor[0]*255), 
+               int(aBackgroundColor[1]*255), 
+               int(aBackgroundColor[2]*255));
+}
+
+
+/*!
+  Redirect the request to SVTK_RenderWindowInteractor::GetInteractorStyle
+*/
+vtkInteractorStyle* SVTK_ViewWindow::GetInteractorStyle() const
+{
+  return GetInteractor()->GetInteractorStyle();
+}
+
+/*!
+  Redirect the request to SVTK_RenderWindowInteractor::PushInteractorStyle
+*/
+void SVTK_ViewWindow::PushInteractorStyle(vtkInteractorStyle* theStyle)
 {
-  return myMainWindow->BackgroundColor();
+  GetInteractor()->PushInteractorStyle(theStyle);
+}
+
+/*!
+  Redirect the request to SVTK_RenderWindowInteractor::PopInteractorStyle
+*/
+void SVTK_ViewWindow::PopInteractorStyle()
+{
+  GetInteractor()->PopInteractorStyle();
 }
 
 /*!
   Updates current viewer
 */
-void
-SVTK_ViewWindow
-::Repaint(bool theUpdateTrihedron)
+void SVTK_ViewWindow::Repaint(bool theUpdateTrihedron)
 {
-  myMainWindow->Repaint( theUpdateTrihedron );
+  if(theUpdateTrihedron) 
+    GetRenderer()->OnAdjustTrihedron();
+
+  GetInteractor()->update();
+
+  SVTK_InteractorStyle* aStyle = (SVTK_InteractorStyle*)getInteractor()->GetInteractorStyle();
+  if ( aStyle )
+    aStyle->OnTimer();
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::GetScale
 */
-void
-SVTK_ViewWindow
-::GetScale( double theScale[3] ) 
+void SVTK_ViewWindow::GetScale( double theScale[3] ) 
 {
-  myMainWindow->GetScale( theScale );
+  GetRenderer()->GetScale( theScale );
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::SetScale
 */
-void
-SVTK_ViewWindow
-::SetScale( double theScale[3] ) 
+void SVTK_ViewWindow::SetScale( double theScale[3] ) 
 {
-  myMainWindow->SetScale( theScale );
+  GetRenderer()->SetScale( theScale );
+  Repaint();
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::IsTrihedronDisplayed
 */
-bool
-SVTK_ViewWindow
-::isTrihedronDisplayed()
+bool SVTK_ViewWindow::isTrihedronDisplayed()
 {
-  return myMainWindow->IsTrihedronDisplayed();
+  return GetRenderer()->IsTrihedronDisplayed();
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::IsCubeAxesDisplayed
 */
-bool
-SVTK_ViewWindow
-::isCubeAxesDisplayed()
+bool SVTK_ViewWindow::isCubeAxesDisplayed()
 {
-  return myMainWindow->IsCubeAxesDisplayed();
+  return GetRenderer()->IsCubeAxesDisplayed();
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::OnViewTrihedron
 */
-void 
-SVTK_ViewWindow
-::onViewTrihedron()
+void SVTK_ViewWindow::onViewTrihedron()
 {
-  myMainWindow->onViewTrihedron();
+  GetRenderer()->OnViewTrihedron();
+  Repaint();
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::OnViewCubeAxes
 */
-void
-SVTK_ViewWindow
-::onViewCubeAxes()
+void SVTK_ViewWindow::onViewCubeAxes()
 {
-  myMainWindow->onViewCubeAxes();
+  GetRenderer()->OnViewCubeAxes();
+  Repaint();
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::GetTrihedron
 */
-VTKViewer_Trihedron* 
-SVTK_ViewWindow::
-GetTrihedron()
+VTKViewer_Trihedron* SVTK_ViewWindow::GetTrihedron()
 {
-  return myMainWindow->GetTrihedron();
+  return GetRenderer()->GetTrihedron();
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::GetCubeAxes
 */
-SVTK_CubeAxesActor2D* 
-SVTK_ViewWindow
-::GetCubeAxes()
+SVTK_CubeAxesActor2D* SVTK_ViewWindow::GetCubeAxes()
 {
-  return myMainWindow->GetCubeAxes();
+  return GetRenderer()->GetCubeAxes();
 }
 
 /*!
   \return trihedron size
 */
-vtkFloatingPointType
-SVTK_ViewWindow
-::GetTrihedronSize() const
+vtkFloatingPointType SVTK_ViewWindow::GetTrihedronSize() const
+{
+  return GetRenderer()->GetTrihedronSize();
+}
+
+/*!
+  Sets projection mode
+  \param theMode - projection mode ( 0 - orthogonal, 1 - perspective )
+*/
+void SVTK_ViewWindow::SetProjectionMode(const int theMode)
 {
-  return myMainWindow->GetTrihedronSize();
+  activateProjectionMode( theMode );
+}
+
+
+/*!
+  Set the gravity center as a focal point
+*/
+void SVTK_ViewWindow::activateSetFocalPointGravity()
+{
+  myEventDispatcher->InvokeEvent(SVTK::SetFocalPointGravity, 0);
+}
+
+/*!
+  Set the selected point as a focal point
+*/
+void SVTK_ViewWindow::activateSetFocalPointSelected()
+{
+  myEventDispatcher->InvokeEvent(SVTK::SetFocalPointSelected, 0);
+}
+
+/*!
+  Set the point selected by user as a focal point
+*/
+void SVTK_ViewWindow::activateStartFocalPointSelection()
+{
+  myEventDispatcher->InvokeEvent(SVTK::StartFocalPointSelection,0);
+}
+
+void SVTK_ViewWindow::activateProjectionMode(int theMode)
+{
+  if (theMode)
+    toolMgr()->action( ProjectionModeId )->setChecked( true );
+  else
+    toolMgr()->action( ParallelModeId )->setChecked( true );
+}
+
+/*!
+  Sets actual interaction style
+  \param theStyle - type of interaction style ( 0 - standard, 1 - keyboard free )
+*/
+void SVTK_ViewWindow::SetInteractionStyle(const int theStyle)
+{
+  onSwitchInteractionStyle( theStyle==1 );
+}
+
+/*!
+  Switches "keyboard free" interaction style on/off
+*/
+void SVTK_ViewWindow::onSwitchInteractionStyle(bool theOn)
+{
+  if (theOn) {
+    // check if style is already set
+    if ( GetInteractorStyle() != myKeyFreeInteractorStyle.GetPointer() )
+    {
+      // keep the same style extensions
+      SVTK_InteractorStyle* aStyle = (SVTK_InteractorStyle*)GetInteractorStyle();
+      if ( aStyle ) {
+       myKeyFreeInteractorStyle->SetControllerIncrement(aStyle->ControllerIncrement());
+       myKeyFreeInteractorStyle->SetControllerOnKeyDown(aStyle->ControllerOnKeyDown());
+      }
+
+      PushInteractorStyle(myKeyFreeInteractorStyle.GetPointer());
+    }
+  }
+  else {
+    // pop only key free  style
+    if ( GetInteractorStyle() == myKeyFreeInteractorStyle.GetPointer() )
+      PopInteractorStyle();
+  }
+
+  // update action state if method is called outside
+  QtxAction* a = getAction( SwitchInteractionStyleId );
+  if ( a->isChecked() != theOn ) a->setChecked( theOn );
+}
+
+/*!
+  Sets incremental speed
+  \param theValue - new incremental speed
+  \param theMode - modification mode
+*/
+void SVTK_ViewWindow::SetIncrementalSpeed(const int theValue, const int theMode)
+{
+  if ( (SVTK_InteractorStyle*)GetInteractorStyle() )
+    ((SVTK_InteractorStyle*)GetInteractorStyle())->SetIncrementSpeed(theValue, theMode);
+}
+
+/*!
+  Sets spacemouse buttons for the functions
+  \param theBtn1 - spacemouse button for the "decrease speed increment"
+  \param theBtn2 - spacemouse button for the "increase speed increment"
+  \param theBtn3 - spacemouse button for the "dominant combined switch"
+*/
+void SVTK_ViewWindow::SetSpacemouseButtons(const int theBtn1, 
+                                          const int theBtn2,
+                                          const int theBtn3)
+{
+  int val = theBtn1;
+  myEventDispatcher->InvokeEvent(SVTK::SetSMDecreaseSpeedEvent, &val);
+  val = theBtn2;
+  myEventDispatcher->InvokeEvent(SVTK::SetSMIncreaseSpeedEvent, &val);
+  val = theBtn3;
+  myEventDispatcher->InvokeEvent(SVTK::SetSMDominantCombinedSwitchEvent, &val);
 }
 
 /*!
@@ -587,49 +716,41 @@ SVTK_ViewWindow
   \param theSize - new trihedron size
   \param theRelative - trihedron relativeness
 */
-void
-SVTK_ViewWindow
-::SetTrihedronSize(const vtkFloatingPointType theSize, const bool theRelative)
+void SVTK_ViewWindow::SetTrihedronSize(const vtkFloatingPointType theSize, const bool theRelative)
 {
-  myMainWindow->SetTrihedronSize(theSize, theRelative);
+  GetRenderer()->SetTrihedronSize(theSize, theRelative);
+  Repaint();
 }
 
 /*! If parameter theIsForcedUpdate is true, recalculate parameters for
  *  trihedron and cube axes, even if trihedron and cube axes is invisible.
  */
-void
-SVTK_ViewWindow
-::AdjustTrihedrons(const bool theIsForcedUpdate)
+void SVTK_ViewWindow::AdjustTrihedrons(const bool theIsForcedUpdate)
 {
-  myMainWindow->AdjustActors();
+  GetRenderer()->AdjustActors();
+  Repaint();
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::OnAdjustTrihedron
 */
-void
-SVTK_ViewWindow
-::onAdjustTrihedron()
+void SVTK_ViewWindow::onAdjustTrihedron()
 {   
-  myMainWindow->onAdjustTrihedron();
+  GetRenderer()->OnAdjustTrihedron();
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::OnAdjustCubeAxes
 */
-void
-SVTK_ViewWindow
-::onAdjustCubeAxes()
+void SVTK_ViewWindow::onAdjustCubeAxes()
 {   
-  myMainWindow->onAdjustCubeAxes();
+  GetRenderer()->OnAdjustCubeAxes();
 }
 
 /*!
   Emits key pressed
 */
-void
-SVTK_ViewWindow
-::onKeyPressed(QKeyEvent* event)
+void SVTK_ViewWindow::onKeyPressed(QKeyEvent* event)
 {
   emit keyPressed( this, event );
 }
@@ -637,9 +758,7 @@ SVTK_ViewWindow
 /*!
   Emits key released
 */
-void
-SVTK_ViewWindow
-::onKeyReleased(QKeyEvent* event)
+void SVTK_ViewWindow::onKeyReleased(QKeyEvent* event)
 {
   emit keyReleased( this, event );
 }
@@ -647,9 +766,7 @@ SVTK_ViewWindow
 /*!
   Emits mouse pressed
 */
-void
-SVTK_ViewWindow
-::onMousePressed(QMouseEvent* event)
+void SVTK_ViewWindow::onMousePressed(QMouseEvent* event)
 {
   emit mousePressed(this, event);
 }
@@ -657,9 +774,7 @@ SVTK_ViewWindow
 /*!
   Emits mouse released
 */
-void
-SVTK_ViewWindow
-::onMouseReleased(QMouseEvent* event)
+void SVTK_ViewWindow::onMouseReleased(QMouseEvent* event)
 {
   emit mouseReleased( this, event );
 }
@@ -667,9 +782,7 @@ SVTK_ViewWindow
 /*!
   Emits mouse moving
 */
-void
-SVTK_ViewWindow
-::onMouseMoving(QMouseEvent* event)
+void SVTK_ViewWindow::onMouseMoving(QMouseEvent* event)
 {
   emit mouseMoving( this, event );
 }
@@ -677,9 +790,7 @@ SVTK_ViewWindow
 /*!
   Emits mouse double clicked
 */
-void
-SVTK_ViewWindow
-::onMouseDoubleClicked( QMouseEvent* event )
+void SVTK_ViewWindow::onMouseDoubleClicked( QMouseEvent* event )
 {
   emit mouseDoubleClicked( this, event );
 }
@@ -687,34 +798,51 @@ SVTK_ViewWindow
 /*!
   Redirect the request to #SVTK_Renderer::AddActor
 */
-void
-SVTK_ViewWindow
-::AddActor( VTKViewer_Actor* theActor, 
-           bool theUpdate )
+void SVTK_ViewWindow::AddActor( VTKViewer_Actor* theActor, 
+                               bool theUpdate )
 {
-  myMainWindow->AddActor( theActor, theUpdate );
+  GetRenderer()->AddActor(theActor);
+  if(theUpdate) 
+    Repaint();
+  emit actorAdded(theActor);
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::RemoveActor
 */
-void
-SVTK_ViewWindow
-::RemoveActor( VTKViewer_Actor* theActor, 
-              bool theUpdate )
+void SVTK_ViewWindow::RemoveActor( VTKViewer_Actor* theActor, 
+                                  bool theUpdate )
 {
-  myMainWindow->RemoveActor( theActor, theUpdate );
+  GetRenderer()->RemoveActor(theActor);
+  if(theUpdate) 
+    Repaint();
+  emit actorRemoved(theActor);
+}
+
+QImage SVTK_ViewWindow::dumpViewContent()
+{
+  vtkRenderWindow* aWindow = getRenderWindow();
+  int* aSize = aWindow->GetSize();
+  int aWidth = aSize[0];
+  int aHeight = aSize[1];
+  
+  unsigned char *aData = 
+    aWindow->GetRGBACharPixelData( 0, 0, aWidth-1, aHeight-1, 0 );
+  
+  QImage anImage( aData, aWidth, aHeight, QImage::Format_ARGB32 );
+
+  anImage = anImage.rgbSwapped();
+  anImage = anImage.mirrored();
+  return anImage;
 }
 
 /*!
   \return QImage, containing all scene rendering in window
 */
-QImage
-SVTK_ViewWindow
-::dumpView()
-{    
-  if ( myMainWindow->getToolBar()->hasMouse() || myDumpImage.isNull() )
-    return myMainWindow->dumpView();
+QImage SVTK_ViewWindow::dumpView()
+{
+  if( myDumpImage.isNull() )
+    return dumpViewContent();
   
   return myDumpImage;
 }
@@ -729,7 +857,7 @@ bool SVTK_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileNa
   if ( format != "PS" && format != "EPS" && format != "PDF" )
     return SUIT_ViewWindow::dumpViewToFormat( img, fileName, format );
 
-  QApplication::setOverrideCursor( Qt::waitCursor );
+  SUIT_OverrideCursor wc;
 
   vtkGL2PSExporter *anExporter = vtkGL2PSExporter::New();
   anExporter->SetRenderWindow(getRenderWindow());
@@ -751,11 +879,10 @@ bool SVTK_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileNa
   QString aFilePrefix(fileName);
   QString anExtension(SUIT_Tools::extension(fileName));
   aFilePrefix.truncate(aFilePrefix.length() - 1 - anExtension.length());
-  anExporter->SetFilePrefix(aFilePrefix.latin1());
+  anExporter->SetFilePrefix(aFilePrefix.toLatin1().data());
   anExporter->Write();
   anExporter->Delete();
 
-  QApplication::restoreOverrideCursor();
   return true;
 }
 
@@ -764,18 +891,16 @@ bool SVTK_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileNa
 */
 void SVTK_ViewWindow::RefreshDumpImage()
 {
-  myDumpImage = myMainWindow->dumpView();
+  myDumpImage = dumpViewContent();
 }
 
 /*!
   Redirect the request to #SVTK_Renderer::SetSelectionProp
 */
-void
-SVTK_ViewWindow
-::SetSelectionProp(const double& theRed, 
-                  const double& theGreen, 
-                  const double& theBlue, 
-                  const int& theWidth) 
+void SVTK_ViewWindow::SetSelectionProp(const double& theRed, 
+                                      const double& theGreen, 
+                                      const double& theBlue, 
+                                      const int& theWidth) 
 {
   myView->SetSelectionProp(theRed,theGreen,theBlue,theWidth);
 }
@@ -783,12 +908,10 @@ SVTK_ViewWindow
 /*!
   Redirect the request to #SVTK_Renderer::SetSelectionProp
 */
-void
-SVTK_ViewWindow
-::SetPreselectionProp(const double& theRed, 
-                     const double& theGreen, 
-                     const double& theBlue, 
-                     const int& theWidth) 
+void SVTK_ViewWindow::SetPreselectionProp(const double& theRed, 
+                                         const double& theGreen, 
+                                         const double& theBlue, 
+                                         const int& theWidth) 
 {
   myView->SetPreselectionProp(theRed,theGreen,theBlue,theWidth);
 }
@@ -796,47 +919,51 @@ SVTK_ViewWindow
 /*!
   Redirect the request to #SVTK_Renderer::SetSelectionTolerance
 */
-void
-SVTK_ViewWindow
-::SetSelectionTolerance(const double& theTolNodes, 
-                       const double& theTolItems,
-                       const double& theTolObjects)
+void SVTK_ViewWindow::SetSelectionTolerance(const double& theTolNodes, 
+                                           const double& theTolItems,
+                                           const double& theTolObjects)
 {
-  myView->SetSelectionTolerance(theTolNodes,theTolItems, theTolObjects);
+  myView->SetSelectionTolerance(theTolNodes, theTolItems, theTolObjects);
 }
 
 /*!
   Performs action
   \param accelAction - action
 */
-bool 
-SVTK_ViewWindow
-::action( const int accelAction  )
+bool SVTK_ViewWindow::action( const int accelAction  )
 {
-  if ( !myMainWindow->hasFocus() )
-    return false;
   if ( accelAction == SUIT_Accel::ZoomFit )
     onFitAll();
   else {
     int anEvent = SVTK::convertAction( accelAction );
-    myMainWindow->InvokeEvent( anEvent, 0 );
+    GetInteractor()->InvokeEvent(anEvent, 0);
   }
   return true;
 }
 
+/*!
+  \return action by it's id
+*/
+QtxAction* SVTK_ViewWindow::getAction( int id ) const
+{
+  return dynamic_cast<QtxAction*>( toolMgr()->action( id ) );
+}
+
+
 // old visual parameters had 13 values.  New format added additional 
 // 76 values for graduated axes, so both numbers are processed.
 const int nNormalParams = 13;   // number of view windows parameters excluding graduated axes params
 const int nGradAxisParams = 25; // number of parameters of ONE graduated axis (X, Y, or Z)
-const int nAllParams = nNormalParams + 3*nGradAxisParams + 1; // number of all visual parameters
+const int nTrihedronParams = 3; // number of parameters for Trihedron
+const int nAllParams = nNormalParams + 3*nGradAxisParams + nTrihedronParams + 1; // number of all visual parameters
 
 /*! The method returns visual parameters of a graduated axis actor (x,y,z axis of graduated axes)
  */
-QString getGradAxisVisualParams( vtkAxisActor2D* actor )
+void getGradAxisVisualParams( QXmlStreamWriter& writer, vtkAxisActor2D* actor, QString theAxis )
 {
-  QString params;
+  //QString params;
   if ( !actor )
-    return params;
+    return ;//params;
 
   // Name
   bool isVisible = actor->GetTitleVisibility();
@@ -856,8 +983,26 @@ QString getGradAxisVisualParams( vtkAxisActor2D* actor )
     italic = txtProp->GetItalic();
     shadow = txtProp->GetShadow();
   }
-  params.sprintf( "* Graduated Axis: * Name *%u*%s*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible, 
-                 title.latin1(), color[0], color[1], color[2], font, bold, italic, shadow );
+  writer.writeStartElement("GraduatedAxis");
+  writer.writeAttribute("Axis", theAxis);
+
+  writer.writeStartElement("Title");
+  writer.writeAttribute("isVisible", QString("%1").arg(isVisible));
+  writer.writeAttribute("Text", title);
+  writer.writeAttribute("Font", QString("%1").arg(font));
+  writer.writeAttribute("Bold", QString("%1").arg(bold));
+  writer.writeAttribute("Italic", QString("%1").arg(italic));
+  writer.writeAttribute("Shadow", QString("%1").arg(shadow));
+
+  writer.writeStartElement("Color");
+  writer.writeAttribute("R", QString("%1").arg(color[0]));
+  writer.writeAttribute("G", QString("%1").arg(color[1]));
+  writer.writeAttribute("B", QString("%1").arg(color[2]));
+  writer.writeEndElement();
+  writer.writeEndElement();
+
+  //params.sprintf( "* Graduated Axis: * Name *%u*%s*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible, 
+  //             title.toLatin1().data(), color[0], color[1], color[2], font, bold, italic, shadow );
 
   // Labels
   isVisible = actor->GetLabelVisibility();
@@ -877,16 +1022,132 @@ QString getGradAxisVisualParams( vtkAxisActor2D* actor )
     italic = txtProp->GetItalic();
     shadow = txtProp->GetShadow();
   }
-  params += QString().sprintf( "* Labels *%u*%u*%u*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible, labels, offset,  
-                              color[0], color[1], color[2], font, bold, italic, shadow );
+
+  writer.writeStartElement("Labels");
+  writer.writeAttribute("isVisible", QString("%1").arg(isVisible));
+  writer.writeAttribute("Number", QString("%1").arg(labels));
+  writer.writeAttribute("Offset", QString("%1").arg(offset));
+  writer.writeAttribute("Font", QString("%1").arg(font));
+  writer.writeAttribute("Bold", QString("%1").arg(bold));
+  writer.writeAttribute("Italic", QString("%1").arg(italic));
+  writer.writeAttribute("Shadow", QString("%1").arg(shadow));
+
+  writer.writeStartElement("Color");
+  writer.writeAttribute("R", QString("%1").arg(color[0]));
+  writer.writeAttribute("G", QString("%1").arg(color[1]));
+  writer.writeAttribute("B", QString("%1").arg(color[2]));
+  writer.writeEndElement();
+  writer.writeEndElement();
+  //  params += QString().sprintf( "* Labels *%u*%u*%u*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible, labels, offset,  
+  //                          color[0], color[1], color[2], font, bold, italic, shadow );
 
   // Tick marks
   isVisible = actor->GetTickVisibility();
   int length = actor->GetTickLength();
+  writer.writeStartElement("TickMarks");
+  writer.writeAttribute("isVisible", QString("%1").arg(isVisible));
+  writer.writeAttribute("Length", QString("%1").arg(length));
+  writer.writeEndElement();
   
-  params += QString().sprintf( "* Tick marks *%u*%u", isVisible, length );
+  //params += QString().sprintf( "* Tick marks *%u*%u", isVisible, length );
   
-  return params;
+  writer.writeEndElement();
+  //return params;
+}
+
+void setGradAxisVisualParams(QXmlStreamReader& reader, vtkAxisActor2D* actor)
+{
+  if ( !actor )
+    return;
+
+  do {
+    reader.readNext();
+  } while (!reader.isStartElement());
+
+  // Read title params
+  QXmlStreamAttributes aAttr = reader.attributes();
+  bool isVisible = aAttr.value("isVisible").toString().toUShort();
+  QString title = aAttr.value("Text").toString();
+  int font = aAttr.value("Font").toString().toInt();
+  int bold = aAttr.value("Bold").toString().toInt();
+  int italic = aAttr.value("Italic").toString().toInt();
+  int shadow = aAttr.value("Shadow").toString().toInt();
+
+  //printf("#### TITLE: %i, %s, %i, %i, %i, %i\n", isVisible, qPrintable(title), font, bold, italic, shadow);
+
+  do {
+    reader.readNext();
+  } while (!reader.isStartElement());
+  
+  // Read title color
+  aAttr = reader.attributes();
+
+  vtkFloatingPointType color[3];
+  color[0] = aAttr.value("R").toString().toDouble();
+  color[1] = aAttr.value("G").toString().toDouble();
+  color[2] = aAttr.value("B").toString().toDouble();
+  //printf("#### Color: %f, %f, %f\n", color[0], color[1], color[2]);
+
+  actor->SetTitleVisibility( isVisible );
+  actor->SetTitle( title.toLatin1() );
+  vtkTextProperty* txtProp = actor->GetTitleTextProperty();
+  if ( txtProp ) {
+    txtProp->SetColor( color );
+    txtProp->SetFontFamily( font );
+    txtProp->SetBold( bold );
+    txtProp->SetItalic( italic );
+    txtProp->SetShadow( shadow );
+  }
+
+  // Labels
+
+  do {
+    reader.readNext();
+  } while (!reader.isStartElement()); 
+  // Read labels
+  aAttr = reader.attributes();
+  isVisible = aAttr.value("isVisible").toString().toUShort();
+  int labels = aAttr.value("Number").toString().toInt();
+  int offset = aAttr.value("Offset").toString().toInt();
+  font = aAttr.value("Font").toString().toInt();
+  bold = aAttr.value("Bold").toString().toInt();
+  italic = aAttr.value("Italic").toString().toInt();
+  shadow = aAttr.value("Shadow").toString().toInt();
+
+  do {
+    reader.readNext();
+  } while (!reader.isStartElement()); 
+  // Read Color
+  aAttr = reader.attributes();
+
+  color[0] = aAttr.value("R").toString().toDouble();
+  color[1] = aAttr.value("G").toString().toDouble();
+  color[2] = aAttr.value("B").toString().toDouble();
+
+  actor->SetLabelVisibility( isVisible );
+  actor->SetNumberOfLabels( labels );
+  actor->SetTickOffset( offset );
+  txtProp = actor->GetLabelTextProperty();
+  if ( txtProp ) {
+    txtProp->SetColor( color );
+    txtProp->SetFontFamily( font );
+    txtProp->SetBold( bold );
+    txtProp->SetItalic( italic );
+    txtProp->SetShadow( shadow );
+  }
+
+  // Tick Marks
+  do {
+    reader.readNext();
+  } while (!reader.isStartElement()); 
+  aAttr = reader.attributes();
+
+  // retrieve and set tick marks properties
+  isVisible = aAttr.value("isVisible").toString().toUShort();
+  int length = aAttr.value("Length").toString().toInt();
+  
+  actor->SetTickVisibility( isVisible );
+  actor->SetTickLength( length );
 }
 
 /*! The method restores visual parameters of a graduated axis actor (x,y,z axis)
@@ -896,7 +1157,7 @@ void setGradAxisVisualParams( vtkAxisActor2D* actor, const QString& params )
   if ( !actor )
     return;
 
-  QStringList paramsLst = QStringList::split( '*', params, true );
+  QStringList paramsLst = params.split( '*' );
 
   if ( paramsLst.size() == nGradAxisParams ) { // altogether name, lable, ticks parameters make up 25 values
 
@@ -913,7 +1174,7 @@ void setGradAxisVisualParams( vtkAxisActor2D* actor, const QString& params )
     int shadow = paramsLst[10].toInt();
 
     actor->SetTitleVisibility( isVisible );
-    actor->SetTitle( title.latin1() );
+    actor->SetTitle( title.toLatin1() );
     vtkTextProperty* txtProp = actor->GetTitleTextProperty();
     if ( txtProp ) {
       txtProp->SetColor( color );
@@ -958,9 +1219,7 @@ void setGradAxisVisualParams( vtkAxisActor2D* actor, const QString& params )
 
 /*! The method returns the visual parameters of this view as a formated string
  */
-QString
-SVTK_ViewWindow
-::getVisualParameters()
+QString SVTK_ViewWindow::getVisualParameters()
 {
   double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
   
@@ -976,29 +1235,65 @@ SVTK_ViewWindow
   // view up values (3 digits), parallel scale (1 digit), scale (3 digits, 
   // Graduated axes parameters (X, Y, Z axes parameters)
   QString retStr;
-  retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", 
-                 pos[0], pos[1], pos[2], focalPnt[0], focalPnt[1], focalPnt[2], 
-                 viewUp[0], viewUp[1], viewUp[2], parScale, scale[0], scale[1], scale[2] );
+  QXmlStreamWriter aWriter(&retStr);
+  aWriter.setAutoFormatting(true);
+
+  aWriter.writeStartDocument();
+  aWriter.writeStartElement("ViewState");
+
+  aWriter.writeStartElement("Position");
+  aWriter.writeAttribute("X", QString("%1").arg(pos[0]));
+  aWriter.writeAttribute("Y", QString("%1").arg(pos[1]));
+  aWriter.writeAttribute("Z", QString("%1").arg(pos[2]));
+  aWriter.writeEndElement();
+
+  aWriter.writeStartElement("FocalPoint");
+  aWriter.writeAttribute("X", QString::number(focalPnt[0]));
+  aWriter.writeAttribute("Y", QString::number(focalPnt[1]));
+  aWriter.writeAttribute("Z", QString::number(focalPnt[2]));
+  aWriter.writeEndElement();
+
+  aWriter.writeStartElement("ViewUp");
+  aWriter.writeAttribute("X", QString::number(viewUp[0]));
+  aWriter.writeAttribute("Y", QString::number(viewUp[1]));
+  aWriter.writeAttribute("Z", QString::number(viewUp[2]));
+  aWriter.writeEndElement();
+
+  aWriter.writeStartElement("ViewScale");
+  aWriter.writeAttribute("Parallel", QString::number(parScale));
+  aWriter.writeAttribute("X", QString::number(scale[0]));
+  aWriter.writeAttribute("Y", QString::number(scale[1]));
+  aWriter.writeAttribute("Z", QString::number(scale[2]));
+  aWriter.writeEndElement();
 
-  // save graduated axes parameters
   if ( SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes() ) {
-    retStr += QString( "*%1" ).arg( getMainWindow()->IsCubeAxesDisplayed() );
-    retStr += ::getGradAxisVisualParams( gradAxesActor->GetXAxisActor2D() );
-    retStr += ::getGradAxisVisualParams( gradAxesActor->GetYAxisActor2D() );
-    retStr += ::getGradAxisVisualParams( gradAxesActor->GetZAxisActor2D() );
+    aWriter.writeStartElement("DisplayCubeAxis");
+    aWriter.writeAttribute("Show", QString( "%1" ).arg( GetRenderer()->IsCubeAxesDisplayed()));
+    aWriter.writeEndElement();
+
+    getGradAxisVisualParams(aWriter, gradAxesActor->GetXAxisActor2D(), "X");
+    getGradAxisVisualParams(aWriter, gradAxesActor->GetYAxisActor2D(), "Y");
+    getGradAxisVisualParams(aWriter, gradAxesActor->GetZAxisActor2D(), "Z");
   }
 
+  aWriter.writeStartElement("Trihedron");
+  aWriter.writeAttribute("isShown",  QString( "%1" ).arg( isTrihedronDisplayed()));
+  aWriter.writeAttribute("Size", QString::number(GetTrihedronSize()));
+  aWriter.writeEndElement();
+
+  aWriter.writeEndElement();
+  aWriter.writeEndDocument();
+
   return retStr;
 }
 
 /*!
   The method restores visual parameters of this view or postpones it untill the view is shown
-*/
-void
-SVTK_ViewWindow
-::setVisualParameters( const QString& parameters )
+*/ 
+void SVTK_ViewWindow::setVisualParameters( const QString& parameters )
 {
-  SVTK_RenderWindowInteractor* anInteractor = getMainWindow()->GetInteractor();
+  //printf("#### %s\n", qPrintable(parameters));
+  SVTK_RenderWindowInteractor* anInteractor = GetInteractor();
   if ( anInteractor->isVisible() ) {
     doSetVisualParameters( parameters ); 
   }
@@ -1011,51 +1306,115 @@ SVTK_ViewWindow
 /*!
   The method restores visual parameters of this view from a formated string
 */
-void
-SVTK_ViewWindow
-::doSetVisualParameters( const QString& parameters )
-{
-  QStringList paramsLst = QStringList::split( '*', parameters, true );
-  if ( paramsLst.size() >= nNormalParams ) {
-    // 'reading' list of parameters
-    double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
-    pos[0] = paramsLst[0].toDouble();
-    pos[1] = paramsLst[1].toDouble();
-    pos[2] = paramsLst[2].toDouble();
-    focalPnt[0] = paramsLst[3].toDouble();
-    focalPnt[1] = paramsLst[4].toDouble();
-    focalPnt[2] = paramsLst[5].toDouble();
-    viewUp[0] = paramsLst[6].toDouble();
-    viewUp[1] = paramsLst[7].toDouble();
-    viewUp[2] = paramsLst[8].toDouble();
-    parScale = paramsLst[9].toDouble();
-    scale[0] = paramsLst[10].toDouble();
-    scale[1] = paramsLst[11].toDouble();
-    scale[2] = paramsLst[12].toDouble();
-    
-    // applying parameters
+void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters )
+{
+  double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
+
+  QXmlStreamReader aReader(parameters);
+  SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes();
+
+  while(!aReader.atEnd()) {
+    aReader.readNext();
+    if (aReader.isStartElement()) {
+      QXmlStreamAttributes aAttr = aReader.attributes();
+      //printf("### Name = %s\n", qPrintable(aReader.name().toString()));
+      if (aReader.name() == "Position") {      
+       pos[0] = aAttr.value("X").toString().toDouble();
+       pos[1] = aAttr.value("Y").toString().toDouble();
+       pos[2] = aAttr.value("Z").toString().toDouble();
+       //printf("#### Position %f; %f; %f\n", pos[0], pos[1], pos[2]);
+      } else if (aReader.name() == "FocalPoint") {
+       focalPnt[0] = aAttr.value("X").toString().toDouble();
+       focalPnt[1] = aAttr.value("Y").toString().toDouble();
+       focalPnt[2] = aAttr.value("Z").toString().toDouble();
+       //printf("#### FocalPoint %f; %f; %f\n", focalPnt[0], focalPnt[1], focalPnt[2]);
+      } else if (aReader.name() == "ViewUp") {
+       viewUp[0] = aAttr.value("X").toString().toDouble();
+       viewUp[1] = aAttr.value("Y").toString().toDouble();
+       viewUp[2] = aAttr.value("Z").toString().toDouble();
+       //printf("#### ViewUp %f; %f; %f\n", viewUp[0], viewUp[1], viewUp[2]);
+      } else if (aReader.name() == "ViewScale") {
+       parScale = aAttr.value("Parallel").toString().toDouble();
+       scale[0] = aAttr.value("X").toString().toDouble();
+       scale[1] = aAttr.value("Y").toString().toDouble();
+       scale[2] = aAttr.value("Z").toString().toDouble();
+       //printf("#### ViewScale %f; %f; %f\n", scale[0], scale[1], scale[2]);
+      } else if (aReader.name() == "DisplayCubeAxis") {
+       if (aAttr.value("Show") == "0")
+         gradAxesActor->VisibilityOff();
+       else
+         gradAxesActor->VisibilityOn();
+      } else if (aReader.name() == "GraduatedAxis") {
+       if(aAttr.value("Axis") == "X") 
+         setGradAxisVisualParams(aReader, gradAxesActor->GetXAxisActor2D());
+       else if(aAttr.value("Axis") == "Y")
+         setGradAxisVisualParams(aReader, gradAxesActor->GetYAxisActor2D());
+       else if(aAttr.value("Axis") == "Z")
+         setGradAxisVisualParams(aReader, gradAxesActor->GetZAxisActor2D());
+      } else if (aReader.name() == "Trihedron") {
+       if (aAttr.value("isShown") == "0")
+         GetTrihedron()->VisibilityOff();
+       else
+         GetTrihedron()->VisibilityOn();
+       SetTrihedronSize(aAttr.value("Size").toString().toDouble());
+      }
+    } 
+  }
+  if (!aReader.hasError()) {
     vtkCamera* camera = getRenderer()->GetActiveCamera();
     camera->SetPosition( pos );
     camera->SetFocalPoint( focalPnt );
     camera->SetViewUp( viewUp );
     camera->SetParallelScale( parScale );
     SetScale( scale );
-
-    // apply graduated axes parameters
-    SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes();
-    if ( gradAxesActor && paramsLst.size() == nAllParams ) {
+  } else {
+    QStringList paramsLst = parameters.split( '*' );
+    if ( paramsLst.size() >= nNormalParams ) {
+      // 'reading' list of parameters
+      pos[0] = paramsLst[0].toDouble();
+      pos[1] = paramsLst[1].toDouble();
+      pos[2] = paramsLst[2].toDouble();
+      focalPnt[0] = paramsLst[3].toDouble();
+      focalPnt[1] = paramsLst[4].toDouble();
+      focalPnt[2] = paramsLst[5].toDouble();
+      viewUp[0] = paramsLst[6].toDouble();
+      viewUp[1] = paramsLst[7].toDouble();
+      viewUp[2] = paramsLst[8].toDouble();
+      parScale = paramsLst[9].toDouble();
+      scale[0] = paramsLst[10].toDouble();
+      scale[1] = paramsLst[11].toDouble();
+      scale[2] = paramsLst[12].toDouble();
+      
+      // applying parameters
+      vtkCamera* camera = getRenderer()->GetActiveCamera();
+      camera->SetPosition( pos );
+      camera->SetFocalPoint( focalPnt );
+      camera->SetViewUp( viewUp );
+      camera->SetParallelScale( parScale );
+      SetScale( scale );
       
-      int i = nNormalParams+1, j = i + nGradAxisParams - 1;
-      ::setGradAxisVisualParams( gradAxesActor->GetXAxisActor2D(), parameters.section( '*', i, j ) ); 
-      i = j + 1; j += nGradAxisParams;
-      ::setGradAxisVisualParams( gradAxesActor->GetYAxisActor2D(), parameters.section( '*', i, j ) ); 
-      i = j + 1; j += nGradAxisParams;
-      ::setGradAxisVisualParams( gradAxesActor->GetZAxisActor2D(), parameters.section( '*', i, j ) ); 
-
-      if ( paramsLst[13].toUShort() )
-       gradAxesActor->VisibilityOn();
-      else
-       gradAxesActor->VisibilityOff();
+      // apply graduated axes parameters
+      SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes();
+      if ( gradAxesActor && paramsLst.size() == nAllParams ) {
+       int i = nNormalParams+1, j = i + nGradAxisParams - 1;
+       ::setGradAxisVisualParams( gradAxesActor->GetXAxisActor2D(), parameters.section( '*', i, j ) ); 
+       i = j + 1; j += nGradAxisParams;
+       ::setGradAxisVisualParams( gradAxesActor->GetYAxisActor2D(), parameters.section( '*', i, j ) ); 
+       i = j + 1; j += nGradAxisParams;
+       ::setGradAxisVisualParams( gradAxesActor->GetZAxisActor2D(), parameters.section( '*', i, j ) ); 
+       
+       if ( paramsLst[13].toUShort() )
+         gradAxesActor->VisibilityOn();
+       else
+         gradAxesActor->VisibilityOff();
+      } else if ( paramsLst.size() == nAllParams ) {
+       if ( paramsLst[90].toUShort() )
+         GetTrihedron()->VisibilityOn();
+       else
+         GetTrihedron()->VisibilityOff();
+       
+       SetTrihedronSize(paramsLst[91].toDouble());
+      }
     }
   }
 }
@@ -1075,3 +1434,507 @@ bool SVTK_ViewWindow::eventFilter( QObject* theWatched, QEvent* theEvent )
   }
   return SUIT_ViewWindow::eventFilter( theWatched, theEvent );
 }
+
+
+/*!
+  Change rotation point
+*/
+void SVTK_ViewWindow::onChangeRotationPoint(bool theIsActivate)
+{
+  if(theIsActivate){
+    mySetRotationPointDlg->addObserver();
+    if ( mySetRotationPointDlg->IsFirstShown() )
+      activateSetRotationGravity();
+    mySetRotationPointDlg->show();
+  }else
+    mySetRotationPointDlg->hide();
+}
+
+/*!
+  Set the gravity center as a rotation point
+*/
+void SVTK_ViewWindow::activateSetRotationGravity()
+{
+  myEventDispatcher->InvokeEvent(SVTK::SetRotateGravity,0);
+}
+
+/*!
+  Set the selected point as a rotation point
+*/
+void SVTK_ViewWindow::activateSetRotationSelected(void* theData)
+{
+  myEventDispatcher->InvokeEvent(SVTK::ChangeRotationPoint,theData);
+}
+
+/*!
+  Set the point selected by user as a rotation point
+*/
+void SVTK_ViewWindow::activateStartPointSelection()
+{
+  myEventDispatcher->InvokeEvent(SVTK::StartPointSelection,0);
+}
+
+/*!
+  Set the view projection mode: orthogonal or perspective
+*/
+void SVTK_ViewWindow::onPerspectiveMode()
+{
+  vtkCamera* aCamera = getRenderer()->GetActiveCamera();
+  aCamera->SetParallelProjection(toolMgr()->action( ParallelModeId )->isChecked());
+  GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
+}
+
+void SVTK_ViewWindow::SetEventDispatcher(vtkObject* theDispatcher)
+{
+  myEventDispatcher = theDispatcher;
+}
+
+/*!
+  Creates all actions of svtk main window
+*/
+void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
+{
+  QtxAction* anAction;
+  QtxActionToolMgr* mgr = toolMgr();
+
+  // Dump view
+  anAction = new QtxAction(tr("MNU_DUMP_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
+                          tr( "MNU_DUMP_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_DUMP_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(onDumpView()));
+  mgr->registerAction( anAction, DumpId );
+
+  // FitAll
+  anAction = new QtxAction(tr("MNU_FITALL"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
+                          tr( "MNU_FITALL" ), 0, this);
+  anAction->setStatusTip(tr("DSC_FITALL"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(onFitAll()));
+  mgr->registerAction( anAction, FitAllId );
+
+  // FitRect
+  anAction = new QtxAction(tr("MNU_FITRECT"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
+                          tr( "MNU_FITRECT" ), 0, this);
+  anAction->setStatusTip(tr("DSC_FITRECT"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(activateWindowFit()));
+  mgr->registerAction( anAction, FitRectId );
+
+  // Zoom
+  anAction = new QtxAction(tr("MNU_ZOOM_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
+                          tr( "MNU_ZOOM_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(activateZoom()));
+  mgr->registerAction( anAction, ZoomId );
+
+  // Panning
+  anAction = new QtxAction(tr("MNU_PAN_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
+                          tr( "MNU_PAN_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_PAN_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(activatePanning()));
+  mgr->registerAction( anAction, PanId );
+
+  // Global Panning
+  anAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
+                          tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning()));
+  mgr->registerAction( anAction, GlobalPanId );
+
+  // Change rotation point
+  anAction = new QtxAction(tr("MNU_CHANGINGROTATIONPOINT_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ROTATION_POINT" ) ),
+                          tr( "MNU_CHANGINGROTATIONPOINT_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_CHANGINGROTATIONPOINT_VIEW"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onChangeRotationPoint(bool)));
+  mgr->registerAction( anAction, ChangeRotationPointId );
+
+  // Rotation
+  anAction = new QtxAction(tr("MNU_ROTATE_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
+                          tr( "MNU_ROTATE_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(activateRotation()));
+  mgr->registerAction( anAction, RotationId );
+
+  // Projections
+  anAction = new QtxAction(tr("MNU_FRONT_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
+                          tr( "MNU_FRONT_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_FRONT_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(onFrontView()));
+  mgr->registerAction( anAction, FrontId );
+
+  anAction = new QtxAction(tr("MNU_BACK_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
+                          tr( "MNU_BACK_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_BACK_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(onBackView()));
+  mgr->registerAction( anAction, BackId );
+
+  anAction = new QtxAction(tr("MNU_TOP_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
+                          tr( "MNU_TOP_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_TOP_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(onTopView()));
+  mgr->registerAction( anAction, TopId );
+
+  anAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
+                          tr( "MNU_BOTTOM_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(onBottomView()));
+  mgr->registerAction( anAction, BottomId );
+
+  anAction = new QtxAction(tr("MNU_LEFT_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
+                          tr( "MNU_LEFT_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_LEFT_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(onLeftView()));
+  mgr->registerAction( anAction, LeftId );
+
+  anAction = new QtxAction(tr("MNU_RIGHT_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
+                          tr( "MNU_RIGHT_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(onRightView()));
+  mgr->registerAction( anAction, RightId );
+
+  // Reset
+  anAction = new QtxAction(tr("MNU_RESET_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
+                          tr( "MNU_RESET_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_RESET_VIEW"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(onResetView()));
+  mgr->registerAction( anAction, ResetId );
+
+  // onViewTrihedron: Shows - Hides Trihedron
+  anAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
+                          tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
+  connect(anAction, SIGNAL(activated()), this, SLOT(onViewTrihedron()));
+  mgr->registerAction( anAction, ViewTrihedronId );
+
+  // onNonIsometric: Manage non-isometric params
+  anAction = new QtxAction(tr("MNU_SVTK_SCALING"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SCALING" ) ),
+                          tr( "MNU_SVTK_SCALING" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SVTK_SCALING"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onNonIsometric(bool)));
+  mgr->registerAction( anAction, NonIsometric );
+
+  // onGraduatedAxes: Manage graduated axes params
+  anAction = new QtxAction(tr("MNU_SVTK_GRADUATED_AXES"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_GRADUATED_AXES" ) ),
+                          tr( "MNU_SVTK_GRADUATED_AXES" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SVTK_GRADUATED_AXES"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onGraduatedAxes(bool)));
+  mgr->registerAction( anAction, GraduatedAxes );
+
+  // onGraduatedAxes: Manage graduated axes params
+  anAction = new QtxAction(tr("MNU_SVTK_UPDATE_RATE"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_UPDATE_RATE" ) ),
+                          tr( "MNU_SVTK_UPDATE_RATE" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SVTK_UPDATE_RATE"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onUpdateRate(bool)));
+  mgr->registerAction( anAction, UpdateRate );
+
+  // Set perspective mode group
+  anAction = new QtxAction(tr("MNU_SVTK_PARALLEL_MODE"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARALLEL" ) ),
+                          tr( "MNU_SVTK_PARALLEL_MODE" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SVTK_PARALLEL_MODE"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
+  mgr->registerAction( anAction, ParallelModeId );
+
+  anAction = new QtxAction(tr("MNU_SVTK_PERSPECTIVE_MODE"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PERSPECTIVE" ) ),
+                          tr( "MNU_SVTK_PERSPECTIVE_MODE" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SVTK_PERSPECTIVE_MODE"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
+  mgr->registerAction( anAction, ProjectionModeId );
+
+  QActionGroup* aPerspectiveGroup = new QActionGroup( this );
+  aPerspectiveGroup->addAction( mgr->action( ParallelModeId ) );
+  aPerspectiveGroup->addAction( mgr->action( ProjectionModeId ) );
+
+  // View Parameters
+  anAction = new QtxAction(tr("MNU_VIEWPARAMETERS_VIEW"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARAMETERS" ) ),
+                          tr( "MNU_VIEWPARAMETERS_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_VIEWPARAMETERS_VIEW"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onViewParameters(bool)));
+  mgr->registerAction( anAction, ViewParametersId );
+
+  // Switch between interaction styles
+  anAction = new QtxAction(tr("MNU_SVTK_STYLE_SWITCH"), 
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_STYLE_SWITCH" ) ),
+                          tr( "MNU_SVTK_STYLE_SWITCH" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SVTK_STYLE_SWITCH"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchInteractionStyle(bool)));
+  mgr->registerAction( anAction, SwitchInteractionStyleId );
+
+  // Start recording
+  myStartAction = new QtxAction(tr("MNU_SVTK_RECORDING_START"), 
+                               theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_START" ) ),
+                               tr( "MNU_SVTK_RECORDING_START" ), 0, this);
+  myStartAction->setStatusTip(tr("DSC_SVTK_RECORDING_START"));
+  connect( myStartAction, SIGNAL( triggered ( bool ) ), this, SLOT( onStartRecording() ) );
+  mgr->registerAction( myStartAction, StartRecordingId );
+
+  // Play recording
+  myPlayAction = new QtxAction(tr("MNU_SVTK_RECORDING_PLAY"), 
+                              theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PLAY" ) ),
+                              tr( "MNU_SVTK_RECORDING_PLAY" ), 0, this);
+  myPlayAction->setStatusTip(tr("DSC_SVTK_RECORDING_PLAY"));
+  myPlayAction->setEnabled( false );
+  connect( myPlayAction, SIGNAL( triggered ( bool ) ), this, SLOT( onPlayRecording() ) );
+  mgr->registerAction( myPlayAction, PlayRecordingId );
+
+  // Pause recording
+  myPauseAction = new QtxAction(tr("MNU_SVTK_RECORDING_PAUSE"), 
+                               theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PAUSE" ) ),
+                               tr( "MNU_SVTK_RECORDING_PAUSE" ), 0, this);
+  myPauseAction->setStatusTip(tr("DSC_SVTK_RECORDING_PAUSE"));
+  myPauseAction->setEnabled( false );
+  connect( myPauseAction, SIGNAL( triggered ( bool ) ), this, SLOT( onPauseRecording() ) );
+  mgr->registerAction( myPauseAction, PauseRecordingId );
+
+  // Stop recording
+  myStopAction = new QtxAction(tr("MNU_SVTK_RECORDING_STOP"), 
+                              theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_STOP" ) ),
+                              tr( "MNU_SVTK_RECORDING_STOP" ), 0, this);
+  myStopAction->setStatusTip(tr("DSC_SVTK_RECORDING_STOP"));
+  myStopAction->setEnabled( false );
+  connect( myStopAction, SIGNAL( triggered ( bool ) ), this, SLOT( onStopRecording() ) );
+  mgr->registerAction( myStopAction, StopRecordingId );
+}
+
+/*!
+  Creates toolbar of svtk main window
+*/
+void SVTK_ViewWindow::createToolBar()
+{
+  QtxActionToolMgr* mgr = toolMgr();
+  
+  mgr->append( DumpId, myToolBar );
+  mgr->append( SwitchInteractionStyleId, myToolBar );
+  mgr->append( ViewTrihedronId, myToolBar );
+
+  QtxMultiAction* aScaleAction = new QtxMultiAction( this );
+  aScaleAction->insertAction( getAction( FitAllId ) );
+  aScaleAction->insertAction( getAction( FitRectId ) );
+  aScaleAction->insertAction( getAction( ZoomId ) );
+  mgr->append( aScaleAction, myToolBar );
+
+  QtxMultiAction* aPanningAction = new QtxMultiAction( this );
+  aPanningAction->insertAction( getAction( PanId ) );
+  aPanningAction->insertAction( getAction( GlobalPanId ) );
+  mgr->append( aPanningAction, myToolBar );
+
+  mgr->append( ChangeRotationPointId, myToolBar );
+
+  mgr->append( RotationId, myToolBar );
+
+  QtxMultiAction* aViewsAction = new QtxMultiAction( this );
+  aViewsAction->insertAction( getAction( FrontId ) );
+  aViewsAction->insertAction( getAction( BackId ) );
+  aViewsAction->insertAction( getAction( TopId ) );
+  aViewsAction->insertAction( getAction( BottomId ) );
+  aViewsAction->insertAction( getAction( LeftId ) );
+  aViewsAction->insertAction( getAction( RightId ) );
+  mgr->append( aViewsAction, myToolBar );
+
+  mgr->append( ResetId, myToolBar );
+
+  mgr->append( UpdateRate, myToolBar );
+  mgr->append( NonIsometric, myToolBar );
+  mgr->append( GraduatedAxes, myToolBar );
+
+  mgr->append( ViewParametersId, myToolBar );
+  mgr->append( toolMgr()->separator(), myToolBar );
+  mgr->append( ParallelModeId, myToolBar );
+  mgr->append( ProjectionModeId, myToolBar );
+
+  mgr->append( StartRecordingId, myRecordingToolBar );
+  mgr->append( PlayRecordingId, myRecordingToolBar );
+  mgr->append( PauseRecordingId, myRecordingToolBar );
+  mgr->append( StopRecordingId, myRecordingToolBar );
+}
+
+void SVTK_ViewWindow::onUpdateRate(bool theIsActivate)
+{
+  if(theIsActivate){
+    myUpdateRateDlg->Update();
+    myUpdateRateDlg->show();
+  }else
+    myUpdateRateDlg->hide();
+}
+
+void SVTK_ViewWindow::onNonIsometric(bool theIsActivate)
+{
+  if(theIsActivate){
+    myNonIsometricDlg->Update();
+    myNonIsometricDlg->show();
+  }else
+    myNonIsometricDlg->hide();
+}
+
+void SVTK_ViewWindow::onGraduatedAxes(bool theIsActivate)
+{
+  if(theIsActivate){
+    myCubeAxesDlg->Update();
+    myCubeAxesDlg->show();
+  }else
+    myCubeAxesDlg->hide();
+}
+
+/*!
+  Starts rotation transformation
+*/
+void SVTK_ViewWindow::activateRotation()
+{
+  myEventDispatcher->InvokeEvent(SVTK::StartRotate,0);
+}
+
+
+/*!
+  Starts panning transformation
+*/
+void SVTK_ViewWindow::activatePanning()
+{
+  myEventDispatcher->InvokeEvent(SVTK::StartPan,0);
+}
+
+/*!
+  Starts zoom transformation
+*/
+void SVTK_ViewWindow::activateZoom()
+{
+  myEventDispatcher->InvokeEvent(SVTK::StartZoom,0);
+}
+
+/*!
+  Starts window fit transformation
+*/
+void SVTK_ViewWindow::activateWindowFit()
+{
+  myEventDispatcher->InvokeEvent(SVTK::StartFitArea,0);
+}
+
+/*!
+  Starts global panning transformation
+*/
+void SVTK_ViewWindow::activateGlobalPanning()
+{
+  myEventDispatcher->InvokeEvent(SVTK::StartGlobalPan,0);
+}
+
+void SVTK_ViewWindow::onStartRecording()
+{
+  myRecorder->CheckExistAVIMaker();
+  if (myRecorder->ErrorStatus()) {
+    SUIT_MessageBox::warning(this, tr("ERROR"), tr("MSG_NO_AVI_MAKER") );
+  }
+  else {
+    SVTK_RecorderDlg* aRecorderDlg = new SVTK_RecorderDlg( this, myRecorder );
+
+    if( !aRecorderDlg->exec() )
+      return;
+
+    myStartAction->setEnabled( false );
+    myPlayAction->setEnabled( false );
+    myPauseAction->setEnabled( true );
+    myStopAction->setEnabled( true );
+
+    // to prevent resizing the window while recording
+    myPreRecordingMinSize = minimumSize();
+    myPreRecordingMaxSize = maximumSize();
+    setFixedSize( size() );
+
+    myRecorder->Record();
+  }
+}
+
+void SVTK_ViewWindow::onPlayRecording()
+{
+  myStartAction->setEnabled( false );
+  myPlayAction->setEnabled( false );
+  myPauseAction->setEnabled( true );
+  myStopAction->setEnabled( true );
+
+  myRecorder->Pause();
+}
+
+void SVTK_ViewWindow::onPauseRecording()
+{
+  myStartAction->setEnabled( false );
+  myPlayAction->setEnabled( true );
+  myPauseAction->setEnabled( false );
+  myStopAction->setEnabled( true );
+
+  myRecorder->Pause();
+}
+
+void SVTK_ViewWindow::onStopRecording()
+{
+  myStartAction->setEnabled( true );
+  myPlayAction->setEnabled( false );
+  myPauseAction->setEnabled( false );
+  myStopAction->setEnabled( false );
+
+  myRecorder->Stop();
+
+  setMinimumSize( myPreRecordingMinSize );
+  setMaximumSize( myPreRecordingMaxSize );
+}
+
+/*!
+  To invoke a VTK event on SVTK_RenderWindowInteractor instance
+*/
+void SVTK_ViewWindow::InvokeEvent(unsigned long theEvent, void* theCallData)
+{
+  GetInteractor()->InvokeEvent(theEvent,theCallData);
+}
+
+/*!
+  Modify view parameters
+*/
+void SVTK_ViewWindow::onViewParameters(bool theIsActivate)
+{
+  if(theIsActivate){
+    myViewParameterDlg->addObserver();
+    myViewParameterDlg->show();
+  }else
+    myViewParameterDlg->hide();
+}
+
+/*!
+  Custom show event handler
+*/
+void SVTK_ViewWindow::showEvent( QShowEvent * theEvent ) 
+{
+  emit Show( theEvent );
+}
+
+/*!
+  Custom hide event handler
+*/
+void SVTK_ViewWindow::hideEvent( QHideEvent * theEvent ) 
+{
+  emit Hide( theEvent );
+}
+
index dca18f0854b46ed561425c43ae916d955b405e7a..3a07a757c419e2d18e6c14cbdbe119cef6c4ffd1 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SVTK_VIEWWINDOW_H
 #define SVTK_VIEWWINDOW_H
 #include "SVTK.h"
 #include "SVTK_Selection.h"
 #include "SUIT_ViewWindow.h"
+
 #include "SALOME_InteractiveObject.hxx"
 
-#include <qimage.h>
+#include <QImage>
+#include <vtkSmartPointer.h>
 
 class SUIT_Desktop;
+class SUIT_ResourceMgr;
 
 class VTKViewer_Actor;
 class VTKViewer_Trihedron;
 
 class SVTK_ViewModelBase;
-class SVTK_MainWindow;
+//class SVTK_MainWindow;
 class SVTK_Selector;
 class SVTK_View;
 
-class SVTK_InteractorStyle;
 class SVTK_CubeAxesActor2D;
 
-class SVTK_RenderWindow;
-class SVTK_RenderWindowInteractor;
-
 class vtkRenderer;
 class vtkRenderWindow;
 class vtkRenderWindowInteractor;
+class vtkInteractorStyle;
+class SVTK_RenderWindowInteractor;
+class SVTK_Renderer;
+class SVTK_NonIsometricDlg;
+class SVTK_UpdateRateDlg;
+class SVTK_CubeAxesDlg;
+class SVTK_SetRotationPointDlg;
+class SVTK_KeyFreeInteractorStyle;
+class SVTK_ViewParameterDlg;
+class SVTK_Recorder;
+
+class vtkObject;
+class QtxAction;
 
 namespace SVTK
 {
@@ -65,279 +80,258 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   //! To construct #SVTK_ViewWindow instance
   SVTK_ViewWindow(SUIT_Desktop* theDesktop);
 
-  virtual
-  ~SVTK_ViewWindow();
+  virtual ~SVTK_ViewWindow();
   
   virtual QImage dumpView();
 
   //! To initialize #SVTK_ViewWindow instance
-  virtual
-  void
-  Initialize(SVTK_ViewModelBase* theModel);
+  virtual void Initialize(SVTK_ViewModelBase* theModel);
 
   //! Get #SVTK_View
-  SVTK_View* 
-  getView();
+  SVTK_View* getView();
 
   //! Get #SVTK_MainWindow
-  SVTK_MainWindow* 
-  getMainWindow();
+  //SVTK_MainWindow* getMainWindow();
 
   //! Redirect the request to #SVTK_MainWindow::getRenderWindow
-  vtkRenderWindow* 
-  getRenderWindow();
+  vtkRenderWindow* getRenderWindow();
 
   //! Redirect the request to #SVTK_MainWindow::getInteractor
-  vtkRenderWindowInteractor*
-  getInteractor();
+  vtkRenderWindowInteractor* getInteractor() const;
+
+  //! Redirect the request to #SVTK_MainWindow::getInteractor
+  SVTK_RenderWindowInteractor*  GetInteractor() const;
+
+  vtkInteractorStyle* GetInteractorStyle() const;
+
+  //! Redirect the request to #SVTK_RenderWindowInteractor::PushInteractorStyle
+  void PushInteractorStyle(vtkInteractorStyle* theStyle);
+
+  //! Redirect the request to #SVTK_RenderWindowInteractor::PopInteractorStyle
+  void PopInteractorStyle();
 
   //! Redirect the request to #SVTK_MainWindow::getRenderer 
-  vtkRenderer* 
-  getRenderer();
+  vtkRenderer* getRenderer() const;
+
+  SVTK_Renderer* GetRenderer() const;
 
   //! Redirect the request to #SVTK_MainWindow::GetSelector 
-  SVTK_Selector* 
-  GetSelector();
+  SVTK_Selector* GetSelector() const;
   
   //! Redirect the request to #SVTK_Selector::SelectionMode
-  Selection_Mode
-  SelectionMode() const;
+  Selection_Mode SelectionMode() const;
   
   //! Change selection mode
-  virtual
-  void
-  SetSelectionMode(Selection_Mode theMode);
+  virtual void SetSelectionMode(Selection_Mode theMode);
 
   //! Redirect the request to #SVTK_MainWindow::SetBackgroundColor 
-  virtual
-  void
-  setBackgroundColor( const QColor& );
+  virtual void setBackgroundColor( const QColor& );
 
   //! Redirect the request to #SVTK_MainWindow::SetBackgroundColor 
-  QColor
-  backgroundColor() const;
+  QColor backgroundColor() const;
 
   //! Redirect the request to #SVTK_Renderer::IsTrihedronDisplayed
-  bool
-  isTrihedronDisplayed();
+  bool isTrihedronDisplayed();
 
   //! Redirect the request to #SVTK_Renderer::IsCubeAxesDisplayed
-  bool
-  isCubeAxesDisplayed();
+  bool isCubeAxesDisplayed();
  
   /*  interactive object management */
   //! Redirect the request to #SVTK_View::highlight (to support old code)
-  virtual
-  void
-  highlight(const Handle(SALOME_InteractiveObject)& theIO, 
-           bool theIsHighlight = true, 
-           bool theIsUpdate = true);
+  virtual void highlight(const Handle(SALOME_InteractiveObject)& theIO, 
+                        bool theIsHighlight = true, 
+                        bool theIsUpdate = true);
 
   //! Redirect the request to #SVTK_View::unHighlightAll (to support old code)
-  virtual
-  void
-  unHighlightAll();
+  virtual void unHighlightAll();
 
   //! Redirect the request to #SVTK_View::isInViewer (to support old code)
-  bool
-  isInViewer(const Handle(SALOME_InteractiveObject)& theIObject);
+  bool isInViewer(const Handle(SALOME_InteractiveObject)& theIObject);
 
   //! Redirect the request to #SVTK_View::isVisible (to support old code)
-  bool
-  isVisible(const Handle(SALOME_InteractiveObject)& theIObject);
+  bool isVisible(const Handle(SALOME_InteractiveObject)& theIObject);
 
   //! Redirect the request to #SVTK_View::FindIObject (to support old code)
   //----------------------------------------------------------------------------
-  Handle(SALOME_InteractiveObject) 
-  FindIObject(const char* theEntry);
+  Handle(SALOME_InteractiveObject) FindIObject(const char* theEntry);
   
   /* display */                
   //----------------------------------------------------------------------------
   //! Redirect the request to #SVTK_View::Display (to support old code)
-  virtual
-  void
-  Display(const Handle(SALOME_InteractiveObject)& theIObject,
-         bool theImmediatly = true);
+  virtual void Display(const Handle(SALOME_InteractiveObject)& theIObject,
+                      bool theImmediatly = true);
 
   //! Redirect the request to #SVTK_View::DisplayOnly (to support old code)
-  virtual
-  void
-  DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject);
+  virtual void DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject);
 
   //! Redirect the request to #SVTK_View::Erase (to support old code)
-  virtual
-  void
-  Erase(const Handle(SALOME_InteractiveObject)& theIObject,
-       bool theImmediatly = true);
+  virtual void Erase(const Handle(SALOME_InteractiveObject)& theIObject,
+                    bool theImmediatly = true);
 
   //! Redirect the request to #SVTK_View::DisplayAll (to support old code)
-  virtual
-  void 
-  DisplayAll();
+  virtual void DisplayAll();
 
   //! Redirect the request to #SVTK_View::EraseAll (to support old code)
-  virtual
-  void 
-  EraseAll();
+  virtual void EraseAll();
 
   //! To repaint the viewer
-  virtual
-  void
-  Repaint(bool theUpdateTrihedron = true);
+  virtual void Repaint(bool theUpdateTrihedron = true);
 
   //----------------------------------------------------------------------------
   //! Redirect the request to #SVTK_Renderer::SetScale
-  virtual
-  void 
-  SetScale( double theScale[3] );
+  virtual void SetScale( double theScale[3] );
 
   //! Redirect the request to #SVTK_Renderer::GetScale
-  virtual
-  void
-  GetScale( double theScale[3] );
+  virtual void GetScale( double theScale[3] );
 
   //! Redirect the request to #SVTK_Renderer::AddActor
-  virtual
-  void
-  AddActor(VTKViewer_Actor* theActor,
-          bool theIsUpdate = false);
+  virtual void AddActor(VTKViewer_Actor* theActor,
+                       bool theIsUpdate = false);
 
   //! Redirect the request to #SVTK_Renderer::RemoveActor
-  virtual
-  void
-  RemoveActor(VTKViewer_Actor* theActor,
-             bool theIsUpdate = false);
+  virtual void RemoveActor(VTKViewer_Actor* theActor,
+                          bool theIsUpdate = false);
 
   //----------------------------------------------------------------------------
   //! Redirect the request to #SVTK_Renderer::AdjustActors
-  virtual
-  void
-  AdjustTrihedrons(const bool theIsForced);
+  virtual void AdjustTrihedrons(const bool theIsForced);
 
   //! Redirect the request to #SVTK_Renderer::GetTrihedron
-  VTKViewer_Trihedron*  
-  GetTrihedron();
+  VTKViewer_Trihedron* GetTrihedron();
 
   //! Redirect the request to #SVTK_Renderer::GetCubeAxes
-  SVTK_CubeAxesActor2D* 
-  GetCubeAxes();
+  SVTK_CubeAxesActor2D* GetCubeAxes();
 
   //! Redirect the request to #SVTK_Renderer::GetTrihedronSize
-  vtkFloatingPointType  
-  GetTrihedronSize() const;
+  vtkFloatingPointType GetTrihedronSize() const;
 
   //! Redirect the request to #SVTK_Renderer::SetTrihedronSize
-  virtual
-  void 
-  SetTrihedronSize( const vtkFloatingPointType, const bool = true );
+  virtual void SetTrihedronSize( const vtkFloatingPointType, const bool = true );
+
+  //! Redirect the request to #SVTK_MainWindow::SetIncrementalSpeed
+  virtual void SetIncrementalSpeed( const int, const int = 0 );
+
+  //! Redirect the request to #SVTK_MainWindow::SetProjectionMode
+  virtual void SetProjectionMode( const int );
+
+  //! Redirect the request to #SVTK_MainWindow::SetInteractionStyle
+  virtual void SetInteractionStyle( const int );
+
+  //! Redirect the request to #SVTK_MainWindow::SetSpacemouseButtons
+  virtual void SetSpacemouseButtons( const int, const int, const int );
 
   //! Redirect the request to #SVTK_Renderer::SetSelectionProp
-  virtual
-  void
-  SetSelectionProp(const double& theRed = 1, 
-                  const double& theGreen = 1,
-                  const double& theBlue = 0, 
-                  const int& theWidth = 5);
+  virtual void SetSelectionProp(const double& theRed = 1, 
+                               const double& theGreen = 1,
+                               const double& theBlue = 0, 
+                               const int& theWidth = 5);
 
   //! Redirect the request to #SVTK_Renderer::SetPreselectionProp
-  virtual
-  void
-  SetPreselectionProp(const double& theRed = 0, 
-                     const double& theGreen = 1,
-                     const double& theBlue = 1, 
-                     const int& theWidth = 5);
+  virtual void SetPreselectionProp(const double& theRed = 0, 
+                                  const double& theGreen = 1,
+                                  const double& theBlue = 1, 
+                                  const int& theWidth = 5);
 
   //! Redirect the request to #SVTK_Renderer::SetSelectionTolerance
-  virtual
-  void
-  SetSelectionTolerance(const double& theTolNodes = 0.025, 
-                       const double& theTolCell = 0.001,
-                       const double& theTolObjects = 0.025);
+  virtual void SetSelectionTolerance(const double& theTolNodes = 0.025, 
+                                    const double& theTolCell = 0.001,
+                                    const double& theTolObjects = 0.025);
 
   //! Methods to save/restore visual parameters of a view (pan, zoom, etc.)
-  virtual 
-  QString   
-  getVisualParameters();
+  virtual QString getVisualParameters();
   
-  virtual
-  void
-  setVisualParameters( const QString& parameters );
+  virtual void setVisualParameters( const QString& parameters );
+
+  virtual bool eventFilter( QObject*, QEvent* );
 
-  virtual
-  bool
-  eventFilter( QObject*, QEvent* );
+  virtual void RefreshDumpImage();
 
-  virtual
-  void RefreshDumpImage();
+  //! To invoke a VTK event on #SVTK_RenderWindowInteractor instance
+  void InvokeEvent(unsigned long theEvent, void* theCallData);
   
+ signals:
+  void Show( QShowEvent * );
+  void Hide( QHideEvent * );
+
 public slots:
-  virtual
-  void
-  onSelectionChanged();
+  virtual void showEvent( QShowEvent * );
+  virtual void hideEvent( QHideEvent * );
+  virtual void onSelectionChanged();
+
+  void onChangeRotationPoint(bool theIsActivate);
+
+  void activateSetRotationGravity();
+  void activateSetRotationSelected(void* theData);
+  void activateStartPointSelection();
+
+  void onUpdateRate(bool theIsActivate);
+  void onNonIsometric(bool theIsActivate);
+  void onGraduatedAxes(bool theIsActivate);
+
+  void activateZoom();
+  void activateWindowFit();
+  void activateRotation();
+  void activatePanning(); 
+  void activateGlobalPanning(); 
+
+  void onPerspectiveMode();
+
+  void activateProjectionMode(int);
+
+  void activateSetFocalPointGravity();
+  void activateSetFocalPointSelected();
+  void activateStartFocalPointSelection();
+
+  void onViewParameters(bool theIsActivate);
+
+  void onSwitchInteractionStyle(bool theOn);
+
+  void onStartRecording();
+  void onPlayRecording();
+  void onPauseRecording();
+  void onStopRecording();
 
 signals:
  void selectionChanged();
+ void actorAdded(VTKViewer_Actor*);
+ void actorRemoved(VTKViewer_Actor*);
 
 public slots:
   //! Redirect the request to #SVTK_Renderer::OnFrontView
-  virtual
-  void
-  onFrontView(); 
+  virtual void onFrontView(); 
 
   //! Redirect the request to #SVTK_Renderer::OnBackView
-  virtual
-  void
-  onBackView(); 
+  virtual void onBackView(); 
 
   //! Redirect the request to #SVTK_Renderer::OnTopView
-  virtual
-  void
-  onTopView();
+  virtual void onTopView();
 
   //! Redirect the request to #SVTK_Renderer::OnBottomView
-  virtual
-  void
-  onBottomView();
+  virtual void onBottomView();
 
   //! Redirect the request to #SVTK_Renderer::OnRightView
-  virtual
-  void 
-  onRightView(); 
+  virtual void onRightView(); 
 
   //! Redirect the request to #SVTK_Renderer::OnLeftView
-  virtual
-  void 
-  onLeftView();     
+  virtual void onLeftView();     
 
   //! Redirect the request to #SVTK_Renderer::OnResetView
-  virtual
-  void
-  onResetView();     
+  virtual void onResetView();     
 
   //! Redirect the request to #SVTK_Renderer::OnFitAll
-  virtual
-  void 
-  onFitAll();
+  virtual void onFitAll();
 
   //! Redirect the request to #SVTK_Renderer::OnViewTrihedron
-  virtual
-  void
-  onViewTrihedron(); 
+  virtual void onViewTrihedron(); 
 
   //! Redirect the request to #SVTK_Renderer::OnViewCubeAxes
-  virtual
-  void
-  onViewCubeAxes();
+  virtual void onViewCubeAxes();
 
   //! Redirect the request to #SVTK_Renderer::OnAdjustTrihedron
-  virtual
-  void
-  onAdjustTrihedron();
+  virtual void onAdjustTrihedron();
 
   //! Redirect the request to #SVTK_Renderer::OnAdjustCubeAxes
-  virtual
-  void 
-  onAdjustCubeAxes();
+  virtual void onAdjustCubeAxes();
 
 protected slots:
   void onKeyPressed(QKeyEvent* event);
@@ -348,25 +342,60 @@ protected slots:
   void onMouseMoving(QMouseEvent* event);
 
 protected:
-  virtual
-  void
-  Initialize(SVTK_View* theView,
-            SVTK_ViewModelBase* theModel);
+  virtual void Initialize(SVTK_View* theView,
+                         SVTK_ViewModelBase* theModel);
+
+  void doSetVisualParameters( const QString& );
+  void SetEventDispatcher(vtkObject* theDispatcher);
 
-  void
-  doSetVisualParameters( const QString& );
+  QImage dumpViewContent();
 
   virtual QString filter() const;
   virtual bool dumpViewToFormat( const QImage& img, const QString& fileName, const QString& format );
   
   virtual bool action( const int );
   
+  QtxAction* getAction( int ) const;
+  void createToolBar();
+  void createActions(SUIT_ResourceMgr* theResourceMgr);
+
+  enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, 
+        ChangeRotationPointId, RotationId,
+         FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, 
+        ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
+        ParallelModeId, ProjectionModeId, ViewParametersId, SwitchInteractionStyleId,
+        StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId };
+
+
   SVTK_View* myView;
-  SVTK_MainWindow* myMainWindow;
+  //SVTK_MainWindow* myMainWindow;
   SVTK_ViewModelBase* myModel;
 
+  SVTK_RenderWindowInteractor* myInteractor;
+  vtkSmartPointer<SVTK_KeyFreeInteractorStyle> myKeyFreeInteractorStyle;
+
   QString myVisualParams; // used for delayed setting of view parameters 
 
+  vtkSmartPointer<vtkObject> myEventDispatcher;
+
+  SVTK_NonIsometricDlg* myNonIsometricDlg;
+  SVTK_UpdateRateDlg* myUpdateRateDlg;
+  SVTK_CubeAxesDlg* myCubeAxesDlg;
+  SVTK_SetRotationPointDlg* mySetRotationPointDlg;
+  SVTK_ViewParameterDlg* myViewParameterDlg;
+
+  QSize myPreRecordingMinSize;
+  QSize myPreRecordingMaxSize;
+
+  SVTK_Recorder* myRecorder;
+  QtxAction* myStartAction;
+  QtxAction* myPlayAction;
+  QtxAction* myPauseAction;
+  QtxAction* myStopAction;
+
+  int myToolBar;
+  int myRecordingToolBar;
+
 private:
   QImage myDumpImage;
 };
index cb7df8649cd9f38db3c0455bd6ee60ec6ff857a1..7656ce5ead3ab5c28205971cd784921668ddeb82 100644 (file)
@@ -1,29 +1,28 @@
-#  VISU VISUGUI : GUI of VISU component
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  VISU VISUGUI : GUI of VISU component
 #  File   : 
 #  Module : 
-
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
diff --git a/src/SVTK/resources/SVTK_images.ts b/src/SVTK/resources/SVTK_images.ts
new file mode 100644 (file)
index 0000000..146bb8c
--- /dev/null
@@ -0,0 +1,76 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>ICON_SVTK_ROTATION_POINT</source>
+        <translation>vtk_view_rotation_point.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_GRADUATED_AXES</source>
+        <translation>vtk_view_graduated_axes.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_SCALING</source>
+        <translation>vtk_view_scaling.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_UPDATE_RATE</source>
+        <translation>vtk_view_update_rate.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_VIEW_PARAMETERS</source>
+        <translation>vtk_view_parameters.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_VIEW_PARALLEL</source>
+        <translation>vtk_view_parallel.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_VIEW_PERSPECTIVE</source>
+        <translation>vtk_view_perspective.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_STYLE_SWITCH</source>
+        <translation>vtk_view_style_switch.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_RECORDING_START</source>
+        <translation>vtk_view_recording_start.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_RECORDING_PLAY</source>
+        <translation>vtk_view_recording_play.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_RECORDING_PAUSE</source>
+        <translation>vtk_view_recording_pause.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_RECORDING_STOP</source>
+        <translation>vtk_view_recording_stop.png</translation>
+    </message>
+</context>
+</TS>
index 6e5f620d32e9a9a592b791f8dabd7963a6e42612..7c39b83cc9641ce7b8ae362b945c1c2885c7c576 100755 (executable)
@@ -1,29 +1,28 @@
-#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 #  File   : SALOMEGUI_msg_en.po
 #  Module : SALOME
-
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
@@ -314,5 +313,3 @@ msgstr "Current Update Rate, FPS"
 msgid "SVTK_UpdateRateDlg::NUMBER_CELLS"
 msgstr "Number of Cells, -"
 
-msgid "SVTK_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png *.jpg *.jpeg *.pdf *.ps *.eps)""
\ No newline at end of file
diff --git a/src/SVTK/resources/SVTK_msg_en.ts b/src/SVTK/resources/SVTK_msg_en.ts
new file mode 100644 (file)
index 0000000..a747d7b
--- /dev/null
@@ -0,0 +1,643 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>MNU_FRONT_VIEW</source>
+        <translation>Front</translation>
+    </message>
+    <message>
+        <source>ERROR</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Dump view...</translation>
+    </message>
+    <message>
+        <source>DSC_TOP_VIEW</source>
+        <translation>Top View</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panning</translation>
+    </message>
+    <message>
+        <source>MNU_TOP_VIEW</source>
+        <translation>Top</translation>
+    </message>
+    <message>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Selection of a new center of the view</translation>
+    </message>
+    <message>
+        <source>DSC_ROTATE_VIEW</source>
+        <translation>Rotation of the point of view around the scene center</translation>
+    </message>
+    <message>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Panning the view</translation>
+    </message>
+    <message>
+        <source>DSC_LEFT_VIEW</source>
+        <translation>Left View</translation>
+    </message>
+    <message>
+        <source>DSC_FITALL</source>
+        <translation>Fit all objects inside the view frame</translation>
+    </message>
+    <message>
+        <source>MNU_FITALL</source>
+        <translation>Fit All</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATE_VIEW</source>
+        <translation>Rotation</translation>
+    </message>
+    <message>
+        <source>DSC_SHOW_TRIHEDRON</source>
+        <translation>Show/Hide trihedron in the current view</translation>
+    </message>
+    <message>
+        <source>DSC_FRONT_VIEW</source>
+        <translation>Front View</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Global Panning</translation>
+    </message>
+    <message>
+        <source>INF_APP_DUMP_VIEW</source>
+        <translation>Dump view</translation>
+    </message>
+    <message>
+        <source>MNU_BACK_VIEW</source>
+        <translation>Back</translation>
+    </message>
+    <message>
+        <source>MNU_SHOW_TRIHEDRON</source>
+        <translation>Show/Hide trihedron</translation>
+    </message>
+    <message>
+        <source>DSC_CHANGINGROTATIONPOINT_VIEW</source>
+        <translation>Change the point, around which the rotation is performed</translation>
+    </message>
+    <message>
+        <source>MNU_BOTTOM_VIEW</source>
+        <translation>Bottom</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Reset</translation>
+    </message>
+    <message>
+        <source>MNU_LEFT_VIEW</source>
+        <translation>Left</translation>
+    </message>
+    <message>
+        <source>DSC_RIGHT_VIEW</source>
+        <translation>Right View</translation>
+    </message>
+    <message>
+        <source>MNU_CHANGINGROTATIONPOINT_VIEW</source>
+        <translation>Change Rotation Point</translation>
+    </message>
+    <message>
+        <source>DSC_FITRECT</source>
+        <translation>Fit area within the view frame</translation>
+    </message>
+    <message>
+        <source>MNU_FITRECT</source>
+        <translation>Fit Area</translation>
+    </message>
+    <message>
+        <source>DSC_BOTTOM_VIEW</source>
+        <translation>Bottom View</translation>
+    </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Saves the active view in the image file</translation>
+    </message>
+    <message>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoom the view</translation>
+    </message>
+    <message>
+        <source>VTK_IMAGE_FILES</source>
+        <translation>Images Files (*.bmp *.png *.jpg *.jpeg)</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Reset View Point</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_CANT_SAVE_FILE</source>
+        <translation>Cannot save file</translation>
+    </message>
+    <message>
+        <source>MNU_RIGHT_VIEW</source>
+        <translation>Right</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>View Operations</translation>
+    </message>
+    <message>
+        <source>DSC_BACK_VIEW</source>
+        <translation>Back View</translation>
+    </message>
+    <message>
+        <source>SVTK_IMAGE_FILES</source>
+        <translation>Images Files (*.bmp *.png *.jpg *.jpeg *.pdf *.ps *.eps)</translation>
+    </message>
+    <message>
+        <source>MNU_VIEWPARAMETERS_VIEW</source>
+        <translation>Change View Parameters</translation>
+    </message>
+    <message>
+        <source>DSC_VIEWPARAMETERS_VIEW</source>
+        <translation>Change the parameters of the view</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_PARALLEL_MODE</source>
+        <translation>Orthogonal Mode</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_PARALLEL_MODE</source>
+        <translation>Set the orthogonal projection type</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_PERSPECTIVE_MODE</source>
+        <translation>Perspective Mode</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_PERSPECTIVE_MODE</source>
+        <translation>Set the perspective projection type</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_STYLE_SWITCH</source>
+        <translation>Interactiion style switch</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_STYLE_SWITCH</source>
+        <translation>Interaction Style Switch</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_CubeAxesDlg</name>
+    <message>
+        <source>X_AXIS</source>
+        <translation>X axis</translation>
+    </message>
+    <message>
+        <source>Y_AXIS</source>
+        <translation>Y axis</translation>
+    </message>
+    <message>
+        <source>Z_AXIS</source>
+        <translation>Z axis</translation>
+    </message>
+    <message>
+        <source>CAPTION</source>
+        <translation>Graduated axes</translation>
+    </message>
+    <message>
+        <source>IS_VISIBLE</source>
+        <translation>Is visible</translation>
+    </message>
+    <message>
+        <source>FONT</source>
+        <translation>Font</translation>
+    </message>
+    <message>
+        <source>NAME</source>
+        <translation>Name</translation>
+    </message>
+    <message>
+        <source>TICK_MARKS</source>
+        <translation>Tick marks</translation>
+    </message>
+    <message>
+        <source>LABELS</source>
+        <translation>Labels</translation>
+    </message>
+    <message>
+        <source>LENGTH</source>
+        <translation>Length</translation>
+    </message>
+    <message>
+        <source>NUMBER</source>
+        <translation>Number</translation>
+    </message>
+    <message>
+        <source>OFFSET</source>
+        <translation>Offset</translation>
+    </message>
+    <message>
+        <source>AXIS_NAME</source>
+        <translation>Axis name</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_FontWidget</name>
+    <message>
+        <source>BOLD</source>
+        <translation>Bold</translation>
+    </message>
+    <message>
+        <source>ARIAL</source>
+        <translation>Arial</translation>
+    </message>
+    <message>
+        <source>TIMES</source>
+        <translation>Times</translation>
+    </message>
+    <message>
+        <source>ITALIC</source>
+        <translation>Italic</translation>
+    </message>
+    <message>
+        <source>SHADOW</source>
+        <translation>Shadow</translation>
+    </message>
+    <message>
+        <source>COURIER</source>
+        <translation>Courier</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_ViewWindow</name>
+    <message>
+        <source>DSC_SVTK_UPDATE_RATE</source>
+        <translation>Update rate</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_SCALING</source>
+        <translation>Scaling</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_SCALING</source>
+        <translation>Scaling</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_GRADUATED_AXES</source>
+        <translation>Graduated axes</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_GRADUATED_AXES</source>
+        <translation>Graduated axes</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_UPDATE_RATE</source>
+        <translation>Update rate</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_RECORDING_START</source>
+        <translation>Start recording</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_RECORDING_START</source>
+        <translation>Start recording</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_RECORDING_PLAY</source>
+        <translation>Play recording</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_RECORDING_PLAY</source>
+        <translation>Play recording</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_RECORDING_PAUSE</source>
+        <translation>Pause recording</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_RECORDING_PAUSE</source>
+        <translation>Pause recording</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_RECORDING_STOP</source>
+        <translation>Stop recording</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_RECORDING_STOP</source>
+        <translation>Stop recording</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_RECORD_LABEL</source>
+        <translation>Recording Operations</translation>
+    </message>
+    <message>
+        <source>MSG_NO_AVI_MAKER</source>
+        <translation>Tool jpeg2yuv, necessary for AVI recording, is not available.
+Please, refer to the documentation.</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_NonIsometricDlg</name>
+    <message>
+        <source>LBL_X</source>
+        <translation>X:</translation>
+    </message>
+    <message>
+        <source>LBL_Y</source>
+        <translation>Y:</translation>
+    </message>
+    <message>
+        <source>LBL_Z</source>
+        <translation>Z:</translation>
+    </message>
+    <message>
+        <source>MEN_SCALING</source>
+        <translation>Scaling</translation>
+    </message>
+    <message>
+        <source>DLG_TITLE</source>
+        <translation>Scaling</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_RecorderDlg</name>
+    <message>
+        <source>ALL_DISLPAYED_FRAMES</source>
+        <translation>Recording all displayed frames</translation>
+    </message>
+    <message>
+        <source>CLOSE</source>
+        <translation>Close</translation>
+    </message>
+    <message>
+        <source>DLG_RECORDER_TITLE</source>
+        <translation>Recorder</translation>
+    </message>
+    <message>
+        <source>FILE_NAME</source>
+        <translation>Save to file : </translation>
+    </message>
+    <message>
+        <source>FLT_ALL_FILES</source>
+        <translation>All Files (*.*)</translation>
+    </message>
+    <message>
+        <source>FLT_AVI_FILES</source>
+        <translation>AVI Files (*.avi)</translation>
+    </message>
+    <message>
+        <source>FPS</source>
+        <translation>FPS : </translation>
+    </message>
+    <message>
+        <source>HELP</source>
+        <translation>Help</translation>
+    </message>
+    <message>
+        <source>PROGRESSIVE</source>
+        <translation>Progressive</translation>
+    </message>
+    <message>
+        <source>QUALITY</source>
+        <translation>Quality : </translation>
+    </message>
+    <message>
+        <source>RECORDING_MODE</source>
+        <translation>Mode : </translation>
+    </message>
+    <message>
+        <source>SETTINGS</source>
+        <translation>Settings</translation>
+    </message>
+    <message>
+        <source>SKIPPED_FRAMES</source>
+        <translation>Recording at a given FPS</translation>
+    </message>
+    <message>
+        <source>START</source>
+        <translation>Start</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_SetRotationPointDlg</name>
+    <message>
+        <source>LBL_X</source>
+        <translation>X:</translation>
+    </message>
+    <message>
+        <source>LBL_Y</source>
+        <translation>Y:</translation>
+    </message>
+    <message>
+        <source>LBL_Z</source>
+        <translation>Z:</translation>
+    </message>
+    <message>
+        <source>LBL_CENTER_OF_BOUNDING_BOX</source>
+        <translation>Center of bounding box</translation>
+    </message>
+    <message>
+        <source>RBUTTONGROUP_TITLE</source>
+        <translation>The rotation point type</translation>
+    </message>
+    <message>
+        <source>USE_BBCENTER</source>
+        <translation>Use Bounding Box Center</translation>
+    </message>
+    <message>
+        <source>LBL_ORIGIN</source>
+        <translation>Origin of the coordinate system</translation>
+    </message>
+    <message>
+        <source>LBL_SELECTED_POINT</source>
+        <translation>Selected point</translation>
+    </message>
+    <message>
+        <source>LBL_TOORIGIN</source>
+        <translation>Set to Origin</translation>
+    </message>
+    <message>
+        <source>LBL_SELECTPOINT</source>
+        <translation>Select Point from View</translation>
+    </message>
+    <message>
+        <source>DLG_TITLE</source>
+        <translation>Set Rotation Point</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_ViewParameterDlg</name>
+    <message>
+        <source>LBL_X</source>
+        <translation>X :</translation>
+    </message>
+    <message>
+        <source>LBL_Y</source>
+        <translation>Y :</translation>
+    </message>
+    <message>
+        <source>LBL_Z</source>
+        <translation>Z :</translation>
+    </message>
+    <message>
+        <source>LBL_DX</source>
+        <translation>DX :</translation>
+    </message>
+    <message>
+        <source>LBL_DY</source>
+        <translation>DY :</translation>
+    </message>
+    <message>
+        <source>LBL_DZ</source>
+        <translation>DZ :</translation>
+    </message>
+    <message>
+        <source>PROJECTION_MODE</source>
+        <translation>Projection Mode</translation>
+    </message>
+    <message>
+        <source>ORTHOGONAL_MODE</source>
+        <translation>Orthogonal</translation>
+    </message>
+    <message>
+        <source>PERSPECTIVE_MODE</source>
+        <translation>Perspective</translation>
+    </message>
+    <message>
+        <source>USE_BBCENTER</source>
+        <translation>Use Bounding Box Center</translation>
+    </message>
+    <message>
+        <source>LBL_TOBBCENTER</source>
+        <translation>Set to Bounding Box Center</translation>
+    </message>
+      <message>
+        <source>LBL_TOORIGIN</source>
+        <translation>Set to Origin</translation>
+    </message>
+  <message>
+        <source>LBL_SELECTPOINT</source>
+        <translation>Select Point from View</translation>
+    </message>
+    <message>
+        <source>FOCAL_POINT</source>
+        <translation>Focal Point</translation>
+    </message>
+    <message>
+        <source>CAMERA_POSITION</source>
+        <translation>Camera Position</translation>
+    </message>
+    <message>
+        <source>WORLD_COORDINATES</source>
+        <translation>World Coordinates</translation>
+    </message>
+    <message>
+        <source>FOCAL_RELATIVE</source>
+        <translation>Relative to Focal Point</translation>
+    </message>
+    <message>
+        <source>PROJECTION_DIRECTION</source>
+        <translation>Projection Direction :</translation>
+    </message>
+    <message>
+        <source>FOCAL_DISTANCE</source>
+        <translation>Focal Distance :</translation>
+    </message>
+    <message>
+        <source>VIEW_UP_DIRECTION</source>
+        <translation>View Up Direction :</translation>
+    </message>
+    <message>
+        <source>ZOOMING</source>
+        <translation>Zooming</translation>
+    </message>
+    <message>
+        <source>LBL_SCALE</source>
+        <translation>Scale</translation>
+    </message>
+    <message>
+        <source>LBL_VIEW_ANGLE</source>
+        <translation>View Angle</translation>
+    </message>
+    <message>
+        <source>DLG_TITLE</source>
+        <translation>View Parameters</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_UpdateRateDlg</name>
+    <message>
+        <source>INFORMATION_FRAME_TITLE</source>
+        <translation>Rendering Metrics</translation>
+    </message>
+    <message>
+        <source>STILL</source>
+        <translation>Still Update Rate, FPS</translation>
+    </message>
+    <message>
+        <source>INPUT_FRAME_TITLE</source>
+        <translation>Enable</translation>
+    </message>
+    <message>
+        <source>NUMBER_CELLS</source>
+        <translation>Number of Cells, -</translation>
+    </message>
+    <message>
+        <source>DESIRED</source>
+        <translation>Desired Update Rate, FPS</translation>
+    </message>
+    <message>
+        <source>CURRENT_FPS</source>
+        <translation>Current Update Rate, FPS</translation>
+    </message>
+    <message>
+        <source>DLG_TITLE</source>
+        <translation>Update Rate</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_ViewManager</name>
+    <message>
+        <source>VTK_VIEW_TITLE</source>
+        <translation>VTK scene:%1 - viewer:%2</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_Viewer</name>
+    <message>
+        <source>MEN_DUMP_VIEW</source>
+        <translation>Dump View...</translation>
+    </message>
+    <message>
+        <source>MEN_SHOW_TOOLBAR</source>
+        <translation>Show toolbar</translation>
+    </message>
+    <message>
+        <source>MEN_CHANGE_BACKGROUD</source>
+        <translation>Change background...</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/SVTK/resources/vtk_view_graduated_axes.png b/src/SVTK/resources/vtk_view_graduated_axes.png
new file mode 100755 (executable)
index 0000000..2b44c06
Binary files /dev/null and b/src/SVTK/resources/vtk_view_graduated_axes.png differ
diff --git a/src/SVTK/resources/vtk_view_parallel.png b/src/SVTK/resources/vtk_view_parallel.png
new file mode 100755 (executable)
index 0000000..dd7a676
Binary files /dev/null and b/src/SVTK/resources/vtk_view_parallel.png differ
diff --git a/src/SVTK/resources/vtk_view_parameters.png b/src/SVTK/resources/vtk_view_parameters.png
new file mode 100755 (executable)
index 0000000..0eee8cc
Binary files /dev/null and b/src/SVTK/resources/vtk_view_parameters.png differ
diff --git a/src/SVTK/resources/vtk_view_perspective.png b/src/SVTK/resources/vtk_view_perspective.png
new file mode 100755 (executable)
index 0000000..36cdd4c
Binary files /dev/null and b/src/SVTK/resources/vtk_view_perspective.png differ
diff --git a/src/SVTK/resources/vtk_view_recording_pause.png b/src/SVTK/resources/vtk_view_recording_pause.png
new file mode 100644 (file)
index 0000000..f181a0f
Binary files /dev/null and b/src/SVTK/resources/vtk_view_recording_pause.png differ
diff --git a/src/SVTK/resources/vtk_view_recording_play.png b/src/SVTK/resources/vtk_view_recording_play.png
new file mode 100644 (file)
index 0000000..7724f48
Binary files /dev/null and b/src/SVTK/resources/vtk_view_recording_play.png differ
diff --git a/src/SVTK/resources/vtk_view_recording_start.png b/src/SVTK/resources/vtk_view_recording_start.png
new file mode 100644 (file)
index 0000000..5b71dc5
Binary files /dev/null and b/src/SVTK/resources/vtk_view_recording_start.png differ
diff --git a/src/SVTK/resources/vtk_view_recording_stop.png b/src/SVTK/resources/vtk_view_recording_stop.png
new file mode 100644 (file)
index 0000000..04db9e3
Binary files /dev/null and b/src/SVTK/resources/vtk_view_recording_stop.png differ
diff --git a/src/SVTK/resources/vtk_view_rotation_point.png b/src/SVTK/resources/vtk_view_rotation_point.png
new file mode 100755 (executable)
index 0000000..fc303e3
Binary files /dev/null and b/src/SVTK/resources/vtk_view_rotation_point.png differ
diff --git a/src/SVTK/resources/vtk_view_scaling.png b/src/SVTK/resources/vtk_view_scaling.png
new file mode 100644 (file)
index 0000000..fa8cbbc
Binary files /dev/null and b/src/SVTK/resources/vtk_view_scaling.png differ
diff --git a/src/SVTK/resources/vtk_view_style_switch.png b/src/SVTK/resources/vtk_view_style_switch.png
new file mode 100755 (executable)
index 0000000..b0a9c80
Binary files /dev/null and b/src/SVTK/resources/vtk_view_style_switch.png differ
diff --git a/src/SVTK/resources/vtk_view_update_rate.png b/src/SVTK/resources/vtk_view_update_rate.png
new file mode 100755 (executable)
index 0000000..3d01ad1
Binary files /dev/null and b/src/SVTK/resources/vtk_view_update_rate.png differ
index 7ced4827f499b21c05d042a7c8fadb9e62896951..cd4a634ea84ec2a4e88ffa9a12c0484416822107 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : SalomeApp
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 if CPPUNIT_IS_OK
 if GUI_ENABLE_CORBA
-  SUBDIRS=Test
+  SUBDIRS = Test
 endif
 endif
 
-lib_LTLIBRARIES= libSalomeApp.la
+lib_LTLIBRARIES = libSalomeApp.la
 
-salomeinclude_HEADERS= \
-       SalomeApp.h \
-       SalomeApp_Application.h \
-       SalomeApp_DataModel.h \
-       SalomeApp_DataObject.h \
-       SalomeApp_Module.h \
-       SalomeApp_Study.h \
-       SalomeApp_ExceptionHandler.h \
-       SalomeApp_EventFilter.h \
-       SalomeApp_Tools.h \
-       SalomeApp_ImportOperation.h \
-       SalomeApp_Filter.h \
-       SalomeApp_TypeFilter.h \
-       SalomeApp_StudyPropertiesDlg.h \
-       SalomeApp_CheckFileDlg.h \
-       SalomeApp_VisualState.h \
-       SalomeApp_ExitDlg.h
+salomeinclude_HEADERS =                        \
+       SalomeApp.h                     \
+       SalomeApp_Application.h         \
+       SalomeApp_DataModel.h           \
+       SalomeApp_DataObject.h          \
+       SalomeApp_LoadStudiesDlg.h      \
+       SalomeApp_Module.h              \
+       SalomeApp_Study.h               \
+       SalomeApp_ExceptionHandler.h    \
+       SalomeApp_PyInterp.h            \
+       SalomeApp_Tools.h               \
+       SalomeApp_ImportOperation.h     \
+       SalomeApp_Filter.h              \
+       SalomeApp_TypeFilter.h          \
+       SalomeApp_StudyPropertiesDlg.h  \
+       SalomeApp_CheckFileDlg.h        \
+       SalomeApp_VisualState.h         \
+       SalomeApp_ExitDlg.h             \
+       SalomeApp_NoteBookDlg.h         \
+       SalomeApp_DoubleSpinBox.h       \
+       SalomeApp_IntSpinBox.h
 
-dist_libSalomeApp_la_SOURCES= \
-       SalomeApp_Module.cxx \
-       SalomeApp_Application.cxx \
-       SalomeApp_DataModel.cxx \
-       SalomeApp_DataObject.cxx \
-       SalomeApp_Study.cxx \
-       SalomeApp_ExceptionHandler.cxx \
-       SalomeApp_EventFilter.cxx \
-       SalomeApp_PyInterp.cxx \
-       SalomeApp_Tools.cxx \
-       SalomeApp_ImportOperation.cxx \
-       SalomeApp_Filter.cxx \
-       SalomeApp_TypeFilter.cxx \
-       SalomeApp_StudyPropertiesDlg.cxx \
-       SalomeApp_ListView.cxx \
-       SalomeApp_CheckFileDlg.cxx \
-       SalomeApp_VisualState.cxx \
-       SalomeApp_ExitDlg.cxx
+dist_libSalomeApp_la_SOURCES =                 \
+       SalomeApp_Module.cxx                    \
+       SalomeApp_Application.cxx               \
+       SalomeApp_DataModel.cxx                 \
+       SalomeApp_DataObject.cxx                \
+       SalomeApp_LoadStudiesDlg.cxx            \
+       SalomeApp_Study.cxx                     \
+       SalomeApp_ExceptionHandler.cxx          \
+       SalomeApp_PyInterp.cxx                  \
+       SalomeApp_Tools.cxx                     \
+       SalomeApp_ImportOperation.cxx           \
+       SalomeApp_Filter.cxx                    \
+       SalomeApp_TypeFilter.cxx                \
+       SalomeApp_StudyPropertiesDlg.cxx        \
+       SalomeApp_ListView.cxx                  \
+       SalomeApp_CheckFileDlg.cxx              \
+       SalomeApp_VisualState.cxx               \
+       SalomeApp_ExitDlg.cxx                   \
+       SalomeApp_NoteBookDlg.cxx               \
+       SalomeApp_DoubleSpinBox.cxx             \
+       SalomeApp_IntSpinBox.cxx
 
-MOC_FILES= \
-       SalomeApp_Application_moc.cxx \
-       SalomeApp_DataModel_moc.cxx \
-       SalomeApp_Module_moc.cxx \
-       SalomeApp_Study_moc.cxx \
-       SalomeApp_StudyPropertiesDlg_moc.cxx \
-       SalomeApp_ListView_moc.cxx \
-       SalomeApp_CheckFileDlg_moc.cxx \
-       SalomeApp_ExitDlg_moc.cxx
+MOC_FILES =                                    \
+       SalomeApp_Application_moc.cxx           \
+       SalomeApp_DataModel_moc.cxx             \
+       SalomeApp_Module_moc.cxx                \
+       SalomeApp_LoadStudiesDlg_moc.cxx        \
+       SalomeApp_Study_moc.cxx                 \
+       SalomeApp_StudyPropertiesDlg_moc.cxx    \
+       SalomeApp_ListView_moc.cxx              \
+       SalomeApp_CheckFileDlg_moc.cxx          \
+       SalomeApp_ExitDlg_moc.cxx               \
+       SalomeApp_NoteBookDlg_moc.cxx           \
+       SalomeApp_DoubleSpinBox_moc.cxx         \
+       SalomeApp_IntSpinBox_moc.cxx
 
-nodist_libSalomeApp_la_SOURCES= $(MOC_FILES)
+nodist_libSalomeApp_la_SOURCES = $(MOC_FILES)
 
-dist_salomeres_DATA= \
-       resources/SalomeApp.ini \
+dist_salomeres_DATA =          \
+       resources/SalomeApp.ini \
        resources/SalomeApp.xml
 
-nodist_salomeres_DATA= \
-       SalomeApp_images.qm \
+nodist_salomeres_DATA =                \
+       SalomeApp_images.qm     \
        SalomeApp_msg_en.qm
 
-libSalomeApp_la_CPPFLAGS=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES) \
-       $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(BOOST_CPPFLAGS) @KERNEL_CXXFLAGS@ \
-       -I$(srcdir)/../LightApp -I$(srcdir)/../CAM -I$(srcdir)/../Qtx \
-       -I$(srcdir)/../SUIT -I$(srcdir)/../OBJECT -I$(srcdir)/../SVTK \
-       -I$(srcdir)/../STD -I$(srcdir)/../VTKViewer -I$(srcdir)/../ObjBrowser \
-       -I$(srcdir)/../PythonConsole -I$(srcdir)/../TOOLSGUI \
-       -I$(srcdir)/../PyInterp -I$(srcdir)/../Session -I$(top_builddir)/idl \
-       -I$(srcdir)/../Event \
-       -I$(srcdir)/../CASCatch \
+libSalomeApp_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES)   \
+       $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(BOOST_CPPFLAGS) @KERNEL_CXXFLAGS@     \
+       -I$(srcdir)/../LightApp -I$(srcdir)/../CAM -I$(srcdir)/../Qtx           \
+       -I$(srcdir)/../SUIT -I$(srcdir)/../OBJECT -I$(srcdir)/../SVTK           \
+       -I$(srcdir)/../STD -I$(srcdir)/../VTKViewer -I$(srcdir)/../ObjBrowser   \
+       -I$(srcdir)/../PyConsole -I$(srcdir)/../TOOLSGUI                        \
+       -I$(srcdir)/../PyInterp -I$(srcdir)/../Session -I$(top_builddir)/idl    \
+       -I$(srcdir)/../Event -I$(srcdir)/../CASCatch                            \
        -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @LIBXML_INCLUDES@
-libSalomeApp_la_LDFLAGS=$(PYTHON_LIBS) $(QT_MT_LIBS) 
-libSalomeApp_la_LIBADD= $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSalomeDSClient \
-       ../SUIT/libsuit.la ../STD/libstd.la ../CAM/libCAM.la ../ObjBrowser/libObjBrowser.la \
-       ../Prs/libSalomePrs.la ../SPlot2d/libSPlot2d.la ../GLViewer/libGLViewer.la \
-       ../OCCViewer/libOCCViewer.la ../VTKViewer/libVTKViewer.la ../OBJECT/libSalomeObject.la \
-       ../SVTK/libSVTK.la ../SOCC/libSOCC.la ../PyInterp/libPyInterp.la \
-       ../PythonConsole/libPythonConsole.la ../LogWindow/libLogWindow.la \
-       ../LightApp/libLightApp.la ../TOOLSGUI/libToolsGUI.la ../CASCatch/libCASCatch.la $(CAS_KERNEL)
-
-EXTRA_DIST+=SalomeApp_PyInterp.h
+libSalomeApp_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) 
+libSalomeApp_la_LIBADD  = $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSalomeDSClient               \
+       ../SUIT/libsuit.la ../STD/libstd.la ../CAM/libCAM.la ../ObjBrowser/libObjBrowser.la     \
+       ../Prs/libSalomePrs.la ../SPlot2d/libSPlot2d.la ../GLViewer/libGLViewer.la              \
+       ../OCCViewer/libOCCViewer.la ../VTKViewer/libVTKViewer.la ../OBJECT/libSalomeObject.la  \
+       ../SVTK/libSVTK.la ../SOCC/libSOCC.la ../PyInterp/libPyInterp.la                        \
+       ../PyConsole/libPyConsole.la ../LogWindow/libLogWindow.la                               \
+       ../LightApp/libLightApp.la ../TOOLSGUI/libToolsGUI.la ../Session/libSalomeSession.la    \
+       ../Event/libEvent.la ../CASCatch/libCASCatch.la $(CAS_KERNEL)
index 130299b083a15629df889a2ec49c8541746ae952..51d8ed6b688847e79a8a3593c218ded40178164f 100644 (file)
@@ -1,34 +1,35 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      SalomeApp.h
 // Created:   November, 2004
 // Author:    OCC team
-// Copyright (C) CEA 2004
-
-
 // The following ifdef block is the standard way of creating macros which make exporting 
 // from a DLL simpler. All files within this DLL are compiled with the SalomeApp_EXPORTS
 // symbol defined on the command line. this symbol should not be defined on any project
 // that uses this DLL. This way any other project whose source files include this file see 
 // SalomeApp_API functions as being imported from a DLL, wheras this DLL sees symbols
 // defined with this macro as being exported.
-#ifdef WNT
+//
+#ifdef WIN32
 
 #ifdef SALOMEAPP_EXPORTS
 #define SALOMEAPP_EXPORT __declspec(dllexport)
 
 #else
 #define SALOMEAPP_EXPORT
-#endif               //WNT
+#endif               //WIN32
 
 #define APP_VERSION "0.1"
 
-#if defined WNT
+#if defined WIN32
 #pragma warning ( disable: 4251 )
 #endif
 
diff --git a/src/SalomeApp/SalomeApp.pro b/src/SalomeApp/SalomeApp.pro
new file mode 100644 (file)
index 0000000..a5d6eca
--- /dev/null
@@ -0,0 +1,110 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = SalomeApp
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
+
+QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
+
+QWT_INCLUDES = $$(QWTHOME)/include
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+VTK_INCLUDES = $$(VTKHOME)/include/vtk
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
+
+CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS
+
+HDF5_INCLUDES = $$(HDF5HOME)/include
+
+PYTHON_LIBS = -L$$(PYTHONHOME)/lib/python2.4/config -lpython2.4 -ldl -lutil
+
+QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
+
+KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
+
+CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
+
+
+INCLUDEPATH += $${PYTHON_INCLUDES} $${QT_INCLUDES} $${QWT_INCLUDES} $${CAS_CPPFLAGS} $${VTK_INCLUDES} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} ../LightApp ../CAM ../Qtx ../SUIT ../OBJECT ../SVTK ../STD ../VTKViewer ../PyConsole ../TOOLSGUI ../PyInterp ../Session ../../idl ../Event ../../salome_adm/unix $${CORBA_INCLUDES} #../ObjBrowser
+
+LIBS += $${QT_MT_LIBS} $${PYTHON_LIBS} $${KERNEL_LDFLAGS} -lOpUtil -lSALOMELocalTrace -lSalomeDSClient -L../../lib -lsuit -lstd -lCAM -lSalomePrs -lSPlot2d -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSVTK -lSOCC -lPyInterp -lPyConsole -lLogWindow -lLightApp -lToolsGUI $${CAS_KERNEL} #-lObjBrowser
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += SALOMEAPP_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS OMNIORB_VERSION=4 __x86__ __linux__ COMP_CORBA_DOUBLE COMP_CORBA_LONG
+
+HEADERS  = SalomeApp.h
+HEADERS += SalomeApp_Application.h
+HEADERS += SalomeApp_DataModel.h
+HEADERS += SalomeApp_DataObject.h
+HEADERS += SalomeApp_LoadStudiesDlg.h
+HEADERS += SalomeApp_Module.h
+HEADERS += SalomeApp_Study.h
+HEADERS += SalomeApp_ExceptionHandler.h
+HEADERS += SalomeApp_Tools.h
+HEADERS += SalomeApp_ImportOperation.h
+HEADERS += SalomeApp_Filter.h
+HEADERS += SalomeApp_TypeFilter.h
+HEADERS += SalomeApp_StudyPropertiesDlg.h
+HEADERS += SalomeApp_CheckFileDlg.h
+HEADERS += SalomeApp_VisualState.h
+
+SOURCES  = SalomeApp_Module.cxx
+SOURCES += SalomeApp_Application.cxx
+SOURCES += SalomeApp_DataModel.cxx
+SOURCES += SalomeApp_DataObject.cxx
+SOURCES += SalomeApp_LoadStudiesDlg.cxx
+SOURCES += SalomeApp_Study.cxx
+SOURCES += SalomeApp_ExceptionHandler.cxx
+SOURCES += SalomeApp_PyInterp.cxx
+SOURCES += SalomeApp_Tools.cxx
+SOURCES += SalomeApp_ImportOperation.cxx
+SOURCES += SalomeApp_Filter.cxx
+SOURCES += SalomeApp_TypeFilter.cxx
+SOURCES += SalomeApp_StudyPropertiesDlg.cxx
+SOURCES += SalomeApp_ListView.cxx
+SOURCES += SalomeApp_CheckFileDlg.cxx
+SOURCES += SalomeApp_VisualState.cxx
+
+TRANSLATIONS = resources/SalomeApp_images.ts \
+               resources/SalomeApp_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 802d7d7b0fd5ea10fc7d4ff3161750f9ff73592f..2c66cbdd71240e1ab49431ff7a4cfaf214c34239 100644 (file)
@@ -1,91 +1,94 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      SalomeApp_Application.cxx
 // Created:   10/22/2004 3:23:45 PM
 // Author:    Sergey LITONIN
-// Copyright (C) CEA 2004
-
+//
 #include "SalomeApp_PyInterp.h" // WARNING! This include must be the first!
-
 #include "SalomeApp_Application.h"
-
 #include "SalomeApp_Study.h"
 #include "SalomeApp_DataModel.h"
 #include "SalomeApp_DataObject.h"
-#include "SalomeApp_EventFilter.h"
 #include "SalomeApp_VisualState.h"
-#include "SalomeApp_ExitDlg.h"
-
 #include "SalomeApp_StudyPropertiesDlg.h"
+#include "SalomeApp_LoadStudiesDlg.h"
+#include "SalomeApp_NoteBookDlg.h"
+
+#include "SalomeApp_ExitDlg.h"
 
-#include "LightApp_Application.h"
-#include "LightApp_Preferences.h"
-#include "LightApp_WidgetContainer.h"
-#include "LightApp_SelectionMgr.h"
-#include "LightApp_NameDlg.h"
+#include <LightApp_Application.h>
+#include <LightApp_Preferences.h>
+#include <LightApp_SelectionMgr.h>
+#include <LightApp_NameDlg.h>
+#include <LightApp_DataOwner.h>
 
-#include "STD_LoadStudiesDlg.h"
+#include <CAM_Module.h>
 
 #include <SUIT_Tools.h>
 #include <SUIT_Session.h>
-#include <SUIT_MsgDlg.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_DataBrowser.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_FileValidator.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_TreeModel.h>
 
-#include <QtxMRUAction.h>
+#include <QtxTreeView.h>
 
-#include <OB_Browser.h>
-#include <OB_ListItem.h>
+#include <SALOME_EventFilter.h>
 
-#include <PythonConsole_PyConsole.h>
+// temporary commented
+//#include <OB_ListItem.h>
 
-#include <SUIT_FileDlg.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_ActionOperation.h>
+#include <PyConsole_Console.h>
 
 #include <Utils_ORB_INIT.hxx>
 #include <Utils_SINGLETON.hxx>
-#include <SALOME_ModuleCatalog_impl.hxx>
 #include <SALOME_LifeCycleCORBA.hxx>
 
-#include <qaction.h>
-#include <qcombobox.h>
-#include <qlistbox.h>
-#include <qregexp.h>
-#include <qcheckbox.h>
-#include <qpushbutton.h>
-#include <qlabel.h>
-#include <qmessagebox.h>
+#include <QApplication>
+#include <QAction>
+#include <QRegExp>
+#include <QCheckBox>
+#include <QPushButton>
+#include <QLabel>
+#include <QListWidget>
+#include <QGridLayout>
+#include <QMenu>
 
-#include "SALOMEDSClient_ClientFactory.hxx"
-#include "SALOMEDSClient_IParameters.hxx"
+#include <SALOMEDSClient_ClientFactory.hxx>
 
-#include "SALOME_ListIteratorOfListIO.hxx"
-#include "SALOME_ListIO.hxx"
+#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
 
-#include "ToolsGUI_CatalogGeneratorDlg.h"
-#include "ToolsGUI_RegWidget.h"
-
-#include <SALOMEDSClient_ClientFactory.hxx>
+#include <ToolsGUI_CatalogGeneratorDlg.h>
+#include <ToolsGUI_RegWidget.h>
 
 #include <vector>
+
 /*!Internal class that updates object browser item properties */
-class SalomeApp_Updater : public OB_Updater
+// temporary commented
+/*class SalomeApp_Updater : public OB_Updater
 {
 public:
   SalomeApp_Updater() : OB_Updater(){};
@@ -101,7 +104,7 @@ void SalomeApp_Updater::update( SUIT_DataObject* theObj, OB_ListItem* theItem )
   SalomeApp_DataObject* SAObj = dynamic_cast<SalomeApp_DataObject*>( theObj );
   if( !SAObj )
     return;
-  
+
   _PTR(SObject) SObj = SAObj->object();
   if( !SObj )
     return;
@@ -114,19 +117,19 @@ void SalomeApp_Updater::update( SUIT_DataObject* theObj, OB_ListItem* theItem )
     theItem->setSelectable( aAttrSel->IsSelectable() );
   }
   // Expandable
-  if ( SObj->FindAttribute(anAttr, "AttributeExpandable") ) 
+  if ( SObj->FindAttribute(anAttr, "AttributeExpandable") )
   {
     _PTR(AttributeExpandable) aAttrExpand = anAttr;
     theItem->setExpandable( aAttrExpand->IsExpandable() );
   }
   // Opened
   //this attribute is not supported in the version of SALOME 3.x
-  //if ( SObj->FindAttribute(anAttr, "AttributeOpened") ) 
+  //if ( SObj->FindAttribute(anAttr, "AttributeOpened") )
   //{
   //  _PTR(AttributeOpened) aAttrOpen = anAttr;
   //  theItem->setOpen( aAttrOpen->IsOpened() );
   //}
-}
+}*/
 
 /*!Create new instance of SalomeApp_Application.*/
 extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
@@ -136,10 +139,11 @@ extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
 
 /*!Constructor.*/
 SalomeApp_Application::SalomeApp_Application()
-: LightApp_Application()
+  : LightApp_Application()
 {
-  connect( desktop(), SIGNAL( message( const QString& ) ), 
+  connect( desktop(), SIGNAL( message( const QString& ) ),
           this,      SLOT( onDesktopMessage( const QString& ) ) );
+  setNoteBook(0);
 }
 
 /*!Destructor.
@@ -148,7 +152,7 @@ SalomeApp_Application::SalomeApp_Application()
 SalomeApp_Application::~SalomeApp_Application()
 {
   // Do not destroy. It's a singleton !
-  //SalomeApp_EventFilter::Destroy();
+  //SALOME_EventFilter::Destroy();
 }
 
 /*!Start application.*/
@@ -156,7 +160,7 @@ void SalomeApp_Application::start()
 {
   LightApp_Application::start();
 
-  SalomeApp_EventFilter::Init();
+  SALOME_EventFilter::Init();
 
   static bool isFirst = true;
   if ( isFirst ) {
@@ -167,17 +171,17 @@ void SalomeApp_Application::start()
 
     for (int i = 1; i < qApp->argc(); i++) {
       QRegExp rxs ("--study-hdf=(.+)");
-      if ( rxs.search( QString(qApp->argv()[i]) ) >= 0 && rxs.capturedTexts().count() > 1 ) {
+      if ( rxs.indexIn( QString(qApp->argv()[i]) ) >= 0 && rxs.capturedTexts().count() > 1 ) {
        QString file = rxs.capturedTexts()[1];
         QFileInfo fi ( file );
-        QString extension = fi.extension( false ).lower();
+        QString extension = fi.suffix().toLower();
         if ( extension == "hdf" && fi.exists() )
-          hdffile = fi.absFilePath();
+          hdffile = fi.absoluteFilePath();
       }
       else {
         QRegExp rxp ("--pyscript=(.+)");
-        if ( rxp.search( QString(qApp->argv()[i]) ) >= 0 && rxp.capturedTexts().count() > 1 ) {
-          QStringList files = QStringList::split(",",rxp.capturedTexts()[1],false);
+        if ( rxp.indexIn( QString(qApp->argv()[i]) ) >= 0 && rxp.capturedTexts().count() > 1 ) {
+          QStringList files = rxp.capturedTexts()[1].split(",",QString::SkipEmptyParts);
           pyfiles += files;
         }
       }
@@ -196,19 +200,19 @@ void SalomeApp_Application::start()
        if ( !aStudy->GetProperties()->IsLocked() ) {
           for (uint j = 0; j < pyfiles.count(); j++ ) {
             QFileInfo fi ( pyfiles[j] );
-           PythonConsole* pyConsole = pythonConsole();
+           PyConsole_Console* pyConsole = pythonConsole();
            if ( pyConsole ) {
-              QString extension = fi.extension( false ).lower();
+              QString extension = fi.suffix().toLower();
               if ( fi.exists() ) {
                 // execute python script
-                QString command = QString( "execfile(\"%1\")" ).arg( fi.absFilePath() );
+                QString command = QString( "execfile(\"%1\")" ).arg( fi.absoluteFilePath() );
                 pyConsole->exec( command );
               }
               else {
                 // import python module
                 QString command = QString( "import %1" ).arg( pyfiles[j] );
                if ( extension == "py" )
-                 command = QString( "import %1" ).arg( fi.baseName( true ) );
+                 command = QString( "import %1" ).arg( fi.completeBaseName() );
                 pyConsole->exec( command );
               }
             }
@@ -225,60 +229,66 @@ void SalomeApp_Application::createActions()
   LightApp_Application::createActions();
 
   SUIT_Desktop* desk = desktop();
-  
+
   //! Save GUI state
   // "Save GUI State" command is moved to VISU module
-  //  createAction( SaveGUIStateId, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIconSet(),
+  //  createAction( SaveGUIStateId, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIcon(),
   //           tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
   //           0, desk, false, this, SLOT( onSaveGUIState() ) );
-  
+
   //! Dump study
-  createAction( DumpStudyId, tr( "TOT_DESK_FILE_DUMP_STUDY" ), QIconSet(),
+  createAction( DumpStudyId, tr( "TOT_DESK_FILE_DUMP_STUDY" ), QIcon(),
                tr( "MEN_DESK_FILE_DUMP_STUDY" ), tr( "PRP_DESK_FILE_DUMP_STUDY" ),
-               CTRL+Key_D, desk, false, this, SLOT( onDumpStudy() ) );
-    
+               Qt::CTRL+Qt::Key_D, desk, false, this, SLOT( onDumpStudy() ) );
+
+  //! NoteBook
+  createAction(NoteBookId, tr( "TOT_DESK_FILE_NOTEBOOK" ), QIcon(),
+               tr( "MEN_DESK_FILE_NOTEBOOK" ), tr( "PRP_DESK_FILE_NOTEBOOK" ),
+               Qt::CTRL+Qt::Key_K, desk, false, this, SLOT(onNoteBook()));
+
   //! Load script
-  createAction( LoadScriptId, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), QIconSet(),
+  createAction( LoadScriptId, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), QIcon(),
                tr( "MEN_DESK_FILE_LOAD_SCRIPT" ), tr( "PRP_DESK_FILE_LOAD_SCRIPT" ),
-               CTRL+Key_T, desk, false, this, SLOT( onLoadScript() ) );
+               Qt::CTRL+Qt::Key_T, desk, false, this, SLOT( onLoadScript() ) );
 
   //! Properties
-  createAction( PropertiesId, tr( "TOT_DESK_PROPERTIES" ), QIconSet(),
+  createAction( PropertiesId, tr( "TOT_DESK_PROPERTIES" ), QIcon(),
                tr( "MEN_DESK_PROPERTIES" ), tr( "PRP_DESK_PROPERTIES" ),
-               CTRL+Key_P, desk, false, this, SLOT( onProperties() ) );
+               Qt::CTRL+Qt::Key_P, desk, false, this, SLOT( onProperties() ) );
 
   //! Catalog Generator
-  createAction( CatalogGenId, tr( "TOT_DESK_CATALOG_GENERATOR" ),  QIconSet(),
+  createAction( CatalogGenId, tr( "TOT_DESK_CATALOG_GENERATOR" ),  QIcon(),
                tr( "MEN_DESK_CATALOG_GENERATOR" ), tr( "PRP_DESK_CATALOG_GENERATOR" ),
-               SHIFT+Key_G, desk, false, this, SLOT( onCatalogGen() ) );
+               Qt::SHIFT+Qt::Key_G, desk, false, this, SLOT( onCatalogGen() ) );
 
   //! Registry Display
-  createAction( RegDisplayId, tr( "TOT_DESK_REGISTRY_DISPLAY" ),  QIconSet(),
+  createAction( RegDisplayId, tr( "TOT_DESK_REGISTRY_DISPLAY" ),  QIcon(),
                tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ),
-               /*SHIFT+Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) );
+               /*Qt::SHIFT+Qt::Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) );
 
   //SRN: BugID IPAL9021, add an action "Load"
   createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
                 resourceMgr()->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
                tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
-               CTRL+Key_L, desk, false, this, SLOT( onLoadDoc() ) );
+               Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) );
   //SRN: BugID IPAL9021: End
 
 
   int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
 
-  // "Save GUI State" command is renamed to "Save VISU State" and 
+  // "Save GUI State" command is renamed to "Save VISU State" and
   // creation of menu item is moved to VISU
-  //  createMenu( SaveGUIStateId, fileMenu, 10, -1 ); 
+  //  createMenu( SaveGUIStateId, fileMenu, 10, -1 );
 
   createMenu( FileLoadId,   fileMenu, 0 );  //SRN: BugID IPAL9021, add a menu item "Load"
 
   createMenu( DumpStudyId, fileMenu, 10, -1 );
-  createMenu( separator(), fileMenu, -1, 15, -1 );
+  createMenu( NoteBookId, fileMenu, 10, -1 );
+  createMenu( separator(), fileMenu, -1, 10, -1 );
   createMenu( LoadScriptId, fileMenu, 10, -1 );
-  createMenu( separator(), fileMenu, -1, 15, -1 );
+  createMenu( separator(), fileMenu, -1, 10, -1 );
   createMenu( PropertiesId, fileMenu, 10, -1 );
-  createMenu( separator(), fileMenu, -1, 15, -1 );
+  createMenu( separator(), fileMenu, -1, 10, -1 );
 
   int toolsMenu = createMenu( tr( "MEN_DESK_TOOLS" ), -1, MenuToolsId, 50 );
   createMenu( CatalogGenId, toolsMenu, 10, -1 );
@@ -286,174 +296,101 @@ void SalomeApp_Application::createActions()
   createMenu( separator(), toolsMenu, -1, 15, -1 );
 }
 
-/*! Purpose : SLOT. Open new document with \a aName.*/
-bool SalomeApp_Application::onOpenDoc( const QString& aName )
+/*!
+  \brief Close application.
+*/
+void SalomeApp_Application::onExit()
 {
-  bool res = false, toOpen = true, isAlreadyOpen = false;
-
-  // Look among opened studies
-  if (activeStudy()) { // at least one study is opened
-    SUIT_Session* aSession = SUIT_Session::session();
-    QPtrList<SUIT_Application> aAppList = aSession->applications();
-    QPtrListIterator<SUIT_Application> it (aAppList);
-    SUIT_Application* aApp = 0;
-    // iterate on all applications
-    for (; (aApp = it.current()) && !isAlreadyOpen; ++it) {
-      if (aApp->activeStudy()->studyName() == aName) {
-        isAlreadyOpen = true; // Already opened, ask user what to do
-
-        // The document ... is already open.
-        // Do you want to reload it?
-        int aAnswer = SUIT_MessageBox::warn2(desktop(), tr("WRN_WARNING"),
-                                             tr("QUE_DOC_ALREADYOPEN").arg(aName),
-                                             tr("BUT_YES"), tr("BUT_NO"), 1, 2, 2);
-        if (aAnswer == 1) { // reload
-          if (activeStudy()->studyName() == aName && aAppList.count() > 1) {
-            // Opened in THIS (active) application.
-            STD_Application* app1 = (STD_Application*)aAppList.at(0);
-            STD_Application* app2 = (STD_Application*)aAppList.at(1);
-            if (!app1 || !app2) {
-              // Error
-              return false;
-            }
-            if (app1->activeStudy()->studyName() == aName) {
-              // app1 is this application, we need another one
-              app1 = app2;
-            }
-            // Close document of this application. This application will be destroyed.
-            onCloseDoc(/*ask = */false);
-            // Open the file with another application, as this one will be destroyed.
-            return app1->onOpenDoc(aName);
-          } else {
-            // Opened in another application.
-            STD_Application* app = (STD_Application*)aApp;
-            if (app)
-              app->onCloseDoc(/*ask = */false);
-          }
-        } else { // do not reload
-          // OK, the study will not be reloaded, but we call
-          // CAM_Application::onOpenDoc( aName ) all the same.
-          // It will activate a desktop of the study <aName>.
-        }
-      }
-    }
-  }
-
-  // Look among unloaded studies
-  if (!isAlreadyOpen) {
-    std::vector<std::string> List = studyMgr()->GetOpenStudies();
-
-    QString studyName;
-    for (unsigned int ind = 0; ind < List.size() && !isAlreadyOpen; ind++) {
-      studyName = List[ind].c_str();
-      if (aName == studyName) {
-        // Already exists unloaded, ask user what to do
-        isAlreadyOpen = true;
+  bool killServers = false;
+  bool result = true;
 
-        // The document ... already exists in the study manager.
-        // Do you want to reload it?
-        int aAnswer = SUIT_MessageBox::warn2(desktop(), tr("WRN_WARNING"),
-                                             tr("QUE_DOC_ALREADYEXIST").arg(aName),
-                                             tr("BUT_YES"), tr("BUT_NO"), 1, 2, 2);
-        if (aAnswer == 1) {
-          _PTR(Study) aStudy = studyMgr()->GetStudyByName(aName.latin1());
-          if (aStudy)
-            studyMgr()->Close(aStudy);
-        } else {
-          toOpen = false;
-        }
-      }
-    }
+  if ( exitConfirmation() ) {
+    SalomeApp_ExitDlg dlg( desktop() );
+    result = dlg.exec() == QDialog::Accepted;
+    killServers = dlg.isServersShutdown();
   }
 
-  if (toOpen)
-    res = CAM_Application::onOpenDoc( aName );
-
-  QAction* a = action( MRUId );
-  if ( a && a->inherits( "QtxMRUAction" ) )
-  {
-    QtxMRUAction* mru = (QtxMRUAction*)a;
-    if ( res )
-      mru->insert( aName );
-    else
-      mru->remove( aName );
-  }
-  return res;
+  if ( result )
+    SUIT_Session::session()->closeSession( SUIT_Session::ASK, killServers );
 }
 
 /*!SLOT. Load document.*/
 void SalomeApp_Application::onLoadDoc()
 {
-  QString name, studyname, ext;
-
-  STD_LoadStudiesDlg aDlg( desktop(), TRUE);
+  QString studyName;
 
   std::vector<std::string> List = studyMgr()->GetOpenStudies();
 
   SUIT_Session* aSession = SUIT_Session::session();
-  QPtrList<SUIT_Application> aAppList = aSession->applications();
-  SUIT_Application* aApp = 0;
+  QList<SUIT_Application*> aAppList = aSession->applications();
 
-  for (unsigned int ind = 0; ind < List.size(); ind++) {
-     studyname = List[ind].c_str();
-     //Add to list only unloaded studies
+  QStringList unloadedStudies;
+
+  for ( unsigned int ind = 0; ind < List.size(); ind++ ) {
+     studyName = List[ind].c_str();
+     // Add to list only unloaded studies
      bool isAlreadyOpen = false;
-     for ( QPtrListIterator<SUIT_Application> it( aAppList ); it.current() && !isAlreadyOpen; ++it )
-       {
-        aApp = it.current();
-        if(!aApp || !aApp->activeStudy()) continue;
-        if ( aApp->activeStudy()->studyName() == studyname ) isAlreadyOpen = true;
-       }
+     QListIterator<SUIT_Application*> it( aAppList );
+     while ( it.hasNext() && !isAlreadyOpen ) {
+       SUIT_Application* aApp = it.next();
+       if( !aApp || !aApp->activeStudy() )
+        continue;
+       if ( aApp->activeStudy()->studyName() == studyName )
+        isAlreadyOpen = true;
+     }
 
-     if ( !isAlreadyOpen ) aDlg.ListComponent->insertItem( studyname );
+     if ( !isAlreadyOpen )
+       unloadedStudies << studyName;
   }
 
-  int retVal = aDlg.exec();
-  studyname = aDlg.ListComponent->currentText();
-
-  if (retVal == QDialog::Rejected)
+  studyName = SalomeApp_LoadStudiesDlg::selectStudy( desktop(), unloadedStudies );
+  if ( studyName.isEmpty() )
     return;
 
-  if ( studyname.isNull() || studyname.isEmpty() )
-    return;
-
-  name = studyname;
-#ifndef WNT
-  //this code replace marker of windows drive and path become invalid therefore 
+#ifndef WIN32
+  // this code replaces marker of windows drive and path become invalid therefore
   // defines placed there
-  name.replace( QRegExp(":"), "/" );
+  studyName.replace( QRegExp(":"), "/" );
 #endif
 
-  if( LightApp_Application::onLoadDoc( name ) )
-  {
-     updateWindows();
-     updateViewManagers();
-     updateObjectBrowser(true);
-  }
-}
-
-/*!
-  \brief Close application.
-*/
-void SalomeApp_Application::onExit()
-{
-  bool killServers = false;
-  bool result = true;
-
-  if ( exitConfirmation() ) {
-    SalomeApp_ExitDlg dlg( desktop() );
-    result = dlg.exec() == QDialog::Accepted;
-    killServers = dlg.isServersShutdown();
+  if ( onLoadDoc( studyName ) ) {
+    updateWindows();
+    updateViewManagers();
+    updateObjectBrowser( true );
   }
-  
-  if ( result )
-    SUIT_Session::session()->closeSession( SUIT_Session::ASK, killServers );
 }
 
 /*!SLOT. Load document with \a aName.*/
 bool SalomeApp_Application::onLoadDoc( const QString& aName )
 {
-  return LightApp_Application::onLoadDoc( aName );
+  bool res = true;
+  if ( !activeStudy() ) {
+    // if no study - load in current desktop
+    res = useStudy( aName );
+  }
+  else {
+    // if study exists - load in new desktop. Check: is the same file is loaded?
+    SUIT_Session* aSession = SUIT_Session::session();
+    QList<SUIT_Application*> aAppList = aSession->applications();
+    bool isAlreadyOpen = false;
+    SalomeApp_Application* aApp = 0;
+    for ( QList<SUIT_Application*>::iterator it = aAppList.begin();
+         it != aAppList.end() && !isAlreadyOpen; ++it ) {
+      aApp = dynamic_cast<SalomeApp_Application*>( *it );
+      if ( aApp && aApp->activeStudy()->studyName() == aName )
+        isAlreadyOpen = true;
+    }
+    if ( !isAlreadyOpen ) {
+      aApp = dynamic_cast<SalomeApp_Application*>( startApplication( 0, 0 ) );
+      if ( aApp )
+        res = aApp->useStudy( aName );
+    }
+    else {
+      aApp->desktop()->activateWindow();
+    }
+  }
+
+  return res;
 }
 
 /*!SLOT. Copy objects to study maneger from selection maneger..*/
@@ -462,10 +399,10 @@ void SalomeApp_Application::onCopy()
   SALOME_ListIO list;
   LightApp_SelectionMgr* mgr = selectionMgr();
   mgr->selectedObjects(list);
-  
+
   SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(activeStudy());
   if(study == NULL) return;
-  
+
   _PTR(Study) stdDS = study->studyDS();
   if(!stdDS) return;
 
@@ -496,10 +433,9 @@ void SalomeApp_Application::onPaste()
   if(!stdDS) return;
 
   if ( stdDS->GetProperties()->IsLocked() ) {
-    SUIT_MessageBox::warn1 ( desktop(),
-                            QObject::tr("WRN_WARNING"),
-                            QObject::tr("WRN_STUDY_LOCKED"),
-                            QObject::tr("BUT_OK") );
+    SUIT_MessageBox::warning( desktop(),
+                             QObject::tr("WRN_WARNING"),
+                             QObject::tr("WRN_STUDY_LOCKED") );
     return;
   }
 
@@ -517,27 +453,34 @@ void SalomeApp_Application::onPaste()
     }
 }
 
+/*!Check the application on closing.
+ * \retval true if possible, else false
+ */
+bool SalomeApp_Application::isPossibleToClose( bool& closePermanently )
+{
+  return LightApp_Application::isPossibleToClose( closePermanently );
+}
+
 /*! Check if the study is locked */
 void SalomeApp_Application::onCloseDoc( bool ask )
 {
   SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(activeStudy());
 
   if (study != NULL) {
-    _PTR(Study) stdDS = study->studyDS(); 
+    _PTR(Study) stdDS = study->studyDS();
     if(stdDS && stdDS->IsStudyLocked()) {
-      if ( SUIT_MessageBox::warn2( desktop(),
-                                  QObject::tr( "WRN_WARNING" ),
-                                  QObject::tr( "CLOSE_LOCKED_STUDY" ),
-                                  QObject::tr( "BUT_YES" ), 
-                                  QObject::tr( "BUT_NO" ),
-                                  SUIT_YES, 
-                                  SUIT_NO, 
-                                  SUIT_NO ) == SUIT_NO ) return;
-       
+      if ( SUIT_MessageBox::question( desktop(),
+                                     QObject::tr( "WRN_WARNING" ),
+                                     QObject::tr( "CLOSE_LOCKED_STUDY" ),
+                                     SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                     SUIT_MessageBox::No) == SUIT_MessageBox::No ) return;
+
     }
   }
 
   LightApp_Application::onCloseDoc( ask );
+  if(myNoteBook && myNoteBook->isVisible())
+     myNoteBook->hide();
 }
 
 /*!Sets enable or disable some actions on selection changed.*/
@@ -577,7 +520,7 @@ void SalomeApp_Application::onDeleteInvalidReferences()
 {
   SALOME_ListIO aList;
   LightApp_SelectionMgr* mgr = selectionMgr();
-  mgr->selectedObjects( aList, QString::null, false );
+  mgr->selectedObjects( aList, QString(), false );
 
   if( aList.IsEmpty() )
     return;
@@ -603,7 +546,7 @@ void SalomeApp_Application::onDeleteInvalidReferences()
 /*!Private SLOT. */
 void SalomeApp_Application::onOpenWith()
 {
-  QApplication::setOverrideCursor( Qt::waitCursor );
+  QApplication::setOverrideCursor( Qt::WaitCursor );
   SALOME_ListIO aList;
   LightApp_SelectionMgr* mgr = selectionMgr();
   mgr->selectedObjects(aList);
@@ -647,6 +590,11 @@ void SalomeApp_Application::updateCommandsStatus()
   if ( a )
     a->setEnabled( activeStudy() );
 
+  // Note Book
+  a = action(NoteBookId);
+  if( a )
+    a->setEnabled( activeStudy() );
+  
   // Load script menu
   a = action( LoadScriptId );
   if ( a )
@@ -668,25 +616,62 @@ void SalomeApp_Application::updateCommandsStatus()
 
 /*!
   \class DumpStudyFileDlg
-  Private class used in Dump Study operation.  Consists 2 check boxes: 
+  Private class used in Dump Study operation.  Consists 2 check boxes:
   "Publish in study" and "Save GUI parameters"
 */
 class DumpStudyFileDlg : public SUIT_FileDlg
 {
 public:
-  DumpStudyFileDlg( QWidget* parent ) : SUIT_FileDlg( parent, false, true, true ) 
+  DumpStudyFileDlg( QWidget* parent ) : SUIT_FileDlg( parent, false, true, true )
   {
-    QHBox* hB = new QHBox( this );
-    myPublishChk = new QCheckBox( tr("PUBLISH_IN_STUDY"), hB );
-    mySaveGUIChk = new QCheckBox( tr("SAVE_GUI_STATE"), hB );
-    QPushButton* pb = new QPushButton(this);      
-    addWidgets( new QLabel("", this), hB, pb );
-    pb->hide();    
+    QGridLayout* grid = ::qobject_cast<QGridLayout*>( layout() );
+    if ( grid )
+    {
+      QWidget *hB = new QWidget( this );
+      myPublishChk = new QCheckBox( tr("PUBLISH_IN_STUDY") );
+      mySaveGUIChk = new QCheckBox( tr("SAVE_GUI_STATE") );
+
+      QHBoxLayout *layout = new QHBoxLayout;
+      layout->addWidget(myPublishChk);
+      layout->addWidget(mySaveGUIChk);
+      hB->setLayout(layout);
+
+      QPushButton* pb = new QPushButton(this);
+
+      int row = grid->rowCount();
+      grid->addWidget( new QLabel("", this), row, 0 );
+      grid->addWidget( hB, row, 1, 1, 3 );
+      grid->addWidget( pb, row, 5 );
+
+      pb->hide();
+    }
   }
   QCheckBox* myPublishChk;
   QCheckBox* mySaveGUIChk;
 };
 
+class DumpStudyFileValidator : public SUIT_FileValidator
+{
+ public:
+  DumpStudyFileValidator( QWidget* parent) : SUIT_FileValidator ( parent ) {};
+  virtual ~DumpStudyFileValidator() {};
+  virtual bool canSave( const QString& file, bool permissions );
+};
+
+bool DumpStudyFileValidator::canSave(const QString& file, bool permissions)
+{
+  QFileInfo fi( file );
+  QString name = fi.fileName(); 
+  
+  if ( name.indexOf( QRegExp("[-!?#*&]") ) >= 0 ) {
+    SUIT_MessageBox::critical( parent(),
+                              QObject::tr("WRN_WARNING"),
+                              QObject::tr("WRN_FILE_NAME_BAD") );
+    return false;
+  }
+  return SUIT_FileValidator::canSave( file, permissions);
+}
+
 /*!Private SLOT. On dump study.*/
 void SalomeApp_Application::onDumpStudy( )
 {
@@ -697,54 +682,60 @@ void SalomeApp_Application::onDumpStudy( )
   QStringList aFilters;
   aFilters.append( tr( "PYTHON_FILES_FILTER" ) );
 
-  DumpStudyFileDlg* fd = new DumpStudyFileDlg( desktop() );
-  fd->setCaption( tr( "TOT_DESK_FILE_DUMP_STUDY" ) );
-  fd->setFilters( aFilters );
-  fd->myPublishChk->setChecked( true );
-  fd->mySaveGUIChk->setChecked( true );
-  QString aFileName;
-  while (1) {
-    fd->exec();
-    fd->raise();
-    aFileName = fd->selectedFile();
-    if (!aFileName.isEmpty()) {
-      if ( (aFileName.find('-', 0) == -1) && (aFileName.find('!', 0) == -1) && (aFileName.find('?', 0) == -1) &&
-          (aFileName.find('#', 0) == -1) && (aFileName.find('*', 0) == -1) && (aFileName.find('&', 0) == -1)) {
-       break;
-      }
-      else {
-      SUIT_MessageBox::warn1 ( desktop(),
-                              QObject::tr("WRN_WARNING"),
-                              tr("WRN_FILE_NAME_BAD"),
-                              QObject::tr("BUT_OK") );
+  DumpStudyFileDlg fd( desktop() );
+  fd.setValidator( new DumpStudyFileValidator( &fd ) );
+  fd.setWindowTitle( tr( "TOT_DESK_FILE_DUMP_STUDY" ) );
+  fd.setFilters( aFilters );
+  fd.myPublishChk->setChecked( true );
+  fd.mySaveGUIChk->setChecked( true );
+  if ( fd.exec() == QDialog::Accepted )
+  {
+    QString aFileName = fd.selectedFile();
+    
+    bool toPublish = fd.myPublishChk->isChecked();
+    bool toSaveGUI = fd.mySaveGUIChk->isChecked();
+    
+    if ( !aFileName.isEmpty() ) {
+      QFileInfo aFileInfo(aFileName);
+      if( aFileInfo.isDir() ) // IPAL19257
+       return;
+
+      int savePoint;
+      _PTR(AttributeParameter) ap;
+      _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
+      if(ip->isDumpPython(appStudy->studyDS())) ip->setDumpPython(appStudy->studyDS()); //Unset DumpPython flag.
+      if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method
+       ip->setDumpPython(appStudy->studyDS());
+       savePoint = SalomeApp_VisualState( this ).storeState(); //SRN: create a temporary save point
       }
-    }
-    else {
-      break;
+      bool res = aStudy->DumpStudy( aFileInfo.absolutePath().toStdString(),
+                                   aFileInfo.baseName().toStdString(), toPublish);
+      if ( toSaveGUI )
+       appStudy->removeSavePoint(savePoint); //SRN: remove the created temporary save point.
+      if ( !res )
+       SUIT_MessageBox::warning( desktop(),
+                                 QObject::tr("WRN_WARNING"),
+                                 tr("WRN_DUMP_STUDY_FAILED") );
     }
   }
-  bool toPublish = fd->myPublishChk->isChecked();
-  bool toSaveGUI = fd->mySaveGUIChk->isChecked();
-  delete fd;
-
-  if ( !aFileName.isEmpty() ) {
-    QFileInfo aFileInfo(aFileName);
-    int savePoint;
-    _PTR(AttributeParameter) ap;
-    _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
-    if(ip->isDumpPython(appStudy->studyDS())) ip->setDumpPython(appStudy->studyDS()); //Unset DumpPython flag.
-    if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method
-      ip->setDumpPython(appStudy->studyDS());
-      savePoint = SalomeApp_VisualState( this ).storeState(); //SRN: create a temporary save point      
+}
+
+/*!Private SLOT. On NoteBook*/
+void SalomeApp_Application::onNoteBook()
+{
+  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
+  if ( appStudy ) {
+    _PTR(Study) aStudy = appStudy->studyDS();
+    if(!myNoteBook) {
+      myNoteBook = new SalomeApp_NoteBookDlg(desktop(),aStudy);
     }
-    bool res = aStudy->DumpStudy( aFileInfo.dirPath( true ).latin1(), aFileInfo.baseName().latin1(), toPublish);
-    if ( toSaveGUI ) 
-      appStudy->removeSavePoint(savePoint); //SRN: remove the created temporary save point.
-    if ( !res )
-      SUIT_MessageBox::warn1 ( desktop(),
-                              QObject::tr("WRN_WARNING"),
-                              tr("WRN_DUMP_STUDY_FAILED"),
-                              QObject::tr("BUT_OK") );
+    else if(!myNoteBook->isVisible()){
+      myNoteBook->Init(aStudy);
+      myNoteBook->adjustSize();
+      myNoteBook->move((int)(desktop()->x() + desktop()->width()/2  - myNoteBook->frameGeometry().width()/2),
+                       (int)(desktop()->y() + desktop()->height()/2 - myNoteBook->frameGeometry().height()/2));
+    }
+    myNoteBook->show();
   }
 }
 
@@ -756,24 +747,27 @@ void SalomeApp_Application::onLoadScript( )
   _PTR(Study) aStudy = appStudy->studyDS();
 
   if ( aStudy->GetProperties()->IsLocked() ) {
-    SUIT_MessageBox::warn1 ( desktop(),
-                            QObject::tr("WRN_WARNING"),
-                            QObject::tr("WRN_STUDY_LOCKED"),
-                            QObject::tr("BUT_OK") );
+    SUIT_MessageBox::warning( desktop(),
+                             QObject::tr("WRN_WARNING"),
+                             QObject::tr("WRN_STUDY_LOCKED") );
     return;
   }
 
   QStringList filtersList;
   filtersList.append(tr("PYTHON_FILES_FILTER"));
   filtersList.append(tr("ALL_FILES_FILTER"));
+  
+  QString anInitialPath = "";
+  if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
+    anInitialPath = QDir::currentPath();
 
-  QString aFile = SUIT_FileDlg::getFileName( desktop(), "", filtersList, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), true, true );
+  QString aFile = SUIT_FileDlg::getFileName( desktop(), anInitialPath, filtersList, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), true, true );
 
   if ( !aFile.isEmpty() )
   {
     QString command = QString("execfile(\"%1\")").arg(aFile);
 
-    PythonConsole* pyConsole = pythonConsole();
+    PyConsole_Console* pyConsole = pythonConsole();
 
     if ( pyConsole )
       pyConsole->exec( command );
@@ -787,7 +781,8 @@ void SalomeApp_Application::onSaveGUIState()
   if ( study ) {
     SalomeApp_VisualState( this ).storeState();
     updateSavePointDataObjects( study );
-    objectBrowser()->updateTree( study->root() );
+    // temporary commented
+    //objectBrowser()->updateTree( study->root() );
   }
   updateActions();
 }
@@ -810,28 +805,62 @@ QWidget* SalomeApp_Application::createWindow( const int flag )
 
   if ( flag == WT_ObjectBrowser )
   {
-    OB_Browser* ob = (OB_Browser*)wid;
-    ob->setUpdater( new SalomeApp_Updater() );
-    connect( ob->listView(), SIGNAL( doubleClicked( QListViewItem* ) ), this, SLOT( onDblClick( QListViewItem* ) ) );
-    bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false ),
-         autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true );
-    for ( int i = SalomeApp_DataObject::CT_Value; i <= SalomeApp_DataObject::CT_RefEntry; i++ )
-    {
+    SUIT_DataBrowser* ob = qobject_cast<SUIT_DataBrowser*>( wid );
+    if ( ob ) {
+      // temporary commented
+      //ob->setUpdater( new SalomeApp_Updater() );
+
+      connect( ob, SIGNAL( doubleClicked( SUIT_DataObject* ) ), this, SLOT( onDblClick( SUIT_DataObject* ) ) );
+
+      QString
+        ValueCol = QObject::tr( "VALUE_COLUMN" ),
+        IORCol = QObject::tr( "IOR_COLUMN" ),
+        RefCol = QObject::tr( "REFENTRY_COLUMN" ),
+        EntryCol = QObject::tr( "ENTRY_COLUMN" );
+
+      SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( ob->model() );
+      treeModel->registerColumn( 0, EntryCol, SalomeApp_DataObject::EntryId );
+      treeModel->registerColumn( 0, ValueCol, SalomeApp_DataObject::ValueId );
+      treeModel->registerColumn( 0, IORCol, SalomeApp_DataObject::IORId );
+      treeModel->registerColumn( 0, RefCol, SalomeApp_DataObject::RefEntryId );
+      treeModel->setAppropriate( EntryCol, Qtx::Toggled );
+      treeModel->setAppropriate( ValueCol, Qtx::Toggled );
+      treeModel->setAppropriate( IORCol, Qtx::Toggled );
+      treeModel->setAppropriate( RefCol, Qtx::Toggled );
+
+      bool autoSize      = resMgr->booleanValue( "ObjectBrowser", "auto_size", false );
+      bool autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true );
+      bool resizeOnExpandItem = resMgr->booleanValue( "ObjectBrowser", "resize_on_expand_item", true );
+
+      ob->setAutoSizeFirstColumn(autoSizeFirst);
+      ob->setAutoSizeColumns(autoSize);
+      ob->setResizeOnExpandItem(resizeOnExpandItem);
+
+      // temporary commented
+      /*
+      for ( int i = SalomeApp_DataObject::ValueIdx; i <= SalomeApp_DataObject::RefEntryIdx; i++ )
+      {
       ob->addColumn( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i ) ), i );
       ob->setColumnShown( i, resMgr->booleanValue( "ObjectBrowser",
-                                                   QString().sprintf( "visibility_column_%d", i ), true ) );
+                                                    QString().sprintf( "visibility_column_%d", i ), true ) );
+      }
+      */
+
+      // temporary commented
+      /*
+       ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual );
+       ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual );
+       ob->resize( desktop()->width()/3, ob->height() );
+      */
     }
-    ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual );
-    ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual );
-    ob->resize( desktop()->width()/3, ob->height() );
   }
   else if ( flag == WT_PyConsole )
   {
-    PythonConsole* pyCons = new PythonConsole( desktop(), new SalomeApp_PyInterp() );
-    pyCons->setCaption( tr( "PYTHON_CONSOLE" ) );
+    PyConsole_Console* pyCons = new PyConsole_Console( desktop(), new SalomeApp_PyInterp() );
+    pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) );
     wid = pyCons;
     pyCons->resize( pyCons->width(), desktop()->height()/4 );
-    //pyCons->connectPopupRequest(this, SLOT(onConnectPopupRequest(SUIT_PopupClient*, QContextMenuEvent*)));
+    pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
   }
   return wid;
 }
@@ -847,12 +876,12 @@ void SalomeApp_Application::createPreferences( LightApp_Preferences* pref )
   int salomeCat = pref->addPreference( tr( "PREF_CATEGORY_SALOME" ) );
   int obTab = pref->addPreference( tr( "PREF_TAB_OBJBROWSER" ), salomeCat );
   int defCols = pref->addPreference( tr( "PREF_GROUP_DEF_COLUMNS" ), obTab );
-  for ( int i = SalomeApp_DataObject::CT_Value; i <= SalomeApp_DataObject::CT_RefEntry; i++ )
+  for ( int i = SalomeApp_DataObject::EntryId; i <= SalomeApp_DataObject::RefEntryId; i++ )
   {
-    pref->addPreference( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i ) ), defCols,
-                         LightApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_%d", i ) );
+    pref->addPreference( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i-1 ).toLatin1() ), defCols,
+                         LightApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_id_%d", i ) );
   }
-  pref->setItemProperty( defCols, "columns", 1 );
+  pref->setItemProperty( "orientation", Qt::Vertical, defCols );
 
   // adding preference to LightApp_Application handled preferences..  a bit of hacking with resources..
   int genTab = pref->addPreference( LightApp_Application::tr( "PREF_TAB_GENERAL" ), salomeCat );
@@ -869,7 +898,7 @@ void SalomeApp_Application::updateDesktopTitle() {
 
   if ( activeStudy() )
   {
-    QString sName = SUIT_Tools::file( activeStudy()->studyName().stripWhiteSpace(), false );
+    QString sName = SUIT_Tools::file( activeStudy()->studyName().trimmed(), false );
     if ( !sName.isEmpty() ) {
       SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(activeStudy());
       if ( study ) {
@@ -885,33 +914,26 @@ void SalomeApp_Application::updateDesktopTitle() {
     }
   }
 
-  desktop()->setCaption( aTitle );
+  desktop()->setWindowTitle( aTitle );
 }
 
-/*!
-  \brief Show dialog box to propose possible user actions when study is closed.
-  \param docName study name
-  \return chosen action ID
-  \sa closeAction()
-*/
 int SalomeApp_Application::closeChoice( const QString& docName )
 {
-  SUIT_MsgDlg dlg( desktop(), tr( "APPCLOSE_CAPTION" ), tr ( "APPCLOSE_DESCRIPTION" ),
-                   QMessageBox::standardIcon( QMessageBox::Information ) );
-  dlg.addButton( tr ( "APPCLOSE_SAVE" ),   CloseSave );
-  dlg.addButton( tr ( "APPCLOSE_CLOSE" ),  CloseDiscard );
-  dlg.addButton( tr ( "APPCLOSE_UNLOAD" ), CloseUnload );
+  int answer = SUIT_MessageBox::question( desktop(), tr( "APPCLOSE_CAPTION" ), tr( "APPCLOSE_DESCRIPTION" ).arg( docName ),
+                                          tr ("APPCLOSE_SAVE"), tr ("APPCLOSE_CLOSE"),
+                                         tr ("APPCLOSE_UNLOAD"), tr ("APPCLOSE_CANCEL"), 0 );
+
+  int res = CloseCancel;
+  if ( answer == 0 )
+    res = CloseSave;
+  else if ( answer == 1 )
+    res = CloseDiscard;
+  else if ( answer == 2 )
+    res = CloseUnload;
 
-  return dlg.exec();
+  return res;
 }
 
-/*!
-  \brief Process user actions selected from the dialog box when study is closed.
-  \param choice chosen action ID
-  \param closePermanently "forced study closing" flag
-  \return operation status
-  \sa closeChoice()
-*/
 bool SalomeApp_Application::closeAction( const int choice, bool& closePermanently )
 {
   bool res = true;
@@ -932,14 +954,76 @@ bool SalomeApp_Application::closeAction( const int choice, bool& closePermanentl
   default:
     res = false;
   }
+
+  return res;
+}
+
+int SalomeApp_Application::openChoice( const QString& aName )
+{
+  int choice = LightApp_Application::openChoice( aName );
+
+  if ( choice == OpenNew ) // The document isn't already open.
+  {
+    bool exist = false;
+    std::vector<std::string> lst = studyMgr()->GetOpenStudies();
+    for ( uint i = 0; i < lst.size() && !exist; i++ )
+    {
+      if ( aName == QString( lst[i].c_str() ) )
+        exist = true;
+    }
+
+    // The document already exists in the study manager.
+    // Do you want to reload it?
+    if ( exist )
+    {
+      int answer = SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_DOC_ALREADYEXIST" ).arg( aName ),
+                                             SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No );
+      if ( answer == SUIT_MessageBox::Yes )
+       choice = OpenRefresh;
+      else
+       choice = OpenCancel;
+    }
+  }
+
+  return choice;
+}
+
+bool SalomeApp_Application::openAction( const int aChoice, const QString& aName )
+{
+  bool res = false;
+  int choice = aChoice;
+  switch ( choice )
+  {
+  case OpenRefresh:
+    {
+      _PTR(Study) aStudy = studyMgr()->GetStudyByName( aName.toStdString() );
+      if ( aStudy )
+      {
+       studyMgr()->Close( aStudy );
+       choice = OpenNew;
+      }
+    }
+  default:
+    res = LightApp_Application::openAction( choice, aName );
+    break;
+  }
+
   return res;
 }
 
 /*!
-  \brief Get module activation actions
-  \return map <action_id><action_name> where
-  - action_id is unique non-zero action identifier
-  - action_name is action title
+  \brief Get map of the operations which can be performed
+  on the module activation.
+
+  The method should return the map of the kind \c {<id>:<name>}
+  where \c <id> is an integer identifier of the operation and
+  \c <name> is a title for the button to be added to the
+  dialog box. After user selects the required operation by the
+  clicking the corresponding button in the dialog box, its identifier
+  is passed to the moduleActionSelected() method to process
+  the made choice.
+
+  \return map of the operations
   \sa moduleActionSelected()
 */
 QMap<int, QString> SalomeApp_Application::activateModuleActions() const
@@ -950,8 +1034,12 @@ QMap<int, QString> SalomeApp_Application::activateModuleActions() const
 }
 
 /*!
-  \brief Process module activation action.
-  \param id action identifier
+  \brief Called when the used selectes required operation chosen
+  from "Activate module" dialog box.
+
+  Performs the required operation according to the user choice.
+
+  \param id operation identifier
   \sa activateModuleActions()
 */
 void SalomeApp_Application::moduleActionSelected( const int id )
@@ -1029,26 +1117,27 @@ void SalomeApp_Application::onProperties()
 }
 
 /*!Insert items in popup, which necessary for current application*/
-void SalomeApp_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopup, QString& title )
+void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePopup, QString& title )
 {
   LightApp_Application::contextMenuPopup( type, thePopup, title );
 
-  OB_Browser* ob = objectBrowser();
+  // temporary commented
+  /*OB_Browser* ob = objectBrowser();
   if ( !ob || type != ob->popupClientType() )
-    return;
+    return;*/
 
   // Get selected objects
   SALOME_ListIO aList;
   LightApp_SelectionMgr* mgr = selectionMgr();
-  mgr->selectedObjects( aList, QString::null, false );
+  mgr->selectedObjects( aList, QString(), false );
 
   // add GUI state commands: restore, rename
-  if ( aList.Extent() == 1 && aList.First()->hasEntry() && 
+  if ( aList.Extent() == 1 && aList.First()->hasEntry() &&
        QString( aList.First()->getEntry() ).startsWith( tr( "SAVE_POINT_DEF_NAME" ) ) ) {
-    thePopup->insertSeparator();
-    thePopup->insertItem( tr( "MEN_RESTORE_VS" ), this, SLOT( onRestoreGUIState() ) );
-    thePopup->insertItem( tr( "MEN_RENAME_VS" ),  this, SLOT( onRenameGUIState() ) );
-    thePopup->insertItem( tr( "MEN_DELETE_VS" ),  this, SLOT( onDeleteGUIState() ) );
+    thePopup->addSeparator();
+    thePopup->addAction( tr( "MEN_RESTORE_VS" ), this, SLOT( onRestoreGUIState() ) );
+    thePopup->addAction( tr( "MEN_RENAME_VS" ),  this, SLOT( onRenameGUIState() ) );
+    thePopup->addAction( tr( "MEN_DELETE_VS" ),  this, SLOT( onDeleteGUIState() ) );
   }
 
   // "Delete reference" item should appear only for invalid references
@@ -1073,8 +1162,8 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QPopupMenu* t
   // Add "Delete reference" item to popup
   if ( isInvalidRefs )
   {
-    thePopup->insertSeparator();
-    thePopup->insertItem( tr( "MEN_DELETE_INVALID_REFERENCE" ), this, SLOT( onDeleteInvalidReferences() ) );
+    thePopup->addSeparator();
+    thePopup->addAction( tr( "MEN_DELETE_INVALID_REFERENCE" ), this, SLOT( onDeleteInvalidReferences() ) );
     return;
   }
 
@@ -1095,7 +1184,7 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QPopupMenu* t
   if (currentModule && currentModule->moduleName() == aModuleTitle)
     return;
   if ( !aModuleTitle.isEmpty() )
-    thePopup->insertItem( tr( "MEN_OPENWITH" ).arg( aModuleTitle ), this, SLOT( onOpenWith() ) );
+    thePopup->addAction( tr( "MEN_OPENWITH" ).arg( aModuleTitle ), this, SLOT( onOpenWith() ) );
 }
 
 /*!Update obect browser:
@@ -1111,19 +1200,18 @@ void SalomeApp_Application::updateObjectBrowser( const bool updateModels )
     _PTR(Study) stdDS = study->studyDS();
     if( stdDS )
     {
-      for ( _PTR(SComponentIterator) it ( stdDS->NewComponentIterator() ); it->More(); it->Next() ) 
+      for ( _PTR(SComponentIterator) it ( stdDS->NewComponentIterator() ); it->More(); it->Next() )
       {
        _PTR(SComponent) aComponent ( it->Value() );
 
        if ( aComponent->ComponentDataType() == "Interface Applicative" )
          continue; // skip the magic "Interface Applicative" component
 
-       OB_Browser* ob = static_cast<OB_Browser*>( getWindow( WT_ObjectBrowser ));
-       const bool isAutoUpdate = ob->isAutoUpdate();
-       ob->setAutoUpdate( false );
+        getWindow( WT_ObjectBrowser );
+       const bool isAutoUpdate = objectBrowser()->autoUpdate();
+       objectBrowser()->setAutoUpdate( false );
        SalomeApp_DataModel::synchronize( aComponent, study );
-       ob->setAutoUpdate( isAutoUpdate );
-        //SalomeApp_DataModel::BuildTree( aComponent, study->root(), study, /*skipExisitng=*/true );
+       objectBrowser()->setAutoUpdate( isAutoUpdate );
       }
     }
   }
@@ -1146,51 +1234,36 @@ void SalomeApp_Application::onCatalogGen()
 void SalomeApp_Application::onRegDisplay()
 {
   CORBA::ORB_var anOrb = orb();
-  ToolsGUI_RegWidget* regWnd = ToolsGUI_RegWidget::GetRegWidget( anOrb, desktop(), "Registry" );
+  ToolsGUI_RegWidget* regWnd = ToolsGUI_RegWidget::GetRegWidget( anOrb, desktop() );
   regWnd->show();
   regWnd->raise();
-  regWnd->setActiveWindow();
+  regWnd->activateWindow();
 }
 
 /*!find original object by double click on item */
-void SalomeApp_Application::onDblClick( QListViewItem* it )
+void SalomeApp_Application::onDblClick( SUIT_DataObject* theObj )
 {
-  OB_ListItem* item = dynamic_cast<OB_ListItem*>( it );
+  SalomeApp_DataObject* obj = dynamic_cast<SalomeApp_DataObject*>( theObj );
   SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( activeStudy() );
 
-  if( study && item )
+  if( study && obj )
   {
-    SalomeApp_DataObject* obj = dynamic_cast<SalomeApp_DataObject*>( item->dataObject() );
-    if( !obj )
-      return;
-
     QString entry = obj->entry();
-    _PTR(SObject) sobj = study->studyDS()->FindObjectID( entry.latin1() ), ref;
+    _PTR(SObject) sobj = study->studyDS()->FindObjectID( entry.toStdString() ), ref;
 
     if( sobj && sobj->ReferencedObject( ref ) )
     {
       entry = ref->GetID().c_str();
-      QListViewItemIterator anIt( item->listView() );
-      for( ; anIt.current(); anIt++ )
-      {
-       OB_ListItem* item = dynamic_cast<OB_ListItem*>( anIt.current() );
-       if( !item )
-         continue;
-
-       SalomeApp_DataObject* original = dynamic_cast<SalomeApp_DataObject*>( item->dataObject() );
-       if( original->entry()!=entry )
-         continue;
-
-       OB_Browser* br = objectBrowser();
-       br->setSelected( original );
-       SUIT_DataObject* p = original->parent();
-       while( p )
-       {
-         br->setOpen( p );
-         p = p->parent();
-       }
-       break;
-      }
+      
+      SUIT_DataOwnerPtrList aList;
+      aList.append( new LightApp_DataOwner( entry ) );
+      selectionMgr()->setSelected( aList, false );
+
+      SUIT_DataBrowser* ob = objectBrowser();
+      
+      QModelIndexList aSelectedIndexes = ob->selectedIndexes();
+      if ( !aSelectedIndexes.isEmpty() )
+       ob->treeView()->scrollTo( aSelectedIndexes.first() );
     }
   }
 }
@@ -1224,8 +1297,8 @@ int getSelectedSavePoint( const LightApp_SelectionMgr* selMgr )
 void SalomeApp_Application::onRestoreGUIState()
 {
   int savePoint = ::getSelectedSavePoint( selectionMgr() );
-  if ( savePoint == -1 ) 
-    return;  
+  if ( savePoint == -1 )
+    return;
   SalomeApp_VisualState( this ).restoreState( savePoint );
 }
 
@@ -1233,17 +1306,18 @@ void SalomeApp_Application::onRestoreGUIState()
 void SalomeApp_Application::onRenameGUIState()
 {
   int savePoint = ::getSelectedSavePoint( selectionMgr() );
-  if ( savePoint == -1 ) 
-    return;  
+  if ( savePoint == -1 )
+    return;
   SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( activeStudy() );
-  if ( !study ) 
+  if ( !study )
     return;
 
   QString newName = LightApp_NameDlg::getName( desktop(), study->getNameOfSavePoint( savePoint ) );
   if ( !newName.isNull() && !newName.isEmpty() ) {
     study->setNameOfSavePoint( savePoint, newName );
     updateSavePointDataObjects( study );
-    objectBrowser()->updateTree( study->root() );
+    // temporary commented
+    //objectBrowser()->updateTree( study->root() );
   }
 }
 
@@ -1252,25 +1326,34 @@ void SalomeApp_Application::onRenameGUIState()
 void SalomeApp_Application::onDeleteGUIState()
 {
   int savePoint = ::getSelectedSavePoint( selectionMgr() );
-  if ( savePoint == -1 ) 
-    return;  
+  if ( savePoint == -1 )
+    return;
   SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( activeStudy() );
-  if ( !study ) 
+  if ( !study )
     return;
-  
+
   study->removeSavePoint( savePoint );
   updateSavePointDataObjects( study );
 }
 
+/*!Called on New study operation*/
+void SalomeApp_Application::onStudyCreated( SUIT_Study* study )
+{
+  LightApp_Application::onStudyCreated( study );
+
+  objectBrowserColumnsVisibility();
+}
+
 /*!Called on Save study operation*/
 void SalomeApp_Application::onStudySaved( SUIT_Study* study )
 {
   LightApp_Application::onStudySaved( study );
 
-  if ( objectBrowser() ) {
+  // temporary commented
+  /*if ( objectBrowser() ) {
     updateSavePointDataObjects( dynamic_cast<SalomeApp_Study*>( study ) );
     objectBrowser()->updateTree( study->root() );
-  }
+  }*/
 }
 
 /*!Called on Open study operation*/
@@ -1278,41 +1361,28 @@ void SalomeApp_Application::onStudyOpened( SUIT_Study* study )
 {
   LightApp_Application::onStudyOpened( study );
 
-  if ( objectBrowser() ) {
+  objectBrowserColumnsVisibility();
+
+  // temporary commented
+  /*if ( objectBrowser() ) {
     updateSavePointDataObjects( dynamic_cast<SalomeApp_Study*>( study ) );
     objectBrowser()->updateTree( study->root() );
-  }
-}
-
-/*! utility function.  returns true if list view item that correspond to given SUIT_DataObject is open.
- only first level items are traversed */
-bool isListViewItemOpen( QListView* lv, const SUIT_DataObject* dobj )
-{
-  if ( !lv || !dobj )
-    return false;
-
-  QListViewItem* item = lv->firstChild();
-  while ( item ) {
-    OB_ListItem* ob_item = dynamic_cast<OB_ListItem*>( item );
-    if ( ob_item && ob_item->dataObject() == dobj )
-      return ob_item->isOpen();
-    item = item->nextSibling();
-  }
-  return false;
+  }*/
 }
 
 /*! updateSavePointDataObjects: syncronize data objects that correspond to save points (gui states)*/
 void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study )
 {
-  OB_Browser* ob = objectBrowser();
+  // temporary commented
+  //OB_Browser* ob = objectBrowser();
 
-  if ( !study || !ob )
+  if ( !study /*|| !ob */) // temporary commented
     return;
 
   // find GUI states root object
   SUIT_DataObject* guiRootObj = 0;
-  DataObjectList ch; 
-  study->root()->children( ch ); 
+  DataObjectList ch;
+  study->root()->children( ch );
   DataObjectList::const_iterator it = ch.begin(), last = ch.end();
   for ( ; it != last ; ++it ) {
     if ( dynamic_cast<SalomeApp_SavePointRootObject*>( *it ) ) {
@@ -1343,8 +1413,8 @@ void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study )
 
   // store data objects in a map id-to-DataObject
   QMap<int,SalomeApp_SavePointObject*> mapDO;
-  ch.clear(); 
-  guiRootObj->children( ch ); 
+  ch.clear();
+  guiRootObj->children( ch );
   for( it = ch.begin(), last = ch.end(); it != last ; ++it ) {
     SalomeApp_SavePointObject* dobj = dynamic_cast<SalomeApp_SavePointObject*>( *it );
     if ( dobj )
@@ -1352,7 +1422,7 @@ void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study )
   }
 
   // iterate new save points.  if DataObject with such ID not found in map - create DataObject
-  // if in the map - remove it from map.  
+  // if in the map - remove it from map.
   for ( int i = 0; i < savePoints.size(); i++ )
     if ( !mapDO.contains( savePoints[i] ) )
       new SalomeApp_SavePointObject( guiRootObj, savePoints[i], study );
@@ -1361,7 +1431,7 @@ void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study )
 
   // delete DataObjects that are still in the map -- their IDs were not found in data model
   for ( QMap<int,SalomeApp_SavePointObject*>::Iterator it = mapDO.begin(); it != mapDO.end(); ++it )
-    delete it.data();
+    delete it.value();
 }
 
 /*! Check data object */
@@ -1377,8 +1447,46 @@ bool SalomeApp_Application::checkDataObject(LightApp_DataObject* theObj)
 void SalomeApp_Application::onDesktopMessage( const QString& message )
 {
   // update object browser
-  if ( message.lower() == "updateobjectbrowser" || 
-       message.lower() == "updateobjbrowser" )
+  if ( message.toLower() == "updateobjectbrowser" ||
+       message.toLower() == "updateobjbrowser" )
     updateObjectBrowser();
 }
 
+/*!
+  Opens other study into active Study. If Study is empty - creates it.
+  \param theName - name of study
+*/
+bool SalomeApp_Application::useStudy( const QString& theName )
+{
+  createEmptyStudy();
+  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
+  bool res = false;
+  if (aStudy)
+    res = aStudy->loadDocument( theName );
+  updateDesktopTitle();
+  updateCommandsStatus();
+  return res;
+}
+
+/*! Show/hide object browser colums according to preferences */
+void SalomeApp_Application::objectBrowserColumnsVisibility()
+{
+  if ( objectBrowser() )
+    for ( int i = SalomeApp_DataObject::EntryId; i <= SalomeApp_DataObject::RefEntryId; i++ )
+    {
+      bool shown = resourceMgr()->booleanValue( "ObjectBrowser", QString( "visibility_column_id_%1" ).arg( i ), true );
+      objectBrowser()->treeView()->setColumnHidden( i, !shown );
+    }
+}
+
+/*! Set SalomeApp_NoteBookDlg pointer */
+void SalomeApp_Application::setNoteBook(SalomeApp_NoteBookDlg* theNoteBook){
+  myNoteBook = theNoteBook;
+}
+
+/*! Return SalomeApp_NoteBookDlg pointer */
+SalomeApp_NoteBookDlg* SalomeApp_Application::getNoteBook() const
+{
+  return myNoteBook;
+}
+
index 373e13b1db17032a3726942eacc7acdda6b25806..3f18e68067473e948c30b132ccdfd585d141527e 100644 (file)
@@ -1,26 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      SalomeApp_Application.h
 // Created:   10/22/2004 3:37:25 PM
 // Author:    Sergey LITONIN
-// Copyright (C) CEA 2004
-
+//
 #ifndef SALOMEAPP_APPLICATION_H
 #define SALOMEAPP_APPLICATION_H
 
 #include "SalomeApp.h"
 #include <LightApp_Application.h>
 
-#include <qmap.h>
-
 #include <CORBA.h>
 
-#include <SALOMEconfig.h>
+//#include <SALOMEconfig.h>
 //#include CORBA_CLIENT_HEADER(SALOMEDS)
 #include <SALOME_NamingService.hxx>
 
 #include "SALOMEDSClient.hxx"
 
-class QAction;
-class QComboBox;
-class QDockWindow;
-
 class LightApp_Preferences;
-class SalomeApp_Module;
 class SalomeApp_Study;
+class SalomeApp_NoteBookDlg;
+class SUIT_DataObject;
 
 class SALOME_LifeCycleCORBA;
 
-class QListViewItem;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -69,11 +65,12 @@ class SALOMEAPP_EXPORT SalomeApp_Application : public LightApp_Application
 public:
   enum { MenuToolsId = 5 };
   enum { DumpStudyId = LightApp_Application::UserID, LoadScriptId, PropertiesId,
-         CatalogGenId, RegDisplayId, SaveGUIStateId, FileLoadId, UserID };
+         CatalogGenId, RegDisplayId, SaveGUIStateId, FileLoadId, NoteBookId, UserID };
 
 protected:
-  enum { CloseUnload = CloseDiscard + 1 };
-  enum { LoadStudyId = OpenStudyId  + 1 };
+  enum { OpenRefresh = LightApp_Application::OpenReload + 1 };
+  enum { CloseUnload = LightApp_Application::CloseDiscard + 1 };
+  enum { LoadStudyId = LightApp_Application::OpenStudyId + 1 };
 
 public:
   SalomeApp_Application();
@@ -85,7 +82,7 @@ public:
 
   virtual void                        start();
 
-  virtual void                        contextMenuPopup( const QString&, QPopupMenu*, QString& );
+  virtual void                        contextMenuPopup( const QString&, QMenu*, QString& );
 
   virtual bool                        checkDataObject(LightApp_DataObject* theObj);
 
@@ -98,17 +95,26 @@ public:
   SUIT_ViewManager*                   newViewManager(const QString&);
   void                                updateSavePointDataObjects( SalomeApp_Study* );
 
+  virtual bool                        isPossibleToClose( bool& );
+
+  virtual bool                        useStudy( const QString& );
+  virtual void                        updateDesktopTitle();
+  
+  virtual void                        setNoteBook(SalomeApp_NoteBookDlg* theNoteBook);
+  virtual SalomeApp_NoteBookDlg*      getNoteBook() const;
+
 public slots:
-  virtual bool                        onOpenDoc( const QString& );
   virtual void                        onLoadDoc();
   virtual bool                        onLoadDoc( const QString& );
+  virtual void                        onCloseDoc( bool ask = true);
+
   virtual void                        onExit();
   virtual void                        onCopy();
   virtual void                        onPaste();
   void                                onSaveGUIState();// called from VISU
-  virtual void                        onCloseDoc( bool ask = true);
 
 protected slots:
+  void                                onStudyCreated( SUIT_Study* );
   void                                onStudySaved( SUIT_Study* );
   void                                onStudyOpened( SUIT_Study* );
   void                                onDesktopMessage( const QString& );
@@ -122,22 +128,27 @@ protected:
   virtual void                        onSelectionChanged();
 
   virtual void                        createPreferences( LightApp_Preferences* );
-  virtual void                        updateDesktopTitle();
-  
+
   virtual bool                        closeAction( const int, bool& );
   virtual int                         closeChoice( const QString& );
 
+  virtual int                         openChoice( const QString& );
+  virtual bool                        openAction( const int, const QString& );
+
   virtual QMap<int, QString>          activateModuleActions() const;
   virtual void                        moduleActionSelected( const int );
 
+  void                                objectBrowserColumnsVisibility();
+
 private slots:
   void                                onDeleteInvalidReferences();
-  void                                onDblClick( QListViewItem* );
+  void                                onDblClick( SUIT_DataObject* );
   void                                onProperties();
   void                                onDumpStudy();
-  void                                onLoadScript(); 
+  void                                onNoteBook();
+  void                                onLoadScript();
 
-  void                                onDeleteGUIState(); 
+  void                                onDeleteGUIState();
   void                                onRestoreGUIState();
   void                                onRenameGUIState();
 
@@ -145,6 +156,8 @@ private slots:
   void                                onRegDisplay();
   void                                onOpenWith();
 
+ private:
+  SalomeApp_NoteBookDlg*             myNoteBook;
 };
 
 #ifdef WIN32
index a62a33d4737fda00646b5c1c6b7bb41aff664814..f9016a68c7005d2dd3ca886e5ec6649e8d1831f8 100644 (file)
@@ -1,26 +1,30 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SalomeApp_CheckFileDlg.h"
 
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
+#include <QCheckBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
 
 /*!
 Constructor
@@ -28,11 +32,20 @@ Constructor
 SalomeApp_CheckFileDlg::SalomeApp_CheckFileDlg( QWidget* parent, bool open, const QString& theCheckBoxName, bool showQuickDir, bool modal) :
 SUIT_FileDlg( parent, open, showQuickDir, modal )
 {    
-  myCheckBox = new QCheckBox( theCheckBoxName, this );
-  QLabel* label = new QLabel("", this);
-  QPushButton* pb = new QPushButton(this);               
-  addWidgets( label, myCheckBox, pb );
-  pb->hide();
+  QGridLayout* grid = ::qobject_cast<QGridLayout*>( layout() );
+  if ( grid )
+  {
+    myCheckBox = new QCheckBox( theCheckBoxName, this );
+    QLabel* label = new QLabel("", this);
+    QPushButton* pb = new QPushButton(this);        
+    
+    int row = grid->rowCount();
+    grid->addWidget( label, row, 0 );
+    grid->addWidget( myCheckBox, row, 1 );
+    grid->addWidget( pb, row, 2 );
+      
+    pb->hide();
+  }
 }
 
 /*!
index 53e56683c2c1514292b069ab5f3de9fb2c3f9fdd..74e857b6b6ca4fc72f05740c3eeca84e1a1f1383 100644 (file)
@@ -1,25 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SALOMEAPP_CHECKFILEDIALOG_H
 #define SALOMEAPP_CHECKFILEDIALOG_H
 
-#include <SalomeApp.h>
+#include "SalomeApp.h"
 
 #include <SUIT_FileDlg.h>
 
index 742a75e3567fa9370c4c82bb757d3224b58489ed..381dc68aee29b99aa58460eda4a84ab48fc65a81 100644 (file)
@@ -1,40 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      SalomeApp_DataModel.cxx
 // Created:   10/25/2004 10:36:06 AM
 // Author:    Sergey LITONIN
-// Copyright (C) CEA 2004
-
+//
 #include "SalomeApp_DataModel.h"
 #include "SalomeApp_Study.h"
 #include "SalomeApp_DataObject.h"
 #include "SalomeApp_Module.h"
 #include "SalomeApp_Application.h"
-#include "SalomeApp_Engine_i.hxx"
-
-#include "LightApp_RootObject.h"
 
 #include <CAM_DataObject.h>
 
-#include <SUIT_Application.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
 #include <SUIT_TreeSync.h>
 #include <SUIT_DataObjectIterator.h>
 
@@ -53,16 +49,18 @@ class SalomeApp_DataModelSync
 public:
   SalomeApp_DataModelSync( _PTR( Study ), SUIT_DataObject* );
 
-  suitPtr  createItem( const kerPtr&, const suitPtr&, const suitPtr&, const bool ) const;
-  void     deleteItemWithChildren( const suitPtr& ) const;
-  bool     isEqual( const kerPtr&, const suitPtr& ) const;
-  kerPtr   nullSrc() const;
-  suitPtr  nullTrg() const;
-  void     children( const kerPtr&, QValueList<kerPtr>& ) const;
-  void     children( const suitPtr&, QValueList<suitPtr>& ) const;
-  suitPtr  parent( const suitPtr& ) const;
-  bool     isCorrect( const kerPtr& ) const;
-  void     updateItem( const kerPtr&, const suitPtr& ) const;
+  bool           isEqual( const kerPtr&, const suitPtr& ) const;
+  kerPtr         nullSrc() const;
+  suitPtr        nullTrg() const;
+  suitPtr        createItem( const kerPtr&, const suitPtr&, const suitPtr& ) const;
+  void           updateItem( const kerPtr&, const suitPtr& ) const;
+  void           deleteItemWithChildren( const suitPtr& ) const;
+  QList<kerPtr>  children( const kerPtr& ) const;
+  QList<suitPtr> children( const suitPtr& ) const;
+  suitPtr        parent( const suitPtr& ) const;
+
+private:
+  bool           isCorrect( const kerPtr& ) const;
 
 private:
   _PTR( Study )     myStudy;
@@ -105,8 +103,7 @@ bool SalomeApp_DataModelSync::isCorrect( const kerPtr& so ) const
 */
 suitPtr SalomeApp_DataModelSync::createItem( const kerPtr& so,
                                             const suitPtr& parent,
-                                            const suitPtr& after,
-                                            const bool prepend ) const
+                                            const suitPtr& after ) const
 {
   if( !isCorrect( so ) )
     return 0;
@@ -114,23 +111,13 @@ suitPtr SalomeApp_DataModelSync::createItem( const kerPtr& so,
   _PTR(SComponent) aSComp( so );
   suitPtr nitem = aSComp ? new SalomeApp_ModuleObject( aSComp, 0 ) :
                            new SalomeApp_DataObject( so, 0 );
-  if( parent )
-    if( after )
-    {
-      DataObjectList ch;
-      parent->children( ch );
-      int pos = ch.find( after );
-      if( pos>=0 )
-       parent->insertChild( nitem, pos+1 );
-      else
-       parent->appendChild( nitem );
-    }
-    else if( prepend )
-      parent->insertChild( nitem, 0 );
-    else // append
-      parent->appendChild( nitem );
-  else if( myRoot )
+  if( parent ) {
+    int pos = after ? parent->childPos( after ) : 0;
+    parent->insertChild( nitem, pos+1 );
+  }
+  else if( myRoot ) {
     myRoot->appendChild( nitem );
+  }
   return nitem;
 }
 
@@ -180,7 +167,7 @@ kerPtr SalomeApp_DataModelSync::nullSrc() const
 */
 suitPtr SalomeApp_DataModelSync::nullTrg() const
 {
-  return suitPtr( 0 );
+  return 0;
 }
 
 /*!
@@ -188,12 +175,14 @@ suitPtr SalomeApp_DataModelSync::nullTrg() const
   \param obj - kernel object
   \param ch - list to be filled
 */
-void SalomeApp_DataModelSync::children( const kerPtr& obj, QValueList<kerPtr>& ch ) const
+QList<kerPtr> SalomeApp_DataModelSync::children( const kerPtr& obj ) const
 {
-  ch.clear();
+  QList<kerPtr> ch;
+
   _PTR(ChildIterator) it ( myStudy->NewChildIterator( obj ) );
   for( ; it->More(); it->Next() )
     ch.append( it->Value() );
+  return ch;
 }
 
 /*!
@@ -201,16 +190,12 @@ void SalomeApp_DataModelSync::children( const kerPtr& obj, QValueList<kerPtr>& c
   \param p - SUIT object
   \param ch - list to be filled
 */
-void SalomeApp_DataModelSync::children( const suitPtr& p, QValueList<suitPtr>& ch ) const
+QList<suitPtr> SalomeApp_DataModelSync::children( const suitPtr& p ) const
 {
-  DataObjectList l;
-  if( p )
-  {
-    p->children( l );
-    ch.clear();
-    for( SUIT_DataObject* o = l.first(); o; o = l.next() )
-      ch.append( o );
-  }
+  QList<suitPtr> ch;
+  if ( p )
+    ch = p->children();
+  return ch;
 }
 
 /*!
@@ -244,7 +229,7 @@ void showTree( SUIT_DataObject* root )
   {
     QString marg; marg.fill( ' ', 3*it.depth() );
     QString nnn = "%1 '%2'";
-    qDebug( nnn.arg( marg ).arg( it.current()->name() ) );
+    qDebug( nnn.arg( marg ).arg( it.current()->name() ).toLatin1() );
   }
 }
 
@@ -277,7 +262,7 @@ bool SalomeApp_DataModel::open( const QString& name, CAM_Study* study, QStringLi
     return true; // Probably nothing to load
 
   _PTR(Study)      aStudy ( aDoc->studyDS() ); // shared_ptr cannot be used here
-  _PTR(SComponent) aSComp ( aStudy->FindComponentID( std::string( anId.latin1() ) ) );
+  _PTR(SComponent) aSComp ( aStudy->FindComponentID( std::string( anId.toLatin1() ) ) );
   if ( aSComp )
     updateTree( aSComp, aDoc );
 
@@ -312,7 +297,7 @@ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study )
       QString anId = getRootEntry( aSStudy );
       if ( !anId.isEmpty() ){ // if nothing is published in the study for this module -> do nothing
        _PTR(Study) aStudy ( aSStudy->studyDS() );
-       sobj = aStudy->FindComponentID( std::string( anId.latin1() ) );
+       sobj = aStudy->FindComponentID( std::string( anId.toLatin1() ) );
       }
     }
   }
@@ -323,7 +308,7 @@ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study )
       if ( aSStudy ) {
         _PTR(Study) aStudy ( aSStudy->studyDS() );
         // modelRoot->object() cannot be reused here: it is about to be deleted by buildTree() soon
-        sobj = aStudy->FindComponentID( std::string( modelRoot->entry().latin1() ) );
+        sobj = aStudy->FindComponentID( std::string( modelRoot->entry().toLatin1() ) );
       }
     }
   }
@@ -408,7 +393,7 @@ QString SalomeApp_DataModel::getRootEntry( SalomeApp_Study* study ) const
       anEntry = anObj->entry();
   }
   else if ( study && study->studyDS() ) { // this works even if <myRoot> is null
-    _PTR(SComponent) aSComp( study->studyDS()->FindComponent( module()->name() ) );
+    _PTR(SComponent) aSComp( study->studyDS()->FindComponent( module()->name().toStdString() ) );
     if ( aSComp )
       anEntry = aSComp->GetID().c_str();
   }
index 9c2bff16a9263b8272e77f6ec09a48be8636d55f..53b2f701c48bb76d8107f1207501c23a37e27c4e 100644 (file)
@@ -1,26 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      SalomeApp_DataModel.h
 // Created:   10/25/2004 10:32:33 AM
 // Author:    Sergey LITONIN
-// Copyright (C) CEA 2004
-
+//
 #ifndef SALOMEAPP_DATAMODEL_H
 #define SALOMEAPP_DATAMODEL_H
 
@@ -35,7 +37,8 @@
 
 class SalomeApp_Module;
 class SalomeApp_Study;
-class SalomeApp_DataObject;
+class SUIT_DataObject;
+class LightApp_DataObject;
 
 //   Class       : SalomeApp_DataModel
 ///  Description : Base class of data model
index dd9ff896078cce00674d647eb20eadf4a3ef6c41..72fd38592ca6ee8f4a07ecc0add14157f2762cd6 100644 (file)
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SalomeApp_DataObject.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #include "SalomeApp_DataObject.h"
-
 #include "SalomeApp_Study.h"
-#include "LightApp_RootObject.h"
+#include "SalomeApp_Application.h"
 
 #include <CAM_DataObject.h>
 
+#include <SUIT_Session.h>
 #include <SUIT_Application.h>
 #include <SUIT_ResourceMgr.h>
-#include <SUIT_DataObjectKey.h>
 
-#include <qobject.h>
+#include <SALOME_LifeCycleCORBA.hxx>
+#include <Basics_Utils.hxx>
+
+#include <QObject>
+#include <QVariant>
 
-#include <SALOMEDSClient_AttributeReal.hxx>
-#include <SALOMEDSClient_AttributeInteger.hxx>
-#include <SALOMEDSClient_AttributeComment.hxx>
-#include <SALOMEDSClient_AttributeTableOfReal.hxx>
-#include <SALOMEDSClient_AttributeTableOfInteger.hxx>
+/*!
+  \class SalomeApp_DataObject
+  \brief Implementation of the data object for use in CORBA-based
+  SALOME modules.
+*/
 
-/*!Constructor. Initialize by \a parent*/
+/*!
+  \brief Constructor. 
+  \param parent parent data object
+*/
 SalomeApp_DataObject::SalomeApp_DataObject( SUIT_DataObject* parent )
-: LightApp_DataObject( parent ),
-  CAM_DataObject( parent ),
-  myEntry( "" ),
-  myName( "" )
+: CAM_DataObject( parent ),
+  LightApp_DataObject( parent )
 {
 }
 
-/*!Constructor. Initialize by \a parent and SObject*/
-SalomeApp_DataObject::SalomeApp_DataObject( const _PTR(SObject)& sobj, SUIT_DataObject* parent )
-: LightApp_DataObject( parent ),
-  CAM_DataObject( parent ),
-  myName( "" )
+/*!
+  \brief Constructor. 
+  \param sobj SALOMEDS object
+  \param parent parent data object
+*/
+SalomeApp_DataObject::SalomeApp_DataObject( const _PTR(SObject)& sobj, 
+                                           SUIT_DataObject* parent )
+: CAM_DataObject( parent ),
+  LightApp_DataObject( parent )
 {
   myObject = sobj;
-  myEntry = myObject->GetID().c_str();
 }
 
-/*!Destructor. Do nothing.*/
+/*!
+  \brief Destructor.
+*/
 SalomeApp_DataObject::~SalomeApp_DataObject()
 {
 }
 
-/*!Gets object ID.
- *\retval QString
- */
-QString SalomeApp_DataObject::entry() const
-{
- if ( myObject )
-    return myObject->GetID().c_str();
-  return QString::null;
-  //return myEntry;
-}
-
-/*!Gets name of object.*/
+/*!
+  \brief Get data object name.
+  \return object name
+*/
 QString SalomeApp_DataObject::name() const
 {
-  //if ( myName.isEmpty() )
-  {
-    QString str;
-    if ( myObject )
-      str = myObject->GetName().c_str();
-
-    if ( str.isEmpty() )
-    {
-      _PTR(SObject) refObj = referencedObject();
-      if ( refObj )
-        str = refObj->GetName().c_str();
-    }
-
-    if ( isReference() )
-      {
-        if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) )
-         str = QString( "* " ) + str;
-        else
-         str = QString( "<Invalid Reference>" );
-      }
-    SalomeApp_DataObject* that = (SalomeApp_DataObject*)this;
-    that->myName = str;
+  QString str;
+  if ( myObject )
+    str = myObject->GetName().c_str();
+  
+  if ( str.isEmpty() ) {
+    _PTR(SObject) refObj = referencedObject();
+    if ( refObj )
+      str = refObj->GetName().c_str();
   }
-  return myName;
+  
+  if ( isReference() ) {
+    if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) )
+      str = QString( "* " ) + str;
+    else
+      str = QString( "<Invalid Reference>" );
+  }
+  return str;
 }
 
-/*!Gets icon picture of object.*/
-QPixmap SalomeApp_DataObject::icon() const
+/*!
+  \brief Get object string identifier.
+  \return object ID
+*/
+QString SalomeApp_DataObject::entry() const
 {
-  _PTR(GenericAttribute) anAttr;
-  if ( myObject && myObject->FindAttribute( anAttr, "AttributePixMap" ) ){
-    _PTR(AttributePixMap) aPixAttr ( anAttr );
-    if ( aPixAttr->HasPixMap() ){
-      QString pixmapName = QObject::tr( aPixAttr->GetPixMap().c_str() );
-      LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
-      if ( aRoot && aRoot->study() ) {
-       SUIT_ResourceMgr* mgr = aRoot->study()->application()->resourceMgr();
-       return mgr->loadPixmap( componentDataType(), pixmapName, false ); 
-      }
-    }
-  }
-  return QPixmap();
+  return entry( myObject );
 }
 
-/*!Gets text value for one of entity:
- *\li Value           (id = SalomeApp_DataObject::CT_Value)
- *\li Entry           (id = SalomeApp_DataObject::CT_Entry)
- *\li IOR             (id = SalomeApp_DataObject::CT_IOR)
- *\li Reference entry (id = SalomeApp_DataObject::CT_RefEntry)
- */
+/*!
+  \brief Get object text data for the specified column.
+
+  This method returns the data according to the specufied column \a id:
+  - NameId     : object name (by calling name() method)
+  - EntryId    : object entry (by calling entry() method)
+  - ValueId    : object value
+  - IORId      : object IOR
+  - RefEntryId : object reference entry
+
+  \param id column id
+  \return object text data
+*/
 QString SalomeApp_DataObject::text( const int id ) const
 {
   QString txt;
+
+  // add "Value", "IOR", and "Reference Entry" columns
   switch ( id )
   {
-  case CT_Value:
-#ifndef WNT
+  case ValueId:
+#ifndef WIN32
     if ( componentObject() != this )
 #else
     if ( componentObject() != (SUIT_DataObject*)this )
@@ -138,84 +138,155 @@ QString SalomeApp_DataObject::text( const int id ) const
       if ( txt.isEmpty() )
        txt = value( referencedObject() );
     break;
-  case CT_Entry:
-    txt = entry( object() );
-    break;
-  case CT_IOR:
+  case IORId:
     txt = ior( referencedObject() );
     break;
-  case CT_RefEntry:
+  case RefEntryId :
     if ( isReference() )
       txt = entry( referencedObject() );
     break;
+  default:
+    txt = LightApp_DataObject::text( id );
+    break;
   }
   return txt;
 }
 
-/*!Get color value for one of entity:
- *\li Text color
- *\li Highlight color
- *\li Higlighted text color
- */
-QColor SalomeApp_DataObject::color( const ColorRole cr ) const
+/*!
+  \brief Get data object icon for the specified column.
+  \param id column id
+  \return object icon for the specified column
+*/
+QPixmap SalomeApp_DataObject::icon( const int id ) const
 {
-  QColor clr;
-  switch ( cr )
+  // we display icon only for the first (NameId ) column
+  if ( id == NameId ) {
+    _PTR(GenericAttribute) anAttr;
+    if ( myObject && myObject->FindAttribute( anAttr, "AttributePixMap" ) ){
+      _PTR(AttributePixMap) aPixAttr ( anAttr );
+      if ( aPixAttr->HasPixMap() ) {
+       QString componentType = componentDataType();
+       QString pixmapID      = aPixAttr->GetPixMap().c_str();
+       // select a plugin within a component
+       QStringList plugin_pixmap = pixmapID.split( "::", QString::KeepEmptyParts );
+       if ( plugin_pixmap.size() == 2 ) {
+         componentType = plugin_pixmap.front();
+         pixmapID      = plugin_pixmap.back();
+       }
+       QString pixmapName = QObject::tr( pixmapID.toLatin1().constData() );
+       LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
+       if ( aRoot && aRoot->study() ) {
+         SUIT_ResourceMgr* mgr = aRoot->study()->application()->resourceMgr();
+         return mgr->loadPixmap( componentType, pixmapName, false ); 
+       }
+      }
+    }
+  }
+  return LightApp_DataObject::icon( id );
+}
+
+/*!
+  \brief Get data object color for the specified column.
+  \param role color role
+  \param id column id (not used)
+  \return object color for the specified column
+*/
+QColor SalomeApp_DataObject::color( const ColorRole role, const int id ) const
+{
+  // we ignore parameter <id> in order to use the same colors for 
+  // all columns
+  QColor c;
+  switch ( role )
   {
   case Text:
-    if ( isReference() )
-      {
-       if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) )
-         clr = QColor( 255, 0, 0 );
-       else
-         clr = QColor( 200, 200, 200 );
-      }
-    else if ( myObject )
-    {
+  case Foreground:
+    // text color (not selected item)
+    if ( isReference() ) {
+      if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) )
+       c = QColor( 255, 0, 0 );      // valid reference (red)
+      else
+       c = QColor( 200, 200, 200 );  // invalid reference (grayed)
+    }
+    else if ( myObject ) {
+      // get color atrtribute value
       _PTR(GenericAttribute) anAttr;
-      if ( myObject->FindAttribute( anAttr, "AttributeTextColor" ) )
-      {
+      if ( myObject->FindAttribute( anAttr, "AttributeTextColor" ) ) {
        _PTR(AttributeTextColor) aColAttr = anAttr;
-       clr = QColor( (int)aColAttr->TextColor().R, (int)aColAttr->TextColor().G, (int)aColAttr->TextColor().B );
+       c = QColor( (int)aColAttr->TextColor().R, (int)aColAttr->TextColor().G, (int)aColAttr->TextColor().B );
       }
     }
     break;
   case Highlight:
-    if ( isReference() )
-      {
-       if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) )
-         clr = QColor( 255, 0, 0 );
-       else
-         clr = QColor( 200, 200, 200 );
-      }
-    else if ( myObject )
-    {
+    // background color for the highlighted item
+    if ( isReference() ) {
+      if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) )
+       c = QColor( 255, 0, 0 );      // valid reference (red)
+      else
+       c = QColor( 200, 200, 200 );  // invalid reference (grayed)
+    }
+    else if ( myObject ) {
+      // get color atrtribute value
       _PTR(GenericAttribute) anAttr;
-      if( myObject->FindAttribute ( anAttr, "AttributeTextHighlightColor") )
-      {
+      if( myObject->FindAttribute ( anAttr, "AttributeTextHighlightColor") ) {
         _PTR(AttributeTextHighlightColor) aHighColAttr = anAttr;
-       clr = QColor( (int)(aHighColAttr->TextHighlightColor().R), 
-                     (int)(aHighColAttr->TextHighlightColor().G), 
-                     (int)(aHighColAttr->TextHighlightColor().B));
+       c = QColor( (int)(aHighColAttr->TextHighlightColor().R), 
+                   (int)(aHighColAttr->TextHighlightColor().G), 
+                   (int)(aHighColAttr->TextHighlightColor().B));
       }
     }
     break;
   case HighlightedText:
+    // text color for the highlighted item
     if ( isReference() )
-      clr = QColor( 255, 255, 255 );
+      c = QColor( 255, 255, 255 );   // white
     break;
   }
-  return clr;
+  if ( !c.isValid() )
+    c = LightApp_DataObject::color( role, id );
+  return c;
 }
 
-/*!Gets tooltip.*/
-QString SalomeApp_DataObject::toolTip() const
+/*!
+  \brief Get data object tooltip for the specified column.
+  \param id column id (not used)
+  \return object tooltip for the specified column
+*/
+QString SalomeApp_DataObject::toolTip( const int /*id*/ ) const
 {
-  //return object()->Name();
+  // we ignore parameter <id> in order to use the same tooltip for 
+  // all columns
+  
+  // Get customized tooltip in case of it exists
+  const SalomeApp_DataObject* compObj = dynamic_cast<SalomeApp_DataObject*>( componentObject() );
+  // Check if the component has been loaded.
+  // In order to avoid loading the component only for getting a custom tooltip.
+  if ( compObj && compObj != this && !ior(compObj->object()).isEmpty() ) {
+    SalomeApp_Application* app = 
+      dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+    if ( app ) {
+      // --- try to find (and not load) the component instance, like GEOM instance,
+      //     registered in naming service under Containers/<hostname>/...
+      //     with any container name, on every machine available
+      Engines::MachineParameters params;
+      app->lcc()->preSet(params); // --- any container name, anywhere
+      Engines::Component_var aComponent =
+        app->lcc()->FindComponent(params, componentDataType().toLatin1().constData() );
+      
+      if ( !CORBA::is_nil(aComponent) && aComponent->hasObjectInfo() ) {
+       LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
+       if ( aRoot && aRoot->study() )
+         return QString( aComponent->getObjectInfo( aRoot->study()->id(), entry().toLatin1().constData()) );
+      }
+    }
+  }
+  
   return QString( "Object \'%1\', module \'%2\', ID=%3" ).arg( name() ).arg( componentDataType() ).arg( entry() );
 }
 
-/*!Get component type.*/
+/*!
+  \brief Get component type.
+  \return component type
+*/
 QString SalomeApp_DataObject::componentDataType() const
 {
   //  if ( myCompDataType.isEmpty() ) {
@@ -232,13 +303,19 @@ QString SalomeApp_DataObject::componentDataType() const
   return myCompDataType;
 }
 
-/*!Gets object.*/
+/*!
+  \brief Get SALOMEDS object.
+  \return SALOMEDS object
+*/
 _PTR(SObject) SalomeApp_DataObject::object() const
 {
   return myObject;
 }
 
-/*!Checks: Is object reference.*/
+/*!
+  \brief Check if the data object is a reference.
+  \return \c true if this data object actually refers to another one
+*/
 bool SalomeApp_DataObject::isReference() const
 {
   bool isRef = false;
@@ -250,7 +327,10 @@ bool SalomeApp_DataObject::isReference() const
   return isRef;
 }
 
-/*!Gets reference object.*/
+/*!
+  \brief Get the object referenced by this one.
+  \return referenced object
+*/
 _PTR(SObject) SalomeApp_DataObject::referencedObject() const
 {
   _PTR(SObject) refObj;
@@ -261,7 +341,43 @@ _PTR(SObject) SalomeApp_DataObject::referencedObject() const
   return obj;
 }
 
-/*!Gets IOR*/
+/*!
+  \brief Check if the specified column supports custom sorting.
+  \param id column id
+  \return \c true if column sorting should be customized
+  \sa compare()
+*/
+bool SalomeApp_DataObject::customSorting( const int id ) const
+{
+  // perform custom sorting for the "Entry" and "Reference Entry" columns
+  return id == EntryId  || id == RefEntryId  ? true 
+    : LightApp_DataObject::customSorting( id );
+}
+
+/*!
+  \brief Compares data from two items for sorting purposes.
+
+  This method is called only for those columns for which customSorting()
+  method returns \c true.
+
+  \param left first data to compare
+  \param right second data to compare
+  \param id column id
+  \return result of the comparison
+  \sa customSorting()
+*/
+bool SalomeApp_DataObject::compare( const QVariant& left, const QVariant& right, const int id ) const
+{
+  // use the same custom sorting for the "Reference Entry" column as for the
+  // "Entry" column (call base implementation)
+  return LightApp_DataObject::compare( left, right, id == RefEntryId ? EntryId : id );
+}
+
+/*!
+  \brief Get data object IOR.
+  \param obj data object
+  \return data object IOR or null string if IOR is empty
+*/
 QString SalomeApp_DataObject::ior( const _PTR(SObject)& obj ) const
 {
   QString txt;
@@ -281,7 +397,11 @@ QString SalomeApp_DataObject::ior( const _PTR(SObject)& obj ) const
   return txt;
 }
 
-/*!Gets Entry*/
+/*!
+  \brief Get data object entry identifier.
+  \param obj data object
+  \return data object entry identifier or empty object does not have entry
+*/
 QString SalomeApp_DataObject::entry( const _PTR(SObject)& obj ) const
 {
   QString txt;
@@ -293,16 +413,59 @@ QString SalomeApp_DataObject::entry( const _PTR(SObject)& obj ) const
   return txt;
 }
 
-/*!Value*/
+/*!
+  \brief Get data object value.
+  \param obj data object
+  \return data object value or empty string if there is no 
+  value associated to the object
+*/
 QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const
 {
   if ( !obj )
-    return QString::null;
+    return QString();
 
   QString val;
   _PTR(GenericAttribute) attr;
 
-  if ( obj->FindAttribute( attr, "AttributeInteger" ) )
+  if ( obj->FindAttribute( attr, "AttributeString" ) )
+  {
+    _PTR(AttributeString) strAttr = attr;
+    std::string str = strAttr->Value();
+    QString aStrings = QString( str.c_str() );
+    
+    //Special case to show NoteBook variables in the "Value" column of the OB 
+    if ( LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() ) )
+    {
+      if ( SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( aRoot->study() ) )
+      {
+        _PTR(Study) studyDS( aStudy->studyDS() );
+
+       bool ok = false;
+       QStringList aSectionList = aStrings.split( "|" );
+       if ( !aSectionList.isEmpty() )
+       {
+         QString aLastSection = aSectionList.last();
+         QStringList aStringList = aLastSection.split( ":" );
+         if ( !aStringList.isEmpty() )
+         {
+           ok = true;
+           for ( int i = 0, n = aStringList.size(); i < n; i++ )
+           {
+             QString aStr = aStringList[i];
+             if ( studyDS->IsVariable( aStr.toStdString() ) )
+               val.append( aStr + ", " );
+           }
+
+           if ( !val.isEmpty() )
+             val.remove( val.length() - 2, 2 );
+         }
+       }
+       if( !ok )
+         val = aStrings;
+      }
+    }
+  }
+  else if ( obj->FindAttribute( attr, "AttributeInteger" ) )
   {
     _PTR(AttributeInteger) intAttr = attr;
     if ( intAttr )
@@ -332,7 +495,7 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const
       val += QString( " " );
     val += QString( "[%1,%2]" ).arg( tableAttr->GetNbRows() ).arg( tableAttr->GetNbColumns() );
   }
-  else if ( obj->FindAttribute( attr, "AttributeComment") )
+  else if ( obj->FindAttribute( attr, "AttributeComment" ) )
   {
     _PTR(AttributeComment) comm = attr;
     std::string str = comm->Value();
@@ -342,89 +505,286 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const
   return val;
 }
 
-
-
-
-
-/*!Constructor.Initialize by \a parent.*/
+/*!
+  \class SalomeApp_ModuleObject
+  \brief This class is used for optimized access to the SALOMEDS-based 
+  data model from SalomeApp_DataObject class instances.
+  \sa CAM_ModuleObject class
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent data object
+*/
 SalomeApp_ModuleObject::SalomeApp_ModuleObject( SUIT_DataObject* parent )
-: SalomeApp_DataObject( parent ),
-  CAM_RootObject( parent ),
-  CAM_DataObject( parent )
+: CAM_DataObject( parent ),
+  LightApp_DataObject( parent ),
+  SalomeApp_DataObject( parent ),
+  CAM_ModuleObject( parent )
 {
 }
 
-/*!Constructor.Initialize by \a parent and SObject.*/
-SalomeApp_ModuleObject::SalomeApp_ModuleObject( const _PTR(SObject)& sobj, SUIT_DataObject* parent )
-: SalomeApp_DataObject( sobj, parent ),
-  CAM_RootObject( 0, parent ),
-  CAM_DataObject( parent )
+/*!
+  \brief Constructor.
+  \param sobj SALOMEDS object
+  \param parent parent data object
+*/
+SalomeApp_ModuleObject::SalomeApp_ModuleObject( const _PTR(SObject)& sobj, 
+                                               SUIT_DataObject* parent )
+: CAM_DataObject( parent ),
+  LightApp_DataObject( parent ),
+  SalomeApp_DataObject( sobj, parent ),
+  CAM_ModuleObject( parent )
 {
 }
 
-/*!Constructor.Initialize by \a parent and CAM_DataModel.*/
-SalomeApp_ModuleObject::SalomeApp_ModuleObject( CAM_DataModel* dm, const _PTR(SObject)& sobj, SUIT_DataObject* parent )
-: SalomeApp_DataObject( sobj, parent ),
-  CAM_RootObject( dm, parent ),
-  CAM_DataObject( parent )
+/*!
+  \brief Constructor.
+  \param dm data model
+  \param sobj SALOMEDS object
+  \param parent parent data object
+*/
+SalomeApp_ModuleObject::SalomeApp_ModuleObject( CAM_DataModel* dm, 
+                                               const _PTR(SObject)& sobj, 
+                                               SUIT_DataObject* parent )
+: CAM_DataObject( parent ),
+  LightApp_DataObject( parent ),
+  SalomeApp_DataObject( sobj, parent ),
+  CAM_ModuleObject( dm, parent )
 {
 }
 
-/*!Destructor. Do nothing.*/
+/*!
+  \brief Destructor.
+*/
 SalomeApp_ModuleObject::~SalomeApp_ModuleObject()
 {
 }
 
-/*!Returns module name */
+/*!
+  \brief Get module name.
+  \return module name
+*/
 QString SalomeApp_ModuleObject::name() const
 {
   return SalomeApp_DataObject::name();
 }
 
+/*!
+  \brief Get data object icon for the specified column.
+  \param id column id
+  \return object icon for the specified column
+*/
+QPixmap SalomeApp_ModuleObject::icon( const int id ) const
+{
+  return SalomeApp_DataObject::icon( id );
+}
 
+/*!
+  \brief Get data object tooltip for the specified column.
+  \param id column id
+  \return object tooltip for the specified column
+*/
+QString SalomeApp_ModuleObject::toolTip( const int id ) const
+{
+  return SalomeApp_DataObject::toolTip( id );
+}
 
+/*!
+  \class SalomeApp_RootObject
+  \brief Root data object for the CORBA-based SALOME application.
+
+  This class is to be instanciated by only one object - the root object
+  of the SalomeApp data object tree. This object is not shown in the object browser.
+  The goal of this class is to provide a unified access to SalomeApp_Study
+  object from SalomeApp_DataObject instances.
+*/
+
+/*!
+  \brief Constructor.
+  \param study pointer to the study
+*/
+SalomeApp_RootObject::SalomeApp_RootObject( LightApp_Study* study )
+: CAM_DataObject( 0 ),
+  LightApp_DataObject( 0 ),
+  SalomeApp_DataObject( 0 ),
+  LightApp_RootObject( study )
+{
+}
 
-/*!Constructor.Initialize by \a parent.*/
-SalomeApp_SavePointObject::SalomeApp_SavePointObject( SUIT_DataObject* _parent, const int id, SalomeApp_Study* study )
-  : LightApp_DataObject( _parent ), CAM_DataObject( _parent ), // IMPORTANT TO CALL ALL VIRTUAL CONSTRUCTORS!
-    myId( id ),
-    myStudy( study )
+/*!
+  \brief Destructor.
+*/
+SalomeApp_RootObject::~SalomeApp_RootObject()
 {
 }
 
-/*!Destructor. Do nothing.*/
+/*!
+  \brief Get data object name.
+  \return object name
+*/
+QString SalomeApp_RootObject::name() const
+{
+  return LightApp_RootObject::name();
+}
+/*!
+  \brief Get object string identifier.
+  \return object ID
+*/
+QString SalomeApp_RootObject::entry() const
+{
+  return LightApp_RootObject::entry();
+}
+
+/*!
+  \brief Get object text data for the specified column.
+  \param id column id
+  \return object text data
+*/
+QString SalomeApp_RootObject::text( const int id ) const
+{
+  return LightApp_RootObject::text( id );
+}
+
+/*!
+  \brief Get data object icon for the specified column.
+  \param id column id
+  \return object icon for the specified column
+*/
+QPixmap SalomeApp_RootObject::icon( const int id ) const
+{
+  return LightApp_RootObject::icon( id );
+}
+
+/*!
+  \brief Get data object color for the specified column.
+  \param role color role
+  \param id column id (not used)
+  \return object color for the specified column
+*/
+QColor SalomeApp_RootObject::color( const ColorRole role, const int id ) const
+{
+  return LightApp_RootObject::color( role, id );
+}
+
+/*!
+  \brief Get data object tooltip for the specified column.
+  \param id column id (not used)
+  \return object tooltip for the specified column
+*/
+QString SalomeApp_RootObject::toolTip( const int id ) const
+{
+  return LightApp_RootObject::toolTip( id );
+}
+
+/*!
+  \class SalomeApp_SavePointObject
+  \brief Represents persistent visual_state object.
+
+  Save point objects are stored in the data model, but NOT in SObjects
+  structure, so they are handled separately using this special class
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent data object
+  \param id save point ID
+  \param study study
+*/
+SalomeApp_SavePointObject::SalomeApp_SavePointObject( SUIT_DataObject* parent, 
+                                                     const int id, 
+                                                     SalomeApp_Study* study )
+: LightApp_DataObject( parent ), 
+  CAM_DataObject( parent ),
+  myId( id ),
+  myStudy( study )
+{
+}
+
+/*!
+  \brief Destructor.
+*/
 SalomeApp_SavePointObject::~SalomeApp_SavePointObject()
 {
 }
 
-/*!Returns save points ID */
+/*!
+  \brief Get save point unique identifier.
+  \return save point ID
+*/
 int SalomeApp_SavePointObject::getId() const
 {
   return myId;
 }
 
-/*!Returns "invalid" entry, which does not correspond to any object in data structure
-  but indicates that it is a save point object  */
+/*!
+  \brief Get object string identifier.
+  \return object ID
+*/
 QString SalomeApp_SavePointObject::entry() const
 {
   return QObject::tr( "SAVE_POINT_DEF_NAME" ) + QString::number( myId );
 }
 
-/*!Returns displayed name of object */
+/*!
+  \brief Get data object name.
+  \return object name
+*/
 QString SalomeApp_SavePointObject::name() const
 {
   return myStudy->getNameOfSavePoint( myId );
 }
 
-/*!Gets icon picture of object.*/
-QPixmap SalomeApp_SavePointObject::icon() const
+/*!
+  \brief Get data object icon for the specified column.
+  \param id column id
+  \return object icon for the specified column
+*/
+QPixmap SalomeApp_SavePointObject::icon( const int /*id*/ ) const
 {
   return QPixmap();
 }
 
-/*!Gets tooltip.*/
-QString SalomeApp_SavePointObject::toolTip() const
+/*!
+  \brief Get data object tooltip for the specified column.
+  \param id column id (not used)
+  \return object tooltip for the specified column
+*/
+QString SalomeApp_SavePointObject::toolTip( const int /*id*/ ) const
 {
   return QObject::tr( "SAVE_POINT_OBJECT_TOOLTIP" ).arg( name() );
 }
 
+/*!
+  \class SalomeApp_SavePointRootObject
+  \brief Represents parent object for visual_state objects.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent object
+*/
+SalomeApp_SavePointRootObject::SalomeApp_SavePointRootObject( SUIT_DataObject* parent )
+: SUIT_DataObject( parent )
+{
+}
+
+/*!
+  \brief Get data object name.
+  \return object name
+*/
+QString SalomeApp_SavePointRootObject::name() const
+{
+  return QObject::tr( "SAVE_POINT_ROOT_NAME" ); 
+}
+
+/*!
+  \brief Get data object tooltip for the specified column.
+  \param id column id (not used)
+  \return object tooltip for the specified column
+*/
+QString SalomeApp_SavePointRootObject::toolTip( const int /*id*/ ) const
+{
+  return QObject::tr( "SAVE_POINT_ROOT_TOOLTIP" ); 
+}
index 7f3ae993d7227973ec6d6d382e1aed3af04314f7..8a0462f4d297b70274b38e1d6dea700d5250e9ef 100644 (file)
@@ -1,80 +1,81 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SalomeApp_DataObject.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #ifndef SALOMEAPP_DATAOBJECT_H
 #define SALOMEAPP_DATAOBJECT_H
 
 #include "SalomeApp.h"
-
-#include "LightApp_DataObject.h"
-#include "CAM_RootObject.h"
-
-#include "SALOMEDSClient.hxx"
+#include <LightApp_DataObject.h>
+#include <SALOMEDSClient.hxx>
 
 class SalomeApp_Study;
 
-class SALOMEAPP_EXPORT SalomeApp_DataObject : public LightApp_DataObject
+class SALOMEAPP_EXPORT SalomeApp_DataObject : public virtual LightApp_DataObject
 {
 
 public:
-  enum { CT_Value, CT_Entry, CT_IOR, CT_RefEntry };
+  //! Column id
+  enum {
+    ValueId = EntryId + 1,    //!< value column
+    IORId,                    //!< IOR column
+    RefEntryId                //!< reference entry column
+  };
 
 public:
   SalomeApp_DataObject( SUIT_DataObject* = 0 );
   SalomeApp_DataObject( const _PTR(SObject)&, SUIT_DataObject* = 0 );
   virtual ~SalomeApp_DataObject();
-    
-  virtual QString                 name() const;
-  virtual QPixmap                 icon() const;
-  virtual QString                 toolTip() const;
 
-  virtual QString                 text( const int ) const;
-  virtual QColor                  color( const ColorRole ) const;
+  virtual QString        name() const;
+  virtual QString        entry() const;
+
+  virtual QString        text( const int = NameId ) const;
+  virtual QPixmap        icon( const int = NameId ) const;
+  virtual QColor         color( const ColorRole, const int = NameId ) const;
+  virtual QString        toolTip( const int = NameId ) const;
 
-  virtual QString                 entry() const;
+  virtual _PTR(SObject)  object() const;
 
-  /*! location of corresponding SALOMEDS::SObject  */
-  virtual _PTR(SObject)           object() const;
+  bool                   isReference() const;
+  _PTR(SObject)          referencedObject() const;
 
-  bool                            isReference() const;
-  _PTR(SObject)                   referencedObject() const;
+  virtual QString        componentDataType() const;
 
-  /*! GEOM, SMESH, VISU, etc.*/
-  virtual QString                 componentDataType() const;
+  virtual bool           customSorting( const int = NameId ) const;
+  virtual bool           compare( const QVariant&, const QVariant&, const int = NameId ) const;
 
 private:
-  QString                         ior( const _PTR(SObject)& ) const;
-  QString                         entry( const _PTR(SObject)& ) const;
-  QString                         value( const _PTR(SObject)& ) const;
+  QString                ior( const _PTR(SObject)& ) const;
+  QString                entry( const _PTR(SObject)& ) const;
+  QString                value( const _PTR(SObject)& ) const;
 
 private:
-  _PTR(SObject)                   myObject;
-  QString                         myEntry;
-  QString                         myName;
+  _PTR(SObject)          myObject;
 };
 
-/*!
- * SalomeApp_ModuleObject - class for optimized access to DataModel from
- * SalomeApp_DataObject instances - see also CAM_RootObject.h
- */
-
 class SALOMEAPP_EXPORT SalomeApp_ModuleObject : public SalomeApp_DataObject,
-                                                public CAM_RootObject
+                                                public CAM_ModuleObject
 {
 public:
   SalomeApp_ModuleObject( SUIT_DataObject* = 0 );
@@ -82,45 +83,52 @@ public:
   SalomeApp_ModuleObject( CAM_DataModel*, const _PTR(SObject)&, SUIT_DataObject* = 0 );
   virtual ~SalomeApp_ModuleObject();
 
-  virtual QString                 name() const;
+  virtual QString        name() const;
+  QPixmap                icon( const int = NameId ) const;
+  QString                toolTip( const int = NameId ) const;
 };
 
-/*!
- * SalomeApp_SavePointObject - class that represents persistent visual_state object
- * these objects are stored in data model, but NOT in SObjects structure, so we
- * must handle them separately using this special class for them
- */
+class SALOMEAPP_EXPORT SalomeApp_RootObject : public SalomeApp_DataObject,
+                                              public LightApp_RootObject
+{
+public:
+  SalomeApp_RootObject( LightApp_Study* );
+  virtual ~SalomeApp_RootObject();
+
+  QString                name() const;
+  QString                entry() const;
+  QString                text( const int = NameId ) const;
+  QPixmap                icon( const int = NameId ) const;
+  QColor                 color( const ColorRole, const int = NameId ) const;
+  QString                toolTip( const int = NameId ) const;
+};
 
 class SALOMEAPP_EXPORT SalomeApp_SavePointObject : public virtual LightApp_DataObject
 {
 public:
-  SalomeApp_SavePointObject( SUIT_DataObject* parent, const int, SalomeApp_Study* study );
+  SalomeApp_SavePointObject( SUIT_DataObject*, const int, SalomeApp_Study* );
   virtual ~SalomeApp_SavePointObject();
-  
-  virtual QString                 entry() const;
 
-  virtual QString                 name() const;
-  virtual QPixmap                 icon() const;
-  virtual QString                 toolTip() const;
+  virtual QString        name() const;
+  virtual QString        entry() const;
 
-  int                             getId() const;
+  virtual QPixmap        icon( const int = NameId ) const;
+  virtual QString        toolTip( const int = NameId ) const;
+
+  int                    getId() const;
 
 private:
-  int                             myId;
-  SalomeApp_Study*                myStudy;
+  int                    myId;
+  SalomeApp_Study*       myStudy;
 };
 
-/*!
- * SalomeApp_SavePointRootObject - class that represents parent object for visual_state objects
- */
-
 class SALOMEAPP_EXPORT SalomeApp_SavePointRootObject : public SUIT_DataObject
 {
 public:
-  SalomeApp_SavePointRootObject( SUIT_DataObject* parent ) : SUIT_DataObject( parent ) {}
-  
-  virtual QString                 name() const   { return QObject::tr( "SAVE_POINT_ROOT_NAME" ); }
-  virtual QString                 toolTip() const{ return QObject::tr( "SAVE_POINT_ROOT_TOOLTIP" ); }
+  SalomeApp_SavePointRootObject( SUIT_DataObject* );
+
+  virtual QString        name() const;
+  virtual QString        toolTip( const int = NameId ) const;
 };
 
 #endif
diff --git a/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx b/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx
new file mode 100644 (file)
index 0000000..42cf9e4
--- /dev/null
@@ -0,0 +1,352 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      SalomeApp_DoubleSpinBox.cxx
+// Author:    Oleg UVAROV
+
+#include "SalomeApp_DoubleSpinBox.h"
+#include "SalomeApp_Application.h"
+#include "SalomeApp_Study.h"
+
+#include <SUIT_Session.h>
+
+#include "SALOMEDSClient_ClientFactory.hxx" 
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+#include <QKeyEvent>
+#include <QLineEdit>
+
+/*!
+  \class SalomeApp_DoubleSpinBox
+*/
+
+/*!
+  \brief Constructor.
+
+  Constructs a spin box with 0.0 as minimum value and 99.99 as maximum value,
+  a step value of 1.0 and a precision of 2 decimal places. 
+  The value is initially set to 0.00.
+
+  \param parent parent object
+*/
+SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox( QWidget* parent )
+: QtxDoubleSpinBox( parent ),
+  myDefaultValue( 0.0 ),
+  myIsRangeSet( false ),
+  myMinimum( 0.0 ),
+  myMaximum( 99.99 )
+{
+  connectSignalsAndSlots();
+}
+
+/*!
+  \brief Constructor.
+
+  Constructs a spin box with specified minimum, maximum and step value.
+  The precision is set to 2 decimal places. 
+  The value is initially set to the minimum value.
+
+  \param min spin box minimum possible value
+  \param max spin box maximum possible value
+  \param step spin box increment/decrement value
+  \param parent parent object
+*/
+SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox( double min, double max, double step, QWidget* parent )
+: QtxDoubleSpinBox( min, max, step, parent ),
+  myDefaultValue( 0.0 ),
+  myIsRangeSet( false ),
+  myMinimum( min ),
+  myMaximum( max )
+{
+  connectSignalsAndSlots();
+}
+
+/*!
+  \brief Constructor.
+
+  Constructs a spin box with specified minimum, maximum and step value.
+  The precision is set to 2 decimal places. 
+  The value is initially set to the minimum value.
+
+  \param min spin box minimum possible value
+  \param max spin box maximum possible value
+  \param step spin box increment/decrement value
+  \param parent parent object
+*/
+SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox( double min, double max, double step, int prec, int dec, QWidget* parent )
+: QtxDoubleSpinBox( min, max, step, prec, dec, parent ),
+  myDefaultValue( 0.0 ),
+  myIsRangeSet( false ),
+  myMinimum( min ),
+  myMaximum( max )
+{
+  connectSignalsAndSlots();
+}
+
+/*!
+  \brief Destructor.
+*/
+SalomeApp_DoubleSpinBox::~SalomeApp_DoubleSpinBox()
+{
+}
+
+/*!
+  \brief Connect signals and slots.
+*/
+void SalomeApp_DoubleSpinBox::connectSignalsAndSlots()
+{
+  connect( this, SIGNAL( editingFinished() ),
+          this, SLOT( onEditingFinished() ) );
+
+  connect( this, SIGNAL( valueChanged( const QString& ) ),
+          this, SLOT( onTextChanged( const QString& ) ) );
+
+  connect( lineEdit(), SIGNAL( textChanged( const QString& ) ),
+          this, SLOT( onTextChanged( const QString& ) ) );
+
+  connect( lineEdit(), SIGNAL( textChanged( const QString& )),
+          this, SIGNAL( textChanged( const QString& ) ) );
+}
+
+/*!
+  \brief This function is called when editing is finished.
+*/
+void SalomeApp_DoubleSpinBox::onEditingFinished()
+{
+  if( myTextValue.isNull() )
+    myTextValue = text();
+
+  setText( myTextValue );
+}
+
+/*!
+  \brief This function is called when value is changed.
+*/
+void SalomeApp_DoubleSpinBox::onTextChanged( const QString& text )
+{
+  myTextValue = text;
+
+  double value = 0;
+  if( isValid( text, value ) == Acceptable )
+    myCorrectValue = text;
+}
+
+/*!
+  \brief Interpret text entered by the user as a value.
+  \param text text entered by the user
+  \return mapped value
+  \sa textFromValue()
+*/
+double SalomeApp_DoubleSpinBox::valueFromText( const QString& text ) const
+{
+  double value = 0;
+  if( isValid( text, value ) == Acceptable )
+    return value;
+
+  return defaultValue();
+}
+
+/*!
+  \brief This function is used by the spin box whenever it needs to display
+  the given value.
+
+  \param val spin box value
+  \return text representation of the value
+  \sa valueFromText()
+*/
+QString SalomeApp_DoubleSpinBox::textFromValue( double val ) const
+{
+  return QtxDoubleSpinBox::textFromValue( val );
+}
+
+/*!
+  \brief This function is used to determine whether input is valid.
+  \param str currently entered value
+  \param pos cursor position in the string
+  \return validating operation result
+*/
+QValidator::State SalomeApp_DoubleSpinBox::validate( QString& str, int& pos ) const
+{
+  return QValidator::Acceptable;
+}
+
+/*!
+  \brief This function is used to determine whether input is valid.
+  \return validating operation result
+*/
+bool SalomeApp_DoubleSpinBox::isValid( QString& msg, bool toCorrect )
+{
+  double value;
+  State aState = isValid( text(), value );
+
+  if( aState != Acceptable )
+  {
+    if( toCorrect )
+    {
+      if( aState == Incompatible )
+       msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n";
+      else if( aState == NoVariable )
+       msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n";
+      else if( aState == Invalid )
+       msg += tr( "ERR_INVALID_VALUE" ) + "\n";
+
+      setText( myCorrectValue );
+    }
+    return false;
+  }
+
+  return true;
+}
+
+/*!
+  \brief This function is used to set a default value for this spinbox.
+  \param value default value
+*/
+void SalomeApp_DoubleSpinBox::setDefaultValue( const double value )
+{
+  myDefaultValue = value;
+}
+
+/*!
+  \brief This function is used to set minimum and maximum values for this spinbox.
+  \param min minimum value
+  \param max maximum value
+*/
+void SalomeApp_DoubleSpinBox::setRange( const double min, const double max )
+{
+  QtxDoubleSpinBox::setRange( min, max );
+
+  myIsRangeSet = true;
+  myMinimum = min;
+  myMaximum = max;
+}
+
+/*!
+  \brief This function is used to set a current value for this spinbox.
+  \param value current value
+*/
+void SalomeApp_DoubleSpinBox::setValue( const double value )
+{
+  QtxDoubleSpinBox::setValue( value );
+
+  myCorrectValue = QString::number( value );
+  myTextValue = myCorrectValue;
+}
+
+/*!
+  \brief This function is used to set a text for this spinbox.
+  \param value current value
+*/
+void SalomeApp_DoubleSpinBox::setText( const QString& value )
+{
+  lineEdit()->setText(value);
+}
+
+/*!
+  \brief This function is used to determine whether input is valid.
+  \return validating operation result
+*/
+SalomeApp_DoubleSpinBox::State SalomeApp_DoubleSpinBox::isValid( const QString& text, double& value ) const
+{
+  SearchState aSearchState = findVariable( text, value );
+  if( aSearchState == NotFound )
+  {
+    bool ok = false;
+    value = text.toDouble( &ok );
+    if( !ok )
+      return NoVariable;
+  }
+  else if( aSearchState == IncorrectType )
+    return Incompatible;
+
+  if( !checkRange( value ) )
+    return Invalid;
+
+  return Acceptable;
+}
+
+/*!
+  \brief This function return a default acceptable value (commonly, 0.0).
+  \return default acceptable value
+*/
+double SalomeApp_DoubleSpinBox::defaultValue() const
+{
+  if( myMinimum > myDefaultValue || myMaximum < myDefaultValue )
+    return myMinimum;
+
+  return myDefaultValue;
+}
+
+/*!
+  \brief This function is used to check that string value lies within predefined range.
+  \return check status
+*/
+bool SalomeApp_DoubleSpinBox::checkRange( const double value ) const
+{
+  if( !myIsRangeSet )
+    return true;
+
+  return value >= myMinimum && value <= myMaximum;
+}
+
+/*!
+  \brief This function is used to determine whether input is a variable name and to get its value.
+  \return status of search operation
+*/
+SalomeApp_DoubleSpinBox::SearchState SalomeApp_DoubleSpinBox::findVariable( const QString& name, double& value ) const
+{
+  value = 0;
+  if( SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() ) )
+  {
+    if( SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) )
+    {
+      _PTR(Study) studyDS = study->studyDS();
+
+      std::string aName = name.toStdString();
+      if( studyDS->IsVariable( aName ) )
+      {
+       if( studyDS->IsReal( aName ) || studyDS->IsInteger( aName ) )
+       {
+         value = studyDS->GetReal( aName );
+         return Found;
+       }
+       return IncorrectType;
+      }
+    }
+  }
+  return NotFound;
+}
+
+/*!
+  \brief This function is called when the spinbox recieves key press event.
+*/
+void SalomeApp_DoubleSpinBox::keyPressEvent( QKeyEvent* e )
+{
+  if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter )
+    QWidget::keyPressEvent( e );
+  else
+    QtxDoubleSpinBox::keyPressEvent( e );
+}
+
+/*!
+  \brief This function is called when the spinbox recieves show event.
+*/
+void SalomeApp_DoubleSpinBox::showEvent( QShowEvent* )
+{
+  setText( myTextValue );
+}
diff --git a/src/SalomeApp/SalomeApp_DoubleSpinBox.h b/src/SalomeApp/SalomeApp_DoubleSpinBox.h
new file mode 100644 (file)
index 0000000..c5b6539
--- /dev/null
@@ -0,0 +1,91 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      SalomeApp_DoubleSpinBox.h
+// Author:    Oleg UVAROV
+
+#ifndef SALOMEAPP_DOUBLESPINBOX_H
+#define SALOMEAPP_DOUBLESPINBOX_H
+
+#include "SalomeApp.h"
+
+#include <QtxDoubleSpinBox.h>
+
+#include <QValidator>
+
+class SALOMEAPP_EXPORT SalomeApp_DoubleSpinBox : public QtxDoubleSpinBox
+{
+  Q_OBJECT
+
+  enum State { Invalid = 0, NoVariable, Incompatible, Acceptable };
+  enum SearchState { NotFound = 0, IncorrectType, Found };
+
+public:
+  SalomeApp_DoubleSpinBox( QWidget* = 0 );
+  SalomeApp_DoubleSpinBox( double, double, double = 1, QWidget* = 0 );
+  SalomeApp_DoubleSpinBox( double, double, double, int, int, QWidget* = 0 );
+  virtual ~SalomeApp_DoubleSpinBox();
+
+  virtual double            valueFromText( const QString& ) const;
+  virtual QString           textFromValue( double ) const;
+
+  virtual QValidator::State validate( QString&, int& ) const;
+
+  virtual bool              isValid( QString& msg, bool = false );
+
+  virtual void              setDefaultValue( const double );
+
+  virtual void              setRange( double, double );
+  virtual void              setValue( double );
+
+  virtual void              setText(const QString& );
+
+signals:
+  void                      textChanged( const QString& );
+
+protected:
+  State                     isValid( const QString&, double& ) const;
+
+  double                    defaultValue() const;
+  bool                      checkRange( const double ) const;
+
+  SearchState               findVariable( const QString&, double& ) const;
+
+protected:
+  virtual void              keyPressEvent( QKeyEvent* );
+  virtual void              showEvent( QShowEvent* );
+
+protected slots:
+  void                      onEditingFinished();
+  void                      onTextChanged( const QString& );
+
+private:
+  void                      connectSignalsAndSlots();
+
+private:
+  double                    myDefaultValue; 
+
+  bool                      myIsRangeSet;
+  double                    myMinimum;
+  double                    myMaximum;
+
+  QString                   myCorrectValue;
+  QString                   myTextValue;
+};
+
+#endif
diff --git a/src/SalomeApp/SalomeApp_EventFilter.cxx b/src/SalomeApp/SalomeApp_EventFilter.cxx
deleted file mode 100755 (executable)
index 493d690..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "SalomeApp_EventFilter.h"
-#include <SALOME_Event.hxx>
-
-#include <qapplication.h>
-
-SalomeApp_EventFilter* SalomeApp_EventFilter::myFilter = NULL;
-
-/*!Constructor.*/
-SalomeApp_EventFilter::SalomeApp_EventFilter()
-: QObject()
-{
-  /* VSR 13/01/03 : installing global event filter for the application */
-  qApp->installEventFilter( this );
-}
-
-/*!Destructor.*/
-SalomeApp_EventFilter::~SalomeApp_EventFilter()
-{
-  qApp->removeEventFilter( this );
-}
-
-/*!
-  Custom event filter
-*/
-bool SalomeApp_EventFilter::eventFilter( QObject* o, QEvent* e )
-{
-  if ( e->type() == SALOME_EVENT )
-  { 
-    SALOME_Event* aSE = (SALOME_Event*)((QCustomEvent*)e)->data();
-    processEvent(aSE);
-    ((QCustomEvent*)e)->setData( 0 );
-    return true;
-  }
-  return QObject::eventFilter( o, e );
-}
-
-/*!Process event.*/
-void SalomeApp_EventFilter::processEvent( SALOME_Event* theEvent )
-{
-  if(theEvent){
-    theEvent->Execute();
-    // Signal the calling thread that the event has been processed
-    theEvent->processed();
-  }
-}
-
-/*!Create new instance of SalomeApp_EventFilter*/
-void SalomeApp_EventFilter::Init()
-{
-  if( myFilter==NULL )
-    myFilter = new SalomeApp_EventFilter();
-}
-
-/*!Destroy filter.*/
-void SalomeApp_EventFilter::Destroy()
-{
-  if( myFilter )
-  {
-    delete myFilter;
-    myFilter = NULL;
-  }
-}
diff --git a/src/SalomeApp/SalomeApp_EventFilter.h b/src/SalomeApp/SalomeApp_EventFilter.h
deleted file mode 100755 (executable)
index e8849e2..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef SALOMEAPP_EVENTFILTER_H
-#define SALOMEAPP_EVENTFILTER_H
-
-#include "SalomeApp.h"
-#include <qobject.h>
-
-#if defined WNT
-#pragma warning( disable: 4251 )
-#endif
-
-class SALOME_Event;
-
-/*!
-  Class provide event filter.
-*/
-class SALOMEAPP_EXPORT SalomeApp_EventFilter: public QObject 
-{
-public:
-  static void Init();
-  static void Destroy();
-
-protected:
-  SalomeApp_EventFilter();
-  virtual ~SalomeApp_EventFilter();
-
-private:
-  /*! global event filter for qapplication */
-  virtual bool eventFilter( QObject* o, QEvent* e );
-  void processEvent( SALOME_Event* );
-
-private:
-  static SalomeApp_EventFilter* myFilter;
-};
-
-#if defined WNT
-#pragma warning( default: 4251 )
-#endif
-
-#endif
index dc6436411dcc5c7b6817b8aec22e42de9636a4e2..01240d878b6fd850514a36f0a56f0e4465991898 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SalomeApp_ExceptionHandler.h"
 #include "CASCatch.hxx"
@@ -24,7 +27,7 @@
 #include <stdexcept>
 #include <exception>
 
-#include <qstring.h>
+#include <QString>
 
 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
   #include <Standard_ErrorHandler.hxx>
@@ -87,7 +90,7 @@ bool SalomeApp_ExceptionHandler::handle( QObject* o, QEvent* e )
   {
     showMessage( title, QString( e.GetMessageString() ) );
   }
-#ifndef WNT
+#ifndef WIN32
   catch(...)
   {
     showMessage( title, "Unknown Exception" );
@@ -98,7 +101,6 @@ bool SalomeApp_ExceptionHandler::handle( QObject* o, QEvent* e )
 }
 
 /*!Create new SUIT_ExceptionHandler*/
-
 extern "C" SALOMEAPP_EXPORT SUIT_ExceptionHandler* getExceptionHandler()
 {
   // MSV 2006-04-26: work around PAL12004 "VTK window => SIGFPE Arithmetic Exception Detected"
index 4a4c0bdab0adc5cfc75a409692f4975fed8b733d..64a26afbe6be8f69a7309431482e6141ab8ba21a 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SALOMEAPP_EXCEPTIONHANDLER_H
 #define SALOMEAPP_EXCEPTIONHANDLER_H
index f01d581c9176e19610aa4f83258abbfd9d0ec38e..a1f15d93680f34eb6f866945dc5df9a6e86da5aa 100644 (file)
@@ -1,32 +1,36 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      SalomeApp_ExitDlg.cxx
 // Author:    Margarita KARPUNINA, Open CASCADE S.A.S.
 //
-
 #include "SalomeApp_ExitDlg.h"
 
-#include <qlabel.h> 
-#include <qlayout.h> 
-#include <qpushbutton.h>
-#include <qmessagebox.h>
-#include <qcheckbox.h>
+#include <QLabel> 
+#include <QVBoxLayout> 
+#include <QHBoxLayout> 
+#include <QGridLayout> 
+#include <QPushButton>
+#include <QMessageBox>
+#include <QCheckBox>
 
 /*!
  * \brief creates a Exit dialog box
  * \param f style flags
  */
 SalomeApp_ExitDlg::SalomeApp_ExitDlg( QWidget* parent )
-  : QDialog( parent, "SalomeApp_ExitDlg", true )
+  : QDialog( parent )
 {
-  setSizeGripEnabled( true );
-  setCaption( tr( "INF_DESK_EXIT" ) );
+  setModal( true );
+  setWindowTitle( tr( "INF_DESK_EXIT" ) );
 
   QVBoxLayout* m_vbL = new QVBoxLayout( this );
   m_vbL->setMargin( 11 );
   m_vbL->setSpacing( 6 );
 
-  QLabel* m_lIcon = new QLabel( this, "m_lDescr" );
+  QLabel* m_lIcon = new QLabel( this );
   QPixmap pm = QMessageBox::standardIcon( QMessageBox::Question );
   m_lIcon->setPixmap( pm );
   m_lIcon->setScaledContents( false );
   m_lIcon->setAlignment( Qt::AlignCenter );
 
-  QLabel* m_lDescr = new QLabel (this, "m_lDescr");
-  m_lDescr->setText ( tr ("QUE_DESK_EXIT") );
+  QLabel* m_lDescr = new QLabel( this );
+  m_lDescr->setText( tr( "QUE_DESK_EXIT" ) );
   m_lDescr->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
 
-  myServersShutdown = new QCheckBox( tr("SHUTDOWN_SERVERS"), this );
-  myServersShutdown->setChecked(true);
+  myServersShutdown = new QCheckBox( tr( "SHUTDOWN_SERVERS" ), this );
+  myServersShutdown->setChecked( true );
   
   QVBoxLayout* m_vl1 = new QVBoxLayout();
   m_vl1->setMargin( 10 ); m_vl1->setSpacing( 16 );
@@ -75,7 +79,7 @@ SalomeApp_ExitDlg::SalomeApp_ExitDlg( QWidget* parent )
   QGridLayout* m_hl2 = new QGridLayout();
   m_hl2->setMargin( 0 ); m_hl2->setSpacing( 6 );
   m_hl2->addWidget( m_pbOk, 0, 0 );
-  m_hl2->setColStretch( 1, 5 );
+  m_hl2->setColumnStretch( 1, 5 );
   m_hl2->addWidget( m_pbCancel, 0, 2 );
   
   m_vbL->addStretch();
index e046291e10b5c28a93fc2eb0664cf468f3d717c8..3398864847a8b6c3dde6b72335243ae12ffb3177 100644 (file)
@@ -1,29 +1,31 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      SalomeApp_ExitDlg.h
 // Author:    Margarita KARPUNINA, Open CASCADE S.A.S.
 //
-
 #ifndef SALOMEAPP_EXITDLG_H
 #define SALOMEAPP_EXITDLG_H
 
-#include <qdialog.h
+#include <QDialog
 
 class QCheckBox;
 
index b3214ba00d8bc02635b421ea0c334d8b852931c6..ac614dadae6552765e9eabb6f0a0a8c211d20072 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SalomeApp_Filter.h"
 
index 8de24ccdd1664534cd49a9118d2deaed8c1af7f9..3a1d988780775bc4a2619d9ce3a3f8472de61e98 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SALOMEAPP_FILTER_H
 #define SALOMEAPP_FILTER_H
index 5d19bf6f0b9e6aabe97513d29af2cc04f085af69..eb1b51680587af7ebc91c4dc13494d4976488eb1 100644 (file)
@@ -1,35 +1,34 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOMEGUI_ImportOperation.cxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SalomeApp_ImportOperation.h"
 #include <SUIT_Application.h>
 
-#ifndef WNT
+#ifndef WIN32
 using namespace std;
 #endif
 
index 56b89558403d594826a8e8edfc1a45d0e098c7fe..337aa9a8306348b30bdd875fcf56f0ae73b400da 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME SALOMEAPP : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEAPP : implementation of desktop and GUI kernel
 //  File   : SalomeApp_ImportOperation.h
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #if !defined SALOMEAPP_IMPORTOPERATION
 #define SALOMEAPP_IMPORTOPERATION
 
diff --git a/src/SalomeApp/SalomeApp_IntSpinBox.cxx b/src/SalomeApp/SalomeApp_IntSpinBox.cxx
new file mode 100644 (file)
index 0000000..4d3460a
--- /dev/null
@@ -0,0 +1,310 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      SalomeApp_IntSpinBox.cxx
+// Author:    Oleg UVAROV
+
+#include "SalomeApp_IntSpinBox.h"
+#include "SalomeApp_Application.h"
+#include "SalomeApp_Study.h"
+
+#include <SUIT_Session.h>
+
+#include "SALOMEDSClient_ClientFactory.hxx" 
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+#include <QKeyEvent>
+#include <QLineEdit>
+
+/*!
+  \class SalomeApp_IntSpinBox
+*/
+
+/*!
+  \brief Constructor.
+
+  Constructs a spin box with 0 as minimum value and 99 as maximum value,
+  a step value of 1. The value is initially set to 0.
+
+  \param parent parent object
+*/
+SalomeApp_IntSpinBox::SalomeApp_IntSpinBox( QWidget* parent )
+: QtxIntSpinBox( parent ),
+  myDefaultValue( 0 )
+{
+  connectSignalsAndSlots();
+}
+
+/*!
+  \brief Constructor.
+
+  Constructs a spin box with specified minimum, maximum and step value.
+  The value is initially set to the minimum value.
+
+  \param min spin box minimum possible value
+  \param max spin box maximum possible value
+  \param step spin box increment/decrement value
+  \param parent parent object
+*/
+SalomeApp_IntSpinBox::SalomeApp_IntSpinBox( int min, int max, int step, QWidget* parent )
+: QtxIntSpinBox( min, max, step, parent ),
+  myDefaultValue( 0 )
+{
+  connectSignalsAndSlots();
+}
+
+/*!
+  \brief Destructor.
+*/
+SalomeApp_IntSpinBox::~SalomeApp_IntSpinBox()
+{
+}
+
+/*!
+  \brief Connect signals and slots.
+*/
+void SalomeApp_IntSpinBox::connectSignalsAndSlots()
+{
+  connect( this, SIGNAL( editingFinished() ),
+          this, SLOT( onEditingFinished() ) );
+
+  connect( this, SIGNAL( valueChanged( const QString& ) ),
+          this, SLOT( onTextChanged( const QString& ) ) );
+
+  connect( lineEdit(), SIGNAL( textChanged( const QString& ) ),
+          this, SLOT( onTextChanged( const QString& ) ) );
+
+  connect( lineEdit(), SIGNAL( textChanged( const QString& )),
+          this, SIGNAL( textChanged( const QString& ) ) );
+}
+
+/*!
+  \brief This function is called when editing is finished.
+*/
+void SalomeApp_IntSpinBox::onEditingFinished()
+{
+  if( myTextValue.isNull() )
+    myTextValue = text();
+
+  setText( myTextValue );
+}
+
+/*!
+  \brief This function is called when value is changed.
+*/
+void SalomeApp_IntSpinBox::onTextChanged( const QString& text )
+{
+  myTextValue = text;
+
+  int value = 0;
+  if( isValid( text, value ) == Acceptable )
+    myCorrectValue = text;
+}
+
+/*!
+  \brief Interpret text entered by the user as a value.
+  \param text text entered by the user
+  \return mapped value
+  \sa textFromValue()
+*/
+int SalomeApp_IntSpinBox::valueFromText( const QString& text ) const
+{
+  int value = 0;
+  if( isValid( text, value ) == Acceptable )
+    return value;
+
+  return defaultValue();
+}
+
+/*!
+  \brief This function is used by the spin box whenever it needs to display
+  the given value.
+
+  \param val spin box value
+  \return text representation of the value
+  \sa valueFromText()
+*/
+QString SalomeApp_IntSpinBox::textFromValue( int val ) const
+{
+  return QtxIntSpinBox::textFromValue( val );
+}
+
+/*!
+  \brief This function is used to determine whether input is valid.
+  \param str currently entered value
+  \param pos cursor position in the string
+  \return validating operation result
+*/
+QValidator::State SalomeApp_IntSpinBox::validate( QString& str, int& pos ) const
+{
+  return QValidator::Acceptable;
+}
+
+/*!
+  \brief This function is used to determine whether input is valid.
+  \return validating operation result
+*/
+bool SalomeApp_IntSpinBox::isValid( QString& msg, bool toCorrect )
+{
+  int value;
+  State aState = isValid( text(), value );
+
+  if( aState != Acceptable )
+  {
+    if( toCorrect )
+    {
+      if( aState == Incompatible )
+       msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n";
+      else if( aState == NoVariable )
+       msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n";
+      else if( aState == Invalid )
+       msg += tr( "ERR_INVALID_VALUE" ) + "\n";
+
+      setText( myCorrectValue );
+    }
+    return false;
+  }
+
+  return true;
+}
+
+/*!
+  \brief This function is used to set a default value for this spinbox.
+  \param value default value
+*/
+void SalomeApp_IntSpinBox::setDefaultValue( const int value )
+{
+  myDefaultValue = value;
+}
+
+/*!
+  \brief This function is used to set a current value for this spinbox.
+  \param value current value
+*/
+void SalomeApp_IntSpinBox::setValue( const int value )
+{
+  QtxIntSpinBox::setValue( value );
+
+  myCorrectValue = QString::number( value );
+  myTextValue = myCorrectValue;
+}
+
+/*!
+  \brief This function is used to set a text for this spinbox.
+  \param value current value
+*/
+void SalomeApp_IntSpinBox::setText( const QString& value )
+{
+  lineEdit()->setText(value);
+}
+
+/*!
+  \brief This function is used to determine whether input is valid.
+  \return validating operation result
+*/
+SalomeApp_IntSpinBox::State SalomeApp_IntSpinBox::isValid( const QString& text, int& value ) const
+{
+  SearchState aSearchState = findVariable( text, value );
+  if( aSearchState == NotFound )
+  {
+    bool ok = false;
+    value = text.toInt( &ok );
+    if( !ok )
+    {
+      text.toDouble( &ok );
+      if( ok )
+       return Invalid;
+      return NoVariable;
+    }
+  }
+  else if( aSearchState == IncorrectType )
+    return Incompatible;
+
+  if( !checkRange( value ) )
+    return Invalid;
+
+  return Acceptable;
+}
+
+/*!
+  \brief This function return a default acceptable value (commonly, 0).
+  \return default acceptable value
+*/
+int SalomeApp_IntSpinBox::defaultValue() const
+{
+  if( minimum() > myDefaultValue || maximum() < myDefaultValue )
+    return minimum();
+
+  return myDefaultValue;
+}
+
+/*!
+  \brief This function is used to check that string value lies within predefined range.
+  \return check status
+*/
+bool SalomeApp_IntSpinBox::checkRange( const int value ) const
+{
+  return value >= minimum() && value <= maximum();
+}
+
+/*!
+  \brief This function is used to determine whether input is a variable name and to get its value.
+  \return status of search operation
+*/
+SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable( const QString& name, int& value ) const
+{
+  value = 0;
+  if( SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() ) )
+  {
+    if( SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) )
+    {
+      _PTR(Study) studyDS = study->studyDS();
+
+      std::string aName = name.toStdString();
+      if( studyDS->IsVariable( aName ) )
+      {
+       if( studyDS->IsInteger( aName ) )
+       {
+         value = studyDS->GetInteger( aName );
+         return Found;
+       }
+       return IncorrectType;
+      }
+    }
+  }
+  return NotFound;
+}
+
+/*!
+  \brief This function is called when the spinbox recieves key press event.
+*/
+void SalomeApp_IntSpinBox::keyPressEvent( QKeyEvent* e )
+{
+  if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter )
+    QWidget::keyPressEvent( e );
+  else
+    QtxIntSpinBox::keyPressEvent( e );
+}
+
+/*!
+  \brief This function is called when the spinbox recieves show event.
+*/
+void SalomeApp_IntSpinBox::showEvent( QShowEvent* )
+{
+  setText( myTextValue );
+}
diff --git a/src/SalomeApp/SalomeApp_IntSpinBox.h b/src/SalomeApp/SalomeApp_IntSpinBox.h
new file mode 100644 (file)
index 0000000..d15fe99
--- /dev/null
@@ -0,0 +1,85 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:      SalomeApp_IntSpinBox.h
+// Author:    Oleg UVAROV
+
+#ifndef SALOMEAPP_INTSPINBOX_H
+#define SALOMEAPP_INTSPINBOX_H
+
+#include "SalomeApp.h"
+
+#include <QtxIntSpinBox.h>
+
+#include <QValidator>
+
+class SALOMEAPP_EXPORT SalomeApp_IntSpinBox : public QtxIntSpinBox
+{
+  Q_OBJECT
+
+  enum State { Invalid = 0, NoVariable, Incompatible, Acceptable };
+  enum SearchState { NotFound = 0, IncorrectType, Found };
+
+public:
+  SalomeApp_IntSpinBox( QWidget* = 0 );
+  SalomeApp_IntSpinBox( int, int, int = 1, QWidget* = 0 );
+  virtual ~SalomeApp_IntSpinBox();
+
+  virtual int               valueFromText( const QString& ) const;
+  virtual QString           textFromValue( int ) const;
+
+  virtual QValidator::State validate( QString&, int& ) const;
+
+  virtual bool              isValid( QString& msg, bool = false );
+
+  virtual void              setDefaultValue( const int );
+
+  virtual void              setValue( int );
+
+  virtual void              setText(const QString& );
+
+signals:
+  void                      textChanged( const QString& );
+
+protected:
+  State                     isValid( const QString&, int& ) const;
+
+  int                       defaultValue() const;
+  bool                      checkRange( const int ) const;
+
+  SearchState               findVariable( const QString&, int& ) const;
+
+protected:
+  virtual void              keyPressEvent( QKeyEvent* );
+  virtual void              showEvent( QShowEvent* );
+
+protected slots:
+  void                      onEditingFinished();
+  void                      onTextChanged( const QString& );
+
+private:
+  void                      connectSignalsAndSlots();
+
+private:
+  int                       myDefaultValue; 
+
+  QString                   myCorrectValue;
+  QString                   myTextValue;
+};
+
+#endif
index e2c354eaaf6b177e29b81b400794ba6d07906fe7..b86831fa17bc7f33f48d6b993d3ed6e171292416 100644 (file)
@@ -1,46 +1,45 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  SALOME SalomeApp
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SalomeApp_ListView.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : SalomeApp_ListView.cxx
-//  Author : Vadim SANDLER
-//  Module : SALOME
-//  $Header$
-
 #include "SalomeApp_ListView.h"
 #include "SalomeApp_Application.h"
 
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_Session.h"
 
-#include <qheader.h>
-#include <qvalidator.h>
-#include <qapplication.h>
-#include <qtoolbutton.h>
+#include <QValidator>
+#include <QToolButton>
+#include <QPixmap>
+#include <QHeaderView>
+#include <QKeyEvent>
+
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_ListOfReal.hxx>
 
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <TColStd_ListIteratorOfListOfReal.hxx>
 
-#include "utilities.h"
-
-using namespace std;
-
 /*!
   Used for resizing editing widget
 */
@@ -49,19 +48,19 @@ void computeEditGeometry(SalomeApp_ListViewItem* theItem,
 {
   if (!theItem)
     return;
-  QListView* aListView = theItem->listView();
+  QTreeWidget* aListView = theItem->treeWidget();
   int anEditColumn = theItem->getEditedColumn();
   if (anEditColumn < 0)
     return;
 
   int aX = 0, aY = 0, aW = 0, aH = 0;
 
-  QRect aRect = aListView->itemRect(theItem);
-  aListView->contentsToViewport(aListView->header()->sectionPos(anEditColumn), 0, aX, aY);
+  QRect aRect = aListView->visualItemRect(theItem);
+  aX = aListView->header()->sectionViewportPosition(anEditColumn);
   if (aX < 0)
     aX = 0; // THIS CAN BE REMOVED
   QSize aSize = theWidget->getControl()->sizeHint();
-  aH = QMAX(aSize.height() , aRect.height() );
+  aH = qMax(aSize.height() , aRect.height() );
   aY = aRect.y() - ((aH - aRect.height()) / 2);
   //aW = aListView->columnWidth(anEditColumn); // CAN SUBSTITUTE NEXT 3 ROWS
   aW = aListView->viewport()->width() - aX;
@@ -74,23 +73,22 @@ void computeEditGeometry(SalomeApp_ListViewItem* theItem,
   Constructor
 */
 SalomeApp_ListView::SalomeApp_ListView( QWidget* parent )
-: QtxListView( parent )
+  : QTreeWidget/*QtxListView*/( parent )
 {
   myMouseEnabled = true;
   myEditingEnabled = false;
-  setSelectionMode(Single);
-  setSorting(-1);
+  setSelectionMode(QAbstractItemView::SingleSelection);
   setRootIsDecorated(false);
   setAllColumnsShowFocus(false);
 //  header()->setClickEnabled(false);
-  header()->setMovingEnabled(false);
+  header()->setMovable(false);
 
   myEditedItem = 0;
   myEdit = 0;
 
   viewport()->installEventFilter(this);
 
-  connect(this, SIGNAL(selectionChanged()),
+  connect(this, SIGNAL(itemSelectionChanged()),
          this, SLOT(onSelectionChanged()));
   connect(header(), SIGNAL(sizeChange(int, int, int)),
          this,     SLOT(onHeaderSizeChange(int, int, int)));
@@ -115,13 +113,14 @@ void SalomeApp_ListView::updateViewer()
 {
   // temporary disconnecting selection changed SIGNAL
   blockSignals(true);
-  SalomeApp_ListViewItem* aRoot = (SalomeApp_ListViewItem*)firstChild();
+  QTreeWidgetItemIterator it( this );
+  SalomeApp_ListViewItem* aRoot = (SalomeApp_ListViewItem*)(*it);
   if (aRoot)
     aRoot->updateAllLevels();
-  updateContents();
+  update( contentsRect() );//updateContents();
   // connecting again selection changed SIGNAL
   blockSignals(false);
-  emit selectionChanged();
+  emit itemSelectionChanged();
 }
 
 /*!
@@ -131,13 +130,13 @@ void SalomeApp_ListView::updateSelected()
 {
   // temporary disconnecting selection changed SIGNAL
   blockSignals(true);
-  SalomeApp_ListViewItem* aChild = (SalomeApp_ListViewItem*)selectedItem();
+  SalomeApp_ListViewItem* aChild = (SalomeApp_ListViewItem*)(selectedItems().first());
   if (aChild)
     aChild->updateAllLevels();
-  updateContents();
+  update( contentsRect() );//updateContents();
   // connecting again selection changed SIGNAL
   blockSignals(false);
-  emit selectionChanged();
+  emit itemSelectionChanged();
 }
 
 /*!
@@ -151,7 +150,7 @@ QString SalomeApp_ListView::popupClientType() const
 /*!
   Fills popup menu with items
 */
-void SalomeApp_ListView::contextMenuPopup( QPopupMenu* aPopup )
+void SalomeApp_ListView::contextMenuPopup( QMenu* aPopup )
 {
   if (aPopup) {
     // add items here...
@@ -168,7 +167,7 @@ void SalomeApp_ListView::clear()
     myEdit = 0;
     myEditedItem = 0;
   }
-  QListView::clear();
+  QTreeWidget::clear();
 }
 
 /*!
@@ -199,7 +198,7 @@ bool SalomeApp_ListView::eventFilter(QObject* object, QEvent* event)
       !isMouseEnabled())
     return true;
   else
-    return QListView::eventFilter(object, event);
+    return QTreeWidget::eventFilter(object, event);
 }
 
 /*!
@@ -244,14 +243,14 @@ void SalomeApp_ListView::onSelectionChanged()
     myEdit = 0;
     if (myEditedItem && !myEditedItem->isAccepted()) {
       delete myEditedItem;
-      updateContents();
+      update( contentsRect() );//updateContents();
     }
     myEditedItem = 0;
   }
   // editing is allowed in Single Selection Mode only
-  if (selectionMode() != Single || !isEnableEditing())
+  if (selectionMode() != QAbstractItemView::SingleSelection || !isEnableEditing())
     return;
-  SalomeApp_ListViewItem* anItem = (SalomeApp_ListViewItem*)selectedItem();
+  SalomeApp_ListViewItem* anItem = (SalomeApp_ListViewItem*)(selectedItems().first());
   if (anItem) {
     if (!anItem->isEditable())
       return;
@@ -271,12 +270,12 @@ void SalomeApp_ListView::onSelectionChanged()
 */
 void SalomeApp_ListView::resizeEvent( QResizeEvent * e)
 {
-  QListView::resizeEvent(e);
-  int aW = columnWidth(columns()-1);
-  int aX = header()->sectionPos(columns()-1);
+  QTreeWidget::resizeEvent(e);
+  int aW = columnWidth(columnCount()-1);
+  int aX = header()->sectionPosition(columnCount()-1);
   if (aW < width() - frameWidth() * 2 - aX - 1)
-    setColumnWidth(columns()-1, width() - frameWidth() * 2 - aX - 1);
-  updateContents();
+    setColumnWidth(columnCount()-1, width() - frameWidth() * 2 - aX - 1);
+  update( contentsRect() );//updateContents();
 }
 
 /*!
@@ -284,10 +283,10 @@ void SalomeApp_ListView::resizeEvent( QResizeEvent * e)
 */
 void SalomeApp_ListView::onHeaderSizeChange(int, int, int)
 {
-  int aW = columnWidth(columns()-1);
-  int aX = header()->sectionPos(columns()-1);
+  int aW = columnWidth(columnCount()-1);
+  int aX = header()->sectionPosition(columnCount()-1);
   if (aW < width() - frameWidth() * 2 - aX - 1)
-    setColumnWidth(columns()-1, width() - frameWidth() * 2 - aX - 1);
+    setColumnWidth(columnCount()-1, width() - frameWidth() * 2 - aX - 1);
 }
 
 /*!
@@ -295,7 +294,7 @@ void SalomeApp_ListView::onHeaderSizeChange(int, int, int)
 */
 void SalomeApp_ListView::viewportPaintEvent(QPaintEvent* e)
 {
-  QListView::viewportPaintEvent(e);
+  QTreeWidget::paintEvent(e);
   if (myEditedItem && myEdit) {
     computeEditGeometry(myEditedItem, myEdit);
   }
@@ -386,14 +385,14 @@ UpdateType SalomeApp_ListView::finishEditing(bool ok)
   \retval valid rect in success
 */
 QRect SalomeApp_ListView::tip(QPoint aPos,
-                       QString& aText,
-                       QRect& dspRect,
-                       QFont& dspFnt) const
+                             QString& aText,
+                             QRect& dspRect,
+                             QFont& dspFnt) const
 {
   QRect result( -1, -1, -1, -1 );
   SalomeApp_ListViewItem* aItem = (SalomeApp_ListViewItem*)itemAt( aPos );
   if ( aItem ) {
-    for (int i = 0; i < columns(); i++) {
+    for (int i = 0; i < columnCount(); i++) {
       QRect aItemRect = aItem->itemRect(i);
       QRect aTextRect = aItem->textRect(i);
       if ( !aItem->text(i).isEmpty() &&
@@ -420,17 +419,7 @@ QRect SalomeApp_ListView::tip(QPoint aPos,
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent) :
-QListViewItem( parent )
-{
-  init();
-}
-
-/*!
-  Constructor
-*/
-SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView*     parent,
-                                  SalomeApp_ListViewItem* after) :
-QListViewItem( parent, after )
+QTreeWidgetItem( parent )
 {
   init();
 }
@@ -439,22 +428,19 @@ QListViewItem( parent, after )
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView*     parent,
-                                  const QString&    theName,
-                                  const bool        theEditable) :
-QListViewItem(parent, theName)
+                                              SalomeApp_ListViewItem* after) :
+QTreeWidgetItem( parent, after )
 {
   init();
-  setEditable(theEditable);
 }
 
 /*!
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView*     parent,
-                                  const QString&    theName,
-                                  const QString&    theValue,
-                                  const bool        theEditable) :
-QListViewItem(parent, theName, theValue)
+                                              const QStringList&    theStrings,
+                                              const bool        theEditable) :
+QTreeWidgetItem(parent, theStrings)
 {
   init();
   setEditable(theEditable);
@@ -464,9 +450,9 @@ QListViewItem(parent, theName, theValue)
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent,
-                                  const QString&    theName,
-                                  const bool        theEditable) :
-QListViewItem(parent, theName)
+                                              const QStringList&    theString,
+                                              const bool        theEditable) :
+QTreeWidgetItem(parent, theString)
 {
   init();
   setEditable(theEditable);
@@ -476,11 +462,12 @@ QListViewItem(parent, theName)
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent,
-                                  SalomeApp_ListViewItem* after,
-                                  const QString&    theName,
-                                  const bool        theEditable) :
-QListViewItem(parent, after, theName)
+                                              SalomeApp_ListViewItem* after,
+                                              const QString&    theName,
+                                              const bool        theEditable) :
+QTreeWidgetItem(parent, after)
 {
+  setData(0,Qt::DisplayRole,QVariant(theName));
   init();
   setEditable(theEditable);
 }
@@ -489,40 +476,28 @@ QListViewItem(parent, after, theName)
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView*     parent,
-                                  SalomeApp_ListViewItem* after,
-                                  const QString&    theName,
-                                  const bool        theEditable) :
-QListViewItem(parent, after, theName)
-{
-  init();
-  setEditable(theEditable);
-}
-
-
-/*!
-  Constructor
-*/
-SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent,
-                                  const QString&    theName,
-                                  const QString&    theValue,
-                                  const bool        theEditable) :
-QListViewItem(parent, theName, theValue)
+                                              SalomeApp_ListViewItem* after,
+                                              const QString&    theName,
+                                              const bool        theEditable) :
+QTreeWidgetItem(parent, after)
 {
+  setData(0,Qt::DisplayRole,QVariant(theName));
   init();
   setEditable(theEditable);
 }
 
-
 /*!
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent,
-                                  SalomeApp_ListViewItem* after,
-                                  const QString&    theName,
-                                  const QString&    theValue,
-                                  const bool        theEditable) :
-QListViewItem(parent, after, theName, theValue)
-{
+                                              SalomeApp_ListViewItem* after,
+                                              const QString&    theName,
+                                              const QString&    theValue,
+                                              const bool        theEditable) :
+QTreeWidgetItem(parent, after)
+{
+  setData(0,Qt::DisplayRole,QVariant(theName));
+  setData(1,Qt::DisplayRole,QVariant(theValue));
   init();
   setEditable(theEditable);
 }
@@ -531,12 +506,14 @@ QListViewItem(parent, after, theName, theValue)
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView*     parent,
-                                  SalomeApp_ListViewItem* after,
-                                  const QString&    theName,
-                                  const QString&    theValue,
-                                  const bool        theEditable) :
-QListViewItem(parent, after, theName, theValue)
-{
+                                              SalomeApp_ListViewItem* after,
+                                              const QString&    theName,
+                                              const QString&    theValue,
+                                              const bool        theEditable) :
+QTreeWidgetItem(parent, after)
+{
+  setData(0,Qt::DisplayRole,QVariant(theName));
+  setData(1,Qt::DisplayRole,QVariant(theValue));
   init();
   setEditable(theEditable);
 }
@@ -561,12 +538,26 @@ void SalomeApp_ListViewItem::init()
   myUserType    = -1;
 }
 
+/*!
+  Returns the depth of this item
+*/
+int SalomeApp_ListViewItem::depth() const
+{
+  int aDepth = 0;
+  QTreeWidgetItem* aParent = parent();
+  while ( aParent ) {
+    aParent = aParent->parent();
+    aDepth++;
+  }
+  return aDepth;
+}
+
 /*!
   \return text in the first column
 */
 QString SalomeApp_ListViewItem::getName() const
 {
-  return ( listView()->columns() > 0 ) ? text(0) : QString("");
+  return ( treeWidget()->columnCount() > 0 ) ? text(0) : QString("");
 }
 
 /*!
@@ -575,7 +566,7 @@ QString SalomeApp_ListViewItem::getName() const
 UpdateType SalomeApp_ListViewItem::setName(const QString& theName)
 {
   UpdateType aNeedsUpdate = utCancel;
-  if (listView()->columns() > 0) {
+  if (treeWidget()->columnCount() > 0) {
     setText(0, theName);
     aNeedsUpdate = utNone;
   }
@@ -587,7 +578,7 @@ UpdateType SalomeApp_ListViewItem::setName(const QString& theName)
 */
 QString SalomeApp_ListViewItem::getValue() const
 {
-  return ( listView()->columns() > 1 ) ? text(1) : QString("");
+  return ( treeWidget()->columnCount() > 1 ) ? text(1) : QString("");
 }
 
 /*!
@@ -596,7 +587,7 @@ QString SalomeApp_ListViewItem::getValue() const
 UpdateType SalomeApp_ListViewItem::setValue(const QString& theValue)
 {
   UpdateType aNeedsUpdate = utCancel;
-  if (listView()->columns() > 1) {
+  if (treeWidget()->columnCount() > 1) {
     setText(1, theValue);
     aNeedsUpdate = utNone;
   }
@@ -622,11 +613,13 @@ QString SalomeApp_ListViewItem::fullName()
 */
 void SalomeApp_ListViewItem::openAllLevels()
 {
-  setOpen(true);
-  SalomeApp_ListViewItem* aChild = (SalomeApp_ListViewItem*)firstChild();
+  setExpanded(true);
+  QTreeWidgetItemIterator it( this );
+  SalomeApp_ListViewItem* aChild = (SalomeApp_ListViewItem*)(*it);
   while( aChild ) {
     aChild->openAllLevels();
-    aChild = (SalomeApp_ListViewItem*)(aChild->nextSibling());
+    ++it;
+    aChild = (SalomeApp_ListViewItem*)(*it);
   }
 }
 
@@ -635,10 +628,12 @@ void SalomeApp_ListViewItem::openAllLevels()
 */
 void SalomeApp_ListViewItem::updateAllLevels()
 {
-  SalomeApp_ListViewItem* aChild = (SalomeApp_ListViewItem*)firstChild();
+  QTreeWidgetItemIterator it( this );
+  SalomeApp_ListViewItem* aChild = (SalomeApp_ListViewItem*)(*it);
   while( aChild ) {
     aChild->updateAllLevels();
-    aChild = (SalomeApp_ListViewItem*)(aChild->nextSibling());
+    ++it;
+    aChild = (SalomeApp_ListViewItem*)(*it);
   }
 }
 
@@ -701,7 +696,7 @@ void SalomeApp_ListViewItem::setEditingType(const int type)
 */
 int SalomeApp_ListViewItem::getEditedColumn()
 {
-  return listView()->columns()-1;
+  return treeWidget()->columnCount()-1;
 }
 
 /*!
@@ -760,7 +755,7 @@ void SalomeApp_ListViewItem::setButtons(const int buttons)
 SalomeApp_EntityEdit* SalomeApp_ListViewItem::startEditing()
 {
   SalomeApp_EntityEdit* aWidget = 0;
-  QListView* aListView = listView();
+  QTreeWidget* aListView = treeWidget();
   if (aListView) {
     if (!isEditable())
       return 0;
@@ -825,14 +820,14 @@ UpdateType SalomeApp_ListViewItem::finishEditing(SalomeApp_EntityEdit* theWidget
 QRect SalomeApp_ListViewItem::tipRect()
 {
   QRect aRect = QRect(-1, -1, -1, -1);
-  QRect aItemRect = listView()->itemRect(this);
+  QRect aItemRect = treeWidget()->visualItemRect(this);
   if ( !aItemRect.isValid() )
     return aItemRect;
 
   QString aTip = tipText();
   if (!aTip.isEmpty()) {
     QRect aRect0 = textRect(0);
-    QFont aFont(listView()->font());
+    QFont aFont(treeWidget()->font());
     QFontMetrics fm(aFont);
     int iw = fm.width(aTip);
     aRect = QRect(QPoint(aRect0.x() < 0 ? 0 : aRect0.x(),
@@ -859,33 +854,33 @@ QString SalomeApp_ListViewItem::tipText()
 */
 QRect SalomeApp_ListViewItem::textRect(const int column) const
 {
-  QRect aItemRect = listView()->itemRect( this );
+  QRect aItemRect = treeWidget()->visualItemRect( this );
   if ( !aItemRect.isValid() )
     return aItemRect;
 
-  QFont aFont(listView()->font());
+  QFont aFont(treeWidget()->font());
   QFontMetrics fm(aFont);
 
-  int decorWidth  = ( listView()->rootIsDecorated() ) ?
-                    ( listView()->treeStepSize() * (depth() + 1) ) :
-                    ( listView()->treeStepSize() *  depth() );
-  int pixmapWidth = ( pixmap(column) ) ?
-                      pixmap(column)->width() +  listView()->itemMargin() * 2 :
-                      listView()->itemMargin();
+  int decorWidth  = ( treeWidget()->rootIsDecorated() ) ?
+                    ( treeWidget()->indentation() * (depth() + 1) ) :
+                    ( treeWidget()->indentation() *  depth() );
+  int pixmapWidth = ( !icon(column).isNull() ) ?
+                      treeWidget()->iconSize().width() + 2 :
+                      1;
   int prevWidth = 0;
   for (int i = 0; i < column; i++)
-    prevWidth += listView()->header()->sectionSize(i);
+    prevWidth += treeWidget()->header()->sectionSize(i);
   int ix = prevWidth   +
            pixmapWidth +
            ((column == 0) ? decorWidth : 0);
   int iy = aItemRect.y();
   int iw = fm.width(text(column));
   int ih = aItemRect.height();
-  if (pixmap(column)) {
-    iy += listView()->itemMargin();
-    ih -= listView()->itemMargin() * 2;
+  if (!icon(column).isNull()) {
+    iy += 1;
+    ih -= 2;
   }
-  ix -= listView()->contentsX();
+  ix -= treeWidget()->contentsRect().left();
 
   QRect theResult(QPoint(ix, iy), QSize(iw, ih));
   return theResult;
@@ -896,30 +891,30 @@ QRect SalomeApp_ListViewItem::textRect(const int column) const
 */
 QRect SalomeApp_ListViewItem::itemRect(const int column) const
 {
-  QRect aItemRect = listView()->itemRect( this );
+  QRect aItemRect = treeWidget()->visualItemRect( this );
   if ( !aItemRect.isValid() )
     return aItemRect;
 
-  QFont aFont(listView()->font());
+  QFont aFont(treeWidget()->font());
   QFontMetrics fm(aFont);
 
-  int decorWidth  = ( listView()->rootIsDecorated() ) ?
-                    ( listView()->treeStepSize() * (depth() + 1) ) :
-                    ( listView()->treeStepSize() *  depth() );
-  int pixmapWidth = ( pixmap(column) ) ?
-                      pixmap(column)->width() +  listView()->itemMargin() * 2 :
+  int decorWidth  = ( treeWidget()->rootIsDecorated() ) ?
+                    ( treeWidget()->indentation() * (depth() + 1) ) :
+                    ( treeWidget()->indentation() *  depth() );
+  int pixmapWidth = ( !icon(column).isNull() ) ?
+                      treeWidget()->iconSize().width() + 2 :
                       0;
   int prevWidth = 0;
   for (int i = 0; i < column; i++)
-    prevWidth += listView()->header()->sectionSize(i);
+    prevWidth += treeWidget()->header()->sectionSize(i);
   int ix = prevWidth;
   int iy = aItemRect.y();
   int iw = pixmapWidth +
-           listView()->itemMargin() * 2 +
+           2 +
            ((column == 0) ? decorWidth : 0) +
            fm.width(text(column));
   int ih = aItemRect.height();
-  ix -= listView()->contentsX();
+  ix -= treeWidget()->contentsRect().left();
 
   QRect theResult(QPoint(ix, iy), QSize(iw, ih));
   return theResult;
@@ -938,7 +933,7 @@ QLineEdit(parent)
 */
 void SalomeApp_EditBox::keyPressEvent( QKeyEvent *e )
 {
-  if ( e->key() == Key_Escape )
+  if ( e->key() == Qt::Key_Escape )
     emit escapePressed();
   else
     QLineEdit::keyPressEvent( e );
@@ -950,8 +945,10 @@ void SalomeApp_EditBox::keyPressEvent( QKeyEvent *e )
   Constructor
 */
 SalomeApp_ComboBox::SalomeApp_ComboBox(bool rw, QWidget* parent, const char* name) :
-QComboBox(rw, parent, name)
+QComboBox(parent)
 {
+  setEditable( rw );
+  setObjectName( name );
 }
 
 /*!
@@ -960,7 +957,7 @@ QComboBox(rw, parent, name)
 int SalomeApp_ComboBox::findItem(const QString& theText)
 {
   for (int i = 0; i < count(); i++)
-    if (text(i) == theText)
+    if (itemText(i) == theText)
       return i;
   return -1;
 }
@@ -969,10 +966,10 @@ int SalomeApp_ComboBox::findItem(const QString& theText)
   Adds item in combo box
 */
 void SalomeApp_ComboBox::insertItem(const QString& theValue,
-                             int            theIndex)
+                                   int            theIndex)
 {
   if (duplicatesEnabled() || findItem(theValue) < 0)
-    QComboBox::insertItem(theValue, theIndex);
+    QComboBox::insertItem(theIndex, theValue);
 }
 
 /*!
@@ -992,10 +989,10 @@ void SalomeApp_ComboBox::insertItem(const int theValue)
   int aNum;
   bool bOk;
   for (int i = 0; i < count(); i++) {
-    aNum = text(i).toInt(&bOk);
+    aNum = itemText(i).toInt(&bOk);
     if (bOk) {
       if (aNum > theValue || (aNum == theValue && duplicatesEnabled())) {
-        insertItem(QString::number(theValue), i);
+        insertItem(QString::number(theValue),i);
         return;
       }
     }
@@ -1020,7 +1017,7 @@ void SalomeApp_ComboBox::insertItem(const double theValue)
   double aNum;
   bool bOk;
   for (int i = 0; i < count(); i++) {
-    aNum = text(i).toDouble(&bOk);
+    aNum = itemText(i).toDouble(&bOk);
     if (bOk) {
       if (aNum > theValue || (aNum == theValue && duplicatesEnabled())) {
         insertItem(QString::number(theValue), i);
@@ -1077,7 +1074,7 @@ myCancelBtn(0)
     myCombo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,
                                        QSizePolicy::Fixed));
     // no insertions
-    myCombo->setInsertionPolicy(QComboBox::NoInsertion);
+    myCombo->setInsertPolicy(QComboBox::NoInsert);
     // no duplicates enabled by default
     myCombo->setDuplicatesEnabled(false);
     aTopLayout->addWidget(myCombo);
@@ -1110,9 +1107,9 @@ myCancelBtn(0)
 
     QPixmap anIcon;
     if( mgr )
-      anIcon = mgr->loadPixmap( "STD", tr( "ICON_APPLY" ), false );
+      anIcon = mgr->loadPixmap( "SalomeApp", tr( "ICON_APPLY" ), false );
 
-    myApplyBtn->setPixmap(anIcon);
+    myApplyBtn->setIcon(anIcon);
     myApplyBtn->setEnabled(false);
     myApplyBtn->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
     myApplyBtn->setMinimumSize(16, 16);
@@ -1125,8 +1122,8 @@ myCancelBtn(0)
     myCancelBtn = new QToolButton(this);
     QPixmap anIcon;
     if( mgr )
-      anIcon = mgr->loadPixmap( "STD", tr( "ICON_CANCEL" ), false );
-    myCancelBtn->setPixmap(anIcon);
+      anIcon = mgr->loadPixmap( "SalomeApp", tr( "ICON_CANCEL" ), false );
+    myCancelBtn->setIcon(anIcon);
     myCancelBtn->setEnabled(false);
     myCancelBtn->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
     myCancelBtn->setMinimumSize(16, 16);
@@ -1178,7 +1175,7 @@ void SalomeApp_EntityEdit::setText(const QString& theText)
   if (myCombo) {
     int aFound = myCombo->findItem(theText);
     if (aFound >= 0) {
-      myCombo->setCurrentItem(aFound);
+      myCombo->setCurrentIndex(aFound);
       onTextChanged(theText);
     }
   }
@@ -1196,11 +1193,11 @@ void SalomeApp_EntityEdit::insertItem(const QString& theValue,
     if (theOrder == atTop)
       aIndexAt = 0;
     else if (theOrder == atBeforeCurrent && myCombo->count() > 0)
-      aIndexAt = myCombo->currentItem();
+      aIndexAt = myCombo->currentIndex();
     else if (theOrder == atAfterCurrent &&
              myCombo->count() > 0 &&
-             myCombo->currentItem() < myCombo->count()-1)
-      aIndexAt = myCombo->currentItem() + 1;
+             myCombo->currentIndex() < myCombo->count()-1)
+      aIndexAt = myCombo->currentIndex() + 1;
     myCombo->insertItem(theValue, aIndexAt);
   }
   if (theSetCurrent)
@@ -1303,7 +1300,7 @@ void SalomeApp_EntityEdit::setFocus()
     myEdit->setFocus();
     //myEdit->selectAll();
   }
-  else if (myCombo && myCombo->editable()) {
+  else if (myCombo && myCombo->isEditable()) {
     myCombo->setFocus();
     //myCombo->lineEdit()->selectAll();
   }
@@ -1325,10 +1322,10 @@ void SalomeApp_EntityEdit::setValidator(const QValidator* theValidator)
 */
 void SalomeApp_EntityEdit::keyPressEvent( QKeyEvent * e)
 {
-  if ( (e->key() == Key_Enter ||
-        e->key() == Key_Return ) )
+  if ( (e->key() == Qt::Key_Enter ||
+        e->key() == Qt::Key_Return ) )
     onApply();
-  else if (e->key() == Key_Escape)
+  else if (e->key() == Qt::Key_Escape)
     onCancel();
 }
 
index 3fa857bb04c9f9cdcaa9e19097ebf0239ed67d78..8e1521a6d5ee0a41bfca2a7de9a92c862e60a847 100644 (file)
@@ -1,48 +1,44 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  SALOME SalomeApp
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : SalomeApp_ListView.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : SalomeApp_ListView.h
-//  Author : Vadim SANDLER
-//  Module : SALOME
-
 #ifndef SALOMEAPP_LISTVIEW_H
 #define SALOMEAPP_LISTVIEW_H
 
-#include <QtxListView.h>
+//#include <QtxListView.h>
 
-#include <qlist.h>
-#include <qstring.h>
-#include <qpixmap.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
+#include <SUIT_PopupClient.h>
 
-//VRV: porting on Qt 3.0.5
-#if QT_VERSION >= 0x030005
-#include <qtoolbutton.h> 
-#endif
-//VRV: porting on Qt 3.0.5
+#include <QTreeWidget>
+#include <QTreeWidgetItem>
+#include <QString>
+#include <QLineEdit>
+#include <QComboBox>
 
-#include <TColStd_ListOfInteger.hxx>
-#include <TColStd_ListOfReal.hxx>
+class QToolButton; 
 
-#include <SUIT_PopupClient.h>
+class TColStd_ListOfInteger;
+class TColStd_ListOfReal;
 
 // enumeration for ListView updating mode
 enum UpdateType {
@@ -61,7 +57,7 @@ class SalomeApp_EntityEdit;
   \class SalomeApp_ListView
   parent class for Data Viewer and Properties Viewer
 */
-class SalomeApp_ListView : public QtxListView , public SUIT_PopupClient  {
+class SalomeApp_ListView : public QTreeWidget/*QtxListView*/ , public SUIT_PopupClient  {
   
   Q_OBJECT
     
@@ -78,7 +74,7 @@ public:
 
 // fills popup with items
   virtual QString popupClientType() const;
-  virtual void    contextMenuPopup( QPopupMenu* );
+  virtual void    contextMenuPopup( QMenu* );
 
 // setting editing of items availbale/not available
   void enableEditing(bool theFlag);
@@ -240,21 +236,17 @@ private:
   QString              myString;
 };
 
-class SalomeApp_ListViewItem : public QListViewItem
+class SalomeApp_ListViewItem : public QTreeWidgetItem
 {
 public:
   SalomeApp_ListViewItem( SalomeApp_ListView* );
   SalomeApp_ListViewItem( SalomeApp_ListView*, 
                          SalomeApp_ListViewItem* );
   SalomeApp_ListViewItem( SalomeApp_ListView*,
-                         const QString&,
-                         const bool = false );
-  SalomeApp_ListViewItem( SalomeApp_ListView*,
-                         const QString& theName,
-                         const QString& theValue, 
+                         const QStringList&,
                          const bool = false );
-  SalomeApp_ListViewItem( SalomeApp_ListViewItem* theParent,
-                         const QString&,
+  SalomeApp_ListViewItem( SalomeApp_ListViewItem*,
+                         const QStringList&,
                          const bool = false );
   SalomeApp_ListViewItem( SalomeApp_ListView*,
                          SalomeApp_ListViewItem*,
@@ -264,10 +256,6 @@ public:
                          SalomeApp_ListViewItem*,
                          const QString&,
                          const bool = false);
-  SalomeApp_ListViewItem( SalomeApp_ListViewItem*,
-                         const QString& theName,
-                         const QString& theValue, 
-                         const bool = false);
   SalomeApp_ListViewItem( SalomeApp_ListView*,
                          SalomeApp_ListViewItem*,
                          const QString& theName,
@@ -340,6 +328,7 @@ public:
 protected:
   // initialization
   void               init();
+  int                depth() const;
 
 private:
   bool myEditable;
diff --git a/src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx b/src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx
new file mode 100644 (file)
index 0000000..d338c68
--- /dev/null
@@ -0,0 +1,136 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "SalomeApp_LoadStudiesDlg.h"
+
+#include <QLabel>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QListWidget>
+#include <QPushButton>
+#include <QStringList>
+
+#define SPACING_SIZE             6
+#define MARGIN_SIZE             11
+#define MIN_LISTBOX_WIDTH      150
+#define MIN_LISTBOX_HEIGHT     100
+
+/*!
+  \class SalomeApp_LoadStudiesDlg
+  \brief Dialog box which allows selecting study to be loaded 
+  from the list.
+*/
+
+/*!
+  \brief Constructor
+  \param parent a parent widget
+  \param studies list of study names
+*/
+SalomeApp_LoadStudiesDlg::SalomeApp_LoadStudiesDlg( QWidget* parent, const QStringList& studies )
+: QDialog( parent )
+{
+  setModal( true );
+
+  setWindowTitle( tr("DLG_LOAD_STUDY_CAPTION") );
+  setSizeGripEnabled( true );
+
+  QVBoxLayout* topLayout = new QVBoxLayout( this );
+  topLayout->setMargin( MARGIN_SIZE );
+  topLayout->setSpacing( SPACING_SIZE );
+  
+  QLabel* lab = new QLabel( tr( "MEN_STUDIES_CHOICE" ), this );
+  
+  myButtonOk = new QPushButton( tr( "BUT_OK" ), this );
+  myButtonOk->setAutoDefault( true );
+  myButtonOk->setDefault( true );
+    
+  QPushButton* buttonCancel = new QPushButton( tr( "BUT_CANCEL" ), this );
+  
+  QHBoxLayout* btnLayout = new QHBoxLayout;
+  btnLayout->setSpacing( SPACING_SIZE );
+  btnLayout->setMargin( 0 );
+  btnLayout->addWidget( myButtonOk );
+  btnLayout->addStretch();
+  btnLayout->addWidget( buttonCancel );
+
+  myList = new QListWidget( this );
+  myList->setMinimumSize( MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT );
+  myList->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, 
+                                              QSizePolicy::Expanding ) );
+  myList->setSelectionMode( QAbstractItemView::SingleSelection );
+
+  topLayout->addWidget( lab );
+  topLayout->addWidget( myList );
+  topLayout->addLayout( btnLayout );
+  
+  connect( myButtonOk,   SIGNAL( clicked() ), this, SLOT( accept() ) );
+  connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( myList,       SIGNAL( itemDoubleClicked( QListWidgetItem* ) ),
+                                             this, SLOT( accept() ) );
+  connect( myList,       SIGNAL( itemSelectionChanged() ),
+                                             this, SLOT( updateState() ) );
+  myList->addItems( studies );
+
+  updateState();
+}
+
+/*!
+  \brief Destructor
+*/
+SalomeApp_LoadStudiesDlg::~SalomeApp_LoadStudiesDlg()
+{
+}
+
+/*!
+  \brief Updates buttons state.
+*/
+void SalomeApp_LoadStudiesDlg::updateState()
+{
+  myButtonOk->setEnabled( myList->currentItem() != 0 );
+}
+
+/*!
+  \brief Get selected study name
+  \return selected study name or null string if study is not selected
+*/
+QString SalomeApp_LoadStudiesDlg::selectedStudy()
+{
+  QString study;
+  if ( myList->currentItem() )
+    study = myList->currentItem()->text();
+  return study;
+}
+
+/*!
+  \brief Executes dialog box to select study from the list 
+         and returns the study selected.
+  \param parent parent widget
+  \param studies list of study names
+  \return select study (or null string if dialog box is rejected)
+*/
+QString SalomeApp_LoadStudiesDlg::selectStudy( QWidget* parent, const QStringList& studies )
+{
+  SalomeApp_LoadStudiesDlg dlg( parent, studies );
+  QString study;
+  if ( dlg.exec() == QDialog::Accepted )
+    study = dlg.selectedStudy();
+  return study;
+}
diff --git a/src/SalomeApp/SalomeApp_LoadStudiesDlg.h b/src/SalomeApp/SalomeApp_LoadStudiesDlg.h
new file mode 100644 (file)
index 0000000..9637c0b
--- /dev/null
@@ -0,0 +1,55 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef SALOMEAPP_LOADSTUDIESDLG_H
+#define SALOMEAPP_LOADSTUDIESDLG_H
+
+#include "SalomeApp.h"
+
+#include <QDialog>
+
+class QListWidget;
+class QPushButton;
+class QStringList;
+
+class SALOMEAPP_EXPORT SalomeApp_LoadStudiesDlg : public QDialog
+{ 
+  Q_OBJECT
+
+private:
+  SalomeApp_LoadStudiesDlg( QWidget*, const QStringList& );
+
+public:
+  ~SalomeApp_LoadStudiesDlg();
+
+  static QString selectStudy( QWidget*, const QStringList& );
+
+  QString        selectedStudy();
+
+private slots:
+  void           updateState();
+
+private:
+  QListWidget*   myList;
+  QPushButton*   myButtonOk;
+};
+
+#endif // STD_LOADSTUDIESDLG_H
index 332441a6536b102fd79b9db5f1cb78c1180251d8..5bfa0adfae0e15a9547cfd6068596766bb0f0a76 100644 (file)
@@ -1,58 +1,47 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      SalomeApp_Module.cxx
 // Created:   10/25/2004 11:39:56 AM
 // Author:    Sergey LITONIN
-// Copyright (C) CEA 2004
-
+//
 #include "SalomeApp_Module.h"
 #include "SalomeApp_DataModel.h"
 #include "SalomeApp_Application.h"
 #include "SalomeApp_Study.h"
 
 #include "LightApp_Selection.h"
-#include "LightApp_Operation.h"
-#include "LightApp_Preferences.h"
-//#include "LightApp_Displayer.h"
 
 #include "CAM_DataModel.h"
 
-#include "OB_Browser.h"
+// temporary commented
+//#include "OB_Browser.h"
 
 #include <SALOME_ListIO.hxx>
 #include <SALOME_ListIteratorOfListIO.hxx>
 #include <SALOME_InteractiveObject.hxx>
-//#include <SALOME_Actor.h>
 
 #include <SUIT_Session.h>
-#include <SUIT_ViewModel.h>
-
-#include <SVTK_ViewWindow.h>
-//#include <SVTK_ViewModel.h>
-//#include <SVTK_MainWindow.h>
-//#include <SVTK_RenderWindowInteractor.h>
-
-#include <qstring.h>
-#include <qmap.h>
 
-//#include <vtkActorCollection.h>
-//#include <vtkRenderer.h>
+#include <QString>
 
 /*!Constructor.*/
 SalomeApp_Module::SalomeApp_Module( const QString& name )
@@ -121,7 +110,7 @@ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_Li
                    val = valSO->GetName().c_str();
 
            Handle( SALOME_InteractiveObject ) new_obj =
-             new SALOME_InteractiveObject( id.latin1(), comp.latin1(), val.latin1() );
+             new SALOME_InteractiveObject( id.toLatin1(), comp.toLatin1(), val.toLatin1() );
            dest.Append( new_obj );
          }
          anIter->Next();
index 87ca5aad736d87de35edcc4e8a1a15278c8c3a4f..3e4af4e13243302686c992354b1c5877e68ae093 100644 (file)
@@ -1,26 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:      SalomeApp_Module.h
 // Created:   10/25/2004 11:33:06 AM
 // Author:    Sergey LITONIN
-// Copyright (C) CEA 2004
-
+//
 #ifndef SALOMEAPP_MODULE_H
 #define SALOMEAPP_MODULE_H
 
@@ -30,7 +32,6 @@
 
 class CAM_DataModel;
 class SalomeApp_Application;
-class LightApp_Operation;
 class LightApp_Selection;
 class SALOME_ListIO;
 class QString;
diff --git a/src/SalomeApp/SalomeApp_NoteBookDlg.cxx b/src/SalomeApp/SalomeApp_NoteBookDlg.cxx
new file mode 100644 (file)
index 0000000..6005d88
--- /dev/null
@@ -0,0 +1,1082 @@
+// Copyright (C) 2008  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:    SalomeApp_NoteBookDlg.cxx
+// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
+// Module : GUI
+
+#include "SalomeApp_NoteBookDlg.h"
+#include "SalomeApp_Application.h"
+#include "SalomeApp_Study.h"
+#include "SalomeApp_VisualState.h"
+
+#include <Qtx.h>
+
+#include <CAM_Module.h>
+
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+#include <PyConsole_Console.h>
+
+#include <SALOMEDS_Tool.hxx>
+
+#include <QWidget>
+#include <QDialog>
+#include <QGridLayout>
+#include <QTableWidget>
+#include <QTableWidgetItem>
+#include <QPushButton>
+#include <QFont>
+#include <QGroupBox>
+#include <QList>
+#include <QApplication>
+#include <QDir>
+
+#include <string>
+#include <vector>
+
+using namespace std;
+
+#define DEFAULT_MARGIN  11
+#define DEFAULT_SPACING 6
+#define SPACER_SIZE     120
+#define COLUMN_SIZE     180
+
+#define NAME_COLUMN  0
+#define VALUE_COLUMN 1
+
+
+///////////////////////////////////////////////////////////////////////////
+//                 NoteBook_TableRow class                               //
+///////////////////////////////////////////////////////////////////////////
+//============================================================================
+/*! Function : NoteBook_TableRow
+ *  Purpose  : Constructor
+ */
+//============================================================================
+NoteBook_TableRow::NoteBook_TableRow(int index, QWidget* parent):
+  QWidget(parent),
+  myIndex(index),
+  myRowHeader(new QTableWidgetItem()),
+  myVariableName(new QTableWidgetItem()),
+  myVariableValue(new QTableWidgetItem())
+{
+}
+
+//============================================================================
+/*! Function : ~NoteBook_TableRow
+ *  Purpose  : Destructor
+ */
+//============================================================================
+NoteBook_TableRow::~NoteBook_TableRow()
+{
+}
+
+//============================================================================
+/*! Function : AddToTable
+ *  Purpose  : Add this row to the table theTable
+ */
+//============================================================================
+void NoteBook_TableRow::AddToTable(QTableWidget *theTable)
+{
+  int aPosition = theTable->rowCount();
+  int aRowCount = aPosition+1;
+  theTable->setRowCount(aRowCount);
+  myRowHeader->setText(QString::number(aRowCount));
+
+  theTable->setVerticalHeaderItem(aPosition,myRowHeader);
+  theTable->setItem(aPosition, NAME_COLUMN, myVariableName);
+  theTable->setItem(aPosition, VALUE_COLUMN, myVariableValue);
+}
+
+//============================================================================
+/*! Function : SetName
+ *  Purpose  : 
+ */
+//============================================================================
+void NoteBook_TableRow::SetName(const QString theName)
+{
+  myVariableName->setText(theName);
+}
+
+//============================================================================
+/*! Function : SetValue
+ *  Purpose  : 
+ */
+//============================================================================
+void NoteBook_TableRow::SetValue(const QString theValue)
+{
+  myVariableValue->setText(theValue);
+}
+
+//============================================================================
+/*! Function : GetName
+ *  Purpose  : Return variable name
+ */
+//============================================================================
+QString NoteBook_TableRow::GetName() const
+{
+  return myVariableName->text();
+}
+
+//============================================================================
+/*! Function : GetValue
+ *  Purpose  : Return variable value
+ */
+//============================================================================
+QString NoteBook_TableRow::GetValue() const
+{
+  return myVariableValue->text(); 
+}
+
+//============================================================================
+/*! Function : CheckName
+ *  Purpose  : Return true if variable name correct, otherwise return false
+ */
+//============================================================================
+bool NoteBook_TableRow::CheckName()
+{
+  QString aName = GetName();
+  int aPos = 0;
+  QRegExpValidator aValidator( QRegExp("^([a-zA-Z]+)([a-zA-Z0-9_]*)$"), 0 );
+  if( aName.isEmpty() || !aValidator.validate( aName, aPos ) )
+    return false;
+  return true;
+}
+
+//============================================================================
+/*! Function : CheckValue
+ *  Purpose  : Return true if variable value correct, otherwise return false
+ */
+//============================================================================
+bool NoteBook_TableRow::CheckValue()
+{
+  bool aResult = false;
+  QString aValue = GetValue();
+  if( (!aValue.isEmpty()) && 
+      (IsRealValue(aValue)) ||
+      IsIntegerValue(aValue)||
+      IsBooleanValue(aValue)) 
+    aResult = true;
+  
+  return aResult;
+}
+
+//============================================================================
+/*! Function : GetVariableItem
+ *  Purpose  : 
+ */
+//============================================================================
+QTableWidgetItem* NoteBook_TableRow::GetVariableItem()
+{
+  return myVariableValue;
+}
+
+//============================================================================
+/*! Function : GetNameItem
+ *  Purpose  : 
+ */
+//============================================================================
+QTableWidgetItem* NoteBook_TableRow::GetNameItem()
+{
+  return myVariableName;
+}
+
+//============================================================================
+/*! Function : GetHeaderItem
+ *  Purpose  : 
+ */
+//============================================================================
+QTableWidgetItem* NoteBook_TableRow::GetHeaderItem()
+{
+  return myRowHeader;
+}
+
+//============================================================================
+/*! Function : IsRealValue
+ *  Purpose  : Return true if theValue string is real value, otherwise return 
+ *             false
+ */
+//============================================================================
+bool NoteBook_TableRow::IsRealValue(const QString theValue, double* theResult)
+{
+  bool aResult = false;
+  double aDResult = theValue.toDouble(&aResult);
+  if(theResult)
+    *theResult = aDResult;
+  
+  return aResult;
+}
+
+//============================================================================
+/*! Function : IsBooleanValue
+ *  Purpose  : Return true if theValue String is boolean value, otherwise return 
+ *             false
+ */
+//============================================================================
+bool NoteBook_TableRow::IsBooleanValue(const QString theValue, bool* theResult){
+  bool aResult = false;
+  bool aBResult; 
+  if(theValue.compare("True") == 0) {
+    aBResult = true;
+    aResult = true;
+  }
+  else if(theValue.compare("False") == 0) {
+    aBResult = false;
+    aResult = true;
+  }
+  if(theResult)
+    *theResult = aBResult;
+  
+  return aResult;
+}
+
+//============================================================================
+/*! Function : IsIntegerValue
+ *  Purpose  : Return true if theValue string is integer value, otherwise return 
+ *             false
+ */
+//============================================================================
+bool NoteBook_TableRow::IsIntegerValue(const QString theValue, int* theResult)
+{
+  bool aResult = false;
+  int anIResult;
+  anIResult = theValue.toInt(&aResult);
+
+  if(theResult)
+    *theResult = anIResult;  
+  
+  return aResult;
+}
+
+
+///////////////////////////////////////////////////////////////////////////
+//                      NoteBook_Table class                             //
+///////////////////////////////////////////////////////////////////////////
+//============================================================================
+/*! Function : NoteBook_Table
+ *  Purpose  : Constructor
+ */
+//============================================================================
+NoteBook_Table::NoteBook_Table(QWidget * parent)
+  :QTableWidget(parent),
+   isProcessItemChangedSignal(false),
+   myIsModified(false)
+{
+  setColumnCount(2);
+  setSelectionMode(QAbstractItemView::SingleSelection);
+  
+  //Add Headers Columns
+  QFont aFont = QFont();
+  aFont.setBold(true);
+  aFont.setPointSize(10);
+  
+  //"Name" column
+  QTableWidgetItem * aNameHeader = new QTableWidgetItem();
+  aNameHeader->setText(tr("VARNAME_COLUMN"));
+  aNameHeader->setFont(aFont);
+  setHorizontalHeaderItem(0,aNameHeader);
+  setColumnWidth ( 0, COLUMN_SIZE);
+
+  //"Value" Column
+  QTableWidgetItem * aValueHeader = new QTableWidgetItem();
+  aValueHeader->setText(tr("VARVALUE_COLUMN"));
+  aValueHeader->setFont(aFont);
+  setHorizontalHeaderItem(1,aValueHeader);
+  setColumnWidth ( 1, COLUMN_SIZE);
+  setSortingEnabled(false);
+  
+  connect(this,SIGNAL(itemChanged(QTableWidgetItem*)),this,SLOT(onItemChanged(QTableWidgetItem*)));
+}
+
+//============================================================================
+/*! Function : ~NoteBook_Table
+ *  Purpose  : Destructor
+ */
+//============================================================================
+NoteBook_Table::~NoteBook_Table(){}
+
+//============================================================================
+/*! Function : getUniqueIndex
+ *  Purpose  : Get a unique index for the new row
+ */
+//============================================================================
+int NoteBook_Table::getUniqueIndex() const
+{
+  int anIndex = 0;
+  if( !myRows.isEmpty() )
+    if( NoteBook_TableRow* aRow = myRows.last() )
+      anIndex = aRow->GetIndex();
+
+  int aMaxRemovedRow = 0;
+  for( QListIterator<int> anIter( myRemovedRows ); anIter.hasNext(); )
+  {
+    int aRemovedRow = anIter.next();
+    aMaxRemovedRow = qMax( aRemovedRow, aMaxRemovedRow );
+  }
+
+  anIndex = qMax( anIndex, aMaxRemovedRow ) + 1;
+  return anIndex;
+}
+
+//============================================================================
+/*! Function : Init
+ *  Purpose  : Add variables in the table from theStudy
+ */
+//============================================================================
+void NoteBook_Table::Init(_PTR(Study) theStudy)
+{
+  isProcessItemChangedSignal = false;
+
+  int aNumRows = myRows.count();
+  if( aNumRows > 0 )
+  {
+    for( int i = 0; i < myRows.size(); i++ )
+    {
+      NoteBook_TableRow* aRow = myRows[ i ];
+      if( aRow )
+      {
+       delete aRow;
+       aRow = 0;
+      }
+    }
+    myRows.clear();
+  }
+  setRowCount( 0 );
+
+  myRemovedRows.clear();
+  myVariableMapRef.clear();
+  myVariableMap.clear();
+
+  //Add all variables into the table
+  vector<string> aVariables = theStudy->GetVariableNames();
+  for(int iVar = 0; iVar < aVariables.size(); iVar++ ) {
+    AddRow(QString(aVariables[iVar].c_str()),
+          Variable2String(aVariables[iVar],theStudy));
+  }
+
+  //Add empty row
+  AddEmptyRow();
+  isProcessItemChangedSignal = true;
+
+  ResetMaps();
+
+  myStudy = theStudy;
+}
+
+//============================================================================
+/*! Function : Variable2String
+ *  Purpose  : Convert variable values to QString
+ */
+//============================================================================
+QString NoteBook_Table::Variable2String(const string& theVarName,
+                                        _PTR(Study) theStudy)
+{
+  QString aResult;
+  if( theStudy->IsReal(theVarName) )
+    aResult = QString::number(theStudy->GetReal(theVarName));
+  else if( theStudy->IsInteger(theVarName) )
+    aResult = QString::number(theStudy->GetInteger(theVarName));
+  else if( theStudy->IsBoolean(theVarName) )
+    aResult = theStudy->GetBoolean(theVarName) ? QString("True") : QString("False");
+  
+  return aResult;
+}
+
+//============================================================================
+/*! Function : IsValid
+ *  Purpose  : Check validity of the table data
+ */
+//============================================================================
+bool NoteBook_Table::IsValid() const
+{
+  int aNumRows = myRows.count();
+  if( aNumRows == 0 )
+    return true;
+
+  bool aLastRowIsEmpty = myRows[ aNumRows - 1 ]->GetName().isEmpty() &&
+                         myRows[ aNumRows - 1 ]->GetValue().isEmpty();
+
+  for( int i = 0, n = aLastRowIsEmpty ? aNumRows - 1 : aNumRows; i < n; i++ )
+    if( !myRows[i]->CheckName() || !IsUniqueName( myRows[i] ) || !myRows[i]->CheckValue() )
+      return false;
+
+  return true;
+}
+
+//============================================================================
+/*! Function : RenamberRowItems
+ *  Purpose  : renumber row items
+ */
+//============================================================================
+void NoteBook_Table::RenamberRowItems(){
+  for(int i=0; i<myRows.size();i++){
+    myRows[i]->GetHeaderItem()->setText(QString::number(i+1));
+  }
+}
+
+//============================================================================
+/*! Function : AddRow
+ *  Purpose  : Add a row into the table
+ */
+//============================================================================
+void NoteBook_Table::AddRow(const QString& theName, const QString& theValue)
+{
+  int anIndex = getUniqueIndex();
+  NoteBook_TableRow* aRow = new NoteBook_TableRow(anIndex, this);
+  aRow->SetName(theName);
+  aRow->SetValue(theValue);
+  aRow->AddToTable(this);
+  myRows.append(aRow);
+
+  myVariableMap.insert( anIndex, NoteBoox_Variable( theName, theValue ) );
+}
+
+//============================================================================
+/*! Function : AddEmptyRow
+ *  Purpose  : Add an empty row into the end of the table
+ */
+//============================================================================
+void NoteBook_Table::AddEmptyRow()
+{
+  isProcessItemChangedSignal = false;
+  AddRow();
+  isProcessItemChangedSignal = true;
+}
+
+//============================================================================
+/*! Function : GetRowByItem
+ *  Purpose  : 
+ */
+//============================================================================
+NoteBook_TableRow* NoteBook_Table::GetRowByItem(const QTableWidgetItem* theItem) const
+{
+  int aCurrentRow = row(theItem);
+  
+  if( (myRows.size() <= aCurrentRow ) && (aCurrentRow < 0))
+    return NULL;
+  else
+    return myRows.at(aCurrentRow);
+}
+
+//============================================================================
+/*! Function : IsLastRow
+ *  Purpose  : Return true if theRow is last row in the table
+ */
+//============================================================================
+bool NoteBook_Table::IsLastRow(const NoteBook_TableRow* theRow) const
+{
+  return (myRows.last() == theRow);
+}
+
+//============================================================================
+/*! Function : onItemChanged
+ *  Purpose  : [slot] called then table item changed
+ */
+//============================================================================
+void NoteBook_Table::onItemChanged(QTableWidgetItem* theItem)
+{
+  if(isProcessItemChangedSignal) {
+    bool isModified = true;
+    NoteBook_TableRow* aRow = GetRowByItem(theItem);
+    if(aRow) {
+      int aCurrentColumn = column(theItem);
+      bool IsCorrect = true, IsVariableComplited = false;
+      QString aMsg;
+
+      if(aCurrentColumn == NAME_COLUMN) {
+       int anIndex = aRow->GetIndex();
+       if( myVariableMap.contains( anIndex ) )
+       {
+         const NoteBoox_Variable& aVariable = myVariableMap[ anIndex ];
+         if( !aVariable.Name.isEmpty() && myStudy->IsVariableUsed( string( aVariable.Name.toLatin1().constData() ) ) )
+         {
+           if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
+                                     tr( "RENAME_VARIABLE_IS_USED" ).arg( aVariable.Name ),
+                                     QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
+           {
+             bool isBlocked = blockSignals( true );
+             aRow->SetName( aVariable.Name );
+             blockSignals( isBlocked );
+             return;
+           }
+         }
+       }
+      }
+
+      //Case then varible name changed. 
+      if(aCurrentColumn == NAME_COLUMN) {
+        if(!aRow->CheckName()) {
+         IsCorrect = false;
+         aMsg = tr( "VARNAME_INCORRECT" ).arg(aRow->GetName());
+       }
+        else if(!IsUniqueName(aRow)) {
+         IsCorrect = false;
+          aMsg = tr( "VARNAME_EXISTS" ).arg(aRow->GetName());
+       }
+       else
+         IsVariableComplited = aRow->CheckValue();
+      }
+      
+      //Case then varible value changed. 
+      else if(aCurrentColumn == VALUE_COLUMN){
+        if(!aRow->CheckValue()) {
+         IsCorrect = false;
+         aMsg = tr( "VARVALUE_INCORRECT" ).arg(aRow->GetName());
+       }
+       else
+         IsVariableComplited = aRow->CheckName() && IsUniqueName(aRow);
+      }
+
+      if(!IsCorrect && !aMsg.isEmpty())
+       SUIT_MessageBox::warning( parentWidget(), tr( "WARNING" ), aMsg );
+
+      bool isBlocked = blockSignals( true );
+      theItem->setForeground( QBrush( IsCorrect ? Qt::black : Qt::red ) );
+      blockSignals( isBlocked );
+
+      int anIndex = aRow->GetIndex();
+      if( myVariableMap.contains( anIndex ) )
+      {
+       NoteBoox_Variable& aVariable = myVariableMap[ anIndex ];
+       if( aVariable.Name.compare( aRow->GetName() ) != 0 ||
+           aVariable.Value.compare( aRow->GetValue() ) != 0 )
+       {
+         aVariable.Name = aRow->GetName();
+         aVariable.Value = aRow->GetValue();
+       }
+       else
+         isModified = false;
+      }
+
+      if(IsCorrect && IsVariableComplited && IsLastRow(aRow))
+       AddEmptyRow();
+    }
+
+    if( !myIsModified )
+      myIsModified = isModified;
+  }
+}
+
+//============================================================================
+/*! Function : IsUniqueName
+ *  Purpose  : Return true if theName is unique name of the Variable
+ */
+//============================================================================
+bool NoteBook_Table::IsUniqueName(const NoteBook_TableRow* theRow) const
+{
+  for(int i=0; i<myRows.size();i++) {
+    if(myRows[i] == theRow ) 
+      continue;
+    if(myRows[i]->GetName().compare(theRow->GetName()) == 0)
+      return false;
+  }
+  return true;
+}
+
+//============================================================================
+/*! Function : RemoveSelected
+ *  Purpose  : Remove selected rows in the table
+ */
+//============================================================================
+void NoteBook_Table::RemoveSelected()
+{
+  isProcessItemChangedSignal = false;
+  QList<QTableWidgetItem*> aSelectedItems = selectedItems();
+  if( !(aSelectedItems.size() > 0)) {
+    isProcessItemChangedSignal = true;
+    return;
+  }
+  bool removedFromStudy = false;
+  for(int i=0; i < aSelectedItems.size(); i++ ) {
+    NoteBook_TableRow* aRow = GetRowByItem(aSelectedItems[i]);
+    if(aRow) {
+      if(IsLastRow(aRow)) {
+        aRow->SetName(QString());
+        aRow->SetValue(QString());
+      }
+      else {
+        int nRow = row(aSelectedItems[i]);
+
+       if( myStudy->IsVariableUsed( string( aRow->GetName().toLatin1().constData() ) ) )
+       {
+         if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
+                                   tr( "REMOVE_VARIABLE_IS_USED" ).arg( aRow->GetName() ),
+                                   QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
+         {
+           isProcessItemChangedSignal = true;
+           return;
+         }
+       }
+
+       int index = aRow->GetIndex();
+        QString aVarName = aRow->GetName();
+       myRemovedRows.append( index );
+       if( myVariableMap.contains( index ) )
+         myVariableMap.remove( index );
+        removeRow(nRow);
+        myRows.removeAt(nRow);
+        if(myStudy->IsVariable(aVarName.toLatin1().constData()))
+          removedFromStudy = true;
+      }
+    }
+  }
+  if(removedFromStudy)
+    myIsModified = true;
+  RenamberRowItems();
+  isProcessItemChangedSignal = true;
+}
+
+//============================================================================
+/*! Function : SetProcessItemChangedSignalFlag
+ *  Purpose  : 
+ */
+//============================================================================
+void NoteBook_Table::SetProcessItemChangedSignalFlag(const bool enable)
+{
+  isProcessItemChangedSignal = enable;
+}
+
+//============================================================================
+/*! Function : GetProcessItemChangedSignalFlag
+ *  Purpose  : 
+ */
+//============================================================================
+bool NoteBook_Table::GetProcessItemChangedSignalFlag() const
+{
+  return isProcessItemChangedSignal;
+}
+
+//============================================================================
+/*! Function : GetRows
+ *  Purpose  : 
+ */
+//============================================================================
+QList<NoteBook_TableRow*> NoteBook_Table::GetRows() const
+{
+  return myRows;
+}
+
+//============================================================================
+/*! Function : ResetMaps
+ *  Purpose  : Reset variable maps
+ */
+//============================================================================
+void NoteBook_Table::ResetMaps()
+{
+  myIsModified = false;
+  myVariableMapRef = myVariableMap;
+  myRemovedRows.clear();
+}
+
+///////////////////////////////////////////////////////////////////////////
+//                  SalomeApp_NoteBookDlg class                          //
+///////////////////////////////////////////////////////////////////////////
+//============================================================================
+/*! Function : SalomeApp_NoteBookDlg
+ *  Purpose  : Constructor
+ */
+//============================================================================
+SalomeApp_NoteBookDlg::SalomeApp_NoteBookDlg(QWidget * parent, _PTR(Study) theStudy):
+  QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
+  myStudy(theStudy)
+{
+  setModal(false);
+  setObjectName("SalomeApp_NoteBookDlg");
+  setWindowTitle(tr("NOTEBOOK_TITLE"));
+  QGridLayout* aLayout = new QGridLayout(this);
+  aLayout->setMargin(DEFAULT_MARGIN);
+  aLayout->setSpacing(DEFAULT_SPACING);
+
+  //Table
+  myTable = new NoteBook_Table(this);
+  aLayout->addWidget(myTable, 0, 0, 1, 3);
+  
+  //Buttons
+  myRemoveButton = new QPushButton(tr("BUT_REMOVE"));
+  aLayout->addWidget(myRemoveButton, 1, 0, 1, 1);
+
+  QSpacerItem* spacer =
+    new QSpacerItem(DEFAULT_SPACING, 5 , QSizePolicy::Expanding, QSizePolicy::Minimum);
+  aLayout->addItem(spacer, 1, 1, 2, 1);
+
+  myUpdateStudyBtn = new QPushButton(tr("BUT_UPDATE_STUDY"));
+  aLayout->addWidget(myUpdateStudyBtn, 1, 2, 1, 1);
+  
+  QGroupBox* groupBox = new QGroupBox(this);
+
+  QGridLayout* aLayout1 = new QGridLayout(groupBox);
+
+  aLayout1->setMargin(DEFAULT_MARGIN);
+  aLayout1->setSpacing(DEFAULT_SPACING);
+
+  myOkBtn = new QPushButton(tr("BUT_APPLY_AND_CLOSE"));
+  aLayout1->addWidget(myOkBtn, 0, 0, 1, 1);
+  
+  myApplyBtn = new QPushButton(tr("BUT_APPLY"));
+  aLayout1->addWidget(myApplyBtn, 0, 1, 1, 1);  
+
+  QSpacerItem* spacer1 =
+    new QSpacerItem(DEFAULT_SPACING, 5, QSizePolicy::Expanding, QSizePolicy::Minimum);
+  aLayout1->addItem(spacer1, 0, 2, 1, 1);
+
+  myCancelBtn = new QPushButton(tr("BUT_CLOSE"));
+  aLayout1->addWidget(myCancelBtn, 0, 3, 1, 1);
+
+  myHelpBtn = new QPushButton(tr("BUT_HELP"));
+  aLayout1->addWidget(myHelpBtn, 0, 4, 1, 1);
+  
+  aLayout->addWidget(groupBox, 2, 0, 1, 3);
+
+  QWidgetList aWidgetList;
+  aWidgetList.append( myTable );
+  aWidgetList.append( myOkBtn );
+  aWidgetList.append( myApplyBtn );
+  aWidgetList.append( myCancelBtn );
+  aWidgetList.append( myHelpBtn );
+  aWidgetList.append( myUpdateStudyBtn );
+  aWidgetList.append( myRemoveButton );
+  Qtx::setTabOrder( aWidgetList );
+
+  connect( myOkBtn, SIGNAL(clicked()), this, SLOT(onOK()) );
+  connect( myApplyBtn, SIGNAL(clicked()), this, SLOT(onApply()) );
+  connect( myCancelBtn, SIGNAL(clicked()), this, SLOT(onCancel()) );
+  connect( myUpdateStudyBtn, SIGNAL(clicked()), this, SLOT(onUpdateStudy()) );
+  connect( myRemoveButton, SIGNAL(clicked()), this, SLOT(onRemove()));
+  connect( myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
+  
+  myTable->Init(myStudy);
+}
+
+//============================================================================
+/*! Function : ~SalomeApp_NoteBookDlg
+ *  Purpose  : Destructor
+ */
+//============================================================================
+SalomeApp_NoteBookDlg::~SalomeApp_NoteBookDlg(){}
+
+
+//============================================================================
+/*! Function : Init()
+ *  Purpose  : init variable table
+ */
+//============================================================================
+void SalomeApp_NoteBookDlg::Init(_PTR(Study) theStudy){
+  if(myStudy!= theStudy)
+    myStudy = theStudy;
+  myTable->Init(myStudy);
+}
+
+
+//============================================================================
+/*! Function : onOK
+ *  Purpose  : [slot]
+ */
+//============================================================================
+void SalomeApp_NoteBookDlg::onOK()
+{
+  onApply();
+  if( myTable->IsValid() )
+    accept();
+}
+
+//============================================================================
+/*! Function : onHelp
+ *  Purpose  : [slot]
+ */
+//============================================================================
+void SalomeApp_NoteBookDlg::onHelp()
+{
+  QString aHelpFileName("using_notebook.html");
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule("GUI",aHelpFileName);
+  else {
+    QString platform;
+#ifdef WIN32
+    platform = "winapplication";
+#else
+    platform = "application";
+#endif
+    SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 platform)).
+                             arg(aHelpFileName));
+  }
+
+}
+//============================================================================
+/*! Function : onApply
+ *  Purpose  : [slot]
+ */
+//============================================================================
+void SalomeApp_NoteBookDlg::onApply()
+{
+  if( !myTable->IsValid() )
+  {
+    SUIT_MessageBox::warning( this, tr( "WARNING" ), tr( "INCORRECT_DATA" ) );
+    return;
+  }
+
+  double aDVal;
+  int    anIVal;
+  bool   aBVal;
+
+  const QList<int>& aRemovedRows = myTable->GetRemovedRows();
+  const VariableMap& aVariableMap = myTable->GetVariableMap();
+  const VariableMap& aVariableMapRef = myTable->GetVariableMapRef();
+
+  for( QListIterator<int> anIter( aRemovedRows ); anIter.hasNext(); )
+  {
+    int anIndex = anIter.next();
+    if( aVariableMapRef.contains( anIndex ) )
+    {
+      QString aRemovedVariable = aVariableMapRef[ anIndex ].Name;
+      myStudy->RemoveVariable( string( aRemovedVariable.toLatin1().constData() ) );
+    }
+  }
+
+  VariableMap::const_iterator it = aVariableMap.constBegin(), itEnd = aVariableMap.constEnd();
+  for( ; it != itEnd; ++it )
+  {
+    int anIndex = it.key();
+    const NoteBoox_Variable& aVariable = it.value();
+    QString aName = aVariable.Name;
+    QString aValue = aVariable.Value;
+
+    if( !aName.isEmpty() && !aValue.isEmpty() )
+    {
+      if( aVariableMapRef.contains( anIndex ) )
+      {
+       const NoteBoox_Variable& aVariableRef = aVariableMapRef[ anIndex ];
+       QString aNameRef = aVariableRef.Name;
+       QString aValueRef = aVariableRef.Value;
+
+       if( !aNameRef.isEmpty() && !aValueRef.isEmpty() && aNameRef != aName )
+       {
+         myStudy->RenameVariable( string( aNameRef.toLatin1().constData() ),
+                                  string( aName.toLatin1().constData() ) );
+       }
+      }
+
+      if( NoteBook_TableRow::IsIntegerValue(aValue,&anIVal) )
+       myStudy->SetInteger(string(aName.toLatin1().constData()),anIVal);
+
+      else if( NoteBook_TableRow::IsRealValue(aValue,&aDVal) )
+       myStudy->SetReal(string(aName.toLatin1().constData()),aDVal);
+    
+      else if( NoteBook_TableRow::IsBooleanValue(aValue,&aBVal) )
+       myStudy->SetBoolean(string(aName.toLatin1().constData()),aBVal);
+    }
+  }
+  myTable->ResetMaps();
+
+  SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+  if(app)
+    app->updateActions();
+
+}
+
+//============================================================================
+/*! Function : onCancel
+ *  Purpose  : [slot]
+ */
+//============================================================================
+void SalomeApp_NoteBookDlg::onCancel()
+{
+  if( myTable->IsModified() )
+  {
+    int answer = QMessageBox::question( this, tr( "CLOSE_CAPTION" ), tr( "CLOSE_DESCRIPTION" ),
+                                       QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel );
+    switch( answer )
+    {
+      case QMessageBox::Yes    : onOK(); return;
+      case QMessageBox::No     : break;
+      case QMessageBox::Cancel : return;
+      default :        break;
+    }
+  }
+  reject();
+}
+
+//============================================================================
+/*! Function : onRemove
+ *  Purpose  : [slot]
+ */
+//============================================================================
+void SalomeApp_NoteBookDlg::onRemove()
+{
+  myTable->RemoveSelected();
+}
+
+//============================================================================
+/*! Function : onUpdateStudy
+ *  Purpose  : [slot]
+ */
+//============================================================================
+void SalomeApp_NoteBookDlg::onUpdateStudy()
+{
+  onApply();
+  if( !myTable->IsValid() )
+    return;
+
+  QApplication::setOverrideCursor( Qt::WaitCursor );
+
+  if( !updateStudy() )
+    SUIT_MessageBox::warning( this, tr( "ERROR" ), tr( "ERR_UPDATE_STUDY_FAILED" ) );
+    
+  QApplication::restoreOverrideCursor();
+}
+
+//============================================================================
+/*! Function : updateStudy
+ *  Purpose  : 
+ */
+//============================================================================
+bool SalomeApp_NoteBookDlg::updateStudy()
+{
+  SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+  if( !app )
+    return false;
+
+  SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+  if( !study )
+    return false;
+
+  bool isStudySaved = study->isSaved();
+  QString aStudyName = study->studyName();
+
+  _PTR(Study) studyDS = study->studyDS();
+
+  // get unique temporary directory name
+  QString aTmpDir = QString::fromStdString( SALOMEDS_Tool::GetTmpDir() );
+  if( aTmpDir.isEmpty() )
+    return false;
+
+  if( aTmpDir.right( 1 ).compare( QDir::separator() ) == 0 )
+    aTmpDir.remove( aTmpDir.length() - 1, 1 );
+
+  // dump study to the temporary directory
+  QString aFileName( "notebook" );
+  bool toPublish = true;
+  bool toSaveGUI = true;
+
+  int savePoint;
+  _PTR(AttributeParameter) ap;
+  _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
+  if(ip->isDumpPython(studyDS)) ip->setDumpPython(studyDS); //Unset DumpPython flag.
+  if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method
+    ip->setDumpPython(studyDS);
+    savePoint = SalomeApp_VisualState( app ).storeState(); //SRN: create a temporary save point
+  }
+  bool ok = studyDS->DumpStudy( aTmpDir.toStdString(), aFileName.toStdString(), toPublish );
+  if ( toSaveGUI )
+    study->removeSavePoint(savePoint); //SRN: remove the created temporary save point.
+
+  if( !ok )
+    return false;
+
+  // clear a study (delete all objects)
+  clearStudy();
+
+  // get active application
+  app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+
+  // load study from the temporary directory
+  QString command = QString( "execfile(\"%1\")" ).arg( aTmpDir + QDir::separator() + aFileName + ".py" );
+
+  PyConsole_Console* pyConsole = app->pythonConsole();
+  if ( pyConsole )
+    pyConsole->execAndWait( command );
+
+  // remove temporary directory
+  QDir aDir( aTmpDir );
+  QStringList aFiles = aDir.entryList( QStringList( "*.py*" ) );
+  for( QStringList::iterator it = aFiles.begin(), itEnd = aFiles.end(); it != itEnd; ++it )
+    ok = aDir.remove( *it ) && ok;
+  if( ok )
+    ok = aDir.rmdir( aTmpDir );
+
+  if( SalomeApp_Study* newStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) )
+  {
+    myStudy = newStudy->studyDS();
+    myTable->Init(myStudy);
+    if(isStudySaved) {
+      newStudy->markAsSavedIn(aStudyName);
+    }
+  }
+  else
+    ok = false;
+
+  return ok;
+}
+
+//============================================================================
+/*! Function : clearStudy
+ *  Purpose  : 
+ */
+//============================================================================
+void SalomeApp_NoteBookDlg::clearStudy()
+{
+  SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+  if( !app )
+    return;
+
+  QList<SUIT_Application*> aList = SUIT_Session::session()->applications();
+  int anIndex = aList.indexOf( app );
+
+  //Store position and size of the this dialog
+  int aW = width();
+  int aH = height();
+  int aX = x();
+  int aY = y();
+
+  // Disconnect dialog from application desktop in case if:
+  // 1) Application is not the first application in the session        
+  // 2) Application is the first application in session but not the only.
+  bool changeDesktop = ((anIndex > 0) || (anIndex == 0 && aList.count() > 1));
+
+  if( changeDesktop )
+    setParent( 0 );
+
+  app->onCloseDoc( false );
+  
+  if( anIndex > 0 && anIndex < aList.count() )
+    app = dynamic_cast<SalomeApp_Application*>( aList[ anIndex - 1 ] );
+  else if(anIndex == 0 && aList.count() > 1)
+    app = dynamic_cast<SalomeApp_Application*>( aList[ 1 ] );
+
+  if( !app )
+    return;
+
+  app->onNewDoc();
+
+  app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+  if( changeDesktop && app ) {
+    setParent( app->desktop(), Qt::Dialog );
+    app->setNoteBook(this);
+  }
+  //Set position and size of the this dialog
+  resize( aW, aH );
+  move( aX, aY );
+  show();
+}
diff --git a/src/SalomeApp/SalomeApp_NoteBookDlg.h b/src/SalomeApp/SalomeApp_NoteBookDlg.h
new file mode 100644 (file)
index 0000000..431b50c
--- /dev/null
@@ -0,0 +1,172 @@
+// Copyright (C) 2008  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:    SalomeApp_NoteBookDlg.h
+// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
+// Module : GUI
+
+#ifndef SALOMEAPP_NOTEBOOKDLG_H
+#define SALOMEAPP_NOTEBOOKDLG_H
+
+#include "SalomeApp.h"
+
+#include "SALOMEDSClient_ClientFactory.hxx" 
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+#include <QDialog>
+#include <QTableWidget>
+#include <QList>
+
+class QWidget;
+class QPushButton;
+class QTableWidgetItem;
+
+struct NoteBoox_Variable
+{
+  NoteBoox_Variable() {}
+  NoteBoox_Variable( const QString& theName, const QString& theValue )
+  {
+    Name = theName;
+    Value = theValue;
+  }
+  QString Name;
+  QString Value;
+};
+
+typedef QMap< int, NoteBoox_Variable > VariableMap;
+
+class SALOMEAPP_EXPORT NoteBook_TableRow : public QWidget
+{
+ public:
+  NoteBook_TableRow(int, QWidget* parent=0);
+  virtual ~NoteBook_TableRow();
+
+  int  GetIndex() const { return myIndex; }
+  
+  void AddToTable(QTableWidget *theTable);
+  
+  void SetName(const QString theName);
+  void SetValue(const QString theValue);
+
+  QString GetValue() const;
+  QString GetName() const;
+
+  bool CheckName();
+  bool CheckValue();
+
+  QTableWidgetItem* GetVariableItem();
+  QTableWidgetItem* GetNameItem();
+  QTableWidgetItem* GetHeaderItem();
+
+  static bool IsRealValue(const QString theValue, double* theResult = 0);
+  static bool IsIntegerValue(const QString theValue, int* theResult = 0);
+  static bool IsBooleanValue(const QString theValue, bool* theResult = 0);
+  
+ private:
+  int               myIndex;
+  QTableWidgetItem* myRowHeader;
+  QTableWidgetItem* myVariableName;
+  QTableWidgetItem* myVariableValue;
+};
+
+class SALOMEAPP_EXPORT NoteBook_Table : public QTableWidget
+{
+  Q_OBJECT
+ public:
+  NoteBook_Table(QWidget * parent = 0);
+  virtual ~NoteBook_Table();
+
+  void Init(_PTR(Study) theStudy);
+  static QString Variable2String(const std::string& theVarName,
+                                _PTR(Study) theStudy);
+
+  bool IsValid() const;
+
+  void AddRow( const QString& theName = QString::null, const QString& theValue = QString::null );
+  void AddEmptyRow();
+  NoteBook_TableRow* GetRowByItem(const QTableWidgetItem* theItem) const;
+  bool IsLastRow(const NoteBook_TableRow* aRow) const;
+
+  void RemoveSelected();
+
+  void SetProcessItemChangedSignalFlag(const bool enable);
+  bool GetProcessItemChangedSignalFlag()const;
+
+  bool IsUniqueName(const NoteBook_TableRow* theRow) const;
+  QList<NoteBook_TableRow*> GetRows() const;
+
+  const bool         IsModified() const { return myIsModified; }
+  const QList<int>&  GetRemovedRows() const { return myRemovedRows; }
+  const VariableMap& GetVariableMap() const { return myVariableMap; }
+  const VariableMap& GetVariableMapRef() const { return myVariableMapRef; }
+  void  RenamberRowItems();
+
+  void ResetMaps();
+
+  public slots:
+    void onItemChanged(QTableWidgetItem* theItem);
+
+ private:
+    int  getUniqueIndex() const;
+    
+ private:
+  bool isProcessItemChangedSignal;
+  QList<NoteBook_TableRow*>          myRows;
+
+  bool        myIsModified;
+  QList<int>  myRemovedRows;
+  VariableMap myVariableMapRef;
+  VariableMap myVariableMap;
+
+  _PTR(Study)      myStudy;
+};
+
+class SALOMEAPP_EXPORT SalomeApp_NoteBookDlg : public QDialog 
+{
+  Q_OBJECT
+ public:
+  SalomeApp_NoteBookDlg(QWidget * parent , _PTR(Study) theStudy);
+  virtual ~SalomeApp_NoteBookDlg();
+
+  void Init(_PTR(Study) theStudy);
+  
+ public slots:
+   void onOK();
+   void onApply();
+   void onCancel();
+   void onRemove();
+   void onUpdateStudy();
+   void onHelp();
+
+ protected:
+   bool updateStudy();
+   void clearStudy();
+
+ private:
+  NoteBook_Table*  myTable;
+  QPushButton*     myRemoveButton;
+  QPushButton*     myUpdateStudyBtn;
+  QPushButton*     myOkBtn;
+  QPushButton*     myApplyBtn;
+  QPushButton*     myCancelBtn;
+  QPushButton*     myHelpBtn;
+  
+  _PTR(Study)      myStudy;
+};
+
+#endif //SALOMEAPP_NOTEBOOKDLG_H
index 67606feae43df793991d3ede45af6df14454d36e..b60117d08be838c219bbb532c971a7543766a19d 100755 (executable)
@@ -1,42 +1,37 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SalomeApp_PyInterp.cxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SalomeApp_PyInterp.h"
 
 #include <utilities.h>
 #include <Container_init_python.hxx>
 
-#include <string>
-#include <vector>
+#include "PyInterp.h" // this include must be first (see PyInterp_base.h)!
 
-#include "PyInterp_base.h" // this include must be first (see PyInterp_base.h)!
-
-#include <cStringIO.h>
 using namespace std;
 
 /*!
@@ -44,7 +39,8 @@ using namespace std;
  * calls initialize method defined in base class, which calls virtual methods
  * initstate & initcontext redefined here.
  */
-SalomeApp_PyInterp::SalomeApp_PyInterp(): PythonConsole_PyInterp()
+SalomeApp_PyInterp::SalomeApp_PyInterp(): 
+  PyConsole_Interp(), myFirstRun( true )
 {
 }
 
@@ -81,7 +77,7 @@ bool SalomeApp_PyInterp::initContext()
    * It is the caller responsability caller to acquire the GIL
    * It will still be held on initContext output
    */
-  if ( !PythonConsole_PyInterp::initContext() )
+  if ( !PyConsole_Interp::initContext() )
     return false;
 
   // Import special module to change the import mechanism
@@ -112,12 +108,31 @@ bool SalomeApp_PyInterp::initContext()
   Do nothing
   The initialization has been done in main
  */
-void SalomeApp_PyInterp::init_python()
+void SalomeApp_PyInterp::initPython()
 {
-  MESSAGE("PyInterp_base::init_python");
+  MESSAGE("PyInterp_base::initPython");
   ASSERT(KERNEL_PYTHON::_gtstate); // initialisation in main
   SCRUTE(KERNEL_PYTHON::_gtstate);
   _gtstate=KERNEL_PYTHON::_gtstate;
   _interp=KERNEL_PYTHON::_interp;
 }
 
+/*!
+  Called before each Python command running.
+*/
+int SalomeApp_PyInterp::beforeRun()
+{
+  if ( myFirstRun ) {
+    myFirstRun = false;
+    int ret = simpleRun( "from Help import *", false );
+    if ( ret )
+      return ret;
+    ret = simpleRun( "import salome", false );
+    if (ret)
+      return ret;
+    ret = simpleRun( "salome.salome_init(0,1)", false );
+    if (ret)
+      return ret;
+  }
+  return true;
+}
index a0db6377f1073b223cb6bde93eb0c9453d8514c8..baef2fffda2f81159c3ea61747139d2a3a7f8fc2 100755 (executable)
@@ -1,46 +1,49 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SalomeApp_PyInterp.h
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef _SalomeApp_PYINTERP_H_
 #define _SalomeApp_PYINTERP_H_
 
-#include <PythonConsole_PyInterp.h> // this include must be first (see PyInterp_base.h)!
+#include <PyConsole_Interp.h> // this include must be first (see PyInterp_base.h)!
 
-class SalomeApp_PyInterp : public PythonConsole_PyInterp
+class SalomeApp_PyInterp : public PyConsole_Interp
 {
 public:
   SalomeApp_PyInterp();
   virtual ~SalomeApp_PyInterp();
 
-  virtual void init_python();
+  virtual void initPython();
 
 protected:
   virtual bool initContext();
+  virtual int  beforeRun();
+
+private:
+  bool myFirstRun;
 };
 
 #endif
index aeee814b63b4515a6ba051db89f3559a2dcd25bc..1c040af7df600b53178b3e251aa82c75a704c05b 100644 (file)
@@ -1,51 +1,43 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SalomeApp_Study.h"
 
 #include "SalomeApp_Module.h"
-#include "SalomeApp_DataModel.h"
 #include "SalomeApp_DataObject.h"
+#include "SalomeApp_DataModel.h"
 #include "SalomeApp_Application.h"
 #include "SalomeApp_Engine_i.hxx"
 #include "SalomeApp_VisualState.h"
 
-#include "LightApp_RootObject.h"
-
-#include <OB_Browser.h>
+// temporary commented
+//#include <OB_Browser.h>
 
 #include <SUIT_ResourceMgr.h>
 
-#include <qptrlist.h>
-#include <qapplication.h>
-#include <qdict.h>
-
 #include "utilities.h"
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include <SUIT_Session.h>
 
 #include "SALOMEDS_Tool.hxx"
 
 #include "SALOMEDSClient_ClientFactory.hxx"
-#include "SALOMEDSClient_IParameters.hxx"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOME_Exception)
@@ -89,24 +81,26 @@ _PTR(Study) SalomeApp_Study::studyDS() const
 /*!
   Create document.
 */
-void SalomeApp_Study::createDocument()
+bool SalomeApp_Study::createDocument( const QString& theStr )
 {
   MESSAGE( "openDocument" );
 
   // initialize myStudyDS, read HDF file
   QString aName = newStudyName();
-  _PTR(Study) study ( SalomeApp_Application::studyMgr()->NewStudy( aName.latin1() ) );
+  _PTR(Study) study ( SalomeApp_Application::studyMgr()->NewStudy( aName.toStdString() ) );
   if ( !study )
-    return;
+    return false;
 
   setStudyDS( study );
   setStudyName( aName );
 
   // create myRoot
-  setRoot( new LightApp_RootObject( this ) );
+  setRoot( new SalomeApp_RootObject( this ) );
 
-  CAM_Study::createDocument();
+  bool aRet = CAM_Study::createDocument( theStr );
   emit created( this );
+
+  return aRet;
 }
 
 /*!
@@ -118,20 +112,21 @@ bool SalomeApp_Study::openDocument( const QString& theFileName )
   MESSAGE( "openDocument" );
 
   // initialize myStudyDS, read HDF file
-  _PTR(Study) study ( SalomeApp_Application::studyMgr()->Open( (char*) theFileName.latin1() ) );
+  _PTR(Study) study ( SalomeApp_Application::studyMgr()->Open( (char*) theFileName.toStdString().c_str() ) );
   if ( !study )
     return false;
 
   setStudyDS( study );
 
-  setRoot( new LightApp_RootObject( this ) ); // create myRoot
+  setRoot( new SalomeApp_RootObject( this ) ); // create myRoot
 
   // update loaded data models: call open() and update() on them.
   ModelList dm_s;
   dataModels( dm_s );
-  for ( ModelListIterator it( dm_s ); it.current(); ++it )
-    openDataModel( studyName(), it.current() );
-
+  QListIterator<CAM_DataModel*> it( dm_s );
+  while ( it.hasNext() ) 
+    openDataModel( studyName(), it.next() );
+  
   // this will build a SUIT_DataObject-s tree under myRoot member field
   // passing "false" in order NOT to rebuild existing data models' trees - it was done in previous step
   // but tree that corresponds to not-loaded data models will be updated any way. 
@@ -149,6 +144,7 @@ bool SalomeApp_Study::openDocument( const QString& theFileName )
       SalomeApp_VisualState( (SalomeApp_Application*)application() ).restoreState( savePoints[savePoints.size()-1] );
   }
 
+  ((SalomeApp_Application*)application())->updateObjectBrowser( true ); 
   return res;
 }
 
@@ -161,13 +157,13 @@ bool SalomeApp_Study::loadDocument( const QString& theStudyName )
   MESSAGE( "loadDocument" );
 
   // obtain myStudyDS from StudyManager
-  _PTR(Study) study ( SalomeApp_Application::studyMgr()->GetStudyByName( (char*) theStudyName.latin1() ) );
+  _PTR(Study) study ( SalomeApp_Application::studyMgr()->GetStudyByName( (char*) theStudyName.toStdString().c_str() ) );
   if ( !study )
     return false;
 
   setStudyDS( study );
 
-  setRoot( new LightApp_RootObject( this ) ); // create myRoot
+  setRoot( new SalomeApp_RootObject( this ) ); // create myRoot
 
   //SRN: BugID IPAL9021, put there the same code as in a method openDocument
 
@@ -175,8 +171,9 @@ bool SalomeApp_Study::loadDocument( const QString& theStudyName )
   ModelList dm_s;
   dataModels( dm_s );
 
-  for ( ModelListIterator it( dm_s ); it.current(); ++it )
-    openDataModel( studyName(), it.current() );
+  QListIterator<CAM_DataModel*> it( dm_s );
+  while ( it.hasNext() )
+    openDataModel( studyName(), it.next() );
 
   // this will build a SUIT_DataObject-s tree under myRoot member field
   // passing "false" in order NOT to rebuild existing data models' trees - it was done in previous step
@@ -194,7 +191,6 @@ bool SalomeApp_Study::loadDocument( const QString& theStudyName )
   }
 
   //SRN: BugID IPAL9021: End
-
   return res;
 }
 
@@ -210,13 +206,15 @@ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName )
   
   ModelList list; dataModels( list );
 
-  SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)list.first();
+  QListIterator<CAM_DataModel*> it( list );
   QStringList listOfFiles;
-  for ( ; aModel; aModel = (SalomeApp_DataModel*)list.next() ) {
-    listOfFiles.clear();
-    aModel->saveAs( theFileName, this, listOfFiles );
-    if ( !listOfFiles.isEmpty() )
-      saveModuleData(aModel->module()->name(), listOfFiles);
+  while ( it.hasNext() ) {
+    if ( SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)it.next() ) {
+      listOfFiles.clear();
+      aModel->saveAs( theFileName, this, listOfFiles );
+      if ( !listOfFiles.isEmpty() )
+       saveModuleData(aModel->module()->name(), listOfFiles);
+    }
   }
 
   // save SALOMEDS document
@@ -227,8 +225,8 @@ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName )
   bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
   bool isAscii = resMgr->booleanValue( "Study", "ascii_file", false );
   bool res = (isAscii ? 
-    SalomeApp_Application::studyMgr()->SaveAsASCII( theFileName.latin1(), studyDS(), isMultiFile ) :
-    SalomeApp_Application::studyMgr()->SaveAs     ( theFileName.latin1(), studyDS(), isMultiFile ))
+    SalomeApp_Application::studyMgr()->SaveAsASCII( theFileName.toStdString(), studyDS(), isMultiFile ) :
+    SalomeApp_Application::studyMgr()->SaveAs     ( theFileName.toStdString(), studyDS(), isMultiFile ))
     && CAM_Study::saveDocumentAs( theFileName );
   
   res = res && saveStudyData(theFileName);
@@ -250,13 +248,15 @@ bool SalomeApp_Study::saveDocument()
 
   ModelList list; dataModels( list );
 
-  SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)list.first();
+  QListIterator<CAM_DataModel*> it( list );
   QStringList listOfFiles;
-  for ( ; aModel; aModel = (SalomeApp_DataModel*)list.next() ) {
-    listOfFiles.clear();
-    aModel->save(listOfFiles);
-    if ( !listOfFiles.isEmpty() ) 
-      saveModuleData(aModel->module()->name(), listOfFiles);
+  while ( it.hasNext() ) {
+    if ( SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)it.next() ) {
+      listOfFiles.clear();
+      aModel->save(listOfFiles);
+      if ( !listOfFiles.isEmpty() ) 
+       saveModuleData(aModel->module()->name(), listOfFiles);
+    }
   }
 
   // save SALOMEDS document
@@ -346,10 +346,10 @@ void SalomeApp_Study::saveModuleData( QString theModuleName, QStringList theList
   for ( QStringList::Iterator it = theListOfFiles.begin(); it != theListOfFiles.end(); ++it ) {
     if ( (*it).isEmpty() )
       continue;
-    aListOfFiles[anIndex] = (*it).latin1();
+    aListOfFiles[anIndex] = (*it).toStdString();
     anIndex++;
   }
-  SetListOfFiles(theModuleName, aListOfFiles);
+  SetListOfFiles(theModuleName.toStdString().c_str(), aListOfFiles);
 }
 
 /*!
@@ -359,7 +359,7 @@ void SalomeApp_Study::saveModuleData( QString theModuleName, QStringList theList
 */
 void SalomeApp_Study::openModuleData( QString theModuleName, QStringList& theListOfFiles )
 {
-  std::vector<std::string> aListOfFiles =  GetListOfFiles( theModuleName );
+  std::vector<std::string> aListOfFiles =  GetListOfFiles( theModuleName.toStdString().c_str() );
 
   int i, aLength = aListOfFiles.size() - 1;
   if ( aLength < 0 )
@@ -378,10 +378,11 @@ void SalomeApp_Study::openModuleData( QString theModuleName, QStringList& theLis
 bool SalomeApp_Study::saveStudyData( const QString& theFileName )
 {
   ModelList list; dataModels( list );
-  SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)list.first();
+  QListIterator<CAM_DataModel*> it( list );
   std::vector<std::string> listOfFiles(0);
-  for ( ; aModel; aModel = (SalomeApp_DataModel*)list.next() )
-    SetListOfFiles(aModel->module()->name(), listOfFiles);
+  while ( it.hasNext() )
+    if ( SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)it.next() )
+      SetListOfFiles(aModel->module()->name().toStdString().c_str(), listOfFiles);
   return true;
 }
 
@@ -406,7 +407,7 @@ void SalomeApp_Study::setStudyDS( const _PTR(Study)& s )
 */
 void SalomeApp_Study::dataModelInserted (const CAM_DataModel* dm)
 {
-  MESSAGE("SalomeApp_Study::dataModelInserted() : module name() = " << dm->module()->name());
+  MESSAGE("SalomeApp_Study::dataModelInserted() : module name() = " << dm->module()->name().toStdString());
 
   CAM_Study::dataModelInserted(dm);
 
@@ -425,20 +426,20 @@ void SalomeApp_Study::addComponent(const CAM_DataModel* dm)
     _PTR(Study) aStudy = studyDS();
     if (!aStudy) 
       return;
-    _PTR(SComponent) aComp = aStudy->FindComponent(dm->module()->name());
+    _PTR(SComponent) aComp = aStudy->FindComponent(dm->module()->name().toStdString());
     if (!aComp) {
       // Create SComponent
       _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
-      aComp = aBuilder->NewComponent(dm->module()->name());
-      aBuilder->SetName(aComp, dm->module()->moduleName().latin1());
+      aComp = aBuilder->NewComponent(dm->module()->name().toStdString());
+      aBuilder->SetName(aComp, dm->module()->moduleName().toStdString());
       QString anIconName = dm->module()->iconName();
       if (!anIconName.isEmpty()) {
         _PTR(AttributePixMap) anAttr = aBuilder->FindOrCreateAttribute(aComp, "AttributePixMap");
         if (anAttr)
-          anAttr->SetPixMap(anIconName.latin1());
+          anAttr->SetPixMap(anIconName.toStdString());
       }
       // Set default engine IOR
-      aBuilder->DefineComponentInstance(aComp, SalomeApp_Application::defaultEngineIOR().latin1());
+      aBuilder->DefineComponentInstance(aComp, SalomeApp_Application::defaultEngineIOR().toStdString());
       //SalomeApp_DataModel::BuildTree( aComp, root(), this, /*skipExisitng=*/true );
       SalomeApp_DataModel::synchronize( aComp, this );
     }
@@ -461,7 +462,7 @@ bool SalomeApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm
   // 1. aModule == 0 means that this is a light module (no CORBA enigine)
   if (!aModule) {
     anEngine = SalomeApp_Application::defaultEngineIOR();
-    aSComp = aStudy->FindComponent(dm->module()->name());
+    aSComp = aStudy->FindComponent(dm->module()->name().toStdString());
   }
   else {
     SalomeApp_DataModel* aDM = dynamic_cast<SalomeApp_DataModel*>( dm );
@@ -472,14 +473,14 @@ bool SalomeApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm
       anEngine = aDM->getModule()->engineIOR();
       if ( anEngine.isEmpty() )
         return false;
-      aSComp = aStudy->FindComponentID( std::string( anId.latin1() ) );
+      aSComp = aStudy->FindComponentID( std::string( anId.toLatin1() ) );
     }
   }
   if ( aSComp ) {
     _PTR(StudyBuilder) aBuilder( aStudy->NewBuilder() );
     if ( aBuilder ) {
       try {
-        aBuilder->LoadWith( aSComp, std::string( anEngine.latin1() ) );
+        aBuilder->LoadWith( aSComp, std::string( anEngine.toLatin1() ) );
       }
       catch( const SALOME::SALOME_Exception& ) {
         // Oops, something went wrong while loading -> return an error
@@ -499,7 +500,7 @@ bool SalomeApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm
     // Remove the files and temporary directory, created
     // for this module by LightApp_Engine_i::Load()
     bool isMultiFile = false; // TODO: decide, how to access this parameter
-    RemoveTemporaryFiles( dm->module()->name(), isMultiFile );
+    RemoveTemporaryFiles( dm->module()->name().toStdString().c_str(), isMultiFile );
 
     // Something has been read -> create data model tree
     LightApp_DataModel* aDM = dynamic_cast<LightApp_DataModel*>( dm );
@@ -521,7 +522,7 @@ QString SalomeApp_Study::newStudyName() const
   while ( newName.isEmpty() ){
     curName = prefix.arg( i );
     for ( j = 0 ; j < n; j++ ){
-      if ( !strcmp( studies[j].c_str(), curName.latin1() ) )
+      if ( !strcmp( studies[j].c_str(), curName.toLatin1() ) )
        break;
     }
     if ( j == n )
@@ -591,6 +592,16 @@ void SalomeApp_Study::RemoveTemporaryFiles ( const char* theModuleName, const bo
   }
 }
 
+/*!
+  Mark the study as saved in the file
+  \param theFileName - the name of file
+*/
+void SalomeApp_Study::markAsSavedIn(QString theFileName)
+{
+  setStudyName(theFileName);
+  setIsSaved(true);
+}
+
 /*!
   Deletes all references to object
   \param obj - object
@@ -616,7 +627,7 @@ void SalomeApp_Study::deleteReferencesTo( _PTR( SObject ) obj )
 */
 QString SalomeApp_Study::referencedToEntry( const QString& entry ) const
 {
-  _PTR(SObject) obj = studyDS()->FindObjectID( entry.latin1() );
+  _PTR(SObject) obj = studyDS()->FindObjectID( entry.toStdString() );
   _PTR(SObject) refobj;
 
   if( obj && obj->ReferencedObject( refobj ) )
@@ -629,7 +640,7 @@ QString SalomeApp_Study::referencedToEntry( const QString& entry ) const
 */
 QString SalomeApp_Study::componentDataType( const QString& entry ) const
 {
-  _PTR(SObject) obj( studyDS()->FindObjectID( entry.latin1() ) );
+  _PTR(SObject) obj( studyDS()->FindObjectID( entry.toStdString() ) );
   if ( !obj )
     return LightApp_Study::componentDataType( entry );
   return obj->GetFatherComponent()->ComponentDataType().c_str();
@@ -640,7 +651,7 @@ QString SalomeApp_Study::componentDataType( const QString& entry ) const
 */
 bool SalomeApp_Study::isComponent( const QString& entry ) const
 {
-  _PTR(SObject) obj( studyDS()->FindObjectID( entry.latin1() ) );
+  _PTR(SObject) obj( studyDS()->FindObjectID( entry.toStdString() ) );
   return obj && QString( obj->GetID().c_str() ) == obj->GetFatherComponent()->GetID().c_str();
 }
 
@@ -649,7 +660,7 @@ bool SalomeApp_Study::isComponent( const QString& entry ) const
 */
 void SalomeApp_Study::children( const QString& entry, QStringList& child_entries ) const
 {
-  _PTR(SObject) SO = studyDS()->FindObjectID( entry.latin1() );
+  _PTR(SObject) SO = studyDS()->FindObjectID( entry.toStdString() );
   _PTR(ChildIterator) anIter ( studyDS()->NewChildIterator( SO ) );
   anIter->InitEx( true );
   while( anIter->More() )
@@ -726,7 +737,7 @@ void SalomeApp_Study::setNameOfSavePoint(int savePoint, const QString& nameOfSav
 {
   _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint);
   _PTR(IParameters) ip = ClientFactory::getIParameters(AP);
-  ip->setProperty("AP_SAVEPOINT_NAME", nameOfSavePoint.latin1());
+  ip->setProperty("AP_SAVEPOINT_NAME", nameOfSavePoint.toStdString());
 }
 
 /*!
index 516df81d844f0afa9cb0c8714cfe05b3d04e56af..217423d1a173ce62d835677b21dbd761fa3460ff 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SALOMEAPP_STUDY_H
 #define SALOMEAPP_STUDY_H
@@ -22,7 +25,6 @@
 #include "SalomeApp.h"
 
 #include <LightApp_Study.h>
-#include <string>
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -40,7 +42,7 @@ public:
 
   virtual int         id() const;
 
-  virtual void        createDocument();
+  virtual bool        createDocument( const QString& );
   virtual bool        openDocument( const QString& );
   virtual bool        loadDocument( const QString& );
 
@@ -75,6 +77,7 @@ public:
   virtual std::string getVisualComponentName();
 
   virtual void        restoreState(int savePoint);
+  void                markAsSavedIn(QString theFileName);
 
 protected:
   virtual void        saveModuleData ( QString theModuleName, QStringList theListOfFiles );
index 830536676c97436dbfd420951f187806d9ce55c4..ee81e8ee159e8088995c5ab94eafd337ba46f72c 100644 (file)
@@ -1,28 +1,30 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  SALOME SalomeApp
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME SalomeApp
 //  File   : SalomeApp_StudyPropertiesDlg.cxx
 //  Author : Sergey ANIKIN
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SalomeApp_StudyPropertiesDlg.h"
 #include "SalomeApp_ListView.h"
 #include "SalomeApp_Study.h"
 #include <SUIT_Desktop.h>
 #include <SUIT_MessageBox.h>
 
-// OCCT Includes
-#include <OSD_Process.hxx>
-#include <Quantity_Date.hxx>
-
 // CORBA Headers
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
 
 // QT Includes
-#include <qpushbutton.h>
-#include <qlayout.h>
+#include <QPushButton>
+#include <QGridLayout>
 
 using namespace std;
 
@@ -59,7 +57,7 @@ public:
                     const QString       theName,
                     const bool          theEditable,
                     const int           theUserType) :
-  SalomeApp_ListViewItem( parent, theName, theEditable )
+  SalomeApp_ListViewItem( parent, QStringList(theName), theEditable )
   {
     setUserType(theUserType);
   }
@@ -141,24 +139,29 @@ public:
 
 /*!Constructor. Initialize study properties dialog.*/
 SalomeApp_StudyPropertiesDlg::SalomeApp_StudyPropertiesDlg(QWidget* parent)
-     : QDialog(parent, "", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
+     : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
        myChanged( false )
 {
-  setCaption(tr("TLT_STUDY_PROPERTIES"));
+  setObjectName( "" );
+  setModal( TRUE );
+
+  setWindowTitle(tr("TLT_STUDY_PROPERTIES"));
   setSizeGripEnabled( true );
 
-  clearWFlags(Qt::WStyle_ContextHelp);
+  setWindowFlags( windowFlags() ^ QFlags<Qt::WindowType>(!Qt::WindowContextHelpButtonHint) );
 
   QGridLayout* mainLayout = new QGridLayout(this);
   mainLayout->setMargin(DEFAULT_MARGIN);
   mainLayout->setSpacing(DEFAULT_SPACING);
 
   myPropList = new SalomeApp_ListView(this);
-  myPropList->addColumn("");
-  myPropList->addColumn("");
+  myPropList->setColumnCount(2);
+  QStringList aLabels;
+  aLabels << "" << "";
+  myPropList->setHeaderLabels( aLabels );
   myPropList->enableEditing(TRUE);
   myPropList->setMinimumSize(MIN_LIST_WIDTH, MIN_LIST_HEIGHT);
-  mainLayout->addMultiCellWidget(myPropList, 0, 0, 0, 2);
+  mainLayout->addWidget(myPropList, 0, 0, 1, 3);
 
   myOKBtn = new QPushButton(tr("BUT_OK"), this);
   mainLayout->addWidget(myOKBtn, 1, 0);
@@ -290,26 +293,25 @@ void SalomeApp_StudyPropertiesDlg::onOK()
     _PTR(AttributeStudyProperties) propAttr = myStudyDoc->GetProperties();
     //myChanged = propChanged();
     if ( propAttr /*&& myChanged*/ ) {
-      QListViewItemIterator it( myPropList );
+      QTreeWidgetItemIterator it( myPropList );
       // iterate through all items of the listview
-      for ( ; it.current(); ++it ) {
-       SalomeApp_PropItem* item = (SalomeApp_PropItem*)(it.current());
+      while (*it) {
+       SalomeApp_PropItem* item = (SalomeApp_PropItem*)(*it);
        switch (item->getUserType()) {
        case prpAuthorId:
-          if (QString(propAttr->GetUserName().c_str()) != item->getValue().stripWhiteSpace()) {
+          if (QString(propAttr->GetUserName().c_str()) != item->getValue().trimmed()) {
             if (!propAttr->IsLocked()) {
-              propAttr->SetUserName(item->getValue().stripWhiteSpace().latin1());
+              propAttr->SetUserName(item->getValue().trimmed().toStdString());
               myChanged = true;
             } else {
-              SUIT_MessageBox::warn1(SUIT_Session::session()->activeApplication()->desktop(),
-                                     QObject::tr("WRN_WARNING"),
-                                     QObject::tr("WRN_STUDY_LOCKED"),
-                                     QObject::tr("BUT_OK"));
+              SUIT_MessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(),
+                                      QObject::tr("WRN_WARNING"),
+                                      QObject::tr("WRN_STUDY_LOCKED") );
             }
           }
          break;
         //case prpModeId:
-       //  propAttr->SetCreationMode(item->getValue().stripWhiteSpace().latin1());
+       //  propAttr->SetCreationMode(item->getValue().trimmed().latin1());
        //  break;
        case prpLockedId:
           {
@@ -323,6 +325,7 @@ void SalomeApp_StudyPropertiesDlg::onOK()
        default:
          break;
        }
+       ++it;
       }
     }
     accept();
@@ -336,18 +339,19 @@ bool SalomeApp_StudyPropertiesDlg::propChanged()
 {
   _PTR(AttributeStudyProperties) propAttr = myStudyDoc->GetProperties();
   if (propAttr) {
-    QListViewItemIterator it (myPropList);
+    QTreeWidgetItemIterator it (myPropList);
+
     // iterate through all items of the listview
-    for (; it.current(); ++it) {
-      SalomeApp_PropItem* item = (SalomeApp_PropItem*)(it.current());
+    while (*it) {
+      SalomeApp_PropItem* item = (SalomeApp_PropItem*)(*it);
       switch (item->getUserType()) {
       case prpAuthorId:
-       if ( QString( propAttr->GetUserName().c_str() ) != item->getValue().stripWhiteSpace() ) {
+       if ( QString( propAttr->GetUserName().c_str() ) != item->getValue().trimmed() ) {
          return true;
        }
        break;
       //case prpModeId:
-      //  if ( QString( propAttr->GetCreationMode().c_str() ) != item->getValue().stripWhiteSpace() ) {
+      //  if ( QString( propAttr->GetCreationMode().c_str() ) != item->getValue().trimmed() ) {
       //    return true;
       //  }
       //  break;
@@ -362,6 +366,7 @@ bool SalomeApp_StudyPropertiesDlg::propChanged()
       default:
        break;
       }
+      ++it;
     }
   }
   return false;
index 4abedf932d159a0db2474c4bfbcaff27deccde48..ce56f996e97eee3c2a73579355233976316a950b 100644 (file)
@@ -1,34 +1,34 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SalomeApp_StudyPropertiesDlg.h
 //  Author : Sergey ANIKIN
 //  Module : SALOME
-
+//
 #ifndef SALOMEAPP_STUDY_PROPERTIES_DLG_H
 #define SALOMEAPP_STUDY_PROPERTIES_DLG_H
 
 #include "SalomeApp.h"
-#include <SALOMEDSClient_definitions.hxx>
-#include <qdialog.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qlistview.h>
+
+#include <QDialog>
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOMEDS)
@@ -37,7 +37,6 @@
 
 class SalomeApp_ListView;
 class QPushButton;
-class QToolButton;
 
 class SALOMEAPP_EXPORT SalomeApp_StudyPropertiesDlg : public QDialog
 { 
index a20fbf0c8efdfb99e36562859456bcc2b42a5779..eeb12e91ff4f7fa1d04d871af3ccbffb61388ef9 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SalomeApp_Tools.h"
 
 
 #include <utilities.h>
 
+#include <QColor>
+#include <QString>
+
+#include <Quantity_Color.hxx>
+
 /*!
   Convert QColor to Quantity_Color, if QColor is valid.
 */
@@ -111,10 +119,10 @@ void SalomeApp_Tools::QtCatchCorbaException( const SALOME::SALOME_Exception& S_e
   }
 
   if ( error )
-    SUIT_MessageBox::error1( SUIT_Session::session()->activeApplication()->desktop(),
-                                  title, message, QObject::tr( "OK" ) );
+    SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
+                              title, message );
   else
-    SUIT_MessageBox::warn1( SUIT_Session::session()->activeApplication()->desktop(),
-                                 title, message, QObject::tr( "OK" ) );
+    SUIT_MessageBox::warning( SUIT_Session::session()->activeApplication()->desktop(),
+                             title, message );
 
 }
index a6f1e06dc5073791c28c09fda421f6884f1f8e94..f341a2824f3fc512d23182e7212ac92acbf48529 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SALOMEAPP_TOOLS_H
 #define SALOMEAPP_TOOLS_H
 
 #include <SUIT_Tools.h>
 
-#include <qcolor.h>
-#include <qstring.h>
+class QColor;
+class QString;
 
-#include <Quantity_Color.hxx>
+class Quantity_Color;
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(SALOME_Exception)
index c8291220752aafbdf3b1cf6ca7cf5d541ed9985b..9e603dcadbdf62365bd5750abc53db1871398dd2 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SalomeApp_TypeFilter.h"
 
@@ -50,11 +53,11 @@ bool SalomeApp_TypeFilter::isOk( const SUIT_DataOwner* sOwner ) const
       _PTR(Study) aStudy = aDoc->studyDS();
       QString entry = owner->entry();
       
-      _PTR(SObject) aSObj( aStudy->FindObjectID( entry.latin1() ) );
+      _PTR(SObject) aSObj( aStudy->FindObjectID( entry.toStdString() ) );
       if (aSObj)
        {
          _PTR(SComponent) aComponent(aSObj->GetFatherComponent());
-         if ( aComponent && (aComponent->ComponentDataType() == myKind.latin1()) )
+         if ( aComponent && (aComponent->ComponentDataType() == myKind.toStdString()) )
            return true;
        }
     }
index 533ea72696a841aa342e9430ecc9397c266f4c67..403e77ae2c2f3e991d12b0bbb2b3565c764849a3 100644 (file)
@@ -1,25 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SALOMEAPP_TYPEFILTER_H
 #define SALOMEAPP_TYPEFILTER_H
 
-#include <qstring.h>
+#include <QString>
 
 #include "SalomeApp_Filter.h"
 
index 08afaeddaeb44a03b30b96fb8fbc4daacb033738..0244b0ac4a57185a6a923e255bd875cce9cfeeb2 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SalomeApp_VisualState.h"
 
 #include "SalomeApp_Study.h"
 #include "SalomeApp_Application.h"
 
-#include <SUIT_ResourceMgr.h>
+//#include <SUIT_ResourceMgr.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_ViewWindow.h>
 #include <QtxWorkstack.h>
 
 #include <STD_TabDesktop.h>
 
-#include <qptrlist.h>
-#include <qapplication.h>
-#include <qdict.h>
+#include <QList>
+#include <QApplication>
+#include <QMultiHash>
 
-#include <SALOMEDSClient_ClientFactory.hxx>
-#include <SALOMEDSClient_IParameters.hxx>
+#include <SALOMEDSClient_ClientFactory.hxx>//?
+#include <SALOMEDSClient_IParameters.hxx>//?
 
-#include <vector>
-#include <string>
+#include <vector>//?
+#include <string>//?
 
 /*!
   Constructor.
 */
 SalomeApp_VisualState::SalomeApp_VisualState( SalomeApp_Application* app )
-  : myApp( app )
+  : QObject(),
+    myApp( app )
 {
 }  
 
@@ -64,28 +70,33 @@ SalomeApp_VisualState::~SalomeApp_VisualState()
 */
 void nameViewWindows( const ViewManagerList& lst )
 {
-  QDict<int> viewersCounter; // map viewerType - to - index_of_this_viewer_type
-  viewersCounter.setAutoDelete( true );
-  for ( QPtrListIterator<SUIT_ViewManager> it(lst); it.current(); ++it) {
-    int view_count = it.current()->getViewsCount();
-    QString vType = it.current()->getType();
+  QMultiHash<QString,int> viewersCounter; // map viewerType - to - index_of_this_viewer_type
+  QListIterator<SUIT_ViewManager*> it(lst);
+  SUIT_ViewManager* aVM = 0;
+  while ( it.hasNext() ) {
+    aVM = it.next();
+    if ( !aVM ) continue;
+
+    int view_count = aVM->getViewsCount();
+    QString vType = aVM->getType();
     if ( !view_count )
       continue; //No views is opened in the viewer
     
-    int* viewerID = viewersCounter[ vType ];
+    int viewerID = viewersCounter.value( vType );
     if ( !viewerID ) {
-      viewerID = new int( 0 );
+      viewerID = 0;
       viewersCounter.insert( vType, viewerID );
     }
     else
-      ++(*viewerID);
+      ++viewerID;
 
-    QPtrVector<SUIT_ViewWindow> views = it.current()->getViews();
+    QVector<SUIT_ViewWindow*> views = aVM->getViews();
     for ( int i = 0; i < view_count; i++ )  {
-      QString vName = QString( "%1_%2_%3" ).arg( vType ).arg( *viewerID ).arg( i );
-      views[i]->setName( vName );
+      QString vName = QString( "%1_%2_%3" ).arg( vType ).arg( viewerID ).arg( i );
+      views[i]->setObjectName( vName );
     }
   }
+  viewersCounter.clear();
 }
 
 /*!
@@ -117,23 +128,26 @@ int SalomeApp_VisualState::storeState()
   // store active window's name
   SUIT_ViewWindow* win = myApp->desktop()->activeWindow();  
   if ( win )
-    ip->setProperty("AP_ACTIVE_VIEW", win->name() );
+    ip->setProperty("AP_ACTIVE_VIEW", win->objectName().toStdString() );
 
   int viewerID = 0;
   SUIT_ViewManager* vm = 0;
-  for (QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
-    vm = it.current();
+  QListIterator<SUIT_ViewManager*> it( lst );
+  while ( it.hasNext() ) {
+    vm = it.next();
+    if ( !vm ) continue;
+
     int view_count = vm->getViewsCount();
     if ( !view_count ) 
       continue; //No views is opened in the viewer
       
-    std::string viewerEntry = QString( "%1_%2" ).arg( vm->getType() ).arg( ++viewerID ).latin1();
+    std::string viewerEntry = QString( "%1_%2" ).arg( vm->getType() ).arg( ++viewerID ).toStdString();
     ip->append("AP_VIEWERS_LIST", viewerEntry);
     
-    QPtrVector<SUIT_ViewWindow> views = vm->getViews();
+    QVector<SUIT_ViewWindow*> views = vm->getViews();
     for(int i = 0; i<view_count; i++) {
-      ip->append( viewerEntry, views[i]->caption().latin1() );
-      ip->append( viewerEntry, views[i]->getVisualParameters().latin1() );
+      ip->append( viewerEntry, views[i]->windowTitle().toStdString() );
+      ip->append( viewerEntry, views[i]->getVisualParameters().toStdString() );
     }
   }
 
@@ -142,20 +156,24 @@ int SalomeApp_VisualState::storeState()
     QtxWorkstack* workstack = ((STD_TabDesktop*)myApp->desktop())->workstack();
     QString workstackInfo;
     (*workstack) >> workstackInfo;
-    ip->setProperty( "AP_WORKSTACK_INFO", workstackInfo.latin1() );
+    ip->setProperty( "AP_WORKSTACK_INFO", workstackInfo.toStdString() );
   }
   
   //Save a name of the active module
   if ( CAM_Module* activeModule = myApp->activeModule() ) 
-    ip->setProperty( "AP_ACTIVE_MODULE", activeModule->moduleName().latin1() );
+    ip->setProperty( "AP_ACTIVE_MODULE", activeModule->moduleName().toStdString() );
 
   //Store visual parameters of the modules
-  QPtrList<CAM_Module> mlist; 
+  QList<CAM_Module*> mlist; 
   myApp->modules( mlist );
+  QListIterator<CAM_Module*> itM( mlist );
   CAM_Module* module = 0;
-  for ( module = mlist.first(); module; module = mlist.next() ) {
+  while ( itM.hasNext() ) {
+    module = itM.next();
+    if ( !module ) continue;
+
     if ( SalomeApp_Module* sModule = dynamic_cast<SalomeApp_Module*>( module ) ) {
-      ip->append( "AP_MODULES_LIST", sModule->moduleName().latin1() );
+      ip->append( "AP_MODULES_LIST", sModule->moduleName().toStdString() );
       sModule->storeVisualParameters( savePoint );
     }
   }
@@ -178,11 +196,14 @@ void SalomeApp_VisualState::restoreState(int savePoint)
   _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName(), savePoint );
   _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
 
+  qApp->installEventFilter( this );
+
   //Remove all already existent veiwers and their views
   ViewManagerList lst;
   myApp->viewManagers( lst );
-  for ( QPtrListIterator<SUIT_ViewManager> it(lst); it.current(); ++it ) {
-    myApp->removeViewManager( it.current() );
+  QListIterator<SUIT_ViewManager*> it(lst);
+  while ( it.hasNext() ) {
+    myApp->removeViewManager( it.next() );
     qApp->processEvents();
   }
   //Restore the viewers and view windows
@@ -191,7 +212,7 @@ void SalomeApp_VisualState::restoreState(int savePoint)
 
   // parameters of view windows are stored in a map for restoring after restoring of the workstack
   QMap<SUIT_ViewWindow*, QString> viewersParameters;
-
+  
   for ( int i = 0; i < nbViewers; i++ ) {
     std::string viewerEntry = ip->getValue( "AP_VIEWERS_LIST", i );
     std::vector<std::string> veiewerParams = ip->parseValue(viewerEntry,'_');
@@ -216,7 +237,7 @@ void SalomeApp_VisualState::restoreState(int savePoint)
     }
 
     //Resize the views, set their captions and apply visual parameters.
-    QPtrVector<SUIT_ViewWindow> views = vm->getViews();  
+    QVector<SUIT_ViewWindow*> views = vm->getViews();  
     for (int i = 0, j = 0; i<viewCount; i++, j+=2) {
       viewWin = views[i];
       if ( !viewWin ) 
@@ -226,7 +247,7 @@ void SalomeApp_VisualState::restoreState(int savePoint)
       while ( !vm->isVisible() )
        qApp->processEvents();
       
-      viewWin->setCaption(ip->getValue(viewerEntry, j).c_str());
+      viewWin->setWindowTitle(ip->getValue(viewerEntry, j).c_str());
       
       //      printf ( "VP for viewWin \"%s\": %s\n", viewerEntry.c_str(), ip->getValue(viewerEntry, j+1).c_str() );
       viewersParameters[ viewWin ] = ip->getValue(viewerEntry, j+1).c_str();
@@ -246,14 +267,18 @@ void SalomeApp_VisualState::restoreState(int savePoint)
   // so here we store their visual parameters for later restoring..
   lst.clear();
   myApp->viewManagers(lst);
-  QPtrListIterator<SUIT_ViewManager> it( lst );
-  for ( ; it.current(); ++it ) {
-    int view_count = it.current()->getViewsCount();
-    QPtrVector<SUIT_ViewWindow> views = it.current()->getViews();
+  QListIterator<SUIT_ViewManager*> itVM( lst );
+  SUIT_ViewManager* aVM = 0;
+  while ( itVM.hasNext() ) {
+    aVM = itVM.next();
+    if ( !aVM ) continue;
+
+    int view_count = aVM->getViewsCount();
+    QVector<SUIT_ViewWindow*> views = aVM->getViews();
     for ( int i = 0; i < view_count; i++ ) {
       if ( !viewersParameters.contains( views[i] ) ) {
        viewersParameters[ views[i] ] = views[i]->getVisualParameters();
-       //      printf ( "store VP for viewWin \"%s\": %s\n", views[i]->name(), views[i]->getVisualParameters().latin1() );
+       //      printf ( "store VP for viewWin \"%s\": %s\n", views[i]->name(), views[i]->getVisualParameters().toLatin1().constData() );
       }
     }
   }  
@@ -280,10 +305,12 @@ void SalomeApp_VisualState::restoreState(int savePoint)
   std::string activeViewName = ip->getProperty("AP_ACTIVE_VIEW");
   QMap<SUIT_ViewWindow*, QString>::Iterator mapIt;
   for ( mapIt = viewersParameters.begin(); mapIt != viewersParameters.end(); ++mapIt ) {
-    mapIt.key()->setVisualParameters( mapIt.data() );
-    if ( activeViewName == mapIt.key()->name() )
+    mapIt.key()->setVisualParameters( mapIt.value() );
+    if ( activeViewName == mapIt.key()->objectName().toStdString() )
       mapIt.key()->setFocus();
   }
+
+  qApp->removeEventFilter( this );
   
   //  for ( it.toFirst(); it.current(); ++it ) {
   //    int view_count = it.current()->getViewsCount();
@@ -303,3 +330,21 @@ void SalomeApp_VisualState::restoreState(int savePoint)
   //    }
   //  }
 }
+
+/*!
+  Custom event filter
+*/
+bool SalomeApp_VisualState::eventFilter( QObject* o, QEvent* e )
+{
+  // eat keyboard and mouse events
+  QEvent::Type aType = e->type();
+  if ( aType == QEvent::MouseButtonDblClick ||
+       aType == QEvent::MouseButtonPress ||
+       aType == QEvent::MouseButtonRelease ||
+       aType == QEvent::MouseMove ||
+       aType == QEvent::KeyPress ||
+       aType == QEvent::KeyRelease )
+    return true;
+  
+  return QObject::eventFilter( o, e );
+}
index dae7fc091631906e70722b6bccc90f4946bd1add..0720f31afb7b32e5e64df111e9304b37d77cce0f 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef SALOMEAPP_VISUALSTATE_H
 #define SALOMEAPP_VISUALSTATE_H
 
 #include "SalomeApp.h"
 
+#include <QObject>
+
 class SalomeApp_Application;
 
-class SALOMEAPP_EXPORT SalomeApp_VisualState
+class SALOMEAPP_EXPORT SalomeApp_VisualState: public QObject
 {
 public:
   SalomeApp_VisualState( SalomeApp_Application* );
@@ -36,6 +41,9 @@ public:
   virtual int            storeState();
   virtual void           restoreState( int savePoint );
 
+private:
+   virtual bool eventFilter( QObject* o, QEvent* e );
+
 protected:
   SalomeApp_Application* myApp;
 };
index 3971f30d0d7753d088588d95cc4365e7727fea88..9ed60c64a72a70809baf7510a8ace8dc99a9a01c 100644 (file)
@@ -1,47 +1,46 @@
-#  SALOMELocalTrace : log on local machine
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOMELocalTrace : log on local machine
 #  File   : Makefile.in
 #  Author : Sergey RUIN
 #  Module : SALOME
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-lib_LTLIBRARIES= libSalomeAppTest.la
+lib_LTLIBRARIES = libSalomeAppTest.la
 
-salomeinclude_HEADERS= SalomeAppTest.hxx
+salomeinclude_HEADERS = SalomeAppTest.hxx
 
-dist_libSalomeAppTest_la_SOURCES= SalomeAppTest.cxx
+dist_libSalomeAppTest_la_SOURCES = SalomeAppTest.cxx
 
-libSalomeAppTest_la_CXXFLAGS= @CPPUNIT_INCLUDES@ $(KERNEL_CXXFLAGS)
-libSalomeAppTest_la_LIBADD= @CPPUNIT_LIBS@
+libSalomeAppTest_la_CXXFLAGS = @CPPUNIT_INCLUDES@ $(KERNEL_CXXFLAGS)
+libSalomeAppTest_la_LIBADD   = @CPPUNIT_LIBS@
 
-bin_PROGRAMS= TestSalomeApp
+bin_PROGRAMS = TestSalomeApp
 
-TestSalomeApp_SOURCES= TestSalomeApp.cxx
+TestSalomeApp_SOURCES = TestSalomeApp.cxx
 
-TestSalomeApp_CXXFLAGS= $(libSalomeAppTest_la_CXXFLAGS)
-TestSalomeApp_LDADD= $(libSalomeAppTest_la_LIBADD) libSalomeAppTest.la
+TestSalomeApp_CXXFLAGS = $(libSalomeAppTest_la_CXXFLAGS)
+TestSalomeApp_LDADD    = $(libSalomeAppTest_la_LIBADD) libSalomeAppTest.la
 
 dist_salomescript_PYTHON = TestSalomeApp.py
 UNIT_TEST_PROG = TestSalomeApp
index e05206e21faa41bdf630908dc700390dd078f2aa..b49a59dd84fd3b411c618217b843782667222955 100644 (file)
@@ -1,23 +1,24 @@
-// Copyright (C) 2006  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "SalomeAppTest.hxx"
 
 using namespace std;
index 97dd581469dd5eec437139ac99029667976b1c25..c2cab3bf10f51660647bc2664e5b8290545643f0 100644 (file)
@@ -1,23 +1,24 @@
-// Copyright (C) 2006  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef _SalomeAppTEST_HXX_
 #define _SalomeAppTEST_HXX_
 
index 5e8ca565eca094f6ddf4aa4c476f3c34fd7163fb..bc917025cbb01f7496167d72e531795c06cb599a 100644 (file)
@@ -1,25 +1,26 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 // --- include all SalomeApp Test from basics until the present directory
-
+//
 #include "SalomeAppTest.hxx"
 
 // --- Registers the fixture into the 'registry'
index e636e1fc94152f4acfa9431945ab027aebe6ae8c..a7bcb4cd96d38b6cb2eb001bccfdd3abb537dcc0 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
@@ -14,9 +17,8 @@
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
 import sys, os,signal,string,commands
 import runSalome
 import orbmodule
index b4da14ade74a1c052b62cee9bb06bfbdbdd3f0bc..b95d46a34a59e47eb71c52c76f34776cdbb310db 100644 (file)
@@ -1,3 +1,26 @@
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
 <document>
   <section name="launch">
     <!-- SALOME launching parameters -->
@@ -12,7 +35,7 @@
     <parameter name="killall"    value="no"/>
     <parameter name="pinter"     value="no"/>
     <parameter name="noexcepthandler"  value="no"/>
-    <parameter name="modules"    value="GEOM,SMESH,VISU,SUPERV,MED,COMPONENT,PYCALCULATOR"/>
+    <parameter name="modules"    value="GEOM,SMESH,VISU,MED,YACS"/>
     <parameter name="pyModules"  value=""/>
     <parameter name="embedded"   value="SalomeAppEngine,study,cppContainer,registry,moduleCatalog"/>
     <parameter name="standalone" value="pyContainer,supervContainer"/>
   </section>
   <section name="splash" >
     <!-- Splash screen settings -->
-    <parameter name="image"           value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
-    <parameter name="info"            value="%V" />
-    <parameter name="text_colors"     value="#FFFFFF" />
-    <parameter name="progress_colors" value="#c33232|#d1d1d1|0" />
-    <parameter name="margin"          value="26" />
+    <parameter name="image"             value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
+    <parameter name="constant_info"     value="%A [ %V ]" />
+    <parameter name="text_colors"       value="#eeeeff|#555555" />
+    <parameter name="hide_on_click"     value="no" />
+    <parameter name="show_progress"     value="yes" />
+    <parameter name="show_message"      value="yes" />
+    <parameter name="show_percents"     value="yes" />
+    <parameter name="margin"            value="40" />
+    <parameter name="progress_width"    value="20" />
+    <parameter name="progress_flags"    value="bottom,left_to_right" />
+    <parameter name="opacity"           value="0.70" />
+    <parameter name="font"              value="Tahoma,12,normal" />
+    <parameter name="alignment"         value="top,left" />
+    <parameter name="progress_colors"   value="#3b3e5d|#d14949|v" />
   </section>
   <section name="resources">
     <!-- Resource directories (resource manager)-->
@@ -39,7 +71,9 @@
     <parameter name="GLViewer"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="OCCViewer"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="VTKViewer"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+    <parameter name="QxSceneViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="SVTK"         value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+    <parameter name="PyConsole"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="LightApp"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="SalomeApp"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="OB"           value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <!-- Here the environment variables are used in upper case, -->
     <!-- In SMESH/resources/SalomeApp.xml case-sensitive notation is used. -->
     <!-- As a result, both variants are acceptable. -->
-    <parameter name="NETGENPlugin" value="${NETGENPLUGIN_ROOT_DIR}/share/salome/resources/netgenplugin"/>
-    <parameter name="GHS3DPlugin"  value="${GHS3DPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dplugin"/>
-    <parameter name="BLSURFPlugin" value="${BLSURFPLUGIN_ROOT_DIR}/share/salome/resources"/>
-    <parameter name="HexoticPLUGIN" value="${HexoticPLUGIN_ROOT_DIR}/share/salome/resources"/>
+    <parameter name="NETGENPlugin"   value="${NETGENPLUGIN_ROOT_DIR}/share/salome/resources/netgenplugin"/>
+    <parameter name="GHS3DPlugin"    value="${GHS3DPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dplugin"/>
+    <parameter name="BLSURFPlugin"   value="${BLSURFPLUGIN_ROOT_DIR}/share/salome/resources/blsurfplugin"/>
+    <parameter name="HexoticPLUGIN"  value="${HexoticPLUGIN_ROOT_DIR}/share/salome/resources/hexoticplugin"/>
+    <parameter name="GHS3DPRLPlugin" value="${GHS3DPRLPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dprlplugin"/>
   </section>
   <section name="SMESH">
     <!-- Default SMESH module plugins -->
-    <parameter name="plugins" value="NETGENPlugin,GHS3DPlugin,BLSURFPlugin,HexoticPLUGIN"/>
+    <parameter name="plugins" value="NETGENPlugin,GHS3DPlugin,GHS3DPRLPlugin,HexoticPLUGIN,BLSURFPlugin"/>
   </section>
   <section name="desktop" >
     <!-- Default GUI desktop state, position, size -->
-    <parameter name="state"  value="normal"/>
-    <parameter name="pos_x"  value="center"/>
-    <parameter name="pos_y"  value="center"/>
-    <parameter name="width"  value="800"/>
-    <parameter name="height" value="600"/>
+    <parameter name="geometry"  value="80%%x80%%+10%%+10%%"/>
+  </section>
+  <section name="Style">
+    <!-- Style and theme preferences -->
+    <parameter name="use_salome_style" value="true" />
   </section>
   <section name="ObjectBrowser" >
     <!-- Object Browser preferences -->
-    <parameter name="auto_size"           value="false" />
-    <parameter name="auto_size_first"     value="true"  />
-    <parameter name="visibility_column_0" value="true"  />
-    <parameter name="visibility_column_1" value="false" />
-    <parameter name="visibility_column_2" value="false" />
-    <parameter name="visibility_column_3" value="false" />
+    <parameter name="auto_hide_search_tool" value="true" />
+    <parameter name="auto_size"             value="false" />
+    <parameter name="auto_size_first"       value="true"  />
+    <parameter name="resize_on_expand_item" value="false"  />
+    <parameter name="visibility_column_id_1" value="true"  />
+    <parameter name="visibility_column_id_2" value="true" />
+    <parameter name="visibility_column_id_3" value="true" />
+    <parameter name="visibility_column_id_4" value="true" />
   </section>
   <section name="PyConsole">
     <!-- Python console preferences -->
     <parameter name="background"     value="0, 0, 0" />
     <parameter name="trihedron_size" value="105" />
     <parameter name="relative_size"  value="true" />
+    <parameter name="use_advanced_selection_algorithm" value="true" />
+    <parameter name="recorder_mode"        value="1"    />
+    <parameter name="recorder_fps"         value="17.3" />
+    <parameter name="recorder_quality"     value="100"  />
+    <parameter name="recorder_progressive" value="true" />
  </section>
  <section name="Plot2d" >
     <!-- Plot2d viewer preferences -->
     <parameter name="Title"      value="63, 213, 255"  />
     <parameter name="NodeBody"   value="255, 249, 147" />
   </section>
+  <section name="MRU" >
+    <!-- Show "Most recently used" studies-->
+    <parameter name="show_mru" value="true"/>
+    <!-- Max number of stored "Most recently used" studies-->
+    <parameter name="max_count" value="50"/>
+    <!-- Max visible number of "Most recently used" studies-->
+    <parameter name="visible_count" value="7"/>
+    <!-- Insert mode-->
+    <parameter name="insert_mode" value="0"/>
+    <!-- Link type-->
+    <parameter name="link_type" value="0"/>
+    <!-- Show "Clear" item-->
+    <parameter name="show_clear" value="true"/>
+  </section> 
   <section name="QxGraph" >
     <!-- QxGraph viewer preferences -->
     <parameter name="Background" value="144, 208, 211" />
     <parameter name="Title"      value="63, 213, 255"  />
     <parameter name="NodeBody"   value="255, 249, 147" />
   </section>
+  <section name="QxSceneViewer" >
+    <!-- QxGraph viewer preferences -->
+    <parameter name="Background" value="144, 208, 211" />
+    <parameter name="Title"      value="63, 213, 255"  />
+    <parameter name="NodeBody"   value="255, 249, 147" />
+  </section>
   <section name="FileDlg" >
     <!-- "Open/Save File" dialog box preferences-->
     <parameter name="QuickDirList" value="${DATA_DIR}" />
index 25df26cd8032315298ff23e154da736576a6c339..73b029b7986d24dc53c3c27227e8ad3f66e03dbe 100644 (file)
@@ -1,25 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      SalomeApp_images.po
-// Created:   November, 2004
-// Author:    OCC team
-// Copyright (C) CEA 2004
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
 msgid ""
 msgstr ""
diff --git a/src/SalomeApp/resources/SalomeApp_images.ts b/src/SalomeApp/resources/SalomeApp_images.ts
new file mode 100644 (file)
index 0000000..f6152fb
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+</TS>
index d6a6d6d90d3d8d6fa40d414aa2b4d6a329cdd75c..0ca26a41403704bd853e44ecd5f42d6ea95669bb 100644 (file)
@@ -1,24 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:      SalomeApp_msg_en.po
-// Created:   10/25/2004 12:46:36 PM
-// Author:    Sergey LITONIN
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
 msgid ""
 msgstr ""
@@ -48,7 +48,7 @@ msgid "SalomeApp_Application::TOT_DESK_FILE_DUMP_STUDY"
 msgstr "Dump study"
 
 msgid "SalomeApp_Application::MEN_DESK_FILE_DUMP_STUDY"
-msgstr "&Dump study..."
+msgstr "&Dump Study..."
 
 msgid "SalomeApp_Application::PRP_DESK_FILE_DUMP_STUDY"
 msgstr "Dumps study to the python script"
@@ -66,7 +66,7 @@ msgid "SalomeApp_Application::TOT_DESK_FILE_LOAD_SCRIPT"
 msgstr "Load python script"
 
 msgid "SalomeApp_Application::MEN_DESK_FILE_LOAD_SCRIPT"
-msgstr "Load scrip&t..."
+msgstr "Load Scrip&t..."
 
 msgid "SalomeApp_Application::PRP_DESK_FILE_LOAD_SCRIPT"
 msgstr "Loads python script from file"
@@ -81,7 +81,7 @@ msgid "SalomeApp_Application::TOT_DESK_CATALOG_GENERATOR"
 msgstr "Catalog generator"
 
 msgid "SalomeApp_Application::MEN_DESK_CATALOG_GENERATOR"
-msgstr "Catalog &generator"
+msgstr "Catalog &Generator"
 
 msgid "SalomeApp_Application::PRP_DESK_CATALOG_GENERATOR"
 msgstr "Generates XML catalog of a component's interface"
@@ -90,7 +90,7 @@ msgid "SalomeApp_Application::TOT_DESK_REGISTRY_DISPLAY"
 msgstr "Registry display"
 
 msgid "SalomeApp_Application::MEN_DESK_REGISTRY_DISPLAY"
-msgstr "Registry &display"
+msgstr "Registry &Display"
 
 msgid "SalomeApp_Application::PRP_DESK_REGISTRY_DISPLAY"
 msgstr "Displays content of the Registry CORBA server"
@@ -99,7 +99,7 @@ msgid "SalomeApp_Application::TOT_DESK_MRU"
 msgstr "Most recently used"
 
 msgid "SalomeApp_Application::MEN_DESK_MRU"
-msgstr "Most recently used"
+msgstr "Most Recently Used"
 
 msgid "SalomeApp_Application::TOT_DESK_PROPERTIES"
 msgstr "Study properties"
@@ -136,7 +136,7 @@ msgstr "Save GUI state"
 //=======================================================================================
 
 msgid "SalomeApp_Application::MEN_WINDOWS_NEW"
-msgstr "New window"
+msgstr "New Window"
 
 msgid "SalomeApp_Application::MEN_VIEW_WNDS"
 msgstr "Windows"
@@ -155,10 +155,10 @@ msgid "SalomeApp_Application::OBJ_BROWSER_NAME"
 msgstr "Object"
 
 msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_0"
-msgstr "Value"
+msgstr "Entry"
 
 msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_1"
-msgstr "Entry"
+msgstr "Value"
 
 msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_2"
 msgstr "IOR"
@@ -221,9 +221,6 @@ msgstr "Publish in study"
 msgid "SalomeApp_Application::WRN_DUMP_STUDY_FAILED"
 msgstr "Dump study failed"
 
-msgid "SalomeApp_Application::WRN_FILE_NAME_BAD"
-msgstr "Please enter correct file name"
-
 msgid "SAVE_POINT_OBJECT_TOOLTIP"
 msgstr "Saved GUI state: %1"
 
@@ -250,23 +247,23 @@ msgstr "Rename"
 msgid "SalomeApp_Application::MEN_DELETE_VS"
 msgstr "Delete"
 
-msgid "SalomeApp_Application::APPCLOSE_CAPTION"
-msgstr "Close study"
+//=======================================================================================
 
-msgid "SalomeApp_Application::APPCLOSE_DESCRIPTION"
-msgstr "Do you want to save or unload study before closing?"
+msgid "SalomeApp_Application::APPCLOSE_SAVE"
+msgstr "&Save&&Close"
 
 msgid "SalomeApp_Application::APPCLOSE_CLOSE"
 msgstr "&Close w/o saving"
 
-msgid "SalomeApp_Application::APPCLOSE_SAVE"
-msgstr "&Save && Close"
-
 msgid "SalomeApp_Application::APPCLOSE_UNLOAD"
 msgstr "&Unload"
 
-msgid "SalomeApp_ExitDlg::SHUTDOWN_SERVERS"
-msgstr "Shutdown standalone servers"
+msgid "SalomeApp_Application::APPCLOSE_CANCEL"
+msgstr "&Cancel"
+
+msgid "SalomeApp_Application::APPCLOSE_CAPTION"
+msgstr "Close active study"
+
+msgid "SalomeApp_Application::APPCLOSE_DESCRIPTION"
+msgstr "Do you want to close or only unload the study"
 
-msgid "SalomeApp_Application::ACTIVATE_MODULE_OP_LOAD"
-msgstr "&Load..."
diff --git a/src/SalomeApp/resources/SalomeApp_msg_en.ts b/src/SalomeApp/resources/SalomeApp_msg_en.ts
new file mode 100644 (file)
index 0000000..2252e9a
--- /dev/null
@@ -0,0 +1,451 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>WRN_FILE_NAME_BAD</source>
+        <translation>Please enter correct file name. Special characters are not allowed.</translation>
+    </message>
+    <message>
+        <source>CLOSE_LOCKED_STUDY</source>
+        <translation>Close locked study?</translation>
+    </message>
+    <message>
+        <source>PUBLISH_IN_STUDY</source>
+        <translation>Publish in study</translation>
+    </message>
+    <message>
+        <source>BUT_NEW</source>
+        <translation>&amp;New</translation>
+    </message>
+    <message>
+        <source>SAVE_POINT_ROOT_NAME</source>
+        <translation>GUI states</translation>
+    </message>
+    <message>
+        <source>SAVE_POINT_ROOT_TOOLTIP</source>
+        <translation>Persistent GUI states</translation>
+    </message>
+    <message>
+        <source>SAVE_GUI_STATE</source>
+        <translation>Save GUI state</translation>
+    </message>
+    <message>
+        <source>BUT_LOAD</source>
+        <translation>&amp;Load</translation>
+    </message>
+    <message>
+        <source>BUT_OPEN</source>
+        <translation>&amp;Open</translation>
+    </message>
+    <message>
+        <source>SAVE_POINT_OBJECT_TOOLTIP</source>
+        <translation>Saved GUI state: %1</translation>
+    </message>
+    <message>
+        <source>SAVE_POINT_DEF_NAME</source>
+        <translation>GUI state: </translation>
+    </message>
+    <message>
+        <source>VALUE_COLUMN</source>
+        <translation>Value</translation>
+    </message>
+    <message>
+        <source>IOR_COLUMN</source>
+        <translation>IOR</translation>
+    </message>
+    <message>
+        <source>REFENTRY_COLUMN</source>
+        <translation>Ref.Entry</translation>
+    </message>
+    <message>
+        <source>ERR_INCOMPATIBLE_TYPE</source>
+        <translation>Variable with name "%1" has incompatible numeric type</translation>
+    </message>
+    <message>
+        <source>ERR_INVALID_VALUE</source>
+        <translation>Value hasn't been validated</translation>
+    </message>
+    <message>
+        <source>ERR_NO_VARIABLE</source>
+        <translation>Variable with name "%1" doesn't exist</translation>
+    </message>
+</context>
+<context>
+    <name>SalomeApp_Application</name>
+    <message>
+        <source>ALL_FILES_FILTER</source>
+        <translation>All files (*.*)</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_UNLOAD</source>
+        <translation>&amp;Unload</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_CLOSE</source>
+        <translation>&amp;Close w/o saving</translation>
+    </message>
+    <message>
+        <source>MEN_WINDOWS_NEW</source>
+        <translation>New Window</translation>
+    </message>
+    <message>
+        <source>MEN_DELETE_INVALID_REFERENCE</source>
+        <translation>Delete Invalid Reference</translation>
+    </message>
+    <message>
+        <source>TOT_FILE_DESK_PREFERENCES</source>
+        <translation>Preferences</translation>
+    </message>
+    <message>
+        <source>MEN_DELETE_VS</source>
+        <translation>Delete</translation>
+    </message>
+    <message>
+        <source>MEN_OPENWITH</source>
+        <translation>Activate %1 Module</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_REGISTRY_DISPLAY</source>
+        <translation>Registry &amp;Display</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_SAVE</source>
+        <translation>&amp;Save &amp;&amp; Close</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_LOAD_SCRIPT</source>
+        <translation>Load python script</translation>
+    </message>
+    <message>
+        <source>PREF_STORE_VISUAL_STATE</source>
+        <translation>Store/restore last GUI state</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_SAVE_GUI_STATE</source>
+        <translation>Saves current state of viewers, displayed objects, etc.</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_SAVE_GUI_STATE</source>
+        <translation>Save GUI State</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_SAVE_GUI_STATE</source>
+        <translation>Save GUI state</translation>
+    </message>
+    <message>
+        <source>MEN_RESTORE_VS</source>
+        <translation>Restore</translation>
+    </message>
+    <message>
+        <source>WRN_DUMP_STUDY_FAILED</source>
+        <translation>Dump study failed</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_PROPERTIES</source>
+        <translation>Pro&amp;perties...</translation>
+    </message>
+    <message>
+        <source>QUE_DOC_ALREADYEXIST</source>
+        <translation>The document %1 already exists in study manager.
+Do you want to reload it ?</translation>
+    </message>
+    <message>
+        <source>MEN_RENAME_VS</source>
+        <translation>Rename</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_CATALOG_GENERATOR</source>
+        <translation>Catalog generator</translation>
+    </message>
+    <message>
+        <source>PUBLISH_IN_STUDY</source>
+        <translation>Publish in study</translation>
+    </message>
+    <message>
+        <source>PREF_OBJ_BROWSER_SETTINGS</source>
+        <translation>Settings</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_REGISTRY_DISPLAY</source>
+        <translation>Displays content of the Registry CORBA server</translation>
+    </message>
+    <message>
+        <source>PYTHON_FILES_FILTER</source>
+        <translation>PYTHON Files (*.py)</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_DESCRIPTION</source>
+        <translation>Do you want to close or unload study before closing?</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_PROPERTIES</source>
+        <translation>Edits study properties</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_OBJBROWSER</source>
+        <translation>Object browser</translation>
+    </message>
+    <message>
+        <source>STUDY_LOCKED</source>
+        <translation>LOCKED</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_CANCEL</source>
+        <translation>&amp;Cancel</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_NAME</source>
+        <translation>Object</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_REGISTRY_DISPLAY</source>
+        <translation>Registry display</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_COLUMN_0</source>
+        <translation>Entry</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_COLUMN_1</source>
+        <translation>Value</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_COLUMN_2</source>
+        <translation>IOR</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_COLUMN_3</source>
+        <translation>Reference entry</translation>
+    </message>
+    <message>
+        <source>PREF_CATEGORY_SALOME</source>
+        <translation>SALOME</translation>
+    </message>
+    <message>
+        <source>PYTHON_CONSOLE</source>
+        <translation>Python Console</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_LOAD_SCRIPT</source>
+        <translation>Load Scrip&amp;t...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_TOOLS</source>
+        <translation>&amp;Tools</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_DUMP_STUDY</source>
+        <translation>Dump study</translation>
+    </message>
+    <message>
+        <source>MEN_VIEW_WNDS</source>
+        <translation>Windows</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_DUMP_STUDY</source>
+        <translation>&amp;Dump Study...</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_CATALOG_GENERATOR</source>
+        <translation>Generates XML catalog of a component&apos;s interface</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_DUMP_STUDY</source>
+        <translation>Dumps study to the python script</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_NOTEBOOK</source>
+        <translation>Open Notebook</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_NOTEBOOK</source>
+        <translation>Noteboo&amp;k...</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_NOTEBOOK</source>
+        <translation>Open Notebook</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_PROPERTIES</source>
+        <translation>Study properties</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_DEF_COLUMNS</source>
+        <translation>Default columns</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_LOAD_SCRIPT</source>
+        <translation>Loads python script from file</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_CATALOG_GENERATOR</source>
+        <translation>Catalog &amp;Generator</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_CAPTION</source>
+        <translation>Close active study</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_MRU</source>
+        <translation>Most Recently Used</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_MRU</source>
+        <translation>Most recently used</translation>
+    </message>
+    <message>
+        <source>ACTIVATE_MODULE_OP_LOAD</source>
+        <translation>&amp;Load...</translation>
+    </message>
+</context>
+<context>
+    <name>SalomeApp_StudyPropertiesDlg</name>
+    <message>
+        <source>PRP_MODE_FROM_SCRATCH</source>
+        <translation>from scratch</translation>
+    </message>
+    <message>
+        <source>PRP_AUTHOR</source>
+        <translation>Author</translation>
+    </message>
+    <message>
+        <source>PRP_LOCKED</source>
+        <translation>Locked</translation>
+    </message>
+    <message>
+        <source>PRP_MODIFICATIONS</source>
+        <translation>Modifications</translation>
+    </message>
+    <message>
+        <source>PRP_NO</source>
+        <translation>No</translation>
+    </message>
+    <message>
+        <source>PRP_YES</source>
+        <translation>Yes</translation>
+    </message>
+    <message>
+        <source>PRP_MODIFIED</source>
+        <translation>Modified</translation>
+    </message>
+    <message>
+        <source>PRP_DATE</source>
+        <translation>Created</translation>
+    </message>
+    <message>
+        <source>PRP_MODE</source>
+        <translation>Mode</translation>
+    </message>
+    <message>
+        <source>PRP_MODE_FROM_COPYFROM</source>
+        <translation>copy from</translation>
+    </message>
+    <message>
+        <source>TLT_STUDY_PROPERTIES</source>
+        <translation>Study Properties</translation>
+    </message>
+</context>
+<context>
+    <name>SalomeApp_ExitDlg</name>
+    <message>
+        <source>SHUTDOWN_SERVERS</source>
+        <translation>Shutdown standalone servers</translation>
+    </message>
+</context>
+<context>
+    <name>NoteBook_Table</name>
+        <message>
+           <source>REMOVE_VARIABLE_IS_USED</source>
+           <translation>Variable with name "%1" is used in the study.
+Do you really want to remove it?</translation>
+       </message>
+        <message>
+           <source>RENAME_VARIABLE_IS_USED</source>
+           <translation>Variable with name "%1" is used in the study.
+Do you really want to rename it?</translation>
+       </message>
+        <message>
+           <source>VARNAME_COLUMN</source>
+           <translation>Variable Name</translation>
+        </message>
+        <message>      
+           <source>VARVALUE_COLUMN</source>
+           <translation>Variable Value</translation>
+       </message>
+        <message>      
+           <source>VARVALUE_INCORRECT</source>
+           <translation>Variable Value Incorrect: %1</translation>
+       </message>
+        <message>      
+           <source>VARNAME_INCORRECT</source>
+           <translation>Valiable Name Incorrect :%1</translation>
+       </message>
+        <message>      
+           <source>VARNAME_EXISTS</source>
+           <translation>Valiable with name "%1" exists</translation>
+       </message>
+</context>
+<context>
+    <name>SalomeApp_NoteBookDlg</name>
+        <message>
+           <source>NOTEBOOK_TITLE</source>
+           <translation>Salome NoteBook</translation>
+        </message>
+        <message>
+           <source>BUT_UPDATE_STUDY</source>
+           <translation>&amp;Update Study</translation>
+       </message>
+        <message>
+           <source>BUT_REMOVE</source>
+           <translation>&amp;Remove</translation>
+       </message>
+        <message>
+           <source>BUT_APPLY_AND_CLOSE</source>
+           <translation>A&amp;pply and Close</translation>
+       </message>
+        <message>
+           <source>BUT_HELP</source>
+           <translation>&amp;Help</translation>
+       </message>
+        <message>
+            <source>CLOSE_CAPTION</source>
+            <translation>Close NoteBook</translation>
+        </message>
+        <message>
+            <source>CLOSE_DESCRIPTION</source>
+            <translation>Do you want to save changes you made to NoteBook?</translation>
+        </message>
+        <message>
+           <source>INCORRECT_DATA</source>
+           <translation>At least one variable has been defined incorrectly.
+Please edit its parameters or remove it from table.</translation>
+       </message>
+        <message>
+           <source>ERR_UPDATE_STUDY_FAILED</source>
+           <translation>Failed to update study!</translation>
+       </message>
+</context>
+</TS>
diff --git a/src/Session/InquireServersQThread.cxx b/src/Session/InquireServersQThread.cxx
deleted file mode 100755 (executable)
index 61fdc3e..0000000
+++ /dev/null
@@ -1,626 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  File   : InquireServersQThread.cxx
-//  Author : Vasily RUSYAEV
-//  Module : SALOME
-//  $Header$
-
-#include "InquireServersQThread.h"
-
-#include <qapplication.h>
-#include <qpushbutton.h>
-#include <qabstractlayout.h> 
-#include <qlayout.h>
-#include <qevent.h> 
-#include <qfont.h> 
-#include <qmessagebox.h> 
-#include <qdir.h>
-#include <qfileinfo.h>
-#include <qstringlist.h>
-#include <qlabel.h> 
-#include <qprogressbar.h> 
-
-//VRV: porting on Qt 3.0.5
-#if QT_VERSION >= 0x030005
-#include <qdesktopwidget.h> 
-#endif
-//VRV: porting on Qt 3.0.5
-
-#include <qsize.h> 
-
-#include <SALOMEconfig.h>
-
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
-#include "SALOME_NamingService.hxx"
-#include "utilities.h"
-#include "OpUtil.hxx"
-
-using namespace std;
-
-#include CORBA_CLIENT_HEADER(SALOME_Session)
-#include CORBA_CLIENT_HEADER(SALOME_Registry)
-#include CORBA_CLIENT_HEADER(SALOMEDS)
-#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
-#include CORBA_CLIENT_HEADER(SALOME_Component)
-
-#define MARGIN_SIZE  5
-#define SPACING_SIZE 3
-
-/*!
-  Constructor
-*/
-InquireServersGUI::InquireServersGUI()
-     : QVBox(0, "SFA splash", Qt::WDestructiveClose | Qt::WStyle_Customize | Qt::WStyle_NoBorder | WType_TopLevel | WStyle_StaysOnTop | WX11BypassWM  )
-{
-  //  myGUI = false;
-  myThread = new InquireServersQThread( this );
-
-  // 1. Polish the appearance
-  setMargin( MARGIN_SIZE );
-  setSpacing( SPACING_SIZE );
-  setFrameStyle( QFrame::Plain | QFrame::Box );
-  setLineWidth( 2 );
-  setMinimumSize( 200, 150 );
-
-  // 2. Set palette
-  QPalette pal = palette();
-  QColorGroup cg = pal.active();
-  cg.setColor( QColorGroup::Foreground, Qt::darkBlue ); 
-  cg.setColor( QColorGroup::Background, Qt::white );
-  pal.setActive( cg ); pal.setInactive( cg ); pal.setDisabled( cg );
-  setPalette( pal );
-
-  // 2. Splash image
-  mySplashFrame = new QFrame( this );
-  mySplashFrame->setFrameStyle( QFrame::Box | QFrame::Raised );
-  QHBoxLayout* frmLayout = new QHBoxLayout( mySplashFrame );
-  frmLayout->setMargin( MARGIN_SIZE );
-  mySplash = new QLabel( mySplashFrame, "splash" );
-  frmLayout->addWidget( mySplash );
-
-  // setting pixmap
-  //QPixmap pix = SUIT_ResourceMgr( "SalomeApp" ).loadPixmap( "SalomeApp", tr( "ABOUT" ) );
-  //splash->setPixmap( pix  );
-  
-  // 3. Progress bar
-  myPrgBar = new QProgressBar( this, "QProgressBar" );
-  myPrgBar->setFixedWidth( 180 );
-  //Sets the total number of steps . 
-  myPrgBar->setPercentageVisible( false );
-  myPrgBar->setIndicatorFollowsStyle( false );
-  myPrgBar->setFixedHeight( 8 );
-  myPrgBar->setFrameStyle( QFrame::Box | QFrame::Plain );
-  myPrgBar->setMargin( 0 );
-  pal = myPrgBar->palette(); cg = pal.active();
-  cg.setColor( QColorGroup::Highlight, Qt::red );
-  pal.setActive( cg ); pal.setInactive( cg ); pal.setDisabled( cg ); myPrgBar->setPalette( pal );
-  myPrgBar->setTotalSteps ( myThread->getInquiredServers() );
-  myPrgBar->setProgress( 0 );
-
-  // 4. Info label
-  QWidget* aWgt1 = new QWidget( this );
-  QHBoxLayout* aHBoxLayout1 = new QHBoxLayout( aWgt1 );
-  myLabel = new QLabel( tr( "Loading:" ), aWgt1 );
-  myLabel->setFixedWidth( 180 );
-  myLabel->setAlignment( AlignLeft );
-  QFont theFont = myLabel->font();
-  theFont.setBold(true);
-  myLabel->setFont( theFont );
-  aHBoxLayout1->addItem( new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
-  aHBoxLayout1->addWidget( myLabel );
-  aHBoxLayout1->addItem( new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
-
-  // 5. <Cancel> button
-  QWidget* aWgt = new QWidget( this );
-  QHBoxLayout* aHBoxLayout = new QHBoxLayout( aWgt );
-  QPushButton* myCancelBtn = new QPushButton( tr( "Cancel" ), aWgt );
-  connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
-  aHBoxLayout->addItem( new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum )  );
-  aHBoxLayout->addWidget( myCancelBtn );
-  aHBoxLayout->addItem( new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum )  );
-
-  //Center widget
-#if QT_VERSION >= 0x030005
-  QDesktopWidget *d = QApplication::desktop();
-#else
-  QWidget *d = QApplication::desktop();
-#endif
-//VRV: porting on Qt 3.0.5
-
-  int w = d->width();         // returns desktop width
-  int h = d->height();        // returns desktop height
-  QSize mySize = sizeHint (); // returns widget size
-  int Xc = ( w - mySize.width() )  / 2;
-  int Yc = ( h - mySize.height() ) / 2;
-  move( Xc, Yc );
-
-  myThread->start();
-}
-
-/*!
-  Sets pixmap of splash screen
-  \param pix - new pixmap
-*/
-void InquireServersGUI::setPixmap( QPixmap pix )
-{
-  if ( !pix.isNull() ) 
-  {
-    mySplash->setPixmap( pix );
-    int w = mySplash->sizeHint().width() + MARGIN_SIZE*2;
-    myPrgBar->setFixedWidth( w );
-    myLabel->setFixedWidth( w );
-  }
-}
-
-/*!
-  Destructor
-*/
-InquireServersGUI::~InquireServersGUI()
-{
-  delete myThread;
-}
-
-/*!
-  Gets parameters from qApp
-  \param _argc - variable to return number of arguments
-  \param _argv - variable to return array of arguments
-*/
-void InquireServersGUI::getArgs( int& _argc, char *** _argv)
-{
-  _argc = qApp->argc();
-  *_argv = qApp->argv();
-}
-
-/*!
-  Cancel loading of SALOME
-*/
-void InquireServersGUI::ClickOnCancel()
-{
-  myThread->stop(); //it's necessary to stop asking servers
-  hide();
-  qApp->exit( 1 );
-}
-
-/*!
-  Custom event filter
-*/
-void InquireServersGUI::customEvent( QCustomEvent* pe )
-{
-  switch( pe->type() )
-    {
-        case InquireEvent::ProgressEvent:
-        {
-            int* value = ( int* )(( InquireEvent*)pe)->data();
-            myPrgBar->setProgress( *value );
-            break;
-        }
-        case InquireEvent::ProgressEventLabel:
-        {
-            QString* myString = ( QString* )(( InquireEvent*)pe)->data();
-            myLabel->setText( *myString );
-            break;
-        }
-        case InquireEvent::ProgressEventError:
-        {
-            QString* myErrDesc = ( QString* )(( InquireEvent*)pe)->data();
-           QString  appName = "SALOME Professional";
-           QString  error = "An internal error occurred.\n"+ *myErrDesc + "\n";
-           QMessageBox myMsgBox(appName,error,QMessageBox::Critical,QMessageBox::Ok,QMessageBox::NoButton,
-                                       QMessageBox::NoButton,0,"MY",TRUE,WStyle_DialogBorder|WStyle_StaysOnTop);
-           myMsgBox.exec();
-           ClickOnCancel();
-            break;
-        }
-      default:
-       {
-         ;
-       }
-    }
-}
-
-/*!
-  \return status of thread exit
-*/
-int InquireServersGUI::getExitStatus()
-{
-  return myThread->getExitStatus();
-}
-
-/*!
-  Constructor
-*/
-InquireServersQThread::InquireServersQThread( InquireServersGUI* r )
-     : receiver(r),  myExitStatus(0)
-{
-  char* cenv;
-
-  IsChecking = true;
-  myServersCount = 5;
-  //how many times we should repeat attempts to get response from all needed for launching SALOME servers
-  myRepeat = 30; // default value, user can change it by setting CSF_RepeatServerRequest env.variable
-  cenv = getenv( "CSF_RepeatServerRequest" );
-  if ( cenv ) {
-    int val = atoi( cenv );
-    if ( val > 0 )
-      myRepeat = val;
-  }
-  //define delay time between two attempts
-  myDelay = 1000000; // 1 second
-  QString str = "Loading: ";
-  myMessages[0] = "Checking naming service...";
-  myMessages[1] = str + "SALOME_Registry_Server" + "...";
-  myMessages[2] = str + "SALOMEDS_Server" + "...";
-  myMessages[3] = str + "SALOME_ModuleCatalog_Server" + "...";
-  myMessages[4] = str + "SALOME_Session_Server" + "...";
-  myMessages[5] = "";
-  myMessages[6] = "";
-  myMessages[7] = "";
-
-  r->getArgs( _argc, &_argv);
-
-  // NRI : Temporary solution for SuperVisionContainer
-  for ( int i=1; i<=(_argc-1); i++) {
-    if (strcmp(_argv[i],"CPP")==0) {
-      myMessages[5] = str + "SALOME_Container FactoryServer" + "...";
-      myServersCount++;
-    }
-    if (strcmp(_argv[i],"PY")==0) {
-      myMessages[6] = str + "SALOME_ContainerPy.py FactoryServerPy" + "...";
-      myServersCount++;
-    }
-    if (strcmp(_argv[i],"SUPERV")==0) {
-      myMessages[7] = str + "SALOME_Container SuperVisionContainer" + "...";
-      myServersCount++;
-    }
-//    if (strcmp(_argv[i],"GUI")==0) {
-//      r->withGUI(true);
-//    }
-  }
-}
-
-/*!
-  The main loop of this thread
-*/
-void InquireServersQThread::run()
-{
-  while ( IsChecking && receiver )
-  {
-    for (int i=1; i<=8; i++)
-    {
-      if ( myMessages[i-1].isEmpty() ) 
-      {
-       if ( i==8 ) 
-       {
-         IsChecking = false;
-         myExitStatus = 0;  //myExitStatus should be 0 because all servers exist and work
-         sleep( 1 ); // sleep( 1 second ) in order to see 100%.  in other case it closes on 85%..
-         break;
-       } 
-       else
-         continue;
-      }
-      QString *message = new QString(myMessages[i-1]);
-      QThread::postEvent( receiver, new InquireEvent( ( QEvent::Type )InquireEvent::ProgressEventLabel, message ) );
-      QThread::usleep(200000);
-      QString *errMsg;
-      bool result = AskServer(i,&errMsg);
-      if (result)
-      {
-       QThread::postEvent( receiver, new InquireEvent( ( QEvent::Type )InquireEvent::ProgressEvent, new int( i ) ) );
-       if ( i==8 )
-       {
-         IsChecking = false;
-         myExitStatus = 0; //myExitStatus should be 0 because all servers exist and work
-         sleep( 1 );  // sleep( 1 second ) in order to see 100%.  in other case it closes on 85%..
-         break;
-       }
-      }
-      else
-      {
-       QThread::postEvent( receiver, new InquireEvent( ( QEvent::Type )InquireEvent::ProgressEventError, errMsg ) );
-       stop();
-       break;
-      }
-    }
-  }
-
-  receiver->hide();
-  qApp->exit( myExitStatus );
-}
-
-/*!
-  Stops this thread
-*/
-void InquireServersQThread::stop()
-{
-  IsChecking = false;
-  myExitStatus = 1;
-}
-
-/*!
-  Destructor
-*/
-InquireServersQThread::~InquireServersQThread()
-{
-}
-
-bool InquireServersQThread::AskServer(int iteration, QString ** errMessage)
-{
-  if ( iteration > myServersCount )
-    return true; // we did not launch server with number iteration, so checking for it is not neccessary
-
-  ASSERT(iteration<=myServersCount);
-
-  //will be set true if we get response from server
-  bool IsPassed = false;
-  QString errDescription;
-#ifdef WNT
-  int i;
-#endif
-  switch (iteration)
-    {
-    case 1:
-      //First checking - existence of Naming Service
-#ifndef WNT
-      for (int i = myRepeat; i ; i--)
-#else
-         for (i = myRepeat; i ; i--)
-#endif
-       {
-         try
-           {
-             CORBA::ORB_var orb = CORBA::ORB_init(_argc,_argv) ;
-             CORBA::Object_var obj = orb->resolve_initial_references("NameService");
-             CosNaming::NamingContext_var _root_context = CosNaming::NamingContext::_narrow(obj);
-             if (CORBA::is_nil(_root_context))
-               continue;
-             else
-               IsPassed = true;
-             break;
-           }
-         catch(CORBA::COMM_FAILURE&)
-           {
-             MESSAGE("CORBA::COMM_FAILURE: unable to contact the naming service");
-           }
-         catch(...)
-           {
-             MESSAGE("Unknown Exception: unable to contact the naming service");
-           }
-         QThread::usleep(myDelay);
-       }
-      if (!IsPassed)
-       *errMessage = new QString("unable to contact the naming service");
-      break;
-    case 2:
-      //checking - existence of SALOME_Registry_Server
-    case 3:
-      //checking - existence of SALOMEDS_Server
-    case 4:
-      //checking - existence of SALOME_ModuleCatalog_Server
-    case 5:
-      //checking - existence of SALOME_Session_Server
-    case 6:
-      //checking - existence of SALOME_Container FactoryServer
-    case 7:
-      //checking - existence of SALOME_ContainerPy.py FactoryServerPy
-    case 8:
-      //checking - existence of SALOME_Container SuperVisionContainer
-
-
-      IsPassed = pingServer(iteration, errDescription);
-      if (!IsPassed)
-       *errMessage = new QString(errDescription);
-      break;
-    }
-return IsPassed;
-}
-
-bool InquireServersQThread::pingServer(int iteration, QString& errMessage)
-{
-  ASSERT(iteration<=myServersCount);
-  bool result = false;
-  QString errorDescr;
-  for (int i = myRepeat; i ; i--)
-    {
-      try
-       {
-         CORBA::ORB_var orb = CORBA::ORB_init(_argc,_argv) ;
-         SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
-         ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
-         NS.init_orb( orb ) ;
-         switch (iteration)
-           {
-           case 2:
-             {
-               CORBA::Object_var obj = NS.Resolve("/Registry");
-               Registry::Components_var registry = Registry::Components::_narrow(obj) ;
-               if (!CORBA::is_nil(registry))
-                 {
-                   MESSAGE("/Registry is found");
-                   registry->ping();
-                   result = true;
-                   MESSAGE("Registry was activated");
-                   return result;
-                 }
-             }
-             break;
-           case 3:
-             {
-               CORBA::Object_var obj = NS.Resolve("/myStudyManager");
-               SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow(obj) ;
-               if (!CORBA::is_nil(studyManager))
-
-
-
-
-
-                 {
-                   MESSAGE("/myStudyManager is found");
-                   studyManager->ping();
-                   result = true;
-                   MESSAGE("StudyManager was activated");
-                   return result;
-                 }
-             }
-             break;
-           case 4:
-             {
-               CORBA::Object_var obj = NS.Resolve("/Kernel/ModulCatalog");
-               SALOME_ModuleCatalog::ModuleCatalog_var catalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj) ;
-               if (!CORBA::is_nil(catalog))
-                 {
-                   MESSAGE("/Kernel/ModulCatalog is found");
-                   catalog->ping();
-                   result = true;
-                   MESSAGE("ModuleCatalog was activated");
-                   return result;
-                 }
-             }
-             break;
-           case 5:
-             {
-               CORBA::Object_var obj = NS.Resolve("/Kernel/Session");
-               SALOME::Session_var session = SALOME::Session::_narrow(obj) ;
-               if (!CORBA::is_nil(session))
-                 {
-                   MESSAGE("/Kernel/Session is found");
-                   session->ping();
-                   result = true;
-                   MESSAGE("SALOME_Session was activated");
-                   return result;
-                 }
-             }
-             break;
-           case 6:
-             {
-               string hostname = GetHostname();
-               string containerName = "/Containers/";
-               containerName += hostname;
-               containerName += "/FactoryServer";
-
-               CORBA::Object_var obj = NS.Resolve(containerName.c_str());
-               Engines::Container_var FScontainer = Engines::Container::_narrow(obj) ;
-               if (!CORBA::is_nil(FScontainer))
-                 {
-                   FScontainer->ping();
-                   result = true;
-                   MESSAGE("FactoryServer container was activated");
-                   return result;
-                 }
-             }
-             break;
-           case 7:
-             {
-               string hostname = GetHostname();
-               string containerName = "/Containers/";
-               containerName += hostname;
-               containerName += "/FactoryServerPy";
-               
-               CORBA::Object_var obj = NS.Resolve(containerName.c_str());
-               Engines::Container_var FSPcontainer = Engines::Container::_narrow(obj) ;
-               if (!CORBA::is_nil(FSPcontainer))
-                 {
-                   FSPcontainer->ping();
-                   result = true;
-                   MESSAGE("FactoryServerPy container was activated");
-                   return result;
-                 }
-             }
-             break;
-           case 8:
-             {
-               string hostname = GetHostname();
-               string containerName = "/Containers/";
-               containerName += hostname;
-               containerName += "/SuperVisionContainer";
-               
-               CORBA::Object_var obj = NS.Resolve(containerName.c_str());
-               Engines::Container_var SVcontainer = Engines::Container::_narrow(obj) ;
-               if (!CORBA::is_nil(SVcontainer))
-                 {
-                   SVcontainer->ping();
-
-                   result = true;
-                   MESSAGE("SuperVisionContainer container was activated");
-                   return result;
-                 }
-             }
-             break;
-           }
-        }
-      catch (ServiceUnreachable&)
-       {
-         MESSAGE("Caught exception: Naming Service Unreachable");
-         errorDescr = "Caught exception: Naming Service Unreachable";
-       }
-      catch (CORBA::COMM_FAILURE&)
-       {
-         MESSAGE("Caught CORBA::SystemException CommFailure.");
-         errorDescr = "Caught CORBA::SystemException CommFailure";
-       }
-      catch (CORBA::SystemException&)
-       {
-         MESSAGE("Caught CORBA::SystemException.");
-         errorDescr = "Caught CORBA::SystemException";
-       }
-      catch (CORBA::Exception&)
-       {
-         MESSAGE("Caught CORBA::Exception.");
-         errorDescr = "Caught CORBA::Exception";
-       }
-      catch (...)
-       {
-         MESSAGE("Caught unknown exception.");
-         errorDescr = "Caught unknown exception";
-       }
-      QThread::usleep(myDelay);
-    }
-  if (!result)
-    {
-      QString serverName;
-      switch (iteration)
-       {
-       case 2:
-         serverName = "SALOME_Registry_Server is not loaded. ";
-         break;
-       case 3:
-         serverName = "SALOMEDS_Server is not loaded. ";
-         break;
-       case 4:
-         serverName = "SALOME_ModuleCatalog_Server is not loaded. ";
-         break;
-       case 5:
-         serverName = "SALOME_Session_Server is not loaded. ";
-         break;
-       case 6:
-         serverName = "SALOME_Container FactoryServer is not loaded. ";
-         break;
-       case 7:
-         serverName = "SALOME_ContainerPy.py FactoryServerPy is not loaded. ";
-         break;
-       case 8:
-         serverName = "SALOME_Container SuperVisionContainer is not loaded. ";
-         break;
-       }
-      errMessage = serverName + errorDescr;
-    }
-  return result;
-}
-
diff --git a/src/Session/InquireServersQThread.h b/src/Session/InquireServersQThread.h
deleted file mode 100755 (executable)
index 2eca8fe..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  File   : InquireServersQThread.h
-//  Author : Vasily RUSYAEV
-//  Module : SALOME
-
-#include <qthread.h> 
-#include <qvbox.h> 
-#include <qguardedptr.h> 
-
-#include <SALOME_Session.hxx>
-
-/*!
-  \class InquireEvent
-  Contains QCustomEvents for posting to InquireServersQThread
-*/
-class SESSION_EXPORT InquireEvent : public QCustomEvent
-{
-public:
-
-  enum myCustomEvents{ ProgressEvent = QEvent::User + 10, ProgressEventLabel, ProgressEventError };
-  
-  InquireEvent( QEvent::Type type , void* data = 0 )
-        : QCustomEvent( type, data ) {}
-  ~InquireEvent() 
-      {
-        type() == (QEvent::Type)ProgressEvent ?
-         delete ( int* )data() : delete ( QString* )data();
-      }
-};
-
-class InquireServersGUI;
-
-class SESSION_EXPORT InquireServersQThread : public QThread
-{
-public:
-  InquireServersQThread( InquireServersGUI* r );
-  virtual ~InquireServersQThread();
-
-  //the main loop of this thread
-  virtual void run() ;
-  //stop to ask servers
-  void stop(); 
-  //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button) 
-  int getExitStatus() { return myExitStatus;}
-  //return count of inquired servers
-  int getInquiredServers() { return myServersCount; }
-
-private:
-
-//functions:
-
-  bool AskServer(int iteration, QString ** message);
-  bool pingServer(int iteration, QString& errMessage);
-
-//variables:
-
-  QGuardedPtr<InquireServersGUI> receiver;
-  int _argc ;
-  char ** _argv;
-  //this variable is true if we are checking servers
-  bool IsChecking;
-  //count of inquired servers
-  int myServersCount;
-  //how many times we should repeat attempt to get response from all needed for launching SALOME servers
-  int myRepeat;
-  //define delay time between two attempts in microseconds
-  int myDelay;
-  //this strings' array contains messages for each server (e.g. "Loading: SALOMEDS_Server") 
-  QString myMessages[8];
-  //exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button) 
-  int myExitStatus;
-
-} ;
-
-class QLabel;
-class QFrame;
-class QProgressBar;
-class SESSION_EXPORT InquireServersGUI : public QVBox
-{
-    Q_OBJECT
-
-public:
-  InquireServersGUI() ;
-  ~InquireServersGUI();
-
-  //returns arguments of QApplication
-  //they are needed for CORBA servers initialization
-  void getArgs(  int& _argc, char *** _argv);
-  //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button) 
-  int getExitStatus();
-  //launch IAPP
-  //  bool withGUI() { return myGUI; }
-  //  void withGUI(bool gui) { myGUI = gui; }
-
-  void setPixmap( QPixmap );
-
-protected:
-  virtual void customEvent( QCustomEvent* ); 
-
-private:
-  InquireServersQThread* myThread;
-  QProgressBar* myPrgBar;
-  //this string contains description of currently asked server
-  QLabel* myLabel;
-  QLabel* mySplash;
-  QFrame* mySplashFrame;
-  //  bool myGUI;
-
-private slots:
-
-    void ClickOnCancel();
-} ;
index 8d76b4f2c81feaf17e2364ba3e9b6040cd28462d..ae858a3f40ecd0bbdb5c9043fc5e4287d910a766 100755 (executable)
@@ -1,77 +1,88 @@
-#  SALOME Session : implementation of Session.idl
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOME Session : implementation of Session.idl
 #  File   : Makefile.in
 #  Author : Paul RASCLE, EDF
 #  Module : SALOME
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSalomeSession.la
 
-salomeinclude_HEADERS= \
-       Session_Session_i.hxx \
-       Session_ServerLauncher.hxx \
-       Session_ServerThread.hxx \
-       Session_ServerCheck.hxx \
+salomeinclude_HEADERS =                        \
+       Session_Session_i.hxx           \
+       SALOME_Session.hxx              \
+       Session_ServerLauncher.hxx      \
+       Session_ServerThread.hxx        \
+       Session_ServerCheck.hxx         \
        SalomeApp_Engine_i.hxx
 
 # Libraries targets
 
-dist_libSalomeSession_la_SOURCES= \
-       Session_Session_i.cxx \
-       Session_ServerThread.cxx \
-       Session_ServerLauncher.cxx \
-       Session_ServerCheck.cxx \
+dist_libSalomeSession_la_SOURCES =     \
+       Session_Session_i.cxx           \
+       Session_ServerThread.cxx        \
+       Session_ServerLauncher.cxx      \
+       Session_ServerCheck.cxx         \
        SalomeApp_Engine_i.cxx
 
-libSalomeSession_la_CPPFLAGS= $(QT_MT_INCLUDES) $(PYTHON_INCLUDES) \
-       $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) @KERNEL_CXXFLAGS@ $(CAS_CPPFLAGS) \
-       @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \
-       -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl \
-       -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../Event \
-       @LIBXML_INCLUDES@
+libSalomeSession_la_CPPFLAGS = $(QT_MT_INCLUDES) $(PYTHON_INCLUDES)            \
+       $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) @KERNEL_CXXFLAGS@ $(CAS_CPPFLAGS)    \
+       @CORBA_CXXFLAGS@ @CORBA_INCLUDES@                                       \
+       -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl                 \
+       -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../Event             \
+       -I$(srcdir)/../Style @LIBXML_INCLUDES@
+
+if ENABLE_TESTRECORDER
+  libSalomeSession_la_CPPFLAGS+= -DENABLE_TESTRECORDER $(TESTRECORDER_INCLUDES)
+endif
 
-libSalomeSession_la_LDFLAGS= $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSalomeNS \
-       -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lSalomeCatalog \
-       -lSalomeDSClient $(CAS_KERNEL) -lwith_loggerTraceCollector \
-       ../SUIT/libsuit.la ../Event/libEvent.la ../../idl/libSalomeIDLGUI.la
+libSalomeSession_la_LDFLAGS = $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSalomeNS       \
+       -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lSalomeCatalog      \
+       -lSalomeDSClient $(CAS_KERNEL) -lwith_loggerTraceCollector              \
+       -lSalomeIDLKernel -lSalomeContainer -lTOOLSDS -lSalomeLauncher          \
+       -lRegistry -lSALOMEBasics                                               \
+       ../SUIT/libsuit.la ../Event/libEvent.la ../../idl/libSalomeIDLGUI.la    \
+       ../Style/libSalomeStyle.la
+
+if ENABLE_TESTRECORDER
+  libSalomeSession_la_LDFLAGS+= $(TESTRECORDER_LIBS)
+endif
 
 # Executable
-bin_PROGRAMS= SALOME_Session_Server
+bin_PROGRAMS = SALOME_Session_Server
 
-dist_SALOME_Session_Server_SOURCES= SALOME_Session_Server.cxx
+dist_SALOME_Session_Server_SOURCES = SALOME_Session_Server.cxx
 
-SALOME_Session_Server_CPPFLAGS= $(libSalomeSession_la_CPPFLAGS)
-SALOME_Session_Server_LDADD= $(libSalomeSession_la_LDFLAGS) $(OMNIORB_LIBS) \
-       $(HDF5_LIBS) -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS \
-       -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry \
-       -lSalomeNotification -lSALOMEBasics -lSalomeLauncher ../Qtx/libqtx.la \
-       $(top_builddir)/idl/libSalomeIDLGUI.la \
+SALOME_Session_Server_CPPFLAGS = $(libSalomeSession_la_CPPFLAGS)
+SALOME_Session_Server_LDADD    = $(libSalomeSession_la_LDFLAGS)                \
+       $(PYTHON_LIBS) $(OMNIORB_LIBS)                                          \
+       $(HDF5_LIBS) -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS       \
+       -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry         \
+       -lSalomeNotification -lSALOMEBasics -lSalomeLauncher ../Qtx/libqtx.la   \
+       $(top_builddir)/idl/libSalomeIDLGUI.la                                  \
        libSalomeSession.la
 
-lib-hook:
-       ln -sf $(top_builddir)/bin/salome/styles styles
-
-# ../SalomeApp/libSalomeApp.la
+if ENABLE_TESTRECORDER
+  SALOME_Session_Server_LDADD+= $(TESTRECORDER_LIBS)
+endif
index a52f3896fcc0f56d3d6ac541eaf3341909d26ab9..0a0d4fe8374d2fbd2b2bc6b084e01757765e6853 100755 (executable)
@@ -1,47 +1,39 @@
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SALOME_Session.hxx
 //  Author : Alexander A. BORODIN
 //  Module : GUI
-
+//
 #ifndef _SALOME_Session_HXX_
 #define _SALOME_Session_HXX_
 
-#ifdef WNT
- #if defined SESSION_EXPORTS
-  #if defined WIN32
-   #define SESSION_EXPORT __declspec( dllexport )
-  #else
-   #define SESSION_EXPORT
-  #endif
- #else
-  #if defined WIN32
-   #define SESSION_EXPORT __declspec( dllimport )
-  #else
-   #define SESSION_EXPORT
-  #endif
- #endif
-#else
- #define SESSION_EXPORT
-#endif
+#if defined WIN32
+#  if defined SESSION_EXPORTS
+#    define SESSION_EXPORT __declspec( dllexport )
+#  else
+#    define SESSION_EXPORT __declspec( dllimport )
+#  endif
+#else  // WIN32
+#  define SESSION_EXPORT
+#endif // WIN32
 
 #endif
index daa2dbb18e7e80014e75aeaac5c071a6afae4993..6bb4668f292d901991548228b155ee9b0cb3b327 100755 (executable)
@@ -1,75 +1,73 @@
-// SALOME Session : implementation of Session.idl
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME Session : implementation of Session.idl
+//  File : SALOME_Session_Server.cxx
+//  Author : Paul RASCLE, EDF
+//  Module : SALOME
 //
-//
-// File : SALOME_Session_Server.cxx
-// Author : Paul RASCLE, EDF
-// Module : SALOME
-
 #include <Container_init_python.hxx>
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
-#include "SALOME_NamingService.hxx"
-#include "SALOMETraceCollector.hxx"
-
-#include "SALOME_ModuleCatalog_impl.hxx"
-#include "OpUtil.hxx"
-#include "RegistryService.hxx"
-#include "ConnectionManager_i.hxx"
-
-#include <iostream>
-#ifndef WNT
-#include <unistd.h>
-#include <iostream.h>
-#include <string.h>
+#include <Utils_ORB_INIT.hxx>
+#include <Utils_SINGLETON.hxx>
+#include <SALOME_NamingService.hxx>
+#include <SALOME_ModuleCatalog_impl.hxx>
+#include <OpUtil.hxx>
+#include <RegistryService.hxx>
+#include <ConnectionManager_i.hxx>
+#include <SALOME_LifeCycleCORBA.hxx>
+
+#ifdef ENABLE_TESTRECORDER
+  #include <TestApplication.h>
 #endif
 
-#include <qdir.h>
-#include <qfile.h>
-#include <qapplication.h>
-#include <qwaitcondition.h>
-#include <qregexp.h>
+#include <QDir>
+#include <QFile>
+#include <QApplication>
+#include <QMutex>
+#include <QWaitCondition>
+#include <QRegExp>
+#include <QTextStream>
 
-#include "Utils_SALOME_Exception.hxx"
-#include "Utils_CorbaException.hxx"
-#include "SALOME_Event.hxx"
+#include <Utils_SALOME_Exception.hxx>
+#include <Utils_CorbaException.hxx>
+#include <SALOME_Event.h>
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOME_Session)
 #include CORBA_SERVER_HEADER(SALOMEDS)
 
 #include <utilities.h>
-#include "Session_Session_i.hxx"
 #include "Session_ServerLauncher.hxx"
 #include "Session_ServerCheck.hxx"
 
 #include <QtxSplash.h>
-#include "SUIT_Tools.h"
-#include "SUIT_Session.h"
-#include "SUIT_Application.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_ExceptionHandler.h"
+#include <Style_Salome.h>
+#include <SUIT_Tools.h>
+#include <SUIT_Session.h>
+#include <SUIT_Application.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_ExceptionHandler.h>
+
+#include <Standard_Version.hxx>
 
 /*! - read arguments, define list of server to launch with their arguments.
  * - wait for naming service
@@ -138,23 +136,23 @@ QString salomeVersion()
   path += QString( "bin/salome/VERSION" );
 
   QFile vf( path );
-  if ( !vf.open( IO_ReadOnly ) )
-    return QString::null;
+  if ( !vf.open( QIODevice::ReadOnly ) )
+    return QString();
+
+  QString line( vf.readLine( 1024 ) );
 
-  QString line;
-  vf.readLine( line, 1024 );
   vf.close();
 
   if ( line.isEmpty() )
-    return QString::null;
+    return QString();
 
   while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
     line.remove( line.length() - 1, 1 );
 
   QString ver;
-  int idx = line.findRev( ":" );
+  int idx = line.lastIndexOf( ":" );
   if ( idx != -1 )
-    ver = line.mid( idx + 1 ).stripWhiteSpace();
+    ver = line.mid( idx + 1 ).trimmed();
 
   return ver;
 }
@@ -175,8 +173,8 @@ public:
       resMgr.loadLanguage( "LightApp",  "en" );
       resMgr.loadLanguage( "SalomeApp", "en" );
 
-      myExtAppName = QObject::tr( "APP_NAME" ).stripWhiteSpace();
-      if ( myExtAppName == "APP_NAME" || myExtAppName.lower() == "salome" ) 
+      myExtAppName = QObject::tr( "APP_NAME" ).trimmed();
+      if ( myExtAppName == "APP_NAME" || myExtAppName.toLower() == "salome" ) 
         myExtAppName = "SalomeApp";
       myExtAppVersion = QObject::tr( "APP_VERSION" );
       if ( myExtAppVersion == "APP_VERSION" ) {
@@ -191,7 +189,7 @@ public:
 protected:
   QString userFileName( const QString& appName, const bool for_load ) const
   { 
-    if ( version().isNull()  ) return ""; 
+    if ( version().isEmpty()  ) return ""; 
     return SUIT_ResourceMgr::userFileName( myExtAppName, for_load );
   }
 
@@ -203,15 +201,15 @@ protected:
       
       QString fname = QFileInfo( _fname ).fileName();
       if( exp.exactMatch( fname ) ) {
-       QStringList vers = QStringList::split( ".", exp.cap( 1 ) );
+       QStringList vers = exp.cap( 1 ).split( ".", QString::SkipEmptyParts );
        int major=0, minor=0;
        major = vers[0].toInt();
        minor = vers[1].toInt();
-       if( vers_exp.search( vers[2] )==-1 )
+       if( vers_exp.indexIn( vers[2] )==-1 )
          return -1;
        int release = 0, dev1 = 0, dev2 = 0;
        release = vers_exp.cap( 1 ).toInt();
-       dev1 = vers_exp.cap( 2 )[ 0 ].latin1();
+       dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1();
        dev2 = vers_exp.cap( 3 ).toInt();
        
        int dev = dev1*100+dev2, id = major;
@@ -231,8 +229,8 @@ public:
   static QString myExtAppVersion;
 };
 
-QString SALOME_ResourceMgr::myExtAppName    = QString::null;
-QString SALOME_ResourceMgr::myExtAppVersion = QString::null;
+QString SALOME_ResourceMgr::myExtAppName    = QString();
+QString SALOME_ResourceMgr::myExtAppVersion = QString();
 
 class SALOME_Session : public SUIT_Session
 {
@@ -249,10 +247,18 @@ protected:
   }
 };
 
-class SALOME_QApplication : public QApplication
+#ifdef ENABLE_TESTRECORDER
+  class SALOME_QApplication : public TestApplication
+#else
+  class SALOME_QApplication : public QApplication
+#endif
 {
 public:
+#ifdef ENABLE_TESTRECORDER
+  SALOME_QApplication( int& argc, char** argv ) : TestApplication( argc, argv ), myHandler ( 0 ) {}
+#else
   SALOME_QApplication( int& argc, char** argv ) : QApplication( argc, argv ), myHandler ( 0 ) {}
+#endif
 
   virtual bool notify( QObject* receiver, QEvent* e )
   {
@@ -270,8 +276,13 @@ public:
     }
 #endif
 
+#ifdef ENABLE_TESTRECORDER
+    return myHandler ? myHandler->handle( receiver, e ) :
+      TestApplication::notify( receiver, e );
+#else
     return myHandler ? myHandler->handle( receiver, e ) :
       QApplication::notify( receiver, e );
+#endif
   }
   SUIT_ExceptionHandler* handler() const { return myHandler; }
   void setHandler( SUIT_ExceptionHandler* h ) { myHandler = h; }
@@ -312,123 +323,14 @@ bool isFound( const char* str, int argc, char** argv )
 
 void killOmniNames()
 {
-    QString fileName( ::getenv ("OMNIORB_CONFIG") );
-    QString portNumber;
-    if ( !fileName.isEmpty() ) 
-    {
-      QFile aFile( fileName );
-      if ( aFile.open(IO_ReadOnly) ) {
-        QRegExp re("InitRef = .*:([0-9]+)$");
-        QTextStream stream ( &aFile );
-        while ( !stream.atEnd() ) {
-          QString textLine = stream.readLine();
-          if ( re.search( textLine ) > -1 )
-            portNumber = re.cap(1);
-        }
-        aFile.close();
-      }
-    }
-
-    if ( !portNumber.isEmpty() ) 
-    {
-      QString cmd ;
-      cmd = QString( "ps -eo pid,command | grep -v grep | grep -E \"omniNames.*%1\" | awk '{cmd=sprintf(\"kill -9 %s\",$1); system(cmd)}'" ).arg( portNumber );
-      system ( cmd.latin1() );
-    }
-
-    /////////////////// NPAL 18309  (Kill Notifd) ////////////////////////////
-    if ( !portNumber.isEmpty() ) 
-    {
-      QString cmd = QString("import pickle, os; ");
-      cmd += QString("from killSalomeWithPort import getPiDict; ");
-      cmd += QString("filedict=getPiDict(%1); ").arg(portNumber);
-      cmd += QString("f=open(filedict, 'r'); ");
-      cmd += QString("pids=pickle.load(f); ");
-      cmd += QString("m={}; ");
-      cmd += QString("[ m.update(i) for i in pids ]; ");
-      cmd += QString("pids=filter(lambda a: 'notifd' in m[a], m.keys()); ");
-      cmd += QString("[ os.kill(pid, 9) for pid in pids ]; ");
-      cmd += QString("os.remove(filedict); ");
-      cmd  = QString("python -c \"%1\" > /dev/null").arg(cmd);
-      system( cmd.latin1() );
-    }
-
+  SALOME_LifeCycleCORBA::killOmniNames();
 }
 
 // shutdown standalone servers
 void shutdownServers( SALOME_NamingService* theNS )
 {
-  // get each Container from NamingService => shutdown it
-  // (the order is inverse to the order of servers initialization)
-  
-  CORBA::Object_var objS = theNS->Resolve("/Kernel/Session");
-  SALOME::Session_var session = SALOME::Session::_narrow(objS);
-  if (!CORBA::is_nil(session)) {
-    session->ping();
-    
-    string hostname = GetHostname();
-    //string containerName = "/Containers/" + hostname;
-    
-    // 1) SuperVisionContainer
-    //string containerNameSV = containerName + "/SuperVisionContainer";
-    //CORBA::Object_var objSV = theNS->Resolve(containerNameSV.c_str());
-    //Engines::Container_var SVcontainer = Engines::Container::_narrow(objSV) ;
-    //if ( !CORBA::is_nil(SVcontainer) && ( session->getPID() != SVcontainer->getPID() ) )
-    //  SVcontainer->Shutdown();
-    
-    // 2) FactoryServerPy
-    //string containerNameFSP = containerName + "/FactoryServerPy";
-    //CORBA::Object_var objFSP = theNS->Resolve(containerNameFSP.c_str());
-    //Engines::Container_var FSPcontainer = Engines::Container::_narrow(objFSP) ;
-    //if ( !CORBA::is_nil(FSPcontainer) && ( session->getPID() != FSPcontainer->getPID() ) )
-    //  FSPcontainer->Shutdown();
-    
-    // 3) FactoryServer
-    //string containerNameFS = containerName + "/FactoryServer";
-    //CORBA::Object_var objFS = theNS->Resolve(containerNameFS.c_str());
-    //Engines::Container_var FScontainer = Engines::Container::_narrow(objFS) ;
-    //if ( !CORBA::is_nil(FScontainer) && ( session->getPID() != FScontainer->getPID() ) )
-    //  FScontainer->Shutdown();
-    
-    // 4) ContainerManager
-    //CORBA::Object_var objCM=theNS->Resolve("/ContainerManager");
-    //Engines::ContainerManager_var contMan=Engines::ContainerManager::_narrow(objCM);
-    //if ( !CORBA::is_nil(contMan) && ( session->getPID() != contMan->getPID() ) )
-    //  contMan->ShutdownWithExit();
-
-    // 4) SalomeLauncher
-    CORBA::Object_var objSL = theNS->Resolve("/SalomeLauncher");
-    Engines::SalomeLauncher_var launcher = Engines::SalomeLauncher::_narrow(objSL);
-    if (!CORBA::is_nil(launcher) && (session->getPID() != launcher->getPID()))
-      launcher->Shutdown();
-
-    // 5) ConnectionManager
-    CORBA::Object_var objCnM=theNS->Resolve("/ConnectionManager");
-    Engines::ConnectionManager_var connMan=Engines::ConnectionManager::_narrow(objCnM);
-    if ( !CORBA::is_nil(connMan) && ( session->getPID() != connMan->getPID() ) )
-      connMan->ShutdownWithExit();
-    
-    // 6) SALOMEDS
-    CORBA::Object_var objSDS = theNS->Resolve("/myStudyManager");
-    SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow(objSDS) ;
-    if ( !CORBA::is_nil(studyManager) && ( session->getPID() != studyManager->getPID() ) )
-      studyManager->Shutdown();
-    
-    // 7) ModuleCatalog
-    CORBA::Object_var objMC=theNS->Resolve("/Kernel/ModulCatalog");
-    SALOME_ModuleCatalog::ModuleCatalog_var catalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objMC);
-    if ( !CORBA::is_nil(catalog) && ( session->getPID() != catalog->getPID() ) )
-      catalog->shutdown();
-    
-    // 8) Registry
-    CORBA::Object_var objR = theNS->Resolve("/Registry");
-    Registry::Components_var registry = Registry::Components::_narrow(objR);
-    if ( !CORBA::is_nil(registry) && ( session->getPID() != registry->getPID() ) )
-      registry->Shutdown();
-    
-    // 9) Kill OmniNames
-    //killOmniNames();
-  }
+  SALOME_LifeCycleCORBA lcc(theNS);
+  lcc.shutdownServers();
 }
 
 // ---------------------------- MAIN -----------------------
@@ -440,85 +342,43 @@ int main( int argc, char **argv )
   // Create Qt application instance;
   // this should be done the very first!
   SALOME_QApplication _qappl( argc, argv );
-  ASSERT( QObject::connect( &_qappl, SIGNAL( lastWindowClosed() ), &_qappl, SLOT( quit() ) ) );
 
   // Add application library path (to search style plugin etc...)
   QString path = QDir::convertSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) );
   _qappl.addLibraryPath( path );
-  
-  // Set SALOME style to the application
-  _qappl.setStyle( "salome" );
 
   bool isGUI    = isFound( "GUI",    argc, argv );
   bool isSplash = isFound( "SPLASH", argc, argv );
   // Show splash screen (only if both the "GUI" and "SPLASH" parameters are set)
+  // Note, that user preferences are not taken into account for splash settings -
+  // it is a property of the application!
   QtxSplash* splash = 0;
   if ( isGUI && isSplash ) {
     // ...create resource manager
     SUIT_ResourceMgr resMgr( "SalomeApp", QString( "%1Config" ) );
     resMgr.setCurrentFormat( "xml" );
+    resMgr.setWorkingMode( QtxResourceMgr::IgnoreUserValues );
     resMgr.loadLanguage( "LightApp", "en" );
-    // ...get splash preferences
-    QString splashIcon;
-    resMgr.value( "splash", "image", splashIcon );
-    QPixmap px( splashIcon );
-    if ( px.isNull() ) // try to get splash pixmap from resources
-      px = resMgr.loadPixmap( "LightApp", QObject::tr( "ABOUT_SPLASH" ) );
-    if ( !px.isNull() ) {
-      // ...set splash pixmap
-      splash = QtxSplash::splash( px );
-      // ... set margin
-      int splashMargin;
-      if ( resMgr.value( "splash", "margin", splashMargin ) && splashMargin > 0 ) {
-       splash->setMargin( splashMargin );
-      }
-      // ...set splash text colors
-      QString splashTextColors;
-      if ( resMgr.value( "splash", "text_colors", splashTextColors ) && !splashTextColors.isEmpty() ) {
-       QStringList colors = QStringList::split( "|", splashTextColors );
-       QColor c1, c2;
-       if ( colors.count() > 0 ) c1 = QColor( colors[0] );
-       if ( colors.count() > 1 ) c2 = QColor( colors[1] );
-       splash->setTextColors( c1, c2 );
-      }
-      else {
-       splash->setTextColors( Qt::white, Qt::black );
-      }
-      // ...set splash progress colors
-      QString splashProgressColors;
-      if ( resMgr.value( "splash", "progress_colors", splashProgressColors ) && !splashProgressColors.isEmpty() ) {
-       QStringList colors = QStringList::split( "|", splashProgressColors );
-       QColor c1, c2;
-       int gradType = QtxSplash::Vertical;
-       if ( colors.count() > 0 ) c1 = QColor( colors[0] );
-       if ( colors.count() > 1 ) c2 = QColor( colors[1] );
-       if ( colors.count() > 2 ) gradType = colors[2].toInt();
-       splash->setProgressColors( c1, c2, gradType );
-      }
-      // ...set splash text font
-      QFont f = splash->font();
-      f.setBold( true );
-      splash->setFont( f );
-      // ...show splash initial status
-      QString splashInfo;
-      if ( resMgr.value( "splash", "info", splashInfo, false ) && !splashInfo.isEmpty() ) {
-       splashInfo.replace( QRegExp( "%A" ),  QObject::tr( "APP_NAME" ) );
-       splashInfo.replace( QRegExp( "%V" ),  QObject::tr( "ABOUT_VERSION" ).arg( salomeVersion() ) );
-       splashInfo.replace( QRegExp( "%L" ),  QObject::tr( "ABOUT_LICENSE" ) );
-       splashInfo.replace( QRegExp( "%C" ),  QObject::tr( "ABOUT_COPYRIGHT" ) );
-       splashInfo.replace( QRegExp( "\\\\n" ), "\n" );
-       splash->message( splashInfo );
-      }
-      // ...set 'hide on click' flag
-#ifdef _DEBUG_
-      splash->setHideOnClick( true );
-#endif
-      // ...show splash
+    //
+    splash = QtxSplash::splash( QPixmap() );
+    splash->readSettings( &resMgr );
+    if ( splash->pixmap().isNull() )
+      splash->setPixmap( resMgr.loadPixmap( "LightApp", QObject::tr( "ABOUT_SPLASH" ) ) );
+    if ( splash->pixmap().isNull() ) {
+      delete splash;
+      splash = 0;
+    }
+    else {
+      splash->setOption( "%A", QObject::tr( "APP_NAME" ) );
+      splash->setOption( "%V", QObject::tr( "ABOUT_VERSION" ).arg( salomeVersion() ) );
+      splash->setOption( "%L", QObject::tr( "ABOUT_LICENSE" ) );
+      splash->setOption( "%C", QObject::tr( "ABOUT_COPYRIGHT" ) );
       splash->show();
-      qApp->processEvents();
+      QApplication::instance()->processEvents();
     }
   }
 
+  
   // Initialization
   int result = -1;
 
@@ -550,9 +410,6 @@ int main( int argc, char **argv )
     int orbArgc = 1;
     orb = init( orbArgc, argv );
 
-    // ...install SALOME thread event handler
-    SALOME_Event::GetSessionThread();
-
     CORBA::Object_var obj = orb->resolve_initial_references( "RootPOA" );
     poa = PortableServer::POA::_narrow( obj );
 
@@ -607,14 +464,29 @@ int main( int argc, char **argv )
       _SplashMutex.lock();
       // ...create servers checking thread
       Session_ServerCheck sc( &_SplashMutex, &_SplashStarted );
-      // ...block this thread until servers checking is finished
-      _SplashStarted.wait( &_SplashMutex );
+      // ... set initial progress
+      splash->setProgress( 0, sc.totalSteps() );
+      // start check loop 
+      while ( true ) {
+       int step    = sc.currentStep();
+       int total   = sc.totalSteps();
+       QString msg = sc.currentMessage();
+       QString err = sc.error();
+       if ( !err.isEmpty() ) {
+         QtxSplash::setError( err );
+         QApplication::instance()->processEvents();
+         result = -1;
+         break;
+       }
+       QtxSplash::setStatus( msg, step );
+       QApplication::instance()->processEvents();
+       if ( step >= total )
+         break;
+       // ...block this thread until servers checking is finished
+       _SplashStarted.wait( &_SplashMutex );
+      }
       // ...unlock mutex 'cause it is no more needed
       _SplashMutex.unlock();
-      // get servers checking thread status
-      result = splash->error();
-      QString info = splash->message().isEmpty() ? "%1" : QString( "%1\n%2" ).arg( splash->message() );
-      splash->setStatus( info.arg( "Activating desktop..." ) );
     }
 
     // Finalize embedded servers launcher 
@@ -628,6 +500,8 @@ int main( int argc, char **argv )
   if ( !result ) {
     // Launch GUI activator
     if ( isGUI ) {
+      if ( splash )
+       splash->setStatus( QApplication::translate( "", "Activating desktop..." ) );
       // ...retrieve Session interface reference
       CORBA::Object_var obj = _NS->Resolve( "/Kernel/Session" );
       SALOME::Session_var session = SALOME::Session::_narrow( obj ) ;
@@ -656,6 +530,10 @@ int main( int argc, char **argv )
       SUIT_Application* aGUIApp = aGUISession->startApplication( "SalomeApp", 0, 0 );
       if ( aGUIApp )
       {
+       Style_Salome::initialize( aGUIApp->resourceMgr() );
+       if ( aGUIApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) )
+         Style_Salome::apply();
+
        if ( !isFound( "noexcepthandler", argc, argv ) )
          _qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application
                                                       // aGUISession contains SalomeApp_ExceptionHandler
@@ -667,8 +545,6 @@ int main( int argc, char **argv )
          
        result = _qappl.exec();
        
-       if ( splash )
-         delete splash;
        splash = 0;
 
        if ( result == SUIT_Session::NORMAL ) { // desktop is closed by user from GUI
@@ -702,20 +578,18 @@ int main( int argc, char **argv )
   PyGILState_STATE gstate = PyGILState_Ensure();
   Py_Finalize();
 
-  try 
-    {
-      orb->destroy();
-    }
-  catch(...) 
-    {
-      //////////////////////////////////////////////////////////////
-      // VSR: silently skip exception:
-      // CORBA.BAD_INV_ORDER.BAD_INV_ORDER_ORBHasShutdown 
-      // exception is raised when orb->destroy() is called and
-      // cpp continer is launched in the embedded mode
-      //////////////////////////////////////////////////////////////
-      // std::cerr << "Caught unexpected exception on destroy : ignored !!" << std::endl;
-    }
+  try  {
+    orb->shutdown(0);
+  }
+  catch (...) {
+    //////////////////////////////////////////////////////////////
+    // VSR: silently skip exception:
+    // CORBA.BAD_INV_ORDER.BAD_INV_ORDER_ORBHasShutdown 
+    // exception is raised when orb->destroy() is called and
+    // cpp continer is launched in the embedded mode
+    //////////////////////////////////////////////////////////////
+    // std::cerr << "Caught unexpected exception on destroy : ignored !!" << std::endl;
+  }
 
   if ( shutdown )
     killOmniNames();
index 813270515dd0f660de88055b41baefb33e0d44ba..e861236f795ef804218052c4a5e54963eb1d2958 100644 (file)
@@ -1,6 +1,6 @@
-//  SalomeApp_Engine_i : implementation of SalomeApp_Engine.idl
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SalomeApp_Engine_i : implementation of SalomeApp_Engine.idl
 //  File   : SalomeApp_Engine_i.cxx
 //  Author : Alexander SLADKOV
 //  Module : SALOME
 //  $Header$
-
+//
 #include "SalomeApp_Engine_i.hxx"
 
 #include "SALOMEDS_Tool.hxx"
 
-#include "utilities.h"
-
 #include <iostream>
 
 using namespace std;
index abadbdd675167cb07b0c48abb1c777dac14ba299..b338785d27b8826761a9b3cbfa5992c53d3cf5ec 100755 (executable)
@@ -1,35 +1,34 @@
-//  SalomeApp_Engine_i : implementation of SalomeApp_Engine.idl
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SalomeApp_Engine_i : implementation of SalomeApp_Engine.idl
 //  File   : SalomeApp_Engine_i.hxx
 //  Author : Alexander SLADKOV
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef _SALOMEAPP_ENGINE_I_HXX_
 #define _SALOMEAPP_ENGINE_I_HXX_
 
-#include <SALOME_Session.hxx>
+#include "SALOME_Session.hxx"
 
 #include "SALOME_Component_i.hxx"
 
diff --git a/src/Session/Session.pro b/src/Session/Session.pro
new file mode 100644 (file)
index 0000000..1fb30bb
--- /dev/null
@@ -0,0 +1,106 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#TEMPLATE = lib
+#TARGET = SalomeSession
+#DESTDIR = ../../lib
+#MOC_DIR = ../../moc
+#OBJECTS_DIR = ../../obj/$$TARGET
+
+# ================>
+
+TEMPLATE = 
+TARGET = SALOME_Session_Server
+DESTDIR = ../../bin
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+# <================
+
+
+QT_MT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
+
+PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
+
+HDF5_INCLUDES = $$(HDF5HOME)/include
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+OMNIORBDIR = $$(OMNIORBDIR)
+CORBA_INCLUDES = $${OMNIORBDIR}/include $${OMNIORBDIR}/include/omniORB4 $${OMNIORBDIR}/include/COS
+
+INCLUDEPATH += $${QT_MT_INCLUDES} $${PYTHON_INCLUDES} $${HDF5_INCLUDES} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${CAS_CPPFLAGS} $${CORBA_INCLUDES} ../../salome_adm/unix $$(GUI_ROOT_DIR)/idl ../Qtx ../SUIT ../Event
+
+QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
+
+KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
+
+CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
+
+LIBS += $${QT_MT_LIBS}  $${KERNEL_LDFLAGS} -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lSalomeCatalog -lSalomeDSClient $${CAS_KERNEL} -L../../lib -lwith_loggerTraceCollector -lsuit -lEvent -L$$(GUI_ROOT_DIR)/idl -lSalomeIDLGUI
+
+# ================>
+
+OMNIORB_LIBS = -L$${OMNIORBDIR}/lib -lomniORB4 -lomniDynamic4 -lCOS4 -lCOSDynamic4 -lomnithread
+
+HDF5_LIBS = -L$$(HDF5HOME)/lib -lhdf5
+
+INCLUDEPATH = $${INCLUDEPATH}
+LIBS = $${LIBS} $${OMNIORB_LIBS} $${HDF5_LIBS} -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry -lSalomeNotification -lSALOMEBasics -L$$(GUI_ROOT_DIR)/lib -lqtx -lSalomeSession
+
+# <================
+
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += SESSION_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS OMNIORB_VERSION=4 __x86__ __linux__ COMP_CORBA_DOUBLE COMP_CORBA_LONG
+
+HEADERS  = Session_Session_i.hxx
+HEADERS += Session_ServerLauncher.hxx
+HEADERS += Session_ServerThread.hxx
+HEADERS += Session_ServerCheck.hxx
+HEADERS += SalomeApp_Engine_i.hxx
+
+SOURCES  = Session_Session_i.cxx
+SOURCES += Session_ServerThread.cxx
+SOURCES += Session_ServerLauncher.cxx
+SOURCES += Session_ServerCheck.cxx
+SOURCES += SalomeApp_Engine_i.cxx
+
+# ================>
+
+SOURCES += SALOME_Session_Server.cxx
+
+# <================
+
+#includes.files = $$HEADERS
+#includes.path = ../../include
+
+#INSTALLS += includes
+
+
index 3642f040728cdb411eca65ea4d869de5abd6e26d..4003b22accdad1f9a87c28eefb0861062c7f8635 100644 (file)
@@ -1,26 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Session_ServerCheck.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-// File:      Session_ServerCheck.cxx
-// Author:    Vadim SANDLER
-
 #include "Session_ServerCheck.hxx"
-#include <QtxSplash.h>
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(SALOME_Session)
 #include "Utils_ORB_INIT.hxx"
 #include "Utils_SINGLETON.hxx"
 #include "SALOME_NamingService.hxx"
+#include "Basics_Utils.hxx"
 #include "utilities.h"
-#include "OpUtil.hxx"
 
+#include <QApplication> 
+#include <QWaitCondition>
+#include <QMutexLocker>
+#include <QStringList>
+
+//
 // Default settings
-const int __DEFAULT__ATTEMPTS__ = 300;      // number of checks attemtps
-                                            // can be overrided by CSF_RepeatServerRequest
-                                            // environment variable
-const int __DEFAULT__DELAY__    = 50000;    // delay between attempts (microseconds)
-                                            // can be overrided by CSF_DelayServerRequest
-                                            // environment variable
+//
+
+/*!
+  \brief Default number of attemtps to check SALOME server.
+
+  This value can be changed by setting the CSF_RepeatServerRequest
+  environment variable. For example, to set number of check attempts
+  for each server to 1000:
+  \code
+  setenv CSF_RepeatServerRequest 1000
+  \endcode
+*/
+const int __DEFAULT__ATTEMPTS__ = 300;
+
+/*!
+  \brief Default delay between attempts (in microseconds).
+
+  This value can be changed by setting the CSF_DelayServerRequest
+  environment variable. For example, to set delay between attemtps
+  to check SALOME servers to 100000 (0.1 second):
+  \code
+  setenv CSF_DelayServerRequest 100000
+  \endcode
+*/
+const int __DEFAULT__DELAY__ = 50000;
+
+/*!
+  \classSession_ServerCheck::Locker
+  \brief Automatic locker/unlocker.
+  \internal
+*/
+
+class Session_ServerCheck::Locker
+{
+public:
+  /*!
+    \brief Constructor. Tries to aquire lock.
+  */
+  Locker( Session_ServerCheck* sc ) 
+    : myChecker( sc )
+  {
+    myChecker->myMutex->lock();
+    myChecker->myMutex->unlock();
+  }
+  /*!
+    \brief Destructor. Wakes the calling thread and goes sleeping.
+  */
+  ~Locker()
+  {
+    myChecker->myWC->wakeAll();
+    myChecker->usleep( myChecker->myDelay );
+  }
+private:
+  Session_ServerCheck* myChecker;
+};
+
+/*!
+  \class Session_ServerCheck
+  \brief The class Session_ServerCheck is used to check SALOME
+  servers availability.
+  
+  It runs in the secondrary thread. The number of attemts to check
+  each SALOME server and the time delay between checks can be specified
+  via setting the CSF_RepeatServerRequest and CSF_DelayServerRequest
+  environment variables.
+
+  Total number of the check attempts can be retrieved via totalSteps()
+  method and current check step can be retrieved via currentStep() method.
+
+  The method currentMessage() can be used to get the information message
+  about what SALOME server is currently checked. If any error occured (some
+  server could not be found) the thread loop is stopped and error status
+  is set. Error message can be retrieved with the error() method.
+*/
 
 /*!
-  Constructor
+  \brief Constructor.
+  \param mutex a mutex used to serialize progress operations (splash)
+  \param wc a wait condition used in combination with \a mutex
 */
 Session_ServerCheck::Session_ServerCheck( QMutex* mutex, QWaitCondition* wc )
-  : QThread(),
-    myMutex( mutex ),
-    myWC( wc ),
-    myCheckCppContainer( false ),
-    myCheckPyContainer( false ),
-    myCheckSVContainer( false ),
-    myAttempts( __DEFAULT__ATTEMPTS__ ),
-    myDelay   ( __DEFAULT__DELAY__ )
+: QThread(),
+  myMutex( mutex ),
+  myWC( wc ),
+  myCheckCppContainer( false ),
+  myCheckPyContainer( false ),
+  myCheckSVContainer( false ),
+  myAttempts( __DEFAULT__ATTEMPTS__ ),
+  myDelay   ( __DEFAULT__DELAY__ ),
+  myCurrentStep( 0 )
 {
   char* cenv;
   // try to get nb of attempts from environment variable
@@ -64,14 +143,12 @@ Session_ServerCheck::Session_ServerCheck( QMutex* mutex, QWaitCondition* wc )
   if ( ( cenv = getenv( "CSF_DelayServerRequest" ) ) && atoi( cenv ) > 0 )
     myDelay = atoi( cenv );
 
-  // check if it is necessary to wait containers
-  for ( int i = 1; i < qApp->argc(); i++ ) {
-    if ( !strcmp( qApp->argv()[i], "CPP" ) )
-      myCheckCppContainer = true;
-    if ( !strcmp( qApp->argv()[i], "PY" ) )
-      myCheckPyContainer = true;
-    if ( !strcmp( qApp->argv()[i], "SUPERV" ) )
-      myCheckSVContainer = true;
+  // parse command line check if it is necessary to wait SALOME containers
+  QStringList args = QApplication::arguments();
+  for ( int i = 1; i < args.count(); i++ ) {
+    myCheckCppContainer = myCheckCppContainer || args[i] == "CPP";
+    myCheckPyContainer  = myCheckPyContainer  || args[i] == "PY";
+    myCheckSVContainer  = myCheckSVContainer  || args[i] == "SUPERV";
   }
   
   // start thread
@@ -79,69 +156,116 @@ Session_ServerCheck::Session_ServerCheck( QMutex* mutex, QWaitCondition* wc )
 }
 
 /*!
-  Destructor
+  \brief Destructor
 */
 Session_ServerCheck::~Session_ServerCheck()
 {
+  terminate();
+  while( isRunning() );
 }
 
 /*!
-  Thread loop. Checnk SALOME servers and shows status message
-  in the splash screen.
+  \brief Get current information message.
+  \return current message
 */
-void Session_ServerCheck::run()
+QString Session_ServerCheck::currentMessage()
 {
-  // automatic locker
-  class Locker
-  {
-  public:
-    QMutex*         _m;
-    QWaitCondition* _wc;
-    Locker( QMutex* m, QWaitCondition* wc ) : _m( m ), _wc( wc )
-    {
-      _m->lock();
-      _m->unlock(); 
-    }
-    ~Locker()
-    {
-      _wc->wakeAll();
-    }
-  };
+  static QStringList messages;
+  if ( messages.isEmpty() ) {
+    messages << tr( "Waiting for naming service..." ); 
+    messages << tr( "Waiting for registry server..." );
+    messages << tr( "Waiting for study server..." );
+    messages << tr( "Waiting for module catalogue server..." );
+    messages << tr( "Waiting for session server..." );
+    messages << tr( "Waiting for C++ container..." );
+    messages << tr( "Waiting for Python container..." );
+    messages << tr( "Waiting for Supervision container..." );
+  }
+  QMutexLocker locker( &myDataMutex );
+  QString msg;
+  int idx = myCurrentStep / myAttempts;
+  if ( idx >= 0 && idx < messages.count() )
+    msg = messages[ idx ];
+  return msg;
+}
 
-  // lock mutex (ensure splash is shown)
-  Locker locker( myMutex, myWC );
+/*!
+  \brief Get error message.
+  \return error message or null string of there was no any error
+*/
+QString Session_ServerCheck::error()
+{
+  QMutexLocker locker( &myDataMutex );
+  return myError;
+}
 
-  // set initial splash status
-  QtxSplash* splash = QtxSplash::splash();
+/*!
+  \brief Get current step.
+  \return current step
+*/
+int Session_ServerCheck::currentStep()
+{
+  QMutexLocker locker( &myDataMutex );
+  return myCurrentStep;
+}
 
+/*!
+  \brief Get total number of check steps.
+  \return total number of steps
+*/
+int Session_ServerCheck::totalSteps()
+{
+  QMutexLocker locker( &myDataMutex );
   int cnt = 5;                       // base servers
   if ( myCheckCppContainer ) cnt++;  // + C++ container
   if ( myCheckPyContainer )  cnt++;  // + Python container
   if ( myCheckSVContainer )  cnt++;  // + supervision container
+  return cnt * myAttempts;
+}
 
-  splash->setProgress( 0, cnt * myAttempts );
-  QString initialInfo = splash->message();
-  QString info = initialInfo.isEmpty() ? "%1" : QString( "%1\n%2" ).arg( initialInfo );
+/*!
+  \brief Modify current step.
+  \param step new current step value
+*/
+void Session_ServerCheck::setStep( const int step )
+{
+  QMutexLocker locker( &myDataMutex );
+  myCurrentStep = step;
+}
 
+/*!
+  \brief Set error message.
+  \param msg error message
+*/
+void Session_ServerCheck::setError( const QString& msg )
+{
+  QMutexLocker locker( &myDataMutex );
+  myError = msg;
+}
+
+/*!
+  \brief Thread loop function. Performs SALOME servers check.
+*/
+void Session_ServerCheck::run()
+{
   // start check servers
-  int i;
   int current = 0;
-  bool bOk;
   QString error;
-  int    argc = qApp->argc();
-  char** argv = qApp->argv();
+  int    argc = QApplication::instance()->argc();
+  char** argv = QApplication::instance()->argv();
 
   // 1. Check naming service
-  bOk = false;
-  for ( i = 0; i < myAttempts ; i++ ) {
-    QtxSplash::setStatus( info.arg( "Waiting for naming service..." ), current * myAttempts + i );
-    QThread::usleep( i == 0 ? 50000 : myDelay );
+  for ( int i = 0; i < myAttempts; i++ ) {
+    Locker locker( this );
+
+    setStep( current * myAttempts + i );
+
     try {
       CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
       CORBA::Object_var obj = orb->resolve_initial_references( "NameService" );
       CosNaming::NamingContext_var _root_context = CosNaming::NamingContext::_narrow( obj );
       if ( !CORBA::is_nil( _root_context ) ) {
-       bOk = true;
+       setStep( ++current * myAttempts );
        break;
       }
     }
@@ -151,19 +275,19 @@ void Session_ServerCheck::run()
     catch( ... ) {
       MESSAGE( "Unknown Exception: unable to contact the naming service" );
     }
+
+    if ( i == myAttempts-1 ) {
+      setError( tr( "Unable to contact the naming service.\n" ) );
+      return;
+    }
   }
-  if ( !bOk ) {
-    QtxSplash::error( "Unable to contact the naming service.\n%1" );
-    return;
-  }
-  QtxSplash::setStatus( info.arg( "Waiting for naming service...OK" ), ++current * myAttempts );
-  QThread::usleep( 30000 );
-  
+
   // 2. Check registry server
-  bOk = false;
-  for ( i = 0; i < myAttempts ; i++ ) {
-    QtxSplash::setStatus( info.arg( "Waiting for registry server..." ), current * myAttempts + i );
-    QThread::usleep( i == 0 ? 50000 : myDelay );
+  for ( int i = 0; i < myAttempts ; i++ ) {
+    Locker locker( this );
+
+    setStep( current * myAttempts + i );
+
     try {
       CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
       SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
@@ -175,7 +299,7 @@ void Session_ServerCheck::run()
        MESSAGE( "/Registry is found" );
        registry->ping();
        MESSAGE( "Registry was activated" );
-       bOk = true;
+       setStep( ++current * myAttempts );
        break;
       }
     }
@@ -199,19 +323,19 @@ void Session_ServerCheck::run()
       MESSAGE( "Caught unknown exception." );
       error = "Caught unknown exception.";
     }
+
+    if ( i == myAttempts-1 ) {
+      setError( tr( "Registry server is not found.\n%1" ).arg ( error ) );
+      return;
+    }
   }
-  if ( !bOk ) {
-    QtxSplash::error( QString( "Registry server is not found.\n%1" ).arg ( error ) );
-    return;
-  }
-  QtxSplash::setStatus( info.arg( "Waiting for registry server...OK" ), ++current * myAttempts );
-  QThread::usleep( 30000 );
 
   // 3. Check data server
-  bOk = false;
-  for ( i = 0; i < myAttempts ; i++ ) {
-    QtxSplash::setStatus( info.arg( "Waiting for study server..." ), current * myAttempts + i );
-    QThread::usleep( i == 0 ? 50000 : myDelay );
+  for ( int i = 0; i < myAttempts ; i++ ) {
+    Locker locker( this );
+
+    setStep( current * myAttempts + i );
+
     try {
       CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
       SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
@@ -223,7 +347,7 @@ void Session_ServerCheck::run()
        MESSAGE( "/myStudyManager is found" );
        studyManager->ping();
        MESSAGE( "StudyManager was activated" );
-       bOk = true;
+       setStep( ++current * myAttempts );
        break;
       }
     }
@@ -247,19 +371,19 @@ void Session_ServerCheck::run()
       MESSAGE( "Caught unknown exception." );
       error = "Caught unknown exception.";
     }
-  }
-  if ( !bOk ) {
-    QtxSplash::error( QString( "Study server is not found.\n%1" ).arg ( error ) );
-    return;
-  }
-  QtxSplash::setStatus( info.arg( "Waiting for study server...OK" ), ++current * myAttempts );
-  QThread::usleep( 30000 );
 
+    if ( i == myAttempts-1 ) {
+      setError( tr( "Study server is not found.\n%1" ).arg ( error ) );
+      return;
+    }
+  }
+  
   // 4. Check module catalogue server
-  bOk = false;
-  for ( i = 0; i < myAttempts ; i++ ) {
-    QtxSplash::setStatus( info.arg( "Waiting for module catalogue server..." ), current * myAttempts + i );
-    QThread::usleep( i == 0 ? 50000 : myDelay );
+  for ( int i = 0; i < myAttempts ; i++ ) {
+    Locker locker( this );
+
+    setStep( current * myAttempts + i );
+
     try {
       CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
       SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
@@ -271,7 +395,7 @@ void Session_ServerCheck::run()
        MESSAGE( "/Kernel/ModulCatalog is found" );
        catalog->ping();
        MESSAGE( "ModuleCatalog was activated" );
-       bOk = true;
+       setStep( ++current * myAttempts );
        break;
       }
     }
@@ -295,19 +419,19 @@ void Session_ServerCheck::run()
       MESSAGE( "Caught unknown exception." );
       error = "Caught unknown exception.";
     }
+
+    if ( i == myAttempts-1 ) {
+      setError( tr( "Module catalogue server is not found.\n%1" ).arg ( error ) );
+      return;
+    }
   }
-  if ( !bOk ) {
-    QtxSplash::error( QString( "Module catalogue server is not found.\n%1" ).arg ( error ) );
-    return;
-  }
-  QtxSplash::setStatus( info.arg( "Waiting for module catalogue server...OK" ), ++current * myAttempts );
-  QThread::usleep( 30000 );
 
   // 5. Check data server
-  bOk = false;
-  for ( i = 0; i < myAttempts ; i++ ) {
-    QtxSplash::setStatus( info.arg( "Waiting for session server..." ), current * myAttempts + i );
-    QThread::usleep( i == 0 ? 50000 : myDelay );
+  for ( int i = 0; i < myAttempts ; i++ ) {
+    Locker locker( this );
+
+    setStep( current * myAttempts + i );
+
     try {
       CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
       SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
@@ -319,7 +443,7 @@ void Session_ServerCheck::run()
        MESSAGE( "/Kernel/Session is found" );
        session->ping();
        MESSAGE( "SALOME_Session was activated" );
-       bOk = true;
+       setStep( ++current * myAttempts );
        break;
       }
     }
@@ -343,33 +467,33 @@ void Session_ServerCheck::run()
       MESSAGE( "Caught unknown exception." );
       error = "Caught unknown exception.";
     }
+
+    if ( i == myAttempts-1 ) {
+      setError( tr( "Session server is not found.\n%1" ).arg ( error ) );
+      return;
+    }
   }
-  if ( !bOk ) {
-    QtxSplash::error( QString( "Session server is not found.\n%1" ).arg ( error ) );
-    return;
-  }
-  QtxSplash::setStatus( info.arg( "Waiting for session server...OK" ), ++current * myAttempts );
-  QThread::usleep( 30000 );
 
   // 6. Check C++ container
   if ( myCheckCppContainer ) {
-    bOk = false;
-    for ( i = 0; i < myAttempts ; i++ ) {
-      QtxSplash::setStatus( info.arg( "Waiting for C++ container..." ), current * myAttempts + i );
-      QThread::usleep( i == 0 ? 50000 : myDelay );
+    for ( int i = 0; i < myAttempts ; i++ ) {
+      Locker locker( this );
+      
+      setStep( current * myAttempts + i );
+
       try {
        CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
        SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
        ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
        NS.init_orb( orb );
-       QString containerName = QString( "/Containers/%1/FactoryServer" ).arg( GetHostname().c_str() );
-       CORBA::Object_var obj = NS.Resolve( containerName.latin1() );
+       QString containerName = QString( "/Containers/%1/FactoryServer" ).arg( Kernel_Utils::GetHostname().c_str() );
+       CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
        Engines::Container_var FScontainer = Engines::Container::_narrow( obj );
        if ( !CORBA::is_nil( FScontainer ) ) {
-         MESSAGE( containerName.latin1() << " is found" );
+         MESSAGE( containerName.toLatin1().constData() << " is found" );
          FScontainer->ping();
          MESSAGE( "FactoryServer container was activated" );
-         bOk = true;
+         setStep( ++current * myAttempts );
          break;
        }
       }
@@ -393,34 +517,34 @@ void Session_ServerCheck::run()
        MESSAGE( "Caught unknown exception." );
        error = "Caught unknown exception.";
       }
+      
+      if ( i == myAttempts-1 ) {
+       setError( tr( "C++ container is not found.\n%1" ).arg ( error ) );
+       return;
+      }
     }
-    if ( !bOk ) {
-      QtxSplash::error( QString( "C++ container is not found.\n%1" ).arg ( error ) );
-      return;
-    }
-    QtxSplash::setStatus( info.arg( "Waiting for C++ container...OK" ), ++current * myAttempts );
-    QThread::usleep( 30000 );
   }
 
   // 7. Check Python container
   if ( myCheckPyContainer ) {
-    bOk = false;
-    for ( i = 0; i < myAttempts ; i++ ) {
-      QtxSplash::setStatus( info.arg( "Waiting for Python container..." ), current * myAttempts + i );
-      QThread::usleep( i == 0 ? 50000 : myDelay );
+    for ( int i = 0; i < myAttempts ; i++ ) {
+      Locker locker( this );
+      
+      setStep( current * myAttempts + i );
+
       try {
        CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
        SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
        ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
        NS.init_orb( orb );
-       QString containerName = QString( "/Containers/%1/FactoryServerPy" ).arg( GetHostname().c_str() );
-       CORBA::Object_var obj = NS.Resolve( containerName.latin1() );
+       QString containerName = QString( "/Containers/%1/FactoryServerPy" ).arg( Kernel_Utils::GetHostname().c_str() );
+       CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
        Engines::Container_var FSPcontainer = Engines::Container::_narrow( obj );
        if ( !CORBA::is_nil( FSPcontainer ) ) {
-         MESSAGE( containerName.latin1() << " is found" );
+         MESSAGE( containerName.toLatin1().constData() << " is found" );
          FSPcontainer->ping();
          MESSAGE("FactoryServerPy container was activated");
-         bOk = true;
+         setStep( ++current * myAttempts );
          break;
        }
       }
@@ -444,34 +568,34 @@ void Session_ServerCheck::run()
        MESSAGE( "Caught unknown exception." );
        error = "Caught unknown exception.";
       }
+
+      if ( i == myAttempts-1 ) {
+       setError( tr( "Python container is not found.\n%1" ).arg ( error ) );
+       return;
+      }
     }
-    if ( !bOk ) {
-      QtxSplash::error( QString( "Python container is not found.\n%1" ).arg ( error ) );
-      return;
-    }
-    QtxSplash::setStatus( info.arg( "Waiting for Python container...OK" ), ++current * myAttempts );
-    QThread::usleep( 30000 );
   }
 
   // 8. Check supervision container
   if ( myCheckSVContainer ) {
-    bOk = false;
-    for ( i = 0; i < myAttempts ; i++ ) {
-      QtxSplash::setStatus( info.arg( "Waiting for Supervision container..." ), current * myAttempts + i );
-      QThread::usleep( i == 0 ? 50000 : myDelay );
+    for ( int i = 0; i < myAttempts ; i++ ) {
+      Locker locker( this );
+      
+      setStep( current * myAttempts + i );
+
       try {
        CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
        SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
        ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
        NS.init_orb( orb );
-       QString containerName = QString( "/Containers/%1/SuperVisionContainer" ).arg( GetHostname().c_str() );
-       CORBA::Object_var obj = NS.Resolve( containerName.latin1() );
+       QString containerName = QString( "/Containers/%1/SuperVisionContainer" ).arg( Kernel_Utils::GetHostname().c_str() );
+       CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
        Engines::Container_var SVcontainer = Engines::Container::_narrow( obj );
        if ( !CORBA::is_nil( SVcontainer ) ) {
-         MESSAGE( containerName.latin1() << " is found" );
+         MESSAGE( containerName.toLatin1().constData() << " is found" );
          SVcontainer->ping();
          MESSAGE("SuperVisionContainer container was activated");
-         bOk = true;
+         setStep( ++current * myAttempts );
          break;
        }
       }
@@ -495,15 +619,11 @@ void Session_ServerCheck::run()
        MESSAGE( "Caught unknown exception." );
        error = "Caught unknown exception.";
       }
+    
+      if ( i == myAttempts-1 ) {
+       setError( tr( "Supervision container is not found.\n%1" ).arg ( error ) );
+       return;
+      }
     }
-    if ( !bOk ) {
-      QtxSplash::error( QString( "Supervision container is not found.\n%1" ).arg ( error ) );
-      return;
-    }
-    QtxSplash::setStatus( info.arg( "Waiting for Supervision container...OK" ), ++current * myAttempts );
-    QThread::usleep( 30000 );
   }
-  // clear splash status
-  splash->setProgress( 0, 0 );
-  splash->setStatus( initialInfo );
 }
index 8de6a6d41822d0f9421241aaa1b29b8ce185b8f5..e23568ed2f0d9402bfc63c1040a70629879c3fe9 100644 (file)
@@ -1,58 +1,73 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Session_ServerCheck.hxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-// File:      Session_ServerCheck.hxx
-// Author:    Vadim SANDLER
-
 #if !defined(SESSION_SERVERCHECK_HXX)
 #define SESSION_SERVERCHECK_HXX
 
-#include <SALOME_Session.hxx>
+#include "SALOME_Session.hxx"
 
-#include <qthread.h
-#include <qapplication.h> 
+#include <QThread
+#include <QMutex>
 
-class QMutex;
 class QWaitCondition;
 
-/*!
-  Class Session_ServerCheck : check SALOME servers
-*/
 class SESSION_EXPORT Session_ServerCheck : public QThread
 {
+  class Locker;
+
 public:
-  // constructor
   Session_ServerCheck( QMutex*, QWaitCondition* );
-  // destructor
   virtual ~Session_ServerCheck();
 
-  // thread loop
-  virtual void run() ;
+  QString         currentMessage();
+  QString         error();
+
+  int             currentStep();
+  int             totalSteps();
+
+protected:
+  virtual void    run();
+
+private:
+  void            setStep( const int );
+  void            setError( const QString& msg );
 
 private:
-  QMutex*         myMutex;             // splash mutex
-  QWaitCondition* myWC;                // splash wait condition
-
-  bool            myCheckCppContainer; // flag : check C++ container ?
-  bool            myCheckPyContainer;  // flag : check Python container ?
-  bool            myCheckSVContainer;  // flag : check supervision container ?
-  int             myAttempts;          // number of checks attemtps to get response from server
-  int             myDelay;             // delay between two attempts in microseconds
+  QMutex          myDataMutex;         //!< data mutex
+  QMutex*         myMutex;             //!< splash mutex
+  QWaitCondition* myWC;                //!< splash wait condition
+
+  bool            myCheckCppContainer; //!< flag : check C++ container
+  bool            myCheckPyContainer;  //!< flag : check Python container
+  bool            myCheckSVContainer;  //!< flag : check supervision container
+  int             myAttempts;          //!< number of attemtps to get response from server
+  int             myDelay;             //!< delay between attempts in microseconds
+  int             myCurrentStep;       //!< current step
+  QString         myMessage;           //!< current information message
+  QString         myError;             //!< error message
+
+  friend class Locker;
 };
 
-#endif
+#endif  // SESSION_SERVERCHECK_HXX
index c13c71a7a008c37c6995b45a5f1e387f57fa1656..bf7fe089037f4a522702249621cd710ca9ba43b4 100755 (executable)
@@ -1,35 +1,39 @@
-//  SALOME Session : implementation of Session_ServerLauncher.cxx
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME Session : implementation of Session_ServerLauncher.cxx
 //  File   : Session_ServerLauncher.xx
 //  Author : Paul RASCLE, EDF
 //  Module : SALOME
 //  $Header$
-
+//
 #include "Session_ServerLauncher.hxx"
+#include "Session_ServerThread.hxx"
 
 #include "Utils_SALOME_Exception.hxx"
 #include "utilities.h"
+
+#include <QMutex>
+#include <QWaitCondition>
+
 using namespace std;
 /*! 
    default constructor not for use
index b3773adf10f1116230dc266b3f85a6188ddd54c4..dac62c609c80db54d482145bb3432a03a2cd1684 100755 (executable)
@@ -1,44 +1,40 @@
-//  SALOME Session : implementation of Session_ServerLauncher.hxx
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME Session : implementation of Session_ServerLauncher.hxx
 //  File   : Session_ServerLauncher.hxx
 //  Author : Paul RASCLE, EDF
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef _SESSION_SERVERLAUNCHER_HXX_
 #define _SESSION_SERVERLAUNCHER_HXX_
 
-#include <SALOME_Session.hxx>
-
-#include "Session_ServerThread.hxx"
+#include "SALOME_Session.hxx"
 
 #include <CORBA.h> 
 #include <list>
 #include <vector>
 #include <string>
-#include <qthread.h>
-#include <qwaitcondition.h>
+#include <QThread>
 
 using namespace std;
 
@@ -55,6 +51,11 @@ inline ServArg::ServArg(int servType, int firstArg, int lastArg):
   _servType(servType),_firstArg(firstArg),_lastArg(lastArg)
 {}
 
+class Session_ServerThread;
+
+class QMutex;
+class QWaitCondition;
+
 class SESSION_EXPORT Session_ServerLauncher: public QThread
 {
 public:
index c29a4807dd94e90a3fa8aafa67891514331a41ac..3a66b102ec440dd0e38973ca9edbcec90038554b 100755 (executable)
@@ -1,6 +1,6 @@
-//  SALOME Session : implementation of Session_ServerThread.cxx
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME Session : implementation of Session_ServerThread.cxx
 //  File   : Session_ServerThread.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SALOME
 //  $Header$
-
 // #include <SALOMEconfig.h>
 // #include CORBA_SERVER_HEADER(SALOME_Session)
 // #include CORBA_SERVER_HEADER(SALOMEDS)
-
+//
 #include "Session_ServerThread.hxx"
 
-#include "SALOME_Container_i.hxx"
-#include "SALOME_Launcher.hxx"
-#include <SALOMEDSClient.hxx>
+#include <SALOME_NamingService.hxx>
+#include <SALOME_Container_i.hxx>
+#include <SALOME_Launcher.hxx>
 #include <SALOMEDSClient_ClientFactory.hxx>
-#include "SALOME_ModuleCatalog_impl.hxx"
-#include "RegistryService.hxx"
+#include <SALOME_ModuleCatalog_impl.hxx>
+#include <RegistryService.hxx>
+
 #include "Session_Session_i.hxx"
 #include "SalomeApp_Engine_i.hxx"
 
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
-#include "Utils_SALOME_Exception.hxx"
-#include "OpUtil.hxx"
-#include "NamingService_WaitForServerReadiness.hxx"
-#include "utilities.h"
+#include <Utils_ORB_INIT.hxx>
+#include <Utils_SINGLETON.hxx>
+#include <Utils_SALOME_Exception.hxx>
+#include <Basics_Utils.hxx>
+#include <NamingService_WaitForServerReadiness.hxx>
+#include <utilities.h>
 
 #include <cstdlib>
 #include <ctime>
 
+#include <QMutex>
+#include <QWaitCondition>
+
 using namespace std;
 
 const int Session_ServerThread::NB_SRV_TYP = 7;
 const char* Session_ServerThread::_serverTypes[NB_SRV_TYP] = {"Container",
-                                                              "ModuleCatalog",
-                                                              "Registry",
-                                                              "SALOMEDS",
-                                                              "Session",
-                                                              "SalomeAppEngine",
+                                                             "ModuleCatalog",
+                                                             "Registry",
+                                                             "SALOMEDS",
+                                                             "Session",
+                                                             "SalomeAppEngine",
                                                               "ContainerManager"};
 
-/*!
+/*! 
   default constructor not for use
 */
 Session_ServerThread::Session_ServerThread()
@@ -70,13 +72,13 @@ Session_ServerThread::Session_ServerThread()
   ASSERT(0); // must not be called
 }
 
-/*!
+/*! 
   constructor
 */
 Session_ServerThread::Session_ServerThread(int argc,
-                                           char ** argv,
-                                           CORBA::ORB_ptr orb,
-                                           PortableServer::POA_ptr poa)
+                                          char ** argv, 
+                                          CORBA::ORB_ptr orb, 
+                                          PortableServer::POA_ptr poa)
 {
   //MESSAGE("Session_ServerThread Constructor " << argv[0]);
   _argc = argc;
@@ -92,8 +94,8 @@ Session_ServerThread::Session_ServerThread(int argc,
                                         // multi thread coherence problems
 }
 
-/*!
-  destructor
+/*! 
+  destructor 
 */
 Session_ServerThread::~Session_ServerThread()
 {
@@ -104,411 +106,365 @@ Session_ServerThread::~Session_ServerThread()
   delete[] _argv;
 }
 
-/*!
+/*! 
   run the thread : activate one servant, the servant type is given by
   argument _argv[0]
 */
 void Session_ServerThread::Init()
 {
-  MESSAGE("Session_ServerThread::Init "<< _argv[0]);
-
-  for (int i=0; i<_argc; i++) SCRUTE(_argv[i]);
-#ifndef WNT
-  for (int i=0; i<NB_SRV_TYP; i++)
-#else
-  for (i=0; i<NB_SRV_TYP; i++)
-#endif
-    if (strcmp(_argv[0],_serverTypes[i])==0)
-      {
-        _servType = i;
-        MESSAGE("Server Thread type : "<<_serverTypes[i]);
-        switch (_servType)
-          {
-          case 0:  // Container
-            {
-              NamingService_WaitForServerReadiness(_NS,"/Registry");
-              NamingService_WaitForServerReadiness(_NS,"/ContainerManager");
-              ActivateContainer(_argc, _argv);
-              break;
-            }
-          case 1:  // ModuleCatalog
-            {
-              NamingService_WaitForServerReadiness(_NS,"/Registry");
-              ActivateModuleCatalog(_argc, _argv);
-              break;
-            }
-          case 2:  // Registry
-            {
-              NamingService_WaitForServerReadiness(_NS,"");
-              ActivateRegistry(_argc, _argv);
-              break;
-            }
-          case 3:  // SALOMEDS
-            {
-              NamingService_WaitForServerReadiness(_NS,"/Kernel/ModulCatalog");
-              ActivateSALOMEDS(_argc, _argv);
-              break;
-            }
-          case 4:  // Session
-            {
-              NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
-              string containerName = "/Containers/";
-              containerName = containerName + GetHostname();
-              containerName = containerName + "/FactoryServer";
-              NamingService_WaitForServerReadiness(_NS,containerName);
-              ActivateSession(_argc, _argv);
-              break;
-            }
-          case 5: // SalomeApp_Engine
-            {
-              NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
-              ActivateEngine(_argc, _argv);
-              break;
-            }
-          case 6: // Container Manager
-            {
-              NamingService_WaitForServerReadiness(_NS,"");
-              ActivateContainerManager(_argc, _argv);
-              break;
-            }
-          default:
-            {
-              ASSERT(0);
-              break;
-            }
-          }
+  MESSAGE("Session_ServerThread::Init "<< _argv[0]); 
+
+  int i;
+  for (i=0; i<_argc; i++) SCRUTE(_argv[i]);
+
+  for (i=0; i<NB_SRV_TYP; i++) {
+    if (strcmp(_argv[0],_serverTypes[i])==0) {
+      _servType = i;
+      MESSAGE("Server Thread type : "<<_serverTypes[i]);
+      switch (_servType) {
+      case 0:  // Container
+       {
+         NamingService_WaitForServerReadiness(_NS,"/Registry");
+         NamingService_WaitForServerReadiness(_NS,"/ContainerManager");
+         ActivateContainer(_argc, _argv);
+         break;
+       }
+      case 1:  // ModuleCatalog
+       {
+         NamingService_WaitForServerReadiness(_NS,"/Registry");
+         ActivateModuleCatalog(_argc, _argv);
+         break;
+       }
+      case 2:  // Registry
+       {
+         NamingService_WaitForServerReadiness(_NS,"");
+         ActivateRegistry(_argc, _argv);
+         break;
+       }
+      case 3:  // SALOMEDS
+       {
+         NamingService_WaitForServerReadiness(_NS,"/Kernel/ModulCatalog");
+         ActivateSALOMEDS(_argc, _argv);
+         break;
+       }
+      case 4:  // Session
+       {
+         NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
+         string containerName = "/Containers/";
+         containerName = containerName + Kernel_Utils::GetHostname();
+         containerName = containerName + "/FactoryServer";
+         NamingService_WaitForServerReadiness(_NS,containerName);
+         ActivateSession(_argc, _argv);
+         break;
+       }
+      case 5: // SalomeApp_Engine
+       {
+         NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
+         ActivateEngine(_argc, _argv);
+         break;
+       }
+      case 6: // Container Manager
+       {
+         NamingService_WaitForServerReadiness(_NS,"");
+         ActivateContainerManager(_argc, _argv);
+         break;
+       }
+      default:
+       {
+         ASSERT(0);
+         break;
+       }
       }
+    }
+  }
 }
 
 void Session_ServerThread::ActivateModuleCatalog(int argc,
-                                                 char ** argv)
+                                                char ** argv)
 {
-  try
-    {
-      MESSAGE("ModuleCatalog thread started");
-      // allocation on heap to allow destruction by POA
-
-      SALOME_ModuleCatalogImpl* Catalogue_i
-        = new SALOME_ModuleCatalogImpl(argc, argv);
-
-      // Tell the POA that the objects are ready to accept requests.
-
-      PortableServer::ObjectId_var id= _root_poa->activate_object (Catalogue_i);
-      Catalogue_i->_remove_ref();
-
-      CORBA::Object_var myCata = Catalogue_i->_this();
-      _NS->Register(myCata ,"/Kernel/ModulCatalog");
-    }
-  catch(CORBA::SystemException&)
-    {
-      INFOS( "Caught CORBA::SystemException." );
-    }
-  catch(CORBA::Exception&)
-    {
-      INFOS( "Caught CORBA::Exception." );
-    }
-  catch(omniORB::fatalException& fe)
-    {
-      INFOS( "Caught omniORB::fatalException:" );
-      INFOS( "  file: " << fe.file() );
-      INFOS( "  line: " << fe.line() );
-      INFOS( "  mesg: " << fe.errmsg() );
-    }
-  catch(...)
-    {
-      INFOS( "Caught unknown exception." );
-    }
+  try {
+    MESSAGE("ModuleCatalog thread started");
+    // allocation on heap to allow destruction by POA
+    
+    SALOME_ModuleCatalogImpl* Catalogue_i
+      = new SALOME_ModuleCatalogImpl(argc, argv);
+    
+    // Tell the POA that the objects are ready to accept requests.
+    
+    PortableServer::ObjectId_var id = _root_poa->activate_object (Catalogue_i);
+    Catalogue_i->_remove_ref();
+    
+    CORBA::Object_var myCata = Catalogue_i->_this();
+    _NS->Register(myCata ,"/Kernel/ModulCatalog");
+  }
+  catch(CORBA::SystemException&) {
+    INFOS( "Caught CORBA::SystemException." );
+  }
+  catch(CORBA::Exception&) {
+    INFOS( "Caught CORBA::Exception." );
+  }
+  catch(omniORB::fatalException& fe) {
+    INFOS( "Caught omniORB::fatalException:" );
+    INFOS( "  file: " << fe.file() );
+    INFOS( "  line: " << fe.line() );
+    INFOS( "  mesg: " << fe.errmsg() );
+  }
+  catch(...) {
+    INFOS( "Caught unknown exception." );
+  }
 }
 
 void Session_ServerThread::ActivateSALOMEDS(int argc,
-                                            char ** argv)
+                                           char ** argv)
 {
-  try
-    {
-      MESSAGE("SALOMEDS thread started");
-      // We allocate the objects on the heap.  Since these are reference
-      // counted objects, they will be deleted by the POA when they are no
-      // longer needed.
-
-      ClientFactory::createStudyManager(_orb,_root_poa);
-    }
-  catch(CORBA::SystemException&)
-    {
-      INFOS( "Caught CORBA::SystemException." );
-    }
-  catch(CORBA::Exception&)
-    {
-      INFOS( "Caught CORBA::Exception." );
-    }
-  catch(omniORB::fatalException& fe)
-    {
-      INFOS( "Caught omniORB::fatalException:" );
-      INFOS( "  file: " << fe.file() );
-      INFOS( "  line: " << fe.line() );
-      INFOS( "  mesg: " << fe.errmsg() );
-    }
-  catch(...)
-    {
-      INFOS( "Caught unknown exception." );
-    }
+  try {
+    MESSAGE("SALOMEDS thread started");
+    // We allocate the objects on the heap.  Since these are reference
+    // counted objects, they will be deleted by the POA when they are no
+    // longer needed.    
+    
+    ClientFactory::createStudyManager(_orb,_root_poa);
+  }
+  catch(CORBA::SystemException&) {
+    INFOS( "Caught CORBA::SystemException." );
+  }
+  catch(CORBA::Exception&) {
+    INFOS( "Caught CORBA::Exception." );
+  }
+  catch(omniORB::fatalException& fe) {
+    INFOS( "Caught omniORB::fatalException:" );
+    INFOS( "  file: " << fe.file() );
+    INFOS( "  line: " << fe.line() );
+    INFOS( "  mesg: " << fe.errmsg() );
+  }
+  catch(...) {
+    INFOS( "Caught unknown exception." );
+  }
 }
 
 void Session_ServerThread::ActivateRegistry(int argc,
-                                            char ** argv)
+                                           char ** argv)
 {
   MESSAGE("Registry thread started");
-  SCRUTE(argc);
-  if( argc<3 )
-    {
-      INFOS("you must provide the Salome session name when you call SALOME_Registry_Server");
-      throw CommException("you must provide the Salome session name when you call SALOME_Registry_Server");
-    }
+  SCRUTE(argc); 
+  if ( argc<3 ) {
+    INFOS("you must provide the Salome session name when you call SALOME_Registry_Server");
+    throw CommException("you must provide the Salome session name when you call SALOME_Registry_Server");
+  }
   const char *ptrSessionName=0;
 
   int k=0 ;
-  for ( k=1 ; k<argc ; k++ )
-    {
-      if( strcmp(argv[k],"--salome_session")==0 )
-        {
-          ptrSessionName=argv[k+1];
-          break;
-        }
+  for ( k=1 ; k<argc ; k++ ) {
+    if ( strcmp(argv[k],"--salome_session")==0 ) {
+      ptrSessionName=argv[k+1];
+      break;
     }
+  }
   ASSERT(ptrSessionName) ;
   ASSERT(strlen( ptrSessionName )>0);
   const char *registryName = "Registry";
   Registry::Components_var varComponents;
-  try
-    {
-      RegistryService *ptrRegistry = SINGLETON_<RegistryService>::Instance();
-      ptrRegistry->SessionName( ptrSessionName );
-      ptrRegistry->SetOrb(_orb);
-      varComponents = ptrRegistry->_this();
-      // The RegistryService must not already exist.
-
-      try
-        {
-          CORBA::Object_var pipo = _NS->Resolve( registryName );
-          if (CORBA::is_nil(pipo) )  throw ServiceUnreachable();
-          INFOS("RegistryService servant already existing" );
-          ASSERT(0);
-        }
-      catch( const ServiceUnreachable &/*ex*/ )
-        {
-        }
-      catch( const CORBA::Exception &/*exx*/ )
-        {
-        }
-      string absoluteName = string("/") + registryName;
-      _NS->Register( varComponents , absoluteName.c_str() );
-      MESSAGE("On attend les requetes des clients");
-    }
-  catch( const SALOME_Exception &ex )
-    {
-      INFOS( "Communication Error : " << ex.what() );
+  try {
+    RegistryService *ptrRegistry = SINGLETON_<RegistryService>::Instance();
+    ptrRegistry->SessionName( ptrSessionName );
+    ptrRegistry->SetOrb(_orb);
+    varComponents = ptrRegistry->_this();
+    // The RegistryService must not already exist.
+    
+    try {
+      CORBA::Object_var pipo = _NS->Resolve( registryName );
+      if (CORBA::is_nil(pipo) )  throw ServiceUnreachable();
+      INFOS("RegistryService servant already existing" );
       ASSERT(0);
     }
+    catch( const ServiceUnreachable &/*ex*/ ) {
+    }
+    catch( const CORBA::Exception &/*exx*/ ) {
+    }
+    string absoluteName = string("/") + registryName;
+    _NS->Register( varComponents , absoluteName.c_str() );
+    MESSAGE("On attend les requetes des clients");
+  }
+  catch( const SALOME_Exception &ex ) {
+    INFOS( "Communication Error : " << ex.what() );
+    ASSERT(0);
+  }
 }
 
 void Session_ServerThread::ActivateContainerManager(int argc,
-                                                    char ** argv)
+                                            char ** argv)
 {
-  try
-    {
-      PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa();
-      cout << "ActivateSalomeLauncher ......!!!! " << endl;
-      SALOME_Launcher * myContainer = new SALOME_Launcher(_orb,root_poa);
-    }
-  catch(CORBA::SystemException&)
-    {
-      INFOS("Caught CORBA::SystemException.");
-    }
-  catch(PortableServer::POA::WrongPolicy&)
-    {
-      INFOS("Caught CORBA::WrongPolicyException.");
-    }
-  catch(PortableServer::POA::ServantAlreadyActive&)
-    {
-      INFOS("Caught CORBA::ServantAlreadyActiveException");
-    }
-  catch(CORBA::Exception&)
-    {
-      INFOS("Caught CORBA::Exception.");
-    }
-  catch(...)
-    {
-      INFOS("Caught unknown exception.");
-    }
+  try {
+    PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa();
+    cout << "Activate SalomeLauncher ......!!!! " << endl;
+    SALOME_Launcher * myContainer = new SALOME_Launcher(_orb,root_poa);
+  }
+  catch(CORBA::SystemException&) {
+    INFOS("Caught CORBA::SystemException.");
+  }
+  catch(PortableServer::POA::WrongPolicy&) {
+    INFOS("Caught CORBA::WrongPolicyException.");
+  }
+  catch(PortableServer::POA::ServantAlreadyActive&) {
+    INFOS("Caught CORBA::ServantAlreadyActiveException");
+  }
+  catch(CORBA::Exception&) {
+    INFOS("Caught CORBA::Exception.");
+  }
+  catch(...) {
+    INFOS("Caught unknown exception.");
+  }
 }
 
 void Session_ServerThread::ActivateContainer(int argc,
-                                             char ** argv)
+                                            char ** argv)
 {
-  try
-    {
-      MESSAGE("Container thread started");
-
-      // get or create the child POA
-
-      PortableServer::POA_var factory_poa;
-      try
-        {
-          factory_poa = _root_poa->find_POA("factory_poa",0);
-          // 0 = no activation (already done if exists)
-        }
-      catch (PortableServer::POA::AdapterNonExistent&)
-        {
-          MESSAGE("factory_poa does not exists, create...");
-          // define policy objects
-          PortableServer::ImplicitActivationPolicy_var implicitActivation =
-            _root_poa->create_implicit_activation_policy(
-                                                         PortableServer::NO_IMPLICIT_ACTIVATION);
-          // default = NO_IMPLICIT_ACTIVATION
-          PortableServer::ThreadPolicy_var threadPolicy =
-            _root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL);
-          // default = ORB_CTRL_MODEL, other choice SINGLE_THREAD_MODEL
-
-          // create policy list
-          CORBA::PolicyList policyList;
-          policyList.length(2);
-          policyList[0] = PortableServer::ImplicitActivationPolicy::
-            _duplicate(implicitActivation);
-          policyList[1] = PortableServer::ThreadPolicy::
-            _duplicate(threadPolicy);
-
-          PortableServer::POAManager_var nil_mgr
-            = PortableServer::POAManager::_nil();
-          factory_poa = _root_poa->create_POA("factory_poa",
-                                              nil_mgr,
-                                              policyList);
-          //with nil_mgr instead of pman,
-          //a new POA manager is created with the new POA
-
-          // destroy policy objects
-          implicitActivation->destroy();
-          threadPolicy->destroy();
-
-          // obtain the factory poa manager
-          PortableServer::POAManager_var pmanfac = factory_poa->the_POAManager();
-          pmanfac->activate();
-          MESSAGE("pmanfac->activate()");
-        }
-
-      char *containerName = "";
-      if (argc >1)
-        {
-          containerName = argv[1];
-        }
-
-      Engines_Container_i * myContainer
-        = new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false);
-    }
-  catch(CORBA::SystemException&)
-    {
-      INFOS("Caught CORBA::SystemException.");
-    }
-  catch(PortableServer::POA::WrongPolicy&)
-    {
-      INFOS("Caught CORBA::WrongPolicyException.");
-    }
-  catch(PortableServer::POA::ServantAlreadyActive&)
-    {
-      INFOS("Caught CORBA::ServantAlreadyActiveException");
-    }
-  catch(CORBA::Exception&)
-    {
-      INFOS("Caught CORBA::Exception.");
-    }
-  catch(...)
-    {
-      INFOS("Caught unknown exception.");
-    }
+  try {
+    MESSAGE("Container thread started");
+    
+    // get or create the child POA
+    
+    PortableServer::POA_var factory_poa;
+    try {
+      factory_poa = _root_poa->find_POA("factory_poa",0);
+      // 0 = no activation (already done if exists)
+    }
+    catch (PortableServer::POA::AdapterNonExistent&) {
+      MESSAGE("factory_poa does not exists, create...");
+      // define policy objects     
+      PortableServer::ImplicitActivationPolicy_var implicitActivation =
+       _root_poa->create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION);
+      // default = NO_IMPLICIT_ACTIVATION
+      PortableServer::ThreadPolicy_var threadPolicy =
+       _root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL);
+      // default = ORB_CTRL_MODEL, other choice SINGLE_THREAD_MODEL
+      
+      // create policy list
+      CORBA::PolicyList policyList;
+      policyList.length(2);
+      policyList[0] = PortableServer::ImplicitActivationPolicy::
+       _duplicate(implicitActivation);
+      policyList[1] = PortableServer::ThreadPolicy::
+       _duplicate(threadPolicy);
+      
+      PortableServer::POAManager_var nil_mgr
+       = PortableServer::POAManager::_nil();
+      factory_poa = _root_poa->create_POA("factory_poa",
+                                         nil_mgr,
+                                         policyList);
+      //with nil_mgr instead of pman,
+      //a new POA manager is created with the new POA
+      
+      // destroy policy objects
+      implicitActivation->destroy();
+      threadPolicy->destroy();
+      
+      // obtain the factory poa manager
+      PortableServer::POAManager_var pmanfac = factory_poa->the_POAManager();
+      pmanfac->activate();
+      MESSAGE("pmanfac->activate()");
+    }
+    
+    char *containerName = "";
+    if (argc >1) {
+      containerName = argv[1];
+    }
+    
+    Engines_Container_i * myContainer 
+      = new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false);
+  }
+  catch(CORBA::SystemException&) {
+    INFOS("Caught CORBA::SystemException.");
+  }
+  catch(PortableServer::POA::WrongPolicy&) {
+    INFOS("Caught CORBA::WrongPolicyException.");
+  }
+  catch(PortableServer::POA::ServantAlreadyActive&) {
+    INFOS("Caught CORBA::ServantAlreadyActiveException");
+  }
+  catch(CORBA::Exception&) {
+    INFOS("Caught CORBA::Exception.");
+  }
+  catch(...) {
+    INFOS("Caught unknown exception.");
+  }
 }
 
 void Session_ServerThread::ActivateEngine(int /*argc*/, char ** /*argv*/)
 {
-  try
-    {
-      MESSAGE("SalomeApp_Engine thread started");
-      SalomeApp_Engine_i* anEngine = new SalomeApp_Engine_i();
-      PortableServer::ObjectId_var id =_root_poa->activate_object( anEngine );
-      MESSAGE("poa->activate_object( SalomeApp_Engine )");
-
-      CORBA::Object_var obj = anEngine->_this();
-      anEngine->_remove_ref();
-      _NS->Register( obj ,"/SalomeAppEngine");
-
-    }
-  catch (CORBA::SystemException&)
-    {
-      INFOS("Caught CORBA::SystemException.");
-    }
-  catch (CORBA::Exception&)
-    {
-      INFOS("Caught CORBA::Exception.");
-    }
-  catch (...)
-    {
-      INFOS("Caught unknown exception.");
-    }
+  try {
+    MESSAGE("SalomeApp_Engine thread started");
+    SalomeApp_Engine_i* anEngine = new SalomeApp_Engine_i();
+    PortableServer::ObjectId_var id =_root_poa->activate_object( anEngine );
+    MESSAGE("poa->activate_object( SalomeApp_Engine )");
+
+    CORBA::Object_var obj = anEngine->_this();
+    anEngine->_remove_ref();
+    _NS->Register( obj ,"/SalomeAppEngine");
+  }
+  catch (CORBA::SystemException&) {
+    INFOS("Caught CORBA::SystemException.");
+  }
+  catch (CORBA::Exception&) {
+    INFOS("Caught CORBA::Exception.");
+  }
+  catch (...) {
+    INFOS("Caught unknown exception.");
+  }
 }
 
 void Session_ServerThread::ActivateSession(int argc,
-                                           char ** argv)
+                                          char ** argv)
 {
   MESSAGE("Session_ServerThread::ActivateSession() not implemented!");
 }
 
-/*!
-  constructor
+/*! 
+  constructor 
 */
 Session_SessionThread::Session_SessionThread(int argc,
-                                             char** argv,
-                                             CORBA::ORB_ptr orb,
-                                             PortableServer::POA_ptr poa,
-                                             QMutex* GUIMutex,
-                                             QWaitCondition* GUILauncher)
-  : Session_ServerThread(argc, argv, orb, poa),
-    _GUIMutex( GUIMutex ),
-    _GUILauncher( GUILauncher )
+                                            char** argv, 
+                                            CORBA::ORB_ptr orb, 
+                                            PortableServer::POA_ptr poa,
+                                            QMutex* GUIMutex,
+                                            QWaitCondition* GUILauncher)
+: Session_ServerThread(argc, argv, orb, poa),
+  _GUIMutex( GUIMutex ),
+  _GUILauncher( GUILauncher )
 {
 }
 
-/*!
-  destructor
+/*! 
+  destructor 
 */
 Session_SessionThread::~Session_SessionThread()
 {
 }
 
 void Session_SessionThread::ActivateSession(int argc,
-                                            char ** argv)
+                                           char ** argv)
 {
-  try
-    {
-      MESSAGE("Session thread started");
-      SALOME_Session_i * mySALOME_Session
-        = new SALOME_Session_i(argc, argv, _orb, _root_poa, _GUIMutex, _GUILauncher) ;
-      PortableServer::ObjectId_var mySALOME_Sessionid
-        = _root_poa->activate_object(mySALOME_Session);
-      MESSAGE("poa->activate_object(mySALOME_Session)");
-
-      CORBA::Object_var obj = mySALOME_Session->_this();
-      CORBA::String_var sior(_orb->object_to_string(obj));
-      mySALOME_Session->_remove_ref();
-
-      mySALOME_Session->NSregister();
-    }
-  catch (CORBA::SystemException&)
-    {
-      INFOS("Caught CORBA::SystemException.");
-    }
-  catch (CORBA::Exception&)
-    {
-      INFOS("Caught CORBA::Exception.");
-    }
-  catch (...)
-    {
-      INFOS("Caught unknown exception.");
-    }
+  try {
+    MESSAGE("Session thread started");
+    SALOME_Session_i * mySALOME_Session
+      = new SALOME_Session_i(argc, argv, _orb, _root_poa, _GUIMutex, _GUILauncher) ;
+    PortableServer::ObjectId_var mySALOME_Sessionid
+      = _root_poa->activate_object(mySALOME_Session);
+    MESSAGE("poa->activate_object(mySALOME_Session)");
+    
+    CORBA::Object_var obj = mySALOME_Session->_this();
+    CORBA::String_var sior(_orb->object_to_string(obj));
+    mySALOME_Session->_remove_ref();
+    
+    mySALOME_Session->NSregister();
+  }
+  catch (CORBA::SystemException&) {
+    INFOS("Caught CORBA::SystemException.");
+  }
+  catch (CORBA::Exception&) {
+    INFOS("Caught CORBA::Exception.");
+  }
+  catch (...) {
+    INFOS("Caught unknown exception.");
+  }
 }
index 04ded4d2ead238a241f946aae311d6e68869d168..549dd3021bbdf94cf759dc28499ae167160e1991 100755 (executable)
@@ -1,46 +1,43 @@
-//  SALOME Session : implementation of Session_ServerThread.hxx
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME Session : implementation of Session_ServerThread.hxx
 //  File   : Session_ServerThread.hxx
 //  Author : Paul RASCLE, EDF
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef _SESSION_SERVERTHREAD_HXX_
 #define _SESSION_SERVERTHREAD_HXX_
 
-#include <SALOME_Session.hxx>
+#include "SALOME_Session.hxx"
 
 #include <CORBA.h> 
 #include <string>
 
-#include "SALOME_NamingService.hxx"
-#include <qthread.h>
-
 using namespace std;
 
 void WaitForServerReadiness(string serverName);
 
+class SALOME_NamingService;
 
 class SESSION_EXPORT Session_ServerThread
 {
@@ -72,6 +69,8 @@ protected:
   SALOME_NamingService *  _NS;
 };
 
+class QMutex;
+class QWaitCondition;
 
 class SESSION_EXPORT Session_SessionThread : public Session_ServerThread
 {
index 92da744bc6199d5f110926b58b8e4afde38ba8bf..59ea32ac2cdb4f018d30e93b613031125f2676a2 100755 (executable)
@@ -1,6 +1,6 @@
-//  SALOME Session : implementation of Session.idl
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME Session : implementation of Session.idl
 //  File   : SALOME_Session_i.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SALOME
 //  $Header$
-
+//
 #include "utilities.h"
 
 #include "Session_Session_i.hxx"
 
 #include "SALOME_NamingService.hxx"
-#include "SALOME_Event.hxx"
+#include "SALOME_Event.h"
 
 #include "SUIT_Session.h"
-#include "SUIT_Application.h"
 #include "SUIT_Desktop.h"
+#include "SUIT_Study.h"
 
-#include <qapplication.h>
+#include <QMutex>
+#include <QWaitCondition>
 
 // Open CASCADE Includes
 #include <OSD_SharedLibrary.hxx>
-#include <OSD_LoadMode.hxx>
 #include <OSD_Function.hxx>
 
+#ifdef WNT
+# include <process.h>
+#endif
+
+
 using namespace std;
 
 /*!
@@ -157,12 +161,12 @@ void SALOME_Session_i::StopSession()
   Send a SALOME::StatSession structure (see idl) to the client
   (number of running studies and presence of GUI)
 */
-class QtLock
+/*class QtLock
 {
 public:
   QtLock() { if ( qApp ) qApp->lock(); }
   ~QtLock() { if ( qApp ) qApp->unlock(); }
-};
+};*/
 
 
 SALOME::StatSession SALOME_Session_i::GetStatSession()
@@ -172,7 +176,7 @@ SALOME::StatSession SALOME_Session_i::GetStatSession()
 
   _runningStudies = 0;
   {
-    QtLock lock;
+    //QtLock lock;
     _isGUI = SUIT_Session::session();
     if ( _isGUI && SUIT_Session::session()->activeApplication() )
       _runningStudies = SUIT_Session::session()->activeApplication()->getNbStudies();
@@ -201,6 +205,15 @@ CORBA::Long SALOME_Session_i::GetActiveStudyId()
   return aStudyId;
 }
 
+CORBA::Long SALOME_Session_i::getPID() {
+  return (CORBA::Long)
+#ifndef WNT
+    getpid();
+#else
+    _getpid();
+#endif
+}
+
 bool SALOME_Session_i::restoreVisualState(CORBA::Long theSavePoint)
 {
   class TEvent: public SALOME_Event {
index 58f5fdb3126b02665c6e9910147124672fb37964..c691a2ba28ad59d6c9ba922eeb54fde735f9ac9b 100755 (executable)
@@ -1,43 +1,43 @@
-//  SALOME Session : implementation of Session.idl
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME Session : implementation of Session.idl
 //  File   : Session_Session_i.hxx
 //  Author : Paul RASCLE, EDF
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef _SESSION_SESSION_I_HXX_
 #define _SESSION_SESSION_I_HXX_
 
-#include <SALOME_Session.hxx>
-
-#include <qthread.h> 
+#include "SALOME_Session.hxx"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include CORBA_SERVER_HEADER(SALOME_Session)
 class SALOME_NamingService;
 
+class QMutex;
+class QWaitCondition;
+
 class SESSION_EXPORT SALOME_Session_i:  public virtual POA_SALOME::Session,
                         public virtual PortableServer::ServantBase
 {
@@ -68,7 +68,7 @@ public:
   CORBA::Long GetActiveStudyId();
 
   void ping(){};
-  CORBA::Long getPID() { return (CORBA::Long)getpid(); };
+  CORBA::Long getPID();
 
   //! Restors a visual state of the study at theSavePoint
   bool restoreVisualState(CORBA::Long theSavePoint);
index aee0db5beddd22f391c67c3def1f0db00ad21649..18cef3c1907727562e92954ce33faf249279f5c4 100644 (file)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : SalomeApp
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
+EXTRA_DIST += images
+
 # Libraries targets
 lib_LTLIBRARIES = libSalomeStyle.la
 
-libSalomeStyle_la_SOURCES = SalomeStyle.cxx
+salomeinclude_HEADERS =                \
+       Style.h                 \
+       Style_PrefDlg.h         \
+       Style_Salome.h
+
+dist_libSalomeStyle_la_SOURCES =\
+       Style.h                 \
+       Style_Model.h           \
+       Style_PrefDlg.h         \
+       Style_Salome.h          \
+       Style_Tools.h           \
+       Style_ResourceMgr.h     \
+       Style_Model.cxx         \
+       Style_PrefDlg.cxx       \
+       Style_ResourceMgr.cxx   \
+       Style_Salome.cxx        \
+       Style_Tools.cxx
+
+MOC_FILES = \
+       Style_PrefDlg_moc.cxx   \
+       Style_Salome_moc.cxx
 
-libSalomeStyle_la_CPPFLAGS=$(QT_INCLUDES)
+QRC_FILES = \
+       qrc_Style.cxx
 
-libSalomeStyle_la_LDFLAGS=$(QT_MT_LIBS)
+nodist_libSalomeStyle_la_SOURCES = $(MOC_FILES) $(QRC_FILES)
 
-EXTRA_DIST+=SalomeStyle.h
+libSalomeStyle_la_CPPFLAGS = $(QT_INCLUDES)    \
+       -I$(srcdir)/../Qtx
 
-install-exec-hook:
-       mkdir -p $(bindir)/styles
-       (cd $(bindir)/styles; ln -sf ../../../lib@LIB_LOCATION_SUFFIX@/salome/libSalomeStyle.so libSalomeStyle.so;)
+libSalomeStyle_la_LDFLAGS  = $(QT_MT_LIBS)     \
+       ../Qtx/libqtx.la
 
-uninstall-hook:
-       rm -f $(bindir)/styles/libSalomeStyle.so
+dist_salomeres_DATA = resources/SalomeStyle.xml
diff --git a/src/Style/SalomeStyle.cxx b/src/Style/SalomeStyle.cxx
deleted file mode 100644 (file)
index 371e261..0000000
+++ /dev/null
@@ -1,1344 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "SalomeStyle.h"
-
-#include <qimage.h>
-#include <qcursor.h>
-#include <qtabbar.h>
-#include <qpalette.h>
-#include <qtoolbar.h>
-#include <qspinbox.h>
-#include <qpainter.h>
-#include <qlineedit.h>
-#include <qlistview.h>
-#include <qdrawutil.h>
-#include <qpopupmenu.h>
-#include <qpushbutton.h>
-#include <qobjectlist.h>
-#include <qtoolbutton.h>
-#include <qapplication.h>
-
-static const char* const hole_xpm[] = {
-"3 3 3 1",
-". c None",
-"a c #999999",
-"b c #FFFFFF",
-"aa.",
-"aab",
-".bb"
-};
-
-static const char* const cross_xpm[] = {
-"12 12 4 1",
-". c None",
-"a c #000000",
-"b c #FFFFFF",
-"c c #666666",
-"............",
-"............",
-"............",
-".aaaa..aaaa.",
-"..abbaabba..",
-"...abbbba...",
-"....abba....",
-"...abbbba...",
-"..abbaabba..",
-".aaaa..aaaa.",
-"............",
-"............"
-};
-
-static const char* const maximize_xpm[] = {
-"12 12 4 1",
-". c None",
-"a c #000000",
-"b c #FFFFFF",
-"c c #666666",
-"............",
-".aaaaaaaaaa.",
-".acccccccca.",
-".acccccccca.",
-".abbbbbbbba.",
-".abbbbbbbba.",
-".abbbbbbbba.",
-".abbbbbbbba.",
-".abbbbbbbba.",
-".abbbbbbbba.",
-".aaaaaaaaaa.",
-"............"
-};
-
-static const char* const normal_xpm[] = {
-"12 12 4 1",
-". c None",
-"a c #000000",
-"b c #FFFFFF",
-"c c #666666",
-"............",
-"...aaaaaaaa.",
-"...acccccca.",
-"...abbbbbba.",
-"...aaaaaaba.",
-".aaaaaaaaba.",
-".accccccaba.",
-".abbbbbbaaa.",
-".abbbbbba...",
-".abbbbbba...",
-".aaaaaaaa...",
-"............"
-};
-
-static const char* const minimize_xpm[] = {
-"12 12 4 1",
-". c None",
-"a c #000000",
-"b c #FFFFFF",
-"c c #666666",
-"............",
-"............",
-"............",
-"............",
-"............",
-"............",
-"............",
-"............",
-"aaaaaaaaaaaa",
-"abbbbbbbbbba",
-"aaaaaaaaaaaa",
-"............"
-};
-
-/*!
-    Class: SalomeStyle [Public]
-    Descr: Style for SALOME platform
-*/
-
-/*!
-  Constructor
-*/
-SalomeStyle::SalomeStyle()
-: myTitleParent( 0 )
-{
-  qApp->installEventFilter( this ); 
-}
-
-/*!
-  Destructor
-*/
-SalomeStyle::~SalomeStyle()
-{
-}
-
-/*!
-  Delayed initialization of style
-*/
-void SalomeStyle::polish( QWidget* w )
-{
-  if ( !w )
-    return;
-/*
-  if ( w->inherits( "QLineEdit" ) )
-  {
-    QLineEdit* fr = (QLineEdit*)w;
-    if ( w->parentWidget() && w->parentWidget()->inherits( "QSpinWidget" ) )
-      fr->setFrameStyle( QFrame::Plain );
-    else
-    {
-      fr->setFrameStyle( QFrame::Plain | QFrame::Box );
-      fr->setLineWidth( 1 );
-      fr->setMidLineWidth( 0 );
-    }
-  }
-  else
-*/
-  if ( w->inherits( "QToolBar" ) )
-  {
-    QToolBar* tb = (QToolBar*)w;
-    tb->setFrameStyle( QFrame::ToolBarPanel | QFrame::Plain );
-    tb->setLineWidth( 1 );
-    tb->setMidLineWidth( 1 );
-  }
-  else
-  if ( w->inherits( "QDockWindow" ) )
-  {
-    QDockWindow* dw = (QDockWindow*)w;
-    dw->setFrameStyle( QFrame::ToolBarPanel | QFrame::Raised );
-  }
-/*
-  else if ( w->inherits( "QListView" ) )
-  {
-    QListView* lv = (QListView*)w;
-    lv->setFrameStyle( QFrame::Box | QFrame::Plain );
-  }
-*/
-  else
-    PARENT_STYLE::polish( w );
-}
-
-/*!
-  Custom event filter
-*/
-bool SalomeStyle::eventFilter( QObject* o, QEvent* e )
-{
-  if ( e->type() == QEvent::FocusIn || e->type() == QEvent::FocusOut )
-  {
-    QDockWindow* wnd = NULL;
-    while( o && !wnd )
-      if( o->inherits( "QDockWindow" ) )
-        wnd = ( QDockWindow* )o;
-      else
-        o = o->parent();
-
-    if ( wnd )
-    {
-      const QObjectList* objList = o->children();
-      for( QObjectListIterator anIt( *objList ); anIt.current(); ++anIt )
-        if( anIt.current()->inherits( "QDockWindowHandle" ) )
-        {
-          QWidget* ww = ( QWidget* )anIt.current();
-          ww->repaint( ww->rect() );
-          const QObjectList* wc = ww->children();
-          for( QObjectListIterator anIt2( *wc ); anIt2.current(); ++anIt2 )
-            if( anIt2.current()->inherits( "QToolButton" ) )
-            {
-              QWidget* tb = ( QWidget* )anIt2.current();
-              tb->repaint( tb->rect() );
-            }
-        }      
-    }
-  }
-
-  if ( o && o->inherits( "QPushButton" ) && ( e->type() == QEvent::Enter || e->type() == QEvent::Leave ) )
-    ((QWidget*)o)->update();
-
-  return false;
-}
-
-double linear( double x )
-{
-  return x;
-}
-
-/*!
-  Mixes two colors, part of first is 1-t, part of second is t
-  \param t - part parameter
-  \param c1, c2 - colors
-  \param res - result color
-*/
-void SalomeStyle::mix( const double t, const QColor& c1, const QColor& c2, QColor& res )
-{
-  if( t<0.0 || t>1.0 )
-    return;
-
-  int r = int( c1.red() * (1-t) + c2.red() * t ),
-      g = int( c1.green() * (1-t) + c2.green() * t ),
-      b = int( c1.blue() * (1-t) + c2.blue() * t );
-  res.setRgb( r, g, b );
-}
-
-/*!
-  Mixes two colors, part of first is 1-t, part of second is t
-  \param t - part parameter
-  \param rgb1, rgb2 - colors (result is stored in rgb1)
-*/
-void SalomeStyle::mix( const double t, QRgb& rgb1, const QRgb& rgb2 )
-{
-  if( t<0.0 || t>1.0 )
-    return;
-
-  int c[2][4] = { qRed( rgb1 ), qGreen( rgb1 ), qBlue( rgb1 ), qAlpha( rgb1 ),
-                  qRed( rgb2 ), qGreen( rgb2 ), qBlue( rgb2 ), qAlpha( rgb2 ) };
-  for( int i=0; i<4; i++ )
-    c[0][i] = (int)( c[0][i] * (1-t) + c[1][i] * t );
-
-  rgb1 = qRgba( c[0][0], c[0][1], c[0][2], qAlpha( rgb1 ) );
-}
-
-/*!
-  Mixes colors of pixmap points with other color
-  \param t - part parameter
-  \param pix - pixmap to be processed
-  \param col - other color
-*/
-void SalomeStyle::mix( const double t, QPixmap& pix, const QColor& col )
-{
-  if( t<0.0 || t>1.0 )
-    return;
-
-  QImage anImage = pix.convertToImage();
-  if( anImage.isNull() )
-    return;
-
-  if( anImage.depth()!=32 )
-    anImage = anImage.convertDepth( 32 );
-
-  int w = anImage.width(),
-      h = anImage.height();
-
-  QRgb colrgb = col.rgb(), cur;
-  for( int y=0; y<h; y++ )
-  {
-    uchar* line = anImage.scanLine( y );
-    QRgb*  colorline = ( QRgb* ) line;
-    for( int x=0; x<w; x++ )
-    {
-      cur = colorline[ x ];
-      mix( t, cur, colrgb );
-      colorline[ x ] = cur;
-    }
-  }
-  pix = anImage;
-}
-
-/*!
-  Converts pixmap to grayscale
-  \param pix - pixmap to be processed
-  \param k - factor (gray value after conversion will be multiplied on it and truncated by 255.0)
-*/
-void SalomeStyle::toGrayscale( QPixmap& pix, double k )
-{
-  QImage anImage = pix.convertToImage();
-  if( anImage.isNull() )
-    return;
-
-  if( anImage.depth()!=32 )
-    anImage = anImage.convertDepth( 32 );
-
-  int w = anImage.width(),
-      h = anImage.height();
-
-  for( int y=0; y<h; y++ )
-  {
-    uchar* line = anImage.scanLine( y );
-    QRgb*  colorline = ( QRgb* ) line;
-    for( int x=0; x<w; x++ )
-    {
-      int gray = (int)( k * qGray( colorline[ x ] ) );
-      if ( gray>255 )
-        gray = 255;
-      else if( gray<0 )
-        gray = 0;
-      colorline[ x ] = qRgba( gray, gray, gray, qAlpha( colorline[x] ) );
-    }
-  }
-  pix = anImage;
-}
-
-/*!
-  Draws gradient filling
-  \param p - painter
-  \param r - rect
-  \param c1, c2 - two colors of gradient
-  \param d - direction of gradient
-  \param f - gradient function (maps co-ordinate to part parameter)
-*/
-void SalomeStyle::drawGradient( QPainter* p, const QRect& r,
-                                    const QColor& c1, const QColor& c2,
-                                    const Direction d, gradient_func f ) const 
-{
-  p->save();
-  p->translate( r.x(), r.y() );
-
-  QColor mid;
-  if( d==LeftToRight || d==RightToLeft )
-    for( int xmax = r.width(), x = d==LeftToRight ? 0 : xmax;
-         d==LeftToRight ? x<=xmax : x>=0;
-         d==LeftToRight ? x++ : x-- )
-    {
-      double t = double( x ) / double( xmax );
-      mix( d==LeftToRight ? f(t) : 1-f(t), c1, c2, mid );
-      p->setPen( mid );
-      p->drawLine( x, 0, x, r.height() );
-    }
-  else
-    for( int ymax = r.height(), y = d==UpToDown ? 0 : ymax;
-         d==UpToDown ? y<=ymax : y>=0;
-         d==UpToDown ? y++ : y-- )
-    {
-      double t = double( y ) / double( ymax );
-      mix( d==UpToDown ? f(t) : 1-f(t), c1, c2, mid );
-      p->setPen( mid );
-      p->drawLine( 0, y, r.width(), y );
-    }
-
-  p->restore();
-}
-
-/*!
-  Draws primitive element
-  \param pe - type of primitive element
-  \param p - painter
-  \param r - rect
-  \param cg - group of colors
-  \param flags - is used to control how the PrimitiveElement is drawn
-  \param opt - can be used to control how various PrimitiveElements are drawn
-*/
-void SalomeStyle::drawPrimitive( PrimitiveElement pe, QPainter* p, const QRect& r,
-                                const QColorGroup& cg, SFlags flags, const QStyleOption& opt ) const
-{
-  switch ( pe )
-  {
-  case PE_ButtonTool:
-    if ( !myTitleParent )
-      PARENT_STYLE::drawPrimitive( pe, p, r, cg, flags, opt );
-    break;
-
-  case PE_DockWindowResizeHandle:
-    p->fillRect( r.x(), r.y(), r.width(), r.height(), cg.dark() );
-    if ( flags & Style_Horizontal )
-      p->fillRect( r.x(), r.y() + 1, r.width(), r.height() - 2, cg.midlight() );
-    else
-      p->fillRect( r.x() + 1, r.y(), r.width() - 2, r.height(), cg.midlight() );
-    break;
-
-  case PE_DockWindowHandle:
-    {
-      QPaintDevice* pd = p->device();
-      if ( !pd )
-        break;
-
-      QWidget* w = (QWidget*)pd;
-
-      if ( !w || !w->inherits( "QDockWindowHandle" ) )
-        break;
-
-      QDockWindow* wnd = ( QDockWindow* ) w->parent();
-      if ( !wnd )
-        return;
-
-      QObject* activeWidget = qApp->focusWidget();
-      QDockWindow* activeWnd = 0;
-      while ( !activeWnd && activeWidget )
-      {
-        if ( activeWidget->inherits( "QDockWindow" ) )
-          activeWnd = (QDockWindow*)activeWidget;
-        else
-          activeWidget = activeWidget->parent();
-      }
-
-      bool act = wnd == activeWnd, horiz = flags & Style_Horizontal;
-
-      QPixmap hole( (const char**)hole_xpm );
-
-      if ( wnd->inherits( "QToolBar" ) )
-      {
-        drawGradient( p, r, cg.light(), cg.background(), horiz ? UpToDown : LeftToRight, linear );
-
-        int c = 4, i; double d = ( horiz ? r.height() : r.width() ) / ( c + 1 );
-        QBrush fill = cg.brush( QColorGroup::Dark );
-        p->setPen( Qt::red );
-        for ( i = 0; i < c; i++ )
-        {
-          if ( horiz )
-            p->drawPixmap( r.x() + r.width() / 2 - 1, (int)( r.y() + ( i + 1 ) * d - 1 ), hole );
-          else
-            p->drawPixmap( (int) ( r.x() + ( i + 1 ) * d - 1 ), r.y() + r.height() / 2 - 1, hole );
-        }
-
-        int dd = (int(d)/2) + (int(d)%2);
-        for ( i = 0; i < c - 1; i++ )
-        {
-          if ( horiz )
-            p->drawPixmap( r.x() + r.width() / 2 + 2, (int)( r.y() + dd + ( i + 1 ) * d - 1 ), hole );
-          else
-            p->drawPixmap( (int)( r.x() + dd + ( i + 1 ) * d - 1 ), r.y() + r.height() / 2 + 2, hole );
-        }
-      }
-      else
-      {
-        int d = 1;
-        QRect rr( r.x()+d, r.y()+d, r.width()-2*d, r.height()-2*d );
-
-        QColor col; 
-        if ( act )
-          mix( 0.5, cg.highlight(), Qt::white, col );
-        else
-          col = cg.background();
-
-        drawGradient( p, rr, act ? cg.highlight() : cg.dark(), col,
-                      horiz ? LeftToRight : UpToDown, linear );
-
-                   QRect rt = rr;
-        if ( flags & Style_Horizontal )
-          rt.addCoords( 0, 20, 0, 0 );
-        else
-          rt.addCoords( 0, 0, -20, 0 );
-
-        int textW = flags & Style_Horizontal ? rt.height() : rt.width();
-        int textH = flags & Style_Horizontal ? rt.width() : rt.height();
-
-       QFont old_font = p->font(), f = old_font;
-       
-        QString title = titleText( wnd->caption(), textW, textH, f );
-       p->setFont( f );
-       if ( wnd )
-        {
-         QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive();
-         p->setPen( cgroup.highlightedText() );
-
-         if ( flags & Style_Horizontal )
-          {
-           p->rotate( 270.0 );
-           p->translate( -(rt.height()+rt.y()), (rt.width()-rt.x()) );
-           p->drawText( 0, 0, title );
-         }
-          else
-           p->drawText( 2, 2, textW, textH, AlignLeft, title );
-       }
-       p->setFont( old_font );
-      }
-      break;
-    }
-
-  case PE_DockWindowSeparator:
-    {
-      bool horiz = ( flags & Style_Horizontal );
-      QWidget* w = ( QWidget* )p->device();
-      if( w->inherits( "QToolBarSeparator" ) )
-      {
-        drawGradient( p, r, cg.light(), cg.background(), horiz ? UpToDown : LeftToRight, linear );
-        int w = r.width(), h = r.height();
-        int part = 8;
-
-        p->setPen( cg.dark() );
-        if( horiz )
-          p->drawLine( r.x() + w/2, r.y() + h/part, r.x() + w/2, r.y() + (part-1)*h/part );
-        else
-          p->drawLine( r.x() + w/part, r.y() + h/2, r.x() + (part-1)*w/part, r.y() + h/2 );
-
-        p->setPen( cg.light() );
-        if( horiz )
-          p->drawLine( r.x() + w/2 + 1, r.y() + h/part + 1, r.x() + w/2 + 1, r.y() + (part-1)*h/part + 1 );
-        else
-          p->drawLine( r.x() + w/part + 1, r.y() + h/2 + 1, r.x() + (part-1)*w/part + 1, r.y() + h/2 + 1 );
-      }
-      else
-        PARENT_STYLE::drawPrimitive( pe, p, r, cg, flags, opt );
-      break;
-    }
-    
-  case PE_PanelDockWindow:
-    {
-      QWidget* w = ( QWidget* )p->device();
-
-      int offset = pixelMetric( PM_DockWindowHandleExtent, w );
-      if ( w->inherits( "QToolBar" ) )
-      {
-        bool vert = ( ( QToolBar* )w )->orientation() == Qt::Vertical;
-        if ( vert )
-          drawGradient( p, QRect( r.x(), r.y()+offset, r.x()+r.width(), r.y()+offset ),
-                        cg.light(), cg.background(), LeftToRight, linear );
-        else
-          drawGradient( p, QRect( r.x()+offset, r.y(), r.x()+offset, r.y()+r.height() ),
-                        cg.light(), cg.background(), UpToDown, linear );
-
-        p->setPen( QPen( cg.light(), 1 ) );
-        p->drawRect( r );
-      }
-      else
-      {
-        p->setPen( QPen( cg.dark(), 1 ) );
-        p->setBrush( cg.light() );
-        p->drawRect( r );
-      }
-
-      break;
-    }
-
-  case PE_PanelPopup:
-    p->setPen( QPen( cg.dark(), 1 ) );
-    p->setBrush( cg.light() );
-    p->drawRect( r );
-    break;
-
-  case PE_HeaderSection:
-    {
-      QColor col; mix( 0.2, cg.light(), Qt::black, col );
-      drawGradient( p, r, cg.light(), col, DownToUp, linear );
-      drawGradient( p, QRect( r.x(), r.y(), 1, r.height() ), cg.light(), cg.dark(), DownToUp, linear );
-      p->setPen( cg.dark() );
-      p->drawLine( r.x(), r.y()+r.height()-1, r.x()+r.width(), r.y()+r.height()-1 );
-      break;
-    }
-
-  case PE_Splitter:
-    p->fillRect( r.x() + 1, r.y() + 1, r.width() - 2, r.height() - 2, cg.dark() );
-    p->fillRect( r.x() + 2, r.y() + 2, r.width() - 4, r.height() - 4, cg.midlight() );
-         break;
-
-  case PE_ButtonBevel:
-    PARENT_STYLE::drawPrimitive( PE_ButtonDropDown, p, r, cg, flags, opt );
-    break;
-
-  case PE_ButtonCommand:
-    {
-      QColorGroup cGrp( cg );
-      if ( flags & Style_MouseOver )
-        cGrp.setColor( QColorGroup::Button, cGrp.midlight() );
-
-      if ( flags & Style_MouseOver )
-        PARENT_STYLE::drawPrimitive( PE_ButtonDropDown, p, r, cGrp, flags, opt );
-      else
-        PARENT_STYLE::drawPrimitive( flags & Style_Raised ? PE_ButtonDropDown : pe, p, r, cGrp, flags, opt );
-    }
-    break;
-
-  default:
-    PARENT_STYLE::drawPrimitive( pe, p, r, cg, flags, opt );
-    break;
-  }
-}
-
-/*!
-  Draws control element
-  \param element - type of control element
-  \param p - painter
-  \param widget - widget
-  \param r - rect
-  \param cg - group of colors
-  \param flags - is used to control how the element is drawn
-  \param opt - can be used to control how various elements are drawn
-*/
-void SalomeStyle::drawControl( ControlElement element, QPainter* p, const QWidget* widget, const QRect& r,
-                               const QColorGroup& cg, SFlags flags, const QStyleOption& opt ) const 
-{
-  switch( element )
-  {
-    case CE_PopupMenuItem:
-    {
-         if(! widget || opt.isDefault())
-           break;
-
-      const QPopupMenu *popupmenu = (const QPopupMenu *) widget;
-      QMenuItem *mi = opt.menuItem();
-      if( !mi )
-           break;
-
-         int tab = opt.tabWidth();
-         int maxpmw = opt.maxIconWidth();
-         bool dis = !( flags & Style_Enabled );
-         bool checkable = popupmenu->isCheckable();
-         bool act = flags & Style_Active;
-      bool use2000style = true;
-         int x, y, w, h;
-
-      int windowsItemFrame = 2,
-          windowsItemHMargin = 5,
-          windowsItemVMargin = 1,
-          windowsRightBorder = 2,
-          windowsArrowHMargin = 2;
-
-         r.rect(&x, &y, &w, &h);
-
-         if ( checkable )
-      {
-           // space for the checkmarks
-        if (use2000style)
-                 maxpmw = QMAX( maxpmw, 20 );
-               else
-                 maxpmw = QMAX( maxpmw, 12 );
-         }
-
-         int checkcol = maxpmw;
-
-         if ( mi && mi->isSeparator() )
-      {
-               p->setPen( cg.dark() );
-               p->drawLine( x+3*checkcol/2, y, x+w, y );
-               //p->setPen( cg.light() );
-               //p->drawLine( x, y+1, x+w, y+1 );
-               return;
-         }
-
-      QBrush fill = ( act && !dis ?
-                cg.brush( QColorGroup::Highlight ) :
-                        cg.brush( QColorGroup::Light ) );
-         p->fillRect( x, y, w, h, fill );
-
-         if( !mi )
-               return;
-
-         int xpos = x;
-         QRect vrect = visualRect( QRect( xpos, y, checkcol, h ), r );
-         int xvis = vrect.x();
-
-         if( mi->isChecked() )
-      {
-           if( act && !dis )
-                 qDrawShadePanel( p, xvis, y, checkcol, h,
-                           cg, TRUE, 1, &cg.brush( QColorGroup::Button ) );
-               else
-        {
-                 QBrush fill( cg.light(), Dense4Pattern );
-                 // set the brush origin for the hash pattern to the x/y coordinate
-                 // of the menu item's checkmark... this way, the check marks have
-                 // a consistent look
-                 QPoint origin = p->brushOrigin();
-                 p->setBrushOrigin( xvis, y );
-                 qDrawShadePanel( p, xvis, y, checkcol, h, cg, TRUE, 1, &fill );
-          // restore the previous brush origin
-                 p->setBrushOrigin( origin );
-               }
-         }
-      else if( !act )
-               p->fillRect(x+checkcol, y, w-checkcol , h, cg.brush( QColorGroup::Light ));
-
-      if( !( act && !dis ) && !mi->isChecked() )
-      {
-        QColor col; mix( 0.5, cg.mid(), Qt::white, col );
-        drawGradient( p, QRect( xvis, y, checkcol, h+1 ), cg.light(), col, LeftToRight, linear );
-      }
-
-      if( mi->iconSet() )
-      { // draw iconset
-               QIconSet::Mode mode = dis ? QIconSet::Active : QIconSet::Normal;
-               if(act && !dis )
-                 mode = QIconSet::Active;
-               QPixmap pixmap;
-               if( checkable && mi->isChecked() )
-                 pixmap = mi->iconSet()->pixmap( QIconSet::Small, mode, QIconSet::On );
-               else
-                 pixmap = mi->iconSet()->pixmap( QIconSet::Small, mode );
-               int pixw = pixmap.width();
-               int pixh = pixmap.height();
-
-        if( dis )
-          toGrayscale( pixmap, 1.1 );
-
-               //if( act && !dis && !mi->isChecked() )
-               //  qDrawShadePanel( p, xvis, y, checkcol, h, cg, FALSE, 1, &cg.brush( QColorGroup::Button ) );
-
-               QRect pmr( 0, 0, pixw, pixh );
-               pmr.moveCenter( vrect.center() );
-               p->setPen( cg.text() );
-               p->drawPixmap( pmr.topLeft(), pixmap );
-
-               QBrush fill = ( act ? cg.brush( QColorGroup::Highlight ) : cg.brush( QColorGroup::Light ));
-               int xp = xpos + checkcol + 1;
-        if( !dis )
-                 p->fillRect( visualRect( QRect( xp, y, w - checkcol - 1, h ), r ), fill);
-         }
-      else if( checkable )
-      {  // just "checking"...
-               if( mi->isChecked() )
-        {
-                 int xp = xpos + windowsItemFrame;
-
-                 SFlags cflags = Style_Default;
-                 if( !dis )
-                   cflags |= Style_Enabled;
-                 if( act )
-                       cflags |= Style_On;
-
-                 drawPrimitive( PE_CheckMark, p,
-                                        visualRect( QRect( xp, y + windowsItemFrame,
-                                            checkcol - 2*windowsItemFrame,
-                                            h - 2*windowsItemFrame), r ), cg, cflags, opt );
-               }
-         }
-
-         p->setPen( act ? cg.highlightedText() : cg.buttonText() );
-
-         QColor discol;
-         if( dis )
-      {
-               discol = cg.text();
-               p->setPen( discol );
-         }
-
-         int xm = windowsItemFrame + checkcol + windowsItemHMargin;
-         xpos += xm;
-
-         vrect = visualRect( QRect( xpos, y+windowsItemVMargin, w-xm-tab+1, h-2*windowsItemVMargin ), r );
-         xvis = vrect.x();
-         if( mi->custom() )
-      {
-               p->save();
-               if ( dis && !act )
-        {
-                 p->setPen( cg.light() );
-                 mi->custom()->paint( p, cg, act, !dis,
-                                                  xvis+1, y+windowsItemVMargin+1,
-                               w-xm-tab+1, h-2*windowsItemVMargin );
-                 p->setPen( discol );
-               }
-               mi->custom()->paint( p, cg, act, !dis, xvis, y+windowsItemVMargin,
-                             w-xm-tab+1, h-2*windowsItemVMargin );
-               p->restore();
-         }
-         QString s = mi->text();
-         if( !s.isNull() )
-      { // draw text
-               int t = s.find( '\t' );
-               int text_flags = AlignVCenter | ShowPrefix | DontClip | SingleLine;
-               if( !styleHint( SH_UnderlineAccelerator, widget ) )
-                 text_flags |= NoAccel;
-               text_flags |= (QApplication::reverseLayout() ? AlignRight : AlignLeft );
-               if( t >= 0 )
-        { // draw tab text
-                 int xp = x + w - tab - windowsItemHMargin - windowsItemFrame + 1;
-                 if( use2000style )
-                   xp -= 20;
-                 else
-                       xp -= windowsRightBorder;
-                 int xoff = visualRect( QRect( xp, y+windowsItemVMargin, tab, h-2*windowsItemVMargin ), r ).x();
-                 if( dis && !act )
-          {
-                       p->setPen( cg.light() );
-                       p->drawText( xoff+1, y+windowsItemVMargin+1, tab, h-2*windowsItemVMargin, text_flags, s.mid( t+1 ));
-                       p->setPen( discol );
-                 }
-                 p->drawText( xoff, y+windowsItemVMargin, tab, h-2*windowsItemVMargin, text_flags, s.mid( t+1 ) );
-                 s = s.left( t );
-               }
-               if( dis && !act )
-        {
-                 p->setPen( cg.light() );
-                 p->drawText( xvis+1, y+windowsItemVMargin+1, w-xm-tab+1, h-2*windowsItemVMargin, text_flags, s, t );
-                 p->setPen( discol );
-               }
-               p->drawText( xvis, y+windowsItemVMargin, w-xm-tab+1, h-2*windowsItemVMargin, text_flags, s, t );
-         }
-      else if( mi->pixmap() )
-      { // draw pixmap
-               QPixmap *pixmap = mi->pixmap();
-               if( pixmap->depth() == 1 )
-                 p->setBackgroundMode( OpaqueMode );
-               p->drawPixmap( xvis, y+windowsItemFrame, *pixmap );
-               if( pixmap->depth() == 1 )
-                 p->setBackgroundMode( TransparentMode );
-         }
-         if( mi->popup() )
-      { // draw sub menu arrow
-               int dim = (h-2*windowsItemFrame) / 2;
-               PrimitiveElement arrow;
-               arrow = ( QApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight );
-               xpos = x+w - windowsArrowHMargin - windowsItemFrame - dim;
-               vrect = visualRect( QRect(xpos, y + h / 2 - dim / 2, dim, dim), r );
-               if( act )
-        {
-                 QColorGroup g2 = cg;
-                 g2.setColor( QColorGroup::ButtonText, g2.highlightedText() );
-                 drawPrimitive( arrow, p, vrect, g2, dis ? Style_Default : Style_Enabled, opt );
-               }
-        else
-        {
-                 drawPrimitive( arrow, p, vrect, cg, dis ? Style_Default : Style_Enabled, opt );
-               }
-         }
-
-      if( act && !dis )
-      {
-        p->setPen( cg.dark() );
-        p->drawRect( r );
-      }
-         break;
-    }
-
-    case CE_MenuBarItem:
-       {
-      bool active = flags & Style_Active;
-         bool down = flags & Style_Down;
-         QRect pr = r;
-
-      p->save();
-      if( active && down )
-      {
-        //QColor col; mix( 0.5, cg.mid(), Qt::white, col );
-        //drawGradient( p, r, col, cg.light(), UpToDown, linear );
-        p->setPen( cg.light() );
-        p->setBrush( cg.light() );
-        p->drawRect( r );
-        
-        p->setPen( cg.dark() );
-        int w = r.width()-1, h = r.height();
-        p->drawLine( r.x(), r.y(), r.x()+w, r.y() );
-        p->drawLine( r.x(), r.y(), r.x(), r.y()+h );
-        p->drawLine( r.x()+w, r.y(), r.x()+w, r.y()+h );
-
-        p->translate( 1, 1 );
-      }
-      else
-        drawGradient( p, r, cg.light(), cg.background(), active ? DownToUp : UpToDown, linear );
-
-         QCommonStyle::drawControl(element, p, widget, pr, cg, flags, opt);
-      p->restore();
-         break;
-       }
-
-    case CE_MenuBarEmptyArea:
-    {
-      drawGradient( p, r, cg.light(), cg.background(), UpToDown, linear );
-         break;
-    }
-
-    case CE_ToolButtonLabel:
-       {
-      const QToolButton *toolbutton = (const QToolButton *) widget;
-      QObject* parent = toolbutton->parent();
-
-      QToolBar* tb = NULL;
-      while( parent )
-        if( parent->inherits( "QToolBar" ) )
-        {
-          tb = ( QToolBar* )parent;
-          break;
-        }
-        else
-          parent = parent->parent();
-      parent = toolbutton->parent();
-
-      int horiz = -1;
-      if( tb )
-      {
-        if( tb->orientation()==Qt::Horizontal )
-          horiz = 1;
-        else
-          horiz = 0;
-        drawGradient( p, r, cg.light(), cg.background(), horiz ? UpToDown : LeftToRight, linear );
-      }
-      else if( parent->inherits( "QDockWindowHandle" ) )
-      {
-        QWidget* w = ( QWidget* ) parent;
-        QDockWindow* wnd = ( QDockWindow* )w->parent();
-        if( !wnd->orientation()==Qt::Horizontal )
-          horiz=1;
-        else
-          horiz=0;
-
-        QPoint pp( r.x(), r.y() ),
-               qq = toolbutton->mapToParent( pp );
-        
-        bitBlt( p->device(), r.x(), r.y(), w, horiz ? qq.x()-r.width() : qq.x(),
-                horiz ? qq.y() : qq.y()+r.height(),
-                r.width(), r.height(), Qt::CopyROP, true );
-      }
-
-      bool highlight = ( flags & Style_MouseOver ),
-           down = ( flags & ( Style_Down | Style_On ) ),
-           en = toolbutton->isEnabled();
-
-      if( down )
-        if( horiz>=0 )
-        {
-          drawGradient( p, r, cg.light(), cg.background(), horiz==1 ? DownToUp : RightToLeft, linear );
-          p->setPen( cg.background() );
-          p->drawRect( r );
-        }
-        else
-        {
-          p->setPen( cg.dark() );
-          p->setBrush( cg.light() );
-          p->drawRect( r );
-        }
-      if( highlight )
-      {
-        p->setPen( cg.dark() );
-        QColor col; mix( 0.05, cg.background(), Qt::black, col );
-        p->setBrush( col );
-        p->drawRect( r );
-      }
-
-
-         QRect rect = r;
-         Qt::ArrowType arrowType = opt.isDefault() ? Qt::DownArrow : opt.arrowType();
-
-         int shiftX = 0, shiftY = 0;
-         if( flags & ( Style_Down | Style_On ) )
-      {
-               shiftX = pixelMetric(PM_ButtonShiftHorizontal, widget);
-               shiftY = pixelMetric(PM_ButtonShiftVertical, widget);
-         }
-
-         if (!opt.isDefault())
-      {
-               PrimitiveElement pe;
-               switch (arrowType)
-        {
-                 case Qt::LeftArrow:  pe = PE_ArrowLeft;  break;
-                 case Qt::RightArrow: pe = PE_ArrowRight; break;
-                 case Qt::UpArrow:    pe = PE_ArrowUp;    break;
-                 default:
-                 case Qt::DownArrow:  pe = PE_ArrowDown;  break;
-        }
-
-        rect.moveBy(shiftX, shiftY);
-           drawPrimitive(pe, p, rect, cg, flags, opt);
-         }
-      else
-      {
-               QColor btext = toolbutton->paletteForegroundColor();
-
-               if (toolbutton->iconSet().isNull() &&
-                   ! toolbutton->text().isNull() &&
-                   ! toolbutton->usesTextLabel())
-        {
-                   int alignment = AlignCenter | ShowPrefix;
-                   if (!styleHint(SH_UnderlineAccelerator, widget, QStyleOption::Default, 0))
-                         alignment |= NoAccel;
-
-                   rect.moveBy(shiftX, shiftY);
-                   drawItem( p, rect, alignment, cg, flags & Style_Enabled, 0, toolbutton->text(),
-                                 toolbutton->text().length(), &btext);
-        }
-        else
-        {
-             QPixmap pm;
-                 QIconSet::Size size =
-                 toolbutton->usesBigPixmap() ? QIconSet::Large : QIconSet::Small;
-                 QIconSet::State state = toolbutton->isOn() ? QIconSet::On : QIconSet::Off;
-                 QIconSet::Mode mode;
-                 if( !toolbutton->isEnabled() )
-               mode = QIconSet::Active; //QIconSet::Disabled;
-                 else if( flags & (Style_Down | Style_On ) || ( flags & Style_Raised ) && (flags & Style_AutoRaise))
-                   mode = QIconSet::Active;
-                 else
-                   mode = QIconSet::Normal;
-                 pm = toolbutton->iconSet().pixmap( size, mode, state );
-
-                 if( toolbutton->usesTextLabel() )
-          {
-                   p->setFont( toolbutton->font() );
-                   QRect pr = rect, tr = rect;
-                   int alignment = ShowPrefix;
-                   if (!styleHint(SH_UnderlineAccelerator, widget, QStyleOption::Default, 0))
-                         alignment |= NoAccel;
-
-                   if( toolbutton->textPosition() == QToolButton::Under )
-            {
-                         int fh = p->fontMetrics().height();
-                         pr.addCoords( 0, 1, 0, -fh-3 );
-                         tr.addCoords( 0, pr.bottom(), 0, -3 );
-                         pr.moveBy(shiftX, shiftY);
-                         drawItem( p, pr, AlignCenter, cg, TRUE, &pm, QString::null );
-                         alignment |= AlignCenter;
-            }
-            else
-            {
-                         pr.setWidth( pm.width() + 8 );
-                         tr.addCoords( pr.right(), 0, 0, 0 );
-                         pr.moveBy(shiftX, shiftY);
-                         drawItem( p, pr, AlignCenter, cg, TRUE, &pm, QString::null );
-                         alignment |= AlignLeft | AlignVCenter;
-            }
-
-               tr.moveBy(shiftX, shiftY);
-                   drawItem( p, tr, alignment, cg, flags & Style_Enabled, 0, toolbutton->textLabel(),
-                                     toolbutton->textLabel().length(), &btext);
-          }
-          else
-          {
-            /*if( en && !highlight )
-              mix( 0.6, pm, cg.background() );
-            else*/ if( !en )
-            {
-              toGrayscale( pm, 1.1 );
-              mix( 0.8, pm, cg.background() );
-            }
-
-                   rect.moveBy(shiftX, shiftY);
-                   drawItem( p, rect, AlignCenter, cg, true, &pm, QString::null );
-          }
-        }
-      }
-    }
-    break;
-
-    case CE_TabBarTab:
-         {
-      QPen oldPen = p->pen();
-
-           QRect r2( r );
-           bool selected = flags & Style_Selected;
-
-      p->setPen( cg.midlight() );
-      p->drawLine( r2.left(), r2.bottom(), r2.right(), r2.bottom() );
-
-      if ( !selected )
-        r2.setRect( r2.left(), r2.top() + 1, r2.width(), r2.height() - 1 );
-      else
-        r2.setRect( r2.left(), r2.top(), r2.width() - 2, r2.height() - 1 );
-
-      p->setPen( cg.foreground() );
-      drawGradient( p, QRect( r2.left(), r2.top(), r2.width(), r2.height() - 1 ),
-                    selected ? cg.highlight() : cg.dark(), cg.background(), UpToDown, linear );
-
-//      p->fillRect( r2.left(), r2.top(), r2.width(), r2.height() - 1, selected ? cg.highlight() : cg.background() );
-      p->drawRect( r2.left(), r2.top(), r2.width(), r2.height() - 1 );
-
-      if ( selected )
-      {
-        p->setPen( cg.shadow() );
-        p->drawLine( r2.left() + 1, r2.bottom(), r2.right() + 1, r2.bottom() );
-        p->drawLine( r2.right() + 1, r2.top() + 1, r2.right() + 1, r2.bottom() );
-      }
-
-           break;
-    }
-
-    case CE_TabBarLabel:
-      {
-        QColorGroup tmp( cg );
-        if ( flags & Style_Selected )
-          tmp.setColor( QColorGroup::Foreground, tmp.highlightedText() );
-        PARENT_STYLE::drawControl( element, p, widget, r, tmp, flags, opt );
-      }
-      break;
-
-    case CE_PushButton:
-         {
-      if ( flags & Style_Enabled && !( flags & Style_Down || flags & Style_On ) )
-      {
-             const QPushButton* button = (const QPushButton*)widget;
-        QRect br = QRect( button->mapToGlobal( button->rect().topLeft() ), button->rect().size() );
-        if ( br.contains( QCursor::pos() )  )
-          flags |= Style_MouseOver;
-      }
-
-      PARENT_STYLE::drawControl( element, p, widget, r, cg, flags, opt );
-           break;
-         }
-
-    default:
-      PARENT_STYLE::drawControl( element, p, widget, r, cg, flags, opt );
-      break;
-  }
-}
-
-/*!
-  \return the sub-area for the widget in logical coordinates
-  \param subrect - type of sub area
-  \param w - widget
-*/
-QRect SalomeStyle::subRect( SubRect subrect, const QWidget* w ) const
-{
-  QRect r = PARENT_STYLE::subRect( subrect, w );
-  if ( subrect==SR_DockWindowHandleRect && w->inherits( "QDockWindowHandle" ) )
-  {
-    QDockWindow* wnd = ( QDockWindow* ) w->parent();
-    if( wnd->orientation()==Qt::Vertical )
-      r.setWidth( w->width() );
-    else
-    {
-      r.setY( r.y()+r.height()-w->height() );
-      r.setHeight( w->height() );
-    }
-  }
-
-  return r;
-}
-
-/*!
-  Draws the ComplexControl
-  \param control - type of complex control element
-  \param p - painter
-  \param widget - widget
-  \param r - rect
-  \param cg - group of colors
-  \param flags, controls, active - is used to control how the element is drawn
-  \param opt - can be used to control how various elements are drawn
-*/
-void SalomeStyle::drawComplexControl( ComplexControl control, QPainter* p, const QWidget* widget,
-                                                             const QRect& r, const QColorGroup& cg, SFlags flags,
-                                                             SCFlags controls, SCFlags active, const QStyleOption& opt ) const
-{
-
-
-
-
-  ((SalomeStyle*)this)->myTitleParent = 0;
-
-  switch ( control )
-  {
-  case CC_ComboBox:
-         if ( controls & SC_ComboBoxArrow )
-    {
-           SFlags flags = Style_Default;
-
-      qDrawShadeRect( p, r, cg, true, pixelMetric( PM_DefaultFrameWidth, widget ),
-                      0, widget->isEnabled() ? &cg.brush( QColorGroup::Base ) : &cg.brush( QColorGroup::Background ) );
-
-           QRect ar = QStyle::visualRect( querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxArrow ), widget );
-           if ( active == SC_ComboBoxArrow )
-      {
-                   p->setPen( cg.dark() );
-                   p->setBrush( cg.brush( QColorGroup::Button ) );
-                   p->drawRect( ar );
-           }
-      else
-                   qDrawWinPanel( p, ar, cg, FALSE, &cg.brush( QColorGroup::Button ) );
-
-           ar.addCoords( 2, 2, -2, -2 );
-           if ( widget->isEnabled() )
-                   flags |= Style_Enabled;
-
-           if ( active == SC_ComboBoxArrow )
-                   flags |= Style_Sunken;
-           drawPrimitive( PE_ArrowDown, p, ar, cg, flags );
-         }
-    PARENT_STYLE::drawComplexControl( control, p, widget, r, cg, flags, controls & ~SC_ComboBoxArrow, active, opt );
-    break;
-
-  case CC_TitleBar:
-    if( widget->inherits( "QTitleBar" ) )
-      ( ( SalomeStyle* )this )->myTitleParent = ( QWidget* )widget->parent();
-
-  default:
-    PARENT_STYLE::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt );
-    break;
-  }
-}
-
-/*!
-  \return pixmap by type
-  \param st - type of pixmap
-  \param w - widget
-  \param opt - style option flags
-*/
-QPixmap SalomeStyle::stylePixmap( StylePixmap st, const QWidget* w, const QStyleOption& opt ) const
-{
-  switch ( st )
-  {
-  case SP_DockWindowCloseButton:
-  case SP_TitleBarCloseButton:
-    return QPixmap( cross_xpm );
-  case SP_TitleBarMaxButton:
-    return QPixmap( maximize_xpm );
-  case SP_TitleBarNormalButton:
-    return QPixmap( normal_xpm );
-  case SP_TitleBarMinButton:
-    return QPixmap( minimize_xpm );
-  default:
-    return PARENT_STYLE::stylePixmap( st, w, opt );
-  }
-}
-
-/*!
-  \return the pixel size
-  \param pm - type of pixel metrics
-  \param widget - widget
-*/
-int SalomeStyle::pixelMetric( PixelMetric pm, const QWidget* widget ) const
-{
-  int ret = 0;
-
-  switch ( pm )
-  {
-  case PM_ButtonMargin:
-    ret = 5;
-    break;
-  case PM_DockWindowFrameWidth:
-    ret = 0;
-    break;
-  case PM_TabBarTabOverlap:
-         ret = 2;
-         break;
-  case PM_TabBarTabHSpace:
-         ret = 20;
-         break;
-  case PM_TabBarTabShiftHorizontal:
-  case PM_TabBarTabShiftVertical:
-         ret = 0;
-         break;
-  case PM_TabBarTabVSpace:
-               ret = 5;
-    break;
-  case PM_DefaultFrameWidth:
-    ret = 1;
-    break;
-  case PM_SpinBoxFrameWidth:
-    ret = 1;
-    break;
-  case PM_ProgressBarChunkWidth:
-    ret = 1;
-    break;
-  default:
-    ret = PARENT_STYLE::pixelMetric( pm, widget );
-    break;
-  }
-  return ret;
-}
-
-/*!
-  \return corrected title text
-  \param txt - title text
-  \param w - possible width
-  \param fm - font metrics
-*/
-QString SalomeStyle::titleText( const QString& txt, const int W, const int H, QFont& f ) const
-{
-  QString res = txt.stripWhiteSpace();
-
-  QFontMetrics fm( f );
-  while( fm.height() > H && f.pointSize()>1 )
-  {
-    f.setPointSize( f.pointSize()-1 );
-    fm = QFontMetrics( f );
-  }
-
-  if ( fm.width( res ) > W )
-  {
-    QString end( "..." );
-    while ( !res.isEmpty() && fm.width( res + end ) > W )
-      res.remove( res.length() - 1, 1 );
-
-    if ( !res.isEmpty() )
-      res += end;
-  }
-
-  return res;
-}
-
-/*!
-    Class: SalomeStylePlugin [Internal]
-    Constructor
-*/
-SalomeStylePlugin::SalomeStylePlugin()
-{
-}
-
-/*!
-  Destructor
-*/
-SalomeStylePlugin::~SalomeStylePlugin()
-{
-}
-
-/*!
-  \return keys of styles of plugin
-*/
-QStringList SalomeStylePlugin::keys() const
-{
-  return QStringList() << "salome";
-}
-
-/*!
-  \return just created style 
-  \param str - style key
-*/
-QStyle* SalomeStylePlugin::create( const QString& str )
-{
-  if ( str == "salome" )
-    return new SalomeStyle();
-  else
-    return 0;
-}
-
-Q_EXPORT_PLUGIN( SalomeStylePlugin )
diff --git a/src/Style/SalomeStyle.h b/src/Style/SalomeStyle.h
deleted file mode 100644 (file)
index e87ebf1..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef SALOMESTYLE_H
-#define SALOMESTYLE_H
-
-#define parent_style qwindowsstyle
-#define PARENT_STYLE QWindowsStyle
-
-#define QUOTE(x) #x
-#define PARENT_INC(x) QUOTE(x.h)
-
-//#include PARENT_INC(parent_style)
-#include <qwindowsstyle.h>
-
-#include <qpixmap.h>
-#include <qdockwindow.h>
-#include <qstyleplugin.h>
-
-#if defined SALOMESTYLE_EXPORTS
-#if defined WIN32
-#define SALOMESTYLE_EXPORT _declspec( dllexport )
-#else
-#define SALOMESTYLE_EXPORT  
-#endif
-#else
-#if defined WIN32
-#define SALOMESTYLE_EXPORT _declspec( dllimport )
-#else
-#define SALOMESTYLE_EXPORT  
-#endif
-#endif
-
-class QFontMetrics;
-
-class SALOMESTYLE_EXPORT SalomeStyle : public PARENT_STYLE
-{
-public:
-  SalomeStyle();
-  virtual ~SalomeStyle();
-
-  virtual void       polish( QWidget* );
-
-  virtual bool       eventFilter( QObject*, QEvent* );
-
-  static void        mix( const double, QRgb&, const QRgb& );
-  static void        mix( const double, QPixmap&, const QColor& );
-  static void        mix( const double, const QColor&, const QColor&, QColor& );
-
-  static void        toGrayscale( QPixmap&, double = 1.0 );
-
-  virtual void       drawPrimitive( PrimitiveElement, QPainter*, const QRect&,
-                                   const QColorGroup&, SFlags = Style_Default,
-                                   const QStyleOption& = QStyleOption::Default ) const;
-
-  virtual void       drawControl( ControlElement, QPainter*, const QWidget*,
-                                 const QRect&, const QColorGroup&, SFlags = Style_Default,
-                                 const QStyleOption& = QStyleOption::Default ) const; 
-
-  virtual QRect      subRect( SubRect, const QWidget* ) const;
-
-  virtual void       drawComplexControl( ComplexControl, QPainter*, const QWidget*,
-                                        const QRect&, const QColorGroup&, SFlags = Style_Default,
-                                        SCFlags = SC_All, SCFlags = SC_None,
-                                        const QStyleOption& = QStyleOption::Default ) const;
-
-  virtual QPixmap    stylePixmap( StylePixmap, const QWidget* = 0,
-                                 const QStyleOption& = QStyleOption::Default ) const;
-
-  virtual int        pixelMetric( PixelMetric, const QWidget* widget = 0 ) const;
-
-protected:
-  typedef enum { LeftToRight, RightToLeft, UpToDown, DownToUp } Direction;
-
-  typedef double (*gradient_func)( double );
-
-  void               drawGradient( QPainter*, const QRect&, const QColor&,
-                                  const QColor&, const Direction, gradient_func ) const;
-
-  QString            titleText( const QString&, const int, const int, QFont& f ) const;
-
-private:
-  QWidget*           myTitleParent;
-};
-
-class SalomeStylePlugin : public QStylePlugin
-{
-public:
-  SalomeStylePlugin();
-  virtual ~SalomeStylePlugin();
-
-  virtual QStringList keys() const;
-  virtual QStyle* create( const QString& );
-};
-
-#endif
diff --git a/src/Style/Style.h b/src/Style/Style.h
new file mode 100644 (file)
index 0000000..9d79eb1
--- /dev/null
@@ -0,0 +1,38 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Style.h
+// Author : Natalia Ermolaeva, Open CASCADE S.A.S.
+//
+#ifndef STYLE_H
+#define STYLE_H
+
+#if defined WIN32
+#  if defined STYLE_SALOME_EXPORTS || defined STYLE_EXPORTS
+#    define STYLE_SALOME_EXPORT _declspec( dllexport )
+#  else
+#    define STYLE_SALOME_EXPORT _declspec( dllimport )
+#  endif
+#else
+#  define STYLE_SALOME_EXPORT  
+#endif
+
+#endif // STYLE_H
diff --git a/src/Style/Style.qrc b/src/Style/Style.qrc
new file mode 100644 (file)
index 0000000..7c529c5
--- /dev/null
@@ -0,0 +1,8 @@
+ <!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+     <file>images/critical.png</file>
+     <file>images/information.png</file>
+     <file>images/question.png</file>
+     <file>images/warning.png</file>
+ </qresource>
+ </RCC>
diff --git a/src/Style/Style_Model.cxx b/src/Style/Style_Model.cxx
new file mode 100644 (file)
index 0000000..43bb896
--- /dev/null
@@ -0,0 +1,866 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Style_Model.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
+//
+#include "Style_Model.h"
+
+#include <QtxResourceMgr.h>
+
+#include <QApplication>
+#include <QColor>
+#include <QFont>
+#include <QPalette>
+
+/*!
+  \brief Mix two colors to get color with averaged red, green, blue and alpha-channel values
+  \internal
+  \param c1 first color
+  \param c2 second color
+  \return averaged color
+*/
+static QColor mixColors( const QColor& c1, const QColor& c2 )
+{
+  return QColor( (c1.red()   + c2.red() )   / 2,
+                (c1.green() + c2.green() ) / 2,
+                (c1.blue()  + c2.blue() )  / 2,
+                (c1.alpha() + c2.alpha() ) / 2 );
+}
+
+/*!
+  \class Style_Model
+  \brief SALOME style model
+
+  Style model class stores properties of the SALOME style, like palette colors,
+  widget roundings etc. It allows reading these properties from the resource file
+  and write them back to resource file.
+
+  SALOME_Style class provides an access to the global style model (which is applied
+  to the application). To get access to the global SALOME style model, use static
+  Style_Model::model() function.
+
+  \sa Style_Salome class
+*/
+
+/*!
+  \brief Application style data
+  \internal
+*/
+Style_Model::AppData* Style_Model::myAppData = 0;
+
+/*!
+  \brief Constructor
+
+  Create new SALOME style model with default properties.
+*/
+Style_Model::Style_Model()
+  : myResourceMgr( 0 )
+{
+  initDefaults(); // init from default values
+}
+
+/*!
+  \brief Destructor
+*/
+Style_Model::~Style_Model()
+{
+}
+
+/*!
+  \brief Initialize model from the current application style
+  
+  This function is useful when it is necessary to set/remove SALOME style
+  dynamically. Function fromApplication() saves current application properties
+  (style, palette, font) which can be later restored with the restore() function.
+
+  The simplest way it can be done is using static functions of Style_Salome class:
+  Style_Salome::apply(), Style_Salome::restore()
+
+  \param reset if \c true model is also initializes preoperties from the application
+  \sa restore(), fromResources()
+  \sa Style_Salome class
+*/
+void Style_Model::fromApplication( bool reset )
+{
+  initDefaults();
+
+  if ( !QApplication::instance() )  // application object is not created yet
+    return;
+
+  if ( !myAppData )  {
+    // if not yes initialized from the application,
+    // store current application's style, palette, etc
+    myAppData = new AppData;
+    myAppData->myStyle   = QApplication::style();
+    myAppData->myPalette = QApplication::palette();
+    myAppData->myFont    = QApplication::font();
+  }
+
+  // initialize style properties from the application
+
+  if ( !reset ) return;
+
+  // font
+  myFont = myAppData->myFont;
+  // colors
+  for ( int i = (int)QPalette::Active; i <= (int)QPalette::Inactive; i++ ) {
+    for ( int j = (int)Style_Model::WindowText; j < (int)Style_Model::NColorRoles; j++ ) {
+      myColors[ (QPalette::ColorGroup)i ][ (Style_Model::ColorRole)j ] =
+       myAppData->myPalette.color( (QPalette::ColorGroup)i, (QPalette::ColorRole)j );
+    }
+  }
+
+  QColor dark = myAppData->myPalette.color( QPalette::Dark );
+  setColor( BorderTop,       dark.lighter() );
+  setColor( BorderBottom,    dark.darker() );
+  setColor( TabBorderTop,    dark.lighter().lighter() );
+  setColor( TabBorderBottom, dark.darker().darker() );
+  setColor( FieldLight,      myAppData->myPalette.color( QPalette::Light ) );
+  setColor( FieldDark,       myAppData->myPalette.color( QPalette::Mid ).light( 125 ) );
+  setColor( ProgressBar,     myAppData->myPalette.color( QPalette::Highlight ) );
+  setColor( Pointer,         myAppData->myPalette.color( QPalette::WindowText ) );
+  setColor( Checked,         myAppData->myPalette.color( QPalette::Base ) );
+  setColor( GridLine,        myAppData->myPalette.color( QPalette::Mid ) );
+  setColor( Header,          myAppData->myPalette.color( QPalette::Button ) );
+  setColor( Slider,          myAppData->myPalette.color( QPalette::Button ) );
+  setColor( HighlightWidget, myAppData->myPalette.color( QPalette::Button ) );
+  setColor( HighlightBorder, myAppData->myPalette.color( QPalette::Button ) );
+  setColor( Lines,           myAppData->myPalette.color( QPalette::Mid ) );
+}
+
+/*!
+  \brief Initialize model from the resources
+
+  This function can be used to retrieve SALOME style properties from the resource file(s).
+  Note, that paremeters \a resMgr and \a resSection are stored by the model to be used
+  later with save() method.
+
+  \param resMgr resources manager
+  \param resSection resources section name; if empty (default), "Theme" section is used instead
+  \sa fromApplication(), save(), update()
+*/
+void Style_Model::fromResources( QtxResourceMgr* resMgr, const QString& resSection )
+{
+  // init from application
+  fromApplication( false );
+
+  myResourceMgr     = resMgr;
+  myResourceSection = resSection;
+
+  // init from resource manager
+  if ( !resourceMgr() )
+    return;
+
+  QString section = resourceSection();
+
+  // colors
+  // Button
+  readColorValue( Button, "button" );
+  // Window text
+  readColorValue( WindowText, "window-text" );
+  // Light
+  readColorValue( Light, "light" );
+  // Dark
+  readColorValue( Dark, "dark" );
+  // Mid
+  readColorValue( Mid, "mid" );
+  // Text
+  readColorValue( Text, "text" );
+  // BrightText
+  readColorValue( BrightText, "bright-text" );
+  // ButtonText
+  readColorValue( ButtonText, "button-text" );
+  // Base
+  readColorValue( Base, "base" );
+  // Window
+  readColorValue( Window, "window" );
+  // AlternateBase
+  readColorValue( AlternateBase, "alternate-base" );
+  // Midlight
+  readColorValue( Midlight, "midlight" );
+  // Shadow
+  readColorValue( Shadow, "shadow" );
+  // Highlight
+  readColorValue( Highlight, "highlight" );
+  // HighlightedText
+  readColorValue( HighlightedText, "highlight-text" );
+  // Link
+  readColorValue( Link, "link" );
+  // LinkVisited
+  readColorValue( LinkVisited, "link-visited" );
+  // ToolTipBase
+  readColorValue( ToolTipBase, "tooltip-base" );
+  // ToolTipText
+  readColorValue( ToolTipText, "tooltip-text" );
+  // BorderTop
+  readColorValue( BorderTop, "border-top" );
+  // BorderBottom
+  readColorValue( BorderBottom, "border-bottom" );
+  // TabBorderTop
+  readColorValue( TabBorderTop, "tab-border-top" );
+  // TabBorderBottom
+  readColorValue( TabBorderBottom, "tab-border-bottom" );
+  // FieldLight
+  readColorValue( FieldLight, "field-light" );
+  // FieldDark
+  readColorValue( FieldDark, "field-dark" );
+  // ProgressBar
+  readColorValue( ProgressBar, "progress-bar" );
+  // Pointer
+  readColorValue( Pointer, "pointer" );
+  // Checked
+  readColorValue( Checked, "checked" );
+  // GridLine
+  readColorValue( GridLine, "grid-line" );
+  // Header
+  readColorValue( Header, "header" );
+  // Slider
+  readColorValue( Slider, "slider" );
+  // HighlightWidget
+  readColorValue( HighlightWidget, "highlight-widget" );
+  // HighlightBorder
+  readColorValue( HighlightBorder, "highlight-border" );
+  // Lines
+  readColorValue( Lines, "lines" );
+  // auto-palette flag (internal)
+  if ( resourceMgr()->hasValue( section, "auto-palette" ) ) {
+    setAutoPalette( resourceMgr()->booleanValue( section, "auto-palette" ) );
+  }
+  // lines type
+  if ( resourceMgr()->hasValue( section, "lines-type" ) ) {
+    int ltype = resourceMgr()->integerValue( section, "lines-type" );
+    if ( ltype >= NoLines && ltype <= Inclined )
+      setLinesType( (LineType)ltype );
+  }
+  // lines transparency
+  if ( resourceMgr()->hasValue( section, "lines-transparency" ) ) {
+    int ltransp = resourceMgr()->integerValue( section, "lines-transparency" );
+    if ( ltransp >= 0 && ltransp <= 100 )
+      setLinesTransparency( ltransp );
+  }
+  // application font
+  if ( resourceMgr()->hasValue( section, "application-font" ) ) {
+    setApplicationFont( resourceMgr()->fontValue( section, "application-font" ) );
+  }
+  // widgets rounding
+  if ( resourceMgr()->hasValue( section, "button-rad" ) ) {
+    setWidgetRounding( ButtonRadius, resourceMgr()->doubleValue( section, "button-rad" ) );
+  }
+  if ( resourceMgr()->hasValue( section, "edit-rad" ) ) {
+    setWidgetRounding( EditRadius, resourceMgr()->doubleValue( section, "edit-rad" ) );
+  }
+  if ( resourceMgr()->hasValue( section, "frame-rad" ) ) {
+    setWidgetRounding( FrameRadius, resourceMgr()->doubleValue( section, "frame-rad" ) );
+  }
+  if ( resourceMgr()->hasValue( section, "slider-rad" ) ) {
+    setWidgetRounding( SliderRadius, resourceMgr()->doubleValue( section, "slider-rad" ) );
+  }
+  // widget effect
+  if ( resourceMgr()->hasValue( section, "widget-effect" ) ) {
+    int effect = resourceMgr()->integerValue( section, "widget-effect" );
+    if ( effect >= NoEffect && effect <= AutoRaiseEffect )
+      setWidgetEffect( (WidgetEffect)effect );
+  }
+  else if ( resourceMgr()->hasValue( section, "is-highlight-widget" ) ||
+           resourceMgr()->hasValue( section, "is-raising-widget" ) ) {
+    bool highlight = resourceMgr()->booleanValue( section, "is-highlight-widget", false );
+    bool autoraise = resourceMgr()->booleanValue( section, "is-highlight-widget", false );
+    if ( highlight )
+      setWidgetEffect( HighlightEffect );
+    else if ( autoraise )
+      setWidgetEffect( AutoRaiseEffect );
+  }
+  if ( resourceMgr()->hasValue( section, "all-antialized" ) ) {
+    setAntialiasing( resourceMgr()->booleanValue( section, "all-antialized" ) );
+  }
+  // handles
+  if ( resourceMgr()->hasValue( section, "hor-hadle-delta" ) ) {
+    setHandleDelta( Qt::Horizontal, resourceMgr()->integerValue( section, "hor-hadle-delta" ) );
+  }
+  if ( resourceMgr()->hasValue( section, "ver-hadle-delta" ) ) {
+    setHandleDelta( Qt::Vertical, resourceMgr()->integerValue( section, "vsr-hadle-delta" ) );
+  }
+  if ( resourceMgr()->hasValue( section, "slider-size" ) ) {
+    setSliderSize( resourceMgr()->integerValue( section, "slider-size" ) );
+  }
+  else if ( resourceMgr()->hasValue( section, "slider-increase" ) ) {
+    setSliderSize( resourceMgr()->integerValue( section, "slider-increase" ) );
+  }
+  if ( resourceMgr()->hasValue( section, "split-handle-len" ) ) {
+    setSplitHandleLength( resourceMgr()->integerValue( section, "split-handle-len" ) );
+  }
+}
+
+/*!
+  \brief Save SALOME stype properties to the resource file.
+  
+  If paremeters \a resMgr and \a resSection are not specified, default ones
+  (those passed to the fromResources() function) are used instead.
+
+  \param resMgr resources manager
+  \param resSection resources section name
+  \sa fromResources(), update()
+*/
+void Style_Model::save( QtxResourceMgr* resMgr, const QString& resSection )
+{
+  if ( !resMgr )
+    resMgr = resourceMgr();
+  if ( !resMgr )
+    return;
+
+  QString section = resSection.isEmpty() ? resourceSection() : resSection;
+
+  // colors
+  // Button
+  writeColorValue( Button, "button", resMgr, section );
+  // Window text
+  writeColorValue( WindowText, "window-text", resMgr, section );
+  // Light
+  writeColorValue( Light, "light", resMgr, section );
+  // Dark
+  writeColorValue( Dark, "dark", resMgr, section );
+  // Mid
+  writeColorValue( Mid, "mid", resMgr, section );
+  // Text
+  writeColorValue( Text, "text", resMgr, section );
+  // BrightText
+  writeColorValue( BrightText, "bright-text", resMgr, section );
+  // ButtonText
+  writeColorValue( ButtonText, "button-text", resMgr, section );
+  // Base
+  writeColorValue( Base, "base", resMgr, section );
+  // Window
+  writeColorValue( Window, "window", resMgr, section );
+  // AlternateBase
+  writeColorValue( AlternateBase, "alternate-base", resMgr, section );
+  // Midlight
+  writeColorValue( Midlight, "midlight", resMgr, section );
+  // Shadow
+  writeColorValue( Shadow, "shadow", resMgr, section );
+  // Highlight
+  writeColorValue( Highlight, "highlight", resMgr, section );
+  // HighlightedText
+  writeColorValue( HighlightedText, "highlight-text", resMgr, section );
+  // Link
+  writeColorValue( Link, "link", resMgr, section );
+  // LinkVisited
+  writeColorValue( LinkVisited, "link-visited", resMgr, section );
+  // ToolTipBase
+  writeColorValue( ToolTipBase, "tooltip-base", resMgr, section );
+  // ToolTipText
+  writeColorValue( ToolTipText, "tooltip-text", resMgr, section );
+  // BorderTop
+  writeColorValue( BorderTop, "border-top", resMgr, section );
+  // BorderBottom
+  writeColorValue( BorderBottom, "border-bottom", resMgr, section );
+  // TabBorderTop
+  writeColorValue( TabBorderTop, "tab-border-top", resMgr, section );
+  // TabBorderBottom
+  writeColorValue( TabBorderBottom, "tab-border-bottom", resMgr, section );
+  // FieldLight
+  writeColorValue( FieldLight, "field-light", resMgr, section );
+  // FieldDark
+  writeColorValue( FieldDark, "field-dark", resMgr, section );
+  // ProgressBar
+  writeColorValue( ProgressBar, "progress-bar", resMgr, section );
+  // Pointer
+  writeColorValue( Pointer, "pointer", resMgr, section );
+  // Checked
+  writeColorValue( Checked, "checked", resMgr, section );
+  // GridLine
+  writeColorValue( GridLine, "grid-line", resMgr, section );
+  // Header
+  writeColorValue( Header, "header", resMgr, section );
+  // Slider
+  writeColorValue( Slider, "slider", resMgr, section );
+  // HighlightWidget
+  writeColorValue( HighlightWidget, "highlight-widget", resMgr, section );
+  // HighlightBorder
+  writeColorValue( HighlightBorder, "highlight-border", resMgr, section );
+  // Lines
+  writeColorValue( Lines, "lines", resMgr, section );
+  // auto-palette flag (internal)
+  resMgr->setValue( section, "auto-palette", isAutoPalette() );
+
+  // lines type
+  resMgr->setValue( section, "lines-type", (int)linesType() );
+  // lines transparency
+  resMgr->setValue( section, "lines-transparency", linesTransparency() );
+  // application font
+  resMgr->setValue( section, "application-font", applicationFont() );
+  // widgets rounding
+  resMgr->setValue( section, "button-rad", widgetRounding( ButtonRadius ) );
+  resMgr->setValue( section, "edit-rad",   widgetRounding( EditRadius ) );
+  resMgr->setValue( section, "frame-rad",  widgetRounding( FrameRadius ) );
+  resMgr->setValue( section, "slider-rad", widgetRounding( SliderRadius ) );
+  resMgr->setValue( section, "all-antialized", antialiasing() );
+  // widget effect
+  resMgr->setValue( section, "widget-effect", (int)widgetEffect() );
+  // handles
+  resMgr->setValue( section, "hor-hadle-delta", handleDelta( Qt::Horizontal ) );
+  resMgr->setValue( section, "vsr-hadle-delta", handleDelta( Qt::Vertical ) );
+  resMgr->setValue( section, "slider-size", sliderSize() );
+  resMgr->setValue( section, "split-handle-len", splitHandleLength() );
+}
+
+/*!
+  \brief Reload SALOME style properties from the resources file(s).
+  \sa fromResources(), save()
+*/
+void Style_Model::update()
+{
+  fromResources( resourceMgr(), resourceSection() );
+}
+
+/*!
+  \brief Restore original style, palette and font to the application
+
+  This function should be used in conjunction with fromApplication() method.
+  Sets initial style, color palette and font to the application.
+  If SALOME style model has not been initialized from the application,
+  this function does nothing.
+
+  \sa fromApplication()
+*/
+void Style_Model::restore()
+{
+  if ( !QApplication::instance() ) // application object is not created yet
+    return;
+  if ( !myAppData ) // not initialized from the application yet
+    return;
+
+  QApplication::setStyle( myAppData->myStyle );
+  QApplication::setPalette( myAppData->myPalette );
+  QApplication::setFont( myAppData->myFont );
+}
+
+/*!
+  \brief Get resource manager used by this SALOME style model.
+
+  \return pointer to the resource manager passed previously to the fromResources() method
+  \sa initFromResources(), resourceSection()
+*/
+QtxResourceMgr* Style_Model::resourceMgr() const
+{
+  return myResourceMgr;
+}
+
+/*!
+  \brief Get resources section name
+
+  If section name is empty, default "Theme" is returned
+
+  \return resource section name passed previously to the fromResources() method
+  \sa initFromResources(), resourceMgr()
+*/
+QString Style_Model::resourceSection() const
+{
+  return !myResourceSection.isEmpty() ? myResourceSection : "Theme";
+}
+
+/*!
+  \brief Get palette color value
+  \param role color role
+  \param cg color group
+  \return a color which should be used to draw the corresponding part of the application
+  \sa setColor()
+*/
+QColor Style_Model::color( ColorRole role, QPalette::ColorGroup cg ) const
+{
+  QColor c = myColors[ cg ][ role ];
+  if ( !c.isValid() ) c = myColors[ QPalette::Active ][ role ];
+  return c;
+}
+
+/*!
+  \brief Set palette color value
+
+  If \a inactive and/or \a disabled colors are not specified, they are automatically
+  calculated from \a active color.
+
+  \param role color role
+  \param active a color to be used with active color group (QPalette::Active)
+  \param inactive a color to be used with inactive color group (QPalette::Inactive)
+  \param disabled a color to be used with disabled color group (QPalette::Disabled)
+  \sa color()
+*/
+void Style_Model::setColor( Style_Model::ColorRole role, const QColor& active,
+                           const QColor& inactive, const QColor& disabled )
+{
+  QColor ac = active, ic = inactive, dc = disabled;
+
+  if ( !ic.isValid() ) {
+    ic = ac;
+  }
+  if ( !dc.isValid() ) {
+    switch ( role ) {
+    case WindowText:
+    case Text:
+      dc = color( Button ).darker();
+      break;
+    case Base:
+      dc = color( Button );
+      break;
+    case AlternateBase:
+      dc = mixColors( color( Base,  QPalette::Inactive ), color( Button, QPalette::Inactive ) );
+      break;
+    case Midlight:
+      dc = mixColors( color( Light, QPalette::Inactive ), color( Button, QPalette::Inactive ) );
+      break;
+    default:
+      dc = ac;
+      break;
+    }
+  }
+
+  setColor( role, QPalette::Active,   ac );
+  setColor( role, QPalette::Inactive, ic );
+  setColor( role, QPalette::Disabled, dc );
+}
+
+/*!
+  \brief Set palette color value
+
+  If \a inactive and/or \a disabled colors are not specified, they are automatically
+  calculated from \a active color.
+
+  \param role color role
+  \param cg color group
+  \param c color which should be used to draw the corresponding part of the application
+  \sa color()
+*/
+void Style_Model::setColor( Style_Model::ColorRole role, QPalette::ColorGroup cg, const QColor& c )
+{
+  myColors[ cg ][ role ] = c;
+}
+
+/*!
+  \brief Returns 'auto-calculating color values' flag
+  \return 'auto-calculating color values' flag
+  \internal
+  \sa setAutoPalette()
+*/
+bool Style_Model::isAutoPalette() const
+{
+  return myAutoPalette;
+}
+
+/*!
+  \brief Set/clear 'auto-calculating color values' flag
+  \param on new value of 'auto-calculating color values' flag
+  \internal
+  \sa isAutoPalette()
+*/
+void Style_Model::setAutoPalette( bool on )
+{
+  myAutoPalette = on;
+}
+
+/*!
+  \brief Get lines type
+  \return current lines type
+  \sa setLinesType(), linesTransparency()
+*/
+Style_Model::LineType Style_Model::linesType() const
+{
+  return myLinesType;
+}
+
+/*!
+  \brief Set lines type
+  \param lt new lines type
+  \sa linesType(), linesTransparency()
+*/
+void Style_Model::setLinesType( LineType lt )
+{
+  myLinesType = lt;
+}
+
+/*!
+  \brief Get lines transparency value
+  \return current lines transparency
+  \sa setLinesTransparency(), linesType()
+*/
+int Style_Model::linesTransparency() const
+{
+  return myLinesTransparency;
+}
+
+/*!
+  \brief Set lines transparency value
+  \param transparency new lines transparency
+  \sa linesTransparency(), linesType()
+*/
+void Style_Model::setLinesTransparency( int transparency )
+{
+  myLinesTransparency = transparency;
+}
+
+/*!
+  \brief Get application font
+  \return current application font
+  \sa setApplicationFont()
+*/
+QFont Style_Model::applicationFont() const
+{
+  return myFont;
+}
+
+/*!
+  \brief Set application font
+  \param font new application font
+  \sa applicationFont()
+*/
+void Style_Model::setApplicationFont( const QFont& font )
+{
+  myFont = font;
+}
+
+/*!
+  \brief Get widget corners rounding radius value
+  \param wr widget type
+  \return current widget corners rounding
+  \sa setWidgetRounding(), antialiasing()
+*/
+double Style_Model::widgetRounding( Style_Model::WidgetRounding wr ) const
+{
+  return myWidgetRounding[ wr ];
+}
+
+/*!
+  \brief Set widget corners rounding radius value
+  \param wr widget type
+  \param value new widget corners rounding
+  \sa widgetRounding(), antialiasing()
+*/
+void Style_Model::setWidgetRounding( WidgetRounding wr, double value )
+{
+  myWidgetRounding[ wr ] = value;
+}
+
+/*!
+  \brief Get anti-aliasing flag value
+  \return \c true if widgets borders should be antialiased
+  \sa setAntialiasing(), widgetRounding()
+*/
+bool Style_Model::antialiasing() const
+{
+  return myAntiAliasing;
+}
+
+/*!
+  \brief Set anti-aliasing flag value
+  \param value if \c true, widgets borders should be antialiased
+  \sa antialiasing(), widgetRounding()
+*/
+void Style_Model::setAntialiasing( bool value )
+{
+  myAntiAliasing = value;
+}
+
+/*!
+  \brief Get widget effect
+  \return current widget effect
+  \sa setWidgetEffect()
+*/
+Style_Model::WidgetEffect Style_Model::widgetEffect() const
+{
+  return myWidgetEffect;
+}
+
+/*!
+  \brief Set widget effect
+  \param we new widget effect
+  \sa widgetEffect()
+*/
+void Style_Model::setWidgetEffect( WidgetEffect we )
+{
+  myWidgetEffect = we;
+}
+
+/*!
+  \brief Get handle spacing value
+  \param o handle spacing direction
+  \return current handle spacing value
+  \sa setHandleDelta()
+*/
+int Style_Model::handleDelta( Qt::Orientation o ) const
+{
+  return myHandleDelta[ o ];
+}
+
+/*!
+  \brief Set handle spacing value
+  \param o handle spacing direction
+  \param value new handle spacing value
+  \sa handleDelta()
+*/
+void Style_Model::setHandleDelta( Qt::Orientation o, int value )
+{
+  myHandleDelta[ o ] = value;
+}
+
+/*!
+  \brief Get splitter handle length
+  \return current splitter handle length
+  \sa setSplitHandleLength()
+*/
+int Style_Model::splitHandleLength() const
+{
+  return mySplitHandleLength;
+}
+
+/*!
+  \brief Set splitted handle length
+  \param value new splitter handle length
+  \sa splitHandleLength()
+*/
+void Style_Model::setSplitHandleLength( int value )
+{
+  mySplitHandleLength = value; 
+}
+
+/*!
+  \brief Get slider handle extra size
+  \return current slider handle extra size
+  \sa setSliderSize()
+*/
+int Style_Model::sliderSize() const
+{
+  return mySliderSize;
+}
+
+/*!
+  \brief Set slider handle extra size
+  \param value new slider handle extra size
+  \sa sliderSize()
+*/
+void Style_Model::setSliderSize( int value )
+{
+  mySliderSize = value;
+}
+
+/*!
+  \brief Initialize model with the default values
+*/
+void Style_Model::initDefaults()
+{
+  // default application font
+  myFont.fromString( "Sans Serif,9,-1,5,50,0,0,0,0,0" );
+
+  // default palette colors
+  myAutoPalette = false;
+  QColor btn = QColor( "#e6e7e6" );
+  QColor fg  = QColor( "#000000" );
+  QColor bg  = QColor( "#ffffff" );
+  setColor( Button,          btn );                  // = (230, 231, 230)
+  setColor( WindowText,      fg );                   // = (  0,   0,   0)
+  setColor( Light,           bg );                   // = (255, 255, 255)
+  setColor( Dark,            btn.darker() );         // = (115, 115, 115) // btn.darker( 130 ) = (177, 178, 177)
+  setColor( Mid,             btn.darker( 150 ) );    // = (153, 154, 153)
+  setColor( Text,            fg );                   // = (  0,   0,   0)
+  setColor( BrightText,      bg );                   // = (255, 255, 255) // fg = (  0,  0,  0)
+  setColor( ButtonText,      fg );                   // = (  0,   0,   0)
+  setColor( Base,            bg );                   // = (255, 255, 255)
+  setColor( Window,          btn );                  // = (230, 231, 230)
+  setColor( AlternateBase,   mixColors( bg, btn ) ); // = (242, 243, 242)
+  setColor( Midlight,        mixColors( bg, btn ) ); // = (242, 243, 242)
+  setColor( Shadow,          fg );                   // = (  0,   0,   0)
+  setColor( Highlight,       "#000080" );            // = (  0,   0, 128) // (  33,  68, 156 )
+  setColor( HighlightedText, bg );                   // = (255, 255, 255)
+  setColor( Link,            "#0000ff" );            // = (  0,   0, 255)
+  setColor( LinkVisited,     "#ff00ff" );            // = (255,   0, 255)
+  setColor( ToolTipBase,     "#ffffdc" );            // = (255, 255, 220) // ( 230, 231, 230 )
+  setColor( ToolTipText,     fg );                   // = (  0,   0,   0)
+  setColor( BorderTop,       "#adadad" );            // = (173, 173, 173) // ( 255, 255, 255 )
+  setColor( BorderBottom,    "#393939" );            // = ( 57,  57,  57) // (  88,  89,  88 )
+  setColor( TabBorderTop,    "#ffffff" );            // = (255, 255, 255)
+  setColor( TabBorderBottom, "#0e0e0e" );            // = ( 14,  14,  14) // (  44,  44,  44 )
+  setColor( FieldLight,      "#ffffff" );            // = (255, 255, 255)
+  setColor( FieldDark,       "#c0c1c0" );            // = (192, 193, 192) // ( 240, 241, 240 )
+  setColor( ProgressBar,     "#000080" );            // = (  0,   0, 128) // (  33,  68, 156 )
+  setColor( Pointer,         "#000000" );            // = (  0,   0,   0)
+  setColor( Checked,         "#ffffff" );            // = (255, 255, 255)
+  setColor( GridLine,        "#999a99" );            // = (153, 154, 153) // ( 192, 192, 192 )
+  setColor( Header,          "#e6e7e6" );            // = (230, 231, 230)
+  setColor( Slider,          "#e6e7e6" );            // = (230, 231, 230)
+  setColor( HighlightWidget, "#e6e7e6" );            // = (230, 231, 230)
+  setColor( HighlightBorder, "#e6e7e6" );            // = (230, 231, 230)
+  setColor( Lines,           "#999a99" );            // = (153, 154, 153) // ( 192, 193, 192 )
+
+  // default values
+  myLinesType          = NoLines;
+  myWidgetEffect       = NoEffect;
+  myAntiAliasing       = false;
+  myLinesTransparency  = 0;
+  myWidgetRounding[ EditRadius   ] = 0.0;
+  myWidgetRounding[ ButtonRadius ] = 0.0;
+  myWidgetRounding[ FrameRadius  ] = 0.0;
+  myWidgetRounding[ SliderRadius ] = 0.0;
+  myHandleDelta[ Qt::Horizontal ]  = 3;
+  myHandleDelta[ Qt::Vertical ]    = 3;
+  mySplitHandleLength              = 20;
+  mySliderSize                     = 2;
+}
+
+/*!
+  \brief Read palette color values from resources manager
+  \param role color role
+  \param prefix palette color value resource name prefix
+  \sa writeColorValue()
+*/
+void Style_Model::readColorValue( ColorRole role, const QString& prefix )
+{
+  if ( !resourceMgr() ) return;
+
+  QString section = resourceSection();
+  QString active   = QString( "%1-color" ).arg( prefix );
+  QString inactive = QString( "%1-color-inactive" ).arg( prefix );
+  QString disabled = QString( "%1-color-disabled" ).arg( prefix );
+
+  if ( resourceMgr()->hasValue( section, active ) )
+    setColor( role, resourceMgr()->colorValue( section, active ) );
+  if ( resourceMgr()->hasValue( section, inactive ) )
+    setColor( role, QPalette::Inactive, resourceMgr()->colorValue( section, inactive ) );
+  if ( resourceMgr()->hasValue( section, disabled ) )
+    setColor( role, QPalette::Disabled, resourceMgr()->colorValue( section, disabled ) );
+}
+
+/*!
+  \brief Write palette color values to resources manager
+  \param role color role
+  \param prefix palette color value resource name prefix
+  \param resMgr resource manager
+  \param resSection resource section name
+  \sa readColorValue()
+*/
+void Style_Model::writeColorValue( ColorRole role, const QString& prefix,
+                                  QtxResourceMgr* resMgr, const QString& resSection ) const
+{
+  QString active   = QString( "%1-color" ).arg( prefix );
+  QString inactive = QString( "%1-color-inactive" ).arg( prefix );
+  QString disabled = QString( "%1-color-disabled" ).arg( prefix );
+
+  resMgr->setValue( resSection, active,   color( role, QPalette::Active ) );
+  resMgr->setValue( resSection, inactive, color( role, QPalette::Inactive ) );
+  resMgr->setValue( resSection, disabled, color( role, QPalette::Disabled ) );
+}
diff --git a/src/Style/Style_Model.h b/src/Style/Style_Model.h
new file mode 100644 (file)
index 0000000..7d94ba7
--- /dev/null
@@ -0,0 +1,191 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Style_Model.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
+//
+#ifndef STYLE_MODEL_H
+#define STYLE_MODEL_H
+
+#include "Style.h"
+
+#include <QMap>
+#include <QString>
+#include <QPalette>
+#include <QFont>
+
+class QStyle;
+class QtxResourceMgr;
+
+//
+// This class is private for Style package.
+// Normally it should not be exported.
+//
+class STYLE_SALOME_EXPORT Style_Model
+{
+public:
+  //! Color palette instance enumeration
+  typedef enum {
+    WindowText      = QPalette::WindowText,      //!< A general foreground color
+    Button          = QPalette::Button,          //!< The general button background color
+    Light           = QPalette::Light,           //!< Usually lighter than Button color
+    Midlight        = QPalette::Midlight,        //!< Usually between Button and Light
+    Dark            = QPalette::Dark,            //!< Usually darker than Button
+    Mid             = QPalette::Mid,             //!< Usualliy between Button and Dark
+    Text            = QPalette::Text,            //!< The foreground color used with Base
+    BrightText      = QPalette::BrightText,      //!< A text color that is very different from WindowText, and contrasts well with e.g. Dark
+    ButtonText      = QPalette::ButtonText,      //!< A foreground color used with the Button color
+    Base            = QPalette::Base,            //!< Used mostly as the background color for text entry widgets
+    Window          = QPalette::Window,          //!< A general background color
+    Shadow          = QPalette::Shadow,          //!< Usually a very dark palette color
+    Highlight       = QPalette::Highlight,       //!< A color to indicate a selected item or the current item
+    HighlightedText = QPalette::HighlightedText, //!< A text color that contrasts with Highlight
+    Link            = QPalette::Link,            //!< A text color used for unvisited hyperlinks
+    LinkVisited     = QPalette::LinkVisited,     //!< A text color used for already visited hyperlinks
+    AlternateBase   = QPalette::AlternateBase,   //!< Used as the alternate background color in views with alternating row colors
+    NoRole          = QPalette::NoRole,          //!< No role; this special role is often used to indicate that a role has not been assigned
+    ToolTipBase     = QPalette::ToolTipBase,     //!< Used as the background color for QToolTip and QWhatsThis
+    ToolTipText     = QPalette::ToolTipText,     //!< Used as the foreground color for QToolTip and QWhatsThis
+    NColorRoles     = QPalette::NColorRoles,     //!< Used to indicate last standard palette color
+    BorderTop       = NColorRoles,               //!< Used to draw top-left borders of the widgets
+    BorderBottom,                                //!< Used to draw bottom-right borders of the widgets
+    TabBorderTop,                                //!< Used to draw top-left borders of the tab panels
+    TabBorderBottom,                             //!< Used to draw bottom-right borders of the tab panels
+    FieldLight,                                  //!< Light component of the text entry widgets
+    FieldDark,                                   //!< Dark component of the text entry widgets
+    Slider,                                      //!< Used to draw sliders
+    Lines,                                       //!< Used to draw lines throughout all the widgets
+    HighlightWidget,                             //!< Used to draw widget background when widget is hovered
+    HighlightBorder,                             //!< Used to draw widget borders when widget is hovered
+    Header,                                      //!< Used to draw header of tab panels
+    ProgressBar,                                 //!< Main progress bar color
+    Pointer,                                     //!< Used to draw different widgets indicators like spin box arrows etc
+    Checked,                                     //!< Check box indicator color
+    GridLine,                                    //!< Used to draw table widgets grid
+    LastColor                                    //!< Points to the last color; no specific meaning
+  } ColorRole;
+
+  //! Lines type
+  typedef enum {
+    NoLines,                     //!< Do not draw lines
+    Horizontal,                  //!< Draw horozontal lines
+    Inclined,                    //!< Draw inclined lines
+  } LineType;
+
+  //!< Widget roundings
+  typedef enum {
+    ButtonRadius,               //!< Buttons rounding
+    EditRadius,                 //!< Text entry widgets rounding
+    FrameRadius,                //!< Frames rounding
+    SliderRadius,               //!< Sliders rounding
+  } WidgetRounding;
+
+  //! Widget effect
+  typedef enum {
+    NoEffect,                   //!< Do not use widget effects
+    HighlightEffect,            //!< Highlight widget when it is hovered
+    AutoRaiseEffect             //!< Raise widget when it is hovered
+  } WidgetEffect;
+
+  Style_Model();
+  virtual ~Style_Model();
+
+  void                fromApplication( bool = false );
+  void                fromResources( QtxResourceMgr*, const QString& = QString() );
+
+  void                save( QtxResourceMgr* = 0, const QString& = QString() );
+  void                update();
+  void                restore();
+
+  QtxResourceMgr*     resourceMgr() const;
+  QString             resourceSection() const;
+
+
+  QColor              color( ColorRole, QPalette::ColorGroup = QPalette::Active ) const;
+  void                setColor( ColorRole, const QColor&, const QColor& = QColor(), const QColor& = QColor() );
+  void                setColor( ColorRole, QPalette::ColorGroup, const QColor& );
+
+  bool                isAutoPalette() const;
+  void                setAutoPalette( bool );
+
+  LineType            linesType() const;
+  void                setLinesType( LineType );
+
+  int                 linesTransparency() const;
+  void                setLinesTransparency( int );
+
+  QFont               applicationFont() const;
+  void                setApplicationFont( const QFont& );
+
+  double              widgetRounding( WidgetRounding ) const;
+  void                setWidgetRounding( WidgetRounding, double );
+
+  bool                antialiasing() const;
+  void                setAntialiasing( bool );
+  
+  WidgetEffect        widgetEffect() const;
+  void                setWidgetEffect( WidgetEffect );
+
+  int                 handleDelta( Qt::Orientation ) const;
+  void                setHandleDelta( Qt::Orientation, int );
+
+  int                 splitHandleLength() const;
+  void                setSplitHandleLength( int );
+
+  int                 sliderSize() const;
+  void                setSliderSize( int );
+
+private:
+  void                initDefaults();
+  void                readColorValue( ColorRole, const QString& );
+  void                writeColorValue( ColorRole, const QString&, QtxResourceMgr*, const QString& ) const;
+
+private:
+  typedef QMap<ColorRole, QColor>              ColorMap;
+  typedef QMap<QPalette::ColorGroup, ColorMap> ColorGroupMap;
+  typedef QMap<WidgetRounding, double>         RoundMap;
+  typedef QMap<Qt::Orientation, int>           DeltaMap;
+
+  QtxResourceMgr*     myResourceMgr;
+  QString             myResourceSection;
+
+  ColorGroupMap       myColors;
+  bool                myAutoPalette;
+  RoundMap            myWidgetRounding;
+  DeltaMap            myHandleDelta;
+  QFont               myFont;
+  LineType            myLinesType;
+  WidgetEffect        myWidgetEffect;
+  bool                myAntiAliasing;
+  int                 myLinesTransparency;
+  int                 mySplitHandleLength;
+  int                 mySliderSize;
+
+  struct AppData {
+    QStyle*  myStyle;
+    QPalette myPalette;
+    QFont    myFont;
+  };
+  
+  static AppData*     myAppData;
+};
+
+#endif // STYLE_MODEL_H
diff --git a/src/Style/Style_PrefDlg.cxx b/src/Style/Style_PrefDlg.cxx
new file mode 100644 (file)
index 0000000..10d1e39
--- /dev/null
@@ -0,0 +1,1032 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Style_PrefDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
+//
+#include "Style_PrefDlg.h"
+#include "Style_ResourceMgr.h"
+#include "Style_Model.h"
+#include "Style_Salome.h"
+
+#include <QtxColorButton.h>
+#include <QtxDoubleSpinBox.h>
+#include <QtxFontEdit.h>
+
+#include <QApplication>
+#include <QButtonGroup>
+#include <QCheckBox>
+#include <QColorDialog>
+#include <QComboBox>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QHBoxLayout>
+#include <QKeyEvent>
+#include <QLabel>
+#include <QListWidget>
+#include <QMap>
+#include <QMessageBox>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QSlider>
+#include <QSpinBox>
+#include <QStackedWidget>
+#include <QTabWidget>
+#include <QVBoxLayout>
+
+static const int MARGIN  = 9;
+static const int SPACING = 6;
+
+/*!
+  \class Style_PrefDlg::PaletteEditor
+  \brief SALOME style palette editor widget
+  \internal
+*/
+
+/*!
+  \brief Constructor
+  \param parent parent widget
+  \internal
+*/
+Style_PrefDlg::PaletteEditor::PaletteEditor( QWidget* parent )
+  : QFrame( parent ), myCurrentRow( 0 ), myCurrentColumn( -1 )
+{
+  QGridLayout* l = new QGridLayout( this );
+  l->setMargin( MARGIN ); l->setSpacing( SPACING );
+  l->addWidget( myQuickButton = new QPushButton( tr( "Quick" ), this ), 0, 0 );
+  l->addWidget( myAutoCheck   = new QCheckBox( tr( "Auto" ),    this ), 0, 1 );
+  l->addWidget( myContainer   = new QFrame( this ),                     1, 0, 1, 2 );
+
+  l = new QGridLayout( myContainer );
+  l->setMargin( 0 ); l->setSpacing( SPACING );
+
+  addColumn( tr( "Base colors" ) );
+  for ( int i = (int)Style_Model::WindowText; i < (int)Style_Model::NColorRoles; i++ ) {
+    if ( i == Style_Model::NoRole ) continue;
+    addItem( i );
+  }
+
+  addColumn( tr( "Additional colors" ) );
+  for ( int i = (int)Style_Model::BorderTop; i < (int)Style_Model::LastColor; i++ )
+    addItem( i );
+
+  connect( myQuickButton, SIGNAL( clicked() ),       this, SLOT( onQuick() ) );
+  connect( myAutoCheck,   SIGNAL( toggled( bool ) ), this, SLOT( onAuto()  ) );
+}
+
+/*!
+  \brief Destructor
+  \internal
+*/
+Style_PrefDlg::PaletteEditor::~PaletteEditor()
+{
+}
+
+/*!
+  \brief Add new color properties column to the widget
+  \param title column title
+  \sa addItem()
+  \internal
+*/
+void Style_PrefDlg::PaletteEditor::addColumn( const QString& title )
+{
+  QGridLayout* l = qobject_cast<QGridLayout*>( myContainer->layout() );
+  myCurrentRow = 0;
+  myCurrentColumn++;
+
+  if ( !title.isEmpty() ) {
+    QHBoxLayout* hbox = new QHBoxLayout;
+    hbox->setMargin( 0 ); hbox->setSpacing( SPACING );
+    QWidget* ln = line();
+    hbox->addWidget( ln );
+    hbox->setStretchFactor( ln, 5 );
+    QLabel* tlt = new QLabel( title, myContainer );
+    tlt->setAlignment( Qt::AlignCenter );
+    hbox->addWidget( tlt );
+    ln = line();
+    hbox->addWidget( ln );
+    hbox->setStretchFactor( ln, 5 );
+    l->addLayout( hbox, myCurrentRow++, myCurrentColumn*4, 1, 4 );
+  }
+
+  l->addWidget( myActiveLab   = new QLabel( tr( "Active" ),   myContainer ), myCurrentRow, myCurrentColumn*4+1 );
+  l->addWidget( myInactiveLab = new QLabel( tr( "Inactive" ), myContainer ), myCurrentRow, myCurrentColumn*4+2 );
+  l->addWidget( myDisabledLab = new QLabel( tr( "Disable" ),  myContainer ), myCurrentRow, myCurrentColumn*4+3 );
+  int w = 0;
+  w = qMax( w, myActiveLab->sizeHint().width() );
+  w = qMax( w, myInactiveLab->sizeHint().width() );
+  w = qMax( w, myDisabledLab->sizeHint().width() );
+  myActiveLab->setMinimumWidth( w );
+  myInactiveLab->setMinimumWidth( w );
+  myDisabledLab->setMinimumWidth( w );
+  
+  for( int i = 1; i < 4; i++ ) l->setColumnStretch( myCurrentColumn*4+i, 5 );
+
+  myCurrentRow++;
+}
+
+/*!
+  \brief Add color item to the widget (to the current column)
+  \param id color palette identifier (Style_Model::ColorRole)
+  \sa addColumn(), items()
+  \internal
+*/
+void Style_PrefDlg::PaletteEditor::addItem( int id )
+{
+  if ( myButtons.contains( id ) )
+    return;
+
+  myButtons[ id ] = Btns();
+  myButtons[ id ][ QPalette::Active ]   = new QtxColorButton( myContainer );
+  myButtons[ id ][ QPalette::Inactive ] = new QtxColorButton( myContainer );
+  myButtons[ id ][ QPalette::Disabled ] = new QtxColorButton( myContainer );
+  myButtons[ id ][ QPalette::Active ]->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  myButtons[ id ][ QPalette::Inactive ]->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  myButtons[ id ][ QPalette::Disabled ]->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+  QGridLayout* l = qobject_cast<QGridLayout*>( myContainer->layout() );
+  l->addWidget( new QLabel( idToName( id ), myContainer ), myCurrentRow, myCurrentColumn*4 );
+  l->addWidget( myButtons[ id ][ QPalette::Active ],       myCurrentRow, myCurrentColumn*4+1 );
+  l->addWidget( myButtons[ id ][ QPalette::Inactive ],     myCurrentRow, myCurrentColumn*4+2 );
+  l->addWidget( myButtons[ id ][ QPalette::Disabled ],     myCurrentRow, myCurrentColumn*4+3 );
+
+  connect( myButtons[ id ][ QPalette::Active   ], SIGNAL( changed( QColor ) ), this, SIGNAL( changed() ) );
+  connect( myButtons[ id ][ QPalette::Inactive ], SIGNAL( changed( QColor ) ), this, SIGNAL( changed() ) );
+  connect( myButtons[ id ][ QPalette::Disabled ], SIGNAL( changed( QColor ) ), this, SIGNAL( changed() ) );
+
+  myCurrentRow++;
+}
+
+/*!
+  \brief Get list of currently available color items
+  \return list of items identifiers (Style_Model::ColorRole)
+  \sa addColumn(), addItem()
+  \internal
+*/
+QList<int> Style_PrefDlg::PaletteEditor::items() const
+{
+  return myButtons.keys();
+}
+
+/*!
+  \brief Set color value to the item
+  \param id item identifier (Style_Model::ColorRole)
+  \param cg color group
+  \param c color value
+  \sa color()
+  \internal
+*/
+void Style_PrefDlg::PaletteEditor::setColor( int id, QPalette::ColorGroup cg, const QColor& c )
+{
+  if ( myButtons.contains( id ) ) {
+    myButtons[ id ][ cg ]->setColor( c );
+  }
+}
+
+/*!
+  \brief Set color value to the item
+  \param id item identifier (Style_Model::ColorRole)
+  \param active color to be used with active color group (QPalette::Active)
+  \param inactive color to be used with inactive color group (QPalette::Inactive)
+  \param disabled color to be used with disabled color group (QPalette::Disabled)
+  \sa color()
+  \internal
+*/
+void Style_PrefDlg::PaletteEditor::setColor( int id, const QColor& active,
+                                            const QColor& inactive, const QColor& disabled )
+{
+  setColor( id, QPalette::Active,   active );
+  setColor( id, QPalette::Inactive, inactive.isValid() ? inactive : active );
+  setColor( id, QPalette::Disabled, disabled.isValid() ? disabled : active );
+}
+
+/*!
+  \brief Get color value assigned to the item
+  \param id item identifier (Style_Model::ColorRole)
+  \param cg color group
+  \return color value
+  \sa setColor()
+  \internal
+*/
+QColor Style_PrefDlg::PaletteEditor::color( int id, QPalette::ColorGroup cg ) const
+{
+  QColor c;
+  if ( myButtons.contains( id ) ) {
+    c = myButtons[ id ][ cg ]->color();
+  }
+  return c;
+}
+
+/*!
+  \brief Get 'auto-palette' flag value
+  \return \c true if inactive/disabled palette colors should be calculated from active one
+  \sa setAuto()
+  \internal
+*/
+bool Style_PrefDlg::PaletteEditor::isAuto() const
+{
+  return myAutoCheck->isChecked();
+}
+
+/*!
+  \brief Set/clear 'auto-palette' flag value
+  \param on if \c true, inactive/disabled palette colors should be calculated from active one
+  \sa isAuto()
+  \internal
+*/
+void Style_PrefDlg::PaletteEditor::setAuto( bool on )
+{
+  myAutoCheck->setChecked( on );
+}
+
+/*!
+  \brief Initialize all palette colors from color \a c
+  \param c button color value
+  \internal
+*/
+void Style_PrefDlg::PaletteEditor::fromColor( const QColor& c )
+{
+  const QPalette pal = QPalette( c );
+  for ( int i = 0; i < (int)Style_Model::NColorRoles; i++ ) {
+    setColor( i,
+             pal.color( QPalette::Active,   (QPalette::ColorRole)i ), 
+             pal.color( QPalette::Inactive, (QPalette::ColorRole)i ),
+             pal.color( QPalette::Disabled, (QPalette::ColorRole)i ) );
+  }
+
+  // Header
+  setColor( Style_Model::Header,
+           pal.color( QPalette::Active,   QPalette::Button ), 
+           pal.color( QPalette::Inactive, QPalette::Button ),
+           pal.color( QPalette::Disabled, QPalette::Button ) );
+  // Checked
+  setColor( Style_Model::Checked,
+           pal.color( QPalette::Active,   QPalette::Base ),
+           pal.color( QPalette::Inactive, QPalette::Base ),
+           pal.color( QPalette::Disabled, QPalette::Base ) );
+  // Lines
+  setColor( Style_Model::Lines,
+           pal.color( QPalette::Active,   QPalette::Mid ),
+           pal.color( QPalette::Inactive, QPalette::Mid ),
+           pal.color( QPalette::Disabled, QPalette::Mid ) );
+  // Slider
+  setColor( Style_Model::Slider,
+           pal.color( QPalette::Active,   QPalette::Button ),
+           pal.color( QPalette::Inactive, QPalette::Button ),
+           pal.color( QPalette::Disabled, QPalette::Button ) );
+  // ProgressBar
+  setColor( Style_Model::ProgressBar,
+           pal.color( QPalette::Active,   QPalette::Highlight ),
+           pal.color( QPalette::Inactive, QPalette::Highlight ),
+           pal.color( QPalette::Disabled, QPalette::Highlight ) );
+  // FieldLight
+  setColor( Style_Model::FieldLight,
+           pal.color( QPalette::Active,   QPalette::Light ),
+           pal.color( QPalette::Inactive, QPalette::Light ),
+           pal.color( QPalette::Disabled, QPalette::Light ) );
+  // FieldDark
+  setColor( Style_Model::FieldDark,
+           pal.color( QPalette::Active,   QPalette::Mid ).light( 125 ),
+           pal.color( QPalette::Inactive, QPalette::Mid ).light( 125 ),
+           pal.color( QPalette::Disabled, QPalette::Mid ).light( 125 ) );
+  // GridLine
+  setColor( Style_Model::GridLine,
+           pal.color( QPalette::Active,   QPalette::Mid ),
+           pal.color( QPalette::Inactive, QPalette::Mid ),
+           pal.color( QPalette::Disabled, QPalette::Mid ) );
+  // HighlightWidget
+  setColor( Style_Model::HighlightWidget,
+           pal.color( QPalette::Active,   QPalette::Button ),
+           pal.color( QPalette::Inactive, QPalette::Button ),
+           pal.color( QPalette::Disabled, QPalette::Button ) );
+  // HighlightWidget
+  setColor( Style_Model::HighlightBorder,
+           pal.color( QPalette::Active,   QPalette::Button ).dark( 100 ),
+           pal.color( QPalette::Inactive, QPalette::Button ).dark( 100 ),
+           pal.color( QPalette::Disabled, QPalette::Button ).dark( 100 ) );
+  // Pointer
+  setColor( Style_Model::Pointer, Qt::black, Qt::black, Qt::black );
+
+  QColor aDarkActive   = pal.color( QPalette::Active,   QPalette::Dark );
+  QColor aDarkInactive = pal.color( QPalette::Inactive, QPalette::Dark );
+  QColor aDarkDisabled = pal.color( QPalette::Disabled, QPalette::Dark );
+
+  // BorderTop
+  setColor( Style_Model::BorderTop,
+           aDarkActive.lighter(),
+           aDarkInactive.lighter(),
+           aDarkDisabled.lighter() );
+  // BorderBottom
+  setColor( Style_Model::BorderBottom,
+           aDarkActive.darker(),
+           aDarkInactive.darker(),
+           aDarkDisabled.darker() );
+  // TabBorderTop
+  setColor( Style_Model::TabBorderTop,
+           aDarkActive.light().light().light(),
+           aDarkInactive.light().light().light(), 
+           aDarkDisabled.light().light().light() );
+  // TabBorderBottom
+  setColor( Style_Model::TabBorderBottom,
+           aDarkActive.dark().dark().dark(),
+           aDarkInactive.dark().dark().dark(),
+           aDarkDisabled.dark().dark().dark() );
+}
+
+/*!
+  \brief Get title of the item
+  \param id item identifier (Style_Model::ColorRole)
+  \return item title
+  \internal
+*/
+QString Style_PrefDlg::PaletteEditor::idToName( int id )
+{
+  QString name;
+  switch ( id ) {
+  case Style_Model::WindowText:        //  0
+    name = tr( "Window text" ); break;
+  case Style_Model::Button:            //  1
+    name = tr( "Button" ); break;
+  case Style_Model::Light:             //  2
+    name = tr( "Light" ); break;
+  case Style_Model::Midlight:          //  3
+    name = tr( "Midlight" ); break;
+  case Style_Model::Dark:              //  4
+    name = tr( "Dark" ); break;
+  case Style_Model::Mid:               //  5
+    name = tr( "Mid" );             break;
+  case Style_Model::Text:              //  6
+    name = tr( "Text" );             break;
+  case Style_Model::BrightText:        //  7
+    name = tr( "Bright text" );      break;
+  case Style_Model::ButtonText:        //  8
+    name = tr( "Buttont text" );      break;
+  case Style_Model::Base:              //  9
+    name = tr( "Base" );             break;
+  case Style_Model::Window:            // 10
+    name = tr( "Window" );           break;
+  case Style_Model::Shadow:            // 11
+    name = tr( "Shadow" );           break;
+  case Style_Model::Highlight:         // 12
+    name = tr( "Highlight" );        break;
+  case Style_Model::HighlightedText:   // 13
+    name = tr( "Highlighted text" ); break;
+  case Style_Model::Link:              // 14
+    name = tr( "Link" );             break;
+  case Style_Model::LinkVisited:       // 15
+    name = tr( "Visited link" );     break;
+  case Style_Model::AlternateBase:     // 16
+    name = tr( "Alternate base" );   break;
+  case Style_Model::ToolTipBase:       // 18
+    name = tr( "Tooltip base" );    break;
+  case Style_Model::ToolTipText:       // 19
+    name = tr( "Tooltip text" );    break;
+  case Style_Model::BorderTop:
+    name = tr( "Border top" ); break;
+  case Style_Model::BorderBottom:
+    name = tr( "Border bottom" ); break;
+  case Style_Model::TabBorderTop:
+    name = tr( "Tab border top" ); break;
+  case Style_Model::TabBorderBottom:
+    name = tr( "Tab border bottom" ); break;
+  case Style_Model::FieldLight:
+    name = tr( "Field light" ); break;
+  case Style_Model::FieldDark:
+    name = tr( "Field dark" ); break;
+  case Style_Model::Slider:
+    name = tr( "Slider" ); break;
+  case Style_Model::Lines:
+    name = tr( "Lines" ); break;
+  case Style_Model::HighlightWidget:
+    name = tr( "Widget center" ); break;
+  case Style_Model::HighlightBorder:
+    name = tr( "Widget border" ); break;
+  case Style_Model::Header:
+    name = tr( "Header" ); break;
+  case Style_Model::ProgressBar:
+    name = tr( "Progress bar" ); break;
+  case Style_Model::Pointer:
+    name = tr( "Pointer" ); break;
+  case Style_Model::Checked:
+    name = tr( "Checked" ); break;
+  case Style_Model::GridLine:
+    name = tr( "Table grid" ); break;
+  default:
+    break;
+  }
+  return name;
+}
+
+/*!
+  \brief Create horizontal line widget
+  \return new line widget
+  \internal
+*/
+QWidget* Style_PrefDlg::PaletteEditor::line()
+{
+  QFrame* hline = new QFrame( myContainer );
+  hline->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+  return hline;
+}
+
+/*!
+  \brief Called when "Quick" button is clicked
+  \internal
+*/
+void Style_PrefDlg::PaletteEditor::onQuick()
+{
+  static QColor lastColor = Qt::white;
+  QColor c = QColorDialog::getColor( lastColor, this );
+  if ( c.isValid() ) {
+    fromColor( lastColor = c );
+    emit( changed() );
+  }
+}
+
+/*!
+  \brief Called when "Auto" check box is clicked
+  \internal
+*/
+void Style_PrefDlg::PaletteEditor::onAuto()
+{
+  foreach( Btns btn, myButtons ) {
+    btn[ QPalette::Inactive ]->setEnabled( !myAutoCheck->isChecked() );
+    btn[ QPalette::Disabled ]->setEnabled( !myAutoCheck->isChecked() );
+  }
+  emit( changed() );
+}
+
+/*!
+  \class Style_PrefDlg
+  \brief SALOME style prefences dialog box class.
+
+  The dialog box lists all SALOME style themes available via the application and allows
+  user to create own schemas.
+*/
+
+/*!
+  \brief Constructor
+  \param parent parent widget
+*/
+Style_PrefDlg::Style_PrefDlg( QWidget* parent )
+  : QtxDialog( parent, true, true, OK | Close | Apply ),
+    myResMgr( 0 )
+{
+  // set title
+  setWindowTitle( tr( "SALOME style preferences" ) );
+
+  // create main layout
+  QVBoxLayout* main = new QVBoxLayout( mainFrame() );
+  main->setMargin( 0 ); main->setSpacing( SPACING );
+
+  // create main widgets
+  myStyleCheck = new QCheckBox( tr( "Use SALOME Style" ), this );
+  QFrame* fr = new QFrame( this );
+  fr->setFrameStyle( QFrame::Box | QFrame::Sunken );
+
+  main->addWidget( myStyleCheck );
+  main->addWidget( fr );
+
+  // create editor widgets
+  myStylesList = new QListWidget( fr );
+  myStylesTab  = new QTabWidget( fr );
+
+  QHBoxLayout* frLayout = new QHBoxLayout( fr );
+  frLayout->setMargin( MARGIN ); frLayout->setSpacing( SPACING );
+  frLayout->addWidget( myStylesList );
+  frLayout->addWidget( myStylesTab );
+  frLayout->setStretchFactor( myStylesList, 1 );
+  frLayout->setStretchFactor( myStylesTab, 2 );
+
+  // ...
+  QWidget* w1 = new QWidget( myStylesTab );
+  QVBoxLayout* vLayout = new QVBoxLayout( w1 );
+  vLayout->setMargin( 0 ); vLayout->setSpacing( SPACING );
+
+  myPaletteEditor = new PaletteEditor( w1 );
+  vLayout->addWidget( myPaletteEditor );
+  vLayout->addStretch();
+
+  // ...
+  QWidget* w2 = new QWidget( myStylesTab );
+  vLayout = new QVBoxLayout( w2 );
+  vLayout->setMargin( MARGIN ); vLayout->setSpacing( SPACING );
+
+  QGroupBox* fontGroup = new QGroupBox( tr( "Font" ), w2 );
+  myFontEdit = new QtxFontEdit( fontGroup );
+
+  QHBoxLayout* fontLayout = new QHBoxLayout( fontGroup );
+  fontLayout->setMargin( MARGIN ); fontLayout->setSpacing( SPACING );
+  fontLayout->addWidget( myFontEdit );
+
+  QGroupBox* linesGroup = new QGroupBox( tr( "Lines" ), w2 );
+  QLabel* linesTypeLab = new QLabel( tr( "Type" ), linesGroup );
+  myLinesCombo  = new QComboBox( linesGroup );
+  myLinesCombo->addItem( tr( "None" ),       Style_Model::NoLines );
+  myLinesCombo->addItem( tr( "Horizontal" ), Style_Model::Horizontal );
+  myLinesCombo->addItem( tr( "Inclined" ),   Style_Model::Inclined );
+  QLabel* linesTranspLab = new QLabel( tr( "Transparency" ), linesGroup );
+  myLinesTransparency = new QSlider( Qt::Horizontal, linesGroup );
+  myLinesTransparency->setMinimum( 0 );
+  myLinesTransparency->setMaximum( 100 );
+  myLinesTransparency->setSingleStep( 1 );
+  myLinesTransparency->setTracking( false );
+
+  QHBoxLayout* linesLayout = new QHBoxLayout( linesGroup );
+  linesLayout->setMargin( MARGIN ); linesLayout->setSpacing( SPACING );
+  linesLayout->addWidget( linesTypeLab );
+  linesLayout->addWidget( myLinesCombo );
+  linesLayout->addWidget( linesTranspLab );
+  linesLayout->addWidget( myLinesTransparency );
+
+  QGroupBox* roundGroup = new QGroupBox( tr( "Widgets rounding" ), w2 );
+  QLabel* roundButtonLab = new QLabel( tr( "Buttons" ), roundGroup );
+  myButtonRound = new QtxDoubleSpinBox( roundGroup );
+  QLabel* roundEditLab = new QLabel( tr( "Edit boxes" ), roundGroup );
+  myEditRound = new QtxDoubleSpinBox( roundGroup );
+  QLabel* roundFrameLab = new QLabel( tr( "Frames" ), roundGroup );
+  myFrameRound = new QtxDoubleSpinBox( roundGroup );
+  QLabel* roundSliderLab = new QLabel( tr( "Sliders" ), roundGroup );
+  mySliderRound = new QtxDoubleSpinBox( roundGroup );
+  myAntiAliasing = new QCheckBox( tr( "Anti-aliased borders" ), roundGroup );
+
+  QGridLayout* roundLayout = new QGridLayout( roundGroup );
+  roundLayout->setMargin( MARGIN ); roundLayout->setSpacing( SPACING );
+  roundLayout->addWidget( roundButtonLab, 0, 0 );
+  roundLayout->addWidget( myButtonRound,  0, 1 );
+  roundLayout->addWidget( roundEditLab,   0, 2 );
+  roundLayout->addWidget( myEditRound,    0, 3 );
+  roundLayout->addWidget( roundFrameLab,  1, 0 );
+  roundLayout->addWidget( myFrameRound,   1, 1 );
+  roundLayout->addWidget( roundSliderLab, 1, 2 );
+  roundLayout->addWidget( mySliderRound,  1, 3 );
+  roundLayout->addWidget( myAntiAliasing, 2, 0, 1, 4 );
+  
+  QGroupBox* handleGroup       = new QGroupBox( tr( "Handle" ), w2 );
+  QLabel*    horHandleLab      = new QLabel( tr( "Horizontal spacing" ), handleGroup );
+  myHorHandleDelta  = new QSpinBox( handleGroup );
+  QLabel*    verHandleLab      = new QLabel( tr( "Vertical spacing" ), handleGroup );
+  myVerHandleDelta  = new QSpinBox( handleGroup );
+  QLabel*    splitterLengthLab = new QLabel( tr( "Splitter handle size" ), handleGroup );
+  mySplitterLength  = new QSpinBox( handleGroup );
+  QLabel*    sliderLengthLab   = new QLabel( tr( "Slider handle size" ), handleGroup );
+  mySliderSize      = new QSpinBox( handleGroup );
+  
+  QGridLayout* handleLayout = new QGridLayout( handleGroup );
+  handleLayout->setMargin( MARGIN ); handleLayout->setSpacing( SPACING );
+  handleLayout->addWidget( horHandleLab,      0, 0 );
+  handleLayout->addWidget( myHorHandleDelta,  0, 1 );
+  handleLayout->addWidget( verHandleLab,      0, 2);
+  handleLayout->addWidget( myVerHandleDelta,  0, 3 );
+  handleLayout->addWidget( splitterLengthLab, 1, 0 );
+  handleLayout->addWidget( mySplitterLength,  1, 1 );
+  handleLayout->addWidget( sliderLengthLab,   1, 2 );
+  handleLayout->addWidget( mySliderSize,      1, 3 );
+
+  QGroupBox* effectGroup = new QGroupBox( tr( "Widget effect" ), w2 );
+  myEffectNone      = new QRadioButton( tr( "None" ),               effectGroup );
+  myEffectHighlight = new QRadioButton( tr( "Highlight widgets" ),  effectGroup );
+  myEffectAutoRaise = new QRadioButton( tr( "Auto raise widgets" ), effectGroup );
+  QButtonGroup* aGroup = new QButtonGroup( w2 );
+  aGroup->addButton( myEffectNone );
+  aGroup->addButton( myEffectHighlight );
+  aGroup->addButton( myEffectAutoRaise );
+  myEffectNone->setChecked( true );
+  myCurrentEffect = myEffectNone;
+
+  QHBoxLayout* effectLayout = new QHBoxLayout( effectGroup );
+  effectLayout->setMargin( MARGIN ); effectLayout->setSpacing( SPACING );
+  effectLayout->addWidget( myEffectNone );
+  effectLayout->addWidget( myEffectHighlight );
+  effectLayout->addWidget( myEffectAutoRaise );
+
+  vLayout->addWidget( fontGroup );
+  vLayout->addWidget( linesGroup );
+  vLayout->addWidget( roundGroup );
+  vLayout->addWidget( handleGroup );
+  vLayout->addWidget( effectGroup );
+  vLayout->addStretch();
+
+  // ...
+  myStylesTab->addTab( w1, tr( "Colors" )  );
+  myStylesTab->addTab( w2, tr( "Properties" )  );
+
+  // initialize dialog box
+  setFocusProxy( fr );
+  setButtonPosition( Right, Close );
+  setDialogFlags( AlignOnce );
+  myStylesList->setEditTriggers( QAbstractItemView::EditKeyPressed );
+
+  QStringList globalStyles = resourceMgr()->styles( Style_ResourceMgr::Global );
+  QStringList userStyles   = resourceMgr()->styles( Style_ResourceMgr::User );
+
+  QListWidgetItem* item;
+
+  // current style
+  item = new QListWidgetItem( tr( "[ Current ]" ) );
+  item->setForeground( QColor( Qt::red ) );
+  item->setData( TypeRole, QVariant( Current ) );
+  myStylesList->addItem( item );
+  // default style
+  item = new QListWidgetItem( tr( "[ Default ]" ) );
+  item->setForeground( QColor( Qt::green ) );
+  item->setData( TypeRole, QVariant( Default ) );
+  myStylesList->addItem( item );
+  // global styles
+  foreach ( QString sname, globalStyles ) {
+    item = new QListWidgetItem( sname );
+    item->setForeground( QColor( Qt::blue ) );
+    item->setData( TypeRole, QVariant( Global ) );
+    item->setData( NameRole, QVariant( sname ) );
+    myStylesList->addItem( item );
+  }
+  // user styles
+  foreach ( QString sname, userStyles ) {
+    item = new QListWidgetItem( sname );
+    item->setData( TypeRole, QVariant( User ) );
+    item->setData( NameRole, QVariant( sname ) );
+    item->setFlags( item->flags() | Qt::ItemIsEditable );
+    myStylesList->addItem( item );
+  }
+  
+  // connect widgets
+  connect( myStyleCheck,        SIGNAL( toggled( bool ) ),        fr,   SLOT( setEnabled( bool ) ) );
+  connect( myStylesList,        SIGNAL( itemSelectionChanged() ), this, SLOT( onStyleChanged() ) );
+  connect( myStylesList,        SIGNAL( itemChanged( QListWidgetItem* ) ),       
+          this, SLOT( onItemChanged( QListWidgetItem* ) ) );
+  connect( myStylesList,        SIGNAL( itemDoubleClicked( QListWidgetItem* ) ), 
+          this, SLOT( onApply() ) );
+  connect( myLinesCombo,        SIGNAL( activated( int ) ),       this, SLOT( onLinesType() ) );
+  connect( myPaletteEditor,     SIGNAL( changed() ),              this, SIGNAL( styleChanged() ) );
+  connect( myFontEdit,          SIGNAL( changed( QFont ) ),       this, SIGNAL( styleChanged() ) );
+  connect( myLinesTransparency, SIGNAL( valueChanged( int ) ),    this, SIGNAL( styleChanged() ) );
+  connect( myButtonRound,       SIGNAL( valueChanged( double ) ), this, SIGNAL( styleChanged() ) );
+  connect( myEditRound,         SIGNAL( valueChanged( double ) ), this, SIGNAL( styleChanged() ) );
+  connect( myFrameRound,        SIGNAL( valueChanged( double ) ), this, SIGNAL( styleChanged() ) );
+  connect( mySliderRound,       SIGNAL( valueChanged( double ) ), this, SIGNAL( styleChanged() ) );
+  connect( myAntiAliasing,      SIGNAL( toggled( bool ) ),        this, SIGNAL( styleChanged() ) );
+  connect( myHorHandleDelta,    SIGNAL( valueChanged( int ) ),    this, SIGNAL( styleChanged() ) );
+  connect( myVerHandleDelta,    SIGNAL( valueChanged( int ) ),    this, SIGNAL( styleChanged() ) );
+  connect( mySplitterLength,    SIGNAL( valueChanged( int ) ),    this, SIGNAL( styleChanged() ) );
+  connect( mySliderSize,        SIGNAL( valueChanged( int ) ),    this, SIGNAL( styleChanged() ) );
+  connect( aGroup,              SIGNAL( buttonClicked( QAbstractButton* ) ),
+          this, SLOT( onEffectChanged( QAbstractButton* ) ) );
+  connect( this,                SIGNAL( styleChanged() ),         this, SLOT( onChanged() ) );
+  
+  connect( this, SIGNAL( dlgApply() ), this, SLOT( onApply() ) );
+  connect( this, SIGNAL( dlgHelp() ),  this, SLOT( onHelp() ) );
+
+  myStylesList->setCurrentRow( 0 );
+  
+  myStyleCheck->setChecked( Style_Salome::isActive() );
+  fr->setEnabled( Style_Salome::isActive() );
+}
+
+/*!
+  \brief Destructor
+*/
+Style_PrefDlg::~Style_PrefDlg()
+{
+}
+
+/*!
+  \brief Called when "OK" button is clicked
+*/
+void Style_PrefDlg::accept()
+{
+  onApply();
+  QtxDialog::accept();
+}
+
+/*!
+  \brief Process key press event
+  \param e key event
+*/
+void Style_PrefDlg::keyPressEvent( QKeyEvent* e )
+{
+  if ( e->key() == Qt::Key_Delete ) {
+    QListWidgetItem* item = myStylesList->currentItem();
+    if ( item && item->data( TypeRole ).toInt() == User ) {
+      if ( QMessageBox::question( this,
+                                 tr( "Delete user theme" ),
+                                 tr( "Remove theme %1?" ).arg( item->text() ),
+                                 QMessageBox::Yes | QMessageBox::No,
+                                 QMessageBox::Yes ) == QMessageBox::Yes ) {
+       resourceMgr()->remove( item->data( NameRole ).toString() );
+       resourceMgr()->save();
+       delete item;
+      }
+    }
+  }
+  QtxDialog::keyPressEvent( e );
+}
+
+/*!
+  \brief Get SALOME themes resource manager
+  \return themes resource manager
+*/
+Style_ResourceMgr* Style_PrefDlg::resourceMgr()
+{
+  if ( !myResMgr )
+    myResMgr = new Style_ResourceMgr();
+  return myResMgr;
+}
+
+/*!
+  \brief Initialize dialog box fields from SALOME style model
+  \param model style model
+*/
+void Style_PrefDlg::fromModel( Style_Model* model )
+{
+  if ( !model ) return;
+  
+  // colors
+  for ( int i = (int)Style_Model::WindowText; i < (int)Style_Model::LastColor; i++ ) {
+    if ( i == Style_Model::NoRole ) continue;
+    myPaletteEditor->setColor( i, QPalette::Active,   model->color( (Style_Model::ColorRole)i, QPalette::Active ) );
+    myPaletteEditor->setColor( i, QPalette::Inactive, model->color( (Style_Model::ColorRole)i, QPalette::Inactive ) );
+    myPaletteEditor->setColor( i, QPalette::Disabled, model->color( (Style_Model::ColorRole)i, QPalette::Disabled ) );
+  }
+  myPaletteEditor->setAuto( model->isAutoPalette() );
+  // font
+  myFontEdit->setCurrentFont( model->applicationFont() );
+  // lines type
+  int idx = myLinesCombo->findData( QVariant( model->linesType() ) );
+  if ( idx >= 0 ) myLinesCombo->setCurrentIndex( idx );
+  // lines transparency
+  myLinesTransparency->setValue( model->linesTransparency() );
+  // widgets rounding
+  myButtonRound->setValue( model->widgetRounding( Style_Model::ButtonRadius ) );
+  myEditRound->setValue( model->widgetRounding( Style_Model::EditRadius ) );
+  myFrameRound->setValue( model->widgetRounding( Style_Model::FrameRadius ) );
+  mySliderRound->setValue( model->widgetRounding( Style_Model::SliderRadius ) );
+  // widgets antialiasing
+  myAntiAliasing->setChecked( model->antialiasing() );
+  // handle delta
+  myHorHandleDelta->setValue( model->handleDelta( Qt::Horizontal ) );
+  myVerHandleDelta->setValue( model->handleDelta( Qt::Vertical ) );
+  // splitter handle lentgh
+  mySplitterLength->setValue( model->splitHandleLength() );
+  // slider size
+  mySliderSize->setValue( model->sliderSize() );
+  // widgets effect
+  Style_Model::WidgetEffect we = model->widgetEffect();
+  if ( we == Style_Model::HighlightEffect ) myEffectHighlight->setChecked( true );
+  else if ( we == Style_Model::AutoRaiseEffect ) myEffectAutoRaise->setChecked( true );
+  else myEffectNone->setChecked( true );
+}
+/*!
+  \brief Save values from dialog box fields to SALOME style model
+  \param model style model
+*/
+void Style_PrefDlg::toModel( Style_Model* model ) const
+{
+  if ( !model ) return;
+  
+  // colors
+  // ... first set Button color 'cause it is used to calculate other ones
+  if ( myPaletteEditor->isAuto() )
+    model->setColor( Style_Model::Button,
+                    myPaletteEditor->color( Style_Model::Button, QPalette::Active ) );
+  else 
+    model->setColor( Style_Model::Button,
+                    myPaletteEditor->color( Style_Model::Button, QPalette::Active ),
+                    myPaletteEditor->color( Style_Model::Button, QPalette::Inactive ),
+                    myPaletteEditor->color( Style_Model::Button, QPalette::Disabled ));
+  // ... then set all other colors
+  for ( int i = (int)Style_Model::WindowText; i < (int)Style_Model::LastColor; i++ ) {
+    if ( i == Style_Model::NoRole ) continue; // not supported
+    if ( i == Style_Model::Button ) continue; // already set
+    if ( myPaletteEditor->isAuto() )
+      model->setColor( (Style_Model::ColorRole)i,
+                      myPaletteEditor->color( i, QPalette::Active ) );
+    else 
+      model->setColor( (Style_Model::ColorRole)i,
+                      myPaletteEditor->color( i, QPalette::Active ),
+                      myPaletteEditor->color( i, QPalette::Inactive ),
+                      myPaletteEditor->color( i, QPalette::Disabled ));
+  }
+  model->setAutoPalette( myPaletteEditor->isAuto() ); // internal
+  // font
+  model->setApplicationFont( myFontEdit->currentFont() );
+  // lines type
+  model->setLinesType( (Style_Model::LineType)myLinesCombo->itemData( myLinesCombo->currentIndex() ).toInt() );
+  // lines transparency
+  model->setLinesTransparency( myLinesTransparency->value() );
+  // widgets rounding
+  model->setWidgetRounding( Style_Model::ButtonRadius, myButtonRound->value() );
+  model->setWidgetRounding( Style_Model::EditRadius,   myEditRound->value() );
+  model->setWidgetRounding( Style_Model::FrameRadius,  myFrameRound->value() );
+  model->setWidgetRounding( Style_Model::SliderRadius, mySliderRound->value() );
+  // widgets antialiasing
+  model->setAntialiasing( myAntiAliasing->isChecked() );
+  // handle delta
+  model->setHandleDelta( Qt::Horizontal, myHorHandleDelta->value() );
+  model->setHandleDelta( Qt::Vertical,   myVerHandleDelta->value() );
+  // splitter handle lentgh
+  model->setSplitHandleLength( mySplitterLength->value() );
+  // slider size
+  model->setSliderSize( mySliderSize->value() );
+  // widgets effect
+  if      ( myEffectHighlight->isChecked() ) model->setWidgetEffect( Style_Model::HighlightEffect );
+  else if ( myEffectAutoRaise->isChecked() ) model->setWidgetEffect( Style_Model::AutoRaiseEffect );
+  else                                       model->setWidgetEffect( Style_Model::NoEffect );
+}
+
+/*!
+  \brief Find unique name for the theme name
+  \param name theme name template
+  \param item if not 0, used to be ignored when browsing through items list
+  \param addSuffix if \c true, the integrer suffix is always added to the theme name (otherwise
+  suffix is added only if item name is not unique)
+  \return new unique theme name
+*/
+QString Style_PrefDlg::findUniqueName( const QString& name, QListWidgetItem* item, bool addSuffix )
+{
+  bool found = false;
+  int idx = 0;
+  for( int i = 2; i < myStylesList->count(); i++ ) {
+    if ( item == myStylesList->item( i ) ) continue;
+    QString iname = myStylesList->item( i )->text();
+    if ( iname == name ) {
+      found = true;
+    }
+    else {
+      iname = iname.mid( name.length() ).trimmed();
+      bool ok = false;
+      int nx = iname.toInt( &ok );
+      if ( ok ) idx = qMax( idx, nx );
+    }
+  }
+  return found || addSuffix ? QString( "%1 %2" ).arg( name ).arg( idx+1 ) : name;
+}
+
+/*!
+  \brief Called when "Apply" button is pressed
+*/
+void Style_PrefDlg::onApply()
+{
+  // save user schemas
+  resourceMgr()->save();
+  // set selected schema as current
+  if ( myStylesList->currentRow() >= 0 ) {
+    Style_Model* model = Style_Salome::model();
+    toModel( model );
+    model->save();
+    Style_Salome::update();
+    if ( myStyleCheck->isChecked() )
+      Style_Salome::apply();
+    else
+      Style_Salome::restore();
+  }
+}
+
+/*!
+  \brief Called when "Help" button is pressed
+*/
+void Style_PrefDlg::onHelp()
+{
+}
+
+/*!
+  \brief Called when user selects any theme item in the themes list
+*/
+void Style_PrefDlg::onStyleChanged()
+{
+  blockSignals( true );
+
+  QListWidgetItem* item = myStylesList->currentItem();
+  int type = item->data( TypeRole ).toInt();
+
+  Style_Model* model = 0;
+
+  switch ( type ) {
+  case Current:
+    // current style
+    model = Style_Salome::model();
+    break;
+  case Default:
+    // default style
+    model = new Style_Model();
+    break;
+  case Global:
+  case User:
+    // global style, user style
+    model = new Style_Model();
+    model->fromResources( resourceMgr(), item->data( NameRole ).toString() );
+    break;
+  default:
+    break;
+  }
+
+  fromModel( model );
+  if ( type != Current )
+    delete model;
+
+  onLinesType();
+
+  blockSignals( false );
+}
+
+/*!
+  \brief Called when lines type is changed
+*/
+void Style_PrefDlg::onLinesType()
+{
+  myLinesTransparency->setEnabled( myLinesCombo->itemData( myLinesCombo->currentIndex() ) != Style_Model::NoLines );
+  emit( styleChanged() );
+}
+
+/*!
+  \brief Called when any style parameter is changed by the user
+*/
+void Style_PrefDlg::onChanged()
+{
+  QListWidgetItem* item = myStylesList->currentItem();
+  int type = item->data( TypeRole ).toInt();
+
+  // for the current and user schemas do not perform any actions
+  if ( type == Current ) {
+    Style_Model model = *( Style_Salome::model() );
+    toModel( &model );
+    model.save();
+    blockSignals( true );
+    fromModel( &model );
+    blockSignals( false );
+  }
+  else if ( type == User ) {
+    Style_Model model;
+    toModel( &model );
+    QString oldName = item->data( NameRole ).toString(), newName = item->text();
+    if ( oldName == newName ) {
+      model.save( resourceMgr(), oldName );
+    }
+    else {
+      resourceMgr()->remove( oldName );
+      model.save( resourceMgr(), newName );
+      item->setData( NameRole, newName );
+    }
+    blockSignals( true );
+    fromModel( &model );
+    blockSignals( false );
+  }
+  else {
+    // if user tries to change global (or default) schema, we create new user schema basing on selected one
+    QString newName = findUniqueName( tr( "Custom schema" ), 0, true );
+    item = new QListWidgetItem( newName );
+    item->setData( TypeRole, QVariant( User ) );
+    item->setData( NameRole, QVariant( newName ) );
+    item->setFlags( item->flags() | Qt::ItemIsEditable );
+    myStylesList->addItem( item );
+    
+    Style_Model model;
+    toModel( &model );
+    model.save( resourceMgr(), newName );
+    
+    myStylesList->setCurrentItem( item );
+  }
+}
+
+/*!
+  \brief Called when user theme is renamed by the user
+*/
+void Style_PrefDlg::onItemChanged( QListWidgetItem* item )
+{
+  QString newName = item->text();
+  QString uniqueName = findUniqueName( newName, item );
+  if ( uniqueName != newName ) {
+    myStylesList->blockSignals( true );
+    item->setText( uniqueName );
+    myStylesList->blockSignals( false );
+  }
+  onChanged();
+}                              
+
+/*!
+  \brief Called when widget effect is changed
+*/
+void Style_PrefDlg::onEffectChanged( QAbstractButton* rb )
+{
+  if ( rb != myCurrentEffect )
+    emit( styleChanged() );
+  myCurrentEffect = qobject_cast<QRadioButton*>( rb );
+}
diff --git a/src/Style/Style_PrefDlg.h b/src/Style/Style_PrefDlg.h
new file mode 100644 (file)
index 0000000..d96a4f0
--- /dev/null
@@ -0,0 +1,162 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Style_PrefDlg.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
+//
+#ifndef STYLE_PREFDLG_H
+#define STYLE_PREFDLG_H
+
+#include "Style.h"
+
+#include <QtxDialog.h>
+#include <QFrame>
+#include <QMap>
+
+class QCheckBox;
+class QComboBox;
+class QLabel;
+class QListWidget;
+class QListWidgetItem;
+class QPushButton;
+class QRadioButton;
+class QSlider;
+class QSpinBox;
+class QTabWidget;
+class QtxColorButton;
+class QtxDoubleSpinBox;
+class QtxFontEdit;
+class Style_ResourceMgr;
+class Style_Model;
+
+class STYLE_SALOME_EXPORT Style_PrefDlg : public QtxDialog
+{
+  Q_OBJECT
+
+  class PaletteEditor;
+  enum { Current, Default, Global, User };
+  enum { TypeRole = Qt::UserRole + 123, NameRole  };
+
+public:
+  Style_PrefDlg( QWidget* = 0 );
+  ~Style_PrefDlg();
+
+  void               accept();
+
+protected:
+  void               keyPressEvent( QKeyEvent* );
+
+private:
+  Style_ResourceMgr* resourceMgr();
+  void               fromModel( Style_Model* );
+  void               toModel( Style_Model* ) const;
+  
+  QString            findUniqueName( const QString&, QListWidgetItem* = 0, bool = false );
+
+signals:
+  void               styleChanged();
+
+private slots:
+  void               onApply();
+  void               onHelp();
+
+  void               onStyleChanged();
+  void               onLinesType();
+  void               onChanged();
+  void               onItemChanged( QListWidgetItem* );
+  void               onEffectChanged( QAbstractButton* );
+
+private:
+  Style_ResourceMgr* myResMgr;
+  QCheckBox*         myStyleCheck;
+  QListWidget*       myStylesList;
+  QTabWidget*        myStylesTab;
+
+  PaletteEditor*     myPaletteEditor;
+  QtxFontEdit*       myFontEdit;
+  QComboBox*         myLinesCombo;
+  QSlider*           myLinesTransparency;
+  QtxDoubleSpinBox*  myEditRound;
+  QtxDoubleSpinBox*  myButtonRound;
+  QtxDoubleSpinBox*  myFrameRound;
+  QtxDoubleSpinBox*  mySliderRound;
+  QCheckBox*         myAntiAliasing;
+  QSpinBox*          myHorHandleDelta;
+  QSpinBox*          myVerHandleDelta;
+  QSpinBox*          mySplitterLength;
+  QSpinBox*          mySliderSize;
+  QRadioButton*      myEffectNone;
+  QRadioButton*      myEffectHighlight;
+  QRadioButton*      myEffectAutoRaise;
+
+  QRadioButton*      myCurrentEffect;
+};
+
+class Style_PrefDlg::PaletteEditor : public QFrame
+{
+  Q_OBJECT
+
+public:
+  PaletteEditor( QWidget* = 0 );
+  ~PaletteEditor();
+  void               addColumn( const QString& );
+  void               addItem( int );
+  QList<int>         items() const;
+
+  void               setColor( int, QPalette::ColorGroup, const QColor& );
+  void               setColor( int, const QColor&, const QColor& = QColor(), const QColor& = QColor() );
+  QColor             color( int, QPalette::ColorGroup ) const;
+
+  bool               isAuto() const;
+  void               setAuto( bool );
+
+  void               fromColor( const QColor& );
+
+private:
+  static QString     idToName( int );
+  QWidget*           line();
+
+private slots:
+  void               onQuick();
+  void               onAuto();
+
+signals:
+  void               changed();
+
+private:
+  typedef QMap<QPalette::ColorGroup, QtxColorButton*> Btns;
+
+  QFrame*            myContainer;
+  QPushButton*       myQuickButton;
+  QCheckBox*         myAutoCheck;
+  QLabel*            myActiveLab;
+  QLabel*            myInactiveLab;
+  QLabel*            myDisabledLab;
+
+  QMap<int, Btns>    myButtons;
+  int                myCurrentRow;
+  int                myCurrentColumn;
+
+  friend class Style_PrefDlg;
+};
+
+#endif // STYLE_PREFDLG_H
diff --git a/src/Style/Style_ResourceMgr.cxx b/src/Style/Style_ResourceMgr.cxx
new file mode 100644 (file)
index 0000000..597e99d
--- /dev/null
@@ -0,0 +1,103 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Style_ResourceMgr.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
+//
+#include "Style_ResourceMgr.h"
+
+/*!
+  \class Style_ResourceMgr
+  \brief SALOME style resources manager.
+
+  This class is used to manage the SALOME style themes throughout the application
+  in the similar way as QtxResourceMgr does it with application preferences.
+
+  Standard SALOME themes are stored in the global application settings files
+  (named as SalomeStyle.xml). User-defined themes are stored in user's home
+  directory - in the file .SalomeStylerc.
+
+  The Style_ResourceMgr class is used by SALOME style preferences dialog box
+  (Style_PrefDlg class).
+*/
+
+/*!
+  \brief Constructor
+*/
+Style_ResourceMgr::Style_ResourceMgr()
+  : QtxResourceMgr( "SalomeStyle", "%1Config" )
+{
+  if ( dirList().isEmpty() && ::getenv( "GUI_ROOT_DIR" ) )
+    setDirList( QStringList() << Qtx::addSlash( ::getenv( "GUI_ROOT_DIR" ) ) + "share/salome/resources/gui" );
+  setCurrentFormat( "xml" );
+}
+
+/*!
+  \brief Destructor
+*/
+Style_ResourceMgr::~Style_ResourceMgr()
+{
+}
+
+/*!
+  \brief Get list of avaiable SALOME themes
+  \param type themes type
+  \param sort if \c true (default), returns a list of themes sorted by name
+  \return list of avaiable themes names
+*/
+QStringList Style_ResourceMgr::styles( StyleType type, bool sort )
+{
+  QStringList sl;
+  
+  WorkingMode m = workingMode();
+
+  switch ( type ) {
+  case Global:
+    setWorkingMode( IgnoreUserValues );
+    sl = sections();
+    break;
+  case User:
+    {
+      setWorkingMode( AllowUserValues );
+      sl = sections();
+      setWorkingMode( IgnoreUserValues );
+      QMutableListIterator<QString> it( sl );
+      while ( it.hasNext() ) {
+       QString s = it.next();
+       if ( hasSection( s ) ) it.remove();
+      }
+    }
+    break;
+  case All:
+    setWorkingMode( AllowUserValues );
+    sl = sections();
+    break;
+  default:
+    break;
+  }
+
+  setWorkingMode( m );
+
+  if ( sort )
+    qSort( sl );
+
+  return sl;
+}
diff --git a/src/Style/Style_ResourceMgr.h b/src/Style/Style_ResourceMgr.h
new file mode 100644 (file)
index 0000000..ab2aaa2
--- /dev/null
@@ -0,0 +1,52 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Style_ResourceMgr.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
+//
+#ifndef STYLE_RESOURCEMGR_H
+#define STYLE_RESOURCEMGR_H
+
+#include "Style.h"
+
+#include <QtxResourceMgr.h>
+
+//
+// This class is private for Style package.
+// Normally it should not be exported.
+//
+class STYLE_SALOME_EXPORT Style_ResourceMgr : public QtxResourceMgr
+{
+public:
+  //! Style type
+  typedef enum {
+    Global,            //!< Global styles
+    User,              //!< User styles
+    All                //!< All style
+  } StyleType;
+
+  Style_ResourceMgr();
+  ~Style_ResourceMgr();
+
+  QStringList styles( StyleType = All, bool = true );
+};
+
+#endif // STYLE_RESOURCEMGR_H
diff --git a/src/Style/Style_Salome.cxx b/src/Style/Style_Salome.cxx
new file mode 100644 (file)
index 0000000..eeb1296
--- /dev/null
@@ -0,0 +1,2553 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Style_Salome.cxx
+// Author : Natalia Ermolaeva, Open CASCADE S.A.S.
+//
+#include "Style_Salome.h"
+#include "Style_Tools.h"
+#include "Style_Model.h"
+
+#include <QApplication>
+#include <QPainter>
+#include <QMap>
+#include <QPainterPath>
+#include <QWidget>
+#include <QComboBox>
+#include <QStyleOptionFrame>
+#include <QStyleOptionComplex>
+#include <QStyleOptionSpinBox>
+#include <QStyleOptionButton>
+#include <QStyleOptionTab>
+#include <QStyleOptionToolButton>
+#include <QStyleOptionFocusRect>
+#include <QStyleOption>
+#include <QSize>
+#include <QToolBar>
+#include <QMenuBar>
+#include <QToolButton>
+#include <QTabWidget>
+#include <QTabBar>
+#include <QToolTip>
+#include <QDockWidget>
+#include <QTextEdit>
+#include <QTreeView>
+#include <QListView>
+#include <QHeaderView>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QPushButton>
+#include <QAbstractSpinBox>
+#include <QLineEdit>
+#include <QScrollBar>
+#include <QSlider>
+#include <QMainWindow>
+#include <QPixmapCache>
+
+#include <limits.h>
+
+#define SHADOW          1
+#define LINE_GR_MARGIN  10
+#define HIGH_WDG_MARGIN 10
+
+#define BUT_PERCENT_COL 125
+#define BUT_PERCENT_ON  115
+
+#define DELTA_H_TAB     1
+#define DELTA_SLIDER    3
+
+static const char* const hole_xpm[] = {
+"3 3 3 1",
+". c None",
+"a c #999999",
+"b c #FFFFFF",
+"aa.",
+"aab",
+".bb"
+};
+
+static const char* const cross_xpm[] = {
+"12 12 4 1",
+". c None",
+"a c #000000",
+"b c #FFFFFF",
+"c c #666666",
+"............",
+"............",
+"............",
+".aaaa..aaaa.",
+"..abbaabba..",
+"...abbbba...",
+"....abba....",
+"...abbbba...",
+"..abbaabba..",
+".aaaa..aaaa.",
+"............",
+"............"
+};
+
+static const char* const maximize_xpm[] = {
+"12 12 4 1",
+". c None",
+"a c #000000",
+"b c #FFFFFF",
+"c c #666666",
+"............",
+".aaaaaaaaaa.",
+".acccccccca.",
+".acccccccca.",
+".abbbbbbbba.",
+".abbbbbbbba.",
+".abbbbbbbba.",
+".abbbbbbbba.",
+".abbbbbbbba.",
+".abbbbbbbba.",
+".aaaaaaaaaa.",
+"............"
+};
+
+static const char* const normal_xpm[] = {
+"12 12 4 1",
+". c None",
+"a c #000000",
+"b c #FFFFFF",
+"c c #666666",
+"............",
+"...aaaaaaaa.",
+"...acccccca.",
+"...abbbbbba.",
+"...aaaaaaba.",
+".aaaaaaaaba.",
+".accccccaba.",
+".abbbbbbaaa.",
+".abbbbbba...",
+".abbbbbba...",
+".aaaaaaaa...",
+"............"
+};
+
+static const char* const minimize_xpm[] = {
+"12 12 4 1",
+". c None",
+"a c #000000",
+"b c #FFFFFF",
+"c c #666666",
+"............",
+"............",
+"............",
+"............",
+"............",
+"............",
+"............",
+"............",
+"aaaaaaaaaaaa",
+"abbbbbbbbbba",
+"aaaaaaaaaaaa",
+"............"
+};
+
+///////////////////////////////////////////////////////////
+// FOR debug purposes only!!!
+//
+int DEBUG_LEVEL = 0;
+
+static bool checkDebugLevel( int level )
+{
+  return DEBUG_LEVEL == level || DEBUG_LEVEL == -1;
+}
+//
+///////////////////////////////////////////////////////////
+
+Style_Model* Style_Salome::myModel = 0;
+
+/*!
+  \class Style_Salome
+  \brief SALOME style class.
+
+  To set SALOME style to the application, use static function Style_Salome::apply().
+  Static function restore() can be used then to restore initial application style.
+
+  The usual way to use SALOME style is as following:
+  \code
+  Style_Salome::initialize( resourceMgr() );     // initialize SALOME style from resources
+  if ( needSalomeStyle ) Style_Salome::apply();  // set SALOME style to the application
+  \endcode
+
+  Style_PrefDlg class can be then used to change style properties, select one of the
+  predefined style themes or even create user themes:
+  \code
+  Style_PrefDlg dlg( desktop() );
+  dlg.exec();
+  \endcode
+*/
+
+/*!
+  \brief Constructor
+
+  Use Style_Salome::apply() static function to set SALOME style to the application.
+*/
+Style_Salome::Style_Salome()
+  : QWindowsStyle()
+{
+  // initialize SALOME style resources
+  Q_INIT_RESOURCE( Style );
+}
+
+/*!
+  \brief Destructor
+*/
+Style_Salome::~Style_Salome()
+{
+}
+
+
+/*!
+  \brief Initialize SALOME style.
+
+  This method should be called at the very beginning of the application
+  which uses SALOME style.
+  The method initializes style properties from the current settings.
+
+  If the parameter \a resMgr is not 0, the style is initialized from the
+  resources manager.
+
+  The parameter \a section allows customizing of the resources file section
+  used to store style's properties. By default "Theme" section name is used.
+
+  \param resMgr resources manager
+  \param section resources file section name
+  \sa apply(), restore()
+*/
+void Style_Salome::initialize( QtxResourceMgr* resMgr, const QString& section )
+{
+  model()->fromResources( resMgr, section );
+}
+
+/*!
+  \brief Set SALOME style to the application
+  \sa initialize(), restore()
+*/
+void Style_Salome::apply()
+{
+  // application object is not created yet
+  if ( !QApplication::instance() )
+    return;
+
+  // update model (from the resources manager if needed)
+  model()->update();
+
+  // check if SALOME style is already set to the application
+  if ( !isActive() ) {
+    // set SALOME style
+    QApplication::style()->setParent( 0 );           // avoid deleting original application style
+    QApplication::setStyle( new Style_Salome() );    // set style
+  }
+  update();                                          // update style
+}
+
+/*!
+  \brief Restore original style to the application
+  \sa initialize(), apply()
+*/
+void Style_Salome::restore()
+{
+  // application object is not created yet
+  if ( !QApplication::instance() )
+    return;
+  // check if SALOME style is set to the application
+  if ( !isActive() )
+    return;
+  // restore previous style
+  model()->restore();
+}
+
+/*!
+  \brief Check if the SALOME style is currently set to application.
+  \return \c true if SALOME style is set to the applcation or \c false otherwise
+*/
+bool Style_Salome::isActive()
+{
+  return QApplication::instance() != 0 && qobject_cast<Style_Salome*>( QApplication::style() ) != 0;
+}
+
+/*!
+  \brief Update style from resources.
+*/
+void Style_Salome::update()
+{
+  // application object is not created yet
+  if ( !QApplication::instance() )
+    return;
+  // check if SALOME style is set to the application
+  if ( Style_Salome* style = qobject_cast<Style_Salome*>( QApplication::style() ) )
+    style->polish( qobject_cast<QApplication*>( QApplication::instance() ) );
+}
+
+/*!
+  \brief Get style model
+  \return style model
+*/
+Style_Model* Style_Salome::model()
+{
+  if ( !myModel )
+    myModel = new Style_Model();
+  return myModel;
+}
+
+/*!
+  \brief Initialize the appearance of the application.
+  
+  Performs late initialization of the given application object.
+
+  \param app application object
+*/
+void Style_Salome::polish ( QApplication* app )
+{
+  QWindowsStyle::polish( app );
+
+  if ( checkDebugLevel(1) ) {
+    return;
+  }
+
+  updatePaletteColors();
+  app->setFont( model()->applicationFont() );
+  updateAllWidgets( app );
+}
+
+/*!
+  \brief Initializes the appearance of the given widget.
+
+  This function is called for every widget at some point after
+  it has been fully created but just before it is shown for the very first time.
+
+  \param w widget object
+*/
+void Style_Salome::polish ( QWidget* w )
+{
+  if ( checkDebugLevel(2) ) {
+    QWindowsStyle::polish( w );
+    return;
+  }
+
+  if ( w && hasHover() ) {
+    if ( qobject_cast<QPushButton*>(w) || qobject_cast<QToolButton*>(w)      ||
+         qobject_cast<QCheckBox*>(w)   || qobject_cast<QRadioButton*>(w)     ||
+         qobject_cast<QComboBox*>(w)   || qobject_cast<QAbstractSpinBox*>(w) ||
+         qobject_cast<QLineEdit*>(w)   || qobject_cast<QScrollBar*>(w)       ||
+         qobject_cast<QTabBar*>(w)     || qobject_cast<QSlider*>(w)          ||
+         qobject_cast<QMenuBar*>(w)    || qobject_cast<QDockWidget*>(w) )
+      w->setAttribute( Qt::WA_Hover );
+  }
+
+  QWindowsStyle::polish( w );
+}
+
+/*!
+  \brief Uninitialize the given widget's appearance.
+
+  This function is the counterpart to polish().
+  It is called for every polished widget whenever the style
+  is dynamically changed; the former style has to unpolish
+  its settings before the new style can polish them again.
+
+  \param w widget object
+*/
+void Style_Salome::unpolish( QWidget* w )
+{
+  if ( checkDebugLevel(3) ) {
+    QWindowsStyle::unpolish( w );
+    return;
+  }
+
+  if ( w && hasHover() ) {
+    if ( qobject_cast<QPushButton*>(w) || qobject_cast<QToolButton*>(w)||
+         qobject_cast<QCheckBox*>(w) || qobject_cast<QRadioButton*>(w) ||
+         qobject_cast<QComboBox*>(w) || qobject_cast<QAbstractSpinBox*>(w) ||
+         qobject_cast<QLineEdit*>(w) || qobject_cast<QScrollBar*>(w) ||
+         qobject_cast<QTabBar*>(w) || qobject_cast<QSlider*>(w) ||
+         qobject_cast<QMenuBar*>(w) || qobject_cast<QDockWidget*>(w) )
+      w->setAttribute( Qt::WA_Hover, false );
+  }
+
+  QWindowsStyle::unpolish( w );
+}
+
+/*!
+  \brief Draws the given control using the provided painter \p with the style options specified by \a opt.
+  \param cc complex control type
+  \param opt style option
+  \param p painter
+  \param w widget
+*/
+void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComplex* opt,
+                                      QPainter* p, const QWidget* w ) const
+{
+  if ( checkDebugLevel(4) ) {
+    QWindowsStyle::drawComplexControl( cc, opt, p, w );
+    return;
+  }
+
+  const QPalette& pal = w->palette();
+  switch( cc ) {
+    case CC_SpinBox:
+      if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
+        bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
+        QRect optr = opt->rect, arUp =   subControlRect( cc, spin, SC_SpinBoxUp, w );
+        optr.setWidth( arUp.x()-optr.x()+1 );
+        double aRad = model()->widgetRounding( Style_Model::EditRadius );
+        bool antialized = model()->antialiasing();
+        QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        if ( hover )
+          drawHoverRect(p, optr, opt->palette.color( QPalette::Window ), aRad, Style_Tools::Left, true);
+        else
+          Style_Tools::shadowRect( p, optr, aRad, LINE_GR_MARGIN, SHADOW, Style_Tools::Left,
+                                   model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr,
+                                   model()->color( Style_Model::FieldDark ),  // Style_Model::fld_dark_clr,
+                                  aBrdTopCol, aBrdBotCol, antialized, false );
+        QRect aBtnRect = QRect( QPoint( arUp.x(), optr.y() ), QPoint( arUp.right(), optr.bottom() ) );
+        QColor aBtnCol = opt->palette.color( QPalette::Button );
+        bool aStateOn = opt->state & ( State_Sunken | State_On );
+        if ( hover )
+          drawHoverRect(p, aBtnRect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::Right, true);
+        else
+          Style_Tools::shadowRect( p, aBtnRect, aRad, 0.0, SHADOW, Style_Tools::Right,
+                                  aBtnCol.light( BUT_PERCENT_COL ), aBtnCol.dark( BUT_PERCENT_COL ),
+                                  aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
+        State flags = State_None;
+        QStyleOptionSpinBox copy;
+        PrimitiveElement pe;
+        if (spin->subControls & SC_SpinBoxUp) {
+          copy.subControls = SC_SpinBoxUp;
+          QPalette pal2 = spin->palette;
+          if (!(spin->stepEnabled & QAbstractSpinBox::StepUpEnabled) ||
+              !(spin->state & State_Enabled)) {
+            pal2.setCurrentColorGroup(QPalette::Disabled);
+            copy.state &= ~State_Enabled;
+          }
+          else
+            copy.state |= State_Enabled;
+          copy.palette = pal2;
+          if ( spin->activeSubControls == SC_SpinBoxUp && ( spin->state & State_Sunken ) ) {
+            copy.state |= State_On;
+            copy.state |= State_Sunken;
+          } else {
+            copy.state |= State_Raised;
+            copy.state &= ~State_Sunken;
+          }
+          pe = (spin->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinPlus
+               : PE_IndicatorSpinUp);
+          copy.rect = aBtnRect;
+          drawPrimitive(pe, &copy, p, w);
+        }
+        if (spin->subControls & SC_SpinBoxDown) {
+          copy.subControls = SC_SpinBoxDown;
+          copy.state = spin->state;
+          QPalette pal2 = spin->palette;
+          if (!(spin->stepEnabled & QAbstractSpinBox::StepDownEnabled) ||
+               !(spin->state & State_Enabled)) {
+            pal2.setCurrentColorGroup(QPalette::Disabled);
+            copy.state &= ~State_Enabled;
+          }
+          else
+            copy.state |= State_Enabled;
+          copy.palette = pal2;
+          if (spin->activeSubControls == SC_SpinBoxDown && (spin->state & State_Sunken)) {
+             copy.state |= State_On;
+             copy.state |= State_Sunken;
+          } else {
+            copy.state |= State_Raised;
+            copy.state &= ~State_Sunken;
+          }
+          pe = (spin->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinMinus
+               : PE_IndicatorSpinDown);
+          copy.rect = aBtnRect;
+          drawPrimitive(pe, &copy, p, w);
+        }
+       break;
+     }
+     case CC_ComboBox: {
+      if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
+        bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
+        QRect optr = opt->rect,
+              ar = subControlRect( cc, cmb, SC_ComboBoxArrow, w );
+        optr.setY( ar.y() );
+        optr.setHeight( ar.height() );
+        optr.setWidth( ar.x()-optr.x()+1 );
+        bool antialized = model()->antialiasing();
+        double aRad = model()->widgetRounding( Style_Model::EditRadius );
+        QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        if ( hover )
+          drawHoverRect(p, optr, opt->palette.color( QPalette::Window ), aRad, Style_Tools::Left, true);
+        else
+          Style_Tools::shadowRect( p, optr, aRad, LINE_GR_MARGIN, SHADOW, Style_Tools::Left,
+                                   model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr,
+                                   model()->color( Style_Model::FieldDark ),  // Style_Model::fld_dark_clr,
+                                  aBrdTopCol, aBrdBotCol, antialized, false );
+        if (cmb->subControls & SC_ComboBoxArrow) {
+          State flags = State_None;
+          QColor aBtnCol = opt->palette.color( QPalette::Button );
+          bool aStateOn = opt->state & ( State_Sunken | State_On );
+          if ( hover )
+            drawHoverRect(p, ar, opt->palette.color( QPalette::Window ), aRad, Style_Tools::Right, true);
+          else
+            Style_Tools::shadowRect( p, ar, aRad, 0.0, SHADOW, Style_Tools::Right,
+                                     aBtnCol.light( BUT_PERCENT_COL ), aBtnCol.dark( BUT_PERCENT_COL ),
+                                     aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
+          if (opt->state & State_Enabled)
+            flags |= State_Enabled;
+          if (cmb->activeSubControls == SC_ComboBoxArrow)
+            flags |= State_Sunken;
+          QStyleOption arrowOpt(0);
+          arrowOpt.rect = ar;
+          arrowOpt.palette = cmb->palette;
+          arrowOpt.state = flags;
+          drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, w);
+        }
+        if (cmb->subControls & SC_ComboBoxEditField) {
+          bool hi = cmb->state & State_HasFocus && !cmb->editable;
+          if( hi ) {
+            Style_Tools::shadowRect( p, optr, aRad, 0.0, SHADOW, Style_Tools::Left,
+                                     pal.color( QPalette::Highlight ),
+                                     pal.color( QPalette::Highlight ), aBrdTopCol, aBrdBotCol,
+                                     antialized, false );
+            p->setPen(cmb->palette.highlightedText().color());
+          }
+          else
+           p->setPen(cmb->palette.text().color());
+        }
+        break;
+      }
+    }
+    case CC_Slider: {
+        if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
+            QRect groove = subControlRect(CC_Slider, slider, SC_SliderGroove, w);
+            QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, w);
+
+            if( hasHover() && (slider->state & State_Enabled) &&
+                         (slider->state & State_MouseOver) ) {
+             QRect moderated = w->rect();
+                drawHoverRect(p, moderated, opt->palette.color( QPalette::Window ),
+                              model()->widgetRounding( Style_Model::ButtonRadius ), Style_Tools::All, false);
+            }
+
+            if ((slider->subControls & SC_SliderGroove) && groove.isValid()) {
+              QStyleOptionSlider tmpSlider = *slider;
+              tmpSlider.subControls = SC_SliderGroove;
+              QWindowsStyle::drawComplexControl(cc, &tmpSlider, p, w);
+            }
+            if (slider->subControls & SC_SliderTickmarks) {
+              QStyleOptionSlider tmpSlider = *slider;
+              tmpSlider.subControls = SC_SliderTickmarks;
+              QCommonStyle::drawComplexControl(cc, &tmpSlider, p, w);
+            }
+            if (slider->subControls & SC_SliderHandle) {
+              if (slider->state & State_HasFocus) {
+                QStyleOptionFocusRect fropt;
+                fropt.QStyleOption::operator=(*slider);
+                fropt.rect = subElementRect(SE_SliderFocusRect, slider, w);
+                drawPrimitive(PE_FrameFocusRect, &fropt, p, w);
+              }
+              int x = handle.x(), y = handle.y(), wi = handle.width(), he = handle.height();
+              bool horiz = slider->orientation == Qt::Horizontal;
+              bool tickAbove = slider->tickPosition == QSlider::TicksAbove;
+              bool tickBelow = slider->tickPosition == QSlider::TicksBelow;
+              QColor aBtnCol = model()->color( Style_Model::Slider );          // Style_Model::slider_clr
+             QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+             QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+              // rect was changed on +/-DELTA_SLIDER value for correct painting Antialised border of slider
+              int aDelta = DELTA_SLIDER-1;
+              QRect slRect = QRect(x+aDelta, y+aDelta, wi-aDelta, he-aDelta);
+              int aXAdd = (int)(slRect.width()/6), aYAdd = (int)(slRect.height()/6);
+              Style_Tools::SliderType type = Style_Tools::SlNone;
+              if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow))
+                type = Style_Tools::SlNone;
+              else {
+                if (horiz)
+                  if (tickAbove) {
+                    type = Style_Tools::SlUp;
+                    slRect.setTop( slRect.top()-aYAdd );
+                  }
+                  else {
+                    type = Style_Tools::SlDown;
+                    slRect.setBottom( slRect.bottom()+aYAdd );
+                  }
+                else
+                  if (tickAbove) {
+                    type = Style_Tools::SlLeft;
+                    slRect.setLeft( slRect.left()-aXAdd );
+                  }
+                  else {
+                    type = Style_Tools::SlRight;
+                    slRect.setRight( slRect.right()+aXAdd );
+                 }
+              }
+              Style_Tools::drawSlider( p, slRect, model()->widgetRounding( Style_Model::SliderRadius ), type,
+                                       aBtnCol.light( BUT_PERCENT_COL ),
+                                       aBtnCol.dark( BUT_PERCENT_COL ), aBrdTopCol, aBrdBotCol );
+              QRect aHRect = handle;
+              int aXRect = (int)(aHRect.width()/5),
+                  aYRect = (int)(aHRect.height()/5);
+              aHRect = QRect( aHRect.x()+aXRect, aHRect.y()+aYRect,
+                              aHRect.width()-2*aXRect, aHRect.height()-2*aYRect );
+              drawHandle( p, aHRect, horiz );
+            }
+            break;
+        }
+    }
+    case CC_ToolButton: {
+      if (const QStyleOptionToolButton *toolbutton
+           = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
+        QRect button, menuArea;
+        button = subControlRect(cc, toolbutton, SC_ToolButton, w);
+        menuArea = subControlRect(cc, toolbutton, SC_ToolButtonMenu, w);
+
+        if (w && ( qobject_cast<QToolBar *>(w->parentWidget() ) || 
+                  toolbutton->state & State_AutoRaise && !( toolbutton->state & State_MouseOver ) )
+           ) {
+          QWindowsStyle::drawComplexControl( cc, opt, p, w );
+          return;
+        }
+        int aMinDelta = (int)model()->widgetRounding( Style_Model::ButtonRadius );
+        if ( !toolbutton->icon.isNull() )
+          aMinDelta = Style_Tools::getMinDelta( toolbutton->rect, toolbutton->iconSize, aMinDelta );
+        bool aStateOn = opt->state & ( State_Sunken | State_On );
+        QColor aBtnCol = opt->palette.color( QPalette::Button ),
+               top    = aBtnCol.light( BUT_PERCENT_COL ),
+               bottom = aBtnCol.dark( BUT_PERCENT_COL );
+        bool isMenuBtn = toolbutton->features == QStyleOptionToolButton::Menu;
+        bool antialized = model()->antialiasing();
+        bool isAutoRaising = model()->widgetEffect() == Style_Model::AutoRaiseEffect;
+        bool isHighWdg     = model()->widgetEffect() == Style_Model::HighlightEffect;
+        bool hover = hasHover() && (opt->state & State_Enabled) && ( opt->state & State_MouseOver );
+       QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        QRect aRect = button;
+        int aType = isMenuBtn ? Style_Tools::Left : Style_Tools::All;
+        if ( toolbutton->subControls & SC_ToolButton ) {
+          if ( isAutoRaising && hover && !aStateOn )
+            Style_Tools::shadowRect( p, aRect, aMinDelta, -1, SHADOW, aType, bottom, top, aBrdTopCol,
+                                     aBrdBotCol, antialized, true, aStateOn );
+          else if ( isHighWdg && hover && !aStateOn )
+            drawHoverRect( p, aRect, opt->palette.color( QPalette::Window ), aMinDelta, aType, true );
+          else
+            Style_Tools::shadowRect( p, aRect, aMinDelta, -1, SHADOW, aType, top, bottom,
+                                     aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
+       }
+        if (toolbutton->subControls & SC_ToolButtonMenu) {
+          p->save();
+          if ( aMinDelta > menuArea.height()/2 )
+            aMinDelta = menuArea.height()/2;
+          if ( aMinDelta > menuArea.width()/2 )
+            aMinDelta = menuArea.width()/2;
+          aRect = menuArea;
+          aType = isMenuBtn ? Style_Tools::Right : Style_Tools::All;
+          if ( isAutoRaising && hover && !aStateOn )
+            Style_Tools::shadowRect( p, aRect, aMinDelta, -1, SHADOW, aType, bottom, top,
+                                     aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
+          else if ( isHighWdg && hover && !aStateOn )
+            drawHoverRect( p, aRect, opt->palette.color( QPalette::Window ), aMinDelta, aType, true );
+          else
+            Style_Tools::shadowRect( p, aRect, aMinDelta, -1, SHADOW, aType, top, bottom,
+                                     aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
+          QStyleOption tool(0);
+          tool.palette = toolbutton->palette;
+          tool.rect = menuArea;
+          State bflags = toolbutton->state;
+          if (bflags & State_AutoRaise) {
+              if (!(bflags & State_MouseOver)) {
+                  bflags &= ~State_Raised;
+              }
+          }
+          State mflags = bflags;
+            if (toolbutton->activeSubControls & SC_ToolButton)
+                bflags |= State_Sunken;
+            if (toolbutton->activeSubControls & SC_ToolButtonMenu)
+                mflags |= State_Sunken;
+          tool.state = mflags;
+          drawPrimitive(PE_IndicatorArrowDown, &tool, p, w);
+          p->restore();
+        }
+
+        if (toolbutton->state & State_HasFocus) {
+          QStyleOptionFocusRect fr;
+          fr.QStyleOption::operator=(*toolbutton);
+          fr.rect.adjust(3, 3, -3, -3);
+          if (toolbutton->features & QStyleOptionToolButton::Menu)
+            fr.rect.adjust(0, 0, -pixelMetric(QStyle::PM_MenuButtonIndicator, toolbutton, w), 0);
+         Style_Tools::drawFocus( p, fr.rect, aMinDelta-1,  isMenuBtn ? Style_Tools::Left :
+                                  Style_Tools::All, aBrdBotCol );
+        }
+        QStyleOptionToolButton label = *toolbutton;
+        int fw = pixelMetric( PM_DefaultFrameWidth, opt, w );
+        label.rect = button.adjusted( fw, fw, -fw, -fw );
+        drawControl( CE_ToolButtonLabel, &label, p, w );
+
+        break;
+      }
+    }
+    case CC_TitleBar: {
+      QWindowsStyle::drawComplexControl( cc, opt, p, w );
+      break;
+    }
+    case CC_GroupBox:
+      if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const 
+                                                 QStyleOptionGroupBox *>(opt)) {
+        // Draw frame
+        QRect textRect = subControlRect( cc, opt, SC_GroupBoxLabel, w );
+        QRect checkBoxRect = subControlRect( cc, opt, SC_GroupBoxCheckBox, w);
+        if (groupBox->subControls & QStyle::SC_GroupBoxFrame) {
+          QRect aRect = subControlRect( cc, opt, SC_GroupBoxFrame, w);
+         QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
+         QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+          Style_Tools::shadowRect( p, aRect, model()->widgetRounding( Style_Model::FrameRadius ), 0.,
+                                   SHADOW, Style_Tools::All,
+                                   model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr
+                                   model()->color( Style_Model::FieldDark ),  // Style_Model::fld_dark_clr
+                                  aBrdTopCol, aBrdBotCol, false, false, false, false);
+        }
+        // Draw title
+        if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) {
+          QColor textColor = groupBox->textColor;
+          if (textColor.isValid())
+            p->setPen(textColor);
+          int alignment = int(groupBox->textAlignment);
+          if (!styleHint(QStyle::SH_UnderlineShortcut, opt, w))
+            alignment |= Qt::TextHideMnemonic;
+          QColor aColor = opt->palette.color( QPalette::Window );
+          Style_Tools::arrowRect( p, textRect, opt->palette.color( QPalette::Dark ),
+                                 aColor.dark(BUT_PERCENT_COL), aColor );
+          drawItemText(p, textRect,  Qt::TextShowMnemonic | Qt::AlignHCenter | alignment,
+                       pal, groupBox->state & State_Enabled, groupBox->text,
+                       textColor.isValid() ? QPalette::NoRole : QPalette::WindowText);
+          if (groupBox->state & State_HasFocus) {
+            QStyleOptionFocusRect fropt;
+            fropt.QStyleOption::operator=(*groupBox);
+            fropt.rect = textRect;
+            drawPrimitive(PE_FrameFocusRect, &fropt, p, w);
+          }
+        }
+        // Draw checkbox
+        if (groupBox->subControls & SC_GroupBoxCheckBox) {
+            QStyleOptionButton box;
+          box.QStyleOption::operator=(*groupBox);
+          box.rect = checkBoxRect;
+          drawPrimitive(PE_IndicatorCheckBox, &box, p, w);
+        }
+        break;
+      }
+    case CC_Dial: {
+      QWindowsStyle::drawComplexControl( cc, opt, p, w );
+      break;
+    }
+    default:
+      QWindowsStyle::drawComplexControl( cc, opt, p, w );
+  }
+}
+
+/*!
+  \brief Draws the given element with the provided painter \p with the style options specified by \a opt.
+  \param ce control element type
+  \param opt style option
+  \param p painter
+  \param w widget
+*/
+void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
+                               QPainter* p, const QWidget* w ) const
+{
+  if ( checkDebugLevel(5) ) {
+    QWindowsStyle::drawControl( ce, opt, p, w );
+    return;
+  }
+
+  switch ( ce ) {
+    case CE_PushButton:
+      if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
+        drawControl(CE_PushButtonBevel, btn, p, w);
+        QStyleOptionButton subopt = *btn;
+        subopt.rect = subElementRect(SE_PushButtonContents, btn, w);
+        drawControl(CE_PushButtonLabel, &subopt, p, w);
+        if (btn->state & State_HasFocus) {
+          QRect aRect = subElementRect( SE_PushButtonFocusRect, btn, w );
+         Style_Tools::drawFocus( p, aRect, model()->widgetRounding( Style_Model::ButtonRadius ),
+                                  Style_Tools::All, model()->color( Style_Model::BorderBottom ) );
+        }
+       break;
+      }
+    case CE_PushButtonBevel:
+      if ( qstyleoption_cast<const QStyleOptionButton *>(opt) ) {
+        double aRad = model()->widgetRounding( Style_Model::ButtonRadius );
+        bool aStateOn = opt->state & ( State_Sunken | State_On );
+        bool isAutoRaising = model()->widgetEffect() == Style_Model::AutoRaiseEffect;
+        bool isHighWdg     = model()->widgetEffect() == Style_Model::HighlightEffect;
+        bool enabled = opt->state & State_Enabled;
+        bool hover = hasHover() && enabled && ( opt->state & State_MouseOver );
+
+        QColor aBtnCol = opt->palette.color( QPalette::Button );
+        QColor top = aBtnCol.light( BUT_PERCENT_COL ),
+              bottom = aBtnCol.dark( BUT_PERCENT_COL );
+        QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        QRect r = opt->rect;
+        bool antialized = model()->antialiasing();
+        if ( isAutoRaising && hover && !aStateOn )
+          Style_Tools::shadowRect( p, r, aRad, -1, SHADOW, Style_Tools::All, bottom, top,
+                                   aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
+        else if ( isHighWdg && hover && !aStateOn )
+          drawHoverRect( p, r, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, true );
+       else
+          Style_Tools::shadowRect( p, r, aRad, -1, SHADOW, Style_Tools::All, top, bottom,
+                                   aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
+       break;
+      }
+      case CE_DockWidgetTitle:
+        if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
+          bool floating = false;
+          int menuOffset = 0; //used to center text when floated
+          QColor inactiveCaptionTextColor = opt->palette.color( QPalette::HighlightedText );
+          const QDockWidget *dockWidget = qobject_cast<const QDockWidget *>(w);
+          //Titlebar gradient
+          if (dockWidget) {
+            if ( dockWidget->isFloating() && dwOpt->movable) {
+              floating = true;
+              QColor top = opt->palette.color( QPalette::Highlight ).light();
+              QColor bottom = opt->palette.color( QPalette::Highlight );
+              menuOffset = 2;
+              QBrush fillBrush(bottom);
+              if (top != bottom) {
+                QPoint p1(dwOpt->rect.x(), dwOpt->rect.y());
+                QPoint p2(dwOpt->rect.x(), dwOpt->rect.bottom() );
+                QLinearGradient lg(p1, p2);
+                lg.setColorAt(0, top);
+                lg.setColorAt(1, bottom);
+                fillBrush = lg;
+              }
+              p->fillRect(dwOpt->rect.adjusted(0, 0, 0, -3), fillBrush);
+            }
+            else {
+              QRect r = dwOpt->rect.adjusted(0, 0, -1, -1); 
+              QColor bottom = opt->palette.color( QPalette::Window ),
+                     top =    bottom.dark( BUT_PERCENT_COL );
+              QRect aRect = dwOpt->rect;
+              QLinearGradient gr( aRect.x(), aRect.y(), aRect.x(), aRect.y()+aRect.height() );
+              gr.setColorAt( 0.0, top );
+              gr.setColorAt( 0.4, bottom );
+              gr.setColorAt( 0.6, bottom );
+              gr.setColorAt( 1.0, top );
+              p->fillRect( r, gr );
+
+              QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );     // Style_Model::border_tab_top_clr
+              QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom );  // Style_Model::border_tab_bot_clr
+              p->setPen( aBrdTopCol );
+              p->drawLine( r.x(), r.bottom(), r.x(), r.y() );
+              p->drawLine( r.x(), r.y(), r.right(), r.y() );
+              p->setPen( aBrdBotCol );
+              p->drawLine( r.x(), r.bottom(), r.right(), r.bottom() );
+              p->drawLine( r.right(), r.bottom(), r.right(), r.y() );
+            }
+          }
+          p->setPen(dwOpt->palette.color(QPalette::Light));
+
+          QString aTitle = dwOpt->title;
+          if (!aTitle.isEmpty()) {
+            int aMargin  = pixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, w);
+            const int indent = p->fontMetrics().descent();
+            QRect r = dwOpt->rect.adjusted(indent + 1, - menuOffset, -indent - 1, -1);
+            QPixmap aPxm = standardPixmap( SP_DockWidgetCloseButton, opt, w);
+            int aWidth = r.width() - aPxm.width()-2/*button margins*/;
+            aPxm = standardPixmap( SP_TitleBarNormalButton, opt, w);
+            aWidth = aWidth - aPxm.width()-2/*button margins*/;
+            r = QRect( r.x(), r.y(), aWidth-aMargin-2/*buttons separator*/-2/*margin from text*/, r.height() );
+
+            QFont oldFont = p->font();
+            QFont font = oldFont;
+            if (floating) {
+              font.setBold(true);
+              p->setFont(font);
+            }
+            aTitle = titleText( aTitle, r.width(), r.height(), font );
+
+            QPalette palette = dwOpt->palette;
+            palette.setColor(QPalette::Window, inactiveCaptionTextColor);
+            bool active = dwOpt->state & State_Active;
+            //const int indent = p->fontMetrics().descent();
+            drawItemText(p, r, Qt::AlignLeft | Qt::AlignVCenter, palette,
+                         dwOpt->state & State_Enabled, aTitle,
+                         floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText);
+            p->setFont(oldFont);
+         }
+         break;
+        }
+    case CE_Splitter: {
+      QWindowsStyle::drawControl( ce, opt, p, w );
+      QRect r = opt->rect;
+      bool horiz = r.width() > r.height();
+      int aLen = model()->splitHandleLength();
+      if ( horiz )
+        r = QRect( r.x() +(int)((r.width()-aLen)/2), r.y(), aLen, r.height());
+      else
+        r = QRect( r.x(), r.y() +(int)((r.height()-aLen)/2), r.width(), aLen);
+      drawHandle( p, r, horiz, true );
+      break;
+    }
+    case CE_TabBarTabShape:
+      if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
+        if (tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedEast ||
+            tab->shape == QTabBar::RoundedSouth || tab->shape == QTabBar::RoundedWest) {
+          p->save();
+          QRect tabRect = opt->rect;
+          // line under selected tab bar object
+          bool isSelected = opt->state & State_Selected;
+          bool isLast = tab->position == QStyleOptionTab::End ||
+                        tab->position == QStyleOptionTab::OnlyOneTab;
+         QColor aColor = opt->palette.color( QPalette::Window ),
+                 aDarkColor = aColor.dark( BUT_PERCENT_ON );
+         QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );     // Style_Model::border_tab_top_clr
+         QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom );  // Style_Model::border_tab_bot_clr
+
+          bool isHover = hasHover() && (opt->state & State_Enabled) &&
+                                       (opt->state & State_MouseOver);
+          if ( isHover && !isSelected && model()->widgetEffect() == Style_Model::HighlightEffect ) {
+            aColor     = model()->color( Style_Model::HighlightWidget ); // Style_Model::high_wdg_clr
+            aDarkColor = model()->color( Style_Model::HighlightBorder ); // Style_Model::high_brd_wdg_clr
+          }
+          Style_Tools::tabRect( p, tabRect, (int)tab->shape,
+                                model()->widgetRounding( Style_Model::FrameRadius ),
+                                DELTA_H_TAB, aColor, aDarkColor,
+                                aBrdTopCol, aBrdBotCol, isSelected, isLast, isHover );
+          p->restore();
+       } else
+           QCommonStyle::drawControl(ce, opt, p, w);
+        break;
+      }
+    case CE_TabBarTabLabel:
+      if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
+       if ( tab->position == QStyleOptionTab::End ||
+             tab->position == QStyleOptionTab::OnlyOneTab ) {
+          QRect oldRect = opt->rect;
+          int aDelta = 0;
+          if ( tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedSouth ) {
+            aDelta = (int)(opt->rect.height()*DELTA_H_TAB/2);
+            oldRect = QRect( oldRect.topLeft(), QPoint( oldRect.right()-aDelta, oldRect.bottom() ) );
+          }
+         else {
+            aDelta = (int)(opt->rect.width()*DELTA_H_TAB/2);
+            oldRect = QRect( oldRect.topLeft(), QPoint( oldRect.right(), oldRect.bottom()-aDelta ) );
+         }
+          QStyleOptionTab* copyTab = (QStyleOptionTab*)tab;
+          copyTab->rect = oldRect;
+          QWindowsStyle::drawControl( ce, copyTab, p, w );
+       }
+        else
+          QWindowsStyle::drawControl( ce, opt, p, w );
+        break;
+      }
+    case CE_MenuBarItem:
+      if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
+        if ( w )
+          drawBackground( p, w->rect(), opt->palette.color( QPalette::Window ), true, true, true );
+        bool active = mbi->state & State_Selected;
+        bool hasFocus = mbi->state & State_HasFocus;
+        bool down = mbi->state & State_Sunken;
+        QStyleOptionMenuItem newMbi = *mbi;
+        if (active || hasFocus) {
+          QBrush b( opt->palette.color( QPalette::Window ) );
+          if (active && down)
+            p->setBrushOrigin(p->brushOrigin() + QPoint(1, 1));
+          if ( active && hasFocus) {
+            bool aStateOn = opt->state & (State_Sunken | State_On);
+            QColor aBtnCol = opt->palette.color( QPalette::Window ),
+                   top =    aBtnCol.light( BUT_PERCENT_ON ),
+                   bottom = aBtnCol.dark( BUT_PERCENT_ON );
+           QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+           QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+            bool aHighWdg = model()->widgetEffect() == Style_Model::HighlightEffect;
+            if ( !aStateOn && aHighWdg && (opt->state & State_Enabled) &&
+                 (opt->state & State_Selected) )
+              drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), 0, Style_Tools::All, true);
+            else {
+              Style_Tools::shadowRect( p, opt->rect, 0, 0., SHADOW, Style_Tools::All, top, bottom,
+                                   aBrdTopCol, aBrdBotCol,
+                                   model()->antialiasing(), true, aStateOn );
+            }
+          }
+          if (active && down) {
+            newMbi.rect.translate(pixelMetric(PM_ButtonShiftHorizontal, mbi, w),
+                                  pixelMetric(PM_ButtonShiftVertical, mbi, w));
+            p->setBrushOrigin(p->brushOrigin() - QPoint(1, 1));
+          }
+        }
+        QCommonStyle::drawControl(ce, &newMbi, p, w);
+        break;
+      }
+    case CE_MenuBarEmptyArea:
+      drawBackground( p, opt->rect, opt->palette.color( QPalette::Window ), true, true, true );
+      break;
+    case CE_ProgressBarGroove: {
+      QColor aBgColor = opt->palette.color( QPalette::Window ),
+       top =    aBgColor.light( BUT_PERCENT_ON ),
+        bottom = aBgColor.dark( BUT_PERCENT_ON );
+      QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+      QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+      Style_Tools::shadowRect( p, opt->rect, model()->widgetRounding( Style_Model::EditRadius ), -1,
+                               SHADOW, Style_Tools::All, top, bottom, aBrdTopCol, aBrdBotCol,
+                               model()->antialiasing(), true );
+      break;
+      }
+    case CE_ProgressBarLabel:
+      if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
+        // implementation from qplastiquestyle
+        // The busy indicator doesn't draw a label
+        if (bar->minimum == 0 && bar->maximum == 0)
+          return;
+        p->save();
+        QRect rect = bar->rect;
+        QRect leftRect;
+        p->setPen(bar->palette.text().color());
+
+        bool vertical = false;
+        bool inverted = false;
+        bool bottomToTop = false;
+        // Get extra style options if version 2
+        if (const QStyleOptionProgressBarV2 *bar2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
+          vertical = (bar2->orientation == Qt::Vertical);
+          inverted = bar2->invertedAppearance;
+          bottomToTop = bar2->bottomToTop;
+        }
+        if (vertical) {
+          rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // flip width and height
+          QMatrix m;
+          if (bottomToTop) {
+            m.translate(0.0, rect.width());
+            m.rotate(-90);
+          } else {
+            m.translate(rect.height(), 0.0);
+            m.rotate(90);
+          }
+          p->setMatrix(m);
+        }
+        int progressIndicatorPos = int(((bar->progress - bar->minimum) / double(bar->maximum - bar->minimum)) * rect.width());
+        bool flip = (!vertical && (((bar->direction == Qt::RightToLeft) && !inverted)
+                    || ((bar->direction == Qt::LeftToRight) && inverted))) || (vertical && ((!inverted && !bottomToTop) || (inverted && bottomToTop)));
+        if (flip) {
+          int indicatorPos = rect.width() - progressIndicatorPos;
+          if (indicatorPos >= 0 && indicatorPos <= rect.width()) {
+            p->setPen(bar->palette.base().color());
+            leftRect = QRect(rect.left(), rect.top(), indicatorPos, rect.height());
+          } else if (indicatorPos > rect.width()) {
+            p->setPen(bar->palette.text().color());
+          } else {
+            p->setPen(bar->palette.base().color());
+          }
+        } else {
+          if (progressIndicatorPos >= 0 && progressIndicatorPos <= rect.width()) {
+            leftRect = QRect(rect.left(), rect.top(), progressIndicatorPos, rect.height());
+          } else if (progressIndicatorPos > rect.width()) {
+            p->setPen(bar->palette.base().color());
+          } else {
+            p->setPen(bar->palette.text().color());
+          }
+        }
+
+        p->drawText(rect, bar->text, QTextOption(Qt::AlignAbsolute | Qt::AlignHCenter | Qt::AlignVCenter));
+        if (!leftRect.isNull()) {
+          p->setPen(flip ? bar->palette.text().color() : bar->palette.base().color());
+          p->setClipRect(leftRect, Qt::IntersectClip);
+          p->drawText(rect, bar->text, QTextOption(Qt::AlignAbsolute | Qt::AlignHCenter | Qt::AlignVCenter));
+        }
+        p->restore();
+      }
+      break;
+    case CE_ProgressBarContents:
+      if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
+        QRect rect = pb->rect;
+        bool vertical = false;
+        bool inverted = false;
+        // Get extra style options if version 2
+        const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt);
+        if (pb2) {
+          vertical = (pb2->orientation == Qt::Vertical);
+          inverted = pb2->invertedAppearance;
+        }
+        QMatrix m;
+        if (vertical) {
+          rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // flip width and height
+          m.translate(rect.height(), 0.0);
+          m.rotate(90);
+        }
+        QPalette pal2 = pb->palette;
+        // Correct the highlight color if it is the same as the background
+        if (pal2.highlight() == pal2.background())
+            pal2.setColor(QPalette::Highlight, pb->palette.color(QPalette::Active,
+                                                                 QPalette::Highlight));
+        bool reverse = ((!vertical && (pb->direction == Qt::RightToLeft)) || vertical);
+        if (inverted)
+          reverse = !reverse;
+        int fw = 2;
+        int width = rect.width() - 2 * fw;
+        if (pb->minimum == 0 && pb->maximum == 0) {
+          // draw busy indicator
+          int x = (pb->progress - pb->minimum) % (width * 2);
+          if (x > width)
+            x = 2 * width - x;
+          x = reverse ? rect.right() - x : x + rect.x();
+          p->setPen(QPen(pal2.highlight().color(), 4));
+          p->drawLine(x, rect.y() + 1, x, rect.height() - fw);
+        } else {
+          const int unit_width = pixelMetric(PM_ProgressBarChunkWidth, pb, w);
+          int u;
+          if (unit_width > 1)
+            u = (rect.width() + unit_width / 3) / unit_width;
+          else
+            u = width / unit_width;
+
+          int p_v = pb->progress - pb->minimum;
+          int t_s = pb->maximum - pb->minimum ? pb->maximum - pb->minimum : 1;
+
+          if (u > 0 && p_v >= INT_MAX / u && t_s >= u) {
+            // scale down to something usable.
+            p_v /= u;
+            t_s /= u;
+          }
+
+          // nu < tnu, if last chunk is only a partial chunk
+          int tnu, nu;
+          tnu = nu = p_v * u / t_s;
+
+          if (nu * unit_width > width)
+            --nu;
+
+          // Draw nu units out of a possible u of unit_width
+          // width, each a rectangle bordered by background
+          // color, all in a sunken panel with a percentage text
+          // display at the end.
+          int x = 0;
+          int x0 = reverse ? rect.right() - ((unit_width > 1) ? unit_width : fw)
+                           : rect.x() + fw;
+          QStyleOptionProgressBarV2 pbBits = *pb;
+          pbBits.rect = rect;
+          pbBits.palette = pal2;
+          int myY = pbBits.rect.y();
+          int myHeight = pbBits.rect.height();
+          pbBits.state = State_None;
+          QRect aRect;
+         QColor aColor = model()->color( Style_Model::ProgressBar );    // Style_Model::prbar_clr
+         QColor top    = aColor.light( BUT_PERCENT_COL );
+         QColor bottom = aColor.dark( BUT_PERCENT_COL );
+          int aType;
+          for (int i = 0; i <= nu; ++i) {
+            aType = Style_Tools::None;
+            if ( i < nu ) { // not last element
+              aRect = QRect(x0 + x, myY, unit_width, myHeight);
+              if ( i == 0 ) {
+                if ( reverse )
+                  aRect.setRight( aRect.right()-fw );
+                if ( vertical )
+                  aType = reverse ? Style_Tools::BottomLeft | Style_Tools::BottomRight
+                                  : Style_Tools::TopLeft | Style_Tools::TopRight;
+                else
+                  aType = reverse ? Style_Tools::Right : Style_Tools::Left;
+              }
+            }
+            else { // last element if it's necessary
+              if ( nu >= tnu )
+                break;
+              int pixels_left = width - (nu * unit_width);
+              int offset = reverse ? x0 + x + unit_width-pixels_left : x0 + x;
+              aRect = QRect(offset, myY, pixels_left, myHeight);
+              if ( vertical )
+                aType = reverse ? Style_Tools::TopLeft | Style_Tools::TopRight
+                                : Style_Tools::BottomLeft | Style_Tools::BottomRight;
+              else
+                aType = reverse ? Style_Tools::Left : Style_Tools::Right;
+            }
+            // display
+            aRect = m.mapRect(aRect);
+            if ( vertical )
+              aRect = QRect(aRect.x(), aRect.y()+fw, aRect.width(), aRect.height());
+
+            if ( !vertical )
+              aRect = QRect(aRect.x()+1, aRect.y()+2, aRect.width()-1,
+                            aRect.height()-4);
+            else
+              aRect = QRect(aRect.x()+1, aRect.y()-1, aRect.width()-5, aRect.height()-1);
+            QColor aTopClr = aColor, aBotClr = aColor;
+            if ( unit_width > 1 ) {
+              aTopClr = aColor.light();
+              aBotClr = aColor.dark();
+           }
+            Style_Tools::shadowRect( p, aRect, model()->widgetRounding( Style_Model::EditRadius ), -1, 0,
+                                     aType, top, bottom, aTopClr, aBotClr, false, true );
+            x += reverse ? -unit_width : unit_width;
+          }
+        }
+      }
+      break;
+    case CE_MenuItem:
+      if (const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
+        const int windowsItemFrame    =  2; // definitions from qwindowstyle.cpp file
+        const int windowsItemHMargin  =  3;
+        const int windowsItemVMargin  =  2;
+        const int windowsRightBorder  = 15;
+        const int windowsArrowHMargin =  6;
+        int x, y, width, h;
+        menuitem->rect.getRect(&x, &y, &width, &h);
+        int tab = menuitem->tabWidth;
+        bool dis = !(menuitem->state & State_Enabled);
+        bool checked = menuitem->checkType != QStyleOptionMenuItem::NotCheckable
+                       ? menuitem->checked : false;
+        bool act = menuitem->state & State_Selected;
+
+        // windows always has a check column, regardless whether we have an icon or not
+        int checkcol = qMax(menuitem->maxIconWidth, 20);
+
+        QColor aBgColor = opt->palette.color( QPalette::Window );
+        double aMargin = LINE_GR_MARGIN;
+        QLinearGradient gr(x,y,menuitem->rect.right(),y);
+        gr.setColorAt( 0.0, aBgColor );
+       gr.setColorAt( aMargin/width, model()->color( Style_Model::FieldLight ) ); // Style_Model::fld_light_clr
+        gr.setColorAt( 1.0, model()->color( Style_Model::FieldLight ) );
+        QBrush fill;
+        if ( act )
+          fill = menuitem->palette.brush( QPalette::Highlight );
+        else
+          fill = QBrush( gr );
+        p->fillRect(menuitem->rect, fill);
+        if (menuitem->menuItemType == QStyleOptionMenuItem::Separator){
+          int yoff = y-1 + h / 2;
+         QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
+         QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+          p->setPen( aBrdBotCol );
+          p->drawLine(x + 2, yoff, x + width - 4, yoff);
+          p->setPen( aBrdTopCol );
+          p->drawLine(x + 2, yoff + 1, x + width - 4, yoff + 1);
+          return;
+        }
+        QRect vCheckRect = visualRect(opt->direction, menuitem->rect, QRect(menuitem->rect.x(),
+                                      menuitem->rect.y(), checkcol, menuitem->rect.height()));
+        if (checked) {
+          if (act && !dis)
+            qDrawShadePanel(p, vCheckRect, menuitem->palette, true, 1, new QBrush(aBgColor));
+          else {
+            QColor aCol = aBgColor;
+            aCol.setAlpha( 80 );
+            QBrush fill(aCol);
+            qDrawShadePanel(p, vCheckRect, menuitem->palette, true, 1, &fill);
+          }
+        } else if (!act)
+          p->fillRect(vCheckRect, QBrush( gr ) );
+        // On Windows Style, if we have a checkable item and an icon we
+        // draw the icon recessed to indicate an item is checked. If we
+        // have no icon, we draw a checkmark instead.
+        if (!menuitem->icon.isNull()) {
+          QIcon::Mode mode = dis ? QIcon::Disabled : QIcon::Normal;
+          if (act && !dis)
+            mode = QIcon::Active;
+          QPixmap pixmap;
+          if (checked)
+            pixmap = menuitem->icon.pixmap(pixelMetric(PM_SmallIconSize), mode, QIcon::On);
+          else
+            pixmap = menuitem->icon.pixmap(pixelMetric(PM_SmallIconSize), mode);
+          int pixw = pixmap.width();
+          int pixh = pixmap.height();
+          if (act && !dis && !checked)
+            qDrawShadePanel(p, vCheckRect,  menuitem->palette, false, 1,
+                            new QBrush(aBgColor));
+          QRect pmr(0, 0, pixw, pixh);
+          pmr.moveCenter(vCheckRect.center());
+          p->setPen(menuitem->palette.text().color());
+          p->drawPixmap(pmr.topLeft(), pixmap);
+        } else if (checked) {
+          QStyleOptionMenuItem newMi = *menuitem;
+          newMi.state = State_None;
+          if (!dis)
+            newMi.state |= State_Enabled;
+          if (act)
+            newMi.state |= State_On;
+          newMi.rect = visualRect(opt->direction, menuitem->rect,
+          QRect(menuitem->rect.x() + windowsItemFrame, menuitem->rect.y() + windowsItemFrame,
+                checkcol - 2 * windowsItemFrame, menuitem->rect.height() - 2*windowsItemFrame));
+          drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w);
+        }
+        p->setPen(act ? menuitem->palette.highlightedText().color() :
+                        menuitem->palette.buttonText().color());
+        QColor discol;
+        if (dis) {
+          discol = menuitem->palette.text().color();
+          p->setPen(discol);
+        }
+        int xm = windowsItemFrame + checkcol + windowsItemHMargin;
+        int xpos = menuitem->rect.x() + xm;
+        QRect textRect(xpos, y + windowsItemVMargin, width - xm - windowsRightBorder - tab + 1,
+                       h - 2 * windowsItemVMargin);
+        QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect);
+        QString s = menuitem->text;
+        if (!s.isEmpty()) {                     // draw text
+          p->save();
+          int t = s.indexOf(QLatin1Char('\t'));
+          int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip |
+                           Qt::TextSingleLine;
+          if (!styleHint(SH_UnderlineShortcut, menuitem, w))
+            text_flags |= Qt::TextHideMnemonic;
+          text_flags |= Qt::AlignLeft;
+          if (t >= 0) {
+            QRect vShortcutRect = visualRect(opt->direction, menuitem->rect, 
+            QRect(textRect.topRight(), QPoint(menuitem->rect.right(), textRect.bottom())));
+            if (dis && !act) {
+               p->setPen(menuitem->palette.light().color());
+               p->drawText(vShortcutRect.adjusted(1,1,1,1), text_flags, s.mid(t + 1));
+               p->setPen(discol);
+             }
+             p->drawText(vShortcutRect, text_flags, s.mid(t + 1));
+             s = s.left(t);
+          }
+          QFont font = menuitem->font;
+          if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem)
+            font.setBold(true);
+            p->setFont(font);
+            if (dis && !act) {
+              p->setPen(menuitem->palette.light().color());
+              p->drawText(vTextRect.adjusted(1,1,1,1), text_flags, s.left(t));
+              p->setPen(discol);
+            }
+            p->drawText(vTextRect, text_flags, s.left(t));
+            p->restore();
+          }
+          if (menuitem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow
+            int dim = (h - 2 * windowsItemFrame) / 2;
+            PrimitiveElement arrow;
+            arrow = (opt->direction == Qt::RightToLeft) ? PE_IndicatorArrowLeft :
+                     PE_IndicatorArrowRight;
+            xpos = x + width - windowsArrowHMargin - windowsItemFrame - dim;
+            QRect  vSubMenuRect = visualRect(opt->direction, menuitem->rect,
+                                             QRect(xpos, y + h / 2 - dim / 2, dim, dim));
+            QStyleOptionMenuItem newMI = *menuitem;
+            newMI.rect = vSubMenuRect;
+            newMI.state = dis ? State_None : State_Enabled;
+            if (act)
+              newMI.palette.setColor(QPalette::ButtonText,
+                                     newMI.palette.highlightedText().color());
+            drawPrimitive(arrow, &newMI, p, w);
+          }
+        }
+      break;
+      /*
+    case CE_ToolBoxTab:
+      QCommonStyle::drawControl( ce, opt, p, w );
+      break;
+      */
+    case CE_HeaderSection: {
+      bool aStateOn = opt->state & State_On;
+      QColor aColor = model()->color( Style_Model::Header );    // Style_Model::header_clr
+      QColor  top =    aColor.light( BUT_PERCENT_COL ),
+             bottom =  aColor.dark( BUT_PERCENT_COL );
+      QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+      QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+      Style_Tools::shadowRect( p, opt->rect, 0, -1, 0, Style_Tools::All, top, bottom, aBrdTopCol,
+                       aBrdBotCol, model()->antialiasing(), true, aStateOn );
+      break;
+    }
+    case CE_ComboBoxLabel:
+      if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
+        QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, w);
+        p->save();
+        p->setClipRect(editRect);
+        if (!cb->currentIcon.isNull()) {
+          QIcon::Mode mode = cb->state & State_Enabled ? QIcon::Normal
+                                                       : QIcon::Disabled;
+          QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode);
+          QRect iconRect(editRect);
+          iconRect.setWidth(cb->iconSize.width() + 4);
+          QRect alignRect = editRect;
+          if ( cb->editable ) {
+            int aHalfRect = (int)Style_Tools::getMaxRect( iconRect, 
+                               (int)model()->widgetRounding( Style_Model::EditRadius )/2 );
+            alignRect.setLeft( alignRect.left() + aHalfRect );
+            alignRect.setRight( alignRect.right() - aHalfRect );
+          }
+          iconRect = alignedRect(QApplication::layoutDirection(),
+                                 Qt::AlignLeft | Qt::AlignVCenter,
+                                 iconRect.size(), alignRect);
+         // Here's absent filling of pixmap on basic color for editable comboBox
+          drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap);
+
+          if (cb->direction == Qt::RightToLeft)
+            editRect.translate(-4 - cb->iconSize.width(), 0);
+          else
+            editRect.translate(cb->iconSize.width() + 4, 0);
+        }
+        if (!cb->currentText.isEmpty() && !cb->editable) {
+          drawItemText(p, editRect.adjusted(1, 0, -1, 0), Qt::AlignLeft | Qt::AlignVCenter, cb->palette,
+                       cb->state & State_Enabled, cb->currentText);
+        }
+        p->restore();
+      }
+      break;
+    case CE_ScrollBarSubLine:
+    case CE_ScrollBarAddLine: {
+        bool aStateOn = opt->state & ( State_Sunken | State_On );
+        QColor aBtnCol = opt->palette.color( QPalette::Button );
+        QColor top =    aBtnCol.light( BUT_PERCENT_COL ),
+               bottom = aBtnCol.dark( BUT_PERCENT_COL );
+        QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        Style_Tools::shadowRect( p, opt->rect, 0, -1, 0, Style_Tools::All, top, bottom, aBrdTopCol,
+                                 aBrdBotCol, false, true, aStateOn, true );
+      PrimitiveElement arrow;
+      if (opt->state & State_Horizontal) {
+        if (ce == CE_ScrollBarAddLine)
+          arrow = opt->direction == Qt::LeftToRight ? PE_IndicatorArrowRight : PE_IndicatorArrowLeft;
+        else
+          arrow = opt->direction == Qt::LeftToRight ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight;
+      } else {
+        if (ce == CE_ScrollBarAddLine)
+          arrow = PE_IndicatorArrowDown;
+        else
+          arrow = PE_IndicatorArrowUp;
+      }
+      drawPrimitive(arrow, opt, p, w);
+      break;
+    }
+    case CE_ScrollBarSlider:
+      if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
+        p->save();
+        p->setRenderHint( QPainter::Antialiasing, true );
+        bool enabled = opt->state & State_Enabled;
+        bool horiz = scrollbar->orientation == Qt::Horizontal;
+        double aRad = model()->widgetRounding( Style_Model::ButtonRadius );
+        if ( hasHover() && enabled && (opt->state & State_MouseOver) )
+         drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, false);
+        else {
+       QColor aColor = model()->color( Style_Model::Slider );      // Style_Model::slider_clr
+          if ( !enabled )
+            aColor = opt->palette.button().color();
+         QColor top =    aColor.light( BUT_PERCENT_ON ),
+                 bottom = aColor.dark( BUT_PERCENT_ON );
+         QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+         QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+          QRect r = opt->rect;
+          QPainterPath path = Style_Tools::roundRect( r, aRad,
+                                                      Style_Tools::All );
+          QLinearGradient gr;
+          if (horiz)
+            gr = QLinearGradient(r.x(), r.y(), r.x(), r.bottom());
+          else
+            gr = QLinearGradient(r.x(), r.y(), r.right(), r.y());
+          gr.setColorAt( 0.0, bottom );
+          gr.setColorAt( 0.5, top );
+          gr.setColorAt( 1.0, bottom );
+
+          p->fillPath( path, gr );
+          p->strokePath( path, aBrdTopCol );
+      }
+      p->setRenderHint( QPainter::Antialiasing, false );
+      // draw handle
+      QRect aRect = opt->rect;
+      int aWidth = aRect.width(), aHeight = aRect.height();
+      if ( aWidth > aHeight + aRad )
+        aRect = QRect( aRect.x() + (int)((aWidth-aHeight)/2),
+                       aRect.y(), aHeight, aHeight );
+      else if ( aHeight > aWidth + aRad )
+        aRect = QRect( aRect.x(), aRect.y() + (int)((aHeight-aWidth)/2),
+                       aWidth, aWidth );
+      else {
+        int aRad2 = (int)(aRad/3);
+        aRect = QRect( aRect.x()+aRad2, aRect.y()+aRad2, aRect.width()-2*aRad2, aRect.height()-2*aRad2  );
+      }
+      drawHandle( p, aRect, horiz, true );
+
+      p->restore();
+      break;
+    }
+  case CE_ToolBar: {
+    QRect r = w->rect();
+    bool horiz = opt->state & State_Horizontal;
+    drawBackground( p, r, opt->palette.color( QPalette::Window ), true, true, horiz );
+    p->setRenderHint( QPainter::Antialiasing, false );
+    drawBorder( p, r, horiz );
+    break;
+  }
+  default:
+    QWindowsStyle::drawControl( ce, opt, p, w );
+    break;
+  }
+}
+
+/*!
+  \brief Draws the given primitive element with the provided painter \p using the style options specified by \a opt.
+  \param pe primitive type
+  \param opt style option
+  \param p painter
+  \param w widget (optional)
+*/
+void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
+                                 QPainter* p, const QWidget* w ) const
+{
+  if ( checkDebugLevel(6) ) {
+    QWindowsStyle::drawPrimitive( pe, opt, p, w );
+    return;
+  }
+
+  const QPalette& pal = opt->palette;
+  bool doRestore = false;
+  switch ( pe ) {
+    case PE_FrameMenu:
+      if (qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
+        QColor aBtnCol = opt->palette.color( QPalette::Window ),
+               top =    aBtnCol.light( BUT_PERCENT_ON ),
+               bottom = aBtnCol.dark( BUT_PERCENT_ON );
+       QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        Style_Tools::shadowRect( p, opt->rect, 0, 0., SHADOW, Style_Tools::All, top,
+                                 bottom, aBrdTopCol, aBrdBotCol, false, false, false, false );
+        break;
+      }
+    case PE_PanelButtonTool : {
+      if ( w && ( opt->state & State_Enabled ) && 
+           ( ( qobject_cast<QToolBar*>( w->parentWidget() ) ) ||
+            ( w->inherits("QDockWidgetTitleButton") ) ||
+             ( w->inherits("QtxWorkstackAreaTitleButton") ) ) ) {
+        bool aStateOn = opt->state & (State_Sunken | State_On);
+        bool aHighWdg = model()->widgetEffect() == Style_Model::HighlightEffect;
+        if ( !aStateOn && aHighWdg && (opt->state & State_Enabled) &&
+             (opt->state & State_MouseOver) )
+          drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), 0, Style_Tools::All, true);
+        else {
+          QColor aBtnCol = opt->palette.color( QPalette::Window );
+         QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
+         QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+          QColor top =    aBtnCol.light( BUT_PERCENT_COL ),
+                 bottom = aBtnCol.dark( BUT_PERCENT_COL );
+          Style_Tools::shadowRect( p, opt->rect, 0.0, 0, SHADOW, Style_Tools::All, top, bottom,
+           aBrdTopCol, aBrdBotCol, model()->antialiasing(), true, aStateOn );
+       }
+       break;
+      }
+      else
+        QWindowsStyle::drawPrimitive( pe, opt, p, w );
+    }
+    break;
+    case PE_FrameFocusRect: {
+      if (w && qobject_cast<QTabBar*>((QWidget*)w)) {
+        QTabBar* tabBar = qobject_cast<QTabBar*>((QWidget*)w);
+       QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
+       QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+        bool isHover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
+        Style_Tools::tabRect( p, opt->rect, (int)tabBar->shape(),
+                              model()->widgetRounding( Style_Model::FrameRadius ), DELTA_H_TAB,
+                              pal.color( QPalette::Window ),
+                              model()->color( Style_Model::BorderTop ), // Style_Model::border_bot_clr
+                              aBrdTopCol, aBrdBotCol, false, false, isHover, true );
+      }
+      else {
+       QWindowsStyle::drawPrimitive( pe, opt, p, w );
+      }
+      break;
+    }
+    case PE_IndicatorArrowRight:
+    case PE_IndicatorArrowLeft:
+    case PE_IndicatorArrowUp:
+    case PE_IndicatorArrowDown:
+    case PE_IndicatorSpinUp:
+    case PE_IndicatorSpinDown:
+    case PE_IndicatorSpinPlus:
+    case PE_IndicatorSpinMinus: {
+      QRect rect = opt->rect;
+      QColor pen, brush;
+      if ( opt->state & State_Enabled ) {
+       pen = model()->color( Style_Model::Pointer );    // Style_Model::pointer_clr
+       brush = opt->palette.color( QPalette::Button );
+        if ( ( opt->state & State_Sunken ) && (opt->state & State_Enabled ) )
+          rect.moveTo( rect.x()+1, rect.y()+1 );
+      } else {
+        pen = opt->palette.mid().color();
+       brush = pen;
+      }
+      if ( pe == PE_IndicatorSpinPlus || pe == PE_IndicatorSpinMinus )
+       Style_Tools::drawSign( pe, p, rect, pen, brush );
+      else
+       Style_Tools::drawArrow( pe, p, rect, pen, brush );
+      break;
+    }
+    case PE_IndicatorCheckBox: {
+      if ( hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver) )
+        drawHoverRect(p, w->rect(), opt->palette.color( QPalette::Window ),
+                     model()->widgetRounding( Style_Model::EditRadius ),
+                      Style_Tools::All, false);
+      QBrush fill;
+      if (opt->state & State_NoChange)
+        fill = QBrush( opt->palette.color( QPalette::Base ), Qt::Dense4Pattern);
+      else if (opt->state & ( State_Sunken | ~State_Enabled ) )
+        fill = opt->palette.color( QPalette::Window );
+      else if (opt->state & State_Enabled) {
+        if (!(opt->state & State_Off) )
+          fill = QBrush( model()->color( Style_Model::Checked ) ); // Style_Model::checked_clr
+        else
+          fill = QBrush( opt->palette.color( QPalette::Base ) );
+      }
+      else
+        fill = opt->palette.color( QPalette::Window );
+      p->save();
+      doRestore = true;
+      QColor color = fill.color();
+      QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+      QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+      if ( model()->antialiasing() )
+        p->setRenderHint( QPainter::Antialiasing, true );
+
+     // make sure the indicator is square
+      QRect ir = opt->rect;
+      if (opt->rect.width() < opt->rect.height()) {
+        ir.setTop(opt->rect.top() + (opt->rect.height() - opt->rect.width()) / 2);
+        ir.setHeight(opt->rect.width());
+      } else if (opt->rect.height() < opt->rect.width()) {
+        ir.setLeft(opt->rect.left() + (opt->rect.width() - opt->rect.height()) / 2);
+        ir.setWidth(opt->rect.height());
+      }
+
+      Style_Tools::shadowCheck( p, ir, 2., Style_Tools::All,
+                                color, color.dark( BUT_PERCENT_ON ), aBrdTopCol, aBrdBotCol );
+      if ( model()->antialiasing() )
+        p->setRenderHint( QPainter::Antialiasing, false );
+      if (opt->state & State_NoChange)
+        p->setPen(opt->palette.dark().color());
+      else
+        p->setPen(opt->palette.text().color());
+     } // Fall through!
+    case PE_IndicatorViewItemCheck:
+    case PE_Q3CheckListIndicator: {
+      if (!doRestore) {
+        p->save();
+        doRestore = true;
+      }
+      const QStyleOptionViewItem *itemViewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt);
+      p->setPen(itemViewOpt && itemViewOpt->showDecorationSelected
+               && opt->state & State_Selected ? opt->palette.highlightedText().color()
+               : opt->palette.text().color());
+      if (opt->state & State_NoChange)
+       p->setBrush( opt->palette.color( QPalette::Button ) );
+      p->drawRect(opt->rect.x() + 1, opt->rect.y() + 1, 11, 11);
+      if (!(opt->state & State_Off)) {
+        QLineF lines[11];
+        int i, xx, yy;
+        xx = opt->rect.x() + 4;
+        yy = opt->rect.y() + 5;
+        for (i = 0; i < 3; ++i) {
+          lines[i] = QLineF(xx, yy, xx, yy + 2);
+          ++xx;
+          ++yy;
+        }
+        yy -= 2;
+        for (i = 3; i < 11; ++i) {
+          lines[i] = QLineF(xx, yy, xx, yy+2);
+          ++xx;
+          --yy;
+        }
+        QColor aColor = model()->color( Style_Model::Pointer ); // Style_Model::pointer_clr
+        if ( !(opt->state & State_Enabled ) )
+          aColor = opt->palette.mid().color();
+       if ( opt->state & State_Selected && itemViewOpt && itemViewOpt->showDecorationSelected )
+          aColor = opt->palette.highlightedText().color();
+
+        p->setPen( QPen( aColor ) );
+        p->drawLines(lines, 11);
+      }
+
+      if (doRestore)
+          p->restore();
+      break;
+    }
+    case PE_IndicatorRadioButton: {
+      if ( hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver) )
+        drawHoverRect(p, w->rect(), opt->palette.color( QPalette::Window ), 
+                     model()->widgetRounding( Style_Model::ButtonRadius ),
+                      Style_Tools::All, false);
+#define PTSARRLEN(x) sizeof(x)/(sizeof(QPoint))
+      static const QPoint pts_border[] = {              // border line
+        QPoint(1, 9),  QPoint(1, 8),  QPoint(0, 7),  QPoint(0, 4),  QPoint(1, 3),  QPoint(1, 2),
+        QPoint(2, 1),  QPoint(3, 1),  QPoint(4, 0),  QPoint(7, 0),  QPoint(8, 1),  QPoint(9, 1),
+        QPoint(10, 2), QPoint(10, 3), QPoint(11, 4), QPoint(11, 7), QPoint(10, 8), QPoint(10, 9), 
+        QPoint(9, 10), QPoint(8, 10), QPoint(7, 11), QPoint(4, 11), QPoint(3, 10), QPoint(2, 10)
+      };
+     // make sure the indicator is square
+      QRect ir = opt->rect;
+      if (opt->rect.width() < opt->rect.height()) {
+        ir.setTop(opt->rect.top() + (opt->rect.height() - opt->rect.width()) / 2);
+        ir.setHeight(opt->rect.width());
+      } else if (opt->rect.height() < opt->rect.width()) {
+        ir.setLeft(opt->rect.left() + (opt->rect.width() - opt->rect.height()) / 2);
+        ir.setWidth(opt->rect.height());
+      }
+      p->save();
+      bool down = opt->state & State_Sunken;
+      bool enabled = opt->state & State_Enabled;
+      bool on = opt->state & State_On;
+      QPolygon a;
+      p->translate(ir.x(), ir.y());
+
+      if ( down || !enabled ) {
+        QColor fillColor = opt->palette.color( QPalette::Window );
+        p->setPen( fillColor );
+        p->setBrush( fillColor );
+      }
+      else {
+        QColor fillColor =  opt->palette.color( QPalette::Base );
+        if ( enabled && on )
+         fillColor = model()->color( Style_Model::Checked ); // Style_Model::checked_clr
+        QLinearGradient gr( 3, 3, 8, 8 );
+        gr.setColorAt( 0.0, fillColor.dark( BUT_PERCENT_ON ) );
+        gr.setColorAt( 1.0, fillColor );
+        p->setPen( fillColor.dark( BUT_PERCENT_ON ) );
+        p->setBrush( gr );
+      }
+      p->drawPolygon(pts_border, PTSARRLEN(pts_border));
+      int aSize = PTSARRLEN(pts_border),
+          aHalfSize = (int)aSize/2;
+      if ( model()->antialiasing() )
+        p->setRenderHint( QPainter::Antialiasing, true );
+      p->setPen( model()->color( Style_Model::BorderTop) );     // Style_Model::border_top_clr
+      p->drawPolyline(pts_border, aHalfSize);
+      p->setPen( model()->color( Style_Model::BorderBottom ) ); // Style_Model::border_bot_clr
+      QPolygon aPolygon;
+      for ( int i = aHalfSize; i < aSize; i++ )
+        aPolygon << pts_border[i];
+      p->drawPolyline( aPolygon );
+      if ( model()->antialiasing() )
+        p->setRenderHint( QPainter::Antialiasing, false );
+
+      if (on) {
+        QColor aPointerCol = model()->color( Style_Model::Pointer ); // Style_Model::pointer_clr
+        if ( !enabled )
+          aPointerCol = opt->palette.mid().color();
+        p->setPen( Qt::NoPen );
+        p->setBrush( aPointerCol );
+        p->drawRect( 5, 4, 2, 4 );
+        p->drawRect( 4, 5, 4, 2 );
+      }
+
+      p->translate(-ir.x(), -ir.y()); // restore translate
+      p->restore();
+      break;
+    }
+    case PE_FrameDockWidget:
+      if ( qstyleoption_cast<const QStyleOptionFrame *>(opt))
+        QCommonStyle::drawPrimitive( pe, opt, p, w );
+      break;
+    case PE_FrameLineEdit:
+    case PE_PanelLineEdit: {
+      if ( w ) {
+        if ( qobject_cast<const QComboBox*>( w->parentWidget() ) ||
+             qobject_cast<const QAbstractSpinBox*>( w->parentWidget() ) )
+          break;
+      }
+      if ( pe == PE_FrameLineEdit ) {
+        QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
+        double aRad = model()->widgetRounding( Style_Model::EditRadius );
+        if ( hover )
+          drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, true);
+        else {
+          Style_Tools::shadowRect( p, opt->rect, aRad, LINE_GR_MARGIN, SHADOW,
+                                  Style_Tools::All, opt->palette.color( QPalette::Base ), // getColor( Style_Model::fld_light_clr ),
+                                   model()->color( Style_Model::FieldDark ), aBrdTopCol, aBrdBotCol,
+                                   model()->antialiasing(), false );
+        }
+      }
+      else {
+        if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
+          QRect rect = panel->rect.adjusted( panel->lineWidth,  panel->lineWidth,
+                                             -panel->lineWidth, -panel->lineWidth);
+         if ( w->inherits("QLineEdit") && panel->lineWidth > 0 ) {
+            drawPrimitive( PE_FrameLineEdit, panel, p, w );
+         }
+          else {
+           QColor c = panel->palette.color(QPalette::Base); c.setAlpha(255);
+            p->fillRect( rect, c ); // panel->palette.brush(QPalette::Base)
+         }
+       }
+      }
+      break;
+    }
+    case PE_FrameTabWidget: {
+      if (w && qobject_cast<QTabWidget*>((QWidget*)w)) {
+        QTabWidget* tabW = qobject_cast<QTabWidget*>((QWidget*)w);
+        int aRoundType = Style_Tools::BottomRight;
+        QTabWidget::TabPosition aTabPos = tabW->tabPosition();
+        if ( aTabPos != QTabWidget::North && aTabPos != QTabWidget::West )
+          aRoundType = aRoundType | Style_Tools::TopLeft;
+        if ( aTabPos != QTabWidget::South )
+          aRoundType = aRoundType | Style_Tools::BottomLeft;
+        if ( aTabPos != QTabWidget::East )
+          aRoundType = aRoundType | Style_Tools::TopRight;
+        QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
+       QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+        Style_Tools::shadowRect( p, opt->rect, model()->widgetRounding( Style_Model::FrameRadius ),
+                                 0., SHADOW, aRoundType,
+                                 model()->color( Style_Model::FieldLight ),
+                                 opt->palette.color( QPalette::Dark ),
+                                 aBrdTopCol, aBrdBotCol, false, false, false, false );
+        break;
+      }
+    }
+    case PE_IndicatorToolBarHandle: {
+      p->save();
+      QRect r = opt->rect;
+      bool horiz = opt->state & State_Horizontal;
+      QLinearGradient gr( r.x(), r.y(), horiz ? r.x() : r.right(), horiz ? r.bottom() : r.y() );
+      QColor aBgCol = opt->palette.color( QPalette::Window );
+      gr.setColorAt( 0.0, aBgCol.light( BUT_PERCENT_ON ) );
+      gr.setColorAt( 1.0, aBgCol );
+      p->fillRect( r, gr );
+      QRect aRect = QRect( r.x(), r.y(), r.width(), r.height() );
+      drawHandle( p, r, horiz, false );
+      p->restore();
+      break;
+    }
+    case PE_Widget: {
+      QWindowsStyle::drawPrimitive( pe, opt, p, w );
+      if ( !w )
+        break;
+      if( w->parent() && !qobject_cast<QMenuBar*>((QWidget*)w) )
+         break;
+      drawBackground( p, w->rect(), opt->palette.color( QPalette::Window ), false );
+      break;
+    }
+    case PE_FrameTabBarBase:
+      // for a tabbar that isn't part of a tab widget(dockWidgets for example).
+      if (const QStyleOptionTabBarBase *tbb
+          = qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) {
+        if (tbb->shape != QTabBar::RoundedNorth && tbb->shape != QTabBar::RoundedEast &&
+           tbb->shape != QTabBar::RoundedSouth && tbb->shape != QTabBar::RoundedWest) {
+          QWindowsStyle::drawPrimitive( pe, opt, p, w );
+          break;
+        }
+        QRect aSelRect = tbb->selectedTabRect;
+        // line under selected tab bar object
+        bool isSelected = opt->state & State_Selected;
+        QTabBar* tabBar = qobject_cast<QTabBar*>((QWidget*)w);
+        bool isLast = false;
+        if ( tabBar )
+          isLast = tabBar->currentIndex() == tabBar->count() -1;
+        QColor aColor = opt->palette.color( QPalette::Window );
+        QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
+       QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+        bool isHover = hasHover() && (opt->state & State_Enabled) &&
+                                     (opt->state & State_MouseOver);
+        QPainterPath aSelPath = Style_Tools::tabRect( p, aSelRect, (int)tbb->shape,
+                                                     model()->widgetRounding( Style_Model::FrameRadius ),
+                                                     DELTA_H_TAB, aColor, aColor,
+                            aColor, aColor, isSelected, isLast, isHover, false, false );
+        if ( !aSelPath.isEmpty() )
+          aSelRect = aSelPath.controlPointRect().toRect();
+        QStyleOptionTabBarBase* copyOpt = (QStyleOptionTabBarBase*)tbb;
+        copyOpt->selectedTabRect = aSelRect;
+       QCommonStyle::drawPrimitive( pe, copyOpt, p, w );
+        break;
+      }
+    case PE_IndicatorBranch: {
+        // This is _way_ too similar to the common style.
+        static const int decoration_size = 9;
+        int mid_h = opt->rect.x() + opt->rect.width() / 2;
+        int mid_v = opt->rect.y() + opt->rect.height() / 2;
+        int bef_h = mid_h;
+        int bef_v = mid_v;
+        int aft_h = mid_h;
+        int aft_v = mid_v;
+        if (opt->state & State_Children) {
+            int delta = decoration_size / 2;
+            bef_h -= delta;
+            bef_v -= delta;
+            aft_h += delta;
+            aft_v += delta;
+            p->drawLine(bef_h + 2, bef_v + 4, bef_h + 6, bef_v + 4);
+            if (!(opt->state & State_Open))
+                p->drawLine(bef_h + 4, bef_v + 2, bef_h + 4, bef_v + 6);
+            QPen oldPen = p->pen();
+            p->setPen(opt->palette.dark().color());
+            p->drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1);
+            p->setPen(oldPen);
+        }
+        QBrush brush(opt->palette.dark().color(), Qt::Dense4Pattern);
+        if (opt->state & State_Item) {
+            if (opt->direction == Qt::RightToLeft)
+                p->fillRect(opt->rect.left(), mid_v, bef_h - opt->rect.left(), 1, brush);
+            else
+                p->fillRect(aft_h, mid_v, opt->rect.right() - aft_h + 1, 1, brush);
+        }
+        if (opt->state & State_Sibling)
+            p->fillRect(mid_h, aft_v, 1, opt->rect.bottom() - aft_v + 1, brush);
+        if (opt->state & (State_Open | State_Children | State_Item | State_Sibling))
+            p->fillRect(mid_h, opt->rect.y(), 1, bef_v - opt->rect.y(), brush);
+        break;
+      }
+    case PE_IndicatorDockWidgetResizeHandle: {
+      QRect r = opt->rect;
+      drawBorder( p, r, opt->state & State_Horizontal );
+      bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
+      if ( hover )
+          drawHoverRect(p, r, opt->palette.color( QPalette::Window ), 0, Style_Tools::All, false);
+      bool horiz = r.width() > r.height();
+      int aLen = model()->splitHandleLength();
+      if ( horiz )
+        r = QRect( r.x() +(int)((r.width()-aLen)/2), r.y(), aLen, r.height());
+      else
+        r = QRect( r.x(), r.y() +(int)((r.height()-aLen)/2), r.width(), aLen);
+      drawHandle( p, r, horiz, true );
+      break;
+    }
+    case PE_Frame: {
+      QWidget* aWdg = (QWidget*)w;
+      if ( qobject_cast<QTextEdit*>(aWdg) || qobject_cast<QTreeView*>(aWdg) ||
+           qobject_cast<QListView*>(aWdg) ) {
+        QRect r = opt->rect;
+        if ( qobject_cast<QTreeView*>(aWdg) ) {
+          QTreeView* trView = qobject_cast<QTreeView*>(aWdg);
+          QHeaderView* aHeader = trView->header();
+          if ( aHeader && aHeader->isVisible() ) {
+            int aHeight = aHeader->contentsRect().height();
+            r = QRect( r.x(), r.y()+aHeight, r.width(), r.height()-aHeight );
+          }
+        }
+        QPalette aPal = aWdg->palette();
+        double aMarg = LINE_GR_MARGIN;
+        QColor base = model()->color( Style_Model::Base ), // Style_Model::pal_base_clr
+         light = base,
+         light_alt = base.dark(110),//AlternateBase color
+         dark  = model()->color( Style_Model::FieldDark ); // Style_Model::fld_dark_clr
+        //light.setAlpha( 0 ); // VSR commented: IPAL19262
+        QLinearGradient gr_h(r.x(), r.y(), r.right(), r.y());
+        gr_h.setColorAt( 0.0, dark );
+        gr_h.setColorAt( aMarg / r.width(), light );
+        gr_h.setColorAt( 1.0, light );
+        QLinearGradient gr_v(r.x(), r.y(), r.x(), r.bottom() );
+        gr_v.setColorAt( 0.0, dark );
+        gr_v.setColorAt( aMarg / r.height(), light );
+        gr_v.setColorAt( 1.0, light );
+        // draw frame
+        p->fillRect( r, base );
+        p->fillRect( r, gr_h );
+       p->fillRect( r, gr_v );
+        aPal.setBrush( QPalette::Base, QBrush( light ) );
+
+        QLinearGradient gr_alt(r.x(), r.y(), r.right(), r.y());
+        gr_alt.setColorAt( 0.0, dark );
+        gr_alt.setColorAt( (aMarg)*2/3/r.width(), light_alt );
+        gr_alt.setColorAt( 1.0, light_alt );
+        aPal.setBrush( QPalette::AlternateBase, QBrush( gr_alt ) );
+        aWdg->setPalette( aPal );
+      }
+      QWindowsStyle::drawPrimitive( pe, opt, p, w );
+      break;
+    }
+    default:
+      QWindowsStyle::drawPrimitive( pe, opt, p, w );
+  }
+}
+
+/*!
+  \brief Returns the value of the given pixel \a metric.
+  \param metric metric type
+  \param opt style option
+  \param w widget
+  \return metric value
+*/
+int Style_Salome::pixelMetric( PixelMetric metric, const QStyleOption* opt,
+                              const QWidget* w ) const
+{
+  if ( checkDebugLevel(7) ) {
+    return QWindowsStyle::pixelMetric( metric, opt, w );
+  }
+
+  int aRes = QWindowsStyle::pixelMetric( metric, opt, w );
+  switch( metric ) {
+    case PM_SliderLength: {
+      aRes += (int)((double)model()->sliderSize()/2);
+      break;
+    }
+    case PM_DockWidgetFrameWidth:
+      aRes = 1;
+    break;
+    case PM_DockWidgetSeparatorExtent:
+      aRes = 8;
+    break;
+    case PM_DockWidgetTitleMargin:
+      aRes = 2;
+    break;
+    case PM_SplitterWidth:
+      aRes = 6;
+    break;
+    default:
+    break;
+  }
+  return aRes;
+}
+
+/*!
+  \brief Returns the size of the element described by the specified option \a opt 
+  and type \a ct, based on the provided \a contentsSize.
+  \param ct contents type
+  \param opt style option
+  \param contentsSize contents size
+  \param w widget (optional)
+  \return size of the element
+*/
+QSize Style_Salome::sizeFromContents( ContentsType ct, const QStyleOption* opt,
+                                      const QSize& contentsSize, const QWidget* w ) const
+{
+  if ( checkDebugLevel(8) ) {
+    return QWindowsStyle::sizeFromContents( ct, opt,contentsSize, w );
+  }
+
+  QSize sz = QWindowsStyle::sizeFromContents( ct, opt, contentsSize, w );
+  switch (ct) {
+    case CT_TabBarTab:
+      if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
+        if ( tab->position == QStyleOptionTab::End ||
+             tab->position == QStyleOptionTab::OnlyOneTab ) {
+          if ( tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedSouth ) {
+            int aDelta = (int)(opt->rect.height()*DELTA_H_TAB/2);
+            sz.setWidth( sz.width() + aDelta );
+         }
+          if ( tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::RoundedWest ) {
+            int aDelta = (int)(opt->rect.width()*DELTA_H_TAB/2);
+            sz.setHeight( sz.height() + aDelta );
+         }
+        }
+        break;
+      }
+      break;
+      case CT_Slider: {
+        int aValue = model()->sliderSize();
+        sz.setWidth( sz.width() + aValue );
+        sz.setHeight( sz.height() + aValue );
+        break;
+      }
+      case CT_ComboBox:
+        if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
+          QRect res = QRect( 0, 0, sz.width(), sz.height() );
+          int aHalfRect = (int)Style_Tools::getMaxRect( res, 
+                             (int)model()->widgetRounding( Style_Model::EditRadius )/2 ); // left value
+          QRect old_arrow = QWindowsStyle::subControlRect( CC_ComboBox, cmb,
+                                                           SC_ComboBoxArrow, w );
+          int aDelta = res.height() - old_arrow.width(); // right value
+          if ( cmb->editable )
+            aDelta += aHalfRect; // for right of line edit internal
+          sz.setWidth( res.width() + aDelta + aHalfRect );
+        }
+       break;
+      default:
+      break;
+  }
+  return sz;
+}
+
+/*!
+  \brief Returns a pixmap for the given \a standardPixmap.
+  \param stPixmap standard pixmap type
+  \param opt style option
+  \param w widget (optional)
+  \return standard pixmap
+*/
+QPixmap Style_Salome::standardPixmap(StandardPixmap stPixmap, const QStyleOption *opt,
+                                     const QWidget *w) const
+{
+  if ( checkDebugLevel(9) ) {
+    return QWindowsStyle::standardPixmap( stPixmap, opt, w );
+  }
+
+  switch ( stPixmap )
+  {
+  case SP_DockWidgetCloseButton:
+  case SP_TitleBarCloseButton:
+    return QPixmap( cross_xpm );
+  case SP_TitleBarMaxButton:
+    return QPixmap( maximize_xpm );
+  case SP_TitleBarNormalButton:
+    return QPixmap( normal_xpm );
+  case SP_TitleBarMinButton:
+    return QPixmap( minimize_xpm );
+  default:
+    return QWindowsStyle::standardPixmap( stPixmap, opt, w );
+  }
+}
+
+/*!
+  \brief Returns an icon for the given \a standardIcon.
+  \param standardIcon standard icon type
+  \param opt style option
+  \param w widget (optional)
+  \return standard icon
+*/
+QIcon Style_Salome::standardIconImplementation( StandardPixmap standardIcon, 
+                                               const QStyleOption* opt,
+                                               const QWidget* w ) const
+{
+  if ( checkDebugLevel(10) ) {
+    return QWindowsStyle::standardIconImplementation( standardIcon, opt, w );
+  }
+
+  switch ( standardIcon )
+  {
+  case SP_MessageBoxInformation:
+    return QPixmap( ":/images/information.png" );
+  case SP_MessageBoxWarning:
+    return QPixmap( ":/images/warning.png" );
+  case SP_MessageBoxCritical:
+    return QPixmap( ":/images/critical.png" );
+  case SP_MessageBoxQuestion:
+    return QPixmap( ":/images/question.png" );
+  default:
+    break;
+  }
+  return QWindowsStyle::standardIconImplementation( standardIcon, opt, w );
+}
+
+/*!
+  \brief Returns an integer representing the specified style \a hint for the
+  given widget \a w described by the provided style option \a opt.
+  \param hint hint type
+  \param opt style option
+  \param w widget (optional)
+  \param returnData (currently not used)
+  \return style hint value
+*/
+int Style_Salome::styleHint( StyleHint hint, const QStyleOption* opt, const QWidget* w,
+                            QStyleHintReturn* returnData ) const
+{
+  if ( checkDebugLevel(11) ) {
+    return QWindowsStyle::styleHint( hint, opt, w, returnData );
+  }
+
+  int aRes = QWindowsStyle::styleHint( hint, opt, w, returnData );
+  switch( hint ) {
+    case SH_Table_GridLineColor: {
+      if ( opt )
+        aRes = model()->color( Style_Model::GridLine ).rgb(); // Style_Model::tbl_grline_clr
+      else
+        return aRes;
+      break;
+    }
+    default:
+      break;
+  }
+  return aRes;
+}
+
+/*!
+  \brief Get the rectangle containing the specified subcontrol \a sc of the given
+  complex control \a cc (with the style specified by option \a opt). 
+  The rectangle is defined in screen coordinates.
+  \param cc complex control type
+  \param opt style option
+  \param sc subcontrol type
+  \param wid widget (optional)
+  \return subcontrol rectangle
+*/
+QRect Style_Salome::subControlRect( ComplexControl cc, const QStyleOptionComplex* opt,
+                                   SubControl sc, const QWidget* wid ) const
+{
+  if ( checkDebugLevel(12) ) {
+    return QWindowsStyle::subControlRect( cc, opt, sc, wid );
+  }
+
+  QRect res = QWindowsStyle::subControlRect( cc, opt, sc, wid );
+  switch ( cc ) {
+    case CC_SpinBox: {
+      int x = res.x(), w = res.width(), h = res.height();
+      if ( sc==SC_SpinBoxUp || sc==SC_SpinBoxDown ) {
+        QRect frame_r = QWindowsStyle::subControlRect( cc, opt, SC_SpinBoxFrame, wid );
+        h = frame_r.height();
+        res.setX( x+w-h );
+        res.setWidth( h );
+      }
+      else if ( sc==QStyle::SC_SpinBoxEditField ) {
+        res.setWidth( w-h );
+        res.setTopLeft( QPoint( res.x(), res.y()-SHADOW ) );
+      }
+      break;
+    }
+    case CC_ComboBox: {
+      if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
+        res = cb->rect;
+        int aHalfRect = (int)Style_Tools::getMaxRect( res, (int)model()->widgetRounding( Style_Model::EditRadius )/2 );
+        int x = res.x(), w = res.width(), h = res.height();
+        switch( sc ) {
+          case SC_ComboBoxEditField: {
+            res.setWidth( w-h );
+            int aX = res.x();
+            if ( !cb->editable )
+              aX += aHalfRect;
+            res.setTopLeft( QPoint( aX, res.y()-SHADOW ) );
+            break;
+          }
+          case SC_ComboBoxArrow: {
+            res.setX( x+w-h );
+            res.setWidth( h );
+            break;
+          }
+        }
+      }
+      break;
+    }
+    case CC_ScrollBar:
+      if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
+        QRect slider_r = QWindowsStyle::subControlRect( cc, opt, SC_ScrollBarSlider, wid );
+        int aRect = Style_Tools::getMaxRect( slider_r, (int)model()->widgetRounding( Style_Model::ButtonRadius ) );
+        switch( sc ) {
+          case SC_ScrollBarSubPage:            // between top/left button and slider
+            if (scrollbar->orientation == Qt::Horizontal)
+              res.setRight( res.right()+aRect+1 );
+            else
+              res.setBottom( res.bottom()+aRect+1 );
+            break;
+          case SC_ScrollBarAddPage:            // between bottom/right button and slider
+            if (scrollbar->orientation == Qt::Horizontal)
+              res.setLeft( res.left() - aRect - 1 );
+            else
+              res.setTop( res.top() - aRect - 1);
+          break;
+         default:
+           break;
+        }
+        break;
+      }
+    case CC_Slider: {
+      if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
+        switch ( sc ) {
+          case SC_SliderGroove: {
+            if ( slider->orientation == Qt::Horizontal ) {
+              res.setLeft( res.left()+DELTA_SLIDER );
+              res.setRight( res.right()-DELTA_SLIDER );
+            }
+            else {
+              res.setTop( res.top()+DELTA_SLIDER );
+              res.setBottom( res.bottom()-DELTA_SLIDER );
+            }
+            break;
+          }
+        }
+      }
+    }
+  }
+  return res;
+}
+
+/*!
+  \brief Returns the sub-area for the given element \a se as described 
+  in the provided style option \a opt.
+  The returned rectangle is defined in screen coordinates.
+  \param se subelement type
+  \param opt style option
+  \param wid widget (optional)
+  \return subelement rectangle
+*/
+QRect Style_Salome::subElementRect( SubElement se, const QStyleOption* opt,
+                                   const QWidget* wid ) const
+{
+  if ( checkDebugLevel(13) ) {
+    return QWindowsStyle::subElementRect( se, opt, wid );
+  }
+
+  QRect res = QWindowsStyle::subElementRect( se, opt, wid );
+  int aHalfRect = (int)Style_Tools::getMaxRect( res, (int)model()->widgetRounding( Style_Model::EditRadius )/2 );
+  int w = res.width(), h = res.height();
+  switch ( se ) {
+    case SE_ComboBoxFocusRect: {
+      QRect old_r = QWindowsStyle::subControlRect( CC_ComboBox,
+                     qstyleoption_cast<const QStyleOptionComplex*>( opt ),
+                     SC_ComboBoxArrow, wid );
+      int old_w = old_r.width();
+      res.setWidth( w-h+old_w-2 );
+      break;
+    }
+    case SE_LineEditContents: {
+      res.setTopLeft( QPoint( res.x()+aHalfRect, res.y()-SHADOW ) );
+      res.setTopRight( QPoint( res.right()-aHalfRect, res.y() ) );
+      break;
+    }
+    case SE_ProgressBarLabel:
+    case SE_ProgressBarContents:
+    case SE_ProgressBarGroove:
+      return opt->rect;
+  }
+  if( qobject_cast<const QRadioButton*>(wid) ||
+      qobject_cast<const QCheckBox*>(wid) ) {
+      if( hasHover() )
+        res = res.adjusted(0, 0, 2, 0);
+  }
+  return res;
+}
+
+/*!
+  \brief Update palette colors from style model
+*/
+void Style_Salome::updatePaletteColors()
+{
+  QPalette pal = QApplication::palette();
+  // colors
+  for ( int i = (int)QPalette::Active; i <= (int)QPalette::Inactive; i++ ) {
+    for ( int j = (int)Style_Model::WindowText; j < (int)Style_Model::NColorRoles; j++ ) {
+      if ( j == QPalette::NoRole ) continue;
+      pal.setColor( (QPalette::ColorGroup)i, (QPalette::ColorRole)j,
+                   model()->color( (Style_Model::ColorRole)j, (QPalette::ColorGroup)i ) );
+    }
+  }
+  QPixmapCache::clear();
+  QApplication::setPalette( pal );
+}
+
+/*!
+  \brief Update all widgets with the current style properties.
+  \param app application object
+*/
+void Style_Salome::updateAllWidgets( QApplication* app )
+{
+  if ( !app )
+    return;
+
+  QWidgetList all = app->allWidgets();
+  QWidget* w;
+  for (QWidgetList::ConstIterator it2 = all.constBegin(); it2 != all.constEnd(); ++it2) {
+    w = *it2;
+    if (w->windowType() != Qt::Desktop && w->testAttribute(Qt::WA_WState_Polished)
+       && !w->testAttribute(Qt::WA_SetStyle)) {
+      QEvent e(QEvent::StyleChange);
+      QApplication::sendEvent(w, &e);
+      polish( w );
+      w->update();
+    }
+  }
+}
+
+/*!
+  \brief Check if any widget effect is currently used
+  \return \c true if any widget effect is currently used
+*/
+bool Style_Salome::hasHover() const
+{
+  return model()->widgetEffect() != Style_Model::NoEffect;
+}
+
+/*!
+  \brief Draw rectangle for the hovered widget
+  \param p painter
+  \param r rectangle
+  \param bgCol background color
+  \param rad corners rounding radius
+  \param type shadow type
+  \param border if \c true border is colored with specific color
+*/
+void Style_Salome::drawHoverRect( QPainter* p, const QRect& r, const QColor& bgCol, const double rad,
+                                  const int type, const bool border ) const
+{
+  if ( !hasHover() )
+    return;
+  bool isAutoRaising = model()->widgetEffect() == Style_Model::AutoRaiseEffect;
+  bool isHighWdg     = model()->widgetEffect() == Style_Model::HighlightEffect;
+  QColor aBorder = model()->color( Style_Model::BorderTop ), // Style_Model::border_bot_clr
+         aCol, aBrdCol;
+  double aMargin = HIGH_WDG_MARGIN;
+  if  ( isAutoRaising ) {
+    aCol = bgCol;
+    aBrdCol = aCol.dark(BUT_PERCENT_ON);
+    if ( !border )
+      aBorder = aCol;
+    aMargin = 0;
+  }
+  else if ( isHighWdg ) {
+    aCol    = model()->color( Style_Model::HighlightWidget ); // Style_Model::high_wdg_clr
+    aBrdCol = model()->color( Style_Model::HighlightBorder ); // Style_Model::high_brd_wdg_clr
+    if ( !border )
+      aBorder = aBrdCol;
+  }
+  Style_Tools::highlightRect( p, r, rad, type, aMargin, aCol, aBrdCol, aBorder );
+}
+
+/*!
+  \brief Draw widget handle
+  \param p painter
+  \param r rectangle
+  \param horiz if \c true draw horizontal handle, otherwise draw vertical handle
+  \param isRect if \c true surrounding rectangle is also drawn
+*/
+void Style_Salome::drawHandle( QPainter* p, const QRect& r, bool horiz, bool isRect ) const
+{
+  QPixmap hole( (const char**)hole_xpm );
+  int i, j;
+  double d_hor = model()->handleDelta( Qt::Horizontal );
+  double d_ver = model()->handleDelta( Qt::Vertical );
+  if ( !d_hor || !d_ver || !r.width() || !r.height() )
+    return;
+  int c_hor = (int)(r.width()/d_hor)-1;
+  int c_ver = (int)(r.height()/d_ver)-1;
+  if ( c_hor+1 <= 0 || c_ver+1 <= 0 )
+    return;
+  // correction for delta value
+  d_hor = r.width()/(c_hor+1);
+  d_ver = r.height()/(c_ver+1);
+
+  double dd_hor = 0, dd_ver = 0;
+  if ( horiz ) {
+    for ( i = 0; i < c_hor; i++ ) {
+      for ( j = 0; j < c_ver; j++ ) {
+          p->drawPixmap( (int)( r.x() + dd_hor + ( i + 1 ) * d_hor  - 1 ),
+                         (int)( r.y() + dd_ver + ( j + 1 ) * d_ver - 1 ), hole );
+      }
+      if ( !isRect ) {
+        dd_ver += (int(d_ver)/2) + (int(d_ver)%2);
+        c_ver = c_ver - 1;
+      }
+    }
+  }
+  else {
+    for ( j = 0; j < c_ver; j++ ) {
+      for ( i = 0; i < c_hor; i++ ) {
+          p->drawPixmap( (int)( r.x() + dd_hor + ( i + 1 ) * d_hor  - 1 ),
+                         (int)( r.y() + dd_ver + ( j + 1 ) * d_ver - 1 ), hole );
+      }
+      if ( !isRect ) {
+        dd_hor += (int(d_hor)/2) + (int(d_hor)%2);
+        c_hor = c_hor - 1;
+      }
+    }
+  }
+}
+
+/*!
+  \brief Draw background.
+  \param p painter
+  \param r rectangle
+  \param bgCol background color
+  \param fill 'fill rectangle' flag
+  \param grad 'draw gradient' flag
+  \param horix 'draw horizontal item' flag (usefull for gradient background)
+*/
+void Style_Salome::drawBackground( QPainter* p, const QRect& r, const QColor& bgCol,
+                                   const bool fill, const bool grad, const bool horiz ) const
+{
+  if ( fill ) {
+    if ( !grad )
+      p->fillRect( r, bgCol );
+    else {
+      QLinearGradient gr( r.x(), r.y(), horiz ? r.x() : r.right(), horiz ? r.bottom() : r.y() );
+      gr.setColorAt( 0.0, bgCol.light( BUT_PERCENT_ON ) );
+      gr.setColorAt( 1.0, bgCol );
+      p->fillRect( r, gr );
+    }
+  }
+
+  int x = r.x(), y = r.y(), left = r.left(), top = r.top();
+  int w = r.width(), h = r.height();
+
+  QVector<QLine> lines;
+
+  switch ( model()->linesType() ) {
+  case Style_Model::Horizontal:
+    {
+      const int d = 3;
+      for ( int i = 0; i <= h; i += d )
+       lines.append( QLine( x, y+i, w, r.y()+i ) );
+    }
+    break;
+  case Style_Model::Inclined:
+    {
+      const int d = 5;
+      w = w/d*d;
+      h = h/d*d;
+      for ( int i = 0; i <= w; i += d )
+       lines.append( QLine( x+i, y, x, y+i ) );
+      for ( int i = 0; i < h; i += d )
+       lines.append( QLine( left+w-i, top+h, left+w, top+h-i ) );
+    }
+    break;
+  default:
+    break;
+  }
+
+  if ( !lines.isEmpty() ) {
+    QColor c = model()->color( Style_Model::Lines );
+    int anAlpha = (int)( 255*( 1 - model()->linesTransparency()/100 ) ); 
+    c.setAlpha( anAlpha );
+    p->setPen( c );
+    p->setRenderHint( QPainter::Antialiasing );
+    p->drawLines( lines );
+  }
+}
+
+/*!
+  \brief Draw border
+  \param p painter
+  \param r rectangle
+  \param horiz 'draw horizontal item' flag
+*/
+void Style_Salome::drawBorder( QPainter* p, const QRect& r, bool horiz ) const 
+{
+  QPen oldPen = p->pen();
+  QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
+  QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+  p->setPen( aBrdTopCol );
+  if (horiz) {
+    p->drawLine(r.left(),  r.top(), r.right(), r.top());
+    p->setPen(aBrdBotCol);
+    p->drawLine(r.left(), r.bottom(), r.right(), r.bottom());
+  }
+  else {
+    p->drawLine(r.left(), r.top(), r.left(), r.bottom());
+    p->setPen(aBrdBotCol);
+    p->drawLine(r.right(), r.top(), r.right(), r.bottom());
+  }
+  p->setPen(oldPen);
+}
+
+/*!
+  \brief Get corrected title text
+  \param txt original text
+  \param W possible width
+  \param H possible height
+  \param f used font
+  \return corrected title text
+*/
+QString Style_Salome::titleText( const QString& txt, const int W, const int H, QFont& f ) const
+{
+  QString res = txt.trimmed();
+
+  QFontMetrics fm( f );
+  while( fm.height() > H && f.pointSize()>1 )
+  {
+    f.setPointSize( f.pointSize()-1 );
+    fm = QFontMetrics( f );
+  }
+
+  if ( fm.width( res ) > W )
+  {
+    QString end( "..." );
+    while ( !res.isEmpty() && fm.width( res + end ) > W )
+      res.remove( res.length() - 1, 1 );
+
+    if ( !res.isEmpty() )
+      res += end;
+  }
+
+  return res;
+}
diff --git a/src/Style/Style_Salome.h b/src/Style/Style_Salome.h
new file mode 100644 (file)
index 0000000..75659e9
--- /dev/null
@@ -0,0 +1,100 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Style_Salome.h
+// Author : Natalia Ermolaeva, Open CASCADE S.A.S.
+//
+#ifndef STYLE_SALOME_H
+#define STYLE_SALOME_H
+
+#include "Style.h"
+
+#include <QWindowsStyle>
+
+class Style_Model;
+
+class QApplication;
+class QWidget;
+class QPainter;
+class QtxResourceMgr;
+
+class STYLE_SALOME_EXPORT Style_Salome : public QWindowsStyle
+{
+  Q_OBJECT
+
+private:
+  Style_Salome();
+
+public:
+  virtual ~Style_Salome();
+
+  static void         initialize( QtxResourceMgr* = 0, const QString& = QString() );
+  static void         apply();
+  static void         restore();
+
+  static bool         isActive();
+
+  static Style_Model* model();
+
+  static void         update();
+
+  virtual void        polish( QApplication* );
+  virtual void        polish( QWidget* );
+  virtual void        unpolish( QWidget* );
+  virtual void        drawComplexControl( ComplexControl, const QStyleOptionComplex*,
+                                         QPainter*, const QWidget* = 0 ) const;
+  
+  virtual void        drawControl( ControlElement, const QStyleOption*, QPainter*, const QWidget* ) const;
+  virtual void        drawPrimitive( PrimitiveElement, const QStyleOption*,
+                                    QPainter*, const QWidget* = 0 ) const;
+  virtual int         pixelMetric( PixelMetric, const QStyleOption* = 0,
+                                  const QWidget* = 0 ) const;
+  virtual QSize       sizeFromContents ( ContentsType, const QStyleOption*,
+                                        const QSize&, const QWidget* = 0 ) const;
+  virtual QPixmap     standardPixmap( StandardPixmap, const QStyleOption*,
+                                     const QWidget* = 0) const;
+  virtual int         styleHint( StyleHint, const QStyleOption* = 0,
+                                const QWidget* = 0, QStyleHintReturn* = 0 ) const;
+  virtual QRect       subControlRect( ComplexControl, const QStyleOptionComplex*,
+                                     SubControl, const QWidget* = 0 ) const;
+  virtual QRect       subElementRect( SubElement, const QStyleOption*, const QWidget* = 0 ) const;
+
+protected slots:
+  QIcon               standardIconImplementation( StandardPixmap, const QStyleOption* = 0,
+                                                 const QWidget* = 0 ) const;
+private:
+  void                updatePaletteColors();
+  void                updateAllWidgets( QApplication* );
+  bool                hasHover() const;
+  void                drawHoverRect( QPainter*, const QRect&, const QColor&, const double,
+                                    const int, const bool ) const;
+  void                drawHandle( QPainter*, const QRect&, bool, bool = true ) const;
+  void                drawBackground( QPainter*, const QRect&, const QColor&, const bool,
+                                     const bool = false, const bool = true ) const;
+  void                drawBorder( QPainter*, const QRect&, bool ) const;
+
+  QString             titleText( const QString&, const int, const int, QFont& ) const;
+
+private:
+  static Style_Model* myModel;
+};
+
+#endif // STYLE_SALOME_H
diff --git a/src/Style/Style_Tools.cxx b/src/Style/Style_Tools.cxx
new file mode 100644 (file)
index 0000000..8ba7c60
--- /dev/null
@@ -0,0 +1,838 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Style_Tools.cxx
+// Author : Natalia Ermolaeva, Open CASCADE S.A.S.
+//
+#include "Style_Tools.h"
+
+#include <QPainter>
+#include <QPainterPath>
+#include <QRect>
+#include <QColor>
+#include <QSize>
+#include <QTabWidget>
+
+/*!
+  \class Style_Tools
+  \brief A set of utility functions used by SALOME style to draw widgets
+*/
+
+/*!
+  \brief Create painter path for specified rectangle
+  \param r rectangle on which painter path is build
+  \return resulting painter path
+*/
+QPainterPath Style_Tools::painterPath( const QRect& r )
+{
+  QPainterPath res;
+  double x = r.x(), y = r.y(), right = r.right(), bottom = r.bottom();
+  res.moveTo( x, y );
+  res.lineTo( right, y );
+  res.lineTo( right, bottom );
+  res.lineTo( x, bottom );
+  res.closeSubpath();
+  return res;
+}
+
+/*!
+  \brief Create painter path by subtracting painter path \a path from another
+  painter path \a fromPath
+  \param fromPath initial painter path
+  \param path painter path being subtracted from \a fromPath
+  \return resulting painter path
+*/
+QPainterPath Style_Tools::substractPath( const QPainterPath& fromPath,
+                                         const QPainterPath& path )
+{
+  QPainterPath res;
+  QRegion aFromRegion( fromPath.toFillPolygon().toPolygon() );
+  QRegion aRegion( path.toFillPolygon().toPolygon() );
+  aFromRegion -= aRegion;
+  res.addRegion( aFromRegion );
+  return res;
+}
+
+/*!
+  \brief Create painter path basing on specified rectangle \a r with rounded corners
+  specified by radius \a r, operation \a type and shadow type \a shType.
+  \param r initial rectangle
+  \param rad rounding radius
+  \param type rounding type operation (Style_Tools::RoundType)
+  \param shType shadow type (Style_Tools::ShadowType)
+  \return resulting painter path
+*/
+QPainterPath Style_Tools::roundRect( const QRect& r, const double rad, int type,
+                                     int shType )
+{
+  QPainterPath res;
+  if ( type & None )
+    return painterPath( r );
+  double x = r.x(), y = r.y(), right = r.right(), bottom = r.bottom();
+  int aRad = getMaxRect( r, (int)rad );
+
+  if ( shType == WholePath || shType == TopPath ) {
+    if ( type & ( All | Left | BottomLeft ) ) {
+      res.moveTo( x+aRad, bottom );
+      res.arcTo( x, bottom-2*aRad, 2*aRad, 2*aRad, 270, -90 );
+    }
+    else
+      res.moveTo( x, bottom );
+    res.lineTo( x, y+aRad );
+    if ( type & (All | Left | TopLeft ) )
+      res.arcTo( x, y, 2*aRad, 2*aRad, 180, -90 );
+    else
+      res.lineTo( x, y );
+    res.lineTo( right-aRad, y );
+    if ( type & ( All | Right | TopRight ) )
+      res.arcTo( right-2*aRad, y, 2*aRad, 2*aRad, 90, -90 );
+    else
+      res.lineTo( right, y );
+  }
+  if ( shType == WholePath || shType == BottomPath ) {
+    if ( shType == BottomPath ) {
+      if ( type & ( All | Right | TopRight ) )
+        res.moveTo( right, y+aRad );
+      else
+        res.moveTo( right, y );
+    }
+    res.lineTo( right, bottom-aRad );
+    if ( type & ( All | Right | BottomRight ) )
+      res.arcTo( right-2*aRad, bottom-2*aRad, 2*aRad, 2*aRad, 0, -90 );
+    else
+      res.lineTo( right, bottom );
+
+    if ( type & ( All | Left | BottomLeft ) )
+      res.lineTo( x+aRad, bottom );
+    else
+      res.lineTo( x, bottom ); 
+  }
+  if ( shType == WholePath )
+    res.closeSubpath();
+  return res;
+}
+
+/*!
+  \brief Draw rectangle with rounded corners.
+  \param p painter
+  \param r drawing rectangle
+  \param rad corner rounding radius
+  \param type rounding type operation (Style_Tools::RoundType)
+  \param c1 first gradient color
+  \param c2 second gradient color
+  \param fill if \c true rectangle is filled with gradiented background according to \a c1 and \a c2
+  \param antial if \c true, rectangle corners are anti-aliased
+*/
+void Style_Tools::roundRect( QPainter* p, const QRect& r, const double rad, const int type,
+                             const QColor& c1, const QColor& c2, bool fill, bool antial )
+{
+  if ( antial )
+    p->setRenderHint( QPainter::Antialiasing );
+
+  QPainterPath path = roundRect( r, rad, type );
+
+  if ( fill ) {
+    QLinearGradient gr( r.x(), r.y(), r.x(), r.bottom() );
+    gr.setColorAt( 0.0, c1 );
+    gr.setColorAt( 0.5, c1 );
+    gr.setColorAt( 1.0, c2 );
+    p->fillPath( path, gr );
+  }
+  p->strokePath( path, QPen( c2, Qt::SolidLine ) );
+}
+
+/*!
+  \brief Draw rectangle with rounded corners and shadow.
+  \param p painter
+  \param r drawing rectangle
+  \param rad corner rounding radius
+  \param marg drawing margin
+  \param shad shadow size
+  \param type rounding type operation (Style_Tools::RoundType)
+  \param light background's first gradient color
+  \param dark background's second gradient color
+  \param border_top top-left border's color
+  \param border_bot bottom-right border's color
+  \param antialize if \c true, rectangle corners are anti-aliased
+  \param isButton \c true if button is drawn
+  \param btnOn \c true if button is drawn and it is pressed
+  \param fill if \c true rectangle is filled with gradiented background according to \a light and \a dark
+*/
+void Style_Tools::shadowRect( QPainter* p, const QRect& r, const double rad, const double marg,
+                              const int shad, int type, const QColor& light, const QColor& dark,
+                              const QColor& border_top, const QColor& border_bot, const bool antialize,
+                              const bool isButton, const bool btnOn, const bool fill )
+{
+  QColor aLight = light, aDark = dark, aBrdTop = border_top, aBrdBot = border_bot;
+  if ( isButton && btnOn ) {
+    aLight = dark;
+    aDark = light;
+    aBrdTop = border_bot;
+    aBrdBot = border_top;
+  }
+
+  // gradients
+  QLinearGradient
+    gr1( r.x(), r.y(), r.right(), r.y() ),
+    gr2( r.x(), r.y(), r.x(), r.bottom() );
+  if ( fill ) {
+    if ( isButton ) {
+      gr2.setColorAt( 0.0, aLight );
+      if ( marg > 0 )
+        gr2.setColorAt( marg / r.height(), aLight );
+      gr2.setColorAt( 1.0, aDark );
+    }
+    else {
+      QColor _c1 = aLight; _c1.setAlpha( 0 );
+      QColor _c2 = aDark;
+      gr1.setColorAt( 0.0, _c2 );
+      if ( marg > 0 )
+        gr1.setColorAt( marg / r.width(), _c1 );
+      gr1.setColorAt( 1.0, _c1 );
+      gr2.setColorAt( 0.0, _c2 );
+      if ( marg > 0 )
+        gr2.setColorAt( marg / r.height(), _c1 );
+      gr2.setColorAt( 1.0, _c1 );
+    }
+  }
+  // paths
+  int x = r.x(), y = r.y(), right = r.right(), bottom = r.bottom();
+  // main path
+  QRect rCont;
+  if ( antialize )
+   rCont = QRect( QPoint( x+shad, y+shad ), QPoint( right-shad, bottom-shad ) );
+  else
+    rCont = QRect( QPoint( x, y ), QPoint( right, bottom ) );
+
+  QPainterPath path = roundRect( rCont, rad, type );
+
+  // draw paths
+  p->save();
+  if ( antialize )
+    p->setRenderHint( QPainter::Antialiasing, true );
+  else
+    p->setRenderHint( QPainter::Antialiasing, false );
+
+  if( fill ) {
+    p->fillPath( path, aLight );
+    if ( !isButton )
+      p->fillPath( path, gr1 );
+    p->fillPath( path, gr2 );
+  }
+  if ( antialize )
+    p->strokePath( path, QPen( aBrdBot, Qt::SolidLine ) );
+
+  QPainterPath bottomPath = roundRect( rCont, rad, type, BottomPath ),
+               topPath = roundRect( rCont, rad, type, TopPath );
+  p->strokePath( bottomPath, aBrdBot );
+  p->strokePath( topPath, aBrdTop );
+
+  if ( antialize )
+      p->setRenderHint( QPainter::Antialiasing, false );
+  p->restore();
+}
+
+/*!
+  \brief Draw shadow of the check-mark
+  \param p painter
+  \param r drawing rectangle
+  \param rad corner rounding radius
+  \param type rounding type operation (Style_Tools::RoundType)
+  \param light background's first gradient color
+  \param dark background's second gradient color
+  \param border_top top-left border's color
+  \param border_bot bottom-right border's color
+*/
+void Style_Tools::shadowCheck( QPainter* p, const QRect& r, const double rad, const int type,
+                               const QColor& light, const QColor& dark,
+                               const QColor& border_top, const QColor& border_bot  )
+{
+  // main path
+  QPainterPath path = roundRect( r, rad, type );
+
+  QLinearGradient gr( r.x(), r.y(), r.right(), r.bottom() );
+  gr.setColorAt( 0.0, dark );
+  gr.setColorAt( 1.0, light );
+  p->fillPath( path, gr ); //fill
+
+  QPainterPath bottomPath = roundRect( r, rad, type, BottomPath ),
+               topPath = roundRect( r, rad, type, TopPath );
+  p->strokePath( bottomPath, border_bot );
+  p->strokePath( topPath, border_top );
+}
+
+/*!
+  \brief Draw rectnagle arrow
+  \param p painter
+  \param re drawing rectangle
+  \param frame frame color
+  \param gr1 background's first gradient color
+  \param gr2 background's second gradient color
+*/
+void Style_Tools::arrowRect( QPainter* p, const QRect& re, const QColor& frame,
+                             const QColor& gr1, const QColor& gr2 )
+{
+  QPainterPath path;
+  const int r = 4;
+  const double d = re.height()/2;
+
+  path.moveTo( re.x()+r,            re.y() );
+  path.lineTo( re.x()+re.width(),   re.y() );
+  path.lineTo( re.x()+re.width()+d, re.y()+d );
+  path.lineTo( re.x()+re.width(),   re.y()+re.height() );
+  path.lineTo( re.x()+r,            re.y()+re.height() );
+  path.arcTo ( re.x(),              re.y()+2*d-2*r, 2*r, 2*r, 270, -90 );
+  path.lineTo( re.x(),              re.y()+r );
+  path.arcTo ( re.x(),              re.y(), 2*r, 2*r, 180, -90 );
+  path.closeSubpath();
+
+  QLinearGradient gr( re.x(), re.y(), re.x(), re.y()+re.height() );
+  gr.setColorAt( 0.0, gr1 );
+  gr.setColorAt( 0.4, gr2 );
+  gr.setColorAt( 0.6, gr2 );
+  gr.setColorAt( 1.0, gr1 );
+
+  p->fillPath( path, gr );
+  p->strokePath( path, QPen( frame, Qt::SolidLine ) );
+}
+
+/*!
+  \brief Fill rectangle with gradiented background
+  \param p painter
+  \param re drawing rectangle
+  \param c1 background's first gradient color
+  \param c2 background's second gradient color
+*/
+void Style_Tools::fillRect( QPainter* p, const QRect& re, const QColor& c1,
+                            const QColor& c2, const int alpha )
+{
+  QLinearGradient gr( re.x(), re.y(), re.x()+re.width(), re.y()+re.height() );
+  QColor cc1 = c1, cc2 = c2;
+  cc1.setAlpha( alpha );
+  cc2.setAlpha( alpha );
+  gr.setColorAt( 0.0, cc1 );
+  gr.setColorAt( 1.0, cc2 );
+  p->fillRect( re, gr );
+}
+
+/*!
+  \brief Draw arrow (for example, for combo-box drop-down menu button)
+  \param type primitive type
+  \param p painter
+  \param r drawing rectangle
+  \param pen foreground painter pen
+  \param brush background painter brush
+*/
+void Style_Tools::drawArrow( QStyle::PrimitiveElement type, QPainter* p, const QRect& r,
+                             const QColor& pen, const QColor& brush )
+{
+  p->save();
+  QPainterPath arrow1;
+  int x = r.x(), y = r.y(), w = r.right()-x, h = r.bottom()-y;
+  int x11 = 0, x12 = 0, y11 = 0, y12 = 0;
+  int aDelta = qMin( (int)(w/3.5), (int)(h/3.5) );
+  int deltaX = aDelta, deltaY = aDelta;
+  QLineF line( 0, 0, 1, 0 );
+  int xc = r.center().x(), yc = r.center().y();
+  p->translate( xc, yc );
+  bool correct = false;
+  switch( type ) {
+    case QStyle::PE_IndicatorArrowDown:
+      correct = true;
+    case QStyle::PE_IndicatorArrowUp: {
+      int widthArr2 = (int)(deltaX/3.);
+      if ( correct )
+        deltaY = -deltaY; // change arrow direction
+      arrow1.moveTo(  0,          deltaY );
+      arrow1.lineTo(  widthArr2,  deltaY );
+      arrow1.lineTo(  widthArr2,  0 );
+      arrow1.lineTo(  deltaX,     0 );
+      arrow1.lineTo(  0,          -deltaY );
+      arrow1.lineTo( -deltaX,     0. );
+      arrow1.lineTo( -widthArr2,  0 );
+      arrow1.lineTo( -widthArr2, deltaY );
+      arrow1.lineTo(  0,         deltaY );
+      if ( correct )
+        deltaX = -deltaX;
+      x11 = -deltaX; y11 = -deltaY; x12 = deltaX; y12 = deltaY;
+      break;
+    }
+    case QStyle::PE_IndicatorArrowLeft: // to change
+      correct = true;
+    case QStyle::PE_IndicatorArrowRight: {
+      int widthArr2 = (int)(deltaX/3.);
+      if ( correct )
+        deltaX = -deltaX; // change arrow direction
+      arrow1.moveTo( -deltaX,  0 );
+      arrow1.lineTo( -deltaX,  widthArr2 );
+      arrow1.lineTo(  0,       widthArr2 );
+      arrow1.lineTo(  0,       deltaY );
+      arrow1.lineTo(  deltaX,  0 );
+      arrow1.lineTo(  0,      -deltaY );
+      arrow1.lineTo(  0,      -widthArr2 );
+      arrow1.lineTo( -deltaX, -widthArr2 );
+      arrow1.lineTo( -deltaX,  0 );
+      x11 = deltaX; y11 = deltaY; x12 = -deltaX; y12 = -deltaY;
+      break;
+    }
+    case QStyle::PE_IndicatorSpinDown:
+      correct = true;
+    case QStyle::PE_IndicatorSpinUp: {
+      aDelta = (int)(deltaY/2);
+      if ( correct ) {
+        aDelta = (int)(-aDelta/2);
+        deltaY = -deltaY;
+      }
+      arrow1.moveTo(  deltaX,     -aDelta );
+      arrow1.lineTo(  0,          -aDelta-deltaY );
+      arrow1.lineTo( -deltaX,     -aDelta );
+      arrow1.lineTo(  deltaX,     -aDelta );
+      if ( correct )
+        deltaX = -deltaX;
+      x11 = -deltaX, y11 = -deltaY, x12 = deltaX, y12 = 0;
+      break;
+    }
+    default:
+      p->restore();
+      return;
+  }
+  p->setPen( pen );
+  p->setBrush( brush );
+
+  QLinearGradient gr( x11, y11, x12, y12 );
+  gr.setColorAt( 0.0, pen );                // grayer
+  gr.setColorAt( 1.0, brush);               // lighter
+  p->fillPath( arrow1, gr );
+  p->strokePath( arrow1, QPen( pen, Qt::SolidLine ) );
+
+  p->restore();
+}
+
+/*!
+  \brief Draw indicator (for example, for spin box's increment/decrement buttons)
+  \param type primitive type
+  \param p painter
+  \param r drawing rectangle
+  \param pen foreground painter pen
+  \param brush background painter brush
+*/
+void Style_Tools::drawSign( QStyle::PrimitiveElement type, QPainter* p, const QRect& r,
+                           const QColor& pen, const QColor& brush )
+{
+  p->save();
+  QPainterPath sign;
+  int x = r.x(), y = r.y(), w = r.right()-x, h = r.bottom()-y;
+  int x11 = 0, x12 = 0, y11 = 0, y12 = 0;
+  int aDelta = qMin( (int)(w/3.5), (int)(h/3.5) );
+  int deltaX = aDelta, deltaY = aDelta;
+  QLineF line( 0, 0, 1, 0 );
+  int xc = r.center().x(), yc = r.center().y();
+  p->translate( xc, yc );
+  bool correct = false;
+  switch( type ) {
+    case QStyle::PE_IndicatorSpinMinus:
+      correct = true;
+    case QStyle::PE_IndicatorSpinPlus: {
+      aDelta = (int)(deltaY/2);
+      if ( correct ) {
+        aDelta = -aDelta;
+        deltaY = -deltaY;
+      }
+      if ( correct ) 
+       sign.moveTo(  deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3) );
+      else {
+       sign.moveTo(  aDelta/3,   -aDelta/2 );
+       sign.lineTo(  aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3) );
+       sign.lineTo(  deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3) );
+      }
+      
+      sign.lineTo(    deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
+      
+      if ( !correct ) {
+       sign.lineTo(  aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
+       sign.lineTo(  aDelta/3,   -aDelta/2-deltaY );
+       sign.lineTo( -aDelta/3,   -aDelta/2-deltaY );
+       sign.lineTo( -aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
+      }
+      
+      sign.lineTo(   -deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
+      sign.lineTo(   -deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3) );
+
+      if ( correct ) 
+       sign.lineTo(  deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3) );
+      else {
+       sign.lineTo( -aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3) );
+       sign.lineTo( -aDelta/3,   -aDelta/2 );
+       sign.lineTo(  aDelta/3,   -aDelta/2);
+      }
+
+      if ( correct )
+        deltaX = -deltaX;
+      x11 = -deltaX, y11 = -deltaY, x12 = deltaX, y12 = 0;
+      break;
+    }
+    default:
+      p->restore();
+      return;
+  }
+  p->setPen( pen );
+  p->setBrush( brush );
+
+  QLinearGradient gr( x11, y11, x12, y12 );
+  gr.setColorAt( 0.0, pen );                // grayer
+  gr.setColorAt( 1.0, brush);               // lighter
+  p->fillPath( sign, gr );
+  p->strokePath( sign, QPen( pen, Qt::SolidLine ) );
+
+  p->restore();
+}
+
+/*!
+  \brief Create painter path for tab bar and optionally draw it
+  \param p painter
+  \param r drawing rectangle
+  \param position tab position
+  \param rad rounding radius
+  \param delta gap between tabs
+  \param light background's first gradient color
+  \param dark background's second gradient color
+  \param border_top top-left border's color
+  \param border_bot bottom-right border's color
+  \param selected \c true if tab is selected
+  \param isLast \c true if tab is last in the tabs list
+  \param isHover \c true if tab is hovered
+  \param focusRect focus rectangle
+  \param draw if \c true, tab bar is drawn
+  \return tab bar's painter path
+*/
+QPainterPath Style_Tools::tabRect( QPainter* p, const QRect& r, const int position, const double rad,
+                                   const double delta, const QColor& light, const QColor& dark,
+                                   const QColor& border_top, const QColor& border_bot,
+                                   const bool selected, const bool isLast,  const bool isHover,
+                                   const bool focusRect, const bool draw )
+{
+  // paths
+  int x = r.x()+1, y = r.y()+1, right = r.right()+1, left = r.left()-1,
+      bottom = r.bottom()-1, top = r.top()+1;
+  int aDelta;
+  if ( position == QTabWidget::North || position == QTabWidget::South )
+    aDelta = (int)((bottom - top)*delta/2);
+  else
+    aDelta = (int)((right-left)*delta/2);  
+
+  int aRad = getMaxRect( r, (int)rad );
+
+  // main path
+  QPainterPath path, strokePath;
+  switch ( position ) {
+    case QTabWidget::North: {
+      path.moveTo( x, bottom );
+      path.lineTo( x, y+aRad );
+      path.arcTo( x, y, 2*aRad, 2*aRad, 180, -90 );
+      if ( isLast )
+        right = right - aDelta;
+      path.lineTo( right-aDelta, y );
+      path.lineTo( right+aDelta, bottom );
+      strokePath.moveTo( x, bottom );
+      strokePath.lineTo( right+aDelta, bottom );
+      break;
+    }
+    case QTabWidget::South: {
+      path.moveTo( x, y );
+      path.lineTo( x, bottom-aRad );
+      path.arcTo( x, bottom-2*aRad, 2*aRad, 2*aRad, 180, 90 );
+      if ( isLast )
+        right = right - aDelta;
+      path.lineTo( right-aDelta, bottom );
+      path.lineTo( right+aDelta, y );
+      strokePath.moveTo( x, y );
+      strokePath.lineTo( right+aDelta, y );
+      break;
+    }
+    case QTabWidget::West: {
+      path.moveTo( right, y );
+      path.lineTo( x+aRad, y );
+      path.arcTo( x, y, 2*aRad, 2*aRad, 90, 90 );
+      if ( isLast )
+        bottom = bottom - aDelta;
+      path.lineTo( x, bottom-aDelta );
+      path.lineTo( right, bottom+aDelta );
+      strokePath.moveTo( right, y );
+      strokePath.lineTo( right, bottom+aDelta );
+      break;
+    }
+    case QTabWidget::East: {
+      path.moveTo( x, y );
+      path.lineTo( right-aRad, y );
+      path.arcTo( right-2*aRad, y, 2*aRad, 2*aRad, 90, -90 );
+      if ( isLast )
+        bottom = bottom - aDelta;
+      path.lineTo( right, bottom-aDelta );
+      path.lineTo( x, bottom+aDelta );
+      strokePath.moveTo( x, y );
+      strokePath.lineTo( x, bottom+aDelta );
+      break;
+    }
+  }
+  if ( !draw )
+    return path;
+
+  // draw path
+  p->save();
+  p->setRenderHint( QPainter::Antialiasing, true );
+  if ( focusRect ) {
+    path.closeSubpath();
+    drawFocus( p, path, dark, false );
+  }
+  else {
+    QLinearGradient gr( x, y, x, bottom );
+    if ( selected ) {
+      gr.setColorAt( 0.0, light );
+      gr.setColorAt( 1.0, light );
+    }
+    else if ( isHover ) {
+      gr.setColorAt( 0.0, dark );
+      gr.setColorAt( 0.2, light );
+      gr.setColorAt( 0.8, light );
+      gr.setColorAt( 1.0, dark );
+      QLinearGradient gr_1( x, y, right, y );
+      QColor aLight = light;
+      aLight.setAlpha( 0 );
+      gr_1.setColorAt( 0.0, dark );
+      gr_1.setColorAt( 0.2, aLight );
+      gr_1.setColorAt( 0.7, aLight );
+      gr_1.setColorAt( 1.0, dark );
+      p->fillPath( path, gr );
+      p->fillPath( path, gr_1 );
+    }
+    else {
+      gr.setColorAt( 0.0, light );
+      gr.setColorAt( 0.3, dark );
+      gr.setColorAt( 0.7, dark );
+      gr.setColorAt( 1.0, light );
+    }
+    if ( !isHover || selected )
+      p->fillPath( path, gr );
+
+    QColor bordCol = border_top;
+    if ( position == QTabWidget::South || position == QTabWidget::East )
+      bordCol = border_bot;
+    else
+      bordCol = border_top;
+    p->strokePath( path, QPen( bordCol, Qt::SolidLine ) );
+    p->setRenderHint( QPainter::Antialiasing, false );
+    p->strokePath( strokePath, QPen( selected ? light : bordCol, Qt::SolidLine ) );
+  }
+  p->restore();
+  return path;
+}
+
+/*!
+  \brief Draw widget's focus
+  \param p painter
+  \param aRect drawing rectangle
+  \param rad rounding radius
+  \param type rounding operation type
+  \param border focus rectangle color
+*/
+void Style_Tools::drawFocus( QPainter* p, const QRect& aRect, const double rad, const int type,
+                             const QColor& border )
+{
+  QPainterPath path = Style_Tools::roundRect( aRect, rad, type );
+
+  drawFocus( p, path, border );
+}
+
+/*!
+  \brief Draw widget's focus
+  \param p painter
+  \param path drawing painter path
+  \param border focus rectangle color
+  \param line if \c true, focus is drawn as dotted line
+*/
+void Style_Tools::drawFocus( QPainter* p, const QPainterPath& path, const QColor& border,
+                             const bool line )
+{
+  QPen oldPen = p->pen();
+  QPen aPen = oldPen;
+  aPen.setColor( border );
+  if ( !line )
+    aPen.setStyle( Qt::DotLine );
+  p->setPen( aPen );
+
+  p->drawPath( path );
+  p->setPen( oldPen );
+}
+
+/*!
+  \brief Draw slider
+  \param p painter
+  \param r drawing rectangle
+  \param rad rounding radius
+  \param slider slider type
+  \param light background's first gradient color
+  \param dark background's second gradient color
+  \param border_top top-left border's color
+  \param border_bot bottom-right border's color
+*/
+void Style_Tools::drawSlider( QPainter* p, const QRect& r, const double rad,
+                              SliderType type, const QColor& light, const QColor& dark,
+                              const QColor& border_top, const QColor& border_bot )
+{
+  p->save();
+  QPainterPath path, bottomPath;
+  if ( rad == 0 )
+    type = SlNone;
+  int aRad = getMaxRect( r, (int)rad );
+  int w = r.width(), h = r.height();
+  int xc = r.center().x(), yc = r.center().y();
+  p->translate( xc, yc );
+  QLinearGradient gr;
+  switch ( type ) {
+    case SlUp:
+    case SlDown: {
+      int aDeltaX = (int)(w/2), aDeltaY = (int)(h/4), aDeltaArr = (int)(aDeltaY/2);
+      if ( type == SlDown )
+        p->rotate( 180 );
+      path.moveTo(  0,       -2*aDeltaY );
+      path.lineTo(  aDeltaX, -aDeltaY+aDeltaArr );
+      path.lineTo(  aDeltaX, 2*aDeltaY-aRad );
+      path.arcTo(   aDeltaX-2*aRad, 2*aDeltaY-2*aRad, 2*aRad, 2*aRad, 0, -90 );
+      path.lineTo( -aDeltaX+aRad, 2*aDeltaY );
+      path.arcTo(  -aDeltaX,  2*aDeltaY-2*aRad, 2*aRad, 2*aRad, 270, -90 );
+      path.lineTo( -aDeltaX, -aDeltaY+aDeltaArr );
+      path.lineTo( 0,       -2*aDeltaY );
+      bottomPath = path;
+      gr.setStart( 0, -2*aDeltaY );
+      gr.setFinalStop( 0, 2*aDeltaY );
+      break;
+    }
+    case SlLeft:
+    case SlRight: {
+      int aDeltaX = (int)(w/4), aDeltaY = (int)(h/2), aDeltaArr = (int)(aDeltaX/2);
+      if ( type == SlRight )
+        p->rotate( 180 );
+      path.moveTo( -2*aDeltaX,        0 );
+      path.lineTo( -aDeltaX+aDeltaArr,aDeltaY );
+      path.lineTo(  2*aDeltaX-aRad,   aDeltaY );
+      path.arcTo(   2*aDeltaX-2*aRad, aDeltaY-2*aRad, 2*aRad, 2*aRad, 270, 90 );
+      path.lineTo(  2*aDeltaX,       -aDeltaY+aRad );
+      path.arcTo(   2*aDeltaX-2*aRad, -aDeltaY, 2*aRad, 2*aRad, 0, 90 );
+      path.lineTo( -aDeltaX+aDeltaArr,-aDeltaY );
+      path.lineTo( -2*aDeltaX,       0 );
+      gr.setStart( -2*aDeltaX, 0 );
+      gr.setFinalStop( 2*aDeltaX, 0 );
+      bottomPath = path;
+      break;
+    }
+    case SlNone: {
+      p->translate( -xc, -yc );
+      path = Style_Tools::roundRect( r, rad, Style_Tools::All );
+      bottomPath = path;
+      gr.setStart( r.x(), r.y() );
+      gr.setFinalStop( r.x(), r.bottom() );
+      break;
+    }
+    default:
+      return;
+  }
+  p->setRenderHint( QPainter::Antialiasing );
+  gr.setColorAt( 0.0, light );
+  gr.setColorAt( 1.0, dark );
+  p->fillPath( path, gr );
+
+  QColor bottomShadow = border_bot;
+  p->strokePath( bottomPath, bottomShadow );
+  p->setRenderHint( QPainter::Antialiasing, false );
+  p->restore();
+}
+
+/*!
+  \brief Draw highlighted rectangle
+  \param p painter
+  \param rect drawing rectangle
+  \param rad rounding radius
+  \param type rounding operation type
+  \parma marg margin size
+  \param center background's center gradient color
+  \param out_center background's second color
+  \param border border color
+*/
+void Style_Tools::highlightRect( QPainter* p, const QRect& rect, const double rad, const int type,
+                                 const double marg, const QColor& center, const QColor& out_center,
+                                 const QColor& border )
+{
+  QPainterPath path = Style_Tools::roundRect( rect, rad, type );
+  QLinearGradient gr_h( rect.x(), rect.y(), rect.right(), rect.y() ),
+                  gr_v( rect.x(), rect.y(), rect.x(), rect.bottom() );
+  double aXDelta = marg > 0 ? marg/rect.width() : 0.5;
+  double aYDelta = marg > 0 ? marg/rect.height() : 0.5;
+  if ( aYDelta > 0.5 )
+    aYDelta = 0.25;
+  gr_v.setColorAt( 0.0, out_center );
+  gr_v.setColorAt( aYDelta, center );
+  gr_v.setColorAt( 1-aYDelta, center );
+  gr_v.setColorAt( 1.0, out_center );
+
+  QColor aCenter = center;
+  aCenter.setAlpha( 0 );
+  if ( aXDelta > 0.5 )
+    aXDelta = 0.25;
+  gr_h.setColorAt( 0.0, out_center );
+  gr_h.setColorAt( aXDelta, aCenter );
+  gr_h.setColorAt( 1-aXDelta, aCenter );
+  gr_h.setColorAt( 1.0, out_center );
+
+  p->fillPath( path, gr_v );
+  if ( marg > 0 )
+    p->fillPath( path, gr_h );
+  p->strokePath( path, border );
+}
+
+/*!
+  \brief Get minimal delta value (the minimum between \a rect and \a size dimensions)
+  \param rect rectangle
+  \param size size
+  \param defDelta default minimum delta
+  \return resulting minimum value
+*/
+int Style_Tools::getMinDelta( const QRect& rect, const QSize& size, const int defDelta )
+{
+  int aDelta = defDelta;
+  aDelta = qMin( aDelta, ( rect.height() - size.height() ) / 2 );
+  aDelta = qMin( aDelta, ( rect.width()  - size.width() )  / 2 );
+  return aDelta;
+}
+
+/*!
+  \brief Get halved size of the quadrangle covering specified rectangle
+  \param rect rectangle
+  \param defRect default quadranle size value
+  \return resulting value
+*/
+int Style_Tools::getMaxRect( const QRect& rect, const int defRect )
+{
+  int aRect = defRect;
+  aRect = qMin( aRect, rect.height() / 2 );
+  aRect = qMin( aRect, rect.width()  / 2 );
+  return aRect;
+}
diff --git a/src/Style/Style_Tools.h b/src/Style/Style_Tools.h
new file mode 100644 (file)
index 0000000..a21893e
--- /dev/null
@@ -0,0 +1,113 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Style_Tools.h
+// Author : Natalia Ermolaeva, Open CASCADE S.A.S.
+//
+#ifndef STYLE_TOOLS_H
+#define STYLE_TOOLS_H
+
+#include "Style.h"
+
+#include <QPainterPath>
+#include <QRect>
+#include <QColor>
+#include <QStyle>
+
+//
+// This class is private for Style package.
+// Normally it should not be exported.
+//
+class STYLE_SALOME_EXPORT Style_Tools
+{
+public:
+  //! Rounding operation type
+  typedef enum {
+    None        = 0x00000000,       //!< No rounding required
+    All         = 0x00000001,       //!< All corners
+    Right       = 0x00000002,       //!< Right corners
+    Left        = 0x00000004,       //!< Left corners
+    TopLeft     = 0x00000008,       //!< Top-left corner
+    TopRight    = 0x00000010,       //!< Top-right corner
+    BottomLeft  = 0x00000020,       //!< Bottom-left corner
+    BottomRight = 0x00000040        //!< Bottom-right corner
+  } RoundType;
+
+  //! Shadow type
+  typedef enum {
+    WholePath,        //!< Whole path
+    BottomPath,       //!< Bottom path
+    TopPath           //!< Top path
+  } ShadowType;
+
+  //! Slider type
+  typedef enum {
+    SlUp,             //!< Up-to-down gradient
+    SlDown,           //!< Down-to-up gradient
+    SlLeft,           //!< Left-to-right gradient
+    SlRight,          //!< Right-to-left gradient
+    SlNone            //!< No gradient
+  } SliderType;
+
+  static QPainterPath painterPath( const QRect& );
+  static QPainterPath substractPath( const QPainterPath&, const QPainterPath& );
+
+  static QPainterPath roundRect( const QRect&, const double, int = 0, int = 0 );
+
+  static void         roundRect( QPainter*, const QRect&, const double, const int,
+                                 const QColor&, const QColor&, bool = true, bool = true );
+
+  static void         shadowRect( QPainter*, const QRect&, const double,
+                                  const double, const int, int,
+                                  const QColor&, const QColor&, const QColor&,
+                                  const QColor&, const bool, const bool,
+                                  const bool = false, const bool = true );
+  static void         shadowCheck( QPainter*, const QRect&, const double, const int,
+                                   const QColor&, const QColor&,
+                                   const QColor&, const QColor& );
+  static void         arrowRect( QPainter*, const QRect&, const QColor&,
+                                 const QColor&, const QColor& );
+  static void         fillRect( QPainter*, const QRect&, const QColor&,
+                                const QColor&, const int = 255 );
+  static void         drawArrow( QStyle::PrimitiveElement, QPainter*, const QRect&,
+                                 const QColor&, const QColor& );
+  static void         drawSign( QStyle::PrimitiveElement, QPainter*, const QRect&,
+                               const QColor&, const QColor& );
+  static QPainterPath tabRect( QPainter*, const QRect&, const int, const double,
+                               const double, const QColor&, const QColor&,
+                               const QColor&, const QColor&,
+                               const bool, const bool, const bool,
+                               const bool = false, const bool = true );
+  static void         drawFocus( QPainter*, const QRect&, const double, const int,
+                                 const QColor& );
+  static void         drawFocus( QPainter*, const QPainterPath&, const QColor&,
+                                 const bool = true );
+  static void         drawSlider( QPainter*, const QRect&, const double,
+                                  SliderType, const QColor&, const QColor&,
+                                  const QColor&, const QColor& );
+  static void         highlightRect( QPainter*, const QRect&, const double, const int,
+                                     const double, const QColor&, const QColor&,
+                                     const QColor& );
+  static int          getMinDelta( const QRect&, const QSize&, const int );
+  static int          getMaxRect( const QRect&, const int );
+};
+
+#endif // STYLE_TOOLS_H
diff --git a/src/Style/images/critical.png b/src/Style/images/critical.png
new file mode 100644 (file)
index 0000000..3cf8e5b
Binary files /dev/null and b/src/Style/images/critical.png differ
diff --git a/src/Style/images/information.png b/src/Style/images/information.png
new file mode 100644 (file)
index 0000000..3cd9764
Binary files /dev/null and b/src/Style/images/information.png differ
diff --git a/src/Style/images/question.png b/src/Style/images/question.png
new file mode 100644 (file)
index 0000000..b42fc1c
Binary files /dev/null and b/src/Style/images/question.png differ
diff --git a/src/Style/images/warning.png b/src/Style/images/warning.png
new file mode 100644 (file)
index 0000000..471ec58
Binary files /dev/null and b/src/Style/images/warning.png differ
diff --git a/src/Style/resources/SalomeStyle.xml b/src/Style/resources/SalomeStyle.xml
new file mode 100644 (file)
index 0000000..3603c1d
--- /dev/null
@@ -0,0 +1,125 @@
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<document>
+  <section name="Steel-Blue">
+    <parameter name="button-color"            value="silver" />
+    <parameter name="base-color"              value="white" />
+    <parameter name="window-color"            value="lightsteelblue" />
+    <parameter name="lines-color"             value="blue" />
+    <parameter name="checked-color"           value="cornflowerblue" />
+    <parameter name="header-color"            value="silver" />
+    <parameter name="slider-color"            value="cornflowerblue" />
+    <parameter name="pointer-color"           value="midnightblue" />
+    <parameter name="field-light-color"       value="whitesmoke" />
+    <parameter name="field-dark-color"        value="#bababa" />
+    <parameter name="progress-bar-color"      value="cornflowerblue" />
+    <parameter name="highlight-widget-color"  value="skyblue" />
+    <parameter name="highlight-border-color"  value="cornflowerblue" />
+    <parameter name="lines-type"              value="0" />
+    <parameter name="slider-rad"              value="3" />
+    <parameter name="edit-rad"                value="6" />
+    <parameter name="button-rad"              value="10" />
+    <parameter name="frame-rad"               value="10" />
+    <parameter name="all-antialized"          value="false" />
+    <parameter name="widget-effect"           value="1" />
+    <parameter name="slider-size"             value="5" />
+  </section>
+  <section name="Dark-Green">
+    <parameter name="button-color"            value="#003300" />
+    <parameter name="window-color"            value="black" />
+    <parameter name="text-color"              value="white" />
+    <parameter name="bright-text-color"       value="gold" />
+    <parameter name="window-text-color"       value="gold" />
+    <parameter name="base-color"              value="black" />
+    <parameter name="highlight-color"         value="gold" />
+    <parameter name="highlight-text-color"    value="goldenrod" />
+    <parameter name="light-color"             value="goldenrod" />
+    <parameter name="dark-color"              value="saddlebrown" />
+    <parameter name="lines-type"              value="0" />
+    <parameter name="checked-color"           value="black" />
+    <parameter name="header-color"            value="#003300" />
+    <parameter name="slider-color"            value="goldenrod" />
+    <parameter name="border-top-color"        value="goldenrod" />
+    <parameter name="border-bottom-color"     value="saddlebrown" />
+    <parameter name="tab-border-top-color"    value="goldenrod" />
+    <parameter name="tab-border-bottom-color" value="saddlebrown" />
+    <parameter name="pointer-color"           value="gold" />
+    <parameter name="field-light-color"       value="green" />
+    <parameter name="field-dark-color"        value="#003300" />
+    <parameter name="progress-bar-color"      value="goldenrod" />
+    <parameter name="grid-line-color"         value="saddlebrown" />
+    <parameter name="highlight-widget-color"  value="green" />
+    <parameter name="highlight-border-color"  value="#003300" />
+    <parameter name="tooltip-base-color"      value="green" />
+    <parameter name="slider-rad"              value="3" />
+    <parameter name="edit-rad"                value="6" />
+    <parameter name="frame-rad"               value="10" />
+    <parameter name="button-rad"              value="10" />
+    <parameter name="all-antialized"          value="false" />
+    <parameter name="slider-size"             value="6" />
+    <parameter name="widget-effect"           value="1" />
+  </section>
+  <section name="Green Sunset" >
+    <parameter name="button-color"            value="#e6e7e6" />
+    <parameter name="text-color"              value="#000000" />
+    <parameter name="base-color"              value="#ffff7f" />
+    <parameter name="window-color"            value="#aaff7f" />
+    <parameter name="light-color"             value="#ffaaff" />
+    <parameter name="dark-color"              value="#55aa00" />
+    <parameter name="button-text-color"       value="#000000" />
+    <parameter name="window-text-color"       value="#000000" />
+    <parameter name="tooltip-base-color"      value="#e6e7e6" />
+    <parameter name="tooltip-text-color"      value="#000000" />
+    <parameter name="highlight-color"         value="#21449c" />
+    <parameter name="highlight-text-color"    value="#ffffff"  />
+    <parameter name="header-color"            value="#e6e7e6" />
+    <parameter name="slider-color"            value="#e6e7e6" />
+    <parameter name="progress-bar-color"      value="#21449c" />
+    <parameter name="checked-color"           value="#ffffff" />
+    <parameter name="pointer-color"           value="#000000" />
+    <parameter name="grid-line-color"         value="#c0c1c0" />
+    <parameter name="highlight-widget-color"  value="#e6e7e6" />
+    <parameter name="highlight-border-color"  value="#e6e7e6" />
+    <parameter name="lines-color"             value="#c0c1c0" />
+    <parameter name="field-light-color"       value="#ffaa7f" />
+    <parameter name="field-dark-color"        value="#aa557f" />
+    <parameter name="lines-type"              value="0" />
+    <parameter name="lines-transparency"      value="0" />
+    <parameter name="hor-hadle-delta"         value="3" />
+    <parameter name="ver-handle-delta"        value="3" />
+    <parameter name="split-handle-len"        value="20" />
+    <parameter name="all-antialized"          value="false" />
+    <parameter name="slider-rad"              value="3" />
+    <parameter name="edit-rad"                value="0" />
+    <parameter name="button-rad"              value="0" />
+    <parameter name="frame-rad"               value="0" />
+    <parameter name="slider-size"             value="5" />
+    <parameter name="widget-effect"           value="2" />
+    <parameter name="application-font"        value="DejaVu Sans,9" />
+    <parameter name="border-top-color"        value="#00ff7f" />
+    <parameter name="border-bottom-color"     value="#55557f" />
+    <parameter name="tab-border-top-color"    value="#ff007f" />
+    <parameter name="tab-border-bottom-color" value="#55aaff" />
+  </section>
+</document>
index e3081448e740fbbc43abcadc4123f6f806653bf5..f82e8734da914587ee31f5425c7cd38b1530d322 100755 (executable)
@@ -1,65 +1,57 @@
-#  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 #  File   : Makefile.in
 #  Author : Marc Tajchman (CEA)
 #  Module : SALOME
 #  $Header$
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libToolsGUI.la
 
-salomeinclude_HEADERS= \
-       ToolsGUI.h \
-       ToolsGUI_RegWidget.h \
+salomeinclude_HEADERS =                        \
+       ToolsGUI.h                      \
+       ToolsGUI_RegWidget.h            \
        ToolsGUI_CatalogGeneratorDlg.h
 
-dist_libToolsGUI_la_SOURCES= \
-       ToolsGUI_CatalogGeneratorDlg.cxx \
-       ToolsGUI_HelpWindow.cxx \
-       ToolsGUI_RegWidget.cxx \
-       ToolsGUI_IntervalWindow.cxx \
+dist_libToolsGUI_la_SOURCES =                  \
+       ToolsGUI_CatalogGeneratorDlg.cxx        \
+       ToolsGUI_RegWidget.cxx                  \
        ToolsGUI.cxx
 
-EXTRA_DIST+=
-
-MOC_FILES= \
-       ToolsGUI_CatalogGeneratorDlg_moc.cxx \
-       ToolsGUI_RegWidget_moc.cxx \
-       ToolsGUI_HelpWindow_moc.cxx \
-       ToolsGUI_IntervalWindow_moc.cxx
+MOC_FILES =                                    \
+       ToolsGUI_CatalogGeneratorDlg_moc.cxx    \
+       ToolsGUI_RegWidget_moc.cxx
 
-nodist_libToolsGUI_la_SOURCES= $(MOC_FILES)
+nodist_libToolsGUI_la_SOURCES = $(MOC_FILES)
 
 # .po files to transform in .qm
-nodist_salomeres_DATA= \
-       ToolsGUI_icons.qm \
+nodist_salomeres_DATA =                \
        ToolsGUI_msg_en.qm
 
-libToolsGUI_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(BOOST_CPPFLAGS) \
-       @KERNEL_CXXFLAGS@ @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \
-       -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl \
+libToolsGUI_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(BOOST_CPPFLAGS)     \
+       @KERNEL_CXXFLAGS@ @CORBA_CXXFLAGS@ @CORBA_INCLUDES@                     \
+       -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl                 \
        -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
-libToolsGUI_la_LDFLAGS = $(QT_MT_LIBS) ../SUIT/libsuit.la $(CAS_KERNEL) $(KERNEL_LDFLAGS) \
-       -lSalomeNS -lOpUtil $(top_builddir)/idl/libSalomeIDLGUI.so
+libToolsGUI_la_LDFLAGS  = $(QT_MT_LIBS) ../SUIT/libsuit.la $(CAS_KERNEL) $(KERNEL_LDFLAGS) \
+       -lSalomeIDLKernel -lSALOMELocalTrace -lSalomeNS -lOpUtil $(top_builddir)/idl/libSalomeIDLGUI.la
diff --git a/src/TOOLSGUI/TOOLSGUI.pro b/src/TOOLSGUI/TOOLSGUI.pro
new file mode 100644 (file)
index 0000000..a52f844
--- /dev/null
@@ -0,0 +1,69 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = ToolsGUI
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
+
+CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS
+
+CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
+
+KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
+
+INCLUDEPATH += $${CAS_CPPFLAGS} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${CORBA_INCLUDES} ../../salome_adm/unix ../../idl ../Qtx ../SUIT
+LIBS += -L../../lib -lsuit -lSalomeNS -lOpUtil $${CAS_KERNEL} $${KERNEL_LDFLAGS}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = ToolsGUI.h
+HEADERS += ToolsGUI_RegWidget.h
+HEADERS += ToolsGUI_CatalogGeneratorDlg.h
+
+SOURCES  = ToolsGUI_CatalogGeneratorDlg.cxx
+SOURCES += ToolsGUI_RegWidget.cxx
+SOURCES += ToolsGUI.cxx
+
+TRANSLATIONS = resources/ToolsGUI_icons.ts \
+               resources/ToolsGUI_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 25b8aeee9f55e3d74d0951eee728e27c28116f6f..45190056fb73a7f069531bdbeb83bd5b722dca43 100755 (executable)
@@ -1,35 +1,41 @@
-//  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 //  File   : ToolsGUI.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-
+//
 #include "ToolsGUI.h"
 
 /*!
-  \return true if object is visible
+  \class ToolsGUI
+  \brief Utility class.
+*/
+
+/*!
+  \brief Get visibility value of the "AttributeGraphic" attribute.
+  \param theStudy study
+  \param theObj object
+  \param theId sub-object identifier
+  \return \c true if an object (sub-object) is visible
 */
 bool ToolsGUI::GetVisibility( _PTR(Study)   theStudy,
                               _PTR(SObject) theObj,
@@ -46,11 +52,11 @@ bool ToolsGUI::GetVisibility( _PTR(Study)   theStudy,
 }
 
 /*!
-  Set flag visibility of object
-  \param theStudy study
-  \param theEntry - entry
-  \param theValue - flag visibility
-  \param theId - id
+  \brief Set visibility value of the "AttributeGraphic" attribute.
+  \param theStudy study
+  \param theObj object
+  \return theValue new visibility value
+  \param theId sub-object identifier
 */
 bool ToolsGUI::SetVisibility( _PTR(Study) theStudy,
                               const char* theEntry,
index ceb1179284243b81e3b28cb78354a7954fe19e53..853fc4ab8cad9d030a083f0b55765fe30fe5d4ea 100755 (executable)
@@ -1,43 +1,45 @@
-//  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 //  File   : ToolsGUI.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
+//
+#ifndef TOOLSGUI_H
+#define TOOLSGUI_H
 
-#ifndef ToolsGUI_HeaderFile
-#define ToolsGUI_HeaderFile
+#ifdef WIN32
+#  ifdef TOOLSGUI_EXPORTS
+#    define TOOLSGUI_EXPORT __declspec(dllexport)
+#  else
+#    define TOOLSGUI_EXPORT __declspec(dllimport)
+#  endif
+#else   // WIN32
+#  define TOOLSGUI_EXPORT
+#endif  // WIN32
 
 #include "utilities.h"
-
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-
 #include "SALOMEDSClient.hxx"
 
-class Standard_EXPORT ToolsGUI  
+class TOOLSGUI_EXPORT ToolsGUI  
 {
 public :
   static bool               GetVisibility( _PTR(Study)   theStudy,
@@ -49,4 +51,4 @@ public :
                                            void*       theId );
 };
 
-#endif
+#endif // TOOLSGUI_H
index 5cf6f399e9b1a908710c04ac3fcc538055d1d097..0ae32da23deb3ec29cc79f748bcf6111957fab3f 100755 (executable)
@@ -1,50 +1,46 @@
-//  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 //  File   : ToolsGUI_CatalogGeneratorDlg.cxx
 //  Author : Nicolas REJNERI
-//  Modified : Marc TAJCHMAN
-//  Module : SALOME
-//  $Header$
-
+//
 #include "ToolsGUI_CatalogGeneratorDlg.h"
 
 #include "SUIT_Application.h"
-#include "SUIT_Desktop.h"
 #include "SUIT_MessageBox.h"
-#include "SUIT_Tools.h"
+//#include "SUIT_Tools.h"
 #include "SUIT_Session.h"
 
 #include <stdlib.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qstringlist.h>
-#include <qregexp.h>
-#include <qvalidator.h>
-#include <qfile.h>
+
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QStringList>
+#include <QRegExp>
+#include <QIntValidator>
+#include <QFile>
 
 #include <OSD_Process.hxx>
 #include <OSD_Path.hxx>
@@ -60,39 +56,47 @@ using namespace std;
 #define MIN_EDIT_SIZE          250
 
 /*!
-  Constructor
+  \class ToolsGUI_CatalogGeneratorDlg
+  \brief A dialog box which allows converting the IDL files 
+         to the XML description.
 */
-ToolsGUI_CatalogGeneratorDlg::ToolsGUI_CatalogGeneratorDlg( QWidget* parent, const char* name )
-    : QDialog( parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+*/
+ToolsGUI_CatalogGeneratorDlg::ToolsGUI_CatalogGeneratorDlg( QWidget* parent )
+: QDialog( parent )
 {
-  if ( !name )
-    setName( "ToolsGUI_CatalogGeneratorDlg" );
-  resize( 322, 120 ); 
-  setCaption( tr( "TOOLS_CATALOG_GENERATOR" ) );
-  setSizeGripEnabled( TRUE );
+  setModal( true );
+
+  setWindowTitle( tr( "TOOLS_CATALOG_GENERATOR" ) );
+  setSizeGripEnabled( true );
 
   QGridLayout* aTopLayout = new QGridLayout(this);
-  aTopLayout->setMargin(MARGIN_SIZE);
-  aTopLayout->setSpacing(SPACING_SIZE);
-
-  QGroupBox* filesGrp = new QGroupBox( tr( "TOOLS_FILES") , this, "filesGrp" );
-  filesGrp->setColumnLayout( 0, Qt::Vertical );
-  filesGrp->layout()->setSpacing( 0 );
-  filesGrp->layout()->setMargin( 0 );
-  QGridLayout* filesGrpLayout = new QGridLayout( filesGrp->layout() );
+  aTopLayout->setMargin( MARGIN_SIZE );
+  aTopLayout->setSpacing( SPACING_SIZE );
+
+  QGroupBox* filesGrp = new QGroupBox( tr( "TOOLS_FILES") , this );
+  filesGrp->setObjectName( "filesGrp" );
+  QGridLayout* filesGrpLayout = new QGridLayout( filesGrp );
   filesGrpLayout->setAlignment( Qt::AlignTop );
   filesGrpLayout->setSpacing( SPACING_SIZE );
   filesGrpLayout->setMargin( MARGIN_SIZE  );
 
-  myIdlEdit = new QLineEdit( filesGrp, "myIdlEdit" );
+  myIdlEdit = new QLineEdit( filesGrp );
+  myIdlEdit->setObjectName( "myIdlEdit" );
   myIdlEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myIdlEdit->setMinimumSize( MIN_EDIT_SIZE, 0 );
-  myXmlEdit = new QLineEdit( filesGrp, "myXmlEdit" );
+  myXmlEdit = new QLineEdit( filesGrp );
+  myXmlEdit->setObjectName( "myXmlEdit" );
   myXmlEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myXmlEdit->setMinimumSize( MIN_EDIT_SIZE, 0 );
 
-  myBrowseIdlBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), filesGrp, "myBrowseIdlBtn" );
-  myBrowseXmlBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), filesGrp, "myBrowseXmlBtn" );
+  myBrowseIdlBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), filesGrp );
+  myBrowseIdlBtn->setObjectName( "myBrowseIdlBtn" );
+  myBrowseXmlBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), filesGrp );
+  myBrowseXmlBtn->setObjectName( "myBrowseXmlBtn" );
 //  QFontMetrics fm(myBrowseIdlBtn->font());
 //  myBrowseIdlBtn->setFixedWidth(fm.width(myBrowseIdlBtn->text()) + 10);
 //  myBrowseXmlBtn->setFixedWidth(fm.width(myBrowseXmlBtn->text()) + 10);
@@ -104,50 +108,56 @@ ToolsGUI_CatalogGeneratorDlg::ToolsGUI_CatalogGeneratorDlg( QWidget* parent, con
   filesGrpLayout->addWidget( myXmlEdit, 1, 1 );
   filesGrpLayout->addWidget( myBrowseXmlBtn, 1, 2 );
 
-  QGroupBox* supplGrp = new QGroupBox(tr( "TOOLS_SUPPLEMENT" )  , this, "SupplGrp" );
-  supplGrp->setColumnLayout( 0, Qt::Vertical );
-  supplGrp->layout()->setSpacing( 0 );
-  supplGrp->layout()->setMargin( 0 );
-  QGridLayout* supplGrpLayout = new QGridLayout( supplGrp->layout() );
+  QGroupBox* supplGrp = new QGroupBox(tr( "TOOLS_SUPPLEMENT" )  , this );
+  supplGrp->setObjectName( "SupplGrp" );
+  QGridLayout* supplGrpLayout = new QGridLayout( supplGrp );
   supplGrpLayout->setAlignment( Qt::AlignTop );
   supplGrpLayout->setSpacing( SPACING_SIZE );
   supplGrpLayout->setMargin( MARGIN_SIZE  );
 
   QSize myMinimumSize(int(MIN_EDIT_SIZE*0.3), 0);
 
-  myAuthorEdit = new QLineEdit( supplGrp , "myAuthorEdit" );
+  myAuthorEdit = new QLineEdit( supplGrp );
+  myAuthorEdit->setObjectName( "myAuthorEdit" );
   myAuthorEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myAuthorEdit->setMinimumSize( myMinimumSize );
 
   OSD_Process aProcess;
   myAuthorEdit->setText(aProcess.UserName().ToCString());
 
-  myVersionEdit = new QLineEdit(supplGrp , "myVersion" );
+  myVersionEdit = new QLineEdit( supplGrp );
+  myVersionEdit->setObjectName( "myVersion" );
   myVersionEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myVersionEdit->setMinimumSize( myMinimumSize );
-  QStringList aList = QStringList::split(QRegExp("\\s+"),tr( "INF_VERSION" ));
+  QStringList aList = tr( "INF_VERSION" ).split(QRegExp("\\s+"), QString::SkipEmptyParts);
   myVersionEdit->setText(aList.last());
 
-  myPngEdit = new QLineEdit(supplGrp , "myCompIcon" );
+  myPngEdit = new QLineEdit( supplGrp );
+  myPngEdit->setObjectName( "myCompIcon" );
   myPngEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myPngEdit->setMinimumSize( MIN_EDIT_SIZE, 0 );
 
-  myBrowsePngBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), supplGrp, "myBrowsePngBtn" );
+  myBrowsePngBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), supplGrp );
+  myBrowsePngBtn->setObjectName( "myBrowsePngBtn" );
 
-  myCompName = new QLineEdit(supplGrp , "myCompName");
+  myCompName = new QLineEdit( supplGrp );
+  myCompName->setObjectName( "myCompName" );
   myCompName->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myCompName->setMinimumSize( myMinimumSize );
 
-  myCompUserName = new QLineEdit(supplGrp , "myCompUserName");
+  myCompUserName = new QLineEdit( supplGrp );
+  myCompUserName->setObjectName( "myCompUserName" );
   myCompUserName->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myCompUserName->setMinimumSize( (int)(MIN_EDIT_SIZE*0.3), 0 );
 
-  myCompType = new QLineEdit(supplGrp , "myCompType");
+  myCompType = new QLineEdit( supplGrp );
+  myCompType->setObjectName( "myCompType" );
   myCompType->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myCompType->setMinimumSize( myMinimumSize );
   myCompType->setText("OTHER");
 
-  myCompMultiStd = new QLineEdit(supplGrp , "myCompMultiStd");
+  myCompMultiStd = new QLineEdit( supplGrp );
+  myCompMultiStd->setObjectName( "myCompMultiStd" );
   myCompMultiStd->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myCompMultiStd->setMinimumSize( myMinimumSize );
   myCompMultiStd->setText("1");
@@ -167,18 +177,19 @@ ToolsGUI_CatalogGeneratorDlg::ToolsGUI_CatalogGeneratorDlg( QWidget* parent, con
   supplGrpLayout->addWidget( new QLabel( tr( "TOOLS_COMP_TYPE" ), supplGrp ), 1, 4);
   supplGrpLayout->addWidget(myCompType,1,5);
   supplGrpLayout->addWidget( new QLabel( tr( "TOOLS_PNG_FILE" ), supplGrp ), 2, 0);
-  supplGrpLayout->addMultiCellWidget( myPngEdit, 2,2,1,4 );
+  supplGrpLayout->addWidget( myPngEdit, 2,1,1,4 );
   supplGrpLayout->addWidget( myBrowsePngBtn, 2, 5 );
-  
 
   QHBoxLayout* aBtnLayout = new QHBoxLayout;
   aBtnLayout->setSpacing( SPACING_SIZE );
   aBtnLayout->setMargin( 0 );
 
-  myApplyBtn = new QPushButton( tr( "TOOLS_BUT_APPLY"  ), this, "myApplyBtn" );
+  myApplyBtn = new QPushButton( tr( "TOOLS_BUT_APPLY"  ), this );
+  myApplyBtn->setObjectName( "myApplyBtn" );
   myApplyBtn->setAutoDefault( true );
   myApplyBtn->setDefault( true );
-  myCloseBtn = new QPushButton( tr( "TOOLS_BUT_CLOSE" ), this, "myCloseBtn" );
+  myCloseBtn = new QPushButton( tr( "TOOLS_BUT_CLOSE" ), this );
+  myCloseBtn->setObjectName( "myCloseBtn" );
   myCloseBtn->setAutoDefault( true );
   
   aBtnLayout->addWidget( myApplyBtn );
@@ -202,85 +213,95 @@ ToolsGUI_CatalogGeneratorDlg::ToolsGUI_CatalogGeneratorDlg( QWidget* parent, con
 }
 
 /*!
-  destructor
+  \brief Destructor
 */
 ToolsGUI_CatalogGeneratorDlg::~ToolsGUI_CatalogGeneratorDlg()
 {  
 }
 
 /*!
-  \return IDL file name entered
+  \brief Get IDL file name
+  \return IDL file name entered by the user
 */
 QString ToolsGUI_CatalogGeneratorDlg::getIdlFile()
 {
-  return myIdlEdit->text().stripWhiteSpace();
+  return myIdlEdit->text().trimmed();
 }
 
 /*!
-  \return  XML file name entered
+  \brief Get XML file name
+  \return XML file name entered by the user
 */
 QString ToolsGUI_CatalogGeneratorDlg::getXmlFile()
 {
-  return myXmlEdit->text().stripWhiteSpace();
+  return myXmlEdit->text().trimmed();
 }
 
 /*!
-  \return PNG file name entered
+  \brief Get module icon file name
+  \return icon file name entered by the user
 */
 QString ToolsGUI_CatalogGeneratorDlg::getPngFile()
 {
-  return myPngEdit->text().stripWhiteSpace();
+  return myPngEdit->text().trimmed();
 }
 
 /*!
-  \return author 
+  \brief Get author name
+  \return author name entered by the user
 */
 QString ToolsGUI_CatalogGeneratorDlg::getAuthor()
 {
-  return myAuthorEdit->text().stripWhiteSpace();
+  return myAuthorEdit->text().trimmed();
 }
 
 /*!
-  \return version number 
+  \brief Get version number 
+  \return version number entered by the user
 */
 QString ToolsGUI_CatalogGeneratorDlg::getVersion()
 {
-  return myVersionEdit->text().stripWhiteSpace();
+  return myVersionEdit->text().trimmed();
 }
 
 /*!
-  \return name of the component
+  \brief Get component name
+  \return name of the component entered by the user
 */
 QString ToolsGUI_CatalogGeneratorDlg::getCompName()
 {
-  return myCompName->text().stripWhiteSpace();
+  return myCompName->text().trimmed();
 }
 
 /*!
-  \return username of the component
+  \brief Get component title (user name)
+  \return title of the component entered by the user
 */
 QString ToolsGUI_CatalogGeneratorDlg::getCompUserName()
 {
-  return myCompUserName->text().stripWhiteSpace();
+  return myCompUserName->text().trimmed();
 }
 
 /*!
-  \return type of the component
+  \brief Get multistudy flag
+  \return multistudy flag for the component entered by the user
 */
 QString ToolsGUI_CatalogGeneratorDlg::getCompMultiStd()
 {
-  return myCompMultiStd->text().stripWhiteSpace();
+  return myCompMultiStd->text().trimmed();
 }
 
 /*!
-  \return type of the component
+  \brief Get component type
+  \return type of the component entered by the user
 */
 QString ToolsGUI_CatalogGeneratorDlg::getCompType()
 {
-  return myCompType->text().stripWhiteSpace();
+  return myCompType->text().trimmed();
 }
 
 /*!
+  \brief Get IDL path of the modules
   \return IDL path of modules
 */
 QString ToolsGUI_CatalogGeneratorDlg::getIdlPath()
@@ -315,7 +336,7 @@ QString ToolsGUI_CatalogGeneratorDlg::getIdlPath()
 }
 
 /*!
-  SLOT: called on Browse button click
+  \brief Called when user presses "Browse" button
 */
 void ToolsGUI_CatalogGeneratorDlg::onBrowseBtnClicked()
 {
@@ -324,18 +345,18 @@ void ToolsGUI_CatalogGeneratorDlg::onBrowseBtnClicked()
   SUIT_Application* app = SUIT_Session::session()->activeApplication();
 
   if ( send == myBrowseIdlBtn ) {
-    QString file = app->getFileName( true, myIdlEdit->text().stripWhiteSpace(), tr("TOOLS_MEN_IMPORT_IDL"), tr("TOOLS_MEN_IMPORT"), 0 );
+    QString file = app->getFileName( true, myIdlEdit->text().trimmed(), tr("TOOLS_MEN_IMPORT_IDL"), tr("TOOLS_MEN_IMPORT"), 0 );
     if ( !file.isEmpty() ) {
       myIdlEdit->setText(file);
     }
   } 
   else if ( send == myBrowseXmlBtn ) {
-    QString file = app->getFileName( false, myXmlEdit->text().stripWhiteSpace(), tr("TOOLS_MEN_EXPORT_XML"), tr("TOOLS_MEN_EXPORT"), 0 );
+    QString file = app->getFileName( false, myXmlEdit->text().trimmed(), tr("TOOLS_MEN_EXPORT_XML"), tr("TOOLS_MEN_EXPORT"), 0 );
     if ( !file.isEmpty() ) {
       myXmlEdit->setText(file);
     }
   } else if ( send == myBrowsePngBtn ) {
-    QString file = app->getFileName( true, myPngEdit->text().stripWhiteSpace(), tr("TOOLS_MEN_IMPORT_PNG"), tr("TOOLS_MEN_IMPORT"), 0 );
+    QString file = app->getFileName( true, myPngEdit->text().trimmed(), tr("TOOLS_MEN_IMPORT_PNG"), tr("TOOLS_MEN_IMPORT"), 0 );
     if ( !file.isEmpty() ) {
       myPngEdit->setText(file);
     
@@ -345,16 +366,18 @@ void ToolsGUI_CatalogGeneratorDlg::onBrowseBtnClicked()
 }
 
 /*!
-  Updates <OK> button's state
+  \brief Update <OK> button's state.
 */
 void ToolsGUI_CatalogGeneratorDlg::updateButtonState()
 {
-  myApplyBtn->setEnabled( !myIdlEdit->text().stripWhiteSpace().isEmpty() && 
-                         !myXmlEdit->text().stripWhiteSpace().isEmpty() );
+  myApplyBtn->setEnabled( !myIdlEdit->text().trimmed().isEmpty() && 
+                         !myXmlEdit->text().trimmed().isEmpty() );
 }
 
 /*!
-  <Apply> button slot, performs IDL->XML conversion
+  \brief Called when user presses <Apply> button
+
+  Performs IDL to XML file conversion using \c runIDLparser SALOME utility.
 */
 void ToolsGUI_CatalogGeneratorDlg::onApply()
 {
@@ -371,26 +394,24 @@ void ToolsGUI_CatalogGeneratorDlg::onApply()
 
   if ( !XmlFile.isEmpty() && !IdlFile.isEmpty() ) {
     if ( !QFile::exists( IdlFile ) ) {
-      SUIT_MessageBox::error1( this, 
-                             tr("TOOLS_ERR_ERROR"), 
-                             tr("TOOLS_ERR_FILE_NOT_EXIST").arg(IdlFile), 
-                             tr ("TOOLS_BUT_OK") );
+      SUIT_MessageBox::critical( this, 
+                                tr("TOOLS_ERR_ERROR"), 
+                                tr("TOOLS_ERR_FILE_NOT_EXIST").arg(IdlFile) );
     }
     else {
       QString command = "";
       if ( getenv("KERNEL_ROOT_DIR")  )
        command = QString( getenv( "KERNEL_ROOT_DIR" ) ) + "/bin/salome/runIDLparser -K " + IDLpath + " -Wbcatalog=" + XmlFile;
       else {
-       SUIT_MessageBox::error1( this, 
-                               tr("TOOLS_ERR_ERROR"), 
-                               tr("KERNEL_ROOT_DIR variable is not defined"), 
-                               tr("TOOLS_BUT_OK") );
+       SUIT_MessageBox::critical( this, 
+                                  tr("TOOLS_ERR_ERROR"), 
+                                  tr("KERNEL_ROOT_DIR variable is not defined") );
       }
 
       if (!Author.isEmpty()) command += ",author=" + Author; 
       if (!Version.isEmpty()) command += ",version=" + Version;
       if (!PngFile.isEmpty()) {
-       OSD_Path aPath((Standard_CString)PngFile.latin1()); 
+       OSD_Path aPath((Standard_CString)PngFile.toLatin1().constData()); 
        TCollection_AsciiString aFile = aPath.Name() + aPath.Extension();
        command += QString(",icon=") + QString(aFile.ToCString());
       }
@@ -399,9 +420,9 @@ void ToolsGUI_CatalogGeneratorDlg::onApply()
       if (!CompType.isEmpty()) command += ",type=" + CompType;
       if (!CompMultiStd.isEmpty()) command += ",multistudy=" + CompMultiStd;
       command += " " + IdlFile;
-      MESSAGE( "shell command is : " << command );
+      MESSAGE( "shell command is : " << command.toLatin1().constData() );
       int res;
-      res = system( ( char* )( command.latin1() ) );
+      res = system( ( char* )( command.toLatin1().constData() ) );
       if ( res == -1 ) {
        MESSAGE( "work failed (system command result = " << res );
       } else if (res == 217) {
index 9169f0ddea88c001e0a460a45691ff7982266b73..646b0c56b8bc82930c6671cf363e1cf571006061 100755 (executable)
@@ -1,47 +1,44 @@
-//  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 //  File   : ToolsGUI_CatalogGeneratorDlg.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-
-#ifndef DIALOGBOX_TOOLSGUI_CATALOGGENERATORDLG_H
-#define DIALOGBOX_TOOLSGUI_CATALOGGENERATORDLG_H
+//
+#ifndef TOOLSGUI_CATALOGGENERATORDLG_H
+#define TOOLSGUI_CATALOGGENERATORDLG_H
 
-#include <qdialog.h>
+#include "ToolsGUI.h"
 
-#include <Standard_Macro.hxx>
+#include <QDialog>
 
 class QLineEdit;
 class QPushButton;
 
-class Standard_EXPORT ToolsGUI_CatalogGeneratorDlg : public QDialog
+class TOOLSGUI_EXPORT ToolsGUI_CatalogGeneratorDlg : public QDialog
 { 
     Q_OBJECT
 
 public:
-    ToolsGUI_CatalogGeneratorDlg( QWidget* parent = 0, const char* name = 0 );
+    ToolsGUI_CatalogGeneratorDlg( QWidget* parent = 0 );
     ~ToolsGUI_CatalogGeneratorDlg();
 
     QString getIdlPath();
@@ -78,4 +75,4 @@ private:
     QPushButton*   myCloseBtn;
 };
 
-#endif // DIALOGBOX_TOOLSGUI_CATALOGGENERATORDLG_H
+#endif // TOOLSGUI_CATALOGGENERATORDLG_H
diff --git a/src/TOOLSGUI/ToolsGUI_HelpWindow.cxx b/src/TOOLSGUI/ToolsGUI_HelpWindow.cxx
deleted file mode 100755 (executable)
index 4581ab8..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-//  SALOME RegistryDisplay : GUI for Registry server implementation
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : ToolsGUI_HelpWindow.cxx
-//  Author : Pascale NOYRET, EDF
-//  Module : SALOME
-//  $Header$
-
-# include "ToolsGUI_HelpWindow.h"
-# include "utilities.h"
-
-# include <qtextview.h>
-# include <qpushbutton.h>
-# include <qtextstream.h> 
-# include <qfile.h> 
-
-using namespace std;
-
-/*!
-  Constructor
-*/
-ToolsGUI_HelpWindow::ToolsGUI_HelpWindow(QWidget* parent, const char* name ) 
-     : QMainWindow( parent, name, WType_TopLevel | WDestructiveClose )
-{
-  BEGIN_OF("Constructeur ToolsGUI_HelpWindow");
-  
-  setCaption( tr( "Help" ) );
-
-  myTextView = new QTextView( this, "myTextView" );
-  QPalette pal = myTextView->palette();
-  QColorGroup cg = pal.active();
-  cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
-  cg.setColor( QColorGroup::HighlightedText, Qt::white );
-  cg.setColor( QColorGroup::Base, QColor( 255,255,220 )  ); 
-  cg.setColor( QColorGroup::Text, Qt::black );
-  pal.setActive  ( cg );
-  cg = pal.inactive();
-  cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
-  cg.setColor( QColorGroup::HighlightedText, Qt::white );
-  cg.setColor( QColorGroup::Base, QColor( 255,255,220 )  ); 
-  cg.setColor( QColorGroup::Text, Qt::black );
-  pal.setInactive( cg );
-  cg = pal.disabled();
-  cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
-  cg.setColor( QColorGroup::HighlightedText, Qt::white );
-  cg.setColor( QColorGroup::Base, QColor( 255,255,220 )  ); 
-  cg.setColor( QColorGroup::Text, Qt::black );
-  pal.setDisabled( cg );
-  myTextView->setPalette( pal );
-  
-  setCentralWidget( myTextView );
-  setMinimumSize( 450, 250 );
-
-  QFile f ( "tmp.txt" );
-  if ( f.open( IO_ReadOnly ) )   
-    {
-      QTextStream t( &f ); 
-      while ( !t.eof() ) 
-       {
-         myTextView->append(t.readLine());
-       }
-    }
-  f.close();
-
-  END_OF("Constructeur ToolsGUI_HelpWindow");
-}
-
-/*!
-  Destructor
-*/
-ToolsGUI_HelpWindow::~ToolsGUI_HelpWindow()
-{
-  BEGIN_OF("Destructeur ToolsGUI_HelpWindow");
-  END_OF("Destructeur ToolsGUI_HelpWindow");
-};
-
-/*!
-  Sets text
-*/
-void ToolsGUI_HelpWindow::setText( const QString& text )
-{
-  myTextView->setText( text );
-}
-
-
diff --git a/src/TOOLSGUI/ToolsGUI_HelpWindow.h b/src/TOOLSGUI/ToolsGUI_HelpWindow.h
deleted file mode 100755 (executable)
index b4849ba..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//  SALOME RegistryDisplay : GUI for Registry server implementation
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : HelpWindow.hxx
-//  Author : Pascale NOYRET, EDF
-//  Module : SALOME
-//  $Header$
-
-# ifndef __HELPWINDOW_H__
-# define __HELPWINDOW_H__
-
-# include <qapplication.h>
-# include <qmainwindow.h>
-
-class QTextView;
-
-class ToolsGUI_HelpWindow : public QMainWindow
-{
-  Q_OBJECT
-
-public:
-  ToolsGUI_HelpWindow( QWidget* parent = 0, const char* name = 0);
-  ~ToolsGUI_HelpWindow();
-
-  void setText( const QString& text );
-  QTextView* textView() const { return myTextView; }
-
-private:
-  QTextView* myTextView;
-};
-# endif         /* __HELPWINDOW_H__ */
-
-
diff --git a/src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx b/src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx
deleted file mode 100755 (executable)
index 7d4fcb0..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  File   : ToolsGUI_IntervalWindow.cxx
-//  Author : Oksana TCHEBANOVA
-//  Module : SALOME
-
-#include "ToolsGUI_IntervalWindow.h"
-
-#include <qbuttongroup.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-# include "utilities.h"
-
-#define MARGIN_SIZE      11
-#define SPACING_SIZE      6
-#define MIN_SPIN_WIDTH  100 
-
-/*!
-  Constructor
-*/
-ToolsGUI_IntervalWindow::ToolsGUI_IntervalWindow ( QWidget* parent )
-: QDialog( parent, "ToolsGUI_IntervalWindow" , true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
-{
-  BEGIN_OF("ToolsGUI_IntervalWindow constructor")
-  setCaption( tr( "Refresh Interval"  ) );
-  setSizeGripEnabled( true );
-
-  QGridLayout* topLayout = new QGridLayout( this );
-  topLayout->setSpacing( SPACING_SIZE );
-  topLayout->setMargin( MARGIN_SIZE );
-
-  QGroupBox* intervalGrp = new QGroupBox( this, "intervalGrp" );
-  intervalGrp->setColumnLayout( 0, Qt::Horizontal );//Vertical
-  intervalGrp->layout()->setSpacing( 0 );
-  intervalGrp->layout()->setMargin( 0 );
-  QGridLayout* intervalGrpLayout = new QGridLayout( intervalGrp->layout() );
-  intervalGrpLayout->setAlignment( Qt::AlignTop );
-  intervalGrpLayout->setSpacing( SPACING_SIZE );
-  intervalGrpLayout->setMargin( MARGIN_SIZE  );  
-
-  QHBoxLayout* aBtnLayout = new QHBoxLayout;
-  aBtnLayout->setSpacing( SPACING_SIZE );
-  aBtnLayout->setMargin( 0 );
-
-  myButtonOk = new QPushButton( this, "buttonOk" );
-  myButtonOk->setText( tr( "BUT_OK"  ) );
-  myButtonOk->setAutoDefault( TRUE );
-  myButtonOk->setDefault( TRUE );
-  
-  myButtonCancel = new QPushButton( this, "buttonCancel" );
-  myButtonCancel->setText( tr( "BUT_CANCEL"  ) );
-  myButtonCancel->setAutoDefault( TRUE );
-
-  QLabel* TextLabel = new QLabel( intervalGrp, "TextLabel" );
-  TextLabel->setText( tr( "Please, enter a number of seconds:"  ) );
-
-  mySpinBox = new QSpinBox( 1, 999999999, 1, intervalGrp, "SpinBox" );
-  mySpinBox->setValue( 100 );
-  mySpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-  mySpinBox->setMinimumWidth(MIN_SPIN_WIDTH);
-
-  intervalGrpLayout->addWidget(TextLabel, 0, 0);
-  intervalGrpLayout->addWidget(mySpinBox, 0, 1);
-
-  aBtnLayout->addWidget( myButtonOk );
-  aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
-  aBtnLayout->addWidget( myButtonCancel );
-
-  topLayout->addWidget( intervalGrp, 0, 0 );
-  topLayout->addLayout( aBtnLayout, 1, 0 ); 
-
-  END_OF("ToolsGUI_IntervalWindow constructor")
-}
-
-/*!
-  Destructor
-*/
-ToolsGUI_IntervalWindow::~ToolsGUI_IntervalWindow() {}
-
-/*!
-   Sets start interval size
-*/
-void ToolsGUI_IntervalWindow::setValue(const int size)
-{
-  mySpinBox->setValue(size);
-}
-
-/*!
-   \return interval size
-*/
-int ToolsGUI_IntervalWindow::getValue()
-{
-  return mySpinBox->value();
-}
-
-/*!
-   \return a pointer to myButtonOk
-*/
-QPushButton* ToolsGUI_IntervalWindow::Ok()
-{
-  return myButtonOk;
-}
-
-/*!
-   \return a pointer to myButtonCancel
-*/
-QPushButton* ToolsGUI_IntervalWindow::Cancel()
-{
-  return myButtonCancel;
-}
diff --git a/src/TOOLSGUI/ToolsGUI_IntervalWindow.h b/src/TOOLSGUI/ToolsGUI_IntervalWindow.h
deleted file mode 100755 (executable)
index 2423736..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  File   : IntervalWindow.hxx
-//  Author : Oksana TCHEBANOVA
-//  Module : SALOME
-
-#ifndef IntervalWindow_HeaderFile
-#define IntervalWindow_HeaderFile
-
-# include <qwidget.h>
-# include <qdialog.h>
-# include <qpushbutton.h>
-# include <qspinbox.h>
-
-#ifndef WNT
-using namespace std;
-#endif
-
-class ToolsGUI_IntervalWindow : public QDialog
-{
-  Q_OBJECT
-
-public:
-  ToolsGUI_IntervalWindow( QWidget* parent = 0 );
-  ~ToolsGUI_IntervalWindow();
-  
-  QPushButton* Ok();
-  QPushButton* Cancel();
-
-  int getValue();
-  void setValue( int );
-
-private:
-  QSpinBox* mySpinBox;
-  QPushButton* myButtonOk;
-  QPushButton* myButtonCancel;
-};
-
-#endif
index d9c62a9bf4b6b041d8ad828df238cb02cf76e24f..8c7fca3547cb909a56ee550fcdda2a15978091ee 100755 (executable)
@@ -1,63 +1,64 @@
-//  SALOME RegistryDisplay : GUI for Registry server implementation
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME RegistryDisplay : GUI for Registry server implementation
 //  File   : ToolsGUI_RegWidget.cxx
 //  Author : Pascale NOYRET, EDF
-//  Module : SALOME
-//  $Header$
-
-# include <qpushbutton.h>
-# include <qlistview.h>
-# include <qtabwidget.h> 
-# include <qstatusbar.h>
-# include <qtextview.h>
-# include <qtimer.h>
-# include <qinputdialog.h>
-# include <qtoolbar.h>
-# include <qdir.h>
-# include <qtooltip.h>
-
-# include "SALOME_NamingService.hxx"
-# include "ServiceUnreachable.hxx"
-# include "Utils_SINGLETON.hxx"
-# include "Utils_CommException.hxx"
-
-# include "utilities.h"
-# include "OpUtil.hxx"
-
+//
 # include "ToolsGUI_RegWidget.h"
-# include "ToolsGUI_HelpWindow.h"
-# include "ToolsGUI_IntervalWindow.h"
-
-# include "Qtx.h"
 
-using namespace std;
+# include <QAction>
+# include <QDialog>
+# include <QSpinBox>
+# include <QPushButton>
+# include <QTreeWidget>
+# include <QTabWidget> 
+# include <QStatusBar>
+# include <QTextEdit>
+# include <QTextStream>
+# include <QTimer>
+# include <QToolBar>
+# include <QEvent>
+# include <QKeyEvent>
+# include <QCloseEvent>
+# include <QFileInfo>
+# include <QGridLayout>
+# include <QLabel>
+# include <QGroupBox>
+
+# include <SALOME_NamingService.hxx>
+# include <ServiceUnreachable.hxx>
+# include <Utils_SINGLETON.hxx>
+# include <Utils_CommException.hxx>
+
+# include <utilities.h>
+# include <OpUtil.hxx>
+
+# include <Qtx.h>
 
 typedef int PIXELS;
-ToolsGUI_RegWidget* ToolsGUI_RegWidget::myRegWidgetPtr = 0;
 
-QString addSlash( const QString& );
-QString findFile( QString filename );
+#define MARGIN_SIZE      11
+#define SPACING_SIZE      6
+#define MIN_SPIN_WIDTH  100 
 
 #define BOLD( text ) ( QString( "<b>" ) + QString( text ) + QString( "</b>" ) )
 
@@ -136,10 +137,12 @@ static const char* const refresh_data[] = {
 "......aaaaa....."};
 
 /*!
-  Creates components list
+  \brief Create components list.
+  \internal
+  \param orb CORBA ORB reference
+  \return list of registered components
 */
-
-Registry::Components_var MakeRegistry( CORBA::ORB_var &orb )
+static Registry::Components_var MakeRegistry( CORBA::ORB_var& orb )
 {
 
   const char *registryName="Registry" ;
@@ -171,37 +174,334 @@ Registry::Components_var MakeRegistry( CORBA::ORB_var &orb )
 }
 
 /*!
-  Only one global registry window should exist at the moment
-  This method creates registry window if necessary and returns it
-  [ static ] 
+  \class ToolsGUI_RegWidget::InfoWindow
+  \brief Information window.
+  \internal
+*/
+
+class ToolsGUI_RegWidget::InfoWindow : public QMainWindow
+{
+public:
+  InfoWindow( QWidget* parent );
+
+  void setText( const QString& text );
+
+protected:
+  void keyPressEvent( QKeyEvent * e );
+
+private:
+  QTextEdit* myTextView;
+};
+
+/*!
+  \brief Constructor.
+  \internal
+  \param parent parent widget
+*/
+ToolsGUI_RegWidget::InfoWindow::InfoWindow( QWidget* parent )
+: QMainWindow( parent )
+{
+  setAttribute( Qt::WA_DeleteOnClose );
+
+  myTextView = new QTextEdit( this );
+  myTextView->setReadOnly( true );
+  setCentralWidget( myTextView );
+  setMinimumSize( 450, 250 );
+}
+
+/*!
+  \brief Set text to the information window.
+  \internal
+  \param text ionfo text
+*/
+void ToolsGUI_RegWidget::InfoWindow::setText( const QString& text )
+{
+  myTextView->setText( text );
+}
+
+/*!
+  \brief Key press event handler. Closeswindow on \c Escape key pressing.
+  \internal
+  \param e key press event
+*/
+void ToolsGUI_RegWidget::InfoWindow::keyPressEvent( QKeyEvent * e )
+{
+  QMainWindow::keyPressEvent( e );
+  if ( e->key() == Qt::Key_Escape )
+    close();
+}
+
+/*!
+  \class ToolsGUI_RegWidget::HelpWindow
+  \brief Help window.
+  \internal
+*/
+
+class ToolsGUI_RegWidget::HelpWindow : public QMainWindow
+{
+public:
+  HelpWindow( QWidget* parent );
+  ~HelpWindow();
+
+  void setText( const QString& text );
+
+private:
+  QTextEdit* myTextView;
+};
+
+/*!
+  \brief Constructor.
+  \internal
+  \param parent parent widget
+*/
+ToolsGUI_RegWidget::HelpWindow::HelpWindow( QWidget* parent ) 
+: QMainWindow( parent )
+{
+  setAttribute( Qt::WA_DeleteOnClose );
+  setWindowTitle( tr( "Help" ) );
+
+  myTextView = new QTextEdit( this );
+  myTextView->setReadOnly( true );
+  QPalette pal = myTextView->palette();
+
+  pal.setBrush( QPalette::Active, QPalette::Highlight,       QBrush( QColor( 0, 0, 128 ) ) );
+  pal.setBrush( QPalette::Active, QPalette::HighlightedText, QBrush( Qt::white ) );
+  pal.setBrush( QPalette::Active, QPalette::Base,            QBrush( QColor( 255,255,220 ) ) );
+  pal.setBrush( QPalette::Active, QPalette::Text,            QBrush( Qt::black ) );
+
+  pal.setBrush( QPalette::Inactive, QPalette::Highlight,       QBrush( QColor( 0, 0, 128 ) ) );
+  pal.setBrush( QPalette::Inactive, QPalette::HighlightedText, QBrush( Qt::white ) );
+  pal.setBrush( QPalette::Inactive, QPalette::Base,            QBrush( QColor( 255,255,220 ) ) );
+  pal.setBrush( QPalette::Inactive, QPalette::Text,            QBrush( Qt::black ) );
+
+  pal.setBrush( QPalette::Disabled, QPalette::Highlight,       QBrush( QColor( 0, 0, 128 ) ) );
+  pal.setBrush( QPalette::Disabled, QPalette::HighlightedText, QBrush( Qt::white ) );
+  pal.setBrush( QPalette::Disabled, QPalette::Base,            QBrush( QColor( 255,255,220 ) ) );
+  pal.setBrush( QPalette::Disabled, QPalette::Text,            QBrush( Qt::black ) );
+
+  myTextView->setPalette( pal );
+  
+  setCentralWidget( myTextView );
+  setMinimumSize( 450, 250 );
+
+  QFile f ( "tmp.txt" );
+  if ( f.open( QIODevice::ReadOnly ) ) {
+    QTextStream t( &f ); 
+    while ( !t.atEnd() ) {
+      myTextView->append( t.readLine() );
+    }
+  }
+  f.close();
+}
+
+/*!
+  \brief Destructor.
+  \internal
+*/
+ToolsGUI_RegWidget::HelpWindow::~HelpWindow()
+{
+};
+
+/*!
+  \brief Set text to the help window.
+  \internal
+  \param text help text
+*/
+void ToolsGUI_RegWidget::HelpWindow::setText( const QString& text )
+{
+  myTextView->setText( text );
+}
+
+/*!
+  \class ToolsGUI_RegWidget::IntervalWindow
+  \brief Dialog box to enter time delay between registry window updates
+  \internal
+*/
+
+class ToolsGUI_RegWidget::IntervalWindow : public QDialog
+{
+public:
+  IntervalWindow( QWidget* parent );
+  ~IntervalWindow();
+  
+  QPushButton* Ok();
+  QPushButton* Cancel();
+
+  int getValue();
+  void setValue( int );
+
+private:
+  QSpinBox* mySpinBox;
+  QPushButton* myButtonOk;
+  QPushButton* myButtonCancel;
+};
+
+/*!
+  \brief Constructor.
+  \internal
+  \param parent parent widget
+*/
+ToolsGUI_RegWidget::IntervalWindow::IntervalWindow ( QWidget* parent )
+: QDialog( parent )
+{
+  setModal( true );
+  setAttribute( Qt::WA_DeleteOnClose );
+
+  setWindowTitle( tr( "Refresh Interval"  ) );
+  setSizeGripEnabled( true );
+
+  QGridLayout* topLayout = new QGridLayout( this );
+  topLayout->setSpacing( SPACING_SIZE );
+  topLayout->setMargin( MARGIN_SIZE );
+
+  QGroupBox* intervalGrp = new QGroupBox( this );
+  intervalGrp->setObjectName( "intervalGrp" );
+  QGridLayout* intervalGrpLayout = new QGridLayout( intervalGrp );
+  intervalGrpLayout->setAlignment( Qt::AlignTop );
+  intervalGrpLayout->setSpacing( SPACING_SIZE );
+  intervalGrpLayout->setMargin( MARGIN_SIZE  );  
+
+  QHBoxLayout* aBtnLayout = new QHBoxLayout;
+  aBtnLayout->setSpacing( SPACING_SIZE );
+  aBtnLayout->setMargin( 0 );
+
+  myButtonOk = new QPushButton( this );
+  myButtonOk->setObjectName( "buttonOk" );
+  myButtonOk->setText( tr( "BUT_OK"  ) );
+  myButtonOk->setAutoDefault( TRUE );
+  myButtonOk->setDefault( TRUE );
+  
+  myButtonCancel = new QPushButton( this );
+  myButtonCancel->setObjectName( "buttonCancel" );
+  myButtonCancel->setText( tr( "BUT_CANCEL"  ) );
+  myButtonCancel->setAutoDefault( TRUE );
+
+  QLabel* TextLabel = new QLabel( intervalGrp );
+  TextLabel->setObjectName( "TextLabel" );
+  TextLabel->setText( tr( "Please, enter a number of seconds:"  ) );
+
+  mySpinBox = new QSpinBox( intervalGrp );
+  mySpinBox->setMinimum( 1 );
+  mySpinBox->setMaximum( 999999999 );
+  mySpinBox->setSingleStep( 1 );
+  mySpinBox->setObjectName( "SpinBox" );
+  mySpinBox->setValue( 100 );
+  mySpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+  mySpinBox->setMinimumWidth(MIN_SPIN_WIDTH);
+
+  intervalGrpLayout->addWidget(TextLabel, 0, 0);
+  intervalGrpLayout->addWidget(mySpinBox, 0, 1);
+
+  aBtnLayout->addWidget( myButtonOk );
+  aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
+  aBtnLayout->addWidget( myButtonCancel );
+
+  topLayout->addWidget( intervalGrp, 0, 0 );
+  topLayout->addLayout( aBtnLayout, 1, 0 ); 
+}
+
+/*!
+  \brief Destructor
+  \internal
 */
-ToolsGUI_RegWidget* ToolsGUI_RegWidget::GetRegWidget( CORBA::ORB_var &orb , QWidget *parent, const char *name )
+ToolsGUI_RegWidget::IntervalWindow::~IntervalWindow()
+{
+}
+
+/*!
+  \brief Set time interval value
+  \internal
+  \param size interval value
+*/
+void ToolsGUI_RegWidget::IntervalWindow::setValue( const int size )
+{
+  mySpinBox->setValue(size);
+}
+
+/*!
+  \brief Get time interval value
+  \internal
+  \return interval value
+*/
+int ToolsGUI_RegWidget::IntervalWindow::getValue()
+{
+  return mySpinBox->value();
+}
+
+/*!
+  \brief Get \c OK button
+  \internal
+  \return a pointer to \c OK button
+*/
+QPushButton* ToolsGUI_RegWidget::IntervalWindow::Ok()
+{
+  return myButtonOk;
+}
+
+/*!
+  \brief Get \c Cancel button
+  \internal
+  \return a pointer to \c Cancel button
+*/
+QPushButton* ToolsGUI_RegWidget::IntervalWindow::Cancel()
+{
+  return myButtonCancel;
+}
+
+/*!
+  \class ToolsGUI_RegWidget
+  \brief SALOME Registry tool window.
+*/
+
+//! The only instance of Registry window
+ToolsGUI_RegWidget* ToolsGUI_RegWidget::myRegWidgetPtr = 0;
+
+/*!
+  \brief Create/get the only instance of the Registry window.
+  \param orb CORBA ORB reference
+  \param parent parent widget
+*/
+ToolsGUI_RegWidget* ToolsGUI_RegWidget::GetRegWidget( CORBA::ORB_var& orb,
+                                                     QWidget* parent )
 {
   if ( !myRegWidgetPtr ) 
-    myRegWidgetPtr = new ToolsGUI_RegWidget( orb, parent, name );
+    myRegWidgetPtr = new ToolsGUI_RegWidget( orb, parent );
   return myRegWidgetPtr;
 }
 
 /*!
-  Constructor  
+  \brief This virtual function is reimplenented to disable popup menu on dock areas
+  (instead of QMainWindow::setDockMenuEnabled( false ) method used in Qt3).
+  \return always 0 to disable menu
 */
-ToolsGUI_RegWidget::ToolsGUI_RegWidget(CORBA::ORB_var &orb, QWidget *parent, const char *name ) 
-     : QMainWindow( parent, name, WType_TopLevel | WDestructiveClose ),
-       _VarComponents( MakeRegistry(orb) ),
-       _clients(0), _history(0), _parent( parent ),
-       _tabWidget(0), _refresh(0), _interval(0),
-       myInfoWindow(0), myHelpWindow(0), myIntervalWindow(0)
+QMenu* ToolsGUI_RegWidget::createPopupMenu()
 {
-   QString aFile = findFile("default.png");
- /* char* dir = getenv( "CSF_ResourcesDefaults" );
-  QString path( "" );
-  if ( dir ) {
-    QDir qDir( dir );
-    path = qDir.filePath( "default.png" );
-  }*/
-  QPixmap pm ( aFile );
-  if ( !pm.isNull() )
-    setIcon( pm );
+  QMenu* aPopup = 0;
+  return aPopup;
+}
+
+/*!
+  \brief Constructor
+  \param orb CORBA ORB reference
+  \param parent parent widget
+*/
+ToolsGUI_RegWidget::ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent ) 
+: QMainWindow( parent, Qt::Window ),
+  _VarComponents( MakeRegistry(orb) ),
+  _clients( 0 ), 
+  _history( 0 ), 
+  _parent( parent ),
+  _tabWidget( 0 ), 
+  _refresh( 0 ), 
+  _interval( 0 ),
+  myInfoWindow( 0 ), 
+  myHelpWindow( 0 ), 
+  myIntervalWindow( 0 )
+{
+  setAttribute( Qt::WA_DeleteOnClose );
+
+  if ( parent )
+    setWindowIcon( parent->windowIcon() );
 
   // pixmap for buttons
   QPixmap image_refresh ( ( const char** ) refresh_data );
@@ -210,14 +510,12 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget(CORBA::ORB_var &orb, QWidget *parent, con
 
   // Buttons definition
   QToolBar* topbar = new QToolBar( tr("Toolbar"), this );
-  setDockEnabled( topbar, DockTornOff, false );
-  setDockMenuEnabled( false );
-
-  _refresh = new QPushButton( tr( "Refresh" ), topbar );
-  _refresh->setIconSet( image_refresh );
-  _refresh->setFocusPolicy( NoFocus );
-  connect( _refresh, SIGNAL( clicked() ), this, SLOT( slotListeSelect() ) );
-  QToolTip::add( _refresh, "", toolTipGroup(), tr("Immediately updates list of components") );
+  topbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
+  addToolBar( Qt::TopToolBarArea, topbar );
+
+  _refresh = topbar->addAction(image_refresh, tr( "Refresh" ), this, SLOT( slotListeSelect() ));
+  _refresh->setToolTip( "" );
+  _refresh->setStatusTip( tr("Immediately updates list of components") );
   
   /* PAL5540 - this button is needless
   QPushButton* help = new QPushButton( tr( "Help" ), topbar );
@@ -225,31 +523,28 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget(CORBA::ORB_var &orb, QWidget *parent, con
   QToolTip::add( help, "", toolTipGroup(), tr("Opens Help window") );
   */
   
-  _interval = new QPushButton( tr( "Interval" ), topbar );
-  _interval->setIconSet( image_interval );
-  _interval->setFocusPolicy( NoFocus );
-  connect( _interval, SIGNAL( clicked() ), this, SLOT( slotSelectRefresh() ) );
-  QToolTip::add( _interval, "", toolTipGroup(), tr("Changes refresh interval") );
+  _interval = topbar->addAction(image_interval, tr( "Interval" ), this, SLOT( slotSelectRefresh() ));
+  _interval->setToolTip( "" );
+  _interval->setStatusTip( tr("Changes refresh interval") );
   
   topbar->addSeparator();
-  _close = new QPushButton( tr("Close"), topbar );
-  _close->setIconSet( image_close );
-  _close->setFocusPolicy( NoFocus );
-  connect( _close, SIGNAL( clicked() ), this, SLOT( close() ) );
-  QToolTip::add( _close, "", toolTipGroup(), tr("Closes Registry window") );
+
+  _close = topbar->addAction( image_close, tr("Close"), this, SLOT( close() ));
+  _close->setToolTip( "" );
+  _close->setStatusTip( tr("Closes Registry window") );
   
   // Display area and associated slots definition
   _tabWidget = new QTabWidget( this );
-  _clients   = new QListView( _tabWidget );
+  _clients   = new QTreeWidget( _tabWidget );
   SetListe();
-  _history   = new QListView( _tabWidget );
+  _history   = new QTreeWidget( _tabWidget );
   SetListeHistory();
   
   _tabWidget->addTab( _clients, tr( "Running" ) );
   _tabWidget->addTab( _history, tr( "History" ) );
   connect( _tabWidget, SIGNAL( currentChanged( QWidget* )), this, SLOT( slotListeSelect() ) );
-  connect( _clients,   SIGNAL( clicked( QListViewItem* ) ),        this, SLOT( slotClientChanged( QListViewItem* ) ) );
-  connect( _history,   SIGNAL( clicked( QListViewItem* ) ),        this, SLOT( slotHistoryChanged( QListViewItem* ) ) );
+  connect( _clients,   SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ),        this, SLOT( slotClientChanged( QTreeWidgetItem* , int ) ) );
+  connect( _history,   SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ),        this, SLOT( slotHistoryChanged( QTreeWidgetItem* , int ) ) );
   setCentralWidget( _tabWidget );
   
   // Timer definition (used to automaticaly refresh the display area)
@@ -263,22 +558,26 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget(CORBA::ORB_var &orb, QWidget *parent, con
   PIXELS largeur = 800 ;
   PIXELS hauteur = 350 ;
   setGeometry( xpos, ypos, largeur, hauteur ) ;
-  setCaption( name ) ;
-  statusBar()->message("    ");
+  setWindowTitle( tr( "Registry" ) ) ;
+  statusBar()->showMessage("    ");
+
+  slotListeSelect();
 }
 
 /*!
-  Destructor
+  \brief Destructor
 */
 ToolsGUI_RegWidget::~ToolsGUI_RegWidget()
 {
-  MESSAGE("Debut du Destructeur");
   _counter->stop();
   myRegWidgetPtr = 0;
 };
 
 /*!
-  Event filter
+  \brief Event filter
+  \param object event receiver
+  \param event event being processed
+  \return \c true if event processing should be stopped
 */
 bool ToolsGUI_RegWidget::eventFilter( QObject* object, QEvent* event )
 {
@@ -294,14 +593,14 @@ bool ToolsGUI_RegWidget::eventFilter( QObject* object, QEvent* event )
     }
     else if ( object == _clients && event->type() == QEvent::KeyPress ) {
       QKeyEvent* ke = (QKeyEvent*)event;
-      if ( ke->key() == Key_Enter || ke->key() == Key_Return ) {
-       slotClientChanged( _clients->currentItem() );
+      if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) {
+       slotClientChanged( _clients->currentItem(), 0 );
       }
     }
     else if ( object == _history && event->type() == QEvent::KeyPress ) {
       QKeyEvent* ke = (QKeyEvent*)event;
-      if ( ke->key() == Key_Enter || ke->key() == Key_Return ) {
-       slotHistoryChanged( _history->currentItem() );
+      if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) {
+       slotHistoryChanged( _history->currentItem(), 0 );
       }
     }
   }
@@ -309,35 +608,39 @@ bool ToolsGUI_RegWidget::eventFilter( QObject* object, QEvent* event )
 }
 
 /*!
-  Searches item in the list and returns it's index or -1 if not found
+  \brief Search item in the list.
+  \param name component name
+  \param pid PID
+  \param machine machine name
+  \param listclient list of registry data
+  \return item index or -1 if it is not found.
 */
-int ToolsGUI_RegWidget::numitem(const QString &name, const QString &pid, const QString &machine,const Registry::AllInfos *listclient)
+int ToolsGUI_RegWidget::numitem( const QString& name, 
+                                const QString& pid, 
+                                const QString& machine,
+                                const Registry::AllInfos* listclient )
 {
-  BEGIN_OF("numitem");
-  for (CORBA::ULong i=0; i<listclient->length(); i++)
-    {       
-      const Registry::Infos & c_info=(*listclient)[i];
-      ASSERT( c_info.name!=NULL);
-      QString b;
-      b.setNum(int(c_info.pid));
-      if ( (name.compare(QString(c_info.name)) == 0) && 
-         (machine.compare(QString(c_info.machine)) == 0) && 
-         (pid.compare(b) == 0) )
-       {
-         END_OF("numitem");
-         return i;
-       }
+  for (CORBA::ULong i=0; i<listclient->length(); i++) {       
+    const Registry::Infos & c_info=(*listclient)[i];
+    ASSERT( c_info.name!=NULL);
+    QString b;
+    b.setNum(int(c_info.pid));
+    if ( (name.compare(QString(c_info.name)) == 0) && 
+        (machine.compare(QString(c_info.machine)) == 0) && 
+        (pid.compare(b) == 0) ) {
+      return i;
     }
-  END_OF("numitem");
+  }
   return -1;
 }
 
 /*!
-  Returns text, containing information about client [ static ]
+  \brief Get description text, containing information about client.
+  \param c_info client info data
+  \return formatted client description
 */
-QString ToolsGUI_RegWidget::setlongText( const Registry::Infos &c_info)
+QString ToolsGUI_RegWidget::setlongText( const Registry::Infos& c_info )
 {
-  BEGIN_OF("setlongText");
   ASSERT( c_info.name != NULL );
   QString a = QString( "<hr><h2>" ) + tr( "Code" ) + QString( " : " );
   a.append( QString( c_info.name ) );
@@ -368,53 +671,48 @@ QString ToolsGUI_RegWidget::setlongText( const Registry::Infos &c_info)
   delete [] t1;
   a.append( "<br>" );
   
-  if (c_info.tc_hello != 0 )
-    {
-      aTime = time_t(c_info.tc_hello);
-      char * t2 = (char * )duplicate(ctime(&aTime));
-      t2 [strlen(t2) -1 ] = ' ';
-      a.append( tr( "last signal" ) + QString(" : ") ); 
-      a.append( BOLD( t2 ) ); 
-      a.append( "<br>" );
-      delete [] t2;
-    }
-  if ((c_info.tc_end - c_info.difftime) != 0)
-    {
-      aTime = time_t(c_info.tc_end);
-      char * t3 = (char * )duplicate(ctime(&aTime));
-      t3 [strlen(t3) -1 ] = ' ';
-      a.append( tr( "ends" ) + QString( " " ) ); 
-      a.append( BOLD( t3 ) ); 
-      a.append( "<br>" );
-      delete [] t3;
-    }
-  else
-    {
-      a.append( tr( "still running" ) + QString( "<br>" ) );
-    }
+  if (c_info.tc_hello != 0 ) {
+    aTime = time_t(c_info.tc_hello);
+    char * t2 = (char * )duplicate(ctime(&aTime));
+    t2 [strlen(t2) -1 ] = ' ';
+    a.append( tr( "last signal" ) + QString(" : ") ); 
+    a.append( BOLD( t2 ) ); 
+    a.append( "<br>" );
+    delete [] t2;
+  }
+  if ((c_info.tc_end - c_info.difftime) != 0) {
+    aTime = time_t(c_info.tc_end);
+    char * t3 = (char * )duplicate(ctime(&aTime));
+    t3 [strlen(t3) -1 ] = ' ';
+    a.append( tr( "ends" ) + QString( " " ) ); 
+    a.append( BOLD( t3 ) ); 
+    a.append( "<br>" );
+    delete [] t3;
+  }
+  else {
+    a.append( tr( "still running" ) + QString( "<br>" ) );
+  }
   
   SCRUTE(c_info.difftime);
-  if (c_info.difftime!= 0)
-    {
-      a.append( QString( "(" ) + tr( "Time on" ) + QString( " " ) ); 
-      a.append( BOLD( c_info.machine ) ); 
-      a.append( QString( " " ) + tr( "differs from server's time. The difference is" ) + QString( " " )); 
-      a.append( BOLD( QString::number( int( c_info.difftime ) ) ) );
-      a.append( QString( " " ) + tr( "seconds" ) + QString( ")<br>" ) );
-    }
+  if (c_info.difftime!= 0) {
+    a.append( QString( "(" ) + tr( "Time on" ) + QString( " " ) ); 
+    a.append( BOLD( c_info.machine ) ); 
+    a.append( QString( " " ) + tr( "differs from server's time. The difference is" ) + QString( " " )); 
+    a.append( BOLD( QString::number( int( c_info.difftime ) ) ) );
+    a.append( QString( " " ) + tr( "seconds" ) + QString( ")<br>" ) );
+  }
   a.append( "</code>" ); // ASV: 28.07.06 : added <code> tags to make the text font be 
                          // fixed width (looks much better on Windows)
-  END_OF("setlongText");  
   return a;
   
 }
 
 /*!
-  Close event
+  \brief Close event handler.
+  \param e close event
 */
-void ToolsGUI_RegWidget::closeEvent( QCloseEvent *e)
+void ToolsGUI_RegWidget::closeEvent( QCloseEvent* e )
 {
-  BEGIN_OF("closeEvent");
   if ( myInfoWindow )
     myInfoWindow->close();
   if ( myHelpWindow )
@@ -422,210 +720,181 @@ void ToolsGUI_RegWidget::closeEvent( QCloseEvent *e)
   if (myIntervalWindow)
     myIntervalWindow->close();
   e->accept();
-  END_OF("closeEvent");
 };
 
 /*!
-  Setups Clients list
+  \brief Setup clients list.
 */
 void ToolsGUI_RegWidget::SetListe()
 {
-  BEGIN_OF("SetListe");
   _clients->installEventFilter( this );
+  _clients->setColumnCount(6);
   _clients->setAllColumnsShowFocus( true );
-  _clients->addColumn( tr( "Component" ), -1);
-  _clients->addColumn( tr( "PID" ), -1 );
-  _clients->addColumn( tr( "User Name" ), -1 );
-  _clients->addColumn( tr( "Machine" ), -1 );
-  _clients->addColumn( tr( "begins" ), -1 );
-  _clients->addColumn( tr( "hello" ) , -1 );
-  _clients->setColumnAlignment( 1, Qt::AlignRight );
-  END_OF("SetListe");
+  QStringList aLabels;
+  aLabels << tr("Component") << tr("PID") << tr("User Name") << tr("Machine") << tr("begins") << tr("hello");
+  _clients->setHeaderLabels( aLabels );
+  //_clients->setColumnAlignment( 1, Qt::AlignRight );
 }
 
 /*!
-  Setups History list
+  \brief Setup history list.
 */
 void ToolsGUI_RegWidget::SetListeHistory()
 {
-   BEGIN_OF("SetListeHistory")
   _history->installEventFilter( this );
+   _history->setColumnCount(6);
   _history->setAllColumnsShowFocus( true );
-  _history->addColumn( tr( "Component" ), -1);
-  _history->addColumn( tr( "PID" ), -1 );
-  _history->addColumn( tr( "User Name" ), -1 );
-  _history->addColumn( tr( "Machine" ), -1 );
-  _history->addColumn( tr( "begins" ), -1 );
-  _history->addColumn( tr( "ends" ), -1 );
-  _history->setColumnAlignment( 1, Qt::AlignRight );
-   END_OF("SetListeHistory")
+  QStringList aLabels;
+  aLabels << tr("Component") << tr("PID") << tr("User Name") << tr("Machine") << tr("begins") << tr("ends");
+  _history->setHeaderLabels( aLabels );
+  //_history->setColumnAlignment( 1, Qt::AlignRight );
 }
 
 /*!
-  Updates History list
+  \brief Update history list
 */
 void ToolsGUI_RegWidget::InfoHistory()
 {
 
-  BEGIN_OF("InfoHistory")
-    _history->clear();
-  try
-    {
-      time_t aTime;
-      _serverhistory = _VarComponents->history();
-      for (CORBA::ULong i=0; i<_serverhistory->length(); i++)
-       {       
-         const Registry::Infos & c_info=(*_serverhistory)[i];
-         ASSERT( c_info.name!=NULL);
-         QString a;
-         a.setNum(int(c_info.pid));
-         aTime = time_t(c_info.tc_start);
-         char * t1 = (char * )duplicate(ctime(&aTime));
-         t1 [strlen(t1) -1 ] = ' ';
-         aTime = time_t(c_info.tc_end);
-         char * t2 = (char * )duplicate(ctime(&aTime));
-         t2 [strlen(t2) -1 ] = ' ';
-         QListViewItem * item = new QListViewItem(_history, QString(c_info.name),\
-                                                  a, QString(c_info.pwname), QString(c_info.machine), \
-                                                  QString(t1), QString(t2));
-         item=0 ;
-         delete [] t1;
-         delete [] t2;
-         
-       }
-    }
-  catch( ... )
-    {
-      _interval->setDisabled( TRUE ) ;
-      _refresh->setDisabled( TRUE ) ;
-      _counter->stop();
-      MESSAGE("Sorry, No more Registry Server") ;
-      statusBar()->message( tr( "Sorry, No more Registry Server" ) ) ;
+  _history->clear();
+  try {
+    time_t aTime;
+    _serverhistory = _VarComponents->history();
+    for (CORBA::ULong i=0; i<_serverhistory->length(); i++) {       
+      const Registry::Infos & c_info=(*_serverhistory)[i];
+      ASSERT( c_info.name!=NULL);
+      QString a;
+      a.setNum(int(c_info.pid));
+      aTime = time_t(c_info.tc_start);
+      char * t1 = (char * )duplicate(ctime(&aTime));
+      t1 [strlen(t1) -1 ] = ' ';
+      aTime = time_t(c_info.tc_end);
+      char * t2 = (char * )duplicate(ctime(&aTime));
+      t2 [strlen(t2) -1 ] = ' ';
+      QStringList anItem;
+      anItem << QString(c_info.name) << a << QString(c_info.pwname) << QString(c_info.machine) << QString(t1) << QString(t2);
+      QTreeWidgetItem * item = new QTreeWidgetItem(_history, anItem);
+      item=0 ;
+      delete [] t1;
+      delete [] t2;
+      
     }
-  END_OF("InfoHistory")
+  }
+  catch( ... ) {
+    _interval->setDisabled( TRUE ) ;
+    _refresh->setDisabled( TRUE ) ;
+    _counter->stop();
+    MESSAGE("Sorry, No more Registry Server") ;
+    statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
+  }
 }
 
 /*!
-  Updates clients list
+  \brief Update clients list
 */
 void ToolsGUI_RegWidget::InfoReg()
 {
-  BEGIN_OF("InfoReg")
   _clients->clear();
-  try
-    {
-      time_t aTime;
-      _serverclients = _VarComponents->getall();
-      for (CORBA::ULong i=0; i<_serverclients->length(); i++)
-       {       
-         const Registry::Infos & c_info=(*_serverclients)[i];
-         ASSERT( c_info.name!=NULL);
-         QString a;
-         a.setNum(int(c_info.pid));
-         aTime = time_t(c_info.tc_start);
-         char * t1 = (char * )duplicate(ctime(&aTime));
-         t1 [strlen(t1) -1 ] = ' ';
-         aTime = time_t(c_info.tc_hello);
-         char * t2 = (char * )duplicate(ctime(&aTime));
-         t2 [strlen(t2) -1 ] = ' ';
-         QListViewItem * item = new QListViewItem(_clients, QString(c_info.name),\
-                                                  a, QString(c_info.pwname), QString(c_info.machine), \
-                                                  QString(t1), QString(t2));
-         item=0 ;
-         delete [] t1;
-         delete [] t2;
-         
-       }
-    }
-  catch( ... )
-    {
-      _interval->setDisabled( TRUE ) ;
-      _refresh->setDisabled( TRUE ) ;
-      _counter->stop();
-      MESSAGE("Sorry, No more Registry Server") ;
-      statusBar()->message( tr( "Sorry, No more Registry Server" ) ) ;
+  try {
+    time_t aTime;
+    _serverclients = _VarComponents->getall();
+    for (CORBA::ULong i=0; i<_serverclients->length(); i++) {       
+      const Registry::Infos & c_info=(*_serverclients)[i];
+      ASSERT( c_info.name!=NULL);
+      QString a;
+      a.setNum(int(c_info.pid));
+      aTime = time_t(c_info.tc_start);
+      char * t1 = (char * )duplicate(ctime(&aTime));
+      t1 [strlen(t1) -1 ] = ' ';
+      aTime = time_t(c_info.tc_hello);
+      char * t2 = (char * )duplicate(ctime(&aTime));
+      t2 [strlen(t2) -1 ] = ' ';
+      QStringList anItem;
+      anItem << QString(c_info.name) << a << QString(c_info.pwname) << QString(c_info.machine) << QString(t1) << QString(t2);
+      QTreeWidgetItem * item = new QTreeWidgetItem(_clients, anItem);
+      item=0 ;
+      delete [] t1;
+      delete [] t2;
+      
     }
-  END_OF("InfoReg")
+  }
+  catch( ... ) {
+    _interval->setDisabled( TRUE ) ;
+    _refresh->setDisabled( TRUE ) ;
+    _counter->stop();
+    MESSAGE("Sorry, No more Registry Server") ;
+    statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
+  }
 }
 
 /*!
-  Called when <Refresh> button is clicked
+  \brief Called when \c Refresh button is clicked
 */
 void ToolsGUI_RegWidget::slotListeSelect()
 {
-  try
-    {
-      ASSERT(_tabWidget->currentPage() != NULL);
-      if (_tabWidget->currentPage () == _clients) InfoReg();
-      else if (_tabWidget->currentPage () == _history) InfoHistory();
-    }
-  catch( ... )
-    {
-      MESSAGE("Sorry, No more Registry Server") ;
-      statusBar()->message( tr( "Sorry, No more Registry Server" ) ) ;
-    }
+  try {
+    ASSERT(_tabWidget->currentWidget() != NULL);
+    if (_tabWidget->currentWidget () == _clients) InfoReg();
+    else if (_tabWidget->currentWidget () == _history) InfoHistory();
+  }
+  catch( ... ) {
+    MESSAGE("Sorry, No more Registry Server") ;
+    statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
+  }
 }
 
 /*!
-  Called when <Interval> button is clicked (changing refresh interval)
+  \brief Called when \c Interval button is clicked (open dialog box to 
+  change refresh interval).
 */
 void ToolsGUI_RegWidget::slotSelectRefresh()
 {
-  BEGIN_OF("slotSelectRefresh");
-  myIntervalWindow = new ToolsGUI_IntervalWindow(this);
+  myIntervalWindow = new ToolsGUI_RegWidget::IntervalWindow(this);
   myIntervalWindow->installEventFilter( this );
   myIntervalWindow->setValue(myRefreshInterval);
   myIntervalWindow->show();
   connect( myIntervalWindow->Cancel(), SIGNAL( clicked() ), myIntervalWindow, SLOT( close() ) );
   connect( myIntervalWindow->Ok(), SIGNAL( clicked() ), this, SLOT( slotIntervalOk() ) );
-  END_OF("slotSelectRefresh");
 }
 
 /*!
-  SLOT: called when IntervalWindow's OK button is clicked
+  \brief Called when IntervalWindow's \c OK button is clicked
 */
 void ToolsGUI_RegWidget::slotIntervalOk()
 {
-  BEGIN_OF("slotIntervalOk");
   myRefreshInterval = myIntervalWindow->getValue();
-  _counter->changeInterval( myRefreshInterval * 1000 );
+  _counter->start( myRefreshInterval * 1000 );
   SCRUTE(myRefreshInterval);
   myIntervalWindow->close();
-  END_OF("slotIntervalOk");
 }
 /*!
-  Called when <Help> button is clicked
+  \brief Called when \c Help button is clicked
 */
 void ToolsGUI_RegWidget::slotHelp()
 {
-  BEGIN_OF("slotHelp()");
-
   if ( !myHelpWindow ) {
-    myHelpWindow  = new ToolsGUI_HelpWindow( this );
+    myHelpWindow  = new ToolsGUI_RegWidget::HelpWindow( this );
     myHelpWindow->installEventFilter( this );
   }
   myHelpWindow->show();
   myHelpWindow->raise();
-  myHelpWindow->setActiveWindow();
-  
-  END_OF("slotHelp()") ;
+  myHelpWindow->activateWindow();
 }
 
 /*!
-  Called when user clicks on item in <Running> list
+  \brief Called when user clicks on item in \c Running list
+  \param item item clicked by the user
 */
-void ToolsGUI_RegWidget::slotClientChanged( QListViewItem* item )
+void ToolsGUI_RegWidget::slotClientChanged( QTreeWidgetItem* item, int col )
 {
-  BEGIN_OF("slotClientChanged()") ;
-
-  if ( item <= 0)
+  if ( !item || col < 0 )
     return;
 
   blockSignals( true ); // for sure that item will not be deleted when refreshing
 
   int numeroItem = numitem(item->text(0), item->text(1), item->text(3), _serverclients);
   SCRUTE(numeroItem) ;
-  SCRUTE(item->text(1)) ;
+  SCRUTE(item->text(1).toLatin1().constData()) ;
   
   ASSERT(numeroItem>=0) ;
   ASSERT((size_t)numeroItem<_serverclients->length()) ;
@@ -633,31 +902,26 @@ void ToolsGUI_RegWidget::slotClientChanged( QListViewItem* item )
   ASSERT( c_info.name!=NULL);
   
   if ( !myInfoWindow ) {
-    myInfoWindow  = new ToolsGUI_InfoWindow( this );
+    myInfoWindow  = new ToolsGUI_RegWidget::InfoWindow( this );
     myInfoWindow->installEventFilter( this );
   }
   QString a = tr( "More about" ) + QString( " " ) + QString( c_info.name );
-  myInfoWindow->setCaption(a);
+  myInfoWindow->setWindowTitle(a);
   myInfoWindow->setText( ToolsGUI_RegWidget::setlongText( c_info) );
   myInfoWindow->show();
   myInfoWindow->raise();
-  myInfoWindow->setActiveWindow();
+  myInfoWindow->activateWindow();
 
   blockSignals( false ); // enabling signals again
-
-  END_OF("slotClientChanged()") ;
-  return ;
 }
 
 /*!
-  Called when user clicks on item in <History> list
+  \brief Called when user clicks on item in \c History list
+  \param item item clicked by the user
 */
-void ToolsGUI_RegWidget::slotHistoryChanged( QListViewItem* item )
+void ToolsGUI_RegWidget::slotHistoryChanged( QTreeWidgetItem* item, int col )
 {
-
-  BEGIN_OF("slotHistoryChanged()") ;
-  
-  if ( item <= 0)
+  if ( !item || col < 0 )
     return;
 
   blockSignals( true ); // for sure that item will not be deleted when refreshing
@@ -665,158 +929,23 @@ void ToolsGUI_RegWidget::slotHistoryChanged( QListViewItem* item )
   int numeroItem = numitem(item->text(0), item->text(1), item->text(3), _serverhistory);
   
   SCRUTE(numeroItem) ;
-  SCRUTE(item->text(1)) ;
+  SCRUTE(item->text(1).toLatin1().constData()) ;
   ASSERT(numeroItem>=0) ;
   ASSERT((size_t)numeroItem<_serverhistory->length()) ;
   const Registry::Infos & c_info=(*_serverhistory)[numeroItem];
   ASSERT( c_info.name!=NULL);
   
   if ( !myInfoWindow ) {
-    myInfoWindow  = new ToolsGUI_InfoWindow( this );
+    myInfoWindow  = new ToolsGUI_RegWidget::InfoWindow( this );
     myInfoWindow->installEventFilter( this );
   }
   QString a = tr( "More about" ) + QString( " " ) + QString( c_info.name );
-  myInfoWindow->setCaption(a);
+  myInfoWindow->setWindowTitle(a);
   myInfoWindow->setText( ToolsGUI_RegWidget::setlongText( c_info ) );
   myInfoWindow->show();
   myInfoWindow->raise();
-  myInfoWindow->setActiveWindow();
+  myInfoWindow->activateWindow();
 
   blockSignals( false ); // enabling signals again
-
-  END_OF("slotHistoryChanged()") ;
-  return ;
 }
 
-/*!
-  Constructor
-*/
-ToolsGUI_InfoWindow::ToolsGUI_InfoWindow( QWidget* parent, const char* name )
-     : QMainWindow( parent, name, WType_TopLevel | WDestructiveClose )
-{
-  BEGIN_OF("InfoWindow");
-  myTextView = new QTextView( this, "myTextView" );
-  setCentralWidget( myTextView );
-  setMinimumSize( 450, 250 );
-  END_OF("InfoWindow");
-}
-
-/*!
-  Sets text
-*/
-void ToolsGUI_InfoWindow::setText( const QString& text )
-{
-  myTextView->setText( text );
-}
-
-/*!
-  Key press event
-*/
-void ToolsGUI_InfoWindow::keyPressEvent( QKeyEvent * e )
-{
-  QMainWindow::keyPressEvent( e );
-  if ( e->key() == Key_Escape )
-    close();
-}
-
-static const char* SEPARATOR    = ":";
-
-QString findFile( QString filename )
-{
-  QString dir;
-  char* cenv;
-  
-  // Try ${HOME}/.salome/resources directory
-  cenv = getenv( "HOME" );
-  if ( cenv ) {
-    dir.sprintf( "%s", cenv );
-    if ( !dir.isEmpty() ) {
-      dir = addSlash(dir) ;
-      dir = dir + ".salome" ;
-      dir = addSlash(dir) ;
-      dir = dir + "resources" ;
-      dir = addSlash(dir) ;
-      QFileInfo fileInfo( dir + filename );
-      if ( fileInfo.isFile() && fileInfo.exists() )
-       return fileInfo.filePath();
-    }
-  }
-  // Try ${SALOME_SITE_DIR}/share/salome/resources directory
-  cenv = getenv( "SALOME_SITE_DIR" );
-  if ( cenv ) {
-    dir.sprintf( "%s", cenv );
-    if ( !dir.isEmpty() ) {
-      dir = addSlash(dir) ;
-      dir = dir + "share" ;
-      dir = addSlash(dir) ;
-      cenv = getenv("SALOME_SITE_NAME");
-      if (cenv)  dir = dir + cenv;
-      else       dir = dir + "salome" ;
-      dir = addSlash(dir) ;
-      dir = dir + "resources" ;
-      dir = addSlash(dir) ;
-      QFileInfo fileInfo( dir + filename );
-      if ( fileInfo.isFile() && fileInfo.exists() )
-       return fileInfo.filePath();
-    }
-  }
-  // Try ${KERNEL_ROOT_DIR}/share/salome/resources directory
-  cenv = getenv( "KERNEL_ROOT_DIR" );
-  if ( cenv ) {
-    dir.sprintf( "%s", cenv );
-    if ( !dir.isEmpty() ) {
-      dir = addSlash(dir) ;
-      dir = dir + "share" ;
-      dir = addSlash(dir) ;
-      dir = dir + "salome" ;
-      dir = addSlash(dir) ;
-      dir = dir + "resources" ;
-      dir = addSlash(dir) ;
-      dir = dir + "kernel" ;
-      dir = addSlash(dir) ;
-      QFileInfo fileInfo( dir + filename );
-      if ( fileInfo.isFile() && fileInfo.exists() )
-       return fileInfo.filePath();
-    }
-  }
-
-  //SRN Added support for SALOMEGUI
-  cenv = getenv( "SALOMEGUI_ROOT_DIR" );
-  if ( cenv ) {
-    dir.sprintf( "%s", cenv );
-    if ( !dir.isEmpty() ) {
-      dir = addSlash(dir) ;
-      dir = dir + "share" ;
-      dir = addSlash(dir) ;
-      dir = dir + "salome" ;
-      dir = addSlash(dir) ;
-      dir = dir + "resources" ;
-      dir = addSlash(dir) ;
-      QFileInfo fileInfo( dir + filename );
-      if ( fileInfo.isFile() && fileInfo.exists() )
-       return fileInfo.filePath();
-    }
-  }
-
-  // Try CSF_SaloameResources env.var directory ( or directory list )
-  cenv = getenv( "CSF_SalomeResources" );
-  if ( cenv ) {
-  dir.sprintf( "%s", cenv );
-  if ( !dir.isEmpty() )
-  {
-    QStringList dirList = QStringList::split( SEPARATOR, dir, false ); // skip empty entries
-    for ( int i = 0; i < (int)dirList.count(); i++ )
-    {
-           QFileInfo fileInfo( addSlash( dirList[ i ] ) + filename );
-           if ( fileInfo.isFile() && fileInfo.exists() )
-             return fileInfo.filePath();
-      }
-    }
-  }
-  return filename;
-}
-
-QString addSlash( const QString& path )
-{
-  return Qtx::addSlash( path );
-}
index be40bc8a245b71c9c85fa39342d5a979f7129a52..1c9b3d5492055098a73b9bdaff83ed2dc1ad1d35 100755 (executable)
-//  SALOME RegistryDisplay : GUI for Registry server implementation
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  File   : RegWidget.h
+//  SALOME RegistryDisplay : GUI for Registry server implementation
+//  File   : ToolsGUI_RegWidget.h
 //  Author : Pascale NOYRET, EDF
-//  Module : SALOME
-//  $Header$
+//
+#ifndef TOOLSGUI_REGWIDGET_H
+#define TOOLSGUI_REGWIDGET_H
 
-#ifndef __REGWIDGET_H__
-#define __REGWIDGET_H__
-#include <qapplication.h>
-#include <qmainwindow.h>
+#include "ToolsGUI.h"
+
+#include <QMainWindow>
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(SALOME_Registry)
 
 class QTabWidget;
-class QListView;
-class QListViewItem;
+class QTreeWidget;
+class QTreeWidgetItem;
 class QWidget;
 class QTimer;
 class QCloseEvent;
-class QTextView;
-#if QT_VERSION > 300
-class QPushButton;
-#endif
-
-#include <Standard_Macro.hxx>
-
-class ToolsGUI_HelpWindow;
-class ToolsGUI_IntervalWindow;
+class QAction;
 
-class Standard_EXPORT  ToolsGUI_InfoWindow : public QMainWindow
+class TOOLSGUI_EXPORT ToolsGUI_RegWidget : public QMainWindow
 {
   Q_OBJECT
 
-public:
-  ToolsGUI_InfoWindow( QWidget* parent = 0, const char* name = 0);
-
-  void setText( const QString& text );
-  QTextView* textView() const { return myTextView; }
+  class HelpWindow;
+  class IntervalWindow;
+  class InfoWindow;
 
-protected:
-  void keyPressEvent( QKeyEvent * e );
-
-private:
-  QTextView* myTextView;
-};
-
-class Standard_EXPORT ToolsGUI_RegWidget : public QMainWindow
-{
-  Q_OBJECT
+  ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent = 0 );
 
 public:
-  ToolsGUI_RegWidget( CORBA::ORB_var &orb , QWidget *parent = 0, const char *name = 0 );
   ~ToolsGUI_RegWidget();
-  void       SetListe();
-  void       SetListeHistory();
-  void       InfoReg();
-  void       InfoHistory();
 
-  bool       eventFilter( QObject* object, QEvent* event );
+  void                       SetListe();
+  void                       SetListeHistory();
+  void                       InfoReg();
+  void                       InfoHistory();
+
+  bool                       eventFilter( QObject* object, QEvent* event );
 
-  static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_var &orb , QWidget *parent = 0, const char *name = 0 );
+  static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_var& orb, 
+                                          QWidget* parent = 0 );
+
+  virtual QMenu*             createPopupMenu();
 
 public slots:
-  void       slotHelp();
-  void       slotListeSelect();
-  void       slotClientChanged( QListViewItem* );
-  void       slotHistoryChanged( QListViewItem* );
-  void       slotSelectRefresh();
-  void       slotIntervalOk();
+  void                       slotHelp();
+  void                       slotListeSelect();
+  void                       slotClientChanged( QTreeWidgetItem*, int );
+  void                       slotHistoryChanged( QTreeWidgetItem*, int );
+  void                       slotSelectRefresh();
+  void                       slotIntervalOk();
+
 protected:  
-  static QString setlongText( const Registry::Infos &c_info );
-  int            numitem( const QString& name, const QString& pid, const QString& machine, const Registry::AllInfos* c_info );
-  void           closeEvent( QCloseEvent *e);
+  static QString             setlongText( const Registry::Infos& c_info );
+  int                        numitem( const QString& name, 
+                                     const QString& pid, 
+                                     const QString& machine, 
+                                     const Registry::AllInfos* clistclient );
+  void                       closeEvent( QCloseEvent* e );
    
 protected :
-  QListView*               _clients;
-  QListView*               _history;
-  QWidget*                 _parent;
-  QTabWidget*              _tabWidget;
-  QPushButton*             _refresh;
-  QPushButton*             _interval;
-  QPushButton*             _close;
-  QTimer*                  _counter;
-  Registry::AllInfos*      _serverhistory;
-  Registry::AllInfos*      _serverclients;
-  ToolsGUI_InfoWindow*     myInfoWindow;
-  ToolsGUI_HelpWindow*     myHelpWindow;
-  ToolsGUI_IntervalWindow* myIntervalWindow;
-  int                      myRefreshInterval;
+  QTreeWidget*         _clients;
+  QTreeWidget*         _history;
+  QWidget*             _parent;
+  QTabWidget*          _tabWidget;
+  QAction*             _refresh;
+  QAction*             _interval;
+  QAction*             _close;
+  QTimer*              _counter;
+  Registry::AllInfos*  _serverhistory;
+  Registry::AllInfos*  _serverclients;
+  InfoWindow*          myInfoWindow;
+  HelpWindow*          myHelpWindow;
+  IntervalWindow*      myIntervalWindow;
+  int                  myRefreshInterval;
 
 private:
-  const      Registry::Components_var _VarComponents;
-  static     ToolsGUI_RegWidget* myRegWidgetPtr;
+  const Registry::Components_var _VarComponents;
+  static ToolsGUI_RegWidget*     myRegWidgetPtr;
 };
 
-#endif
+#endif // TOOLSGUI_REGWIDGET_H
index f59a4fc94f0a692614acb10332414b63cd8c030e..0501074da9d5a6c284f2dd5fac9d943a0e8aa56b 100755 (executable)
@@ -1,29 +1,28 @@
-#  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 #  File   : ToolsGUI_icons.po
 #  Module : SALOME
-
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: SALOME VERSION 0.4\n"
index cfab19fbba9340cb3f7c48bf870bfc5e2f282142..8b7c8c8516ec160b744fc679dd89e6d74bec37d9 100755 (executable)
@@ -1,29 +1,28 @@
-#  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 #  File   : ToolsGUI_msg_en.po
 #  Module : SALOME
-
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: SALOME VERSION 0.4\n"
diff --git a/src/TOOLSGUI/resources/ToolsGUI_msg_en.ts b/src/TOOLSGUI/resources/ToolsGUI_msg_en.ts
new file mode 100644 (file)
index 0000000..91c4043
--- /dev/null
@@ -0,0 +1,128 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>TOOLS_WRN_WARNING</source>
+        <translation>Warning</translation>
+    </message>
+    <message>
+        <source>TOOLS_BUT_BROWSE</source>
+        <translation>Browse...</translation>
+    </message>
+    <message>
+        <source>TOOLS_ERR_ERROR</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>TOOLS_ERR_FILE_NOT_EXIST</source>
+        <translation>%1
+File doesn&apos;t exist</translation>
+    </message>
+    <message>
+        <source>TOOLS_BUT_OK</source>
+        <translation>&amp;Ok</translation>
+    </message>
+    <message>
+        <source>TOOLS_BUT_APPLY</source>
+        <translation>&amp;Apply</translation>
+    </message>
+    <message>
+        <source>TOOLS_BUT_CLOSE</source>
+        <translation>&amp;Close</translation>
+    </message>
+</context>
+<context>
+    <name>ToolsGUI_CatalogGeneratorDlg</name>
+    <message>
+        <source>TOOLS_MEN_EXPORT</source>
+        <translation>Export</translation>
+    </message>
+    <message>
+        <source>TOOLS_MEN_IMPORT</source>
+        <translation>Import</translation>
+    </message>
+    <message>
+        <source>TOOLS_VERSION</source>
+        <translation>Version : </translation>
+    </message>
+    <message>
+        <source>TOOLS_COMP_NAME</source>
+        <translation>Name : </translation>
+    </message>
+    <message>
+        <source>TOOLS_COMP_TYPE</source>
+        <translation>Type : </translation>
+    </message>
+    <message>
+        <source>TOOLS_XML_FILE</source>
+        <translation>XML : </translation>
+    </message>
+    <message>
+        <source>TOOLS_PNG_FILE</source>
+        <translation>Icon : </translation>
+    </message>
+    <message>
+        <source>TOOLS_SUPPLEMENT</source>
+        <translation>Component supplementary data</translation>
+    </message>
+    <message>
+        <source>TOOLS_AUTHOR</source>
+        <translation>Author : </translation>
+    </message>
+    <message>
+        <source>TOOLS_COMP_MULTISTD</source>
+        <translation>Multistudy : </translation>
+    </message>
+    <message>
+        <source>TOOLS_COMP_USERNAME</source>
+        <translation>UserName : </translation>
+    </message>
+    <message>
+        <source>TOOLS_CATALOG_GENERATOR</source>
+        <translation>Catalog generator</translation>
+    </message>
+    <message>
+        <source>TOOLS_FILES</source>
+        <translation>Files</translation>
+    </message>
+    <message>
+        <source>TOOLS_MEN_IMPORT_PNG</source>
+        <translation>PNG Files ( *.png )</translation>
+    </message>
+    <message>
+        <source>TOOLS_MEN_IMPORT_IDL</source>
+        <translation>IDL Files ( *.idl )</translation>
+    </message>
+    <message>
+        <source>TOOLS_MEN_EXPORT_XML</source>
+        <translation>XML Files ( *.xml )</translation>
+    </message>
+    <message>
+        <source>TOOLS_IDL_FILE</source>
+        <translation>IDL : </translation>
+    </message>
+</context>
+</TS>
index 5b3da9f55cc8e5ee2387ca635907aa78d6aa5202..65a01c533bc7c9f16ff7a561af3fc47b6c71cb71 100755 (executable)
@@ -1,4 +1,7 @@
-#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU Lesser General Public
 #  License along with this library; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : VTKViewer
-# $Header$
 
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libVTKViewer.la
 
-salomeinclude_HEADERS= \
-       VTKViewer.h \
-       VTKViewer_CellLocationsArray.h \
-       VTKViewer_Actor.h \
-       VTKViewer_ExtractUnstructuredGrid.h \
-       VTKViewer_ConvexTool.h \
-       VTKViewer_Filter.h \
-       VTKViewer_GeometryFilter.h \
-       VTKViewer_AppendFilter.h \
-       VTKViewer_Algorithm.h \
-       VTKViewer_InteractorStyle.h \
-       VTKViewer_RenderWindow.h \
-       VTKViewer_RenderWindowInteractor.h \
-       VTKViewer_ShrinkFilter.h \
-       VTKViewer_TransformFilter.h \
-       VTKViewer_Transform.h \
-       VTKViewer_Trihedron.h \
-       VTKViewer_Utilities.h \
-       VTKViewer_ViewManager.h \
-       VTKViewer_ViewModel.h \
-       VTKViewer_ViewWindow.h \
+salomeinclude_HEADERS =                                \
+       VTKViewer.h                             \
+       VTKViewer_CellLocationsArray.h          \
+       VTKViewer_Actor.h                       \
+       VTKViewer_ExtractUnstructuredGrid.h     \
+       VTKViewer_ConvexTool.h                  \
+       VTKViewer_Filter.h                      \
+       VTKViewer_GeometryFilter.h              \
+       VTKViewer_AppendFilter.h                \
+       VTKViewer_Algorithm.h                   \
+       VTKViewer_InteractorStyle.h             \
+       VTKViewer_RenderWindow.h                \
+       VTKViewer_RenderWindowInteractor.h      \
+       VTKViewer_ShrinkFilter.h                \
+       VTKViewer_TransformFilter.h             \
+       VTKViewer_Transform.h                   \
+       VTKViewer_Trihedron.h                   \
+       VTKViewer_Utilities.h                   \
+       VTKViewer_ViewManager.h                 \
+       VTKViewer_ViewModel.h                   \
+       VTKViewer_ViewWindow.h                  \
        VTKViewer_Functor.h
 
-dist_libVTKViewer_la_SOURCES= \
-       VTKViewer_CellLocationsArray.cxx \
-       VTKViewer_Actor.cxx \
-       VTKViewer_ExtractUnstructuredGrid.cxx \
-       VTKViewer_Filter.cxx \
-       VTKViewer_GeometryFilter.cxx \
-       VTKViewer_AppendFilter.cxx \
-       VTKViewer_InteractorStyle.cxx \
-       VTKViewer_RenderWindow.cxx \
-       VTKViewer_RenderWindowInteractor.cxx \
-       VTKViewer_ShrinkFilter.cxx \
-       VTKViewer_Transform.cxx \
-       VTKViewer_TransformFilter.cxx \
-       VTKViewer_Trihedron.cxx \
-       VTKViewer_Utilities.cxx \
-       VTKViewer_ViewManager.cxx \
-       VTKViewer_ViewModel.cxx \
-       VTKViewer_ConvexTool.cxx \
+dist_libVTKViewer_la_SOURCES =                 \
+       VTKViewer_CellLocationsArray.cxx        \
+       VTKViewer_Actor.cxx                     \
+       VTKViewer_ExtractUnstructuredGrid.cxx   \
+       VTKViewer_Filter.cxx                    \
+       VTKViewer_GeometryFilter.cxx            \
+       VTKViewer_AppendFilter.cxx              \
+       VTKViewer_InteractorStyle.cxx           \
+       VTKViewer_RenderWindow.cxx              \
+       VTKViewer_RenderWindowInteractor.cxx    \
+       VTKViewer_ShrinkFilter.cxx              \
+       VTKViewer_Transform.cxx                 \
+       VTKViewer_TransformFilter.cxx           \
+       VTKViewer_Trihedron.cxx                 \
+       VTKViewer_Utilities.cxx                 \
+       VTKViewer_ViewManager.cxx               \
+       VTKViewer_ViewModel.cxx                 \
+       VTKViewer_ConvexTool.cxx                \
        VTKViewer_ViewWindow.cxx                
 
-MOC_FILES= \
-       VTKViewer_RenderWindow_moc.cxx \
-       VTKViewer_RenderWindowInteractor_moc.cxx \
-       VTKViewer_ViewManager_moc.cxx \
-       VTKViewer_ViewModel_moc.cxx \
+MOC_FILES =                                            \
+       VTKViewer_RenderWindow_moc.cxx                  \
+       VTKViewer_RenderWindowInteractor_moc.cxx        \
+       VTKViewer_ViewManager_moc.cxx                   \
+       VTKViewer_ViewModel_moc.cxx                     \
        VTKViewer_ViewWindow_moc.cxx 
-nodist_libVTKViewer_la_SOURCES= $(MOC_FILES)
+nodist_libVTKViewer_la_SOURCES = $(MOC_FILES)
 
-dist_salomeres_DATA=\
-       resources/view_back.png \
-       resources/view_bottom.png \
-       resources/view_camera_dump.png \
-       resources/view_fitall.png \
-       resources/view_fitarea.png \
-       resources/view_front.png \
-       resources/view_glpan.png \
-       resources/view_graduated_axes.png \
-       resources/view_left.png \
-       resources/view_pan.png \
-       resources/view_reset.png \
-       resources/view_right.png \
-       resources/view_rotate.png \
-       resources/view_scaling.png \
-       resources/view_top.png \
-       resources/view_triedre.png \
-       resources/view_update_rate.png \
-       resources/view_zoom.png \
-       resources/view_rotation_point.png
+dist_salomeres_DATA =                          \
+       resources/vtk_view_back.png             \
+       resources/vtk_view_bottom.png           \
+       resources/vtk_view_camera_dump.png      \
+       resources/vtk_view_fitall.png           \
+       resources/vtk_view_fitarea.png          \
+       resources/vtk_view_front.png            \
+       resources/vtk_view_glpan.png            \
+       resources/vtk_view_left.png             \
+       resources/vtk_view_pan.png              \
+       resources/vtk_view_reset.png            \
+       resources/vtk_view_right.png            \
+       resources/vtk_view_rotate.png           \
+       resources/vtk_view_top.png              \
+       resources/vtk_view_triedre.png          \
+       resources/vtk_view_zoom.png
 
-nodist_salomeres_DATA= \
-       VTKViewer_images.qm \
+nodist_salomeres_DATA =                \
+       VTKViewer_images.qm     \
        VTKViewer_msg_en.qm
 
-libVTKViewer_la_CPPFLAGS=$(QT_INCLUDES) $(VTK_INCLUDES) $(CAS_CPPFLAGS) \
+libVTKViewer_la_CPPFLAGS = $(QT_INCLUDES) $(VTK_INCLUDES) $(CAS_CPPFLAGS)      \
        -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
-libVTKViewer_la_LDFLAGS=$(VTK_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) \
+libVTKViewer_la_LDFLAGS = $(VTK_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) $(OGL_LIBS)  \
        ../Qtx/libqtx.la ../SUIT/libsuit.la
 
 # Executable
 
 bin_PROGRAMS = VTKViewer
 
-dist_VTKViewer_SOURCES=VTKViewer.cxx
+dist_VTKViewer_SOURCES = VTKViewer.cxx
 
-VTKViewer_CPPFLAGS=$(libVTKViewer_la_CPPFLAGS)
-VTKViewer_LDADD=libVTKViewer.la $(libVTKViewer_la_LDFLAGS)
+VTKViewer_CPPFLAGS = $(libVTKViewer_la_CPPFLAGS)
+VTKViewer_LDADD    = libVTKViewer.la $(libVTKViewer_la_LDFLAGS)
 
index a65c5c204eaf3ea75720b268cbd2bc4359ad3aa6..0c39feb56241ccc06cbf82a9587904912d66a96b 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   :
 //  Author :
 //  Module :
 //  $Header$
-
+//
 #include "VTKViewer_Actor.h"
 #include "VTKViewer_ExtractUnstructuredGrid.h"
 #include "VTKViewer_ConvexTool.h"
index 77de948308415189a02f8a84f1547c0041bfae57..c05da2448d7e48a8d3bf13ff000f07a868acf64d 100755 (executable)
@@ -1,26 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef VTKVIEWER_H
 #define VTKVIEWER_H
 
-#ifdef WNT
+#ifdef WIN32
 #  ifdef VTKVIEWER_EXPORTS
 #    define VTKVIEWER_EXPORT __declspec( dllexport )
 #  else
diff --git a/src/VTKViewer/VTKViewer.pro b/src/VTKViewer/VTKViewer.pro
new file mode 100644 (file)
index 0000000..0d7fb63
--- /dev/null
@@ -0,0 +1,99 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+TEMPLATE = lib
+TARGET = VTKViewer
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+VTKHOME = $$(VTKHOME)
+VTK_INCLUDES = $${VTKHOME}/include/vtk
+
+VTK_LIBS = -L$${VTKHOME}/lib/vtk -L$${VTKHOME}/lib/vtk/python -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets   -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
+
+INCLUDEPATH += ../../include $${VTK_INCLUDES} $${CAS_CPPFLAGS} ../Qtx ../SUIT
+LIBS += -L../../lib -lqtx -lsuit $${VTK_LIBS} $${CAS_KERNEL}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += VTKVIEWER_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = VTKViewer.h
+HEADERS += VTKViewer_CellLocationsArray.h
+HEADERS += VTKViewer_Actor.h
+HEADERS += VTKViewer_ExtractUnstructuredGrid.h
+HEADERS += VTKViewer_ConvexTool.h
+HEADERS += VTKViewer_Filter.h
+HEADERS += VTKViewer_GeometryFilter.h
+HEADERS += VTKViewer_AppendFilter.h
+HEADERS += VTKViewer_Algorithm.h
+HEADERS += VTKViewer_InteractorStyle.h
+HEADERS += VTKViewer_RenderWindow.h
+HEADERS += VTKViewer_RenderWindowInteractor.h
+HEADERS += VTKViewer_ShrinkFilter.h
+HEADERS += VTKViewer_TransformFilter.h
+HEADERS += VTKViewer_Transform.h
+HEADERS += VTKViewer_Trihedron.h
+HEADERS += VTKViewer_Utilities.h
+HEADERS += VTKViewer_ViewManager.h
+HEADERS += VTKViewer_ViewModel.h
+HEADERS += VTKViewer_ViewWindow.h
+HEADERS += VTKViewer_Functor.h
+
+SOURCES  = VTKViewer_CellLocationsArray.cxx
+SOURCES += VTKViewer_Actor.cxx
+SOURCES += VTKViewer_ExtractUnstructuredGrid.cxx
+SOURCES += VTKViewer_Filter.cxx
+SOURCES += VTKViewer_GeometryFilter.cxx
+SOURCES += VTKViewer_AppendFilter.cxx
+SOURCES += VTKViewer_InteractorStyle.cxx
+SOURCES += VTKViewer_RenderWindow.cxx
+SOURCES += VTKViewer_RenderWindowInteractor.cxx
+SOURCES += VTKViewer_ShrinkFilter.cxx
+SOURCES += VTKViewer_Transform.cxx
+SOURCES += VTKViewer_TransformFilter.cxx
+SOURCES += VTKViewer_Trihedron.cxx
+SOURCES += VTKViewer_Utilities.cxx
+SOURCES += VTKViewer_ViewManager.cxx
+SOURCES += VTKViewer_ViewModel.cxx
+SOURCES += VTKViewer_ConvexTool.cxx
+SOURCES += VTKViewer_ViewWindow.cxx
+
+TRANSLATIONS = resources/VTKViewer_images.ts \
+               resources/VTKViewer_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index 5c65df651e9af2a7568725a23f388ed2269345cb..d086127716801013a4ddee98ff470161f2bd670b 100755 (executable)
@@ -1,31 +1,30 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_Actor.cxx
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 /*!
   \class SALOME_Actor SALOME_Actor.h
   \brief Abstract class of SALOME Objects in VTK.
index 72035b6aea01de18ff856f7c2696b1830f590793..77e54f2450d71a4559fa1b2f03b4c6b93d6009ec 100755 (executable)
@@ -1,31 +1,30 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_Actor.h
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef VTKVIEVER_ACTOR_H
 #define VTKVIEVER_ACTOR_H
 
index b533f149b19c535ee30a73f0da7f7115d980fb8b..fefcb3a8a3cdf7293ee3467453277b2412647e0e 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : VTKViewer_ViewFrame.h
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef VTKViewer_Algorithm_H
 #define VTKViewer_Algorithm_H
 
index 26610336968017acbe887ee6cf74f46fea14f363..ccde1876d6d497e6e6edd29676e625e945fecd37 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME OBJECT : kernel of SALOME component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : kernel of SALOME component
 //  File   : VTKViewer_GeometryFilter.cxx
 //  Author : 
 //  Module : SALOME
 //  $Header$
-
+//
 #include "VTKViewer_AppendFilter.h"
 
 #include <vtkCell.h>
index ef2e7f11d41d6845290f0aab1cf1d30587eeeb02..9f90c66581f6420fb6b0093469b200672c3f7ff5 100644 (file)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_APPENDFILTER_H
 #define VTKVIEWER_APPENDFILTER_H
index 995eedf49d7d6d19427ec6872ea8d0bb67c02c8b..c928d26f1f77b6f3c47791c7d1d11226070cc96d 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   :
 //  Author :
 //  Module :
 //  $Header$
-
+//
 #include "VTKViewer_CellLocationsArray.h"
 
 #include <vtkObjectFactory.h>
index 4d965a8e12ba47dc72971fc4f15e45d9e39743d0..5fad08ef84dec2bf05259a6ecfe5dfeb969812bc 100644 (file)
@@ -1,22 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef VTKVIEWER_CELLLOCATIONS_H
 #define VTKVIEWER_CELLLOCATIONS_H
 
index 46e6377f6cd7b2c03ea194a0412b08fc797fbc80..96b6bec3384f233676cd7fb4313364525520acd9 100644 (file)
@@ -1,40 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
 #include "VTKViewer_ConvexTool.h"
 
 #include <set>
 #include <map>
-
-#ifdef WNT
 #include <algorithm>
-#endif
 
 #include <vtkUnstructuredGrid.h>
 #include <vtkGeometryFilter.h>
index 5e391d976af4cc0667d687c10e8f5a82ac4cc132..0f4429c2badb3363023fe4f443073305fc0395ec 100644 (file)
@@ -1,23 +1,24 @@
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #ifndef _VTKViewer_ConvexTool_H
 #define _VTKViewer_ConvexTool_H
 
index ea3abb5ff2dc9ab82e2ad8b742d902284a167c1c..7cd46041a9c2e26a334a3397709c06dd3394fcb7 100755 (executable)
@@ -1,30 +1,29 @@
-//  VISU CONVERTOR :
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  VISU CONVERTOR :
 // File:    VISU_ExtractUnstructuredGrid.cxx
 // Author:  Alexey PETROV
 // Module : VISU
-
-
+//
 #include "VTKViewer_ExtractUnstructuredGrid.h"
 #include "VTKViewer_CellLocationsArray.h"
 
index 71f3274d8cb7f82e8fa2cfae05c1d5ae6bee7e41..8c3b4a7dc5bc3b3545bf0c58274ae654487a6216 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H
 #define VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H
index f33ea7baead721fd4238cc1e51270539e594a08f..ca9907a840137474baebe9e321be0f9837fc8af5 100755 (executable)
@@ -1,30 +1,29 @@
-//  VTKViewer_Filter : Filter for VTK viewer
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  VTKViewer_Filter : Filter for VTK viewer
 //  File   : VTKViewer_Filter.cxx
 //  Author : Sergey LITONIN
 //  Module : SALOME
-
+//
 #include "VTKViewer_Filter.h"
 using namespace std;
 
index 7e72b8df5adff07f17946a2bfcd4f6c70d74a40e..74bcb2041e2639922e8eadc9b4beb1592df695fa 100755 (executable)
@@ -1,30 +1,29 @@
-//  SMESHGUI_Filter : Filter for VTK viewer
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SMESHGUI_Filter : Filter for VTK viewer
 //  File   : VTKViewer_Filter.h
 //  Author : Sergey LITONIN
 //  Module : SALOME
-
+//
 #ifndef VTKViewer_Filter_HeaderFile
 #define VTKViewer_Filter_HeaderFile
 
index 7aa5630befbb8a6442c5cb4d9d8d49bae1233784..e1bb57b173b8fe9dc895b51cc8285961e82634b3 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : VTKViewer_ViewFrame.h
 //  Author : Nicolas REJNERI
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef VTKViewer_Functor_H
 #define VTKViewer_Functor_H
 
index 5d2590de63e9f337ee114d020decbc90bd4c1333..c9f40a734dd00ac6d5490479762214f21dc7d7a6 100755 (executable)
@@ -1,31 +1,30 @@
-//  SALOME OBJECT : kernel of SALOME component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME OBJECT : kernel of SALOME component
 //  File   : VTKViewer_GeometryFilter.cxx
 //  Author : Michael ZORIN
 //  Module : SALOME
-//  $Header$
-
+//  $Header$ 
+//
 #include "VTKViewer_GeometryFilter.h"
 #include "VTKViewer_ConvexTool.h"
 
@@ -152,7 +151,10 @@ VTKViewer_GeometryFilter
   vtkIdType newCellId;
   int faceId, *faceVerts, numFacePts;
   vtkFloatingPointType *x;
-  int PixelConvert[4], aNewPts[VTK_CELL_SIZE];
+  vtkIdType PixelConvert[4];
+  // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
+  // from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON
+  vtkIdType aNewPts[VTK_CELL_SIZE];
   // ghost cell stuff
   unsigned char  updateLevel = (unsigned char)(output->GetUpdateGhostLevel());
   unsigned char  *cellGhostLevels = 0;  
@@ -474,6 +476,8 @@ VTKViewer_GeometryFilter
         case VTK_QUADRATIC_QUAD:
         case VTK_QUADRATIC_TETRA:
         case VTK_QUADRATIC_HEXAHEDRON:
+        case VTK_QUADRATIC_WEDGE:
+        case VTK_QUADRATIC_PYRAMID:
          if(!myIsWireframeMode){
            input->GetCell(cellId,cell);
            vtkIdList *pts = vtkIdList::New();  
@@ -650,6 +654,82 @@ VTKViewer_GeometryFilter
 
              break;
            }
+            case VTK_QUADRATIC_WEDGE: {
+              aCellType = VTK_POLYGON;
+             numFacePts = 6;
+              //---------------------------------------------------------------
+              //Face 1
+             aNewPts[0] = pts[0];
+             aNewPts[1] = pts[6];
+             aNewPts[2] = pts[1];
+             aNewPts[3] = pts[7];
+             aNewPts[4] = pts[2];
+             aNewPts[5] = pts[8];
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+              outputCD->CopyData(cd,cellId,newCellId);
+              
+              //---------------------------------------------------------------
+              //Face 2
+              aNewPts[0] = pts[3];
+             aNewPts[1] = pts[9];
+             aNewPts[2] = pts[4];
+             aNewPts[3] = pts[10];
+             aNewPts[4] = pts[5];
+             aNewPts[5] = pts[11];
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+              outputCD->CopyData(cd,cellId,newCellId);
+              
+              //---------------------------------------------------------------
+              //Face 3
+              numFacePts = 8;
+              aNewPts[0] = pts[0];
+             aNewPts[1] = pts[8];
+             aNewPts[2] = pts[2];
+             aNewPts[3] = pts[14];
+             aNewPts[4] = pts[5];
+             aNewPts[5] = pts[11];
+             aNewPts[6] = pts[3];
+             aNewPts[7] = pts[12];
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              //Face 4
+              aNewPts[0] = pts[1];
+             aNewPts[1] = pts[13];
+             aNewPts[2] = pts[4];
+             aNewPts[3] = pts[10];
+             aNewPts[4] = pts[5];
+             aNewPts[5] = pts[14];
+             aNewPts[6] = pts[2];
+             aNewPts[7] = pts[7];
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              //Face 5
+              aNewPts[0] = pts[0];
+             aNewPts[1] = pts[12];
+             aNewPts[2] = pts[3];
+             aNewPts[3] = pts[9];
+             aNewPts[4] = pts[4];
+             aNewPts[5] = pts[13];
+              aNewPts[6] = pts[1];
+              aNewPts[7] = pts[6];
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+              outputCD->CopyData(cd,cellId,newCellId);
+              break;
+            }
            case VTK_QUADRATIC_HEXAHEDRON: {
              aCellType = VTK_POLYGON;
              numFacePts = 8;
@@ -750,6 +830,85 @@ VTKViewer_GeometryFilter
              
              outputCD->CopyData(cd,cellId,newCellId);
              
+             break;
+           }
+           case VTK_QUADRATIC_PYRAMID: {
+             aCellType = VTK_POLYGON;
+             numFacePts = 6;
+             
+             //---------------------------------------------------------------
+             aNewPts[0] = pts[0];
+             aNewPts[1] = pts[8];
+             aNewPts[2] = pts[3];
+             aNewPts[3] = pts[12];
+             aNewPts[4] = pts[4];
+             aNewPts[5] = pts[9];
+             
+             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+             
+             outputCD->CopyData(cd,cellId,newCellId);
+
+             //---------------------------------------------------------------
+             aNewPts[0] = pts[0];
+             aNewPts[1] = pts[9];
+             aNewPts[2] = pts[4];
+             aNewPts[3] = pts[10];
+             aNewPts[4] = pts[1];
+             aNewPts[5] = pts[5];
+             
+             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+             
+             outputCD->CopyData(cd,cellId,newCellId);
+
+             //---------------------------------------------------------------
+             aNewPts[0] = pts[1];
+             aNewPts[1] = pts[10];
+             aNewPts[2] = pts[4];
+             aNewPts[3] = pts[11];
+             aNewPts[4] = pts[2];
+             aNewPts[5] = pts[6];
+             
+             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+             
+             outputCD->CopyData(cd,cellId,newCellId);
+
+             //---------------------------------------------------------------
+             aNewPts[0] = pts[2];
+             aNewPts[1] = pts[11];
+             aNewPts[2] = pts[4];
+             aNewPts[3] = pts[12];
+             aNewPts[4] = pts[3];
+             aNewPts[5] = pts[7];
+             
+             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+             
+             outputCD->CopyData(cd,cellId,newCellId);
+
+             //---------------------------------------------------------------
+              numFacePts = 8;
+             aNewPts[0] = pts[0];
+             aNewPts[1] = pts[5];
+             aNewPts[2] = pts[1];
+             aNewPts[3] = pts[6];
+             aNewPts[4] = pts[2];
+             aNewPts[5] = pts[7];
+             aNewPts[6] = pts[3];
+             aNewPts[7] = pts[8];
+             
+             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+             
+             outputCD->CopyData(cd,cellId,newCellId);
+
              break;
            }}
          }
@@ -772,7 +931,7 @@ VTKViewer_GeometryFilter
     delete [] cellVis;
     }
 
-  return 0;
+  return 1;
 }
 
 
index 300c5a948d516c5e4dbd5451f42a2e92ded3af35..b482eb5af864bb1faa761dc6a376f894a78e5a85 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_GEOMETRYFILTER_H
 #define VTKVIEWER_GEOMETRYFILTER_H
index 6bc13e78e7198268b69588e2f151921307251b3d..e69a47edf5092b0bf2fbcbf6685408be5475f217 100644 (file)
@@ -1,30 +1,29 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : VTKViewer_InteractorStyle.cxx
 //  Author : Christophe ATTANASIO
 //  Module : SALOME
-
+//
 #include "VTKViewer_InteractorStyle.h"
 
 #include "VTKViewer_Actor.h"
 #include <vtkSmartPointer.h>
 #include <vtkProperty.h>
 
-#include <qapplication.h>
-//VRV: porting on Qt 3.0.5
-#if QT_VERSION >= 0x030005
-#include <qpainter.h>
-#endif
-//VRV: porting on Qt 3.0.5
+#include <QApplication>
+#include <QRubberBand>
+
 #include <algorithm>
 
 //#include "utilities.h"
@@ -103,6 +99,8 @@ VTKViewer_InteractorStyle::VTKViewer_InteractorStyle()
   myPreSelectionActor->GetProperty()->SetLineWidth(5);
   myPreSelectionActor->GetProperty()->SetPointSize(5);
 
+  myRectBand = 0;
+
   OnSelectionModeChanged();
 }
 
@@ -111,6 +109,7 @@ VTKViewer_InteractorStyle::VTKViewer_InteractorStyle()
 VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle() 
 {
   m_ViewWnd->RemoveActor(myPreSelectionActor);
+  endDrawRect();
 }
 
 
@@ -522,13 +521,13 @@ const char* imageRotateCursor[] = {
 /*! Loads cursors for viewer operations - zoom, pan, etc...*/
 void VTKViewer_InteractorStyle::loadCursors()
 {
-  myDefCursor       = QCursor(ArrowCursor);
-  myHandCursor      = QCursor(PointingHandCursor);
-  myPanCursor       = QCursor(SizeAllCursor);
+  myDefCursor       = QCursor(Qt::ArrowCursor);
+  myHandCursor      = QCursor(Qt::PointingHandCursor);
+  myPanCursor       = QCursor(Qt::SizeAllCursor);
   myZoomCursor      = QCursor(QPixmap(imageZoomCursor));
   myRotateCursor    = QCursor(QPixmap(imageRotateCursor));
   mySpinCursor      = QCursor(QPixmap(imageRotateCursor)); // temporarly !!!!!!
-  myGlobalPanCursor = QCursor(CrossCursor);
+  myGlobalPanCursor = QCursor(Qt::CrossCursor);
   myCursorState     = false;
 }
 
@@ -776,6 +775,32 @@ void VTKViewer_InteractorStyle::setCursor(const int operation)
   }
 }
 
+/*!
+  Draws rectangle by starting and current points
+*/
+void VTKViewer_InteractorStyle::drawRect()
+{
+  if ( !myRectBand ) {
+    myRectBand = new QRubberBand( QRubberBand::Rectangle, myGUIWindow );
+    QPalette palette;
+    palette.setColor(myRectBand->foregroundRole(), Qt::white);
+    myRectBand->setPalette(palette);
+  }
+  myRectBand->hide();
+
+  QRect aRect(myPoint, myOtherPoint);
+  myRectBand->setGeometry( aRect );
+  myRectBand->setVisible( aRect.isValid() );
+}
+
+/*!
+  \brief Delete rubber band on the end on the dragging operation.
+*/
+void VTKViewer_InteractorStyle::endDrawRect()
+{
+  delete myRectBand;
+  myRectBand = 0;
+}
 
 /*! called when viewer operation started (!put necessary initialization here!)*/
 void VTKViewer_InteractorStyle::onStartOperation()
@@ -787,10 +812,7 @@ void VTKViewer_InteractorStyle::onStartOperation()
     case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
     case VTK_INTERACTOR_STYLE_CAMERA_FIT:
     {
-      QPainter p(myGUIWindow);
-      p.setPen(Qt::lightGray);
-      p.setRasterOp(Qt::XorROP);
-      p.drawRect(QRect(myPoint, myOtherPoint));
+      drawRect();
       break;
     }
     case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
@@ -1163,12 +1185,8 @@ void VTKViewer_InteractorStyle::onOperation(QPoint mousePos)
     }
   case VTK_INTERACTOR_STYLE_CAMERA_FIT:
     {
-      QPainter p(myGUIWindow);
-      p.setPen(Qt::lightGray);
-      p.setRasterOp(Qt::XorROP);
-      p.drawRect(QRect(myPoint, myOtherPoint));
       myOtherPoint = mousePos;
-      p.drawRect(QRect(myPoint, myOtherPoint));
+      drawRect();
       break;
     }
   }
index b867f64b3536b95dfaf103cf16485c0e7ab38c1b..a3e36e0976d54ba93f4a7a240225375dd63bfb0f 100644 (file)
@@ -1,30 +1,29 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : VTKViewer_InteractorStyle.h
 //  Author : Christophe ATTANASIO
 //  Module : SALOME
-
+//
 #ifndef __VTKViewer_InteractorStyle_h
 #define __VTKViewer_InteractorStyle_h
 
 class vtkCell;
 class vtkRenderWindowInteractor;
 
-#include <qobject.h>
-#include <qcursor.h>
+#include <QObject>
+#include <QCursor>
+
+class QRubberBand;
 
 #include <map>
 
@@ -159,6 +160,8 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
   virtual void onCursorMove(QPoint mousePos);
   virtual void setCursor(const int operation);
 
+  void drawRect();
+  void endDrawRect();
 
  protected:
   QCursor                   myDefCursor;
@@ -181,6 +184,8 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
   
   std::map<int, Handle(VTKViewer_Filter) > myFilters;
 
+  QRubberBand* myRectBand; //!< selection rectangle rubber band
+
   /**  @name members from old version*/
   //@{
   double                    DeltaElevation;
index f052b072c0be224b1971b0aeb5aafadfcce40067..3c0e74395ac47440d57241fbf0f96e06eca8da8c 100755 (executable)
@@ -1,31 +1,29 @@
-//  SALOME FILTER : interactive object for VISU entities implementation
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME FILTER : interactive object for VISU entities implementation
 //  File   : SALOME_PassThroughFilter.cxx
 //  Author : Laurent CORNABE with help of Nicolas REJNERI
 //  Module : SALOME
-
-
+//
 #include "VTKViewer_PassThroughFilter.h"
 
 #include <vtkCellData.h>
index 99b81ef520d5ed8a13358c869284afe9879e04e4..92ce5bb569d588aca6c45bc0e9d3d9696be980d0 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_PASSTHROUGHFILTER_H
 #define VTKVIEWER_PASSTHROUGHFILTER_H
index 82bcf80ec64b2e36a1423f7e9139e33429c2873d..be3abf8d11393b20b0b10af2a4eccf7d4fa86bdb 100755 (executable)
@@ -1,25 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "VTKViewer_RenderWindow.h"
 
-#include <qcolordialog.h>
-#include <qpopupmenu.h>
+#include <QColorDialog>
+#include <QContextMenuEvent>
 
 #include <stdlib.h>
 #include <math.h>
 #include <vtkRenderWindowInteractor.h>
 #include <vtkRendererCollection.h>
 #include <vtkCamera.h>
-#ifndef WNT
+#ifndef WIN32
+#include <QX11Info>
 #include <vtkXOpenGLRenderWindow.h>
 //#include <GL/gl.h>
 //#include <GL/glu.h>
 //#include <qgl.h>
 #endif
 
-#if QT_VERSION > 300
-#include <qcursor.h>
-#endif
-
 /*!Constructor. Create render window with parant \a parent and name \a name.
  *\param parent - parent window
  *\param name   - render window name.
  */
 VTKViewer_RenderWindow::VTKViewer_RenderWindow(QWidget* parent, const char* name) :
-QWidget(parent, name, 
-        Qt::WStyle_NoBorder | Qt::WDestructiveClose | 
-        Qt::WResizeNoErase | Qt::WRepaintNoErase)
+QWidget(parent, Qt::FramelessWindowHint )
 {
+  setObjectName( name );
+  setAttribute( Qt::WA_DeleteOnClose );
+
   myRW = vtkRenderWindow::New();
-#ifndef WNT
-  myRW->SetDisplayId((void*)x11Display());
+#ifndef WIN32
+  myRW->SetDisplayId((void*)(QX11Info::display()));
 #endif
   myRW->SetWindowId((void*)winId());
   myRW->DoubleBufferOn();
index e85b1c549566769ddb044656786ff27dc59539f6..13cbb3ea395ce100828cf1b9bccf2c1e5d5f2a4b 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_RENDERWINDOW_H
 #define VTKVIEWER_RENDERWINDOW_H
@@ -23,7 +26,7 @@
 
 #include <vtkRenderWindow.h>
 
-#include <qwidget.h>
+#include <QWidget>
 
 class VTKVIEWER_EXPORT VTKViewer_RenderWindow : public QWidget 
 {
index 9445c5b15d123e2e605d0e1950689f429159779c..907e85ed19827cca8b70813cb91fdaab648936db 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "VTKViewer_RenderWindowInteractor.h"
 #include "VTKViewer_RenderWindow.h"
 #include <vtkProperty.h>
 
 // QT Includes
-#include <qkeycode.h>
+#include <QTimer>
+#include <QMouseEvent>
+#include <QKeyEvent>
+#include <QContextMenuEvent>
 
 /*! Create new instance of VTKViewer_RenderWindowInteractor*/
 VTKViewer_RenderWindowInteractor* VTKViewer_RenderWindowInteractor::New() 
@@ -324,7 +330,8 @@ int VTKViewer_RenderWindowInteractor::CreateTimer(int vtkNotUsed(timertype))
   ///
   /// Start a one-shot timer for 10ms.
   ///
-  mTimer->start(10, TRUE) ;
+  mTimer->setSingleShot(TRUE) ;
+  mTimer->start(10) ;
   return 1 ;
 }
 
@@ -383,8 +390,8 @@ void VTKViewer_RenderWindowInteractor::LeftButtonPressed(const QMouseEvent *even
   if( ! this->Enabled ) {
     return ;
   }
-  myInteractorStyle->OnLeftButtonDown((event->state() & ControlButton), 
-                                     (event->state() & ShiftButton), 
+  myInteractorStyle->OnLeftButtonDown((event->modifiers() & Qt::ControlModifier), 
+                                     (event->modifiers() & Qt::ShiftModifier), 
                                      event->x(), event->y());
 }
 
@@ -396,8 +403,8 @@ void VTKViewer_RenderWindowInteractor::LeftButtonReleased(const QMouseEvent *eve
   if( ! this->Enabled ) {
     return ;
   }
-  myInteractorStyle->OnLeftButtonUp( (event->state() & ControlButton), 
-                                    (event->state() & ShiftButton), 
+  myInteractorStyle->OnLeftButtonUp( (event->modifiers() & Qt::ControlModifier), 
+                                    (event->modifiers() & Qt::ShiftModifier), 
                                     event->x(), event->y() ) ;
 }
 
@@ -409,8 +416,8 @@ void VTKViewer_RenderWindowInteractor::MiddleButtonPressed(const QMouseEvent *ev
   if( ! this->Enabled ) {
     return ;
   }
-  myInteractorStyle->OnMiddleButtonDown((event->state() & ControlButton), 
-                                       (event->state() & ShiftButton), 
+  myInteractorStyle->OnMiddleButtonDown((event->modifiers() & Qt::ControlModifier), 
+                                       (event->modifiers() & Qt::ShiftModifier), 
                                        event->x(), event->y() ) ;
 }
 
@@ -422,8 +429,8 @@ void VTKViewer_RenderWindowInteractor::MiddleButtonReleased(const QMouseEvent *e
   if( ! this->Enabled ) {
     return ;
   }
-  myInteractorStyle->OnMiddleButtonUp( (event->state() & ControlButton), 
-                                      (event->state() & ShiftButton), 
+  myInteractorStyle->OnMiddleButtonUp( (event->modifiers() & Qt::ControlModifier), 
+                                      (event->modifiers() & Qt::ShiftModifier), 
                                       event->x(), event->y() ) ;
 }
 
@@ -435,8 +442,8 @@ void VTKViewer_RenderWindowInteractor::RightButtonPressed(const QMouseEvent *eve
   if( ! this->Enabled ) {
     return ;
   }
-  myInteractorStyle->OnRightButtonDown( (event->state() & ControlButton), 
-                                       (event->state() & ShiftButton), 
+  myInteractorStyle->OnRightButtonDown( (event->modifiers() & Qt::ControlModifier), 
+                                       (event->modifiers() & Qt::ShiftModifier), 
                                        event->x(), event->y() ) ;
 }
 
@@ -449,14 +456,13 @@ void VTKViewer_RenderWindowInteractor::RightButtonReleased(const QMouseEvent *ev
     return ;
   }
   bool isOperation = myInteractorStyle->CurrentState() != VTK_INTERACTOR_STYLE_CAMERA_NONE;
-  myInteractorStyle->OnRightButtonUp( (event->state() & ControlButton),
-                                     (event->state() & ShiftButton),
+  myInteractorStyle->OnRightButtonUp( (event->modifiers() & Qt::ControlModifier),
+                                     (event->modifiers() & Qt::ShiftModifier),
                                      event->x(), event->y() );
   if ( !isOperation )
   {
     QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
-                              event->pos(), event->globalPos(),
-                              event->state() );
+                              event->pos(), event->globalPos() );
     emit contextMenuRequested( &aEvent );
   }
 }
index 435e5b4b8f334d0213b6bab2d710897fc3f2ce53..3edf9c8e32b78713b1800e779ca0faa1cb042c76 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_RENDERWINDOWINTERACTOR_H
 #define VTKVIEWER_RENDERWINDOWINTERACTOR_H
 #include "VTKViewer.h"
 #include "VTKViewer_Actor.h"
 
-#include <qtimer.h>
-#include <qobject.h>
+#include <QObject>
+
+class QTimer;
+class QMouseEvent;
+class QKeyEvent;
+class QContextMenuEvent;
 
 // Open CASCADE Includes
 #include <TColStd_MapOfInteger.hxx>
index 3391c08c7cad9eae79e8ad96d46edcdf39466f8a..0084d939d5d9a7325426460c963f3875053815b1 100755 (executable)
@@ -1,31 +1,30 @@
-//  SALOME OBJECT : kernel of SALOME component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME OBJECT : kernel of SALOME component
 //  File   : SALOME_GeometryFilter.cxx
 //  Author : Michael ZORIN
 //  Module : SALOME
 //  $Header$
-
+//
 #include "VTKViewer_ShrinkFilter.h"
 
 #include <vtkCell.h>
index ab46c251484ec360e7c886180648f71572b00b9f..46f912446e83bf0d2735852e07a5a3aee655a73a 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_SHRINKFILTER_H
 #define VTKVIEWER_SHRINKFILTER_H
index 4526d455533ace5e3091520524d99fa128c4c11b..7b2f92767c6708d488fcd10050e7733c26299911 100755 (executable)
@@ -1,31 +1,29 @@
-//  SALOME FILTER : interactive object for VISU entities implementation
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME FILTER : interactive object for VISU entities implementation
 //  File   : SALOME_Transform.cxx
 //  Author : Laurent CORNABE with help of Nicolas REJNERI
 //  Module : SALOME
-
-
+//
 #include "VTKViewer_Transform.h"
 
 #include <vtkObjectFactory.h>
index 9ef36457738acc78eb49cd02402e92fdbc135947..45277d86d2745fd956e9cd4f4ba5ca8e016e44e7 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_TRANSFORM_H
 #define VTKVIEWER_TRANSFORM_H
index 1c1121044562eafe0d8fe72d3bbd71328a564c58..2c463f50871d9300941b0b7588bad195ee304df8 100755 (executable)
@@ -1,31 +1,29 @@
-//  SALOME FILTER : interactive object for VISU entities implementation
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME FILTER : interactive object for VISU entities implementation
 //  File   : SALOME_TransformFilter.h
 //  Author : Laurent CORNABE with help of Nicolas REJNERI
 //  Module : SALOME
-
-
+//
 #include "VTKViewer_TransformFilter.h"
 #include "VTKViewer_Transform.h"
 
index 69a286b0666f599b7cb91621c5d3676f56cac4af..d4937c801e933e6bf678e6319eefe04f6c9d5a71 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_TRANSFORMFILTER_H
 #define VTKVIEWER_TRANSFORMFILTER_H
index f50d67b30b862bc967e3ef2efcb92107dde0b9a8..067dfecf689f73778e549b101d9227c373940cc2 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "VTKViewer_Trihedron.h"
 #include "VTKViewer_Actor.h"
@@ -80,8 +83,12 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
     vtkFloatingPointType aLength = aDataSet->GetLength();
     vtkFloatingPointType aPrecision = 1.0E-3;
     vtkFloatingPointType anOldScale = GetScale()[0];
-    vtkFloatingPointType aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1]));
-    if(fabs(aScale - anOldScale)/aScale > aPrecision){
+    vtkFloatingPointType aScale;
+    if (aSize[1] > aSize[0])
+      aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1]));
+    else
+      aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[1])/vtkFloatingPointType(aSize[0]));
+    if(aScale != 0.0&& fabs(aScale - anOldScale)/aScale > aPrecision){
       SetScale(aScale);
     }
   }
@@ -91,7 +98,7 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
 vtkStandardNewMacro(VTKViewer_LineActor);
 
 vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,VTKViewer_UnScaledActor);
-vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,VTKViewer_UnScaledActor);
+vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,vtkFollower);
 
 /*!Adds Label and Arrow actors to \a theRenderer.*/
 void VTKViewer_LineActor::Render(vtkRenderer *theRenderer)
@@ -125,16 +132,17 @@ VTKViewer_Axis::VTKViewer_Axis()
   
   /*! \li Initialize the Arrow pipe-line representation*/
   myConeSource =  vtkConeSource::New();
-  myConeSource->SetResolution(2);
+  myConeSource->SetResolution(16);
   myConeSource->SetAngle(10);
+  myConeSource->SetCenter(-0.5,0.0,0.0);
   
   myMapper[1] = vtkPolyDataMapper::New();
   myMapper[1]->SetInput(myConeSource->GetOutput());
   
-  myArrowActor = VTKViewer_UnScaledActor::New();
+  myArrowActor = vtkFollower::New();
   myArrowActor->SetMapper(myMapper[1]);
-  static int aArrowActorSize = 24;
-  myArrowActor->SetSize(aArrowActorSize);
+  static int aArrowActorSize = 16;
+  myArrowActor->SetScale(aArrowActorSize);
   myArrowActor->PickableOff();
   
   myLineActor->SetArrowActor(myArrowActor);
@@ -248,11 +256,15 @@ void VTKViewer_Axis::SetProperty(vtkProperty* theProperty){
 void VTKViewer_Axis::SetSize(vtkFloatingPointType theSize)
 {
   vtkFloatingPointType aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize};
-  myLineSource->SetPoint2(aPosition);
+
+  vtkFloatingPointType aCoef = 0.99;
+  vtkFloatingPointType aLinePosition[3] = {aPosition[0]*aCoef, aPosition[1]*aCoef, aPosition[2]*aCoef};
+  myLineSource->SetPoint2(aLinePosition);
   
   myArrowActor->SetPosition(0.0,0.0,0.0);
   myArrowActor->AddPosition(aPosition);
   myArrowActor->SetOrientation(myRot);
+  myArrowActor->SetScale(theSize / 10.);
   
   myLabelActor->SetPosition(0.0,0.0,0.0);
   myLabelActor->AddPosition(aPosition);
index 0d3b34561f5ee7ce5d987e26d7f314fd272b245d..f1bf77d3e66406c700f3c5844b915416be70a52c 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_TRIHEDRON_H
 #define VTKVIEWER_TRIHEDRON_H
@@ -86,7 +89,7 @@ public:
   /*! Sets Arrow actor.
    * \param theLabelActor - VTKViewer_UnScaledActor
    */
-  void SetArrowActor(VTKViewer_UnScaledActor* theLabelActor);
+  void SetArrowActor(vtkFollower* theArrowActor);
 
   virtual void Render(vtkRenderer *theRenderer);
   
@@ -108,7 +111,7 @@ protected:
   VTKViewer_UnScaledActor* LabelActor;
 
   /*!Arrow actor pointer*/
-  VTKViewer_UnScaledActor* ArrowActor;
+  vtkFollower* ArrowActor;
 };
 
 /*!This class provide support trihedron object in vtk viewer.*/
@@ -239,7 +242,7 @@ public:
   /*! Get arrow actor.
    * \retval Return myArrowActor
    */
-  virtual VTKViewer_UnScaledActor* GetArrow() { return myArrowActor; }
+  virtual vtkFollower* GetArrow() { return myArrowActor; }
 
   /*! Check if actor belongs to the axis object
    * \param theActor - vtkActor pointer
@@ -264,9 +267,9 @@ protected:
    */
   VTKViewer_LineActor *myLineActor;
 
-  /*! VTKViewer_UnScaledActor actor pointer
+  /*! vtkFollower actor pointer
    */
-  VTKViewer_UnScaledActor *myArrowActor;
+  vtkFollower *myArrowActor;
 
   /*! VTKViewer_UnScaledActor actor pointer
    */
index 09b7642363244dcf98a10192fc24b02e18368ac6..03d085813444b47ae74dbf872b5f352adedbe61f 100755 (executable)
@@ -1,22 +1,24 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 #include "VTKViewer_Utilities.h"
 #include "VTKViewer_Actor.h"
 
index f9bd70e0f628a9ad086651a73651d5b95de749ba..a9074da59cc17e3badef38d9afdf71d672a06b9a 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_UTILITIES_H
 #define VTKVIEWER_UTILITIES_H
index 88f4d95fbc1d7355beef2472a3c5e9b5b5f04e66..8c7f8662766910db3ffd94274298c1b162a12b3f 100755 (executable)
@@ -1,21 +1,3 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
 /*=========================================================================
 
   Program:   Visualization Toolkit
@@ -31,6 +13,8 @@
      This software is distributed WITHOUT ANY WARRANTY; without even 
      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
      PURPOSE.  See the above copyright notice for more information.*/
+     
+// Modified by Open CASCADE SAS (www.opencascade.com)    
 
 // VTKViewer_VectorText.cxx is a copy of vtkVectorText.cxx file.
 // Purpose of copying:  to remove linking to libHybrid.so VTK library 
index 347757082034652370fc8be7d65a3b934f23e94c..b554919e120fccc9fdd5f91d429d597ca5331630 100755 (executable)
@@ -1,21 +1,3 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
 /*=========================================================================
 
   Program:   Visualization Toolkit
@@ -52,6 +34,8 @@
 // VTKViewer_VectorText.h is a copy of vtkVectorText.h file.
 // Purpose of copying: to remove linking to libHybrid.so VTK library 
 
+// Modified by Open CASCADE SAS (www.opencascade.com)
+
 #ifndef __VTKViewer_VectorText_h
 #define __VTKViewer_VectorText_h
 
index a206be6ee9e95495d382ba2d3bf70ac42fd41b13..cae65130c49935a8ee481a9ec2323bfca46448c2 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "VTKViewer_ViewManager.h"
 #include "VTKViewer_ViewModel.h"
index 38518fe06d3877eab6c8efb41ed671e974c3bf74..213df207a1dbb110a8d0820d1fc06009918d612a 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_VIEWMANAGER_H
 #define VTKVIEWER_VIEWMANAGER_H
index f611972ae9d63f315bba8b22b4f17165c2ee63e0..6da15fdf82c003bfc787bc5f93242ad6c9f6508f 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "VTKViewer_ViewModel.h"
 #include "VTKViewer_ViewWindow.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_Session.h"
 
-#include <qpainter.h>
-#include <qapplication.h>
-#include <qcolordialog.h>
-#include <qpalette.h>
-#include <qpopupmenu.h>
+#include <QColorDialog>
+#include <QMenu>
+#include <QMouseEvent>
+#include <QToolBar>
 
 bool _InitializeVtkWarningsCall()
 {
@@ -90,16 +92,16 @@ void VTKViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
 }
 
 /*!Insert context into popup menu.*/
-void VTKViewer_Viewer::contextMenuPopup(QPopupMenu* thePopup)
+void VTKViewer_Viewer::contextMenuPopup(QMenu* thePopup)
 {
-  thePopup->insertItem( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
-  thePopup->insertItem( tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+  thePopup->addAction( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
+  thePopup->addAction( tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
 
-  thePopup->insertSeparator();
+  thePopup->addSeparator();
 
   VTKViewer_ViewWindow* aView = (VTKViewer_ViewWindow*)(myViewManager->getActiveView());
   if ( aView && !aView->getToolBar()->isVisible() )
-    thePopup->insertItem( tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
+    thePopup->addAction( tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
 }
 
 /*!On mouse press event.*/
@@ -111,14 +113,14 @@ void VTKViewer_Viewer::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
   if ( !rwi )
     return;
 
-  switch(event->button()) {
-  case LeftButton:
+  switch(event->buttons()) {
+  case Qt::LeftButton:
     rwi->LeftButtonPressed(event) ;
     break ;
-  case MidButton:
+  case Qt::MidButton:
     rwi->MiddleButtonPressed(event) ;
     break ;
-  case RightButton:
+  case Qt::RightButton:
     rwi->RightButtonPressed(event) ;
     break;
   default:
@@ -145,14 +147,14 @@ void VTKViewer_Viewer::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
   if ( !rwi )
     return;
 
-  switch(event->button()) {
-  case LeftButton:
+  switch(event->buttons()) {
+  case Qt::LeftButton:
     rwi->LeftButtonReleased(event) ;
     break ;
-  case MidButton:
+  case Qt::MidButton:
     rwi->MiddleButtonReleased(event) ;
     break ;
-  case RightButton:
+  case Qt::RightButton:
     rwi->RightButtonReleased(event) ;
     break;
   default:
index 06cab857f563c93057d5a945422d3918cde406e5..37298af3cdbf754a83d84495a161582863ed0a7b 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_VIEWMODEL_H
 #define VTKVIEWER_VIEWMODEL_H
@@ -22,7 +25,9 @@
 #include "VTKViewer.h"
 #include "SUIT_ViewModel.h"
 
-#include <qcolor.h>
+#include <QColor>
+
+class QMouseEvent;
 
 class SUIT_ViewWindow;
 class SUIT_Desktop;
@@ -41,7 +46,7 @@ public:
   virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
 
   virtual void             setViewManager(SUIT_ViewManager* theViewManager);
-  virtual void             contextMenuPopup( QPopupMenu* );
+  virtual void             contextMenuPopup( QMenu* );
   /*!Gets type of viewer.*/
   virtual QString          getType() const { return Type(); }
 
index e885ed8ccf16b4de302a36a6bde6ec5312d47d93..20185b38afc4e90cac1c9d6621283cd051220ee6 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "VTKViewer_ViewWindow.h"
 #include "VTKViewer_ViewModel.h"
 #include "VTKViewer_Transform.h"
 #include "VTKViewer_Utilities.h"
 
-#include "SUIT_Session.h"
-#include "SUIT_ToolButton.h"
-#include "SUIT_MessageBox.h"
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Tools.h>
+#include <SUIT_ResourceMgr.h>
 
-#include "SUIT_Tools.h"
-#include "SUIT_ResourceMgr.h"
-
-#include <qapplication.h>
-#include <qimage.h>
+#include <QImage>
 
 #include <vtkRenderer.h>
 #include <vtkCamera.h>
 
+#include <QtxToolBar.h>
+#include <QtxMultiAction.h>
+
 /*! Construction*/
 VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop, 
                                             VTKViewer_Viewer* theModel,
@@ -55,7 +58,7 @@ VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop,
 
   myRenderWindow = new VTKViewer_RenderWindow( this, "RenderWindow" );
   setCentralWidget(myRenderWindow);
-  myRenderWindow->setFocusPolicy( StrongFocus );
+  myRenderWindow->setFocusPolicy( Qt::StrongFocus );
   myRenderWindow->setFocus();
 
   myRenderWindow->getRenderWindow()->AddRenderer( myRenderer );
@@ -88,9 +91,7 @@ VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop,
 
   setCentralWidget( myRenderWindow );
 
-  myToolBar = new QToolBar(this);
-  myToolBar->setCloseMode(QDockWindow::Undocked);
-  myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+  myToolBar = new QtxToolBar( true, tr("LBL_TOOLBAR_LABEL"), this );
 
   createActions();
   createToolBar();
@@ -290,29 +291,32 @@ void VTKViewer_ViewWindow::createActions()
 /*!Create tool bar.*/
 void VTKViewer_ViewWindow::createToolBar()
 {
-  myActionsMap[DumpId]->addTo(myToolBar);
-  myActionsMap[TrihedronShowId]->addTo(myToolBar);
+  myToolBar->addAction( myActionsMap[DumpId] );
+  myToolBar->addAction( myActionsMap[TrihedronShowId] );
 
-  SUIT_ToolButton* aScaleBtn = new SUIT_ToolButton(myToolBar);
-  aScaleBtn->AddAction(myActionsMap[FitAllId]);
-  aScaleBtn->AddAction(myActionsMap[FitRectId]);
-  aScaleBtn->AddAction(myActionsMap[ZoomId]);
+  QtxMultiAction* aScaleAction = new QtxMultiAction( this );
+  aScaleAction->insertAction( myActionsMap[FitAllId] );
+  aScaleAction->insertAction( myActionsMap[FitRectId] );
+  aScaleAction->insertAction( myActionsMap[ZoomId] );
+  myToolBar->addAction( aScaleAction );
 
-  SUIT_ToolButton* aPanningBtn = new SUIT_ToolButton(myToolBar);
-  aPanningBtn->AddAction(myActionsMap[PanId]);
-  aPanningBtn->AddAction(myActionsMap[GlobalPanId]);
+  QtxMultiAction* aPanningAction = new QtxMultiAction( this );
+  aPanningAction->insertAction( myActionsMap[PanId] );
+  aPanningAction->insertAction( myActionsMap[GlobalPanId] );
+  myToolBar->addAction( aPanningAction );
 
-  myActionsMap[RotationId]->addTo(myToolBar);
+  myToolBar->addAction( myActionsMap[RotationId] );
 
-  SUIT_ToolButton* aViewsBtn = new SUIT_ToolButton(myToolBar);
-  aViewsBtn->AddAction(myActionsMap[FrontId]);
-  aViewsBtn->AddAction(myActionsMap[BackId]);
-  aViewsBtn->AddAction(myActionsMap[TopId]);
-  aViewsBtn->AddAction(myActionsMap[BottomId]);
-  aViewsBtn->AddAction(myActionsMap[LeftId]);
-  aViewsBtn->AddAction(myActionsMap[RightId]);
+  QtxMultiAction* aViewsAction = new QtxMultiAction(myToolBar);
+  aViewsAction->insertAction( myActionsMap[FrontId] );
+  aViewsAction->insertAction( myActionsMap[BackId] );
+  aViewsAction->insertAction( myActionsMap[TopId] );
+  aViewsAction->insertAction( myActionsMap[BottomId] );
+  aViewsAction->insertAction( myActionsMap[LeftId] );
+  aViewsAction->insertAction( myActionsMap[RightId] );
+  myToolBar->addAction( aViewsAction );
 
-  myActionsMap[ResetId]->addTo(myToolBar);
+  myToolBar->addAction( myActionsMap[ResetId] );
 }
 
 /*!On front view event.*/
@@ -414,7 +418,7 @@ QColor VTKViewer_ViewWindow::backgroundColor() const
     myRenderer->GetBackground( backint );
     return QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255));
   }
-  return SUIT_ViewWindow::backgroundColor();
+  return palette().color( backgroundRole() );
 }
 
 /*!Repaint window. If \a theUpdateTrihedron is true - recalculate trihedron.*/
@@ -455,8 +459,8 @@ void VTKViewer_ViewWindow::onAdjustTrihedron(){
                      (bnd[5]-bnd[4])*(bnd[5]-bnd[4]));
     }else{
       aLength = bnd[1]-bnd[0];
-      aLength = std::max((bnd[3]-bnd[2]),aLength);
-      aLength = std::max((bnd[5]-bnd[4]),aLength);
+      aLength = qMax((bnd[3]-bnd[2]),aLength);
+      aLength = qMax((bnd[5]-bnd[4]),aLength);
     }
    
     static vtkFloatingPointType aSizeInPercents = 105;
@@ -557,7 +561,7 @@ void VTKViewer_ViewWindow::onTrihedronShow()
 QImage VTKViewer_ViewWindow::dumpView()
 {
   QPixmap px = QPixmap::grabWindow( myRenderWindow->winId() );
-  return px.convertToImage();
+  return px.toImage();
 }
 
 /*! The method returns the visual parameters of this view as a formated string
@@ -584,7 +588,7 @@ QString VTKViewer_ViewWindow::getVisualParameters()
  */
 void VTKViewer_ViewWindow::setVisualParameters( const QString& parameters )
 {
-  QStringList paramsLst = QStringList::split( '*', parameters, true );
+  QStringList paramsLst = parameters.split( '*' );
   if ( paramsLst.size() == 13 ) {
     double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
     pos[0] = paramsLst[0].toDouble();
index 05c9ee9a8979705c2ea86474bc7881a75afe7ed3..3bceda6c595b55ebc9593477346daa9eb07c189d 100755 (executable)
@@ -1,20 +1,23 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VTKVIEWER_VIEWWINDOW_H
 #define VTKVIEWER_VIEWWINDOW_H
index 895766a66b88557fee5d72bb1ca04f5bc1950cf4..4dcb8a5f57664dad8a2a326d8c47d9f55ecfdbf3 100755 (executable)
@@ -1,29 +1,28 @@
-#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 #  File   : SALOMEGUI_icons.po
 #  Module : SALOME
-
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
diff --git a/src/VTKViewer/resources/VTKViewer_images.ts b/src/VTKViewer/resources/VTKViewer_images.ts
new file mode 100644 (file)
index 0000000..7dd3502
--- /dev/null
@@ -0,0 +1,87 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_GLOBALPAN</source>
+        <translation>vtk_view_glpan.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_FITAREA</source>
+        <translation>vtk_view_fitarea.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_FRONT</source>
+        <translation>vtk_view_front.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_RESET</source>
+        <translation>vtk_view_reset.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_RIGHT</source>
+        <translation>vtk_view_right.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_FITALL</source>
+        <translation>vtk_view_fitall.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_BOTTOM</source>
+        <translation>vtk_view_bottom.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_TOP</source>
+        <translation>vtk_view_top.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_PAN</source>
+        <translation>vtk_view_pan.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_ROTATE</source>
+        <translation>vtk_view_rotate.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_DUMP</source>
+        <translation>vtk_view_camera_dump.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_BACK</source>
+        <translation>vtk_view_back.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_ZOOM</source>
+        <translation>vtk_view_zoom.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_LEFT</source>
+        <translation>vtk_view_left.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_TRIHEDRON</source>
+        <translation>vtk_view_triedre.png</translation>
+    </message>
+</context>
+</TS>
index ea26f2678875ca2e535d66c477d9434b9fa0b74f..e1f3959744e973da4036a3f4ebad1e582f591ecf 100755 (executable)
@@ -1,29 +1,28 @@
-#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
 #
-#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-# 
-#  This library is free software; you can redistribute it and/or 
-#  modify it under the terms of the GNU Lesser General Public 
-#  License as published by the Free Software Foundation; either 
-#  version 2.1 of the License. 
-# 
-#  This library is distributed in the hope that it will be useful, 
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-#  Lesser General Public License for more details. 
-# 
-#  You should have received a copy of the GNU Lesser General Public 
-#  License along with this library; if not, write to the Free Software 
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-# 
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
 #
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 #  File   : SALOMEGUI_msg_en.po
 #  Module : SALOME
-
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
diff --git a/src/VTKViewer/resources/VTKViewer_msg_en.ts b/src/VTKViewer/resources/VTKViewer_msg_en.ts
new file mode 100644 (file)
index 0000000..6efdc42
--- /dev/null
@@ -0,0 +1,190 @@
+<!DOCTYPE TS><TS>
+<!--
+  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<context>
+    <name>@default</name>
+    <message>
+        <source>MNU_FRONT_VIEW</source>
+        <translation>Front</translation>
+    </message>
+    <message>
+        <source>ERROR</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Dump view...</translation>
+    </message>
+    <message>
+        <source>DSC_TOP_VIEW</source>
+        <translation>Top View</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panning</translation>
+    </message>
+    <message>
+        <source>MNU_TOP_VIEW</source>
+        <translation>Top</translation>
+    </message>
+    <message>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Selection of a new center of the view</translation>
+    </message>
+    <message>
+        <source>DSC_ROTATE_VIEW</source>
+        <translation>Rotation of the point of view around the scene center</translation>
+    </message>
+    <message>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Panning the view</translation>
+    </message>
+    <message>
+        <source>DSC_LEFT_VIEW</source>
+        <translation>Left View</translation>
+    </message>
+    <message>
+        <source>DSC_FITALL</source>
+        <translation>Fit all objects inside the view frame</translation>
+    </message>
+    <message>
+        <source>MNU_FITALL</source>
+        <translation>Fit All</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATE_VIEW</source>
+        <translation>Rotation</translation>
+    </message>
+    <message>
+        <source>DSC_SHOW_TRIHEDRON</source>
+        <translation>Show/Hide trihedron in the current view</translation>
+    </message>
+    <message>
+        <source>DSC_FRONT_VIEW</source>
+        <translation>Front View</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Global Panning</translation>
+    </message>
+    <message>
+        <source>INF_APP_DUMP_VIEW</source>
+        <translation>Dump view</translation>
+    </message>
+    <message>
+        <source>MNU_BACK_VIEW</source>
+        <translation>Back</translation>
+    </message>
+    <message>
+        <source>MNU_SHOW_TRIHEDRON</source>
+        <translation>Show/Hide trihedron</translation>
+    </message>
+    <message>
+        <source>MNU_BOTTOM_VIEW</source>
+        <translation>Bottom</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Reset</translation>
+    </message>
+    <message>
+        <source>MNU_LEFT_VIEW</source>
+        <translation>Left</translation>
+    </message>
+    <message>
+        <source>DSC_RIGHT_VIEW</source>
+        <translation>Right View</translation>
+    </message>
+    <message>
+        <source>DSC_FITRECT</source>
+        <translation>Fit area within the view frame</translation>
+    </message>
+    <message>
+        <source>MNU_FITRECT</source>
+        <translation>Fit Area</translation>
+    </message>
+    <message>
+        <source>DSC_BOTTOM_VIEW</source>
+        <translation>Bottom View</translation>
+    </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Saves the active view in the image file</translation>
+    </message>
+    <message>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoom the view</translation>
+    </message>
+    <message>
+        <source>VTK_IMAGE_FILES</source>
+        <translation>Images Files (*.bmp *.png *.jpg *.jpeg)</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Reset View Point</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_CANT_SAVE_FILE</source>
+        <translation>Cannot save file</translation>
+    </message>
+    <message>
+        <source>MNU_RIGHT_VIEW</source>
+        <translation>Right</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>View Operations</translation>
+    </message>
+    <message>
+        <source>DSC_BACK_VIEW</source>
+        <translation>Back View</translation>
+    </message>
+</context>
+<context>
+    <name>VTKViewer_ViewManager</name>
+    <message>
+        <source>VTK_VIEW_TITLE</source>
+        <translation>VTK scene:%M - viewer:%V</translation>
+    </message>
+</context>
+<context>
+    <name>VTKViewer_Viewer</name>
+    <message>
+        <source>MEN_DUMP_VIEW</source>
+        <translation>Dump View...</translation>
+    </message>
+    <message>
+        <source>MEN_SHOW_TOOLBAR</source>
+        <translation>Show Toolbar</translation>
+    </message>
+    <message>
+        <source>MEN_CHANGE_BACKGROUD</source>
+        <translation>Change Background...</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/VTKViewer/resources/view_back.png b/src/VTKViewer/resources/view_back.png
deleted file mode 100755 (executable)
index 436f2da..0000000
Binary files a/src/VTKViewer/resources/view_back.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_bottom.png b/src/VTKViewer/resources/view_bottom.png
deleted file mode 100755 (executable)
index a18011c..0000000
Binary files a/src/VTKViewer/resources/view_bottom.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_camera_dump.png b/src/VTKViewer/resources/view_camera_dump.png
deleted file mode 100755 (executable)
index 8eb63e0..0000000
Binary files a/src/VTKViewer/resources/view_camera_dump.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_fitall.png b/src/VTKViewer/resources/view_fitall.png
deleted file mode 100755 (executable)
index c09ff94..0000000
Binary files a/src/VTKViewer/resources/view_fitall.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_fitarea.png b/src/VTKViewer/resources/view_fitarea.png
deleted file mode 100755 (executable)
index 5b79594..0000000
Binary files a/src/VTKViewer/resources/view_fitarea.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_front.png b/src/VTKViewer/resources/view_front.png
deleted file mode 100755 (executable)
index c5dfc00..0000000
Binary files a/src/VTKViewer/resources/view_front.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_glpan.png b/src/VTKViewer/resources/view_glpan.png
deleted file mode 100755 (executable)
index c23322a..0000000
Binary files a/src/VTKViewer/resources/view_glpan.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_graduated_axes.png b/src/VTKViewer/resources/view_graduated_axes.png
deleted file mode 100755 (executable)
index 9c9f3d2..0000000
Binary files a/src/VTKViewer/resources/view_graduated_axes.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_left.png b/src/VTKViewer/resources/view_left.png
deleted file mode 100755 (executable)
index dbc06cc..0000000
Binary files a/src/VTKViewer/resources/view_left.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_pan.png b/src/VTKViewer/resources/view_pan.png
deleted file mode 100755 (executable)
index 038fba1..0000000
Binary files a/src/VTKViewer/resources/view_pan.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_reset.png b/src/VTKViewer/resources/view_reset.png
deleted file mode 100755 (executable)
index 1285064..0000000
Binary files a/src/VTKViewer/resources/view_reset.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_right.png b/src/VTKViewer/resources/view_right.png
deleted file mode 100755 (executable)
index 598def4..0000000
Binary files a/src/VTKViewer/resources/view_right.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_rotate.png b/src/VTKViewer/resources/view_rotate.png
deleted file mode 100755 (executable)
index 80926c5..0000000
Binary files a/src/VTKViewer/resources/view_rotate.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_rotation_point.png b/src/VTKViewer/resources/view_rotation_point.png
deleted file mode 100755 (executable)
index 59f5931..0000000
Binary files a/src/VTKViewer/resources/view_rotation_point.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_scaling.png b/src/VTKViewer/resources/view_scaling.png
deleted file mode 100644 (file)
index 5d34436..0000000
Binary files a/src/VTKViewer/resources/view_scaling.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_top.png b/src/VTKViewer/resources/view_top.png
deleted file mode 100755 (executable)
index ebbf34d..0000000
Binary files a/src/VTKViewer/resources/view_top.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_triedre.png b/src/VTKViewer/resources/view_triedre.png
deleted file mode 100755 (executable)
index 3eed48d..0000000
Binary files a/src/VTKViewer/resources/view_triedre.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_update_rate.png b/src/VTKViewer/resources/view_update_rate.png
deleted file mode 100755 (executable)
index 3d01ad1..0000000
Binary files a/src/VTKViewer/resources/view_update_rate.png and /dev/null differ
diff --git a/src/VTKViewer/resources/view_zoom.png b/src/VTKViewer/resources/view_zoom.png
deleted file mode 100755 (executable)
index b465739..0000000
Binary files a/src/VTKViewer/resources/view_zoom.png and /dev/null differ
diff --git a/src/VTKViewer/resources/vtk_view_back.png b/src/VTKViewer/resources/vtk_view_back.png
new file mode 100755 (executable)
index 0000000..51beb0c
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_back.png differ
diff --git a/src/VTKViewer/resources/vtk_view_bottom.png b/src/VTKViewer/resources/vtk_view_bottom.png
new file mode 100755 (executable)
index 0000000..fa558e2
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_bottom.png differ
diff --git a/src/VTKViewer/resources/vtk_view_camera_dump.png b/src/VTKViewer/resources/vtk_view_camera_dump.png
new file mode 100755 (executable)
index 0000000..b02616f
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_camera_dump.png differ
diff --git a/src/VTKViewer/resources/vtk_view_fitall.png b/src/VTKViewer/resources/vtk_view_fitall.png
new file mode 100755 (executable)
index 0000000..87e001d
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_fitall.png differ
diff --git a/src/VTKViewer/resources/vtk_view_fitarea.png b/src/VTKViewer/resources/vtk_view_fitarea.png
new file mode 100755 (executable)
index 0000000..450dc56
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_fitarea.png differ
diff --git a/src/VTKViewer/resources/vtk_view_front.png b/src/VTKViewer/resources/vtk_view_front.png
new file mode 100755 (executable)
index 0000000..d917960
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_front.png differ
diff --git a/src/VTKViewer/resources/vtk_view_glpan.png b/src/VTKViewer/resources/vtk_view_glpan.png
new file mode 100644 (file)
index 0000000..28ab547
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_glpan.png differ
diff --git a/src/VTKViewer/resources/vtk_view_left.png b/src/VTKViewer/resources/vtk_view_left.png
new file mode 100755 (executable)
index 0000000..1b787b0
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_left.png differ
diff --git a/src/VTKViewer/resources/vtk_view_pan.png b/src/VTKViewer/resources/vtk_view_pan.png
new file mode 100755 (executable)
index 0000000..ec56cac
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_pan.png differ
diff --git a/src/VTKViewer/resources/vtk_view_reset.png b/src/VTKViewer/resources/vtk_view_reset.png
new file mode 100755 (executable)
index 0000000..66f81e6
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_reset.png differ
diff --git a/src/VTKViewer/resources/vtk_view_right.png b/src/VTKViewer/resources/vtk_view_right.png
new file mode 100755 (executable)
index 0000000..5c6e161
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_right.png differ
diff --git a/src/VTKViewer/resources/vtk_view_rotate.png b/src/VTKViewer/resources/vtk_view_rotate.png
new file mode 100755 (executable)
index 0000000..28ec89f
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_rotate.png differ
diff --git a/src/VTKViewer/resources/vtk_view_top.png b/src/VTKViewer/resources/vtk_view_top.png
new file mode 100755 (executable)
index 0000000..cef9504
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_top.png differ
diff --git a/src/VTKViewer/resources/vtk_view_triedre.png b/src/VTKViewer/resources/vtk_view_triedre.png
new file mode 100755 (executable)
index 0000000..bc5894d
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_triedre.png differ
diff --git a/src/VTKViewer/resources/vtk_view_zoom.png b/src/VTKViewer/resources/vtk_view_zoom.png
new file mode 100755 (executable)
index 0000000..386c966
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_zoom.png differ
diff --git a/src/src.pro b/src/src.pro
new file mode 100644 (file)
index 0000000..74f5e47
--- /dev/null
@@ -0,0 +1,53 @@
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+TEMPLATE = subdirs
+CONFIG += ordered
+
+SUBDIRS  = Qtx
+SUBDIRS += DDS
+SUBDIRS += QDS
+SUBDIRS += SUIT
+SUBDIRS += SUITApp
+SUBDIRS += STD
+SUBDIRS += CAF
+SUBDIRS += CAM
+SUBDIRS += LogWindow
+SUBDIRS += PyInterp
+SUBDIRS += PyConsole
+SUBDIRS += Prs
+SUBDIRS += OBJECT
+SUBDIRS += GLViewer
+SUBDIRS += VTKViewer
+SUBDIRS += SVTK
+SUBDIRS += OCCViewer
+SUBDIRS += SOCC
+SUBDIRS += Plot2d
+SUBDIRS += SPlot2d
+SUBDIRS += SUPERVGraph
+SUBDIRS += QxGraph
+SUBDIRS += Event
+SUBDIRS += LightApp
+SUBDIRS += ResExporter
+SUBDIRS += TOOLSGUI
+SUBDIRS += SalomeApp
+SUBDIRS += Session