added possibility to detach viewelements

This commit is contained in:
louis
2015-03-28 11:57:51 +01:00
parent fcf90375fa
commit 762e2c1507
30 changed files with 1188 additions and 681 deletions

View File

@@ -83,6 +83,8 @@ void cTemplateFunction::SetParameters(vector<pair<string, string> > params) {
p.first = ptLayer;
} else if (!name.compare("transparency")) {
p.first = ptTransparency;
} else if (!name.compare("background")) {
p.first = ptBackground;
} else if (!name.compare("quadrant")) {
p.first = ptQuadrant;
} else if (!name.compare("type")) {
@@ -271,6 +273,9 @@ bool cTemplateFunction::CalculateParameters(void) {
case ptDetached:
paramValid = SetDetached(value);
break;
case ptBackground:
paramValid = SetBackground(value);
break;
default:
paramValid = true;
break;
@@ -413,6 +418,8 @@ int cTemplateFunction::GetNumericParameter(eParamType type) {
return 0;
else if (type == ptDetached)
return 0;
else if (type == ptBackground)
return 0;
return -1;
}
return hit->second;
@@ -1077,6 +1084,14 @@ bool cTemplateFunction::SetDetached(string value) {
return true;
}
bool cTemplateFunction::SetBackground(string value) {
int back = 0;
if (!value.compare("true"))
back = 1;
numericParameters.insert(pair<eParamType, int>(ptBackground, back));
return true;
}
void cTemplateFunction::ParseStringParameters(void) {
//first replace stringtokens in Text (drawText)
stringstream text;

View File

@@ -56,6 +56,7 @@ enum eParamType {
ptText,
ptLayer,
ptTransparency,
ptBackground,
ptQuadrant,
ptType,
ptAlign,
@@ -154,6 +155,7 @@ protected:
bool SetOverflow(string value);
bool SetHideRoot(string value);
bool SetDetached(string value);
bool SetBackground(string value);
void ParseStringParameters(void);
void ParseNumericalParameters(void);
void CalculateAlign(int elementWidth, int elementHeight);

View File

@@ -12,6 +12,7 @@ cTemplatePixmap::cTemplatePixmap(void) {
containerHeight = 0;
globals = NULL;
scrolling = false;
background = false;
}
cTemplatePixmap::~cTemplatePixmap() {
@@ -171,6 +172,8 @@ bool cTemplatePixmap::CalculateParameters(void) {
}
}
background = parameters->GetNumericParameter(ptBackground);
return paramsValid;
}

View File

@@ -21,6 +21,7 @@ using namespace std;
class cTemplatePixmap {
protected:
bool scrolling;
bool background;
cTemplateFunction *parameters;
vector<cTemplateFunction*> functions;
vector<cTemplateFunction*>::iterator funcIt;
@@ -76,6 +77,7 @@ public:
bool DoExecute(void) { return parameters->DoExecute(); };
bool DoDebug(void) { return parameters->DoDebug(); };
bool Ready(void);
bool BackgroundArea(void) { return background; };
//Traverse Functions
void InitIterator(void);
cTemplateFunction *GetNextFunction(void);

View File

@@ -638,6 +638,7 @@ void cTemplateView::SetFunctionDefinitions(void) {
attributes.insert("height");
attributes.insert("layer");
attributes.insert("transparency");
attributes.insert("background");
funcsAllowed.insert(pair< string, set<string> >(name, attributes));
name = "areascroll";