1 /* === S I N F G =========================================================== */
2 /*! \file dialog_gradient.cpp
3 ** \brief Template File
5 ** $Id: dialog_color.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
31 #include "dialog_color.h"
32 #include "widget_color.h"
33 #include <gtkmm/frame.h>
34 #include <gtkmm/table.h>
35 #include <gtkmm/label.h>
36 #include <sinfg/general.h>
37 #include <sinfgapp/canvasinterface.h>
38 #include <sinfgapp/value_desc.h>
39 #include "widget_color.h"
40 #include <gtkmm/spinbutton.h>
41 #include <sinfgapp/main.h>
42 #include <sigc++/retype_return.h>
43 #include <sigc++/retype.h>
44 #include <sigc++/hide.h>
49 /* === U S I N G =========================================================== */
53 using namespace sinfg;
54 using namespace studio;
56 /* === M A C R O S ========================================================= */
58 /* === G L O B A L S ======================================================= */
60 /* === P R O C E D U R E S ================================================= */
62 /* === M E T H O D S ======================================================= */
64 Dialog_Color::Dialog_Color():
65 Dialog(_("Colors"),false,true),
66 dialog_settings(this,"color"),
68 // adjustment_pos(0,0.0,1.0,0.001,0.001,0.001)
70 set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY);
72 //Gtk::Button *ok_button(manage(new class Gtk::Button(Gtk::StockID("gtk-ok"))));
74 //add_action_widget(*ok_button,2);
75 //ok_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Color::on_ok_pressed));
77 //Gtk::Button *apply_button(manage(new class Gtk::Button(Gtk::StockID("gtk-apply"))));
78 //apply_button->show();
79 //add_action_widget(*apply_button,1);
80 //apply_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Color::on_apply_pressed));
82 Gtk::Button *cancel_button(manage(new class Gtk::Button(Gtk::StockID("gtk-close"))));
83 cancel_button->show();
84 add_action_widget(*cancel_button,0);
85 cancel_button->signal_clicked().connect(sigc::hide_return(sigc::mem_fun(*this, &Dialog_Color::on_close_pressed)));
86 signal_delete_event().connect(sigc::hide(sigc::mem_fun(*this, &Dialog_Color::on_close_pressed)));
88 Gtk::Table* table(manage(new Gtk::Table(2,2,false)));
89 get_vbox()->pack_start(*table);
91 widget_color=manage(new Widget_ColorEdit());
92 widget_color->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Dialog_Color::on_color_changed));
93 //widget_color->signal_activate().connect(sigc::mem_fun(*this,&studio::Dialog_Color::on_color_changed));
94 table->attach(*widget_color, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
96 add_accel_group(App::ui_manager()->get_accel_group());
101 Dialog_Color::~Dialog_Color()
106 Dialog_Color::reset()
108 signal_edited_.clear();
112 Dialog_Color::on_close_pressed()
114 // signal_edited_(get_color());
123 Dialog_Color::on_apply_pressed()
126 signal_edited_(get_color());
131 Dialog_Color::on_color_changed()
134 signal_edited_(get_color());