--- deliantra/Deliantra-Client/bin/cfplus 2006/08/14 03:41:29 1.115 +++ deliantra/Deliantra-Client/bin/cfplus 2006/08/15 06:30:05 1.117 @@ -1128,21 +1128,23 @@ } sub open_string_query { - my $cb = $_[1]; + my ($title, $cb, $txt, $tooltip) = @_; my $dialog = new CFPlus::UI::Toplevel x => "center", y => "center", z => 50, force_w => $WIDTH * 4/5, - title => $_[0]; + title => $title; $dialog->add ( my $e = new CFPlus::UI::Entry on_activate => sub { $cb->(@_); $dialog->hide; 0 }, on_key_down => sub { $_[1]->{sym} == 27 and $dialog->hide; 0 }, + tooltip => $tooltip ); $e->grab_focus; + $e->set_text ($txt) if $txt; $dialog->show; } @@ -1534,10 +1536,21 @@ $buttons->clear; + $buttons->add (new CFPlus::UI::Button + text => "⇤", + tooltip => "back to the starting page", + on_activate => sub { + unshift @future, [$curnode, $viewer->current_paragraph] if $curnode; + unshift @future, @history; + @history = (); + $load_node->(@{shift @future}); + }, + ); + if (@history) { $buttons->add (new CFPlus::UI::Button text => "⋘", - tooltip => "back to " . (CFPlus::asxml CFPlus::Pod::full_path $history[-1]) . "", + tooltip => "back to " . (CFPlus::asxml CFPlus::Pod::full_path $history[-1][0]) . "", on_activate => sub { unshift @future, [$curnode, $viewer->current_paragraph] if $curnode; $load_node->(@{pop @history}); @@ -1548,7 +1561,7 @@ if (@future) { $buttons->add (new CFPlus::UI::Button text => "⋙", - tooltip => "forward to " . (CFPlus::asxml CFPlus::Pod::full_path $future[0]) . "", + tooltip => "forward to " . (CFPlus::asxml CFPlus::Pod::full_path $future[0][0]) . "", on_activate => sub { push @history, [$curnode, $viewer->current_paragraph]; $load_node->(@{shift @future}); @@ -1589,7 +1602,7 @@ push @history, [$curnode, $viewer->current_paragraph] if $curnode; @future = (); - $load_node->(CFPlus::Pod::find @path); + $load_node->((CFPlus::Pod::find @path)[0]); $win->show; };