mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Add tab control to GEDebugger
This commit is contained in:
parent
94b04d7326
commit
68edc4ffcf
4 changed files with 73 additions and 6 deletions
|
@ -24,10 +24,13 @@
|
|||
#include "Windows/GEDebugger/SimpleGLWindow.h"
|
||||
#include "Windows/GEDebugger/CtrlDisplayListView.h"
|
||||
#include "Windows/WindowsHost.h"
|
||||
#include "Windows/WndMainWindow.h"
|
||||
#include "Windows/main.h"
|
||||
#include "GPU/GPUInterface.h"
|
||||
#include "GPU/Common/GPUDebugInterface.h"
|
||||
#include "GPU/GPUState.h"
|
||||
#include <windowsx.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
const UINT WM_GEDBG_BREAK_CMD = WM_USER + 200;
|
||||
const UINT WM_GEDBG_BREAK_DRAW = WM_USER + 201;
|
||||
|
@ -90,7 +93,6 @@ 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);
|
||||
|
@ -104,6 +106,8 @@ CGEDebugger::CGEDebugger(HINSTANCE _hInstance, HWND _hParent)
|
|||
GetWindowRect(frameWnd,&frameRect);
|
||||
MapWindowPoints(HWND_DESKTOP,m_hDlg,(LPPOINT)&frameRect,2);
|
||||
MoveWindow(frameWnd,frameRect.left,frameRect.top,512,272,TRUE);
|
||||
|
||||
dispListTab = addTabWindow(L"CtrlDisplayListView",L"Display List");
|
||||
}
|
||||
|
||||
CGEDebugger::~CGEDebugger() {
|
||||
|
@ -119,8 +123,48 @@ 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;
|
||||
|
||||
TCITEM tcItem;
|
||||
ZeroMemory (&tcItem,sizeof (tcItem));
|
||||
tcItem.mask = TCIF_TEXT;
|
||||
tcItem.dwState = 0;
|
||||
tcItem.pszText = title;
|
||||
tcItem.cchTextMax = (int)wcslen(tcItem.pszText)+1;
|
||||
tcItem.iImage = 0;
|
||||
|
||||
int index = TabCtrl_GetItemCount(tabControl);
|
||||
int result = TabCtrl_InsertItem(tabControl,index,&tcItem);
|
||||
|
||||
RECT tabRect;
|
||||
GetWindowRect(tabControl,&tabRect);
|
||||
MapWindowPoints(HWND_DESKTOP,tabControl,(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);
|
||||
tabs.push_back(hwnd);
|
||||
|
||||
showTab(index);
|
||||
return index;
|
||||
}
|
||||
|
||||
void CGEDebugger::showTab(int index)
|
||||
{
|
||||
HWND tabControl = GetDlgItem(m_hDlg,IDC_GEDBG_MAINTAB);
|
||||
|
||||
for (auto i = 0; i < tabs.size(); i++)
|
||||
{
|
||||
ShowWindow(tabs[i],i == index ? SW_NORMAL : SW_HIDE);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
|
||||
CtrlDisplayListView* displayList = CtrlDisplayListView::getFrom(GetDlgItem(m_hDlg,IDC_GEDBG_CURRENTDISPLAYLIST));
|
||||
CtrlDisplayListView* displayList = CtrlDisplayListView::getFrom(getTab(dispListTab));
|
||||
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
|
@ -138,6 +182,24 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
|
|||
SetupFrameWindow();
|
||||
break;
|
||||
|
||||
case WM_NOTIFY:
|
||||
switch (wParam)
|
||||
{
|
||||
case IDC_GEDBG_MAINTAB:
|
||||
{
|
||||
HWND tabs = GetDlgItem(m_hDlg, IDC_GEDBG_MAINTAB);
|
||||
NMHDR* pNotifyMessage = NULL;
|
||||
pNotifyMessage = (LPNMHDR)lParam;
|
||||
if (pNotifyMessage->hwndFrom == tabs)
|
||||
{
|
||||
int iPage = TabCtrl_GetCurSel (tabs);
|
||||
showTab(iPage);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDC_GEDBG_BREAK:
|
||||
|
|
|
@ -34,6 +34,11 @@ protected:
|
|||
|
||||
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]; };
|
||||
|
||||
int dispListTab;
|
||||
SimpleGLWindow *frameWindow;
|
||||
std::vector<HWND> tabs;
|
||||
};
|
||||
|
|
|
@ -171,8 +171,8 @@ 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_FRAME,"SimpleGLWindow",WS_CHILD | WS_VISIBLE,140,10,256,136
|
||||
CONTROL "",IDC_GEDBG_CURRENTDISPLAYLIST,"CtrlDisplayListView",WS_BORDER | WS_VISIBLE,10,185,456,200
|
||||
CONTROL "",IDC_GEDBG_MAINTAB,"SysTabControl32",TCS_TABS | TCS_FOCUSONBUTTONDOWN ,10,16,480,180
|
||||
CONTROL "",IDC_GEDBG_FRAME,"SimpleGLWindow",WS_CHILD | WS_VISIBLE,140,210,256,136
|
||||
END
|
||||
|
||||
#include "aboutbox.rc"
|
||||
|
|
|
@ -262,7 +262,7 @@
|
|||
#define IDC_GEDBG_BREAK 40117
|
||||
#define IDC_GEDBG_RESUME 40118
|
||||
#define IDC_GEDBG_FRAME 40119
|
||||
#define IDC_GEDBG_CURRENTDISPLAYLIST 40120
|
||||
#define IDC_GEDBG_MAINTAB 40120
|
||||
|
||||
// Dummy option to let the buffered rendering hotkey cycle through all the options.
|
||||
#define ID_OPTIONS_BUFFEREDRENDERINGDUMMY 40500
|
||||
|
|
Loading…
Add table
Reference in a new issue