Commit 0fb204bd authored by Alessandro Ghedini's avatar Alessandro Ghedini

Imported Upstream version 0.9906

parent e1e273a0
Revision history for Perl extension Wx.
0.9906 Tue Mar 27 2012
- wrapped wxWebView ( wxWidgets ge 2.9.3 )
- wrapped wxTimePickerCtrl ( wxWidgets ge 2.9.3 )
- wrapped wxRichToolTip ( wxWidgets ge 2.9.3 )
- wrapped wxBannerWindow ( wxWidgets ge 2.9.3 )
- Allow RichTextPrinting without dialog ( wxWidgets ge 2.9.4 )
(thanks to Steve Cookson )
- wrapped some missing wxPrintData methods
0.9905 Fri Mar 16 2012
- wrapped wxPropertyGrid ( wxWidgets ge 2.9.3 )
- wrapped native wxTreeListCtrl ( wxWidgets ge 2.9.3 )
......
......@@ -4,7 +4,7 @@
// Author: Mattia Barbon
// Modified by:
// Created: 29/10/2000
// RCS-ID: $Id: Constant.xs 3185 2012-03-10 06:40:00Z mdootson $
// RCS-ID: $Id: Constant.xs 3220 2012-03-18 03:02:46Z mdootson $
// Copyright: (c) 2000-2011 Mattia Barbon
// Licence: This program is free software; you can redistribute it and/or
// modify it under the same terms as Perl itself
......@@ -3463,6 +3463,9 @@ _get_packages()
#if wxPERL_USE_RIBBON && wxUSE_RIBBON && WXPERL_W_VERSION_GE( 2, 9, 3 )
"use Wx::Ribbon;"
#endif
#if wxPERL_USE_WEBVIEW && wxUSE_WEBVIEW && WXPERL_W_VERSION_GE( 2, 9, 3 )
"use Wx::WebView;"
#endif
#if wxPERL_USE_RICHTEXT && WXPERL_W_VERSION_GE( 2, 7, 0 )
"use Wx::RichText;"
#endif
......
......@@ -4,7 +4,7 @@
// Author: Mattia Barbon
// Modified by:
// Created: 29/10/2000
// RCS-ID: $Id: Controls.xs 3159 2012-02-29 23:43:26Z mdootson $
// RCS-ID: $Id: Controls.xs 3228 2012-03-19 03:59:13Z mdootson $
// Copyright: (c) 2000-2010 Mattia Barbon
// Licence: This program is free software; you can redistribute it and/or
// modify it under the same terms as Perl itself
......@@ -31,6 +31,7 @@
#define wxNORMAL_FONTPtr (wxFont*)wxNORMAL_FONT
#define wxNullBitmapPtr (wxBitmap*) &wxNullBitmap
#define wxNullAnimationPtr (wxAnimation*) &wxNullAnimation
#define wxNullColourPtr (wxColour*)&wxNullColour
#undef THIS
......@@ -106,6 +107,11 @@ INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t typemap.xsp interface/w
INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t typemap.xsp interface/wx/button.h
INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t typemap.xsp interface/wx/treelist.h
INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t typemap.xsp interface/wx/richtooltip.h
INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t typemap.xsp interface/wx/bannerwindow.h
INCLUDE: XS/CheckBox.xs
INCLUDE: XS/CheckListBox.xs
INCLUDE: XS/Choice.xs
......
......@@ -4,7 +4,7 @@
// Author: Mattia Barbon
// Modified by:
// Created: 29/10/2000
// RCS-ID: $Id: Event.xs 2700 2009-12-13 11:25:50Z mbarbon $
// RCS-ID: $Id: Event.xs 3232 2012-03-19 05:38:20Z mdootson $
// Copyright: (c) 2000-2009 Mattia Barbon
// Licence: This program is free software; you can redistribute it and/or
// modify it under the same terms as Perl itself
......@@ -414,6 +414,16 @@ wxKeyEvent::HasModifiers()
bool
wxKeyEvent::ShiftDown()
#if WXPERL_W_VERSION_GE( 2, 9, 3 )
void
wxKeyEvent::DoAllowNextEvent()
bool
wxKeyEvent::IsNextEventAllowed()
#endif
MODULE=Wx_Evt PACKAGE=Wx::HelpEvent
wxHelpEvent*
......
......@@ -295,6 +295,7 @@ ext/calendar/typemap
ext/calendar/XS/CalendarCtrl.xsp
ext/calendar/XS/CalendarDateAttr.xsp
ext/calendar/XS/DatePickerCtrl.xsp
ext/calendar/XS/TimePickerCtrl.xsp
ext/dataview/DataView.pm
ext/dataview/DataView.xs
......@@ -586,6 +587,17 @@ ext/ribbon/t/02_inheritance.t
ext/ribbon/t/03_threads.t
ext/ribbon/t/04_userdata.t
ext/webview/Makefile.PL
ext/webview/WebView.xs
ext/webview/typemap
ext/webview/typemap.xsp
ext/webview/lib/Wx/WebView.pm
ext/webview/t/01_load.t
ext/webview/t/02_inheritance.t
ext/webview/t/03_threads.t
ext/webview/cpp/webview_constants.cpp
ext/webview/XS/WebView.xsp
interface/wx/bmpbuttn.h
interface/wx/button.h
interface/wx/dataview/dataviewlistctrl.h
......@@ -597,5 +609,7 @@ interface/wx/headercol.h
interface/wx/headerctrl.h
interface/wx/infobar.h
interface/wx/treelist.h
interface/wx/bannerwindow.h
interface/wx/richtooltip.h
META.yml Module meta-data (added by MakeMaker)
# http://module-build.sourceforge.net/META-spec.html
name: Wx
version: 0.9905
version_from: Wx.pm
installdirs: site
--- #YAML:1.0
name: Wx
version: 0.9906
abstract: interface to the wxWidgets cross-platform GUI toolkit
author:
- Mattia Barbon <mbarbon@cpan.org>
abstract: interface to the wxWidgets cross-platform GUI toolkit
license: perl
requires:
Alien::wxWidgets: 0.25
ExtUtils::ParseXS: 3.15
ExtUtils::XSpp: 0.1602
File::Spec::Functions: 0.82
if: 0.03
Test::Harness: 2.26
Test::More: 0.45
build_requires:
ExtUtils::MakeMaker: 6.17
no_index:
directory:
- samples
- script
package:
- MY
- Parse::Yapp::Driver
# extras.
- Mattia Barbon <mbarbon@cpan.org>
license: perl
distribution_type: module
configure_requires:
Alien::wxWidgets: 0.25
dynamic_config: 1
Alien::wxWidgets: 0.25
build_requires:
Alien::wxWidgets: 0.25
ExtUtils::MakeMaker: 6.48
ExtUtils::ParseXS: 3.15
ExtUtils::XSpp: 0.1602
File::Spec::Functions: 0.82
if: 0.03
Test::Harness: 2.26
Test::More: 0.45
requires:
Alien::wxWidgets: 0.25
resources:
MailingList: http://lists.perl.org/list/wxperl-users.html
bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Wx
homepage: http://wxperl.eu/
license: http://dev.perl.org/licenses/
repository: https://wxperl.svn.sourceforge.net/svnroot/wxperl/wxPerl
distribution_type: module
generated_by: ExtUtils::MY_Metafile version 0.09, EUMM-6.57_05.
bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Wx
homepage: http://wxperl.eu/
license: http://dev.perl.org/licenses/
MailingList: http://lists.perl.org/list/wxperl-users.html
repository: https://wxperl.svn.sourceforge.net/svnroot/wxperl/wxPerl
no_index:
directory:
- samples
- script
package:
- MY
- Parse::Yapp::Driver
generated_by: ExtUtils::MakeMaker version 6.57_05
meta-spec:
version: 1.3
url: http://module-build.sourceforge.net/META-spec-v1.3.html
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
dynamic_config: 1
......@@ -5,7 +5,7 @@
## Author: Mattia Barbon
## Modified by:
## Created: 01/10/2000
## RCS-ID: $Id: Makefile.PL 3187 2012-03-11 23:22:34Z mdootson $
## RCS-ID: $Id: Makefile.PL 3258 2012-03-27 08:57:58Z mdootson $
## Copyright: (c) 2000-2012 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
......@@ -22,71 +22,76 @@ use Wx::build::MakeMaker::Core;
( my $mmv = ExtUtils::MakeMaker->VERSION ) =~ s/_//g;
if( $mmv == 6.21 ) {
die <<EOT
ExtUtils::MakeMaker 6.21 is known not to work with wxPerl;
please downgrade to 6.17 or install the latest version from CPAN.
EOT
}
my $moduleauthor = ( $mmv >= 6.5702 ) ? [ 'Mattia Barbon <mbarbon@cpan.org>' ] : 'Mattia Barbon <mbarbon@cpan.org>';
# $ExtUtils::MakeMaker::Verbose = 2;
# $wxConfig::Verbose = 10;
my $build_requires = {
'ExtUtils::MakeMaker' => 6.17,
};
my $requires = {
'Alien::wxWidgets' => 0.25,
'ExtUtils::XSpp' => 0.1602,
'ExtUtils::ParseXS' => 3.15,
'File::Spec::Functions' => 0.82,
'Test::More' => 0.45,
'Test::Harness' => 2.26,
'if' => 0.03,
};
eval {
require ExtUtils::MY_Metafile;
ExtUtils::MY_Metafile->import;
my_metafile
( { license => 'perl',
author => $moduleauthor,
dynamic_config => 1,
requires => $requires,
build_requires => $build_requires,
no_index => { directory => [ qw(samples script) ],
package => [ qw(MY Parse::Yapp::Driver) ],
},
configure_requires => { 'Alien::wxWidgets' => 0.25,
},
resources => { 'license' => 'http://dev.perl.org/licenses/',
'homepage' => 'http://wxperl.eu/',
'bugtracker' => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Wx',
'repository' => 'https://wxperl.svn.sourceforge.net/svnroot/wxperl/wxPerl',
'MailingList' => 'http://lists.perl.org/list/wxperl-users.html',
},
} );
};
# Make setting optional MakeMaker parameters more readable
# lifted from DBD::SQLite distribution
sub OPTIONAL {
return () unless $ExtUtils::MakeMaker::VERSION ge shift;
return @_;
}
wxWriteMakefile( NAME => 'Wx',
ABSTRACT_FROM => 'Wx.pm',
AUTHOR => $moduleauthor,
VERSION_FROM => 'Wx.pm',
PREREQ_PM => { %$requires, %$build_requires },
PMLIBDIRS => [ 'lib', 'build' ],
EXE_FILES => [ qw(script/wxperl_overload) ],
WX_CORE_LIB_MAYBE => $^O eq 'darwin' ? 'media html' : '',
WX_CORE_LIB => 'adv core base',
WX_OVERLOAD => { header => 'cpp/ovl_const.h',
source => 'cpp/ovl_const.cpp',
},
WX_TOP => 'Wx.pm',
LICENSE => 'perl',
);
wxWriteMakefile(
NAME => 'Wx',
ABSTRACT_FROM => 'Wx.pm',
VERSION_FROM => 'Wx.pm',
AUTHOR => $moduleauthor,
PREREQ_PM => {
'Alien::wxWidgets' => 0.25,
'ExtUtils::XSpp' => 0.1602,
'ExtUtils::MakeMaker' => 6.46,
'ExtUtils::ParseXS' => 3.15,
'File::Spec::Functions' => 0.82,
'Test::More' => 0.45,
'Test::Harness' => 2.26,
'if' => 0.03,
},
LICENSE => 'perl',
OPTIONAL( '6.48',
MIN_PERL_VERSION => '5.006001',
),
META_ADD => {
dynamic_config => 1,
configure_requires => {
'Alien::wxWidgets' => 0.25,
},
build_requires => {
'Alien::wxWidgets' => 0.25,
'ExtUtils::MakeMaker' => 6.48,
'ExtUtils::XSpp' => 0.1602,
'Test::More' => 0.42,
'ExtUtils::ParseXS' => 3.15,
'File::Spec::Functions' => 0.82,
'Test::More' => 0.45,
'Test::Harness' => 2.26,
'if' => 0.03,
},
requires => {
'Alien::wxWidgets' => 0.25,
},
resources => {
'license' => 'http://dev.perl.org/licenses/',
'homepage' => 'http://wxperl.eu/',
'bugtracker' => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Wx',
'repository' => 'https://wxperl.svn.sourceforge.net/svnroot/wxperl/wxPerl',
'MailingList' => 'http://lists.perl.org/list/wxperl-users.html',
},
no_index => { directory => [ qw(samples script) ],
package => [ qw(MY Parse::Yapp::Driver) ],
},
},
PMLIBDIRS => [ 'lib', 'build' ],
EXE_FILES => [ qw(script/wxperl_overload) ],
WX_CORE_LIB_MAYBE => $^O eq 'darwin' ? 'media html' : '',
WX_CORE_LIB => 'adv core base',
WX_OVERLOAD => { header => 'cpp/ovl_const.h',
source => 'cpp/ovl_const.cpp',
},
WX_TOP => 'Wx.pm',
);
END {
print <<EOT;
......
......@@ -4,7 +4,7 @@
## Author: Mattia Barbon
## Modified by:
## Created: 01/10/2000
## RCS-ID: $Id: Wx.pm 3157 2012-02-28 14:55:59Z mdootson $
## RCS-ID: $Id: Wx.pm 3214 2012-03-16 22:46:23Z mdootson $
## Copyright: (c) 2000-2011 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
......@@ -21,7 +21,7 @@ use vars qw(@ISA $VERSION $XS_VERSION $AUTOLOAD @EXPORT_OK %EXPORT_TAGS
$_msw = 1; $_gtk = 2; $_motif = 3; $_mac = 4; $_x11 = 5;
@ISA = qw(Exporter);
$VERSION = '0.9905';
$VERSION = '0.9906';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
......
......@@ -4,7 +4,7 @@
// Author: Mattia Barbon
// Modified by:
// Created: 01/10/2000
// RCS-ID: $Id: Wx.xs 3168 2012-03-08 01:49:46Z mdootson $
// RCS-ID: $Id: Wx.xs 3220 2012-03-18 03:02:46Z mdootson $
// Copyright: (c) 2000-2002, 2004-2010 Mattia Barbon
// Licence: This program is free software; you can redistribute it and/or
// modify it under the same terms as Perl itself
......@@ -455,6 +455,16 @@ _wx_optmod_media()
#endif
OUTPUT: RETVAL
bool
_wx_optmod_webview()
CODE:
#if wxPERL_USE_WEBVIEW && wxUSE_WEBVIEW && WXPERL_W_VERSION_GE( 2, 9, 3 )
RETVAL = TRUE;
#else
RETVAL = FALSE;
#endif
OUTPUT: RETVAL
I32
looks_like_number( sval )
......
......@@ -4,7 +4,7 @@
## Author: Mattia Barbon
## Modified by:
## Created: 27/11/2000
## RCS-ID: $Id: MessageDialog.xsp 2118 2007-08-05 17:20:14Z mbarbon $
## RCS-ID: $Id: MessageDialog.xsp 3225 2012-03-18 05:19:39Z mdootson $
## Copyright: (c) 2000-2004, 2007 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
......@@ -38,6 +38,11 @@
void SetMessage( const wxString& message );
void SetExtendedMessage( const wxString& extendedMessage );
#endif
#if WXPERL_W_VERSION_GE( 2, 9, 3 )
bool SetHelpLabel(const wxString& help);
#endif
};
%name{Wx::MessageBox}
......
......@@ -4,7 +4,7 @@
## Author: Mattia Barbon
## Modified by:
## Created: 11/02/2002
## RCS-ID: $Id: Process.xs 2998 2011-01-17 02:41:09Z mdootson $
## RCS-ID: $Id: Process.xs 3252 2012-03-27 00:03:15Z mdootson $
## Copyright: (c) 2002-2004, 2006-2007 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
......
......@@ -3,17 +3,28 @@ package build::Wx::XSP::Enum;
use strict;
use warnings;
sub new { return bless { parser => $_[1] }, $_[0] }
sub new { return bless { parser => $_[1], exporttag => '' }, $_[0] }
sub register_plugin {
my( $class, $parser ) = @_;
my $instance = $class->new( $parser );
$parser->add_post_process_plugin( plugin => $instance );
$parser->add_toplevel_tag_plugin( plugin => $instance, tag => 'EnumExportTag' );
}
$parser->add_post_process_plugin( plugin => $class->new( $parser ) );
sub handle_toplevel_tag {
my( $self, $empty, $tag, %args ) = @_;
my $checktag = $args{any_positional_arguments}[0];
die qq(Invalid Export Tag $checktag) if $checktag !~ /^[a-z]+$/;
$self->{exporttag} = $checktag;
1; # we handled the tag
}
sub post_process {
my( $self, $nodes ) = @_;
my $parser = $self->{parser};
my $exporttag = $self->{exporttag};
my( %constants, %conditions );
foreach my $node ( @$nodes ) {
......@@ -41,7 +52,7 @@ sub post_process {
}
my $consts = join "\n", @defines;
my $all_conditions = join ' && ', 1, keys %conditions;
my @lines = sprintf <<'EOT', $all_conditions, $name, $consts, $name, $name;
my @lines = sprintf <<'EOT', $all_conditions, $name, $exporttag, $consts, $name, $name;
#if %s
#include "cpp/constants.h"
......@@ -55,7 +66,7 @@ static double %s_constant( const char* name, int arg )
WX_PL_CONSTANT_INIT();
// !package: Wx
// !tag:
// !tag: %s
// !parser: sub { $_[0] =~ m<^\s*r\w*\(\s*(\w+)\s*\);\s*(?://(.*))?$> }
// switch( fl )
......
......@@ -92,7 +92,7 @@ sub is_number {
'unsigned long', 'float', 'double',
'wxAlignment', 'wxBrushStyle',
'size_t', 'ssize_t', 'wxCoord',
'wxUint32'
'wxUint32', 'wxDirection',
);
}
......
package Wx::build::MakeMaker;
BEGIN {
# strip -nostdinc from config on darwin
# for all dists that use Wx::build::MakeMaker
use Config;
if( $^O eq 'darwin') {
my $cfgobj = tied %Config::Config;
$cfgobj->{$_} =~ s/-nostdinc/ /g for ( qw( ccflags cppflags ) );
}
}
use strict;
use ExtUtils::MakeMaker;
use base 'Exporter';
......
......@@ -128,7 +128,6 @@ sub depend_core {
'blibdirs' => 'wxt_copy_files',
'blibdirs.ts' => 'wxt_copy_files',
'wxt_copy_files' => join( ' ', keys %files ),
'distmeta' => 'check_my_metafile',
);
my %this_depend = @_;
......@@ -235,9 +234,6 @@ typemap : typemap.tmpl script/make_typemap.pl
cpp/v_cback_def.h : script/make_v_cback.pl
\$(PERL) script/make_v_cback.pl > cpp/v_cback_def.h
check_my_metafile :
\$(PERL) -e "eval 'require ExtUtils::MY_Metafile; 1' || die 'Install ExtUtils::MY_Metafile'"
EOT
foreach my $f ( @generated_xs ) {
......
......@@ -19,7 +19,7 @@ use vars qw(@EXPORT @subdirs);
my @top_level_xs = qw(Wx.xs Constant.xs Controls.xs Event.xs
Frames.xs GDI.xs Window.xs);
@subdirs = qw(socket dnd filesys grid help html mdi print xrc stc docview
calendar datetime media richtext aui dataview propgrid ribbon );
calendar datetime media richtext aui dataview propgrid ribbon webview );
my %subdirs;
Wx::build::MakeMaker::_set_is_wxPerl_tree( 1 );
......
......@@ -4,7 +4,7 @@
## Author: Mattia Barbon
## Modified by:
## Created: 05/10/2002
## RCS-ID: $Id: Calendar.pm 2057 2007-06-18 23:03:00Z mbarbon $
## RCS-ID: $Id: Calendar.pm 3224 2012-03-18 05:19:08Z mdootson $
## Copyright: (c) 2002, 2005-2006 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
......@@ -30,6 +30,7 @@ no strict;
package Wx::CalendarCtrl; @ISA = qw(Wx::Control);
package Wx::DatePickerCtrl; @ISA = qw(Wx::Control);
package Wx::TimePickerCtrl; @ISA = qw(Wx::Control);
package Wx::DateEvent; @ISA = qw(Wx::CommandEvent);
package Wx::CalendarEvent; @ISA = qw(Wx::DateEvent);
......@@ -47,6 +48,7 @@ sub EVT_CALENDAR_MONTH($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_CALENDAR_MON
sub EVT_CALENDAR_YEAR($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_CALENDAR_YEAR_CHANGED, $_[2] ) }
sub EVT_CALENDAR_WEEKDAY_CLICKED($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_CALENDAR_WEEKDAY_CLICKED, $_[2] ) }
sub EVT_DATE_CHANGED($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_DATE_CHANGED, $_[2] ) }
sub EVT_TIME_CHANGED($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_TIME_CHANGED, $_[2] ) }
1;
......
......@@ -4,7 +4,7 @@
// Author: Mattia Barbon
// Modified by:
// Created: 22/09/2002
// RCS-ID: $Id: Calendar.xs 2757 2010-01-17 10:26:27Z mbarbon $
// RCS-ID: $Id: Calendar.xs 3224 2012-03-18 05:19:08Z mdootson $
// Copyright: (c) 2002, 2005-2006, 2008-2010 Mattia Barbon
// Licence: This program is free software; you can redistribute it and/or
// modify it under the same terms as Perl itself
......@@ -33,6 +33,8 @@ INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t ../../typemap.xsp XS/Ca
INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t ../../typemap.xsp XS/CalendarDateAttr.xsp
INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t ../../typemap.xsp XS/TimePickerCtrl.xsp
# //FIXME//tricky
#if defined(__WXMSW__)
#undef XS
......
......@@ -4,7 +4,7 @@
## Author: Mattia Barbon
## Modified by:
## Created: 05/10/2002
## RCS-ID: $Id: CalendarCtrl.xsp 2927 2010-06-06 08:06:10Z mbarbon $
## RCS-ID: $Id: CalendarCtrl.xsp 3224 2012-03-18 05:19:08Z mdootson $
## Copyright: (c) 2002-2006, 2008, 2010 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
......@@ -64,6 +64,9 @@ double calendar_constant( const char* name, int arg )
#if WXPERL_W_VERSION_GE( 2, 5, 4 )
r( wxEVT_DATE_CHANGED );
#endif
#if WXPERL_W_VERSION_GE( 2, 9, 3 )
r( wxEVT_TIME_CHANGED );
#endif
break;
}
......
#############################################################################
## Name: ext/calendar/XS/TimePickerCtrl.xsp
## Purpose: XS++ for Wx::TimePickerCtrl
## Author: Mark Dootson
## Modified by:
## Created: 18/03/2012
## RCS-ID: $Id:$
## Copyright: (c) 2012, 2010-2011 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
#############################################################################
#if WXPERL_W_VERSION_GE( 2, 9, 3 ) && wxUSE_TIMEPICKCTRL
#include <wx/timectrl.h>
#include "xspp/timectrl.h"
%typemap{wxTimePickerCtrl*}{simple};
%typemap{wxDateTime}{reference};
%module{Wx};
%file{xspp/timectrl.h};
%{
double timepicker_constant( const char* name, int arg )
{
// !package: Wx
// !parser: sub { $_[0] =~ m<^\s*r\w*\(\s*(\w+)\s*\);\s*(?://(.*))?$> }
// !tag: timepicker
#define r( n ) \
if( strEQ( name, #n ) ) \
return n;
WX_PL_CONSTANT_INIT();
switch( fl )
{
case 'T':
r( wxTP_DEFAULT );
break;
}
#undef r
WX_PL_CONSTANT_CLEANUP();
}
wxPlConstants timepicker_module( &timepicker_constant );
%}
%file{-};
%name{Wx::TimePickerCtrl} class wxTimePickerCtrl : public wxControl
{
public:
wxTimePickerCtrl(wxWindow* parent, wxWindowID id,
const wxDateTime& dt = wxDefaultDateTimePtr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidatorPtr,
const wxString& name = "timectrl")
%postcall{% wxPli_create_evthandler( aTHX_ RETVAL, CLASS ); %};
bool Create(wxWindow* parent, wxWindowID id,
const wxDateTime& dt = wxDefaultDateTimePtr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidatorPtr,
const wxString& name = "timectrl");
virtual wxDateTime GetValue() const;
virtual void SetValue(const wxDateTime& dt);
};
#endif
......@@ -4,7 +4,7 @@
## Author: Mattia Barbon
## Modified by:
## Created: 05/10/2002
## RCS-ID: $Id: typemap 2567 2009-05-17 14:29:33Z mbarbon $
## RCS-ID: $Id: typemap 3224 2012-03-18 05:19:08Z mdootson $
## Copyright: (c) 2002-2003, 2005, 2008-2009 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
......@@ -18,5 +18,6 @@ wxDateEvent * O_WXOBJECT
wxCalendarEvent * O_WXOBJECT
wxCalendarCtrl * O_WXOBJECT
wxDatePickerCtrl * O_WXOBJECT
wxTimePickerCtrl * O_WXOBJECT
wxDateTime * O_NON_WXOBJECT_THR
wxCalendarDateAttr * O_NON_WXOBJECT_THR
......@@ -34,17 +34,32 @@ in_frame(
ok( wxTheClipboard->SetData( $copied ), "copying succeeds" );
undef $copied;
my $pasted = MyDataObject->new;
ok( wxTheClipboard->IsSupported( Wx::DataFormat->newUser( $FORMAT ) ),
"format supported" );
# intermittent non-repeatable failure on MSW and GTK
# On GTK I see when running tests on a VM accessed by
# VNC that doesn't have the focus on the client machine.
# I had assumed this was a GTK + Visual Box + VNC
# issue - but I recently have seen this on MSW box (no
# VNC present, not VM). Can't repeat the problem on MSW.
# What to do? The 'undef copied' above looks suspicious
# but all the code behind it looks correct to me re ref
# counting the Perl SV and not destroying the C++ data.
TODO: {
local $TODO = 'intermittent failure to GetData on wxMSW and wxGTK';
ok( wxTheClipboard->GetData( $pasted ), "pasting succeeds" );
}
isnt( $pasted->GetPerlData, $complex, "Check that identity is not the same" );
TODO: {
local $TODO = 'intermittent failure to GetPerlData on wxMSW and wxGTK';
is_deeply( $pasted->GetPerlData, $complex, "Correctly copied" );
wxTheClipboard->Close;
}
} );
package MyDataObject;
......
......@@ -4,7 +4,7 @@
## Author: Mattia Barbon
## Modified by:
## Created: 04/05/2001
## RCS-ID: $Id: PrintData.xs 2315 2008-01-18 21:47:17Z mbarbon $
## RCS-ID: $Id: PrintData.xs 3243 2012-03-25 11:24:18Z mdootson $
## Copyright: (c) 2001, 2004-2005, 2008 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
......@@ -103,4 +103,55 @@ wxPrintData::SetPrinterName( name )
void
wxPrintData::SetQuality( quality )
wxPrintQuality quality
#if WXPERL_W_VERSION_GE( 2, 8, 0 )
bool
wxPrintData::IsOrientationReversed()
wxPrintMode
wxPrintData::GetPrintMode()
int
wxPrintData::GetMedia();
void
wxPrintData::SetOrientationReversed( reversed )
bool reversed
void
wxPrintData::SetMedia( media )
int media
void