Esempio n. 1
0
 def OnRefresh(self, event):
     """ Reopen text editor at previous position after closing Parameter form
         This method has been added because the TextEditMixin close the text box
         whenever user click of double-click a cell in the list control"""
     parm = cdml.GetRefreshInfo()
     # update the list of parameters in the combo box
     self.SetComboItem()
     if parm != None:
         self.cc_coef.GetTextCtrl().SetValue(str(parm))
Esempio n. 2
0
    def OnRefresh(self, event):
        """ Refresh data after closing child form """

        # This line wa previously:
        # self.SetComboItems(self.curCtrl, self.curPage)
        # Yet o allow the user to create new paameters for all
        # combo boxes it was decided to update all combo boxes
        # if the is inefficient, then the previous approach should be rerolled
        if self.curCtrl == self.combo_box_1:
            self.SetComboItems(self.combo_box_1, self.curPage)
            self.SetComboItems(self.combo_box_2, self.curPage)
            self.SetComboItems(self.combo_box_3, self.curPage)
        else:
            self.SetComboItems(None, self.curPage)
            
        record = cdml.GetRefreshInfo()

        if record == None:
            id_record = 0
        elif type(record)==str or not hasattr(record,'ID'):
            # For cost wizard and parameters that their id is their name
            id_record = record

        else:
            id_record = record.ID

        if self.curCtrl != None: # on return from result viewer this can be 0
            if self.curCtrl.Id == cdml.IDF_BUTTON1:
                self.cc_pset.SetValue(id_record)

            elif self.curCtrl.Id == cdml.IDF_BUTTON2:
                if record == None :
                    self.cc_model.GetTextCtrl().SetValue('')
                else:
                    self.cc_model.SetValue(id_record)

            else:

                if self.curCtrl.Id in [ cdml.IDP_BUTTON1, cdml.IDP_BUTTON2, cdml.IDP_BUTTON3, cdml.IDP_BUTTON4]:
                    if record == None :
                        self.curCtrl.SetValue(0)
                    else:                
                        self.curCtrl.GetTextCtrl().SetValue(id_record)
            self.curCtrl.SetFocus()
        self.curCtrl = None
Esempio n. 3
0
 def RefreshEvent(self, event):
     """ Function to handle a return from a child form """
     # Just clear the stack from the last return
     cdml.GetRefreshInfo()
     # Update the project list
     self.ShowProjectList(event)