+ wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx) :
+#if wxUSE_POPUPWIN
+ wxSTCCallTipBase(parent, wxBORDER_NONE),
+#else
+ wxSTCCallTipBase(parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize,
+ wxFRAME_NO_TASKBAR
+ | wxFRAME_FLOAT_ON_PARENT
+ | wxBORDER_NONE
+#ifdef __WXMAC__
+ | wxPOPUP_WINDOW
+#endif
+ ),
+#endif
+ m_ct(ct), m_swx(swx), m_cx(wxDefaultCoord), m_cy(wxDefaultCoord)
+ {
+ SetBackgroundStyle(wxBG_STYLE_CUSTOM);
+ }
+
+ ~wxSTCCallTip() {
+#if wxUSE_POPUPWIN && defined(__WXGTK__)
+ wxRect rect = GetRect();
+ rect.x = m_cx;
+ rect.y = m_cy;
+ GetParent()->Refresh(false, &rect);
+#endif
+ }
+
+ bool AcceptsFocus() const { return false; }
+
+ void OnPaint(wxPaintEvent& WXUNUSED(evt))
+ {
+ wxAutoBufferedPaintDC dc(this);
+ Surface* surfaceWindow = Surface::Allocate();
+ surfaceWindow->Init(&dc, m_ct->wDraw.GetID());
+ m_ct->PaintCT(surfaceWindow);
+ surfaceWindow->Release();
+ delete surfaceWindow;
+ }
+
+ void OnFocus(wxFocusEvent& event)
+ {
+ GetParent()->SetFocus();
+ event.Skip();
+ }
+
+ void OnLeftDown(wxMouseEvent& event)
+ {
+ wxPoint pt = event.GetPosition();
+ Point p(pt.x, pt.y);
+ m_ct->MouseClick(p);
+ m_swx->CallTipClick();
+ }
+
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO)
+ {
+ // convert coords to screen coords since we're a top-level window
+ if (x != wxDefaultCoord) {
+ m_cx = x;
+ GetParent()->ClientToScreen(&x, NULL);
+ }
+ if (y != wxDefaultCoord) {
+ m_cy = y;
+ GetParent()->ClientToScreen(NULL, &y);
+ }
+ wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags);
+ }
+
+#if wxUSE_POPUPWIN
+#else
+ virtual bool Show( bool show = true )
+ {
+ // Although we're a frame, we always want the parent to be active, so
+ // raise it whenever we get shown.
+ bool rv = wxSTCCallTipBase::Show(show);
+ if (rv && show)