void HTMLButcherMaskAreaImageFormatDialog::OnSelectColor(ButcherImageViewColorEvent &event) { wxRadioBox *selectionctrl = (wxRadioBox*)FindWindow(ID_TRANSPARENTSELECTION); int cid=ID_PROC_HOVERCOLOR; if (event.GetSelect()==ButcherImageViewColorEvent::CS_SELECT || event.GetSelect()==ButcherImageViewColorEvent::CS_CONFIRM) { cid=ID_PROC_SELCOLOR; if (event.GetSelect()==ButcherImageViewColorEvent::CS_CONFIRM) { if (selectionctrl->GetSelection()==0) AddTColor(event.GetColor()); else AddTPixel(event.GetPixel()); UpdateDisplay(); } } wxTextCtrl *ct=(wxTextCtrl*)FindWindow(cid); // some combinations of the fg/bg colours may be unreadable, so we invert // the colour to make sure fg colour is different enough from m_colour wxColour colFg(~event.GetColor().Red(), ~event.GetColor().Green(), ~event.GetColor().Blue()); ct->SetForegroundColour(colFg); ct->SetBackgroundColour(event.GetColor()); ct->SetValue(wxString::Format(wxT("%s (%d,%d)"), event.GetColor().GetAsString(wxC2S_HTML_SYNTAX).c_str(), event.GetPixel().x, event.GetPixel().y)); event.Skip(); }
void HTMLButcherMaskAreaEditDialog::OnSelectColor(ButcherImageViewColorEvent &event) { if (ButcherOptions::GetEditMode(GetProject()->GetOptions())>=ButcherOptions::EM_NORMAL) { int cid=ID_PROC_HOVERCOLOR; if (event.GetSelect()==ButcherImageViewColorEvent::CS_SELECT || event.GetSelect()==ButcherImageViewColorEvent::CS_CONFIRM) { cid=ID_PROC_SELCOLOR; if (ButcherOptions::GetEditMode(GetProject()->GetOptions())>=ButcherOptions::EM_NORMAL) { if (event.GetSelect()==ButcherImageViewColorEvent::CS_CONFIRM) { wxColourPickerCtrl *bgcolorctrl=(wxColourPickerCtrl*)FindWindow(ID_BGCOLOR); bgcolorctrl->SetColour(event.GetColor()); } } } wxTextCtrl *ct=(wxTextCtrl*)FindWindow(cid); // some combinations of the fg/bg colours may be unreadable, so we invert // the colour to make sure fg colour is different enough from m_colour wxColour colFg(~event.GetColor().Red(), ~event.GetColor().Green(), ~event.GetColor().Blue()); ct->SetForegroundColour(colFg); ct->SetBackgroundColour(event.GetColor()); ct->SetValue(event.GetColor().GetAsString(wxC2S_HTML_SYNTAX)); //SetTitle(event.GetColor().GetAsString(wxC2S_HTML_SYNTAX)); } event.Skip(); }