From aa897faeb38d238f8a82f0205d9e74feb87639c1 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 30 Aug 2005 21:25:47 +0000 Subject: [PATCH] FLUID: Grouping and ungrouping would not work inside an Fl_Widget_Class_Type git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4553 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/Fl_Group_Type.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fluid/Fl_Group_Type.cxx b/fluid/Fl_Group_Type.cxx index c8c89a60d..f80652bfb 100644 --- a/fluid/Fl_Group_Type.cxx +++ b/fluid/Fl_Group_Type.cxx @@ -34,6 +34,7 @@ #include #include #include "Fl_Widget_Type.h" +#include "../src/flstring.h" // Override group's resize behavior to do nothing to children: void igroup::resize(int X, int Y, int W, int H) { @@ -71,7 +72,7 @@ void group_cb(Fl_Widget *, void *) { // Find the current widget: Fl_Type *qq = Fl_Type::current; while (qq && (!qq->is_widget() || qq->is_menu_item())) qq = qq->parent; - if (!qq || qq->level <= 1) { + if (!qq || qq->level < 1 || (qq->level == 1 && !strcmp(qq->type_name(), "widget_class"))) { fl_message("Please select widgets to group"); return; } @@ -95,7 +96,7 @@ void ungroup_cb(Fl_Widget *, void *) { Fl_Type *q = Fl_Type::current; while (q && (!q->is_widget() || q->is_menu_item())) q = q->parent; if (q) q = q->parent; - if (!q || q->level <= 1) { + if (!q || q->level < 1 || (q->level == 1 && !strcmp(q->type_name(), "widget_class"))) { fl_message("Please select widgets in a group"); return; }