From: daid Date: Thu, 15 Mar 2012 16:27:37 +0000 (+0100) Subject: Made the help popups show on focus for MacOS. This is not a perfect solution, as... X-Git-Tag: RC1~84 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=b3d823e1e044ce2831bd0af999e1edd6a0994014;p=cura.git Made the help popups show on focus for MacOS. This is not a perfect solution, as the popup had to be moved to it was not in the way of other controls. But atleast it shows the help for MacOS now. --- diff --git a/SkeinPyPy_NewUI/newui/configBase.py b/SkeinPyPy_NewUI/newui/configBase.py index 7c9ec2a1..aa028e52 100644 --- a/SkeinPyPy_NewUI/newui/configBase.py +++ b/SkeinPyPy_NewUI/newui/configBase.py @@ -65,8 +65,12 @@ class configWindowBase(wx.Frame): self.popup.text.SetLabel(setting.helpText) self.popup.text.Wrap(350) self.popup.Fit() - x, y = setting.ctrl.ClientToScreenXY(0, 0) - sx, sy = setting.ctrl.GetSizeTuple() + if os.name == 'darwin': + x, y = self.ClientToScreenXY(0, 0) + sx, sy = self.GetClientSizeTuple() + else: + x, y = setting.ctrl.ClientToScreenXY(0, 0) + sx, sy = setting.ctrl.GetSizeTuple() #if platform.system() == "Windows": # for some reason, under windows, the popup is relative to the main window... in some cases. (Wierd ass bug) # wx, wy = self.ClientToScreenXY(0, 0) @@ -126,8 +130,12 @@ class SettingRow(): sizer.Add(self.ctrl, (x,y+1), flag=wx.ALIGN_BOTTOM|wx.EXPAND) sizer.SetRows(x+1) - self.ctrl.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnter) - self.ctrl.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseExit) + if os.name == 'darwin': + self.ctrl.Bind(wx.EVT_SET_FOCUS, self.OnMouseEnter) + self.ctrl.Bind(wx.EVT_KILL_FOCUS, self.OnMouseExit) + else: + self.ctrl.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnter) + self.ctrl.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseExit) self.defaultBGColour = self.ctrl.GetBackgroundColour()