Beispiel #1
0
void FalagardActionButton::drawSelf( float z )
{
    if (d_needsRedraw  )
    {
        d_renderCache.clearCachedImagery();
        d_needsRedraw = false;
        const StateImagery* imagery;
        // get WidgetLookFeel for the assigned look.
        const WidgetLookFeel& wlf = WidgetLookManager::getSingleton().getWidgetLook(d_lookName);
        if( wlf.isStateImageryPresent( "BackgroundImage" ) )
        {
            imagery = &wlf.getStateImagery( "BackgroundImage" );
            // peform the rendering operation.
            imagery->render(*this);
        }
        // 画背景

        d_BackImage.draw(d_renderCache);
        //Empty
        if(isEmpty())
        {
            if((isHovering() || isPushed()) && !isDisabled(true) )//&& !isGloom())
            {
                drawHover(z);
            }
        }
        else
        {
            //Draw normal image
            drawNormal(z);

            //Draw percentage Img
            if(isPercentagePresent())
            {
                drawPercentageImg(z);
            }

            //Notin Dragging
            if(d_dragging && !isGloom())
            {
                drawPushed(z);
            }
            else
            {
                //Draw disable mask only when disabled
                if (isDisabled(true) || isGloom() )
                {
                    drawDisabled(z);
                    if (isPushed() || isChecked())
                    {
                        drawPushed(z);
                    }
                    drawAnimate(z);
                }
                else
                {
                    //If pushed or checked draw "Pushed" Layer
                    if (isPushed() || isChecked())
                    {
                        drawPushed(z);
                    }

                    //Draw "Hover" Layer
                    if (isHovering() && !isChecked())
                    {
                        drawHover(z);
                    }

                    drawAnimate(z);
                    // If default
                    if(isDefault())
                    {
                        drawDefault(z);
                    }

                }

                //Draw corner character
                drawCorner(z);
                drawFlash( z );
            }
        }
    }

    Window::drawSelf(z);
}
	void FalagardActionButton::drawSelf( float z )
	{
		if (d_needsRedraw  )
		{
			d_renderCache.clearCachedImagery();
			d_needsRedraw = false;
			
			//Empty
			if(isEmpty())
			{
				if((isHovering() || isPushed()) && !isDisabled(true) )//&& !isGloom())
				{
					drawHover(z);
				}
			}
			else
			{
				//Draw normal image
				drawNormal(z);

				//Notin Dragging
				if(d_dragging && !isGloom())
				{
					drawPushed(z);
				}
				else
				{
					//Draw disable mask only when disabled
					if (isDisabled(true) || isGloom() )
					{
						drawDisabled(z);
						if (isPushed() || isChecked()) 
						{
							drawPushed(z);
						}
					}
					else
					{
						//If pushed or checked draw "Pushed" Layer
						if (isPushed() || isChecked()) 
						{
							drawPushed(z);
						}

						//Draw "Hover" Layer
						if (isHovering() && !isChecked())
						{
							drawHover(z);
						}

						drawAnimate(z);
						// If default
						if(isDefault())
						{
							drawDefault(z);
						}
						
					}

					//Draw corner character
					drawCorner(z);
				}
			}
		}

		Window::drawSelf(z);
	}