From: Francesco M. <f18...@ya...> - 2005-06-24 16:13:48
|
Hi, since I'm working on the "webupdate" component which will provide a dialog for updating your app, the following question raised: how should we provide dialog windows in our components ? Using XRC files, or just hard-coded classes that build the UI ? I've never used the XRC system before and all my components (but actually only keybinder has a dialog) do not use it. What is the "right" approach ? Thanks for your opinion, Francesco |
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 |
From: Otto W. <ott...@or...> - 2005-06-24 18:53:16
|
John Labenski wrote: > > 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: > > > > 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. Same for me, IMO hardcoded is better especially for a component which should be usable unchanged. Else you might end up with either countless XRC files or have to merge them together. O. Wyss -- Development of frame buffer drivers: http://linux-fbdev.sf.net Sample code snippets for wxWidgets: http://wxcode.sf.net How to build well-designed applications: http://wyoguide.sf.net Desktop with a consistent look and feel: http://wyodesktop.sf.net |
From: Francesco M. <f18...@ya...> - 2005-06-24 21:15:44
|
Hi, >>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. > > 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). yes; that's exactly the approach I've taken with keybinder: I created some "build flags" to allow customization of appearance dialog and also I've divided the dialog construction in various virtual functions which should make easier dialog-customization.... > > 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. even if I think that it would be easier for the user to fine-tune the appearance of the dialog, I agree with you and Otto on the hardcode approach since it does not force the user to link to the XRC lib and is a (little) faster. Still I think that in future XRC will play a more important role in wx GUI programming... Francesco |
From: Joseph B. <jb...@um...> - 2005-06-25 02:02:01
|
If you like the flexibility, then XRC resources can be great. I set up the wxSpellChecker component to use XRC resources for most of the dialogs, but one of the samples uses a hard coded dialog to demonstrate adding custom functionality beyond what my "cookie-cutter" XRC based dialogs handled. I found out how great XRC-based dialogs could be when I asked someone to test the interface and tell me what he thought. He remarked that a combo box on the dialog should be sorted. Thanks to XRC resources, only a text editor was needed to change the combo box style and fix the problem. On Fri, 24 Jun 2005, Francesco Montorsi wrote: > Hi, > since I'm working on the "webupdate" component which will provide a dialog > for updating your app, the following question raised: > > how should we provide dialog windows in our components ? > Using XRC files, or just hard-coded classes that build the UI ? > > I've never used the XRC system before and all my components (but actually > only keybinder has a dialog) do not use it. > > What is the "right" approach ? > > > Thanks for your opinion, > Francesco > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > wxCode-users mailing list > wxC...@li... > https://lists.sourceforge.net/lists/listinfo/wxcode-users > > > |
From: Francesco M. <f18...@ya...> - 2005-06-28 09:09:14
|
Hi, Joseph Blough wrote: > If you like the flexibility, then XRC resources can be great. I set up > the wxSpellChecker component to use XRC resources for most of the > dialogs, but one of the samples uses a hard coded dialog to demonstrate > adding custom functionality beyond what my "cookie-cutter" XRC based > dialogs handled. > I found out how great XRC-based dialogs could be when I asked someone to > test the interface and tell me what he thought. He remarked that a > combo box on the dialog should be sorted. Thanks to XRC resources, only > a text editor was needed to change the combo box style and fix the problem. I'm still undecided; looking at wxSpellChecker it seems that XRC gives more flexibility to the developer rather than an hardcoded dialog. Still I'm not sure about performance; however, since my dialog will be quite simple I think this won't be an issue so I'll try to use XRC... I'll let you know, Francesco |