]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/tools/XRCed/xrced.py
added wxDialog::GetEscapeId()
[wxWidgets.git] / wxPython / wx / tools / XRCed / xrced.py
index 1cdb52788e8090a77633859378e866f029986499..7da554998466a0a4e043d1928cd67b71725cbd86 100644 (file)
@@ -177,7 +177,7 @@ class Frame(wxFrame):
         # Create toolbar
         tb = self.CreateToolBar(wxTB_HORIZONTAL | wxNO_BORDER | wxTB_FLAT)
         tb.SetToolBitmapSize((24,24))
-        new_bmp  = wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR)
+        new_bmp  = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_TOOLBAR)
         open_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR)
         save_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR)
         undo_bmp = wx.ArtProvider.GetBitmap(wx.ART_UNDO, wx.ART_TOOLBAR)
@@ -361,7 +361,7 @@ class Frame(wxFrame):
         if evt.GetId() == wxID_SAVEAS or not self.dataFile:
             if self.dataFile: defaultName = ''
             else: defaultName = 'UNTITLED.xrc'
-            dirname = os.path.dirname(self.dataFile)
+            dirname = os.path.abspath(os.path.dirname(self.dataFile))
             dlg = wxFileDialog(self, 'Save As', dirname, defaultName, '*.xrc',
                                wxSAVE | wxOVERWRITE_PROMPT | wxCHANGE_DIR)
             if dlg.ShowModal() == wxID_OK:
@@ -456,7 +456,8 @@ class Frame(wxFrame):
             if parent.__class__ != xxxMainNode: error = True
         elif x.__class__ == xxxToolBar:
             # Toolbar can be top-level of child of panel or frame
-            if parent.__class__ not in [xxxMainNode, xxxPanel, xxxFrame]: error = True
+            if parent.__class__ not in [xxxMainNode, xxxPanel, xxxFrame] and \
+               not parent.isSizer: error = True
         elif x.__class__ == xxxPanel and parent.__class__ == xxxMainNode:
             pass
         elif x.__class__ == xxxSpacer:
@@ -716,7 +717,6 @@ Homepage: http://xrced.sourceforge.net\
 
     # Simple emulation of python command line
     def OnDebugCMD(self, evt):
-        import traceback
         while 1:
             try:
                 exec raw_input('C:\> ')
@@ -1033,6 +1033,8 @@ Homepage: http://xrced.sourceforge.net\
             self.modified = False
             panel.SetModified(False)
         except:
+            inf = sys.exc_info()
+            wxLogError(traceback.format_exception(inf[0], inf[1], None)[-1])
             wxLogError('Error writing file: %s' % path)
             raise