| 844 | } |
| 845 | |
| 846 | LRESULT |
| 847 | onMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam) |
| 848 | { |
| 849 | LPMEASUREITEMSTRUCT lpmis; |
| 850 | TEXTMETRIC tm; |
| 851 | HGDIOBJ saveFont; |
| 852 | HDC hdc; |
| 853 | PNHMenuWindow data; |
| 854 | RECT list_rect; |
| 855 | |
| 856 | lpmis = (LPMEASUREITEMSTRUCT) lParam; |
| 857 | data = (PNHMenuWindow) GetWindowLong(hWnd, GWL_USERDATA); |
| 858 | GetClientRect(GetMenuControl(hWnd), &list_rect); |
| 859 | |
| 860 | hdc = GetDC(GetMenuControl(hWnd)); |
| 861 | saveFont = |
| 862 | SelectObject(hdc, mswin_get_font(NHW_MENU, ATR_INVERSE, hdc, FALSE)); |
| 863 | GetTextMetrics(hdc, &tm); |
| 864 | |
| 865 | /* Set the height of the list box items. */ |
| 866 | lpmis->itemHeight = max(tm.tmHeight, TILE_Y) + 2; |
| 867 | lpmis->itemWidth = list_rect.right - list_rect.left; |
| 868 | |
| 869 | SelectObject(hdc, saveFont); |
| 870 | ReleaseDC(GetMenuControl(hWnd), hdc); |
| 871 | return TRUE; |
| 872 | } |
| 873 | |
| 874 | LRESULT |
| 875 | onDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam) |
no test coverage detected