| 2325 | */ |
| 2326 | |
| 2327 | static void |
| 2328 | MsgClick(NhWindow *wind, Point pt) |
| 2329 | { |
| 2330 | int r_idx = 0; |
| 2331 | |
| 2332 | while (topl_resp[r_idx]) { |
| 2333 | Rect frame; |
| 2334 | topl_resp_rect(r_idx, &frame); |
| 2335 | InsetRect(&frame, 1, 1); |
| 2336 | if (PtInRect(pt, &frame)) { |
| 2337 | Boolean in_btn = true; |
| 2338 | |
| 2339 | InvertRect(&frame); |
| 2340 | while (WaitMouseUp()) { |
| 2341 | #if !TARGET_API_MAC_CARBON |
| 2342 | SystemTask(); |
| 2343 | #endif |
| 2344 | GetMouse(&pt); |
| 2345 | if (PtInRect(pt, &frame) != in_btn) { |
| 2346 | in_btn = !in_btn; |
| 2347 | InvertRect(&frame); |
| 2348 | } |
| 2349 | } |
| 2350 | if (in_btn) { |
| 2351 | InvertRect(&frame); |
| 2352 | AddToKeyQueue(topl_resp[r_idx], 1); |
| 2353 | } |
| 2354 | return; |
| 2355 | } |
| 2356 | ++r_idx; |
| 2357 | } |
| 2358 | return; |
| 2359 | } |
| 2360 | |
| 2361 | static void |
| 2362 | MsgUpdate(NhWindow *wind) |
no test coverage detected