Fixed two crashes

Originally committed to SVN as r1336.
This commit is contained in:
Rodrigo Braz Monteiro 2007-07-03 01:09:39 +00:00
parent 16786725c3
commit 1125cbb5a9
3 changed files with 4 additions and 2 deletions

View file

@ -2095,7 +2095,7 @@ void AudioDisplay::ChangeLine(int delta) {
int next = line_n+delta; int next = line_n+delta;
if (next == -1) next = 0; if (next == -1) next = 0;
if (next == grid->GetRows()) next = grid->GetRows() - 1; if (next == grid->GetRows()) next = grid->GetRows() - 1;
wxLogDebug(_T("AudioDisplay::ChangeLine: next=%s"), next); wxLogDebug(_T("AudioDisplay::ChangeLine: next=%i"), next);
// Set stuff // Set stuff
NeedCommit = false; NeedCommit = false;

View file

@ -500,6 +500,7 @@ void FrameMain::InitContents() {
// Set display // Set display
SetDisplayMode(0,0); SetDisplayMode(0,0);
Layout(); Layout();
EditBox->TextEdit->SetFocus();
} }

View file

@ -371,7 +371,8 @@ void AegisubApp::OnMouseWheel(wxMouseEvent &event) {
wxPoint pt; wxPoint pt;
wxWindow *target = wxFindWindowAtPointer(pt); wxWindow *target = wxFindWindowAtPointer(pt);
if (target == frame->audioBox->audioDisplay || target == frame->SubsBox) { if (target == frame->audioBox->audioDisplay || target == frame->SubsBox) {
target->AddPendingEvent(event); if (target->IsShownOnScreen()) target->AddPendingEvent(event);
else event.Skip();
} }
else event.Skip(); else event.Skip();
} }