[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1514
Date       : Mon Jul 24 20:33:52 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc
   M /Trunk/XaraLX/wxXtra/slidercombo.cpp
   M /Trunk/XaraLX/wxXtra/slidercombo.h
   M /Trunk/XaraLX/wxXtra/xh_slidrcombo.cpp

More pop-up slider work


Diff:
Index: Trunk/XaraLX/wxXtra/slidercombo.h
===================================================================
--- Trunk/XaraLX/wxXtra/slidercombo.h	(revision 1513)
+++ Trunk/XaraLX/wxXtra/slidercombo.h	(revision 1514)
@@ -58,20 +58,45 @@
     bool GetAutomaticUpdates() const;
     void SetAutomaticUpdates(bool);
 
+    // Duplicate the wxSlider API
+
     // From wxSlider whatever is necessary... Events are the most important here
     int GetSliderValue() const;
     void SetSliderValue(int value);
 
-    // How much do we increase/decrease with page up/down?
-    int GetPageSize() const;
-    void SetPageSize(int pageSize);
-
     // Default without having called this is 0..100
     void SetRange(int minValue, int maxValue);
 
-	int GetSliderMin() const;
-	int GetSliderMax() const;
+    int GetSliderMin() const;
+    int GetSliderMax() const;
+    void SetSliderMin( int minValue );
+    void SetSliderMax( int maxValue );
 
+    // the line/page size is the increment by which the slider moves when
+    // cursor arrow key/page up or down are pressed (clicking the mouse is like
+    // pressing PageUp/Down) and are by default set to 1 and 1/10 of the range
+    void SetLineSize(int lineSize);
+    void SetPageSize(int pageSize);
+    int GetLineSize() const;
+    int GetPageSize() const;
+
+    // these methods get/set the length of the slider pointer in pixels
+    void SetThumbLength(int lenPixels);
+    int GetThumbLength() const;
+
+    // warning: most of subsequent methods are currently only implemented in
+    //          wxMSW under Win95 and are silently ignored on other platforms
+
+    void SetTickFreq(int n, int pos);
+    int GetTickFreq() const;
+    void ClearTicks();
+    void SetTick(int tickPos);
+
+    void ClearSel();
+    int GetSelEnd() const;
+    int GetSelStart() const;
+    void SetSelection(int min, int max);
+
     // Do we need floating point support? In this case this could be used to
     // select it (and add some other floating point methods)
     /* void SetRange(double minValue, double maxValue); */
Index: Trunk/XaraLX/wxXtra/slidercombo.cpp
===================================================================
--- Trunk/XaraLX/wxXtra/slidercombo.cpp	(revision 1513)
+++ Trunk/XaraLX/wxXtra/slidercombo.cpp	(revision 1514)
@@ -145,28 +145,98 @@
     m_slider->SetValue(value);
 }
 
-int wxSliderCombo::GetPageSize() const
+void wxSliderCombo::SetRange(int minValue, int maxValue)
 {
-    return m_slider->GetPageSize();
+    m_slider->SetRange(minValue, maxValue);
+    // FIXME: Perhaps need to sync with text control
 }
 
+int wxSliderCombo::GetSliderMin() const
+{
+    return m_slider->GetMin();
+}
+
+int wxSliderCombo::GetSliderMax() const
+{
+    return m_slider->GetMax();
+}
+
+void wxSliderCombo::SetSliderMin( int minValue )
+{
+    m_slider->SetMin(minValue);
+}
+
+void wxSliderCombo::SetSliderMax( int maxValue )
+{
+    m_slider->SetMax(maxValue);
+}
+
+void wxSliderCombo::SetLineSize(int lineSize)
+{
+    m_slider->SetLineSize(lineSize);
+}
+
 void wxSliderCombo::SetPageSize(int pageSize)
 {
     m_slider->SetPageSize(pageSize);
 }
 
-void wxSliderCombo::SetRange(int minValue, int maxValue)
+int wxSliderCombo::GetLineSize() const
 {
-    m_slider->SetRange(minValue, maxValue);
-    // FIXME: Perhaps need to sync with text control
+    return m_slider->GetLineSize();
 }
 
-int wxSliderCombo::GetSliderMin() const
+int wxSliderCombo::GetPageSize() const
 {
-    return m_slider->GetMin();
+    return m_slider->GetPageSize();
 }
 
-int wxSliderCombo::GetSliderMax() const
+void wxSliderCombo::SetThumbLength(int lenPixels)
 {
-    return m_slider->GetMax();
+    m_slider->SetThumbLength(lenPixels);
 }
+
+int wxSliderCombo::GetThumbLength() const
+{
+    return m_slider->GetThumbLength();
+}
+
+void wxSliderCombo::SetTickFreq(int n, int pos)
+{
+    m_slider->SetTickFreq(n, pos);
+}
+
+int wxSliderCombo::GetTickFreq() const
+{
+    return m_slider->GetTickFreq();
+}
+
+void wxSliderCombo::ClearTicks()
+{
+    m_slider->ClearTicks();
+}
+
+void wxSliderCombo::SetTick(int tickPos)
+{
+    m_slider->SetTick(tickPos);
+}
+
+void wxSliderCombo::ClearSel()
+{
+    m_slider->ClearSel();
+}
+
+int wxSliderCombo::GetSelEnd() const
+{
+    return m_slider->GetSelEnd();
+}
+
+int wxSliderCombo::GetSelStart() const
+{
+    return m_slider->GetSelStart();
+}
+
+void wxSliderCombo::SetSelection(int min, int max)
+{
+    m_slider->SetSelection(min,max);
+}
Index: Trunk/XaraLX/wxXtra/xh_slidrcombo.cpp
===================================================================
--- Trunk/XaraLX/wxXtra/xh_slidrcombo.cpp	(revision 1513)
+++ Trunk/XaraLX/wxXtra/xh_slidrcombo.cpp	(revision 1514)
@@ -49,8 +49,34 @@
                     GetStyle(),
                     GetName());
 
+    // Slider like stuff
+    if( HasParam(wxT("tickfreq")))
+    {
+        control->SetTickFreq(GetLong(wxT("tickfreq")), 0);
+    }
+    if( HasParam(wxT("pagesize")))
+    {
+        control->SetPageSize(GetLong(wxT("pagesize")));
+    }
+    if( HasParam(wxT("linesize")))
+    {
+        control->SetLineSize(GetLong(wxT("linesize")));
+    }
+    if( HasParam(wxT("thumb")))
+    {
+        control->SetThumbLength(GetLong(wxT("thumb")));
+    }
+    if( HasParam(wxT("tick")))
+    {
+        control->SetTick(GetLong(wxT("tick")));
+    }
+    if( HasParam(wxT("selmin")) && HasParam(wxT("selmax")))
+    {
+        control->SetSelection(GetLong(wxT("selmin")), GetLong(wxT("selmax")));
+    }
+
+    // ComboCtrl like stuff
     wxSize ButtonSize=GetSize(wxT("buttonsize"));
-
     if (ButtonSize != wxDefaultSize)
     control->SetButtonPosition(ButtonSize.GetWidth(), ButtonSize.GetHeight());
 
Index: Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc	(revision 1513)
+++ Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc	(revision 1514)
@@ -1079,7 +1079,8 @@
                     <sliderstyle>wxSL_HORIZONTAL|wxSL_AUTOTICKS</sliderstyle>
                     <value>0</value>
                     <min>0</min>
-                    <max>100</max>
+                    <max>37500</max>
+                    <linesize>375</linesize>
                     <optoken>FeatherSize</optoken>
                 </object>
             </object>


Xara