DXGL r778 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r777‎ | r778 | r779 >
Date:07:39, 15 December 2017
Author:admin
Status:new
Tags:
Comment:
Add copyright information to About tab of DXGL Config.
Add save prompt to DXGL Test when double clicking a list item.
Modified paths:
  • /common/version.h.in (modified) (history)
  • /dxglcfg/dxglcfg.cpp (modified) (history)
  • /dxglcfg/dxglcfg.rc (modified) (history)
  • /dxglcfg/dxgltest.cpp (modified) (history)
  • /dxglcfg/resource.h (modified) (history)

Diff [purge]

Index: common/version.h.in
——@@ -12,6 +12,9 @@
1313 #define DXGLVERQWORD (((unsigned __int64)DXGLMAJOR<<48)+((unsigned __int64)DXGLMINOR<<32)+((unsigned __int64)DXGLPOINT<<16)+(unsigned __int64)DXGLBUILD)
1414 #define DXGLVERSTRING $VERSTRING
1515
 16+#define COPYYEAR 2017
 17+#define COPYYEARSTRING "2017"
 18+
1619 #define SHADER2DVERSION 1
1720 #define SHADER3DVERSION 1
1821
Index: dxglcfg/dxglcfg.cpp
——@@ -39,6 +39,7 @@
4040 #include "../ddraw/include/GL/glext.h"
4141 #include "dxgltest.h"
4242 #include "common.h"
 43+#include "../common/version.h"
4344
4445 #ifndef SHGFI_ADDOVERLAYS
4546 #define SHGFI_ADDOVERLAYS 0x000000020
——@@ -2400,6 +2401,7 @@
24012402 DWORD err;
24022403 RECT r;
24032404 NMHDR *nm;
 2405+ TCHAR abouttext[1024];
24042406 int newtab;
24052407 TCITEM tab;
24062408 switch (Msg)
——@@ -2946,7 +2948,26 @@
29472949 SendDlgItemMessage(hTabs[5], IDC_HACKSLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
29482950 _tcscpy(buffer, _T("Expand 512x448 to 640x480 when border is blank"));
29492951 SendDlgItemMessage(hTabs[5], IDC_HACKSLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
2950 -
 2952+ // About text
 2953+ _tcscpy(abouttext, _T("DXGL\r\nVersion "));
 2954+ _tcscat(abouttext, _T(DXGLVERSTRING));
 2955+ _tcscat(abouttext, _T("\r\nCopyright ©2011-"));
 2956+ _tcscat(abouttext, _T(COPYYEARSTRING));
 2957+ _tcscat(abouttext, _T(" William Feely\r\n\r\n\
 2958+This library is free software; you can redistribute it and/or\r\n\
 2959+modify it under the terms of the GNU Lesser General Public\r\n\
 2960+License as published by the Free Software Foundation; either\r\n\
 2961+version 2.1 of the License, or (at your option) any later version.\r\n\
 2962+\r\n\
 2963+This library is distributed in the hope that it will be useful,\r\n\
 2964+but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n\
 2965+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r\n\
 2966+Lesser General Public License for more details.\r\n\
 2967+\r\n\
 2968+You should have received a copy of the GNU Lesser General Public\r\n\
 2969+License along with this library; if not, write to the Free Software\r\n\
 2970+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"));
 2971+ SendDlgItemMessage(hTabs[7], IDC_ABOUTTEXT, WM_SETTEXT, 0, (LPARAM)abouttext);
29512972 // Check install path
29522973 installpath = NULL;
29532974 error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\DXGL"), 0, KEY_READ, &hKey);
Index: dxglcfg/dxglcfg.rc
——@@ -187,12 +187,12 @@
188188 STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_CHILDWINDOW
189189 FONT 8, "Ms Shell Dlg"
190190 {
191 - GROUPBOX "File info", IDC_STATIC, 7, 7, 137, 155
192 - LTEXT "ddraw.dll type", IDC_STATIC, 13, 18, 44, 8, SS_LEFT
193 - EDITTEXT IDC_DDTYPE, 82, 18, 57, 14, NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY
194 - LTEXT "ddraw.dll version", IDC_STATIC, 13, 34, 54, 8, SS_LEFT
195 - EDITTEXT IDC_DDVER, 82, 34, 57, 14, NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY
196 - PUSHBUTTON "Run DXDiag", IDC_DXDIAG, 13, 145, 45, 14
 191+ LTEXT "", IDC_ABOUTTEXT, 5, 5, 280, 144, SS_LEFT, WS_EX_LEFT
 192+ LTEXT "ddraw.dll type", IDC_STATIC, 274, 5, 44, 8, SS_LEFT, WS_EX_LEFT
 193+ EDITTEXT IDC_DDTYPE, 274, 15, 57, 14, NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY, WS_EX_LEFT
 194+ LTEXT "ddraw.dll version", IDC_STATIC, 274, 31, 54, 8, SS_LEFT, WS_EX_LEFT
 195+ EDITTEXT IDC_DDVER, 274, 41, 57, 14, NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY, WS_EX_LEFT
 196+ PUSHBUTTON "Run DXDiag", IDC_DXDIAG, 290, 150, 45, 14, 0, WS_EX_LEFT
197197 }
198198
199199
Index: dxglcfg/dxgltest.cpp
——@@ -329,6 +329,13 @@
330330 }
331331 else if (HIWORD(wParam) == LBN_DBLCLK)
332332 {
 333+ if (IsWindowEnabled(GetDlgItem(hDialog, IDC_APPLY)))
 334+ {
 335+ if (MessageBox(hDialog, _T("You have unsaved changes to your configuration.\r\n\
 336+Do you want to apply them before running this test?"),
 337+_T("Notice"), MB_YESNO | MB_ICONQUESTION) == IDYES)
 338+SaveChanges(hDialog);
 339+ }
333340 if (SendDlgItemMessage(hWnd, IDC_RESIZABLE, BM_GETCHECK, 0, 0)) resizable = true;
334341 else resizable = false;
335342 if (buffer < minbuffer) buffer = minbuffer;
Index: dxglcfg/resource.h
——@@ -135,10 +135,11 @@
136136 #define IDC_FSAA 2616
137137 #define IDC_TEST 2617
138138
139 -// Controls - System Information Tab
140 -#define IDC_DDTYPE 2701
141 -#define IDC_DDVER 2702
142 -#define IDC_DXDIAG 2703
 139+// Controls - About Tab
 140+#define IDC_ABOUTTEXT 2701
 141+#define IDC_DDTYPE 2702
 142+#define IDC_DDVER 2703
 143+#define IDC_DXDIAG 2704
143144
144145 // Controls - Shader Test Dialog Common
145146 #define IDC_DISPLAY 2801