(clientData, eventPtr)
| 1294 | * This procedure is called back by Tk in response to |
| 1295 | * mouse events such as window entry, window exit, mouse |
| 1296 | * motion, and button presses. |
| 1297 | * |
| 1298 | * Results: |
| 1299 | * None. |
| 1300 | * |
| 1301 | * Side effects: |
| 1302 | * This procedure implements the "feel" of the scale by |
| 1303 | * issuing commands in response to button presses and mouse |
| 1304 | * motion. |
| 1305 | * |
| 1306 | *-------------------------------------------------------------- |
| 1307 | */ |
| 1308 | |
| 1309 | static void |
| 1310 | ScaleMouseProc(clientData, eventPtr) |
| 1311 | ClientData clientData; /* Information about window. */ |
| 1312 | register XEvent *eventPtr; /* Information about event. */ |
| 1313 | { |
| 1314 | register Scale *scalePtr = (Scale *) clientData; |
| 1315 | |
| 1316 | if (scalePtr->state != tkNormalUid) { |
| 1317 | return; |
| 1318 | } |
| 1319 | |
| 1320 | Tk_Preserve((ClientData) scalePtr); |
| 1321 | if (eventPtr->type == EnterNotify) { |
| 1322 | scalePtr->flags |= ACTIVE; |
| 1323 | EventuallyRedrawScale(scalePtr, REDRAW_SLIDER); |
| 1324 | } else if (eventPtr->type == LeaveNotify) { |
| 1325 | scalePtr->flags &= ~ACTIVE; |
| 1326 | EventuallyRedrawScale(scalePtr, REDRAW_SLIDER); |
| 1327 | } else if ((eventPtr->type == MotionNotify) |
| 1328 | && (scalePtr->flags & BUTTON_PRESSED)) { |
| 1329 | SetScaleValue(scalePtr, PixelToValue(scalePtr, |
| 1330 | eventPtr->xmotion.x, eventPtr->xmotion.y)); |
| 1331 | } else if ((eventPtr->type == ButtonPress) |
| 1332 | && ((eventPtr->xbutton.state & ALL_BUTTONS) == 0)) { |
| 1333 | scalePtr->flags |= BUTTON_PRESSED; |
nothing calls this directly
no test coverage detected