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

Modified Files:
        Ruler.cpp Ruler.h 
Log Message:
Making DrawGrid more general.

Index: Ruler.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/Ruler.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- Ruler.h     19 Feb 2009 23:48:03 -0000      1.30
+++ Ruler.h     23 Feb 2009 22:40:01 -0000      1.31
@@ -118,7 +118,8 @@
    void Draw(wxDC& dc, Envelope *speedEnv, long minSpeed, long maxSpeed);
    // If length <> 0, draws lines perpendiculars to ruler corresponding
    // to selected ticks (major, minor, or both), in an adjacent window.
-   void DrawGrid(wxDC& dc, int length, bool minor = true, bool major = true);
+   // You may need to use the offsets if you are using part of the dc for 
rulers, borders etc.
+   void DrawGrid(wxDC& dc, int length, bool minor = true, bool major = true, 
int xOffset = 0, int yOffset = 0);
 
    // So we can have white ticks on black...
    void SetTickColour( const wxColour & colour)

Index: Ruler.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/Ruler.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- Ruler.cpp   19 Feb 2009 23:48:03 -0000      1.59
+++ Ruler.cpp   23 Feb 2009 22:40:01 -0000      1.60
@@ -1357,7 +1357,7 @@
 }
 
 // ********** Draw grid ***************************
-void Ruler::DrawGrid(wxDC& dc, int length, bool minor, bool major)
+void Ruler::DrawGrid(wxDC& dc, int length, bool minor, bool major, int 
xOffset, int yOffset)
 {
    mGridLineLength = length;
    mMajorGrid = major;
@@ -1376,11 +1376,11 @@
          gridPos = mMinorLabels[i].pos;
          if(mOrientation == wxHORIZONTAL) {
             if((gridPos != 0) && (gridPos != mGridLineLength))
-               mDC->DrawLine(gridPos+1, 1, gridPos+1, mGridLineLength);
+               mDC->DrawLine(gridPos+xOffset, yOffset, gridPos+xOffset, 
mGridLineLength);
          }
          else {
             if((gridPos != 0) && (gridPos != mGridLineLength))
-               mDC->DrawLine(1, gridPos+1, mGridLineLength, gridPos+1);
+               mDC->DrawLine(xOffset, gridPos+yOffset, 
mGridLineLength+xOffset, gridPos+yOffset);
          }
       }
    }
@@ -1392,11 +1392,11 @@
          gridPos = mMajorLabels[i].pos;
          if(mOrientation == wxHORIZONTAL) {
             if((gridPos != 0) && (gridPos != mGridLineLength))
-               mDC->DrawLine(gridPos+1, 1, gridPos+1, mGridLineLength);
+               mDC->DrawLine(gridPos+xOffset, yOffset, gridPos+xOffset, 
mGridLineLength+yOffset);
          }
          else {
             if((gridPos != 0) && (gridPos != mGridLineLength))
-               mDC->DrawLine(1, gridPos+1, mGridLineLength, gridPos+1);
+               mDC->DrawLine(xOffset, gridPos+yOffset, 
mGridLineLength+xOffset, gridPos+yOffset);
          }
       }
       
@@ -1406,11 +1406,11 @@
          mDC->SetPen(*wxBLACK_PEN);
          if(mOrientation == wxHORIZONTAL) {
             if(zeroPosition != mGridLineLength)
-               mDC->DrawLine(zeroPosition+1, 1, zeroPosition+1, 
mGridLineLength);
+               mDC->DrawLine(zeroPosition+xOffset, yOffset, 
zeroPosition+xOffset, mGridLineLength+yOffset);
          }
          else {
             if(zeroPosition != mGridLineLength)
-               mDC->DrawLine(1, zeroPosition+1, mGridLineLength, 
zeroPosition+1);
+               mDC->DrawLine(xOffset, zeroPosition+yOffset, 
mGridLineLength+xOffset, zeroPosition+yOffset);
          }
       }
    }


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to