Changeset 5524
- Timestamp:
- 06/24/09 04:35:22 (3 years ago)
- File:
-
- 1 edited
-
trunk/Padre/lib/Padre/Wx/DocBrowser.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre/Wx/DocBrowser.pm
r5503 r5524 142 142 #my @menu_id; 143 143 $exitMenu->Append(Wx::wxID_CLOSE, Wx::gettext("&Close\tCtrl+W") ); 144 $exitMenu->Append(22222, Wx::gettext("E&xit\tCtrl+X") ); 144 my $exitID = Wx::NewId; 145 146 $exitMenu->Append($exitID, Wx::gettext("E&xit\tCtrl+X") ); 145 147 146 148 my $menuBar = Wx::MenuBar->new(); … … 148 150 $self->SetMenuBar($menuBar); 149 151 150 my $table = Wx::AcceleratorTable->new( [Wx::wxACCEL_NORMAL, Wx::WXK_ESCAPE, 22222] );152 my $table = Wx::AcceleratorTable->new( [Wx::wxACCEL_NORMAL, Wx::WXK_ESCAPE, $exitID ] ); 151 153 $self->SetAcceleratorTable( $table ); 152 154 153 155 # you can create fictional menu items for use by the accelerator table 154 Wx::Event::EVT_MENU( $self, 22222, sub { $_[0]->_close(); } );156 Wx::Event::EVT_MENU( $self, $exitID, sub { $_[0]->_close(); } ); 155 157 Wx::Event::EVT_MENU( $self, Wx::wxID_CLOSE, sub { $_[0]->_close_tab(); } ); 156 158 … … 340 342 341 343 sub not_found { 344 # trying a dialog rather than the open tab. 342 345 my ( $self, $query ) = @_; 343 my $html = qq| 344 <html><body> 345 <h1>Not Found</h1> 346 <p>Could not find documentation for 347 <pre>$query</pre> 348 </p> 349 </body> 350 </html> 351 |; 352 my $frame = Padre::Wx::HtmlWindow->new($self); 353 $self->notebook->AddPage( $frame, 'Not Found', 1 ); 354 $frame->SetPage($html); 346 347 my $layout = [ 348 [ 349 [ 'Wx::StaticText', undef, "Nothing found for $query"], 350 ], 351 [ 352 [ 'Wx::Button', 'ok', Wx::wxID_OK ], 353 ], 354 ]; 355 356 # Wx::Perl::Dialog 357 my $dialog = Padre::Wx::Dialog->new( 358 parent => $self, 359 title => 'Unable to locate help...', 360 layout => $layout, 361 width => [250, 550], 362 363 ); 364 365 366 $dialog->Show(); 367 368 369 # my $html = qq| 370 #<html><body> 371 #<h1>Not Found</h1> 372 #<p>Could not find documentation for 373 #<pre>$query</pre> 374 #</p> 375 #</body> 376 #</html> 377 #|; 378 # my $frame = Padre::Wx::HtmlWindow->new($self); 379 # $self->notebook->AddPage( $frame, 'Not Found', 1 ); 380 # $frame->SetPage($html); 355 381 356 382 }
Note: See TracChangeset
for help on using the changeset viewer.
