[wxPython] ActiveX Control wrapper window

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] ActiveX Control wrapper window

Mike  Fletcher
Well, got a little time, and a project that needs it, so I did some work on
this stuff.  Still based on Willy's code, but slightly more generalised.

New Features:
        Resizing support (you can include an ActiveXWrapper in your normal
wxPython sizer-driven layouts)
        Arbitrary activeX controls (i.e. not a single hard-coded control).
You pass in your control instance to the SetControl method.  You can
instantiate it with whatever arguments you need then pass it in.
        Background redrawing suppression flag (prevents flicker)
        There is a single new wxPython window for each new control, keeps
the hierarchy simple, keeps the ActiveX stuff encapsulated rather than
having it strewn across the parent windows, and makes subclassing simple.
Bad thing is that we waste a window/control.

Relevant code from the sample:

# Build the wxPython wrapper window
self.controlwindow = activexwrapper.ActiveXWrapper( self, -1,
EraseBackground=0)
# Add the control to that wrapper window
self.controlwindow.SetControl( PDFControl() )
# Add the wrapper window to the sizer for automatic resizing
outerSizer.Add(
        self.controlwindow, 1, wxPython.wx.wxEXPAND
)

Hope to see this (or a better version) show up in the lib directory some
day.  Enjoy all,
Mike


-----Original Message-----
From: Robin Dunn [mailto:[hidden email]]
Sent: Monday, February 14, 2000 5:59 PM
To: Willy Heineman; [hidden email]
Subject: Re: [wxPython] ActiveX Controls in wxPython Demo


> I have a demonstration file showing how to use ActiveX controls in
> wxPython (for win32 users only, sorry):
>
>  http://www.uconect.net/~wheineman/python/ActiveXDemo.py
>

Awesome!  Just yesterday I added an item to my ToDo list to figure out how
to
use ActiveX/COM/whatever-they're-calling-it-today controls in a wxPython
program.  Thanks for saving me the work!  <grin>
...


activexwrapper.pyc (4K) Download Attachment
ActiveXDemo3.py (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] ActiveX Control wrapper window

Willy Heineman
Hi Mike,
        Thanks for turning my straw into gold. Are you going to release the
source for this as well?

Cheers,

Willy


Mike Fletcher wrote:

>
> Well, got a little time, and a project that needs it, so I did some work on
> this stuff.  Still based on Willy's code, but slightly more generalised.
>
> New Features:
>         Resizing support (you can include an ActiveXWrapper in your normal
> wxPython sizer-driven layouts)
>         Arbitrary activeX controls (i.e. not a single hard-coded control).
> You pass in your control instance to the SetControl method.  You can
> instantiate it with whatever arguments you need then pass it in.
>         Background redrawing suppression flag (prevents flicker)
>         There is a single new wxPython window for each new control, keeps
> the hierarchy simple, keeps the ActiveX stuff encapsulated rather than
> having it strewn across the parent windows, and makes subclassing simple.
> Bad thing is that we waste a window/control.
>
> Relevant code from the sample:
>
> # Build the wxPython wrapper window
> self.controlwindow = activexwrapper.ActiveXWrapper( self, -1,
> EraseBackground=0)
> # Add the control to that wrapper window
> self.controlwindow.SetControl( PDFControl() )
> # Add the wrapper window to the sizer for automatic resizing
> outerSizer.Add(
>         self.controlwindow, 1, wxPython.wx.wxEXPAND
> )
>
> Hope to see this (or a better version) show up in the lib directory some
> day.  Enjoy all,
> Mike
>
> -----Original Message-----
> From: Robin Dunn [mailto:[hidden email]]
> Sent: Monday, February 14, 2000 5:59 PM
> To: Willy Heineman; [hidden email]
> Subject: Re: [wxPython] ActiveX Controls in wxPython Demo
>
> > I have a demonstration file showing how to use ActiveX controls in
> > wxPython (for win32 users only, sorry):
> >
> >  http://www.uconect.net/~wheineman/python/ActiveXDemo.py
> >
>
> Awesome!  Just yesterday I added an item to my ToDo list to figure out how
> to
> use ActiveX/COM/whatever-they're-calling-it-today controls in a wxPython
> program.  Thanks for saving me the work!  <grin>
> ...
>
>   ------------------------------------------------------------------------
>                          Name: activexwrapper.pyc
>    activexwrapper.pyc    Type: unspecified type (application/octet-stream)
>                      Encoding: base64
>
>    ActiveXDemo3.pyName: ActiveXDemo3.py
>                   Type: unspecified type (application/octet-stream)


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

RE: [wxPython] ActiveX Control wrapper window

Mike  Fletcher
In reply to this post by Mike Fletcher
Urgh, I'm an idiot, I selected the wrong file when posting the code.  Sorry
about that.  I'm assuming your stuff was LGPL, so of course I will release
the source.

Enjoy,
Mike

-----Original Message-----
From: Willy Heineman [mailto:[hidden email]]
Sent: Sunday, March 05, 2000 2:20 PM
To: [hidden email]
Cc: Mike Fletcher
Subject: Re: [wxPython] ActiveX Control wrapper window


Hi Mike,
        Thanks for turning my straw into gold. Are you going to release the
source for this as well?

Cheers,

Willy
...


activexwrapper.py (2K) Download Attachment