From: John L. <jla...@gm...> - 2005-06-24 16:47:54
|
On 6/24/05, Francesco Montorsi <f18...@ya...> wrote: > Hi, > since I'm working on the "webupdate" component which will provide a > dialog for updating your app, the following question raised: >=20 > how should we provide dialog windows in our components ? > Using XRC files, or just hard-coded classes that build the UI ? I hard code them, the complicated pages are created using wxDesigner. I try to make them reasonably extensible if at all possible. For example, in wxStEdit I have a preferences dialog with 7 notebook pages. Each page can be used independently of the others and of the dialog that contains them. All I do is forward the Ok, Cancel, etc buttons to the page before the dialog deals with them and if the page handles it fine, if not, fine too. =20 I think it's a good idea to at least separate the "page(s)" of the dialog from the dialog since then it'll be reusable. You can also provide flags to make it possible for users to get different varieties or add a virtual function "CreateDialog" (or whatever) so that people can subclass it and override it's behavior. In this case everyone will have to call the "CreateDialog" function after creation (you can't have virtual functions in the constructor). XRC makes your user link to the XRC lib so I prefer not to use that. It also won't make it any easier for them to reuse or change things anyway. > I've never used the XRC system before and all my components (but > actually only keybinder has a dialog) do not use it. >=20 > What is the "right" approach ? Whatever makes you happy? Seriously though, maybe someone has better suggestions. Regards, John Labenski |