Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / XS / MultiChoiceDialog.xs
1 #############################################################################
2 ## Name:        XS/MultiChoiceDialog.xs
3 ## Purpose:     XS for Wx::MultiChoiceDialog
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     03/02/2001
7 ## RCS-ID:      $Id: MultiChoiceDialog.xs 2057 2007-06-18 23:03:00Z mbarbon $
8 ## Copyright:   (c) 2001-2004 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 #############################################################################
12
13 #include <wx/choicdlg.h>
14
15 MODULE=Wx PACKAGE=Wx::MultiChoiceDialog
16
17 wxMultiChoiceDialog*
18 wxMultiChoiceDialog::new( parent, message, caption, chs, style = wxCHOICEDLG_STYLE, pos = wxDefaultPosition )
19     wxWindow* parent
20     wxString message
21     wxString caption
22     SV* chs
23     long style
24     wxPoint pos
25   PREINIT:
26     wxString* choices;
27     int n;
28   CODE:
29     n = wxPli_av_2_stringarray( aTHX_ chs, &choices );
30     RETVAL = new wxMultiChoiceDialog( parent, message, caption, n, choices,
31         style, pos );
32     delete[] choices;
33   OUTPUT:
34     RETVAL
35
36 void
37 wxMultiChoiceDialog::GetSelections()
38   PREINIT:
39     wxArrayInt ret;
40     int i, max;
41   PPCODE:
42     ret = THIS->GetSelections();
43     max = ret.GetCount();
44     EXTEND( SP, max );
45     for( i = 0; i < max; ++i )
46     {
47       PUSHs( sv_2mortal( newSViv( ret[i] ) ) );
48     }
49
50 void
51 wxMultiChoiceDialog::SetSelections( ... )
52   PREINIT:
53     wxArrayInt array;
54     int i;
55   CODE:
56     array.Alloc( items - 1 );
57     for( i = 1; i < items; ++i )
58     {
59       array.Add( SvIV( ST( i ) ) );
60     }
61     THIS->SetSelections( array );