[wxPython-dev] Some info on the ongoing SoC XRCed project
Roman Rolinsky
rolinsky at femagsoft.com
Mon Jul 9 16:31:01 PDT 2007
On Fri, 2007-07-06 at 21:05 -0700, Kevin Ollivier wrote:
[snip]
> BTW, I really do like the new tool pane, I think it gives the app a
> more modern look and gives the user a better idea of what the
> controls will look like in the app. :-)
Thanks. The only problem now is to keep the size of the tool pane sane,
so it will not get in the way of the test window and others.
Unfortunately Toolbook does not provide a means to scroll the toolbar
which is used for pane selection buttons, so when the size of the window
is not enough to hold all the buttons they are simply clipped away. I
think I will need to provide at least some indicator that there are more
buttons than meets the eye. The only way to implement scrolling seems to
be removing some buttons from the toolbar (maybe hiding will do, I
didn't try yet). I also plan to make specific tool panes for wxMAC and
wxMSW and make them scalable by selecting a factor from the
application's preference dialog.
> Nice! I'll be looking forward to that, so I can add SizedControls and
> wxWebKit in there. (The latter will have to be able to install itself
> into XRCed when the user installs the control, I imagine that would
> be possible?)
You mean to initialize C++ XML handlers? This is possible using ctypes
module which can load a function from a shared library. AFAIK only the
interface to C functions is portable, so a plugin must provide an extern
"C" function without arguments and the name of this function is made
known to XRCed when registering the component. The function is called
every time the test window is created. It should add XML handlers to the
resource object returned by XmlResource::Get(). Another approach is to
provide a wrapper module similar to wxPython wrappers. It must be
generated using a patched SWIG, and then the module is imported like any
other python modules.
Defining pure-wxPython component plugins is very easy, once there is a
working XmlHandler class. It can be done using a python module imported
by XRCed or by using XML manifest file which can be edited using XRCed
(this is already working but I need to make some documentation).
Normally XmlHandler classes should be in some separate modules, not
necessary in XRCed/plugins, just available for importing by component
plugin modules.
> > The tool panel is inspired by the OSX Interface Builder, it's just a
> > wxToolbook with wxPanels and wxBitmapButtons. I'm planning to try
> > to use
> > AUI to make all panels docking in the future.
> >
> > The test window is a little different too, it is 'persistent' for
> > non-top-level controls, so should not flicker and steal focus from the
> > main window. Another new feature is the possibility to test individual
> > interface elements.
>
> Also nice! :-) BTW, I was wondering, how hard would it be to drag and
> drop controls into the test window? I think it would be a very nice
> feature to have.
You may check the "Recent Changes" document for wxPython 2.8.4 ;)
> I also like the idea of the AUI-style panes. But if it's not too much
> trouble, please make the panes in a way that you could switch to
> another docking framework later. (May not be a big deal since you're
> already taking an MVP-centric design, of course.) I'm still planning
> to finish my Mac-friendly docking framework that can remember pane
> info even when its undocked, and eventually once it's complete I'd
> like to have XRCed using it.
Ok, no problem. I was going to provide an option to turn off AUI
completely also.
> > Auto-refreshing and highlighting are not yet
> > refactored, neither are Locate and code generation commands.
> >
> > The standard component plug-ins are defined using plugins/core.py
> > file.
> > I will provide a working example of a custom component plug-in soon.
>
> Thanks for all your work on this, it looks very exciting. :-)
>
> Kevin
Regards,
Roman
More information about the wxpython-dev
mailing list