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;
}
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;
}
Beispiel #3
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;
}
Beispiel #4
0
void LineGraph::RenderGraph(int eventsOfset)
{
	primitives_PaintRect16(m_surface, &m_surfaceRect, g_colorSet->GetColor(COLOR_BLACK));
	primitives_FrameRect16(m_surface, &m_surfaceRect, g_colorSet->GetColor(COLOR_WHITE));
	primitives_FrameRect16(m_surface, &m_graphRect, g_colorSet->GetColor(COLOR_WHITE));

	DrawThisStateImage(
		0,
		m_surface,
		&m_surfaceRect );

	LabelAxes();
	DrawLines(eventsOfset);
	if (m_hasIndicator) DrawIndicator();
}
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;
}
AUI_ERRCODE ctp2_HyperTextBox::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.left -= k_CTP2_HYPERTEXTBOX_INSETWIDTH;
	rect.top -= k_CTP2_HYPERTEXTBOX_INSETWIDTH;
	rect.bottom += k_CTP2_HYPERTEXTBOX_INSETWIDTH;

	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 );
		}
		if(m_bevelWidth > 0) {
			primitives_BevelRect16( surface, &rect, m_bevelWidth, 1, 16, 16);
		}

	}




	DrawThisStateImage(
		0,
		surface,
		&rect );

	
	rect.left += k_CTP2_HYPERTEXTBOX_INSETWIDTH;
	rect.top += k_CTP2_HYPERTEXTBOX_INSETWIDTH;
	rect.bottom -= k_CTP2_HYPERTEXTBOX_INSETWIDTH;

	DrawThisHyperText(
		surface,
		&rect,
		0,
		-m_ranger->GetValueY() );
















	
	rect.left -= k_CTP2_HYPERTEXTBOX_INSETWIDTH;
	rect.top -= k_CTP2_HYPERTEXTBOX_INSETWIDTH;
	rect.bottom += k_CTP2_HYPERTEXTBOX_INSETWIDTH;




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

	return AUI_ERRCODE_OK;
}
Beispiel #7
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;
}