void ControlPanel::redraw()
{
	if ( !ToolCanDraw() )
		return;

	CChoreoWidgetDrawHelper helper( this, GetSysColor( COLOR_BTNFACE ) );
	HandleToolRedraw( helper );

	BaseClass::redraw();
}
예제 #2
0
void MatSysWindow::redraw()
{
	BaseClass::redraw();
return;
	if ( IsLocked() )
	{
		RECT bounds;
		GetClientRect( (HWND)getHandle(), &bounds );
		bounds.bottom = bounds.top + GetCaptionHeight();
		CChoreoWidgetDrawHelper helper( this, bounds );
		HandleToolRedraw( helper );
	}
}
void mxStatusWindow::redraw()
{
//	if ( !ToolCanDraw() )
//		return;

	if ( !m_pScrollbar )
		return;

	CChoreoWidgetDrawHelper helper( this, RGB( 0, 0, 0 ) );
	HandleToolRedraw( helper );

	RECT rc;
	helper.GetClientRect( rc );

	RECT rcText = rc;

	int lineheight = ( STATUS_FONT_SIZE + 2 );

	InflateRect( &rcText, -4, 0 );
	rcText.bottom = h2() - 4;
	rcText.top = rcText.bottom - lineheight;

	//int minval = m_pScrollbar->getMinValue();
	int maxval = m_pScrollbar->getMaxValue();
	int pagesize = m_pScrollbar->getPagesize();
	int curval = m_pScrollbar->getValue();

	int offset = ( maxval - pagesize ) - curval;
	offset = ( offset + lineheight - 1 ) / lineheight;

	offset = max( 0, offset );
	//offset = 0;
	//offset += 10;
	//offset = max( 0, offset );

	for ( int i = 0; i < MAX_TEXT_LINES - offset; i++ )
	{
		int rawline = m_nCurrentLine - i - 1;
		if ( rawline <= 0 )
			continue;

		if ( rcText.bottom < 0 )
			break;

		int line = ( rawline - offset ) & TEXT_LINE_MASK;

		char *ptext = m_rgTextLines[ line ].m_szText;
		
		RECT rcTime = rcText;
		rcTime.right = rcTime.left + 50;

		char sz[ 32 ];
		sprintf( sz, "%.3f",  m_rgTextLines[ line ].curtime );

		int len = helper.CalcTextWidth( "Arial", STATUS_FONT_SIZE, FW_NORMAL, sz );

		rcTime.left = rcTime.right - len - 5;

		helper.DrawColoredText( "Arial", STATUS_FONT_SIZE, FW_NORMAL, RGB( 255, 255, 150 ), rcTime, sz );

		rcTime = rcText;
		rcTime.left += 50;

		helper.DrawColoredText( "Arial", STATUS_FONT_SIZE, FW_NORMAL, m_rgTextLines[ line ].rgb, rcTime, ptext );

		OffsetRect( &rcText, 0, -lineheight );
	}

	DrawActiveTool();
}
void mxExpressionTray::redraw()
{
	if ( !ToolCanDraw() )
		return;

	bool updateSelection = false;

	CExpClass *active = expressions->GetActiveClass();
	if ( active && active->GetNumExpressions() != m_nPreviousExpressionCount )
	{
		m_nTopOffset = 0;

		RepositionSlider();
		m_nPreviousExpressionCount = active->GetNumExpressions();
	}

	CChoreoWidgetDrawHelper helper( this, GetSysColor( COLOR_BTNFACE ) );
	HandleToolRedraw( helper );

	int w, h;
	w = w2();
	h = h2();

	if ( active )
	{
		RECT clipRect;
		helper.GetClientRect( clipRect );
		
		clipRect.top += TOP_GAP + GetCaptionHeight();

		helper.StartClipping( clipRect );

		if ( m_nLastNumExpressions != active->GetNumExpressions() )
		{
			m_nTopOffset = 0;
			m_nLastNumExpressions = active->GetNumExpressions();
			RepositionSlider();
			updateSelection = true;
		}

		int selected = active->GetSelectedExpression();

		int rcx, rcy, rcw, rch;

		int c = 0;
		while ( c < active->GetNumExpressions() )
		{
			if ( !ComputeRect( c, rcx, rcy, rcw, rch ) )
			{
				c++;
				continue;
			}

			CExpression *current = active->GetExpression( c );
			if ( !current )
				break;

			DrawThumbNail( active, current, helper, rcx, rcy, rcw, rch, c, selected, updateSelection );

			c++;
		}

		helper.StopClipping();

	}
	else
	{

		RECT rc;
		helper.GetClientRect( rc );

		// Arial 36 normal
		char sz[ 256 ];
		sprintf( sz, "No expression file loaded" );

		int pointsize = 18;

		int textlen = helper.CalcTextWidth( "Arial", pointsize, FW_NORMAL, sz );

		RECT rcText;
		rcText.top = ( rc.bottom - rc.top ) / 2 - pointsize / 2;
		rcText.bottom = rcText.top + pointsize + 10;
		int fullw = rc.right - rc.left;

		rcText.left = rc.left + ( fullw - textlen ) / 2;
		rcText.right = rcText.left + textlen;

		helper.DrawColoredText( "Arial", pointsize, FW_NORMAL,  RGB( 80, 80, 80 ), rcText, sz );
	}


// 	ValidateRect( (HWND)getHandle(), &rc );
}