- if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
- {
- wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
- if (m_pString)
- {
- pControl->SetValue(*m_pString) ;
- return TRUE;
- }
- }
-#endif
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
- {
- wxChoice* pControl = (wxChoice*) m_validatorWindow;
- if (m_pInt)
- {
- pControl->SetSelection(*m_pInt) ;
- return TRUE;
- }
- }
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
- {
- wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
- if (m_pString)
- {
- pControl->SetLabel(*m_pString) ;
- return TRUE;
- }
- }
- else if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
- {
- wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
- if (m_pString)
- {
- pControl->SetValue(*m_pString) ;
- return TRUE;
- }
- } else
-#if wxUSE_CHECKLISTBOX
-#ifndef __WIN16__
- // array controls
- // NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox
- // MUST come first:
- if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
- {
- wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
- if (m_pArrayInt)
- {
- // clear all selections
- int i;
- for (i = 0 ; i < pControl->Number(); ++i)
- pControl->Check(i, FALSE);
- // select each item in our array
- unsigned u;
- for (u = 0; u < m_pArrayInt->Count(); ++u)
- pControl->Check(m_pArrayInt->Item(u));
- return TRUE;
- }
- else
- return FALSE;
- } else
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
+ {
+ wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
+ if (m_pInt)
+ {
+ pControl->SetSelection(*m_pInt) ;
+ return true;
+ }
+ else if (m_pString)
+ {
+ if (pControl->FindString(* m_pString) != wxNOT_FOUND)
+ {
+ pControl->SetStringSelection(* m_pString);
+ }
+ if ((m_validatorWindow->GetWindowStyle() & wxCB_READONLY) == 0)
+ {
+ pControl->SetValue(* m_pString);
+ }
+ return true;
+ }
+ } else
+#endif
+#if wxUSE_CHOICE
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
+ {
+ wxChoice* pControl = (wxChoice*) m_validatorWindow;
+ if (m_pInt)
+ {
+ pControl->SetSelection(*m_pInt) ;
+ return true;
+ }
+ else if (m_pString)
+ {
+ if (pControl->FindString(* m_pString) != wxNOT_FOUND)
+ {
+ pControl->SetStringSelection(* m_pString);
+ }
+ return true;
+ }
+ } else