Exemplo n.º 1
0
/// @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());
	}
}
Exemplo n.º 2
0
/// @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);
}
Exemplo n.º 3
0
	void operator()(wxCommandEvent& evt) {
		ColourButton *btn = static_cast<ColourButton*>(evt.GetClientData());
		if (btn)
			parent->SetOption(new agi::OptionValueColor(name, btn->GetColor()));
		evt.Skip();
	}