/// @brief Change colour of preview's background void DialogStyleEditor::OnPreviewColourChange (wxCommandEvent &evt) { ColourButton *btn = static_cast<ColourButton*>(evt.GetClientData()); if (!btn) evt.Skip(); else { SubsPreview->SetColour(btn->GetColor()); OPT_SET("Colour/Style Editor/Background/Preview")->SetColor(btn->GetColor()); } }
/// @brief Sets color for one of the four color buttons /// @param n Colour to set void DialogStyleEditor::OnSetColor(int n, wxCommandEvent& evt) { ColourButton *btn = static_cast<ColourButton*>(evt.GetClientData()); if (!btn) { evt.Skip(); return; } switch (n) { case 1: work->primary = btn->GetColor(); break; case 2: work->secondary = btn->GetColor(); break; case 3: work->outline = btn->GetColor(); break; case 4: work->shadow = btn->GetColor(); break; default: throw agi::InternalError("attempted setting colour id outside range", 0); } if (SubsPreview) SubsPreview->SetStyle(*work); }
void operator()(wxCommandEvent& evt) { ColourButton *btn = static_cast<ColourButton*>(evt.GetClientData()); if (btn) parent->SetOption(new agi::OptionValueColor(name, btn->GetColor())); evt.Skip(); }