]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormNote.C
Martin's changes to the Note inset.
[lyx.git] / src / frontends / xforms / FormNote.C
index 6d3c13c61aeb6ba92acf3f15bc83f6484dad337e..40bbc96f1f3fef61f822d62cc848bdd87819bbe6 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming
+ * \author Martin Vermeer
  *
  * Full author contact details are available in file CREDITS
  */
 #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 <vector>
+
+using std::vector;
+
+
 typedef FormController<ControlNote, FormView<FD_note> > 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];
 }