Make GEDebugger the parent, not the tab control

This commit is contained in:
Kingcom 2013-09-27 15:38:20 +02:00
parent 68edc4ffcf
commit 7945f5cb7f
3 changed files with 7 additions and 6 deletions

View File

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

View File

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

View File

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