summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e85b635)
raw | patch | inline | side by side (parent: e85b635)
author | keescook <keescook@users.sourceforge.net> | |
Sun, 30 Dec 2007 02:05:21 +0000 (02:05 +0000) | ||
committer | keescook <keescook@users.sourceforge.net> | |
Sun, 30 Dec 2007 02:05:21 +0000 (02:05 +0000) |
src/ui/widget/rendering-options.cpp | patch | blob | history | |
src/ui/widget/rendering-options.h | patch | blob | history |
index 9ea7c07bdc691eff48bc66d0c1e73fbdfbee6a75..1a1e600522ab74277f0acd1af52db59a78260c29 100644 (file)
namespace UI {
namespace Widget {
+void
+RenderingOptions::_toggled()
+{
+ _frame_bitmap.set_sensitive(as_bitmap());
+}
+
/**
* Construct a Rendering Options widget
*
RenderingOptions::RenderingOptions () :
Gtk::VBox (),
- //Labelled(label, tooltip, new Gtk::VBox(), suffix, icon, mnemonic),
- _radio_cairo ( new Gtk::RadioButton () ),
- //_radio_bitmap( new Gtk::RadioButton (_radio_cairo->get_group ()),
- _radio_bitmap( new Gtk::RadioButton () ),
- _widget_cairo( Glib::ustring(_("_Vector")),
- Glib::ustring(_("Render using Cairo vector operations. The resulting image is usually smaller in file "
+ _radio_vector ( Glib::ustring(_("Vector")) ),
+ _radio_bitmap ( Glib::ustring(_("Bitmap")) ),
+ _frame_backends ( Glib::ustring(_("Backend")) ),
+ _frame_bitmap ( Glib::ustring(_("Bitmap options")) ),
+ _dpi( _("DPI"),
+ Glib::ustring(_("Preferred resolution of rendering, "
+ "in dots per inch.")),
+ 1,
+ Glib::ustring(""), Glib::ustring(""),
+ false)
+{
+ // set up tooltips
+ _tt.set_tip (_radio_vector, Glib::ustring(
+ _("Render using Cairo vector operations. "
+ "The resulting image is usually smaller in file "
"size and can be arbitrarily scaled, but some "
- "filter effects will not be correctly rendered.")),
- _radio_cairo,
- Glib::ustring(""), Glib::ustring(""),
- true),
- _widget_bitmap(Glib::ustring(_("_Bitmap")),
- Glib::ustring(_("Render everything as bitmap. The resulting image "
+ "filter effects will not be correctly rendered.")));
+ _tt.set_tip (_radio_bitmap, Glib::ustring(
+ _("Render everything as bitmap. The resulting image "
"is usually larger in file size and cannot be "
"arbitrarily scaled without quality loss, but all "
- "objects will be rendered exactly as displayed.")),
- _radio_bitmap,
- Glib::ustring(""), Glib::ustring(""),
- true),
- _dpi( _("DPI"), Glib::ustring(_("Preferred resolution of rendering, in dots per inch.")),
- 1,
- Glib::ustring(""), Glib::ustring(""),
- false)
-{
+ "objects will be rendered exactly as displayed.")));
+
set_border_width(2);
- // default to cairo operations
- _radio_cairo->set_active (true);
- Gtk::RadioButtonGroup group = _radio_cairo->get_group ();
- _radio_bitmap->set_group (group);
+ // default to vector operations
+ _radio_vector.set_active (true);
+ Gtk::RadioButtonGroup group = _radio_vector.get_group ();
+ _radio_bitmap.set_group (group);
+ _radio_bitmap.signal_toggled().connect(sigc::mem_fun(*this, &RenderingOptions::_toggled));
// configure default DPI
_dpi.setRange(PT_PER_IN,2400.0);
_dpi.setValue(PT_PER_IN);
+ _dpi.setIncrements(1.0,10.0);
+ _dpi.setDigits(0);
+ _dpi.update();
+
+ // fill frames
+ Gtk::VBox *box_vector = Gtk::manage( new Gtk::VBox () );
+ box_vector->set_border_width (2);
+ box_vector->add (_radio_vector);
+ box_vector->add (_radio_bitmap);
+ _frame_backends.add (*box_vector);
+
+ Gtk::HBox *box_bitmap = Gtk::manage( new Gtk::HBox () );
+ box_bitmap->set_border_width (2);
+ box_bitmap->add (_dpi);
+ _frame_bitmap.add (*box_bitmap);
// fill up container
- add (_widget_cairo);
- add (_widget_bitmap);
- add (_dpi);
+ add (_frame_backends);
+ add (_frame_bitmap);
+
+ // initialize states
+ _toggled();
show_all_children ();
}
bool
RenderingOptions::as_bitmap ()
{
- return _radio_bitmap->get_active();
+ return _radio_bitmap.get_active();
}
double
index 41134b81475e99c84d6d62e130f4efbb857bd4ec..964ffca577232ec07bc2f9363a8999ad9fb227b2 100644 (file)
#ifndef INKSCAPE_UI_WIDGET_RENDERING_OPTIONS_H
#define INKSCAPE_UI_WIDGET_RENDERING_OPTIONS_H
-#include "labelled.h"
+#include <gtkmm.h>
#include "scalar.h"
namespace Inkscape {
protected:
// Radio buttons to select desired rendering
- Gtk::RadioButton *_radio_cairo;
- Gtk::RadioButton *_radio_bitmap;
- Labelled _widget_cairo;
- Labelled _widget_bitmap;
- Scalar _dpi; // DPI of bitmap to render
+ Gtk::Frame _frame_backends;
+ Gtk::RadioButton _radio_vector;
+ Gtk::RadioButton _radio_bitmap;
+
+ // Bitmap options
+ Gtk::Frame _frame_bitmap;
+ Scalar _dpi; // DPI of bitmap to render
+
+ // Tooltip manager
+ Gtk::Tooltips _tt;
+
+ // callback for bitmap button
+ void _toggled();
};
} // namespace Widget