preferences-widget.cpp revision 5c75cf72a495b3b7acef3df76ed8fa8d81952aad
/**
* \brief Inkscape Preferences dialog
*
* Authors:
* Marco Scholten
*
* Copyright (C) 2004, 2006 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtkmm/alignment.h>
#include "prefs-utils.h"
#include "ui/widget/preferences-widget.h"
#include "verbs.h"
#include "selcue.h"
#include <iostream>
#include "enums.h"
#include "inkscape.h"
#include "desktop-handles.h"
#include "message-stack.h"
#include "style.h"
#include "selection.h"
#include "selection-chemistry.h"
namespace Inkscape {
namespace UI {
namespace Widget {
{
this->set_border_width(12);
this->set_col_spacings(12);
this->set_row_spacings(6);
}
void DialogPage::add_line(bool indent, const Glib::ustring label, Gtk::Widget& widget, const Glib::ustring suffix, const Glib::ustring& tip, bool expand_widget)
{
int start_col;
int row = this->property_n_rows();
if (expand_widget)
{
w = &widget;
}
else
{
}
if (label != "")
{
if (indent)
{
}
else
start_col = 1;
}
else
start_col = 0;
{
this->attach(*alignment, start_col, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::AttachOptions(), 0, 0);
}
else
{
}
if (suffix != "")
{
Gtk::Label* suffix_widget = Gtk::manage(new Gtk::Label(suffix , Gtk::ALIGN_LEFT , Gtk::ALIGN_CENTER, true));
if (expand_widget)
else
}
if (tip != "")
{
}
}
{
int row = this->property_n_rows();
if (name != "")
{
Gtk::Label* label_widget = Gtk::manage(new Gtk::Label(Glib::ustring(/*"<span size='large'>*/"<b>") + name +
label_widget->set_use_markup(true);
if (row != 1)
}
}
void PrefCheckButton::init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr,
bool default_value)
{
this->set_active( prefs_get_int_attribute (_prefs_path.c_str(), _attr.c_str(), (int)default_value) );
}
void PrefCheckButton::on_toggled()
{
if (this->is_visible()) //only take action if the user toggled it
{
}
}
void PrefRadioButton::init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr,
{
if (group_member)
{
}
if ( val )
else
this->set_active( false );
}
void PrefRadioButton::init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr,
{
if (group_member)
{
}
if (default_value)
this->set_active( prefs_get_int_attribute( _prefs_path.c_str(), _attr.c_str(), int_value ) == _int_value);
else
this->set_active( prefs_get_int_attribute( _prefs_path.c_str(), _attr.c_str(), int_value + 1 )== _int_value);
}
void PrefRadioButton::on_toggled()
{
{
if ( _value_type == VAL_STRING )
else if ( _value_type == VAL_INT )
}
}
{
double value;
if (is_int)
if (is_percent)
value = 100 * prefs_get_double_attribute_limited (prefs_path.c_str(), attr.c_str(), default_value, lower/100.0, upper/100.0);
else
value = (double) prefs_get_int_attribute_limited (prefs_path.c_str(), attr.c_str(), (int) default_value, (int) lower, (int) upper);
else
value = prefs_get_double_attribute_limited (prefs_path.c_str(), attr.c_str(), default_value, lower, upper);
this->set_numeric();
this->set_width_chars(6);
if (is_int)
this->set_digits(0);
else if (step_increment < 0.1)
this->set_digits(4);
else
this->set_digits(2);
}
void PrefSpinButton::on_value_changed()
{
if (this->is_visible()) //only take action if user changed value
{
if (_is_int)
if (_is_percent)
else
else
}
}
{
int row = 0;
for (int i = 0 ; i < num_items; ++i)
{
this->append_text(labels[i]);
row = i;
}
this->set_active(row);
}
void PrefCombo::on_changed()
{
if (this->is_visible()) //only take action if user changed value
{
prefs_set_int_attribute (_prefs_path.c_str(), _attr.c_str(), _values[this->get_active_row_number()]);
std::cout << "combo set: " << _prefs_path << " " << _attr << " " << _values[this->get_active_row_number()] << std::endl;
}
}
} // namespace Widget
} // namespace UI
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :