summaryrefslogtreecommitdiff
path: root/fluid/Fl_Menu_Type.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-07-19 17:44:44 +0200
committerMatthias Melcher <github@matthiasm.com>2023-07-19 17:45:28 +0200
commitf8a327877699a8565d36b2f0b1cbe074f224fba4 (patch)
tree00673ec9887fa97a108a56910c97df6b37c6ff8c /fluid/Fl_Menu_Type.cxx
parent9ee8cdc727e7c510c28b51318b953d82aa1dd936 (diff)
FLUID: emulated RTTI for all types
Complete type hierarchy in Fl_Types doc Window now derives correctly from Group Menu Items now correctly (functionally in FLUID) derived form Button Menu Buttons have a better hierarchy Fixing two possible crash bugs where Input_Choice was assumed to be a Menu_ Hoping I have not degraded the original code!
Diffstat (limited to 'fluid/Fl_Menu_Type.cxx')
-rw-r--r--fluid/Fl_Menu_Type.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx
index 37d44148d..7b582e65b 100644
--- a/fluid/Fl_Menu_Type.cxx
+++ b/fluid/Fl_Menu_Type.cxx
@@ -158,7 +158,7 @@ Fl_Type *Fl_Menu_Item_Type::make(Strategy strategy) {
if ( (force_parent && q->is_menu_item()) || !q->is_parent()) p = p->parent;
}
force_parent = 0;
- if (!p || !(p->is_menu_button() || (p->is_menu_item() && p->is_parent()))) {
+ if (!p || !(p->is_a(ID_Menu_Manager_) || (p->is_menu_item() && p->is_parent()))) {
fl_message("Please select a menu to add to");
return 0;
}
@@ -532,7 +532,7 @@ void Fl_Menu_Item_Type::write_code2(Fd_Code_Writer&) {}
// children. An actual array of Fl_Menu_Items is kept parallel
// with the child objects and updated as they change.
-void Fl_Menu_Type::build_menu() {
+void Fl_Menu_Base_Type::build_menu() {
Fl_Menu_* w = (Fl_Menu_*)o;
// count how many Fl_Menu_Item structures needed:
int n = 0;
@@ -596,7 +596,7 @@ void Fl_Menu_Type::build_menu() {
o->redraw();
}
-Fl_Type* Fl_Menu_Type::click_test(int, int) {
+Fl_Type* Fl_Menu_Base_Type::click_test(int, int) {
if (selected) return 0; // let user move the widget
Fl_Menu_* w = (Fl_Menu_*)o;
if (!menusize) return 0;
@@ -615,7 +615,7 @@ Fl_Type* Fl_Menu_Type::click_test(int, int) {
return this;
}
-void Fl_Menu_Type::write_code2(Fd_Code_Writer& f) {
+void Fl_Menu_Manager_Type::write_code2(Fd_Code_Writer& f) {
if (next && next->is_menu_item()) {
f.write_c("%s%s->menu(%s);\n", f.indent(), name() ? name() : "o",
f.unique_id(this, "menu", name(), label()));
@@ -623,7 +623,7 @@ void Fl_Menu_Type::write_code2(Fd_Code_Writer& f) {
Fl_Widget_Type::write_code2(f);
}
-void Fl_Menu_Type::copy_properties() {
+void Fl_Menu_Base_Type::copy_properties() {
Fl_Widget_Type::copy_properties();
Fl_Menu_ *s = (Fl_Menu_*)o, *d = (Fl_Menu_*)live_widget;
d->menu(s->menu());