[Ann] WxMorphic v.0.01alpha

Rob Gayvert rtg at rochester.rr.com
Tue Mar 15 19:35:38 UTC 2005


Steven Swerling wrote:

>> 4. How much Win32-specific code is there? Any idea how hard this will 
>> be to port to OS X or GTK?
>
> The win32 specific code is all contained in the plugin file
> "WxFormUtils.cpp". The generated plugin code will be x-platform I would
> think, and the header file won't require any signifigant change. So it's
> just that file, which contains 4 external functions: WxBitmapFromForm,
> formToWxDC, wxInvalidateRect (I was surprised I had to write this, but I
> did), and initialize. Most of the support code for those functions was
> ripped out of sqWin32Window.c (for color palette handling) and more than
> likely an analagous approach would work on other platforms for
> supporting those 4 primitives.

Nice. That sounds very straightforward.

>> 5. The keyboard focus problem is tricky. I tried a quick modification 
>> of WxButtonMorph to see if a wxEvtSetFocus event could deflect focus 
>> back to the parent, but it didn't have any effect. We may have to 
>> look deeper into the wxWidgets internals here to find an answer.
>
> Yes, this is worrisome, but if worse comes to worse, we can implement a
> primitive call that would probably do the trick.

That's true. Worst case, we should be able to bypass wx and go straight 
to a platform specific routine to set the focus.

>> 6. The notion of halos on wxButtons is intriguing.. If this can be 
>> generalized to any wx widget, it may offer an almost trivial solution 
>> to some of the more difficult problems in creating a UI builder.
>
> It certainly can, and thats the point of that little demo. The morph
> wrapper classes for most objects would be paper thin, too. The one
> exeception is Sizers. A WxBoxSizerMorph would have to have some built in
> smarts to layout its child widgets the way Wx would after XRC
> generation. 

Re-implementing all the sizer logic is not trivial, but certainly doable.

> Also, some careful thought needs to go into the relationship
> between wx and morphic. Would a morphic UI builder just spit out XRC, or
> can we assume there is a WxMorphicWorld behind the widgets handling
> layout. 

I think the result of the builder should be independent of morphic, if 
that's what you mean. 

> I haven't given much thought to this yet, but I think it's
> important to have a clear idea about what direction you want to take it
> before adding more WxWidgetWrappers.

It should be easy to get started with a few simple tests to see how it 
might work out. With a couple of wrappers and a box sizer you can go a 
long way.







More information about the Wxsqueak mailing list