From 876e29acefc9207562fbe98502eba48a06e1f5f8 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 21 Nov 2004 14:53:48 +0000 Subject: Fix FLUID menu items with images bug (STR #564) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3910 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 2 ++ fluid/Fl_Menu_Type.cxx | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 106b18352..0fe31cba2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ CHANGES IN FLTK 1.1.6 - Documentation updates (STR #552, STR #608) + - FLUID didn't display menu items using images properly + (STR #564) - Fl_Sys_Menu_Bar didn't compile on case-sensitive file-systems (STR #622) - FLUID didn't handle default function parameters diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx index da7e8350a..cdfdb12d5 100644 --- a/fluid/Fl_Menu_Type.cxx +++ b/fluid/Fl_Menu_Type.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_Type.cxx,v 1.16.2.12.2.9 2004/05/15 22:58:18 easysw Exp $" +// "$Id: Fl_Menu_Type.cxx,v 1.16.2.12.2.10 2004/11/21 14:53:48 easysw Exp $" // // Menu item code for the Fast Light Tool Kit (FLTK). // @@ -339,11 +339,14 @@ void Fl_Menu_Type::build_menu() { int lvl = level+1; for (q = next; q && q->level > level; q = q->next) { Fl_Menu_Item_Type* i = (Fl_Menu_Item_Type*)q; - m->label(i->o->label()); + if (i->o->image()) i->o->image()->label(m); + else { + m->label(i->o->label() ? i->o->label() : "(nolabel)"); + m->labeltype(i->o->labeltype()); + } m->shortcut(((Fl_Button*)(i->o))->shortcut()); m->callback(0,(void*)i); m->flags = i->flags(); - m->labeltype(i->o->labeltype()); m->labelfont(i->o->labelfont()); m->labelsize(i->o->labelsize()); m->labelcolor(i->o->labelcolor()); @@ -465,5 +468,5 @@ void shortcut_in_cb(Shortcut_Button* i, void* v) { } // -// End of "$Id: Fl_Menu_Type.cxx,v 1.16.2.12.2.9 2004/05/15 22:58:18 easysw Exp $". +// End of "$Id: Fl_Menu_Type.cxx,v 1.16.2.12.2.10 2004/11/21 14:53:48 easysw Exp $". // -- cgit v1.2.3