static void SendPointEvent( gui_window *wnd, gui_event gui_ev, gui_coord *point ) { gui_point pt; bool down_sent; down_sent = ButtonDownSent == wnd; switch( gui_ev ) { case GUI_LBUTTONDOWN : case GUI_RBUTTONDOWN : ButtonDownSent = wnd; break; case GUI_LBUTTONUP : case GUI_RBUTTONUP : ButtonDownSent = NULL; break; default : break; } /* if the mouse event is not on the border, or if it is a mouse up on * the border */ if( down_sent || ( MouseState == MOUSE_CLIENT ) ) { if( ( wnd->hgadget != NULL ) && !GUI_HSCROLL_EVENTS_SET( wnd ) ) { point->x += wnd->hgadget->pos; } if( ( wnd->vgadget != NULL ) && !GUI_VSCROLL_EVENTS_SET( wnd ) ) { point->y += wnd->vgadget->pos; } GUIMakeRelative( wnd, point, &pt ); GUIEVENTWND( wnd, gui_ev, &pt ); } }
bool GUIGetMousePosn( gui_window *wnd, gui_point *point ) { WPI_POINT pt; if( !_wpi_getsystemmetrics( SM_MOUSEPRESENT ) ) { return( false ); } _wpi_getcursorpos( &pt ); #ifdef __OS2_PM__ // close your eyes!!! gross hack coming up _wpi_screentoclient( wnd->hwnd, &pt ); pt.y = _wpi_cvtc_y( wnd->hwnd, pt.y ); _wpi_clienttoscreen( wnd->hwnd, &pt ); #endif GUIMakeRelative( wnd, &pt, point ); return( true ); }
bool SendPointEvent( WPI_PARAM1 wparam, WPI_PARAM2 lparam, gui_window *wnd, gui_event gui_ev, bool force_current ) { WPI_POINT currentpoint; gui_point point; if( force_current || !EditControlHasFocus ) { wparam = wparam; lparam = lparam; currentpoint.x = GET_WM_MOUSEMOVE_POSX( wparam, lparam ); currentpoint.y = GET_WM_MOUSEMOVE_POSY( wparam, lparam ); if( force_current && ( GUICurrWnd != wnd ) && ( GUICurrWnd != NULL ) ) { //wnd = GUICurrWnd; } currentpoint.y = _wpi_cvtc_y( wnd->hwnd, currentpoint.y ); _wpi_clienttoscreen( wnd->hwnd, ¤tpoint ); GUIMakeRelative( wnd, ¤tpoint, &point ); GUIEVENTWND( wnd, gui_ev, &point ); return( TRUE ); } return( FALSE ); }