Remove private wxDisclosureTriangle control.
Remove the private and undocumented control and it's usage in wxGenericCollapsiblePane. The class used a low resolution bitmap which looks bad on high resolution displays. The generic implementation using wxRendererNative::DrawCollapseButton() is better fit even on OS X.
This commit is contained in:
@@ -138,57 +138,3 @@ wxSize wxButtonBase::GetDefaultSize()
|
||||
{
|
||||
return wxAnyButton::GetDefaultSize();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------
|
||||
// wxDisclosureTriangle
|
||||
//-------------------------------------------------------
|
||||
|
||||
bool wxDisclosureTriangle::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos, const wxSize& size, long style,const wxValidator& validator, const wxString& name )
|
||||
{
|
||||
DontCreatePeer();
|
||||
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
|
||||
return false;
|
||||
|
||||
SetPeer(wxWidgetImpl::CreateDisclosureTriangle(this, parent, id, label, pos, size, style, GetExtraStyle() ));
|
||||
|
||||
MacPostControlCreate( pos, size );
|
||||
// passing the text in the param doesn't seem to work, so let's do it again
|
||||
SetLabel( label );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDisclosureTriangle::SetOpen( bool open )
|
||||
{
|
||||
GetPeer()->SetValue( open ? 1 : 0 );
|
||||
}
|
||||
|
||||
bool wxDisclosureTriangle::IsOpen() const
|
||||
{
|
||||
return GetPeer()->GetValue() == 1;
|
||||
}
|
||||
|
||||
bool wxDisclosureTriangle::OSXHandleClicked( double WXUNUSED(timestampsec) )
|
||||
{
|
||||
// Just emit button event for now
|
||||
wxCommandEvent event(wxEVT_BUTTON, m_windowId);
|
||||
event.SetEventObject(this);
|
||||
ProcessCommand(event);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
wxSize wxDisclosureTriangle::DoGetBestSize() const
|
||||
{
|
||||
wxSize size = wxWindow::DoGetBestSize();
|
||||
|
||||
// under Carbon the base class GetBestSize() implementation doesn't seem to
|
||||
// take the label into account at all, correct for it here
|
||||
#if wxOSX_USE_CARBON
|
||||
size.x += GetTextExtent(GetLabel()).x;
|
||||
#endif // wxOSX_USE_CARBON
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user