preferences-widget.cpp revision 8216c3ff062d14097e70b504033979ab98e91d9f
/**
* \brief Inkscape Preferences dialog
*
* Authors:
* Marco Scholten
* Bruno Dilly <bruno.dilly@gmail.com>
*
* Copyright (C) 2004, 2006, 2007 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 "preferences.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, Glib::ustring const &label, Gtk::Widget &widget, Glib::ustring const &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)
}
}
{
}
bool default_value)
{
}
void PrefCheckButton::on_toggled()
{
if (this->is_visible()) //only take action if the user toggled it
{
}
}
{
(void)default_value;
if (group_member)
{
}
else
this->set_active( false );
}
{
if (group_member)
{
}
if (default_value)
else
}
void PrefRadioButton::on_toggled()
{
{
if ( _value_type == VAL_STRING )
else if ( _value_type == VAL_INT )
}
}
{
double value;
if (is_int) {
if (is_percent) {
} else {
}
} else {
}
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 {
}
}
}
_unitconv(1.0),
_border(5)
{
}
void ZoomCorrRuler::set_size(int x, int y)
{
_min_width = x;
_height = y;
}
// The following two functions are borrowed from 2geom's toy-framework-2; if they are useful in
// other locations, we should perhaps make them (or adapted versions of them) publicly available
static void
// set font and size
}
static void
}
/*
* \arg dist The distance between consecutive minor marks
* \arg major_interval Number of marks after which to draw a major mark
*/
void
double mark = 0;
int i = 0;
while (mark <= _drawing_width) {
if ((i % major_interval) == 0) {
// major mark
} else {
// minor mark
}
++i;
}
}
void
ZoomCorrRuler::redraw() {
int w, h;
if (abbr == "cm") {
} else if (abbr == "ft") {
} else if (abbr == "in") {
} else if (abbr == "m") {
} else if (abbr == "mm") {
} else if (abbr == "pc") {
} else if (abbr == "pt") {
} else if (abbr == "px") {
} else {
}
}
bool
this->redraw();
return true;
}
void
{
{
freeze = true;
freeze = false;
}
}
void
{
{
freeze = true;
freeze = false;
}
}
void
// when the unit menu is initialized, the unit is set to the default but
// it needs to be reset later so we don't perform the change in this case
return;
}
if (_ruler.is_visible()) {
}
}
void
{
double value = prefs->getDoubleLimited("/options/zoomcorrection/value", default_value, lower, upper) * 100.0;
freeze = false;
_slider.signal_value_changed().connect(sigc::mem_fun(*this, &ZoomCorrRulerSlider::on_slider_value_changed));
_sb.signal_value_changed().connect(sigc::mem_fun(*this, &ZoomCorrRulerSlider::on_spinbutton_value_changed));
}
void
{
{
freeze = true;
freeze = false;
}
}
void
{
{
freeze = true;
freeze = false;
}
}
void
double lower, double upper, double step_increment, double page_increment, double default_value, int digits)
{
freeze = false;
}
{
int row = 0;
for (int i = 0 ; i < num_items; ++i)
{
this->append_text(labels[i]);
row = i;
}
this->set_active(row);
}
/**
initialize a combo box
second form uses strings as key values
*/
{
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
{
{
}
else
{
}
}
}
{
this->pack_start(*relatedEntry);
this->pack_start(*relatedButton);
}
{
if (this->is_visible()) //only take action if user changed value
{
}
}
{
if (this->is_visible()) //only take action if user changed value
{
}
}
{
}
void PrefFileButton::onFileChanged()
{
}
{
this->set_invisible_char('*');
this->set_visibility(visibility);
}
void PrefEntry::on_changed()
{
if (this->is_visible()) //only take action if user changed value
{
}
}
{
}
{
if (this->is_visible()) //only take action if the user toggled it
{
}
}
{
}
void PrefUnit::on_changed()
{
if (this->is_visible()) //only take action if user changed value
{
}
}
} // 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 :