Update of /cvsroot/audacity/audacity-src/src/widgets
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6545/widgets

Modified Files:
        ASlider.cpp Grabber.cpp Meter.cpp TimeTextCtrl.cpp 
Log Message:
Converted all wxDC::DrawLine()s to AColor::Line()s so that it can handle        
                                        
the line drawing differences among platforms.                                   
                                        
                                                                                
                                        
Hopefully fixed all 1-off drawing issues that creaped in due to the platform    
                                        
differences.  Everyone should keep an extra critical eye open for stray         
                                        
pixels or lines that seem to be longer at one of the ends.                      
                                        

Reworked much of the waveform drawing code in TrackArtist to improve
performance.

Due to the performance gains in TrackArtist, the Mac specific waveform
drawing code was removed since it was out of sync with the other platforms.

Fixed drawing and click detection within NoteTrack label area.


Index: ASlider.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/ASlider.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- ASlider.cpp 30 Mar 2009 10:33:00 -0000      1.69
+++ ASlider.cpp 16 May 2009 11:13:13 -0000      1.70
@@ -568,6 +568,7 @@
    }
 
    mCenterY = mHeight - 9;
+
    mThumbWidth = mThumbBitmap->GetWidth();
    mThumbHeight = mThumbBitmap->GetHeight();
 
@@ -595,7 +596,7 @@
    dc->Clear();
 
    AColor::Dark(dc, false);
-   dc->DrawLine(mLeftX, mCenterY+1, mRightX+2, mCenterY+1);
+   AColor::Line(*dc, mLeftX, mCenterY+1, mRightX+2, mCenterY+1);
 
    // Draw +/- or L/R first.  We need to draw these before the tick marks.
    if (mStyle == PAN_SLIDER)
@@ -634,9 +635,9 @@
 #else
       dc->SetPen(*wxBLACK_PEN);
 #endif
-      dc->DrawLine(mLeftX, mCenterY-10, mLeftX+5, mCenterY-10);
-      dc->DrawLine(mRightX-5, mCenterY-10, mRightX, mCenterY-10);
-      dc->DrawLine(mRightX-3, mCenterY-12, mRightX-3, mCenterY-7);
+      AColor::Line(*dc, mLeftX, mCenterY-10, mLeftX+4, mCenterY-10);
+      AColor::Line(*dc, mRightX-5, mCenterY-10, mRightX-1, mCenterY-10);
+      AColor::Line(*dc, mRightX-3, mCenterY-12, mRightX-3, mCenterY-8);
    }
 
 
@@ -649,9 +650,9 @@
          int_d = (int)d;
          int ht = (int_d==0 || int_d==divs? 5: 3);
          AColor::Light(dc, false);
-         dc->DrawLine(mLeftX+p, mCenterY-ht, mLeftX+p, mCenterY);
+         AColor::Line(*dc, mLeftX+p, mCenterY-ht, mLeftX+p, mCenterY-1);
          AColor::Dark(dc, false);
-         dc->DrawLine(mLeftX+p+1, mCenterY-ht+1, mLeftX+p+1, mCenterY);
+         AColor::Line(*dc, mLeftX+p+1, mCenterY-ht+1, mLeftX+p+1, mCenterY-1);
       }
       d += upp;
    }

Index: Grabber.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/Grabber.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Grabber.cpp 28 Jun 2008 21:10:53 -0000      1.4
+++ Grabber.cpp 16 May 2009 11:13:13 -0000      1.5
@@ -133,7 +133,7 @@
 
    // Cache
    left = r.GetLeft();
-   right = r.GetRight() + 1;  //+1 for DrawLine()'s lack of not plotting last 
pixel
+   right = r.GetRight();
    top = r.GetTop();
    bottom = r.GetBottom();
 
@@ -146,7 +146,7 @@
    }
 
    for (y = top; y < bottom; y += 4) {
-      dc.DrawLine(left, y, right, y);
+      AColor::Line(dc, left, y, right, y);
    }
 
    // Draw the pushed bumps
@@ -158,7 +158,7 @@
    }
 
    for (y = top + 1; y <= bottom; y += 4) {
-      dc.DrawLine(left, y, right, y);
+      AColor::Line(dc, left, y, right, y);
    }
 }
 

Index: TimeTextCtrl.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/TimeTextCtrl.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- TimeTextCtrl.cpp    19 Mar 2009 05:04:40 -0000      1.58
+++ TimeTextCtrl.cpp    16 May 2009 11:13:13 -0000      1.59
@@ -835,13 +835,12 @@
    if (mMenuEnabled) {
       wxRect r(mWidth, 0, mButtonWidth - 1, mHeight - 1);
       AColor::Bevel(memDC, true, r);
+      memDC.SetBrush(*wxBLACK_BRUSH);
       memDC.SetPen(*wxBLACK_PEN);
-      int triWid = mButtonWidth - 2;
-      int xStart = mWidth + 1;
-      int yStart = (mHeight / 2) - 2;
-      for (i = 0; i <= (unsigned int)(triWid / 2); i++) {
-         memDC.DrawLine(xStart + i, yStart + i, xStart + triWid - i, yStart + 
i);
-      }
+      AColor::Arrow(memDC,
+                    mWidth + 1,
+                    (mHeight / 2) - 2,
+                    mButtonWidth - 2);
    }
    return true;
 }

