diff --git a/src/base_grid.cpp b/src/base_grid.cpp index 1c0aff237..d0cf96f7a 100644 --- a/src/base_grid.cpp +++ b/src/base_grid.cpp @@ -67,9 +67,9 @@ enum { BaseGrid::BaseGrid(wxWindow* parent, agi::Context *context) : wxWindow(parent, -1, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS | wxSUNKEN_BORDER) , scrollBar(new wxScrollBar(this, GRID_SCROLLBAR, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL)) +, context(context) , columns(GetGridColumns()) , seek_listener(context->videoController->AddSeekListener([&] { Refresh(false); })) -, context(context) { scrollBar->SetScrollbar(0,10,100,10); diff --git a/src/base_grid.h b/src/base_grid.h index 726ee726a..f6b09c746 100644 --- a/src/base_grid.h +++ b/src/base_grid.h @@ -49,6 +49,15 @@ class BaseGrid final : public wxWindow { wxScrollBar *scrollBar; ///< The grid's scrollbar bool byFrame = false; ///< Should times be displayed as frame numbers + /// Row from which the selection shrinks/grows from when selecting via the + /// keyboard, shift-clicking or dragging + int extendRow = -1; + + /// First row that is visible at the current scroll position + int yPos = 0; + + agi::Context *context; ///< Associated project context + std::vector> columns; std::vector column_widths; std::vector column_header_widths; @@ -67,10 +76,6 @@ class BaseGrid final : public wxWindow { wxBrush LeftCol; } row_colors; - /// Row from which the selection shrinks/grows from when selecting via the - /// keyboard, shift-clicking or dragging - int extendRow = -1; - std::vector index_line_map; ///< Row number -> dialogue line /// Connection for video seek event. Stored explicitly so that it can be @@ -96,17 +101,11 @@ class BaseGrid final : public wxWindow { void ScrollTo(int y); - int yPos = 0; - void AdjustScrollbar(); void SetColumnWidths(); bool IsDisplayed(const AssDialogue *line) const; - agi::Context *context; ///< Current project context - - void ClearMaps(); - /// @brief Update the row <-> AssDialogue mappings void UpdateMaps(); void UpdateStyle();