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

Modified Files:
        ASlider.cpp ASlider.h 
Log Message:
Add ability to set scroll sizes for keyboard users and use it for the SPEED 
slider type

Index: ASlider.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/ASlider.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- ASlider.cpp 3 Jun 2009 03:48:44 -0000       1.71
+++ ASlider.cpp 7 Jun 2009 10:42:30 -0000       1.72
@@ -263,7 +263,9 @@
                            wxPoint position,
                            wxSize size,
                            int style, 
-                           float value):
+                           float value,
+                           float line,
+                           float page):
    wxDialog(parent,id,title,position),
    mStyle(style)
 {
@@ -283,6 +285,7 @@
                             size,
                             style,
                             false);
+      mSlider->SetScroll(line, page);
       S.AddWindow(mSlider, wxEXPAND);
    }
    S.EndVerticalLay();
@@ -432,6 +435,8 @@
    mDefaultValue = 0.0f;
    mDefaultShortcut = false;
    mBitmap = NULL;
+   mScrollLine = 1;
+   mScrollPage = 5;
 
    // Get the Thumb bitmap.  Generic version fo rnow...
 //#ifdef USE_AQUA
@@ -478,6 +483,18 @@
    mDefaultShortcut = value; 
 }
 
+void LWSlider::GetScroll(float & line, float & page)
+{
+   line = mScrollLine;
+   page = mScrollPage;
+}
+
+void LWSlider::SetScroll(float line, float page)
+{
+   mScrollLine = line;
+   mScrollPage = page;
+}
+
 wxWindow* LWSlider::GetToolTipParent() const
 {
    wxWindow *top = mParent;
@@ -728,7 +745,9 @@
                      pos,
                      wxSize( mWidth, mHeight ),
                      mStyle,
-                     Get());
+                     Get(),
+                     mScrollLine,
+                     mScrollPage);
    if (pos == wxPoint(-1, -1)) {
       dlg.Center();
    }
@@ -868,13 +887,13 @@
    {
       case WXK_RIGHT:
       case WXK_UP:
-         Increase( 1 );
+         Increase( mScrollLine );
          SendUpdate( mCurrentValue );
       break;
 
       case WXK_LEFT:
       case WXK_DOWN:
-         Decrease( 1 );
+         Decrease( mScrollLine );
          SendUpdate( mCurrentValue );
       break;
 
@@ -882,7 +901,7 @@
 #if !wxCHECK_VERSION(2,7,0)
       case WXK_PRIOR:
 #endif
-         Increase( 5 );
+         Increase( mScrollPage );
          SendUpdate( mCurrentValue );
       break;
 
@@ -890,7 +909,7 @@
 #if !wxCHECK_VERSION(2,7,0)
       case WXK_NEXT:
 #endif
-         Decrease( 5 );
+         Decrease( mScrollPage );
          SendUpdate( mCurrentValue );
       break;
 
@@ -1226,6 +1245,16 @@
    mLWSlider->RecreateTipWin();
 }
 
+void ASlider::GetScroll(float & line, float & page)
+{
+   mLWSlider->GetScroll(line, page);
+}
+
+void ASlider::SetScroll(float line, float page)
+{
+   mLWSlider->SetScroll(line, page);
+}
+
 float ASlider::Get( bool convert )
 {
    return mLWSlider->Get( convert );

Index: ASlider.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/ASlider.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- ASlider.h   3 Jun 2009 03:48:44 -0000       1.30
+++ ASlider.h   7 Jun 2009 10:42:30 -0000       1.31
@@ -105,6 +105,9 @@
    void SetDefaultValue(float value);
    void SetDefaultShortcut(bool value);
 
+   void GetScroll(float & line, float & page);
+   void SetScroll(float line, float page);
+
    float Get(bool convert = true);
    void Set(float value);
 
@@ -174,7 +177,10 @@
    float mMaxValue;
    float mStepValue;
    float mSpeed;
- 
+
+   float mScrollLine;
+   float mScrollPage;
+
    float mCurrentValue;
 
    bool mDefaultShortcut;
@@ -213,6 +219,9 @@
             float stepValue = STEP_CONTINUOUS );
    virtual ~ASlider();
 
+   void GetScroll(float & line, float & page);
+   void SetScroll(float line, float page);
+
    float Get( bool convert = true );
    void Set(float value);
 
@@ -260,7 +269,9 @@
                 wxPoint position,
                 wxSize size, 
                 int style,
-                float value);
+                float value,
+                float line,
+                float page);
    ~SliderDialog();
    
    float Get();


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to