Index: Meter.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/Meter.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- Meter.cpp   14 Mar 2009 07:39:10 -0000      1.40
+++ Meter.cpp   16 May 2009 11:13:13 -0000      1.41
@@ -848,13 +848,12 @@
       {
          wxRect r = mMenuRect;
          AColor::Bevel(dc, true, r);
+         dc.SetBrush(*wxBLACK_BRUSH);
          dc.SetPen(*wxBLACK_PEN);
-         int triWid = 11;
-         int xStart = r.x+3;
-         int yStart = r.y+4;
-         for(i=0;i<=triWid/2;i++){
-            dc.DrawLine(xStart+i, yStart+i, xStart + triWid - i,yStart+i);
-         }
+         AColor::Arrow(dc,
+                       r.x + 3,
+                       r.y + 5,
+                       10);
       }
 
       if (mNumBars>0)
@@ -920,9 +919,9 @@
    AColor::Dark(&dc, false);
    for(i=0; i<mNumTicks; i++)
       if (meterBar->vert)
-         dc.DrawLine(r.x+r.width/2-1, mTick[i], r.x+r.width/2+1, mTick[i]);
+         AColor::Line(dc, r.x+r.width/2-1, mTick[i], r.x+r.width/2+1, 
mTick[i]);
       else
-         dc.DrawLine(mTick[i], r.y+r.height/2-1, mTick[i], r.y+r.height/2+1);
+         AColor::Line(dc, mTick[i], r.y+r.height/2-1, mTick[i], 
r.y+r.height/2+1);
    */
 
    dc.SetBrush(*wxTRANSPARENT_BRUSH);
@@ -930,18 +929,18 @@
 
    if (meterBar->vert) {
       int ht = (int)(meterBar->peakHold * r.height + 0.5);
-      dc.DrawLine(r.x+1, r.y + r.height - ht,
-                  r.x+r.width, r.y + r.height - ht);
+      AColor::Line(dc, r.x+1, r.y + r.height - ht,
+                   r.x+r.width-1, r.y + r.height - ht);
       if (ht > 1)
-         dc.DrawLine(r.x+1, r.y + r.height - ht + 1,
-                     r.x+r.width, r.y + r.height - ht + 1);
+         AColor::Line(dc, r.x+1, r.y + r.height - ht + 1,
+                      r.x+r.width-1, r.y + r.height - ht + 1);
       dc.SetPen(mPeakPeakPen);
       ht = (int)(meterBar->peakPeakHold * r.height + 0.5);
-      dc.DrawLine(r.x+1, r.y + r.height - ht,
-                  r.x+r.width, r.y + r.height - ht);
+      AColor::Line(dc, r.x+1, r.y + r.height - ht,
+                   r.x+r.width-1, r.y + r.height - ht);
       if (ht > 1)
-         dc.DrawLine(r.x+1, r.y + r.height - ht + 1,
-                     r.x+r.width, r.y + r.height - ht + 1);
+         AColor::Line(dc, r.x+1, r.y + r.height - ht + 1,
+                      r.x+r.width-1, r.y + r.height - ht + 1);
 
       dc.SetPen(mPen);
       ht = (int)(meterBar->peak * r.height + 0.5);
@@ -954,15 +953,15 @@
    }
    else {
       int wd = (int)(meterBar->peakHold * r.width + 0.5);
-      dc.DrawLine(r.x + wd, r.y + 1, r.x + wd, r.y + r.height);
+      AColor::Line(dc, r.x + wd, r.y + 1, r.x + wd, r.y + r.height - 1);
       if (wd > 1)
-         dc.DrawLine(r.x + wd - 1, r.y + 1, r.x + wd - 1, r.y + r.height);
+         AColor::Line(dc, r.x + wd - 1, r.y + 1, r.x + wd - 1, r.y + r.height 
- 1);
 
       dc.SetPen(mPeakPeakPen);
       wd = (int)(meterBar->peakPeakHold * r.width + 0.5);
-      dc.DrawLine(r.x + wd, r.y + 1, r.x + wd, r.y + r.height);
+      AColor::Line(dc, r.x + wd, r.y + 1, r.x + wd, r.y + r.height - 1);
       if (wd > 1)
-         dc.DrawLine(r.x + wd - 1, r.y + 1, r.x + wd - 1, r.y + r.height);
+         AColor::Line(dc, r.x + wd - 1, r.y + 1, r.x + wd - 1, r.y + r.height 
- 1);
       
       dc.SetPen(mPen);
       wd = (int)(meterBar->peak * r.width + 0.5);
@@ -980,11 +979,11 @@
 
    dc.SetBrush(*wxTRANSPARENT_BRUSH);
    dc.SetPen(mLightPen);
-   dc.DrawLine(r.x, r.y, r.x + r.width, r.y);
-   dc.DrawLine(r.x, r.y, r.x, r.y + r.height);
+   AColor::Line(dc, r.x, r.y, r.x + r.width, r.y);
+   AColor::Line(dc, r.x, r.y, r.x, r.y + r.height);
    dc.SetPen(mDarkPen);
-   dc.DrawLine(r.x + r.width, r.y, r.x + r.width, r.y + r.height);
-   dc.DrawLine(r.x, r.y + r.height, r.x + r.width + 1, r.y + r.height);
+   AColor::Line(dc, r.x + r.width, r.y, r.x + r.width, r.y + r.height);
+   AColor::Line(dc, r.x, r.y + r.height, r.x + r.width, r.y + r.height);
 
    if (mClip) {
       if (meterBar->clipping)


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to