measure-toolbar.cpp revision 694d8555c0639ca02269603e99b46c0ff49b1753
/**
* @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();
}
}
}
static void
{
if (mt) {
mt->showCanvasItems();
}
}
}
{
if (mt) {
mt->showCanvasItems();
}
}
}
static void
{
if (mt) {
mt->showCanvasItems();
}
}
}
static void
{
if (mt) {
mt->showCanvasItems();
}
}
static void
{
if ( active ) {
desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Start and end measures inactive."));
} else {
}
if (mt) {
mt->showCanvasItems();
}
}
static void
{
if ( active ) {
} else {
}
if (mt) {
mt->showCanvasItems();
}
}
static void
{
if ( active ) {
} else {
desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Use current layer in the measure."));
}
if (mt) {
mt->showCanvasItems();
}
}
static void
{
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();
}
}
static void
sp_to_guides(void){
if (mt) {
}
}
static void
sp_to_item(void){
if (mt) {
}
}
{
EgeAdjustmentAction *eact = 0;
/* Font Size */
{
_("Font Size"), _("Font Size:"),
_("The font size to be used in the measurement labels"),
1.0, 36.0, 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") );
}
/* Precission */
{
_("Precision"), _("Precision:"),
_("Decimal precision of measure"),
0, 10, 1, 0,
0, 0, 0,
sp_measure_precision_value_changed, NULL, 0 ,0);
}
/* Scale */
{
_("Scale %"), _("Scale %:"),
_("Scale the results"),
0.0, 90000.0, 1.0, 4.0,
0, 0, 0,
}
/* Offset */
{
_("Offset"), _("Offset:"),
_("The offset size"),
0.0, 90000.0, 1.0, 4.0,
0, 0, 0,
}
/* 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(sp_toggle_ignore_1st_and_last), desktop) ;
}
/* only visible */
{
_("Only visible intersections"),
_("Only visible intersections"),
INKSCAPE_ICON("zoom"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/measure/only_visible", true) );
}
/* 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 guides */
{
_("To guides"),
_("To guides"),
INKSCAPE_ICON("guides"),
}
/* to mark dimensions */
{
_("Mark Dimension"),
_("Mark Dimension"),
INKSCAPE_ICON("tool-pointer"),
}
/* to item */
{
_("Convert to item"),
_("Convert to item"),
INKSCAPE_ICON("path-reverse"),
}
} // 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 :