id = event.GetId()
if id == FindInDirService.FINDALL_ID:
projectService = wx.GetApp().GetService(ProjectEditor.ProjectService)
- view = projectService.GetView()
- if view and view.GetDocument() and view.GetDocument().GetFiles():
+ if projectService.GetFilesFromCurrentProject():
event.Enable(True)
else:
event.Enable(False)
def ShowFindDirDialog(self, findString=None):
config = wx.ConfigBase_Get()
- frame = wx.Dialog(None, -1, _("Find in Directory"), size= (320,200))
+ frame = wx.Dialog(wx.GetApp().GetTopWindow(), -1, _("Find in Directory"), size= (320,200))
borderSizer = wx.BoxSizer(wx.HORIZONTAL)
contentSizer = wx.BoxSizer(wx.VERTICAL)
dir = dirCtrl.GetValue()
if len(dir):
dlg.SetPath(dir)
+ dlg.CenterOnParent()
if dlg.ShowModal() == wx.ID_OK:
dirCtrl.SetValue(dlg.GetPath())
dirCtrl.SetToolTipString(dirCtrl.GetValue())
dirCtrl.SetInsertionPointEnd()
-
dlg.Destroy()
wx.EVT_BUTTON(findDirButton, -1, OnBrowseButton)
lineSizer.Add(wx.StaticLine(frame, -1, size = (10,-1)), 0, flag=wx.EXPAND)
contentSizer.Add(lineSizer, flag=wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.BOTTOM, border=HALF_SPACE)
+ if wx.Platform == "__WXMAC__":
+ contentSizer.Add((-1, 10), 0, wx.EXPAND)
+
lineSizer = wx.BoxSizer(wx.HORIZONTAL)
lineSizer.Add(wx.StaticText(frame, -1, _("Find what:")), 0, wx.ALIGN_CENTER | wx.RIGHT, HALF_SPACE)
if not findString:
buttonSizer = wx.BoxSizer(wx.VERTICAL)
findBtn = wx.Button(frame, wx.ID_OK, _("Find"))
findBtn.SetDefault()
- buttonSizer.Add(findBtn, 0, wx.BOTTOM, HALF_SPACE)
+ BTM_SPACE = HALF_SPACE
+ if wx.Platform == "__WXMAC__":
+ BTM_SPACE = SPACE
+ buttonSizer.Add(findBtn, 0, wx.BOTTOM, BTM_SPACE)
buttonSizer.Add(wx.Button(frame, wx.ID_CANCEL), 0)
borderSizer.Add(buttonSizer, 0, wx.ALL, SPACE)
frame.SetSizer(borderSizer)
frame.Fit()
+ frame.CenterOnParent()
status = frame.ShowModal()
passedCheck = False
_("Find in Directory"),
wx.OK | wx.ICON_EXCLAMATION
)
+ dlg.CenterOnParent()
dlg.ShowModal()
dlg.Destroy()
_("Find in Directory"),
wx.OK | wx.ICON_EXCLAMATION
)
+ dlg.CenterOnParent()
dlg.ShowModal()
dlg.Destroy()
regExpr = regExprCtrl.IsChecked()
self.SaveFindConfig(findString, wholeWord, matchCase, regExpr)
-
+ frame.Destroy()
if status == wx.ID_OK:
- frame.Destroy()
-
messageService = wx.GetApp().GetService(MessageService.MessageService)
messageService.ShowWindow()
return True
else:
- frame.Destroy()
return False
def ShowFindAllDialog(self, findString=None):
config = wx.ConfigBase_Get()
- frame = wx.Dialog(None, -1, _("Find in Project"), size= (320,200))
+ frame = wx.Dialog(wx.GetApp().GetTopWindow(), -1, _("Find in Project"), size= (320,200))
borderSizer = wx.BoxSizer(wx.HORIZONTAL)
contentSizer = wx.BoxSizer(wx.VERTICAL)
buttonSizer = wx.BoxSizer(wx.VERTICAL)
findBtn = wx.Button(frame, wx.ID_OK, _("Find"))
findBtn.SetDefault()
- buttonSizer.Add(findBtn, 0, wx.BOTTOM, HALF_SPACE)
+ BTM_SPACE = HALF_SPACE
+ if wx.Platform == "__WXMAC__":
+ BTM_SPACE = SPACE
+ buttonSizer.Add(findBtn, 0, wx.BOTTOM, BTM_SPACE)
buttonSizer.Add(wx.Button(frame, wx.ID_CANCEL), 0)
borderSizer.Add(buttonSizer, 0, wx.ALL, SPACE)
frame.SetSizer(borderSizer)
frame.Fit()
+ frame.CenterOnParent()
status = frame.ShowModal()
# save user choice state for this and other Find Dialog Boxes
regExpr = regExprCtrl.IsChecked()
self.SaveFindConfig(findString, wholeWord, matchCase, regExpr)
+ frame.Destroy()
if status == wx.ID_OK:
- frame.Destroy()
-
messageService = wx.GetApp().GetService(MessageService.MessageService)
messageService.ShowWindow()
return True
else:
- frame.Destroy()
return False
break
if not foundView:
- doc = wx.GetApp().GetDocumentManager().CreateDocument(filename, wx.lib.docview.DOC_SILENT)
- foundView = doc.GetFirstView()
+ doc = wx.GetApp().GetDocumentManager().CreateDocument(filename, wx.lib.docview.DOC_SILENT|wx.lib.docview.DOC_OPEN_ONCE)
+ if doc:
+ foundView = doc.GetFirstView()
if foundView:
foundView.GetFrame().SetFocus()