mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
chachged displaymessage in menus to detachable
This commit is contained in:
parent
9a0217589e
commit
8d7584d66e
1
HISTORY
1
HISTORY
@ -322,4 +322,5 @@ Version 0.4.5
|
||||
correctly
|
||||
- implemented shiftout for views
|
||||
- fixed blinking for animated views
|
||||
- chachged displaymessage in menus to detachable
|
||||
|
||||
|
@ -66,6 +66,14 @@
|
||||
|
||||
<!ELEMENT message (area|areascroll)*>
|
||||
<!ATTLIST message
|
||||
detached CDATA #IMPLIED
|
||||
delay CDATA #IMPLIED
|
||||
fadetime CDATA #IMPLIED
|
||||
shifttime CDATA #IMPLIED
|
||||
shifttype CDATA #IMPLIED
|
||||
shiftmode CDATA #IMPLIED
|
||||
startx CDATA #IMPLIED
|
||||
starty CDATA #IMPLIED
|
||||
debug CDATA #IMPLIED
|
||||
condition CDATA #IMPLIED
|
||||
>
|
||||
|
@ -94,7 +94,7 @@
|
||||
{warning} true if message is an warn message
|
||||
{error} true if message is an error message
|
||||
-->
|
||||
<message>
|
||||
<message detached="true" delay="0" shifttime="{shifttimemessage}" shifttype="bottom" shiftmode="slowed">
|
||||
<area x="5%" y="80%" width="90%" height="15%" layer="6">
|
||||
<drawimage condition="{status}" imagetype="skinpart" path="messageblue" x="0" y="0" width="100%" height="100%" />
|
||||
<drawimage condition="{info}" imagetype="skinpart" path="messagegreen" x="0" y="0" width="100%" height="100%" />
|
||||
|
@ -680,21 +680,30 @@ void cDisplayMenuRootView::DrawColorButtons(void) {
|
||||
|
||||
void cDisplayMenuRootView::DrawMessage(eMessageType type, const char *text) {
|
||||
if (!text) {
|
||||
ClearViewElement(veMessage);
|
||||
if (DetachViewElement(veMessage))
|
||||
DestroyDetachedViewElement(veMessage);
|
||||
else
|
||||
ClearViewElement(veMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
map < string, string > stringTokens;
|
||||
map < string, int > intTokens;
|
||||
|
||||
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));
|
||||
stringTokens.insert(pair<string,string>("text", text));
|
||||
|
||||
ClearViewElement(veMessage);
|
||||
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
||||
if (DetachViewElement(veMessage)) {
|
||||
cViewElement *viewElement = GetViewElement(veMessage);
|
||||
if (!viewElement) {
|
||||
viewElement = new cViewElementMenuMessage(tmplView->GetViewElement(veMessage), type, text);
|
||||
AddViewElement(veMessage, viewElement);
|
||||
viewElement->Start();
|
||||
} else {
|
||||
if (!viewElement->Starting())
|
||||
viewElement->Render();
|
||||
}
|
||||
} else {
|
||||
map < string, string > stringTokens;
|
||||
map < string, int > intTokens;
|
||||
SetMenuMessage(type, text, stringTokens, intTokens);
|
||||
ClearViewElement(veMessage);
|
||||
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
||||
}
|
||||
}
|
||||
|
||||
void cDisplayMenuRootView::Action(void) {
|
||||
|
@ -173,20 +173,31 @@ bool cDisplayMenuView::DrawMessage(eMessageType type, const char *text) {
|
||||
return false;
|
||||
}
|
||||
if (!text) {
|
||||
ClearViewElement(veMessage);
|
||||
if (DetachViewElement(veMessage))
|
||||
DestroyDetachedViewElement(veMessage);
|
||||
else
|
||||
ClearViewElement(veMessage);
|
||||
return true;
|
||||
}
|
||||
map < string, string > stringTokens;
|
||||
map < string, int > intTokens;
|
||||
|
||||
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));
|
||||
stringTokens.insert(pair<string,string>("text", text));
|
||||
if (DetachViewElement(veMessage)) {
|
||||
cViewElement *viewElement = GetViewElement(veMessage);
|
||||
if (!viewElement) {
|
||||
viewElement = new cViewElementMenuMessage(tmplView->GetViewElement(veMessage), type, text);
|
||||
AddViewElement(veMessage, viewElement);
|
||||
viewElement->Start();
|
||||
} else {
|
||||
if (!viewElement->Starting())
|
||||
viewElement->Render();
|
||||
}
|
||||
} else {
|
||||
map < string, string > stringTokens;
|
||||
map < string, int > intTokens;
|
||||
|
||||
ClearViewElement(veMessage);
|
||||
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
||||
SetMenuMessage(type, text, stringTokens, intTokens);
|
||||
ClearViewElement(veMessage);
|
||||
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -30,14 +30,7 @@ void cDisplayMessageView::DrawBackground(void) {
|
||||
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));
|
||||
|
||||
SetMenuMessage(type, text, stringTokens, intTokens);
|
||||
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "../libtemplate/template.h"
|
||||
#include "view.h"
|
||||
|
||||
class cDisplayMessageView : public cView {
|
||||
class cDisplayMessageView : public cView, public cViewHelpers {
|
||||
public:
|
||||
cDisplayMessageView(cTemplateView *tmplView);
|
||||
virtual ~cDisplayMessageView();
|
||||
|
@ -122,3 +122,18 @@ bool cViewElementMenuHeader::Render(void) {
|
||||
DrawViewElement(veHeader, &stringTokens, &intTokens);
|
||||
return true;
|
||||
}
|
||||
|
||||
/********************************************************************************************************************/
|
||||
|
||||
cViewElementMenuMessage::cViewElementMenuMessage(cTemplateViewElement *tmplViewElement, eMessageType type, string text) : cViewElement(tmplViewElement) {
|
||||
this->type = type;
|
||||
this->text = text;
|
||||
}
|
||||
|
||||
bool cViewElementMenuMessage::Render(void) {
|
||||
ClearTokens();
|
||||
SetMenuMessage(type, text, stringTokens, intTokens);
|
||||
ClearViewElement(veMessage);
|
||||
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
||||
return true;
|
||||
}
|
||||
|
@ -75,4 +75,14 @@ public:
|
||||
bool Render(void);
|
||||
};
|
||||
|
||||
class cViewElementMenuMessage : public cViewElement, public cViewHelpers {
|
||||
private:
|
||||
eMessageType type;
|
||||
string text;
|
||||
public:
|
||||
cViewElementMenuMessage(cTemplateViewElement *tmplViewElement, eMessageType type, string text);
|
||||
virtual ~cViewElementMenuMessage() {};
|
||||
bool Render(void);
|
||||
};
|
||||
|
||||
#endif //__DISPLAYCHANNELVIEWELEMENTS_H
|
10
views/view.c
10
views/view.c
@ -245,6 +245,16 @@ void cView::DestroyViewElement(eViewElement ve) {
|
||||
ClearAnimations(ve);
|
||||
}
|
||||
|
||||
void cView::DestroyDetachedViewElement(eViewElement ve) {
|
||||
map < eViewElement, cViewElement* >::iterator hit = detachedViewElements.find(ve);
|
||||
if (hit == detachedViewElements.end())
|
||||
return;
|
||||
cViewElement *viewElement = hit->second;
|
||||
delete viewElement;
|
||||
detachedViewElements.erase(hit);
|
||||
}
|
||||
|
||||
|
||||
void cView::ClearAnimations(int cat) {
|
||||
//stop and delete all animated elements from this viewelement
|
||||
if (animations.size() == 0)
|
||||
|
@ -58,6 +58,7 @@ protected:
|
||||
void DrawViewElement(eViewElement ve, map <string,string> *stringTokens = NULL, map <string,int> *intTokens = NULL, map < string, vector< map< string, string > > > *loopTokens = NULL);
|
||||
void ClearViewElement(eViewElement ve);
|
||||
void DestroyViewElement(eViewElement ve);
|
||||
void DestroyDetachedViewElement(eViewElement ve);
|
||||
void ClearAnimations(int cat);
|
||||
bool ExecuteViewElement(eViewElement ve);
|
||||
bool DetachViewElement(eViewElement ve);
|
||||
|
@ -1125,3 +1125,11 @@ bool cViewHelpers::CompareECMInfos(sDVBAPIEcmInfo *ecmInfo) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void cViewHelpers::SetMenuMessage(eMessageType type, string text, stringmap &stringTokens, intmap &intTokens) {
|
||||
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));
|
||||
stringTokens.insert(pair<string,string>("text", text));
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ protected:
|
||||
void SetMenuHeader(eMenuCategory cat, string menuTitle, stringmap &stringTokens, intmap &intTokens);
|
||||
void SetCurrentSchedule(string recName, stringmap &stringTokens, intmap &intTokens);
|
||||
bool SetEcmInfos(int channelSid, stringmap &stringTokens, intmap &intTokens);
|
||||
void SetMenuMessage(eMessageType type, string text, stringmap &stringTokens, intmap &intTokens);
|
||||
public:
|
||||
cViewHelpers(void);
|
||||
virtual ~cViewHelpers(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user