From 0dad7e18fd8210460ec5eb5b1447ae1afbd80cf1 Mon Sep 17 00:00:00 2001 From: asl Date: Thu, 7 Jul 2005 08:58:05 +0000 Subject: [PATCH] new method setContentActive( bool ): if parameter is true, all content to enable or disable state --- src/SMESHGUI/SMESHGUI_Dialog.cxx | 21 ++++++++++++++++++++- src/SMESHGUI/SMESHGUI_Dialog.h | 8 ++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/SMESHGUI/SMESHGUI_Dialog.cxx b/src/SMESHGUI/SMESHGUI_Dialog.cxx index 0d8d7eb78..649904c6f 100644 --- a/src/SMESHGUI/SMESHGUI_Dialog.cxx +++ b/src/SMESHGUI/SMESHGUI_Dialog.cxx @@ -1,17 +1,36 @@ #include #include +#include +#include #include #include SMESHGUI_Dialog::SMESHGUI_Dialog( SMESHGUI* theModule, const bool modal, const bool allowResize, const int flags ) -: SalomeApp_Dialog( SMESH::GetDesktop( theModule ), "", modal, allowResize, flags ) +: SalomeApp_Dialog( SMESH::GetDesktop( theModule ), "", modal, allowResize, flags ), + mySMESHGUI( theModule ) { + int prefix = SMESHGUI_Operation::prefix( "SMESH" ); + typeName( prefix + MESH ) = tr( "DLG_MESH" ); + typeName( prefix + HYPOTHESIS ) = tr( "DLG_HYPO" ); + typeName( prefix + ALGORITHM ) = tr( "DLG_ALGO" ); } SMESHGUI_Dialog::~SMESHGUI_Dialog() { } +void SMESHGUI_Dialog::show() +{ + int x, y; + mySMESHGUI->DefineDlgPosition(this, x, y); + move(x, y); + SalomeApp_Dialog::show(); +} + +void SMESHGUI_Dialog::setContentActive( const bool active ) const +{ + mainFrame()->setEnabled( active ); +} diff --git a/src/SMESHGUI/SMESHGUI_Dialog.h b/src/SMESHGUI/SMESHGUI_Dialog.h index 62deb9a74..2f9092fea 100644 --- a/src/SMESHGUI/SMESHGUI_Dialog.h +++ b/src/SMESHGUI/SMESHGUI_Dialog.h @@ -13,6 +13,14 @@ class SMESHGUI_Dialog : public SalomeApp_Dialog public: SMESHGUI_Dialog( SMESHGUI*, const bool = false, const bool = false, const int = OK | Cancel | Apply ); virtual ~SMESHGUI_Dialog(); + + virtual void show(); + + //! set all content to enable (parameter is true) or disable state + void setContentActive( const bool ) const; + +private: + SMESHGUI* mySMESHGUI; }; #endif -- 2.39.2