From: Kevin A. <ka...@us...> - 2004-08-12 19:19:36
|
Update of /cvsroot/pythoncard/PythonCard/samples/pictureViewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16511/pictureViewer Modified Files: pictureViewer.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: pictureViewer.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/pictureViewer/pictureViewer.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** pictureViewer.py 10 May 2004 00:45:20 -0000 1.22 --- pictureViewer.py 12 Aug 2004 19:18:56 -0000 1.23 *************** *** 142,148 **** def on_menuImageScaleSize_select(self, event): result = dialog.textEntryDialog(self, "Scale image", "Scale by percent:", "") ! if result['accepted']: try: ! scale = float(result['text']) / 100.0 self.displayFileScaled(scale, scale) except: --- 142,148 ---- def on_menuImageScaleSize_select(self, event): result = dialog.textEntryDialog(self, "Scale image", "Scale by percent:", "") ! if result.accepted: try: ! scale = float(result.text) / 100.0 self.displayFileScaled(scale, scale) except: *************** *** 195,200 **** def on_menuFileOpen_select(self, event): result = dialog.openFileDialog() ! if result['accepted']: ! self.openFile(result['paths'][0]) def on_menuFileSaveAs_select(self, event): --- 195,200 ---- def on_menuFileOpen_select(self, event): result = dialog.openFileDialog() ! if result.accepted: ! self.openFile(result.paths[0]) def on_menuFileSaveAs_select(self, event): *************** *** 206,211 **** wildcard = "All files (*.*)|*.*" result = dialog.saveFileDialog(None, "Save As", path, filename, wildcard) ! if result['accepted']: ! path = result['paths'][0] fileType = graphic.bitmapType(path) #print fileType, path --- 206,211 ---- wildcard = "All files (*.*)|*.*" result = dialog.saveFileDialog(None, "Save As", path, filename, wildcard) ! if result.accepted: ! path = result.paths[0] fileType = graphic.bitmapType(path) #print fileType, path *************** *** 216,224 **** bmp = self.components.bufOff.getBitmap() bmp.SaveFile(path, fileType) ! return 1 except: ! return 0 else: ! return 0 def on_menuEditCopy_select(self, event): --- 216,224 ---- bmp = self.components.bufOff.getBitmap() bmp.SaveFile(path, fileType) ! return True except: ! return False else: ! return False def on_menuEditCopy_select(self, event): |