wxMacListControl* wxListBox::GetPeer() const
{
- return dynamic_cast<wxMacListControl*>(m_peer);
+ wxMacDataBrowserListControl *lb = wxDynamicCast(m_peer,wxMacDataBrowserListControl);
+ return lb ? wx_static_cast(wxMacListControl*,lb) : 0 ;
}
bool wxListBox::Create(
{
#if wxMAC_USE_CORE_GRAPHICS
wxClientDC dc(const_cast<wxListBox*>(this));
+ dc.SetFont(GetFont());
#else
wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef)MacGetTopLevelWindowRef() ) );
#else
wLine = ::TextWidth( str.c_str(), 0, str.length() );
#endif
-
- lbWidth = wxMax( lbWidth, wLine );
#endif
+ lbWidth = wxMax( lbWidth, wLine );
}
// Add room for the scrollbar
int cy = 12;
#if wxMAC_USE_CORE_GRAPHICS
wxCoord width, height ;
- dc.GetTextExtent( wxT("X") , &width, &height);
+ dc.GetTextExtent( wxT("XX") , &width, &height);
int cx = width ;
#else
- int cx = ::TextWidth( "X", 0, 1 );
+ int cx = ::TextWidth( "XX", 0, 1 );
#endif
lbWidth += cx;
DataBrowserItemNotification message,
DataBrowserItemDataRef itemData ) const
{
- wxMacDataBrowserListControl *lb = dynamic_cast<wxMacDataBrowserListControl*>(owner);
+ wxMacDataBrowserListControl *lb = wxDynamicCast(owner,wxMacDataBrowserListControl);
// we want to depend on as little as possible to make sure tear-down of controls is safe
}
}
+IMPLEMENT_DYNAMIC_CLASS( wxMacDataBrowserListControl , wxMacDataItemBrowserControl )
+
wxMacDataBrowserListControl::wxMacDataBrowserListControl( wxWindow *peer, const wxPoint& pos, const wxSize& size, long style)
: wxMacDataItemBrowserControl( peer, pos, size, style )
{
}
else if ( style & wxLB_EXTENDED )
{
- // default behaviour
+ options |= kDataBrowserCmdTogglesSelection;
}
else
{