FLTK logo

[Library] r5761 - branches/fctrunk/fluid

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Library      Forums      Links      Apps     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[Library] r5761 - branches/fctrunk/fluid fltk-dev Apr 05, 2007  
 
Author: fabien
Date: 2007-04-05 10:30:37 -0400 (Thu, 05 Apr 2007)
New Revision: 5761
Log:
added delete menu and shortcut, so not necessary to cut anymore to delete somtg in the tree

Modified:
   branches/fctrunk/fluid/fluid.cxx
   branches/fctrunk/fluid/fluid_menus.cxx

Modified: branches/fctrunk/fluid/fluid.cxx
===================================================================
--- branches/fctrunk/fluid/fluid.cxx	2007-04-05 13:57:29 UTC (rev 5760)
+++ branches/fctrunk/fluid/fluid.cxx	2007-04-05 14:30:37 UTC (rev 5761)
@@ -755,6 +755,16 @@
     if (p) select_only(p);
 }
 
+void delete_cb(Widget *, void *) {
+    if (!FluidType::current) return;
+    Undo::checkpoint();
+    ipasteoffset = 0;
+    FluidType *p = FluidType::current->parent;
+    while (p && p->selected()) p = p->parent;
+    delete_all(1);
+    if (p) select_only(p);
+}
+
 extern int force_parent;
 
 void paste_cb(Widget*, void*) {

Modified: branches/fctrunk/fluid/fluid_menus.cxx
===================================================================
--- branches/fctrunk/fluid/fluid_menus.cxx	2007-04-05 13:57:29 UTC (rev 5760)
+++ branches/fctrunk/fluid/fluid_menus.cxx	2007-04-05 14:30:37 UTC (rev 5761)
@@ -42,6 +42,7 @@
 DECL_MENUCBV(write_cb);
 DECL_MENUCBV(exit_cb);
 DECL_MENUCBV(cut_cb);
+DECL_MENUCBV(delete_cb);
 DECL_MENUCBV(copy_cb);
 DECL_MENUCBV(paste_cb);
 DECL_MENUCBV(exit_cb);
@@ -180,6 +181,7 @@
 	new Item("&Paste", COMMAND+'v', paste_cb);
 	new Item("Select &All", COMMAND+'a', select_all_cb);
 	new Item("Select &None", SHIFT+COMMAND+'a', select_none_cb);
+	new Item("&Delete", DeleteKey, delete_cb);
 	new Divider();
 	new Item("Ed&it this widget", ReturnKey, openwidget_cb);
 	new Item("&Sort these widgets", 0, sort_cb);

Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.