1 #############################################################################
2 ## Name: XS/VListBox.xsp
3 ## Purpose: XS++ for Wx::VListBox
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: VListBox.xsp 2191 2007-08-21 21:20:59Z mbarbon $
8 ## Copyright: (c) 2006-2007 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 #############################################################################
15 %typemap{wxVListBox*}{simple};
16 %typemap{wxPlVListBox*}{simple};
18 #if WXPERL_W_VERSION_GE( 2, 5, 0 )
22 %name{Wx::VListBox} class wxVListBox
24 bool Create( wxWindow *parent, wxWindowID id = wxID_ANY,
25 const wxPoint& pos = wxDefaultPosition,
26 const wxSize& size = wxDefaultSize,
28 const wxString& name = wxVListBoxNameStr );
30 bool IsCurrent(size_t item) const;
31 bool IsSelected(size_t item) const;
32 size_t GetSelectedCount() const;
33 wxPoint GetMargins() const;
34 const wxColour& GetSelectionBackground() const;
35 void SetItemCount( size_t count );
37 void SetSelection( int selection );
38 bool Select( size_t item, bool select = true );
39 bool SelectRange( size_t from, size_t to );
40 void Toggle( size_t item );
43 void SetMargins( wxCoord x, wxCoord y );
44 void SetSelectionBackground( const wxColour& col );
54 wxVListBox::GetFirstSelected()
57 int ret = THIS->GetFirstSelected( cookie );
59 PUSHs( sv_2mortal( newSViv( ret ) ) );
60 PUSHs( sv_2mortal( newSViv( cookie ) ) );
63 wxVListBox::GetNextSelected( unsigned long cookie )
65 int ret = THIS->GetFirstSelected( cookie );
67 PUSHs( sv_2mortal( newSViv( ret ) ) );
68 PUSHs( sv_2mortal( newSViv( cookie ) ) );
75 #include "cpp/v_cback.h"
77 // void METH(wxDC&, const wxRect&, size_t)
78 #define DEC_V_CBACK_VOID__WXDC_WXRECT_SIZET_const( METHOD ) \
79 void METHOD( wxDC& p1, const wxRect& p2, size_t p3 ) const
81 #define DEF_V_CBACK_VOID__WXDC_WXRECT_SIZET_const_pure( CLASS, BASE, METHOD )\
82 void CLASS::METHOD( wxDC& p1, const wxRect& p2, size_t p3 ) const \
85 if( wxPliFCback( aTHX_ &m_callback, #METHOD ) ) \
87 wxAutoSV ret( aTHX_ wxPliCCback( aTHX_ &m_callback, \
90 new wxRect( p2 ), "Wx::Rect", \
97 class wxPlVListBox : public wxVListBox {
98 WXPLI_DECLARE_DYNAMIC_CLASS( wxPlVListBox );
99 WXPLI_DECLARE_V_CBACK();
101 WXPLI_DEFAULT_CONSTRUCTOR( wxPlVListBox, "Wx::VListBox", true );
102 WXPLI_CONSTRUCTOR_6( wxPlVListBox, "Wx::VListBox", true,
103 wxWindow*, wxWindowID, const wxPoint&,
104 const wxSize&, long, const wxString& );
106 DEC_V_CBACK_WXCOORD__VOID_const( EstimateTotalHeight );
107 DEC_V_CBACK_WXCOORD__SIZET_const( OnMeasureItem );
108 DEC_V_CBACK_VOID__WXDC_WXRECT_SIZET_const( OnDrawItem );
111 DEF_V_CBACK_WXCOORD__VOID_const( wxPlVListBox, wxVListBox,
112 EstimateTotalHeight );
113 DEF_V_CBACK_WXCOORD__SIZET_const_pure( wxPlVListBox, wxVListBox,
115 DEF_V_CBACK_VOID__WXDC_WXRECT_SIZET_const_pure( wxPlVListBox, wxVListBox,
118 WXPLI_IMPLEMENT_DYNAMIC_CLASS( wxPlVListBox, wxVListBox );
123 #include "cpp/overload.h"
124 #include "cpp/vlbox.h"
126 %name{Wx::PlVListBox} class wxPlVListBox
133 MATCH_VOIDM_REDISP( newDefault )
134 MATCH_ANY_REDISP( newFull )
135 END_OVERLOAD( "Wx::PlVListBox::new" )
138 %name{newDefault} wxPlVListBox()
139 %code{% RETVAL = new wxPlVListBox( CLASS ); %};
140 %name{newFull} wxPlVListBox( wxWindow *parent,
141 wxWindowID id = wxID_ANY,
142 const wxPoint& pos = wxDefaultPosition,
143 const wxSize& size = wxDefaultSize,
145 const wxString& name = wxVListBoxNameStr )
146 %code{% RETVAL = new wxPlVListBox( CLASS, parent, id, pos, size,