diff --git a/Source/Project64/Settings/UISettings.cpp b/Source/Project64/Settings/UISettings.cpp index a0431688f..5bfcef5cf 100644 --- a/Source/Project64/Settings/UISettings.cpp +++ b/Source/Project64/Settings/UISettings.cpp @@ -66,36 +66,16 @@ void RegisterUISettings (void) g_Settings->AddHandler((SettingID)(FirstUISettings + SupportWindows_RunCount), new CSettingTypeApplication("Support Project64", "Run Count", (uint32_t)0)); //Debugger UI - g_Settings->AddHandler((SettingID)(FirstUISettings + MemorySearch_Top), new CSettingTypeApplication("Debugger", "Memory Search Top", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + MemorySearch_Left), new CSettingTypeApplication("Debugger", "Memory Search Left", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + ViewMemory_Top), new CSettingTypeApplication("Debugger", "View Memory Top", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + ViewMemory_Left), new CSettingTypeApplication("Debugger", "View Memory Left", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + TLB_Top), new CSettingTypeApplication("Debugger", "TLB Top", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + TLB_Left), new CSettingTypeApplication("Debugger", "TLB Left", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Commands_Top), new CSettingTypeApplication("Debugger", "Commands Top", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Commands_Left), new CSettingTypeApplication("Debugger", "Commands Left", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Commands_Width), new CSettingTypeApplication("Debugger", "Commands Width", (uint32_t)489)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Commands_Height), new CSettingTypeApplication("Debugger", "Commands Height", (uint32_t)327)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Scripts_Top), new CSettingTypeApplication("Debugger", "Scripts Top", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Scripts_Left), new CSettingTypeApplication("Debugger", "Scripts Left", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Scripts_Width), new CSettingTypeApplication("Debugger", "Scripts Width", (uint32_t)337)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Scripts_Height), new CSettingTypeApplication("Debugger", "Scripts Height", (uint32_t)170)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Symbols_Top), new CSettingTypeApplication("Debugger", "Symbols Top", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Symbols_Left), new CSettingTypeApplication("Debugger", "Symbols Left", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Symbols_Width), new CSettingTypeApplication("Debugger", "Symbols Width", (uint32_t)313)); - g_Settings->AddHandler((SettingID)(FirstUISettings + Symbols_Height), new CSettingTypeApplication("Debugger", "Symbols Height", (uint32_t)141)); - g_Settings->AddHandler((SettingID)(FirstUISettings + DMALogView_Top), new CSettingTypeApplication("Debugger", "DMA Log View Top", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + DMALogView_Left), new CSettingTypeApplication("Debugger", "DMA Log View Left", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + DMALogView_Width), new CSettingTypeApplication("Debugger", "DMA Log View Width", (uint32_t)309)); - g_Settings->AddHandler((SettingID)(FirstUISettings + DMALogView_Height), new CSettingTypeApplication("Debugger", "DMA Log View Height", (uint32_t)215)); - g_Settings->AddHandler((SettingID)(FirstUISettings + StackView_Top), new CSettingTypeApplication("Debugger", "Stack View Top", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + StackView_Left), new CSettingTypeApplication("Debugger", "Stack View Left", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + StackView_Width), new CSettingTypeApplication("Debugger", "Stack View Width", (uint32_t)197)); - g_Settings->AddHandler((SettingID)(FirstUISettings + StackView_Height), new CSettingTypeApplication("Debugger", "Stack View Height", (uint32_t)212)); - g_Settings->AddHandler((SettingID)(FirstUISettings + StackTrace_Top), new CSettingTypeApplication("Debugger", "Stack Trace Top", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + StackTrace_Left), new CSettingTypeApplication("Debugger", "Stack Trace Left", Default_None)); - g_Settings->AddHandler((SettingID)(FirstUISettings + StackTrace_Width), new CSettingTypeApplication("Debugger", "Stack Trace Width", (uint32_t)223)); - g_Settings->AddHandler((SettingID)(FirstUISettings + StackTrace_Height), new CSettingTypeApplication("Debugger", "Stack Trace Height", (uint32_t)221)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_CommandsPos), new CSettingTypeApplication("Debugger UI", "Commands Pos", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_MemoryPos), new CSettingTypeApplication("Debugger UI", "Memory Pos", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_MemoryDumpPos), new CSettingTypeApplication("Debugger UI", "Memory Dump Pos", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_MemorySearchPos), new CSettingTypeApplication("Debugger UI", "Memory Search Pos", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_DMALogPos), new CSettingTypeApplication("Debugger UI", "DMA Log Pos", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_ScriptsPos), new CSettingTypeApplication("Debugger UI", "Scripts Pos", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_StackPos), new CSettingTypeApplication("Debugger UI", "Stack Pos", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_StackTracePos), new CSettingTypeApplication("Debugger UI", "Stack Trace Pos", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_SymbolsPos), new CSettingTypeApplication("Debugger UI", "Symbols Pos", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DebuggerUI_TLBPos), new CSettingTypeApplication("Debugger UI", "TLB Pos", Default_None)); } void UISettingsSaveBool(UISettingID Type, bool Value) diff --git a/Source/Project64/Settings/UISettings.h b/Source/Project64/Settings/UISettings.h index fbc091e03..19ccb009d 100644 --- a/Source/Project64/Settings/UISettings.h +++ b/Source/Project64/Settings/UISettings.h @@ -62,37 +62,17 @@ enum UISettingID //Support Window SupportWindows_RunCount, - //Debugger UI positions and sizes - MemorySearch_Top, - MemorySearch_Left, - ViewMemory_Top, - ViewMemory_Left, - TLB_Top, - TLB_Left, - Commands_Top, - Commands_Left, - Commands_Width, - Commands_Height, - Scripts_Top, - Scripts_Left, - Scripts_Width, - Scripts_Height, - Symbols_Top, - Symbols_Left, - Symbols_Width, - Symbols_Height, - DMALogView_Top, - DMALogView_Left, - DMALogView_Width, - DMALogView_Height, - StackView_Top, - StackView_Left, - StackView_Width, - StackView_Height, - StackTrace_Top, - StackTrace_Left, - StackTrace_Width, - StackTrace_Height, + //Debugger UI window positions and sizes + DebuggerUI_CommandsPos, + DebuggerUI_MemoryPos, + DebuggerUI_MemoryDumpPos, + DebuggerUI_MemorySearchPos, + DebuggerUI_DMALogPos, + DebuggerUI_ScriptsPos, + DebuggerUI_StackPos, + DebuggerUI_StackTracePos, + DebuggerUI_SymbolsPos, + DebuggerUI_TLBPos, }; void RegisterUISettings (void); diff --git a/Source/Project64/UserInterface/Debugger/DebugDialog.h b/Source/Project64/UserInterface/Debugger/DebugDialog.h index 7d05a567c..5e3e327b0 100644 --- a/Source/Project64/UserInterface/Debugger/DebugDialog.h +++ b/Source/Project64/UserInterface/Debugger/DebugDialog.h @@ -9,6 +9,8 @@ protected: CDebuggerUI * m_Debugger; HANDLE m_CreatedEvent; HANDLE m_DialogThread; + UISettingID m_UISettingID; + bool m_bInitialized; static DWORD CreateDebuggerWindow(CDebugDialog * pThis) { @@ -22,30 +24,41 @@ protected: SetEvent(m_CreatedEvent); } - void LoadWindowPos(UISettingID TopSetting, UISettingID LeftSetting) + void DlgSavePos_Init(UISettingID uiSettingID) + { + m_UISettingID = uiSettingID; + m_bInitialized = true; + } + + void LoadWindowPos() { - CRect m_DefaultWindowRect; - GetWindowRect(&m_DefaultWindowRect); - //We find the middle position of the screen, we use this if theres no setting - uint32_t X = GetX(m_DefaultWindowRect); - uint32_t Y = GetY(m_DefaultWindowRect); + if (!m_bInitialized) + { + return; + } - //Load the value from settings, if none is available, default to above - UISettingsLoadDword(TopSetting, Y); - UISettingsLoadDword(LeftSetting, X); - - SetPos(X, Y); + T* pT = static_cast(this); + std::string str = UISettingsLoadStringVal(m_UISettingID); + int left, top, width, height; + int nParams = sscanf(str.c_str(), "%d,%d,%d,%d", &left, &top, &width, &height); + if (nParams == 4) + { + pT->SetWindowPos(NULL, left, top, width, height, 0); + pT->RedrawWindow(); + } } - void SaveWindowPos(UISettingID TopSetting, UISettingID LeftSetting) + void SaveWindowPos() { - RECT WinRect; - GetWindowRect(&WinRect); - - //Load the value from settings, if none is available, default to above - UISettingsSaveDword(TopSetting, WinRect.top); - UISettingsSaveDword(LeftSetting, WinRect.left); + if (!m_bInitialized) + { + return; + } + T* pT = static_cast(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()); } public: @@ -66,100 +79,6 @@ public: } } - enum { Timer_SetWindowPos = 1 }; - - //Get Information about the window - int GetHeight(void) { - if (!m_hWnd) { return 0; } - - RECT rect; - GetWindowRect(m_hWnd, &rect); - return rect.bottom - rect.top; - } - - int GetWidth(void) { - if (!m_hWnd) { return 0; } - - RECT rect; - GetWindowRect(m_hWnd, &rect); - return rect.right - rect.left; - } - - int GetX(CRect WinRect) { - return (GetSystemMetrics(SM_CXSCREEN) - (WinRect.right - WinRect.left)) / 2; - } - - int GetY(CRect WinRect) { - return (GetSystemMetrics(SM_CYSCREEN) - (WinRect.bottom - WinRect.top)) / 2; - } - - //Manipulate the state of the window - void SetPos(int X, int Y) { //Move the window to this screen location - ::SetWindowPos(m_hWnd, NULL, X, Y, 0, 0, SWP_NOZORDER | SWP_NOSIZE); - } - - void SaveWindowLoc(UISettingID SettingID_Top, UISettingID SettingID_Left) { - RECT WinRect; - ::GetWindowRect(m_hWnd, &WinRect); - - //save the location of the window - if (m_hWnd) - { - m_SaveWnd = true; - m_SaveWndTop = WinRect.top; - m_SaveWndLeft = WinRect.left; - } - - ::KillTimer(m_hWnd, Timer_SetWindowPos); - ::SetTimer(m_hWnd, Timer_SetWindowPos, 1000, NULL); - - bool flush = false; - if (m_SaveWnd) - { - m_SaveWnd = false; - UISettingsSaveDword(SettingID_Top, m_SaveWndTop); - UISettingsSaveDword(SettingID_Left, m_SaveWndLeft); - flush = true; - } - - if (flush) - { - CSettingTypeApplication::Flush(); - } - } - - void SetSize(int Width, int Height) { //Set window Height and Width - RECT rcClient; - rcClient.top = 0; - rcClient.bottom = Height; - rcClient.left = 0; - rcClient.right = Width; - ::AdjustWindowRect(&rcClient, ::GetWindowLong(m_hWnd, GWL_STYLE), true); - - int32_t WindowHeight = rcClient.bottom - rcClient.top; - int32_t WindowWidth = rcClient.right - rcClient.left; - - ::SetWindowPos(m_hWnd, NULL, 0, 0, WindowWidth, WindowHeight, SWP_NOMOVE | SWP_NOZORDER); - } - - void SaveSize(UISettingID SettingID_X, UISettingID SettingID_Y) { - //Get the current window size - RECT rect; - GetWindowRect(m_hWnd, &rect); - - int32_t WindowHeight = rect.bottom - rect.top; - int32_t WindowWidth = rect.right - rect.left; - - if (UISettingsLoadDword(SettingID_X) != WindowWidth) - { - UISettingsSaveDword(SettingID_X, WindowWidth); - } - if (UISettingsLoadDword(SettingID_Y) != WindowHeight) - { - UISettingsSaveDword(SettingID_Y, WindowHeight); - } - } - void HideWindow(void) { if (m_hWnd && ::IsWindow(m_hWnd)) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp b/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp index a71f9b599..2ab9c6847 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp @@ -85,38 +85,9 @@ LRESULT CDebugCommandsView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARA m_OpEdit.Attach(GetDlgItem(IDC_OP_EDIT)); DlgResize_Init(false, true); + DlgSavePos_Init(DebuggerUI_CommandsPos); DlgToolTip_Init(); - int32_t Width = UISettingsLoadDword(Commands_Width); - int32_t Height = UISettingsLoadDword(Commands_Height); - - SetSize(Width, Height); - - - //Fix sizing (duplicate code of CDebugCommandsView:OnSizing) -- FIXME - CRect listRect; - m_CommandList.GetWindowRect(listRect); - - CRect headRect; - CHeaderCtrl listHead = m_CommandList.GetHeader(); - listHead.GetWindowRect(&headRect); - - int rowsHeight = listRect.Height() - headRect.Height(); - - int nRows = (rowsHeight / m_RowHeight); - - if (m_CommandListRows != nRows) - { - m_CommandListRows = nRows; - ShowAddress(m_StartAddress, TRUE); - } - - m_RegisterTabs.RedrawCurrentTab(); - - // Fix cmd list header - listHead.ResizeClient(listRect.Width(), headRect.Height()); - - // Setup address input m_AddressEdit.SetDisplayType(CEditNumber32::DisplayHex); m_AddressEdit.SetLimitText(8); @@ -168,7 +139,8 @@ LRESULT CDebugCommandsView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARA DWORD dwThreadID = ::GetCurrentThreadId(); hWinMessageHook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC)HookProc, NULL, dwThreadID); - LoadWindowPos(Commands_Top, Commands_Left); + LoadWindowPos(); + RedrawCommandsAndRegisters(); WindowCreated(); m_Attached = true; return TRUE; @@ -176,7 +148,7 @@ LRESULT CDebugCommandsView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARA void CDebugCommandsView::OnExitSizeMove(void) { - SaveWindowPos(Commands_Top, Commands_Left); + SaveWindowPos(); } LRESULT CDebugCommandsView::OnDestroy(void) @@ -1495,7 +1467,7 @@ LRESULT CDebugCommandsView::OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, return FALSE; } -LRESULT CDebugCommandsView::OnSizing(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +void CDebugCommandsView::RedrawCommandsAndRegisters() { CRect listRect; m_CommandList.GetWindowRect(listRect); @@ -1518,7 +1490,11 @@ LRESULT CDebugCommandsView::OnSizing(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /* // Fix cmd list header listHead.ResizeClient(listRect.Width(), headRect.Height()); +} +LRESULT CDebugCommandsView::OnSizing(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + RedrawCommandsAndRegisters(); return FALSE; } diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Commands.h b/Source/Project64/UserInterface/Debugger/Debugger-Commands.h index 196205a93..dcefc50f1 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Commands.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-Commands.h @@ -243,6 +243,8 @@ private: void ClearBranchArrows(); void DrawBranchArrows(HDC listDC); + void RedrawCommandsAndRegisters(); + CBreakpoints* m_Breakpoints; vector m_History; int m_HistoryIndex; diff --git a/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp b/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp index e78609279..00c3dc388 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp @@ -145,11 +145,7 @@ LRESULT CDebugDMALogView::OnActivate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /* LRESULT CDebugDMALogView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { DlgResize_Init(false, true); - - int32_t Width = UISettingsLoadDword(DMALogView_Width); - int32_t Height = UISettingsLoadDword(DMALogView_Height); - - SetSize(Width, Height); + DlgSavePos_Init(DebuggerUI_DMALogPos); m_bConvertingAddress = false; m_nLastStartIndex = 0; @@ -183,7 +179,7 @@ LRESULT CDebugDMALogView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM RefreshList(); - LoadWindowPos(DMALogView_Top, DMALogView_Left); + LoadWindowPos(); WindowCreated(); m_AutoRefreshThread = CreateThread(NULL, 0, AutoRefreshProc, (void*)this, 0, NULL); @@ -193,7 +189,7 @@ LRESULT CDebugDMALogView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM void CDebugDMALogView::OnExitSizeMove(void) { - SaveWindowPos(DMALogView_Top, DMALogView_Left); + SaveWindowPos(); } LRESULT CDebugDMALogView::OnDestroy(void) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.cpp b/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.cpp index eb8994ff1..2d2aec9a3 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.cpp @@ -25,6 +25,8 @@ CDumpMemory::~CDumpMemory() LRESULT CDumpMemory::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { + DlgSavePos_Init(DebuggerUI_MemoryDumpPos); + m_StartAddress.Attach(GetDlgItem(IDC_E_START_ADDR)); m_EndAddress.Attach(GetDlgItem(IDC_E_END_ADDR)); m_PC.Attach(GetDlgItem(IDC_E_ALT_PC)); @@ -50,10 +52,16 @@ LRESULT CDumpMemory::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lPa m_FormatList.SetCurSel(0); + LoadWindowPos(); WindowCreated(); return TRUE; } +void CDumpMemory::OnExitSizeMove(void) +{ + SaveWindowPos(); +} + LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { switch (wID) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.h b/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.h index 9cd4250ac..17030b9d0 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-MemoryDump.h @@ -33,10 +33,12 @@ private: BEGIN_MSG_MAP_EX(CDumpMemory) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked) + MSG_WM_EXITSIZEMOVE(OnExitSizeMove); END_MSG_MAP() LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled); + void OnExitSizeMove(void); bool DumpMemory(LPCSTR FileName, DumpFormat Format, DWORD StartPC, DWORD EndPC, DWORD DumpPC); diff --git a/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp b/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp index 5e6939f65..8fbe407ea 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp @@ -40,6 +40,8 @@ void CDebugMemorySearch::AddAlignmentOptions(CComboBox & ctrl) LRESULT CDebugMemorySearch::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { + DlgSavePos_Init(DebuggerUI_MemorySearchPos); + m_PAddrStart.Attach(GetDlgItem(IDC_PADDR_START)); m_PAddrStart.SetDisplayType(CEditNumber32::DisplayHex); m_SearchLen.Attach(GetDlgItem(IDC_ADDR_END)); @@ -71,14 +73,14 @@ LRESULT CDebugMemorySearch::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARA BOOL bHandled; OnClicked(0, IDC_BTN_RDRAM, NULL, bHandled); OnClicked(0, IDC_RADIO_VALUE, NULL, bHandled); - LoadWindowPos(MemorySearch_Top, MemorySearch_Left); + LoadWindowPos(); WindowCreated(); return TRUE; } void CDebugMemorySearch::OnExitSizeMove(void) { - SaveWindowPos(MemorySearch_Top, MemorySearch_Left); + SaveWindowPos(); } LRESULT CDebugMemorySearch::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND hWndCtl, BOOL& /*bHandled*/) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp b/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp index 0c43496da..cf2ee6189 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp @@ -30,11 +30,7 @@ CDebugScripts::~CDebugScripts(void) LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { DlgResize_Init(false, true); - - int32_t Width = UISettingsLoadDword(Scripts_Width); - int32_t Height = UISettingsLoadDword(Scripts_Height); - - SetSize(Width, Height); + DlgSavePos_Init(DebuggerUI_ScriptsPos); HFONT monoFont = CreateFont(-11, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET, @@ -61,14 +57,14 @@ LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l RefreshList(); - LoadWindowPos(Scripts_Top, Scripts_Left); + LoadWindowPos(); WindowCreated(); return 0; } void CDebugScripts::OnExitSizeMove(void) { - SaveWindowPos(Scripts_Top, Scripts_Left); + SaveWindowPos(); } void CDebugScripts::ConsolePrint(const char* text) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp b/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp index 5528d56c8..51352e3e4 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp @@ -49,11 +49,7 @@ void CDebugStackTrace::ClearEntries() LRESULT CDebugStackTrace::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { DlgResize_Init(); - - int32_t Width = UISettingsLoadDword(StackTrace_Width); - int32_t Height = UISettingsLoadDword(StackTrace_Height); - - SetSize(Width, Height); + DlgSavePos_Init(DebuggerUI_StackTracePos); m_List.Attach(GetDlgItem(IDC_STACKTRACE_LIST)); m_List.AddColumn("Caller", 0); @@ -67,14 +63,14 @@ LRESULT CDebugStackTrace::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM m_List.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT); - LoadWindowPos(StackTrace_Top, StackTrace_Left); + LoadWindowPos(); WindowCreated(); return TRUE; } void CDebugStackTrace::OnExitSizeMove(void) { - SaveWindowPos(StackTrace_Top, StackTrace_Left); + SaveWindowPos(); } LRESULT CDebugStackTrace::OnActivate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp b/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp index 601f72d3d..3e1b9e937 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp @@ -25,11 +25,7 @@ CDebugStackView::~CDebugStackView(void) LRESULT CDebugStackView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { DlgResize_Init(false, true); - - int32_t Width = UISettingsLoadDword(StackView_Width); - int32_t Height = UISettingsLoadDword(StackView_Height); - - SetSize(Width, Height); + DlgSavePos_Init(DebuggerUI_StackPos); m_StackList.Attach(GetDlgItem(IDC_STACK_LIST)); m_StackList.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER); @@ -47,7 +43,7 @@ LRESULT CDebugStackView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM / m_SPStatic.Attach(GetDlgItem(IDC_SP_STATIC)); - LoadWindowPos(StackView_Top, StackView_Left); + LoadWindowPos(); WindowCreated(); return 0; @@ -55,7 +51,7 @@ LRESULT CDebugStackView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM / void CDebugStackView::OnExitSizeMove(void) { - SaveWindowPos(StackView_Top, StackView_Left); + SaveWindowPos(); } LRESULT CDebugStackView::OnDestroy(void) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp b/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp index 9d44bc708..043718198 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp @@ -25,11 +25,7 @@ CDebugSymbols::CDebugSymbols(CDebuggerUI * debugger) : LRESULT CDebugSymbols::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { DlgResize_Init(false, true); - - int32_t Width = UISettingsLoadDword(Symbols_Width); - int32_t Height = UISettingsLoadDword(Symbols_Height); - - SetSize(Width, Height); + DlgSavePos_Init(DebuggerUI_SymbolsPos); m_SymbolsListView.Attach(GetDlgItem(IDC_SYMBOLS_LIST)); m_SymbolsListView.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER); @@ -50,14 +46,14 @@ LRESULT CDebugSymbols::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l m_AutoRefreshThread = CreateThread(NULL, 0, AutoRefreshProc, (void*)this, 0, NULL); - LoadWindowPos(Symbols_Top, Symbols_Left); + LoadWindowPos(); WindowCreated(); return 0; } void CDebugSymbols::OnExitSizeMove(void) { - SaveWindowPos(Symbols_Top, Symbols_Left); + SaveWindowPos(); } LRESULT CDebugSymbols::OnDestroy(void) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp b/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp index 33f623675..63ec05317 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp @@ -23,6 +23,8 @@ CDebugTlb::~CDebugTlb() LRESULT CDebugTlb::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { + DlgSavePos_Init(DebuggerUI_TLBPos); + LV_COLUMN col; col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; @@ -76,14 +78,14 @@ LRESULT CDebugTlb::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lPara RefreshTLBWindow(); SendMessage(GetDlgItem(IDC_TLB_ENTRIES), BM_SETCHECK, BST_CHECKED, 0); - LoadWindowPos(TLB_Top, TLB_Left); + LoadWindowPos(); WindowCreated(); return TRUE; } void CDebugTlb::OnExitSizeMove(void) { - SaveWindowPos(TLB_Top, TLB_Left); + SaveWindowPos(); } LRESULT CDebugTlb::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND, BOOL& /*bHandled*/) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp b/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp index fc1a3ecf5..186a6d8ae 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp @@ -38,6 +38,8 @@ CDebugMemoryView::~CDebugMemoryView() LRESULT CDebugMemoryView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { + DlgSavePos_Init(DebuggerUI_MemoryPos); + m_SymbolColorStride = 0; m_SymbolColorPhase = 0; m_DataStartLoc = (DWORD)-1; @@ -127,7 +129,7 @@ LRESULT CDebugMemoryView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM DWORD dwThreadID = ::GetCurrentThreadId(); hWinMessageHook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC)HookProc, NULL, dwThreadID); - LoadWindowPos(ViewMemory_Top, ViewMemory_Left); + LoadWindowPos(); WindowCreated(); m_AutoRefreshThread = CreateThread(NULL, 0, AutoRefreshProc, (void*)this, 0, NULL); @@ -150,7 +152,7 @@ DWORD WINAPI CDebugMemoryView::AutoRefreshProc(void* _self) void CDebugMemoryView::OnExitSizeMove() { - SaveWindowPos(ViewMemory_Top, ViewMemory_Left); + SaveWindowPos(); } void CDebugMemoryView::InterceptMouseWheel(WPARAM wParam, LPARAM /*lParam*/)