Fixes for hidden class members...

(Bill, please look at the Fl_Menu_Type.cxx code around line 171; the
previous code didn't initialize level before it was used; I hope I
captured the original intent...)


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1338 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2000-11-21 21:37:08 +00:00
parent 7d432ff92c
commit 3988dbf8bd
3 changed files with 20 additions and 19 deletions

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Menu_Type.cxx,v 1.16.2.9 2000/06/05 21:20:37 mike Exp $"
// "$Id: Fl_Menu_Type.cxx,v 1.16.2.10 2000/11/21 21:37:07 easysw Exp $"
//
// Menu item code for the Fast Light Tool Kit (FLTK).
//
@ -168,21 +168,21 @@ void Fl_Menu_Item_Type::write_static() {
if (next && next->is_menu_item()) return;
// okay, when we hit last item in the menu we have to write the
// entire array out:
int level;
int mylevel;
const char* k = class_name(1);
if (k) {
write_c("\nFl_Menu_Item %s::%s[] = {\n", k, menu_name(level));
} else
write_c("\nFl_Menu_Item %s[] = {\n", menu_name(level));
Fl_Type* t = prev; while (t && t->is_menu_item()) t = t->prev;
level = t->level+1;
mylevel = t->level+1;
for (Fl_Type* q = t->next; q && q->is_menu_item(); q = q->next) {
((Fl_Menu_Item_Type*)q)->write_item();
if (q->is_parent()) level++;
if (q->is_parent()) mylevel++;
int l1 =
(q->next && q->next->is_menu_item()) ? q->next->level : t->next->level;
while (level > l1) {write_c(" {0},\n"); level--;}
level = l1;
while (mylevel > l1) {write_c(" {0},\n"); mylevel--;}
mylevel = l1;
}
write_c(" {0}\n};\n");
@ -462,5 +462,5 @@ void shortcut_in_cb(Shortcut_Button* i, void* v) {
}
//
// End of "$Id: Fl_Menu_Type.cxx,v 1.16.2.9 2000/06/05 21:20:37 mike Exp $".
// End of "$Id: Fl_Menu_Type.cxx,v 1.16.2.10 2000/11/21 21:37:07 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Type.h,v 1.5.2.9 2000/06/05 21:20:38 mike Exp $"
// "$Id: Fl_Type.h,v 1.5.2.10 2000/11/21 21:37:08 easysw Exp $"
//
// Widget type header file for the Fast Light Tool Kit (FLTK).
//
@ -431,13 +431,13 @@ public:
#include <FL/Fl_Menu_.H>
class Fl_Menu_Type : public Fl_Widget_Type {
int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) {
Fl_Menu_ *o = (Fl_Menu_*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
Fl_Menu_ *myo = (Fl_Menu_*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
switch (w) {
case 4:
case 0: f = o->textfont(); s = o->textsize(); c = o->textcolor(); break;
case 1: o->textfont(f); break;
case 2: o->textsize(s); break;
case 3: o->textcolor(c); break;
case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break;
case 1: myo->textfont(f); break;
case 2: myo->textsize(s); break;
case 3: myo->textcolor(c); break;
}
return 1;
}
@ -476,9 +476,9 @@ class Fl_Choice_Type : public Fl_Menu_Type {
public:
virtual const char *type_name() {return "Fl_Choice";}
Fl_Widget *widget(int x,int y,int w,int h) {
Fl_Choice *o = new Fl_Choice(x,y,w,h,"choice:");
o->menu(dummymenu);
return o;
Fl_Choice *myo = new Fl_Choice(x,y,w,h,"choice:");
myo->menu(dummymenu);
return myo;
}
Fl_Widget_Type *_make() {return new Fl_Choice_Type();}
};
@ -532,5 +532,5 @@ int storestring(const char *n, const char * & p, int nostrip=0);
extern int include_H_from_C;
//
// End of "$Id: Fl_Type.h,v 1.5.2.9 2000/06/05 21:20:38 mike Exp $".
// End of "$Id: Fl_Type.h,v 1.5.2.10 2000/11/21 21:37:08 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: factory.cxx,v 1.4.2.7 2000/11/20 15:44:18 easysw Exp $"
// "$Id: factory.cxx,v 1.4.2.8 2000/11/21 21:37:08 easysw Exp $"
//
// Widget factory code for the Fast Light Tool Kit (FLTK).
//
@ -36,6 +36,7 @@
#include <FL/Fl_Menu_Item.H>
#include <string.h>
#include <stdio.h>
#include <config.h>
#if defined(WIN32) || defined(__EMX__)
#define strcasecmp stricmp
@ -721,5 +722,5 @@ int lookup_symbol(const char *name, int &v, int numberok) {
}
//
// End of "$Id: factory.cxx,v 1.4.2.7 2000/11/20 15:44:18 easysw Exp $".
// End of "$Id: factory.cxx,v 1.4.2.8 2000/11/21 21:37:08 easysw Exp $".
//