]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_popupwin.i
wx.App
[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
26
27// wxPopupWindow: a special kind of top level window used for popup menus,
28// combobox popups and such.
29class wxPopupWindow : public wxWindow {
30public:
31 %addtofunc wxPopupWindow "self._setOORInfo(self)"
32 %addtofunc wxPopupWindow() ""
33
34 wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
35 %name(PrePopupWindow)wxPopupWindow();
36
37 bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
38
39 // move the popup window to the right position, i.e. such that it is
40 // entirely visible
41 //
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
44 // left &c
45 //
46 // the point must be given in screen coordinates!
47 void Position(const wxPoint& ptOrigin,
48 const wxSize& size);
49};
50
51
52//---------------------------------------------------------------------------
53%newgroup;
54
55%{
56class wxPyPopupTransientWindow : public wxPopupTransientWindow
57{
58public:
59 wxPyPopupTransientWindow() : wxPopupTransientWindow() {}
60 wxPyPopupTransientWindow(wxWindow* parent, int style = wxBORDER_NONE)
61 : wxPopupTransientWindow(parent, style) {}
62
63 DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown);
64 DEC_PYCALLBACK__(OnDismiss);
65 DEC_PYCALLBACK_BOOL_(CanDismiss);
66 PYPRIVATE;
67};
68
69
70IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown);
71IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss);
72IMP_PYCALLBACK_BOOL_(wxPyPopupTransientWindow, wxPopupTransientWindow, CanDismiss);
73%}
74
75
76
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
80{
81public:
82 %addtofunc wxPyPopupTransientWindow "self._setOORInfo(self);self._setCallbackInfo(self, PopupTransientWindow)"
83 %addtofunc wxPyPopupTransientWindow() ""
84
85 wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
86 %name(PrePopupTransientWindow)wxPyPopupTransientWindow();
87
88 void _setCallbackInfo(PyObject* self, PyObject* _class);
89
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);
93
94 // hide the window
95 virtual void Dismiss();
96};
97
98//---------------------------------------------------------------------------
99
100
101
102#else // On Mac we need to provide dummy classes to keep the renamers in sync
103%{
104class wxPopupWindow : public wxWindow {
105public:
81cfe5e1
RD
106 wxPopupWindow(wxWindow *, int) { wxPyRaiseNotImplemented(); }
107 wxPopupWindow() { wxPyRaiseNotImplemented(); }
d14a1e28
RD
108};
109
110class wxPyPopupTransientWindow : public wxPopupWindow
111{
112public:
81cfe5e1
RD
113 wxPyPopupTransientWindow(wxWindow *, int) { wxPyRaiseNotImplemented(); }
114 wxPyPopupTransientWindow() { wxPyRaiseNotImplemented(); }
d14a1e28
RD
115};
116%}
117
118
119class wxPopupWindow : public wxWindow {
120public:
121 wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
122 %name(PrePopupWindow)wxPopupWindow();
123};
124
125%name(PopupTransientWindow) class wxPyPopupTransientWindow : public wxPopupWindow
126{
127public:
128 wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
129 %name(PrePopupTransientWindow)wxPyPopupTransientWindow();
130};
131
132
133#endif
134//---------------------------------------------------------------------------