~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/extension/param/notebook.cpp

  • Committer: JazzyNico
  • Date: 2011-08-29 20:25:30 UTC
  • Revision ID: nicoduf@yahoo.fr-20110829202530-6deuoz11q90usldv
Code refactoring and merging with trunk (revision 10599).

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
    Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
58
58
    void paramString (std::list <std::string> &list);
59
59
    gchar * get_guitext (void) {return _text;};
60
 
 
 
60
    Parameter * get_param (const gchar * name);
61
61
}; /* class ParamNotebookPage */
62
62
 
63
63
 
210
210
        Parameter * param = reinterpret_cast<Parameter *>(list->data);
211
211
        Gtk::Widget * widg = param->get_widget(doc, node, changeSignal);
212
212
        gchar const * tip = param->get_tooltip();
213
 
 
214
 
        vbox->pack_start(*widg, true, true, 2);
 
213
//        printf("Tip: '%s'\n", tip);
 
214
        vbox->pack_start(*widg, false, false, 2);
215
215
        if (tip != NULL) {
216
216
            _tooltips->set_tip(*widg, Glib::ustring(tip));
217
217
        }
381
381
    return;
382
382
}
383
383
 
384
 
 
 
384
/** \brief  Search the parameter's name in the notebook content */
 
385
Parameter *
 
386
ParamNotebook::get_param(const gchar * name)
 
387
{
 
388
    if (name == NULL) {
 
389
        throw Extension::param_not_exist();
 
390
    }
 
391
    for (GSList * pglist = pages; pglist != NULL; pglist = g_slist_next(pglist)) {
 
392
        ParamNotebookPage * page = reinterpret_cast<ParamNotebookPage *>(pglist->data);
 
393
        Parameter * subparam = page->get_param(name);
 
394
        if (subparam) {
 
395
            return subparam;
 
396
        }
 
397
    }
 
398
 
 
399
    return NULL;
 
400
}
 
401
 
 
402
/** \brief  Search the parameter's name in the page content */
 
403
Parameter *
 
404
ParamNotebookPage::get_param(const gchar * name)
 
405
{
 
406
    if (name == NULL) {
 
407
        throw Extension::param_not_exist();
 
408
    }
 
409
    if (this->parameters == NULL) {
 
410
        // the list of parameters is empty
 
411
        throw Extension::param_not_exist();
 
412
    }
 
413
 
 
414
    for (GSList * list = this->parameters; list != NULL; list = g_slist_next(list)) {
 
415
        Parameter * param = static_cast<Parameter*>(list->data);
 
416
        if (!strcmp(param->name(), name)) {
 
417
            return param;
 
418
        }
 
419
    }
 
420
 
 
421
    return NULL;
 
422
}
385
423
 
386
424
/**
387
425
    \brief  Creates a Notebook widget for a notebook parameter
428
466
  fill-column:99
429
467
  End:
430
468
*/
431
 
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
 
469
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :