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

Modified Files:
        Ruler.cpp Ruler.h 
Log Message:
Fix grid line placement.

Index: Ruler.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/Ruler.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- Ruler.h     16 Feb 2009 22:34:34 -0000      1.28
+++ Ruler.h     18 Feb 2009 06:38:12 -0000      1.29
@@ -216,6 +216,10 @@
 
    ~RulerPanel();
 
+   void DoSetSize(int x, int y,
+                  int width, int height,
+                  int sizeFlags = wxSIZE_AUTO);
+
    void OnErase(wxEraseEvent &evt);
    void OnPaint(wxPaintEvent &evt);
    void OnSize(wxSizeEvent &evt);

Index: Ruler.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/Ruler.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- Ruler.cpp   16 Feb 2009 22:34:34 -0000      1.56
+++ Ruler.cpp   18 Feb 2009 06:38:12 -0000      1.57
@@ -1366,6 +1366,8 @@
    mMinorGrid = minor;
    mDC = &dc;
 
+   Update();
+
    int gridPos;
    wxPen gridPen;
 
@@ -1511,10 +1513,6 @@
                        const wxSize& size /*= wxDefaultSize*/):
    wxPanel(parent, id, pos, size)
 {
-   int width, height;
-   GetClientSize(&width, &height);
-
-   ruler.SetBounds(0, 0, width-1, height-1);
 }
 
 RulerPanel::~RulerPanel()
@@ -1540,14 +1538,24 @@
 
 void RulerPanel::OnSize(wxSizeEvent &evt)
 {
-   int width, height;
-   GetClientSize(&width, &height);
-
-   ruler.SetBounds(0, 0, width-1, height-1);
-
    Refresh(false);
 }
 
+// LL:  We're overloading DoSetSize so that we can update the ruler bounds 
immediately
+//      instead of waiting for a wxEVT_SIZE to come through.  This is needed 
by (at least)
+//      FreqWindow since it needs to have an updated ruler before RulerPanel 
gets the
+//      size event.
+void RulerPanel::DoSetSize(int x, int y,
+                           int width, int height,
+                           int sizeFlags)
+{
+   wxPanel::DoSetSize(x, y, width, height, sizeFlags);
+
+   int w, h;
+   GetClientSize(&w, &h);
+
+   ruler.SetBounds(0, 0, w-1, h-1);
+}
 
 /**********************************************************************
 


------------------------------------------------------------------------------
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