diff options
Diffstat (limited to 'Master/xemtex/perl/site/lib/auto/Tk/Toplevel')
7 files changed, 190 insertions, 0 deletions
diff --git a/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_BindIn.al b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_BindIn.al new file mode 100644 index 00000000000..cc2ceaf7b63 --- /dev/null +++ b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_BindIn.al @@ -0,0 +1,19 @@ +# NOTE: Derived from blib\lib\Tk/Toplevel.pm. +# Changes made here will be lost when autosplit is run again. +# See AutoSplit.pm. +package Tk::Toplevel; + +#line 128 "blib\lib\Tk/Toplevel.pm (autosplit into blib\lib\auto\Tk\Toplevel\FG_BindIn.al)" +# tkFocusGroup_BindIn -- +# +# Add a widget into the "FocusIn" list of the focus group. The $cmd will be +# called when the widget is focused on by the user. +# +sub FG_BindIn { + my($t, $w, $cmd) = @_; + $t->Error("focus group \"$t\" doesn't exist") unless (exists $t->{'_fg'}); + $t->{'_FocusIn'}{$w} = Tk::Callback->new($cmd); +} + +# end of Tk::Toplevel::FG_BindIn +1; diff --git a/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_BindOut.al b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_BindOut.al new file mode 100644 index 00000000000..5c5cf9cc3de --- /dev/null +++ b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_BindOut.al @@ -0,0 +1,20 @@ +# NOTE: Derived from blib\lib\Tk/Toplevel.pm. +# Changes made here will be lost when autosplit is run again. +# See AutoSplit.pm. +package Tk::Toplevel; + +#line 139 "blib\lib\Tk/Toplevel.pm (autosplit into blib\lib\auto\Tk\Toplevel\FG_BindOut.al)" +# tkFocusGroup_BindOut -- +# +# Add a widget into the "FocusOut" list of the focus group. The +# $cmd will be called when the widget loses the focus (User +# types Tab or click on another widget). +# +sub FG_BindOut { + my($t, $w, $cmd) = @_; + $t->Error("focus group \"$t\" doesn't exist") unless (exists $t->{'_fg'}); + $t->{'_FocusOut'}{$w} = Tk::Callback->new($cmd); +} + +# end of Tk::Toplevel::FG_BindOut +1; diff --git a/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_Create.al b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_Create.al new file mode 100644 index 00000000000..0953c045be8 --- /dev/null +++ b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_Create.al @@ -0,0 +1,56 @@ +# NOTE: Derived from blib\lib\Tk/Toplevel.pm. +# Changes made here will be lost when autosplit is run again. +# See AutoSplit.pm. +package Tk::Toplevel; + +#line 80 "blib\lib\Tk/Toplevel.pm (autosplit into blib\lib\auto\Tk\Toplevel\FG_Create.al)" +#---------------------------------------------------------------------- +# +# Focus Group +# +# Focus groups are used to handle the user's focusing actions inside a +# toplevel. +# +# One example of using focus groups is: when the user focuses on an +# entry, the text in the entry is highlighted and the cursor is put to +# the end of the text. When the user changes focus to another widget, +# the text in the previously focused entry is validated. +# + +#---------------------------------------------------------------------- +# tkFocusGroup_Create -- +# +# Create a focus group. All the widgets in a focus group must be +# within the same focus toplevel. Each toplevel can have only +# one focus group, which is identified by the name of the +# toplevel widget. +# +sub FG_Create { + my $t = shift; + unless (exists $t->{'_fg'}) { + $t->{'_fg'} = 1; + $t->bind('<FocusIn>', sub { + my $w = shift; + my $Ev = $w->XEvent; + $t->FG_In($w, $Ev->d); + } + ); + $t->bind('<FocusOut>', sub { + my $w = shift; + my $Ev = $w->XEvent; + $t->FG_Out($w, $Ev->d); + } + ); + $t->bind('<Destroy>', sub { + my $w = shift; + my $Ev = $w->XEvent; + $t->FG_Destroy($w); + } + ); + # <Destroy> is not sufficient to break loops if never mapped. + $t->OnDestroy([$t,'FG_Destroy']); + } +} + +# end of Tk::Toplevel::FG_Create +1; diff --git a/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_Destroy.al b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_Destroy.al new file mode 100644 index 00000000000..e20f1eb7568 --- /dev/null +++ b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_Destroy.al @@ -0,0 +1,29 @@ +# NOTE: Derived from blib\lib\Tk/Toplevel.pm. +# Changes made here will be lost when autosplit is run again. +# See AutoSplit.pm. +package Tk::Toplevel; + +#line 151 "blib\lib\Tk/Toplevel.pm (autosplit into blib\lib\auto\Tk\Toplevel\FG_Destroy.al)" +# tkFocusGroup_Destroy -- +# +# Cleans up when members of the focus group is deleted, or when the +# toplevel itself gets deleted. +# +sub FG_Destroy { + my($t, $w) = @_; + if (!defined($w) || $t == $w) { + delete $t->{'_fg'}; + delete $t->{'_focus'}; + delete $t->{'_FocusOut'}; + delete $t->{'_FocusIn'}; + } else { + if (exists $t->{'_focus'}) { + delete $t->{'_focus'} if ($t->{'_focus'} == $w); + } + delete $t->{'_FocusIn'}{$w}; + delete $t->{'_FocusOut'}{$w}; + } +} + +# end of Tk::Toplevel::FG_Destroy +1; diff --git a/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_In.al b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_In.al new file mode 100644 index 00000000000..a4b5c67a155 --- /dev/null +++ b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_In.al @@ -0,0 +1,24 @@ +# NOTE: Derived from blib\lib\Tk/Toplevel.pm. +# Changes made here will be lost when autosplit is run again. +# See AutoSplit.pm. +package Tk::Toplevel; + +#line 172 "blib\lib\Tk/Toplevel.pm (autosplit into blib\lib\auto\Tk\Toplevel\FG_In.al)" +# tkFocusGroup_In -- +# +# Handles the <FocusIn> event. Calls the FocusIn command for the newly +# focused widget in the focus group. +# +sub FG_In { + my($t, $w, $detail) = @_; + if (defined $t->{'_focus'} and $t->{'_focus'} eq $w) { + # This is already in focus + return; + } else { + $t->{'_focus'} = $w; + $t->{'_FocusIn'}{$w}->Call if exists $t->{'_FocusIn'}{$w}; + } +} + +# end of Tk::Toplevel::FG_In +1; diff --git a/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_Out.al b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_Out.al new file mode 100644 index 00000000000..96a3841e6fd --- /dev/null +++ b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/FG_Out.al @@ -0,0 +1,32 @@ +# NOTE: Derived from blib\lib\Tk/Toplevel.pm. +# Changes made here will be lost when autosplit is run again. +# See AutoSplit.pm. +package Tk::Toplevel; + +#line 188 "blib\lib\Tk/Toplevel.pm (autosplit into blib\lib\auto\Tk\Toplevel\FG_Out.al)" +# tkFocusGroup_Out -- +# +# Handles the <FocusOut> event. Checks if this is really a lose +# focus event, not one generated by the mouse moving out of the +# toplevel window. Calls the FocusOut command for the widget +# who loses its focus. +# +sub FG_Out { + my($t, $w, $detail) = @_; + if ($detail ne 'NotifyNonlinear' and $detail ne 'NotifyNonlinearVirtual') { + # This is caused by mouse moving out of the window + return; + } + unless (exists $t->{'_FocusOut'}{$w}) { + return; + } else { + $t->{'_FocusOut'}{$w}->Call; + delete $t->{'_focus'}; + } +} + +1; + +__END__ +1; +# end of Tk::Toplevel::FG_Out diff --git a/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/autosplit.ix b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/autosplit.ix new file mode 100644 index 00000000000..6267c58604c --- /dev/null +++ b/Master/xemtex/perl/site/lib/auto/Tk/Toplevel/autosplit.ix @@ -0,0 +1,10 @@ +# Index created by AutoSplit for blib\lib\Tk/Toplevel.pm +# (file acts as timestamp) +package Tk::Toplevel; +sub FG_Create ; +sub FG_BindIn ; +sub FG_BindOut ; +sub FG_Destroy ; +sub FG_In ; +sub FG_Out ; +1; |