示例#1
0
//---------------------------------------------------------------------
void __fastcall TColorSetDlg::PCClick(TObject *Sender)
{
	int i, x, pos;
	pos = -1;
	for( i = 0; (i < 8) && (pos < 0); i++ ){
		for(x = 0; x < 4; x++ ){
			if( Sender == GetItem(i, x) ){
				pos = i;
				break;
			}
		}
	}
	TColorDialog *pDialog = Mmsstv->ColorDialog;
	InitCustomColor(pDialog);

	TPanel *pPanel[4];
    for( i = 0; i < 4; i++ ){
		pPanel[i] = GetItem(pos, i);
		AddCustomColor(pDialog, pPanel[i]->Color);
    }

	pDialog->Color = ((TPanel *)Sender)->Color;
	SetDisPaint();
	if( pDialog->Execute() == TRUE ){
		((TPanel *)Sender)->Color = pDialog->Color;
		if( (pPanel[0]->Color == pPanel[1]->Color) && (pPanel[2]->Color == pPanel[3]->Color) ){
			if( YesNoMB( MsgEng ? "Change to two colors gradation?" : "2色のグラデーションに変更しますか?" ) == IDYES ){
				pPanel[1]->Color = GetCol(pPanel[0]->Color, pPanel[3]->Color, 2, 4);
				pPanel[2]->Color = GetCol(pPanel[0]->Color, pPanel[3]->Color, 3, 4);
			}
		}
	}
	ResDisPaint();
}
void __fastcall TTimelineMainForm::btnColorClick(TObject *Sender)
{
  TColorDialog* pCD;
  pCD = new TColorDialog(NULL);

    pCD->Color = FCurColor;
    if( pCD->Execute() )
    {
      FCurColor = pCD->Color;
    }
    delete pCD;

}
示例#3
0
//---------------------------------------------------------------------
void __fastcall TColorBarDlg::PCClick(TObject *Sender)
{
	TPanel *tp = (TPanel *)Sender;
	TColorDialog *pDialog = Mmsstv->ColorDialog;
	InitCustomColor(pDialog);
	AddCustomColor(pDialog, PC1->Color);
	AddCustomColor(pDialog, PC2->Color);
	AddCustomColor(pDialog, PC3->Color);
	AddCustomColor(pDialog, PC4->Color);
	pDialog->Color = tp->Color;
	SetDisPaint();
	if( pDialog->Execute() == TRUE ){
		tp->Color = pDialog->Color;
	}
	ResDisPaint();
}
void __fastcall TTMTimeLineMainForm::btnPenColorClick(TObject *Sender)
{
  TColorDialog* pCD;
  pCD = new TColorDialog(NULL);

  try
  {
    pCD->Color = JvTimeLine1->Selection->Pen->Color;
    if( pCD->Execute() )
    {
      JvTimeLine1->Selection->Pen->Color = pCD->Color;
    }
  }
  __finally
  {
    delete pCD;
  }
}