Angus Leeming wrote:
> Martin Vermeer wrote:
> > Ah! Yes, these are standard tokens and should not be translated. But
> > we need "user names" in locale to present in the menu. Hmmm...
>
> Add a function to ControlNote.[Ch]

Or, since QNote does note use those strings anyway (we have radiobuttons), 
here's a simple solution for FormNote.

Juergen.
Index: src/frontends/xforms/FormNote.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormNote.C,v
retrieving revision 1.3
diff -u -r1.3 FormNote.C
--- src/frontends/xforms/FormNote.C	18 Jul 2003 14:51:13 -0000	1.3
+++ src/frontends/xforms/FormNote.C	30 Jul 2003 15:57:10 -0000
@@ -27,20 +27,17 @@
 {}


-string const FormNote::predefineds() const
-{
-	return _("Note|Comment|Greyedout");
-}
-
-
 void FormNote::build()
 {
 	dialog_.reset(build_note(this));
 
-	fl_addto_choice(dialog_->choice_type, predefineds().c_str());
-	string str = _("Note: LyX internal only\n"
+	fl_clear_choice(dialog_->choice_type);
+	fl_addto_choice(dialog_->choice_type, _("LyX Note").c_str());
+	fl_addto_choice(dialog_->choice_type, _("Comment").c_str());
+	fl_addto_choice(dialog_->choice_type, _("Greyed out").c_str());
+	string str = _("LyX Note: LyX internal only\n"
 		       "Comment: Export to LaTeX but don't print\n"
-		       "Greyedout: Print as grey text");
+		       "Greyed out: Print as grey text");
 	tooltips().init(dialog_->choice_type, str);
 
 	bcview().setOK(dialog_->button_ok);
@@ -52,12 +49,36 @@
 void FormNote::update()
 {
 	string type(controller().params().type);
-	fl_set_choice_text(dialog_->choice_type, type.c_str());
+	int sel;
+	if (type == "Note")
+		sel = 1;
+	else if (type == "Comment")
+		sel = 2;
+	else if (type == "Greyedout")
+		sel = 3;
+	if (sel != 0)
+		fl_set_choice(dialog_->choice_type, sel);
 }
 
 
 void FormNote::apply()
 {
-	controller().params().type = fl_get_choice_text(dialog_->choice_type);
+ 	int sel = fl_get_choice(dialog_->choice_type);
+	string type;
+	switch(sel) {
+		case 1:
+			type = "Note";
+			break;
+		case 2:
+			type = "Comment";
+			break;
+		case 3:
+			type = "Greyedout";
+			break;
+		default:
+			break;
+	}
+	if (!type.empty())
+		controller().params().type = type;
 }
 
Index: src/frontends/xforms/FormNote.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormNote.h,v
retrieving revision 1.3
diff -u -r1.3 FormNote.h
--- src/frontends/xforms/FormNote.h	18 Jul 2003 14:51:13 -0000	1.3
+++ src/frontends/xforms/FormNote.h	30 Jul 2003 15:57:10 -0000
@@ -32,8 +32,6 @@
 	virtual void build();
 	/// Update dialog before showing it
 	virtual void update();
-	///
-	string const predefineds() const;
 };
 
 #endif // FORMNOTE_H

Reply via email to