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,6 +205,10 @@ 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))
|
||||||
|
# Hide some icons on Mac to reduce the toolbar size,
|
||||||
|
# and comply more with the Apple LnF, besides
|
||||||
|
# wxMac icons are ugly
|
||||||
|
if wx.Platform != '__WXMAC__':
|
||||||
new_bmp = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, 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)
|
open_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR)
|
||||||
save_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR)
|
save_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR)
|
||||||
@@ -213,7 +217,6 @@ class Frame(wx.Frame):
|
|||||||
cut_bmp = wx.ArtProvider.GetBitmap(wx.ART_CUT, wx.ART_TOOLBAR)
|
cut_bmp = wx.ArtProvider.GetBitmap(wx.ART_CUT, wx.ART_TOOLBAR)
|
||||||
copy_bmp = wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR)
|
copy_bmp = wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR)
|
||||||
paste_bmp= wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR)
|
paste_bmp= wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR)
|
||||||
|
|
||||||
tb.AddSimpleTool(wx.ID_NEW, new_bmp, 'New', 'New file')
|
tb.AddSimpleTool(wx.ID_NEW, new_bmp, 'New', 'New file')
|
||||||
tb.AddSimpleTool(wx.ID_OPEN, open_bmp, 'Open', 'Open file')
|
tb.AddSimpleTool(wx.ID_OPEN, open_bmp, 'Open', 'Open file')
|
||||||
tb.AddSimpleTool(wx.ID_SAVE, save_bmp, 'Save', 'Save file')
|
tb.AddSimpleTool(wx.ID_SAVE, save_bmp, 'Save', 'Save file')
|
||||||
@@ -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()
|
||||||
|
if wx.Platform == '__WXMAC__':
|
||||||
conf.width, conf.height = self.GetClientSize()
|
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,6 +1763,8 @@ 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)
|
||||||
|
# Mac does not set the correct size
|
||||||
|
if wx.Platform == '__WXMAC__':
|
||||||
frame.SetClientSize(size)
|
frame.SetClientSize(size)
|
||||||
frame.Show(True)
|
frame.Show(True)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user