PropertyGrid Selection Explorer Implemented
This commit is contained in:
@@ -10,8 +10,7 @@ bool Globals::showMouse = true;
|
|||||||
bool Globals::useMousePoint = false;
|
bool Globals::useMousePoint = false;
|
||||||
|
|
||||||
const std::string Globals::PlaceholderName = "Dynamica";
|
const std::string Globals::PlaceholderName = "Dynamica";
|
||||||
|
std::vector<Instance*> selectedInstances = std::vector<Instance*>();
|
||||||
|
|
||||||
G3D::TextureRef Globals::surface;
|
G3D::TextureRef Globals::surface;
|
||||||
POINT Globals::mousepoint;
|
POINT Globals::mousepoint;
|
||||||
Globals::Globals(void){}
|
Globals::Globals(void){}
|
||||||
|
|||||||
@@ -19,3 +19,5 @@ public:
|
|||||||
static int surfaceId;
|
static int surfaceId;
|
||||||
static const std::string PlaceholderName;
|
static const std::string PlaceholderName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern std::vector<Instance*> selectedInstances;
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "WindowFunctions.h"
|
#include "WindowFunctions.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "PropertyWindow.h"
|
#include "PropertyWindow.h"
|
||||||
|
#include "Globals.h"
|
||||||
|
|
||||||
/*typedef struct typPRGP {
|
/*typedef struct typPRGP {
|
||||||
Instance* instance; // Declare member types
|
Instance* instance; // Declare member types
|
||||||
@@ -54,6 +55,15 @@ LRESULT CALLBACK PropProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PropertyWindow::refreshExplorer()
|
||||||
|
{
|
||||||
|
SendMessage(_explorerComboBox,CB_RESETCONTENT,0,0);
|
||||||
|
for (unsigned int i=0;i<selectedInstances.size();i++) {
|
||||||
|
SendMessage(_explorerComboBox,CB_ADDSTRING, 0,(LPARAM)selectedInstances[i]->name.c_str());
|
||||||
|
SendMessage(_explorerComboBox,CB_SETCURSEL,0,(LPARAM)0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstance) {
|
bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstance) {
|
||||||
|
|
||||||
if (!createWindowClass("propHWND",PropProc,hThisInstance))
|
if (!createWindowClass("propHWND",PropProc,hThisInstance))
|
||||||
@@ -81,13 +91,14 @@ bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstanc
|
|||||||
WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST,
|
WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
280,
|
0,
|
||||||
20,
|
0,
|
||||||
_hwndProp, // parent
|
_hwndProp, // parent
|
||||||
NULL, // menu
|
NULL, // menu
|
||||||
hThisInstance,
|
hThisInstance,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
SendMessage(_explorerComboBox, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), 0);
|
||||||
|
|
||||||
_propGrid = New_PropertyGrid(_hwndProp,IDC_PROPERTYGRID);
|
_propGrid = New_PropertyGrid(_hwndProp,IDC_PROPERTYGRID);
|
||||||
|
|
||||||
@@ -131,8 +142,11 @@ bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstanc
|
|||||||
PropGrid_ShowToolTips(_propGrid,TRUE);
|
PropGrid_ShowToolTips(_propGrid,TRUE);
|
||||||
PropGrid_ShowPropertyDescriptions(_propGrid,TRUE);
|
PropGrid_ShowPropertyDescriptions(_propGrid,TRUE);
|
||||||
PropGrid_ExpandAllCatalogs(_propGrid);
|
PropGrid_ExpandAllCatalogs(_propGrid);
|
||||||
|
|
||||||
|
|
||||||
SetWindowLongPtr(_hwndProp,GWL_USERDATA,(LONG)this);
|
SetWindowLongPtr(_hwndProp,GWL_USERDATA,(LONG)this);
|
||||||
|
|
||||||
|
refreshExplorer();
|
||||||
_resize();
|
_resize();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -152,7 +166,7 @@ void PropertyWindow::_resize()
|
|||||||
RECT rect;
|
RECT rect;
|
||||||
GetClientRect(_hwndProp,&rect);
|
GetClientRect(_hwndProp,&rect);
|
||||||
SetWindowPos(_propGrid, NULL, 0, 20, rect.right, rect.bottom-20, SWP_NOZORDER | SWP_NOACTIVATE);
|
SetWindowPos(_propGrid, NULL, 0, 20, rect.right, rect.bottom-20, SWP_NOZORDER | SWP_NOACTIVATE);
|
||||||
SetWindowPos(_explorerComboBox, NULL, 0, 0, rect.right, 20, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
|
SetWindowPos(_explorerComboBox, NULL, 0, 0, rect.right, 400, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertyWindow::SetProperties(Instance * instance)
|
void PropertyWindow::SetProperties(Instance * instance)
|
||||||
@@ -169,7 +183,9 @@ void PropertyWindow::SetProperties(Instance * instance)
|
|||||||
//propgp.prop = prop.at(i);
|
//propgp.prop = prop.at(i);
|
||||||
}
|
}
|
||||||
PropGrid_ExpandAllCatalogs(_propGrid);
|
PropGrid_ExpandAllCatalogs(_propGrid);
|
||||||
SetWindowLongPtr(_propGrid,GWL_USERDATA,(LONG)this);
|
//SetWindowLongPtr(_propGrid,GWL_USERDATA,(LONG)this);
|
||||||
|
|
||||||
|
refreshExplorer();
|
||||||
_resize();
|
_resize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public:
|
|||||||
void SetProperties(Instance *);
|
void SetProperties(Instance *);
|
||||||
void ClearProperties();
|
void ClearProperties();
|
||||||
void onResize();
|
void onResize();
|
||||||
|
void refreshExplorer();
|
||||||
HWND _hwndProp;
|
HWND _hwndProp;
|
||||||
private:
|
private:
|
||||||
HWND _propGrid;
|
HWND _propGrid;
|
||||||
|
|||||||
1
main.cpp
1
main.cpp
@@ -78,7 +78,6 @@ static int mode = CURSOR;
|
|||||||
bool dragging = false;
|
bool dragging = false;
|
||||||
Vector2 oldMouse = Vector2(0,0);
|
Vector2 oldMouse = Vector2(0,0);
|
||||||
float moveRate = 0.5;
|
float moveRate = 0.5;
|
||||||
std::vector<Instance*> selectedInstances = std::vector<Instance*>();
|
|
||||||
static const std::string PlaceholderName = "HyperCube";
|
static const std::string PlaceholderName = "HyperCube";
|
||||||
|
|
||||||
Demo *usableApp = NULL;
|
Demo *usableApp = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user