Author: spitzak
Date: 2008-11-11 14:31:26 -0800 (Tue, 11 Nov 2008)
New Revision: 6518
Log:
Further shortcut fixes:

Removed previous fix as it just moves the type problems up. Put in the
usual workaround of int(long(x)) to get around casting bug in 64-bit
VC++ compiler.

Shortcut case is preserved and used to decide how to display in the menus.
It is ignored when matching shortcuts. Removed old kludge to control the
capitalization in menus, fixed some of the programs that used lowercase.

Punctuation matches even if shift is held down, so you don't have to
specify shift for punctuation marks (you can if you want to).


Modified:
   trunk/fltk/Widget.h
   trunk/fluid/fluid_menus.cxx
   trunk/src/ShortcutAssignment.cxx
   trunk/src/key_name.cxx
   trunk/test/editor.cxx
   trunk/test/menubar.cxx

Modified: trunk/fltk/Widget.h
===================================================================
--- trunk/fltk/Widget.h 2008-11-10 22:31:42 UTC (rev 6517)
+++ trunk/fltk/Widget.h 2008-11-11 22:31:26 UTC (rev 6518)
@@ -22,8 +22,6 @@
 #ifndef fltk_Widget_h
 #define fltk_Widget_h
 
-#include <cstdio>
-
 #include "Style.h"
 #include "Rectangle.h"
 
@@ -103,12 +101,12 @@
   const char *tooltip() const  { return tooltip_; }
   void tooltip(const char *t)  { tooltip_ = t; }
 
-  size_t shortcut() const      ;
-  void shortcut(size_t key)    ;
-  bool add_shortcut(size_t key);
-  bool remove_shortcut(size_t key);
+  unsigned shortcut() const    ;
+  void shortcut(unsigned key)  ;
+  bool add_shortcut(unsigned key);
+  bool remove_shortcut(unsigned key);
   void  remove_shortcuts()     ;
-  size_t label_shortcut() const;
+  unsigned label_shortcut() const;
   bool test_label_shortcut() const;
   bool test_shortcut() const   ;
   bool  test_shortcut(bool) const;

