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

Method UpdateStatusBar

Source/CursesDialog/cmCursesLongMessageForm.cxx:56–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void cmCursesLongMessageForm::UpdateStatusBar()
57{
58 int x;
59 int y;
60 getmaxyx(stdscr, y, x);
61
62 char bar[cmCursesMainForm::MAX_WIDTH];
63 size_t size = this->Title.size();
64 if (size >= cmCursesMainForm::MAX_WIDTH) {
65 size = cmCursesMainForm::MAX_WIDTH - 1;
66 }
67 strncpy(bar, this->Title.c_str(), size);
68 for (size_t i = size; i < cmCursesMainForm::MAX_WIDTH; i++) {
69 bar[i] = ' ';
70 }
71 int width;
72 if (x >= 0 && x < cmCursesMainForm::MAX_WIDTH) {
73 width = x;
74 } else {
75 width = cmCursesMainForm::MAX_WIDTH - 1;
76 }
77
78 bar[width] = '\0';
79
80 char version[cmCursesMainForm::MAX_WIDTH];
81 char vertmp[128];
82 snprintf(vertmp, sizeof(vertmp), "CMake Version %s",
83 cmVersion::GetCMakeVersion());
84 size_t sideSpace = (width - strlen(vertmp));
85 for (size_t i = 0; i < sideSpace; i++) {
86 version[i] = ' ';
87 }
88 snprintf(version + sideSpace, sizeof(version) - sideSpace, "%s", vertmp);
89 version[width] = '\0';
90
91 char fmt_s[] = "%s";
92 move(y - 4, 0);
93 attron(A_STANDOUT);
94 printw(fmt_s, bar);
95 attroff(A_STANDOUT);
96 move(y - 3, 0);
97 printw(fmt_s, version);
98 pos_form_cursor(this->Form);
99}
100
101void cmCursesLongMessageForm::PrintKeys()
102{

Callers 3

UpdateContentMethod · 0.95
RenderMethod · 0.95
HandleInputMethod · 0.95

Calls 9

moveFunction · 0.85
attronFunction · 0.85
printwFunction · 0.85
attroffFunction · 0.85
pos_form_cursorFunction · 0.85
c_strMethod · 0.80
snprintfFunction · 0.50
strlenFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected