/* GUIBEGIN WINDOW , 123, 231, 336, 124, POPUP|CAPTION|SYSMENU|MINBOX|MAXBOX|THICK, , Mouse Position example FONT 8, 400, MS Shell Dlg GROUP 2, 5, 327, 50, GROUP, , , , Image RADIO 10, 21, 48, 8, AUTO|GROUP, , MouseShapes, ALT "D", Stan&dard RADIO 69, 21, 42, 8, AUTO, , , ALT "I", &I_beam RADIO 122, 21, 35, 8, AUTO, , , ALT "A", W&ait RADIO 172, 21, 40, 8, AUTO, , , ALT "C", &Cross RADIO 218, 21, 48, 8, AUTO, , , ALT "U", &UpArrow RADIO 269, 21, 56, 8, AUTO, , , ALT "S", SizeNW&SE RADIO 10, 36, 55, 8, AUTO, , , ALT "E", SizeN&ESW RADIO 70, 36, 46, 8, AUTO, , , ALT "W", Size&WE RADIO 121, 36, 42, 10, AUTO, , , ALT "N", Size&NS RADIO 172, 36, 39, 10, AUTO, , , ALT "L", SizeA&ll RADIO 218, 36, 32, 8, AUTO, , , ALT "O", N&o RADIO 269, 36, 46, 10, AUTO, , , ALT "P", A&ppStart TEXT 97, 72, 125, 8, GROUP, , , , Move mouse here to observe shape DEND GUIEND */ /* An example of printing the mouse coordinates when the mouse * is moved inside of a REXX GUI window. */ /* ============== FUNCDEF some needed OS functions ============ */ LIBRARY rexxgui DO /* FUNCDEF LoadCursor. It loads a cursor image from the * resource of some executable, or uses one of the standard * windows cursors such as a wait pointer. We're going to * define it (callable as LoadStdCursor) for doing the latter * easily */ FUNCDEF("LoadStdCursor", "void, void, 32u", "user32", "LoadCursor") /* FUNCDEF SetCursor. It sets the mouse pointer image */ FUNCDEF("SetCursor", "void, void", "user32") CATCH FAILURE CONDITION("M") RETURN END GuiErr = "SYNTAX" GuiHeading = 1 GuiCreateWindow('NORMAL') /* Initially assume a standard mouse pointer */ ImageNumber = 32512 Presets.1 = 32512 Presets.2 = 32513 Presets.3 = 32514 Presets.4 = 32515 Presets.5 = 32516 Presets.6 = 32642 Presets.7 = 32643 Presets.8 = 32644 Presets.9 = 32645 Presets.10 = 32646 Presets.11 = 32648 Presets.12 = 32650 Again: DO FOREVER GuiGetMsg() CATCH SYNTAX CONDITION('M') SIGNAL Again CATCH HALT FINALLY GuiDestroyWindow() END RETURN /* ================== WM_MOUSEMOVE ================== * This handles the MOUSEMOVE event for my window. * * Reginald calls this when the user has moved * the mouse pointer. * * ARG(1) is a value that tells what keys (on the keyboard) * were held down while the mouse was moved. * ARG(2) is the X position of the mouse. * ARG(3) is the Y position of the mouse. */ WM_MOUSEMOVE: /* Let's get the mouse image shape desired. If you use the * PROCEDURE keyword, remember to EXPOSE external variables * you wish to access here. */ /* The first arg to LoadStdCursor can be omitted. * * The second arg determines which preset image is * used, and must be one of the following: * * Standard ARROW = 32512 * IBEAM = 32513 * WAIT = 32514 * CROSS = 32515 * UPARROW = 32516 * SIZENWSE = 32642 * SIZENESW = 32643 * SIZEWE = 32644 * SIZENS = 32645 * SIZEALL = 32646 * NO = 32648 * APPSTARTING = 32650 */ newcursor = LoadStdCursor(, ImageNumber) /* Did we get it ok? */ IF newcursor \== 0 THEN /* Change the mouse to that image */ SetCursor(newcursor) /* We handled this msg */ RETURN "" /* =============== WM_CLICK_MouseShapes =============== * This handles the CLICK event for my group of RADIO * buttons associated with the "MouseShapes" variable. * * Reginald calls this when the user has changed to * a different radio button. */ WM_CLICK_MouseShapes: /* Get the currently selected button number. */ GuiGetCtlValue("MouseShapes") IF EXISTS("MouseShapes") THEN /* Look up the value that we'll pass to LoadStdCursor for * this mouse pointer, and set "ImageNumber" to it. */ ImageNumber = Presets.MouseShapes RETURN