Add wxDataViewToggleRenderer::ShowAsRadio()
This allows showing radio buttons in wxDataViewCtrl easily and natively. Notice that this approach, adding an extra function to the existing renderer class instead of creating some new wxDataViewRadioRenderer (see https://github.com/wxWidgets/wxWidgets/pull/809), was finally chosen because it is simpler to implement and, more importantly, because it will be more natural to generalize if/when we also add a 3-state check/radio renderer. Closes https://github.com/wxWidgets/wxWidgets/pull/853
This commit is contained in:
@@ -132,6 +132,8 @@ public:
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
void ShowAsRadio() { m_radio = true; }
|
||||
|
||||
virtual bool SetValue( const wxVariant &value ) wxOVERRIDE;
|
||||
virtual bool GetValue( wxVariant &value ) const wxOVERRIDE;
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
@@ -149,6 +151,7 @@ public:
|
||||
const wxMouseEvent *mouseEvent) wxOVERRIDE;
|
||||
private:
|
||||
bool m_toggle;
|
||||
bool m_radio;
|
||||
|
||||
protected:
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer);
|
||||
|
Reference in New Issue
Block a user