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

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1508
Date       : Mon Jul 24 16:22:03 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/camelot.cpp
   M /Trunk/XaraLX/wxXtra/slidercombo.cpp

More popup slider stuff


Diff:
Index: Trunk/XaraLX/wxXtra/slidercombo.cpp
===================================================================
--- Trunk/XaraLX/wxXtra/slidercombo.cpp	(revision 1507)
+++ Trunk/XaraLX/wxXtra/slidercombo.cpp	(revision 1508)
@@ -12,9 +12,6 @@
 #include "slidercombo.h"
 
 #include <wx/slider.h>
-#ifdef __WXGTK20__
-#include <gtk/gtk.h>
-#endif
 
 class wxSliderComboPopup : public wxSlider, public wxComboPopup
 {
@@ -55,7 +52,7 @@
     virtual wxString GetStringValue() const
     {
     // FIXME: Does this get called in wxGTK? On wxMSW this gets called on popup close
-        return wxT("asdf");
+        return wxString::Format(wxT("%d"), GetValue());
     }
 
 protected:
@@ -91,7 +88,6 @@
                              const wxPoint& pos, const wxSize& size,
                              long style, const wxString& name)
 // FIXME: initial string and validator should maybe be in our ctor too?
-    : wxComboCtrl(parent, id, wxEmptyString, pos, size, style, wxDefaultValidator, name)
 {
     Init();
     Create(parent, id, value, pos, size, style, name);
@@ -102,11 +98,15 @@
                            const wxPoint& pos, const wxSize& size,
                            long style, const wxString& name)
 {
-    wxSliderComboPopup* sliderpopup = new wxSliderComboPopup();
-    m_slider = sliderpopup;
-    SetPopupControl(sliderpopup);
-    m_slider->SetValue(value);
-    return true;
+    if (wxComboCtrl::Create(parent, id, wxEmptyString, pos, size, style, wxDefaultValidator, name))
+    {
+        wxSliderComboPopup* sliderpopup = new wxSliderComboPopup();
+        m_slider = sliderpopup;
+        SetPopupControl(sliderpopup);
+        m_slider->SetValue(value);
+        return true;
+    }
+    return false;
 }
 
 wxSliderCombo::~wxSliderCombo()
Index: Trunk/XaraLX/wxOil/camelot.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camelot.cpp	(revision 1507)
+++ Trunk/XaraLX/wxOil/camelot.cpp	(revision 1508)
@@ -317,6 +317,7 @@
 
 			if( pClassInfo->IsKindOf( CLASSINFO(wxTextCtrl) ) ||
 				pClassInfo->IsKindOf( CLASSINFO(wxComboBox) ) ||
+				pClassInfo->IsKindOf( CLASSINFO(wxSliderCombo) ) ||
 				pClassInfo->IsKindOf( CLASSINFO(wxOwnerDrawnComboBox) ) ||
 				pClassInfo->IsKindOf( CLASSINFO(wxComboCtrl) )
 				)


Xara