Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / XS / Treebook.xsp
1 #############################################################################
2 ## Name:        XS/Treebook.xsp
3 ## Purpose:     XS++ for Wx::Treebook
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     30/07/2006
7 ## RCS-ID:      $Id: Treebook.xsp 2148 2007-08-15 17:10:50Z 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 #############################################################################
12
13 %module{Wx};
14
15 %typemap{wxTreebook*}{simple};
16 %typemap{wxTreebookEvent*}{simple};
17
18 #if WXPERL_W_VERSION_GE( 2, 7, 0 )
19
20 #include <wx/treebook.h>
21
22 %name{Wx::TreebookEvent} class wxTreebookEvent
23 {
24     wxTreebookEvent( wxEventType commandType = wxEVT_NULL, int id = 0,
25                      int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND );
26
27     int GetOldSelection() const;
28     int GetSelection() const;
29 };
30
31 %name{Wx::Treebook} class wxTreebook
32 {
33     %name{newDefault} wxTreebook()
34         %code{% RETVAL = new wxTreebook();
35                 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
36              %};
37     %name{newFull} wxTreebook(wxWindow *parent,
38                               wxWindowID id = wxID_ANY,
39                               const wxPoint& pos = wxDefaultPosition,
40                               const wxSize& size = wxDefaultSize,
41                               long style = 0,
42                               const wxString& name = wxEmptyString)
43         %code{% RETVAL = new wxTreebook( parent, id, pos, size, style, name );
44                 wxPli_create_evthandler( aTHX_ RETVAL, CLASS );
45              %};
46
47     bool Create(wxWindow *parent,
48                 wxWindowID id = wxID_ANY,
49                 const wxPoint& pos = wxDefaultPosition,
50                 const wxSize& size = wxDefaultSize,
51                 long style = 0,
52                 const wxString& name = wxEmptyString);
53
54     bool InsertSubPage( size_t pos, wxWindow* page,
55                         const wxString& text, bool bSelect = false,
56                         int imageId = wxNOT_FOUND );
57     bool AddSubPage( wxWindow* page, const wxString& text,
58                      bool bSelect = false, int imageId = wxNOT_FOUND );
59     bool IsNodeExpanded( size_t pos ) const;
60     bool ExpandNode( size_t pos, bool expand = true );
61     bool CollapseNode( size_t pos );
62     int GetPageParent( size_t pos ) const;
63     wxTreeCtrl* GetTreeCtrl() const;
64 };
65
66 %{
67 void
68 new( ... )
69   PPCODE:
70     BEGIN_OVERLOAD()
71         MATCH_VOIDM_REDISP( newDefault )
72         MATCH_ANY_REDISP( newFull )
73     END_OVERLOAD( "Wx::Treebook::new" )
74 %}
75
76 #endif