… | |
… | |
1133 | }; |
1133 | }; |
1134 | |
1134 | |
1135 | $window |
1135 | $window |
1136 | } |
1136 | } |
1137 | |
1137 | |
|
|
1138 | sub open_string_query { |
|
|
1139 | my $cb = $_[1]; |
|
|
1140 | my $dialog = new CFPlus::UI::FancyFrame |
|
|
1141 | x => "center", |
|
|
1142 | y => "center", |
|
|
1143 | z => 50, |
|
|
1144 | force_w => $WIDTH * 4/5, |
|
|
1145 | title => $_[0]; |
|
|
1146 | |
|
|
1147 | $dialog->add ( |
|
|
1148 | my $e = new CFPlus::UI::Entry |
|
|
1149 | on_activate => sub { $cb->(@_); $dialog->hide; 0 }, |
|
|
1150 | on_key_down => sub { $_[1]->{sym} == 27 and $dialog->hide; 0 }, |
|
|
1151 | ); |
|
|
1152 | |
|
|
1153 | $e->grab_focus; |
|
|
1154 | $dialog->show; |
|
|
1155 | } |
|
|
1156 | |
1138 | sub open_quit_dialog { |
1157 | sub open_quit_dialog { |
1139 | unless ($QUIT_DIALOG) { |
1158 | unless ($QUIT_DIALOG) { |
1140 | $QUIT_DIALOG = new CFPlus::UI::FancyFrame |
1159 | $QUIT_DIALOG = new CFPlus::UI::FancyFrame |
1141 | x => "center", |
1160 | x => "center", |
1142 | y => "center", |
1161 | y => "center", |