X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2FFormNote.C;h=40bbc96f1f3fef61f822d62cc848bdd87819bbe6;hb=1c155241d88fa2106565711ef94396be42b912a9;hp=aad238f512a39a943280fde2db73a7976cd5e434;hpb=359583859f9599c08bb7fe0c4983211e91cab5e6;p=lyx.git diff --git a/src/frontends/xforms/FormNote.C b/src/frontends/xforms/FormNote.C index aad238f512..40bbc96f1f 100644 --- a/src/frontends/xforms/FormNote.C +++ b/src/frontends/xforms/FormNote.C @@ -15,11 +15,16 @@ #include "ControlNote.h" #include "FormNote.h" #include "forms/form_note.h" -#include "xforms_helpers.h" // formatted +#include "Tooltips.h" #include "lyx_forms.h" #include "insets/insetnote.h" #include "debug.h" +#include + +using std::vector; + + typedef FormController > base_class; FormNote::FormNote(Dialog & parent) @@ -31,7 +36,19 @@ void FormNote::build() { dialog_.reset(build_note(this)); - fl_addto_choice(dialog_->choice_type, predefineds().c_str()); + note_gui_tokens(ids_, gui_names_); + + for (int i = 0; i < 3; ++i) { + } + + for (int i = 0; i < 3; ++i) { + fl_addto_choice(dialog_->choice_type, gui_names_[i].c_str()); + } + + string str = _("Lyx Note: LyX internal only\n" + "Comment: Export to LaTeX but don't print\n" + "Greyed Out: Print as grey text"); + tooltips().init(dialog_->choice_type, str); bcview().setOK(dialog_->button_ok); bcview().setApply(dialog_->button_apply); @@ -42,12 +59,16 @@ void FormNote::build() void FormNote::update() { string type(controller().params().type); - fl_set_choice_text(dialog_->choice_type, type.c_str()); + for (int i = 0; i < 3; ++i) { + if (type == ids_[i]) + fl_set_choice_text(dialog_->choice_type, gui_names_[i].c_str()); + } } void FormNote::apply() { - controller().params().type = fl_get_choice_text(dialog_->choice_type); + int i = fl_get_choice(dialog_->choice_type); + controller().params().type = ids_[i - 1]; }