Skip to content

Commit

Permalink
Changed special handling on ISO characters 0x80 to 0xA0 for OS X, sin…
Browse files Browse the repository at this point in the history
…ce this characters must be handled as standard characters here.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4957 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Matthias Melcher committed Apr 15, 2006
1 parent eea06b4 commit 1184d7e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/fl_draw.cxx
Expand Up @@ -95,7 +95,11 @@ expand(const char* from, char* buf, double maxw, int& n, double &width,
} else if (c < ' ' || c == 127) { // ^X
*o++ = '^';
*o++ = c ^ 0x40;
} else if (c == 0xA0) { // non-breaking space
#ifdef __APPLE__
} else if (c == 0xCA) { // non-breaking space in MacRoman
#else
} else if (c == 0xA0) { // non-breaking space in ISO 8859
#endif
*o++ = ' ';
} else if (c == '@' && draw_symbols) { // Symbol???
if (p[1] && p[1] != '@') break;
Expand Down
12 changes: 10 additions & 2 deletions src/fl_shortcut.cxx
Expand Up @@ -55,7 +55,11 @@ int Fl::test_shortcut(int shortcut) {
if (!shortcut) return 0;

int v = shortcut & 0xffff;
if (v > 32 && v < 0x7f || v > 0xa0 && v <= 0xff) {
#ifdef __APPLE__
if (v > 32 && v < 0x7f || v >= 0x80 && v <= 0xff) {
#else
if (v > 32 && v < 0x7f || v >= 0xa0 && v <= 0xff) {
#endif
if (isupper(v)) {
shortcut |= FL_SHIFT;
}
Expand Down Expand Up @@ -127,7 +131,11 @@ const char * fl_shortcut_label(int shortcut) {
if (!shortcut) {*p = 0; return buf;}
// fix upper case shortcuts
int v = shortcut & 0xffff;
if (v > 32 && v < 0x7f || v > 0xa0 && v <= 0xff) {
#ifdef __APPLE__
if (v > 32 && v < 0x7f || v >= 0x80 && v <= 0xff) {
#else
if (v > 32 && v < 0x7f || v >= 0xa0 && v <= 0xff) {
#endif
if (isupper(v)) {
shortcut |= FL_SHIFT;
}
Expand Down

0 comments on commit 1184d7e

Please sign in to comment.