git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61356
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxMacDataBrowserCellValue(DataBrowserItemDataRef data) : m_data(data) {}
virtual ~wxMacDataBrowserCellValue() {}
wxMacDataBrowserCellValue(DataBrowserItemDataRef data) : m_data(data) {}
virtual ~wxMacDataBrowserCellValue() {}
- virtual void Set( CFStringRef value );
+ virtual void Set( CFStringRef value );
virtual void Set( const wxString& value );
virtual void Set( int value ) ;
virtual void Set( const wxString& value );
virtual void Set( int value ) ;
+ virtual void Check( bool check );
virtual int GetIntValue() const ;
virtual wxString GetStringValue() const ;
virtual int GetIntValue() const ;
virtual wxString GetStringValue() const ;
virtual void Set( CFStringRef value ) = 0;
virtual void Set( const wxString& value ) = 0;
virtual void Set( int value ) = 0;
virtual void Set( CFStringRef value ) = 0;
virtual void Set( const wxString& value ) = 0;
virtual void Set( int value ) = 0;
+ virtual void Check( bool check );
+ virtual bool IsChecked() const;
virtual int GetIntValue() const = 0;
virtual wxString GetStringValue() const = 0;
} ;
virtual int GetIntValue() const = 0;
virtual wxString GetStringValue() const = 0;
} ;
}
void wxMacDataBrowserCellValue::Set( int value )
}
void wxMacDataBrowserCellValue::Set( int value )
SetDataBrowserItemDataValue( m_data, value );
SetDataBrowserItemDataValue( m_data, value );
- // SetDataBrowserItemDataButtonValue( m_data, value ? kThemeButtonOn : kThemeButtonOff);
+}
+
+void wxMacDataBrowserCellValue::Check( bool check )
+{
+ SetDataBrowserItemDataButtonValue( m_data, check ? kThemeButtonOn : kThemeButtonOff);
}
int wxMacDataBrowserCellValue::GetIntValue() const
}
int wxMacDataBrowserCellValue::GetIntValue() const
void wxCheckListBox::GetValueCallback( unsigned int n, wxListWidgetColumn* col , wxListWidgetCellValue& value )
{
if ( col == m_checkColumn )
void wxCheckListBox::GetValueCallback( unsigned int n, wxListWidgetColumn* col , wxListWidgetCellValue& value )
{
if ( col == m_checkColumn )
- value.Set( IsChecked( n ) );
+ value.Check( IsChecked( n ) );
else
wxListBox::GetValueCallback( n, col, value );
}
else
wxListBox::GetValueCallback( n, col, value );
}
{
if ( col == m_checkColumn )
{
{
if ( col == m_checkColumn )
{
- Check( n, value.GetIntValue() != 0 );
+ Check( n, value.IsChecked() );
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId() );
event.SetInt( n );
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId() );
event.SetInt( n );
HandleWindowEvent(event);
}
HandleWindowEvent(event);
}
+//
+// common list cell value operations
+//
+
+void wxListWidgetCellValue::Check( bool check )
+{
+ Set( check ? 1 : 0 );
+}
+
+bool wxListWidgetCellValue::IsChecked() const
+{
+ return GetIntValue() != 0;
+}
+
+
+