From: Joakim V. <jo...@ve...> - 2004-04-01 08:47:32
|
Ok, so I've re-implemented a small number of static dialogs, and that works. But what about the dynamic dialogs? There are a number of dialogs that have varying number of controls, for instance the mixer window http://www.jazzware.com/docs/html/jazz35.html#mixer How should these be made now? - build them with code like previously - some kind of xml resource aproach. The later aproach could maybe be achieved with 2 resources, one for the dialog, and one used as a template for dynamic addition to the parent dialog. Ideas? /Joakim |
From: Patrick E. <pa...@pa...> - 2004-04-02 07:33:48
|
On Thursday 01 April 2004 00:42, Joakim Verona wrote: > The later aproach could maybe be achieved with 2 resources, one for > the dialog, and one used as a template for dynamic addition to the > parent dialog. That's a cool idea. I'm implementing something right now, I think it will work out well. I don't have time to finish it tonight, but I'll describe the basic idea. I've created a new class called jppResourcePanel. You construct it by passing it a name and it will load the named panel from one of the same files you did a jppResourceDialog::LoadResource() on. Once you have the panel, there's a method that's used to add it to an existing dialog, namely to a sizer within the dialog. It would work something like this, minus the pythonish for loop: jppResourceDialog dialog("myDialog", parentWin); for x in ["one", "two", "three"] { jppResoucePanel panel("myPanel"); wxLabel *label = (wxLabel *) panel.FindWindowByName("myLabel"); if(!label) cout << "You crazy!"; label.SetText(x); dialog.AddToSizer("mySizer", panel); } I haven't though through the memory management yet, so that may be something like panel = new jppResourcePanel("myPanel"). In any case, it's nearly as simple. Does that look good? Are there improvements to be made? Okay, time for bed. Patrick |
From: Joakim V. <jo...@ve...> - 2004-04-02 08:55:14
|
Yes, this seems very nice! How would the Attach function work in this case? It would be neat if we could attach an array of values. /Joakim Patrick Earl wrote: >On Thursday 01 April 2004 00:42, Joakim Verona wrote: > > >>The later aproach could maybe be achieved with 2 resources, one for >>the dialog, and one used as a template for dynamic addition to the >>parent dialog. >> >> > >That's a cool idea. I'm implementing something right now, I think it >will work out well. I don't have time to finish it tonight, but I'll >describe the basic idea. > >I've created a new class called jppResourcePanel. You construct it by >passing it a name and it will load the named panel from one of the >same files you did a jppResourceDialog::LoadResource() on. > >Once you have the panel, there's a method that's used to add it to an >existing dialog, namely to a sizer within the dialog. It would work >something like this, minus the pythonish for loop: > >jppResourceDialog dialog("myDialog", parentWin); >for x in ["one", "two", "three"] { > jppResoucePanel panel("myPanel"); > wxLabel *label = (wxLabel *) panel.FindWindowByName("myLabel"); > if(!label) cout << "You crazy!"; > label.SetText(x); > dialog.AddToSizer("mySizer", panel); >} > >I haven't though through the memory management yet, so that may be >something like panel = new jppResourcePanel("myPanel"). In any case, >it's nearly as simple. Does that look good? Are there improvements >to be made? > >Okay, time for bed. > > Patrick > > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >_______________________________________________ >jazzplusplus-devel mailing list >jaz...@li... >https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel > > |
From: Patrick E. <pa...@pa...> - 2004-04-02 15:32:07
|
On Friday 02 April 2004 00:49, Joakim Verona wrote: > Yes, this seems very nice! > > How would the Attach function work in this case? > It would be neat if we could attach an array of values. Is there much of an advantage to attaching an array? In the case of my example, you could just stick the attach line in the example and assign it to a particular array index. Are there cases where you wouldn't loop to add the extra widgets? Or when the loop index probably wouldn't be numeric or sequentially numeric? Patrick > >jppResourceDialog dialog("myDialog", parentWin); > >for x in ["one", "two", "three"] { > > jppResoucePanel panel("myPanel"); > > wxLabel *label = (wxLabel *) panel.FindWindowByName("myLabel"); > > if(!label) cout << "You crazy!"; > > label.SetText(x); > > dialog.AddToSizer("mySizer", panel); > >} |
From: joakim v. <jo...@ve...> - 2004-04-02 20:26:01
|
I'm not shure I'm following you entirely. The idea I had was that the loop that attaches holder variables for one of the controllers in the panel copy we are attaching to the parent dialog, could reside within the jppResourceDialog, rather than within the client code. For instance, with the mixer dialog as example, we have, say 6, volume controllers, and also 6 timbre controllers. So client code could look like this: long timbre[6]; long volume[6]; jppResourcePanel panel("mixerpanel"); jppResourceDialog dialog("mixerparent", panel, 6, parentWin); dialog.AttachArray(timbre,"timbre"); dialog.AttachArray(timbre,"volume"); ...which feels like a fairly compact description. (It seemed to me that it was the implementation of this you were describing below.) /Joakim Patrick Earl wrote: >On Friday 02 April 2004 00:49, Joakim Verona wrote: > > >>Yes, this seems very nice! >> >>How would the Attach function work in this case? >>It would be neat if we could attach an array of values. >> >> > >Is there much of an advantage to attaching an array? In the case of >my example, you could just stick the attach line in the example and >assign it to a particular array index. Are there cases where you >wouldn't loop to add the extra widgets? Or when the loop index >probably wouldn't be numeric or sequentially numeric? > > Patrick > > > >>>jppResourceDialog dialog("myDialog", parentWin); >>>for x in ["one", "two", "three"] { >>> jppResoucePanel panel("myPanel"); >>> wxLabel *label = (wxLabel *) panel.FindWindowByName("myLabel"); >>> if(!label) cout << "You crazy!"; >>> label.SetText(x); >>> dialog.AddToSizer("mySizer", panel); >>>} >>> >>> > > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >_______________________________________________ >jazzplusplus-devel mailing list >jaz...@li... >https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel > > |
From: Patrick E. <pa...@pa...> - 2004-04-03 11:20:20
|
I was describing my idea of the client code. Your idea of attaching arrays is interesting, but how would you handle the case where there are two areas within the dialog that have looped stuff added to them? I'm not saying it's difficult... I just haven't thought about it. Patrick On Friday 02 April 2004 13:25, joakim verona wrote: > I'm not shure I'm following you entirely. > > The idea I had was that the loop that attaches holder variables > for one of the controllers in the panel copy we are attaching to > the parent dialog, could reside within the jppResourceDialog, > rather than within the client code. > > For instance, with the mixer dialog as example, we have, say 6, > volume controllers, > and also 6 timbre controllers. > > So client code could look like this: > > long timbre[6]; > long volume[6]; > > jppResourcePanel panel("mixerpanel"); > jppResourceDialog dialog("mixerparent", panel, 6, parentWin); > > dialog.AttachArray(timbre,"timbre"); > dialog.AttachArray(timbre,"volume"); > > > ...which feels like a fairly compact description. > > (It seemed to me that it was the implementation of this you were > describing below.) > > > /Joakim > > Patrick Earl wrote: > >On Friday 02 April 2004 00:49, Joakim Verona wrote: > >>Yes, this seems very nice! > >> > >>How would the Attach function work in this case? > >>It would be neat if we could attach an array of values. > > > >Is there much of an advantage to attaching an array? In the case > > of my example, you could just stick the attach line in the > > example and assign it to a particular array index. Are there > > cases where you wouldn't loop to add the extra widgets? Or when > > the loop index probably wouldn't be numeric or sequentially > > numeric? > > > > Patrick > > > >>>jppResourceDialog dialog("myDialog", parentWin); > >>>for x in ["one", "two", "three"] { > >>> jppResoucePanel panel("myPanel"); > >>> wxLabel *label = (wxLabel *) panel.FindWindowByName("myLabel"); > >>> if(!label) cout << "You crazy!"; > >>> label.SetText(x); > >>> dialog.AddToSizer("mySizer", panel); > >>>} > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: IBM Linux Tutorials > >Free Linux tutorial presented by Daniel Robbins, President and CEO > > of GenToo technologies. Learn everything from fundamentals to > > system > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=c > >lick _______________________________________________ > >jazzplusplus-devel mailing list > >jaz...@li... > >https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO > of GenToo technologies. Learn everything from fundamentals to > system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=cli >ck _______________________________________________ > jazzplusplus-devel mailing list > jaz...@li... > https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel |
From: Dave F. <dav...@co...> - 2004-04-03 11:33:02
|
On Saturday 03 April 2004 11:13 am, Patrick Earl wrote: > I was describing my idea of the client code. Your idea of attaching > arrays is interesting, but how would you handle the case where there > are two areas within the dialog that have looped stuff added to them? > I'm not saying it's difficult... I just haven't thought about it. Seems to me that you would do one of two things (possibly both?). You'd create a new sizer in that area and just loop through the array adding new elements to the sizer accordingly, or you'd put a panel or some scrollable widget, then a sizer, and then loop the array adding new elements to the sizer. The second option means it'll size with the dialog without forcing the dialog to be too big, possibly bigger than the screen. So your dialog would have this sort of tree (better set to use a fixed font for this): Dialog Panel Sizer SOme edit gadget Antoher edit gadget Scrollable widget // This is the problem I'm solving here ;) Sizer First array element Second array element Yet another widget Dave > Patrick > > On Friday 02 April 2004 13:25, joakim verona wrote: > > I'm not shure I'm following you entirely. > > > > The idea I had was that the loop that attaches holder variables > > for one of the controllers in the panel copy we are attaching to > > the parent dialog, could reside within the jppResourceDialog, > > rather than within the client code. > > > > For instance, with the mixer dialog as example, we have, say 6, > > volume controllers, > > and also 6 timbre controllers. > > > > So client code could look like this: > > > > long timbre[6]; > > long volume[6]; > > > > jppResourcePanel panel("mixerpanel"); > > jppResourceDialog dialog("mixerparent", panel, 6, parentWin); > > > > dialog.AttachArray(timbre,"timbre"); > > dialog.AttachArray(timbre,"volume"); > > > > > > ...which feels like a fairly compact description. > > > > (It seemed to me that it was the implementation of this you were > > describing below.) > > > > > > /Joakim > > > > Patrick Earl wrote: > > >On Friday 02 April 2004 00:49, Joakim Verona wrote: > > >>Yes, this seems very nice! > > >> > > >>How would the Attach function work in this case? > > >>It would be neat if we could attach an array of values. > > > > > >Is there much of an advantage to attaching an array? In the case > > > of my example, you could just stick the attach line in the > > > example and assign it to a particular array index. Are there > > > cases where you wouldn't loop to add the extra widgets? Or when > > > the loop index probably wouldn't be numeric or sequentially > > > numeric? > > > > > > Patrick > > > > > >>>jppResourceDialog dialog("myDialog", parentWin); > > >>>for x in ["one", "two", "three"] { > > >>> jppResoucePanel panel("myPanel"); > > >>> wxLabel *label = (wxLabel *) panel.FindWindowByName("myLabel"); > > >>> if(!label) cout << "You crazy!"; > > >>> label.SetText(x); > > >>> dialog.AddToSizer("mySizer", panel); > > >>>} > > > > > >------------------------------------------------------- > > >This SF.Net email is sponsored by: IBM Linux Tutorials > > >Free Linux tutorial presented by Daniel Robbins, President and CEO > > > of GenToo technologies. Learn everything from fundamentals to > > > system > > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=c > > >lick _______________________________________________ > > >jazzplusplus-devel mailing list > > >jaz...@li... > > >https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: IBM Linux Tutorials > > Free Linux tutorial presented by Daniel Robbins, President and CEO > > of GenToo technologies. Learn everything from fundamentals to > > system > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=cli > >ck _______________________________________________ > > jazzplusplus-devel mailing list > > jaz...@li... > > https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > jazzplusplus-devel mailing list > jaz...@li... > https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel -- Visit my website! http://www.davefancella.com/?event=em What is a magician but a practising theorist? -- Obi-Wan Kenobi |
From: joakim v. <jo...@ve...> - 2004-04-03 19:36:47
|
Patrick Earl wrote: >I was describing my idea of the client code. Your idea of attaching >arrays is interesting, but how would you handle the case where there >are two areas within the dialog that have looped stuff added to them? > > I would say that a) this case never happens with the current jazz dialogs, and b) if we decide to build such dialogs it can be achieved with Daves idea. /Joakim >I'm not saying it's difficult... I just haven't thought about it. > > Patrick > >On Friday 02 April 2004 13:25, joakim verona wrote: > > >>I'm not shure I'm following you entirely. >> >>The idea I had was that the loop that attaches holder variables >>for one of the controllers in the panel copy we are attaching to >>the parent dialog, could reside within the jppResourceDialog, >>rather than within the client code. >> >>For instance, with the mixer dialog as example, we have, say 6, >>volume controllers, >>and also 6 timbre controllers. >> >>So client code could look like this: >> >>long timbre[6]; >>long volume[6]; >> >>jppResourcePanel panel("mixerpanel"); >>jppResourceDialog dialog("mixerparent", panel, 6, parentWin); >> >>dialog.AttachArray(timbre,"timbre"); >>dialog.AttachArray(timbre,"volume"); >> >> >>...which feels like a fairly compact description. >> >>(It seemed to me that it was the implementation of this you were >>describing below.) >> >> >>/Joakim >> >>Patrick Earl wrote: >> >> >>>On Friday 02 April 2004 00:49, Joakim Verona wrote: >>> >>> >>>>Yes, this seems very nice! >>>> >>>>How would the Attach function work in this case? >>>>It would be neat if we could attach an array of values. >>>> >>>> >>>Is there much of an advantage to attaching an array? In the case >>>of my example, you could just stick the attach line in the >>>example and assign it to a particular array index. Are there >>>cases where you wouldn't loop to add the extra widgets? Or when >>>the loop index probably wouldn't be numeric or sequentially >>>numeric? >>> >>> Patrick >>> >>> >>> >>>>>jppResourceDialog dialog("myDialog", parentWin); >>>>>for x in ["one", "two", "three"] { >>>>>jppResoucePanel panel("myPanel"); >>>>>wxLabel *label = (wxLabel *) panel.FindWindowByName("myLabel"); >>>>>if(!label) cout << "You crazy!"; >>>>>label.SetText(x); >>>>>dialog.AddToSizer("mySizer", panel); >>>>>} >>>>> >>>>> >>>------------------------------------------------------- >>>This SF.Net email is sponsored by: IBM Linux Tutorials >>>Free Linux tutorial presented by Daniel Robbins, President and CEO >>>of GenToo technologies. Learn everything from fundamentals to >>>system >>>administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=c >>>lick _______________________________________________ >>>jazzplusplus-devel mailing list >>>jaz...@li... >>>https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel >>> >>> >>------------------------------------------------------- >>This SF.Net email is sponsored by: IBM Linux Tutorials >>Free Linux tutorial presented by Daniel Robbins, President and CEO >>of GenToo technologies. Learn everything from fundamentals to >>system >>administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=cli >>ck _______________________________________________ >>jazzplusplus-devel mailing list >>jaz...@li... >>https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel >> >> > > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >_______________________________________________ >jazzplusplus-devel mailing list >jaz...@li... >https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel > > |