view release on metacpan or search on metacpan
ZooZ/Forms.pm view on Meta::CPAN
last;
}
$f5->Label(-text => 'Size',
)->grid(-column => 0, -row => 0, -sticky => 'w');
$f5->Optionmenu(-options => [5 .. 25],
-textvariable => \$FONTDATA{size},
-command => [\&configureSampleFont, $sample],
)->grid(-column => 1, -row => 0, -sticky => 'ew',
-columnspan => 2);
$f5->Label(-text => 'Weight',
)->grid(-column => 0, -row => 1, -sticky => 'w');
$f5->Radiobutton(-text => 'Normal',
-value => 'normal',
-variable => \$FONTDATA{weight},
-command => [\&configureSampleFont, $sample],
)->grid(-column => 1, -row => 1, -sticky => 'w');
$f5->Radiobutton(-text => 'Bold',
-value => 'bold',
ZooZ/Forms.pm view on Meta::CPAN
-variable => \$FONTDATA{slant},
-command => [\&configureSampleFont, $sample],
)->grid(-column => 2, -row => 2, -sticky => 'w');
$f5->Label(-text => 'Underline',
)->grid(-column => 0, -row => 3, -sticky => 'w');
$f5->Checkbutton(-text => 'Yes/No',
-variable => \$FONTDATA{underline},
-command => [\&configureSampleFont, $sample],
)->grid(-column => 1, -row => 3, -sticky => 'ew',
-columnspan => 2);
$f5->Label(-text => 'Overstrike',
)->grid(-column => 0, -row => 4, -sticky => 'w');
$f5->Checkbutton(-text => 'Yes/No',
-variable => \$FONTDATA{overstrike},
-command => [\&configureSampleFont, $sample],
)->grid(-column => 1, -row => 4, -sticky => 'ew',
-columnspan => 2);
# when user selects a registered font, update the other widgets.
$l3->bind('<1>' => sub {
my ($sel) = $l3->curselection;
defined $sel or return;
$sel = $l3->get($sel);
my $obj = $::FONTOBJ->obj($sel);
# update all the vars.
ZooZ/Forms.pm view on Meta::CPAN
)->pack(qw/-fill x/);
$VARDATA{initArrayV} = $f->Scrolled(Text =>
-scrollbars => 'e',
)->pack(qw/-fill both -expand 1/);
}
{
my $f = $VARDATA{initHashF} = $t->Frame;
$f->Label(-anchor => 'w',
-justify => 'left',
-text => <<EOT)->grid(-columnspan => 2);
Enter key value pairs.
Each line on the left will define a key and
each line on the right will define the corresponding value.
EOT
;
$f->Label(-text => 'Keys',
-font => 'OptionText',
)->grid(-row => 1, -column => 0, -sticky => 'w');
$f->Label(-text => 'Values',
-font => 'OptionText',
ZooZ/Forms.pm view on Meta::CPAN
$top->Label(
-textvariable => \$MENUDATA{FormName},
-font => 'WidgetName',
-fg => 'darkolivegreen',
-bg => 'white',
-borderwidth => 1,
-relief => 'ridge',
-pady => 5,
)->grid(-row => 0,
-column => 0,
-columnspan => 2,
-sticky => 'ew');
my $hl = $top->Scrolled(HList =>
-scrollbars => 'se',
-bg => 'white',
-header => 1,
-columns => 4,
)->grid(-row => 1,
-column => 0,
-rowspan => 2,
ZooZ/Forms.pm view on Meta::CPAN
my $ref = $CONFDATA{NBCONF}{$projid}{$name};
$ref->{LB}->delete(qw/0 end/);
$ref->{LB}->insert(end => $_) for keys %{$ref->{TABS}};
$ref->{TOP}->deiconify;
#$top->waitVisibility;
})->grid(-row => $row,
-column => 0,
-sticky => 'nsew',
-columnspan => 3,
-pady => 10,
-pady => 5,
);
# Check if we have menu builder support enabled.
} elsif (main::MENU_BUILDER_SUPPORT && ref($widget) eq 'Tk::Toplevel') {
$MENUS[$projid]{ENABLED} = 0;
my $lf;
my $cb = $f->Checkbutton(-text => 'Add Menu',
ZooZ/Forms.pm view on Meta::CPAN
$_->configure(-state => 'disabled') for $lf->children;
}
});
$lf = $f->Labelframe(#-text => 'Menus',
-labelwidget => $cb,
-relief => 'ridge',
)->grid(-row => $row+1,
-column => 0,
-sticky => 'nsew',
-columnspan => 3,
);
$lf->Button(-text => 'Configure Menu',
-command => [\&configureMenu, __PACKAGE__, $project, $projid, $name, $widget],
)->pack(qw/-fill both -expand 1/);
# initially .. set everything to disabled state.
$_->configure(-state => 'disabled') for $lf->children;
}
ZooZ/Forms.pm view on Meta::CPAN
$f11->Label(-text => 'Horizontal',
)->grid(-column => 0, -row => 1, -sticky => 'w');
$f11->Checkbutton(-text => 'Display Only if Needed',
-variable => \$Eoptions->{HOPTIONAL},
-font => 'OptionText',
)->grid(-column => 1,
-row => 1,
-sticky => 'w',
-columnspan => 3,
);
$f11->Radiobutton(-text => 'North',
-value => 'n',
-variable => \$Eoptions->{HSCROLLLOC},
-font => 'OptionText',
)->grid(-column => 1,
-row => 2,
-sticky => 'ew');
$f11->Radiobutton(-text => 'South',
-value => 's',
ZooZ/Forms.pm view on Meta::CPAN
$f11->Label(-text => 'Vertical',
)->grid(-column => 0, -row => 3, -sticky => 'w');
$f11->Checkbutton(-text => 'Display Only if Needed',
-variable => \$Eoptions->{VOPTIONAL},
-font => 'OptionText',
)->grid(-column => 1,
-row => 3,
-sticky => 'w',
-columnspan => 3,
);
$f11->Radiobutton(-text => 'East',
-value => 'e',
-variable => \$Eoptions->{VSCROLLLOC},
-font => 'OptionText',
)->grid(-column => 1,
-row => 4,
-sticky => 'ew');
$f11->Radiobutton(-text => 'West',
-value => 'w',
ZooZ/Options.pm view on Meta::CPAN
$$ref = $h{$key};
my $e = $frame->BrowseEntry(
-choices => [sort {$h{$a} <=> $h{$b}} keys %h],
-state => 'readonly',
-variable => \$key,
-disabledforeground => 'black',
-browsecmd => sub { $$ref = $h{$key} },
)->grid(-column => $col + 1,
-row => $row,
-columnspan => 2,
-sticky => 'ew',
);
} elsif ($type eq 'List') {
my $e = $frame->BrowseEntry(
-choices => [@list],
-state => 'readonly',
-variable => $ref,
-disabledforeground => 'black',
)->grid(-column => $col + 1,
-row => $row,
-columnspan => 2,
-sticky => 'ew',
);
} elsif ($type eq 'Integer') {
my $pos = shift @list || 0;
my $rgx = $pos ? qr/^\d$/ : qr/^(?:-|\d|\.)$/;
$frame->Entry(
-textvariable => $ref,
-validate => 'key',
-validatecommand => sub {
return 1 unless $_[4] == 1 || $_[4] == 8; # Tk800 and Tk804
return 0 unless $_[1] =~ /$rgx/;
return 1;
},
)->grid(-column => $col + 1,
-row => $row,
-columnspan => 2,
-sticky => 'ew',
);
} elsif ($type eq 'String') {
$frame->Entry(
-textvariable => $ref,
)->grid(-column => $col + 1,
-row => $row,
-columnspan => 2,
-sticky => 'ew',
);
} elsif ($type eq 'Boolean') {
$frame->Checkbutton(-text => 'On/Off',
-variable => $ref,
-anchor => 'w',
)->grid(-column => $col + 1,
-row => $row,
-columnspan => 2,
-sticky => 'ew',
);
} elsif ($type eq 'Font') {
$$ref ||= 'Default';
$frame->Entry(-textvariable => $ref,
-relief => 'flat',
-state => 'disabled',
-disabledforeground => 'black',
)->grid(-column => $col + 1,
ZooZ/Options.pm view on Meta::CPAN
return;
}
$b->configure(-text => '\&' . $cb);
$$ref = eval "\\&$cb";
$::CALLBACKOBJ->name2code($cb, $$ref);
},
)->grid(-column => $col + 1,
-row => $row,
-columnspan => 2,
-sticky => 'ew',
);
} elsif ($type eq 'VarRef') {
$$ref = 'Select Variable' unless $$ref;
my $b;
$b = $frame->Button(-text => $$ref,
-pady => 0,
-command => sub {
ZooZ/Options.pm view on Meta::CPAN
{
$vr =~ s/^.//;
no strict;
$$ref = \${"main::$vr"};
}
$::VARREFOBJ->name2ref($cp, $$ref);
})->grid(-column => $col + 1,
-row => $row,
-columnspan => 2,
-sticky => 'ew',
);
} elsif ($type eq 'Name') {
$frame->Entry(
-textvariable => $ref,
-validate => 'key',
-validatecommand => sub { #disallow spaces
return 1 unless $_[4] == 1 || $_[4] == 8; # Tk800 and Tk804
return 0 if $_[1] =~ /\s/;
return 1;
})->grid(-column => $col + 1,
-row => $row,
-columnspan => 2,
-sticky => 'ew',
);
$label->configure(-font => 'Default', -relief => 'solid', -bg => $args[0] || Tk::NORMAL_BG);
}
# configure the row to make it look nice.
$frame->gridRowconfigure($row, -minsize => $maxHeight, -weight => 2);
return $label;
ZooZ/Project.pm view on Meta::CPAN
# now iterate through all the objects and update.
for my $lab (keys %{$self->{LABEL2GRID}}) {
my ($row, $col) = @{$self->{LABEL2GRID}{$lab}};
my $ref = $self->{GRID}[$row][$col];
$ref->{PREVIEW}->grid(-row => $row,
-column => $col,
-rowspan => $ref->{ROWS},
-columnspan => $ref->{COLS},
);
}
$top->geometry('') unless $self->{ISCHILD};
}
######################
#
# This method creates the canvas (full-fledged ZooZ::Project object)
# for any container widgets when we want to add widgets to them.
ZooZ/Project.pm view on Meta::CPAN
} else {
print $fh ")->grid(";
}
# Now place it via grid().
@pairs = ([-row => $row],
[-column => $col],
);
push @pairs => [-rowspan => $ref->{ROWS}] if $ref->{ROWS} > 1;
push @pairs => [-columnspan => $ref->{COLS}] if $ref->{COLS} > 1;
$ref->{PCONF}{$_} &&
push @pairs => [$_ => $ref->{PCONF}{$_} =~ /^\d+$/ ?
$ref->{PCONF}{$_} : "'$ref->{PCONF}{$_}'"
] for qw/-sticky -ipadx -ipady -padx -pady/;
print $fh "\n", ZooZ::Generic::lineUpCommas(@pairs), "\n );";
# if a container, then call recursively.
if (exists $self->{SHARED}{SUBHIERS}{$lab}) {