Similar Threads
1. Reverse hyperlink
I would like to create a cell where a user can enter a value (1 thru 4096),
the entered value will jump them to the corresponding row. Can this be done?
or should I simply create a worksheet that performs a lookup to another sheet?
2. Reverse Hyperlink - change mailto to text
3. Reverse arrow for hyperlinks
Version: 2008
Operating System: Mac OS X 10.6 (Snow Leopard)
Processor: Intel
I need to find a 'reversing arrow' that I can add to the toolbar to click on after using a hyperlink. <br>
You can do this in Windows but I cannot find a similar facility when using my macbook. <br>
I use longish word docs that often have links to other parts of the document. How do I get back to the point at which I activated the hyperlink, apart from scrolling back laboriously? <br>
Thanks for any solutions.
4. Listbox selection reverse
5. Tk-HistEntry 0.42 patch to reverse display of items
It irked me that Tk::HistEntry 0.42 displays the history items with the
most recent item on the bottom of the popup listbox. I would expect
the
items to be in reverse order (latest at the top). So, I implemented a
-showlastfirst option that does what I want.
I'm probably not the only person who wants this behavior, so I'm
including a patch containing my changes at the end of this message.
I would appreciate any comments on these changes.
Thanks,
Bradford C. Smith
Index: HistEntry.pm
===================================================================
RCS file: /scm/cvs-root/CPSptkwid/Tk-HistEntry/HistEntry.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HistEntry.pm 12 Apr 2005 14:37:02 -0000 1.1
+++ HistEntry.pm 15 Apr 2005 16:57:29 -0000 1.2
@@ -385,8 +385,11 @@
if ($Tk::VERSION >= 800) {
$w->SUPER::Populate($args);
} else {
+ my @myopts = qw(
+ -auto -command -dup -bell -limit -match -case
-showlastfirst
+ );
my $saveargs;
- foreach (qw(-auto -command -dup -bell -limit -match -case)) {
+ foreach (@myopts) {
if (exists $args->{$_}) {
$saveargs->{$_} = delete $args->{$_};
}
@@ -413,6 +416,8 @@
-match => ['PASSIVE', 'match', 'Match', 0],
-case => ['PASSIVE', 'case', 'Case', 1],
-history => ['METHOD'],
+ -showlastfirst =>
+ [qw/PASSIVE showLastFirst ShowLastFirst/, undef],
);
## Delegation does not work with the new BrowseEntry --- it seems to
me
@@ -429,35 +434,40 @@
sub get { shift->Subwidget('entry')->get (@_) }
sub insert { shift->Subwidget('entry')->insert(@_) }
+# $w->listboxRefresh
+#
+# Reload listbox widget (if any) with history items.
+sub listboxRefresh {
+ my ($w) = @_;
+
+ $w->_listbox_method(qw/delete 0 end/);
+ my @hist = $w->history;
+ return unless @hist;
+ my $lastfirst = $w->cget('-showlastfirst');
+ @hist = reverse(@hist) if $lastfirst;
+ $w->_listbox_method(qw/insert end/, @hist);
+ my $select_idx = $lastfirst ? 0 : 'end';
+ # make sure latest value is visible, selected and active
+ $w->_listbox_method('see', $select_idx);
+ $w->_listbox_method('selectionSet', $select_idx);
+ $w->_listbox_method('activate', $select_idx);
+}
+
sub historyAdd {
my($w, $string) = @_;
- my($inserted, $spliced) = $w->SUPER::historyAdd($string,
-spliceinfo => 1);
- if (defined $inserted) {
- if ($spliced) {
- $w->history([ $w->SUPER::history ]);
- } else {
- $w->_listbox_method("insert", 'end', $inserted);
- # XXX Obeying -limit also for the array itself?
- if (defined $w->cget(-limit) &&
- $w->_listbox_method("size") > $w->cget(-limit)) {
- $w->_listbox_method("delete", 0);
- }
- }
- $w->_listbox_method("see", 'end');
- return $inserted;
- }
- undef;
+ my($inserted) = $w->SUPER::historyAdd($string);
+ # refresh listbox if history has been changed
+ $w->listboxRefresh if defined $inserted;
+ return $inserted;
}
*addhistory = \&historyAdd;
sub history {
my($w, $history) = @_;
- if (defined $history) {
- $w->_listbox_method("delete", 0, 'end');
- $w->_listbox_method("insert", 'end', @$history);
- $w->_listbox_method("see", 'end');
- }
- $w->SUPER::history($history);
+ my @ret = $w->SUPER::history($history);
+ # refresh listbox if history has been changed
+ $w->listboxRefresh if $history;
+ return @ret;
}
1;
@@ -538,8 +548,16 @@
=item B<-case>
-If set to true a true value, then be case sensitive on
+If set to a true value, then be case sensitive on
auto-completion. Defaults to 1.
+
+=item B<-showlastfirst>
+
+This option only applies to Tk::HistEntry.
+If it is set to a true value,
+history items will be displayed in reverse order in the listbox
+(i.e. most recent at the top).
+Default value is undef.
=back
6. a tool to reverse-engineer a schema - Perl DBI
7. Howto reverse SortByValue with Tie::IxHash
Hi,
I have a problem using Tie::IxHash.
My question is how can I sort the hash
by value in descending order.
I tried this to get the descending order,
but doesn't seem to work:
__BEGIN__
my %hash =(
'1-1' => 3,
'2-3' => 2,
'2-2' => 1,
'1-2' => 6,
'1-3' => 3
);
my $t = Tie::IxHash->new(%hash);
$t->SortByValue; # ascending, ok!
$t->$hash{$b}<=>$hash{$a}SortByValue; #tried this but doesn't work
__END__
Can anybody advice how to go about this?
Thanks beforehand.
Regards,
Edward WIJAYA
SINGAPORE
8. Help with ARP scan/reverse DNS script - Perl