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