GUIDeFATE
view release on metacpan or search on metacpan
GUIDeFATE.pod view on Meta::CPAN
specific functions.
=back
=head1 AUTHOR
Saif Ahmed, SAIFTYNET { at } gmail.com
=head1 SEE ALSO
L<Wx>, L<Tk>, L<Image::Magick>, L<Wx::Perl::Imagick>, L<GLib>, L<Gtk3>
=cut
lib/GFtemplate.pm view on Meta::CPAN
package GFtemplate;
use strict;
use warnings;
our $VERSION = '0.081';
use parent qw(Backend::MainWindow); ##
use Image::Magick; ##other modules that need to be loaded
use Exporter 'import'; ##somefunctions are always passed back to GUIDeFATE.pm
our @EXPORT_OK = qw<addButton addStatText addTextCtrl addMenuBits addPanel setScale $frame $winScale $winWidth $winHeight $winTitle>;
our $frame; # The frame which is the parent of all the widgets
# ever widget is referenced by an id and is accessible by $frame -> {id}
our $winX=30; # These are the window dimensions and are modified by GUIDeFATE
our $winY=30;
our $winWidth;
lib/GFtemplate.pm view on Meta::CPAN
}
return $currentMenu;
}
sub aSP{
my ($self,$canvas, $id, $panelType, $content, $location, $size)=@_; ##image Id must endup $id+1
if ($panelType eq "I"){ # Image panels start with I
$content=~s/^\s+|\s+$//g;
if (! -e $content){ return; }
no warnings; # sorry about that...suppresses a "Useless string used in void context"
my $image = Image::Magick->new;
my $r = $image->Read("$content");
if ($image){
# function to place image at ${$location}[0],${$location}[1] of size ${$size}[0],${$size}[1]
# Image id is "Image".($id+1)...notice capital I and also $id is incremented (sometimes useful to put
# image in a container and if the container needs an ID then the containers ID is suffexed $id
}
else {"print failed to load image $content \n";}
}
if ($panelType eq "T"){ # text entry panels start with T
lib/GFtemplate.pm view on Meta::CPAN
my $location=$stattexts[getItem($self,$id,\@stattexts)][2];
# routine to change the contents of static text
}
#Image functions
sub setImage{
my ($self,$id,$file)=@_;
my $location=getLocation($self,$id,\@subpanels);
my $size=getSize($self,$id,\@subpanels);
if ($size){
my $image = Image::Magick->new;
my $r = $image->Read("$file");
if ($image){
# function to place image at ${$location}[0],${$location}[1] of size ${$size}[0],${$size}[1]
# Image id is "Image".($id+1)...notice capital I and also $id is incremented (sometimes useful to put
# image in a container and if the container needs an ID then the containers ID is suffexed $id
}
else {"print failed to load image $file \n";}
}
else {print "Panel not found"}
lib/GFtk.pm view on Meta::CPAN
package GFtk;
use strict;
use warnings;
our $VERSION = '0.081';
use parent qw(Tk::MainWindow);
use Tk::JPEG;
use Tk::BrowseEntry;
use Image::Magick;
use MIME::Base64;
use Exporter 'import';
our @EXPORT_OK = qw<addWidget addVar setScale $frame $winScale $winWidth $winHeight $winTitle>;
our $frame;
our $winX=30;
our $winY=30;
our $winWidth;
our $winHeight;
lib/GFtk.pm view on Meta::CPAN
}
# logging menu generator print "$currentMenu---$id----$label---$type\n";
return $currentMenu;
}
sub aSP{
my ($self,$canvas, $id, $panelType, $content, $location, $size)=@_;
if ($panelType eq "I"){ # Image panels start with I
if (! -e $content){ return; }
no warnings; # sorry about that...suppresses a "Useless string used in void context"
my $image = Image::Magick->new;
my $r = $image->Read("$content");
if ($image){
my $bmp; # used to hold the bitmap.
my $geom=${$size}[0]."x".${$size}[1]."!";
$image->Scale(geometry => $geom);
$bmp = ( $image->ImageToBlob(magick=>'jpg') )[0];
$canvas->{"image".($id+1)}=$canvas->createImage(${$location}[0],${$location}[1],
-anchor=>"nw",
-image => $canvas->Photo(#"img$id",
-format=>'jpeg',
lib/GFtk.pm view on Meta::CPAN
-font =>'medium'
);
}
#Image functions
sub setImage{
my ($self,$id,$file)=@_;
my $location=getLocation($self,$id,\@widgets);
my $size=getSize($self,$id,\@widgets);
if ($size){
my $image = Image::Magick->new;
my $r = $image->Read("$file");
if ($image){
my $bmp; # used to hold the bitmap.
my $geom=${$size}[0]."x".${$size}[1]."!";
$image->Scale(geometry => $geom);
$bmp = ( $image->ImageToBlob(magick=>'jpg') )[0];
$frame->{"$id"}=$frame->createImage(${$location}[0],${$location}[1],
-anchor=>"nw",
-image => $frame->Photo(#"img$id",
-format=>'jpeg',
lib/GUIDeFATE.pm view on Meta::CPAN
specific functions.
=back
=head1 AUTHOR
Saif Ahmed, SAIFTYNET { at } gmail.com
=head1 SEE ALSO
L<Wx>, L<Tk>, L<Image::Magick>, L<Wx::Perl::Imagick>, L<GLib>, L<Gtk3>
=cut
( run in 0.332 second using v1.01-cache-2.11-cpan-beeb90c9504 )