Explorar o código

wxGUI/animation: center dialogs on parent

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58433 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová %!s(int64=11) %!d(string=hai) anos
pai
achega
1454ddf6dc
Modificáronse 2 ficheiros con 7 adicións e 1 borrados
  1. 2 0
      gui/wxpython/animation/controller.py
  2. 5 1
      gui/wxpython/animation/dialogs.py

+ 2 - 0
gui/wxpython/animation/controller.py

@@ -193,6 +193,7 @@ class AnimationController(wx.EvtHandler):
         self.EndAnimation()
         dlg = EditDialog(parent=self.frame, evalFunction=self.EvaluateInput,
                          animationData=self.animationData, maxAnimations=len(self.animations))
+        dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_CANCEL:
             dlg.Destroy()
             return
@@ -226,6 +227,7 @@ class AnimationController(wx.EvtHandler):
         animationIndex = len([anim for anim in self.animations if anim.IsActive()])
         animData.SetDefaultValues(windowIndex, animationIndex)
         dlg = InputDialog(parent=self.frame, mode='add', animationData=animData)
+        dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_CANCEL:
             dlg.Destroy()
             return

+ 5 - 1
gui/wxpython/animation/dialogs.py

@@ -573,6 +573,7 @@ class EditDialog(wx.Dialog):
         animationIndex = len(self.animationData)
         animData.SetDefaultValues(windowIndex, animationIndex)
         dlg = InputDialog(parent=self, mode='add', animationData=animData)
+        dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_CANCEL:
             dlg.Destroy()
             return
@@ -588,6 +589,7 @@ class EditDialog(wx.Dialog):
 
         animData = self.listbox.GetClientData(index)
         dlg = InputDialog(parent=self, mode='edit', animationData=animData)
+        dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_CANCEL:
             dlg.Destroy()
             return
@@ -933,7 +935,7 @@ class ExportDialog(wx.Dialog):
         fontdata.SetInitialFont(font)
 
         dlg = wx.FontDialog(self, fontdata)
-
+        dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_OK:
             newfontdata = dlg.GetFontData()
             font = newfontdata.GetChosenFont()
@@ -1114,6 +1116,7 @@ class AnimSimpleLayerManager(SimpleLayerManager):
         dlg = AddTemporalLayerDialog(parent=self, layer=layer)
         # first get hidden property, it's altered afterwards
         hidden = layer.hidden
+        dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_OK:
             layer = dlg.GetLayer()
             if hidden:
@@ -1282,6 +1285,7 @@ class AddTemporalLayerDialog(wx.Dialog):
         dlg.layerType.SetSelection(index)
         dlg.LoadMapLayers(dlg.GetLayerType(cmd=True),
                           dlg.mapset.GetStringSelection())
+        dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_OK:
             self.tselect.SetValue(','.join(dlg.GetMapLayers()))