ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/cfplus
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.111 by root, Sun Aug 13 19:47:05 2006 UTC vs.
Revision 1.113 by root, Sun Aug 13 21:46:10 2006 UTC

1507 $vbox->add (my $viewer = new CFPlus::UI::TextScroller 1507 $vbox->add (my $viewer = new CFPlus::UI::TextScroller
1508 expand => 1, fontsize => 0.8, padding_x => 4); 1508 expand => 1, fontsize => 0.8, padding_x => 4);
1509 1509
1510 my @history; 1510 my @history;
1511 my @future; 1511 my @future;
1512 my $node; 1512 my $curnode;
1513 1513
1514 my $load_node; $load_node = sub { 1514 my $load_node; $load_node = sub {
1515 my ($node) = @_; 1515 my ($node) = @_;
1516 1516
1517 $buttons->clear; 1517 $buttons->clear;
1518 1518
1519 if (@history) { 1519 if (@history) {
1520 $buttons->add (new CFPlus::UI::Button label => "<", on_activate => sub { 1520 $buttons->add (new CFPlus::UI::Button
1521 text => "⋘",
1522 tooltip => "back to <i>" . (CFPlus::asxml CFPlus::Pod::full_path $history[-1]) . "</i>",
1523 on_activate => sub {
1521 unshift @future, $node if $node; 1524 unshift @future, $curnode if $curnode;
1522 $node = pop @history; 1525 $load_node->(pop @history);
1523 1526 },
1524 }); 1527 );
1525 } 1528 }
1529
1530 if (@future) {
1531 $buttons->add (new CFPlus::UI::Button
1532 text => "⋙",
1533 tooltip => "forward to <i>" . (CFPlus::asxml CFPlus::Pod::full_path $future[0]) . "</i>",
1534 on_activate => sub {
1535 push @history, $curnode;
1536 $load_node->(shift @future);
1537 },
1538 );
1539 }
1540
1541 $buttons->add (new CFPlus::UI::Label text => " ");
1542
1543 my @path = CFPlus::Pod::full_path_of $node;
1544 pop @path; # drop current node
1545
1546 for my $node (@path) {
1547 $buttons->add (new CFPlus::UI::Button
1548 text => $node->{kw}[0],
1549 tooltip => "go to <i>" . (CFPlus::asxml CFPlus::Pod::full_path $node) . "</i>",
1550 on_activate => sub {
1551 push @history, $curnode if $curnode; @future = ();
1552 $load_node->($node);
1553 },
1554 );
1555 $buttons->add (new CFPlus::UI::Label text => "/");
1556 }
1557
1558 $buttons->add (new CFPlus::UI::Label text => $node->{kw}[0]);
1559
1560 $curnode = $node;
1561
1526 $viewer->clear; 1562 $viewer->clear;
1527 $viewer->add_paragraph (CFPlus::Pod::as_paragraphs CFPlus::Pod::section_of $node); 1563 $viewer->add_paragraph (CFPlus::Pod::as_paragraphs CFPlus::Pod::section_of $curnode);
1528 $viewer->set_offset (0); 1564 $viewer->set_offset (0);
1529 }; 1565 };
1530 1566
1531 $load_node->(CFPlus::Pod::find pod => "mainpage"); 1567 $load_node->(CFPlus::Pod::find pod => "mainpage");
1532 1568
1533 $CFPlus::Pod::on_link = sub { 1569 $CFPlus::Pod::goto_document = sub {
1534 my (@path) = @_; 1570 my (@path) = @_;
1535 1571
1536 push @history, $node if $node; 1572 push @history, $curnode if $curnode; @future = ();
1537 @future = ();
1538 1573
1539 $load_node->(CFPlus::Pod::find @path); 1574 $load_node->(CFPlus::Pod::find @path);
1540 $win->show; 1575 $win->show;
1541 }; 1576 };
1542 1577

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines