dialogs/FBDBlockDialog.py
changeset 746 963123fb4917
parent 743 75576aea4555
equal deleted inserted replaced
745:ecd2effd4660 746:963123fb4917
   191                    self.ExecutionControl.SetValue(value)
   191                    self.ExecutionControl.SetValue(value)
   192         self.RefreshPreview()
   192         self.RefreshPreview()
   193 
   193 
   194     def GetValues(self):
   194     def GetValues(self):
   195         values = self.LibraryPanel.GetSelectedBlock()
   195         values = self.LibraryPanel.GetSelectedBlock()
   196         if self.BlockName.GetValue() != "":
   196         if self.BlockName.IsEnabled() and self.BlockName.GetValue() != "":
   197             values["name"] = self.BlockName.GetValue()
   197             values["name"] = self.BlockName.GetValue()
   198         values["width"], values["height"] = self.Block.GetSize()
   198         values["width"], values["height"] = self.Block.GetSize()
   199         values["extension"] = self.Inputs.GetValue()
   199         values["extension"] = self.Inputs.GetValue()
   200         values["executionOrder"] = self.ExecutionOrder.GetValue()
   200         values["executionOrder"] = self.ExecutionOrder.GetValue()
   201         values["executionControl"] = self.ExecutionControl.GetValue()
   201         values["executionControl"] = self.ExecutionControl.GetValue()
   245         dc = wx.ClientDC(self.Preview)
   245         dc = wx.ClientDC(self.Preview)
   246         dc.SetFont(self.Preview.GetFont())
   246         dc.SetFont(self.Preview.GetFont())
   247         dc.Clear()
   247         dc.Clear()
   248         values = self.LibraryPanel.GetSelectedBlock()
   248         values = self.LibraryPanel.GetSelectedBlock()
   249         if values is not None:
   249         if values is not None:
       
   250             if self.BlockName.IsEnabled():
       
   251                 blockname = self.BlockName.GetValue()
       
   252             else:
       
   253                 blockname = ""
   250             self.Block = FBD_Block(self.Preview, values["type"], 
   254             self.Block = FBD_Block(self.Preview, values["type"], 
   251                     self.BlockName.GetValue(), 
   255                     blockname, 
   252                     extension = self.Inputs.GetValue(), 
   256                     extension = self.Inputs.GetValue(), 
   253                     inputs = values["inputs"], 
   257                     inputs = values["inputs"], 
   254                     executionControl = self.ExecutionControl.GetValue(), 
   258                     executionControl = self.ExecutionControl.GetValue(), 
   255                     executionOrder = self.ExecutionOrder.GetValue())
   259                     executionOrder = self.ExecutionOrder.GetValue())
   256             width, height = self.MinBlockSize
   260             width, height = self.MinBlockSize