Wx::ActiveX - ActiveX Control Interface for Wx
Version 0.16
use Wx::ActiveX qw( EVT_ACTIVEX ); use Wx qw( wxID_ANY wxDefaultPosition , wxDefaultSize ); ........ my $activex = Wx::ActiveX->new( $parent, "WMPlayer.OCX", wxID_ANY, wxDefaultPosition, wxDefaultSize ); EVT_ACTIVEX( $this, $activex, "PlaylistCollectionChange", \&on_event_handler ); $activex->PropSet("URL",'pathtomyfile.avi') ; .......... $activex->Invoke("launchURL", "http://my.url.com/file.movie") ; ... or ... $activex->launchURL("http://my.url.com/file.movie") ; ---------------------------------------------------------------- package MyActiveXControl; use Wx::ActiveX; use base qw( Wx::ActiveX ); our (@EXPORT_OK, %EXPORT_TAGS); $EXPORT_TAGS{everything} = \@EXPORT_OK; my @activexevents = qw( OnReadyStateChange FSCommand OnProgress ); my $exporttag = 'elviscontrol'; my $eventname = 'ELVIS'; __PACKAGE__->activex_load_activex_event_types( __PACKAGE__, $eventname, $exporttag, \@activexevents ); ... EVT_ACTIVEX_ELVIS_ONPROGRESS( $this, $activex,\&on_event_handler );
Load ActiveX controls for wxWindows. The package installs a module in Wx::Demo for reference.
There are some wrapped controls included with the package:
Wx::ActiveX::IE Internet Explorer Control Wx::ActiveX::Mozilla Mozilla Browser Control Wx::ActiveX::WMPlayer Windows Media Player Wx::ActiveX::ScriptControl MS Script Control Wx::ActiveX::Document Control Wrapper via Browser Wx::ActiveX::Acrobat Acrobat ActiveX Control Wx::ActiveX::Flash Adobe Flash Control Wx::ActiveX::Quicktime Apple QuickTime ActiveX Control
See the POD for each indvidual control.
There is also a Template producer that will provide code for a module given an ActiveX ProgID.
wxactivex_template
or
perl -MWx::ActiveX::Template -e"run_wxactivex_template();"
Create the ActiveX control.
PARENT need to be a Wx::Window object. CONTROL_ID The control ID (PROGID/string).
Get the value of a propriety of the control.
Set a propriety of the control.
PROP_NAME The propriety name. VALUE The value(s).
Return the type of the propriety.
Returnt the number of events that the control have.
Returnt the number of proprieties.
Returnt the number of control methods.
Returnt the name of the event X, where X is a integer.
Returnt the name of the propriety X, where X is a integer.
Returnt the name of the method X, where X is a integer.
Returnt the number of arguments of the MethodX.
Returnt the name of the ArgX of MethodX.
Return an ARRAY with all the events names.
Return an ARRAY with all the proprieties names.
Return an ARRAY with all the methods names.
Return an ARRAY with all the methods names and arguments. like:
foo(argx, argy)
Return a HASH with all the methods names (keys) and arguments (values). The arguments are inside a ARRAY ref:
my %methods = $activex->ListMethods_and_Args_Hash ; my @args = @{ $methods{foo} } ;
Return a string with all the informations about the ActiveX Control:
<EVENTS> MouseUp MouseMove MouseDown </EVENTS> <PROPS> FileName </PROPS> <METHODS> Close() Load(file) </METHODS>
From version 0.5 Wx::ActiveX is compatible with Win32::OLE objects:
use Wx::ActiveX ; use Win32::OLE ; my $activex = Wx::ActiveX->new( $this , "ShockwaveFlash.ShockwaveFlash" , 101 , wxDefaultPosition , wxDefaultSize ) ; my $OLE = $activex->GetOLE() ; $OLE->LoadMovie('0' , "file:///F:/swf/test.swf") ; $OLE->Play() ;
All the events use EVT_ACTIVEX.
EVT_ACTIVEX($parent , $activex , "EventName" , sub{...} ) ;
** You can get the list of ActiveX event names using ListEvents():
Each ActiveX event has its own argument list (hash), and the method 'Veto' can be used to ignore the event. In this example any new window will be canceled, seting $evt->IsAllowed to False:
EVT_ACTIVEX($this,$activex, "EventX" , sub{ my ( $obj , $evt ) = @_ ; $evt->Veto; }) ;
Wx::ActiveX::IE, Wx::ActiveX::Mozilla, Wx::ActiveX::WMPlayer, Wx
Wx::ActiveX has benefited from many contributors:
Graciliano Monteiro Passos - original author
Contributions from:
Simon Flack Mattia Barbon Eric Wilhelm Andy Levine Mark Dootson
Thanks to Justin Bradford and Lindsay Mathieson who wrote the C classes for wxActiveX and wxIEHtmlWin.
Copyright (C) 2002-2011 Authors & Contributors, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Mark Dootson <mdootson@cpan.org>
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.