浏览代码

vdigit: settings cancel button does not cancel anything, it just closes the dialog

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63267 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 10 年之前
父节点
当前提交
b902e4458a
共有 1 个文件被更改,包括 9 次插入7 次删除
  1. 9 7
      gui/wxpython/vdigit/preferences.py

+ 9 - 7
gui/wxpython/vdigit/preferences.py

@@ -48,7 +48,7 @@ class VDigitSettingsDialog(wx.Dialog):
 
         # buttons
         btnApply = wx.Button(self, wx.ID_APPLY)
-        btnCancel = wx.Button(self, wx.ID_CANCEL)
+        btnCancel = wx.Button(self, wx.ID_CLOSE)
         btnSave = wx.Button(self, wx.ID_SAVE)
         btnSave.SetDefault()
 
@@ -62,16 +62,18 @@ class VDigitSettingsDialog(wx.Dialog):
         btnCancel.SetToolTipString(_("Close dialog and ignore changes"))
         
         # sizers
-        btnSizer = wx.StdDialogButtonSizer()
-        btnSizer.AddButton(btnCancel)
-        btnSizer.AddButton(btnApply)
-        btnSizer.AddButton(btnSave)
-        btnSizer.Realize()
+        btnSizer = wx.wx.BoxSizer(wx.HORIZONTAL)
+        btnSizer.Add(btnCancel, proportion = 0,
+                     flag = wx.ALIGN_RIGHT | wx.ALL, border = 5)
+        btnSizer.Add(btnApply, proportion = 0,
+                     flag = wx.ALIGN_RIGHT | wx.ALL, border = 5)
+        btnSizer.Add(btnSave, proportion = 0,
+                     flag = wx.ALIGN_RIGHT | wx.ALL, border = 5)
         
         mainSizer = wx.BoxSizer(wx.VERTICAL)
         mainSizer.Add(item = notebook, proportion = 1, flag = wx.EXPAND | wx.ALL, border = 5)
         mainSizer.Add(item = btnSizer, proportion = 0,
-                      flag = wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border = 5)
+                      flag = wx.ALIGN_RIGHT, border = 5)
         
         self.Bind(wx.EVT_CLOSE, self.OnCancel)