MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / display

Method display

src/ui/StaticDialog.cpp:48–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void StaticDialog::display(bool toShow, bool activate) const {
49 if (toShow) {
50 // If the user has switched from a dual monitor to a single monitor since we last
51 // displayed the dialog, then ensure that it's still visible on the single monitor.
52 RECT workAreaRect, rc;
53 ::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0);
54 ::GetWindowRect(_hSelf, &rc);
55 int newLeft = rc.left;
56 int newTop = rc.top;
57 int margin = ::GetSystemMetrics(SM_CYSMCAPTION);
58 if (newLeft > ::GetSystemMetrics(SM_CXVIRTUALSCREEN) - margin)
59 newLeft -= rc.right - workAreaRect.right;
60 if (newLeft + (rc.right - rc.left) < ::GetSystemMetrics(SM_XVIRTUALSCREEN) + margin)
61 newLeft = workAreaRect.left;
62 if (newTop > ::GetSystemMetrics(SM_CYVIRTUALSCREEN) - margin)
63 newTop -= rc.bottom - workAreaRect.bottom;
64 if (newTop + (rc.bottom - rc.top) < ::GetSystemMetrics(SM_YVIRTUALSCREEN) + margin)
65 newTop = workAreaRect.top;
66
67 if ((newLeft != rc.left) || (newTop != rc.top)) // then the virtual screen size has shrunk
68 // Remember that MoveWindow wants width/height.
69 ::MoveWindow(_hSelf, newLeft, newTop, rc.right - rc.left, rc.bottom - rc.top, TRUE);
70 }
71
72 Window::display(toShow, activate);
73}
74
75HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplate) {
76 // Get Dlg Template resource

Callers 7

subclass_procFunction · 0.45
beNotifiedFunction · 0.45
messageProcFunction · 0.45
run_dlg_procMethod · 0.45
init_suggestions_boxMethod · 0.45
finalize_downloadingMethod · 0.45
run_dlg_procMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected