Corrected some combobox-related code, changed ordering and added wxSpinCtrl
support as per bug report git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7804 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -44,11 +44,14 @@
|
||||
#include "wx/slider.h"
|
||||
#endif
|
||||
|
||||
#ifndef __WIN16__
|
||||
#include "wx/spinbutt.h"
|
||||
#if wxUSE_CHECKLISTBOX
|
||||
#include "wx/checklst.h"
|
||||
#if wxUSE_SPINCTRL && !defined(__WIN16__)
|
||||
#include "wx/spinctrl.h"
|
||||
#endif
|
||||
#if wxUSE_SPINBTN && !defined(__WIN16__)
|
||||
#include "wx/spinbutt.h"
|
||||
#endif
|
||||
#if wxUSE_CHECKLISTBOX && !defined(__WIN16__)
|
||||
#include "wx/checklst.h"
|
||||
#endif
|
||||
|
||||
#include "wx/valgen.h"
|
||||
@@ -162,6 +165,17 @@ bool wxGenericValidator::TransferToWindow(void)
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
#if wxUSE_SPINCTRL && !defined(__WIN16__)
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinCtrl)) )
|
||||
{
|
||||
wxSpinCtrl* pControl = (wxSpinCtrl*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
pControl->SetValue(*m_pInt);
|
||||
return TRUE;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
#if wxUSE_SPINBTN && !defined(__WIN16__)
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
|
||||
{
|
||||
@@ -195,10 +209,10 @@ bool wxGenericValidator::TransferToWindow(void)
|
||||
return TRUE;
|
||||
}
|
||||
} else
|
||||
#if wxUSE_CHOICE
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
|
||||
#if wxUSE_COMBOBOX
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
|
||||
{
|
||||
wxChoice* pControl = (wxChoice*) m_validatorWindow;
|
||||
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
pControl->SetSelection(*m_pInt) ;
|
||||
@@ -214,10 +228,10 @@ bool wxGenericValidator::TransferToWindow(void)
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
#if wxUSE_COMBOBOX
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
|
||||
#if wxUSE_CHOICE
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
|
||||
{
|
||||
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
|
||||
wxChoice* pControl = (wxChoice*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
pControl->SetSelection(*m_pInt) ;
|
||||
@@ -368,8 +382,18 @@ bool wxGenericValidator::TransferFromWindow(void)
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
#if wxUSE_SPINBTN
|
||||
#ifndef __WIN16__
|
||||
#if wxUSE_SPINCTRL && !defined(__WIN16__)
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinCtrl)) )
|
||||
{
|
||||
wxSpinCtrl* pControl = (wxSpinCtrl*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
*m_pInt=pControl->GetValue();
|
||||
return TRUE;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
#if wxUSE_SPINBTN && !defined(__WIN16__)
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
|
||||
{
|
||||
wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
|
||||
@@ -380,7 +404,6 @@ bool wxGenericValidator::TransferFromWindow(void)
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
#endif
|
||||
#if wxUSE_SLIDER
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSlider)) )
|
||||
{
|
||||
@@ -407,9 +430,9 @@ bool wxGenericValidator::TransferFromWindow(void)
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
|
||||
{
|
||||
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
|
||||
if (m_pString)
|
||||
if (m_pInt)
|
||||
{
|
||||
*m_pString = pControl->GetValue() ;
|
||||
*m_pInt = pControl->GetSelection() ;
|
||||
return TRUE;
|
||||
}
|
||||
else if (m_pString)
|
||||
@@ -435,20 +458,6 @@ bool wxGenericValidator::TransferFromWindow(void)
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
|
||||
{
|
||||
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
*m_pInt = pControl->GetSelection() ;
|
||||
return TRUE;
|
||||
}
|
||||
else if (m_pString)
|
||||
{
|
||||
*m_pString = pControl->GetStringSelection();
|
||||
return TRUE;
|
||||
}
|
||||
} else
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
|
||||
{
|
||||
wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
|
||||
@@ -521,6 +530,7 @@ bool wxGenericValidator::TransferFromWindow(void)
|
||||
|
||||
/*
|
||||
Called by constructors to initialize ALL data members
|
||||
Last change: JAC 21 Jul 100 4:58 pm
|
||||
*/
|
||||
void wxGenericValidator::Initialize()
|
||||
{
|
||||
|
Reference in New Issue
Block a user