vptk_w
view release on metacpan or search on metacpan
toolbar/balloon_cnf_dlg.txt view on Meta::CPAN
up listbox. It is passed the widget and the text of the entry
selected. This function is called after the entry variable has been
assigned the value.
-column => n
Sets the column to place widget in (n >= 0).
-columns => number
Number of columns in widget.
-columnspan => n
Sets the number of columns for the widget to span beginning with -column.
-command => subroutine pointer
Specifies the callback routine to be associated with the widget main action
(select, double-click, 'return' key, etc.) See specific TkPOD help for
each widget.
-compound => type
Specifies whether the button should display both an image and text, and
if so, where the image should be placed relative to the text. The default
my %IDE_settings;
my %Project_defaults;
my $balloon_bg_color;
my $balloon_delay;
my @AllWidgetsNames = AllWidgetsNames();
# Legal parameters per geometry:
my (%w_geom) = (
'pack' => [qw/-side -fill -expand -anchor -ipadx -ipady -padx -pady/],
'grid' => [qw/-row -column -rowspan -columnspan -sticky -ipadx -ipady -padx -pady/],
'place' => [qw/-anchor -height -width -x -y -relheight -relwidth -relx -rely/]
);
my @OrdinaryWidgets = (grep(HaveGeometry($_),sort @AllWidgetsNames),'packAdjust');
# (excluded widgets without geometry)
my @wrapped_icons = map(WidgetIconName($_),@AllWidgetsNames);
#
# ======================== Geometry management for Main window ================
#
my $mw = MainWindow->new(-title=>"Visual Perl Tk $VERSION (widget edition)");
# 1.2. check, does this cell free or not
# 1.3. if conflict - store it's id in '@conflicts' list
# 2. For each element in '@conflicts' list
# 2.1. correct element's (x,y) using 'safe' space after (xmax/ymax)
my ($x,$y,$xmax,$ymax);
my @conflicts;
my @matrix;
$xmax = $ymax = -1;
foreach (@children) {
($x) = $descriptor{$_}->{'geom'} =~ /-column\W+(\d+)/; # prevented matching -columnspan
$x = '0' unless $x;
$xmax = $x if $x > $xmax;
($y) = $descriptor{$_}->{'geom'} =~ /-row\W+(\d+)/; # prevented matching -rowspan
$y = '0' unless $y;
$ymax = $y if $y > $ymax;
if($matrix[$y][$x]) { push(@conflicts,$_); }
else { $matrix[$y][$x]=$_; }
}
$x = 0; $ymax++;
foreach (@conflicts) {
my %st;
foreach my $s (qw/n s e w/)
{
$st{$s}=grep(/$s/,$g_val{'-sticky'});
$f->Checkbutton(-text=>$s,-variable=>\$st{$s},
-command => sub{$g_val{'-sticky'}=~s/$s//g;$g_val{'-sticky'}.=$s if $st{$s}})
->pack(-side=>'left');
}
}
my $i=1;
foreach my $k(qw/-column -row -columnspan -rowspan -ipadx -ipady -padx -pady/)
{
&cnf_dlg_balloon($bl,$g_grid->Label(-text=>$k,-justify=>'left')->
grid(-row=>$i,-column=>0,-sticky=>'w',-padx=>8),$k);
my $f=$g_grid->Frame()->grid(-row=>$i,-column=>1,-pady=>4);
&cnf_dlg_balloon($bl,$f,$k);
&NumEntry($f,-textvariable=>\$g_val{$k},-width=>4,
-minvalue=>($k=~/(-column|-row)$/)?0:1)->pack(-side=>'right');
$i++;
}
( run in 0.303 second using v1.01-cache-2.11-cpan-a5abf4f5562 )