36d9047104b5881ca587a71ade77b1f21d083bc4Jon A. Cruz/*
be0e34af047138582978b032a7dd57c136421b18cilix * Authors:
be0e34af047138582978b032a7dd57c136421b18cilix * Carl Hetherington <inkscape@carlh.net>
be0e34af047138582978b032a7dd57c136421b18cilix * Maximilian Albert <maximilian.albert@gmail.com>
be0e34af047138582978b032a7dd57c136421b18cilix *
be0e34af047138582978b032a7dd57c136421b18cilix * Copyright (C) 2004 Carl Hetherington
be0e34af047138582978b032a7dd57c136421b18cilix *
be0e34af047138582978b032a7dd57c136421b18cilix * Released under GNU GPL. Read the file 'COPYING' for more information.
be0e34af047138582978b032a7dd57c136421b18cilix */
be0e34af047138582978b032a7dd57c136421b18cilix
be0e34af047138582978b032a7dd57c136421b18cilix#ifndef INKSCAPE_UI_WIDGET_TEXT_H
be0e34af047138582978b032a7dd57c136421b18cilix#define INKSCAPE_UI_WIDGET_TEXT_H
be0e34af047138582978b032a7dd57c136421b18cilix
be0e34af047138582978b032a7dd57c136421b18cilix#include "labelled.h"
be0e34af047138582978b032a7dd57c136421b18cilix
1b3a8414f17dc95fc921d999ea715c99d10dd4aaAlex Valavanis
be0e34af047138582978b032a7dd57c136421b18cilixnamespace Inkscape {
be0e34af047138582978b032a7dd57c136421b18cilixnamespace UI {
be0e34af047138582978b032a7dd57c136421b18cilixnamespace Widget {
be0e34af047138582978b032a7dd57c136421b18cilix
36d9047104b5881ca587a71ade77b1f21d083bc4Jon A. Cruz/**
36d9047104b5881ca587a71ade77b1f21d083bc4Jon A. Cruz * A labelled text box, with optional icon or suffix, for entering arbitrary number values.
36d9047104b5881ca587a71ade77b1f21d083bc4Jon A. Cruz */
be0e34af047138582978b032a7dd57c136421b18cilixclass Text : public Labelled
be0e34af047138582978b032a7dd57c136421b18cilix{
be0e34af047138582978b032a7dd57c136421b18cilixpublic:
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz /**
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz * Construct a Text Widget.
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz *
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz * @param label Label.
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz * @param suffix Suffix, placed after the widget (defaults to "").
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz * @param icon Icon filename, placed before the label (defaults to "").
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz * @param mnemonic Mnemonic toggle; if true, an underscore (_) in the label
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz * indicates the next character should be used for the
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz * mnemonic accelerator key (defaults to false).
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz */
be0e34af047138582978b032a7dd57c136421b18cilix Text(Glib::ustring const &label,
be0e34af047138582978b032a7dd57c136421b18cilix Glib::ustring const &tooltip,
be0e34af047138582978b032a7dd57c136421b18cilix Glib::ustring const &suffix = "",
be0e34af047138582978b032a7dd57c136421b18cilix Glib::ustring const &icon = "",
be0e34af047138582978b032a7dd57c136421b18cilix bool mnemonic = true);
be0e34af047138582978b032a7dd57c136421b18cilix
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz /**
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz * Get the text in the entry.
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz */
be0e34af047138582978b032a7dd57c136421b18cilix const char* getText() const;
be0e34af047138582978b032a7dd57c136421b18cilix
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz /**
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz * Sets the text of the text entry.
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz */
4ea30e1bba14987abced98e7bf194b69153e9e21cilix void setText(const char* text);
be0e34af047138582978b032a7dd57c136421b18cilix
be0e34af047138582978b032a7dd57c136421b18cilix void update();
be0e34af047138582978b032a7dd57c136421b18cilix
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz /**
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz * Signal raised when the spin button's value changes.
153bb1867986d6db392e2cfa711ad6231fce8abeJon A. Cruz */
be0e34af047138582978b032a7dd57c136421b18cilix Glib::SignalProxy0<void> signal_activate();
be0e34af047138582978b032a7dd57c136421b18cilix
cf37d48226bff1ae8aec0105665c4dcf0e3ba420cilix bool setProgrammatically; // true if the value was set by setValue, not changed by the user;
be0e34af047138582978b032a7dd57c136421b18cilix // if a callback checks it, it must reset it back to false
be0e34af047138582978b032a7dd57c136421b18cilix};
be0e34af047138582978b032a7dd57c136421b18cilix
be0e34af047138582978b032a7dd57c136421b18cilix} // namespace Widget
be0e34af047138582978b032a7dd57c136421b18cilix} // namespace UI
be0e34af047138582978b032a7dd57c136421b18cilix} // namespace Inkscape
be0e34af047138582978b032a7dd57c136421b18cilix
be0e34af047138582978b032a7dd57c136421b18cilix#endif // INKSCAPE_UI_WIDGET_TEXT_H
be0e34af047138582978b032a7dd57c136421b18cilix
be0e34af047138582978b032a7dd57c136421b18cilix/*
be0e34af047138582978b032a7dd57c136421b18cilix Local Variables:
be0e34af047138582978b032a7dd57c136421b18cilix mode:c++
be0e34af047138582978b032a7dd57c136421b18cilix c-file-style:"stroustrup"
be0e34af047138582978b032a7dd57c136421b18cilix c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
be0e34af047138582978b032a7dd57c136421b18cilix indent-tabs-mode:nil
be0e34af047138582978b032a7dd57c136421b18cilix fill-column:99
be0e34af047138582978b032a7dd57c136421b18cilix End:
be0e34af047138582978b032a7dd57c136421b18cilix*/
a4030d5ca449e7e384bc699cd249ee704faaeab0Chris Morgan// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :