From ebe7ad682e557203c8f55b956519f8f170c76acc Mon Sep 17 00:00:00 2001 From: andreja6 Date: Wed, 24 Oct 2018 13:02:31 -0700 Subject: [PATCH] Added MeasureItem case --- PropertyWindow.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/PropertyWindow.cpp b/PropertyWindow.cpp index f4fc637..cd7b2e6 100644 --- a/PropertyWindow.cpp +++ b/PropertyWindow.cpp @@ -4,7 +4,6 @@ #include "resource.h" #include "PropertyWindow.h" #include "Globals.h" - /*typedef struct typPRGP { Instance* instance; // Declare member types Property ∝ @@ -14,7 +13,6 @@ std::vector prop; std::vector children; Instance* selectedInstance; -PropertyWindow * thisCls; LRESULT CALLBACK PropProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -30,6 +28,13 @@ LRESULT CALLBACK PropProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ShowWindow(hwnd, SW_HIDE); } break; + case WM_MEASUREITEM: + { + LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam; + if (lpmis->itemHeight < 18) + lpmis->itemHeight = 18; + } + break; case WM_SIZE: { propWind->onResize(); @@ -44,11 +49,11 @@ LRESULT CALLBACK PropProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SendMessage((HWND) lParam, (UINT) CB_GETLBTEXT, (WPARAM) ItemIndex, (LPARAM) ListItem); if(ItemIndex != 0) { - thisCls->ClearProperties(); + propWind->ClearProperties(); while(g_selectedInstances.size() != 0) g_selectedInstances.erase(g_selectedInstances.begin()); g_selectedInstances.push_back(children.at(ItemIndex-1)); - thisCls->SetProperties(children.at(ItemIndex-1)); + propWind->SetProperties(children.at(ItemIndex-1)); } } } @@ -92,7 +97,6 @@ void PropertyWindow::refreshExplorer() } bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstance) { - thisCls = this; if (!createWindowClass("propHWND",PropProc,hThisInstance)) return false;