AAC-Pvoice

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    probably not that important)

0.9 AAC::Pvoice::Bitmap
        * We now use Image::Magick to create the bitmaps. It's a change to
          the internals, so the methods and their parameters stay the same.
        * Returned images are cached first (using File::Cache). If an image
          has been processed before, it will be retrieved from the cache.
          The cache never expires, but every combination of parameters
          results in a new cached image (and of course the file modificationtime
          of the image is also taken into account.
    AAC::Pvoice::Dialog
        * This is a newly added class. It's a subclass of Wx::Dialog and
          allows you to create dialog boxes, using an AAC::Pvoice::Panel
    AAC::Pvoice
        * This module now provides the AAC::Pvoice::MessageBox function,
          similar to Wx::MessageBox.
0.91 AAC::Pvoice
        * Made a little more space between the text and the buttons in the MessageBox
          function
     AAC::Pvoice::Bitmap
        * Minor changes
     AAC::Pvoice::Panel
        * ability to return the array of added texts from RetrieveText and SpeechRetrieveText

MANIFEST  view on Meta::CPAN

LICENSE
README
Todo
Changes
lib/AAC/Pvoice.pm
lib/AAC/Pvoice/Bitmap.pm
lib/AAC/Pvoice/Input.pm
lib/AAC/Pvoice/Panel.pm
lib/AAC/Pvoice/Row.pm
lib/AAC/Pvoice/EditableRow.pm
lib/AAC/Pvoice/Dialog.pm
t/001_load.t
Makefile.PL
META.yml

lib/AAC/Pvoice.pm  view on Meta::CPAN

use strict;
use warnings;

use Wx qw(:everything);
use Wx::Perl::Carp;
use AAC::Pvoice::Bitmap;
use AAC::Pvoice::Input;
use AAC::Pvoice::Row;
use AAC::Pvoice::EditableRow;
use AAC::Pvoice::Panel;
use AAC::Pvoice::Dialog;
use Text::Wrap qw(wrap);

BEGIN {
	use Exporter ();
	use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
	$VERSION     = 0.91;
	@ISA         = qw (Exporter);
	@EXPORT      = qw (MessageBox);
	@EXPORT_OK   = qw ();
	%EXPORT_TAGS = ();

lib/AAC/Pvoice.pm  view on Meta::CPAN

                                wxDECORATIVE,       # font family
                                wxNORMAL,           # style
                                wxNORMAL,           # weight
                                0,                  
                                'Comic Sans MS',    # face name
                                wxFONTENCODING_SYSTEM));

	my $h = $m->GetSize->GetHeight;
	$p->Destroy;

	my $d = AAC::Pvoice::Dialog->new(undef, -1, $caption, [$x,$y], [310,100+$h]);
	
	my $messagectrl = Wx::StaticText->new($d->{panel},
                                          -1,
                                          $message,
                                          wxDefaultPosition,
                                          wxDefaultSize,
                                          wxALIGN_CENTRE);
	$messagectrl->SetBackgroundColour($d->{backgroundcolour});
	$messagectrl->SetFont(Wx::Font->new(10,                 # font size
                                        wxDECORATIVE,       # font family

lib/AAC/Pvoice/Bitmap.pm  view on Meta::CPAN

    		return wxNullBitmap if not $factor;
    		($w, $h) = (int($w/$factor),$y-$ch);
    	    }
    	    $img->Resize(height => $h, width =>$w );
    	}
        
    	$img->Border(width  => int(($x - $img->Get('width'))/2) - $radius/2,
    		      height => int((($y-$textheight) - $img->Get('height'))/2) - $radius/2,
    		      fill   => $ibg);
    	
    	# Call the Composite method of the background image, with the logo image as an argument.
    	$background->Composite(image=>$img,compose=>'over', gravity => 'North');
    	$background->Set(quality=>100);
    	$background->Set(magick => 'png');
    	$image = $background->imagetoblob();
    	$cache->set("$file-$x-$y-$caption-$ibg-$blowup-$pbg-$mtime", $image);	
    	undef $background;
    	undef $img;
    }
    
    my $fh = IO::Scalar->new(\$image); 	 

lib/AAC/Pvoice/Dialog.pm  view on Meta::CPAN

package AAC::Pvoice::Dialog;
use strict;
use warnings;

our $VERSION     = sprintf("%d.%02d", q$Revision: 1.1 $=~/(\d+)\.(\d+)/);

use Wx qw(:everything);
use Wx::Event qw(EVT_CLOSE);

use base 'Wx::Dialog';

sub new
{
    my $class = shift;
    my $self = $class->SUPER::new(@_);
    my ($x, $y) = ($self->GetClientSize->GetWidth,
                   $self->GetClientSize->GetHeight);

    $self->{margin}           = 10;
    $self->{ITEMSPACING}      = 4;

lib/AAC/Pvoice/Dialog.pm  view on Meta::CPAN


1;

__END__


=pod

=head1 NAME

AAC::Pvoice::Dialog - A class similar to Wx::Dialog, with added accessibility

=head1 SYNOPSIS

  use AAC::Pvoice::Dialog;

=head1 DESCRIPTION

This subclass of Wx::Dialog knows all of Wx::Dialog's methods. Therefore
only two methods are described below. The constructor (which is also similar
to the Wx::Dialog constructor) and the (added) Append method.

=head1 USAGE

=head2 new(parent, id, caption, [x,y], [w,h])

This is the constructor for a new AAC::Pvoice::Dialog. It is similar to calling
the constructor of a Wx::Dialog.

=head2 Append

This method is similar to AAC::Pvoice::Panel's Append method and allows you
to append a 'row' (or any Wx::Window subclass) to the Dialog.

=head1 BUGS

probably a lot, patches welcome!


=head1 AUTHOR

	Jouke Visser
	jouke@pvoice.org



( run in 0.387 second using v1.01-cache-2.11-cpan-4d50c553e7e )