diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 2d1386c142..4462bf11f4 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -3592,13 +3592,8 @@ public: bool DoDropText(long x, long y, const wxString& data); #endif - // Specify whether anti-aliased fonts should be used. Will have no effect - // on some platforms, but on some (wxMac for example) can greatly improve - // performance. - void SetUseAntiAliasing(bool useAA); - - // Returns the current UseAntiAliasing setting. - bool GetUseAntiAliasing(); + void SetUseAntiAliasing(bool WXUNUSED(useAA)) { } + bool GetUseAntiAliasing() { return true; } diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index a58a60d8f5..d6e45790c2 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -160,7 +160,6 @@ void Font::Create(const char *faceName, int characterSet, false, stc2wx(faceName), encoding); - font->SetNoAntiAliasing(!extraFontFlag); id = font; } diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 879d5f1ab1..93f6e52062 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -81,6 +81,7 @@ void wxSTCDropTarget::OnLeave() { } #endif // wxUSE_DRAG_AND_DROP +//-------------------------------------------------------------------------- #if wxUSE_POPUPWIN #include "wx/popupwin.h" @@ -92,33 +93,14 @@ void wxSTCDropTarget::OnLeave() { #include "wx/dcbuffer.h" -class wxSTCCallTip : public wxSTCCallTipBase { -public: - 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 +class wxSTCCallTipContent : public wxPanel { +public: + wxSTCCallTipContent(wxWindow* parent, CallTip* ct, ScintillaWX* swx) + : wxPanel(parent, -1), + m_ct(ct), m_swx(swx) + { + SetBackgroundStyle(wxBG_STYLE_CUSTOM); } bool AcceptsFocus() const { return false; } @@ -135,7 +117,7 @@ public: void OnFocus(wxFocusEvent& event) { - GetParent()->SetFocus(); + GetGrandParent()->SetFocus(); event.Skip(); } @@ -146,6 +128,52 @@ public: m_ct->MouseClick(p); m_swx->CallTipClick(); } + +private: + CallTip* m_ct; + ScintillaWX* m_swx; + DECLARE_EVENT_TABLE() +}; + + +BEGIN_EVENT_TABLE(wxSTCCallTipContent, wxPanel) + EVT_PAINT(wxSTCCallTipContent::OnPaint) + EVT_SET_FOCUS(wxSTCCallTipContent::OnFocus) + EVT_LEFT_DOWN(wxSTCCallTipContent::OnLeftDown) +END_EVENT_TABLE() + + + +class wxSTCCallTip : public wxSTCCallTipBase { +public: + 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_cx(wxDefaultCoord), m_cy(wxDefaultCoord) + { + m_content = new wxSTCCallTipContent(this, ct, swx); + } + + ~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; } virtual void DoSetSize(int x, int y, int width, int height, @@ -161,6 +189,8 @@ public: GetParent()->ClientToScreen(NULL, &y); } wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags); + + m_content->SetSize(0, 0, width, height, sizeFlags); } #if wxUSE_POPUPWIN @@ -187,17 +217,10 @@ public: } private: - CallTip* m_ct; - ScintillaWX* m_swx; int m_cx, m_cy; - DECLARE_EVENT_TABLE() + wxSTCCallTipContent* m_content; }; -BEGIN_EVENT_TABLE(wxSTCCallTip, wxSTCCallTipBase) - EVT_PAINT(wxSTCCallTip::OnPaint) - EVT_SET_FOCUS(wxSTCCallTip::OnFocus) - EVT_LEFT_DOWN(wxSTCCallTip::OnLeftDown) -END_EVENT_TABLE() //---------------------------------------------------------------------- @@ -252,6 +275,7 @@ ScintillaWX::~ScintillaWX() { Finalise(); } + //---------------------------------------------------------------------- // base class virtuals @@ -263,7 +287,6 @@ void ScintillaWX::Initialise() { dropTarget->SetScintilla(this); stc->SetDropTarget(dropTarget); #endif // wxUSE_DRAG_AND_DROP - vs.extraFontFlag = true; // UseAntiAliasing } @@ -1097,15 +1120,6 @@ void ScintillaWX::ClipChildren(wxDC& WXUNUSED(dc), PRectangle WXUNUSED(rect)) } -void ScintillaWX::SetUseAntiAliasing(bool useAA) { - vs.extraFontFlag = useAA; - InvalidateStyleRedraw(); -} - -bool ScintillaWX::GetUseAntiAliasing() { - return vs.extraFontFlag; -} - //---------------------------------------------------------------------- //---------------------------------------------------------------------- diff --git a/src/stc/ScintillaWX.h b/src/stc/ScintillaWX.h index 576229389b..be0c67cd26 100644 --- a/src/stc/ScintillaWX.h +++ b/src/stc/ScintillaWX.h @@ -168,8 +168,6 @@ public: void DoScrollToLine(int line); void DoScrollToColumn(int column); void ClipChildren(wxDC& dc, PRectangle rect); - void SetUseAntiAliasing(bool useAA); - bool GetUseAntiAliasing(); private: bool capturedMouse; @@ -193,7 +191,7 @@ private: int sysCaretHeight; #endif - friend class wxSTCCallTip; + friend class wxSTCCallTipContent; }; //---------------------------------------------------------------------- diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 452a30f9fd..4ec829b704 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -3580,17 +3580,6 @@ bool wxStyledTextCtrl::DoDropText(long x, long y, const wxString& data) { #endif -void wxStyledTextCtrl::SetUseAntiAliasing(bool useAA) { - m_swx->SetUseAntiAliasing(useAA); -} - -bool wxStyledTextCtrl::GetUseAntiAliasing() { - return m_swx->GetUseAntiAliasing(); -} - - - - void wxStyledTextCtrl::AddTextRaw(const char* text) { diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 2d23345d91..829232b535 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -589,17 +589,6 @@ bool wxStyledTextCtrl::DoDropText(long x, long y, const wxString& data) { #endif -void wxStyledTextCtrl::SetUseAntiAliasing(bool useAA) { - m_swx->SetUseAntiAliasing(useAA); -} - -bool wxStyledTextCtrl::GetUseAntiAliasing() { - return m_swx->GetUseAntiAliasing(); -} - - - - void wxStyledTextCtrl::AddTextRaw(const char* text) { diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index 6398adbc8f..740f9e374a 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -228,13 +228,8 @@ public: bool DoDropText(long x, long y, const wxString& data); #endif - // Specify whether anti-aliased fonts should be used. Will have no effect - // on some platforms, but on some (wxMac for example) can greatly improve - // performance. - void SetUseAntiAliasing(bool useAA); - - // Returns the current UseAntiAliasing setting. - bool GetUseAntiAliasing(); + void SetUseAntiAliasing(bool WXUNUSED(useAA)) { } + bool GetUseAntiAliasing() { return true; }