Changeset 4717 for extensions/pLoader/trunk/src
- Timestamp:
- Jan 21, 2010, 11:20:17 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/src/Uploader/GUI/wxHtmlWindow.pm
r3357 r4717 22 22 use strict; 23 23 use Wx::Html; 24 use base qw(Wx::HtmlWindow); 24 use base qw(Wx::Dialog); 25 use Wx qw/ 26 wxTheApp 27 wxDefaultSize 28 wxDefaultPosition 29 wxALIGN_CENTER_VERTICAL 30 wxALL 31 wxVERTICAL 32 wxLIST_AUTOSIZE 33 wxDEFAULT_DIALOG_STYLE 34 wxMAXIMIZE_BOX 35 wxMINIMIZE_BOX 36 wxRESIZE_BORDER 37 wxSTAY_ON_TOP 38 wxGROW 39 /; 25 40 26 41 sub new { 27 my $class = shift; 28 my $this = $class->SUPER::new( @_ ); 42 my ($class, $params) = @_; 43 44 my $this = $class->SUPER::new( 45 undef, 46 -1, 47 $params->{caption}, 48 wxDefaultPosition, 49 wxDefaultSize, 50 wxDEFAULT_DIALOG_STYLE| 51 wxMAXIMIZE_BOX| 52 wxMINIMIZE_BOX| 53 wxSTAY_ON_TOP| 54 wxRESIZE_BORDER 55 ); 56 $this->{sizev} = Wx::BoxSizer->new( wxVERTICAL ); 57 58 $this->{html} = Wx::HtmlWindow->new( 59 $this, 60 -1, 61 wxDefaultPosition, 62 $params->{size}, 63 ); 64 65 66 $this->{html}->SetPage( 67 $params->{html} 68 ); 69 70 # layout 71 $this->{sizev}->Add( $this->{html}, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 2 ); 72 $this->SetSizer( $this->{sizev} ); 73 $this->{sizev}->SetSizeHints( $this ); 74 75 Wx::Event::EVT_HTML_LINK_CLICKED( $this, $this->{html}, \&OnHtmlLinkClicked); 29 76 30 77 return $this; … … 38 85 } 39 86 40 sub On LinkClicked {41 my( $this, $link) = @_;87 sub OnHtmlLinkClicked { 88 my ( $self, $event ) = @_; 42 89 43 my $href = $link->GetHref();90 my $href = $event->GetLinkInfo->GetHref, "\n"; 44 91 45 $this->{HrefCallbacks}->{$href}->() if exists $this->{HrefCallbacks}->{$href}; 46 92 $self->{HrefCallbacks}->{$href}->() if exists $self->{HrefCallbacks}->{$href}; 47 93 } 48 94 95 49 96 1; 97
Note: See TracChangeset
for help on using the changeset viewer.