--- /dev/null
+*********************************************************************
+* File : BUGS_DESCRIPTION
+* Project : PAL/SALOME
+* Module : PatchQt
+* Author : Vadim SANDLER
+* Created : 03/11/2004
+*********************************************************************
+
+This file contains description of bugs found in Qt 3.0.5 classes and patches with bug-fixes and improvements done for Qt classes
+in frames of PAL/SALOME project.
+
+Main principles of the patches creation:
+* the original classes are renamed by adding "P" suffix to the class name;
+* private Qt classes are copied to patched files in order to avoid compilation/linking problems;
+* classes definitions are moved from *.cpp implementation to *.h header in order to avoid additional moc preprocessing for *.cpp files.
+
+*********************************************************************
+
+Bug: keyboard accelerators for actions (menu, toolbar, etc) are not disabled when action itself is disabled (grayed).
+
+Gravity: medium
+
+Patched file(s):
+* qactionP.cxx:
+1) void QActionPrivate::update()
+- enable/disable key accelerator according to the action state
+
+*********************************************************************
+
+Bug: Wrong MDI behaviour
+To reproduce in SALOME:
+1. Create new study
+- Window Study1#1 appears and becomes active
+2. Create one more study
+- Window Study2#1 appears and becomes active (Study1#1 becames inactive)
+3. Minimize Study2#1 window
+- Window Study2#1 is minimized, Study1#1 becames active
+4. Minimize Study1#1 window
+- Window Study1#1 is minimized but stays still active (highlighted title)
+5. Menu command "File/Close"
+- Study2 document is closed, but should Study1 !!!
+
+Gravity: high
+
+Bug: Crash on close study window
+To reproduce in SALOME:
+1. Launch application.
+2. Create new study with any Viewer.
+3. Create second new study.
+4. Close second study.
+-> crash
+
+Gravity: high
+
+Bug: crash when leaving a study
+To reproduce in SALOME:
+1. Create new study
+2. Load VISU component
+3. Menu Window / New Window / Plot2d Viewer
+4. Miximize Study 1#2 window (with Plot2d viewer)
+5. Menu File / Close
+6. Press "Close w/o saving" button in "Close Active Study" dialog box.
+-> crash
+
+Gravity: high
+
+Patched files(s):
+* qworkspaceP.h:
+- methods
+void QWorkspace::activateNextWindow()
+void QWorkspace::activatePreviousWindow()
+void QWorkspace::activateWindow( QWidget* w, bool change_focus = TRUE )
+are made public
+
+* qworkspaceP.cxx:
+- methods
+void QWorkspace::childEvent( QChildEvent * e)
+void QWorkspace::activateWindow( QWidget* w, bool change_focus )
+void QWorkspace::minimizeWindow( QWidget* w)
+bool QWorkspace::eventFilter( QObject *o, QEvent * e)
+void QWorkspace::activatePreviousWindow()
+are modified to activate correct child window on maximizing/minimizing/closing etc operations and to avoid crashes.
+
+*********************************************************************
+
+Improvement: Add controls to allow collapse/expand parts of view frame.
+The patch adds buttons with small arrows for splitter which allow to collapse/restore splitter in both (left/right or top/botton) directions.
+
+Gravity: medium
+
+Bug: Splitter is not shown in python console
+To reproduce in SALOME:
+1. Create new study
+2. Open new window (VTK or OCC) -> python console and message console is hidden
+3. Restore normal size of low frames (python and message consoles) by clicking corresponding splitter button.
+-> horizontal scrolbars for this windows are not shown, i.e. python and message frames are clipped.
+
+Gravity: medium
+
+Bug: Splitter does not restore its original position after collapsing/expanding operations.
+To reproduce try to collapse/expand repeatedly any splitter (e.g. that one between Python and Message consoles).
+
+Gravity: medium
+
+Improvement: Implement a functionality (for VISU module) to control the Viewers behavior from python console - concerning QSplitter it means a possibility
+to show/hide different parts of view frame (Object Browser, Python Console, 3d/2d viewer, Python console, Message window).
+
+Gravity: high
+
+Patched file(s):
+* qsplitterP.h
+1) to process correctly resizing events:
+- methods
+QSizePolicy QSplitter::sizePolicy() const
+QSizePolicy QSplitterHandle::sizePolicy() const;
+are added
+
+2) to allow collapse/expand functionality:
+- methods
+bool QSplitter::isCompressEnabled() const;
+void QSplitter::setCompressEnabled(bool on);
+void QSplitter::compress(QWidget*);
+void QSplitter::unCompress(QWidget*);
+QSplitterHandle* QSplitter::getHandleAfter(QWidget* w);
+QSplitterHandle* QSplitter::getHandleBefore(QWidget* w);
+bool QSplitter::isCompressed( const QWidget* ) const;
+QWidget* QSplitter::widgetBefore( int id ) const;
+QWidget* QSplitter::widgetAfter( int id ) const;
+QSize QSplitter::minSize( const QWidget *w ) const;
+QSize QSplitter::maxSize( const QWidget *w ) const;
+int QSplitter::hit( QPoint p );
+void QSplitter::updateSplitterHandles() const;
+and
+void QSplitterHandle::updateButtonState();
+void QSplitterHandle::compressAfter();
+void QSplitterHandle::unCompressAfter();
+void QSplitterHandle::compressBefore();
+void QSplitterHandle::unCompressBefore();
+void QSplitterHandle::onBeforeCompress();
+void QSplitterHandle::onAfterCompress();
+void QSplitterHandle::onBeforeUnCompress();
+void QSplitterHandle::onAfterUnCompress();
+are added
+
+- fields:
+QWidgetList QSplitter::compressed_widgets;
+bool QSplitter::compress_flag;
+and
+int QSplitterHandle::oldpos;
+QPushButton* QSplitterHandle::left;
+QPushButton* QSplitterHandle::right;
+QPushButton* QSplitterHandle::unleft;
+QPushButton* QSplitterHandle::unright;
+are added
+
+- method
+void QSplitter::setG( QWidget *w, int p, int s );
+is modified
+
+* qsplitterP.cxx:
+1) to draw button arrows:
+static const char* splitter_left_xpm[];
+static const char* splitter_right_xpm[];
+static const char* splitter_up_xpm[];
+static const char* splitter_down_xpm[];
+are added
+
+2) to process correctly resizing events:
+- methods
+QSizePolicy QSplitter::sizePolicy() const
+QSizePolicy QSplitterHandle::sizePolicy() const;
+are added
+
+3) to allow collapse/expand functionality:
+- methods
+bool QSplitter::isCompressEnabled() const;
+void QSplitter::setCompressEnabled(bool on);
+void QSplitter::compress(QWidget*);
+void QSplitter::unCompress(QWidget*);
+QSplitterHandle* QSplitter::getHandleAfter(QWidget* w);
+QSplitterHandle* QSplitter::getHandleBefore(QWidget* w);
+bool QSplitter::isCompressed( const QWidget* ) const;
+QWidget* QSplitter::widgetBefore( int id ) const;
+QWidget* QSplitter::widgetAfter( int id ) const;
+QSize QSplitter::minSize( const QWidget *w ) const;
+QSize QSplitter::maxSize( const QWidget *w ) const;
+int QSplitter::hit( QPoint p );
+void QSplitter::updateSplitterHandles() const;
+and
+void QSplitterHandle::updateButtonState();
+void QSplitterHandle::compressAfter();
+void QSplitterHandle::unCompressAfter();
+void QSplitterHandle::compressBefore();
+void QSplitterHandle::unCompressBefore();
+void QSplitterHandle::onBeforeCompress();
+void QSplitterHandle::onAfterCompress();
+void QSplitterHandle::onBeforeUnCompress();
+void QSplitterHandle::onAfterUnCompress();
+are added
+
+- methods
+QSplitterHandle::QSplitterHandle()
+void QSplitter::setG( QWidget *w, int p, int s );
+QSize QSplitterHandle::sizeHint() const
+void QSplitterHandle::setOrientation( Qt::Orientation o )
+void QSplitterHandle::mouseReleaseEvent( QMouseEvent *e )
+void QSplitterHandle::paintEvent( QPaintEvent * )
+void QSplitter::init()
+void QSplitter::setOrientation( Orientation o )
+QSplitterLayoutStruct *QSplitter::addWidget( QWidget *w, bool first )
+void QSplitter::setRubberband( int p )
+void QSplitter::drawSplitter( QPainter *p, QCOORD x, QCOORD y, QCOORD w, QCOORD h )
+void QSplitter::moveSplitter( QCOORD p, int id )
+void QSplitter::moveBefore( int pos, int id, bool upLeft )
+void QSplitter::moveAfter( int pos, int id, bool upLeft )
+void QSplitter::getRange( int id, int *min, int *max )
+void QSplitter::doResize()
+void QSplitter::recalc( bool update )
+void QSplitter::styleChange( QStyle& old )
+are modified:
+
+*********************************************************************
+
+Bug: File names filter of the "Open" and "Save" dialog boxes is broken
+To reproduce in SALOME:
+1) start PAL/SALOME
+2) open new study with the help of OCC Viewer and load Geometry module
+3) Menu File / Import / BRep
+4) Browse to any directory may be changed by yourself
+5) Press "Create New Folder" button of the "Import" dialog box
+6) Browse to created directory "New Folder 1"
+7) Press "Create New Folder" button of the "Import" dialog box
+8) Browse to created directory "New Folder 1"
+9) Delete first created "New Folder 1" directory externally (e.g. from any terminal window)
+10) Press "One directory up" button of the "Import" dialog box
+11) Error message box appears: "Could not read directory .../New Folder 1/New Folder 1" - press OK button to close message box.
+-> Result: "BREP Files (*.brep)" filter is set as "File type" in the "Import" dialog box, but non-BREP files are also visible and available for the selection
+in the browser window of the "Import" dialog box
+-> The same situation takes place for the "Export" dialog box.
+
+Gravity: low
+
+Patch:
+* qfiledialogP.cxx:
+1) methods
+void QFileDialogP::urlFinished( QNetworkOperation *op )
+is modified to fix bug
+
+*********************************************************************
+
#include "SALOMEDS_AttributeSelectable_i.hxx"
#include "SALOMEDS_AttributeExpandable_i.hxx"
#include "SALOMEDS_AttributeOpened_i.hxx"
+#include "SALOMEDS_AttributeFlags_i.hxx"
+#include "SALOMEDS_AttributeGraphic_i.hxx"
#include "SALOMEDS_AttributeTextColor_i.hxx"
#include "SALOMEDS_AttributeTextHighlightColor_i.hxx"
#include "SALOMEDS_AttributePixMap_i.hxx"
#include <HDFOI.hxx>
#include <stdlib.h>
+
using namespace std;
#define USE_CASE_LABEL_TAG 2
__FindOrCreateAttribute(SALOMEDS_StudyPropertiesAttribute, AttributeStudyProperties)
__FindOrCreateAttribute(SALOMEDS_ExternalFileDef, AttributeExternalFileDef)
__FindOrCreateAttribute(SALOMEDS_FileType, AttributeFileType)
+ __FindOrCreateAttribute(SALOMEDS_FlagsAttribute, AttributeFlags)
+ __FindOrCreateAttribute(SALOMEDS_GraphicAttribute, AttributeGraphic)
if (strncmp(aTypeOfAttribute, "AttributeTreeNode",17) == 0 ) {
Standard_GUID aTreeNodeGUID;
-using namespace std;
//=============================================================================
// File : SALOME_PYQT_GUI.cxx
// Created : mer jun 4 17:17:20 UTC 2003
* no call to python module.BuildPresentation() (not yet ???)
*/
//=============================================================================
-void SALOME_PYQT_GUI::BuildPresentation( const Handle(SALOME_InteractiveObject)& theIO )
+void SALOME_PYQT_GUI::BuildPresentation( const Handle(SALOME_InteractiveObject)&,
+ QAD_ViewFrame* )
{
}
* no call to python module.SupportedViewType() (not yet ???)
*/
//=============================================================================
-void SALOME_PYQT_GUI::SupportedViewType(int* buffer, int bufferSize)
+void SALOME_PYQT_GUI::SupportedViewType(int* /*buffer*/, int /*bufferSize*/ )
{
}
const QString & theParent, const QString & theObject );
virtual void DefinePopup ( QString & theContext, QString & theParent, QString & theObject );
virtual bool ActiveStudyChanged( QAD_Desktop* parent);
- virtual void BuildPresentation ( const Handle(SALOME_InteractiveObject)& theIO );
+ virtual void BuildPresentation ( const Handle(SALOME_InteractiveObject)& theIO,
+ QAD_ViewFrame* = 0 );
virtual void SupportedViewType (int* buffer, int bufferSize);
virtual void Deactivate ();
void initInterp(int studyId);
#include "SalomePyQt.hxx"
#include <qapplication.h>
+#include <qmenubar.h>
#include "QAD_Application.h"
#include "QAD_Desktop.h"
#include "QAD_Config.h"
#include "QAD_Settings.h"
+
using namespace std;
QWidget* SalomePyQt::getDesktop()
}
return false;
}
+
+QPopupMenu* SalomePyQt::getPopupMenu( const MenuName menu )
+{
+ QMenuBar* mainMenu = QAD_Application::getDesktop()->getMainMenuBar();
+ if ( mainMenu->findItem( menu ) ) {
+ return mainMenu->findItem( menu )->popup();
+ }
+ return 0;
+}
#include <qstring.h>
#include <qmenubar.h>
+enum MenuName {
+ File = 1,
+ View = 2,
+ Edit = 3,
+ Preferences = 4,
+ Tools = 5,
+ Window = 6,
+ Help = 7
+};
+
class SalomePyQt
{
public:
static QWidget* getDesktop();
static QWorkspace* getMainFrame();
static QMenuBar* getMainMenuBar();
+ static QPopupMenu* getPopupMenu( const MenuName menu );
static SALOME_Selection* getSelection();
static int getStudyId();
static void putInfo( const QString& );
void currentSelectionChanged();
};
+enum MenuName {
+ File = 1,
+ View = 2,
+ Edit = 3,
+ Preferences = 4,
+ Tools = 5,
+ Window = 6,
+ Help = 7
+};
+
class SalomePyQt
{
%HeaderCode
static QWidget* getDesktop();
static QWorkspace* getMainFrame();
static QMenuBar* getMainMenuBar();
+ static QPopupMenu* getPopupMenu( const MenuName );
static SALOME_Selection* getSelection();
static int getStudyId();
static void putInfo( const QString& );
# initialise the ORB
orb = None
-while orb == None:
+step = 0
+while step < 100 and orb is None:
orb = CORBA.ORB_init([''], CORBA.ORB_ID)
+ step = step + 1
+ time.sleep(4)
+
+if orb is None:
+ print "Warning: ORB has not been initialized !!!"
# create an LifeCycleCORBA instance
lcc = LifeCycleCORBA(orb)
-while lcc._catalog == None:
+step = 0
+while step < 100 and lcc._catalog is None:
lcc = LifeCycleCORBA(orb)
-
+ step = step + 1
+ time.sleep(4)
+
+if lcc._catalog is None:
+ print "Warning: LifeCycleCORBA object is incomplete !!!"
+
#create a naming service instance
naming_service = SALOME_NamingServicePy_i(orb)
# get Study Manager reference
-obj=None
-while obj == None:
- obj = naming_service.Resolve('myStudyManager')
+obj = None
+
+step = 0
+while step < 100 and obj == None:
+ obj = naming_service.Resolve('myStudyManager')
+ step = step + 1
+ time.sleep(4)
+
myStudyManager = obj._narrow(SALOMEDS.StudyManager)
+if myStudyManager is None:
+ print "Warning: SALOMEDS.StudyManager has not been created !!!"
+
# create new study
aListOfOpenStudies = myStudyManager.GetOpenStudies();
myStudy = None;
#include <sys/time.h>
#include <stdlib.h>
+
+#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+
using namespace std;
//============================================================================
if(aBuffer == NULL) return NULL;
- long aBufferSize = theStream.length();
long aFileSize, aCurrentPos = 4;
int i, aFileNameSize, aNbFiles = 0;
aDirString.ChangeAll('|','/');
return aDirString.ToCString();
}
+
+//=======================================================================
+// name : GetFlag
+// Purpose : Retrieve specified flaf from "AttributeFlags" attribute
+//=======================================================================
+bool SALOMEDS_Tool::GetFlag( const int theFlag,
+ SALOMEDS::Study_var theStudy,
+ SALOMEDS::SObject_var theObj )
+{
+ SALOMEDS::GenericAttribute_var anAttr;
+ if ( !theObj->_is_nil() && theObj->FindAttribute( anAttr, "AttributeFlags" ) )
+ {
+ SALOMEDS::AttributeFlags_var aFlags = SALOMEDS::AttributeFlags::_narrow( anAttr );
+ return aFlags->Get( theFlag );
+ }
+
+ return false;
+}
+
+//=======================================================================
+// name : SetFlag
+// Purpose : Set/Unset specified flaf from "AttributeFlags" attribute
+//=======================================================================
+bool SALOMEDS_Tool::SetFlag( const int theFlag,
+ SALOMEDS::Study_var theStudy,
+ const char* theEntry,
+ const bool theValue )
+{
+ SALOMEDS::SObject_var anObj = theStudy->FindObjectID( theEntry );
+
+ if ( !anObj->_is_nil() )
+ {
+ SALOMEDS::GenericAttribute_var aGAttr;
+ if ( anObj->FindAttribute( aGAttr, "AttributeFlags" ) )
+ {
+ SALOMEDS::AttributeFlags_var anAttr = SALOMEDS::AttributeFlags::_narrow( aGAttr );
+ anAttr->Set( theFlag, theValue );
+ }
+ else if ( theValue )
+ {
+ SALOMEDS::StudyBuilder_var aBuilder = theStudy->NewBuilder();
+ SALOMEDS::AttributeFlags_var anAttr = SALOMEDS::AttributeFlags::_narrow(
+ aBuilder->FindOrCreateAttribute( anObj, "AttributeFlags" ) );
+ anAttr->Set( theFlag, theValue );
+ }
+ return true;
+ }
+
+ return false;
+}
+
+//=======================================================================
+// name : getAllChildren
+// Purpose : Get all children of object.
+// If theObj is null all objects of study are returned
+//=======================================================================
+void SALOMEDS_Tool::GetAllChildren( SALOMEDS::Study_var theStudy,
+ SALOMEDS::SObject_var theObj,
+ std::list<SALOMEDS::SObject_var>& theList )
+{
+ if ( theObj->_is_nil() )
+ {
+ SALOMEDS::SComponentIterator_var anIter = theStudy->NewComponentIterator();
+ for ( ; anIter->More(); anIter->Next() )
+ {
+ SALOMEDS::SObject_var anObj = SALOMEDS::SObject::_narrow( anIter->Value() );
+ if ( !anObj->_is_nil() )
+ {
+ theList.push_back( anObj );
+ GetAllChildren( theStudy, anObj, theList );
+ }
+ }
+ }
+ else
+ {
+ SALOMEDS::ChildIterator_var anIter = theStudy->NewChildIterator( theObj );
+ for ( ; anIter->More(); anIter->Next() )
+ {
+ SALOMEDS::SObject_var anObj = anIter->Value();
+ SALOMEDS::SObject_var aRef;
+ if ( !anObj->ReferencedObject( aRef ) )
+ {
+ theList.push_back( anObj );
+ GetAllChildren( theStudy, anObj, theList );
+ }
+ }
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
#ifndef __SALOMEDS_Tool_H__
#define __SALOMEDS_Tool_H__
-#include <string>
+#include <string>
+#include <list>
// IDL headers
#include "SALOMEconfig.h"
// for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "/tmp/aaa"
static std::string GetDirFromPath(const char* thePath);
+ // Retrieves specified flaf from "AttributeFlags" attribute
+ static bool GetFlag( const int theFlag,
+ SALOMEDS::Study_var theStudy,
+ SALOMEDS::SObject_var theObj );
+
+ // Sets/Unsets specified flaf from "AttributeFlags" attribute
+ static bool SetFlag( const int theFlag,
+ SALOMEDS::Study_var theStudy,
+ const char* theEntry,
+ const bool theValue );
+
+ // Get all children of object. If theObj is null all objects of study are returned
+ static void GetAllChildren( SALOMEDS::Study_var theStudy,
+ SALOMEDS::SObject_var theObj,
+ std::list<SALOMEDS::SObject_var>& theList );
+
};
#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@COMMENCE@
# header files
-EXPORT_HEADERS=
+EXPORT_HEADERS = ToolsGUI.h
# .po files to transform in .qm
PO_FILES = \
LIB_SRC = ToolsGUI.cxx \
ToolsGUI_CatalogGeneratorDlg.cxx
-LIB_MOC = ToolsGUI_moc.cxx \
- ToolsGUI_CatalogGeneratorDlg_moc.cxx
+LIB_MOC = ToolsGUI_CatalogGeneratorDlg_moc.cxx
-LIB_CLIENT_IDL = SALOME_Exception.idl
+LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl \
+ SALOME_Component.idl SALOME_Exception.idl
# additionnal information to compil and link file
#include "utilities.h"
#include <stdlib.h>
+
+#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+
using namespace std;
+//============================================================================
+// function : runCommand
+// purpose : Run command
+//============================================================================
int ToolsGUI::runCommand(string & arg)
{
int res;
- res = system(arg.c_str());
+ res = system( arg.c_str() );
- if (res == -1)
- MESSAGE("fork failed (system command result = 0x" << hex << res << ")" << dec)
+ if ( res == -1 )
+ MESSAGE( "fork failed (system command result = 0x" << hex << res << ")" << dec )
else
- if (res == 217)
- MESSAGE("shell exec failed (system command result = 0x" << hex << res << ")" << dec)
-
+ if ( res == 217 )
+ MESSAGE( "shell exec failed (system command result = 0x" << hex << res << ")" << dec )
return res;
}
-bool ToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
+//============================================================================
+// function : OnGUIEvent
+// purpose : Process events
+//============================================================================
+bool ToolsGUI::OnGUIEvent( int theCommandID, QAD_Desktop* parent )
{
- QAD_Study* myActiveStudy = parent->getActiveStudy();
- switch (theCommandID)
+ switch ( theCommandID )
+ {
+ case 5102 :
{
- case 5102 :
- {
- ToolsGUI_CatalogGeneratorDlg* aDlg = new ToolsGUI_CatalogGeneratorDlg(parent);
- aDlg->exec();
- delete aDlg;
- break;
- }
-
- default:
- MESSAGE (" No command associated with this id = " << theCommandID )
+ ToolsGUI_CatalogGeneratorDlg* aDlg = new ToolsGUI_CatalogGeneratorDlg( parent );
+ aDlg->exec();
+ delete aDlg;
break;
}
+
+ default:
+ MESSAGE ( " No command associated with this id = " << theCommandID )
+ break;
+ }
return true;
}
extern "C"
{
- bool OnGUIEvent(int theCommandID, QAD_Desktop* parent)
+ bool OnGUIEvent( int theCommandID, QAD_Desktop* parent )
{
- //MESSAGE("ToolsGUI::OnGUIEvent "<< theCommandID);
return ToolsGUI::OnGUIEvent(theCommandID, parent);
}
+}
+
+//=======================================================================
+// name : GetVisibility
+// Purpose : Verify whether object is visible or not
+//=======================================================================
+bool ToolsGUI::GetVisibility( SALOMEDS::Study_var theStudy,
+ SALOMEDS::SObject_var theObj,
+ void* theId )
+{
+ SALOMEDS::GenericAttribute_var anAttr;
+ if ( !theObj->_is_nil() && theObj->FindAttribute( anAttr, "AttributeGraphic" ) )
+ {
+ SALOMEDS::AttributeGraphic_var aGraphic =
+ SALOMEDS::AttributeGraphic::_narrow( anAttr );
+ return aGraphic->GetVisibility( (unsigned long)theId );
+ }
+ return false;
}
+
+//=======================================================================
+// name : SetVisibility
+// Purpose : Set flag visibility of object
+//=======================================================================
+bool ToolsGUI::SetVisibility( SALOMEDS::Study_var theStudy,
+ const char* theEntry,
+ const bool theValue,
+ void* theId )
+{
+ SALOMEDS::SObject_var anObj = theStudy->FindObjectID( theEntry );
+
+ if ( !anObj->_is_nil() )
+ {
+ SALOMEDS::GenericAttribute_var aGAttr;
+ if ( anObj->FindAttribute( aGAttr, "AttributeGraphic" ) )
+ {
+ SALOMEDS::AttributeGraphic_var anAttr = SALOMEDS::AttributeGraphic::_narrow( aGAttr );
+ anAttr->SetVisibility( (unsigned long)theId, theValue );
+ }
+ else if ( theValue )
+ {
+ SALOMEDS::StudyBuilder_var aBuilder = theStudy->NewBuilder();
+ SALOMEDS::AttributeGraphic_var anAttr = SALOMEDS::AttributeGraphic::_narrow(
+ aBuilder->FindOrCreateAttribute( anObj, "AttributeGraphic" ) );
+ anAttr->SetVisibility( (unsigned long)theId, theValue );
+ }
+ return true;
+ }
+
+ return false;
+}
+
+
+
+
+
+
#include "QAD_Desktop.h"
-class ToolsGUI : public QObject
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+class Standard_EXPORT ToolsGUI
{
- Q_OBJECT
public :
-// Methods PUBLIC
-//
- Standard_EXPORT static int ToolsGUI::runCommand(string & arg);
-Standard_EXPORT static bool OnGUIEvent (int theCommandID, QAD_Desktop* parent);
-
-protected:
-
- // Methods PROTECTED
- //
-
-
- // Fields PROTECTED
- //
-
-
-private:
-
- // Methods PRIVATE
- //
-
-
- // Fields PRIVATE
- //
+ static int runCommand( string& );
+ static bool OnGUIEvent( int theCommandID, QAD_Desktop* parent );
+ static bool GetVisibility( SALOMEDS::Study_var theStudy,
+ SALOMEDS::SObject_var theObj,
+ void* theId );
+ static bool SetVisibility( SALOMEDS::Study_var theStudy,
+ const char* theEntry,
+ const bool theValue,
+ void* theId );
};
#endif