Improve documentation of wxPropertyGrid::MakeColumnEditable()
Explain that column must be different from 1 in the documentation and in the (already existing) assert checking it. Closes https://github.com/wxWidgets/wxWidgets/pull/656
This commit is contained in:
committed by
Vadim Zeitlin
parent
f423b88ded
commit
f4b56f67ec
@@ -942,6 +942,10 @@ public:
|
|||||||
@param editable
|
@param editable
|
||||||
Using @false here will disable column from being editable.
|
Using @false here will disable column from being editable.
|
||||||
|
|
||||||
|
Note that @a column must not be equal to 1, as the second column is
|
||||||
|
always editable and can be made read-only only on cell-by-cell basis
|
||||||
|
using @code wxPGProperty::ChangeFlag(wxPG_PROP_READONLY, true) @endcode
|
||||||
|
|
||||||
@see BeginLabelEdit(), EndLabelEdit()
|
@see BeginLabelEdit(), EndLabelEdit()
|
||||||
*/
|
*/
|
||||||
void MakeColumnEditable( unsigned int column, bool editable = true );
|
void MakeColumnEditable( unsigned int column, bool editable = true );
|
||||||
|
@@ -964,7 +964,13 @@ void wxPropertyGrid::DoSetSelection( const wxArrayPGProperty& newSelection,
|
|||||||
void wxPropertyGrid::MakeColumnEditable( unsigned int column,
|
void wxPropertyGrid::MakeColumnEditable( unsigned int column,
|
||||||
bool editable )
|
bool editable )
|
||||||
{
|
{
|
||||||
wxASSERT( column != 1 );
|
// The second column is always editable. To make it read-only is a property
|
||||||
|
// by property decision by setting its wxPG_PROP_READONLY flag.
|
||||||
|
wxASSERT_MSG
|
||||||
|
(
|
||||||
|
column != 1,
|
||||||
|
wxS("Set wxPG_PROP_READONLY property flag instead")
|
||||||
|
);
|
||||||
|
|
||||||
wxArrayInt& cols = m_pState->m_editableColumns;
|
wxArrayInt& cols = m_pState->m_editableColumns;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user