Re: Misc.
Bryan Bulten <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <[email protected]> |
> - I still cannot commit
Although I'm now a project admin, this being my first time as a project
admin on SourceForge, I have no idea on how to fix this... Hopefully
Jason can help you out soon.
> 1) to remove the name parameter as this is for
> debugging purposes only and can be set later
> with SetName()
Sounds good.
> 2) to remove control constructors that have no
> id since controls without a known id are pretty
> useless
Ok.
For the most part, the more elaborate constructors that I've added are
the ones that were needed with the Controls sample. I will stick to
these guidelines.
> - I'd be grateful if anyone could write one example
> of a EVT_COMBO() macros so that I can fill out the
> remaining useful macros. I don't want anyone to
> wrie the "AddListener...." code and get sore finger
> tips from it.
There are two steps to doing this:
1. Add the appropriate definition to the typemap member of the
static Event constructor:
typemap.Add(CommandComboboxSelected, typeof(CommandEvent));
where 'CommandComboboxSelected' is the identifier for the event, as
declared in Event.cs, and where 'typeof(CommandEvent)' corresponds to
the event handler class for that particular event. For the wxComboBox,
the event type, is wxCommandEvent, hence CommandEvent is used. If the
event class doesn't exist yet (i.e. hasn't been written,) pick the best
match.
2. Write the EVT_* macro. These go in EvtHandler.h:
EVT_COMBOBOX(int id, EventListener lsnr)
{
AddCommandListener(Event.CommandComboboxSelected, id, lsnr);
}
Where 'Event.CommandComboboxSelected' is the identifier used when adding
to the event map. Having these definitions in EvtHandler removes the
need for users to refer to each macro as 'EvtHandler.EVT_*', since
every class using the macros inherits from EvtHandler.
Hopefully that clears it up; there are already several examples in both
Event.cs and EvtHandler.cs.
> - How can I test for a certain platform? The defintion
> of the wxDEFAULT_DIALOG_STYLE is different for different
> platforms do there need to be a way to distinguish that.
I'm there's no official way to tell what platform is being used in C#,
aside from some methods in MS's .NET that give the version of Windows
(System.Environment.OSVersion.)
The easiest way to do this would be by adding a utility function in the
wrapper library that returns an identifier for wxMSW/wxGTK/etc. Defs.cs
may be a good place for this.
--
Bryan Bulten
http://opendev.ods.org/
http://wxnet.sourceforge.net/
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+pQ4n32WFWIzmzHgRAilyAJ9WxsDJwt+zNyLfqXb47W4iosgHGgCfWBmk BPBZ++mZy3a0L4/KVMpBsnk= =hh/R -----END PGP SIGNATURE-----