controls/LocationCellEditor.py
changeset 1768 691083b5682a
parent 1767 c74815729afd
child 1836 d42b6cf00fa6
equal deleted inserted replaced
1767:c74815729afd 1768:691083b5682a
    40         main_sizer.AddGrowableCol(0)
    40         main_sizer.AddGrowableCol(0)
    41         main_sizer.AddGrowableRow(0)
    41         main_sizer.AddGrowableRow(0)
    42 
    42 
    43         # create location text control
    43         # create location text control
    44         self.Location = wx.TextCtrl(self, size=wx.Size(0, -1),
    44         self.Location = wx.TextCtrl(self, size=wx.Size(0, -1),
    45               style=wx.TE_PROCESS_ENTER)
    45                                     style=wx.TE_PROCESS_ENTER)
    46         self.Location.Bind(wx.EVT_KEY_DOWN, self.OnLocationChar)
    46         self.Location.Bind(wx.EVT_KEY_DOWN, self.OnLocationChar)
    47         main_sizer.AddWindow(self.Location, flag=wx.GROW)
    47         main_sizer.AddWindow(self.Location, flag=wx.GROW)
    48 
    48 
    49         # create browse button
    49         # create browse button
    50         self.BrowseButton = wx.Button(self, label='...', size=wx.Size(30, -1))
    50         self.BrowseButton = wx.Button(self, label='...', size=wx.Size(30, -1))
    92 
    92 
    93         if infos is not None:
    93         if infos is not None:
    94             location = infos["location"]
    94             location = infos["location"]
    95             # set the location
    95             # set the location
    96             if not infos["location"].startswith("%"):
    96             if not infos["location"].startswith("%"):
    97                 dialog = wx.SingleChoiceDialog(self,
    97                 dialog = wx.SingleChoiceDialog(
    98                       _("Select a variable class:"), _("Variable class"),
    98                     self,
    99                       [_("Input"), _("Output"), _("Memory")],
    99                     _("Select a variable class:"),
   100                       wx.DEFAULT_DIALOG_STYLE | wx.OK | wx.CANCEL)
   100                     _("Variable class"),
       
   101                     [_("Input"), _("Output"), _("Memory")],
       
   102                     wx.DEFAULT_DIALOG_STYLE | wx.OK | wx.CANCEL)
   101                 if dialog.ShowModal() == wx.ID_OK:
   103                 if dialog.ShowModal() == wx.ID_OK:
   102                     selected = dialog.GetSelection()
   104                     selected = dialog.GetSelection()
   103                 else:
   105                 else:
   104                     selected = None
   106                     selected = None
   105                 dialog.Destroy()
   107                 dialog.Destroy()