1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 08:38:39 +02:00

Fix wx3 related crash and remove wx2 ifdef'd code

This commit is contained in:
Leland Lucius 2015-08-19 00:37:03 -05:00
parent 9bc9b994ab
commit a4802f48b1

View File

@ -1232,11 +1232,7 @@ KeyView::OnSetFocus(wxFocusEvent & event)
// will also refresh the visual (highlighted) state. // will also refresh the visual (highlighted) state.
if (GetSelection() != wxNOT_FOUND) if (GetSelection() != wxNOT_FOUND)
{ {
#if wxCHECK_VERSION(3,0,0)
RefreshRow(GetSelection()); RefreshRow(GetSelection());
#else
RefreshLine(GetSelection());
#endif
} }
#if wxUSE_ACCESSIBILITY #if wxUSE_ACCESSIBILITY
@ -1257,11 +1253,7 @@ KeyView::OnKillFocus(wxFocusEvent & event)
// Refresh the selected line to adjust visual highlighting. // Refresh the selected line to adjust visual highlighting.
if (GetSelection() != wxNOT_FOUND) if (GetSelection() != wxNOT_FOUND)
{ {
#if wxCHECK_VERSION(3,0,0)
RefreshRow(GetSelection()); RefreshRow(GetSelection());
#else
RefreshLine(GetSelection());
#endif
} }
} }
@ -1336,11 +1328,7 @@ KeyView::OnKeyDown(wxKeyEvent & event)
RefreshLines(); RefreshLines();
// Reset the original top line // Reset the original top line
#if wxCHECK_VERSION(3,0,0) ScrollToRow(topline);
ScrollToRow(topline);
#else
ScrollToLine(topline);
#endif
// And make sure current line is still selected // And make sure current line is still selected
SelectNode(LineToIndex(line)); SelectNode(LineToIndex(line));
@ -1404,11 +1392,7 @@ KeyView::OnKeyDown(wxKeyEvent & event)
RefreshLines(); RefreshLines();
// Reset the original top line // Reset the original top line
#if wxCHECK_VERSION(3,0,0) ScrollToRow(topline);
ScrollToRow(topline);
#else
ScrollToLine(topline);
#endif
// And make sure current line is still selected // And make sure current line is still selected
SelectNode(LineToIndex(line)); SelectNode(LineToIndex(line));
@ -1529,7 +1513,7 @@ KeyView::OnLeftDown(wxMouseEvent & event)
wxPoint pos = event.GetPosition(); wxPoint pos = event.GetPosition();
// And see if it was on a line within the view // And see if it was on a line within the view
int line = HitTest(pos); int line = VirtualHitTest(pos.y);
// It was on a line // It was on a line
if (line != wxNOT_FOUND) if (line != wxNOT_FOUND)
@ -1550,11 +1534,7 @@ KeyView::OnLeftDown(wxMouseEvent & event)
RefreshLines(); RefreshLines();
// Reset the original top line // Reset the original top line
#if wxCHECK_VERSION(3,0,0) ScrollToRow(topline);
ScrollToRow(topline);
#else
ScrollToLine(topline);
#endif
// And make sure current line is still selected // And make sure current line is still selected
SelectNode(LineToIndex(line)); SelectNode(LineToIndex(line));
@ -1780,11 +1760,7 @@ KeyView::GetLineHeight(int line)
return 0; return 0;
} }
#if wxCHECK_VERSION(3,0,0)
return OnGetRowHeight(line); return OnGetRowHeight(line);
#else
return OnGetLineHeight(line);
#endif
} }
// //