/////////////////////////////////////////////////////////////////////////////
-// Name: choice.cpp
+// Name: src/mac/classic/choice.cpp
// Purpose: wxChoice
// Author: Stefan Csomor
// Modified by:
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "choice.h"
-#endif
-
#include "wx/defs.h"
+
+#if wxUSE_CHOICE
+
#include "wx/choice.h"
#include "wx/menu.h"
#include "wx/mac/uma.h"
-#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
-#endif
extern MenuHandle NewUniqueMenu() ;
Str255 title ;
MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , -12345 , 0 ,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , -12345 , 0 ,
kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ;
m_macPopUpMenuHandle = NewUniqueMenu() ;
{
Append(choices[i]);
}
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
return m_strings.GetCount() ;
}
-int wxChoice::FindString(const wxString& s) const
-{
- for( int i = 0 ; i < GetCount() ; i++ )
- {
- if ( GetString( i ).IsSameAs(s, FALSE) )
- return i ;
- }
- return wxNOT_FOUND ;
-}
-
void wxChoice::SetString(int n, const wxString& s)
{
wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented"));
wxString wxChoice::GetString(int n) const
{
- wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), _T(""),
+ wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), wxEmptyString,
_T("wxChoice::GetString(): invalid index") );
return m_strings[n] ;
return (wxClientData *)DoGetItemClientData(n);
}
-void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown))
+void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown))
{
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId );
int n = GetSelection();
}
return wxSize(lbWidth, lbHeight);
}
+
+#endif // wxUSE_CHOICE