| 1858 | |
| 1859 | #if defined(WIN_CE_SMARTPHONE) |
| 1860 | void |
| 1861 | NHSPhoneDialogSetup(HWND hDlg, UINT nToolBarId, BOOL is_edit, |
| 1862 | BOOL is_fullscreen) |
| 1863 | { |
| 1864 | SHMENUBARINFO mbi; |
| 1865 | HWND hOK, hCancel; |
| 1866 | RECT rtOK, rtDlg; |
| 1867 | |
| 1868 | // Create our MenuBar |
| 1869 | ZeroMemory(&mbi, sizeof(SHMENUBARINFO)); |
| 1870 | mbi.cbSize = sizeof(mbi); |
| 1871 | mbi.hwndParent = hDlg; |
| 1872 | mbi.nToolBarId = nToolBarId; |
| 1873 | mbi.hInstRes = GetNHApp()->hApp; |
| 1874 | if (!SHCreateMenuBar(&mbi)) { |
| 1875 | error("cannot create dialog menu"); |
| 1876 | } |
| 1877 | |
| 1878 | if (is_fullscreen) { |
| 1879 | SHINITDLGINFO shidi; |
| 1880 | RECT main_wnd_rect; |
| 1881 | shidi.dwMask = SHIDIM_FLAGS; |
| 1882 | shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN; |
| 1883 | shidi.hDlg = hDlg; |
| 1884 | SHInitDialog(&shidi); |
| 1885 | |
| 1886 | GetWindowRect(GetNHApp()->hMainWnd, &main_wnd_rect); |
| 1887 | MoveWindow(hDlg, main_wnd_rect.left, main_wnd_rect.top, |
| 1888 | main_wnd_rect.right - main_wnd_rect.left, |
| 1889 | main_wnd_rect.bottom - main_wnd_rect.top, FALSE); |
| 1890 | } |
| 1891 | |
| 1892 | /* hide OK and CANCEL buttons */ |
| 1893 | hOK = GetDlgItem(hDlg, IDOK); |
| 1894 | hCancel = GetDlgItem(hDlg, IDCANCEL); |
| 1895 | |
| 1896 | if (IsWindow(hCancel)) |
| 1897 | ShowWindow(hCancel, SW_HIDE); |
| 1898 | if (IsWindow(hOK)) { |
| 1899 | GetWindowRect(hOK, &rtOK); |
| 1900 | GetWindowRect(hDlg, &rtDlg); |
| 1901 | |
| 1902 | rtDlg.bottom -= rtOK.bottom - rtOK.top; |
| 1903 | ShowWindow(hOK, SW_HIDE); |
| 1904 | SetWindowPos(hDlg, HWND_TOP, 0, 0, rtDlgr.right - rtDlg.left, |
| 1905 | rtDlg.bottom - rtDlg.top, |
| 1906 | SWP_NOMOVE | SWP_NOREPOSITION | SWP_NOZORDER); |
| 1907 | } |
| 1908 | |
| 1909 | /* override "Back" button for edit box dialogs */ |
| 1910 | if (is_edit) |
| 1911 | SendMessage(mbi.hwndMB, SHCMBM_OVERRIDEKEY, VK_TBACK, |
| 1912 | MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY, |
| 1913 | SHMBOF_NODEFAULT | SHMBOF_NOTIFY)); |
| 1914 | } |
| 1915 | #endif /* defined(WIN_CE_SMARTPHONE) */ |
| 1916 | |
| 1917 | void |
no test coverage detected