Rearrange BaseGrid's data members

This commit is contained in:
Thomas Goyne 2014-04-19 07:03:36 -07:00
parent c3e024954c
commit 2387b31cee
2 changed files with 10 additions and 11 deletions

View File

@ -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);

View File

@ -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<std::unique_ptr<GridColumn>> columns;
std::vector<int> column_widths;
std::vector<int> 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<AssDialogue*> 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();