//----------------------------------------------------------------------------- // Purpose: // Input : drawHelper - // &rcWAV - //----------------------------------------------------------------------------- void CChoreoEventWidget::DrawRelativeTags( CChoreoWidgetDrawHelper& drawHelper, RECT &rcWAV, float length, CChoreoEvent *event ) { for ( int i = 0; i < event->GetNumRelativeTags(); i++ ) { CEventRelativeTag *tag = event->GetRelativeTag( i ); if ( !tag ) continue; // int left = rcWAV.left + (int)( tag->GetPercentage() * ( float )( rcWAV.right - rcWAV.left ) + 0.5f ); RECT rcMark; rcMark = rcWAV; rcMark.top -= 2; rcMark.bottom = rcMark.top + 6; rcMark.left = left - 3; rcMark.right = left + 3; drawHelper.DrawTriangleMarker( rcMark, RGB( 0, 100, 250 ) ); RECT rcText; rcText = rcMark; rcText.top -= 12; int len = drawHelper.CalcTextWidth( "Arial", 9, FW_NORMAL, tag->GetName() ); rcText.left = left - len / 2; rcText.right = rcText.left + len + 2; rcText.bottom = rcText.top + 10; drawHelper.DrawColoredText( "Arial", 9, FW_NORMAL, RGB( 0, 100, 200 ), rcText, tag->GetName() ); } }
void CBaseEventPropertiesDialog::PopulateTagList( CEventParams *params ) { CChoreoScene *scene = params->m_pScene; if ( !scene ) return; HWND control = GetControl( IDC_TAGS ); if ( control ) { SendMessage( control, CB_RESETCONTENT, 0, 0 ); SendMessage( control, WM_SETTEXT , 0, (LPARAM)va( "\"%s\" \"%s\"", params->m_szTagName, params->m_szTagWav ) ); for ( int i = 0; i < scene->GetNumActors(); i++ ) { CChoreoActor *a = scene->GetActor( i ); if ( !a ) continue; for ( int j = 0; j < a->GetNumChannels(); j++ ) { CChoreoChannel *c = a->GetChannel( j ); if ( !c ) continue; for ( int k = 0 ; k < c->GetNumEvents(); k++ ) { CChoreoEvent *e = c->GetEvent( k ); if ( !e ) continue; if ( e->GetNumRelativeTags() <= 0 ) continue; // add each tag to combo box for ( int t = 0; t < e->GetNumRelativeTags(); t++ ) { CEventRelativeTag *tag = e->GetRelativeTag( t ); if ( !tag ) continue; SendMessage( control, CB_ADDSTRING, 0, (LPARAM)va( "\"%s\" \"%s\"", tag->GetName(), e->GetParameters() ) ); } } } } } }