NoteEditor(grt::Module *m, const grt::BaseListRef &args)
    : PluginEditorBase(m, args), _be(workbench_model_NoteFigureRef::cast_from(args[0])) {
    set_border_width(8);

    _xml = Gtk::Builder::create_from_file(bec::GRTManager::get()->get_data_file_path("modules/data/editor_note.glade"));

    Gtk::Widget *widget;
    _xml->get_widget("base_table", widget);

    Gtk::Image *image;
    _xml->get_widget("image", image);

    // image->set(grtm->get_data_file_path(""));

    Gtk::Entry *entry;
    _xml->get_widget("name_entry", entry);

    add_entry_change_timer(entry, sigc::mem_fun(this, &NoteEditor::set_name));

    Gtk::TextView *tview;
    _xml->get_widget("text_view", tview);

    add_text_change_timer(tview, sigc::mem_fun(_be, &NoteEditorBE::set_text));

    widget->reparent(*this);

    show_all();

    refresh_form_data();
  }
Пример #2
0
  ImageEditorFE(grt::Module *m, bec::GRTManager *grtm, const grt::BaseListRef &args)
    : PluginEditorBase(m, grtm, args)
    , _be(grtm, workbench_model_ImageFigureRef::cast_from(args[0]))
    , _xml(0)
    , _image(0)
  {
    set_border_width(8);
    
    _xml= Gtk::Builder::create_from_file(grtm->get_data_file_path("modules/data/editor_image.glade"));

    Gtk::Widget *widget;
    _xml->get_widget("editor_image_hbox", widget);

    Gtk::Button *button(0);
    _xml->get_widget("browse_button", button);
    button->signal_clicked().connect(sigc::mem_fun(this, &ImageEditorFE::browse_file));

    _xml->get_widget("reset_size_button", button);
    button->signal_clicked().connect(sigc::mem_fun(this, &ImageEditorFE::reset_aspect));

    Gtk::CheckButton *check;
    _xml->get_widget("aspect_check", check);
    check->signal_toggled().connect(sigc::mem_fun(this, &ImageEditorFE::aspect_toggled));
    
    Gtk::Entry *entry;
    _xml->get_widget("width_entry", entry);
    entry->signal_activate().connect(sigc::mem_fun(this, &ImageEditorFE::width_changed));
    _xml->get_widget("height_entry", entry);
    entry->signal_activate().connect(sigc::mem_fun(this, &ImageEditorFE::height_changed));

    _xml->get_widget("image", _image);
    
    widget->reparent(*this);

    show_all();
    
    refresh_form_data();
  }