summaryrefslogtreecommitdiff
path: root/fluid/Fl_Type.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2000-05-16 12:26:07 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2000-05-16 12:26:07 +0000
commit74198871a67e9ca1bdc46fc9b57ac4b09649eddf (patch)
treed8abdfa9be21febda997d3c88b08e919729acce3 /fluid/Fl_Type.cxx
parent3f177d70dee93b576efb7807107dd66302ca5de4 (diff)
I18N didn't work right for menus - the messages numbers were wrong.
Added new "msgnum()" method to Fl_Type to handle computing the message number on the fly. Now initialize nl_catd and locale settings directly in the static variables so that menu labels are correctly looked up. This hack shouldn't be necessary in 2.0... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1124 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Type.cxx')
-rw-r--r--fluid/Fl_Type.cxx23
1 files changed, 20 insertions, 3 deletions
diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx
index be5d5dad0..8294156bc 100644
--- a/fluid/Fl_Type.cxx
+++ b/fluid/Fl_Type.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Type.cxx,v 1.6.2.1 1999/03/13 20:07:19 bill Exp $"
+// "$Id: Fl_Type.cxx,v 1.6.2.2 2000/05/16 12:26:03 mike Exp $"
//
// Widget type code for the Fast Light Tool Kit (FLTK).
//
@@ -15,7 +15,7 @@
// not in the linked list and are not written to files or
// copied or otherwise examined.
//
-// Copyright 1998-1999 by Bill Spitzak and others.
+// Copyright 1998-2000 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -387,6 +387,23 @@ void Fl_Type::insert(Fl_Type *g) {
widget_browser->redraw();
}
+// Return message number for I18N...
+int
+Fl_Type::msgnum() {
+ int count;
+ Fl_Type *p;
+
+ for (count = 0, p = this; p;) {
+ if (p->is_widget() && p->label() && !((Fl_Widget_Type *)p)->image) count ++;
+
+ if (p->prev) p = p->prev;
+ else p = p->parent;
+ }
+
+ return count;
+}
+
+
// delete from parent:
Fl_Type *Fl_Type::remove() {
Fl_Type *end = this;
@@ -648,5 +665,5 @@ void Fl_Type::read_property(const char *c) {
int Fl_Type::read_fdesign(const char*, const char*) {return 0;}
//
-// End of "$Id: Fl_Type.cxx,v 1.6.2.1 1999/03/13 20:07:19 bill Exp $".
+// End of "$Id: Fl_Type.cxx,v 1.6.2.2 2000/05/16 12:26:03 mike Exp $".
//