mirror of
https://github.com/fltk/fltk.git
synced 2026-05-22 07:01:34 +08:00
Tiny change to Fl.H to get around bug in new gcc versions?
Change to code to try alternative cases of shortcuts suggested by Yaroslav Volovich. It should now work for foreign letters. However I was unable to get it to do anything no matter how I set the locale. It may be better to fix this by hardcoding in the iso-8859-1 character set and not use ctype at all, "locale" is a horrid travestry anyway and has done more to *prevent* internationalization than to help it by making it virtually impossible to test foreign components. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1001 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+5
-4
@@ -1,6 +1,6 @@
|
||||
#include <stdio.h>
|
||||
//
|
||||
// "$Id: Fl.cxx,v 1.24.2.14 2000/01/16 04:30:36 bill Exp $"
|
||||
// "$Id: Fl.cxx,v 1.24.2.15 2000/02/15 08:31:45 bill Exp $"
|
||||
//
|
||||
// Main event handling code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -496,8 +496,9 @@ int Fl::handle(int event, Fl_Window* window)
|
||||
|
||||
// and then try a shortcut with the case of the text swapped, by
|
||||
// changing the text and falling through to FL_SHORTCUT case:
|
||||
if (!isalpha(event_text()[0])) return 0;
|
||||
*(char*)(event_text()) ^= ('A'^'a');
|
||||
{char* c = (char*)event_text(); // cast away const
|
||||
if (!isalpha(*c)) return 0;
|
||||
*c = isupper(*c) ? tolower(*c) : toupper(*c);}
|
||||
event = FL_SHORTCUT;
|
||||
|
||||
case FL_SHORTCUT:
|
||||
@@ -704,5 +705,5 @@ int fl_old_shortcut(const char* s) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl.cxx,v 1.24.2.14 2000/01/16 04:30:36 bill Exp $".
|
||||
// End of "$Id: Fl.cxx,v 1.24.2.15 2000/02/15 08:31:45 bill Exp $".
|
||||
//
|
||||
|
||||
+4
-2
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_rect.cxx,v 1.10 1999/03/04 18:32:14 mike Exp $"
|
||||
// "$Id: fl_rect.cxx,v 1.10.2.1 2000/02/15 08:31:46 bill Exp $"
|
||||
//
|
||||
// Rectangle drawing routines for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -325,6 +325,8 @@ void fl_pop_clip() {
|
||||
|
||||
// does this rectangle intersect current clip?
|
||||
int fl_not_clipped(int x, int y, int w, int h) {
|
||||
if (x+w <= 0 || y+h <= 0 || x > Fl_Window::current()->w()
|
||||
|| y > Fl_Window::current()->h()) return 0;
|
||||
Region r = rstack[rstackptr];
|
||||
#ifndef WIN32
|
||||
return r ? XRectInRegion(r, x, y, w, h) : 1;
|
||||
@@ -386,5 +388,5 @@ int fl_clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H){
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: fl_rect.cxx,v 1.10 1999/03/04 18:32:14 mike Exp $".
|
||||
// End of "$Id: fl_rect.cxx,v 1.10.2.1 2000/02/15 08:31:46 bill Exp $".
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user