measure-toolbar.cpp revision e8b36e4378a56e4f3d4af68e71baeb75fcbc4d5d
/**
* @file
* Measure aux toolbar
*/
/* Authors:
* MenTaLguY <mental@rydia.net>
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Frank Felfe <innerspace@iname.com>
* John Cliff <simarilius@yahoo.com>
* David Turner <novalis@gnu.org>
* Josh Andler <scislac@scislac.com>
* Jon A. Cruz <jon@joncruz.org>
* Maximilian Albert <maximilian.albert@gmail.com>
* Tavmjong Bah <tavmjong@free.fr>
* Abhishek Sharma
* Kris De Gussem <Kris.DeGussem@gmail.com>
*
* Copyright (C) 2004 David Turner
* Copyright (C) 2003 MenTaLguY
* Copyright (C) 1999-2011 authors
* Copyright (C) 2001-2002 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "measure-toolbar.h"
#include "desktop.h"
#include "inkscape.h"
#include "message-stack.h"
#include "document-undo.h"
#include "widgets/ege-adjustment-action.h"
#include "widgets/ege-output-action.h"
#include "preferences.h"
#include "toolbox.h"
#include "widgets/ink-action.h"
#include "ui/icon-names.h"
#include "ui/tools/measure-tool.h"
#include "ui/widget/unit-tracker.h"
using Inkscape::DocumentUndo;
//########################
//## Measure Toolbox ##
//########################
/** Temporary hack: Returns the node tool in the active desktop.
* Will go away during tool refactoring. */
static MeasureTool *get_measure_tool()
{
MeasureTool *tool = 0;
if (SP_ACTIVE_DESKTOP ) {
if (SP_IS_MEASURE_CONTEXT(ec)) {
}
}
return tool;
}
static void
{
if (mt) {
mt->showCanvasItems();
}
}
}
{
if (mt) {
mt->showCanvasItems();
}
}
{
if ( active ) {
desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Start and end measures inactive."));
} else {
}
if (mt) {
mt->showCanvasItems();
}
}
{
if ( active ) {
} else {
desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Use current layer in the measure."));
}
if (mt) {
mt->showCanvasItems();
}
}
{
if ( active ) {
} else {
}
if (mt) {
mt->showCanvasItems();
}
}
static void sp_reverse_knots(void){
if (mt) {
mt->reverseKnots();
}
}
static void sp_to_mark_dimension(void){
if (mt) {
mt->toMarkDimension();
}
}
{
EgeAdjustmentAction *eact = 0;
/* Font Size */
{
_("Font Size"), _("Font Size:"),
_("The font size to be used in the measurement labels"),
10, 36, 1.0, 4.0,
0, 0, 0,
}
// units label
{
EgeOutputAction* act = ege_output_action_new( "measure_units_label", _("Units:"), _("The units to be used for the measurements"), 0 );
}
// units menu
{
GtkAction* act = tracker->createAction( "MeasureUnitsAction", _("Units:"), _("The units to be used for the measurements") );
}
// ignore_1st_and_last
{
_("Ignore first and last"),
_("Ignore first and last"),
INKSCAPE_ICON("draw-geometry-line-segment"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/measure/ignore_1st_and_last", true) );
g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(toggle_ignore_1st_and_last), desktop) ;
}
// measure imbetweens
{
_("Show measures between items"),
_("Show measures between items"),
INKSCAPE_ICON("distribute-randomize"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/measure/show_in_between", true) );
}
// measure only current layer
{
_("Measure all layers"),
_("Measure all layers"),
INKSCAPE_ICON("dialog-layers"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/measure/all_layers", true) );
}
//toogle start end
{
_("Reverse measure"),
_("Reverse measure"),
INKSCAPE_ICON("draw-geometry-mirror"),
}
//to mark dimensions
{
_("Mark Dimension"),
_("Mark Dimension"),
INKSCAPE_ICON("draw-geometry-mirror"),
}
} // end of sp_measure_toolbox_prep()
/*
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:fileencoding=utf-8:textwidth=99 :