Back to index

salome-gui  6.5.0
Public Member Functions | Public Attributes
GUI_PY.mytestdialog.MyTestDialog Class Reference
Inheritance diagram for GUI_PY.mytestdialog.MyTestDialog:
Inheritance graph
[legend]
Collaboration diagram for GUI_PY.mytestdialog.MyTestDialog:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def setData
def checkData
def getData

Public Attributes

 ui
 checkDataMessage

Detailed Description

This class is to illustrate the usage of the GenericDialog to implement
the dialog windows of the application with a common design template provided
by the generic class GenericDialog.

Definition at line 27 of file mytestdialog.py.


Constructor & Destructor Documentation

def GUI_PY.mytestdialog.MyTestDialog.__init__ (   self,
  parent = None,
  name = "MyTestDialog" 
)

Reimplemented in GUI_PY.mytestdialog.MyTestDialogWithSignals.

Definition at line 33 of file mytestdialog.py.

00033 
00034     def __init__(self, parent=None, name="MyTestDialog"):
00035         GenericDialog.__init__(self, parent, name)
00036         # Set up the user interface from Designer.
00037         self.ui = Ui_MyTestDialog()
00038         # BE CAREFULL HERE, the ui form is NOT put in the global dialog (already
00039         # containing some generic widgets) but in the center panel created in the
00040         # GenericDialog as a void container for the form. The MyTestDialog form
00041         # is supposed here to create only the widgets to be placed in the center
00042         # panel
00043         self.ui.setupUi(self.getPanel())


Member Function Documentation

This function implements the control to be done on the values contained
in the widgets when trying to validate the dialog window (click OK first
trigs this function).

Definition at line 53 of file mytestdialog.py.

00053 
00054     def checkData(self):
00055         """
00056         This function implements the control to be done on the values contained
00057         in the widgets when trying to validate the dialog window (click OK first
00058         trigs this function).
00059         """
00060         if ( self.ui.txtName.text().trimmed() == "" ):
00061             self.checkDataMessage = "The name can't be void"
00062             return False
00063         return True

This function implements the mapping from the widgets to the data model

Definition at line 64 of file mytestdialog.py.

00064 
00065     def getData(self):
00066         """
00067         This function implements the mapping from the widgets to the data model
00068         """
00069         name = str(self.ui.txtName.text().trimmed().toUtf8())
00070         # _MEM_: note here that (i) the utf8 format is used and (ii) we must not
00071         # forget to convert to a standard python string (instead of a QString).
00072         return name
00073 

def GUI_PY.mytestdialog.MyTestDialog.setData (   self,
  name 
)
This function implements the mapping from the data model to the widgets

Definition at line 47 of file mytestdialog.py.

00047 
00048     def setData(self, name):
00049         """
00050         This function implements the mapping from the data model to the widgets
00051         """
00052         self.ui.txtName.setText(name)


Member Data Documentation

Definition at line 60 of file mytestdialog.py.

Definition at line 36 of file mytestdialog.py.


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