From: Kevin A. <ka...@us...> - 2004-09-25 15:37:52
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17862 Modified Files: dialog.py model.py Log Message: bumped minimum requirement to wxPython 2.5.2.8 removed 2.5.2.7 workarounds in dialog.py added passwordTextEntryDialog, multilineTextEntryDialog Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.188 retrieving revision 1.189 diff -C2 -d -r1.188 -r1.189 *** model.py 25 Sep 2004 03:19:23 -0000 1.188 --- model.py 25 Sep 2004 15:37:40 -0000 1.189 *************** *** 20,24 **** import wx ! assert wx.VERSION >= (2, 5, 2) except: from wxPython.wx import wxPySimpleApp, wxFrame, wxMessageDialog, wxICON_EXCLAMATION, wxOK, wxVERSION_STRING --- 20,24 ---- import wx ! assert wx.VERSION >= (2, 5, 2, 8) except: from wxPython.wx import wxPySimpleApp, wxFrame, wxMessageDialog, wxICON_EXCLAMATION, wxOK, wxVERSION_STRING *************** *** 26,30 **** frame = wxFrame(None, -1, "Minimum Requirements Not Met") #frame.Show(1) ! message = "PythonCard minimum requirements:\nPython 2.3 and wxPython 2.5.2\n\n" + \ "You are using Python %s\nand wxPython %s.\n\nClick OK to exit." % (sys.version, wxVERSION_STRING) dialog = wxMessageDialog(frame, message, --- 26,30 ---- frame = wxFrame(None, -1, "Minimum Requirements Not Met") #frame.Show(1) ! message = "PythonCard minimum requirements:\nPython 2.3 and wxPython 2.5.2.8\n\n" + \ "You are using Python %s\nand wxPython %s.\n\nClick OK to exit." % (sys.version, wxVERSION_STRING) dialog = wxMessageDialog(frame, message, Index: dialog.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/dialog.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** dialog.py 17 Aug 2004 19:11:43 -0000 1.38 --- dialog.py 25 Sep 2004 15:37:40 -0000 1.39 *************** *** 12,86 **** DialogResults = dialogs.DialogResults ! #findDialog = dialogs.findDialog ! # KEA 2004-08-17 ! # need input and result arg names to match ! # so workaround the way it works in 2.5.2.7 ! def findDialog(parent=None, searchText='', wholeWordsOnly=False, caseSensitive=False): ! dlg = wx.Dialog(parent, -1, "Find", wx.DefaultPosition, (380, 120)) ! ! wx.StaticText(dlg, -1, 'Find what:', (7, 10)) ! wSearchText = wx.TextCtrl(dlg, -1, searchText, (80, 7), (195, -1)) ! wSearchText.SetValue(searchText) ! wx.Button(dlg, wx.ID_OK, "Find Next", (285, 5), wx.DefaultSize).SetDefault() ! wx.Button(dlg, wx.ID_CANCEL, "Cancel", (285, 35), wx.DefaultSize) ! ! wWholeWord = wx.CheckBox(dlg, -1, 'Match whole word only', ! (7, 35), wx.DefaultSize, wx.NO_BORDER) ! ! if wholeWordsOnly: ! wWholeWord.SetValue(1) ! ! wCase = wx.CheckBox(dlg, -1, 'Match case', (7, 55), wx.DefaultSize, wx.NO_BORDER) ! ! if caseSensitive: ! wCase.SetValue(1) ! ! wSearchText.SetSelection(0, len(wSearchText.GetValue())) ! wSearchText.SetFocus() ! ! result = DialogResults(dlg.ShowModal()) ! result.searchText = wSearchText.GetValue() ! result.wholeWordsOnly = wWholeWord.GetValue() ! result.caseSensitive = wCase.GetValue() ! dlg.Destroy() ! return result ! ! colorDialog = dialogs.colorDialog - # KEA 2004-08-14 - # due to a typo of mine in wx.lib.fontDialog - # I have to include the full version of the function here - def wxFontDialog(parent=None, fontData=None, font=None): - if fontData is None: - fontData = wx.FontData() - fontData.SetColour(wx.BLACK) - fontData.SetInitialFont(wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)) - - if font is not None: - fontData.SetInitialFont(font) - - dialog = wx.FontDialog(parent, fontData) - result = DialogResults(dialog.ShowModal()) - - if result.accepted: - fontData = dialog.GetFontData() - result.fontData = fontData - result.color = fontData.GetColour().Get() - result.colour = result.color - result.font = fontData.GetChosenFont() - else: - result.color = None - result.colour = None - result.font = None - - dialog.Destroy() - return result - def fontDialog(parent, aFont=None): if aFont is not None: aFont = aFont._getFont() ! result = wxFontDialog(parent, font=aFont) ! #result = dialogs.fontDialog(parent, font=aFont) if result.accepted: fontData = result.fontData --- 12,22 ---- DialogResults = dialogs.DialogResults ! findDialog = dialogs.findDialog colorDialog = dialogs.colorDialog def fontDialog(parent, aFont=None): if aFont is not None: aFont = aFont._getFont() ! result = dialogs.fontDialog(parent, font=aFont) if result.accepted: fontData = result.fontData *************** *** 92,99 **** return result ! # KEA 2004-08-15 ! # should we have a passwordEntryDialog and multilineEntryDialog ! # for convenience rather than requiring the use of ! # wx.TE_PASSWORD or wx.TE_MULTILINE styles? textEntryDialog = dialogs.textEntryDialog messageDialog = dialogs.messageDialog --- 28,42 ---- return result ! def passwordTextEntryDialog(parent=None, message='', title='', defaultText='', ! style=wx.TE_PASSWORD | wx.OK | wx.CANCEL): ! return dialogs.textEntryDialog(parent, message, title, defaultText, style) ! ! def multilineTextEntryDialog(parent=None, message='', title='', defaultText='', ! style=wx.TE_MULTILINE | wx.OK | wx.CANCEL): ! result = dialogs.textEntryDialog(parent, message, title, defaultText, style) ! # workaround for Mac OS X ! result.text = '\n'.join(result.text.splitlines()) ! return result ! textEntryDialog = dialogs.textEntryDialog messageDialog = dialogs.messageDialog *************** *** 104,115 **** saveFileDialog = dialogs.saveFileDialog directoryDialog = dialogs.directoryDialog ! ! #singleChoiceDialog = dialogs.singleChoiceDialog ! # KEA 2004-08-15 ! # another workaround for 2.5.2.7 ! def singleChoiceDialog(parent=None, message='', title='', lst=[], ! style=wx.OK | wx.CANCEL | wx.CENTRE): ! return dialogs.singleChoiceDialog(parent, message, title, list(lst), style | wx.DEFAULT_DIALOG_STYLE) ! multipleChoiceDialog = dialogs.multipleChoiceDialog --- 47,51 ---- saveFileDialog = dialogs.saveFileDialog directoryDialog = dialogs.directoryDialog ! singleChoiceDialog = dialogs.singleChoiceDialog multipleChoiceDialog = dialogs.multipleChoiceDialog |