]> rtime.felk.cvut.cz Git - CanFestival-3.git/commitdiff
added optional cancel button in node creation dialog (Beremiz)
authoretisserant <etisserant>
Wed, 25 Jun 2008 15:02:17 +0000 (15:02 +0000)
committeretisserant <etisserant>
Wed, 25 Jun 2008 15:02:17 +0000 (15:02 +0000)
objdictgen/commondialogs.py

index a07cb7a14565185c2f1e95c9270c1eb8926eaa98..1657f4605227299748c6f71ca34b7ab923518804 100644 (file)
@@ -890,7 +890,7 @@ class CreateNodeDialog(wx.Dialog):
         
         self.SetSizer(self.flexGridSizer1)
 
-    def _init_ctrls(self, prnt):
+    def _init_ctrls(self, prnt, buttons):
         wx.Dialog.__init__(self, id=ID_CREATENODEDIALOG,
               name='CreateNodeDialog', parent=prnt, pos=wx.Point(376, 223),
               size=wx.Size(450, 350), style=wx.DEFAULT_DIALOG_STYLE,
@@ -994,13 +994,13 @@ class CreateNodeDialog(wx.Dialog):
               name='Spacer', parent=self, pos=wx.Point(0, 0),
               size=wx.Size(0, 0), style=wx.TAB_TRAVERSAL)
 
-        self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL)
+        self.ButtonSizer = self.CreateButtonSizer(buttons)
         self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.ButtonSizer.GetAffirmativeButton().GetId())
         
         self._init_sizers()
 
-    def __init__(self, parent):
-        self._init_ctrls(parent)
+    def __init__(self, parent,buttons=wx.OK|wx.CANCEL):
+        self._init_ctrls(parent,buttons)
         
         self.staticText3.Hide()
         self.NodeID.Hide()
@@ -1238,7 +1238,12 @@ class AddSlaveDialog(wx.Dialog):
                 self.EndModal(wx.ID_OK)
 
     def OnImportEDSButton(self, event):
-        dialog = wx.FileDialog(self, "Choose an EDS file", os.getcwd(), "",  "EDS files (*.eds)|*.eds|All files|*.*", wx.OPEN|wx.CHANGE_DIR)
+        dialog = wx.FileDialog(self,
+                               "Choose an EDS file",
+                               os.getcwd(),
+                               "",
+                               "EDS files (*.eds)|*.eds|All files|*.*",
+                               wx.OPEN)
         if dialog.ShowModal() == wx.ID_OK:
             filepath = dialog.GetPath()
             if os.path.isfile(filepath):