forked from mia/Aegisub
Remove the SubsEditBox from the context in favor of the SubsEditTextCtrl as it was the only public member of SubsEditBox
Originally committed to SVN as r5595.
This commit is contained in:
parent
d022d2ae56
commit
1f095b0a01
11 changed files with 20 additions and 27 deletions
|
@ -57,7 +57,6 @@
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "frame_main.h"
|
#include "frame_main.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "subs_edit_box.h"
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "video_context.h"
|
#include "video_context.h"
|
||||||
#include "video_slider.h"
|
#include "video_slider.h"
|
||||||
|
|
|
@ -50,7 +50,6 @@
|
||||||
#include "../ass_file.h"
|
#include "../ass_file.h"
|
||||||
#include "../dialog_search_replace.h"
|
#include "../dialog_search_replace.h"
|
||||||
#include "../include/aegisub/context.h"
|
#include "../include/aegisub/context.h"
|
||||||
#include "../subs_edit_box.h"
|
|
||||||
#include "../subs_edit_ctrl.h"
|
#include "../subs_edit_ctrl.h"
|
||||||
#include "../subs_grid.h"
|
#include "../subs_grid.h"
|
||||||
#include "../video_context.h"
|
#include "../video_context.h"
|
||||||
|
@ -82,8 +81,8 @@ struct edit_line_copy : public validate_sel_nonempty {
|
||||||
STR_HELP("Copy subtitles.")
|
STR_HELP("Copy subtitles.")
|
||||||
|
|
||||||
void operator()(agi::Context *c) {
|
void operator()(agi::Context *c) {
|
||||||
if (c->parent->FindFocus() == c->editBox->TextEdit) {
|
if (c->parent->FindFocus() == c->editBox) {
|
||||||
c->editBox->TextEdit->Copy();
|
c->editBox->Copy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
c->subsGrid->CopyLines(c->subsGrid->GetSelection());
|
c->subsGrid->CopyLines(c->subsGrid->GetSelection());
|
||||||
|
@ -99,8 +98,8 @@ struct edit_line_cut: public validate_sel_nonempty {
|
||||||
STR_HELP("Cut subtitles.")
|
STR_HELP("Cut subtitles.")
|
||||||
|
|
||||||
void operator()(agi::Context *c) {
|
void operator()(agi::Context *c) {
|
||||||
if (c->parent->FindFocus() == c->editBox->TextEdit) {
|
if (c->parent->FindFocus() == c->editBox) {
|
||||||
c->editBox->TextEdit->Cut();
|
c->editBox->Cut();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
c->subsGrid->CutLines(c->subsGrid->GetSelection());
|
c->subsGrid->CutLines(c->subsGrid->GetSelection());
|
||||||
|
@ -251,8 +250,8 @@ struct edit_line_paste : public Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator()(agi::Context *c) {
|
void operator()(agi::Context *c) {
|
||||||
if (c->parent->FindFocus() == c->editBox->TextEdit) {
|
if (c->parent->FindFocus() == c->editBox) {
|
||||||
c->editBox->TextEdit->Paste();
|
c->editBox->Paste();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
c->subsGrid->PasteLines(c->subsGrid->GetFirstSelRow());
|
c->subsGrid->PasteLines(c->subsGrid->GetFirstSelRow());
|
||||||
|
|
|
@ -45,10 +45,9 @@
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
|
||||||
#include "../include/aegisub/context.h"
|
#include "../include/aegisub/context.h"
|
||||||
#include "../video_context.h"
|
|
||||||
#include "../main.h"
|
|
||||||
#include "../compat.h"
|
#include "../compat.h"
|
||||||
#include "../subs_edit_box.h"
|
#include "../main.h"
|
||||||
|
#include "../video_context.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
using cmd::Command;
|
using cmd::Command;
|
||||||
|
|
|
@ -50,7 +50,6 @@
|
||||||
#include "frame_main.h"
|
#include "frame_main.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "selection_controller.h"
|
#include "selection_controller.h"
|
||||||
#include "subs_edit_box.h"
|
|
||||||
#include "subs_edit_ctrl.h"
|
#include "subs_edit_ctrl.h"
|
||||||
#include "subs_grid.h"
|
#include "subs_grid.h"
|
||||||
#include "video_display.h"
|
#include "video_display.h"
|
||||||
|
@ -454,7 +453,7 @@ void SearchReplaceEngine::ReplaceNext(bool DoReplace) {
|
||||||
context->subsGrid->MakeCellVisible(curLine,0);
|
context->subsGrid->MakeCellVisible(curLine,0);
|
||||||
if (field == 0) {
|
if (field == 0) {
|
||||||
context->subsGrid->SetActiveLine(context->subsGrid->GetDialogue(curLine));
|
context->subsGrid->SetActiveLine(context->subsGrid->GetDialogue(curLine));
|
||||||
context->editBox->TextEdit->SetSelectionU(pos,pos+replaceLen);
|
context->editBox->SetSelectionU(pos,pos+replaceLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update video
|
// Update video
|
||||||
|
|
|
@ -36,11 +36,11 @@
|
||||||
#include "ass_file.h"
|
#include "ass_file.h"
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "help_button.h"
|
#include "help_button.h"
|
||||||
#include "libresrc/libresrc.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "include/aegisub/context.h"
|
#include "include/aegisub/context.h"
|
||||||
#include "include/aegisub/spellchecker.h"
|
#include "include/aegisub/spellchecker.h"
|
||||||
#include "subs_edit_box.h"
|
#include "libresrc/libresrc.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "selection_controller.h"
|
||||||
#include "subs_edit_ctrl.h"
|
#include "subs_edit_ctrl.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ void DialogSpellChecker::OnClose(wxCommandEvent&) {
|
||||||
|
|
||||||
bool DialogSpellChecker::FindNext() {
|
bool DialogSpellChecker::FindNext() {
|
||||||
AssDialogue *active_line = context->selectionController->GetActiveLine();
|
AssDialogue *active_line = context->selectionController->GetActiveLine();
|
||||||
int start_pos = context->editBox->TextEdit->GetReverseUnicodePosition(context->editBox->TextEdit->GetCurrentPos());
|
int start_pos = context->editBox->GetReverseUnicodePosition(context->editBox->GetCurrentPos());
|
||||||
int commit_id = -1;
|
int commit_id = -1;
|
||||||
|
|
||||||
if (CheckLine(active_line, start_pos, &commit_id))
|
if (CheckLine(active_line, start_pos, &commit_id))
|
||||||
|
@ -266,7 +266,7 @@ void DialogSpellChecker::Replace() {
|
||||||
if (active_line->Text.Mid(word_start, word_end - word_start) == orig_word->GetValue()) {
|
if (active_line->Text.Mid(word_start, word_end - word_start) == orig_word->GetValue()) {
|
||||||
active_line->Text = active_line->Text.Left(word_start) + replace_word->GetValue() + active_line->Text.Mid(word_end);
|
active_line->Text = active_line->Text.Left(word_start) + replace_word->GetValue() + active_line->Text.Mid(word_end);
|
||||||
context->ass->Commit(_("spell check replace"), AssFile::COMMIT_DIAG_TEXT);
|
context->ass->Commit(_("spell check replace"), AssFile::COMMIT_DIAG_TEXT);
|
||||||
context->editBox->TextEdit->SetCurrentPos(context->editBox->TextEdit->GetUnicodePosition(word_start + replace_word->GetValue().size()));
|
context->editBox->SetCurrentPos(context->editBox->GetUnicodePosition(word_start + replace_word->GetValue().size()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,8 +278,8 @@ void DialogSpellChecker::SetWord(wxString const& word) {
|
||||||
suggest_list->Clear();
|
suggest_list->Clear();
|
||||||
suggest_list->Append(suggestions);
|
suggest_list->Append(suggestions);
|
||||||
|
|
||||||
context->editBox->TextEdit->SetSelectionU(word_start, word_end);
|
context->editBox->SetSelectionU(word_start, word_end);
|
||||||
context->editBox->TextEdit->SetCurrentPos(context->editBox->TextEdit->GetUnicodePosition(word_end));
|
context->editBox->SetCurrentPos(context->editBox->GetUnicodePosition(word_end));
|
||||||
|
|
||||||
add_button->Enable(spellchecker->CanAddWord(word));
|
add_button->Enable(spellchecker->CanAddWord(word));
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,7 +274,8 @@ void FrameMain::InitContents() {
|
||||||
audioSash->SetMinimumSizeY(audioBox->GetSize().GetHeight());
|
audioSash->SetMinimumSizeY(audioBox->GetSize().GetHeight());
|
||||||
|
|
||||||
StartupLog("Create subtitle editing box");
|
StartupLog("Create subtitle editing box");
|
||||||
context->editBox = EditBox = new SubsEditBox(Panel, context.get());
|
EditBox = new SubsEditBox(Panel, context.get());
|
||||||
|
context->editBox = EditBox->TextEdit;
|
||||||
|
|
||||||
StartupLog("Arrange main sizers");
|
StartupLog("Arrange main sizers");
|
||||||
ToolsSizer = new wxBoxSizer(wxVERTICAL);
|
ToolsSizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
|
@ -6,7 +6,7 @@ class DialogDetachedVideo;
|
||||||
class DialogStyling;
|
class DialogStyling;
|
||||||
class DialogTranslation;
|
class DialogTranslation;
|
||||||
template<class T> class SelectionController;
|
template<class T> class SelectionController;
|
||||||
class SubsEditBox;
|
class SubsTextEditCtrl;
|
||||||
class SubtitlesGrid;
|
class SubtitlesGrid;
|
||||||
class VideoBox;
|
class VideoBox;
|
||||||
class VideoContext;
|
class VideoContext;
|
||||||
|
@ -34,7 +34,7 @@ struct Context {
|
||||||
DialogDetachedVideo *detachedVideo;
|
DialogDetachedVideo *detachedVideo;
|
||||||
DialogStyling *stylingAssistant;
|
DialogStyling *stylingAssistant;
|
||||||
DialogTranslation *translationAssistant;
|
DialogTranslation *translationAssistant;
|
||||||
SubsEditBox *editBox;
|
SubsTextEditCtrl *editBox;
|
||||||
SubtitlesGrid *subsGrid;
|
SubtitlesGrid *subsGrid;
|
||||||
VideoBox *videoBox;
|
VideoBox *videoBox;
|
||||||
};
|
};
|
||||||
|
|
|
@ -60,7 +60,6 @@
|
||||||
#include "dialog_paste_over.h"
|
#include "dialog_paste_over.h"
|
||||||
#include "frame_main.h"
|
#include "frame_main.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "subs_edit_box.h"
|
|
||||||
#include "subs_grid.h"
|
#include "subs_grid.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "video_context.h"
|
#include "video_context.h"
|
||||||
|
|
|
@ -53,7 +53,6 @@
|
||||||
#include "libresrc/libresrc.h"
|
#include "libresrc/libresrc.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "selection_controller.h"
|
#include "selection_controller.h"
|
||||||
#include "subs_edit_box.h"
|
|
||||||
#include "subs_grid.h"
|
#include "subs_grid.h"
|
||||||
#include "toggle_bitmap.h"
|
#include "toggle_bitmap.h"
|
||||||
#include "tooltip_manager.h"
|
#include "tooltip_manager.h"
|
||||||
|
|
|
@ -71,7 +71,6 @@
|
||||||
#include "mkv_wrap.h"
|
#include "mkv_wrap.h"
|
||||||
#include "selection_controller.h"
|
#include "selection_controller.h"
|
||||||
#include "standard_paths.h"
|
#include "standard_paths.h"
|
||||||
#include "subs_edit_box.h"
|
|
||||||
#include "threaded_frame_source.h"
|
#include "threaded_frame_source.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "video_context.h"
|
#include "video_context.h"
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
#include "ass_time.h"
|
#include "ass_time.h"
|
||||||
#include "include/aegisub/context.h"
|
#include "include/aegisub/context.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "subs_edit_box.h"
|
|
||||||
#include "subs_grid.h"
|
#include "subs_grid.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "video_context.h"
|
#include "video_context.h"
|
||||||
|
|
Loading…
Reference in a new issue