From: joakim v. <jo...@ve...> - 2004-03-25 20:49:55
|
I was going to try out my new shiny xml resource based dialog with the following code: ////JAVE /// this is a test to see how to implement a dialog with patricks system /// it replaces tMidiDelayDlg void tPianoWin::ActMidiDelayDialog() { double scale = 0.5; long clockDelay = 10; int repeat = 6; jppResourceDialog dialog(this, "midiDelay"); dialog.Attach("scale", &scale); dialog.Attach("clockDelay", &clockDelay); dialog.Attach("repeat", &repeat); if(dialog.ShowModal() == wxID_OK) { //execute the command // tCmdMidiDelay cmd(Filter, scale,clockDelay,repeat); // cmd.Execute(); Setup();//?? Canvas->SetScrollRanges(); Redraw(); } } //////////// It fails, because there are only long* prototypes of Attach. Is this so by design or because floats havent been implemented? I suspect it's by design, because I couldnt find a "double" capable slider either. I could of course use longs in the gui, and convert to double when sending to the command object. However, how would I show the user a float in the gui in that case? BTW there are some other issues here. The old code is full of global scope variables, which I find un-beautiful. In this case "scale" and so on would be global. It was used so that the dialog would remember state between invocations. Do you still think this is the right way to do it? Cheers, /Joakim |
From: Dave F. <dav...@co...> - 2004-03-25 20:55:58
|
On Thursday 25 March 2004 08:49 pm, joakim verona wrote: > I suspect it's by design, because I couldnt find a "double" capable > slider either. I strongly suggest checking out the sliders in Audacity. They're real nice, have tooltips already to show the values stored, and are capable of displaying several different units of volume. They're both easy and hard to use, though. :( > I could of course use longs in the gui, and convert to double when > sending to the command object. > > However, how would I show the user a float in the gui in that case? > > BTW there are some other issues here. The old code is full of global > scope variables, which I find un-beautiful. > In this case "scale" and so on would be global. It was used so that the > dialog would remember state between invocations. All of these global variables are completely wrong. ;) I'm working on factoring them all out into jppProject, and you can take a crack at it already (I've added jppProject to the cvs now, even if it's not doing much yet). We need to collect all the global variables into jppProject (as much as it makes sense, anyway) and then write some solid interfaces to them within jppProject so we can then free the data from the implementation. Dave > Do you still think this is the right way to do it? > > > Cheers, > /Joakim > > > > ------------------------------------------------------- > 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 Win98 is called Win98 because there is a 98% probability that it will crash during installation |
From: Joakim V. <jo...@ve...> - 2004-03-26 10:19:16
|
Dave Fancella wrote: > >I strongly suggest checking out the sliders in Audacity. They're real nice, >have tooltips already to show the values stored, and are capable of >displaying several different units of volume. They're both easy and hard to >use, though. :( > > > Which gui toolkit does audacity use? Cheers, /Joakim |
From: Dave F. <dav...@co...> - 2004-03-26 10:28:01
Attachments:
ASlider.cpp
ASlider.h
|
On Friday 26 March 2004 10:14 am, Joakim Verona wrote: > Dave Fancella wrote: > >I strongly suggest checking out the sliders in Audacity. They're real > > nice, have tooltips already to show the values stored, and are capable of > > displaying several different units of volume. They're both easy and hard > > to use, though. :( > > Which gui toolkit does audacity use? wxWidgets. :) Attached are the ASlider class files, and I'll poke around real quick and see if there are any other files that should be here. Dave > Cheers, > /Joakim > > > > > ------------------------------------------------------- > 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 Last week's pet, this week's special. |
From: Patrick E. <pa...@pa...> - 2004-03-26 07:30:58
|
On Thursday 25 March 2004 13:49, joakim verona wrote: > dialog.Attach("scale", &scale); > dialog.Attach("clockDelay", &clockDelay); > dialog.Attach("repeat", &repeat); I implemented int* versions of the Attach methods. I also added support for wxSlider. I didn't test any the recent changes, so it may not work. I really need to head to bed. > It fails, because there are only long* prototypes of Attach. > Is this so by design or because floats havent been implemented? > > I suspect it's by design, because I couldnt find a "double" capable > slider either. > > I could of course use longs in the gui, and convert to double when > sending to the command object. Another possibility is adding Attach methods like this: Attach(wxString name, double *ptr, double divisor); When the values come out of the slider it automatically performs the division for you. The sliders could be phrased in terms of percent or something like that. The XRC resource controls the range and labels on the slider. Another possibility would be implementing our own double capable sliders. Probably wouldn't be too hard, but not a trivial task either. Patrick |
From: Joakim V. <jo...@ve...> - 2004-03-26 09:59:26
|
Patrick Earl wrote: >On Thursday 25 March 2004 13:49, joakim verona wrote: > > >> dialog.Attach("scale", &scale); >> dialog.Attach("clockDelay", &clockDelay); >> dialog.Attach("repeat", &repeat); >> >> > >I implemented int* versions of the Attach methods. I also added >support for wxSlider. I didn't test any the recent changes, so it >may not work. I really need to head to bed. > > cool. >Another possibility is adding Attach methods like this: > > Attach(wxString name, double *ptr, double divisor); > >When the values come out of the slider it automatically performs the >division for you. The sliders could be phrased in terms of percent >or something like that. The XRC resource controls the range and >labels on the slider. > >Another possibility would be implementing our own double capable >sliders. Probably wouldn't be too hard, but not a trivial task >either. > > Well, there are a couple of "double" capable controls in the jazz gui, so we should figure out something to use at all such places. What would be useful is a combination of string entry box and a slider(or knob). Is it difficult to create your own widget in wxwidgets? or do I just subclass and instantiate 2 components within + glue logic, and voila new component like in "Swing"(or whatever modern toolkit)? How would the new component interface with wxwidgets gui builders like xrced or wxDesigner? Cheers, Joakim > 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-03-26 15:58:35
|
On Friday 26 March 2004 02:56, Joakim Verona wrote: > Well, there are a couple of "double" capable controls in the jazz > gui, so we should figure out something to use at all such places. > > What would be useful is a combination of string entry box and > a slider(or knob). > > Is it difficult to create your own widget in wxwidgets? > > or do I just subclass and instantiate 2 components within + glue > logic, and voila new component like in "Swing"(or whatever modern > toolkit)? > > How would the new component interface with wxwidgets gui builders > like xrced or wxDesigner? It looks like you just somehow subclass wxWindow and go from there, but I haven't tried it. That ASlider looks like a decent example. There's a way to add "unknown" widgets in wxglade and xrced. wxglade also provides a way to add properties, though I didn't figure out how to access them. I'd figure out how to use it, but I have to run. Patrick |