mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-12-16 13:08:13 +00:00
Compare commits
1 Commits
idd-warnin
...
idd-config
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cab12c6bd2 |
@@ -103,7 +103,7 @@ LRESULT CConfigWindow::onCreate()
|
|||||||
|
|
||||||
m_modeGroup.reset(new CGroupBox(L"Custom modes", WS_CHILD | WS_VISIBLE, m_hwnd));
|
m_modeGroup.reset(new CGroupBox(L"Custom modes", WS_CHILD | WS_VISIBLE, m_hwnd));
|
||||||
|
|
||||||
m_modeBox.reset(new CListBox(WS_CHILD | WS_VISIBLE | WS_VSCROLL | LBS_NOTIFY, m_hwnd));
|
m_modeBox.reset(new CListBox(WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | LBS_NOTIFY, m_hwnd));
|
||||||
if (m_modes)
|
if (m_modes)
|
||||||
updateModeList();
|
updateModeList();
|
||||||
|
|
||||||
@@ -111,18 +111,18 @@ LRESULT CConfigWindow::onCreate()
|
|||||||
m_heightLabel.reset(new CStaticWidget(L"Height:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
m_heightLabel.reset(new CStaticWidget(L"Height:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
||||||
m_refreshLabel.reset(new CStaticWidget(L"Refresh:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
m_refreshLabel.reset(new CStaticWidget(L"Refresh:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
||||||
|
|
||||||
m_modeWidth.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
|
m_modeWidth.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd));
|
||||||
m_modeHeight.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
|
m_modeHeight.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd));
|
||||||
m_modeRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
|
m_modeRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd));
|
||||||
|
|
||||||
m_modeUpdate.reset(new CButton(L"Save", WS_CHILD | WS_VISIBLE, m_hwnd));
|
m_modeUpdate.reset(new CButton(L"Save", WS_CHILD | WS_VISIBLE | WS_TABSTOP, m_hwnd));
|
||||||
m_modeDelete.reset(new CButton(L"Delete", WS_CHILD | WS_VISIBLE, m_hwnd));
|
m_modeDelete.reset(new CButton(L"Delete", WS_CHILD | WS_VISIBLE | WS_TABSTOP, m_hwnd));
|
||||||
EnableWindow(*m_modeUpdate, FALSE);
|
EnableWindow(*m_modeUpdate, FALSE);
|
||||||
EnableWindow(*m_modeDelete, FALSE);
|
EnableWindow(*m_modeDelete, FALSE);
|
||||||
|
|
||||||
m_autosizeGroup.reset(new CGroupBox(L"Autosizing", WS_CHILD | WS_VISIBLE, m_hwnd));
|
m_autosizeGroup.reset(new CGroupBox(L"Autosizing", WS_CHILD | WS_VISIBLE, m_hwnd));
|
||||||
m_defRefreshLabel.reset(new CStaticWidget(L"Default refresh:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
m_defRefreshLabel.reset(new CStaticWidget(L"Default refresh:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
||||||
m_defRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
|
m_defRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER | WS_TABSTOP, m_hwnd));
|
||||||
m_defRefreshHz.reset(new CStaticWidget(L"Hz", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
m_defRefreshHz.reset(new CStaticWidget(L"Hz", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
||||||
|
|
||||||
RECT client = { 0, 0, (LONG)(436 * m_scale), (LONG)(300 * m_scale) };
|
RECT client = { 0, 0, (LONG)(436 * m_scale), (LONG)(300 * m_scale) };
|
||||||
@@ -220,7 +220,7 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
|
|||||||
|
|
||||||
LRESULT result = m_settings.setModes(*m_modes);
|
LRESULT result = m_settings.setModes(*m_modes);
|
||||||
if (result != ERROR_SUCCESS)
|
if (result != ERROR_SUCCESS)
|
||||||
DEBUG_ERROR_HR((HRESULT) result, "Failed to save modes");
|
DEBUG_ERROR_HR(result, "Failed to save modes");
|
||||||
}
|
}
|
||||||
else if (hwnd == *m_modeDelete && code == BN_CLICKED && m_modes)
|
else if (hwnd == *m_modeDelete && code == BN_CLICKED && m_modes)
|
||||||
{
|
{
|
||||||
@@ -234,7 +234,7 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
|
|||||||
|
|
||||||
LRESULT result = m_settings.setModes(*m_modes);
|
LRESULT result = m_settings.setModes(*m_modes);
|
||||||
if (result != ERROR_SUCCESS)
|
if (result != ERROR_SUCCESS)
|
||||||
DEBUG_ERROR_HR((HRESULT) result, "Failed to save modes");
|
DEBUG_ERROR_HR(result, "Failed to save modes");
|
||||||
|
|
||||||
updateModeList();
|
updateModeList();
|
||||||
onModeListSelectChange();
|
onModeListSelectChange();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ std::wstring CEditWidget::getValue()
|
|||||||
{
|
{
|
||||||
std::wstring result;
|
std::wstring result;
|
||||||
result.resize(Edit_GetTextLength(m_hwnd));
|
result.resize(Edit_GetTextLength(m_hwnd));
|
||||||
Edit_GetText(m_hwnd, result.data(), (int) (result.size() + 1));
|
Edit_GetText(m_hwnd, result.data(), result.size() + 1);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ int CListBox::getSel()
|
|||||||
|
|
||||||
int CListBox::getData(int index)
|
int CListBox::getData(int index)
|
||||||
{
|
{
|
||||||
return (int) ListBox_GetItemData(m_hwnd, index);
|
return ListBox_GetItemData(m_hwnd, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CListBox::setSel(int index)
|
void CListBox::setSel(int index)
|
||||||
|
|||||||
@@ -143,6 +143,11 @@ void CNotifyWindow::registerIcon()
|
|||||||
DEBUG_ERROR_HR(GetLastError(), "Shell_NotifyIcon(NIM_SETVERSION)");
|
DEBUG_ERROR_HR(GetLastError(), "Shell_NotifyIcon(NIM_SETVERSION)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HWND CNotifyWindow::hwndDialog()
|
||||||
|
{
|
||||||
|
return m_config ? m_config->hwnd() : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void CNotifyWindow::close()
|
void CNotifyWindow::close()
|
||||||
{
|
{
|
||||||
closeRequested = true;
|
closeRequested = true;
|
||||||
|
|||||||
@@ -28,5 +28,6 @@ public:
|
|||||||
~CNotifyWindow() override;
|
~CNotifyWindow() override;
|
||||||
static bool registerClass();
|
static bool registerClass();
|
||||||
|
|
||||||
|
HWND hwndDialog();
|
||||||
void close();
|
void close();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -105,8 +105,12 @@ int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _
|
|||||||
MSG msg;
|
MSG msg;
|
||||||
while (GetMessage(&msg, NULL, 0, 0) > 0)
|
while (GetMessage(&msg, NULL, 0, 0) > 0)
|
||||||
{
|
{
|
||||||
TranslateMessage(&msg);
|
HWND hDlg = window.hwndDialog();
|
||||||
DispatchMessage(&msg);
|
if (!hDlg || !IsDialogMessage(hDlg, &msg))
|
||||||
|
{
|
||||||
|
TranslateMessage(&msg);
|
||||||
|
DispatchMessage(&msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) UnregisterWait(hWait);
|
(void) UnregisterWait(hWait);
|
||||||
|
|||||||
Reference in New Issue
Block a user