]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/stc/ScintillaWX.cpp
removed enum that was causing more problems than it was worth
[wxWidgets.git] / contrib / src / stc / ScintillaWX.cpp
index 62ac066fb93b56683f92c7cbea8410d0002f8613..de7f683e540f18f8085990e214b14d5357ee5827 100644 (file)
@@ -1,6 +1,6 @@
 ////////////////////////////////////////////////////////////////////////////
 // Name:        ScintillaWX.cxx
-// Purpose:     A wxWindows implementation of Scintilla.  A class derived
+// Purpose:     A wxWidgets implementation of Scintilla.  A class derived
 //              from ScintillaBase that uses the "wx platform" defined in
 //              PlatformWX.cxx  This class is one end of a bridge between
 //              the wx world and the Scintilla world.  It needs a peer
@@ -67,6 +67,8 @@ void  wxSTCDropTarget::OnLeave() {
 #define param2 -1 // wxWindow's 2nd param is ID
 #endif
 
+#include <wx/dcbuffer.h>
+
 class wxSTCCallTip : public wxSTCCallTipBase {
 public:
     wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx)
@@ -76,12 +78,17 @@ public:
         }
 
     ~wxSTCCallTip() {
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP && defined(__WXGTK__)
+        wxRect rect = GetRect();
+        GetParent()->ScreenToClient(&rect.x, &rect.y);
+        GetParent()->Refresh(false, &rect);
+#endif
     }
 
     bool AcceptsFocus() const { return FALSE; }
 
     void OnPaint(wxPaintEvent& WXUNUSED(evt)) {
-        wxPaintDC dc(this);
+        wxBufferedPaintDC dc(this);
         Surface* surfaceWindow = Surface::Allocate();
         surfaceWindow->Init(&dc, m_ct->wDraw.GetID());
         m_ct->PaintCT(surfaceWindow);
@@ -547,7 +554,7 @@ void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) {
     if (paintState == paintAbandoned) {
         // Painting area was insufficient to cover new styling or brace
         // highlight positions
-        FullPaint(dc);
+        FullPaint();
     }
     paintState = notPainting;
     dc->EndDrawing();
@@ -862,7 +869,7 @@ void ScintillaWX::DoDragLeave() {
 //----------------------------------------------------------------------
 
 // Force the whole window to be repainted
-void ScintillaWX::FullPaint(wxDC *dc) {
+void ScintillaWX::FullPaint() {
     stc->Refresh(false);
     stc->Update();
 }
@@ -885,7 +892,11 @@ void ScintillaWX::ClipChildren(wxDC& dc, PRectangle rect) {
         rgn.Subtract(childRect);
     }
     if (ct.inCallTipMode) {
-        wxRect childRect = ((wxWindow*)ct.wCallTip.GetID())->GetRect();
+        wxWindow* tip = (wxWindow*)ct.wCallTip.GetID();
+        wxRect childRect = tip->GetRect();
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
+        tip->GetParent()->ScreenToClient(&childRect.x, &childRect.y);
+#endif
         rgn.Subtract(childRect);
     }