Rect FalagardActionButton::getActionArea() { Rect rcOut; const WidgetLookFeel& wlf = WidgetLookManager::getSingleton().getWidgetLook(d_lookName); if( wlf.isNamedAreaDefined( "ActionArea" ) ) rcOut = wlf.getNamedArea("ActionArea").getArea().getPixelRect(*this); else rcOut= Rect(0, 0, getAbsoluteSize().d_width, getAbsoluteSize().d_height); return rcOut; }
void FalagardActionButton::drawAnimate(float z) { if(!d_animate1.d_animate || !d_animate1.d_currentFrame) return; //Draw CornerChar ColourRect color(colour( 1.0f, 1.0f, 0 )); color.setAlpha( d_animate1.d_alpha ); d_renderCache.cacheImage(*(d_animate1.d_currentFrame), Rect(0, 0, getAbsoluteSize().d_width, getAbsoluteSize().d_height), 0, color); }
/************************************************************************* Perform the actual rendering for this Window. *************************************************************************/ void Static::populateRenderCache() { Rect backgroundRect(Point(0,0), getAbsoluteSize()); // draw frame if (d_frameEnabled) { d_frame.draw(d_renderCache); // adjust destination area for backfrop image. backgroundRect.d_left += d_left_width; backgroundRect.d_right -= d_right_width; backgroundRect.d_top += d_top_height; backgroundRect.d_bottom -= d_bottom_height; } // draw backdrop if (d_backgroundEnabled && (d_background != NULL)) { // factor window alpha into colours to use when rendering background ColourRect colours(d_backgroundCols); colours.modulateAlpha(getEffectiveAlpha()); // cache image for drawing d_renderCache.cacheImage(*d_background, backgroundRect, 0, colours); } }
/************************************************************************* Handler for when window is sized *************************************************************************/ void Static::onParentSized(WindowEventArgs& e) { // base class processing Window::onParentSized(e); // update frame size. d_frame.setSize(getAbsoluteSize()); e.handled = true; }
void FalagardActionButton::drawCorner(float z) { //Draw CornerChar ColourRect final_cols(colour(1.0f, 1.0f, 0.0f)); //Top Left if(!d_CornerChar_TopLeft.d_Char.empty()) { d_renderCache.cacheText(this, d_CornerChar_TopLeft.d_Char, getFont(), (TextFormatting)LeftAligned, Rect(2, 2, getAbsoluteSize().d_width, getAbsoluteSize().d_height), 0.0f, final_cols); } //Top Right if(!d_CornerChar_TopRight.d_Char.empty()) { d_renderCache.cacheText(this, d_CornerChar_TopRight.d_Char, getFont(), (TextFormatting)RightAligned, Rect(0, 2, getAbsoluteSize().d_width-2, getAbsoluteSize().d_height), 0.0f, final_cols); } //Bottom Left if(!d_CornerChar_BotLeft.d_Char.empty()) { //Get the font height float fFontHeight = getFont()->getFontHeight(); d_renderCache.cacheText(this, d_CornerChar_BotLeft.d_Char, getFont(), (TextFormatting)LeftAligned, Rect(2, getAbsoluteSize().d_height-fFontHeight-2, getAbsoluteSize().d_width, getAbsoluteSize().d_height), 0.0f, final_cols); } //Bottom Right if(!d_CornerChar_BotRight.d_Char.empty()) { //Get the font height float fFontHeight = getFont()->getFontHeight(); d_renderCache.cacheText(this, d_CornerChar_BotRight.d_Char, getFont(), (TextFormatting)RightAligned, Rect(0, getAbsoluteSize().d_height-fFontHeight-2, getAbsoluteSize().d_width-2, getAbsoluteSize().d_height), 0.0f, final_cols); } }
void FalagardPaoPao::updateSelfSize() { FalagardSelfFitWindow::updateSelfSize(); const WidgetLookFeel& wlf = WidgetLookManager::getSingleton().getWidgetLook(d_lookName); if( wlf.isNamedAreaDefined( "TextArea" ) ) { const Rect rectBorder(wlf.getNamedArea("TextArea").getArea().getPixelRect(*this)); Rect wndArea(getAbsoluteRect()); Size size(getAbsoluteSize()); size.d_width += wndArea.getWidth() - rectBorder.getWidth(); size.d_height += wndArea.getHeight() - rectBorder.getHeight(); setSize(Absolute, size); } if( d_ArrowImage.getImage() ) { Size size = d_ArrowImage.getImage()->getSize(); Rect area( getAbsoluteWidth() / 2 - size.d_width / 2, getAbsoluteHeight() - size.d_height, getAbsoluteWidth() / 2 + size.d_width / 2, getAbsoluteHeight() ); d_ArrowImage.setRect( area ); } }
Size OverlayCategory::getAbsoluteSize( castor::Size const & p_size )const { Point2d size = getAbsoluteSize(); return Size{ uint32_t( p_size.getWidth() * size[0] ) , uint32_t( p_size.getHeight() * size[1] ) }; }
Rect FalagardSuperTooltip::ResizeText::getTextRenderArea(void) const { return Rect(d_textArea.asAbsolute(getAbsoluteSize())); }
void Static::onSized(WindowEventArgs& e) { Window::onSized(e); d_frame.setSize(getAbsoluteSize()); e.handled = true; }