void CPageController::OnButtonTitleForeground() { // TODO: Add your control notification handler code here CColorDialog dlgColor(this->m_clrTitleForeground, 0, this); if (dlgColor.DoModal() == IDOK) { this->m_clrTitleForeground = dlgColor.GetColor(); this->ShowPreview(); } }
void CColorNewColorRampColorMapDialog::OnColorMapRampBUTTONEditColor() { UpdateData(true); COLORREF m_clr ; m_clr = RGB(m_Red*255,m_Green*255,m_Blue*255); CColorDialog dlgColor(m_clr); if (dlgColor.DoModal() == IDOK) { m_clr = dlgColor.GetColor(); m_Red = GetRValue(m_clr)/255.; m_Green = GetGValue(m_clr)/255.; m_Blue = GetBValue(m_clr)/255.; } Quantity_Color aColor(m_Red,m_Green,m_Blue,Quantity_TOC_RGB); m_ColorList.SetCurSel(aColor.Name()); UpdateData(false); }
void DlgAttributes::OnColor() { Handle(AIS_InteractiveObject) Current ; Quantity_Color CSFColor ; COLORREF MSColor ; myAISContext->InitCurrent(); if (myAISContext->MoreCurrent()) { Current = myAISContext->Current() ; if ( Current->HasColor () ) { CSFColor = Current->Color () ; MSColor = RGB (CSFColor.Red()*255., CSFColor.Green()*255., CSFColor.Blue()*255.); } else { MSColor = RGB (255,255,255) ; } CColorDialog dlgColor(MSColor); if (dlgColor.DoModal() == IDOK) { MSColor = dlgColor.GetColor(); CSFColor = Quantity_Color (GetRValue(MSColor)/255., GetGValue(MSColor)/255., GetBValue(MSColor)/255.,Quantity_TOC_RGB); for (myAISContext->InitCurrent(); myAISContext->MoreCurrent (); myAISContext->NextCurrent ()) myAISContext->SetColor (myAISContext->Current(), CSFColor.Name()); } } TCollection_AsciiString Message ("\ \n\ for (myAISContext->InitCurrent(); myAISContext->MoreCurrent (); \n\ myAISContext->NextCurrent ()) \n\ myAISContext->SetColor (myAISContext->Current(), CSFColor.Name()); \n\ \n"); CString text(Message.ToCString()); (*myCResultDialog).SetTitle(CString("Setting Color")); (*myCResultDialog).SetText(text); }
void OCC_3dView::OnModifyChangeBackground() { Standard_Real R1; Standard_Real G1; Standard_Real B1; myView->BackgroundColor(Quantity_TOC_RGB,R1,G1,B1); COLORREF m_clr ; m_clr = RGB(R1*255,G1*255,B1*255); CColorDialog dlgColor(m_clr); if (dlgColor.DoModal() == IDOK) { m_clr = dlgColor.GetColor(); R1 = GetRValue(m_clr)/255.; G1 = GetGValue(m_clr)/255.; B1 = GetBValue(m_clr)/255.; myView->SetBackgroundColor(Quantity_TOC_RGB,R1,G1,B1); } myView->Redraw(); }
void CLinePlotTestDlg::OnBtnCurrColor() { // get the current plot index. int nIndex = m_LinePlot.Selected(); if (nIndex<0 || nIndex>=m_LinePlot.Count()) AfxMessageBox("There is no plot selected."); else { // get the color. COLORREF crCurr = m_LinePlot.GetColor(nIndex); // show the color dialog. CColorDialog dlgColor(crCurr, CC_FULLOPEN); if (dlgColor.DoModal()==IDOK) { // update the current color. m_LinePlot.SetColor(nIndex, dlgColor.GetColor()); } } }
void OCC_2dView::OnChangeBackground() { Standard_Real R1, G1, B1; Handle(Aspect_Window) aWindow = myV2dView->Window(); Aspect_Background ABack = aWindow->Background(); Quantity_Color aColor = ABack.Color(); aColor.Values(R1,G1,B1,Quantity_TOC_RGB); COLORREF m_clr ; m_clr = RGB(R1*255,G1*255,B1*255); CColorDialog dlgColor(m_clr); if (dlgColor.DoModal() == IDOK) { m_clr = dlgColor.GetColor(); R1 = GetRValue(m_clr)/255.; G1 = GetGValue(m_clr)/255.; B1 = GetBValue(m_clr)/255.; aColor.SetValues(R1,G1,B1,Quantity_TOC_RGB); myV2dView->SetBackgroundColor(aColor); myV2dView->Update(); } }