Wx::ActiveX::IE - ActiveX interface for Internet Explorer. (Win32)
use Wx::ActiveX::IE ; my $IE = Wx::ActiveX::IE->new( $parent , -1 , wxDefaultPosition , wxDefaultSize ); $IE->LoadUrl("http://wxperl.sf.net") ; EVT_ACTIVEX_IE_BEFORENAVIGATE2($this,$IE,sub{ my ( $obj , $evt ) = @_ ; my $url = $evt->{URL} ; print "ACTIVEX_IE BeforeNavigate2 >> $url \n" ; }) ;
This will implement the web browser Internet Explorer in your App, using the interface Wx::ActiveX.
This will create and return the IE object.
Attempts to browse to the url, the control uses its internal (MS) network streams.
Load the passed HTML string.
Load the passed HTML stream. The control takes ownership of the pointer, deleting when finished.
Sets the charset of the loaded document.
Set the EditMode ON/OFF.
Return true if the EditMode as set on.
Get the text selected in the page. If asHTML is true it return the html codes too.
Get all the text of the page. If asHTML is true it return the html codes too.
Go back in the History.
Go forward in the History (if it goes back before).
Go to the Home Page of the browser.
Go to the default search page of IE.
Refresh the URL. You can set the LEVELs, from 0 to 3, of the refresh:
0 -> Normal*. 1 -> If Expired. 2 -> Continue. 3 -> Completely.
Stop the download process.
All the events use EVT_ACTIVEX. For example, the event BeforeNavigate2 can be declared usgin EVT_ACTIVEX:
EVT_ACTIVEX($parent , $IE , "BeforeNavigate2" , sub{...} ) ;
or using the ACTIVEX_IE event table:
EVT_ACTIVEX_IE_BEFORENAVIGATE2($parent , $IE , sub{...} ) ;
To import the events use:
use Wx::ActiveX::Event qw(EVT_ACTIVEX EVT_ACTIVEX_IE_NEWWINDOW2 EVT_ACTIVEX_IE_STATUSTEXTCHANGE) ; ... or ... use Wx::ActiveX::Event qw(:all) ;
You can get the list of ActiveX events using GetEventName():
for(0..($IE->GetEventCount)) { my $evt_name = $IE->GetEventName($_) ; print "$_> $evt_name\n" ; }
Eache ActiveX event has their own argument list (hash), and the Key 'Cancel' can be used to ignore the event. In this example any new window will be canceled, seting $evt->{Cancel} to true:
EVT_ACTIVEX_IE_NEWWINDOW2($this,$IE,sub{ my ( $obj , $evt ) = @_ ; $evt->{Cancel} = 1 ; }) ;
Here are the event table for ACTIVEX_IE:
EVT_ACTIVEX_IE_BEFORENAVIGATE2 EVT_ACTIVEX_IE_CLIENTTOHOSTWINDOW EVT_ACTIVEX_IE_COMMANDSTATECHANGE EVT_ACTIVEX_IE_DOCUMENTCOMPLETE EVT_ACTIVEX_IE_DOWNLOADBEGIN EVT_ACTIVEX_IE_DOWNLOADCOMPLETE EVT_ACTIVEX_IE_FILEDOWNLOAD EVT_ACTIVEX_IE_NAVIGATECOMPLETE2 EVT_ACTIVEX_IE_NEWWINDOW2 EVT_ACTIVEX_IE_ONFULLSCREEN EVT_ACTIVEX_IE_ONMENUBAR EVT_ACTIVEX_IE_ONQUIT EVT_ACTIVEX_IE_ONSTATUSBAR EVT_ACTIVEX_IE_ONTHEATERMODE EVT_ACTIVEX_IE_ONTOOLBAR EVT_ACTIVEX_IE_ONVISIBLE EVT_ACTIVEX_IE_PROGRESSCHANGE EVT_ACTIVEX_IE_PROPERTYCHANGE EVT_ACTIVEX_IE_SETSECURELOCKICON EVT_ACTIVEX_IE_STATUSTEXTCHANGE EVT_ACTIVEX_IE_TITLECHANGE EVT_ACTIVEX_IE_WINDOWCLOSING EVT_ACTIVEX_IE_WINDOWSETHEIGHT EVT_ACTIVEX_IE_WINDOWSETLEFT EVT_ACTIVEX_IE_WINDOWSETRESIZABLE EVT_ACTIVEX_IE_WINDOWSETTOP EVT_ACTIVEX_IE_WINDOWSETWIDTH
This package only works for Win32, since it use AtiveX.
Wx:ActiveX Wx
Graciliano M. P. <gm@virtuasites.com.br> Thanks to wxWindows peoples and Mattia Barbon for wxPerl! :P Thanks to Justin Bradford <justin@maxwell.ucsf.edu> and Lindsay Mathieson <lmathieson@optusnet.com.au>, that wrote the C classes for wxActiveX and wxIEHtmlWin.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Wx::ActiveX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wx::ActiveX
CPAN shell
perl -MCPAN -e shell install Wx::ActiveX
For more information on module installation, please visit the detailed CPAN module installation guide.