18 from ..context
import POPUP_BACKGROUND, POPUP_FOREGROUND, IS_WINDOWS
19 from ..widgets
import VerticalSizer, HtmlWindow, HtmlDialog
24 def __init__(self, size, detachable=True, autohide=False, color_background=POPUP_BACKGROUND,
25 color_foreground=POPUP_FOREGROUND):
31 self._set_auto_hiding()
37 panel = wx.MiniFrame(self)
42 self.
_details_details = HtmlWindow(self, size=size)
43 szr.add_expanding(self.
_details_details)
55 dlg.SetPosition((wx.GetMouseState().x, wx.GetMouseState().y))
60 if self.GetPosition() != position:
61 self.SetPosition(position)
62 if not self.IsShown():
65 def hide(self, event=None):
69 screen_position = property
72 return self.ScreenPosition
82 color =
'#' +
''.join(hex(item)[2:]
for item
in self.
color_backgroundcolor_background)
85 self.
_current_details_current_details =
'<body bgcolor=%s>%s</body>' % (color, content)
93 wx.PopupWindow.__init__(self, parent,
94 flags=wx.CAPTION | wx.RESIZE_BORDER | wx.DEFAULT_FRAME_STYLE)
100 component_to_hide = self.
panelpanel
if IS_WINDOWS
else self
101 component_to_hide.Bind(wx.EVT_LEAVE_WINDOW, self.
hidehide)
106 def __init__(self, parent, size, detachable=True, autohide=False):
107 from ..preferences
import RideSettings
111 _settings = RideSettings()
115 RidePopupWindow.__init__(self, parent, size)
116 _PopupWindowBase.__init__(self, size, detachable, autohide, color_background=self.
color_background_helpcolor_background_help,
123 def __init__(self, parent, size, detachable=True, autohide=False):
124 wx.MiniFrame.__init__(self, parent, style=wx.SIMPLE_BORDER
127 self.SetLayoutDirection(wx.Layout_LeftToRight)
128 from ..preferences
import RideSettings
132 _settings = RideSettings()
136 _PopupWindowBase.__init__(self, size, detachable, autohide, color_background=self.
color_background_helpcolor_background_help,
141 self.
_details_details.Bind(wx.EVT_MOTION,
lambda evt: self.
hidehide())
147 if wx.PlatformInfo[0] ==
'__WXMAC__':
148 RidePopupWindow = HtmlPopupWindow = MacRidePopupWindow
149 del MacRidePopupWindow