1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 15:49:41 +02:00

ExtImport: don't let user select multiple rules at once

While selection with Shift+Up/Down is still possible, it
will only last until Shift is released.
This commit is contained in:
LRN1986 2010-04-24 12:29:14 +00:00
parent fce76e9f46
commit 6151d3d4e2
2 changed files with 10 additions and 5 deletions

View File

@ -58,7 +58,7 @@ END_EVENT_TABLE()
ExtImportPrefs::ExtImportPrefs(wxWindow * parent)
: PrefsPanel(parent, _("Extended Import")), RuleTable(NULL),
PluginList(NULL), mCreateTable (false), mDragFocus (NULL),
last_selected (-1), mFakeKeyEvent (false)
last_selected (-1), mFakeKeyEvent (false), mStopRecursiveSelection (false)
{
dragtext1 = new wxTextDataObject(wxT(""));
dragtext2 = new wxTextDataObject(wxT(""));
@ -369,21 +369,25 @@ void ExtImportPrefs::DoOnRuleTableKeyDown (int keycode)
void ExtImportPrefs::OnRuleTableSelect (wxGridEvent& event)
{
int toprow;
if (!event.Selecting())
event.Skip();
if (!event.Selecting() || mStopRecursiveSelection)
return;
toprow = event.GetRow();
DoOnRuleTableSelect (toprow);
event.Skip();
}
void ExtImportPrefs::OnRuleTableSelectRange (wxGridRangeSelectEvent& event)
{
int toprow;
if (!event.Selecting())
event.Skip();
if (!event.Selecting() || mStopRecursiveSelection)
return;
toprow = event.GetTopRow();
DoOnRuleTableSelect (toprow);
event.Skip();
mStopRecursiveSelection = true;
RuleTable->SelectRow (toprow);
mStopRecursiveSelection = false;
RuleTable->SetGridCursor (toprow, 0);
}
void ExtImportPrefs::DoOnRuleTableSelect (int toprow)

View File

@ -93,6 +93,7 @@ class ExtImportPrefs:public PrefsPanel
bool mCreateTable;
wxWindow *mDragFocus;
bool mFakeKeyEvent;
bool mStopRecursiveSelection;
int last_selected;