diff options
| author | Bill Spitzak <spitzak@gmail.com> | 2000-06-03 08:37:09 +0000 |
|---|---|---|
| committer | Bill Spitzak <spitzak@gmail.com> | 2000-06-03 08:37:09 +0000 |
| commit | b0cdb25d3cf5e3016ce14d889a357cd963ba876d (patch) | |
| tree | 9add6102de13b9ba92d548d19d8b2e2ae0387b9e /src/Fl_win32.cxx | |
| parent | fa364dc13e591c9a0362a297e0369575bd4bb718 (diff) | |
Fixes for 1.0.8 I found:
Fixed hardware overlays. The problem was the new fl_clipped() code,
which tests against the current window size. The hardware overlay
code did not set the current window when drawing the overlay. I
needed hardware overlay for DD's code, I'm not sure if these fixes are
good enough to enable this in our general release. Hardware overlay
still only works on SGI Irix.
Some patches to turn off the MSVC++ -Oa (assumme no aliasing)
optimization flag. Suprisingly this only broke a few parts of fltk,
or at least these are the only ones I found.
Does not unmap child windows when the main window is iconized. This
reduces flashing when the window is deiconized.
Fl::key() is set to zero by all events except key down/up. This will
allow you to reliably test if an event or callback was produced by a
keystroke. Fixes the bug posted about stopping Escape from closing
the window.
User defined cursors on OpenGL windows slowed down NT a *LOT*. Some
attempts to fix this by turning off the cursor while drawing the
window.
Filename completion in the file chooser works better on NT. Typing
TAB fixes the case of everything you typed to match the shortest name
that can be completed.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1158 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_win32.cxx')
| -rw-r--r-- | src/Fl_win32.cxx | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 7436e388c..acae8ba9c 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_win32.cxx,v 1.33.2.24 2000/04/25 22:16:35 mike Exp $" +// "$Id: Fl_win32.cxx,v 1.33.2.25 2000/06/03 08:37:02 bill Exp $" // // WIN32-specific code for the Fast Light Tool Kit (FLTK). // @@ -240,7 +240,7 @@ double fl_wait(int timeout_flag, double time) { if (fl_msg.message == WM_FLSELECT) { // Got notification for socket for (int i = 0; i < nfds; i ++) - if (fd[i].fd == fl_msg.wParam) { + if (fd[i].fd == (int)fl_msg.wParam) { (fd[i].cb)(fd[i].fd, fd[i].arg); break; } @@ -433,7 +433,7 @@ static Fl_Window* resize_bug_fix; static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - static char buffer[2]; + Fl::e_keysym = 0; #if 0 // Not sure what this is, it may be left over from earlier attempts to @@ -537,26 +537,27 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar case WM_DEADCHAR: case WM_SYSDEADCHAR: case WM_CHAR: - case WM_SYSCHAR: - {ulong state = Fl::e_state & 0xff000000; // keep the mouse button state - // if GetKeyState is expensive we might want to comment some of these out: - if (GetKeyState(VK_SHIFT)&~1) state |= FL_SHIFT; - if (GetKeyState(VK_CAPITAL)) state |= FL_CAPS_LOCK; - if (GetKeyState(VK_CONTROL)&~1) state |= FL_CTRL; - // Alt gets reported for the Alt-GR switch on foreign keyboards. - // so we need to check the event as well to get it right: - if ((lParam&(1<<29)) //same as GetKeyState(VK_MENU) + case WM_SYSCHAR: { + ulong state = Fl::e_state & 0xff000000; // keep the mouse button state + // if GetKeyState is expensive we might want to comment some of these out: + if (GetKeyState(VK_SHIFT)&~1) state |= FL_SHIFT; + if (GetKeyState(VK_CAPITAL)) state |= FL_CAPS_LOCK; + if (GetKeyState(VK_CONTROL)&~1) state |= FL_CTRL; + // Alt gets reported for the Alt-GR switch on foreign keyboards. + // so we need to check the event as well to get it right: + if ((lParam&(1<<29)) //same as GetKeyState(VK_MENU) && uMsg != WM_CHAR) state |= FL_ALT; - if (GetKeyState(VK_NUMLOCK)) state |= FL_NUM_LOCK; - if (GetKeyState(VK_LWIN)&~1 || GetKeyState(VK_RWIN)&~1) { - // WIN32 bug? GetKeyState returns garbage if the user hit the - // meta key to pop up start menu. Sigh. - if ((GetAsyncKeyState(VK_LWIN)|GetAsyncKeyState(VK_RWIN))&~1) - state |= FL_META; - } - if (GetKeyState(VK_SCROLL)) state |= FL_SCROLL_LOCK; - Fl::e_state = state;} + if (GetKeyState(VK_NUMLOCK)) state |= FL_NUM_LOCK; + if (GetKeyState(VK_LWIN)&~1 || GetKeyState(VK_RWIN)&~1) { + // WIN32 bug? GetKeyState returns garbage if the user hit the + // meta key to pop up start menu. Sigh. + if ((GetAsyncKeyState(VK_LWIN)|GetAsyncKeyState(VK_RWIN))&~1) + state |= FL_META; + } + if (GetKeyState(VK_SCROLL)) state |= FL_SCROLL_LOCK; + Fl::e_state = state; if (lParam & (1<<31)) goto DEFAULT; // ignore up events after fixing shift + static char buffer[2]; if (uMsg == WM_CHAR || uMsg == WM_SYSCHAR) { buffer[0] = char(wParam); Fl::e_length = 1; @@ -571,7 +572,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar // for (int i = lParam&0xff; i--;) while (window->parent()) window = window->window(); if (Fl::handle(FL_KEYBOARD,window)) return 0; - break; + break;} case WM_GETMINMAXINFO: Fl_X::i(window)->set_minmax((LPMINMAXINFO)lParam); @@ -966,5 +967,5 @@ void Fl_Window::make_current() { } // -// End of "$Id: Fl_win32.cxx,v 1.33.2.24 2000/04/25 22:16:35 mike Exp $". +// End of "$Id: Fl_win32.cxx,v 1.33.2.25 2000/06/03 08:37:02 bill Exp $". // |
