You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(45) |
May
(185) |
Jun
|
Jul
(36) |
Aug
(205) |
Sep
(98) |
Oct
(107) |
Nov
(6) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(1) |
Feb
(2) |
Mar
(19) |
Apr
(26) |
May
(18) |
Jun
|
Jul
(12) |
Aug
(16) |
Sep
(22) |
Oct
(7) |
Nov
(11) |
Dec
(74) |
2006 |
Jan
(14) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(14) |
Jun
(5) |
Jul
(20) |
Aug
(10) |
Sep
(1) |
Oct
|
Nov
(4) |
Dec
(1) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(14) |
Aug
|
Sep
|
Oct
(6) |
Nov
(1) |
Dec
|
From: Kevin A. <ka...@us...> - 2004-08-12 19:19:33
|
Update of /cvsroot/pythoncard/PythonCard/samples/addressesZODB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16511/addressesZODB Modified Files: addresses.py Log Message: dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: addresses.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/addressesZODB/addresses.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** addresses.py 24 Apr 2004 21:09:17 -0000 1.31 --- addresses.py 12 Aug 2004 19:18:48 -0000 1.32 *************** *** 232,239 **** def on_findRecord_command(self, event): result = dialog.findDialog(self) ! if result['accepted']: ! #print "FindDialog result:\naccepted: %s\nText: %s\nWhole word only: %s\nCase sensitive: %s" % \ ! # (result['accepted'], result['searchText'], result['wholeWordsOnly'], result['caseSensitive']) ! self.document.findRecord(result['searchText'], result['caseSensitive']) def on_editUndo_command(self, event): --- 232,237 ---- def on_findRecord_command(self, event): result = dialog.findDialog(self) ! if result.accepted: ! self.document.findRecord(result.searchText, result.caseSensitive) def on_editUndo_command(self, event): |
From: Kevin A. <ka...@us...> - 2004-08-12 19:17:53
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16367/resourceEditor/modules Removed Files: runOptionsDialog.py runOptionsDialog.rsrc.py Log Message: runOptionsDialog moved to templates.dialogs.runOptionsDialog.py --- runOptionsDialog.py DELETED --- --- runOptionsDialog.rsrc.py DELETED --- |
From: Kevin A. <ka...@us...> - 2004-08-12 19:17:43
|
Update of /cvsroot/pythoncard/PythonCard/tools/codeEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16367/codeEditor/modules Removed Files: runOptionsDialog.py runOptionsDialog.rsrc.py Log Message: runOptionsDialog moved to templates.dialogs.runOptionsDialog.py --- runOptionsDialog.py DELETED --- --- runOptionsDialog.rsrc.py DELETED --- |
From: Kevin A. <ka...@us...> - 2004-08-12 19:15:02
|
Update of /cvsroot/pythoncard/PythonCard/tools/codeEditor/scriptlets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15782/codeEditor/scriptlets Modified Files: documentWordCount.py insertDialog.py selectionWordCount.py Log Message: getCommandLineArgs moved to util.py runOptionsDialog moved to templates.dialogs.runOptionsDialog.py dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: documentWordCount.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/codeEditor/scriptlets/documentWordCount.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** documentWordCount.py 8 Apr 2004 20:56:55 -0000 1.5 --- documentWordCount.py 12 Aug 2004 19:14:21 -0000 1.6 *************** *** 1,2 **** --- 1,3 ---- + import wx from PythonCard import dialog, util *************** *** 14,16 **** filename = os.path.basename(bg.documentPath) ! dialog.MessageDialog(bg, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(util.normalizeEOL(bg.components.document.text)), 'Word Count', dialog.ICON_INFORMATION, dialog.BUTTON_OK) --- 15,17 ---- filename = os.path.basename(bg.documentPath) ! dialog.MessageDialog(bg, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(util.normalizeEOL(bg.components.document.text)), 'Word Count', wx.ICON_INFORMATION | wx.OK) Index: insertDialog.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/codeEditor/scriptlets/insertDialog.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** insertDialog.py 8 Apr 2004 20:56:55 -0000 1.7 --- insertDialog.py 12 Aug 2004 19:14:21 -0000 1.8 *************** *** 2,58 **** alertDialogTemplate = """result = dialog.alertDialog(self, 'a message', 'a title') ! if result['accepted']: ! returned = result['returned'] """ colorDialogTemplate = """result = dialog.colorDialog(self) ! if result['accepted']: ! color = result['color'] """ directoryDialogTemplate = """result = dialog.directoryDialog(self, 'Choose a directory', '') ! if result['accepted']: ! path = result['path'] """ findDialogTemplate = """result = dialog.findDialog(self) ! if result['accepted']: ! searchText = result['searchText'] ! wholeWordsOnly = result['wholeWordsOnly'] ! caseSensitive = result['caseSensitive'] """ fontDialogTemplate = """result = dialog.fontDialog(self) ! if result['accepted']: ! color = result['color'] ! font = result['font'] """ messageDialogTemplate = """result = dialog.messageDialog(self, 'a message', 'a title', ! dialog.ICON_INFORMATION, ! dialog.BUTTON_YES_NO | dialog.BUTTON_NO_DEFAULT | dialog.BUTTON_CANCEL) ! if result['accepted']: ! returned = result['returned'] """ multipleChoiceDialogTemplate = """result = dialog.multipleChoiceDialog(self, "title", "message", ['one', 'two', 'three']) ! if result['accepted']: ! sel = result['selection'] """ openFileDialogTemplate = """wildcard = "JPG files (*.jpg;*.jpeg)|*.jpg;*.jpeg;*.JPG;*.JPEG|GIF files (*.gif)|*.gif;*.GIF|All Files (*.*)|*.*" result = dialog.openFileDialog(self, 'Open', '', '', wildcard ) ! if result['accepted']: ! path = result['paths'][0] """ saveFileDialogTemplate = """wildcard = "JPG files (*.jpg;*.jpeg)|*.jpg;*.jpeg;*.JPG;*.JPEG|GIF files (*.gif)|*.gif;*.GIF|All Files (*.*)|*.*" result = dialog.saveFileDialog(self, 'Save', '', '', wildcard ) ! if result['accepted']: ! path = result['paths'][0] """ scrolledMessageDialogTemplate = """dialog.scrolledMessageDialog(self, 'message', 'title') ! if result['accepted']: # you don't really need the accepted test, since there isn't a result # to check for a scrolledMessageDialog --- 2,57 ---- alertDialogTemplate = """result = dialog.alertDialog(self, 'a message', 'a title') ! if result.accepted: ! returned = result.returnedString """ colorDialogTemplate = """result = dialog.colorDialog(self) ! if result.accepted: ! color = result.color """ directoryDialogTemplate = """result = dialog.directoryDialog(self, 'Choose a directory', '') ! if result.accepted: ! path = result.path """ findDialogTemplate = """result = dialog.findDialog(self) ! if result.accepted: ! searchText = result.text ! wholeWordsOnly = result.wholeword ! caseSensitive = result.casesensitive """ fontDialogTemplate = """result = dialog.fontDialog(self) ! if result.accepted: ! color = result.color ! font = result.font """ messageDialogTemplate = """result = dialog.messageDialog(self, 'a message', 'a title', ! wx.ICON_INFORMATION | wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL) ! if result.accepted: ! returned = result.returnedString """ multipleChoiceDialogTemplate = """result = dialog.multipleChoiceDialog(self, "title", "message", ['one', 'two', 'three']) ! if result.accepted: ! sel = result.selection """ openFileDialogTemplate = """wildcard = "JPG files (*.jpg;*.jpeg)|*.jpg;*.jpeg;*.JPG;*.JPEG|GIF files (*.gif)|*.gif;*.GIF|All Files (*.*)|*.*" result = dialog.openFileDialog(self, 'Open', '', '', wildcard ) ! if result.accepted: ! path = result.paths[0] """ saveFileDialogTemplate = """wildcard = "JPG files (*.jpg;*.jpeg)|*.jpg;*.jpeg;*.JPG;*.JPEG|GIF files (*.gif)|*.gif;*.GIF|All Files (*.*)|*.*" result = dialog.saveFileDialog(self, 'Save', '', '', wildcard ) ! if result.accepted: ! path = result.paths[0] """ scrolledMessageDialogTemplate = """dialog.scrolledMessageDialog(self, 'message', 'title') ! if result.accepted: # you don't really need the accepted test, since there isn't a result # to check for a scrolledMessageDialog *************** *** 61,72 **** singleChoiceDialogTemplate = """result = dialog.singleChoiceDialog(self, "title", "message", ['one', 'two', 'three']) ! if result['accepted']: ! sel = result['selection'] """ textEntryDialogTemplate = """result = dialog.textEntryDialog(self, 'title', 'message', 'text') ! if result['accepted']: ! returned = result['returned'] ! text = result['text'] """ --- 60,71 ---- singleChoiceDialogTemplate = """result = dialog.singleChoiceDialog(self, "title", "message", ['one', 'two', 'three']) ! if result.accepted: ! sel = result.selection """ textEntryDialogTemplate = """result = dialog.textEntryDialog(self, 'title', 'message', 'text') ! if result.accepted: ! returned = result.returnedString ! text = result.text """ *************** *** 80,85 **** result = dialog.singleChoiceDialog(None, "Dialogs", "Pick a dialog:", dialogsList) ! if result['accepted']: ! dialogText = eval(result['selection'] + 'Template') # could get the current indent and insert the appropriate # number of spaces before each line of the template here --- 79,84 ---- result = dialog.singleChoiceDialog(None, "Dialogs", "Pick a dialog:", dialogsList) ! if result.accepted: ! dialogText = eval(result.selection + 'Template') # could get the current indent and insert the appropriate # number of spaces before each line of the template here Index: selectionWordCount.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/codeEditor/scriptlets/selectionWordCount.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** selectionWordCount.py 8 Apr 2004 20:56:55 -0000 1.6 --- selectionWordCount.py 12 Aug 2004 19:14:21 -0000 1.7 *************** *** 1,2 **** --- 1,3 ---- + import wx from PythonCard import dialog, util *************** *** 15,17 **** text = util.normalizeEOL(bg.components.document.GetSelectedText()) ! dialog.MessageDialog(bg, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(text), 'Word Count', dialog.ICON_INFORMATION, dialog.BUTTON_OK) --- 16,18 ---- text = util.normalizeEOL(bg.components.document.GetSelectedText()) ! dialog.MessageDialog(bg, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(text), 'Word Count', wx.ICON_INFORMATION | wx.OK) |
From: Kevin A. <ka...@us...> - 2004-08-12 19:15:02
|
Update of /cvsroot/pythoncard/PythonCard/tools/findfiles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15782/findfiles Modified Files: findfiles.py Log Message: getCommandLineArgs moved to util.py runOptionsDialog moved to templates.dialogs.runOptionsDialog.py dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: findfiles.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/findfiles/findfiles.py,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** findfiles.py 3 Aug 2004 05:40:53 -0000 1.80 --- findfiles.py 12 Aug 2004 19:14:21 -0000 1.81 *************** *** 180,185 **** wildcard = "Grep files (*.grep)|*.grep|All files (*.*)|*.*" result = dialog.openFileDialog(wildcard=wildcard) ! if result['accepted']: ! path = result['paths'][0] self.loadGrepFile(path) --- 180,185 ---- wildcard = "Grep files (*.grep)|*.grep|All files (*.*)|*.*" result = dialog.openFileDialog(wildcard=wildcard) ! if result.accepted: ! path = result.paths[0] self.loadGrepFile(path) *************** *** 187,192 **** wildcard = "Grep files (*.grep)|*.grep" result = dialog.openFileDialog(wildcard=wildcard) ! if result['accepted']: ! s = result['paths'][0] self.dir = os.path.dirname(s) fileList = [] --- 187,192 ---- wildcard = "Grep files (*.grep)|*.grep" result = dialog.openFileDialog(wildcard=wildcard) ! if result.accepted: ! s = result.paths[0] self.dir = os.path.dirname(s) fileList = [] *************** *** 316,321 **** dirs = wFldDirectories.text result = dialog.directoryDialog(self, '', '') ! if result['accepted']: ! s = result['path'] if dirs == "": wFldDirectories.text = s --- 316,321 ---- dirs = wFldDirectories.text result = dialog.directoryDialog(self, '', '') ! if result.accepted: ! s = result.path if dirs == "": wFldDirectories.text = s *************** *** 356,365 **** filename = os.path.basename(self.documentPath) result = dialog.saveFileDialog(None, "Save As", dir, filename, wildcard) ! if result['accepted']: ! path = result['paths'][0] self.saveGrepFile(path) ! return 1 else: ! return 0 def editFile(self, filename, lineno=None): --- 356,365 ---- filename = os.path.basename(self.documentPath) result = dialog.saveFileDialog(None, "Save As", dir, filename, wildcard) ! if result.accepted: ! path = result.paths[0] self.saveGrepFile(path) ! return True else: ! return False def editFile(self, filename, lineno=None): |
From: Kevin A. <ka...@us...> - 2004-08-12 19:15:01
|
Update of /cvsroot/pythoncard/PythonCard/tools/codeEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15782/codeEditor Modified Files: codeEditor.py Log Message: getCommandLineArgs moved to util.py runOptionsDialog moved to templates.dialogs.runOptionsDialog.py dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: codeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/codeEditor/codeEditor.py,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** codeEditor.py 8 Aug 2004 18:31:53 -0000 1.121 --- codeEditor.py 12 Aug 2004 19:14:20 -0000 1.122 *************** *** 12,16 **** from PythonCard import about, configuration, dialog, log, menu, model, resource, util ! from modules.runOptionsDialog import RunOptionsDialog from modules import scriptutils import os, sys --- 12,17 ---- from PythonCard import about, configuration, dialog, log, menu, model, resource, util ! from PythonCard.templates.dialogs import runOptionsDialog ! from modules import scriptutils import os, sys *************** *** 95,102 **** self.configPath = os.path.join(configuration.homedir, 'codeeditor') self.loadConfig() ! self.cmdLineArgs = {'debugmenu':0, 'logging':0, 'messagewatcher':0, ! 'namespaceviewer':0, 'propertyeditor':0, ! 'shell':0, 'otherargs':''} ! self.lastFind = {'searchText':'', 'replaceText':'', 'wholeWordsOnly':0, 'caseSensitive':0} self.startTitle = self.title if len(sys.argv) > 1: --- 96,103 ---- self.configPath = os.path.join(configuration.homedir, 'codeeditor') self.loadConfig() ! self.cmdLineArgs = {'debugmenu':False, 'logging':False, 'messagewatcher':False, ! 'namespaceviewer':False, 'propertyeditor':False, ! 'shell':False, 'otherargs':''} ! self.lastFind = {'searchText':'', 'replaceText':'', 'wholeWordsOnly':False, 'caseSensitive':False} self.startTitle = self.title if len(sys.argv) > 1: *************** *** 408,414 **** msg = self.resource.strings.documentChangedPrompt % filename result = dialog.messageDialog(self, msg, self.resource.strings.codeEditor, ! dialog.ICON_EXCLAMATION, ! dialog.BUTTON_YES_NO | dialog.BUTTON_CANCEL) ! return result['returned'] def doExit(self): --- 409,414 ---- msg = self.resource.strings.documentChangedPrompt % filename result = dialog.messageDialog(self, msg, self.resource.strings.codeEditor, ! wx.ICON_EXCLAMATION | wx.YES_NO | wx.CANCEL) ! return result.returnedString def doExit(self): *************** *** 416,422 **** save = self.saveChanges() if save == "Cancel": ! return 0 elif save == "No": ! return 1 else: if self.documentPath is None: --- 416,422 ---- save = self.saveChanges() if save == "Cancel": ! return False elif save == "No": ! return True else: if self.documentPath is None: *************** *** 424,430 **** else: self.saveFile(self.documentPath) ! return 1 else: ! return 1 def on_close(self, event): --- 424,430 ---- else: self.saveFile(self.documentPath) ! return True else: ! return True def on_close(self, event): *************** *** 460,470 **** filename = os.path.basename(self.documentPath) result = dialog.saveFileDialog(None, self.resource.strings.saveAs, dir, filename, wildcard) ! if result['accepted']: ! path = result['paths'][0] self.saveFile(path) self.fileHistory.AddFileToHistory(path) ! return 1 else: ! return 0 def newFile(self): --- 460,470 ---- filename = os.path.basename(self.documentPath) result = dialog.saveFileDialog(None, self.resource.strings.saveAs, dir, filename, wildcard) ! if result.accepted: ! path = result.paths[0] self.saveFile(path) self.fileHistory.AddFileToHistory(path) ! return True else: ! return False def newFile(self): *************** *** 611,616 **** wildcard = self.resource.strings.saveAsWildcard result = dialog.openFileDialog(None, self.resource.strings.openFile, '', '', wildcard) ! if result['accepted']: ! path = result['paths'][0] # an error will probably occur here if the text is too large # to fit in the wxTextCtrl (TextArea) or the file is actually --- 611,616 ---- wildcard = self.resource.strings.saveAsWildcard result = dialog.openFileDialog(None, self.resource.strings.openFile, '', '', wildcard) ! if result.accepted: ! path = result.paths[0] # an error will probably occur here if the text is too large # to fit in the wxTextCtrl (TextArea) or the file is actually *************** *** 734,741 **** lastFind['caseSensitive']) ! if result['accepted']: ! lastFind['searchText'] = result['searchText'] ! lastFind['wholeWordsOnly'] = result['wholeWordsOnly'] ! lastFind['caseSensitive'] = result['caseSensitive'] self.findNext(lastFind['searchText'], --- 734,741 ---- lastFind['caseSensitive']) ! if result.accepted: ! lastFind['searchText'] = result.text ! lastFind['wholeWordsOnly'] = result.wholeword ! lastFind['caseSensitive'] = result.casesensitive self.findNext(lastFind['searchText'], *************** *** 760,766 **** # this version doesn't alert the user if the line number is out-of-range # it just fails quietly ! if result['accepted']: try: ! self.gotoLine(int(result['text'])) except: pass --- 760,766 ---- # this version doesn't alert the user if the line number is out-of-range # it just fails quietly ! if result.accepted: try: ! self.gotoLine(int(result.text)) except: pass *************** *** 898,902 **** % self.wordCount(self.components.document.text), self.resource.strings.about, ! dialog.ICON_INFORMATION, dialog.BUTTON_OK) def on_doHelpAboutPythonCard_command(self, event): --- 898,902 ---- % self.wordCount(self.components.document.text), self.resource.strings.about, ! wx.ICON_INFORMATION | wx.OK) def on_doHelpAboutPythonCard_command(self, event): *************** *** 925,930 **** path = '' result = dialog.directoryDialog(self, 'Choose a directory', path) ! if result['accepted']: ! path = result['path'] os.chdir(path) self.application.shell.run('os.getcwd()') --- 925,930 ---- path = '' result = dialog.directoryDialog(self, 'Choose a directory', path) ! if result.accepted: ! path = result.path os.chdir(path) self.application.shell.run('os.getcwd()') *************** *** 947,952 **** scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.saveFileDialog(None, self.resource.strings.saveAs, scriptletsDir, 'scriptlet.py', wildcard) ! if result['accepted']: ! path = result['paths'][0] f = open(path, 'w') f.write(script) --- 947,952 ---- scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.saveFileDialog(None, self.resource.strings.saveAs, scriptletsDir, 'scriptlet.py', wildcard) ! if result.accepted: ! path = result.paths[0] f = open(path, 'w') f.write(script) *************** *** 972,977 **** scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.openFileDialog(self, self.resource.strings.openFile, scriptletsDir, '', wildcard) ! if result['accepted']: ! filename = result['paths'][0] self.execScriptlet(filename) #os.chdir(curDir) --- 972,977 ---- scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.openFileDialog(self, self.resource.strings.openFile, scriptletsDir, '', wildcard) ! if result.accepted: ! filename = result.paths[0] self.execScriptlet(filename) #os.chdir(curDir) *************** *** 1083,1121 **** scriptutils.CheckFile(self, self.documentPath) self.lastPos = self.components.document.GetCurrentPos() - - # the stuff below was adapted from the resourceEditor - # and can probably be moved to a separate module - # command-line args code - def getCommandLineArgs(self): - args = [] - if self.cmdLineArgs['otherargs'] != '': - args.append(self.cmdLineArgs['otherargs']) - if self.cmdLineArgs['debugmenu']: - args.append('-d') - if self.cmdLineArgs['logging']: - args.append('-l') - if self.cmdLineArgs['messagewatcher']: - args.append('-m') - if self.cmdLineArgs['namespaceviewer']: - args.append('-n') - if self.cmdLineArgs['propertyeditor']: - args.append('-p') - if self.cmdLineArgs['shell']: - args.append('-s') - return args - def on_fileRunOptions_command(self, event): ! dlg = RunOptionsDialog(self, self.cmdLineArgs) ! dlg.showModal() ! if dlg.accepted(): ! self.cmdLineArgs['debugmenu'] = dlg.components.chkDebugMenu.checked ! self.cmdLineArgs['logging'] = dlg.components.chkLogging.checked ! self.cmdLineArgs['messagewatcher'] = dlg.components.chkMessageWatcher.checked ! self.cmdLineArgs['namespaceviewer'] = dlg.components.chkNamespaceViewer.checked ! self.cmdLineArgs['propertyeditor'] = dlg.components.chkPropertyEditor.checked ! self.cmdLineArgs['shell'] = dlg.components.chkShell.checked ! self.cmdLineArgs['otherargs'] = dlg.components.fldOtherArgs.text ! dlg.destroy() --- 1083,1097 ---- scriptutils.CheckFile(self, self.documentPath) self.lastPos = self.components.document.GetCurrentPos() def on_fileRunOptions_command(self, event): ! result = runOptionsDialog.runOptionsDialog(self, self.cmdLineArgs) ! if result.accepted: ! self.cmdLineArgs['debugmenu'] = result.debugmenu ! self.cmdLineArgs['logging'] = result.logging ! self.cmdLineArgs['messagewatcher'] = result.messagewatcher ! self.cmdLineArgs['namespaceviewer'] = result.namespaceviewer ! self.cmdLineArgs['propertyeditor'] = result.propertyeditor ! self.cmdLineArgs['shell'] = result.shell ! self.cmdLineArgs['otherargs'] = result.otherargs *************** *** 1150,1154 **** # the args should come from a dialog or menu items that are checked/unchecked ! args = self.getCommandLineArgs() # change to the script directory before attempting to run --- 1126,1130 ---- # the args should come from a dialog or menu items that are checked/unchecked ! args = util.getCommandLineArgs(self.cmdLineArgs) # change to the script directory before attempting to run |
From: Kevin A. <ka...@us...> - 2004-08-12 19:14:34
|
Update of /cvsroot/pythoncard/PythonCard/tools/textEditor/scriptlets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15782/textEditor/scriptlets Modified Files: documentWordCount.py selectionWordCount.py Log Message: getCommandLineArgs moved to util.py runOptionsDialog moved to templates.dialogs.runOptionsDialog.py dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: documentWordCount.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/textEditor/scriptlets/documentWordCount.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** documentWordCount.py 8 Apr 2004 20:56:50 -0000 1.4 --- documentWordCount.py 12 Aug 2004 19:14:24 -0000 1.5 *************** *** 1,2 **** --- 1,3 ---- + import wx from PythonCard import dialog *************** *** 14,16 **** filename = os.path.basename(bg.documentPath) ! dialog.MessageDialog(bg, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(bg.components.fldDocument.text), 'Word Count', dialog.ICON_INFORMATION, dialog.BUTTON_OK) --- 15,17 ---- filename = os.path.basename(bg.documentPath) ! dialog.MessageDialog(bg, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(bg.components.fldDocument.text), 'Word Count', wx.ICON_INFORMATION | wx.OK) Index: selectionWordCount.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/textEditor/scriptlets/selectionWordCount.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** selectionWordCount.py 8 Apr 2004 20:56:50 -0000 1.4 --- selectionWordCount.py 12 Aug 2004 19:14:24 -0000 1.5 *************** *** 1,2 **** --- 1,3 ---- + import wx from PythonCard import dialog *************** *** 15,17 **** text = bg.components.fldDocument.getStringSelection() ! dialog.MessageDialog(bg, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(text), 'Word Count', dialog.ICON_INFORMATION, dialog.BUTTON_OK) --- 16,18 ---- text = bg.components.fldDocument.getStringSelection() ! dialog.MessageDialog(bg, "Document: %s\n" % filename + "%d chars, %d words, %d lines" % wordCount(text), 'Word Count', wx.ICON_INFORMATION | wx.OK) |
From: Kevin A. <ka...@us...> - 2004-08-12 19:14:33
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15782/resourceEditor Modified Files: resourceEditor.py Log Message: getCommandLineArgs moved to util.py runOptionsDialog moved to templates.dialogs.runOptionsDialog.py dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: resourceEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/resourceEditor.py,v retrieving revision 1.203 retrieving revision 1.204 diff -C2 -d -r1.203 -r1.204 *** resourceEditor.py 8 Aug 2004 18:07:45 -0000 1.203 --- resourceEditor.py 12 Aug 2004 19:14:22 -0000 1.204 *************** *** 16,26 **** from PythonCard import about, clipboard, configuration, dialog, graphic, log from PythonCard import menu, model, registry, resource, util from modules.backgroundInfoDialog import BackgroundInfoDialog ! from modules.stackInfoDialog import StackInfoDialog from modules import menuDialog from modules import stringDialog from modules.dialogInfoDialog import DialogInfoDialog - from modules.runOptionsDialog import RunOptionsDialog from modules.propertyEditor import PropertyEditor from modules import resourceOutput --- 16,26 ---- from PythonCard import about, clipboard, configuration, dialog, graphic, log from PythonCard import menu, model, registry, resource, util + from PythonCard.templates.dialogs import runOptionsDialog from modules.backgroundInfoDialog import BackgroundInfoDialog ! from modules import stackInfoDialog from modules import menuDialog from modules import stringDialog from modules.dialogInfoDialog import DialogInfoDialog from modules.propertyEditor import PropertyEditor from modules import resourceOutput *************** *** 53,59 **** self.filename = None self.documentChanged = False ! self.cmdLineArgs = {'debugmenu':0, 'logging':0, 'messagewatcher':0, ! 'namespaceviewer':0, 'propertyeditor':0, ! 'shell':0} self.lastCaptured = None --- 53,59 ---- self.filename = None self.documentChanged = False ! self.cmdLineArgs = {'debugmenu':False, 'logging':False, 'messagewatcher':False, ! 'namespaceviewer':False, 'propertyeditor':False, ! 'shell':False, 'otherargs':''} self.lastCaptured = None *************** *** 682,688 **** msg = "The data in the %s file has changed.\n\nDo you want to save the changes?" % filename result = dialog.messageDialog(self, msg, 'resourceEditor', ! dialog.ICON_EXCLAMATION, ! dialog.BUTTON_YES_NO | dialog.BUTTON_CANCEL) ! return result['returned'] def newFile(self, fullTemplatePath): --- 682,687 ---- msg = "The data in the %s file has changed.\n\nDo you want to save the changes?" % filename result = dialog.messageDialog(self, msg, 'resourceEditor', ! wx.ICON_EXCLAMATION | wx.YES_NO | wx.CANCEL) ! return result.returnedString def newFile(self, fullTemplatePath): *************** *** 713,718 **** # don't set the starting dir, let user navigate result = dialog.saveFileDialog(None, "Save As", "", templateFilename[:-8] + ".py", wildcard) ! if result['accepted']: ! path = result['paths'][0] if path.endswith('.rsrc.py'): --- 712,717 ---- # don't set the starting dir, let user navigate result = dialog.saveFileDialog(None, "Save As", "", templateFilename[:-8] + ".py", wildcard) ! if result.accepted: ! path = result.paths[0] if path.endswith('.rsrc.py'): *************** *** 781,785 **** message = 'The resource file could not be saved.\n' + str( e ) dialog.messageDialog(self, message, 'ResourceEditor Error', ! dialog.ICON_EXCLAMATION,dialog.BUTTON_OK) return False --- 780,784 ---- message = 'The resource file could not be saved.\n' + str( e ) dialog.messageDialog(self, message, 'ResourceEditor Error', ! wx.ICON_EXCLAMATION | wx.OK) return False *************** *** 832,837 **** listX.append(t[0]) result = dialog.singleChoiceDialog(self, "Templates", "Choose a resource template", listX) ! if result['accepted']: ! name = result['selection'] for t in templates: if t[0] == name: --- 831,836 ---- listX.append(t[0]) result = dialog.singleChoiceDialog(self, "Templates", "Choose a resource template", listX) ! if result.accepted: ! name = result.selection for t in templates: if t[0] == name: *************** *** 892,897 **** wildcard = "resource files (*.rsrc.py)|*.rsrc.py" result = dialog.saveFileDialog(None, "Save As", path, filename, wildcard) ! if result['accepted']: ! path = result['paths'][0] # KEA 2002-06-01 # force .rsrc.py extension --- 891,896 ---- wildcard = "resource files (*.rsrc.py)|*.rsrc.py" result = dialog.saveFileDialog(None, "Save As", path, filename, wildcard) ! if result.accepted: ! path = result.paths[0] # KEA 2002-06-01 # force .rsrc.py extension *************** *** 924,930 **** msg = "You will lose any changes you've made to %s.\n\nAre you sure you want to revert to the last saved version?" % filename result = dialog.messageDialog(self, msg, 'resourceEditor', ! dialog.ICON_EXCLAMATION, ! dialog.BUTTON_YES_NO | dialog.BUTTON_CANCEL) ! save = result['returned'] if save == "Cancel" or save == "No": # don't do anything, just go back to editing --- 923,928 ---- msg = "You will lose any changes you've made to %s.\n\nAre you sure you want to revert to the last saved version?" % filename result = dialog.messageDialog(self, msg, 'resourceEditor', ! wx.ICON_EXCLAMATION | wx.YES_NO | wx.CANCEL) ! save = result.returnedString if save == "Cancel" or save == "No": # don't do anything, just go back to editing *************** *** 979,984 **** wildcard = "resource files (*.rsrc.py)|*.rsrc.py" result = dialog.openFileDialog(None, "Import which resource file?", '', '', wildcard) ! if result['accepted']: ! self.openFile(result['paths'][0]) def on_menuFileOpen_select(self, event): --- 977,982 ---- wildcard = "resource files (*.rsrc.py)|*.rsrc.py" result = dialog.openFileDialog(None, "Import which resource file?", '', '', wildcard) ! if result.accepted: ! self.openFile(result.paths[0]) def on_menuFileOpen_select(self, event): *************** *** 1030,1035 **** 'Name for copy:', self.startName + 'Copy') ! if result['accepted']: ! name = result['text'] if name in self.components: dialog.alertDialog(self, name + " already exists", 'Error: Unable to duplicate widget') --- 1028,1033 ---- 'Name for copy:', self.startName + 'Copy') ! if result.accepted: ! name = result.text if name in self.components: dialog.alertDialog(self, name + " already exists", 'Error: Unable to duplicate widget') *************** *** 1086,1092 **** aWidget = self.components[self.startName] msg = "Are you sure you want to delete %s %s?" % (aWidget.__class__.__name__, aWidget.name) ! result = dialog.messageDialog(self, msg, 'Delete Component', ! dialog.ICON_INFORMATION) ! if result['accepted']: self.hideSizingHandles() del self.components[aWidget.name] --- 1084,1089 ---- aWidget = self.components[self.startName] msg = "Are you sure you want to delete %s %s?" % (aWidget.__class__.__name__, aWidget.name) ! result = dialog.messageDialog(self, msg, 'Delete Component', wx.ICON_INFORMATION) ! if result.accepted: self.hideSizingHandles() del self.components[aWidget.name] *************** *** 1252,1274 **** wx.EVT_MOTION(c, self.on_mouseDrag) def on_fileRunOptions_command(self, event): ! dlg = RunOptionsDialog(self, self.cmdLineArgs) ! dlg.showModal() ! if dlg.accepted(): ! self.cmdLineArgs['debugmenu'] = dlg.components.chkDebugMenu.checked ! self.cmdLineArgs['logging'] = dlg.components.chkLogging.checked ! self.cmdLineArgs['messagewatcher'] = dlg.components.chkMessageWatcher.checked ! self.cmdLineArgs['namespaceviewer'] = dlg.components.chkNamespaceViewer.checked ! self.cmdLineArgs['propertyeditor'] = dlg.components.chkPropertyEditor.checked ! self.cmdLineArgs['shell'] = dlg.components.chkShell.checked ! dlg.destroy() def on_editStackInfo_command(self, event): ! dlg = StackInfoDialog(self, self.rsrc) ! dlg.showModal() ! if dlg.accepted(): ! self.rsrc.application.name = dlg.components.fldName.text self.documentChanged = True - dlg.destroy() # need to change the logic so that self.rsrc --- 1249,1274 ---- wx.EVT_MOTION(c, self.on_mouseDrag) + # KEA 2004-08-12 + # for each of the dialogs below, the code should be refactored + # so that the dialog modules have a function wrapper and the + # result contains whatever attributes would be needed + # the function should probably not have side-effects + def on_fileRunOptions_command(self, event): ! result = runOptionsDialog.runOptionsDialog(self, self.cmdLineArgs) ! if result.accepted: ! self.cmdLineArgs['debugmenu'] = result.debugmenu ! self.cmdLineArgs['logging'] = result.logging ! self.cmdLineArgs['messagewatcher'] = result.messagewatcher ! self.cmdLineArgs['namespaceviewer'] = result.namespaceviewer ! self.cmdLineArgs['propertyeditor'] = result.propertyeditor ! self.cmdLineArgs['shell'] = result.shell ! self.cmdLineArgs['otherargs'] = result.otherargs def on_editStackInfo_command(self, event): ! result = stackInfoDialog.stackInfoDialog(self, self.rsrc) ! if result.accepted: ! self.rsrc.application.name = result.text self.documentChanged = True # need to change the logic so that self.rsrc *************** *** 1279,1284 **** background.size = self.GetSizeTuple() dlg = BackgroundInfoDialog(self, background) ! dlg.showModal() ! if dlg.accepted(): background.name = dlg.components.fldName.text background.title = dlg.components.fldTitle.text --- 1279,1284 ---- background.size = self.GetSizeTuple() dlg = BackgroundInfoDialog(self, background) ! result = dlg.showModal() ! if result.accepted: background.name = dlg.components.fldName.text background.title = dlg.components.fldTitle.text *************** *** 1328,1333 **** background.size = self.GetSizeTuple() dlg = DialogInfoDialog(self, background) ! dlg.showModal() ! if dlg.accepted(): background.name = dlg.components.fldName.text background.title = dlg.components.fldTitle.text --- 1328,1333 ---- background.size = self.GetSizeTuple() dlg = DialogInfoDialog(self, background) ! result = dlg.showModal() ! if result.accepted: background.name = dlg.components.fldName.text background.title = dlg.components.fldTitle.text *************** *** 1345,1350 **** menubar = None dlg = menuDialog.MenuDialog(self, menubar) ! dlg.showModal() ! if dlg.accepted(): if len(dlg.menuList) == 0: self.rsrc.application.backgrounds[0].menubar = None --- 1345,1350 ---- menubar = None dlg = menuDialog.MenuDialog(self, menubar) ! result = dlg.showModal() ! if result.accepted: if len(dlg.menuList) == 0: self.rsrc.application.backgrounds[0].menubar = None *************** *** 1366,1371 **** stringList = {} dlg = stringDialog.StringDialog(self, stringList) ! dlg.showModal() ! if dlg.accepted(): if self.editingDialog: self.rsrc.strings = stringDialog.stringResourceFromList(dlg.stringList) --- 1366,1371 ---- stringList = {} dlg = stringDialog.StringDialog(self, stringList) ! result = dlg.showModal() ! if result.accepted: if self.editingDialog: self.rsrc.strings = stringDialog.stringResourceFromList(dlg.stringList) *************** *** 1381,1387 **** 'Enter the preferred grid size (e.g. 5):', str(self.xGridSize)) ! if result['accepted']: try: ! size = int(result['text']) self.xGridSize = size self.yGridSize = size --- 1381,1387 ---- 'Enter the preferred grid size (e.g. 5):', str(self.xGridSize)) ! if result.accepted: try: ! size = int(result.text) self.xGridSize = size self.yGridSize = size *************** *** 1512,1518 **** aWidget = self.components[self.startName] msg = "Are you sure you want to Cut %s %s?" % (aWidget.__class__.__name__, aWidget.name) ! result = dialog.messageDialog(self, msg, 'Cut Component', ! dialog.ICON_INFORMATION) ! if result['accepted']: self.copyWidgetDescriptionToClipboard(self.startName) self.hideSizingHandles() --- 1512,1517 ---- aWidget = self.components[self.startName] msg = "Are you sure you want to Cut %s %s?" % (aWidget.__class__.__name__, aWidget.name) ! result = dialog.messageDialog(self, msg, 'Cut Component', wx.ICON_INFORMATION) ! if result.accepted: self.copyWidgetDescriptionToClipboard(self.startName) self.hideSizingHandles() *************** *** 1543,1548 **** name + ' component already exists\nEnter a new name:', name + 'Copy') ! if result['accepted']: ! name = result['text'] if name in self.components: dialog.alertDialog(self, name + " already exists", 'Error: Unable to duplicate component') --- 1542,1547 ---- name + ' component already exists\nEnter a new name:', name + 'Copy') ! if result.accepted: ! name = result.text if name in self.components: dialog.alertDialog(self, name + " already exists", 'Error: Unable to duplicate component') *************** *** 1603,1609 **** save = self.saveChanges() if save == "Cancel": ! return 0 elif save == "No": ! return 1 else: if self.filename is None: --- 1602,1608 ---- save = self.saveChanges() if save == "Cancel": ! return False elif save == "No": ! return True else: if self.filename is None: *************** *** 1612,1616 **** return self.saveFile() else: ! return 1 def doCleanup(self): --- 1611,1615 ---- return self.saveFile() else: ! return True def doCleanup(self): |
From: Kevin A. <ka...@us...> - 2004-08-12 19:14:33
|
Update of /cvsroot/pythoncard/PythonCard/tools/textEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15782/textEditor Modified Files: textEditor.pyw Log Message: getCommandLineArgs moved to util.py runOptionsDialog moved to templates.dialogs.runOptionsDialog.py dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: textEditor.pyw =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/textEditor/textEditor.pyw,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** textEditor.pyw 10 May 2004 00:45:25 -0000 1.73 --- textEditor.pyw 12 Aug 2004 19:14:23 -0000 1.74 *************** *** 15,18 **** --- 15,19 ---- from PythonCard import configuration, dialog, log, model, resource, util + from PythonCard.templates.dialogs import findDialog import os, sys import wx *************** *** 29,71 **** return html - class FindDialog(model.CustomDialog): - def __init__(self, aBg, searchText='', wholeWordsOnly=0, caseSensitive=0) : - # load the resource - path = os.path.join(aBg.application.applicationDirectory, \ - model.internationalResourceName('find')) - aDialogRsrc = resource.ResourceFile(path).getResource() - - model.CustomDialog.__init__(self, aBg, aDialogRsrc) - - self.parent = aBg - - # if some special setup is necessary, do it here - self.components.fldFind.text = searchText - self.components.chkMatchWholeWordOnly.checked = wholeWordsOnly - self.components.chkMatchCase.checked = caseSensitive - self.components.fldFind.setSelection(0, len(self.components.fldFind.text)) - self.components.fldFind.setFocus() - - # these shouldn't be necessary - # but I haven't taken the time to figure out what is messed up in - # the event dispatch that keeps event.skip from being called automatically - # there might be a problem specific to wxDialog - def on_btnFindNext_mouseClick(self, event): - event.skip() - - def on_btnCancel_mouseClick(self, event): - event.skip() - - - def findDialog(parent, searchText='', wholeWordsOnly=0, caseSensitive=0): - dlg = FindDialog(parent, searchText, wholeWordsOnly, caseSensitive) - dlg.showModal() - result = {'accepted':dlg.accepted()} - result['searchText'] = dlg.components.fldFind.text - result['wholeWordsOnly'] = dlg.components.chkMatchWholeWordOnly.checked - result['caseSensitive'] = dlg.components.chkMatchCase.checked - dlg.destroy() - return result - class TextEditor(model.Background): --- 30,33 ---- *************** *** 194,200 **** msg = "The text in the %s file has changed.\n\nDo you want to save the changes?" % filename result = dialog.messageDialog(self, msg, 'textEditor', ! dialog.ICON_EXCLAMATION, ! dialog.BUTTON_YES_NO | dialog.BUTTON_CANCEL) ! return result['returned'] def doExit(self): --- 156,161 ---- msg = "The text in the %s file has changed.\n\nDo you want to save the changes?" % filename result = dialog.messageDialog(self, msg, 'textEditor', ! wx.ICON_EXCLAMATION | wx.YES_NO | wx.CANCEL) ! return result.returnedString def doExit(self): *************** *** 202,208 **** save = self.saveChanges() if save == "Cancel": ! return 0 elif save == "No": ! return 1 else: if self.documentPath is None: --- 163,169 ---- save = self.saveChanges() if save == "Cancel": ! return False elif save == "No": ! return True else: if self.documentPath is None: *************** *** 210,216 **** else: self.saveFile(self.documentPath) ! return 1 else: ! return 1 def on_close(self, event): --- 171,177 ---- else: self.saveFile(self.documentPath) ! return True else: ! return True def on_close(self, event): *************** *** 226,231 **** def on_doSetFont_command(self, event): result = dialog.fontDialog(self, self.components.fldDocument.font) ! if result['accepted']: ! self.config['defaultFont'] = result['font'] self.setDocumentFont() --- 187,192 ---- def on_doSetFont_command(self, event): result = dialog.fontDialog(self, self.components.fldDocument.font) ! if result.accepted: ! self.config['defaultFont'] = result.font self.setDocumentFont() *************** *** 246,259 **** filename = os.path.basename(self.documentPath) result = dialog.saveFileDialog(None, "Save As", dir, filename, wildcard) ! if result['accepted']: ! path = result['paths'][0] self.saveFile(path) self.fileHistory.AddFileToHistory(path) ! return 1 else: ! return 0 def on_fldDocument_textUpdate(self, event): ! self.documentChanged = 1 def newFile(self): --- 207,220 ---- filename = os.path.basename(self.documentPath) result = dialog.saveFileDialog(None, "Save As", dir, filename, wildcard) ! if result.accepted: ! path = result.paths[0] self.saveFile(path) self.fileHistory.AddFileToHistory(path) ! return True else: ! return False def on_fldDocument_textUpdate(self, event): ! self.documentChanged = True def newFile(self): *************** *** 331,336 **** wildcard = "Text files (*.txt)|*.txt;*.TXT|All files (*.*)|*.*" result = dialog.openFileDialog(wildcard=wildcard) ! if result['accepted']: ! path = result['paths'][0] # an error will probably occur here if the text is too large # to fit in the wxTextCtrl (TextArea) or the file is actually --- 292,297 ---- wildcard = "Text files (*.txt)|*.txt;*.TXT|All files (*.*)|*.*" result = dialog.openFileDialog(wildcard=wildcard) ! if result.accepted: ! path = result.paths[0] # an error will probably occur here if the text is too large # to fit in the wxTextCtrl (TextArea) or the file is actually *************** *** 419,424 **** # two versions of Find, the first one is using the FindDialog # defined in dialog.py, the second one is using a FindDialog class ! # defined in this source file based on the GenericDialog class ! # in dialog.py # the second one is what you should base your own dialogs on """ --- 380,384 ---- # two versions of Find, the first one is using the FindDialog # defined in dialog.py, the second one is using a FindDialog class ! # defined in templates.dialogs.findDialog # the second one is what you should base your own dialogs on """ *************** *** 432,439 **** lastFind['caseSensitive']) ! if result['accepted']: ! lastFind['searchText'] = result['searchText'] ! lastFind['wholeWordsOnly'] = result['wholeWordsOnly'] ! lastFind['caseSensitive'] = result['caseSensitive'] self.findNext(lastFind['searchText'], --- 392,399 ---- lastFind['caseSensitive']) ! if result.accepted: ! lastFind['searchText'] = result.searchText ! lastFind['wholeWordsOnly'] = result.wholeWordsOnly ! lastFind['caseSensitive'] = result.caseSensitive self.findNext(lastFind['searchText'], *************** *** 487,493 **** # this version doesn't alert the user if the line number is out-of-range # it just fails quietly ! if result['accepted']: try: ! self.gotoLine(int(result['text'])) except: pass --- 447,453 ---- # this version doesn't alert the user if the line number is out-of-range # it just fails quietly ! if result.accepted: try: ! self.gotoLine(int(result.text)) except: pass *************** *** 514,518 **** % self.wordCount(self.components.fldDocument.text), 'About textEditor...', ! dialog.ICON_INFORMATION, dialog.BUTTON_OK) --- 474,478 ---- % self.wordCount(self.components.fldDocument.text), 'About textEditor...', ! wx.ICON_INFORMATION | wx.OK) *************** *** 537,542 **** scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.saveFileDialog(None, "Save As", scriptletsDir, 'scriptlet.py', wildcard) ! if result['accepted']: ! path = result['paths'][0] f = open(path, 'w') f.write(script) --- 497,502 ---- scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.saveFileDialog(None, "Save As", scriptletsDir, 'scriptlet.py', wildcard) ! if result.accepted: ! path = result.paths[0] f = open(path, 'w') f.write(script) *************** *** 554,559 **** scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.openFileDialog(self, 'Open', scriptletsDir, '', wildcard) ! if result['accepted']: ! filename = result['paths'][0] try: command = 'execfile(%r)' % filename --- 514,519 ---- scriptletsDir = os.path.join(self.application.applicationDirectory, 'scriptlets') result = dialog.openFileDialog(self, 'Open', scriptletsDir, '', wildcard) ! if result.accepted: ! filename = result.paths[0] try: command = 'execfile(%r)' % filename |
From: Kevin A. <ka...@us...> - 2004-08-12 19:14:33
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15782/resourceEditor/templates Modified Files: dialogTemplate.py templateFullMenus.py Log Message: getCommandLineArgs moved to util.py runOptionsDialog moved to templates.dialogs.runOptionsDialog.py dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: dialogTemplate.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/templates/dialogTemplate.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dialogTemplate.py 8 Apr 2004 20:56:55 -0000 1.2 --- dialogTemplate.py 12 Aug 2004 19:14:23 -0000 1.3 *************** *** 18,26 **** def myDialog(parent): dlg = MyDialog(parent, txt) ! dlg.showModal() ! result = {'accepted':dlg.accepted()} # stick your results into the result dictionary here # example from samples/dialogs/minimalDialog.py ! # result['text'] = dlg.components.field1.text dlg.destroy() return result --- 18,25 ---- def myDialog(parent): dlg = MyDialog(parent, txt) ! result = dlg.showModal() # stick your results into the result dictionary here # example from samples/dialogs/minimalDialog.py ! # result.text = dlg.components.field1.text dlg.destroy() return result Index: templateFullMenus.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/templates/templateFullMenus.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** templateFullMenus.py 30 Apr 2004 16:26:12 -0000 1.9 --- templateFullMenus.py 12 Aug 2004 19:14:23 -0000 1.10 *************** *** 46,53 **** filename = self.documentPath msg = "The text in the %s file has changed.\n\nDo you want to save the changes?" % filename ! result = dialog.messageDialog(self, msg, 'textEditor', ! dialog.ICON_EXCLAMATION, ! dialog.BUTTON_YES_NO | dialog.BUTTON_CANCEL) ! return result['returned'] def doExit(self): --- 46,51 ---- filename = self.documentPath msg = "The text in the %s file has changed.\n\nDo you want to save the changes?" % filename ! result = dialog.messageDialog(self, msg, 'textEditor', wx.ICON_EXCLAMATION | wx.YES_NO | wx.CANCEL) ! return result.returnedString def doExit(self): *************** *** 55,61 **** save = self.saveChanges() if save == "Cancel": ! return 0 elif save == "No": ! return 1 else: if self.documentPath is None: --- 53,59 ---- save = self.saveChanges() if save == "Cancel": ! return False elif save == "No": ! return True else: if self.documentPath is None: *************** *** 63,67 **** else: self.saveFile(self.documentPath) ! return 1 else: return 1 --- 61,65 ---- else: self.saveFile(self.documentPath) ! return True else: return 1 *************** *** 90,99 **** filename = os.path.basename(self.documentPath) result = dialog.saveFileDialog(None, "Save As", dir, filename, wildcard) ! if result['accepted']: ! path = result['paths'][0] self.saveFile(path) ! return 1 else: ! return 0 def newFile(self): --- 88,97 ---- filename = os.path.basename(self.documentPath) result = dialog.saveFileDialog(None, "Save As", dir, filename, wildcard) ! if result.accepted: ! path = result.paths[0] self.saveFile(path) ! return True else: ! return False def newFile(self): *************** *** 132,136 **** # f.close() self.documentPath = path ! self.documentChanged = 0 self.title = os.path.split(path)[-1] + ' - ' + self.startTitle self.statusBar.text = path --- 130,134 ---- # f.close() self.documentPath = path ! self.documentChanged = False self.title = os.path.split(path)[-1] + ' - ' + self.startTitle self.statusBar.text = path *************** *** 180,185 **** wildcard = "Text files (*.txt)|*.txt;*.TXT|All files (*.*)|*.*" result = dialog.openFileDialog(wildcard=wildcard) ! if result['accepted']: ! path = result['paths'][0] # an error will probably occur here if the text is too large # to fit in the wxTextCtrl (TextArea) or the file is actually --- 178,183 ---- wildcard = "Text files (*.txt)|*.txt;*.TXT|All files (*.*)|*.*" result = dialog.openFileDialog(wildcard=wildcard) ! if result.accepted: ! path = result.paths[0] # an error will probably occur here if the text is too large # to fit in the wxTextCtrl (TextArea) or the file is actually |
From: Kevin A. <ka...@us...> - 2004-08-12 19:14:33
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15782/resourceEditor/modules Modified Files: backgroundInfoDialog.py propertyEditor.py stackInfoDialog.py Log Message: getCommandLineArgs moved to util.py runOptionsDialog moved to templates.dialogs.runOptionsDialog.py dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: backgroundInfoDialog.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/backgroundInfoDialog.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** backgroundInfoDialog.py 15 Apr 2004 23:59:30 -0000 1.12 --- backgroundInfoDialog.py 12 Aug 2004 19:14:23 -0000 1.13 *************** *** 37,52 **** def on_btnForegroundColor_mouseClick(self, event): result = dialog.colorDialog(self) ! if result['accepted']: ! self.components.fldForegroundColor.text = str(result['color']) def on_btnBackgroundColor_mouseClick(self, event): result = dialog.colorDialog(self) ! if result['accepted']: ! self.components.fldBackgroundColor.text = str(result['color']) def on_btnFile_mouseClick(self, event): result = dialog.openFileDialog() ! if result['accepted']: ! path = result['paths'][0] filename = os.path.split(path)[-1] self.components.fldImage.text = filename --- 37,52 ---- def on_btnForegroundColor_mouseClick(self, event): result = dialog.colorDialog(self) ! if result.accepted: ! self.components.fldForegroundColor.text = str(result.color) def on_btnBackgroundColor_mouseClick(self, event): result = dialog.colorDialog(self) ! if result.accepted: ! self.components.fldBackgroundColor.text = str(result.color) def on_btnFile_mouseClick(self, event): result = dialog.openFileDialog() ! if result.accepted: ! path = result.paths[0] filename = os.path.split(path)[-1] self.components.fldImage.text = filename *************** *** 55,60 **** wildcard = "Icon Files (*.ico)|*.ico|XPM Files (*.xpm)|*.xpm|All Files (*.*)|*.*" result = dialog.openFileDialog(wildcard=wildcard) ! if result['accepted']: ! path = result['paths'][0] filename = os.path.split(path)[-1] self.components.fldIcon.text = filename --- 55,60 ---- wildcard = "Icon Files (*.ico)|*.ico|XPM Files (*.xpm)|*.xpm|All Files (*.*)|*.*" result = dialog.openFileDialog(wildcard=wildcard) ! if result.accepted: ! path = result.paths[0] filename = os.path.split(path)[-1] self.components.fldIcon.text = filename Index: stackInfoDialog.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/stackInfoDialog.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** stackInfoDialog.py 10 May 2004 05:02:50 -0000 1.8 --- stackInfoDialog.py 12 Aug 2004 19:14:23 -0000 1.9 *************** *** 17,18 **** --- 17,24 ---- self.components.fldName.text = rsrc.application.name + def stackInfoDialog(parent): + dlg = StackInfoDialog(parent, parent.rsrc) + result = dlg.showModal() + result.text = dlg.components.fldName.text + dlg.destroy() + return result Index: propertyEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/propertyEditor.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** propertyEditor.py 11 Aug 2004 01:58:03 -0000 1.48 --- propertyEditor.py 12 Aug 2004 19:14:23 -0000 1.49 *************** *** 270,275 **** def on_wColor_mouseClick(self, event): result = dialog.colorDialog(self) ! if result['accepted']: ! self.components.wField.text = str(result['color']) def on_wFont_mouseClick(self, event): --- 270,275 ---- def on_wColor_mouseClick(self, event): result = dialog.colorDialog(self) ! if result.accepted: ! self.components.wField.text = str(result.color) def on_wFont_mouseClick(self, event): *************** *** 282,288 **** f = font.Font(desc) result = dialog.fontDialog(self, f) ! if result['accepted']: #color = dlg.getColor() ! f = result['font'] #self.components.wField.SetValue("%s;%s" % (f, color)) self.components.wField.text = "%s" % f --- 282,288 ---- f = font.Font(desc) result = dialog.fontDialog(self, f) ! if result.accepted: #color = dlg.getColor() ! f = result.font #self.components.wField.SetValue("%s;%s" % (f, color)) self.components.wField.text = "%s" % f |
From: Kevin A. <ka...@us...> - 2004-08-12 19:12:55
|
Update of /cvsroot/pythoncard/PythonCard/templates/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15583/dialogs Modified Files: findDialog.py loginDialog.py Added Files: runOptionsDialog.py runOptionsDialog.rsrc.py Log Message: runOptionsDialog moved to templates.dialogs.runOptionsDialog.py dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: loginDialog.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/templates/dialogs/loginDialog.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** loginDialog.py 27 Apr 2004 23:07:56 -0000 1.1 --- loginDialog.py 12 Aug 2004 19:12:39 -0000 1.2 *************** *** 19,28 **** def loginDialog(parent, host="127.0.0.1", port=80, username="guest", password="guest"): dlg = LoginDialog(parent, host, port, username, password) ! dlg.showModal() ! result = {'accepted':dlg.accepted()} ! result['host'] = dlg.components.fldHost.text ! result['port'] = int(dlg.components.fldPort.text) ! result['username'] = dlg.components.fldUsername.text ! result['password'] = dlg.components.fldPassword.text dlg.destroy() return result --- 19,27 ---- def loginDialog(parent, host="127.0.0.1", port=80, username="guest", password="guest"): dlg = LoginDialog(parent, host, port, username, password) ! result = dlg.showModal() ! result.host = dlg.components.fldHost.text ! result.port = int(dlg.components.fldPort.text) ! result.username = dlg.components.fldUsername.text ! result.password = dlg.components.fldPassword.text dlg.destroy() return result --- NEW FILE: runOptionsDialog.py --- """ __version__ = "$Revision: 1.1 $" __date__ = "$Date: 2004/08/12 19:12:39 $" """ from PythonCard import model import os import wx class RunOptionsDialog(model.CustomDialog): def __init__(self, aBg, cmdLineArgs): model.CustomDialog.__init__(self, aBg) self.parent = aBg self.components.chkDebugMenu.checked = cmdLineArgs['debugmenu'] self.components.chkLogging.checked = cmdLineArgs['logging'] self.components.chkMessageWatcher.checked = cmdLineArgs['messagewatcher'] self.components.chkNamespaceViewer.checked = cmdLineArgs['namespaceviewer'] self.components.chkPropertyEditor.checked = cmdLineArgs['propertyeditor'] self.components.chkShell.checked = cmdLineArgs['shell'] self.components.fldOtherArgs.text = cmdLineArgs['otherargs'] self.initSizers() def initSizers(self): sizer1 = wx.BoxSizer(wx.VERTICAL) sizer2 = wx.BoxSizer(wx.VERTICAL) sizer3 = wx.BoxSizer(wx.HORIZONTAL) sizer4 = wx.BoxSizer(wx.HORIZONTAL) comp = self.components btnFlags = wx.LEFT | wx.ALIGN_BOTTOM vertFlags = wx.LEFT | wx.TOP | wx.ALIGN_LEFT fldFlags = wx.LEFT | wx.TOP | wx.ALIGN_CENTER sizer4.Add(comp.stcOtherArgs, 0, fldFlags, 5) sizer4.Add(comp.fldOtherArgs, 1, fldFlags, 5) sizer3.Add(comp.btnOK, 0, btnFlags, 5) sizer3.Add(comp.btnCancel, 0, btnFlags, 5) sizer2.Add(comp.stcCmdLineArgs, 0, wx.LEFT | wx.BOTTOM | wx.ALIGN_TOP, 5) sizer2.Add(comp.chkDebugMenu, 0, vertFlags, 5) sizer2.Add(comp.chkLogging, 0, vertFlags, 5) sizer2.Add(comp.chkMessageWatcher, 0, vertFlags, 5) sizer2.Add(comp.chkNamespaceViewer, 0, vertFlags, 5) sizer2.Add(comp.chkPropertyEditor, 0, vertFlags, 5) sizer2.Add(comp.chkShell, 0, vertFlags, 5) sizer2.Add(sizer4, 0, vertFlags) sizer2.Add((5, 5), 1) # spacer sizer2.Add(sizer3, 1, wx.ALIGN_BOTTOM) sizer1.Add(sizer2, 0, vertFlags) sizer1.Fit(self) sizer1.SetSizeHints(self) self.panel.SetSizer(sizer1) self.panel.SetAutoLayout(1) self.panel.Layout() def runOptionsDialog(parent, cmdLineArgs): dlg = RunOptionsDialog(parent, cmdLineArgs) result = dlg.showModal() if result.accepted: result.debugmenu = dlg.components.chkDebugMenu.checked result.logging = dlg.components.chkLogging.checked result.messagewatcher= dlg.components.chkMessageWatcher.checked result.namespaceviewer = dlg.components.chkNamespaceViewer.checked result.propertyeditor = dlg.components.chkPropertyEditor.checked result.shell = dlg.components.chkShell.checked result.otherargs = dlg.components.fldOtherArgs.text dlg.destroy() return result --- NEW FILE: runOptionsDialog.rsrc.py --- {'type':'CustomDialog', 'name':'runOptions', 'title':'Run Options', 'size':(200, 220), 'components': [ {'type':'StaticText', 'name':'stcCmdLineArgs', 'position':(10, 5), 'text':'Command line options:', }, {'type':'CheckBox', 'name':'chkDebugMenu', 'position':(10, 25), 'label':'Debug Menu (-d)', }, {'type':'CheckBox', 'name':'chkLogging', 'position':(10, 25), 'label':'Logging (-l)', }, {'type':'CheckBox', 'name':'chkMessageWatcher', 'position':(10, 50), 'label':'Message Watcher (-m)', }, {'type':'CheckBox', 'name':'chkNamespaceViewer', 'position':(10, 75), 'label':'Namespace Viewer (-n)', }, {'type':'CheckBox', 'name':'chkPropertyEditor', 'position':(10, 100), 'label':'Property Editor (-p)', }, {'type':'CheckBox', 'name':'chkShell', 'position':(10, 120), 'label':'Shell (-s)', }, {'type':'StaticText', 'name':'stcOtherArgs', 'text':'Other args:', }, {'type':'TextField', 'name':'fldOtherArgs', 'size':(200, -1), 'text':'', }, {'type':'Button', 'name':'btnOK', 'position':(8, 152), 'default':1, 'id':5100, 'label':'OK', }, {'type':'Button', 'name':'btnCancel', 'position':(105, 152), 'id':5101, 'label':'Cancel', }, ] # end components } Index: findDialog.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/templates/dialogs/findDialog.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** findDialog.py 22 Apr 2004 15:34:08 -0000 1.1 --- findDialog.py 12 Aug 2004 19:12:39 -0000 1.2 *************** *** 35,48 **** dlg = FindDialog(parent, searchText, wholeWordsOnly, caseSensitive, searchField, searchableFields) ! dlg.showModal() ! result = {'accepted':dlg.accepted()} ! result['searchText'] = dlg.components.fldFind.text ! result['wholeWordsOnly'] = dlg.components.chkMatchWholeWordOnly.checked ! result['caseSensitive'] = dlg.components.chkMatchCase.checked sel = dlg.components.popSearchField.stringSelection if searchableFields is None or sel == 'All': ! result['searchField'] = None else: ! result['searchField'] = sel dlg.destroy() return result --- 35,47 ---- dlg = FindDialog(parent, searchText, wholeWordsOnly, caseSensitive, searchField, searchableFields) ! result = dlg.showModal() ! result.searchText= dlg.components.fldFind.text ! result.wholeWordsOnly = dlg.components.chkMatchWholeWordOnly.checked ! result.caseSensitive = dlg.components.chkMatchCase.checked sel = dlg.components.popSearchField.stringSelection if searchableFields is None or sel == 'All': ! result.searchField = None else: ! result.searchField = sel dlg.destroy() return result |
From: Kevin A. <ka...@us...> - 2004-08-12 19:11:22
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15301 Modified Files: model.py debug.py dialog.py Log Message: dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: debug.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/debug.py,v retrieving revision 1.131 retrieving revision 1.132 diff -C2 -d -r1.131 -r1.132 *** debug.py 14 May 2004 19:23:11 -0000 1.131 --- debug.py 12 Aug 2004 19:11:13 -0000 1.132 *************** *** 334,339 **** def onSelectColor(self, evt): result = dialog.colorDialog(self) ! if result['accepted']: ! self.wField.SetValue(str(result['color'])) def onSelectFont(self, evt): --- 334,339 ---- def onSelectColor(self, evt): result = dialog.colorDialog(self) ! if result.accepted: ! self.wField.SetValue(str(result.color)) def onSelectFont(self, evt): *************** *** 345,351 **** f = font.Font(desc) result = dialog.fontDialog(self, f) ! if result['accepted']: #color = dlg.getColor() ! f = result['font'] self.wField.SetValue("%s" % f) --- 345,351 ---- f = font.Font(desc) result = dialog.fontDialog(self, f) ! if result.accepted: #color = dlg.getColor() ! f = result.font self.wField.SetValue("%s" % f) Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.179 retrieving revision 1.180 diff -C2 -d -r1.179 -r1.180 *** model.py 9 Aug 2004 17:22:44 -0000 1.179 --- model.py 12 Aug 2004 19:11:13 -0000 1.180 *************** *** 48,51 **** --- 48,52 ---- import component import util + import dialog import types *************** *** 1188,1214 **** self._initLayout( aDialogRsrc.components ) ! # KEA 2001-10-14 ! # this is from ModalDialog in dialog.py ! def showModal(self): ! self._accepted = False ! self._returned = self.ShowModal() ! if self._returned == wx.ID_OK or self._returned == wx.ID_YES: ! self._accepted = True ! ! # KEA should these be getAccepted, getReturned? ! def accepted( self ) : ! return self._accepted ! ! # KEA added accessor for self._returned ! # should we just return numeric values instead? ! # should the the strings all be lowercase ! # Ok is actually displayed as OK in dialogs ! def returned( self ) : ! ret = self._returned for w in self.components.itervalues(): ! if ret == w.GetId(): return w.label ! def destroy( self ) : self.Destroy() --- 1189,1204 ---- self._initLayout( aDialogRsrc.components ) ! # this allows the labels to be something other than Ok, Cancel, No, etc. ! def _returnedString(self, returned): for w in self.components.itervalues(): ! if returned == w.GetId(): return w.label ! def showModal(self): ! result = dialog.DialogResults(self.ShowModal()) ! result.returnedString = self._returnedString(result.returned) ! return result ! ! def destroy(self): self.Destroy() Index: dialog.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/dialog.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** dialog.py 21 Jul 2004 19:16:43 -0000 1.33 --- dialog.py 12 Aug 2004 19:11:13 -0000 1.34 *************** *** 9,448 **** import font - ICON_EXCLAMATION = wx.ICON_EXCLAMATION # Shows an exclamation mark icon. - ICON_HAND = wx.ICON_HAND # Shows an error icon. - ICON_ERROR = wx.ICON_ERROR # Shows an error icon - the same as wxICON_HAND. - ICON_QUESTION = wx.ICON_QUESTION # Shows a question mark icon. - ICON_INFORMATION = wx.ICON_INFORMATION # Shows an information (i) icon. - - BUTTON_OK = wx.OK # Show an OK button. - BUTTON_CANCEL = wx.CANCEL # Show a Cancel button. - BUTTON_YES_NO = wx.YES_NO # Show Yes and No buttons. - BUTTON_YES_DEFAULT = wx.YES_DEFAULT # Used with wxYES_NO, makes Yes button the default - which is the default behaviour. - BUTTON_NO_DEFAULT = wx.NO_DEFAULT # Used with wxYES_NO, makes No button the default. - - RETURNED_OK = wx.ID_OK - RETURNED_CANCEL = wx.ID_CANCEL - RETURNED_YES = wx.ID_YES - RETURNED_NO = wx.ID_NO - - FILE_OPEN = wx.OPEN # This is an open dialog. - FILE_SAVE = wx.SAVE # This is a save dialog. - FILE_HIDE_READONLY = wx.HIDE_READONLY # Hide read-only files. - # For save dialog only: prompt for a confirmation if a file will be overwritten. - FILE_OVERWRITE_PROMPT = wx.OVERWRITE_PROMPT - # For open dialog only: allows selecting multiple files. - FILE_MULTIPLE = wx.MULTIPLE - # Change the current working directory to the directory where the file(s) chosen by the user are. - FILE_CHANGE_DIR = wx.CHANGE_DIR - - # For dir dialog only: allow creation of new directories - DIR_NEWDIR_BUTTON = wx.DD_NEW_DIR_BUTTON - - TEXT_MULTILINE = wx.TE_MULTILINE - TEXT_PASSWORD = wx.TE_PASSWORD - - class ModalDialog : - - def __init__( self, aParent ) : - self._parent = aParent - self._accepted = 0 - self._returned = 0 - self._dialog = None - - #def _getParent( self ) : - # return self._parent - - def _setDialog( self, aWxDialog ) : - self._dialog = aWxDialog - - def _getDialog( self ) : - return self._dialog - - # KEA I don't think we need this - def _setAccepted( self, aBoolean ) : - self._accepted = aBoolean - - def _showModal( self ) : - # KEA added wxID_YES to accepted condition - # and added a returned value - self._returned = self._dialog.ShowModal() - if self._returned == wx.ID_OK or self._returned == wx.ID_YES : - self._accepted = 1 - # KEA don't destroy until after we get the results - # so self._destroy() added to each dialog class below - #self._destroy() - self.result = {'accepted':self._accepted, 'returned':self.returned()} - - # KEA should these be getAccepted, getReturned? - def accepted( self ) : - return self._accepted - - # KEA added accessor for self._returned - # should we just return numeric values instead? - # should the the strings all be lowercase - # Ok is actually displayed as OK in dialogs - def returned( self ) : - ret = self._returned - if ret == RETURNED_OK: - return "Ok" - elif ret == RETURNED_CANCEL: - return "Cancel" - elif ret == RETURNED_YES: - return "Yes" - elif ret == RETURNED_NO: - return "No" - - def _destroy( self ) : - self._dialog.Destroy() ! class FindDialog(ModalDialog): ! ! def __init__(self, aParent, searchText='', wholeWordsOnly=0, caseSensitive=0): ! ModalDialog.__init__( self, aParent ) ! ! dlg = wx.Dialog(aParent, -1, "Find", wx.DefaultPosition, wx.Size(370, 120)) ! ! wx.StaticText(dlg, -1, 'Find what:', wx.Point(7, 10)) ! wSearchText = wx.TextCtrl(dlg, -1, searchText, ! wx.Point(70, 7), wx.Size(195, -1)) ! wSearchText.SetValue(searchText) ! wx.Button(dlg, wx.ID_OK, "Find Next", wx.Point(280, 5), wx.DefaultSize).SetDefault() ! wx.Button(dlg, wx.ID_CANCEL, "Cancel", wx.Point(280, 35), wx.DefaultSize) ! wWholeWord = wx.CheckBox(dlg, -1, 'Match whole word only', ! wx.Point(7, 35), wx.DefaultSize, wx.NO_BORDER) ! if wholeWordsOnly: ! wWholeWord.SetValue(1) ! wCase = wx.CheckBox(dlg, -1, 'Match case', ! wx.Point(7, 55), wx.DefaultSize, wx.NO_BORDER) ! if caseSensitive: ! wCase.SetValue(1) ! wSearchText.SetSelection(0, len(wSearchText.GetValue())) ! wSearchText.SetFocus() ! ! self._setDialog( dlg ) ! self._showModal() ! self._text = wSearchText.GetValue() ! self._wholeWord = wWholeWord.GetValue() ! self._caseSensitive = wCase.GetValue() ! self._destroy() ! self.result['text'] = self._text ! self.result['wholeword'] = self._wholeWord ! self.result['casesensitive'] = self._caseSensitive ! ! def getText( self ) : ! return self._text ! ! def getWholeWord( self ) : ! return self._wholeWord ! ! def getCaseSensitive( self ) : ! return self._caseSensitive ! ! def findDialog(parent, searchText='', wholeWordsOnly=0, caseSensitive=0): ! dialog = FindDialog(parent, searchText, wholeWordsOnly, caseSensitive) ! result = {'accepted':dialog.accepted(), ! 'searchText': dialog.getText(), ! 'wholeWordsOnly': dialog.getWholeWord(), ! 'caseSensitive': dialog.getCaseSensitive()} ! return result ! ! ! class ColorDialog( ModalDialog ) : ! ! def __init__( self, aParent ) : ! self._color = None ! ModalDialog.__init__( self, aParent ) ! dialog = wx.ColourDialog( self._parent ) # add color data support later ! dialog.GetColourData().SetChooseFull(1) ! self._setDialog( dialog ) ! self._showModal() ! # KEA why does this work? the dialog should already be destroyed ! # by _showModal() ! self._colorData = dialog.GetColourData() ! self._color = self._colorData.GetColour().Get() ! self._destroy() ! self.result['color'] = self._color ! ! def getColor( self ) : ! return self._color ! ! # should we just return numeric values instead? ! # should the the strings all be lowercase ! # Ok is actually displayed as OK in dialogs ! def returnedString(ret): ! if ret == RETURNED_OK: ! return "Ok" ! elif ret == RETURNED_CANCEL: ! return "Cancel" ! elif ret == RETURNED_YES: ! return "Yes" ! elif ret == RETURNED_NO: ! return "No" ! ! def colorDialog(parent): ! dialog = wx.ColourDialog(parent) ! dialog.GetColourData().SetChooseFull(1) ! returned = dialog.ShowModal() ! if returned == wx.ID_OK or returned == wx.ID_YES: ! accepted = 1 ! else: ! accepted = 0 ! colorData = dialog.GetColourData() ! color = colorData.GetColour().Get() ! dialog.Destroy() ! return {'accepted':accepted, 'returned':returnedString(returned), 'color':color} ! ! # do not rely on the return value of getFont ! # I just added this today 2001-07-28 and haven't ! # done enough with fonts to know what I need to use and ignore ! class FontDialog( ModalDialog ) : ! ! def __init__( self, aParent, aFont=None) : ! self._color = None ! self._font = None ! self._fontDescription = None ! ModalDialog.__init__( self, aParent ) ! # RDS: You have to pass a wxFontData instance below, ! # None causes a seg fault. ! aFontData = wx.FontData() ! # 2004-07-21 ! # Mac needs the color set ! aFontData.SetColour(wx.BLACK) ! if aFont is not None: ! aFontData.SetInitialFont(aFont._getFont()) ! ! dialog = wx.FontDialog( self._parent, aFontData ) # add font data support later ! self._setDialog( dialog ) ! self._showModal() ! # KEA why does this work? the dialog should already be destroyed ! # by _showModal() ! if self.accepted(): ! fontData = dialog.GetFontData() ! self._color = fontData.GetColour().Get() ! fontWx = fontData.GetChosenFont() ! self._fontDescription = font.fontDescription(fontWx) ! self._font = font.Font(self._fontDescription) ! #self._font = (font.GetFamily(), font.GetFaceName(), font.GetPointSize(), font.GetStyle()) ! #self._font = (font.GetFaceName(), font.GetPointSize()) ! self._destroy() ! self.result['color'] = self._color ! self.result['font'] = self._font ! def getColor( self ) : ! return self._color ! def getFont( self ) : ! return self._font def fontDialog(parent, aFont=None): ! return FontDialog(parent, aFont).result ! ! class TextEntryDialog( ModalDialog ) : ! ! def __init__( self, aParent, aWindowTitle, aMessage, aDefaultText, aStyle=0 ) : ! self._text = None ! ModalDialog.__init__( self, aParent ) ! dialog = wx.TextEntryDialog( self._parent, ! aMessage, ! aWindowTitle, ! aDefaultText, ! aStyle | wx.OK | wx.CANCEL ) ! self._setDialog( dialog ) ! self._showModal() ! # KEA why does this work? the dialog should already be destroyed ! # by _showModal() ! self._text = dialog.GetValue() ! self._destroy() ! self.result['text'] = self._text ! ! def getText( self ) : ! return self._text ! ! def textEntryDialog(aParent, aWindowTitle, aMessage, aDefaultText, aStyle=0): ! return TextEntryDialog(aParent, aWindowTitle, aMessage, aDefaultText, aStyle).result ! ! ! class MessageDialog( ModalDialog ) : ! ! def __init__( self, aParent, aMessage, aTitle, ! aIcon = ICON_INFORMATION, ! aButtons = BUTTON_OK | BUTTON_CANCEL) : ! ModalDialog.__init__( self, aParent ) ! dialog = wx.MessageDialog(self._parent, ! aMessage, ! aTitle, ! aIcon | aButtons ) ! self._setDialog( dialog ) ! self._showModal() ! self._destroy() ! ! def messageDialog(aParent, aMessage, aTitle, ! aIcon = ICON_INFORMATION, ! aButtons = BUTTON_OK | BUTTON_CANCEL): ! return MessageDialog(aParent, aMessage, aTitle, aIcon, aButtons).result ! ! ! # KEA this class should go away ! # it does the exact same thing as the default for MessageDialog ! """ ! class ConfirmationDialog( ModalDialog ) : ! ! def __init__( self, aParent, aMessage, aTitle ) : ! ModalDialog.__init__( self, aParent ) ! dialog = wxMessageDialog( self._parent, ! aMessage, ! aTitle, ! ICON_INFORMATION | BUTTON_OK | BUTTON_CANCEL ) ! self._setDialog( dialog ) ! self._showModal() ! """ ! ! # KEA alerts are common, so providing a class rather than requiring the user code ! # to set up the right icons and buttons with MessageDialog ! class AlertDialog(MessageDialog) : ! def __init__(self, aParent, aMessage, aTitle) : ! MessageDialog.__init__(self, aParent, aMessage, aTitle, ICON_EXCLAMATION, BUTTON_OK) ! ! def alertDialog(aParent, aMessage, aTitle): ! return AlertDialog(aParent, aMessage, aTitle).result ! ! class ScrolledMessageDialog( ModalDialog ) : ! ! def __init__( self, aParent, aMessage, aTitle ) : ! ModalDialog.__init__( self, aParent ) ! dialog = dialogs.ScrolledMessageDialog( self._parent, ! aMessage, ! aTitle) ! self._setDialog( dialog ) ! self._showModal() ! self._destroy() ! ! def scrolledMessageDialog(aParent, aMessage, aTitle): ! return ScrolledMessageDialog(aParent, aMessage, aTitle).result ! ! ! class FileDialog( ModalDialog ) : ! ! def __init__(self, aParent, aMessage, aPath, aFileName, aFilter, ! aStyle=FILE_OPEN | FILE_MULTIPLE): ! ModalDialog.__init__( self, aParent ) ! self._message = aMessage ! self._path = aPath ! self._fileName = aFileName ! self._filter = aFilter ! self._value = None ! self._paths = None ! ! dialog = wx.FileDialog( self._parent, ! aMessage, ! aPath, ! aFileName, ! aFilter, ! aStyle ) ! ! self._setDialog( dialog ) ! ! # KEA changed to self, was: ! # ModalDialog._showModal( self ) ! self._showModal() ! ! if self.accepted() : ! self._paths = self._dialog.GetPaths() ! self._destroy() ! self.result['paths'] = self._paths ! ! def getPaths( self ) : ! return self._paths ! ! def fileDialog(aParent, aMessage, aPath, aFileName, aFilter, aStyle=FILE_OPEN | FILE_MULTIPLE): ! return FileDialog(aParent, aMessage, aPath, aFileName, aFilter, aStyle).result ! ! def openFileDialog(parent=None, title='Open', directory='', filename='', wildcard='All Files (*.*)|*.*', style=FILE_OPEN | FILE_MULTIPLE): ! return FileDialog(parent, title, directory, filename, wildcard, style).result ! ! def saveFileDialog(parent=None, title='Save', directory='', filename='', wildcard='All Files (*.*)|*.*', style=FILE_SAVE | FILE_HIDE_READONLY | FILE_OVERWRITE_PROMPT): ! return FileDialog(parent, title, directory, filename, wildcard, style).result ! ! class DirectoryDialog( ModalDialog ) : ! ! def __init__( self, aParent, aMessage, aPath, aStyle=DIR_NEWDIR_BUTTON ) : ! ModalDialog.__init__( self, aParent ) ! self._message = aMessage ! self._path = aPath ! self._value = None ! self._setDialog( wx.DirDialog( self._parent, aMessage, aPath, aStyle ) ) ! ! if self._message is not None : ! self._dialog.SetMessage( self._message ) ! ! if self._path is not None : ! self._dialog.SetPath( self._path ) ! ! # KEA changed to self, was: ! # ModalDialog._showModal( self ) ! self._showModal() ! ! if self.accepted() : ! self._value = self._dialog.GetPath() ! self._destroy() ! self.result['path'] = self._value ! ! def getPath( self ) : ! return self._value ! ! def directoryDialog(aParent, aMessage, aPath, aStyle=DIR_NEWDIR_BUTTON): ! return DirectoryDialog(aParent, aMessage, aPath, aStyle).result ! ! ! class SingleChoiceDialog( ModalDialog ) : ! ! def __init__( self, aParent, aWindowTitle, aMessage, aList, ! aStyle=wx.OK | wx.CANCEL | wx.CENTRE) : ! self._text = None ! ModalDialog.__init__( self, aParent ) ! # KEA 2003-07-30 ! # added wx.DEFAULT_DIALOG_STYLE below ! # to workaround wxPython 2.4.1.2 bug ! dialog = wx.SingleChoiceDialog( self._parent, ! aMessage, ! aWindowTitle, ! aList, ! style=aStyle | wx.DEFAULT_DIALOG_STYLE ) ! self._setDialog( dialog ) ! self._showModal() ! # KEA why does this work? the dialog should already be destroyed ! # by _showModal() ! self._text = dialog.GetStringSelection() ! self._destroy() ! self.result['selection'] = self._text ! ! def getSelection( self ) : ! return self._text ! ! def singleChoiceDialog(aParent, aWindowTitle, aMessage, aList, ! aStyle=wx.OK | wx.CANCEL | wx.CENTRE): ! return SingleChoiceDialog(aParent, aWindowTitle, aMessage, aList, aStyle).result ! ! class MultipleChoiceDialog( ModalDialog ) : ! ! def __init__( self, aParent, aWindowTitle, aMessage, aList) : ! self._list = None ! ModalDialog.__init__( self, aParent ) ! dialog = dialogs.MultipleChoiceDialog( self._parent, ! aMessage, ! aWindowTitle, ! aList) ! self._setDialog( dialog ) ! self._showModal() ! # KEA why does this work? the dialog should already be destroyed ! # by _showModal() ! self._list = dialog.GetValueString() ! self._destroy() ! self.result['selection'] = self._list ! ! def getSelection( self ) : ! return self._list - def multipleChoiceDialog(aParent, aWindowTitle, aMessage, aList): - return MultipleChoiceDialog(aParent, aWindowTitle, aMessage, aList).result --- 9,39 ---- import font ! DialogResults = dialogs.DialogResults ! findDialog = dialogs.findDialog ! colorDialog = dialogs.colorDialog def fontDialog(parent, aFont=None): ! result = dialogs.fontDialog(aFont) ! if result.accepted: ! fontData = result.fontData ! result.color = result.fontData.GetColour().Get() ! fontWx = result.fontData.GetChosenFont() ! result.fontDescription = font.fontDescription(fontWx) ! fontWx = None ! result.font = font.Font(result.fontDescription) ! return result ! textEntryDialog = dialogs.textEntryDialog ! messageDialog = dialogs.messageDialog ! alertDialog = dialogs.alertDialog ! scrolledMessageDialog = dialogs.scrolledMessageDialog ! fileDialog = dialogs.fileDialog ! openFileDialog = dialogs.openFileDialog ! saveFileDialog = dialogs.saveFileDialog ! directoryDialog = dialogs.directoryDialog ! singleChoiceDialog = dialogs.singleChoiceDialog ! multipleChoiceDialog = dialogs.multipleChoiceDialog |
From: Kevin A. <ka...@us...> - 2004-08-12 19:10:44
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15013/docs Modified Files: changelog.txt Log Message: getCommandLineArgs moved to util.py runOptionsDialog moved to templates.dialogs.runOptionsDialog.py dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.298 retrieving revision 1.299 diff -C2 -d -r1.298 -r1.299 *** changelog.txt 10 Aug 2004 23:41:00 -0000 1.298 --- changelog.txt 12 Aug 2004 19:10:03 -0000 1.299 *************** *** 3,6 **** --- 3,12 ---- Release 0.8 2004-08-?? + getCommandLineArgs moved to util.py + runOptionsDialog moved to templates.dialogs.runOptionsDialog.py + dialog.py is now a thin wrapper around wx.lib.dialogs.py + all dialog results now use DialogResults class instead of dictionary + e.g. result.accepted instead of result['accepted'] + see dialogs sample and other samples and tools for examples of change menuDialog changed to insert in place, added default naming based on label changed Calendar component to CAL_SEQUENTIAL_MONTH_SELECTION style |
From: Kevin A. <ka...@us...> - 2004-08-12 19:10:18
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15013 Modified Files: util.py Log Message: getCommandLineArgs moved to util.py runOptionsDialog moved to templates.dialogs.runOptionsDialog.py dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: util.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/util.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** util.py 28 Jul 2004 07:11:33 -0000 1.26 --- util.py 12 Aug 2004 19:10:04 -0000 1.27 *************** *** 257,260 **** --- 257,278 ---- # currently it is only used by the slideshow sample + def getCommandLineArgs(cmdLineArgs): + args = [] + if cmdLineArgs['otherargs'] != '': + args.append(cmdLineArgs['otherargs']) + if cmdLineArgs['debugmenu']: + args.append('-d') + if cmdLineArgs['logging']: + args.append('-l') + if cmdLineArgs['messagewatcher']: + args.append('-m') + if cmdLineArgs['namespaceviewer']: + args.append('-n') + if cmdLineArgs['propertyeditor']: + args.append('-p') + if cmdLineArgs['shell']: + args.append('-s') + return args + def runScript(filename, args=' ', requireConsole=False, useInterpreter=False): if filename is None: |
From: Kevin A. <ka...@us...> - 2004-08-11 14:08:36
|
Update of /cvsroot/pythoncard/PythonCard/components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv485/components Modified Files: multicolumnlist.py Log Message: fixed columnProperty property typo Index: multicolumnlist.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/components/multicolumnlist.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** multicolumnlist.py 13 May 2004 02:40:24 -0000 1.26 --- multicolumnlist.py 11 Aug 2004 14:08:24 -0000 1.27 *************** *** 520,524 **** items = property(_getItems, _setItems) ! getColumnHeadings = property(_getColumnHeadings, _setColumnHeadings) maxColumns = property(_getMaxColumns, _setMaxColumns) rules = property(_getRules, _setRules) --- 520,524 ---- items = property(_getItems, _setItems) ! columnHeadings = property(_getColumnHeadings, _setColumnHeadings) maxColumns = property(_getMaxColumns, _setMaxColumns) rules = property(_getRules, _setRules) |
From: Kevin A. <ka...@us...> - 2004-08-11 01:58:12
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17941/tools/resourceEditor/modules Modified Files: propertyEditor.py resourceOutput.py Log Message: updated file and size attribute handling to support resourceEditor Index: propertyEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/propertyEditor.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** propertyEditor.py 10 May 2004 17:16:13 -0000 1.47 --- propertyEditor.py 11 Aug 2004 01:58:03 -0000 1.48 *************** *** 10,13 **** --- 10,14 ---- import resourceOutput import time + import os import string *************** *** 253,258 **** #print "attribute change took:", endTime - startTime else: ! setattr(widget, propName, value) ! #print propName, value # KEA 2002-02-23 self._parent.showSizingHandles(wName) --- 254,268 ---- #print "attribute change took:", endTime - startTime else: ! if wClass in ['Image', 'ImageButton'] and propName == 'file': ! cwd = os.getcwd() ! try: ! os.chdir(self._parent.filename) ! except: ! pass ! setattr(widget, propName, value) ! os.chdir(cwd) ! else: ! setattr(widget, propName, value) ! #print propName, value # KEA 2002-02-23 self._parent.showSizingHandles(wName) Index: resourceOutput.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/resourceOutput.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** resourceOutput.py 9 Aug 2004 21:40:47 -0000 1.27 --- resourceOutput.py 11 Aug 2004 01:58:03 -0000 1.28 *************** *** 48,52 **** # try and determine default sizes width, height = aWidget.size ! if aWidget.__class__.__name__ not in ['BitmapCanvas', 'HtmlWindow', 'IEHtmlWindow', 'Gauge']: bestWidth, bestHeight = aWidget.GetBestSize() if bestWidth == width: --- 48,54 ---- # try and determine default sizes width, height = aWidget.size ! if aWidget.__class__.__name__ in imgWidgets: ! width, height = aWidget._size ! elif aWidget.__class__.__name__ not in ['BitmapCanvas', 'HtmlWindow', 'IEHtmlWindow', 'Gauge']: bestWidth, bestHeight = aWidget.GetBestSize() if bestWidth == width: |
From: Kevin A. <ka...@us...> - 2004-08-11 01:58:11
|
Update of /cvsroot/pythoncard/PythonCard/components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17941/components Modified Files: image.py imagebutton.py Log Message: updated file and size attribute handling to support resourceEditor Index: imagebutton.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/components/imagebutton.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** imagebutton.py 19 Jul 2004 17:47:39 -0000 1.18 --- imagebutton.py 11 Aug 2004 01:58:03 -0000 1.19 *************** *** 47,57 **** # is aResource used again later? #print aResource.size ! x = aResource.size[0] ! if x == -2: ! x = self._bitmap.getWidth() ! y = aResource.size[1] ! if y == -2: ! y = self._bitmap.getHeight() ! size = (x, y) # KEA need to check all possible variations on Win32 and Linux --- 47,58 ---- # is aResource used again later? #print aResource.size ! self._size = tuple(aResource.size) ! w = aResource.size[0] ! if w == -2: ! w = self._bitmap.getWidth() ! h = aResource.size[1] ! if h == -2: ! h = self._bitmap.getHeight() ! size = (w, h) # KEA need to check all possible variations on Win32 and Linux Index: image.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/components/image.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** image.py 21 Jul 2004 20:24:08 -0000 1.23 --- image.py 11 Aug 2004 01:58:03 -0000 1.24 *************** *** 39,53 **** _spec = ImageSpec() ! def __init__( self, aParent, aResource ) : self._bitmap = graphic.Bitmap(aResource.file, aResource.size) self._file = aResource.file ! x = aResource.size[0] ! if x == -2: ! x = self._bitmap.getWidth() ! y = aResource.size[1] ! if y == -2: ! y = self._bitmap.getHeight() ! size = (x, y) #size = wx.Size( self._bitmap.GetWidth(), self._bitmap.GetHeight() ) --- 39,54 ---- _spec = ImageSpec() ! def __init__(self, aParent, aResource): self._bitmap = graphic.Bitmap(aResource.file, aResource.size) self._file = aResource.file ! self._size = tuple(aResource.size) ! w = aResource.size[0] ! if w == -2: ! w = self._bitmap.getWidth() ! h = aResource.size[1] ! if h == -2: ! h = self._bitmap.getHeight() ! size = (w, h) #size = wx.Size( self._bitmap.GetWidth(), self._bitmap.GetHeight() ) *************** *** 103,114 **** # KEA special handling for -2 size option ! def _setSize( self, aSize ): ! x = aSize[0] ! if x == -2: ! x = self._bitmap.getWidth() ! y = aSize[1] ! if y == -2: ! y = self._bitmap.getHeight() ! self.SetSize( ( x, y ) ) # KEA 2001-08-02 --- 104,116 ---- # KEA special handling for -2 size option ! def _setSize(self, aSize): ! self._size = tuple(aSize) ! w = aSize[0] ! if w == -2: ! w = self._bitmap.getWidth() ! h = aSize[1] ! if h == -2: ! h = self._bitmap.getHeight() ! self.SetSize((w, h)) # KEA 2001-08-02 |
From: Alex T. <ale...@us...> - 2004-08-10 23:41:10
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28081/tools/resourceEditor/modules Modified Files: menuDialog.py Log Message: NewMenu and NewMenuItem now add "in place" - i.e. below currently selected line. If the name of a new item is left unchanged, then it will be derived from the label value. Index: menuDialog.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/menuDialog.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** menuDialog.py 10 May 2004 05:02:50 -0000 1.14 --- menuDialog.py 10 Aug 2004 23:41:00 -0000 1.15 *************** *** 193,199 **** --- 193,220 ---- def on_fldLabel_loseFocus(self, event): + def normalize(label): + name = label.replace("&", "").replace(".", "").replace(" ", "") + return name + sel = self.components.listMenus.selection try: label = event.target.text + if self.menuList[sel]['type'] == 'Menu' and self.menuList[sel]['label'] == 'New Menu': + oldname = self.menuList[sel]['name'] + if oldname == 'menuNewMenu': + name = 'menu'+normalize(label) + self.menuList[sel]['name'] = name + self.components.fldName.text = name + elif self.menuList[sel]['type'] == 'MenuItem' and self.menuList[sel]['label'] == 'New Item': + oldname = self.menuList[sel]['name'] + menuname = 'menuMenu' + for i in range(sel+1): + if self.menuList[sel-i]['type'] == 'Menu': + menuname = self.menuList[sel-i]['name'] + break + if oldname == menuname+'NewItem': + name = menuname+normalize(label) + self.menuList[sel]['name'] = name + self.components.fldName.text = name self.menuList[sel]['label'] = label if self.menuList[sel]['type'] == 'MenuItem': *************** *** 326,338 **** def on_btnNewMenu_mouseClick(self, event): ! self.menuList.append(self.buildMenu('menuNewMenu', 'New Menu')) ! sel = len(self.menuList) - 1 self.rebuildListMenus(sel) self.displayItemAttributes(sel) def on_btnNewMenuItem_mouseClick(self, event): ! self.menuList.append(self.buildMenuItem('menuNewMenuItem', 'New MenuItem', '', None, 1, 0, 0)) ! sel = len(self.menuList) - 1 self.rebuildListMenus(sel) self.displayItemAttributes(sel) - --- 347,375 ---- def on_btnNewMenu_mouseClick(self, event): ! sel = self.components.listMenus.selection ! self.menuList.append(" ") # extend list ! if sel == -1: ! sel = len(self.menuList) - 1 ! else: ! self.menuList[sel+1:] = self.menuList[sel:-1] ! sel = sel+1 ! self.menuList[sel] = self.buildMenu('menuNewMenu', 'New Menu') self.rebuildListMenus(sel) self.displayItemAttributes(sel) def on_btnNewMenuItem_mouseClick(self, event): ! sel = self.components.listMenus.selection ! self.menuList.append(" ") # extend list ! if sel == -1: ! sel = len(self.menuList) - 1 ! else: ! self.menuList[sel+1:] = self.menuList[sel:-1] ! sel = sel+1 ! name = 'menuMenu' ! for i in range(1, sel+1): ! if self.menuList[sel-i]['type'] == 'Menu': ! name = self.menuList[sel-i]['name'] ! break ! self.menuList[sel] = self.buildMenuItem(name+'NewItem', 'New Item', '', None, 1, 0, 0) self.rebuildListMenus(sel) self.displayItemAttributes(sel) |
From: Alex T. <ale...@us...> - 2004-08-10 23:41:09
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28081/docs Modified Files: changelog.txt Log Message: NewMenu and NewMenuItem now add "in place" - i.e. below currently selected line. If the name of a new item is left unchanged, then it will be derived from the label value. Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.297 retrieving revision 1.298 diff -C2 -d -r1.297 -r1.298 *** changelog.txt 10 Aug 2004 22:34:58 -0000 1.297 --- changelog.txt 10 Aug 2004 23:41:00 -0000 1.298 *************** *** 3,6 **** --- 3,7 ---- Release 0.8 2004-08-?? + menuDialog changed to insert in place, added default naming based on label changed Calendar component to CAL_SEQUENTIAL_MONTH_SELECTION style added mp3player sample |
From: Kevin A. <ka...@us...> - 2004-08-10 22:35:09
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16787/docs Modified Files: changelog.txt Log Message: removed Alex's test Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.296 retrieving revision 1.297 diff -C2 -d -r1.296 -r1.297 *** changelog.txt 10 Aug 2004 22:32:51 -0000 1.296 --- changelog.txt 10 Aug 2004 22:34:58 -0000 1.297 *************** *** 1,5 **** Changelog for PythonCard - Test AGT Release 0.8 2004-08-?? --- 1,4 ---- |
From: Alex T. <ale...@us...> - 2004-08-10 22:33:01
|
Update of /cvsroot/pythoncard/PythonCard/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16287 Modified Files: changelog.txt Log Message: Testing for commit access. AGT. Index: changelog.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/docs/changelog.txt,v retrieving revision 1.295 retrieving revision 1.296 diff -C2 -d -r1.295 -r1.296 *** changelog.txt 8 Aug 2004 15:30:33 -0000 1.295 --- changelog.txt 10 Aug 2004 22:32:51 -0000 1.296 *************** *** 1,4 **** --- 1,5 ---- Changelog for PythonCard + Test AGT Release 0.8 2004-08-?? |
From: Kevin A. <ka...@us...> - 2004-08-09 23:04:27
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14319/tools/resourceEditor/modules Modified Files: backgroundInfoDialog.rsrc.py menuDialog.rsrc.py Log Message: fixed position and size for Mac Index: backgroundInfoDialog.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/backgroundInfoDialog.rsrc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** backgroundInfoDialog.rsrc.py 13 Sep 2002 18:55:16 -0000 1.1 --- backgroundInfoDialog.rsrc.py 9 Aug 2004 23:04:19 -0000 1.2 *************** *** 8,12 **** 'name':'stcName', 'position':(10, 10), - 'size':(45, -1), 'text':'Name:', }, --- 8,11 ---- *************** *** 15,19 **** 'name':'stcTitle', 'position':(10, 35), - 'size':(45, -1), 'text':'Title:', }, --- 14,17 ---- *************** *** 22,26 **** 'name':'stcPosition', 'position':(10, 60), - 'size':(45, -1), 'text':'Position:', }, --- 20,23 ---- *************** *** 29,33 **** 'name':'stcSize', 'position':(10, 85), - 'size':(45, -1), 'text':'Size:', }, --- 26,29 ---- *************** *** 36,40 **** 'name':'stcForegroundColor', 'position':(10, 110), - 'size':(90, -1), 'text':'Foreground color:', }, --- 32,35 ---- *************** *** 43,47 **** 'name':'stcBackgroundColor', 'position':(10, 135), ! 'size':(90, -1), 'text':'Background color:', }, --- 38,42 ---- 'name':'stcBackgroundColor', 'position':(10, 135), ! #'size':(90, -1), 'text':'Background color:', }, *************** *** 50,54 **** 'name':'stcImage', 'position':(10, 160), - 'size':(45, -1), 'text':'Image:', }, --- 45,48 ---- *************** *** 57,61 **** 'name':'stcIcon', 'position':(10, 210), - 'size':(45, -1), 'text':'Icon:', }, --- 51,54 ---- *************** *** 63,73 **** {'type':'TextField', 'name':'fldName', ! 'position':(110, 5), ! 'size':(188, -1), }, {'type':'TextField', 'name':'fldTitle', ! 'position':(110, 30), 'size':(188, -1), }, --- 56,65 ---- {'type':'TextField', 'name':'fldName', ! 'position':(130, 5), }, {'type':'TextField', 'name':'fldTitle', ! 'position':(130, 30), 'size':(188, -1), }, *************** *** 75,91 **** {'type':'TextField', 'name':'fldPosition', ! 'position':(110, 55), ! 'size':(68, -1), }, {'type':'TextField', 'name':'fldSize', ! 'position':(110, 80), ! 'size':(68, -1), }, {'type':'TextField', 'name':'fldForegroundColor', ! 'position':(110, 110), 'size':(100, -1), }, --- 67,83 ---- {'type':'TextField', 'name':'fldPosition', ! 'position':(130, 55), ! 'size':(80, -1), }, {'type':'TextField', 'name':'fldSize', ! 'position':(130, 80), ! 'size':(80, -1), }, {'type':'TextField', 'name':'fldForegroundColor', ! 'position':(130, 110), 'size':(100, -1), }, *************** *** 93,97 **** {'type':'Button', 'name':'btnForegroundColor', ! 'position':(230, 110), 'label':'Color...', }, --- 85,89 ---- {'type':'Button', 'name':'btnForegroundColor', ! 'position':(250, 110), 'label':'Color...', }, *************** *** 99,103 **** {'type':'TextField', 'name':'fldBackgroundColor', ! 'position':(110, 135), 'size':(100, -1), }, --- 91,95 ---- {'type':'TextField', 'name':'fldBackgroundColor', ! 'position':(130, 135), 'size':(100, -1), }, *************** *** 105,109 **** {'type':'Button', 'name':'btnBackgroundColor', ! 'position':(230, 135), 'label':'Color...', }, --- 97,101 ---- {'type':'Button', 'name':'btnBackgroundColor', ! 'position':(250, 135), 'label':'Color...', }, *************** *** 111,115 **** {'type':'TextField', 'name':'fldImage', ! 'position':(110, 160), 'size':(100, -1), }, --- 103,107 ---- {'type':'TextField', 'name':'fldImage', ! 'position':(130, 160), 'size':(100, -1), }, *************** *** 117,121 **** {'type':'Button', 'name':'btnFile', ! 'position':(230, 160), 'label':'File...', }, --- 109,113 ---- {'type':'Button', 'name':'btnFile', ! 'position':(250, 160), 'label':'File...', }, *************** *** 123,127 **** {'type':'CheckBox', 'name':'chkTiled', ! 'position':(110, 185), 'size':(135, -1), 'checked':0, --- 115,119 ---- {'type':'CheckBox', 'name':'chkTiled', ! 'position':(130, 185), 'size':(135, -1), 'checked':0, *************** *** 131,135 **** {'type':'TextField', 'name':'fldIcon', ! 'position':(110, 210), 'size':(100, -1), }, --- 123,127 ---- {'type':'TextField', 'name':'fldIcon', ! 'position':(130, 210), 'size':(100, -1), }, *************** *** 137,141 **** {'type':'Button', 'name':'btnIconFile', ! 'position':(230, 210), 'label':'File...', }, --- 129,133 ---- {'type':'Button', 'name':'btnIconFile', ! 'position':(250, 210), 'label':'File...', }, *************** *** 143,148 **** {'type':'CheckBox', 'name':'chkStatusBar', ! 'position':(110, 235), ! 'size':(135, -1), 'checked':0, 'label':'Status bar on window', --- 135,139 ---- {'type':'CheckBox', 'name':'chkStatusBar', ! 'position':(130, 235), 'checked':0, 'label':'Status bar on window', *************** *** 151,155 **** {'type':'CheckBox', 'name':'chkVisible', ! 'position':(110, 260), 'size':(135, -1), 'checked':1, --- 142,146 ---- {'type':'CheckBox', 'name':'chkVisible', ! 'position':(130, 260), 'size':(135, -1), 'checked':1, *************** *** 159,163 **** {'type':'CheckBox', 'name':'chkResizeable', ! 'position':(110, 285), 'size':(135, -1), 'checked':0, --- 150,154 ---- {'type':'CheckBox', 'name':'chkResizeable', ! 'position':(130, 285), 'size':(135, -1), 'checked':0, Index: menuDialog.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/menuDialog.rsrc.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** menuDialog.rsrc.py 9 Aug 2004 22:46:56 -0000 1.4 --- menuDialog.rsrc.py 9 Aug 2004 23:04:19 -0000 1.5 *************** *** 2,6 **** 'name':'menuDialog', 'title':'Menu Editor', - 'position':(20, 50), 'size':(480, 300), 'components': [ --- 2,5 ---- |
From: Kevin A. <ka...@us...> - 2004-08-09 22:47:05
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11529/tools/resourceEditor/modules Modified Files: menuDialog.rsrc.py Log Message: adjusted position and sizes for Mac OS X Index: menuDialog.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/menuDialog.rsrc.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** menuDialog.rsrc.py 1 May 2002 16:15:09 -0000 1.3 --- menuDialog.rsrc.py 9 Aug 2004 22:46:56 -0000 1.4 *************** *** 1,7 **** {'type':'CustomDialog', ! 'name':'menuDialog', ! 'title':'Menu Editor', ! 'size':(480, 300), ! 'components': [ {'type':'List', --- 1,8 ---- {'type':'CustomDialog', ! 'name':'menuDialog', ! 'title':'Menu Editor', ! 'position':(20, 50), ! 'size':(480, 300), ! 'components': [ {'type':'List', *************** *** 14,27 **** {'type':'Button', 'name':'btnUp', ! 'position':(5, 190), ! 'size':(50, -1), ! 'label':'Up', }, {'type':'Button', 'name':'btnDown', ! 'position':(65, 190), ! 'size':(50, -1), ! 'label':'Down', }, --- 15,28 ---- {'type':'Button', 'name':'btnUp', ! 'position':(5, 190), ! 'size':(50, -1), ! 'label':'Up', }, {'type':'Button', 'name':'btnDown', ! 'position':(60, 190), ! 'size':(60, -1), ! 'label':'Down', }, *************** *** 29,34 **** 'name':'btnDelete', 'position':(125, 190), ! 'size':(50, -1), ! 'label':'Delete', }, --- 30,35 ---- 'name':'btnDelete', 'position':(125, 190), ! 'size':(60, -1), ! 'label':'Delete', }, *************** *** 36,40 **** 'name':'stcName', 'position':(200, 10), - #'size':(45, -1), 'text':'Name:', }, --- 37,40 ---- *************** *** 43,47 **** 'name':'stcLabel', 'position':(200, 35), - #'size':(45, -1), 'text':'Label:', }, --- 43,46 ---- *************** *** 50,54 **** 'name':'stcShortcut', 'position':(200, 60), - #'size':(45, -1), 'text':'Shortcut:', }, --- 49,52 ---- *************** *** 57,61 **** 'name':'stcCommand', 'position':(200, 85), - #'size':(45, -1), 'text':'Command:', }, --- 55,58 ---- *************** *** 64,73 **** 'name':'fldListIndex', 'position':(460, 5), ! 'visible':0, }, {'type':'TextField', 'name':'fldName', ! 'position':(260, 5), 'size':(188, -1), }, --- 61,70 ---- 'name':'fldListIndex', 'position':(460, 5), ! 'visible':False, }, {'type':'TextField', 'name':'fldName', ! 'position':(275, 5), 'size':(188, -1), }, *************** *** 75,79 **** {'type':'TextField', 'name':'fldLabel', ! 'position':(260, 30), 'size':(188, -1), }, --- 72,76 ---- {'type':'TextField', 'name':'fldLabel', ! 'position':(275, 30), 'size':(188, -1), }, *************** *** 81,85 **** {'type':'TextField', 'name':'fldShortcut', ! 'position':(260, 55), 'size':(188, -1), }, --- 78,82 ---- {'type':'TextField', 'name':'fldShortcut', ! 'position':(275, 55), 'size':(188, -1), }, *************** *** 87,91 **** {'type':'TextField', 'name':'fldCommand', ! 'position':(260, 80), 'size':(188, -1), }, --- 84,88 ---- {'type':'TextField', 'name':'fldCommand', ! 'position':(275, 80), 'size':(188, -1), }, *************** *** 93,99 **** {'type':'CheckBox', 'name':'chkEnabled', ! 'position':(260, 105), ! #'size':(135, -1), ! 'checked':1, 'label':'Enabled', }, --- 90,95 ---- {'type':'CheckBox', 'name':'chkEnabled', ! 'position':(275, 110), ! 'checked':True, 'label':'Enabled', }, *************** *** 101,107 **** {'type':'CheckBox', 'name':'chkCheckable', ! 'position':(260, 130), ! #'size':(135, -1), ! 'checked':0, 'label':'Checkable', }, --- 97,101 ---- {'type':'CheckBox', 'name':'chkCheckable', ! 'position':(275, 135), 'label':'Checkable', }, *************** *** 109,115 **** {'type':'CheckBox', 'name':'chkChecked', ! 'position':(260, 155), ! #'size':(135, -1), ! 'checked':0, 'label':'Checked', }, --- 103,107 ---- {'type':'CheckBox', 'name':'chkChecked', ! 'position':(275, 160), 'label':'Checked', }, *************** *** 117,143 **** {'type':'Button', 'name':'btnNewMenu', ! 'position':(200, 190), ! 'label':'New Menu', }, {'type':'Button', 'name':'btnNewMenuItem', ! 'position':(290, 190), ! 'label':'New MenuItem', }, {'type':'Button', 'name':'btnOK', 'position':(10, 240), ! 'label':'OK', ! 'default':1, ! 'id':5100, }, {'type':'Button', 'name':'btnCancel', 'position':(115, 240), ! 'label':'Cancel', ! 'id':5101, }, --- 109,135 ---- {'type':'Button', 'name':'btnNewMenu', ! 'position':(220, 190), ! 'label':'New Menu', }, {'type':'Button', 'name':'btnNewMenuItem', ! 'position':(320, 190), ! 'label':'New MenuItem', }, {'type':'Button', + 'id':5100, 'name':'btnOK', 'position':(10, 240), ! 'default':1, ! 'label':'OK', }, {'type':'Button', + 'id':5101, 'name':'btnCancel', 'position':(115, 240), ! 'label':'Cancel', }, |
From: Kevin A. <ka...@us...> - 2004-08-09 21:40:56
|
Update of /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31562/tools/resourceEditor/modules Modified Files: resourceOutput.py Log Message: added Gauge to list of components to skip on default sizes Index: resourceOutput.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/resourceEditor/modules/resourceOutput.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** resourceOutput.py 18 Jul 2004 16:43:28 -0000 1.26 --- resourceOutput.py 9 Aug 2004 21:40:47 -0000 1.27 *************** *** 48,52 **** # try and determine default sizes width, height = aWidget.size ! if aWidget.__class__.__name__ not in ['BitmapCanvas', 'HtmlWindow', 'IEHtmlWindow']: bestWidth, bestHeight = aWidget.GetBestSize() if bestWidth == width: --- 48,52 ---- # try and determine default sizes width, height = aWidget.size ! if aWidget.__class__.__name__ not in ['BitmapCanvas', 'HtmlWindow', 'IEHtmlWindow', 'Gauge']: bestWidth, bestHeight = aWidget.GetBestSize() if bestWidth == width: |