From: buliabyak Date: Tue, 7 Aug 2007 06:55:35 +0000 (+0000) Subject: add a way to set a radio toggle in aux toolbar via desktop, by the toggles id X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=36e6eecb030f3ee0f7ba5a0beb6daf3b5be17dae;p=inkscape.git add a way to set a radio toggle in aux toolbar via desktop, by the toggles id --- diff --git a/src/desktop.cpp b/src/desktop.cpp index e785aab6d..4b4d1fe5b 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -1119,6 +1119,12 @@ SPDesktop::setToolboxAdjustmentValue (gchar const* id, double val) _widget->setToolboxAdjustmentValue (id, val); } +void +SPDesktop::setToolboxSelectOneValue (gchar const* id, gint val) +{ + _widget->setToolboxSelectOneValue (id, val); +} + bool SPDesktop::isToolboxButtonActive (gchar const *id) { diff --git a/src/desktop.h b/src/desktop.h index ca2d24204..10509c274 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -247,6 +247,7 @@ struct SPDesktop : public Inkscape::UI::View::View void destroyWidget(); void setToolboxFocusTo (gchar const* label); void setToolboxAdjustmentValue (gchar const* id, double val); + void setToolboxSelectOneValue (gchar const* id, gint val); bool isToolboxButtonActive (gchar const *id); void updateNow(); void updateCanvasNow(); diff --git a/src/ui/view/edit-widget-interface.h b/src/ui/view/edit-widget-interface.h index 4c9ad8b02..8e388529e 100644 --- a/src/ui/view/edit-widget-interface.h +++ b/src/ui/view/edit-widget-interface.h @@ -120,6 +120,9 @@ struct EditWidgetInterface /// In auxiliary toolbox, set value of adjustment with specific id virtual void setToolboxAdjustmentValue (const gchar *, double) = 0; + + /// In auxiliary toolbox, select one of the "select one" options (usually radio toggles) + virtual void setToolboxSelectOneValue (const gchar *, gint) = 0; /// In auxiliary toolbox, return true if specific togglebutton is active virtual bool isToolboxButtonActive (gchar const*) = 0; diff --git a/src/ui/view/edit-widget.cpp b/src/ui/view/edit-widget.cpp index d5b782865..b87250e47 100644 --- a/src/ui/view/edit-widget.cpp +++ b/src/ui/view/edit-widget.cpp @@ -1488,6 +1488,12 @@ EditWidget::setToolboxAdjustmentValue (const gchar *, double) /// \todo not implemented } +void +EditWidget::setToolboxSelectOneValue (const gchar *, gint) +{ + /// \todo not implemented +} + bool EditWidget::isToolboxButtonActive (gchar const*) { diff --git a/src/ui/view/edit-widget.h b/src/ui/view/edit-widget.h index 7f68abcf5..443b10ac8 100644 --- a/src/ui/view/edit-widget.h +++ b/src/ui/view/edit-widget.h @@ -126,6 +126,7 @@ public: virtual void letZoomGrabFocus(); virtual void setToolboxFocusTo (const gchar *); virtual void setToolboxAdjustmentValue (const gchar *, double); + virtual void setToolboxSelectOneValue (const gchar *, gint); virtual bool isToolboxButtonActive (gchar const*); virtual void setCoordinateStatus (NR::Point p); virtual void setMessage (Inkscape::MessageType type, gchar const* msg); diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 4dca563aa..b68d2328d 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -52,6 +52,7 @@ #include "sp-item.h" #include "dialogs/swatches.h" #include "conn-avoid-ref.h" +#include "ege-select-one-action.h" #if defined (SOLARIS_2_8) #include "round.h" @@ -1023,6 +1024,16 @@ SPDesktopWidget::setToolboxAdjustmentValue (gchar const *id, double value) } } +void +SPDesktopWidget::setToolboxSelectOneValue (gchar const *id, int value) +{ + gpointer hb = sp_search_by_data_recursive(aux_toolbox, (gpointer) id); + if (hb) { + ege_select_one_action_set_active((EgeSelectOneAction*) hb, value); + } +} + + bool SPDesktopWidget::isToolboxButtonActive (const gchar* id) { diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index fbd350b12..bb9d7ef86 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -172,6 +172,8 @@ struct SPDesktopWidget { { _dtw->setToolboxFocusTo (id); } virtual void setToolboxAdjustmentValue (const gchar *id, double val) { _dtw->setToolboxAdjustmentValue (id, val); } + virtual void setToolboxSelectOneValue (gchar const *id, int val) + { _dtw->setToolboxSelectOneValue (id, val); } virtual bool isToolboxButtonActive (gchar const* id) { return _dtw->isToolboxButtonActive (id); } virtual void setCoordinateStatus (NR::Point p) @@ -197,6 +199,7 @@ struct SPDesktopWidget { bool warnDialog (gchar *text); void setToolboxFocusTo (gchar const *); void setToolboxAdjustmentValue (gchar const * id, double value); + void setToolboxSelectOneValue (gchar const * id, gint value); bool isToolboxButtonActive (gchar const *id); void setCoordinateStatus(NR::Point p); void requestCanvasUpdate();