Exemplo n.º 1
0
AUI_ERRCODE ctp2_Button::DrawThis(aui_Surface *surface,
								  sint32 x,
								  sint32 y)
{

	if(IsHidden())
		return AUI_ERRCODE_OK;

	if(!surface)
		surface = m_window->TheSurface();

	RECT rect = { 0, 0, m_width, m_height };
	OffsetRect( &rect, m_x + x, m_y + y );
	ToWindow( &rect );

	DrawLayers(surface, &rect);

	DrawThisText(surface, &rect);


	if(surface == m_window->TheSurface())
		m_window->AddDirtyRect(&rect);

	if(m_window->GetFocusControl() == this) {
		primitives_FrameThickRect16(surface, &rect, g_colorSet->GetColor(COLOR_UI_BOX), 3);
	}

	return AUI_ERRCODE_OK;
}
Exemplo n.º 2
0
AUI_ERRCODE aui_Button::DrawThis(
	aui_Surface *surface,
	sint32 x,
	sint32 y )
{

	if ( IsHidden() ) return AUI_ERRCODE_OK;

	if ( !surface ) surface = m_window->TheSurface();

	RECT rect = { 0, 0, m_width, m_height };
	OffsetRect( &rect, m_x + x, m_y + y );
	ToWindow( &rect );

	DrawThisStateImage(
		IsDown() ? 1 : 0,
		surface,
		&rect );

	DrawThisText(
		surface,
		&rect );

	if ( surface == m_window->TheSurface() )
		m_window->AddDirtyRect( &rect );

	return AUI_ERRCODE_OK;
}
Exemplo n.º 3
0
AUI_ERRCODE aui_Control::DrawThis(
	aui_Surface *surface,
	sint32 x,
	sint32 y )
{

	if ( IsHidden() ) return AUI_ERRCODE_OK;

	if ( !surface ) surface = m_window->TheSurface();

	RECT rect = { 0, 0, m_width, m_height };
	OffsetRect( &rect, m_x + x, m_y + y );
	ToWindow( &rect );

	if(m_numberOfLayers > 0)
		DrawLayers(surface, &rect);
	else
		DrawThisStateImage(0, surface, &rect);

	DrawThisText(
		surface,
		&rect );

	if ( surface == m_window->TheSurface() )
		m_window->AddDirtyRect( &rect );

	return AUI_ERRCODE_OK;
}
Exemplo n.º 4
0
AUI_ERRCODE c3_Radio::DrawThis(
	aui_Surface *surface,
	sint32 x,
	sint32 y )
{

	if ( IsHidden() ) return AUI_ERRCODE_OK;

	if ( !surface ) surface = m_window->TheSurface();

	RECT rect = { 0, 0, m_width, m_height };
	OffsetRect( &rect, m_x + x, m_y + y );
	ToWindow( &rect );

	if ( m_pattern ) {
		if ( m_srcWidthPix || m_srcHeightPix ) {
			RECT srcRect = { m_srcX, m_srcY, m_srcX + m_srcWidthPix, m_srcY + m_srcHeightPix };
			m_pattern->Draw( surface, &rect, &srcRect );
		}
		else {
			m_pattern->Draw( surface, &rect );
		}
	}

	DrawThisStateImage(
		m_state ? m_state : IsOn() ? 1 : 0,
		surface,
		&rect );

	if (m_bevelWidth > 0) {
		if ( m_bevelType == 2 ) {
			if ( IsOn() ) {
				primitives_FrameThickRect16( surface, &rect, g_colorSet->GetColor( COLOR_UI_BOX ), m_bevelWidth );
			}
		}
		else {
			if ( IsOn() ) {
				primitives_BevelRect16( surface, &rect, m_bevelWidth, (IsOn() ? 1 : 0), 16, 16 );
			}
		}
	}

	DrawThisText(
		surface,
		&rect );

	if ( surface == m_window->TheSurface() )
		m_window->AddDirtyRect( &rect );

	return AUI_ERRCODE_OK;
}
Exemplo n.º 5
0
AUI_ERRCODE c3_ColoredStatic::DrawThis(
	aui_Surface *surface,
	sint32 x,
	sint32 y )
{
	
	if ( IsHidden() ) return AUI_ERRCODE_OK;

	if ( !surface ) surface = m_window->TheSurface();

	RECT rect = { 0, 0, m_width, m_height };
	OffsetRect( &rect, m_x + x, m_y + y );
	ToWindow( &rect );

	
	if ( m_pattern ) 
		m_pattern->Draw( surface, &rect );

	
	DrawThisStateImage(
		0,
		surface,
		&rect );

	if (m_color != COLOR_MAX) {
		primitives_PaintRect16(surface, &rect, g_colorSet->GetColor(m_color));
	}

	
	if (m_bevelWidth > 0) {
		primitives_BevelRect16( surface, &rect, m_bevelWidth, m_bevelType, 16, 16 );
	}

	
	DrawThisText(
		surface,
		&rect );

	if ( surface == m_window->TheSurface() )
		m_window->AddDirtyRect( &rect );

	return AUI_ERRCODE_OK;
}
Exemplo n.º 6
0
AUI_ERRCODE c3_Icon::DrawThis(
	aui_Surface *surface,
	sint32 x,
	sint32 y )
{
	
	if ( IsHidden() ) return AUI_ERRCODE_OK;

	if ( !surface ) surface = m_window->TheSurface();

	RECT rect = { 0, 0, m_width, m_height };
	OffsetRect( &rect, m_x + x, m_y + y );
	ToWindow( &rect );

	
	if ( m_pattern ) 
		m_pattern->Draw( surface, &rect );

	
	DrawThisStateImage(
		0,
		surface,
		&rect );

	
	if (m_mapIcon != MAPICON_MAX) {
		if (m_color != COLOR_MAX) {
			POINT where;
			TileSet		*tileSet = g_tiledMap->GetTileSet();
			POINT iconDim = tileSet->GetMapIconDimensions( m_mapIcon );

			
			where.x = ( m_width - iconDim.x ) / 2;
			if (where.x < 0) where.x = 0;
			where.y = ( m_height - iconDim.y ) / 2;
			if (where.y < 0) where.y = 0;

			where.x += rect.left;
			where.y += rect.top;
			
			
			Pixel16 *icon;

			icon = tileSet->GetMapIconData( m_mapIcon );
			Assert(icon); 
			if (!icon) return AUI_ERRCODE_OK;

			g_tiledMap->DrawColorizedOverlay( icon, surface, where.x, where.y, g_colorSet->GetColor(m_color) );
		}
	}

	
	if (m_bevelWidth > 0) {
		primitives_BevelRect16( surface, &rect, m_bevelWidth, m_bevelType, 16, 16 );
	}

	
	DrawThisText(
		surface,
		&rect );

	if ( surface == m_window->TheSurface() )
		m_window->AddDirtyRect( &rect );

	return AUI_ERRCODE_OK;
}
Exemplo n.º 7
0
AUI_ERRCODE TextRadio::DrawThis( aui_Surface *surface, sint32 x, sint32 y )
{
	
	

	
	if ( IsHidden() ) return AUI_ERRCODE_OK;

	if ( !surface ) surface = m_window->TheSurface();

	
	RECT rect = { 0, 0, m_width, m_height };
	OffsetRect( &rect, m_x + x, m_y + y );
	ToWindow( &rect );

	
	RECT buttonRect = { 0, m_height / 2 - 10, 0, 0 };
	buttonRect.right = buttonRect.left + 20;
	buttonRect.bottom = buttonRect.top + 20;
	OffsetRect( &buttonRect, rect.left, rect.top );

	
	if ( m_pattern )
		m_pattern->Draw( surface, &buttonRect );

	if ( IsOn() )
	{
		
		primitives_BevelRect16( surface, &buttonRect, 1, 1, 16, 16 );
	}
	else
	{
		
		primitives_BevelRect16( surface, &buttonRect, 2, 0, 16, 16 );
	}

	if ( IsActive() )
	{
		
		if ( IsOn() )
		{
			
			primitives_BevelRect16( surface, &buttonRect, 1, 1, 16, 16 );
		}
		else
		{
			
			primitives_BevelRect16( surface, &buttonRect, 2, 0, 16, 16 );
		}
	}
	else
	{
		
	}

	if ( IsActive() )
		SetTextColor(g_colorSet->GetColorRef(COLOR_BUTTON_TEXT_HILITE));

	else
		SetTextColor(g_colorSet->GetColorRef(COLOR_BUTTON_TEXT_PLAIN));


	
	DrawThisText(surface, &rect);

	if ( surface == m_window->TheSurface() )
		m_window->AddDirtyRect( &rect );

	return AUI_ERRCODE_OK;
}