MCPcopy Create free account
hub / github.com/Kitware/CMake / Render

Method Render

Source/CursesDialog/cmCursesMainForm.cxx:207–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207void cmCursesMainForm::Render(int left, int top, int width, int height)
208{
209
210 if (this->Form) {
211 FIELD* currentField = current_field(this->Form);
212 cmCursesWidget* cw =
213 reinterpret_cast<cmCursesWidget*>(field_userptr(currentField));
214 // If in edit mode, get out of it
215 if (cw->GetType() == cmStateEnums::STRING ||
216 cw->GetType() == cmStateEnums::PATH ||
217 cw->GetType() == cmStateEnums::FILEPATH) {
218 cmCursesStringWidget* sw = static_cast<cmCursesStringWidget*>(cw);
219 sw->SetInEdit(false);
220 }
221 // Delete the previous form
222 unpost_form(this->Form);
223 free_form(this->Form);
224 this->Form = nullptr;
225 }
226
227 // Wrong window size
228 if (width < cmCursesMainForm::MIN_WIDTH || width < this->InitialWidth ||
229 height < cmCursesMainForm::MIN_HEIGHT) {
230 return;
231 }
232
233 // Leave room for toolbar
234 height -= 7;
235
236 if (this->AdvancedMode) {
237 this->NumberOfVisibleEntries = this->Entries.size();
238 } else {
239 // If normal, display only non-advanced entries
240 this->NumberOfVisibleEntries = 0;
241 for (cmCursesCacheEntryComposite& entry : this->Entries) {
242 cmValue existingValue =
243 this->CMakeInstance->GetState()->GetCacheEntryValue(entry.GetValue());
244 bool advanced =
245 this->CMakeInstance->GetState()->GetCacheEntryPropertyAsBool(
246 entry.GetValue(), "ADVANCED");
247 if (!existingValue || (!this->AdvancedMode && advanced)) {
248 continue;
249 }
250 this->NumberOfVisibleEntries++;
251 }
252 }
253
254 // Re-adjust the fields according to their place
255 this->NumberOfPages = 1;
256 if (height > 0) {
257 bool isNewPage;
258 int i = 0;
259 for (cmCursesCacheEntryComposite& entry : this->Entries) {
260 cmValue existingValue =
261 this->CMakeInstance->GetState()->GetCacheEntryValue(entry.GetValue());
262 bool advanced =
263 this->CMakeInstance->GetState()->GetCacheEntryPropertyAsBool(
264 entry.GetValue(), "ADVANCED");

Callers 6

ConfigureMethod · 0.95
GenerateMethod · 0.95
HandleInputMethod · 0.95
HandleResizeMethod · 0.45
DisplayOutputsMethod · 0.45
mainFunction · 0.45

Calls 15

UpdateStatusBarMethod · 0.95
PrintKeysMethod · 0.95
current_fieldFunction · 0.85
field_userptrFunction · 0.85
unpost_formFunction · 0.85
free_formFunction · 0.85
new_formFunction · 0.85
post_formFunction · 0.85
touchwinFunction · 0.85
refreshFunction · 0.85
SetInEditMethod · 0.80
SetPageMethod · 0.80

Tested by

no test coverage detected