Back to index

salome-gui  6.5.0
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | Static Private Attributes
GUI_PY.genericdialog.GenericDialog Class Reference
Inheritance diagram for GUI_PY.genericdialog.GenericDialog:
Inheritance graph
[legend]
Collaboration diagram for GUI_PY.genericdialog.GenericDialog:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def getPanel
def getButtonBox
def accept
def displayAndWait
def wasOk
def checkData

Public Attributes

 checkDataMessage

Static Public Attributes

string checkDataMessage = ""

Private Attributes

 __ui

Static Private Attributes

 __wasOk = False

Detailed Description

This is an abstract generic dialog box for implementing default and
generic behaviour of dialog windows.
Note that this class can be instantiated but can't be used because the
OK behaviour is a default one indicating that the checkData function should
be implemented in a derived class. The general interface that should be
implemented in derived class is the MVC pattern:

- setData(<a_data_model_object>):
  to initiate the values of the dialog windows from a given data model.

- boolean checkData():
  to verify that the data are valid and notify user if not.

- <a_data_model_object> getData():
  to get the valid data model from values read in the dialog window.

Definition at line 28 of file genericdialog.py.


Constructor & Destructor Documentation

def GUI_PY.genericdialog.GenericDialog.__init__ (   self,
  parent = None,
  name = None,
  modal = 0,
  fl = 0 
)

Definition at line 50 of file genericdialog.py.

00050 
00051     def __init__(self,parent = None,name = None,modal = 0,fl = 0):
00052         QDialog.__init__(self,parent)
00053         # Set up the user interface from Designer.
00054         self.__ui = Ui_GenericDialog()
00055         self.__ui.setupUi(self)


Member Function Documentation

Slot function connected to the button OK

Definition at line 66 of file genericdialog.py.

00066 
00067     def accept(self):
00068         """
00069         Slot function connected to the button OK
00070         """
00071         if not self.checkData():
00072             QMessageBox.warning( self, "Alerte", self.checkDataMessage)
00073             return
00074         self.__wasOk = True
00075         self.hide()

Here is the call graph for this function:

Here is the caller graph for this function:

This function should be implemented in a derived class. It should return
True in the case where the data are estimated to be valid data.

Definition at line 101 of file genericdialog.py.

00101 
00102     def checkData(self):
00103         """
00104         This function should be implemented in a derived class. It should return
00105         True in the case where the data are estimated to be valid data.
00106         """
00107         self.checkDataMessage = "The checkData() function is not implemented yet"
00108         return True
00109 
00110 #
00111 # ==============================================================================
00112 # Basic use cases and unit test functions
00113 # ==============================================================================
#

Here is the caller graph for this function:

This function can be used to display the dialog in the case
where the dialog is modal and does not need interactivity with
parent windows and other part of the application. When called,
the dialog is raised visible and keep waiting until the button
OK or the button CANCEL is pressed. Then the flow can go on
(see an example of implementation in the tests functions at
the end of this file).
In the general case, in particular if you need interaction
with the graphical framework (clic on widgets embedded in
other dialogs), you should used instead the show() command
(for a non modal dialog) or the open() command (for a window
modal dialog, i.e. a dialog that can not interact with its
direct parent but can interact with the other parts).

Definition at line 76 of file genericdialog.py.

00076 
00077     def displayAndWait(self):
00078         """
00079         This function can be used to display the dialog in the case
00080         where the dialog is modal and does not need interactivity with
00081         parent windows and other part of the application. When called,
00082         the dialog is raised visible and keep waiting until the button
00083         OK or the button CANCEL is pressed. Then the flow can go on
00084         (see an example of implementation in the tests functions at
00085         the end of this file).
00086         In the general case, in particular if you need interaction
00087         with the graphical framework (clic on widgets embedded in
00088         other dialogs), you should used instead the show() command
00089         (for a non modal dialog) or the open() command (for a window
00090         modal dialog, i.e. a dialog that can not interact with its
00091         direct parent but can interact with the other parts).
00092         """
00093         self.__wasOk = False
00094         self.exec_()

Definition at line 63 of file genericdialog.py.

00063 
00064     def getButtonBox(self):
00065         return self.__ui.buttonBox

This returns the central panel where to draw the custom dialog
widgets.

Definition at line 56 of file genericdialog.py.

00056 
00057     def getPanel(self):
00058         '''
00059         This returns the central panel where to draw the custom dialog
00060         widgets.
00061         '''
00062         return self.__ui.myCenterPanel

Return True if the button OK was pressed to close the dialog windows.

Definition at line 95 of file genericdialog.py.

00095 
00096     def wasOk(self):
00097         """
00098         Return True if the button OK was pressed to close the dialog windows.
00099         """
00100         return self.__wasOk

Here is the caller graph for this function:


Member Data Documentation

Definition at line 53 of file genericdialog.py.

GUI_PY.genericdialog.GenericDialog.__wasOk = False [static, private]

Definition at line 47 of file genericdialog.py.

Definition at line 48 of file genericdialog.py.

Definition at line 106 of file genericdialog.py.


The documentation for this class was generated from the following file: