コード例 #1
0
ファイル: ed_search.py プロジェクト: wangdyna/wxPython
    def _CreateNewDialog(self, e_id):
        """Create and set the controlers find dialog
        @param e_id: Dialog Type Id

        """
        if e_id == ed_glob.ID_FIND_REPLACE:
            dlg = eclib.AdvFindReplaceDlg(self._parent, self._data,
                                          (_("Find"), _("Find/Replace")),
                                          eclib.AFR_STYLE_REPLACEDIALOG)
        elif e_id == ed_glob.ID_FIND:
            dlg = eclib.AdvFindReplaceDlg(self._parent, self._data,
                                          (_("Find"), _("Find/Replace")))
        else:
            dlg = None

        # Change the icons to use ones from Editra's ArtProvider
        if dlg is not None:
            find = wx.ArtProvider.GetBitmap(str(ed_glob.ID_FIND), wx.ART_MENU)
            replace = wx.ArtProvider.GetBitmap(str(ed_glob.ID_FIND_REPLACE),
                                               wx.ART_MENU)
            if find is not None and find.IsOk():
                dlg.SetFindBitmap(find)

            if replace is not None and replace.IsOk():
                dlg.SetReplaceBitmap(replace)

            # Set the persisted data from the last time the dialog was shown
            dlg.SetLookinChoices(self._li_choices)
            dlg.SetLookinSelection(self._li_sel)
            dlg.SetFileFilters(self._filters)

        return dlg
コード例 #2
0
 def OnButton(self, evt):
     """Show a dialog"""
     e_id = evt.GetId()
     if e_id in DIALOG_MAP:
         self.data, style, title = DIALOG_MAP[e_id]
         self.dlg = eclib.AdvFindReplaceDlg(self, self.data, title, style)
         self.dlg.Show()
     else:
         evt.Skip()