From c6151b58e2ba24a87e15612148e889842d5d5f59 Mon Sep 17 00:00:00 2001 From: DirtPiper Date: Mon, 22 Oct 2018 14:25:25 -0400 Subject: [PATCH 1/3] zip --- G3DTest.vcproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/G3DTest.vcproj b/G3DTest.vcproj index 81f91c6..b925670 100644 --- a/G3DTest.vcproj +++ b/G3DTest.vcproj @@ -294,6 +294,10 @@ RelativePath=".\propertyGrid.cpp" > + + @@ -403,6 +407,10 @@ RelativePath=".\propertyGrid.h" > + + From 551a0e4b9e470a54e4d9be488507126f62fc62ef Mon Sep 17 00:00:00 2001 From: DirtPiper Date: Mon, 22 Oct 2018 14:50:23 -0400 Subject: [PATCH 2/3] more propertygrid testing --- PropertyWindow.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/PropertyWindow.cpp b/PropertyWindow.cpp index 8f8ae6f..d385ac2 100644 --- a/PropertyWindow.cpp +++ b/PropertyWindow.cpp @@ -55,9 +55,32 @@ bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstanc pItem.lpCurValue=0; pItem.iItemType=PIT_EDIT; + + PROPGRIDITEM pItem2; + PropGrid_ItemInit(pItem2); + + pItem2.lpszCatalog="Test"; + pItem2.lpszPropName="s"; + pItem2.lpszzCmbItems="itemlist\0itemlist2\0itemlist3"; + pItem2.lpszPropDesc=""; + pItem2.lpCurValue=0; + + pItem2.iItemType=PIT_COMBO; + + /*PROPGRIDITEM FauxExplorerItem; + PropGrid_ItemInit(FauxExplorerItem); + FauxExplorerItem.lpszCatalog="Test"; + FauxExplorerItem.lpszPropName = "Editable Combo Field"; + FauxExplorerItem.lpszzCmbItems = "Test1\0Test2\0Test3"; + FauxExplorerItem.lpszPropDesc = "Press F4 to view drop down."; + FauxExplorerItem.iItemType = PIT_EDITCOMBO; + FauxExplorerItem.lpCurValue = 1; + PropGrid_AddItem(_propGrid, &FauxExplorerItem);*/ + PropGrid_Enable(_propGrid,true); ShowWindow(_propGrid,SW_SHOW); PropGrid_AddItem(_propGrid,&pItem); + PropGrid_AddItem(_propGrid,&pItem2); PropGrid_SetItemHeight(_propGrid,20); PropGrid_ShowToolTips(_propGrid,TRUE); PropGrid_ShowPropertyDescriptions(_propGrid,TRUE); From ccf440a65e618a548a80d8d00f6c6341b0ae3d8b Mon Sep 17 00:00:00 2001 From: MusicalProgrammer <38636805+MusicalProgrammer@users.noreply.github.com> Date: Mon, 22 Oct 2018 15:02:44 -0400 Subject: [PATCH 3/3] _redraw(HWND) is now just _redraw() --- PropertyWindow.cpp | 15 +++++++-------- PropertyWindow.h | 2 +- main.cpp | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/PropertyWindow.cpp b/PropertyWindow.cpp index d385ac2..34ebfa7 100644 --- a/PropertyWindow.cpp +++ b/PropertyWindow.cpp @@ -49,10 +49,10 @@ bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstanc PropGrid_ItemInit(pItem); pItem.lpszCatalog="Test"; - pItem.lpszPropName="Test2"; + pItem.lpszPropName="Offset"; pItem.lpszzCmbItems="What"; pItem.lpszPropDesc="Description"; - pItem.lpCurValue=0; + pItem.lpCurValue=(LPARAM)"0, 0, 0"; pItem.iItemType=PIT_EDIT; @@ -87,7 +87,7 @@ bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstanc PropGrid_ExpandAllCatalogs(_propGrid); SetWindowLongPtr(_propGrid,GWL_USERDATA,(LONG)this); - _redraw(_hwndProp); + _redraw(); return true; } @@ -98,13 +98,12 @@ PropertyWindow::PropertyWindow(int x, int y, int sx, int sy, HMODULE hThisInstan void PropertyWindow::onResize() { - _redraw(_hwndProp); + _redraw(); } -void PropertyWindow::_redraw(HWND hwnd) +void PropertyWindow::_redraw() { RECT rect; - GetClientRect(hwnd,&rect); - SetWindowPos(_propGrid, NULL, 0, 0, rect.right, rect.bottom, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); + GetClientRect(_hwndProp,&rect); + SetWindowPos(_propGrid, NULL, 0, 20, rect.right, rect.bottom-20, SWP_NOZORDER | SWP_NOACTIVATE); } - diff --git a/PropertyWindow.h b/PropertyWindow.h index 34eae0c..3c3e54f 100644 --- a/PropertyWindow.h +++ b/PropertyWindow.h @@ -8,5 +8,5 @@ public: private: HWND _propGrid; HWND _hwndProp; - void _redraw(HWND hwnd); + void _redraw(); }; \ No newline at end of file diff --git a/main.cpp b/main.cpp index 095b4a1..4142ef8 100644 --- a/main.cpp +++ b/main.cpp @@ -141,7 +141,7 @@ Demo::Demo(const GAppSettings& settings,HWND parentWindow) { //: GApp(settings,w SetWindowLongPtr(_hWndMain,GWL_USERDATA,(LONG)this); SetWindowLongPtr(_hwndRenderer,GWL_USERDATA,(LONG)this); - _propWindow = new PropertyWindow(0,0,200,640,hThisInstance); + _propWindow = new PropertyWindow(0, 0, 200, 640, hThisInstance); IEBrowser* webBrowser = new IEBrowser(_hwndToolbox); webBrowser->navigateSyncURL(L"http://scottbeebiwan.tk/g3d/toolbox/"); }