3
3
Program: CMake - Cross-Platform Makefile Generator
4
4
Module: $RCSfile: cmCursesLongMessageForm.cxx,v $
6
Date: $Date: 2005/05/03 18:57:32 $
7
Version: $Revision: 1.13 $
6
Date: $Date: 2006/03/16 15:44:55 $
7
Version: $Revision: 1.14 $
9
9
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10
10
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
33
33
std::vector<std::string>::const_iterator it;
34
34
for(it=messages.begin(); it != messages.end(); it++)
36
this->Messages += (*it);
37
37
// Add one blank line after each message
38
this->Messages += "\n\n";
45
45
cmCursesLongMessageForm::~cmCursesLongMessageForm()
49
free_field(m_Fields[0]);
49
free_field(this->Fields[0]);
57
57
getmaxyx(stdscr, y, x);
59
59
char bar[cmCursesMainForm::MAX_WIDTH];
60
int size = strlen(m_Title.c_str());
60
int size = strlen(this->Title.c_str());
61
61
if ( size >= cmCursesMainForm::MAX_WIDTH )
63
63
size = cmCursesMainForm::MAX_WIDTH-1;
65
strncpy(bar, m_Title.c_str(), size);
65
strncpy(bar, this->Title.c_str(), size);
66
66
for(int i=size-1; i<cmCursesMainForm::MAX_WIDTH; i++) bar[i] = ' ';
119
119
getmaxyx(stdscr, y, x);
123
unpost_form(this->Form);
124
free_form(this->Form);
128
const char* msg = m_Messages.c_str();
128
const char* msg = this->Messages.c_str();
134
free_field(m_Fields[0]);
134
free_field(this->Fields[0]);
138
m_Fields[0] = new_field(y-6, x-2, 1, 1, 0, 0);
140
field_opts_off(m_Fields[0], O_STATIC);
142
m_Form = new_form(m_Fields);
138
this->Fields[0] = new_field(y-6, x-2, 1, 1, 0, 0);
140
field_opts_off(this->Fields[0], O_STATIC);
142
this->Form = new_form(this->Fields);
143
post_form(this->Form);
146
form_driver(m_Form, REQ_BEG_FIELD);
146
form_driver(this->Form, REQ_BEG_FIELD);
147
147
while(msg[i] != '\0' && i < 60000)
149
149
if (msg[i] == '\n' && msg[i+1] != '\0')
151
form_driver(m_Form, REQ_NEW_LINE);
151
form_driver(this->Form, REQ_NEW_LINE);
155
form_driver(m_Form, msg[i]);
155
form_driver(this->Form, msg[i]);
159
form_driver(m_Form, REQ_BEG_FIELD);
159
form_driver(this->Form, REQ_BEG_FIELD);
161
161
this->UpdateStatusBar();
162
162
this->PrintKeys();
189
189
else if ( key == KEY_DOWN || key == ctrl('n') )
191
form_driver(m_Form, REQ_SCR_FLINE);
191
form_driver(this->Form, REQ_SCR_FLINE);
193
193
else if ( key == KEY_UP || key == ctrl('p') )
195
form_driver(m_Form, REQ_SCR_BLINE);
195
form_driver(this->Form, REQ_SCR_BLINE);
197
197
else if ( key == KEY_NPAGE || key == ctrl('d') )
199
form_driver(m_Form, REQ_SCR_FPAGE);
199
form_driver(this->Form, REQ_SCR_FPAGE);
201
201
else if ( key == KEY_PPAGE || key == ctrl('u') )
203
form_driver(m_Form, REQ_SCR_BPAGE);
203
form_driver(this->Form, REQ_SCR_BPAGE);
206
206
this->UpdateStatusBar();