From: <pst...@us...> - 2013-03-24 19:32:31
|
Revision: 997 http://sourceforge.net/p/jazzplusplus/code/997 Author: pstieber Date: 2013-03-24 19:32:28 +0000 (Sun, 24 Mar 2013) Log Message: ----------- Changed JZArrayEdit and JZRhyArrayEdit constructor arguments from int xx, int yy, int ww, and int hh to const wxPoint& and const wxSize. Modified Paths: -------------- trunk/jazz/src/ControlEdit.cpp trunk/jazz/src/Random.cpp trunk/jazz/src/Random.h trunk/jazz/src/Rhythm.cpp trunk/jazz/src/SampleDialog.cpp trunk/jazz/src/SampleFrame.cpp trunk/jazz/src/SliderWindow.cpp Modified: trunk/jazz/src/ControlEdit.cpp =================================================================== --- trunk/jazz/src/ControlEdit.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/ControlEdit.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -100,7 +100,12 @@ ctrlmode = 0; // ctrlmode is used to distinguish between Apply and Edit. - edit = new JZArrayEdit((wxFrame *)mpPianoWindow, array, x+dx, y, w - dx, h, 0); + edit = new JZArrayEdit( + (wxFrame *)mpPianoWindow, + array, + wxPoint(x + dx, y), + wxSize(w - dx, h), + 0); edit->SetLabel(label); edit->SetDrawBars(this); Modified: trunk/jazz/src/Random.cpp =================================================================== --- trunk/jazz/src/Random.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/Random.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -263,12 +263,10 @@ JZArrayEdit::JZArrayEdit( wxFrame *frame, JZRndArray &ar, - int xx, - int yy, - int ww, - int hh, + const wxPoint& Position, + const wxSize& Size, int StyleBits) - : wxScrolledWindow(frame, wxID_ANY, wxPoint(xx, yy), wxSize(ww, hh)), + : wxScrolledWindow(frame, wxID_ANY, Position, Size), mArray(ar), n(ar.n), min(ar.min), @@ -286,8 +284,8 @@ x = 0; // draw to topleft corner of canvas y = 0; - w = ww; - h = hh; + w = Size.GetWidth(); + h = Size.GetHeight(); int tw, th; @@ -785,12 +783,10 @@ JZRhyArrayEdit::JZRhyArrayEdit( wxFrame *parent, JZRndArray& Array, - int xx, - int yy, - int ww, - int hh, + const wxPoint& Position, + const wxSize& Size, int StyleBits) - : JZArrayEdit(parent, Array, xx, yy, ww, hh, StyleBits) + : JZArrayEdit(parent, Array, Position, Size, StyleBits) { steps_per_count = 4; count_per_bar = 4; Modified: trunk/jazz/src/Random.h =================================================================== --- trunk/jazz/src/Random.h 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/Random.h 2013-03-24 19:32:28 UTC (rev 997) @@ -183,10 +183,8 @@ JZArrayEdit( wxFrame* pParent, JZRndArray& Array, - int xx, - int yy, - int ww, - int hh, + const wxPoint& Position, + const wxSize& Size, int StyleBits = (ARED_GAP | ARED_XTICKS)); virtual ~JZArrayEdit(); @@ -229,10 +227,8 @@ JZRhyArrayEdit( wxFrame *parent, JZRndArray& Array, - int xx, - int yy, - int ww, - int hh, + const wxPoint& Position, + const wxSize& Size, int StyleBits = (ARED_GAP | ARED_XTICKS | ARED_RHYTHM)); void SetMeter(int steps_per_count, int count_per_bar, int n_bars); Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/Rhythm.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -1303,30 +1303,24 @@ mpLengthEdit = new JZArrayEdit( pParent, mRhythm.length, - x, - y + Height / 2, - Width / 2, - Height / 4 - 4); + wxPoint(x, y + Height / 2), + wxSize(Width / 2, Height / 4 - 4)); mpLengthEdit->SetXMinMax(1, 8); mpLengthEdit->SetLabel("length/interval"); mpVelocityEdit = new JZArrayEdit( pParent, mRhythm.veloc, - x + Width / 2, - y + Height / 2, - Width / 2, - Height / 4 - 4); + wxPoint(x + Width / 2, y + Height / 2), + wxSize(Width / 2, Height / 4 - 4)); mpVelocityEdit->SetXMinMax(1, 127); mpVelocityEdit->SetLabel("velocity"); mpRhythmEdit = new JZRhyArrayEdit( pParent, mRhythm.rhythm, - x, - y + 3 * Height / 4, - Width, - Height/ 4 - 4); + wxPoint(x, y + 3 * Height / 4), + wxSize(Width, Height/ 4 - 4)); mpRhythmEdit->SetMeter( mRhythm.steps_per_count, mRhythm.count_per_bar, Modified: trunk/jazz/src/SampleDialog.cpp =================================================================== --- trunk/jazz/src/SampleDialog.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/SampleDialog.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -78,7 +78,7 @@ public: JZEquArrayEdit(JZEqualizer *parent, JZRndArray &arr, int style) - : JZRhyArrayEdit(parent, arr, 10, 10, 10, 10, style), + : JZRhyArrayEdit(parent, arr, wxPoint(10, 10), wxSize(10, 10), style), equ(*parent) { } @@ -245,7 +245,8 @@ void JZDistortion::AddEdits() { n_sliders = 1; - sliders[0] = new JZRhyArrayEdit(this, arr, 10,10,10,10, ARED_LINES); + sliders[0] = + new JZRhyArrayEdit(this, arr, wxPoint(10, 10), wxSize(10, 10), ARED_LINES); } #ifdef OBSOLETE @@ -374,9 +375,16 @@ { int i; arr.SetNull(ynul); - for (i = 0; i < n; i++) + for (i = 0; i < n; ++i) + { arr[i] = ynul; - edit = new JZRhyArrayEdit(parent, arr, 10,10,10,10, style); + } + edit = new JZRhyArrayEdit( + parent, + arr, + wxPoint(10, 10), + wxSize(10, 10), + style); edit->SetLabel(label); } void Show(bool x) Modified: trunk/jazz/src/SampleFrame.cpp =================================================================== --- trunk/jazz/src/SampleFrame.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/SampleFrame.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -333,7 +333,8 @@ //----------------------------------------------------------------------------- void JZSampleFrame::AddParam(JZRndArray *array, const char *label) { - params[num_params] = new JZArrayEdit(this, *array, 0, 0, 10, 10, 0); + params[num_params] = + new JZArrayEdit(this, *array, wxPoint(0, 0), wxSize(10, 10), 0); params[num_params]->SetLabel(label); num_params++; int cw, ch; Modified: trunk/jazz/src/SliderWindow.cpp =================================================================== --- trunk/jazz/src/SliderWindow.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/SliderWindow.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -160,8 +160,15 @@ { n_sliders = 2; sliders_per_row = 2; - for (int i = 0; i < n_sliders; i++) - sliders[i] = new JZRhyArrayEdit(this, *new JZRndArray(20, 0, 100), 10, 10, 10, 10, (ARED_GAP | ARED_XTICKS)); + for (int i = 0; i < n_sliders; ++i) + { + sliders[i] = new JZRhyArrayEdit( + this, + *new JZRndArray(20, 0, 100), + wxPoint(10, 10), + wxSize(10, 10), + ARED_GAP | ARED_XTICKS); + } } #ifdef OBSOLETE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |