Пример #1
0
wxSize wxRadioBox::GetTotalButtonSize( const wxSize& rSizeBtn ) const
{
    int    nCx1;
    int    nCy1;
    int    nHeight;
    int    nWidth;
    int    nWidthLabel = 0;

    nCx1 = GetCharWidth();
    nCy1 = GetCharHeight();
    nHeight = GetNumVer() * rSizeBtn.y + (2 * nCy1);
    nWidth  = GetNumHor() * (rSizeBtn.x + nCx1) + nCx1;

    //
    // And also wide enough for its label
    //
    wxString                        sStr = wxGetWindowText(GetHwnd());
    if (!sStr.IsEmpty())
    {
        GetTextExtent( sStr
                      ,&nWidthLabel
                      ,NULL
                     );
        nWidthLabel += 2*nCx1;
    }
    if (nWidthLabel > nWidth)
        nWidth = nWidthLabel;

    wxSize total( nWidth, nHeight );
    return total;
} // end of wxRadioBox::GetTotalButtonSize
Пример #2
0
wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
{
    // the radiobox should be big enough for its buttons
    int cx1, cy1;
    wxGetCharSize(m_hWnd, &cx1, &cy1, GetFont());

    int extraHeight = cy1;

    int height = GetNumVer() * sizeBtn.y + cy1/2 + extraHeight;
    int width  = GetNumHor() * (sizeBtn.x + cx1) + cx1;

    // Add extra space under the label, if it exists.
    if (!wxControl::GetLabel().empty())
        height += cy1/2;

    // and also wide enough for its label
    int widthLabel;
    GetTextExtent(GetTitle(), &widthLabel, NULL);
    widthLabel += RADIO_SIZE; // FIXME this is bogus too
    if ( widthLabel > width )
        width = widthLabel;

    return wxSize(width, height);
}
Пример #3
0
int wxRadioBox::GetColumnCount() const
{
    return GetNumHor();
} // end of wxRadioBox::GetColumnCount