]>
git.saurik.com Git - wxWidgets.git/blob - src/common/ctrlsub.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: common/ctrlsub.cpp
3 // Purpose: wxItemContainer 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"
34 #include "wx/ctrlsub.h"
37 // ============================================================================
39 // ============================================================================
41 // ----------------------------------------------------------------------------
43 // ----------------------------------------------------------------------------
45 wxString
wxItemContainer::GetStringSelection() const
48 int sel
= GetSelection();
55 // ----------------------------------------------------------------------------
57 // ----------------------------------------------------------------------------
59 void wxItemContainer::SetClientObject(int n
, wxClientData
*data
)
61 wxASSERT_MSG( m_clientDataItemsType
!= wxClientData_Void
,
62 wxT("can't have both object and void client data") );
64 wxClientData
*clientDataOld
= DoGetItemClientObject(n
);
68 DoSetItemClientObject(n
, data
);
69 m_clientDataItemsType
= wxClientData_Object
;
72 wxClientData
*wxItemContainer::GetClientObject(int n
) const
74 wxASSERT_MSG( m_clientDataItemsType
== wxClientData_Object
,
75 wxT("this window doesn't have object client data") );
77 return DoGetItemClientObject(n
);
80 void wxItemContainer::SetClientData(int n
, void *data
)
82 wxASSERT_MSG( m_clientDataItemsType
!= wxClientData_Object
,
83 wxT("can't have both object and void client data") );
85 DoSetItemClientData(n
, data
);
86 m_clientDataItemsType
= wxClientData_Void
;
89 void *wxItemContainer::GetClientData(int n
) const
91 wxASSERT_MSG( m_clientDataItemsType
== wxClientData_Void
,
92 wxT("this window doesn't have void client data") );
94 return DoGetItemClientData(n
);
97 #endif // wxUSE_CONTROLS