2016-02-06 09:55:15 +01:00
|
|
|
#include "viewdisplaymessage.h"
|
|
|
|
#include "../config.h"
|
|
|
|
|
|
|
|
/************************************************************************************
|
|
|
|
* cViewMessage
|
|
|
|
************************************************************************************/
|
|
|
|
|
|
|
|
cViewMessage::cViewMessage(void) {
|
|
|
|
ClearVariables();
|
|
|
|
viewId = eViewType::DisplayMessage;
|
|
|
|
viewName = strdup("displaymessage");
|
|
|
|
numViewElements = (int)eVeDisplayMessage::count;
|
|
|
|
viewElements = new cViewElement*[numViewElements];
|
|
|
|
for (int i=0; i < numViewElements; i++) {
|
|
|
|
viewElements[i] = NULL;
|
|
|
|
}
|
|
|
|
SetViewElements();
|
|
|
|
veMessage = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
cViewMessage::~cViewMessage() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewMessage::SetViewElements(void) {
|
|
|
|
viewElementNames.insert(pair<string, int>("background", (int)eVeDisplayMessage::background));
|
|
|
|
viewElementNames.insert(pair<string, int>("message", (int)eVeDisplayMessage::message));
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewMessage::SetViewElementObjects(void) {
|
|
|
|
if (!viewElements[(int)eVeDisplayMessage::message])
|
|
|
|
return;
|
|
|
|
veMessage = dynamic_cast<cVeMessage*>(viewElements[(int)eVeDisplayMessage::message]);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewMessage::ClearVariables(void) {
|
|
|
|
init = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void cViewMessage::SetMessage(eMessageType type, const char *text) {
|
|
|
|
if (!text)
|
|
|
|
veMessage->Clear();
|
|
|
|
else
|
|
|
|
veMessage->Set(type, text);
|
|
|
|
}
|
|
|
|
|
2016-07-22 15:21:09 +02:00
|
|
|
void cViewMessage::Flush(void) {
|
2016-02-06 09:55:15 +01:00
|
|
|
if (init) {
|
|
|
|
Render((int)eVeDisplayMessage::background);
|
|
|
|
}
|
|
|
|
Render((int)eVeDisplayMessage::message);
|
2016-07-22 15:21:09 +02:00
|
|
|
cView::Flush();
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|