#pragma hdrstop
#endif
+#if wxUSE_STC
#ifndef WX_PRECOMP
+ #include "wx/scrolbar.h"
+ #include "wx/menu.h"
+ #include "wx/timer.h"
#endif // WX_PRECOMP
#include "wx/textbuf.h"
#include "ScintillaWX.h"
#include "ExternalLexer.h"
#include "wx/stc/stc.h"
+#include "wx/stc/private.h"
#include "PlatWX.h"
#ifdef __WXMSW__
class wxSTCTimer : public wxTimer {
public:
wxSTCTimer(ScintillaWX* swx) {
- this->swx = swx;
+ m_swx = swx;
}
void Notify() {
- swx->DoTick();
+ m_swx->DoTick();
}
private:
- ScintillaWX* swx;
+ ScintillaWX* m_swx;
};
class wxStartDragTimer : public wxTimer {
public:
wxStartDragTimer(ScintillaWX* swx) {
- this->swx = swx;
+ m_swx = swx;
}
void Notify() {
- swx->DoStartDrag();
+ m_swx->DoStartDrag();
}
private:
- ScintillaWX* swx;
+ ScintillaWX* m_swx;
};
bool wxSTCDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) {
- return swx->DoDropText(x, y, data);
+ return m_swx->DoDropText(x, y, data);
}
wxDragResult wxSTCDropTarget::OnEnter(wxCoord x, wxCoord y, wxDragResult def) {
- return swx->DoDragEnter(x, y, def);
+ return m_swx->DoDragEnter(x, y, def);
}
wxDragResult wxSTCDropTarget::OnDragOver(wxCoord x, wxCoord y, wxDragResult def) {
- return swx->DoDragOver(x, y, def);
+ return m_swx->DoDragOver(x, y, def);
}
void wxSTCDropTarget::OnLeave() {
- swx->DoDragLeave();
+ m_swx->DoDragLeave();
}
#endif // wxUSE_DRAG_AND_DROP
-#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
-#include <wx/popupwin.h>
+#if wxUSE_POPUPWIN
+#include "wx/popupwin.h"
#define wxSTCCallTipBase wxPopupWindow
-#define param2 wxBORDER_NONE // popup's 2nd param is flags
#else
+#include "wx/frame.h"
#define wxSTCCallTipBase wxFrame
-#define param2 -1 // wxWindow's 2nd param is ID
#endif
-#include <wx/dcbuffer.h>
+#include "wx/dcbuffer.h"
class wxSTCCallTip : public wxSTCCallTipBase {
public:
wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx) :
-#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
+#if wxUSE_POPUPWIN
wxSTCCallTipBase(parent, wxBORDER_NONE),
#else
wxSTCCallTipBase(parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize,
#endif
m_ct(ct), m_swx(swx), m_cx(wxDefaultCoord), m_cy(wxDefaultCoord)
{
+ SetBackgroundStyle(wxBG_STYLE_CUSTOM);
}
~wxSTCCallTip() {
-#if wxUSE_POPUPWIN && wxSTC_USE_POPUP && defined(__WXGTK__)
+#if wxUSE_POPUPWIN && defined(__WXGTK__)
wxRect rect = GetRect();
rect.x = m_cx;
rect.y = m_cy;
void OnPaint(wxPaintEvent& WXUNUSED(evt))
{
- wxBufferedPaintDC dc(this);
+ wxAutoBufferedPaintDC dc(this);
Surface* surfaceWindow = Surface::Allocate();
surfaceWindow->Init(&dc, m_ct->wDraw.GetID());
m_ct->PaintCT(surfaceWindow);
wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags);
}
-#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
+#if wxUSE_POPUPWIN
#else
virtual bool Show( bool show = true )
{
result = source.DoDragDrop(evt.GetDragAllowMove());
if (result == wxDragMove && dropWentOutside)
ClearSelection();
- inDragDrop = false;
+ inDragDrop = ddNone;
SetDragPosition(invalidPosition);
}
#endif // wxUSE_DRAG_AND_DROP
// if (ct.inCallTipMode) {
// wxSTCCallTip* tip = (wxSTCCallTip*)ct.wCallTip.GetID();
// wxRect childRect = tip->GetRect();
-// #if wxUSE_POPUPWIN && wxSTC_USE_POPUP
+// #if wxUSE_POPUPWIN
// childRect.SetPosition(tip->GetMyPosition());
// #endif
// rgn.Subtract(childRect);
//----------------------------------------------------------------------
//----------------------------------------------------------------------
+
+#endif // wxUSE_STC