Wx::ActiveX - ActiveX Control Interface for Wx |
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).
PROP_NAME The propriety name. VALUE The value(s).
ListEvents()
ListProps()
ListMethods()
ListMethods_and_Args()
foo(argx, argy)
ListMethods_and_Args_Hash()
my %methods = $activex->ListMethods_and_Args_Hash ; my @args = @{ $methods{foo} } ;
ActivexInfos()
<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; }) ;
the Wx::ActiveX::IE manpage, the Wx::ActiveX::Mozilla manpage, the Wx::ActiveX::WMPlayer manpage, 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>
Wx::ActiveX - ActiveX Control Interface for Wx |