]>
git.saurik.com Git - wxWidgets.git/blob - src/common/ctrlsub.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: common/ctrlsub.cpp
3 // Purpose: wxControlWithItems implementation
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "controlwithitems.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
32 #include "wx/ctrlsub.h"
35 // ============================================================================
37 // ============================================================================
39 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
43 wxString
wxControlWithItems::GetStringSelection() const
46 int sel
= GetSelection();
53 // ----------------------------------------------------------------------------
55 // ----------------------------------------------------------------------------
57 void wxControlWithItems::SetClientObject(int n
, wxClientData
*data
)
59 wxASSERT_MSG( m_clientDataItemsType
!= ClientData_Void
,
60 wxT("can't have both object and void client data") );
62 wxClientData
*clientDataOld
= DoGetItemClientObject(n
);
66 DoSetItemClientObject(n
, data
);
67 m_clientDataItemsType
= ClientData_Object
;
70 wxClientData
*wxControlWithItems::GetClientObject(int n
) const
72 wxASSERT_MSG( m_clientDataItemsType
== ClientData_Object
,
73 wxT("this window doesn't have object client data") );
75 return DoGetItemClientObject(n
);
78 void wxControlWithItems::SetClientData(int n
, void *data
)
80 wxASSERT_MSG( m_clientDataItemsType
!= ClientData_Object
,
81 wxT("can't have both object and void client data") );
83 DoSetItemClientData(n
, data
);
84 m_clientDataItemsType
= ClientData_Void
;
87 void *wxControlWithItems::GetClientData(int n
) const
89 wxASSERT_MSG( m_clientDataItemsType
== ClientData_Void
,
90 wxT("this window doesn't have void client data") );
92 return DoGetItemClientData(n
);