26#include <wx/srchctrl.h>
40 {
return idx < m_worksheets.size() ? m_worksheets[idx] :
nullptr; }
54 void OnScroll(wxScrollWinEvent &event);
55 void OnToggleHorizontalSync(wxCommandEvent &event);
56 void OnToggleVerticalSync(wxCommandEvent &event);
57 void OnSearch(wxCommandEvent &event);
58 void OnSearchCancel(wxCommandEvent &event);
60 void OnSearchEnter(wxCommandEvent &event);
61 void OnFindNext(wxCommandEvent &event);
62 void OnFindPrev(wxCommandEvent &event);
64 void OnFocusSearch(wxCommandEvent &event);
71 void OnCopyCommand(wxCommandEvent &event);
73 void OnSelectAll(wxCommandEvent &event);
80 bool SearchPanes(
const wxString &query,
bool down,
bool incremental);
81 void OnDiffNext(wxCommandEvent &event);
82 void OnDiffPrev(wxCommandEvent &event);
87 int CurrentScrollY(
size_t idx)
const;
91 void SyncScrollFrom(
int src_idx,
int y_new_src);
93 std::vector<Worksheet *> m_worksheets;
94 std::vector<std::unique_ptr<Configuration>> m_worksheetConfigurations;
96 wxSearchCtrl *m_searchCtrl =
nullptr;
98 size_t m_searchPane = 0;
100 size_t m_activePane = 0;
101 int m_currentDiffIdx = -1;
102 bool m_syncing =
false;
103 bool m_syncHorizontal =
true;
104 bool m_syncVertical =
true;
106 void LoadFiles(
const wxArrayString &files);
112 std::vector<DiffEntry> m_diffEntries;
113 std::vector<int> m_lastScrollY;
117 bool IsDiffEntry(
const DiffEntry &e)
const;
122 void UpdateDiffNavUI();
123 void OnIdle(wxIdleEvent &event);
127 int FindAdjacentDiff(
int direction)
const;
130 void SetCurrentDiff(
int idx);
135 struct DiffMark {
int docY;
bool current; };
137 std::vector<DiffMark> DiffMarksForPane(
size_t paneIdx)
const;
140 void JumpToNearestDiff(
size_t paneIdx,
int docY);
142 std::vector<DiffMarkerBar *> m_markerBars;
145 int m_lastBarViewTop = -1;
146 int m_lastBarCurrent = -2;
152 std::vector<int> m_lastBarDocHeights;
154 wxToolBar *m_toolBar =
nullptr;
156 wxStaticText *m_diffStatus =
nullptr;
159 int m_shownPrevEnabled = -1;
160 int m_shownNextEnabled = -1;
167 wxTimer m_resizeTimer;
168 void RelayoutWorksheets();
173 int m_lastLayoutWidth = -1;
This file defines the class Worksheet.
The configuration storage for the current worksheet.
Definition: Configuration.h:101
Definition: DiffFrame.h:33
Worksheet * ActivePane() const
The pane copy commands and select-all act on (see m_activePane)
Definition: DiffFrame.cpp:741
Worksheet * GetPane(size_t idx) const
The worksheet of pane idx (nullptr if there is no such pane)
Definition: DiffFrame.h:39
bool FindNext(bool down)
Moves to the next (down) or previous match of the search field's text.
Definition: DiffFrame.cpp:682
wxSearchCtrl * GetSearchCtrl() const
The search field (exposed for the tests)
Definition: DiffFrame.h:51
Definition: DiffFrame.cpp:44
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:88
The canvas that contains the spreadsheet the whole program is about.
Definition: Worksheet.h:121