aboutsummaryrefslogtreecommitdiff
path: root/Perl/Zinc/Debug.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Perl/Zinc/Debug.pm')
-rw-r--r--Perl/Zinc/Debug.pm51
1 files changed, 26 insertions, 25 deletions
diff --git a/Perl/Zinc/Debug.pm b/Perl/Zinc/Debug.pm
index b12333c..207f5b6 100644
--- a/Perl/Zinc/Debug.pm
+++ b/Perl/Zinc/Debug.pm
@@ -1,13 +1,12 @@
-# ZincDebug Perl Module :
+# Tk::Zinc::Debug Perl Module :
#
-# For debugging/analysing a Zinc application. Only one instance
-# of zinc can be managed.
+# For debugging/analysing a Zinc application.
#
# Author : Daniel Etienne <etienne@cena.fr>
#
# $Id$
#---------------------------------------------------------------------------
-package ZincDebug;
+package Tk::Zinc::Debug;
use vars qw( $VERSION );
($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
@@ -56,10 +55,10 @@ my %cmdoptions;
my $initobjectfunction;
BEGIN {
- # test if ZincDebug is loaded using the -M perl option
+ # test if Tk::Zinc::Debug is loaded using the -M perl option
$preload = 1 if (caller(2))[2] == 0;
return unless $preload;
- # parse ZincDebug options
+ # parse Tk::Zinc::Debug options
require Getopt::Long;
Getopt::Long::Configure('pass_through');
Getopt::Long::GetOptions(\%cmdoptions,
@@ -76,10 +75,10 @@ BEGIN {
}
-# Hack to capture the instance of zinc. ZincDebug functions are invoked here.
+# Hack to capture the instance of zinc. Tk::Zinc::Debug functions are invoked here.
# Note that created bindings might be overloaded by the application.
sub Tk::Zinc::InitObject {
- print "ZincDebug is ON\n";
+ print "Tk::Zinc::Debug is ON\n";
# invoke function possibly overloaded in other modules
&$initobjectfunction(@_) if $initobjectfunction;
return unless $preload;
@@ -118,7 +117,7 @@ sub tree {
my $zinc = shift;
unless ($zinc) {
- carp "In ZincDebug module, tree() function, widget must be specified\n";
+ carp "In Tk::Zinc::Debug module, tree() function, widget must be specified\n";
return;
}
&newinstance($zinc);
@@ -133,7 +132,7 @@ sub tree {
# options
my %options = @_;
for my $opt (keys(%options)) {
- carp "in ZincDebug module, tree() function, unknown option $opt\n"
+ carp "in Tk::Zinc::Debug module, tree() function, unknown option $opt\n"
unless ($opt eq '-itemModBtn' or $opt eq '-key' or $opt eq '-tkey' or
$opt eq '-optionsToDisplay' or $opt eq '-optionsFormat');
}
@@ -161,7 +160,7 @@ sub tree {
['Control', 2];
$options{-optionsFormat} = 'column' unless $options{-optionsFormat};
if ($options{-optionsFormat} ne 'row' and $options{-optionsFormat} ne 'column') {
- carp "in ZincDebug module, tree() function, expected values for ".
+ carp "in Tk::Zinc::Debug module, tree() function, expected values for ".
"-optionsFormat are 'row' or 'column'. Option is set to 'column'\n";
$options{-optionsFormat} = 'column';
}
@@ -192,14 +191,14 @@ sub finditems {
my $zinc = shift;
unless ($zinc) {
- carp "In ZincDebug module, finditems() function, widget must be specified\n";
+ carp "In Tk::Zinc::Debug module, finditems() function, widget must be specified\n";
return;
}
&newinstance($zinc);
# options
my %options = @_;
for my $opt (keys(%options)) {
- carp "in ZincDebug module, finditems() function, unknown option $opt\n"
+ carp "in Tk::Zinc::Debug module, finditems() function, unknown option $opt\n"
unless ($opt eq '-color' or $opt eq '-enclosedModBtn' or
$opt eq '-overlapModBtn' or $opt eq '-searchKey');
}
@@ -286,14 +285,14 @@ sub snapshot {
my $zinc = shift;
unless ($zinc) {
- carp "In ZincDebug module, snapshot() function, widget must be specified\n";
+ carp "In Tk::Zinc::Debug module, snapshot() function, widget must be specified\n";
return;
}
&newinstance($zinc);
# options
my %options = @_;
for my $opt (keys(%options)) {
- carp "in ZincDebug module, snapshot() function, unknown option $opt\n"
+ carp "in Tk::Zinc::Debug module, snapshot() function, unknown option $opt\n"
unless ($opt eq '-key' or $opt eq '-skey' or
$opt eq '-verbosity' or $opt eq '-basename');
}
@@ -1803,7 +1802,7 @@ sub printWindow {
}
else {
my $dir = `pwd`; chomp ($dir);
- print "ZincDebug: Zinc window snapshot saved in $dir". "/$filename\n"
+ print "Tk::Zinc::Debug: Zinc window snapshot saved in $dir". "/$filename\n"
if $verbosity;
}
@@ -1837,11 +1836,11 @@ sub showErrorWhilePrinting {
# display complete help screen
sub showgeneralhelp {
if (@instances == 1) {
- &showinstancehelp($instances[0], "ZincDebug help", 1);
+ &showinstancehelp($instances[0], "Tk::Zinc::Debug help", 1);
} elsif (@instances > 1) {
$help_tl{gene}->destroy if $help_tl{gene} and Tk::Exists($help_tl{gene});
$help_tl{gene} = $instances[0]->Toplevel;
- $help_tl{gene}->title("ZincDebug general help");
+ $help_tl{gene}->title("Tk::Zinc::Debug general help");
my $text = $help_tl{gene}->Scrolled('Text', -font =>
scalar $instances[0]->cget(-font),
@@ -1874,7 +1873,7 @@ sub showgeneralhelp {
$fm->Button(-text => 'Help',
-cursor => 'top_left_arrow',
-command => [\&showinstancehelp, $instances[$i],
- 'ZincDebug help about instance #'.$j],
+ 'Tk::Zinc::Debug help about instance #'.$j],
)->grid(-row => $j, -column => 4);
#&showinstancehelp($_);
}
@@ -2227,16 +2226,16 @@ __END__
=head1 NAME
-ZincDebug - a perl module for analysing a Zinc application.
+Tk::Zinc::Debug - a perl module for analysing a Zinc application.
=head1 SYNOPSIS
- perl -MZincDebug zincscript [zincscript-opts] [zincdebug-opts]
+ perl -MTk::Zinc::Debug zincscript [zincscript-opts] [zincdebug-opts]
or
- use ZincDebug;
+ use Tk::Zinc::Debug;
my $zinc = MainWindow->new()->Zinc()->pack;
finditems($zinc, [options]);
tree($zinc, [options]);
@@ -2245,7 +2244,7 @@ ZincDebug - a perl module for analysing a Zinc application.
=head1 DESCRIPTION
-ZincDebug provides an interface to help developers to debug or analyse Zinc applications.
+Tk::Zinc::Debug provides an interface to help developers to debug or analyse Zinc applications.
With B<finditems()> function, you are able to scan all items which are enclosed in a rectangular area you have first drawn by drag & drop, or all items which overlap it. Result is a Tk table which presents details (options, coordinates, ...) about found items; you can also highlight a particular item, even if it's not visible, by clicking on its corresponding button in the table. You can also display particular item's features by entering this id in dedicated entry field
@@ -2255,8 +2254,8 @@ With B<snapshot()> function, you are able to snapshot the application window, in
Press B<Escape> key in the toplevel of the application to have some help about available input sequences.
-B<If you load ZincDebug using the -M perl option, nothing needs to be added to your code>. By default, all the previous specific functions are invoked with their default attributes for each instance of Zinc widget. You can overload these by passing the same options to the command. Note that perl arrays must be transformed to comma separated string. For example:
- perl -M ZincDebug zincscript -optionsToDisplay '-tags'
+B<If you load Tk::Zinc::Debug using the -M perl option, nothing needs to be added to your code>. By default, all the previous specific functions are invoked with their default attributes for each instance of Zinc widget. You can overload these by passing the same options to the command. Note that perl arrays must be transformed to comma separated string. For example:
+ perl -M Tk::Zinc::Debug zincscript -optionsToDisplay '-tags'
-optionsFormat row -itemModBtn Control,1
@@ -2346,6 +2345,8 @@ Daniel Etienne <etienne@cena.fr>
=head1 HISTORY
+Sep 15 2003 : due to CPAN-isation, the ZincDebug module has been renamed Tk::Zinc::Debug
+
May 20 2003 : perl code can be generated from the items tree, with some limitations concerning transformations and images.
Mar 11 2003 : ZincDebug can manage several instances of Zinc widget. Options of ZincDebug functions can be set on the command line.