Use the active line rather than first selected line in SubsEditBox

Originally committed to SVN as r5455.
This commit is contained in:
Thomas Goyne 2011-07-15 04:04:54 +00:00
parent 4d924b3f27
commit e6dc86212b
1 changed files with 3 additions and 9 deletions

View File

@ -631,16 +631,12 @@ void SubsEditBox::OnDurationChange(wxCommandEvent &) {
} }
void SubsEditBox::OnMarginLChange(wxCommandEvent &) { void SubsEditBox::OnMarginLChange(wxCommandEvent &) {
SetSelectedRows(std::mem_fun(&AssDialogue::SetMarginString<0>), MarginL->GetValue(), _("MarginL change")); SetSelectedRows(std::mem_fun(&AssDialogue::SetMarginString<0>), MarginL->GetValue(), _("MarginL change"));
AssDialogue *cur = c->subsGrid->GetDialogue(c->subsGrid->GetFirstSelRow()); if (line) MarginL->ChangeValue(line->GetMarginString(0, false));
if (cur)
MarginL->ChangeValue(cur->GetMarginString(0,false));
} }
void SubsEditBox::OnMarginRChange(wxCommandEvent &) { void SubsEditBox::OnMarginRChange(wxCommandEvent &) {
SetSelectedRows(std::mem_fun(&AssDialogue::SetMarginString<1>), MarginR->GetValue(), _("MarginR change")); SetSelectedRows(std::mem_fun(&AssDialogue::SetMarginString<1>), MarginR->GetValue(), _("MarginR change"));
AssDialogue *cur = c->subsGrid->GetDialogue(c->subsGrid->GetFirstSelRow()); if (line) MarginR->ChangeValue(line->GetMarginString(1, false));
if (cur)
MarginR->ChangeValue(cur->GetMarginString(1,false));
} }
static void set_margin_v(AssDialogue* diag, wxString value) { static void set_margin_v(AssDialogue* diag, wxString value) {
@ -650,9 +646,7 @@ static void set_margin_v(AssDialogue* diag, wxString value) {
void SubsEditBox::OnMarginVChange(wxCommandEvent &) { void SubsEditBox::OnMarginVChange(wxCommandEvent &) {
SetSelectedRows(set_margin_v, MarginV->GetValue(), _("MarginV change")); SetSelectedRows(set_margin_v, MarginV->GetValue(), _("MarginV change"));
AssDialogue *cur = c->subsGrid->GetDialogue(c->subsGrid->GetFirstSelRow()); if (line) MarginV->ChangeValue(line->GetMarginString(2, false));
if (cur)
MarginV->ChangeValue(cur->GetMarginString(2,false));
} }
void SubsEditBox::OnEffectChange(wxCommandEvent &) { void SubsEditBox::OnEffectChange(wxCommandEvent &) {