diff --git a/Dialogs.aps b/Dialogs.aps
index 0df5e20..143032d 100644
Binary files a/Dialogs.aps and b/Dialogs.aps differ
diff --git a/Dialogs.rc b/Dialogs.rc
index 6913781..1bf70a2 100644
--- a/Dialogs.rc
+++ b/Dialogs.rc
@@ -67,6 +67,13 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "icon1.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_BITMAP1 BITMAP "C:\\Users\\Andreja\\Desktop\\Parts.bmp"
#endif // English (Canada) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/G3DTest.vcproj b/G3DTest.vcproj
index 174413c..74a0eea 100644
--- a/G3DTest.vcproj
+++ b/G3DTest.vcproj
@@ -444,6 +444,10 @@
RelativePath=".\icon1.ico"
>
+
+
diff --git a/Instance.cpp b/Instance.cpp
index 4be98b3..7cc363d 100644
--- a/Instance.cpp
+++ b/Instance.cpp
@@ -8,6 +8,7 @@ Instance::Instance(void)
parent = NULL;
name = "Default Game Instance";
className = "BaseInstance";
+ listicon = 0;
}
Instance::Instance(const Instance &oinst)
diff --git a/Instance.h b/Instance.h
index eb85d18..07231a1 100644
--- a/Instance.h
+++ b/Instance.h
@@ -22,6 +22,7 @@ public:
virtual Instance* clone() const { return new Instance(*this); }
virtual std::vector getProperties();
virtual void PropUpdate(LPPROPGRIDITEM &pItem);
+ int listicon;
protected:
std::string className;
Instance* parent; // Another pointer.
diff --git a/PropertyWindow.cpp b/PropertyWindow.cpp
index 3d9ef2a..f4fc637 100644
--- a/PropertyWindow.cpp
+++ b/PropertyWindow.cpp
@@ -13,6 +13,9 @@
std::vector prop;
std::vector children;
Instance* selectedInstance;
+
+PropertyWindow * thisCls;
+
LRESULT CALLBACK PropProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
PropertyWindow *propWind = (PropertyWindow *)GetWindowLongPtr(hwnd, GWL_USERDATA);
@@ -38,11 +41,14 @@ LRESULT CALLBACK PropProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
int ItemIndex = SendMessage((HWND) lParam, (UINT) CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
CHAR ListItem[256];
- SendMessage((HWND) lParam, (UINT) CB_GETLBTEXT, (WPARAM) ItemIndex, (LPARAM) ListItem);
- MessageBox(hwnd, ListItem, "Item Selected", MB_OK);
+ SendMessage((HWND) lParam, (UINT) CB_GETLBTEXT, (WPARAM) ItemIndex, (LPARAM) ListItem);
if(ItemIndex != 0)
{
- //SetProperties(children.at(ItemIndex-1));
+ thisCls->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));
}
}
}
@@ -79,14 +85,14 @@ void PropertyWindow::refreshExplorer()
children = g_selectedInstances[i]->getChildren();
for(size_t z = 0; z < children.size(); z++)
{
- SendMessage(_explorerComboBox,CB_ADDSTRING, 0,(LPARAM)children.at(i)->name.c_str());
+ SendMessage(_explorerComboBox,CB_ADDSTRING, 0,(LPARAM)children.at(z)->name.c_str());
}
SendMessage(_explorerComboBox,CB_SETCURSEL,0,(LPARAM)0);
}
}
bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstance) {
-
+ thisCls = this;
if (!createWindowClass("propHWND",PropProc,hThisInstance))
return false;
diff --git a/resource.h b/resource.h
index b6267f8..dd09446 100644
--- a/resource.h
+++ b/resource.h
@@ -3,13 +3,14 @@
// Used by Dialogs.rc
//
#define IDI_ICON1 102
-#define IDC_PROPERTYGRID 2000
+#define IDB_BITMAP1 103
+#define IDC_PROPERTYGRID 2000
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 103
+#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101