From: Kevin A. <al...@se...> - 2004-04-23 15:54:56
|
On Apr 23, 2004, at 8:18 AM, Thomas Heller wrote: > "Kevin Altis" <al...@se...> writes: > >> You didn't specify which components were broken, so if this doesn't >> solve the problem or other components need a similar workaround on >> Windows, please let me know. Hopefully, the 3D border offset is the >> same on Win98, 2K, XP; I can only check it on Win2K. > > I don't think it is the same on these systems, and it may even depend=20= > on > some user settings. > > Windows exposes the GetSystemMetrics api to find out a lot of these > things, although I have no idea whether wxPython exposes this = function. > > Thomas Aha, I didn't know that was a system setting you could query. In=20 wxPython, those numbers are available via the GetMetric method in the=20 wxSystemSettings class. So, the code for resourceEditor.py in=20 PythonCardPrototype would be: # KEA 2003-05-05 # workaround for 3D border on Windows t =3D target.__class__.__name__ if wx.Platform =3D=3D "__WXMSW__": if ['List', 'PasswordField', 'TextField',=20 'TextArea'].count(t): self.startGlobalOffset =3D = [self.startGlobalOffset[0]=20 + wx.wxSystemSettings.GetMetric(wx.wxSYS_EDGE_X), self.startGlobalOffset[1] +=20 wx.wxSystemSettings.GetMetric(wx.wxSYS_EDGE_Y)] elif ['Gauge', 'StaticLine'].count(t): self.startGlobalOffset =3D = [self.startGlobalOffset[0]=20 + wx.wxSystemSettings.GetMetric(wx.wxSYS_BORDER_X), self.startGlobalOffset[1] +=20 wx.wxSystemSettings.GetMetric(wx.wxSYS_BORDER_Y)] =00 Calendar and Spinner are still screwed up, but that is because they are=20= compound wxWidget controls and don't report positions correctly. I'm=20 still not sure what I should do about them to get the offset right on=20 all platforms. ka= |