Ensure that the static box sizers in the translation assistant are created before the contained controls.

This should fix #1171.

Originally committed to SVN as r5387.
This commit is contained in:
Niels Martin Hansen 2011-04-27 19:10:28 +00:00
parent df7ef0e224
commit ec24aae109
1 changed files with 5 additions and 3 deletions

View File

@ -71,6 +71,11 @@ DialogTranslation::DialogTranslation (wxWindow *parent,AssFile *_subs,SubtitlesG
audio = VideoContext::Get()->audio;
video = video->Get();
// Create sizers (especially StaticBoxSizers) first to get control Z order right
wxSizer *TranslationSizer = new wxBoxSizer(wxVERTICAL);
wxSizer *OriginalTransSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Original"));
wxSizer *TranslatedSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Translation"));
// Translation controls
OrigText = new ScintillaTextCtrl(this,TEXT_ORIGINAL,_T(""),wxDefaultPosition,wxSize(320,80));
OrigText->SetWrapMode(wxSTC_WRAP_WORD);
@ -85,9 +90,6 @@ DialogTranslation::DialogTranslation (wxWindow *parent,AssFile *_subs,SubtitlesG
TransText->SetFocus();
// Translation box
wxSizer *TranslationSizer = new wxBoxSizer(wxVERTICAL);
wxSizer *OriginalTransSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Original"));
wxSizer *TranslatedSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Translation"));
LineCount = new wxStaticText(this,-1,_("Current line: ?"));
OriginalTransSizer->Add(LineCount,0,wxBOTTOM,5);
OriginalTransSizer->Add(OrigText,1,wxEXPAND,0);