| 59 | } |
| 60 | |
| 61 | LRESULT CALLBACK |
| 62 | TextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) |
| 63 | { |
| 64 | HWND control; |
| 65 | HDC hdc; |
| 66 | PNHTextWindow data; |
| 67 | |
| 68 | data = (PNHTextWindow) GetWindowLong(hWnd, GWL_USERDATA); |
| 69 | switch (message) { |
| 70 | case WM_INITDIALOG: |
| 71 | /* set text control font */ |
| 72 | control = GetDlgItem(hWnd, IDC_TEXT_CONTROL); |
| 73 | if (!control) { |
| 74 | panic("cannot get text view window"); |
| 75 | } |
| 76 | |
| 77 | hdc = GetDC(control); |
| 78 | SendMessage(control, WM_SETFONT, |
| 79 | (WPARAM) mswin_get_font(NHW_TEXT, ATR_NONE, hdc, FALSE), |
| 80 | 0); |
| 81 | ReleaseDC(control, hdc); |
| 82 | |
| 83 | #if defined(WIN_CE_SMARTPHONE) |
| 84 | /* special initialization for SmartPhone dialogs */ |
| 85 | NHSPhoneDialogSetup(hWnd, IDC_SPHONE_TEXTDIALOGBAR, FALSE, |
| 86 | GetNHApp()->bFullScreen); |
| 87 | #endif |
| 88 | /* subclass edit control */ |
| 89 | editControlWndProc = (WNDPROC) GetWindowLong(control, GWL_WNDPROC); |
| 90 | SetWindowLong(control, GWL_WNDPROC, (LONG) NHTextControlWndProc); |
| 91 | |
| 92 | SetFocus(control); |
| 93 | return FALSE; |
| 94 | |
| 95 | case WM_MSNH_COMMAND: |
| 96 | onMSNHCommand(hWnd, wParam, lParam); |
| 97 | break; |
| 98 | |
| 99 | case WM_SIZE: |
| 100 | LayoutText(hWnd); |
| 101 | return FALSE; |
| 102 | |
| 103 | case WM_COMMAND: |
| 104 | switch (LOWORD(wParam)) { |
| 105 | case IDOK: |
| 106 | case IDCANCEL: |
| 107 | data->done = 1; |
| 108 | return TRUE; |
| 109 | case IDC_TEXT_TOGGLE_WRAP: |
| 110 | ToggleWrapStatus(hWnd, !mswin_get_text_wrap(data->window_text)); |
| 111 | return TRUE; |
| 112 | } |
| 113 | break; |
| 114 | |
| 115 | case WM_CTLCOLORBTN: |
| 116 | case WM_CTLCOLOREDIT: |
| 117 | case WM_CTLCOLORSTATIC: { /* sent by edit control before it is drawn */ |
| 118 | HDC hdcEdit = (HDC) wParam; |
nothing calls this directly
no test coverage detected