Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / blib / lib / Wx / Menu.pm
1 #############################################################################
2 ## Name:        lib/Wx/Menu.pm
3 ## Purpose:     Wx::Menu class
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     25/11/2000
7 ## RCS-ID:      $Id: Menu.pm 2057 2007-06-18 23:03:00Z mbarbon $
8 ## Copyright:   (c) 2000-2003, 2005-2006 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 package Wx::Menu;
14
15 use strict;
16
17 sub Append {
18   my( $this ) = shift;
19
20   Wx::_match( @_, $Wx::_n_s_wmen, 3, 1 ) && ( return $this->AppendSubMenu_( @_ ) );
21   Wx::_match( @_, $Wx::_n_s, 2, 1 )      && ( return $this->AppendString( @_ ) );
22   Wx::_match( @_, $Wx::_wmit, 1 )        && ( return $this->AppendItem( @_ ) );
23   Wx::_croak Wx::_ovl_error;
24 }
25
26 sub Delete {
27   my( $this ) = shift;
28
29   Wx::_match( @_, $Wx::_wmit, 1 ) && ( $this->DeleteItem( @_ ), return );
30   Wx::_match( @_, $Wx::_n, 1 )    && ( $this->DeleteId( @_ ), return );
31   Wx::_croak Wx::_ovl_error;
32 }
33
34 sub Destroy {
35   my( $this ) = shift;
36
37   @_ == 0                     && ( $this->DestroyMenu(), return );
38   Wx::_match( @_, $Wx::_wmit, 1 ) && ( $this->DestroyItem( @_ ), return );
39   Wx::_match( @_, $Wx::_n, 1 )    && ( $this->DestroyId( @_ ), return );
40   Wx::_croak Wx::_ovl_error;
41 }
42
43 sub Remove {
44   my( $this ) = shift;
45
46   Wx::_match( @_, $Wx::_wmit, 1 ) && return $this->RemoveItem( @_ );
47   Wx::_match( @_, $Wx::_n, 1 )    && return $this->RemoveId( @_ );
48   Wx::_croak Wx::_ovl_error;
49 }
50
51 sub Prepend {
52   my( $this ) = shift;
53
54   Wx::_match( @_, $Wx::_n_s_wmen, 3, 1 ) && ( $this->PrependSubMenu( @_ ), return );
55   Wx::_match( @_, $Wx::_n_s, 2, 1 )      && ( $this->PrependString( @_ ), return );
56   Wx::_match( @_, $Wx::_wmit, 1 )        && ( $this->PrependItem( @_ ), return );
57   Wx::_croak Wx::_ovl_error;
58 }
59
60 sub Insert {
61   my( $this ) = shift;
62
63   Wx::_match( @_, $Wx::_n_n_s_wmen, 4, 1 ) && ( $this->InsertSubMenu( @_ ), return );
64   Wx::_match( @_, $Wx::_n_n_s, 3, 1 )      && ( $this->InsertString( @_ ), return );
65   Wx::_match( @_, $Wx::_n_wmit, 2 )        && ( $this->InsertItem( @_ ), return );
66   Wx::_croak Wx::_ovl_error;
67 }
68
69
70 1;
71
72 # Local variables: #
73 # mode: cperl #
74 # End: #