Use CmdDown in mouse events instead of ControlDown so Mac users can
multi-select with shift and cmd like they are used to. Other platforms are not affected. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1980,6 +1980,14 @@ public:
|
|||||||
bool MetaDown() { return m_meta; }
|
bool MetaDown() { return m_meta; }
|
||||||
bool ShiftDown() { return m_shift; }
|
bool ShiftDown() { return m_shift; }
|
||||||
bool AltDown() { return m_alt; }
|
bool AltDown() { return m_alt; }
|
||||||
|
bool CmdDown()
|
||||||
|
{
|
||||||
|
#if defined(__WXMAC__) || defined(__WXCOCOA__)
|
||||||
|
return MetaDown();
|
||||||
|
#else
|
||||||
|
return ControlDown();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_row;
|
int m_row;
|
||||||
@@ -2014,6 +2022,14 @@ public:
|
|||||||
bool MetaDown() { return m_meta; }
|
bool MetaDown() { return m_meta; }
|
||||||
bool ShiftDown() { return m_shift; }
|
bool ShiftDown() { return m_shift; }
|
||||||
bool AltDown() { return m_alt; }
|
bool AltDown() { return m_alt; }
|
||||||
|
bool CmdDown()
|
||||||
|
{
|
||||||
|
#if defined(__WXMAC__) || defined(__WXCOCOA__)
|
||||||
|
return MetaDown();
|
||||||
|
#else
|
||||||
|
return ControlDown();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_rowOrCol;
|
int m_rowOrCol;
|
||||||
@@ -2061,6 +2077,14 @@ public:
|
|||||||
bool MetaDown() { return m_meta; }
|
bool MetaDown() { return m_meta; }
|
||||||
bool ShiftDown() { return m_shift; }
|
bool ShiftDown() { return m_shift; }
|
||||||
bool AltDown() { return m_alt; }
|
bool AltDown() { return m_alt; }
|
||||||
|
bool CmdDown()
|
||||||
|
{
|
||||||
|
#if defined(__WXMAC__) || defined(__WXCOCOA__)
|
||||||
|
return MetaDown();
|
||||||
|
#else
|
||||||
|
return ControlDown();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxGridCellCoords m_topLeft;
|
wxGridCellCoords m_topLeft;
|
||||||
|
@@ -5138,7 +5138,7 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event )
|
|||||||
if ( row >= 0 &&
|
if ( row >= 0 &&
|
||||||
!SendEvent( wxEVT_GRID_LABEL_LEFT_CLICK, row, -1, event ) )
|
!SendEvent( wxEVT_GRID_LABEL_LEFT_CLICK, row, -1, event ) )
|
||||||
{
|
{
|
||||||
if ( !event.ShiftDown() && !event.ControlDown() )
|
if ( !event.ShiftDown() && !event.CmdDown() )
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
if ( m_selection )
|
if ( m_selection )
|
||||||
{
|
{
|
||||||
@@ -5356,7 +5356,7 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event )
|
|||||||
if ( col >= 0 &&
|
if ( col >= 0 &&
|
||||||
!SendEvent( wxEVT_GRID_LABEL_LEFT_CLICK, -1, col, event ) )
|
!SendEvent( wxEVT_GRID_LABEL_LEFT_CLICK, -1, col, event ) )
|
||||||
{
|
{
|
||||||
if ( !event.ShiftDown() && !event.ControlDown() )
|
if ( !event.ShiftDown() && !event.CmdDown() )
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
if ( m_selection )
|
if ( m_selection )
|
||||||
{
|
{
|
||||||
@@ -5634,7 +5634,7 @@ void wxGrid::ProcessGridCellMouseEvent( wxMouseEvent& event )
|
|||||||
|
|
||||||
if ( coords != wxGridNoCellCoords )
|
if ( coords != wxGridNoCellCoords )
|
||||||
{
|
{
|
||||||
if ( event.ControlDown() )
|
if ( event.CmdDown() )
|
||||||
{
|
{
|
||||||
if ( m_selectingKeyboard == wxGridNoCellCoords)
|
if ( m_selectingKeyboard == wxGridNoCellCoords)
|
||||||
m_selectingKeyboard = coords;
|
m_selectingKeyboard = coords;
|
||||||
@@ -5737,7 +5737,7 @@ void wxGrid::ProcessGridCellMouseEvent( wxMouseEvent& event )
|
|||||||
coords.GetCol(),
|
coords.GetCol(),
|
||||||
event ) )
|
event ) )
|
||||||
{
|
{
|
||||||
if ( !event.ControlDown() )
|
if ( !event.CmdDown() )
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
if ( event.ShiftDown() )
|
if ( event.ShiftDown() )
|
||||||
{
|
{
|
||||||
@@ -5759,7 +5759,7 @@ void wxGrid::ProcessGridCellMouseEvent( wxMouseEvent& event )
|
|||||||
DisableCellEditControl();
|
DisableCellEditControl();
|
||||||
MakeCellVisible( coords );
|
MakeCellVisible( coords );
|
||||||
|
|
||||||
if ( event.ControlDown() )
|
if ( event.CmdDown() )
|
||||||
{
|
{
|
||||||
if ( m_selection )
|
if ( m_selection )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user