| 1823 | } |
| 1824 | |
| 1825 | void CMainFrame::DockKeypad(BOOL dock) { |
| 1826 | if (D3EditState.keypad_visible) { |
| 1827 | if (dock) { |
| 1828 | // Resize the keypad to the size of the window. |
| 1829 | if (m_FloatingKeypadDialog) { |
| 1830 | m_FloatingKeypadDialog->DestroyWindow(); |
| 1831 | m_FloatingKeypadDialog = NULL; |
| 1832 | } |
| 1833 | ShowControlBar(&m_wndKeypadBar, TRUE, FALSE); |
| 1834 | ResizeKeypad(); |
| 1835 | ShowCurrentKeypad(); |
| 1836 | } else { |
| 1837 | ShowControlBar(&m_wndKeypadBar, FALSE, FALSE); |
| 1838 | if (!m_FloatingKeypadDialog) { |
| 1839 | if (!D3EditState.float_keypad_moved) { |
| 1840 | RECT rect; |
| 1841 | m_wndKeypadBar.GetWindowRect(&rect); |
| 1842 | GetActiveFrame()->ScreenToClient(&rect); |
| 1843 | D3EditState.float_keypad_x = rect.left; |
| 1844 | D3EditState.float_keypad_y = rect.top; |
| 1845 | } |
| 1846 | |
| 1847 | CWnd *wnd = GetActiveView(); |
| 1848 | |
| 1849 | m_FloatingKeypadDialog = new CFloatingKeypadDialog(wnd); |
| 1850 | m_FloatingKeypadDialog->Create(); |
| 1851 | |
| 1852 | if (!D3EditState.float_keypad_moved) { |
| 1853 | RECT rect; |
| 1854 | m_FloatingKeypadDialog->GetWindowRect(&rect); |
| 1855 | D3EditState.float_keypad_w = rect.right - rect.left; |
| 1856 | D3EditState.float_keypad_h = rect.bottom - rect.top; |
| 1857 | } |
| 1858 | } |
| 1859 | |
| 1860 | // place keypad at right, top of desktop if not already placed |
| 1861 | m_FloatingKeypadDialog->SetWindowPos(NULL, D3EditState.float_keypad_x, D3EditState.float_keypad_y, |
| 1862 | D3EditState.float_keypad_w, D3EditState.float_keypad_h, SWP_NOZORDER); |
| 1863 | m_FloatingKeypadDialog->SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); |
| 1864 | m_FloatingKeypadDialog->ShowWindow(SW_SHOW); |
| 1865 | D3EditState.float_keypad_moved = 1; |
| 1866 | } |
| 1867 | } else { |
| 1868 | // keypad is NOT visi |
| 1869 | . |
| 1870 | ShowControlBar(&m_wndKeypadBar, FALSE, FALSE); |
| 1871 | } |
| 1872 | } |
| 1873 | |
| 1874 | // Invoke Descent 3 from D3Edit |
no test coverage detected