git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50020
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxWindowID id,
wxEvtHandler* evtHandler)
{
wxWindowID id,
wxEvtHandler* evtHandler)
{
+ int style = wxBORDER_NONE;
+ if (!m_allowOthers)
+ style |= wxCB_READONLY;
m_control = new wxComboBox(parent, id, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
m_control = new wxComboBox(parent, id, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
- m_choices,
- m_allowOthers ? 0 : wxCB_READONLY);
wxGridCellEditor::Create(parent, id, evtHandler);
}
wxGridCellEditor::Create(parent, id, evtHandler);
}
wxSize size = checkbox->GetBestSize();
wxCoord checkSize = size.y + 2 * wxGRID_CHECKMARK_MARGIN;
wxSize size = checkbox->GetBestSize();
wxCoord checkSize = size.y + 2 * wxGRID_CHECKMARK_MARGIN;
- // FIXME wxGTK::wxCheckBox::GetBestSize() gives "wrong" result
-#if defined(__WXGTK__) || defined(__WXMOTIF__)
+#if defined(__WXMOTIF__)
checkSize -= size.y / 2;
#endif
checkSize -= size.y / 2;
#endif
if ( size.x >= minSize || size.y >= minSize )
{
// and even leave (at least) 1 pixel margin
if ( size.x >= minSize || size.y >= minSize )
{
// and even leave (at least) 1 pixel margin
- size.x = size.y = minSize - 2;
+ size.x = size.y = minSize;
}
// draw a border around checkmark
}
// draw a border around checkmark
value = wxGridCellBoolEditor::IsTrueValue(cellval);
}
value = wxGridCellBoolEditor::IsTrueValue(cellval);
}
- if ( value )
- {
- wxRect rectMark = rectBorder;
-
-#ifdef __WXMSW__
- // MSW DrawCheckMark() is weird (and should probably be changed...)
- rectMark.Inflate(-wxGRID_CHECKMARK_MARGIN / 2);
- rectMark.x++;
- rectMark.y++;
-#else
- rectMark.Inflate(-wxGRID_CHECKMARK_MARGIN);
-#endif
-
- dc.SetTextForeground(attr.GetTextColour());
- dc.DrawCheckMark(rectMark);
- }
-
- dc.SetBrush(*wxTRANSPARENT_BRUSH);
- dc.SetPen(wxPen(attr.GetTextColour(), 1, wxSOLID));
- dc.DrawRectangle(rectBorder);
+ int flags = 0;
+ if (value)
+ flags |= wxCONTROL_CHECKED;
+
+ wxRendererNative::Get().DrawCheckBox( &grid, dc, rectBorder, flags );
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
if (rect.GetRight() > client_right)
rect.SetRight( client_right - 1 );
}
if (rect.GetRight() > client_right)
rect.SetRight( client_right - 1 );
}
editor->SetCellAttr( attr );
editor->SetSize( rect );
if (nXMove != 0)
editor->SetCellAttr( attr );
editor->SetSize( rect );
if (nXMove != 0)