1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
|
#############################################################################
## Name: XS/SingleChoiceDialog.xs
## Purpose: XS for Wx::SingleChoiceDialog
## Author: Mattia Barbon
## Modified by:
## Created: 03/02/2001
## RCS-ID: $Id: SingleChoiceDialog.xs 2057 2007-06-18 23:03:00Z mbarbon $
## Copyright: (c) 2001-2002, 2005 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
#############################################################################
#include <wx/choicdlg.h>
#include "cpp/singlechoicedialog.h"
MODULE=Wx PACKAGE=Wx::SingleChoiceDialog
wxSingleChoiceDialog*
wxSingleChoiceDialog::new( parent, message, caption, chs, dt = &PL_sv_undef, style = wxCHOICEDLG_STYLE, pos = wxDefaultPosition )
wxWindow* parent
wxString message
wxString caption
SV* chs
SV* dt
long style
wxPoint pos
PREINIT:
wxString* choices;
SV** data;
int n, n2;
CODE:
n = wxPli_av_2_stringarray( aTHX_ chs, &choices );
if( !SvOK( dt ) )
{
RETVAL = new wxPliSingleChoiceDialog( parent, message, caption, n,
choices, 0, style, pos );
}
else
{
n2 = wxPli_av_2_svarray( aTHX_ dt, &data );
if( n != n2 )
{
delete[] choices;
delete[] data;
choices = 0; data = 0; n = 0;
croak( "supplied arrays of different size" );
}
RETVAL = new wxPliSingleChoiceDialog( parent, message, caption, n,
choices, data, style, pos );
delete[] data;
}
delete[] choices;
OUTPUT:
RETVAL
int
wxSingleChoiceDialog::GetSelection()
SV*
wxSingleChoiceDialog::GetSelectionClientData()
PREINIT:
char* t;
CODE:
t = THIS->GetSelectionClientData();
RETVAL = &PL_sv_undef;
if( t )
{
RETVAL = (SV*)t;
}
SvREFCNT_inc( RETVAL );
OUTPUT:
RETVAL
wxString
wxSingleChoiceDialog::GetStringSelection()
void
wxSingleChoiceDialog::SetSelection( selection )
int selection
MODULE=Wx PACKAGE=Wx PREFIX=wx
#
# Function interface
#
wxString
wxGetSingleChoice( message, caption, chs, parent = 0, x = -1, y = -1, centre = true, width = wxCHOICE_WIDTH, height = wxCHOICE_HEIGHT )
wxString message
wxString caption
SV* chs
wxWindow* parent
int x
int y
bool centre
int width
int height
PREINIT:
wxString* choices;
int n;
CODE:
n = wxPli_av_2_stringarray( aTHX_ chs, &choices );
RETVAL = wxGetSingleChoice( message, caption, n, choices, parent, x, y,
centre, width, height );
delete[] choices;
OUTPUT:
RETVAL
int
wxGetSingleChoiceIndex( message, caption, chs, parent = 0, x = -1, y = -1, centre = true, width = wxCHOICE_WIDTH, height = wxCHOICE_HEIGHT )
wxString message
wxString caption
SV* chs
wxWindow* parent
int x
int y
bool centre
int width
int height
PREINIT:
wxString* choices;
int n;
CODE:
n = wxPli_av_2_stringarray( aTHX_ chs, &choices );
RETVAL = wxGetSingleChoiceIndex( message, caption, n, choices,
parent, x, y, centre, width, height );
delete[] choices;
OUTPUT:
RETVAL
SV*
wxGetSingleChoiceData( message, caption, chs, dt, parent = 0, x = -1, y = -1, centre = true, width = wxCHOICE_WIDTH, height = wxCHOICE_HEIGHT )
wxString message
wxString caption
SV* chs
SV* dt
wxWindow* parent
int x
int y
bool centre
int width
int height
PREINIT:
wxString* choices;
SV** data;
int n, n2;
void* rt;
CODE:
n = wxPli_av_2_stringarray( aTHX_ chs, &choices );
n2 = wxPli_av_2_svarray( aTHX_ dt, &data );
if( n != n2 )
{
delete[] choices;
delete[] data;
choices = 0; data = 0; n = 0;
croak( "supplied arrays of different sizes" );
}
rt = wxGetSingleChoiceData( message, caption, n, choices, (void**)data,
parent, x, y, centre, width, height );
RETVAL = rt ? (SV*)rt : &PL_sv_undef;
SvREFCNT_inc( RETVAL );
delete[] choices;
delete[] data;
OUTPUT:
RETVAL
|