iconization of the properties window together with the main to
fix blocking on wxGTK; do not put Open/Save/... toolbar icons on Mac - they are ugly git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -205,26 +205,29 @@ class Frame(wx.Frame):
|
|||||||
# Create toolbar
|
# Create toolbar
|
||||||
tb = self.CreateToolBar(wx.TB_HORIZONTAL | wx.NO_BORDER | wx.TB_FLAT)
|
tb = self.CreateToolBar(wx.TB_HORIZONTAL | wx.NO_BORDER | wx.TB_FLAT)
|
||||||
tb.SetToolBitmapSize((24,24))
|
tb.SetToolBitmapSize((24,24))
|
||||||
new_bmp = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_TOOLBAR)
|
# Hide some icons on Mac to reduce the toolbar size,
|
||||||
open_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR)
|
# and comply more with the Apple LnF, besides
|
||||||
save_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR)
|
# wxMac icons are ugly
|
||||||
undo_bmp = wx.ArtProvider.GetBitmap(wx.ART_UNDO, wx.ART_TOOLBAR)
|
if wx.Platform != '__WXMAC__':
|
||||||
redo_bmp = wx.ArtProvider.GetBitmap(wx.ART_REDO, wx.ART_TOOLBAR)
|
new_bmp = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_TOOLBAR)
|
||||||
cut_bmp = wx.ArtProvider.GetBitmap(wx.ART_CUT, wx.ART_TOOLBAR)
|
open_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR)
|
||||||
copy_bmp = wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR)
|
save_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR)
|
||||||
paste_bmp= wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR)
|
undo_bmp = wx.ArtProvider.GetBitmap(wx.ART_UNDO, wx.ART_TOOLBAR)
|
||||||
|
redo_bmp = wx.ArtProvider.GetBitmap(wx.ART_REDO, wx.ART_TOOLBAR)
|
||||||
tb.AddSimpleTool(wx.ID_NEW, new_bmp, 'New', 'New file')
|
cut_bmp = wx.ArtProvider.GetBitmap(wx.ART_CUT, wx.ART_TOOLBAR)
|
||||||
tb.AddSimpleTool(wx.ID_OPEN, open_bmp, 'Open', 'Open file')
|
copy_bmp = wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR)
|
||||||
tb.AddSimpleTool(wx.ID_SAVE, save_bmp, 'Save', 'Save file')
|
paste_bmp= wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR)
|
||||||
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
tb.AddSimpleTool(wx.ID_NEW, new_bmp, 'New', 'New file')
|
||||||
tb.AddSimpleTool(wx.ID_UNDO, undo_bmp, 'Undo', 'Undo')
|
tb.AddSimpleTool(wx.ID_OPEN, open_bmp, 'Open', 'Open file')
|
||||||
tb.AddSimpleTool(wx.ID_REDO, redo_bmp, 'Redo', 'Redo')
|
tb.AddSimpleTool(wx.ID_SAVE, save_bmp, 'Save', 'Save file')
|
||||||
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
||||||
tb.AddSimpleTool(wx.ID_CUT, cut_bmp, 'Cut', 'Cut')
|
tb.AddSimpleTool(wx.ID_UNDO, undo_bmp, 'Undo', 'Undo')
|
||||||
tb.AddSimpleTool(wx.ID_COPY, copy_bmp, 'Copy', 'Copy')
|
tb.AddSimpleTool(wx.ID_REDO, redo_bmp, 'Redo', 'Redo')
|
||||||
tb.AddSimpleTool(self.ID_TOOL_PASTE, paste_bmp, 'Paste', 'Paste')
|
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
||||||
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
tb.AddSimpleTool(wx.ID_CUT, cut_bmp, 'Cut', 'Cut')
|
||||||
|
tb.AddSimpleTool(wx.ID_COPY, copy_bmp, 'Copy', 'Copy')
|
||||||
|
tb.AddSimpleTool(self.ID_TOOL_PASTE, paste_bmp, 'Paste', 'Paste')
|
||||||
|
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
||||||
tb.AddSimpleTool(self.ID_TOOL_LOCATE,
|
tb.AddSimpleTool(self.ID_TOOL_LOCATE,
|
||||||
images.getLocateBitmap(), #images.getLocateArmedBitmap(),
|
images.getLocateBitmap(), #images.getLocateArmedBitmap(),
|
||||||
'Locate', 'Locate control in test window and select it', True)
|
'Locate', 'Locate control in test window and select it', True)
|
||||||
@@ -328,9 +331,7 @@ class Frame(wx.Frame):
|
|||||||
(conf.panelWidth, conf.panelHeight))
|
(conf.panelWidth, conf.panelHeight))
|
||||||
self.miniFrame = miniFrame
|
self.miniFrame = miniFrame
|
||||||
sizer2 = wx.BoxSizer()
|
sizer2 = wx.BoxSizer()
|
||||||
miniFrame.SetAutoLayout(True)
|
|
||||||
miniFrame.SetSizer(sizer2)
|
miniFrame.SetSizer(sizer2)
|
||||||
wx.EVT_CLOSE(self.miniFrame, self.OnCloseMiniFrame)
|
|
||||||
# Create panel for parameters
|
# Create panel for parameters
|
||||||
global panel
|
global panel
|
||||||
if conf.embedPanel:
|
if conf.embedPanel:
|
||||||
@@ -1368,10 +1369,6 @@ Homepage: http://xrced.sourceforge.net\
|
|||||||
finally:
|
finally:
|
||||||
self.inIdle = False
|
self.inIdle = False
|
||||||
|
|
||||||
# We don't let close panel window
|
|
||||||
def OnCloseMiniFrame(self, evt):
|
|
||||||
return
|
|
||||||
|
|
||||||
def OnIconize(self, evt):
|
def OnIconize(self, evt):
|
||||||
if evt.Iconized():
|
if evt.Iconized():
|
||||||
conf.x, conf.y = self.GetPosition()
|
conf.x, conf.y = self.GetPosition()
|
||||||
@@ -1381,10 +1378,10 @@ Homepage: http://xrced.sourceforge.net\
|
|||||||
else:
|
else:
|
||||||
conf.panelX, conf.panelY = self.miniFrame.GetPosition()
|
conf.panelX, conf.panelY = self.miniFrame.GetPosition()
|
||||||
conf.panelWidth, conf.panelHeight = self.miniFrame.GetSize()
|
conf.panelWidth, conf.panelHeight = self.miniFrame.GetSize()
|
||||||
self.miniFrame.Iconize()
|
self.miniFrame.Show(False)
|
||||||
else:
|
else:
|
||||||
if not conf.embedPanel:
|
if not conf.embedPanel:
|
||||||
self.miniFrame.Iconize(False)
|
self.miniFrame.Show(True)
|
||||||
evt.Skip()
|
evt.Skip()
|
||||||
|
|
||||||
def OnCloseWindow(self, evt):
|
def OnCloseWindow(self, evt):
|
||||||
@@ -1397,7 +1394,10 @@ Homepage: http://xrced.sourceforge.net\
|
|||||||
panel.RemovePage(1)
|
panel.RemovePage(1)
|
||||||
if not self.IsIconized():
|
if not self.IsIconized():
|
||||||
conf.x, conf.y = self.GetPosition()
|
conf.x, conf.y = self.GetPosition()
|
||||||
conf.width, conf.height = self.GetClientSize()
|
if wx.Platform == '__WXMAC__':
|
||||||
|
conf.width, conf.height = self.GetClientSize()
|
||||||
|
else:
|
||||||
|
conf.width, conf.height = self.GetSize()
|
||||||
if conf.embedPanel:
|
if conf.embedPanel:
|
||||||
conf.sashPos = self.splitter.GetSashPosition()
|
conf.sashPos = self.splitter.GetSashPosition()
|
||||||
else:
|
else:
|
||||||
@@ -1763,7 +1763,9 @@ Please upgrade wxWidgets to %d.%d.%d or higher.''' % MinWxVersion)
|
|||||||
wx.FileSystem.AddHandler(wx.MemoryFSHandler())
|
wx.FileSystem.AddHandler(wx.MemoryFSHandler())
|
||||||
# Create main frame
|
# Create main frame
|
||||||
frame = Frame(pos, size)
|
frame = Frame(pos, size)
|
||||||
frame.SetClientSize(size)
|
# Mac does not set the correct size
|
||||||
|
if wx.Platform == '__WXMAC__':
|
||||||
|
frame.SetClientSize(size)
|
||||||
frame.Show(True)
|
frame.Show(True)
|
||||||
|
|
||||||
# Load plugins
|
# Load plugins
|
||||||
|
Reference in New Issue
Block a user