1 #############################################################################
2 ## Name: XS/PopupWindow.xsp
3 ## Purpose: XS++ for Wx::PopupWindow and Wx::PopupTransientWindow
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: PopupWindow.xsp 2079 2007-07-08 21:18:04Z mbarbon $
8 ## Copyright: (c) 2005-2006 Mattia Barbon
9 ## Licence: This program is free software; you can redistribute it and/or
10 ## modify it under the same terms as Perl itself
11 #############################################################################
17 %typemap{wxPopupWindow*}{simple};
18 %typemap{wxPopupTransientWindow*}{simple};
19 %typemap{wxPlPopupTransientWindow*}{simple};
20 %typemap{wxMouseEvent&}{reference};
23 #include "wx/popupwin.h"
24 #include "cpp/popupwin.h"
27 %file{cpp/popupwin.h};
30 #define DEC_V_CBACK_BOOL__WXMOUSEEVENT( METHOD ) \
31 bool METHOD( wxMouseEvent& event )
33 #define DEF_V_CBACK_BOOL__WXMOUSEEVENT( CLASS, BASE, METHOD ) \
34 bool CLASS::METHOD( wxMouseEvent& param1 ) \
37 if( wxPliFCback( aTHX_ &m_callback, #METHOD ) ) \
39 wxAutoSV evt( aTHX_ wxPli_object_2_sv( aTHX_ newSViv( 0 ), ¶m1 ));\
40 wxAutoSV ret( aTHX_ wxPliCCback( aTHX_ &m_callback, G_SCALAR, \
42 sv_setiv( SvRV( evt ), 0 ); \
43 return SvTRUE( ret ); \
45 return BASE::METHOD( param1 ); \
48 class wxPlPopupTransientWindow : public wxPopupTransientWindow
50 WXPLI_DECLARE_DYNAMIC_CLASS( wxPlPopupTransientWindow );
51 WXPLI_DECLARE_V_CBACK();
53 WXPLI_DEFAULT_CONSTRUCTOR( wxPlPopupTransientWindow,
54 "Wx::PlPopupTransientWindow", true );
55 WXPLI_CONSTRUCTOR_2( wxPlPopupTransientWindow,
56 "Wx::PlPopupTransientWindow", true,
59 DEC_V_CBACK_VOID__WXWINDOW( Popup );
60 DEC_V_CBACK_VOID__VOID( Dismiss );
61 DEC_V_CBACK_BOOL__VOID( CanDismiss );
62 DEC_V_CBACK_BOOL__WXMOUSEEVENT( ProcessLeftDown );
63 DEC_V_CBACK_BOOL__BOOL( Show );
66 DEF_V_CBACK_VOID__WXWINDOW( wxPlPopupTransientWindow,
67 wxPopupTransientWindow, Popup );
68 DEF_V_CBACK_VOID__VOID( wxPlPopupTransientWindow,
69 wxPopupTransientWindow, Dismiss );
70 DEF_V_CBACK_BOOL__VOID( wxPlPopupTransientWindow,
71 wxPopupTransientWindow, CanDismiss );
72 DEF_V_CBACK_BOOL__WXMOUSEEVENT( wxPlPopupTransientWindow,
73 wxPopupTransientWindow, ProcessLeftDown );
74 DEF_V_CBACK_BOOL__BOOL( wxPlPopupTransientWindow,
75 wxPopupTransientWindow, Show );
77 WXPLI_IMPLEMENT_DYNAMIC_CLASS( wxPlPopupTransientWindow,
78 wxPopupTransientWindow );
83 %name{Wx::PopupWindow} class wxPopupWindow
85 %name{newDefault} wxPopupWindow()
86 %code{% RETVAL = new wxPopupWindow();
87 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
89 %name{newFull} wxPopupWindow( wxWindow *parent, int flags = wxBORDER_NONE )
90 %code{% RETVAL = new wxPopupWindow( parent, flags );
91 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
94 bool Create( wxWindow *parent, int flags = wxBORDER_NONE );
96 void Position( const wxPoint& ptOrigin, const wxSize& size );
104 MATCH_VOIDM_REDISP( newDefault )
105 MATCH_ANY_REDISP( newFull )
106 END_OVERLOAD( "Wx::PopupWindow::new" )
109 %name{Wx::PopupTransientWindow} class wxPopupTransientWindow
111 %name{newDefault} wxPopupTransientWindow()
112 %code{% RETVAL = new wxPopupTransientWindow();
113 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
115 %name{newFull} wxPopupTransientWindow( wxWindow *parent,
116 int flags = wxBORDER_NONE )
117 %code{% RETVAL = new wxPopupTransientWindow( parent, flags );
118 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
121 void Popup( wxWindow *focus = NULL );
124 bool ProcessLeftDown( wxMouseEvent& event );
132 MATCH_VOIDM_REDISP( newDefault )
133 MATCH_ANY_REDISP( newFull )
134 END_OVERLOAD( "Wx::PopupTransientWindow::new" )
136 #define Popup wxPopupTransientWindow::Popup
137 #define Dismiss wxPopupTransientWindow::Dismiss
138 #define CanDismiss wxPopupTransientWindow::CanDismiss
139 #define ProcessLeftDown wxPopupTransientWindow::ProcessLeftDown
142 %name{Wx::PlPopupTransientWindow} class wxPlPopupTransientWindow
144 %name{newDefault} wxPlPopupTransientWindow()
145 %code{% RETVAL = new wxPlPopupTransientWindow( CLASS );
146 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
148 %name{newFull} wxPlPopupTransientWindow( wxWindow *parent,
149 int flags = wxBORDER_NONE )
150 %code{% RETVAL = new wxPlPopupTransientWindow( CLASS, parent, flags );
151 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
154 void Popup( wxWindow *focus = NULL );
157 bool ProcessLeftDown( wxMouseEvent& event );
164 #undef ProcessLeftDown
170 MATCH_VOIDM_REDISP( newDefault )
171 MATCH_ANY_REDISP( newFull )
172 END_OVERLOAD( "Wx::PlPopupTransientWindow::new" )
174 #endif // wxUSE_POPUPWIN