adding special case for Carbon DataBrowser Checkbox
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -848,6 +848,7 @@ public :
|
|||||||
virtual void Set( CFStringRef value );
|
virtual void Set( CFStringRef value );
|
||||||
virtual void Set( const wxString& value );
|
virtual void Set( const wxString& value );
|
||||||
virtual void Set( int value ) ;
|
virtual void Set( int value ) ;
|
||||||
|
virtual void Check( bool check );
|
||||||
|
|
||||||
virtual int GetIntValue() const ;
|
virtual int GetIntValue() const ;
|
||||||
virtual wxString GetStringValue() const ;
|
virtual wxString GetStringValue() const ;
|
||||||
|
@@ -482,7 +482,9 @@ public :
|
|||||||
virtual void Set( CFStringRef value ) = 0;
|
virtual void Set( CFStringRef value ) = 0;
|
||||||
virtual void Set( const wxString& value ) = 0;
|
virtual void Set( const wxString& value ) = 0;
|
||||||
virtual void Set( int value ) = 0;
|
virtual void Set( int value ) = 0;
|
||||||
|
virtual void Check( bool check );
|
||||||
|
|
||||||
|
virtual bool IsChecked() const;
|
||||||
virtual int GetIntValue() const = 0;
|
virtual int GetIntValue() const = 0;
|
||||||
virtual wxString GetStringValue() const = 0;
|
virtual wxString GetStringValue() const = 0;
|
||||||
} ;
|
} ;
|
||||||
|
@@ -610,7 +610,11 @@ void wxMacDataBrowserCellValue::Set( const wxString& value )
|
|||||||
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
|
||||||
|
@@ -108,7 +108,7 @@ void wxCheckListBox::Check(unsigned int n, bool check)
|
|||||||
void wxCheckListBox::GetValueCallback( unsigned int n, wxListWidgetColumn* col , wxListWidgetCellValue& value )
|
void wxCheckListBox::GetValueCallback( unsigned int n, wxListWidgetColumn* col , wxListWidgetCellValue& value )
|
||||||
{
|
{
|
||||||
if ( col == m_checkColumn )
|
if ( col == m_checkColumn )
|
||||||
value.Set( IsChecked( n ) );
|
value.Check( IsChecked( n ) );
|
||||||
else
|
else
|
||||||
wxListBox::GetValueCallback( n, col, value );
|
wxListBox::GetValueCallback( n, col, value );
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ void wxCheckListBox::SetValueCallback( unsigned int n, wxListWidgetColumn* col ,
|
|||||||
{
|
{
|
||||||
if ( col == m_checkColumn )
|
if ( col == m_checkColumn )
|
||||||
{
|
{
|
||||||
Check( n, value.GetIntValue() != 0 );
|
Check( n, value.IsChecked() );
|
||||||
|
|
||||||
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId() );
|
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId() );
|
||||||
event.SetInt( n );
|
event.SetInt( n );
|
||||||
|
@@ -388,4 +388,20 @@ void wxListBox::HandleLineEvent( unsigned int n, bool doubleClick )
|
|||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // wxUSE_LISTBOX
|
#endif // wxUSE_LISTBOX
|
||||||
|
Reference in New Issue
Block a user