1 #############################################################################
2 ## Name: ext/html/XS/HtmlListBox.xsp
3 ## Purpose: XS++ for Wx::HtmlListBox
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: HtmlListBox.xsp 2129 2007-08-11 21:29:29Z 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{wxHtmlListBox*}{simple};
16 %typemap{wxPlHtmlListBox*}{simple};
17 %typemap{wxSimpleHtmlListBox*}{simple};
18 %typemap{wxFileSystem*}{simple};
20 #if WXPERL_W_VERSION_GE( 2, 5, 0 )
23 #include <wx/clntdata.h>
24 #include "cpp/helpers.h"
25 #include <wx/htmllbox.h>
26 #include "cpp/overload.h"
27 #include "cpp/htmllbox.h"
30 %file{cpp/htmllbox.h};
33 #include "cpp/v_cback.h"
36 #define DEC_V_CBACK_WXSTRING__SIZET_( METHOD, CONST ) \
37 wxString METHOD( size_t ) CONST
39 #define DEF_V_CBACK_WXSTRING__SIZET_( CLASS, CALLBASE, METHOD, CONST )\
40 wxString CLASS::METHOD( size_t p1 ) CONST \
43 if( wxPliFCback( aTHX_ &m_callback, #METHOD ) ) \
45 wxAutoSV ret( aTHX_ wxPliCCback( aTHX_ &m_callback, G_SCALAR, \
48 WXSTRING_INPUT( value, wxChar*, ret ); \
54 #define DEC_V_CBACK_WXSTRING__SIZET_const( METHOD ) \
55 DEC_V_CBACK_WXSTRING__SIZET_( METHOD, wxPli_CONST )
57 #define DEF_V_CBACK_WXSTRING__SIZET_const_pure( CLASS, BASE, METHOD ) \
58 DEF_V_CBACK_WXSTRING__SIZET_( CLASS, return wxEmptyString, METHOD, wxPli_CONST )
60 class wxPlHtmlListBox : public wxHtmlListBox {
61 WXPLI_DECLARE_DYNAMIC_CLASS( wxPlHtmlListBox );
62 WXPLI_DECLARE_V_CBACK();
64 WXPLI_DEFAULT_CONSTRUCTOR( wxPlHtmlListBox, "Wx::HtmlListBox", true );
65 WXPLI_CONSTRUCTOR_6( wxPlHtmlListBox, "Wx::HtmlListBox", true,
66 wxWindow*, wxWindowID, const wxPoint&,
67 const wxSize&, long, const wxString& );
69 DEC_V_CBACK_WXCOORD__VOID_const( EstimateTotalHeight );
70 DEC_V_CBACK_WXSTRING__SIZET_const( OnGetItem );
73 WXPLI_IMPLEMENT_DYNAMIC_CLASS( wxPlHtmlListBox, wxHtmlListBox );
75 DEF_V_CBACK_WXCOORD__VOID_const( wxPlHtmlListBox, wxHtmlListBox,
76 EstimateTotalHeight );
77 DEF_V_CBACK_WXSTRING__SIZET_const_pure( wxPlHtmlListBox, wxHtmlListBox,
83 %name{Wx::HtmlListBox} class wxHtmlListBox
85 bool Create( wxWindow *parent, wxWindowID id = wxID_ANY,
86 const wxPoint& pos = wxDefaultPosition,
87 const wxSize& size = wxDefaultSize,
89 const wxString& name = wxVListBoxNameStr );
95 wxHtmlListBox::GetFileSystem()
97 RETVAL = &THIS->GetFileSystem();
100 wxPli_object_set_deleteable( aTHX_ ST(0), false );
104 %name{Wx::PlHtmlListBox} class wxPlHtmlListBox
106 %name{newDefault} wxPlHtmlListBox()
107 %code{% RETVAL = new wxPlHtmlListBox( CLASS ); %};
108 %name{newFull} wxPlHtmlListBox( wxWindow *parent,
109 wxWindowID id = wxID_ANY,
110 const wxPoint& pos = wxDefaultPosition,
111 const wxSize& size = wxDefaultSize,
113 const wxString& name = wxEmptyString )
114 %code{% RETVAL = new wxPlHtmlListBox( CLASS, parent, id, pos, size,
125 MATCH_VOIDM_REDISP( newDefault )
126 MATCH_ANY_REDISP( newFull )
127 END_OVERLOAD( "Wx::PlHtmlListBox::new" )
131 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
133 %name{Wx::SimpleHtmlListBox} class wxSimpleHtmlListBox
135 %name{newDefault} wxSimpleHtmlListBox()
136 %code{% RETVAL = new wxSimpleHtmlListBox;
137 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
139 %name{newFull} wxSimpleHtmlListBox( wxWindow *parent,
140 wxWindowID id = wxID_ANY,
141 const wxPoint& pos = wxDefaultPosition,
142 const wxSize& size = wxDefaultSize,
143 wxArrayString choices,
145 const wxValidator& validator = wxDefaultValidatorPtr,
146 const wxString& name = wxSimpleHtmlListBoxNameStr )
147 %code{% RETVAL = new wxSimpleHtmlListBox( parent, id, pos, size,
148 choices, style, *validator,
150 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
152 bool Create( wxWindow *parent,
153 wxWindowID id = wxID_ANY,
154 const wxPoint& pos = wxDefaultPosition,
155 const wxSize& size = wxDefaultSize,
156 wxArrayString choices,
158 const wxValidator& validator = wxDefaultValidatorPtr,
159 const wxString& name = wxSimpleHtmlListBoxNameStr );
161 void SetSelection( int n );
162 int GetSelection() const;
163 unsigned int GetCount() const;
164 wxString GetString( unsigned int n ) const;
165 ## wxArrayString GetStrings() const;
166 void SetString( unsigned int n, const wxString& s );
171 wxSimpleHtmlListBox::Clear()
173 THIS->wxVListBox::Clear();
176 void Delete( unsigned int n );
177 %name{AppendStrings} void Append( const wxArrayString& strings );
178 %name{AppendString} void Append( const wxString& item );
179 %name{AppendData} void Append( const wxString& item,
180 wxPliUserDataCD* data );
189 MATCH_VOIDM_REDISP( newDefault )
190 MATCH_ANY_REDISP( newFull )
191 END_OVERLOAD( "Wx::SimpleHtmlListBox::new" )
197 MATCH_REDISP( wxPliOvl_arr, AppendStrings )
198 MATCH_REDISP( wxPliOvl_s_s, AppendData )
199 MATCH_REDISP( wxPliOvl_s, AppendString )
200 END_OVERLOAD( Wx::SimpleHtmlListBox::Append )