/*! \file widget_coloredit.cpp
** \brief Template File
**
-** $Id: widget_coloredit.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
}
bool
-ColorSlider::redraw(GdkEventExpose*bleh)
+ColorSlider::redraw(GdkEventExpose */*bleh*/)
{
Color color(color_);
ATTACH_SPIN_BUTTON(1,G);
SLIDER_ROW(2,B,_("Blue"));
ATTACH_SPIN_BUTTON(2,B);
+
+ hex_color_label = manage(new Gtk::Label(_("HTML code"), 0.0, 0.5));
+ hex_color_label->set_use_markup(false);
+ hex_color_label->set_use_underline(false);
+ hex_color_label->set_attributes(attr_list);
+ table->attach(*hex_color_label, 0, 1, 7, 8, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
+
+ hex_color = manage(new Gtk::Entry());
+ hex_color->set_width_chars(8);
+ hex_color->signal_activate().connect(sigc::mem_fun(*this,&studio::Widget_ColorEdit::on_hex_edited));
+ table->attach(*hex_color, 0, 1, 8, 9, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
}
{
Gtk::Table* table(yuv_table);
}
void
+Widget_ColorEdit::on_hex_edited()
+{
+ Color color(get_value_raw());
+ String s = hex_color->get_text();
+ color.set_hex(s);
+ set_value(color);
+ signal_value_changed_();
+}
+
+void
Widget_ColorEdit::on_value_changed()
{
if(hold_signals)
slider_HUE->set_color(color);
slider_SAT->set_color(color);
slider_A->set_color(color);
+ hex_color->set_text(color.get_hex());
widget_color.set_value(color);
activate();
slider_HUE->set_color(color);
slider_SAT->set_color(color);
slider_A->set_color(color);
+ hex_color->set_text(color.get_hex());
widget_color.set_value(color);
hold_signals=false;
color.set_r(gamma_out(R_adjustment.get_value()/100.0f));
color.set_g(gamma_out(G_adjustment.get_value()/100.0f));
color.set_b(gamma_out(B_adjustment.get_value()/100.0f));
- assert(color.is_valid());
}
else
{
color.set_r(R_adjustment.get_value()/100);
color.set_g(G_adjustment.get_value()/100);
color.set_b(B_adjustment.get_value()/100);
- assert(color.is_valid());
}
color.set_a(A_adjustment.get_value()/100);
assert(color.is_valid());