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 |