A bit of cleanup for STC's use of PopupWindow

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52867 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2008-03-27 21:25:03 +00:00
parent 5e328f3879
commit c0a4c58aca
3 changed files with 8 additions and 15 deletions

View File

@@ -39,12 +39,6 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#endif #endif
#endif #endif
//----------------------------------------------------------------------
// Should a wxPopupWindow be used for the call tips and autocomplete windows?
#ifndef wxSTC_USE_POPUP
#define wxSTC_USE_POPUP 1
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// BEGIN generated section. The following code is automatically generated // BEGIN generated section. The following code is automatically generated

View File

@@ -97,14 +97,12 @@ void wxSTCDropTarget::OnLeave() {
#endif // wxUSE_DRAG_AND_DROP #endif // wxUSE_DRAG_AND_DROP
#if wxUSE_POPUPWIN && wxSTC_USE_POPUP #if wxUSE_POPUPWIN
#include "wx/popupwin.h" #include "wx/popupwin.h"
#define wxSTCCallTipBase wxPopupWindow #define wxSTCCallTipBase wxPopupWindow
#define param2 wxBORDER_NONE // popup's 2nd param is flags
#else #else
#include "wx/frame.h" #include "wx/frame.h"
#define wxSTCCallTipBase wxFrame #define wxSTCCallTipBase wxFrame
#define param2 -1 // wxWindow's 2nd param is ID
#endif #endif
#include "wx/dcbuffer.h" #include "wx/dcbuffer.h"
@@ -112,7 +110,7 @@ void wxSTCDropTarget::OnLeave() {
class wxSTCCallTip : public wxSTCCallTipBase { class wxSTCCallTip : public wxSTCCallTipBase {
public: public:
wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx) : wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx) :
#if wxUSE_POPUPWIN && wxSTC_USE_POPUP #if wxUSE_POPUPWIN
wxSTCCallTipBase(parent, wxBORDER_NONE), wxSTCCallTipBase(parent, wxBORDER_NONE),
#else #else
wxSTCCallTipBase(parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSTCCallTipBase(parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize,
@@ -126,10 +124,11 @@ public:
#endif #endif
m_ct(ct), m_swx(swx), m_cx(wxDefaultCoord), m_cy(wxDefaultCoord) m_ct(ct), m_swx(swx), m_cx(wxDefaultCoord), m_cy(wxDefaultCoord)
{ {
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
} }
~wxSTCCallTip() { ~wxSTCCallTip() {
#if wxUSE_POPUPWIN && wxSTC_USE_POPUP && defined(__WXGTK__) #if wxUSE_POPUPWIN && defined(__WXGTK__)
wxRect rect = GetRect(); wxRect rect = GetRect();
rect.x = m_cx; rect.x = m_cx;
rect.y = m_cy; rect.y = m_cy;
@@ -141,7 +140,7 @@ public:
void OnPaint(wxPaintEvent& WXUNUSED(evt)) void OnPaint(wxPaintEvent& WXUNUSED(evt))
{ {
wxBufferedPaintDC dc(this); wxAutoBufferedPaintDC dc(this);
Surface* surfaceWindow = Surface::Allocate(); Surface* surfaceWindow = Surface::Allocate();
surfaceWindow->Init(&dc, m_ct->wDraw.GetID()); surfaceWindow->Init(&dc, m_ct->wDraw.GetID());
m_ct->PaintCT(surfaceWindow); m_ct->PaintCT(surfaceWindow);
@@ -179,7 +178,7 @@ public:
wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags); wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags);
} }
#if wxUSE_POPUPWIN && wxSTC_USE_POPUP #if wxUSE_POPUPWIN
#else #else
virtual bool Show( bool show = true ) virtual bool Show( bool show = true )
{ {
@@ -1129,7 +1128,7 @@ void ScintillaWX::ClipChildren(wxDC& WXUNUSED(dc), PRectangle WXUNUSED(rect))
// if (ct.inCallTipMode) { // if (ct.inCallTipMode) {
// wxSTCCallTip* tip = (wxSTCCallTip*)ct.wCallTip.GetID(); // wxSTCCallTip* tip = (wxSTCCallTip*)ct.wCallTip.GetID();
// wxRect childRect = tip->GetRect(); // wxRect childRect = tip->GetRect();
// #if wxUSE_POPUPWIN && wxSTC_USE_POPUP // #if wxUSE_POPUPWIN
// childRect.SetPosition(tip->GetMyPosition()); // childRect.SetPosition(tip->GetMyPosition());
// #endif // #endif
// rgn.Subtract(childRect); // rgn.Subtract(childRect);

View File

@@ -229,7 +229,7 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
offsetMain = insetX; // initial alignment assuming no arrows offsetMain = insetX; // initial alignment assuming no arrows
PaintContents(surfaceWindow, true); PaintContents(surfaceWindow, true);
#ifndef __APPLE__ #if !defined(__APPLE__) || defined(__WX__)
// OSX doesn't put borders on "help tags" // OSX doesn't put borders on "help tags"
// Draw a raised border around the edges of the window // Draw a raised border around the edges of the window
surfaceWindow->MoveTo(0, rcClientSize.bottom - 1); surfaceWindow->MoveTo(0, rcClientSize.bottom - 1);