[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : alex
Repository : xara
Revision : 1505
Date : Mon Jul 24 14:08:28 BST 2006
Changed paths:
M /Trunk/XaraLX/wxOil/camresource.cpp
M /Trunk/XaraLX/wxOil/dlgmgr.cpp
M /Trunk/XaraLX/wxXtra/slidercombo.cpp
M /Trunk/XaraLX/wxXtra/slidercombo.h
M /Trunk/XaraLX/wxXtra/xh_slidrcombo.cpp
M /Trunk/XaraLX/wxXtra/xh_slidrcombo.h
More popup combo work
Diff:
Index: Trunk/XaraLX/wxXtra/slidercombo.h
===================================================================
--- Trunk/XaraLX/wxXtra/slidercombo.h (revision 1504)
+++ Trunk/XaraLX/wxXtra/slidercombo.h (revision 1505)
@@ -69,6 +69,9 @@
// Default without having called this is 0..100
void SetRange(int minValue, int maxValue);
+ int GetSliderMin() const;
+ int GetSliderMax() const;
+
// 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/xh_slidrcombo.h
===================================================================
--- Trunk/XaraLX/wxXtra/xh_slidrcombo.h (revision 1504)
+++ Trunk/XaraLX/wxXtra/xh_slidrcombo.h (revision 1505)
@@ -11,6 +11,8 @@
#ifndef _WX_XH_SLIDERCOMBO_H_
#define _WX_XH_SLIDERCOMBO_H_
+#define wxXTRA_XH_SLIDERCOMBO
+
#include <wx/xrc/xmlres.h>
//#if wxUSE_SLIDERCOMBO
Index: Trunk/XaraLX/wxXtra/slidercombo.cpp
===================================================================
--- Trunk/XaraLX/wxXtra/slidercombo.cpp (revision 1504)
+++ Trunk/XaraLX/wxXtra/slidercombo.cpp (revision 1505)
@@ -158,3 +158,13 @@
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();
+}
Index: Trunk/XaraLX/wxXtra/xh_slidrcombo.cpp
===================================================================
--- Trunk/XaraLX/wxXtra/xh_slidrcombo.cpp (revision 1504)
+++ Trunk/XaraLX/wxXtra/xh_slidrcombo.cpp (revision 1505)
@@ -50,6 +50,8 @@
GetStyle(),
GetName());
+ control->SetPopupControl();
+
SetupWindow(control);
return control;
Index: Trunk/XaraLX/wxOil/camresource.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camresource.cpp (revision 1504)
+++ Trunk/XaraLX/wxOil/camresource.cpp (revision 1505)
@@ -1455,7 +1455,9 @@
wxXmlResource::Get()->AddHandler(new wxOwnerDrawnComboBoxXmlHandler);
// wxXmlResource::Get()->AddHandler(new wxComboControlXmlHandler);
#endif
+#ifdef wxXTRA_XH_SLIDERCOMBO
wxXmlResource::Get()->AddHandler(new wxSliderComboXmlHandler);
+#endif
#if WXXTRA_TREEBOOK
wxXmlResource::Get()->AddHandler(new wxTreebookXmlHandler);
#endif
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp (revision 1504)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp (revision 1505)
@@ -1101,7 +1101,12 @@
(EventType == wxEVT_SCROLL_LINEDOWN) ||
(EventType == wxEVT_SCROLL_PAGEUP) ||
(EventType == wxEVT_SCROLL_PAGEDOWN)
- ) && !(pGadget && pGadget->IsKindOf(CLASSINFO(wxSlider)))) || // Don't handle slider scroll stuff here
+ ) &&
+ !(
+ (pGadget && pGadget->IsKindOf(CLASSINFO(wxSlider))) ||
+ (pGadget && pGadget->IsKindOf(CLASSINFO(wxSliderCombo)))
+ )
+ ) || // Don't handle slider scroll stuff here
(EventType == wxEVT_COMMAND_TREE_SEL_CHANGED) ||
FALSE)
{
@@ -1129,8 +1134,8 @@
(EventType == wxEVT_SCROLL_LINEDOWN) ||
(EventType == wxEVT_SCROLL_PAGEUP) ||
(EventType == wxEVT_SCROLL_PAGEDOWN)
- ) && (pGadget && pGadget->IsKindOf(CLASSINFO(wxSlider)))) || // Handle slider movements - note SCROLL_CHANGED always comes later
- FALSE)
+ ) && (pGadget && ( pGadget->IsKindOf(CLASSINFO(wxSlider)) || pGadget->IsKindOf(CLASSINFO(wxSliderCombo)) ))) ||
+ FALSE) // Handle slider movements - note SCROLL_CHANGED always comes later
{
msg.DlgMsg = DIM_SLIDER_POS_CHANGING;
HandleMessage = TRUE;
@@ -1138,7 +1143,9 @@
else if(
// Do not handle THUMB_RELEASE because we get a SCROLL_CHANGED anyway, and having two means we generate two SETs which will generate 2 undo records
// on (for instance) transparency and Bevel tools
- ((/*EventType == wxEVT_SCROLL_THUMBRELEASE ||*/ EventType == wxEVT_SCROLL_CHANGED) && (pGadget && pGadget->IsKindOf(CLASSINFO(wxSlider)))) || // Handle slider changes
+ ((/*EventType == wxEVT_SCROLL_THUMBRELEASE ||*/ EventType == wxEVT_SCROLL_CHANGED) &&
+ ( (pGadget && pGadget->IsKindOf(CLASSINFO(wxSlider))) || (pGadget && pGadget->IsKindOf(CLASSINFO(wxSliderCombo))) )
+ ) || // Handle slider changes
FALSE)
{
msg.DlgMsg = DIM_SLIDER_POS_SET;
@@ -2348,6 +2355,12 @@
return TRUE;
}
+ if ( pGadget->IsKindOf(CLASSINFO(wxSliderCombo)) )
+ {
+ ((wxSliderCombo *)(pGadget))->SetSliderValue(Value);
+ return TRUE;
+ }
+
if ( pGadget->IsKindOf(CLASSINFO(wxGauge)) )
{
((wxGauge *)(pGadget))->SetValue(Value);
@@ -2466,6 +2479,7 @@
( pGadget->IsKindOf(CLASSINFO(wxRadioButton))) ||
( pGadget->IsKindOf(CLASSINFO(wxScrollBar))) ||
( pGadget->IsKindOf(CLASSINFO(wxSlider))) ||
+ ( pGadget->IsKindOf(CLASSINFO(wxSliderCombo))) ||
( pGadget->IsKindOf(CLASSINFO(wxCamArtControl))) ||
( pGadget->IsKindOf(CLASSINFO(wxGauge)))
)
@@ -3002,6 +3016,12 @@
return TRUE;
}
+ if ( pGadget->IsKindOf(CLASSINFO(wxSliderCombo)) )
+ {
+ ((wxSliderCombo *)(pGadget))->SetRange(Min, Max);
+ return TRUE;
+ }
+
if ( pGadget->IsKindOf(CLASSINFO(wxGauge)) )
{
ERROR3IF(Min !=0 , "Gauges with non-zero minimum need to be subclassed");
@@ -3202,6 +3222,7 @@
// do this then break the control setting
if ( pGadget->IsKindOf(CLASSINFO(wxScrollBar))
|| pGadget->IsKindOf(CLASSINFO(wxSlider))
+ || pGadget->IsKindOf(CLASSINFO(wxSliderCombo))
|| pGadget->IsKindOf(CLASSINFO(wxGauge)) )
return TRUE;
@@ -3723,6 +3744,12 @@
return (INT32)(((wxSlider *)(pGadget))->GetValue());
}
+ if ( pGadget->IsKindOf(CLASSINFO(wxSliderCombo)) )
+ {
+ if (Valid) *Valid=TRUE;
+ return (INT32)(((wxSliderCombo *)(pGadget))->GetSliderValue());
+ }
+
if ( pGadget->IsKindOf(CLASSINFO(wxGauge)) )
{
if (Valid) *Valid=TRUE;
@@ -3876,6 +3903,7 @@
( pGadget->IsKindOf(CLASSINFO(wxRadioButton))) ||
( pGadget->IsKindOf(CLASSINFO(wxScrollBar))) ||
( pGadget->IsKindOf(CLASSINFO(wxSlider))) ||
+ ( pGadget->IsKindOf(CLASSINFO(wxSliderCombo))) ||
( pGadget->IsKindOf(CLASSINFO(wxGauge)))
)
return (double)GetLongGadgetValue( WindowID, Gadget, (INT32)(floor(StartRange+0.5)), (INT32)(floor(EndRange+0.5)), IDSInvalidMsg, Valid);
@@ -4170,9 +4198,15 @@
if ( pGadget->IsKindOf(CLASSINFO(wxSlider)) )
{
min=((wxSlider *)(pGadget))->GetMin();
- max=((wxSlider *)(pGadget))->GetMin();
+ max=((wxSlider *)(pGadget))->GetMax();
}
+ if ( pGadget->IsKindOf(CLASSINFO(wxSliderCombo)) )
+ {
+ min=((wxSliderCombo *)(pGadget))->GetSliderMin();
+ max=((wxSliderCombo *)(pGadget))->GetSliderMax();
+ }
+
if ( pGadget->IsKindOf(CLASSINFO(wxGauge)) )
{
max = ((wxGauge *)(pGadget))->GetRange();
Xara