Dialogs.py
changeset 108 9aa1fdfb7cb2
parent 105 d8284a8f1934
child 113 9eeaebd867aa
equal deleted inserted replaced
107:255eada20688 108:9aa1fdfb7cb2
  1471 
  1471 
  1472         self.Inline = wx.TextCtrl(id=ID_TRANSITIONCONTENTDIALOGINLINE,
  1472         self.Inline = wx.TextCtrl(id=ID_TRANSITIONCONTENTDIALOGINLINE,
  1473               name='Inline', parent=self, pos=wx.Point(0, 0),
  1473               name='Inline', parent=self, pos=wx.Point(0, 0),
  1474               size=wx.Size(0, 24), style=0)
  1474               size=wx.Size(0, 24), style=0)
  1475         self.Bind(wx.EVT_TEXT, self.OnInlineChanged, id=ID_TRANSITIONCONTENTDIALOGINLINE)
  1475         self.Bind(wx.EVT_TEXT, self.OnInlineChanged, id=ID_TRANSITIONCONTENTDIALOGINLINE)
  1476 
  1476         self.Inline.Enable(False)
       
  1477         
  1477         self.radioButton3 = wx.RadioButton(id=ID_TRANSITIONCONTENTDIALOGRADIOBUTTON3,
  1478         self.radioButton3 = wx.RadioButton(id=ID_TRANSITIONCONTENTDIALOGRADIOBUTTON3,
  1478               label='Connection', name='radioButton3', parent=self,
  1479               label='Connection', name='radioButton3', parent=self,
  1479               pos=wx.Point(0, 0), size=wx.Size(0, 24), style=0)
  1480               pos=wx.Point(0, 0), size=wx.Size(0, 24), style=0)
  1480         self.Bind(wx.EVT_RADIOBUTTON, self.OnTypeChanged, id=ID_TRANSITIONCONTENTDIALOGRADIOBUTTON3)
  1481         self.Bind(wx.EVT_RADIOBUTTON, self.OnTypeChanged, id=ID_TRANSITIONCONTENTDIALOGRADIOBUTTON3)
  1481         self.radioButton3.SetValue(False)
  1482         self.radioButton3.SetValue(False)
  1597             self.radioButton2.SetValue(False)
  1598             self.radioButton2.SetValue(False)
  1598             self.radioButton3.SetValue(True)
  1599             self.radioButton3.SetValue(True)
  1599             self.Reference.Enable(False)
  1600             self.Reference.Enable(False)
  1600             self.Inline.Enable(False)
  1601             self.Inline.Enable(False)
  1601             self.Element.SetType("connection")
  1602             self.Element.SetType("connection")
       
  1603         self.Priority.SetValue(values["priority"])
  1602         self.Element.SetPriority(values["priority"])
  1604         self.Element.SetPriority(values["priority"])
  1603         self.RefreshPreview()
  1605         self.RefreshPreview()
  1604         
  1606         
  1605     def GetValues(self):
  1607     def GetValues(self):
  1606         values = {"priority" : int(self.Priority.GetValue())}
  1608         values = {"priority" : int(self.Priority.GetValue())}
  2060               name='DownButton', parent=self, pos=wx.Point(0, 0),
  2062               name='DownButton', parent=self, pos=wx.Point(0, 0),
  2061               size=wx.Size(32, 32), style=0)
  2063               size=wx.Size(32, 32), style=0)
  2062         self.Bind(wx.EVT_BUTTON, self.OnDownButton, id=ID_ACTIONBLOCKDIALOGDOWNBUTTON)
  2064         self.Bind(wx.EVT_BUTTON, self.OnDownButton, id=ID_ACTIONBLOCKDIALOGDOWNBUTTON)
  2063 
  2065 
  2064         self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL|wx.CENTRE)
  2066         self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL|wx.CENTRE)
       
  2067         self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.ButtonSizer.GetAffirmativeButton().GetId())
  2065 
  2068 
  2066         self._init_sizers()
  2069         self._init_sizers()
  2067 
  2070 
  2068     def __init__(self, parent):
  2071     def __init__(self, parent):
  2069         self._init_ctrls(parent)
  2072         self._init_ctrls(parent)
  2076         
  2079         
  2077         self.ActionsGrid.SetTable(self.Table)
  2080         self.ActionsGrid.SetTable(self.Table)
  2078         self.ActionsGrid.SetRowLabelSize(0)
  2081         self.ActionsGrid.SetRowLabelSize(0)
  2079         
  2082         
  2080         self.Table.ResetView(self.ActionsGrid)
  2083         self.Table.ResetView(self.ActionsGrid)
       
  2084 
       
  2085     def OnOK(self, event):
       
  2086         self.ActionsGrid.SetGridCursor(0, 0)
       
  2087         self.EndModal(wx.ID_OK)
  2081 
  2088 
  2082     def OnAddButton(self, event):
  2089     def OnAddButton(self, event):
  2083         self.Table.AppendRow(self.DefaultValue.copy())
  2090         self.Table.AppendRow(self.DefaultValue.copy())
  2084         self.Table.ResetView(self.ActionsGrid)
  2091         self.Table.ResetView(self.ActionsGrid)
  2085         event.Skip()
  2092         event.Skip()