[Debugger UI] Save window size only when the window is resizable.

Prevents some dialogs from becoming clipped at high DPI
This commit is contained in:
oddMLan 2019-04-18 18:18:55 -07:00
parent df9967b782
commit b9025667f8
13 changed files with 24 additions and 14 deletions

View File

@ -47,18 +47,28 @@ protected:
pT->SetWindowPos(NULL, left, top, width, height, 0);
pT->RedrawWindow();
}
if (nParams == 2) {
pT->SetWindowPos(NULL, left, top, width, height, 1);
pT->RedrawWindow();
}
}
void SaveWindowPos()
void SaveWindowPos(bool bSaveSize)
{
if (!m_bInitialized)
{
return;
}
T* pT = static_cast<T*>(this);
CRect rect;
pT->GetWindowRect(&rect);
UISettingsSaveString(m_UISettingID, stdstr_f("%d,%d,%d,%d", rect.left, rect.top, rect.Width(), rect.Height()).c_str());
if (!bSaveSize) {
UISettingsSaveString(m_UISettingID, stdstr_f("%d,%d", rect.left, rect.top).c_str());
}
else {
UISettingsSaveString(m_UISettingID, stdstr_f("%d,%d,%d,%d", rect.left, rect.top, rect.Width(), rect.Height()).c_str());
}
}
public:

View File

@ -243,7 +243,7 @@ void CDebugCPULogView::InterceptMouseWheel(WPARAM wParam, LPARAM /*lParam*/)
void CDebugCPULogView::OnExitSizeMove(void)
{
RefreshList(false);
SaveWindowPos();
SaveWindowPos(true);
}
void CDebugCPULogView::ToggleLoggingEnabled(void)

View File

@ -150,7 +150,7 @@ LRESULT CDebugCommandsView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARA
void CDebugCommandsView::OnExitSizeMove(void)
{
SaveWindowPos();
SaveWindowPos(true);
}
LRESULT CDebugCommandsView::OnDestroy(void)

View File

@ -206,7 +206,7 @@ LRESULT CDebugDMALogView::OnRefresh(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lPara
void CDebugDMALogView::OnExitSizeMove(void)
{
SaveWindowPos();
SaveWindowPos(true);
}
LRESULT CDebugDMALogView::OnDestroy(void)

View File

@ -96,5 +96,5 @@ LRESULT CDebugExcBreakpoints::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND, BO
void CDebugExcBreakpoints::OnExitSizeMove(void)
{
SaveWindowPos();
SaveWindowPos(0);
}

View File

@ -59,7 +59,7 @@ LRESULT CDumpMemory::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lPa
void CDumpMemory::OnExitSizeMove(void)
{
SaveWindowPos();
SaveWindowPos(0);
}
LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)

View File

@ -216,7 +216,7 @@ LRESULT CALLBACK CDebugMemorySearch::HookProc(int nCode, WPARAM wParam, LPARAM l
void CDebugMemorySearch::OnExitSizeMove(void)
{
UpdateWatchList(true);
SaveWindowPos();
SaveWindowPos(true);
}
void CDebugMemorySearch::OnSizing(UINT /*fwSide*/, LPRECT /*pRect*/)

View File

@ -64,7 +64,7 @@ LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l
void CDebugScripts::OnExitSizeMove(void)
{
SaveWindowPos();
SaveWindowPos(true);
}
void CDebugScripts::ConsolePrint(const char* text)

View File

@ -70,7 +70,7 @@ LRESULT CDebugStackTrace::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM
void CDebugStackTrace::OnExitSizeMove(void)
{
SaveWindowPos();
SaveWindowPos(true);
}
LRESULT CDebugStackTrace::OnActivate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)

View File

@ -51,7 +51,7 @@ LRESULT CDebugStackView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /
void CDebugStackView::OnExitSizeMove(void)
{
SaveWindowPos();
SaveWindowPos(true);
}
LRESULT CDebugStackView::OnDestroy(void)

View File

@ -53,7 +53,7 @@ LRESULT CDebugSymbols::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l
void CDebugSymbols::OnExitSizeMove(void)
{
SaveWindowPos();
SaveWindowPos(true);
}
LRESULT CDebugSymbols::OnDestroy(void)

View File

@ -85,7 +85,7 @@ LRESULT CDebugTlb::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lPara
void CDebugTlb::OnExitSizeMove(void)
{
SaveWindowPos();
SaveWindowPos(0);
}
LRESULT CDebugTlb::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND, BOOL& /*bHandled*/)

View File

@ -152,7 +152,7 @@ DWORD WINAPI CDebugMemoryView::AutoRefreshProc(void* _self)
void CDebugMemoryView::OnExitSizeMove()
{
SaveWindowPos();
SaveWindowPos(0);
}
void CDebugMemoryView::InterceptMouseWheel(WPARAM wParam, LPARAM /*lParam*/)