|
From: Patrick E. <pa...@pa...> - 2004-03-25 05:40:38
|
On Wednesday 24 March 2004 14:27, Dave Fancella wrote:
> To be honest, I'm not particular on *how* the data is pulled from
> the dialog. I'm interested in this Attach method. Also, bear in
> mind I just came back from php-land yesterday, so it'll take a
> little bit for me to get strongly-typed again. :( In any case, I
> was thinking that the absolute best way to take the most advantage
> out of XRC would be to have one single dialog maker using several
> different XRC dialog resources rather than just making a bunch of
> dialogs that all load their resources from a file. It's entirely
> possible that the XRC system will take care of the whole problem of
> pulling data from the dialog for us. I seem to recall that in XRC
> you define both the resource name and the type, placement, look,
> etc. Maybe it just takes care of it for us? ;)
Well, I don't know precisely what you're refering to, but I do know
that XRC only specifies the GUI widgets and their layout. It doesn't
specify any means for interaction with data. You're expected to do
basically wxWindow:::FindWindowByName(dialog, "someWidget") and get
the data out yourself. It's not -hard- to get the data out, but it's
still much easier with a wrapper class doing the dirty work for you.
> Not necessarily, but the associative array deal is far from
> perfect. It is pretty readable, though, and that's a winning trait
> for it's use in weak-typed languages.
Ya, they're great in dynamically typed languages. :)
> > // "Attach" technique. This is actual code that would work in
> > the // current system.
> > jppResourceDialog dialog = jppResourceDialog(parent, "myDialog");
> > dialog.Attach("myTextCtrl", &myString);
> > dialog.Attach("myCheckBox", &myBool);
> > dialog.ShowModal();
>
> Is this "Attach" method part of wxWindows already? It looks
> familiar....
Hmm, I hope not... otherwise I just re-invented the wheel.
Patrick
|