Wx

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

t/09_create_delete.t
t/10_oor.t
t/11_twostage.t
t/12_pod.t
t/13_nbksizer.t
t/14_eh_die.t
t/15_threads.t
t/16_stream.t
t/17_thread_evt.t
t/18_unicode.t
t/19_overlay.t
t/20_ctx_threads.t
t/21_locale.t
t/22_interface.t
t/Tests_Helper.pm
t/zz_distrib.t
typemap
typemap.tmpl
typemap.xsp
Window.xs
Wx.pm

XS/Overlay.xs  view on Meta::CPAN

## RCS-ID:      $Id: Overlay.xs 2791 2010-02-09 22:01:57Z mbarbon $
## Copyright:   (c) 2000-2007, 2010 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, 8, 0 )

#include <wx/dc.h>
#include <wx/window.h>
#include <wx/overlay.h>
#include <wx/dcclient.h>

MODULE=Wx PACKAGE=Wx::Overlay

wxOverlay*
new( CLASS )
    SV* CLASS
  CODE:
    RETVAL = new wxOverlay();
  OUTPUT:

XS/Overlay.xs  view on Meta::CPAN


wxDCOverlay*
wxDCOverlay::new( ... )
  PPCODE:
    BEGIN_OVERLOAD()
        MATCH_REDISP( wxPliOvl_woly_wdc, newDefault )
        MATCH_REDISP( wxPliOvl_woly_wdc_n_n_n_n, newLong )
    END_OVERLOAD( Wx::DCOverlay::new )

wxDCOverlay*
newDefault( CLASS, overlay, dc )
    SV* CLASS
    wxOverlay* overlay
    wxWindowDC* dc
  CODE:
    RETVAL = new wxDCOverlay( *overlay, dc);
  OUTPUT:
    RETVAL

wxDCOverlay*
newLong( CLASS, overlay, dc, x, y, width, height )
    SV* CLASS
    wxOverlay* overlay
    wxWindowDC* dc
    int x
    int y
    int width
    int height
  CODE:
    RETVAL = new wxDCOverlay( *overlay, dc, x, y, width, height);
  OUTPUT:
    RETVAL

static void
wxDCOverlay::CLONE()
  CODE:
    wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );

## // thread OK

XS/TextAttr.xsp  view on Meta::CPAN

static void
wxTextAttr::CLONE()
  CODE:
    wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
%}

#if WXPERL_W_VERSION_GE( 2, 9, 0 )
    bool Apply(const wxTextAttr& style, wxTextAttr* compareWith = NULL );
#endif
#if WXPERL_W_VERSION_GE( 2, 7, 0 )
    void Merge( const wxTextAttr& overlay );
#endif
    void SetTextColour( const wxColour& colText );
    void SetBackgroundColour( const wxColour& colBack );
    void SetFont( const wxFont& font, long flags = wxTEXT_ATTR_FONT );
    void SetAlignment( wxTextAttrAlignment alignment );
    void SetTabs( const wxArrayInt& tabs );
    void SetLeftIndent( int indent, int subIndent = 0 );
    void SetRightIndent( int indent );
    void SetFlags( long flags );

t/15_threads.t  view on Meta::CPAN


sub check_undef {
    $_->[1] = undef foreach @tocheck;
}

my $testtreelist = defined(&Wx::TreeListCtrl::new);

my $app = Wx::App->new( sub { 1 } );
# ancillary
my $frame = Wx::Frame->new( undef, -1, 'Test frame' );
$frame->Show; # otherwise overlay tests fail
my $treectrl = Wx::TreeCtrl->new( $frame, -1 );
my $textctrl = Wx::TextCtrl->new( $frame, -1, 'Some text' );
my $treelist = Wx::TreeListCtrl->new( $frame, -1) if $testtreelist;
my $point = Wx::Point->new( 100, 100 );
my $size = Wx::Size->new( 100, 100 );
my $rect = Wx::Rect->new( $point, $size );
my $region = Wx::Region->new( $rect );
my $bitmap = Wx::Bitmap->new( 100, 100, -1 );
my $image = Wx::Image->new( 16, 16 );
my $locker;

t/15_threads.t  view on Meta::CPAN

check_init { Wx::AcceleratorEntry->new( 0, 1, 1 ) };
check_init { Wx::AcceleratorTable->new };
check_init { Wx::PlValidator->new };

if( Wx::wxVERSION > 2.009002 ) {
    check_init { Wx::RichToolTip->new('Hello', 'Goodbye') } ;
}

# Wx::Overlay / Wx::DCOverlay thread tests
# creation / destruction order is important
my( $overlay1, $overlay2, $checkdc1, $checkdc2, $dcoverlay1, $dcoverlay2 );
if( Wx::wxVERSION >= 2.008 ) {
    $overlay1 = Wx::Overlay->new;
    $overlay2 = Wx::Overlay->new;
    $checkdc1 = Wx::ClientDC->new( $frame );
    $checkdc2 = Wx::ClientDC->new( $frame );
    $dcoverlay1 =  Wx::DCOverlay->new($overlay1,  $checkdc1);
    $dcoverlay2 =  Wx::DCOverlay->new($overlay2,  $checkdc2);
}
undef $dcoverlay1;
undef $checkdc1;
undef $overlay1;

# check the ref hash is safe!
undef $color2;
undef $pen2;
undef $imagelist2;
undef $bi2;
undef $tid2;
undef $tlid2 if $testtreelist;
undef $tlccomp if $testtreelist;
check_undef;

t/19_overlay.t  view on Meta::CPAN

use strict;
use Wx;
use lib './t';
use Tests_Helper qw(in_frame);
use if !defined(&Wx::Overlay::new) => 'Test::More' => skip_all => 'no Overlay';
use Test::More 'tests' => 1;

# test will crash if creation / destruction does not happen as
# we expect

sub run_overlay_tests {
    my $self = shift;
    # Wx::Overlay real usage test
    $self->{wx_overlay} = Wx::Overlay->new;
    run_mouse_captured_drawing($self);
    run_mouse_captured_drawing($self);
    run_mouse_release($self);
    ok(1, 'Test completed');
}

sub run_mouse_captured_drawing {
    my $self = shift;
    my $dc = Wx::ClientDC->new( $self );
    my $olay = Wx::DCOverlay->new($self->{wx_overlay}, $dc);
    $dc->DrawLine(1,1,10,10);
}


sub run_mouse_release {
    my $self = shift;
    {
        # dc scope MUST be narrower than Reset call to overlay
        my $dc = Wx::ClientDC->new( $self );
        my $olay = Wx::DCOverlay->new($self->{wx_overlay}, $dc);
        $olay->Clear;
    }
    $self->{wx_overlay}->Reset;
}

in_frame(\&run_overlay_tests);



( run in 0.853 second using v1.01-cache-2.11-cpan-3b35f9de6a3 )