/*! * \brief Get the minimum zindex for the card to be visible over all its children * \return int */ int Card::getTopZIndex() { if (mChild) { return mChild->getTopZIndex(); } return getZIndex() + 1; }
int FormatterDeviceRegion::getZIndexValue() { int zIndex; zIndex = getZIndex(); if (zIndex != -1) { return zIndex; } else { return 0; } }
void Control::draw(Graphics graphics, int left, int top, int layer) { if (layer != getZIndex()) { return; } string borderCharHorizontal; string borderCharVertical; int newXPos = left; int newYPos = top; graphics.moveTo(newXPos,newYPos); switch (_border) { case BorderType::Single: { borderCharVertical = "-"; borderCharHorizontal = "|"; break; } case BorderType::Double: { borderCharVertical = "="; borderCharHorizontal = "||"; break; } case BorderType::None: { borderCharVertical = " "; borderCharHorizontal = " "; } } for (int rows = 0; rows <_height; rows++) { for (int col = 0; col < _width; col++) { if (col == 0 || col == (_width - 1) || rows == 0 || (rows == _height - 1)) { if(rows == 0 || (rows == _height - 1)){ cout<<borderCharVertical; } else { cout <<borderCharHorizontal; } } else { printf(" "); } } printf("\n"); newYPos++; graphics.moveTo(newXPos, newYPos); } }
string LayoutRegionGenerator::generateCode() { string ret = "<region id=\"" + this->getId() + "\" "; double aux = this->getLeft(); if (! isNaN(aux)) { ret += "left =\"" + itos(aux); if (this->isLeftPercentual()) { ret += "%"; } ret += "\" "; } aux = this->getTop(); if (! isNaN(aux)) { ret += "top =\"" + itos(aux); if (this->isTopPercentual()) { ret += "%"; } ret += "\" "; } aux = this->getRight(); if (! isNaN(aux)) { ret += "right=\"" + itos(aux); if (this->isRightPercentual()) { ret += "%"; } ret += "\" "; } aux = this->getBottom(); if (! isNaN(aux)) { ret += "bottom=\"" + itos(aux); if (this->isBottomPercentual()) { ret += "%"; } ret += "\" "; } aux = this->getHeight(); if (! isNaN(aux)) { ret += "height=\"" + itos(aux); if (this->isHeightPercentual()) { ret += "%"; } ret += "\" "; } aux = this->getWidth(); if (! isNaN(aux)) { ret += "width=\"" + itos(aux); if (this->isWidthPercentual()) { ret += "%"; } ret += "\" "; } if (this->getTitle() != "") { ret += "title=\"" + this->getTitle() + "\" "; } int zIndex = getZIndex(); if (zIndex != 0) { ret +="zIndex= \"" + itos(zIndex) + "\" "; } //Não existe nada na norma sobre movable, resized... porém existem //atributos que tratam disto na classe LayoutRegion. vector<LayoutRegion*>* childRegions = this->getRegions(); if (childRegions->size() != 0) { ret+= ">\n"; vector<LayoutRegion*>::iterator it; it = childRegions->begin(); while (it != childRegions->end()) { ret += (static_cast<LayoutRegionGenerator*>(*it))->generateCode(); it++; } ret += "</region>\n"; } else { ret+= "/>\n"; } return ret; }
void SurfaceProperties::applyZIndex() { LDEBUG("SurfaceProperties", "apply zIndex, value=%d", _zIndex); int tmp=_zIndex; getZIndex(tmp); surface()->setZIndex(tmp); }