]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormNote.C
Tiny clean-ups.
[lyx.git] / src / frontends / xforms / FormNote.C
index aad238f512a39a943280fde2db73a7976cd5e434..3db5352fc54f1fc1c2810f82ee893b2b9fc510ee 100644 (file)
@@ -5,20 +5,25 @@
  *
  * \author Martin Vermeer
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
-
 #include <config.h>
 
-#include "xformsBC.h"
-#include "ControlNote.h"
 #include "FormNote.h"
+#include "ControlNote.h"
 #include "forms/form_note.h"
-#include "xforms_helpers.h" // formatted
-#include "lyx_forms.h"
+
+#include "Tooltips.h"
+#include "xformsBC.h"
+
 #include "insets/insetnote.h"
-#include "debug.h"
+
+#include "lyx_forms.h"
+
+
+using std::string;
+
 
 typedef FormController<ControlNote, FormView<FD_note> > base_class;
 
@@ -31,7 +36,16 @@ void FormNote::build()
 {
        dialog_.reset(build_note(this));
 
-       fl_addto_choice(dialog_->choice_type, predefineds().c_str());
+       note_gui_tokens(ids_, gui_names_);
+
+       for (string::size_type i = 0; i < gui_names_.size(); ++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 +56,15 @@ void FormNote::build()
 void FormNote::update()
 {
        string type(controller().params().type);
-       fl_set_choice_text(dialog_->choice_type, type.c_str());
+       for (string::size_type i = 0; i < gui_names_.size(); ++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];
 }
-