| 76 | } |
| 77 | |
| 78 | void MainFrame::initialiseModule(const IApplicationContext& ctx) |
| 79 | { |
| 80 | // Add another page for Multi-Monitor stuff |
| 81 | IPreferencePage& page = GlobalPreferenceSystem().getPage(_("Settings/Multi Monitor")); |
| 82 | |
| 83 | // Initialise the registry, if no key is set |
| 84 | if (GlobalRegistry().get(RKEY_MULTIMON_START_MONITOR).empty()) |
| 85 | { |
| 86 | GlobalRegistry().set(RKEY_MULTIMON_START_MONITOR, "0"); |
| 87 | } |
| 88 | |
| 89 | ComboBoxValueList list; |
| 90 | |
| 91 | for (unsigned int i = 0; i < wxutil::MultiMonitor::getNumMonitors(); ++i) |
| 92 | { |
| 93 | wxRect rect = wxutil::MultiMonitor::getMonitor(i); |
| 94 | |
| 95 | list.push_back( |
| 96 | fmt::format("Monitor {0:d} ({1:d}x{2:d})", i, rect.GetWidth(), rect.GetHeight()) |
| 97 | ); |
| 98 | } |
| 99 | |
| 100 | page.appendCombo(_("Start DarkRadiant on monitor"), RKEY_MULTIMON_START_MONITOR, list); |
| 101 | |
| 102 | GlobalCommandSystem().addCommand(FOCUS_CONTROL_COMMAND, |
| 103 | std::bind(&MainFrame::focusControl, this, std::placeholders::_1), |
| 104 | { cmd::ARGTYPE_STRING | cmd::ARGTYPE_OPTIONAL } |
| 105 | ); |
| 106 | GlobalCommandSystem().addCommand(TOGGLE_CONTROL_COMMAND, |
| 107 | std::bind(&MainFrame::toggleControl, this, std::placeholders::_1), |
| 108 | { cmd::ARGTYPE_STRING | cmd::ARGTYPE_OPTIONAL } |
| 109 | ); |
| 110 | GlobalCommandSystem().addCommand(TOGGLE_MAIN_CONTROL_COMMAND, |
| 111 | std::bind(&MainFrame::toggleMainControl, this, std::placeholders::_1), |
| 112 | { cmd::ARGTYPE_STRING | cmd::ARGTYPE_OPTIONAL } |
| 113 | ); |
| 114 | GlobalCommandSystem().addCommand(CREATE_CONTROL_COMMAND, |
| 115 | std::bind(&MainFrame::createControl, this, std::placeholders::_1), |
| 116 | { cmd::ARGTYPE_STRING | cmd::ARGTYPE_OPTIONAL } |
| 117 | ); |
| 118 | |
| 119 | GlobalCommandSystem().addCommand("Exit", sigc::mem_fun(this, &MainFrame::exitCmd)); |
| 120 | |
| 121 | #ifdef WIN32 |
| 122 | HMODULE lib = LoadLibrary(L"dwmapi.dll"); |
| 123 | |
| 124 | if (lib != NULL) |
| 125 | { |
| 126 | void (WINAPI *dwmEnableComposition) (bool) = |
| 127 | (void (WINAPI *) (bool)) GetProcAddress(lib, "DwmEnableComposition"); |
| 128 | |
| 129 | if (dwmEnableComposition) |
| 130 | { |
| 131 | // Add a page for Desktop Composition stuff |
| 132 | IPreferencePage& compatPage = GlobalPreferenceSystem().getPage(_("Settings/Compatibility")); |
| 133 | |
| 134 | compatPage.appendCheckBox(_("Disable Windows Desktop Composition"), |
| 135 | RKEY_DISABLE_WIN_DESKTOP_COMP); |
nothing calls this directly
no test coverage detected