Update the size of the karaoke syllable bar when the window is resized. Updates #1516.

This commit is contained in:
Thomas Goyne 2012-10-01 15:21:18 -07:00
parent 1b089795f1
commit b020322a3a
2 changed files with 7 additions and 1 deletions

View File

@ -95,7 +95,7 @@ AudioKaraoke::AudioKaraoke(wxWindow *parent, agi::Context *c)
split_font.SetFaceName(OPT_GET("Audio/Karaoke/Font Face")->GetString()); split_font.SetFaceName(OPT_GET("Audio/Karaoke/Font Face")->GetString());
split_font.SetPointSize(OPT_GET("Audio/Karaoke/Font Size")->GetInt()); split_font.SetPointSize(OPT_GET("Audio/Karaoke/Font Size")->GetInt());
Bind(wxEVT_SIZE, bind(&AudioKaraoke::Refresh, this, false, (const wxRect*)0)); split_area->Bind(wxEVT_SIZE, &AudioKaraoke::OnSize, this);
split_area->Bind(wxEVT_PAINT, &AudioKaraoke::OnPaint, this); split_area->Bind(wxEVT_PAINT, &AudioKaraoke::OnPaint, this);
split_area->Bind(wxEVT_LEFT_DOWN, &AudioKaraoke::OnMouse, this); split_area->Bind(wxEVT_LEFT_DOWN, &AudioKaraoke::OnMouse, this);
split_area->Bind(wxEVT_LEFT_UP, &AudioKaraoke::OnMouse, this); split_area->Bind(wxEVT_LEFT_UP, &AudioKaraoke::OnMouse, this);
@ -153,6 +153,11 @@ void AudioKaraoke::SetEnabled(bool en) {
} }
} }
void AudioKaraoke::OnSize(wxSizeEvent &evt) {
RenderText();
Refresh(false);
}
void AudioKaraoke::OnPaint(wxPaintEvent &) { void AudioKaraoke::OnPaint(wxPaintEvent &) {
int w, h; int w, h;
split_area->GetClientSize(&w, &h); split_area->GetClientSize(&w, &h);

View File

@ -138,6 +138,7 @@ class AudioKaraoke : public wxWindow, private SelectionListener<AssDialogue> {
void OnFileChanged(int type); void OnFileChanged(int type);
void OnMouse(wxMouseEvent &event); void OnMouse(wxMouseEvent &event);
void OnPaint(wxPaintEvent &event); void OnPaint(wxPaintEvent &event);
void OnSize(wxSizeEvent &event);
void OnSelectedSetChanged(Selection const&, Selection const&) { } void OnSelectedSetChanged(Selection const&, Selection const&) { }
void OnAudioOpened(); void OnAudioOpened();
void OnAudioClosed(); void OnAudioClosed();