From 608675c05088964d4891725791690ce217daaf28 Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 22 Apr 2005 07:36:14 +0000 Subject: [PATCH] Tweeked the gui, fixed some bugs, added a goto-def box. It needs a compile first, and it doesn't currently do that compile for you. You'll have to actually click the compile button. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@975 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/qccgui.c | 46 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/engine/qclib/qccgui.c b/engine/qclib/qccgui.c index 843f2f766..67055c05e 100644 --- a/engine/qclib/qccgui.c +++ b/engine/qclib/qccgui.c @@ -27,6 +27,8 @@ char *QCC_ReadFile (char *fname, void *buffer, int len); int QCC_FileSize (char *fname); pbool QCC_WriteFile (char *name, void *data, int len); +char finddef[256]; + void RunCompiler(char *args); HINSTANCE ghInstance; @@ -40,6 +42,8 @@ HWND mdibox; HWND outputwindow; HWND outputbox; HWND projecttree; +HWND gotodefbox; +HWND gotodefaccept; FILE *logfile; @@ -1485,19 +1489,29 @@ static LONG CALLBACK MainWndProc(HWND hWnd,UINT message, // Create the MDI client window. - if (mdibox) - break; - mdibox = CreateWindow( "MDICLIENT", (LPCTSTR) NULL, - WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL, - 0, 0, 320, 200, hWnd, (HMENU) 0xCAC, ghInstance, (LPSTR) &ccs); + WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL, + 0, 0, 320, 200, hWnd, (HMENU) 0xCAC, ghInstance, (LPSTR) &ccs); ShowWindow(mdibox, SW_SHOW); projecttree = CreateWindow(WC_TREEVIEW, (LPCTSTR) NULL, - WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL - | TVS_HASBUTTONS |TVS_LINESATROOT|TVS_HASLINES, + WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL + | TVS_HASBUTTONS |TVS_LINESATROOT|TVS_HASLINES, 0, 0, 320, 200, hWnd, (HMENU) 0xCAC, ghInstance, (LPSTR) &ccs); ShowWindow(projecttree, SW_SHOW); + + if (projecttree) + { + gotodefbox = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", (LPCTSTR) NULL, + WS_CHILD | WS_CLIPCHILDREN | ES_WANTRETURN, + 0, 0, 320, 200, hWnd, (HMENU) 0xCAC, ghInstance, (LPSTR) NULL); + ShowWindow(gotodefbox, SW_SHOW); + + gotodefaccept = CreateWindowEx(WS_EX_CLIENTEDGE, "BUTTON", "GO", + WS_CHILD | WS_CLIPCHILDREN | BS_DEFPUSHBUTTON, + 0, 0, 320, 200, hWnd, (HMENU) 0x4404, ghInstance, (LPSTR) NULL); + ShowWindow(gotodefaccept, SW_SHOW); + } } break; @@ -1509,7 +1523,10 @@ static LONG CALLBACK MainWndProc(HWND hWnd,UINT message, GetClientRect(mainwindow, &rect); if (projecttree) { - SetWindowPos(projecttree, NULL, 0, 0, 192, rect.bottom-rect.top - 32, 0); + SetWindowPos(projecttree, NULL, 0, 0, 192, rect.bottom-rect.top - 34 - 24, 0); + + SetWindowPos(gotodefbox, NULL, 0, rect.bottom-rect.top - 33 - 24, 160, 24, 0); + SetWindowPos(gotodefaccept, NULL, 160, rect.bottom-rect.top - 33 - 24, 32, 24, 0); SetWindowPos(mdibox?mdibox:outputbox, NULL, 192, 0, rect.right-rect.left-192, rect.bottom-rect.top - 32, 0); } else @@ -1528,6 +1545,11 @@ static LONG CALLBACK MainWndProc(HWND hWnd,UINT message, return TRUE; break; case WM_COMMAND: + if (wParam == 0x4404) + { + GetWindowText(gotodefbox, finddef, sizeof(finddef)-1); + return true; + } if (LOWORD(wParam)>0 && LOWORD(wParam) <= NUMBUTTONS) { if (LOWORD(wParam)) @@ -1552,7 +1574,9 @@ static LONG CALLBACK MainWndProc(HWND hWnd,UINT message, GenericMenu(wParam); break; } + break; case WM_NOTIFY: + if (lParam) { NMHDR *nm; HANDLE item; @@ -2209,6 +2233,12 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin } } + if (*finddef) + { + GoToDefinition(finddef); + *finddef = '\0'; + } + Sleep(10); }