Esempio n. 1
0
AUI_ERRCODE TextBox::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 );

	primitives_BevelRect16( surface, &rect, 1, 1, 16, 16 );

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

	return AUI_ERRCODE_OK;
}
Esempio n. 2
0
AUI_ERRCODE BattleViewWindow::DrawThis(aui_Surface *surface, sint32 x, sint32 y)
{
	
	if ( IsHidden() ) return AUI_ERRCODE_OK;

	
	C3Window::DrawThis(surface, x, y);

	if (!surface) surface = TheSurface();

	RECT rect = {0, 0, Width(), Height()};

	
	rect = m_battleViewRect;
	OffsetRect(&rect, -rect.left, -rect.top);

	
	if (m_battleView && m_battleView->GetBattleSurface()) 
		g_c3ui->TheBlitter()->Blt(surface, m_battleViewRect.left, m_battleViewRect.top, 
			m_battleView->GetBattleSurface(), &rect, k_AUI_BLITTER_FLAG_COPY);

	
	m_dirtyList->AddRect( &rect );

	
	rect = m_battleViewRect;
	InflateRect(&rect, 5, 5);
	primitives_BevelRect16( surface, &rect, 5,1, 16, 16 );

	
	m_dirtyList->AddRect( &rect );

	return AUI_ERRCODE_OK;
}
Esempio n. 3
0
AUI_ERRCODE ControlSheet::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 );
		}
	}

	if ( m_border )
		primitives_BevelRect16( surface, &rect, 2, 1, 16, 16 );

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

	return AUI_ERRCODE_OK;
}
Esempio 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;
}
Esempio n. 5
0
AUI_ERRCODE DebugWindow::DrawThis( aui_Surface *surface, sint32 x, sint32 y )
{
	
	if ( IsHidden() ) return AUI_ERRCODE_OK;

	RECT rect = { 0, 0, m_width, m_height };

	m_pattern->Draw( m_surface, &rect );

	
	primitives_BevelRect16( m_surface, &rect, 1, 0, 16, 16 );

	
	m_dirtyList->AddRect( &rect );

	return AUI_ERRCODE_OK;
}
Esempio n. 6
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;
}
Esempio n. 7
0
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;
}
Esempio n. 8
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;
}
Esempio n. 9
0
AUI_ERRCODE C3Slider::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 dirtyRect = rect;

	if ( m_orientation == AUI_RANGER_ORIENTATION_VERTICAL )
		InflateRect( &rect, -m_width / 2 + 8, 0 );
	else
		InflateRect( &rect, 0, -m_height / 2 + 8 );

	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, &dirtyRect , &srcRect );
		}
		else {
			m_pattern->Draw( surface, &dirtyRect  );
		}
	}


	if ( m_ticks && m_quantized )
	{
		if ( m_orientation == AUI_RANGER_ORIENTATION_VERTICAL )
		{
			sint32 spacing = m_height / ( m_maxY - m_minY ) - 1;
			RECT tickRect;
			for ( sint32 i = m_maxY - m_minY; i >= 0; i -= m_ticks )
			{
				tickRect.top =
					i * spacing + dirtyRect.top + m_minThumbSize / 2;
				tickRect.left = dirtyRect.left + 6;
				tickRect.bottom = tickRect.top + 3;
				tickRect.right = tickRect.left + 6;
				primitives_BevelRect16( surface, &tickRect, 1, 1, 16, 16 );
				tickRect.left = dirtyRect.right - 12;
				tickRect.right = dirtyRect.right - 6;
				primitives_BevelRect16( surface, &tickRect, 1, 1, 16, 16 );
			}
		}
		else
		{
			sint32 spacing = m_width / ( m_maxX - m_minX ) - 1;
			RECT tickRect;
			for ( sint32 i = m_maxX - m_minX; i >= 0; i -= m_ticks )
			{
				tickRect.left =
					i * spacing + dirtyRect.left + m_minThumbSize / 2;
				tickRect.top = dirtyRect.top + 6;
				tickRect.right = tickRect.left + 3;
				tickRect.bottom = tickRect.top + 6;
				primitives_BevelRect16( surface, &tickRect, 1, 1, 16, 16 );
				tickRect.top = dirtyRect.bottom - 12;
				tickRect.bottom = dirtyRect.bottom - 6;
				primitives_BevelRect16( surface, &tickRect, 1, 1, 16, 16 );
			}
		}
	}

	RECT origRect = rect;
	primitives_BevelRect16( surface, &origRect, 2, 0, 16, 16 );
	InflateRect( &rect, -4, -4 );
	primitives_BevelRect16( surface, &rect, 1, 1, 16, 16 );
	if ( IsActive() )
	{

		primitives_BevelRect16( surface, &rect, 1, 1, 16, 16 );
	}

	InflateRect( &rect, -1, -1 );
	primitives_PaintRect16( surface, &rect, 0x0000 );

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

	return AUI_ERRCODE_OK;
}
Esempio n. 10
0
AUI_ERRCODE TextSwitch::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 );

	primitives_FrameRect16(surface, &rect, g_colorSet->GetColor(COLOR_BLACK));

	











	if ( IsOn() )
		primitives_BevelRect16( surface, &rect, 2, 1, 16, 16 );
	else
		primitives_BevelRect16( surface, &rect, 2, 0, 16, 16 );

	if ( IsActive() )
	{
		
		if ( IsOn() )
		{
			
		}
		else
		{
			
		}

		
		if (m_text) {




			textutils_CenteredDropString(surface, m_text, &rect, 9, COLOR_BUTTON_TEXT_HILITE, 0);
		}
	}
	else
	{
		
		if (m_text) {




			textutils_CenteredDropString(surface, m_text, &rect, 9, COLOR_BUTTON_TEXT_PLAIN, 0);

		}
	}

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

	return AUI_ERRCODE_OK;
}
Esempio n. 11
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;
}