1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2010 EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 This python file provides the implementation of the interface of the GUI part of
23 this SALOME module. This interface is required by the SALOME GUI framework.
24 We use here a proxy module named under the alias GuiImpl for at least three
26 1. To Keep the required interface as clear as possible in this file;
27 2. The concrete implementation can be substituted by an alternative version;
28 3. We could mix several concrete implementations provided by different proxy
29 modules, for example for test purposes.
32 from daGuiImpl import ADAOGUI_impl as GuiImpl
33 from daGuiImpl import adaoLogger
35 adaoLogger.debug("Import ADAOGUI")
37 # called when module is initialized
38 # perform initialization actions
40 adaoLogger.debug("initialize")
43 # called when module is initialized
44 # return map of popup windows to be used by the module
46 adaoLogger.debug("windows")
47 return GuiImpl.windows()
50 adaoLogger.debug("views")
51 return GuiImpl.views()
53 # called when module is initialized
54 # export module's preferences
55 def createPreferences():
56 adaoLogger.debug("createPreferences")
57 GuiImpl.createPreferences()
59 # called when module is activated
60 # returns True if activating is successfull and False otherwise
62 adaoLogger.debug("activate")
63 return GuiImpl.activate()
65 # called when module is deactivated
67 adaoLogger.debug("deactivate")
70 # called when active study is changed
71 # active study ID is passed as parameter
72 def activeStudyChanged( studyID ):
73 adaoLogger.debug("activeStudyChanged")
74 GuiImpl.activeStudyChanged( studyID )
76 # called when popup menu is invoked
77 # popup menu and menu context are passed as parameters
78 def createPopupMenu( popup, context ):
79 adaoLogger.debug("createPopupMenu")
80 GuiImpl.createPopupMenu(popup, context )
82 # called when GUI action is activated
83 # action ID is passed as parameter
84 def OnGUIEvent(commandID) :
85 adaoLogger.debug("OnGUIEvent")
86 GuiImpl.OnGUIEvent(commandID)
88 # called when module's preferences are changed
89 # preference's resources section and setting name are passed as parameters
90 def preferenceChanged( section, setting ):
91 adaoLogger.debug("preferenceChanged")
92 GuiImpl.preferenceChanged( section, setting )
94 def activeViewChanged(myView):
95 adaoLogger.debug("activeViewChanged")
96 GuiImpl.activeViewChanged(myView)