summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2009-09-17 22:12:24 +0000
committerMatthias Melcher <fltk@matthiasm.com>2009-09-17 22:12:24 +0000
commitbcff4ec8e0e8d75880312d31e3e678b8f270de6b (patch)
treed6fd1a4017da6d8d208c40b945c101c1c49e7b29 /FL
parentc0e4cf48a402bc355558b7a99160da0659cfbfa2 (diff)
International menu shortcuts working on Mac OS (and probably the other OS's)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6878 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Enumerations.H8
-rw-r--r--FL/Fl.H2
-rw-r--r--FL/Fl_Button.H2
-rw-r--r--FL/Fl_Menu_Item.H2
-rw-r--r--FL/Fl_Widget.H2
-rw-r--r--FL/fl_draw.H4
-rw-r--r--FL/fl_types.h2
7 files changed, 15 insertions, 7 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H
index 265c4b8e9..6e6cd0ef3 100644
--- a/FL/Enumerations.H
+++ b/FL/Enumerations.H
@@ -330,6 +330,8 @@ enum Fl_When { // Fl_Widget::when():
/*@{*/
+// FIXME: These codes collide with valid Unicode keys
+
#define FL_Button 0xfee8 ///< A mouse button; use Fl_Button + n for mouse button n.
#define FL_BackSpace 0xff08 ///< The backspace key.
#define FL_Tab 0xff09 ///< The tab key.
@@ -391,6 +393,9 @@ enum Fl_When { // Fl_Widget::when():
/*@{*/ // group: Event States
+// FIXME: it would be nice to have the modifiers in the upper 8 bit so that
+// a unicode ke (24bit) can be sent as an unsigned with the modifiers.
+
#define FL_SHIFT 0x00010000 ///< One of the shift keys is down
#define FL_CAPS_LOCK 0x00020000 ///< The caps lock is on
#define FL_CTRL 0x00040000 ///< One of the ctrl keys is down
@@ -407,6 +412,9 @@ enum Fl_When { // Fl_Widget::when():
#define FL_BUTTONS 0x7f000000 ///< Any mouse button is pushed
#define FL_BUTTON(n) (0x00800000<<(n)) ///< Mouse button n (n > 0) is pushed
+#define FL_KEY_MASK 0x0000ffff ///< All keys are 16 bit for now
+ // FIXME: Unicode needs 24 bits!
+
#ifdef __APPLE__
# define FL_COMMAND FL_META ///< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X
# define FL_CONTROL FL_CTRL ///< An alias for FL_META on WIN32 and X11, or FL_META on MacOS X
diff --git a/FL/Fl.H b/FL/Fl.H
index a52149f6a..25cbd16c8 100644
--- a/FL/Fl.H
+++ b/FL/Fl.H
@@ -568,7 +568,7 @@ public:
static void compose_reset() {compose_state = 0;}
static int event_inside(int,int,int,int);
static int event_inside(const Fl_Widget*);
- static int test_shortcut(int);
+ static int test_shortcut(Fl_Shortcut);
// event destinations:
static int handle(int, Fl_Window*);
diff --git a/FL/Fl_Button.H b/FL/Fl_Button.H
index be2d05f99..4444df3be 100644
--- a/FL/Fl_Button.H
+++ b/FL/Fl_Button.H
@@ -45,7 +45,7 @@
#define FL_HIDDEN_BUTTON 3 ///< for Forms compatibility
#ifndef FL_DOXYGEN
-extern FL_EXPORT int fl_old_shortcut(const char*);
+extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
#endif
/**
diff --git a/FL/Fl_Menu_Item.H b/FL/Fl_Menu_Item.H
index 99f8a71be..6a10e5781 100644
--- a/FL/Fl_Menu_Item.H
+++ b/FL/Fl_Menu_Item.H
@@ -47,7 +47,7 @@ enum { // values for flags:
FL_MENU_HORIZONTAL = 0x100 ///< ??? -- reserved
};
-extern FL_EXPORT int fl_old_shortcut(const char*);
+extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
class Fl_Menu_;
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H
index 7c136dc4c..00feef450 100644
--- a/FL/Fl_Widget.H
+++ b/FL/Fl_Widget.H
@@ -828,7 +828,7 @@ public:
/** Internal use only. */
int test_shortcut();
/** Internal use only. */
- static char label_shortcut(const char *t);
+ static Fl_Shortcut label_shortcut(const char *t);
/** Internal use only. */
static int test_shortcut(const char*);
diff --git a/FL/fl_draw.H b/FL/fl_draw.H
index ea2d315fb..89e09198a 100644
--- a/FL/fl_draw.H
+++ b/FL/fl_draw.H
@@ -441,8 +441,8 @@ FL_EXPORT int fl_measure_pixmap(const char* const* cdata, int &w, int &h);
// other:
FL_EXPORT void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
void (*draw_area)(void*, int,int,int,int), void* data);
-FL_EXPORT const char* fl_shortcut_label(int shortcut);
-FL_EXPORT const char* fl_shortcut_label(int shortcuti, const char **eom);
+FL_EXPORT const char* fl_shortcut_label(Fl_Shortcut shortcut);
+FL_EXPORT const char* fl_shortcut_label(Fl_Shortcut shortcut, const char **eom);
FL_EXPORT void fl_overlay_rect(int x,int y,int w,int h);
FL_EXPORT void fl_overlay_clear();
FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color fg=FL_BLACK, Fl_Color bg=FL_WHITE);
diff --git a/FL/fl_types.h b/FL/fl_types.h
index d87cd7387..b470a9167 100644
--- a/FL/fl_types.h
+++ b/FL/fl_types.h
@@ -7,7 +7,7 @@
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
+ * License as published by the Free Software Foundation; either∑
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,