summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e018daf)
raw | patch | inline | side by side (parent: e018daf)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 20 Jul 2008 20:31:16 +0000 (20:31 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 20 Jul 2008 20:31:16 +0000 (20:31 +0000) |
src/ui/dialog/livepatheffect-editor.cpp | patch | blob | history | |
src/ui/dialog/livepatheffect-editor.h | patch | blob | history |
index 671b28010ea801fe2f10c33a70dca32be2d9f23d..f46a6bc95ccd5d5c9f93c9378c0bd997590b3704 100644 (file)
* LivePathEffectEditor
*/
-LivePathEffectEditor::LivePathEffectEditor()
+LivePathEffectEditor::LivePathEffectEditor()
: UI::Widget::Panel("", "dialogs.livepatheffect", SP_VERB_DIALOG_LIVE_PATH_EFFECT),
combo_effecttype(Inkscape::LivePathEffect::LPETypeConverter),
effectwidget(NULL),
// button_hbox.pack_start(button_up, true, true);
// button_hbox.pack_start(button_down, true, true);
// button_hbox.pack_end(button_remove, true, true);
- toolbar.set_toolbar_style(Gtk::TOOLBAR_ICONS);
+ toolbar.set_toolbar_style(Gtk::TOOLBAR_ICONS);
// Add toolbar items to toolbar
- toolbar.append(button_up);
- toolbar.append(button_down);
- toolbar.append(button_remove);
+ toolbar.append(button_up);
+ toolbar.append(button_down);
+ toolbar.append(button_remove);
+
+
+ // Add toolbar
+ //add_toolbar(toolbar);
+ toolbar.show_all(); //Show the toolbar and all its child widgets.
-
- // Add toolbar
- //add_toolbar(toolbar);
- toolbar.show_all(); //Show the toolbar and all its child widgets.
-
//Create the Tree model:
effectlist_store = Gtk::ListStore::create(columns);
effectlist_view.set_model(effectlist_store);
//button_remove.hide();
}
-LivePathEffectEditor::~LivePathEffectEditor()
+LivePathEffectEditor::~LivePathEffectEditor()
{
if (effectwidget) {
effectcontrol_vbox.remove(*effectwidget);
if ( SP_IS_LPE_ITEM(item) ) {
SPLPEItem *lpeitem = SP_LPE_ITEM(item);
- effect_list_update(lpeitem);
+ effect_list_reload(lpeitem);
current_lpeitem = lpeitem;
-
+
set_sensitize_all(true);
if ( sp_lpe_item_has_path_effect(lpeitem) ) {
Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(lpeitem);
showText(_("No effect applied"));
button_remove.set_sensitive(false);
}
- }
- else
- {
+ } else {
showText(_("Item is not a path or shape"));
set_sensitize_all(false);
}
}
}
+/*
+ * First clears the effectlist_store, then appends all effects from the effectlist.
+ */
void
-LivePathEffectEditor::effect_list_update(SPLPEItem *lpeitem)
+LivePathEffectEditor::effect_list_reload(SPLPEItem *lpeitem)
{
effectlist_store->clear();
-
+
PathEffectList effectlist = sp_lpe_item_get_effect_list(lpeitem);
PathEffectList::iterator it;
for( it = effectlist.begin() ; it!=effectlist.end(); it++ )
}
-void
+void
LivePathEffectEditor::setDesktop(SPDesktop *desktop)
{
Panel::setDesktop(desktop);
SPItem *item = sel->singleItem();
if ( item && SP_IS_LPE_ITEM(item) ) {
sp_lpe_item_remove_current_path_effect(SP_LPE_ITEM(item), false);
-
- sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
+
+ sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
_("Remove path effect") );
- effect_list_update(SP_LPE_ITEM(item));
+ effect_list_reload(SP_LPE_ITEM(item));
}
}
}
void LivePathEffectEditor::onUp()
{
- Inkscape::Selection *sel = _getSelection();
+ Inkscape::Selection *sel = _getSelection();
if ( sel && !sel->isEmpty() ) {
SPItem *item = sel->singleItem();
if ( item && SP_IS_LPE_ITEM(item) ) {
-
- sp_lpe_item_up_current_path_effect(SP_LPE_ITEM(item));
-
- sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
+ sp_lpe_item_up_current_path_effect(SP_LPE_ITEM(item));
+
+ sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
_("Move path effect up") );
- effect_list_update(SP_LPE_ITEM(item));
+ effect_list_reload(SP_LPE_ITEM(item));
}
}
-
}
void LivePathEffectEditor::onDown()
{
- Inkscape::Selection *sel = _getSelection();
+ Inkscape::Selection *sel = _getSelection();
if ( sel && !sel->isEmpty() ) {
SPItem *item = sel->singleItem();
if ( item && SP_IS_LPE_ITEM(item) ) {
-
- sp_lpe_item_down_current_path_effect(SP_LPE_ITEM(item));
-
- sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
+ sp_lpe_item_down_current_path_effect(SP_LPE_ITEM(item));
+
+ sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
_("Move path effect down") );
- effect_list_update(SP_LPE_ITEM(item));
+ effect_list_reload(SP_LPE_ITEM(item));
}
}
}
index a1d4479abd6c06a36df481077db6c144b93dfbde..76ee9f09c8a2d1afc514aa9290d2fa163dc2e977 100644 (file)
void showText(Glib::ustring const &str);
// void add_entry(const char* name );
- void effect_list_update(SPLPEItem *lpeitem);
+ void effect_list_reload(SPLPEItem *lpeitem);
// callback methods for buttons on grids page.
void onApply();