--- deliantra/Deliantra-Client/bin/cfplus 2006/08/13 19:47:05 1.111 +++ deliantra/Deliantra-Client/bin/cfplus 2006/08/13 20:01:14 1.112 @@ -1509,7 +1509,7 @@ my @history; my @future; - my $node; + my $curnode; my $load_node; $load_node = sub { my ($node) = @_; @@ -1517,14 +1517,29 @@ $buttons->clear; if (@history) { - $buttons->add (new CFPlus::UI::Button label => "<", on_activate => sub { - unshift @future, $node if $node; - $node = pop @history; + $buttons->add (new CFPlus::UI::Button + text => "<", + tooltip => "back to " . CFPlus::Pod::full_path_of $history[-1], + on_activate => sub { + unshift @future, $curnode if $curnode; + $load_node->(pop @history); + }); + } + if (@future) { + $buttons->add (new CFPlus::UI::Button + text => ">", + tooltip => "forward to " . CFPlus::Pod::full_path_of $future[0], + on_activate => sub { + push @history, $curnode; + $load_node->(shift @future); }); } + + $curnode = $node; + $viewer->clear; - $viewer->add_paragraph (CFPlus::Pod::as_paragraphs CFPlus::Pod::section_of $node); + $viewer->add_paragraph (CFPlus::Pod::as_paragraphs CFPlus::Pod::section_of $curnode); $viewer->set_offset (0); }; @@ -1533,7 +1548,7 @@ $CFPlus::Pod::on_link = sub { my (@path) = @_; - push @history, $node if $node; + push @history, $curnode if $curnode; @future = (); $load_node->(CFPlus::Pod::find @path);