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
|
correctly
|
||||||
- implemented shiftout for views
|
- implemented shiftout for views
|
||||||
- fixed blinking for animated views
|
- fixed blinking for animated views
|
||||||
|
- chachged displaymessage in menus to detachable
|
||||||
|
|
||||||
|
@ -66,6 +66,14 @@
|
|||||||
|
|
||||||
<!ELEMENT message (area|areascroll)*>
|
<!ELEMENT message (area|areascroll)*>
|
||||||
<!ATTLIST message
|
<!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
|
debug CDATA #IMPLIED
|
||||||
condition CDATA #IMPLIED
|
condition CDATA #IMPLIED
|
||||||
>
|
>
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
{warning} true if message is an warn message
|
{warning} true if message is an warn message
|
||||||
{error} true if message is an error 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">
|
<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="{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%" />
|
<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) {
|
void cDisplayMenuRootView::DrawMessage(eMessageType type, const char *text) {
|
||||||
if (!text) {
|
if (!text) {
|
||||||
ClearViewElement(veMessage);
|
if (DetachViewElement(veMessage))
|
||||||
|
DestroyDetachedViewElement(veMessage);
|
||||||
|
else
|
||||||
|
ClearViewElement(veMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
map < string, string > stringTokens;
|
if (DetachViewElement(veMessage)) {
|
||||||
map < string, int > intTokens;
|
cViewElement *viewElement = GetViewElement(veMessage);
|
||||||
|
if (!viewElement) {
|
||||||
intTokens.insert(pair<string, int>("status", (type == mtStatus) ? true : false));
|
viewElement = new cViewElementMenuMessage(tmplView->GetViewElement(veMessage), type, text);
|
||||||
intTokens.insert(pair<string, int>("info", (type == mtInfo) ? true : false));
|
AddViewElement(veMessage, viewElement);
|
||||||
intTokens.insert(pair<string, int>("warning", (type == mtWarning) ? true : false));
|
viewElement->Start();
|
||||||
intTokens.insert(pair<string, int>("error", (type == mtError) ? true : false));
|
} else {
|
||||||
stringTokens.insert(pair<string,string>("text", text));
|
if (!viewElement->Starting())
|
||||||
|
viewElement->Render();
|
||||||
ClearViewElement(veMessage);
|
}
|
||||||
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
} else {
|
||||||
|
map < string, string > stringTokens;
|
||||||
|
map < string, int > intTokens;
|
||||||
|
SetMenuMessage(type, text, stringTokens, intTokens);
|
||||||
|
ClearViewElement(veMessage);
|
||||||
|
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cDisplayMenuRootView::Action(void) {
|
void cDisplayMenuRootView::Action(void) {
|
||||||
|
@ -173,20 +173,31 @@ bool cDisplayMenuView::DrawMessage(eMessageType type, const char *text) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!text) {
|
if (!text) {
|
||||||
ClearViewElement(veMessage);
|
if (DetachViewElement(veMessage))
|
||||||
|
DestroyDetachedViewElement(veMessage);
|
||||||
|
else
|
||||||
|
ClearViewElement(veMessage);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
map < string, string > stringTokens;
|
|
||||||
map < string, int > intTokens;
|
|
||||||
|
|
||||||
intTokens.insert(pair<string, int>("status", (type == mtStatus) ? true : false));
|
if (DetachViewElement(veMessage)) {
|
||||||
intTokens.insert(pair<string, int>("info", (type == mtInfo) ? true : false));
|
cViewElement *viewElement = GetViewElement(veMessage);
|
||||||
intTokens.insert(pair<string, int>("warning", (type == mtWarning) ? true : false));
|
if (!viewElement) {
|
||||||
intTokens.insert(pair<string, int>("error", (type == mtError) ? true : false));
|
viewElement = new cViewElementMenuMessage(tmplView->GetViewElement(veMessage), type, text);
|
||||||
stringTokens.insert(pair<string,string>("text", text));
|
AddViewElement(veMessage, viewElement);
|
||||||
|
viewElement->Start();
|
||||||
ClearViewElement(veMessage);
|
} else {
|
||||||
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
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);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,14 +30,7 @@ void cDisplayMessageView::DrawBackground(void) {
|
|||||||
void cDisplayMessageView::DrawMessage(eMessageType type, const char *text) {
|
void cDisplayMessageView::DrawMessage(eMessageType type, const char *text) {
|
||||||
map < string, string > stringTokens;
|
map < string, string > stringTokens;
|
||||||
map < string, int > intTokens;
|
map < string, int > intTokens;
|
||||||
|
SetMenuMessage(type, text, stringTokens, 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);
|
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "../libtemplate/template.h"
|
#include "../libtemplate/template.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
|
||||||
class cDisplayMessageView : public cView {
|
class cDisplayMessageView : public cView, public cViewHelpers {
|
||||||
public:
|
public:
|
||||||
cDisplayMessageView(cTemplateView *tmplView);
|
cDisplayMessageView(cTemplateView *tmplView);
|
||||||
virtual ~cDisplayMessageView();
|
virtual ~cDisplayMessageView();
|
||||||
|
@ -122,3 +122,18 @@ bool cViewElementMenuHeader::Render(void) {
|
|||||||
DrawViewElement(veHeader, &stringTokens, &intTokens);
|
DrawViewElement(veHeader, &stringTokens, &intTokens);
|
||||||
return true;
|
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);
|
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
|
#endif //__DISPLAYCHANNELVIEWELEMENTS_H
|
10
views/view.c
10
views/view.c
@ -245,6 +245,16 @@ void cView::DestroyViewElement(eViewElement ve) {
|
|||||||
ClearAnimations(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) {
|
void cView::ClearAnimations(int cat) {
|
||||||
//stop and delete all animated elements from this viewelement
|
//stop and delete all animated elements from this viewelement
|
||||||
if (animations.size() == 0)
|
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 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 ClearViewElement(eViewElement ve);
|
||||||
void DestroyViewElement(eViewElement ve);
|
void DestroyViewElement(eViewElement ve);
|
||||||
|
void DestroyDetachedViewElement(eViewElement ve);
|
||||||
void ClearAnimations(int cat);
|
void ClearAnimations(int cat);
|
||||||
bool ExecuteViewElement(eViewElement ve);
|
bool ExecuteViewElement(eViewElement ve);
|
||||||
bool DetachViewElement(eViewElement ve);
|
bool DetachViewElement(eViewElement ve);
|
||||||
|
@ -1125,3 +1125,11 @@ bool cViewHelpers::CompareECMInfos(sDVBAPIEcmInfo *ecmInfo) {
|
|||||||
return false;
|
return false;
|
||||||
return true;
|
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 SetMenuHeader(eMenuCategory cat, string menuTitle, stringmap &stringTokens, intmap &intTokens);
|
||||||
void SetCurrentSchedule(string recName, stringmap &stringTokens, intmap &intTokens);
|
void SetCurrentSchedule(string recName, stringmap &stringTokens, intmap &intTokens);
|
||||||
bool SetEcmInfos(int channelSid, stringmap &stringTokens, intmap &intTokens);
|
bool SetEcmInfos(int channelSid, stringmap &stringTokens, intmap &intTokens);
|
||||||
|
void SetMenuMessage(eMessageType type, string text, stringmap &stringTokens, intmap &intTokens);
|
||||||
public:
|
public:
|
||||||
cViewHelpers(void);
|
cViewHelpers(void);
|
||||||
virtual ~cViewHelpers(void);
|
virtual ~cViewHelpers(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user