(event.xmotion.state & Button3Mask) ||
(event.xmotion.state & Button4Mask) ||
(event.xmotion.state & Button5Mask) )
- {
INVOKE_WCB( *window, Motion, ( event.xmotion.x,
event.xmotion.y ) );
- }
else
- {
INVOKE_WCB( *window, Passive, ( event.xmotion.x,
event.xmotion.y ) );
- }
}
break;
* XXX Use a symbolic constant, *not* "4"!
*/
if( ( button < 3 ) || ( ! FETCH_WCB( *window, MouseWheel ) ) )
- {
INVOKE_WCB( *window, Mouse, ( button,
pressed ? GLUT_DOWN : GLUT_UP,
event.xbutton.x,
event.xbutton.y )
);
- }
else
{
/*
break;
case WM_PAINT:
+ /* Turn on the visibility in case it was turned off somehow */
+ window->State.Visible = GL_TRUE;
BeginPaint( hWnd, &ps );
fghRedrawWindowByHandle( hWnd );
EndPaint( hWnd, &ps );
if( ( wParam & MK_LBUTTON ) ||
( wParam & MK_MBUTTON ) ||
( wParam & MK_RBUTTON ) )
- {
INVOKE_WCB( *window, Motion, ( window->State.MouseX,
window->State.MouseY ) );
- }
else
- {
INVOKE_WCB( *window, Passive, ( window->State.MouseX,
window->State.MouseY ) );
- }
window->State.Modifiers = 0xffffffff;
}
{
int wheel_number = LOWORD( wParam );
/* THIS IS SPECULATIVE -- John Fay, 10/2/03 */
- short ticks = HIWORD( wParam ) / 120;
+ short ticks = ( short )HIWORD( wParam ) / 120;
/* Should be WHEEL_DELTA instead of 120 */
int direction = 1;
while( ticks-- )
if( FETCH_WCB( *window, MouseWheel ) )
- {
INVOKE_WCB( *window, MouseWheel,
( wheel_number,
direction,
window->State.MouseY
)
);
- }
else /* No mouse wheel, call the mouse button callback twice */
{
/*
/* Pass it on to "DefWindowProc" to repaint a standard border */
break;
+ case WM_SYSCOMMAND : /* 0x0112 */
+ {
+ /*
+ * We have received a system command message. Try to act on it.
+ * The commands are passed in through the "lParam" parameter:
+ * Clicking on a corner to resize the window gives a "F004" message
+ * but this is not defined in my header file.
+ */
+ switch ( lParam )
+ {
+ case SC_SIZE :
+ break ;
+
+ case SC_MOVE :
+ break ;
+
+ case SC_MINIMIZE :
+ /* User has clicked on the "-" to minimize the window */
+ /* Turn off the visibility */
+ window->State.Visible = GL_FALSE ;
+
+ break ;
+
+ case SC_MAXIMIZE :
+ break ;
+
+ case SC_NEXTWINDOW :
+ break ;
+
+ case SC_PREVWINDOW :
+ break ;
+
+ case SC_CLOSE :
+ /* Followed very closely by a WM_CLOSE message */
+ break ;
+
+ case SC_VSCROLL :
+ break ;
+
+ case SC_HSCROLL :
+ break ;
+
+ case SC_MOUSEMENU :
+ break ;
+
+ case SC_KEYMENU :
+ break ;
+
+ case SC_ARRANGE :
+ break ;
+
+ case SC_RESTORE :
+ break ;
+
+ case SC_TASKLIST :
+ break ;
+
+ case SC_SCREENSAVE :
+ break ;
+
+ case SC_HOTKEY :
+ break ;
+ }
+ }
+
+ /* We need to pass the message on to the operating system as well */
+ lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
+ break;
+
default:
/*
* Handle unhandled messages