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);
|
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 {
|
int BaseGrid::GetFirstSelRow() const {
|
||||||
if (selection.empty()) return -1;
|
if (selection.empty()) return -1;
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,6 @@ public:
|
||||||
bool IsDisplayed(const AssDialogue *line) const;
|
bool IsDisplayed(const AssDialogue *line) const;
|
||||||
void SelectRow(int row, bool addToSelected = false, bool select=true);
|
void SelectRow(int row, bool addToSelected = false, bool select=true);
|
||||||
int GetFirstSelRow() const;
|
int GetFirstSelRow() const;
|
||||||
void SelectVisible();
|
|
||||||
wxArrayInt GetSelection() const;
|
wxArrayInt GetSelection() const;
|
||||||
|
|
||||||
void ClearMaps();
|
void ClearMaps();
|
||||||
|
|
|
@ -394,8 +394,25 @@ struct subtitle_select_visible : public Command {
|
||||||
CMD_TYPE(COMMAND_VALIDATE)
|
CMD_TYPE(COMMAND_VALIDATE)
|
||||||
|
|
||||||
void operator()(agi::Context *c) {
|
void operator()(agi::Context *c) {
|
||||||
|
if (!c->videoController->IsLoaded()) return;
|
||||||
c->videoController->Stop();
|
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) {
|
bool Validate(agi::Context *c) {
|
||||||
|
|
Loading…
Reference in New Issue