]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_popupwin.i
added a test to check how exception handling works with Win32 SEH; corrected copyright
[wxWidgets.git] / wxPython / src / _popupwin.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _popupwin.i
3// Purpose: SWIG interface defs for wxPopupWindow and derived classes
4//
5// Author: Robin Dunn
6//
7// Created: 22-Dec-1998
8// RCS-ID: $Id$
9// Copyright: (c) 2003 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13// Not a %module
14
15
16//---------------------------------------------------------------------------
17
18%{
19#include <wx/popupwin.h>
20%}
21
22//---------------------------------------------------------------------------
23#ifndef __WXMAC__
24%newgroup;
25
ab1f7d2a 26MustHaveApp(wxPopupWindow);
d14a1e28
RD
27
28// wxPopupWindow: a special kind of top level window used for popup menus,
29// combobox popups and such.
ab1f7d2a
RD
30MustHaveApp(wxPopupWindow);
31
d14a1e28
RD
32class wxPopupWindow : public wxWindow {
33public:
2b9048c5
RD
34 %pythonAppend wxPopupWindow "self._setOORInfo(self)"
35 %pythonAppend wxPopupWindow() ""
d14a1e28
RD
36
37 wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
1b8c7ba6 38 %RenameCtor(PrePopupWindow, wxPopupWindow());
d14a1e28
RD
39
40 bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
41
42 // move the popup window to the right position, i.e. such that it is
43 // entirely visible
44 //
45 // the popup is positioned at ptOrigin + size if it opens below and to the
46 // right (default), at ptOrigin - sizePopup if it opens above and to the
47 // left &c
48 //
49 // the point must be given in screen coordinates!
50 void Position(const wxPoint& ptOrigin,
51 const wxSize& size);
52};
53
54
55//---------------------------------------------------------------------------
56%newgroup;
57
58%{
59class wxPyPopupTransientWindow : public wxPopupTransientWindow
60{
61public:
62 wxPyPopupTransientWindow() : wxPopupTransientWindow() {}
63 wxPyPopupTransientWindow(wxWindow* parent, int style = wxBORDER_NONE)
64 : wxPopupTransientWindow(parent, style) {}
65
66 DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown);
67 DEC_PYCALLBACK__(OnDismiss);
68 DEC_PYCALLBACK_BOOL_(CanDismiss);
69 PYPRIVATE;
70};
71
72
73IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown);
74IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss);
75IMP_PYCALLBACK_BOOL_(wxPyPopupTransientWindow, wxPopupTransientWindow, CanDismiss);
76%}
77
78
ab1f7d2a 79MustHaveApp(wxPyPopupTransientWindow);
d14a1e28
RD
80
81// wxPopupTransientWindow: a wxPopupWindow which disappears automatically
82// when the user clicks mouse outside it or if it loses focus in any other way
ab1f7d2a 83
1b8c7ba6
RD
84%rename(PopupTransientWindow) wxPyPopupTransientWindow;
85class wxPyPopupTransientWindow : public wxPopupWindow
d14a1e28
RD
86{
87public:
2b9048c5
RD
88 %pythonAppend wxPyPopupTransientWindow "self._setOORInfo(self);self._setCallbackInfo(self, PopupTransientWindow)"
89 %pythonAppend wxPyPopupTransientWindow() ""
d14a1e28
RD
90
91 wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
1b8c7ba6 92 %RenameCtor(PrePopupTransientWindow, wxPyPopupTransientWindow());
d14a1e28
RD
93
94 void _setCallbackInfo(PyObject* self, PyObject* _class);
95
96 // popup the window (this will show it too) and keep focus at winFocus
97 // (or itself if it's NULL), dismiss the popup if we lose focus
98 virtual void Popup(wxWindow *focus = NULL);
99
100 // hide the window
101 virtual void Dismiss();
102};
103
104//---------------------------------------------------------------------------
105
106
107
108#else // On Mac we need to provide dummy classes to keep the renamers in sync
109%{
110class wxPopupWindow : public wxWindow {
111public:
81cfe5e1
RD
112 wxPopupWindow(wxWindow *, int) { wxPyRaiseNotImplemented(); }
113 wxPopupWindow() { wxPyRaiseNotImplemented(); }
d14a1e28
RD
114};
115
116class wxPyPopupTransientWindow : public wxPopupWindow
117{
118public:
81cfe5e1
RD
119 wxPyPopupTransientWindow(wxWindow *, int) { wxPyRaiseNotImplemented(); }
120 wxPyPopupTransientWindow() { wxPyRaiseNotImplemented(); }
d14a1e28
RD
121};
122%}
123
124
125class wxPopupWindow : public wxWindow {
126public:
127 wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
1b8c7ba6 128 %RenameCtor(PrePopupWindow, wxPopupWindow());
d14a1e28
RD
129};
130
1b8c7ba6
RD
131%rename(PopupTransientWindow) wxPyPopupTransientWindow;
132class wxPyPopupTransientWindow : public wxPopupWindow
d14a1e28
RD
133{
134public:
135 wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
1b8c7ba6 136 %RenameCtor(PrePopupTransientWindow, wxPyPopupTransientWindow());
d14a1e28
RD
137};
138
139
140#endif
141//---------------------------------------------------------------------------