mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
initial commit version 0.0.1
This commit is contained in:
49
views/displaymessageview.c
Normal file
49
views/displaymessageview.c
Normal file
@@ -0,0 +1,49 @@
|
||||
#define __STL_CONFIG_H
|
||||
#include <vdr/menu.h>
|
||||
#include "displaymessageview.h"
|
||||
|
||||
cDisplayMessageView::cDisplayMessageView(cTemplateView *tmplView) : cView(tmplView) {
|
||||
DeleteOsdOnExit();
|
||||
SetFadeTime(tmplView->GetNumericParameter(ptFadeTime));
|
||||
}
|
||||
|
||||
cDisplayMessageView::~cDisplayMessageView() {
|
||||
CancelSave();
|
||||
FadeOut();
|
||||
}
|
||||
|
||||
bool cDisplayMessageView::createOsd(void) {
|
||||
cRect osdSize = tmplView->GetOsdSize();
|
||||
bool ok = CreateOsd(cOsd::OsdLeft() + osdSize.X(),
|
||||
cOsd::OsdTop() + osdSize.Y(),
|
||||
osdSize.Width(),
|
||||
osdSize.Height());
|
||||
return ok;
|
||||
}
|
||||
|
||||
void cDisplayMessageView::DrawBackground(void) {
|
||||
map < string, string > stringTokens;
|
||||
map < string, int > intTokens;
|
||||
DrawViewElement(veBackground, &stringTokens, &intTokens);
|
||||
}
|
||||
|
||||
void cDisplayMessageView::DrawMessage(eMessageType type, const char *text) {
|
||||
map < string, string > stringTokens;
|
||||
map < string, int > intTokens;
|
||||
|
||||
stringTokens.insert(pair<string,string>("text", text));
|
||||
|
||||
intTokens.insert(pair<string,int>("status", (type == mtStatus) ? true : false));
|
||||
intTokens.insert(pair<string,int>("info", (type == mtInfo) ? true : false));
|
||||
intTokens.insert(pair<string,int>("warning", (type == mtWarning) ? true : false));
|
||||
intTokens.insert(pair<string,int>("error", (type == mtError) ? true : false));
|
||||
|
||||
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
||||
}
|
||||
|
||||
void cDisplayMessageView::Action(void) {
|
||||
SetInitFinished();
|
||||
FadeIn();
|
||||
DoFlush();
|
||||
cView::Action();
|
||||
}
|
Reference in New Issue
Block a user