1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface defs for wxPopupWindow and derived classes
7 // Created: 22-Dec-1998
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
19 #include <wx/popupwin.h>
22 //---------------------------------------------------------------------------
27 // wxPopupWindow: a special kind of top level window used for popup menus,
28 // combobox popups and such.
29 class wxPopupWindow : public wxWindow {
31 %addtofunc wxPopupWindow "self._setOORInfo(self)"
32 %addtofunc wxPopupWindow() ""
34 wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
35 %name(PrePopupWindow)wxPopupWindow();
37 bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
39 // move the popup window to the right position, i.e. such that it is
42 // the popup is positioned at ptOrigin + size if it opens below and to the
43 // right (default), at ptOrigin - sizePopup if it opens above and to the
46 // the point must be given in screen coordinates!
47 void Position(const wxPoint& ptOrigin,
52 //---------------------------------------------------------------------------
56 class wxPyPopupTransientWindow : public wxPopupTransientWindow
59 wxPyPopupTransientWindow() : wxPopupTransientWindow() {}
60 wxPyPopupTransientWindow(wxWindow* parent, int style = wxBORDER_NONE)
61 : wxPopupTransientWindow(parent, style) {}
63 DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown);
64 DEC_PYCALLBACK__(OnDismiss);
65 DEC_PYCALLBACK_BOOL_(CanDismiss);
70 IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown);
71 IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss);
72 IMP_PYCALLBACK_BOOL_(wxPyPopupTransientWindow, wxPopupTransientWindow, CanDismiss);
77 // wxPopupTransientWindow: a wxPopupWindow which disappears automatically
78 // when the user clicks mouse outside it or if it loses focus in any other way
79 %name(PopupTransientWindow) class wxPyPopupTransientWindow : public wxPopupWindow
82 %addtofunc wxPyPopupTransientWindow "self._setOORInfo(self);self._setCallbackInfo(self, PopupTransientWindow)"
83 %addtofunc wxPyPopupTransientWindow() ""
85 wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
86 %name(PrePopupTransientWindow)wxPyPopupTransientWindow();
88 void _setCallbackInfo(PyObject* self, PyObject* _class);
90 // popup the window (this will show it too) and keep focus at winFocus
91 // (or itself if it's NULL), dismiss the popup if we lose focus
92 virtual void Popup(wxWindow *focus = NULL);
95 virtual void Dismiss();
98 //---------------------------------------------------------------------------
102 #else // On Mac we need to provide dummy classes to keep the renamers in sync
104 class wxPopupWindow : public wxWindow {
106 wxPopupWindow(wxWindow *, int) { PyErr_SetNone(PyExc_NotImplementedError); }
107 wxPopupWindow() { PyErr_SetNone(PyExc_NotImplementedError); }
110 class wxPyPopupTransientWindow : public wxPopupWindow
113 wxPyPopupTransientWindow(wxWindow *, int) { PyErr_SetNone(PyExc_NotImplementedError); }
114 wxPyPopupTransientWindow() { PyErr_SetNone(PyExc_NotImplementedError); }
119 class wxPopupWindow : public wxWindow {
121 wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
122 %name(PrePopupWindow)wxPopupWindow();
125 %name(PopupTransientWindow) class wxPyPopupTransientWindow : public wxPopupWindow
128 wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
129 %name(PrePopupTransientWindow)wxPyPopupTransientWindow();
134 //---------------------------------------------------------------------------