Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / XS / FileCtrl.xsp
1 #############################################################################
2 ## Name:        XS/FileCtrl.xsp
3 ## Purpose:     XS+++ for Wx::FileCtrl
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     07/10/2007
7 ## RCS-ID:      $Id: FileCtrl.xsp 2240 2007-10-07 19:18:51Z mbarbon $
8 ## Copyright:   (c) 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 #############################################################################
12
13 %module{Wx};
14
15 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
16
17 %typemap{wxFileCtrl*}{simple};
18 %typemap{wxFileCtrlEvent*}{simple};
19
20 #include <wx/filectrl.h>
21
22 %name{Wx::FileCtrl} class wxFileCtrl
23 {
24 %{
25 void
26 new( ... )
27   PPCODE:
28     BEGIN_OVERLOAD()
29         MATCH_VOIDM_REDISP( newDefault )
30         MATCH_ANY_REDISP( newFull )
31     END_OVERLOAD( "Wx::FileCtrl::new" )
32 %}
33
34     %name{newDefault} wxFileCtrl()
35         %code{% RETVAL = new wxFileCtrl();
36                 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
37                 %};
38
39     %name{newFull} wxFileCtrl( wxWindow *parent,
40                                wxWindowID id = wxID_ANY,
41                                const wxString& defaultDirectory = wxEmptyString,
42                                const wxString& defaultFilename = wxEmptyString,
43                                const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
44                                long style = wxFC_DEFAULT_STYLE,
45                                const wxPoint& pos = wxDefaultPosition,
46                                const wxSize& size = wxDefaultSize,
47                                const wxString& name = wxFileCtrlNameStr )
48         %code{% RETVAL = new wxFileCtrl( parent, id, defaultDirectory,
49                                          defaultFilename, wildCard, style,
50                                          pos, size, name );
51                 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
52                 %};
53
54     bool Create( wxWindow *parent,
55                  wxWindowID id = wxID_ANY,
56                  const wxString& defaultDirectory = wxEmptyString,
57                  const wxString& defaultFilename = wxEmptyString,
58                  const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
59                  long style = wxFC_DEFAULT_STYLE,
60                  const wxPoint& pos = wxDefaultPosition,
61                  const wxSize& size = wxDefaultSize,
62                  const wxString& name = wxFileCtrlNameStr );
63
64     void SetWildcard( const wxString& wildCard );
65     void SetFilterIndex( int filterindex );
66     bool SetDirectory( const wxString& dir );
67
68     bool SetFilename( const wxString& name );
69
70     bool SetPath( const wxString& path );
71
72     wxString GetFilename() const;
73     wxString GetDirectory() const;
74     wxString GetWildcard() const;
75     wxString GetPath() const;
76
77 %{
78 void
79 wxFileCtrl::GetPaths()
80   PPCODE:
81     PUTBACK;
82     wxArrayString ret;
83     THIS->GetPaths( ret );
84     wxPli_stringarray_push( aTHX_ ret );
85     SPAGAIN;
86
87 void
88 wxFileCtrl::GetFilenames()
89   PPCODE:
90     PUTBACK;
91     wxArrayString ret;
92     THIS->GetFilenames( ret );
93     wxPli_stringarray_push( aTHX_ ret );
94     SPAGAIN;
95
96 %}
97     int GetFilterIndex() const;
98
99     bool HasMultipleFileSelection() const;
100     void ShowHidden(bool show);
101 };
102
103 %name{Wx::FileCtrlEvent} class wxFileCtrlEvent
104 {
105     void SetFiles( const wxArrayString &files );
106     void SetDirectory( const wxString &directory );
107
108 %{
109 void
110 wxFileCtrlEvent::GetFiles()
111   PPCODE:
112     PUTBACK;
113     wxPli_stringarray_push( aTHX_ THIS->GetFiles() );
114     SPAGAIN;
115 %}
116
117     wxString GetDirectory() const;
118     wxString GetFile() const;
119 };
120
121 #endif