mirror of https://github.com/odrling/Aegisub
Kill BaseGrid::SelectVisible
Originally committed to SVN as r5600.
This commit is contained in:
parent
11c40188c2
commit
683dd6c0a9
|
@ -324,25 +324,6 @@ void BaseGrid::SelectRow(int row, bool addToSelected, bool select) {
|
|||
RefreshRect(wxRect(0, (row + 1 - yPos) * lineHeight, w, lineHeight), false);
|
||||
}
|
||||
|
||||
void BaseGrid::SelectVisible() {
|
||||
Selection new_selection;
|
||||
|
||||
int rows = GetRows();
|
||||
bool selectedOne = false;
|
||||
for (int i=0;i<rows;i++) {
|
||||
AssDialogue *diag = GetDialogue(i);
|
||||
if (IsDisplayed(diag)) {
|
||||
if (!selectedOne) {
|
||||
MakeCellVisible(i,0);
|
||||
selectedOne = true;
|
||||
}
|
||||
new_selection.insert(diag);
|
||||
}
|
||||
}
|
||||
|
||||
SetSelectedSet(new_selection);
|
||||
}
|
||||
|
||||
int BaseGrid::GetFirstSelRow() const {
|
||||
if (selection.empty()) return -1;
|
||||
|
||||
|
|
|
@ -142,7 +142,6 @@ public:
|
|||
bool IsDisplayed(const AssDialogue *line) const;
|
||||
void SelectRow(int row, bool addToSelected = false, bool select=true);
|
||||
int GetFirstSelRow() const;
|
||||
void SelectVisible();
|
||||
wxArrayInt GetSelection() const;
|
||||
|
||||
void ClearMaps();
|
||||
|
|
|
@ -394,8 +394,25 @@ struct subtitle_select_visible : public Command {
|
|||
CMD_TYPE(COMMAND_VALIDATE)
|
||||
|
||||
void operator()(agi::Context *c) {
|
||||
if (!c->videoController->IsLoaded()) return;
|
||||
c->videoController->Stop();
|
||||
c->subsGrid->SelectVisible();
|
||||
|
||||
SubtitleSelectionController::Selection new_selection;
|
||||
int frame = c->videoController->GetFrameN();
|
||||
|
||||
for (entryIter it = c->ass->Line.begin(); it != c->ass->Line.end(); ++it) {
|
||||
AssDialogue *diag = dynamic_cast<AssDialogue*>(*it);
|
||||
if (diag &&
|
||||
c->videoController->FrameAtTime(diag->Start.GetMS(), agi::vfr::START) <= frame &&
|
||||
c->videoController->FrameAtTime(diag->End.GetMS(), agi::vfr::END) >= frame)
|
||||
{
|
||||
if (new_selection.empty())
|
||||
c->selectionController->SetActiveLine(diag);
|
||||
new_selection.insert(diag);
|
||||
}
|
||||
}
|
||||
|
||||
c->selectionController->SetSelectedSet(new_selection);
|
||||
}
|
||||
|
||||
bool Validate(agi::Context *c) {
|
||||
|
|
Loading…
Reference in New Issue