From 7945f5cb7f531187faeab61802e6c22c60dd0942 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Fri, 27 Sep 2013 15:38:20 +0200 Subject: [PATCH] Make GEDebugger the parent, not the tab control --- Windows/GEDebugger/GEDebugger.cpp | 9 +++++---- Windows/GEDebugger/GEDebugger.h | 2 +- Windows/ppsspp.rc | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Windows/GEDebugger/GEDebugger.cpp b/Windows/GEDebugger/GEDebugger.cpp index c3f76df0cc..d87b453ddc 100644 --- a/Windows/GEDebugger/GEDebugger.cpp +++ b/Windows/GEDebugger/GEDebugger.cpp @@ -93,6 +93,7 @@ static void RunPauseAction() { actionWait.notify_one(); pauseAction = PAUSE_CONTINUE; } + CGEDebugger::CGEDebugger(HINSTANCE _hInstance, HWND _hParent) : Dialog((LPCSTR)IDD_GEDEBUGGER, _hInstance, _hParent), frameWindow(NULL) { breakCmds.resize(256, false); @@ -126,7 +127,7 @@ void CGEDebugger::SetupFrameWindow() { int CGEDebugger::addTabWindow(wchar_t* className, wchar_t* title, DWORD style) { HWND tabControl = GetDlgItem(m_hDlg,IDC_GEDBG_MAINTAB); - style |= WS_CHILD | WS_VISIBLE; + style |= WS_CHILD; TCITEM tcItem; ZeroMemory (&tcItem,sizeof (tcItem)); @@ -141,12 +142,12 @@ int CGEDebugger::addTabWindow(wchar_t* className, wchar_t* title, DWORD style) RECT tabRect; GetWindowRect(tabControl,&tabRect); - MapWindowPoints(HWND_DESKTOP,tabControl,(LPPOINT)&tabRect,2); + MapWindowPoints(HWND_DESKTOP,m_hDlg,(LPPOINT)&tabRect,2); TabCtrl_AdjustRect(tabControl, FALSE, &tabRect); HWND hwnd = CreateWindowEx(0,className,title,style, tabRect.left,tabRect.top,tabRect.right-tabRect.left,tabRect.bottom-tabRect.top, - tabControl,0,MainWindow::GetHInstance(),0); + m_hDlg,0,MainWindow::GetHInstance(),0); tabs.push_back(hwnd); showTab(index); @@ -157,7 +158,7 @@ void CGEDebugger::showTab(int index) { HWND tabControl = GetDlgItem(m_hDlg,IDC_GEDBG_MAINTAB); - for (auto i = 0; i < tabs.size(); i++) + for (size_t i = 0; i < tabs.size(); i++) { ShowWindow(tabs[i],i == index ? SW_NORMAL : SW_HIDE); } diff --git a/Windows/GEDebugger/GEDebugger.h b/Windows/GEDebugger/GEDebugger.h index 189fffbf86..eaed104e2f 100644 --- a/Windows/GEDebugger/GEDebugger.h +++ b/Windows/GEDebugger/GEDebugger.h @@ -36,7 +36,7 @@ private: void SetupFrameWindow(); int addTabWindow(wchar_t* className, wchar_t* title, DWORD style = 0); void showTab(int index); - HWND getTab(int index) { return tabs[index]; }; + HWND getTab(unsigned int index) { return index >= tabs.size() ? 0 : tabs[index]; }; int dispListTab; SimpleGLWindow *frameWindow; diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index f0ee03c799..a50b50f71f 100644 --- a/Windows/ppsspp.rc +++ b/Windows/ppsspp.rc @@ -171,7 +171,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN PUSHBUTTON "Break",IDC_GEDBG_BREAK,0,0,48,14 PUSHBUTTON "Resume",IDC_GEDBG_RESUME,52,0,48,14 - CONTROL "",IDC_GEDBG_MAINTAB,"SysTabControl32",TCS_TABS | TCS_FOCUSONBUTTONDOWN ,10,16,480,180 + CONTROL "",IDC_GEDBG_MAINTAB,"SysTabControl32",TCS_TABS ,10,16,480,180 CONTROL "",IDC_GEDBG_FRAME,"SimpleGLWindow",WS_CHILD | WS_VISIBLE,140,210,256,136 END