mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-05 06:39:26 +02:00
Bug 2083 - Labels Editor has confusing selection interface - can cause wrong labels to be deleted
This commit is contained in:
parent
f59ba86faf
commit
e5bb95d6f2
@ -130,6 +130,7 @@ void LabelDialog::PopulateLabels()
|
|||||||
// Build the initial (empty) grid
|
// Build the initial (empty) grid
|
||||||
mGrid->CreateGrid(0, Col_Max, wxGrid::wxGridSelectRows);
|
mGrid->CreateGrid(0, Col_Max, wxGrid::wxGridSelectRows);
|
||||||
mGrid->SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_CENTER);
|
mGrid->SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_CENTER);
|
||||||
|
mGrid->SetRowLabelSize(0);
|
||||||
|
|
||||||
size_t ii = 0;
|
size_t ii = 0;
|
||||||
for ( const auto &label : {
|
for ( const auto &label : {
|
||||||
|
@ -468,6 +468,7 @@ BEGIN_EVENT_TABLE(Grid, wxGrid)
|
|||||||
EVT_SET_FOCUS(Grid::OnSetFocus)
|
EVT_SET_FOCUS(Grid::OnSetFocus)
|
||||||
EVT_KEY_DOWN(Grid::OnKeyDown)
|
EVT_KEY_DOWN(Grid::OnKeyDown)
|
||||||
EVT_GRID_SELECT_CELL(Grid::OnSelectCell)
|
EVT_GRID_SELECT_CELL(Grid::OnSelectCell)
|
||||||
|
EVT_GRID_EDITOR_SHOWN(Grid::OnEditorShown)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
Grid::Grid(wxWindow *parent,
|
Grid::Grid(wxWindow *parent,
|
||||||
@ -500,6 +501,8 @@ Grid::Grid(wxWindow *parent,
|
|||||||
safenew wxGridCellStringRenderer,
|
safenew wxGridCellStringRenderer,
|
||||||
safenew ChoiceEditor);
|
safenew ChoiceEditor);
|
||||||
|
|
||||||
|
// Bug #2803:
|
||||||
|
// Ensure selection doesn't show up.
|
||||||
SetSelectionForeground(GetDefaultCellTextColour());
|
SetSelectionForeground(GetDefaultCellTextColour());
|
||||||
SetSelectionBackground(GetDefaultCellBackgroundColour());
|
SetSelectionBackground(GetDefaultCellBackgroundColour());
|
||||||
}
|
}
|
||||||
@ -534,6 +537,15 @@ void Grid::OnSelectCell(wxGridEvent &event)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Grid::OnEditorShown(wxGridEvent &event)
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
|
||||||
|
// Bug #2803 (comment 7):
|
||||||
|
// Select row whenever an editor is displayed
|
||||||
|
SelectRow(GetGridCursorRow());
|
||||||
|
}
|
||||||
|
|
||||||
void Grid::OnKeyDown(wxKeyEvent &event)
|
void Grid::OnKeyDown(wxKeyEvent &event)
|
||||||
{
|
{
|
||||||
auto keyCode = event.GetKeyCode();
|
auto keyCode = event.GetKeyCode();
|
||||||
|
@ -210,6 +210,7 @@ class Grid final : public wxGrid
|
|||||||
|
|
||||||
void OnSetFocus(wxFocusEvent &event);
|
void OnSetFocus(wxFocusEvent &event);
|
||||||
void OnSelectCell(wxGridEvent &event);
|
void OnSelectCell(wxGridEvent &event);
|
||||||
|
void OnEditorShown(wxGridEvent &event);
|
||||||
void OnKeyDown(wxKeyEvent &event);
|
void OnKeyDown(wxKeyEvent &event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user