MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / PopPage

Method PopPage

engine/Poseidon/UI/Options/OptionsShell.cpp:148–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146 p->OnReshown(*this);
147 RefreshTitle();
148}
149
150void OptionsShell::PopPage()
151{
152 if (m_stack.empty())
153 {
154 BeginCloseAnim(IDC_CANCEL);
155 return;
156 }
157 auto top = std::move(m_stack.back());
158 m_stack.pop_back();
159 top->Unmount(*this);
160 top.reset();
161
162 // PushPage hides the previous page's controls in all cases (modal
163 // or not — see comment there). Symmetric re-show on pop.
164 if (auto* now = TopPage())
165 {
166 ShowPageControls(now, true);
167 // Default focus first, OnReshown last — the latter is the place
168 // pages override focus to remember per-page state (e.g.
169 // FlatMenuPage's last-nav-idc memory). Without this order the
170 // default would trample the remembered focus.
171 int focusIdc = now->DefaultFocusIdc();
172 if (focusIdc >= 0)
173 FocusNotebookCtrl(focusIdc);
174 now->OnReshown(*this);
175 RefreshTitle();
176 }
177 else
178 {
179 BeginCloseAnim(IDC_CANCEL);
180 }
181}
182

Callers 8

OnButtonClickedMethod · 0.80
OnKeyDownMethod · 0.80
ResolveMethod · 0.80
OnNavMethod · 0.80
ResolveMethod · 0.80
OnButtonClickedMethod · 0.80
OnKeyDownMethod · 0.80

Calls 5

emptyMethod · 0.45
UnmountMethod · 0.45
resetMethod · 0.45
DefaultFocusIdcMethod · 0.45
OnReshownMethod · 0.45

Tested by

no test coverage detected