object-properties.cpp revision c3c78ba9299d19ef9b50bd3aadda3dd35c326b7c
/**
* @file Object properties dialog.
*/
/*
* Inkscape, an Open Source vector graphics editor
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (C) 2012 Kris De Gussem <Kris.DeGussem@gmail.com>
* c++ version based on former C-version (GPL v2) with authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Johan Engelen <goejendaagh@zonnet.nl>
* Abhishek Sharma
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "object-properties.h"
#include "../../desktop-handles.h"
#include "../../document.h"
#include "../../document-undo.h"
#include "verbs.h"
#include "inkscape.h"
#include "selection.h"
#include "desktop.h"
#include "sp-item.h"
namespace Inkscape {
namespace UI {
namespace Dialog {
ObjectProperties::ObjectProperties (void) :
blocked (false),
attrTable(),
deskTrack(),
{
//initialize labels for the table at the bottom of the dialog
desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &ObjectProperties::setTargetDesktop) );
MakeWidget();
}
ObjectProperties::~ObjectProperties (void)
{
}
void ObjectProperties::MakeWidget(void)
{
contents->set_spacing(0);
/* Create the label for the object id */
Gtk::AttachOptions(), 0, 0 );
/* Create the entry box for the object id */
EntryID.set_tooltip_text (_("The id= attribute (only letters, digits, and the characters .-_: allowed)"));
Gtk::AttachOptions(), 0, 0 );
// pressing enter in the id field is the same as clicking Set:
// focus is in the id field initially:
/* Create the label for the object label */
Gtk::AttachOptions(), 0, 0 );
/* Create the entry box for the object label */
Gtk::AttachOptions(), 0, 0 );
// pressing enter in the label field is the same as clicking Set:
/* Create the label for the object title */
Gtk::AttachOptions(), 0, 0 );
/* Create the entry box for the object title */
Gtk::AttachOptions(), 0, 0 );
// pressing enter in the label field is the same as clicking Set:
/* Create the frame for the object description */
FrameDescription.set_padding (0,0,0,0);
/* Create the text view box for the object description */
/* Check boxes */
/* Hide */
Gtk::AttachOptions(), 0, 0 );
/* Lock */
// TRANSLATORS: "Lock" is a verb here
Gtk::AttachOptions(), 0, 0 );
/* Button for setting the object's id, label, title and description. */
Gtk::AttachOptions(), 0, 0 );
/* Create the frame for interactivity options */
show_all ();
widget_setup();
}
void ObjectProperties::widget_setup(void)
{
{
return;
}
if (SP_ACTIVE_DESKTOP != desktop)
{
return;
}
if (!selection->singleItem()) {
contents->set_sensitive (false);
CurrentItem = NULL;
//no selection anymore or multiple objects selected, means that we need
//to close the connections to the previously selected object
return;
} else {
contents->set_sensitive (true);
}
if (CurrentItem == item)
{
//otherwise we would end up wasting resources through the modify selection
//callback when moving an object (endlessly setting the labels and recreating attrTable)
return;
}
blocked = true;
/* ID */
/* Label */
} else {
/* ID */
/* Label */
/* Title */
if (title) {
}
else {
}
/* Description */
if (desc) {
} else {
}
if (CurrentItem == NULL)
{
}
else
{
}
}
CurrentItem = item;
blocked = false;
}
void ObjectProperties::label_changed(void)
{
if (blocked)
{
return;
}
blocked = true;
/* Retrieve the label widget for the object's id */
} else {
SP_EXCEPTION_INIT (&ex);
}
/* Retrieve the label widget for the object's label */
/* Give feedback on success of setting the drawing object's label
* using the widget's label text
*/
_("Set object label"));
}
/* Retrieve the title */
_("Set object title"));
/* Retrieve the description */
_("Set object description"));
blocked = false;
}
void ObjectProperties::sensitivity_toggled (void)
{
if (blocked)
{
return;
}
blocked = true;
blocked = false;
}
void ObjectProperties::hidden_toggled(void)
{
if (blocked)
{
return;
}
blocked = true;
blocked = false;
}
{
}
{
if (this->desktop) {
}
selectChangedConn = desktop->selection->connectChanged(sigc::hide(sigc::mem_fun(*this, &ObjectProperties::widget_setup)));
subselChangedConn = desktop->connectToolSubselectionChanged(sigc::hide(sigc::mem_fun(*this, &ObjectProperties::widget_setup)));
}
widget_setup();
}
}
}
}
}
/*
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 :