[Debugger] UI: Get window position and size from cfg

This commit is contained in:
oddMLan 2019-01-13 01:13:59 -07:00
parent f1927648ac
commit 12351337d1
9 changed files with 169 additions and 0 deletions

View File

@ -89,6 +89,46 @@ LRESULT CDebugCommandsView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARA
GetWindowRect(&m_DefaultWindowRect);
//We find the middle position of the screen, we use this if theres no setting
int32_t X = GetX(m_DefaultWindowRect);
int32_t Y = GetY(m_DefaultWindowRect);
//Load the value from settings, if none is available, default to above
UISettingsLoadDword(Commands_Top, (uint32_t &)Y);
UISettingsLoadDword(Commands_Left, (uint32_t &)X);
SetPos(X, Y);
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);

View File

@ -146,6 +146,24 @@ LRESULT CDebugDMALogView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM
{
DlgResize_Init(false, true);
CRect m_DefaultWindowRect;
GetWindowRect(&m_DefaultWindowRect);
//We find the middle position of the screen, we use this if theres no setting
int32_t X = GetX(m_DefaultWindowRect);
int32_t Y = GetY(m_DefaultWindowRect);
//Load the value from settings, if none is available, default to above
UISettingsLoadDword(DMALogView_Top, (uint32_t &)Y);
UISettingsLoadDword(DMALogView_Left, (uint32_t &)X);
SetPos(X, Y);
int32_t Width = UISettingsLoadDword(DMALogView_Width);
int32_t Height = UISettingsLoadDword(DMALogView_Height);
SetSize(Width, Height);
m_bConvertingAddress = false;
m_nLastStartIndex = 0;

View File

@ -40,6 +40,19 @@ void CDebugMemorySearch::AddAlignmentOptions(CComboBox & ctrl)
LRESULT CDebugMemorySearch::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CRect m_DefaultWindowRect;
GetWindowRect(&m_DefaultWindowRect);
//We find the middle position of the screen, we use this if theres no setting
int32_t X = GetX(m_DefaultWindowRect);
int32_t Y = GetY(m_DefaultWindowRect);
//Load the value from settings, if none is available, default to above
UISettingsLoadDword(MemorySearch_Top, (uint32_t &)Y);
UISettingsLoadDword(MemorySearch_Left, (uint32_t &)X);
SetPos(X, Y);
m_PAddrStart.Attach(GetDlgItem(IDC_PADDR_START));
m_PAddrStart.SetDisplayType(CEditNumber32::DisplayHex);
m_SearchLen.Attach(GetDlgItem(IDC_ADDR_END));

View File

@ -31,6 +31,24 @@ LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l
{
DlgResize_Init(false, true);
CRect m_DefaultWindowRect;
GetWindowRect(&m_DefaultWindowRect);
//We find the middle position of the screen, we use this if theres no setting
int32_t X = GetX(m_DefaultWindowRect);
int32_t Y = GetY(m_DefaultWindowRect);
//Load the value from settings, if none is available, default to above
UISettingsLoadDword(Scripts_Top, (uint32_t &)Y);
UISettingsLoadDword(Scripts_Left, (uint32_t &)X);
SetPos(X, Y);
int32_t Width = UISettingsLoadDword(Scripts_Width);
int32_t Height = UISettingsLoadDword(Scripts_Height);
SetSize(Width, Height);
HFONT monoFont = CreateFont(-11, 0, 0, 0,
FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,

View File

@ -49,6 +49,24 @@ void CDebugStackTrace::ClearEntries()
LRESULT CDebugStackTrace::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
DlgResize_Init();
CRect m_DefaultWindowRect;
GetWindowRect(&m_DefaultWindowRect);
//We find the middle position of the screen, we use this if theres no setting
int32_t X = GetX(m_DefaultWindowRect);
int32_t Y = GetY(m_DefaultWindowRect);
//Load the value from settings, if none is available, default to above
UISettingsLoadDword(StackTrace_Top, (uint32_t &)Y);
UISettingsLoadDword(StackTrace_Left, (uint32_t &)X);
SetPos(X, Y);
int32_t Width = UISettingsLoadDword(StackTrace_Width);
int32_t Height = UISettingsLoadDword(StackTrace_Height);
SetSize(Width, Height);
m_List.Attach(GetDlgItem(IDC_STACKTRACE_LIST));
m_List.AddColumn("Caller", 0);

View File

@ -26,6 +26,24 @@ LRESULT CDebugStackView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /
{
DlgResize_Init(false, true);
CRect m_DefaultWindowRect;
GetWindowRect(&m_DefaultWindowRect);
//We find the middle position of the screen, we use this if theres no setting
int32_t X = GetX(m_DefaultWindowRect);
int32_t Y = GetY(m_DefaultWindowRect);
//Load the value from settings, if none is available, default to above
UISettingsLoadDword(StackView_Top, (uint32_t &)Y);
UISettingsLoadDword(StackView_Left, (uint32_t &)X);
SetPos(X, Y);
int32_t Width = UISettingsLoadDword(StackView_Width);
int32_t Height = UISettingsLoadDword(StackView_Height);
SetSize(Width, Height);
m_StackList.Attach(GetDlgItem(IDC_STACK_LIST));
m_StackList.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
m_StackList.AddColumn("#", 0);

View File

@ -26,6 +26,24 @@ LRESULT CDebugSymbols::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l
{
DlgResize_Init(false, true);
CRect m_DefaultWindowRect;
GetWindowRect(&m_DefaultWindowRect);
//We find the middle position of the screen, we use this if theres no setting
int32_t X = GetX(m_DefaultWindowRect);
int32_t Y = GetY(m_DefaultWindowRect);
//Load the value from settings, if none is available, default to above
UISettingsLoadDword(Symbols_Top, (uint32_t &)Y);
UISettingsLoadDword(Symbols_Left, (uint32_t &)X);
SetPos(X, Y);
int32_t Width = UISettingsLoadDword(Symbols_Width);
int32_t Height = UISettingsLoadDword(Symbols_Height);
SetSize(Width, Height);
m_SymbolsListView.Attach(GetDlgItem(IDC_SYMBOLS_LIST));
m_SymbolsListView.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);

View File

@ -23,6 +23,19 @@ CDebugTlb::~CDebugTlb()
LRESULT CDebugTlb::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CRect m_DefaultWindowRect;
GetWindowRect(&m_DefaultWindowRect);
//We find the middle position of the screen, we use this if theres no setting
int32_t X = GetX(m_DefaultWindowRect);
int32_t Y = GetY(m_DefaultWindowRect);
//Load the value from settings, if none is available, default to above
UISettingsLoadDword(TLB_Top, (uint32_t &)Y);
UISettingsLoadDword(TLB_Left, (uint32_t &)X);
SetPos(X, Y);
LV_COLUMN col;
col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;

View File

@ -38,6 +38,19 @@ CDebugMemoryView::~CDebugMemoryView()
LRESULT CDebugMemoryView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CRect m_DefaultWindowRect;
GetWindowRect(&m_DefaultWindowRect);
//We find the middle position of the screen, we use this if theres no setting
int32_t X = GetX(m_DefaultWindowRect);
int32_t Y = GetY(m_DefaultWindowRect);
//Load the value from settings, if none is available, default to above
UISettingsLoadDword(ViewMemory_Top, (uint32_t &)Y);
UISettingsLoadDword(ViewMemory_Left, (uint32_t &)X);
SetPos(X, Y);
m_SymbolColorStride = 0;
m_SymbolColorPhase = 0;
m_DataStartLoc = (DWORD)-1;