Re: New wxPython versions
Adit Panchal <[email protected]>
| Newsgroups | gmane.comp.mobile.bitpim.devel |
|---|---|
| Message-ID | <[email protected]> |
Roger - have you updated makedist.py to require 2.5.4.1 yet? I didn't see any commits for it. Anyways, I checked out some Mac specific behavior in the code that can be removed due to the version upgrade. The only one that I am not 100% sure of, but it works fine on my machine, is the wx.Bitmap to wx.Image conversion routine in wallpaper.py. I just commented it out in case you wanted to keep the code around for historical purposes. The main things that are fixed is the toolbar image size weirdness and the tickmarks for the slider. Also, the calendar entry editor was hardcoded in size - I took that out completely and it looks fine on both Windows and Mac. Thanks, Adit On Mar 17, 2005, at 10:09, Roger Binns wrote: >>> 2.5.4.1 has now been released and we will update to this >> As part of next Monday build? > > Yes. In fact you'll need to update after the next cvs update :-)
mac_2541.diff
(application/octet-stream, 4.4 KB)
Index: calendarentryeditor.py
===================================================================
RCS file: /cvsroot/bitpim/bitpim/calendarentryeditor.py,v
retrieving revision 1.15
diff -u -r1.15 calendarentryeditor.py
--- calendarentryeditor.py 3 Mar 2005 07:18:16 -0000 1.15
+++ calendarentryeditor.py 20 Mar 2005 09:30:48 -0000
@@ -554,10 +554,10 @@
self.SetSizer(vbs)
self.SetAutoLayout(True)
vbs.Fit(self)
- if guihelper.IsMac():
- self.SetSize( (700, 450) )
- else:
- self.SetSize((560, 380))
+# if guihelper.IsMac():
+# self.SetSize( (700, 450) )
+# else:
+# self.SetSize((560, 380))
# delete is disabled until an item is selected
self.__delete_btn.Enable(False)
Index: gui.py
===================================================================
RCS file: /cvsroot/bitpim/bitpim/gui.py,v
retrieving revision 1.179
diff -u -r1.179 gui.py
--- gui.py 20 Mar 2005 04:04:32 -0000 1.179
+++ gui.py 20 Mar 2005 09:30:51 -0000
@@ -597,12 +597,7 @@
### toolbar
self.tb=self.CreateToolBar(wx.TB_HORIZONTAL|wx.TB_TEXT)
- # work around a bug in which the Mac toolbar icons are 4 pixels bigger
- # in each dimension
- if guihelper.IsMac():
- self.tb.SetToolBitmapSize(wx.Size(27,27))
- else:
- self.tb.SetToolBitmapSize(wx.Size(32,32))
+ self.tb.SetToolBitmapSize(wx.Size(32,32))
sz=self.tb.GetToolBitmapSize()
# add and delete tools
Index: phonebookentryeditor.py
===================================================================
RCS file: /cvsroot/bitpim/bitpim/phonebookentryeditor.py,v
retrieving revision 1.35
diff -u -r1.35 phonebookentryeditor.py
--- phonebookentryeditor.py 11 Mar 2005 08:10:50 -0000 1.35
+++ phonebookentryeditor.py 20 Mar 2005 09:30:53 -0000
@@ -997,10 +997,7 @@
tb=wx.ToolBar(self, 7, style=wx.TB_FLAT|wx.TB_HORIZONTAL|wx.TB_TEXT)
# work around a bug in which the mac toolbar icons are 4 pixels bigger
# in each dimension
- if guihelper.IsMac():
- tb.SetToolBitmapSize(wx.Size(27,27))
- else:
- tb.SetToolBitmapSize(wx.Size(32,32))
+ tb.SetToolBitmapSize(wx.Size(32,32))
sz=tb.GetToolBitmapSize()
tb.AddLabelTool(self.ID_UP, "Up", wx.ArtProvider.GetBitmap(guihelper.ART_ARROW_UP, wx.ART_TOOLBAR, sz), shortHelp="Move field up")
tb.AddLabelTool(self.ID_DOWN, "Down", wx.ArtProvider.GetBitmap(guihelper.ART_ARROW_DOWN, wx.ART_TOOLBAR, sz), shortHelp="Move field down")
Index: wallpaper.py
===================================================================
RCS file: /cvsroot/bitpim/bitpim/wallpaper.py,v
retrieving revision 1.66
diff -u -r1.66 wallpaper.py
--- wallpaper.py 17 Mar 2005 07:55:16 -0000 1.66
+++ wallpaper.py 20 Mar 2005 09:30:55 -0000
@@ -926,12 +926,12 @@
# scaling up
# Mac is eye wateringly slow doing wx.Bitmap to wx.Image conversions so
# we use up extra memory keeping a copy of self.thebmp as an image
- if guihelper.IsMac():
- if self.imageofthebmp is None:
- self.imageofthebmp=self.thebmp.ConvertToImage()
- sub=self.imageofthebmp.GetSubImage( (l,t,(r-l),(b-t)) )
- sub.Rescale(w,h)
- return sub.ConvertToBitmap()
+# if guihelper.IsMac():
+# if self.imageofthebmp is None:
+# self.imageofthebmp=self.thebmp.ConvertToImage()
+# sub=self.imageofthebmp.GetSubImage( (l,t,(r-l),(b-t)) )
+# sub.Rescale(w,h)
+# return sub.ConvertToBitmap()
# non-Mac
sub=self.thebmp.GetSubBitmap( (l,t,(r-l),(b-t)) )
sub=sub.ConvertToImage()
@@ -993,8 +993,8 @@
for one,(s,_) in enumerate(self.SCALES):
if s==1: break
# Mac gets ticks completely wrong so we turn then off, even calling SetTickFreq
- tickstyle=[wx.SL_AUTOTICKS,0][bool(guihelper.IsMac())]
- self.slider=wx.Slider(self, -1, one, 0, len(self.SCALES)-1, style=wx.HORIZONTAL|tickstyle)
+# tickstyle=[,0][bool(guihelper.IsMac())]
+ self.slider=wx.Slider(self, -1, one, 0, len(self.SCALES)-1, style=wx.HORIZONTAL|wx.SL_AUTOTICKS)
wx.EVT_SCROLL(self, self.SetZoom)
vbs.Add(self.slider, 0, wx.ALL|wx.EXPAND, 5)
self.zoomlabel=wx.StaticText(self, -1, self.SCALES[one][1])