コード例 #1
0
ファイル: ClipEditor.cpp プロジェクト: 2asoft/xray
void __fastcall TClipMaker::BPOnPaint(TObject *Sender)
{
	TMxPanel* bp 		= dynamic_cast<TMxPanel*>(Sender); VERIFY(bp);
    CEditableObject* O	= 	m_CurrentObject; VERIFY(O);
    TCanvas* canvas 	= bp->Canvas;
    canvas->Font->Name 	= "MS Sans Serif";
    canvas->Font->Style	= TFontStyles();
    canvas->Font->Color = clBlack;
    canvas->Pen->Color	= clBlack;
    canvas->Pen->Style	= psSolid;
    canvas->Brush->Style= bsSolid;
    if (-2==bp->Tag){
        for (UIClipIt it=clips.begin(); it!=clips.end(); it++){
	        canvas->Brush->Color= (*it==sel_clip)?(drag_obj==bp->Tag?BP_ACTIVE_DRAG_COLOR:BP_ACTIVE_COLOR):BP_INACTIVE_COLOR;
            TRect R 			= TRect((*it)->PLeft(), 1, (*it)->PRight()-1, 15);
    	    AnsiString fx_name	= (*it)->FXName();
            if (!fx_name.IsEmpty()){
                canvas->Rectangle	(R);
                R.Top				+= 1;
                R.Bottom			-= 1;
                R.Left				+= 1;
                R.Right				-= 1;
                canvas->TextRect	(R,R.Left,R.Top,fx_name);
            }
        }
    }else if ((bp->Tag>=0)&&(bp->Tag<(int)O->BoneParts().size())){
        AnsiString mn_prev		= "";
        for (UIClipIt it=clips.begin(); it!=clips.end(); it++){
            AnsiString mn		= (*it)->CycleName(u16(bp->Tag));
            TRect R 			= TRect((*it)->PLeft(), 1, (*it)->PRight()-1, 15);
            if (!mn.IsEmpty()){
                canvas->Brush->Color= (*it==sel_clip)?(drag_obj==bp->Tag?BP_ACTIVE_DRAG_COLOR:BP_ACTIVE_COLOR):BP_INACTIVE_COLOR;
                canvas->Rectangle	(R);
                R.Top				+= 1;
                R.Bottom			-= 1;
                R.Left				+= 1;
                R.Right				-= 1;
                canvas->TextRect	(R,R.Left,R.Top,mn);
	            mn_prev				= mn;
            }else if (!mn_prev.IsEmpty()){
	            canvas->MoveTo		((*it)->PLeft()+1,13);
                canvas->LineTo		(R.Right,13);
                canvas->LineTo		(R.Width()>5?R.Right-5:R.Right-R.Width(),8);
                R.Top				+= 1;
                R.Bottom			-= 1;
                R.Left				+= 1;
                R.Right				-= 1;
            }
        }
    }
}
コード例 #2
0
ファイル: ClipEditor.cpp プロジェクト: 2asoft/xray
void TClipMaker::RealRepaintClips()
{
    m_RTFlags.set		(flRT_RepaintClips,FALSE);
    // repaint
    paClips->Repaint	();
    gtClip->Repaint		();
    paBP0->Repaint		();
    paBP1->Repaint		();
    paBP2->Repaint		();
    paBP3->Repaint		();          
    paFXs->Repaint		();

	// set BP name                   
    CEditableObject* O	= m_CurrentObject;
    u32 k				= 0;
    if (O){
	    BPVec& bps 		= O->BoneParts();
        for (; k<bps.size(); k++)
        	m_LB[k]->Caption = bps[k].alias.c_str();
    }
	for (; k<4; k++)	m_LB[k]->Caption	= "-";
    UpdateProperties	();
}