#include <wx/wx.h>
#include <wx/dnd.h>
+//----------------------------------------------------------------------
+
+// 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
// by gen_iface.py. Do not edit this file. Edit stc.h.in instead
EVT_SET_FOCUS(wxSTCListBox::OnFocus)
END_EVENT_TABLE()
+#undef wxSTC_USE_POPUP
+#define wxSTC_USE_POPUP 0 // Leave it off for this one...
// A window to place the listbox upon. If wxPopupWindow is supported then
// that will be used so the listbox can extend beyond the client area of the
// wxSTC if needed.
-
-#if wxUSE_POPUPWIN
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
#include <wx/popupwin.h>
#define wxSTCListBoxWinBase wxPopupWindow
#define param2 wxBORDER_NONE // popup's 2nd param is flags
#else
#define wxSTCListBoxWinBase wxWindow
-#define param2 -1 // wxWindows 2nd param is ID
+#define param2 -1 // wxWindow's 2nd param is ID
#endif
class wxSTCListBoxWin : public wxSTCListBoxWinBase {
wxSTCListBoxWin(wxWindow* parent, wxWindowID id)
: wxSTCListBoxWinBase(parent, param2) {
lb = new wxSTCListBox(this, id);
+ lb->SetCursor(wxCursor(wxCURSOR_ARROW));
}
void OnSize(wxSizeEvent& event) {
event.Skip();
}
- wxListBox* GetLB() { return lb; }
+ wxListBox* GetLB() { return lb; }
-#if wxUSE_POPUPWIN
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO) {
rc.left = 0;
if (sz.x > 400)
sz.x = 400;
- if (sz.y > 160) // TODO: Use desiredVisibleRows??
- sz.y = 160;
+ if (sz.y > 140) // TODO: Use desiredVisibleRows??
+ sz.y = 140;
rc.right = sz.x;
rc.bottom = sz.y;
return rc;
#endif
-#if wxUSE_POPUPWIN
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
#include <wx/popupwin.h>
#define wxSTCCallTipBase wxPopupWindow
#define param2 wxBORDER_NONE // popup's 2nd param is flags
delete surfaceWindow;
}
-#if wxUSE_POPUPWIN
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO) {
GetParent()->ClientToScreen(NULL, &y);
wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags);
}
+
+ virtual bool Show( bool show = TRUE ) {
+ bool retval = wxSTCCallTipBase::Show(show);
+ if (show) {
+ CaptureMouse();
+ }
+ else {
+ ReleaseMouse();
+ }
+ return retval;
+ }
+
+ void OnLeftDown(wxMouseEvent& ) {
+ Show(FALSE);
+ }
#endif
private:
BEGIN_EVENT_TABLE(wxSTCCallTip, wxSTCCallTipBase)
EVT_PAINT(wxSTCCallTip::OnPaint)
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
+ EVT_LEFT_DOWN(wxSTCCallTip::OnLeftDown)
+#endif
END_EVENT_TABLE()
#include <wx/wx.h>
#include <wx/dnd.h>
+//----------------------------------------------------------------------
+
+// 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
// by gen_iface.py. Do not edit this file. Edit stc.h.in instead
#include <wx/wx.h>
#include <wx/dnd.h>
+//----------------------------------------------------------------------
+
+// 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
// by gen_iface.py. Do not edit this file. Edit stc.h.in instead
EVT_SET_FOCUS(wxSTCListBox::OnFocus)
END_EVENT_TABLE()
+#undef wxSTC_USE_POPUP
+#define wxSTC_USE_POPUP 0 // Leave it off for this one...
// A window to place the listbox upon. If wxPopupWindow is supported then
// that will be used so the listbox can extend beyond the client area of the
// wxSTC if needed.
-
-#if wxUSE_POPUPWIN
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
#include <wx/popupwin.h>
#define wxSTCListBoxWinBase wxPopupWindow
#define param2 wxBORDER_NONE // popup's 2nd param is flags
#else
#define wxSTCListBoxWinBase wxWindow
-#define param2 -1 // wxWindows 2nd param is ID
+#define param2 -1 // wxWindow's 2nd param is ID
#endif
class wxSTCListBoxWin : public wxSTCListBoxWinBase {
wxSTCListBoxWin(wxWindow* parent, wxWindowID id)
: wxSTCListBoxWinBase(parent, param2) {
lb = new wxSTCListBox(this, id);
+ lb->SetCursor(wxCursor(wxCURSOR_ARROW));
}
void OnSize(wxSizeEvent& event) {
event.Skip();
}
- wxListBox* GetLB() { return lb; }
+ wxListBox* GetLB() { return lb; }
-#if wxUSE_POPUPWIN
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO) {
rc.left = 0;
if (sz.x > 400)
sz.x = 400;
- if (sz.y > 160) // TODO: Use desiredVisibleRows??
- sz.y = 160;
+ if (sz.y > 140) // TODO: Use desiredVisibleRows??
+ sz.y = 140;
rc.right = sz.x;
rc.bottom = sz.y;
return rc;
#endif
-#if wxUSE_POPUPWIN
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
#include <wx/popupwin.h>
#define wxSTCCallTipBase wxPopupWindow
#define param2 wxBORDER_NONE // popup's 2nd param is flags
delete surfaceWindow;
}
-#if wxUSE_POPUPWIN
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO) {
GetParent()->ClientToScreen(NULL, &y);
wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags);
}
+
+ virtual bool Show( bool show = TRUE ) {
+ bool retval = wxSTCCallTipBase::Show(show);
+ if (show) {
+ CaptureMouse();
+ }
+ else {
+ ReleaseMouse();
+ }
+ return retval;
+ }
+
+ void OnLeftDown(wxMouseEvent& ) {
+ Show(FALSE);
+ }
#endif
private:
BEGIN_EVENT_TABLE(wxSTCCallTip, wxSTCCallTipBase)
EVT_PAINT(wxSTCCallTip::OnPaint)
+#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
+ EVT_LEFT_DOWN(wxSTCCallTip::OnLeftDown)
+#endif
END_EVENT_TABLE()
#include <wx/wx.h>
#include <wx/dnd.h>
+//----------------------------------------------------------------------
+
+// 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
// by gen_iface.py. Do not edit this file. Edit stc.h.in instead
SWIG_globals = SWIG_newvarlink();
m = Py_InitModule("stc_c", stc_cMethods);
d = PyModule_GetDict(m);
+ PyDict_SetItemString(d,"wxSTC_USE_POPUP", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxSTC_INVALID_POSITION", PyInt_FromLong((long) -1));
PyDict_SetItemString(d,"wxSTC_START", PyInt_FromLong((long) 2000));
PyDict_SetItemString(d,"wxSTC_OPTIONAL_START", PyInt_FromLong((long) 3000));
#-------------- VARIABLE WRAPPERS ------------------
+wxSTC_USE_POPUP = stc_c.wxSTC_USE_POPUP
wxSTC_INVALID_POSITION = stc_c.wxSTC_INVALID_POSITION
wxSTC_START = stc_c.wxSTC_START
wxSTC_OPTIONAL_START = stc_c.wxSTC_OPTIONAL_START