-------------------------------------------------------------------------*/
| 951 | } |
| 952 | /*-------------------------------------------------------------------------*/ |
| 953 | void |
| 954 | onMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam) |
| 955 | { |
| 956 | PNHCmdWindow data; |
| 957 | POINT mpt; |
| 958 | int newActiveCell; |
| 959 | |
| 960 | /* get mouse coordinates */ |
| 961 | mpt.x = LOWORD(lParam); |
| 962 | mpt.y = HIWORD(lParam); |
| 963 | |
| 964 | /* map mouse coordinates to the display cell */ |
| 965 | data = (PNHCmdWindow) GetWindowLong(hWnd, GWL_USERDATA); |
| 966 | newActiveCell = CellFromPoint(data, mpt); |
| 967 | if (data->active_cell == -1) |
| 968 | return; |
| 969 | |
| 970 | /* if mouse is within orginal display cell - select the cell otherwise |
| 971 | clear the selection */ |
| 972 | switch (nhcmdlayout_cell_direct(data->layout_current, data->active_cell) |
| 973 | ->type) { |
| 974 | case NH_CELL_REG: |
| 975 | HighlightCell(hWnd, data->active_cell, |
| 976 | (newActiveCell == data->active_cell)); |
| 977 | break; |
| 978 | |
| 979 | case NH_CELL_CTRL: |
| 980 | HighlightCell(hWnd, data->active_cell, |
| 981 | ((newActiveCell == data->active_cell) ? !data->is_ctrl |
| 982 | : data->is_ctrl)); |
| 983 | break; |
| 984 | |
| 985 | case NH_CELL_CAP: |
| 986 | HighlightCell(hWnd, data->active_cell, |
| 987 | ((newActiveCell == data->active_cell) ? !data->is_caps |
| 988 | : data->is_caps)); |
| 989 | break; |
| 990 | } |
| 991 | } |
| 992 | /*-------------------------------------------------------------------------*/ |
| 993 | void |
| 994 | onMouseUp(HWND hWnd, WPARAM wParam, LPARAM lParam) |
no test coverage detected