| 242 | } |
| 243 | |
| 244 | LRESULT CALLBACK |
| 245 | MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) |
| 246 | { |
| 247 | PNHMenuWindow data; |
| 248 | |
| 249 | CheckInputDialog(hWnd, message, wParam, lParam); |
| 250 | |
| 251 | data = (PNHMenuWindow) GetWindowLong(hWnd, GWL_USERDATA); |
| 252 | switch (message) { |
| 253 | case WM_INITDIALOG: { |
| 254 | HWND text_control; |
| 255 | HDC hDC; |
| 256 | |
| 257 | text_control = GetDlgItem(hWnd, IDC_MENU_TEXT); |
| 258 | |
| 259 | data = (PNHMenuWindow) malloc(sizeof(NHMenuWindow)); |
| 260 | ZeroMemory(data, sizeof(NHMenuWindow)); |
| 261 | data->type = MENU_TYPE_TEXT; |
| 262 | data->how = PICK_NONE; |
| 263 | data->result = 0; |
| 264 | data->done = 0; |
| 265 | data->bmpChecked = |
| 266 | LoadBitmap(GetNHApp()->hApp, MAKEINTRESOURCE(IDB_MENU_SEL)); |
| 267 | data->bmpCheckedCount = |
| 268 | LoadBitmap(GetNHApp()->hApp, MAKEINTRESOURCE(IDB_MENU_SEL_COUNT)); |
| 269 | data->bmpNotChecked = |
| 270 | LoadBitmap(GetNHApp()->hApp, MAKEINTRESOURCE(IDB_MENU_UNSEL)); |
| 271 | SetWindowLong(hWnd, GWL_USERDATA, (LONG) data); |
| 272 | |
| 273 | /* subclass edit control */ |
| 274 | editControlWndProc = |
| 275 | (WNDPROC) GetWindowLong(text_control, GWL_WNDPROC); |
| 276 | SetWindowLong(text_control, GWL_WNDPROC, (LONG) NHMenuTextWndProc); |
| 277 | |
| 278 | /* set text window font */ |
| 279 | hDC = GetDC(text_control); |
| 280 | SendMessage(text_control, WM_SETFONT, |
| 281 | (WPARAM) mswin_get_font(NHW_TEXT, ATR_NONE, hDC, FALSE), |
| 282 | (LPARAM) 0); |
| 283 | ReleaseDC(text_control, hDC); |
| 284 | |
| 285 | #if defined(WIN_CE_SMARTPHONE) |
| 286 | /* special initialization for SmartPhone dialogs */ |
| 287 | NHSPhoneDialogSetup(hWnd, IDC_SPHONE_DIALOGBAR, FALSE, |
| 288 | GetNHApp()->bFullScreen); |
| 289 | #endif |
| 290 | } break; |
| 291 | |
| 292 | case WM_MSNH_COMMAND: |
| 293 | onMSNHCommand(hWnd, wParam, lParam); |
| 294 | break; |
| 295 | |
| 296 | case WM_SIZE: |
| 297 | LayoutMenu(hWnd); |
| 298 | return FALSE; |
| 299 | |
| 300 | case WM_COMMAND: { |
| 301 | switch (LOWORD(wParam)) { |
nothing calls this directly
no test coverage detected