Comment on ToDo in wxmax

2 views
Skip to first unread message

codesite...@google.com

unread,
Dec 29, 2007, 3:10:58 PM12/29/07
to wx...@googlegroups.com
Comment by woollybah:

I'll need to find out how to create custom events programatically.
Normally you'd use a macro, but I guess there must be a way to create
new ones on-the-fly.


For more information:
http://code.google.com/p/wxmax/wiki/ToDo

Noel Cower

unread,
Dec 29, 2007, 3:23:24 PM12/29/07
to wx...@googlegroups.com
Depending on whether or not you're building with
WXWIN_COMPATIBILITY_EVENT_TYPES, you would either call wxNewEventType
(returns an integer that represents the new event ID), or you would
implement wxNewEventType() yourself and return an ID that is
wxEVT_FIRST/wxEVT_USER_FIRST plus a counter, respectively. After that,
it's just a matter of sending the events.

WXWIN_COMPATIBILITY_EVENT_TYPES should only be defined when compiling
for backwards compatibility with older versions of wxWidgets, so I'd
probably go with just calling wxNewEventType().

-noel

Bruce Henderson

unread,
Dec 29, 2007, 4:21:07 PM12/29/07
to wx...@googlegroups.com
Ah, okay. One of those "not in the documentation" features :-)

Thanks.  I'll have a look into that!

:o)

Brucey

Noel Cower

unread,
Dec 29, 2007, 6:02:36 PM12/29/07
to wx...@googlegroups.com
Not really an undocumented feature, just something that changed
internally but left the same as ye olden days for the sake of easy
compatibility with old code. Just need to look at the header file to
see how custom event IDs are allocated. Now, one thing I can't tell you
how to do is write your own event class in BMax. Event IDs are simple,
obviously, but you can't really just inherit from an old event type and
expect it to work, considering the BMax classes are wrappers of
wrappers, more or less.

So, your call on that side of it.

-noel

Bruce Henderson wrote:
> Ah, okay. One of those "not in the documentation" features :-)
>
> Thanks. I'll have a look into that!
>
> :o)
>
> Brucey
>
> On Dec 29, 2007 10:23 PM, Noel Cower <nco...@gmail.com

Reply all
Reply to author
Forward
0 new messages