point.cpp revision 64caa91f2899a6648503a75dc7310841955b74fd
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * Released under GNU GPL, read the file 'COPYING' for more information
d431763a9ec8059aa4962688de8144319969fb0fjohanengelen// needed for on-canvas editting:
d431763a9ec8059aa4962688de8144319969fb0fjohanengelen#define LPEPOINTPARAM_DEBUG // undefine to disable all on-canvas editing code for PointParam
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmPointParam::PointParam( const Glib::ustring& label, const Glib::ustring& tip,
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm const Glib::ustring& key, Inkscape::UI::Widget::Registry* wr,
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm : Geom::Point(default_value), Parameter(label, tip, key, wr, effect), defvalue(default_value)
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm unsigned int success = sp_svg_number_read_d(strarray[0], &newx);
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm return true;
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm return false;
c0cd5511d3b975ebe07d019c1f5528108725e438johanengelenPointParam::param_newWidget(Gtk::Tooltips * tooltips)
7073d105e612f7dc898c292742bee9655d2a51b2johanengelen Inkscape::UI::Widget::RegisteredPoint * pointwdg = Gtk::manage(
7073d105e612f7dc898c292742bee9655d2a51b2johanengelen new Inkscape::UI::Widget::RegisteredPoint( param_label,
7073d105e612f7dc898c292742bee9655d2a51b2johanengelen pointwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change point parameter"));
7073d105e612f7dc898c292742bee9655d2a51b2johanengelen Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( "draw_node", Inkscape::ICON_SIZE_BUTTON) );
7073d105e612f7dc898c292742bee9655d2a51b2johanengelen Gtk::Button * pButton = Gtk::manage(new Gtk::Button());
7073d105e612f7dc898c292742bee9655d2a51b2johanengelen pButton->signal_clicked().connect(sigc::mem_fun(*this, &PointParam::on_button_click));
7073d105e612f7dc898c292742bee9655d2a51b2johanengelen Gtk::HBox * hbox = Gtk::manage( new Gtk::HBox() );
7073d105e612f7dc898c292742bee9655d2a51b2johanengelen static_cast<Gtk::HBox*>(hbox)->pack_start(*pButton, true, true);
7073d105e612f7dc898c292742bee9655d2a51b2johanengelen static_cast<Gtk::HBox*>(hbox)->pack_start(*pointwdg, true, true);
7073d105e612f7dc898c292742bee9655d2a51b2johanengelen static_cast<Gtk::HBox*>(hbox)->show_all_children();
7073d105e612f7dc898c292742bee9655d2a51b2johanengelen tooltips->set_tip(*pButton, _("Edit on-canvas"));
0903335a0099bd7ee779925f43a15a2216a0e863johanengelenPointParam::param_set_and_write_new_value (Geom::Point newpoint)
d431763a9ec8059aa4962688de8144319969fb0fjohanengelenPointParam::param_editOncanvas(SPItem * item, SPDesktop * dt)
d431763a9ec8059aa4962688de8144319969fb0fjohanengelen // If not already in nodecontext, goto it!
d431763a9ec8059aa4962688de8144319969fb0fjohanengelen ShapeEditor * shape_editor = SP_NODE_CONTEXT( dt->event_context )->shape_editor;
d431763a9ec8059aa4962688de8144319969fb0fjohanengelen shape_editor->set_item_lpe_point_parameter(item, SP_OBJECT(param_effect->getLPEObj()), param_key.c_str());
0903335a0099bd7ee779925f43a15a2216a0e863johanengelenPointParam::param_transform_multiply(Geom::Matrix const& postmul, bool /*set*/)
0903335a0099bd7ee779925f43a15a2216a0e863johanengelen param_set_and_write_new_value( (*this) * postmul );
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm// CALLBACKS:
d431763a9ec8059aa4962688de8144319969fb0fjohanengelen SPItem * item = sp_desktop_selection(SP_ACTIVE_DESKTOP)->singleItem();
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm} /* namespace LivePathEffect */
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm} /* namespace Inkscape */
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm Local Variables:
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm c-file-style:"stroustrup"
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm indent-tabs-mode:nil
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm fill-column:99
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :