[Debugger] Clean and refactor Window position retrieving & saving code

Many thanks to Shygoo for the general template of the code
This commit is contained in:
oddMLan 2019-01-14 00:06:01 -07:00
parent 786a519433
commit 2b96fdaa94
15 changed files with 100 additions and 247 deletions

View File

@ -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)

View File

@ -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);

View File

@ -9,6 +9,8 @@ protected:
CDebuggerUI * m_Debugger;
HANDLE m_CreatedEvent;
HANDLE m_DialogThread;
UISettingID m_UISettingID;
bool m_bInitialized;
static DWORD CreateDebuggerWindow(CDebugDialog<T> * 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<T*>(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<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());
}
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))

View File

@ -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;
}

View File

@ -243,6 +243,8 @@ private:
void ClearBranchArrows();
void DrawBranchArrows(HDC listDC);
void RedrawCommandsAndRegisters();
CBreakpoints* m_Breakpoints;
vector<uint32_t> m_History;
int m_HistoryIndex;

View File

@ -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)

View File

@ -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)

View File

@ -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);

View File

@ -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*/)

View File

@ -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)

View File

@ -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*/)

View File

@ -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)

View File

@ -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)

View File

@ -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*/)

View File

@ -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*/)