Modified: trunk/fluid/fluid_menus.cxx
===================================================================
--- trunk/fluid/fluid_menus.cxx 2008-11-10 22:31:42 UTC (rev 6517)
+++ trunk/fluid/fluid_menus.cxx 2008-11-11 22:31:26 UTC (rev 6518)
@@ -154,32 +154,32 @@
     menubar->begin();
 
     {MenuSection g("&File");
-       new Item("&New", COMMAND+'n', new_cb, 0);//)->image(new_pixmap);
-       new Item("&Open...", COMMAND+'o', open_cb, 0);//)->image(open_pixmap);
-       new Item("&Save", COMMAND+'s', save_cb, 0); //)->image(save_pixmap);
+       new Item("&New", COMMAND+'N', new_cb, 0);//)->image(new_pixmap);
+       new Item("&Open...", COMMAND+'O', open_cb, 0);//)->image(open_pixmap);
+       new Item("&Save", COMMAND+'S', save_cb, 0); //)->image(save_pixmap);
        new Item("S&ave As", SHIFT+COMMAND+'S', save_cb, (void*)1);
        new Item("Sa&ve a Copy", ACCELERATOR+COMMAND+'S', save_cb, (void*)2);
        new Item("Save &Template", COMMAND+'T', save_template_cb, (void*)1);
        new Divider();
        new Item("&Revert", COMMAND+'R', revert_cb, (void*)1);
        //new Item("&Print", COMMAND+'P', print_menu_cb, (void*)1); // TODO: 
add nice printing code
-       new Item("&Merge...", COMMAND+'i', open_cb, 
(void*)1);//)->image(merge_pixmap);
-       new Item("&Write code", COMMAND+'w', write_cb, 
0);//)->image(write_pixmap);
+       new Item("&Merge...", COMMAND+'I', open_cb, 
(void*)1);//)->image(merge_pixmap);
+       new Item("&Write code", COMMAND+'W', write_cb, 
0);//)->image(write_pixmap);
        new Divider();
        for (int h=0; h<MAX_HISTORY; h++)
            history_item[h] = new Item(relative_history[h], COMMAND+('0'+h), 
open_history_cb, absolute_history[h]);
        new Divider();
-       new Item("&Quit", COMMAND+'q', exit_cb);
+       new Item("&Quit", COMMAND+'Q', exit_cb);
     }
     {MenuSection g("&Edit");
-       undo_item[0] = new Item("U&ndo", COMMAND+'z', Undo::undo_cb,0,INACTIVE);
+       undo_item[0] = new Item("U&ndo", COMMAND+'Z', Undo::undo_cb,0,INACTIVE);
        undo_item[1] = new Item("&Redo", SHIFT+COMMAND+'Z', 
Undo::redo_cb,0,INACTIVE);
        new Divider();
-       new Item("&Cut", COMMAND+'x', cut_cb);
-       new Item("C&opy", COMMAND+'c', copy_cb);
-       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("&Cut", COMMAND+'X', cut_cb);
+       new Item("C&opy", COMMAND+'C', copy_cb);
+       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 Divider();
        new Item("Ed&it this widget", ReturnKey, openwidget_cb);
        new Item("&Sort these widgets", 0, sort_cb);
@@ -195,16 +195,16 @@
        //new Item("Deactivate", 0, nyi);
        //new Item("Activate", 0, nyi, 0, FL_MENU_DIVIDER);
        {MenuSection g("&Show / Hide"); 
-           ishow_overlay = new ToggleItem("Show 
&Overlays",ACCELERATOR+'o',toggle_overlays);
-           iwidget_bin   = new ToggleItem("Show &Widget 
Bin",ACCELERATOR+'b',toggle_widgetbin_cb);
-           isource_view  = new ToggleItem("Show &Source 
Code",ACCELERATOR+COMMAND+'s',(Callback*) toggle_sourceview_cb);
-           istatusbar    = new ToggleItem("Show Status 
&Bar",ACCELERATOR+COMMAND+'b',(Callback*) toggle_statusbar_cb);
+           ishow_overlay = new ToggleItem("Show 
&Overlays",ACCELERATOR+'O',toggle_overlays);
+           iwidget_bin   = new ToggleItem("Show &Widget 
Bin",ACCELERATOR+'B',toggle_widgetbin_cb);
+           isource_view  = new ToggleItem("Show &Source 
Code",ACCELERATOR+COMMAND+'S',(Callback*) toggle_sourceview_cb);
+           istatusbar    = new ToggleItem("Show Status 
&Bar",ACCELERATOR+COMMAND+'B',(Callback*) toggle_statusbar_cb);
        }
        //new Divider();
-       new Item("&Preferences",COMMAND+'p',show_preferences_cb);
+       new Item("&Preferences",COMMAND+'P',show_preferences_cb);
        new Item("Coding St&yle", 0, show_coding_style_cb);
        new Item("T&heme", 0, theme_cb);
-       new Item("Set i&mages root directory", COMMAND+'d', set_images_dir_cb);
+       new Item("Set i&mages root directory", COMMAND+'D', set_images_dir_cb);
     }    
     {MenuSection g("&New"); fill_in_New_Menu(g.group()); }
     {MenuSection g("&Plugins"); Plugins_Options_Menu->add_to(g.group());}
@@ -239,11 +239,11 @@
        (new Item("&Huge",ACCELERATOR+'6',(Callback 
*)widget_size_cb,(void*)32))->textsize(32);
       }
       new Divider();
-      new Item("&Grid and Size 
Settings...",COMMAND+'g',show_preferences_cb,(void*)2);
+      new Item("&Grid and Size 
Settings...",COMMAND+'G',show_preferences_cb,(void*)2);
     }
     {MenuSection g("&Shell");
-       new Item("Execute &Command",ACCELERATOR+'x',show_shell_window);
-       new Item("Execute &Again",ACCELERATOR+'g', (Callback*)do_shell_command);
+       new Item("Execute &Command",ACCELERATOR+'X',show_shell_window);
+       new Item("Execute &Again",ACCELERATOR+'G', (Callback*)do_shell_command);
     }
     {MenuSection g("&Help");
        new Item("&About fluid",0,about_cb);

Modified: trunk/src/ShortcutAssignment.cxx
===================================================================
--- trunk/src/ShortcutAssignment.cxx    2008-11-10 22:31:42 UTC (rev 6517)
+++ trunk/src/ShortcutAssignment.cxx    2008-11-11 22:31:26 UTC (rev 6518)
@@ -44,7 +44,6 @@
 static shortcutAssociationType shortcutAssociation;
 
 /*!
-
   Add a new shortcut assignment. Returns true if successful.  If \a key
   is zero or the assignment already exists this does nothing and
   returns false.
@@ -58,15 +57,26 @@
 
   The shortcut value is a bitwise OR (or sum) of a any set of shift flags
   returned by fltk::event_state(), and either a key symbol returned by
-  fltk::event_key(), or an ASCII character.  Examples:
+  fltk::event_key(), or an ASCII character from fltk::event_text().  Examples:
   - <code>fltk::CTRL+'a'</code>
   - <code>fltk::ACCELERATOR+fltk::CTRL+'A'</code>
   - just <code>'a'</code>
   - <code>fltk::SHIFT+'#'</code>
   - <code>fltk::SHIFT+fltk::UpKey</code>
-  Case is ignored
-  (the lower-case version of any letter is actually put in the table).
 
+  For letters, <code>'A'</code> will only match if the Shift key
+  is \e not held down, and <code>fltk::SHIFT+'a'</code> will only match
+  if the shift key \e is held down. Case (and thus Caps Lock) is ignored.
+  The case does control how the shortcut is displayed in a menu so
+  you will want to choose based on the style of your application.
+
+  Non-letters without <code>fltk::SHIFT</code> will match whether or
+  not Shift is held down. Since both fltk::event_key() and
+  fltk::event_text()[0] are matched, the '#' can be specified by any
+  of <code>fltk::SHIFT+'3'</code>, <code>fltk::SHIFT+'#'</code>, or
+  by <code>'#'</code>. You can choose based on how you want the shortcut
+  to appear in menus and how you want to map to foreign keyboards.
+
   When FLTK gets a keystroke, it sends it to the fltk::focus()
   widget. If that widget's handle() returns 0, it will also send
   the keystroke to all parents of that widget (this is mostly for
@@ -77,9 +87,8 @@
   Widget::test_shortcut() to see if the keystroke is registered here (many
   widgets will also directly test the key to see if it is something
   they are interested in).  */
-bool Widget::add_shortcut(size_t key) {
+bool Widget::add_shortcut(unsigned key) {
   if (!key) return false;
-  key = key&0xffff0000u|tolower(key&0xffu);
   if (find(shortcutAssociation, (void*)key)) return false;
   add(shortcutAssociation, (void*)key);
   return true;
@@ -89,7 +98,7 @@
 /*!
   Delete a shortcut assignment. Returns true if it actually existed.
 */
-bool Widget::remove_shortcut(size_t key) {
+bool Widget::remove_shortcut(unsigned key) {
   return remove(shortcutAssociation, (void*)key);
 }
 
@@ -108,8 +117,8 @@
   or returns zero if there are none. If you want to look at more
   than onle you must use fltk::list_shortcuts(this).
 */
-size_t Widget::shortcut() const {
-  return (size_t)get(shortcutAssociation);
+unsigned Widget::shortcut() const {
+  return (unsigned int)get(shortcutAssociation);
 }
 
 
@@ -118,7 +127,7 @@
   except it may be implemented in a more efficient way.
   The result is exactly one shortcut (or none if \a key is zero).
 */
-void Widget::shortcut(size_t key) {
+void Widget::shortcut(unsigned key) {
   set(shortcutAssociation, (void*)key);
 }
 
@@ -126,11 +135,11 @@
 /*!
   Returns a value that can be passed to add_shortcut() so that this
   widget has a real shortcut assignment to match any &x in it's
-  label().  The returned value is ALT|c where c is the character after
-  the first '&' in the label (except '&&' is ignored), or zero if
-  there isn't any '&' sign or if flag(RAW_LABEL) is on.
+  label().  The returned value is ACCELERATOR|c where c is the
+  character after the first '&' in the label (except '&&' is ignored),
+  or zero if there isn't any '&' sign or if flag(RAW_LABEL) is on.
 */
-size_t Widget::label_shortcut() const {
+unsigned Widget::label_shortcut() const {
   if (flag(RAW_LABEL)) return 0;
   const char* label = this->label();
   if (!label) for (;*label;) {
@@ -160,7 +169,8 @@
 bool Widget::test_label_shortcut() const {
   if (flag(RAW_LABEL)) return false;
   char c = event_text()[0];
-  if (!c) return false;
+  if (!c) return false; // ignore function keys
+  if (c & 0x80) return false; // UTF-8 does not work yet
   const char* label = this->label();
   if (!label) return false;
   //if (ACCELERATOR==CTRL)
@@ -195,23 +205,33 @@
     keyCompareFunctor(void) : count(0) {}
 
     bool handle(const AssociationType&, const Widget*, void* data) {
-
       count++;
 
-      size_t key = (size_t)data;
+      unsigned shortcut = unsigned(long(data));
 
-      unsigned mismatch = key ^ (event_key() | event_state());
+      // turn letters into lower-case to match event_key()
+      if (!(shortcut & 0xff00u))
+        shortcut = shortcut&0xffff0000u|tolower(shortcut&0xffu);
 
-      if (!(mismatch & 0xffff) &&
-          !(mismatch & (key|META|ALT|CTRL|SHIFT)))
+      // we must match all bits in the keysym, all shift keys that
+      // must be held down, and the main shift keys must match if off:
+      unsigned mismatch = shortcut ^ (event_key() | event_state());
+      if (!(mismatch & (0xffffu|shortcut|META|ALT|CTRL|SHIFT)))
         return true;
 
-      mismatch = key ^ (tolower(event_text()[0]) | event_state());
+      // Check against punctuation characters that may require shift
+      // or that the keypad produces. If you want '#' to work as a
+      // shortcut, you would have to specify SHIFT+'3' for the above
+      // to work. This code allows SHIFT+'#' and just '#' to work:
+      char c = event_text()[0];
+      // this does not work for letters (as it would make different
+      // shortcuts for shift and unshifted not work) and not for UTF-8:
+      if (c && !isalpha(c) && !(c&0x80)) {
+        mismatch = shortcut ^ (unsigned(c) | event_state());
+        if (!(mismatch & (0xffffu|shortcut|META|ALT|CTRL)))
+          return true;
+      }
 
-      if (!(mismatch & 0xffff) &&
-          !(mismatch & (key|META|ALT|CTRL|SHIFT)))
-        return true;
-
       return false;
     }
 };
@@ -250,7 +270,7 @@
   ShortcutFunctor& f;
   GlueFunctor(ShortcutFunctor& g) : f(g) {}
   bool handle(const AssociationType&, const Widget* widget, void* data) {
-    return f.handle(widget, (size_t)data);
+    return f.handle(widget, unsigned(long(data)));
   }
 };
 
@@ -285,7 +305,7 @@
 */
 unsigned fltk::foreachShortcut(const Widget* widget, ShortcutFunctor& f) {
   GlueFunctor g(f);
-  return (size_t)(foreach(&shortcutAssociation, widget, g));
+  return (unsigned int)(foreach(&shortcutAssociation, widget, g));
 }
 
 // End of $Id$

Modified: trunk/src/key_name.cxx
===================================================================
--- trunk/src/key_name.cxx      2008-11-10 22:31:42 UTC (rev 6517)
+++ trunk/src/key_name.cxx      2008-11-11 22:31:26 UTC (rev 6518)
@@ -76,19 +76,14 @@
 #endif
 };
 
-// Secret control for fltk::key_name.
-// 0 = all letters are returned lower-case
-// 1 = all letters are returned upper-case (default)
-// 2 = letters are uppercase if SHIFT is on
-FL_API int fl_key_name_uppercase = 1;
-
 /*!
-  Unparse a fltk::Widget::shortcut() or fltk::event_key() value into
-  human-readable text. Returns a pointer to a
-  human-readable string like "Alt+N". If \a hotkey is zero an empty
-  string is returned. The return value points at a static buffer that
-  is overwritten with each call.
 
+  Unparse a fltk::Widget::shortcut(), an fltk::event_key(), or an
+  fltk::event_key() or'd with fltk::event_state().  Returns a pointer
+  to a human-readable string like "Alt+N". If \a hotkey is zero an
+  empty string is returned. The return value points at a static buffer
+  that is overwritten with each call.
+
   The opposite function is fltk::key().
 */
 const char* fltk::key_name(unsigned hotkey) {
@@ -142,12 +137,8 @@
     return buf;
   }
   // if all else fails use the keysym as a character:
-  switch (fl_key_name_uppercase) {
-  case 0: *p = uchar(key); break;
-  case 2: if (!(hotkey&SHIFT)) {*p = uchar(key); break;}
-  default: *p = toupper(uchar(key)); break;
-  }
-  *++p = 0;
+  *p++ = uchar(key);
+  *p = 0;
   return buf;
 }
 

Modified: trunk/test/editor.cxx
===================================================================
--- trunk/test/editor.cxx       2008-11-10 22:31:42 UTC (rev 6517)
+++ trunk/test/editor.cxx       2008-11-11 22:31:26 UTC (rev 6518)
@@ -731,30 +731,30 @@
       g = new fltk::ItemGroup( "&File" );
       g->begin();
        new fltk::Item( "&New File",        0, (fltk::Callback *)new_cb );
-       new fltk::Item( "&Open File...",    fltk::COMMAND + 'o', 
(fltk::Callback *)open_cb );
-       new fltk::Item( "&Insert File...",  fltk::COMMAND + 'i', 
(fltk::Callback *)insert_cb);
+       new fltk::Item( "&Open File...",    fltk::COMMAND + 'O', 
(fltk::Callback *)open_cb );
+       new fltk::Item( "&Insert File...",  fltk::COMMAND + 'I', 
(fltk::Callback *)insert_cb);
        new fltk::Divider();
-       new fltk::Item( "&Save File",       fltk::COMMAND + 's', 
(fltk::Callback *)save_cb );
-       new fltk::Item( "Save File &As...", fltk::COMMAND + fltk::SHIFT + 's', 
(fltk::Callback *)saveas_cb);
+       new fltk::Item( "&Save File",       fltk::COMMAND + 'S', 
(fltk::Callback *)save_cb );
+       new fltk::Item( "Save File &As...", fltk::COMMAND + fltk::SHIFT + 'S', 
(fltk::Callback *)saveas_cb);
        new fltk::Divider();
-       new fltk::Item( "New &View", fltk::ACCELERATOR + 'v', (fltk::Callback 
*)view_cb, 0 );
-       new fltk::Item( "&Close View", fltk::COMMAND + 'w', (fltk::Callback 
*)close_cb);
+       new fltk::Item( "New &View", fltk::ACCELERATOR + 'V', (fltk::Callback 
*)view_cb, 0 );
+       new fltk::Item( "&Close View", fltk::COMMAND + 'W', (fltk::Callback 
*)close_cb);
        new fltk::Divider();
-       new fltk::Item( "E&xit", fltk::COMMAND + 'q', (fltk::Callback 
*)quit_cb, 0 );
+       new fltk::Item( "E&xit", fltk::COMMAND + 'Q', (fltk::Callback 
*)quit_cb, 0 );
       g->end();
       g = new fltk::ItemGroup( "&Edit" );
       g->begin();
-       new fltk::Item( "Cu&t",        fltk::COMMAND + 'x', (fltk::Callback 
*)cut_cb );
-       new fltk::Item( "&Copy",       fltk::COMMAND + 'c', (fltk::Callback 
*)copy_cb );
-       new fltk::Item( "&Paste",      fltk::COMMAND + 'v', (fltk::Callback 
*)paste_cb );
+       new fltk::Item( "Cu&t",        fltk::COMMAND + 'X', (fltk::Callback 
*)cut_cb );
+       new fltk::Item( "&Copy",       fltk::COMMAND + 'C', (fltk::Callback 
*)copy_cb );
+       new fltk::Item( "&Paste",      fltk::COMMAND + 'V', (fltk::Callback 
*)paste_cb );
        new fltk::Item( "&Delete",     0, (fltk::Callback *)delete_cb );
       g->end();
       g = new fltk::ItemGroup( "&Search" );
       g->begin();
-       new fltk::Item( "&Find...",       fltk::COMMAND + 'f', (fltk::Callback 
*)find_cb );
-       new fltk::Item( "F&ind Again",    fltk::COMMAND + 'g', find2_cb );
-       new fltk::Item( "&Replace...",    fltk::COMMAND + 'r', replace_cb );
-       new fltk::Item( "Re&place Again", fltk::COMMAND + 't', replace2_cb );
+       new fltk::Item( "&Find...",       fltk::COMMAND + 'F', (fltk::Callback 
*)find_cb );
+       new fltk::Item( "F&ind Again",    fltk::COMMAND + 'G', find2_cb );
+       new fltk::Item( "&Replace...",    fltk::COMMAND + 'R', replace_cb );
+       new fltk::Item( "Re&place Again", fltk::COMMAND + 'T', replace2_cb );
       g->end();
     menu->end();
 }

Modified: trunk/test/menubar.cxx
===================================================================
--- trunk/test/menubar.cxx      2008-11-10 22:31:42 UTC (rev 6517)
+++ trunk/test/menubar.cxx      2008-11-11 22:31:26 UTC (rev 6518)
@@ -77,20 +77,20 @@
 Fl_Menu_Item menutable[] = {
   {"foo",0,0,0,FL_MENU_INACTIVE},
   {"&File",0,0,0,FL_SUBMENU},
-    {"&Open",  fltk::COMMAND+'o', 0, 0, FL_MENU_INACTIVE},
+    {"&Open",  fltk::COMMAND+'O', 0, 0, FL_MENU_INACTIVE},
     {"&Close", 0,      0},
-    {"&Quit",  fltk::COMMAND+'q', quit_cb, 0, fltk::MENU_DIVIDER},
-    {"shortcut",'a'},
-    {"shortcut",fltk::SHIFT+'a'},
-    {"shortcut",fltk::COMMAND+'a'},
-    {"shortcut",fltk::COMMAND+fltk::SHIFT+'a'},
-    {"shortcut",fltk::ACCELERATOR+'a'},
-    {"shortcut",fltk::ACCELERATOR+fltk::SHIFT+'a'},
-    {"shortcut",fltk::ACCELERATOR+fltk::COMMAND+'a'},
-    {"shortcut",fltk::ACCELERATOR+fltk::SHIFT+fltk::COMMAND+'a', 0,0, 
fltk::MENU_DIVIDER},
-       {"shortcut",fltk::ReturnKey},
-       {"shortcut",fltk::COMMAND+fltk::ReturnKey, 0,0, fltk::MENU_DIVIDER},
-       {"shortcut",fltk::F1Key},
+    {"&Quit",  fltk::COMMAND+'Q', quit_cb, 0, fltk::MENU_DIVIDER},
+    {"shortcut",'A'},
+    {"shortcut",fltk::SHIFT+'A'},
+    {"shortcut",fltk::COMMAND+'A'},
+    {"shortcut",fltk::COMMAND+fltk::SHIFT+'A'},
+    {"shortcut",fltk::ACCELERATOR+'A'},
+    {"shortcut",fltk::ACCELERATOR+fltk::SHIFT+'A'},
+    {"shortcut",fltk::ACCELERATOR+fltk::COMMAND+'A'},
+    {"shortcut",fltk::ACCELERATOR+fltk::SHIFT+fltk::COMMAND+'A', 0,0, 
fltk::MENU_DIVIDER},
+    {"shortcut",fltk::ReturnKey},
+    {"shortcut",fltk::COMMAND+fltk::ReturnKey, 0,0, fltk::MENU_DIVIDER},
+    {"shortcut",fltk::F1Key},
     {"shortcut",fltk::SHIFT+fltk::F1Key},
     {"shortcut",fltk::COMMAND+fltk::F1Key},
     {"shortcut",fltk::SHIFT+fltk::COMMAND+fltk::F1Key},
@@ -110,16 +110,17 @@
       {0},
     {0},
   {"&Edit",0,0,0,FL_SUBMENU},
-    {"Undo",   fltk::ACCELERATOR+'z',  0},
-    {"Redo",   fltk::ACCELERATOR+'r',  0, 0, fltk::MENU_DIVIDER},
-    {"Cut",    fltk::ACCELERATOR+'x',  0},
-    {"Copy",   fltk::ACCELERATOR+'c',  0},
-    {"Paste",  fltk::ACCELERATOR+'v',  0},
-    {"Inactive",fltk::ACCELERATOR+'d', 0, 0, FL_MENU_INACTIVE},
+    {"Undo",   fltk::COMMAND+'Z',      0},
+    {"Redo",   fltk::COMMAND+'Y',      0, 0, fltk::MENU_DIVIDER},
+    {"Cut",    fltk::COMMAND+'X',      0},
+    {"Copy",   fltk::COMMAND+'C',      0},
+    {"Paste",  fltk::COMMAND+'V',      0},
+    {"Inactive",fltk::COMMAND+'D',     0, 0, FL_MENU_INACTIVE},
     {"Clear",  0,      0, 0, fltk::MENU_DIVIDER},
-    {"Invisible",fltk::ACCELERATOR+'e',        0, 0, FL_MENU_INVISIBLE},
+    {"Invisible",fltk::COMMAND+'E',    0, 0, FL_MENU_INVISIBLE},
     {"Preferences",0,  0},
-    {"Size",   0,      0},
+    {"Larger", '+', 0, 0},
+    {"Smaller", '-', 0, 0},
     {0},
   {"&Checkbox",0,0,0,FL_SUBMENU},
     {"&Alpha", 0,      0, (void *)1, fltk::MENU_TOGGLE|FL_MENU_VALUE},

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to