void ComboBox::display(void) { static Kernel *kernel = Kernel::getInstance(); if (_cTexture == NULL || _isVisible == false) return; Point currPosition = getAbsolutePosition(); if (isDragging()) _comboBoxMenu->setPosition(currPosition + Point(0, getHeight())); _cTexture->enable(); ColorScheme::getInstance()->applyColor(ColorScheme::TEXTFIELD); _cTexture->display(currPosition.x, currPosition.y, 1, getWidth(), getHeight()); _cTexture->display(currPosition.x + 1, currPosition.y + 1, 0, getWidth() - 2, getHeight() - 2); ColorScheme::getInstance()->applyColor(ColorScheme::MAINCOMPONENTS); _cTexture->display(currPosition.x + getWidth() - 17, currPosition.y + getHeight() - 2, 2, 15, - 16); ColorScheme::getInstance()->applyColor(ColorScheme::TEXTFIELD); if (isHolded()) { _cTexture->display(currPosition.x + 1, currPosition.y + 1, 4, getWidth() - 2, getHeight() - 2); } else if (isOvered()) { _cTexture->display(currPosition.x + 1 , currPosition.y + 1, 3, getWidth() - 2, getHeight() - 2); } _cTexture->disable(); Scissor::getInstance()->pushScissor(Scissor::Info(currPosition.x + 3, kernel->getHeight() - (getHeight() + currPosition.y), getWidth() - 22, getHeight())); StaticLabel::display(currPosition.x + 4, currPosition.y + getHeight() / 2 - 6, Label::getString()); Scissor::getInstance()->popScissor(); }
void CheckBox::display(void) { static Kernel *kernel = Kernel::getInstance(); static Scissor *scissor = Scissor::getInstance(); static FontTahoma *font = FontTahoma::getInstance(); static ColorScheme *scheme = ColorScheme::getInstance(); if (_cTexture == NULL || _isVisible == false) return; Point currPosition = getAbsolutePosition(); _cTexture->enable(); scheme->applyDefaultModulate(); if (getState() == false) { _cTexture->display(getAbsolutePosition(), 0); } else { _cTexture->display(getAbsolutePosition(), 1); } if (isHolded()) { scheme->applyColor(ColorScheme::HOLDCOMPONENTS); _cTexture->display(currPosition.x + 1, currPosition.y + 1, 2, 13 - 2, 13 - 2); } else if (isOvered()) { scheme->applyColor(ColorScheme::OVERCOMPONENTS); _cTexture->display(currPosition.x + 1, currPosition.y + 1, 3, 13 - 2, 13 - 2); } _cTexture->disable(); scissor->pushScissor(Scissor::Info(currPosition.x, kernel->getHeight() - (getHeight() + currPosition.y), getWidth() + font->getStringLength(Label::getString()) + 3, getHeight())); StaticLabel::display(currPosition.x + 13 + 3, currPosition.y, Label::getString()); scissor->popScissor(); }
void Button::display(void) { static Kernel *kernel = Kernel::getInstance(); static Scissor *scissor = Scissor::getInstance(); static ColorScheme *scheme = ColorScheme::getInstance(); static FontFreeType *freeType = FontFreeType::getInstance(); if (_cTexture == NULL || _isVisible == false) return; Point currPosition = getAbsolutePosition(); _cTexture->enable(); scheme->applyColor(ColorScheme::MAINCOMPONENTS); // middle _cTexture->display(currPosition.x + 1, currPosition.y + 1, 4, getWidth() - 2, getHeight() - 2); if (isHolded()) { scheme->applyColor(ColorScheme::HOLDCOMPONENTS); _cTexture->display(currPosition.x + 1, currPosition.y + 1, 6, getWidth() - 2, getHeight() - 2); } else if (isOvered()) { scheme->applyColor(ColorScheme::OVERCOMPONENTS); _cTexture->display(currPosition.x + 1, currPosition.y + 1, 5, getWidth() - 2, getHeight() - 2); } scheme->applyColor(ColorScheme::MAINCOMPONENTS); // horizontal lines _cTexture->display(currPosition.x + 2, currPosition.y, 7, getWidth() - 4, 2); _cTexture->display(currPosition.x + 2, currPosition.y + getHeight() - 2, 8, getWidth() - 4, 2); // vertical lines _cTexture->display(currPosition.x, currPosition.y + 2, 9, 2, getHeight() - 4); _cTexture->display(currPosition.x + getWidth() - 2, currPosition.y + 2, 10, 2, getHeight() - 4); // corners _cTexture->display(currPosition, 0); _cTexture->display(currPosition.x + getWidth() - 3, currPosition.y, 1); _cTexture->display(currPosition.x, currPosition.y + getHeight()- 3, 2); _cTexture->display(currPosition.x + getWidth() - 3, currPosition.y + getHeight() - 3, 3); _cTexture->disable(); scissor->pushScissor(Scissor::Info(currPosition.x + 3, kernel->getHeight() - (getHeight() + currPosition.y), getWidth() - 6, getHeight())); StaticLabel::display(currPosition.x + getWidth() / 2 - freeType->getStringLength(Label::getString()) / 2 , currPosition.y + getHeight() / 2 - 6, Label::getString()); scissor->popScissor(); }