mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 23:59:37 +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
|
||||
mGrid->CreateGrid(0, Col_Max, wxGrid::wxGridSelectRows);
|
||||
mGrid->SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_CENTER);
|
||||
mGrid->SetRowLabelSize(0);
|
||||
|
||||
size_t ii = 0;
|
||||
for ( const auto &label : {
|
||||
|
@ -468,6 +468,7 @@ BEGIN_EVENT_TABLE(Grid, wxGrid)
|
||||
EVT_SET_FOCUS(Grid::OnSetFocus)
|
||||
EVT_KEY_DOWN(Grid::OnKeyDown)
|
||||
EVT_GRID_SELECT_CELL(Grid::OnSelectCell)
|
||||
EVT_GRID_EDITOR_SHOWN(Grid::OnEditorShown)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
Grid::Grid(wxWindow *parent,
|
||||
@ -500,6 +501,8 @@ Grid::Grid(wxWindow *parent,
|
||||
safenew wxGridCellStringRenderer,
|
||||
safenew ChoiceEditor);
|
||||
|
||||
// Bug #2803:
|
||||
// Ensure selection doesn't show up.
|
||||
SetSelectionForeground(GetDefaultCellTextColour());
|
||||
SetSelectionBackground(GetDefaultCellBackgroundColour());
|
||||
}
|
||||
@ -534,6 +537,15 @@ void Grid::OnSelectCell(wxGridEvent &event)
|
||||
#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)
|
||||
{
|
||||
auto keyCode = event.GetKeyCode();
|
||||
|
@ -210,6 +210,7 @@ class Grid final : public wxGrid
|
||||
|
||||
void OnSetFocus(wxFocusEvent &event);
|
||||
void OnSelectCell(wxGridEvent &event);
|
||||
void OnEditorShown(wxGridEvent &event);
|
||||
void OnKeyDown(wxKeyEvent &event);
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user