git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8645 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2011-05-10 16:46:42 +00:00
parent 41fc90726b
commit 42af47f31e

View File

@ -470,7 +470,10 @@ void Fl_Menu_Type::write_code2() {
const char *mName = mi->menu_name(i);
for (Fl_Type* q = next; q && q->is_menu_item(); q = q->next) {
if (((Fl_Menu_Item_Type*)q)->label()) nLabel++;
nItem++;
int thislevel = q->level; if (q->is_parent()) thislevel++;
int nextlevel =
(q->next && q->next->is_menu_item()) ? q->next->level : next->level+1;
nItem += 1 + ((thislevel > nextlevel) ? (thislevel-nextlevel) : 0);
}
if (nLabel) {
write_c("%sif (!%s_i18n_done) {\n", indent(), mName);