editors/ConfTreeNodeEditor.py
changeset 846 26836e421e19
parent 844 ec9e6ef49878
child 920 1499a4d225db
equal deleted inserted replaced
845:412a9f05070f 846:26836e421e19
   376                     if isinstance(element_infos["value"], types.TupleType):
   376                     if isinstance(element_infos["value"], types.TupleType):
   377                         browse_boxsizer = wx.BoxSizer(wx.HORIZONTAL)
   377                         browse_boxsizer = wx.BoxSizer(wx.HORIZONTAL)
   378                         boxsizer.AddSizer(browse_boxsizer)
   378                         boxsizer.AddSizer(browse_boxsizer)
   379                         
   379                         
   380                         textctrl = wx.TextCtrl(self.ParamsEditor, 
   380                         textctrl = wx.TextCtrl(self.ParamsEditor, 
   381                               size=wx.Size(275, 25), style=wx.TE_READONLY)
   381                               size=wx.Size(275, -1), style=wx.TE_READONLY)
   382                         if element_infos["value"] is not None:
   382                         if element_infos["value"] is not None:
   383                             textctrl.SetValue(element_infos["value"][0])
   383                             textctrl.SetValue(element_infos["value"][0])
   384                             value_infos = element_infos["value"][1]
   384                             value_infos = element_infos["value"][1]
   385                         else:
   385                         else:
   386                             value_infos = None
   386                             value_infos = None
   393                                     self.GetBrowseCallBackFunction(element_infos["name"], textctrl, element_infos["type"], 
   393                                     self.GetBrowseCallBackFunction(element_infos["name"], textctrl, element_infos["type"], 
   394                                                                    value_infos, element_path), 
   394                                                                    value_infos, element_path), 
   395                                     button)
   395                                     button)
   396                     else:
   396                     else:
   397                         combobox = wx.ComboBox(self.ParamsEditor, 
   397                         combobox = wx.ComboBox(self.ParamsEditor, 
   398                               size=wx.Size(300, 28), style=wx.CB_READONLY)
   398                               size=wx.Size(300, -1), style=wx.CB_READONLY)
   399                         boxsizer.AddWindow(combobox)
   399                         boxsizer.AddWindow(combobox)
   400                         
   400                         
   401                         if element_infos["use"] == "optional":
   401                         if element_infos["use"] == "optional":
   402                             combobox.Append("")
   402                             combobox.Append("")
   403                         if len(element_infos["type"]) > 0 and isinstance(element_infos["type"][0], types.TupleType):
   403                         if len(element_infos["type"]) > 0 and isinstance(element_infos["type"][0], types.TupleType):
   428                     if "min" in element_infos["type"]:
   428                     if "min" in element_infos["type"]:
   429                         scmin = element_infos["type"]["min"]
   429                         scmin = element_infos["type"]["min"]
   430                     if "max" in element_infos["type"]:
   430                     if "max" in element_infos["type"]:
   431                         scmax = element_infos["type"]["max"]
   431                         scmax = element_infos["type"]["max"]
   432                     spinctrl = wx.SpinCtrl(self.ParamsEditor, 
   432                     spinctrl = wx.SpinCtrl(self.ParamsEditor, 
   433                           size=wx.Size(300, 25), style=wx.SP_ARROW_KEYS|wx.ALIGN_RIGHT)
   433                           size=wx.Size(300, -1), style=wx.SP_ARROW_KEYS|wx.ALIGN_RIGHT)
   434                     spinctrl.SetRange(scmin, scmax)
   434                     spinctrl.SetRange(scmin, scmax)
   435                     boxsizer.AddWindow(spinctrl)
   435                     boxsizer.AddWindow(spinctrl)
   436                     if element_infos["value"] is not None:
   436                     if element_infos["value"] is not None:
   437                         spinctrl.SetValue(element_infos["value"])
   437                         spinctrl.SetValue(element_infos["value"])
   438                     spinctrl.Bind(wx.EVT_SPINCTRL, 
   438                     spinctrl.Bind(wx.EVT_SPINCTRL, 
   454                             scmin = 0
   454                             scmin = 0
   455                         else:
   455                         else:
   456                             scmin = -(2**31)
   456                             scmin = -(2**31)
   457                         scmax = 2**31-1
   457                         scmax = 2**31-1
   458                         spinctrl = wx.SpinCtrl(self.ParamsEditor, 
   458                         spinctrl = wx.SpinCtrl(self.ParamsEditor, 
   459                               size=wx.Size(300, 25), style=wx.SP_ARROW_KEYS|wx.ALIGN_RIGHT)
   459                               size=wx.Size(300, -1), style=wx.SP_ARROW_KEYS|wx.ALIGN_RIGHT)
   460                         spinctrl.SetRange(scmin, scmax)
   460                         spinctrl.SetRange(scmin, scmax)
   461                         boxsizer.AddWindow(spinctrl)
   461                         boxsizer.AddWindow(spinctrl)
   462                         if element_infos["value"] is not None:
   462                         if element_infos["value"] is not None:
   463                             spinctrl.SetValue(element_infos["value"])
   463                             spinctrl.SetValue(element_infos["value"])
   464                         spinctrl.Bind(wx.EVT_SPINCTRL, 
   464                         spinctrl.Bind(wx.EVT_SPINCTRL, 
   470                         textctrl = TextCtrlAutoComplete(name=element_infos["name"], 
   470                         textctrl = TextCtrlAutoComplete(name=element_infos["name"], 
   471                                                         parent=self.ParamsEditor, 
   471                                                         parent=self.ParamsEditor, 
   472                                                         appframe=self, 
   472                                                         appframe=self, 
   473                                                         choices=choices, 
   473                                                         choices=choices, 
   474                                                         element_path=element_path,
   474                                                         element_path=element_path,
   475                                                         size=wx.Size(300, 25))
   475                                                         size=wx.Size(300, -1))
   476                         
   476                         
   477                         boxsizer.AddWindow(textctrl)
   477                         boxsizer.AddWindow(textctrl)
   478                         if element_infos["value"] is not None:
   478                         if element_infos["value"] is not None:
   479                             textctrl.ChangeValue(str(element_infos["value"]))
   479                             textctrl.ChangeValue(str(element_infos["value"]))
   480                         textctrl.Bind(wx.EVT_TEXT, self.GetTextCtrlCallBackFunction(textctrl, element_path))
   480                         textctrl.Bind(wx.EVT_TEXT, self.GetTextCtrlCallBackFunction(textctrl, element_path))