diff --git a/Blocks3D.vcproj b/Blocks3D.vcproj index 11afcb6..19a83f7 100644 --- a/Blocks3D.vcproj +++ b/Blocks3D.vcproj @@ -75,7 +75,7 @@ /> - - - - - - - - - - - - - - postRenderStack; @@ -36,4 +37,5 @@ extern COLORREF g_acrCustClr[16]; //Will be dynamic later extern std::string cameraSound; extern std::string clickSound; extern std::string dingSound; +extern HWND mainHwnd; const std::string g_PlaceholderName = "Dygysphere"; \ No newline at end of file diff --git a/src/source/DataModel/GuiRootInstance.cpp b/src/source/DataModel/GuiRootInstance.cpp index 7e1151a..b1aa15e 100644 --- a/src/source/DataModel/GuiRootInstance.cpp +++ b/src/source/DataModel/GuiRootInstance.cpp @@ -445,7 +445,7 @@ void GuiRootInstance::renderGUI(G3D::RenderDevice* rd, double fps) #endif //GUI Boxes Draw::box(G3D::Box(Vector3(0,25,0),Vector3(80,355,0)),rd,Color4(0.6F,0.6F,0.6F,0.4F), Color4(0,0,0,0)); - Draw::box(G3D::Box(Vector3(rd->getWidth() - 120,rd->getHeight() - 120,0),Vector3(rd->getWidth(),rd->getHeight(),0)),rd,Color4(0.6F,0.6F,0.6F,0.4F), Color4(0,0,0,0)); + Draw::box(G3D::Box(Vector3(rd->getWidth() - 120,rd->getHeight() - 117,0),Vector3(rd->getWidth(),rd->getHeight(),0)),rd,Color4(0.6F,0.6F,0.6F,0.4F), Color4(0,0,0,0)); //Camera menu title g_fntlighttrek->draw2D(rd, "CameraMenu", Vector2(rd->getWidth()-(g_fntlighttrek->get2DStringBounds("CameraMenu", 14).x+1),rd->getHeight() - 120), 14, Color3::white(), Color4(0.5F,0.5F,0.5F,0.5F)); diff --git a/src/source/Globals.cpp b/src/source/Globals.cpp index a1aec05..981bb0a 100644 --- a/src/source/Globals.cpp +++ b/src/source/Globals.cpp @@ -2,9 +2,9 @@ #include "Application.h" int const Globals::gen = 0; -int const Globals::major = 0; +int const Globals::major = 100; int const Globals::minor = 4; -int const Globals::patch = 2; +int const Globals::patch = 3; int Globals::surfaceId = 2; bool Globals::showMouse = true; bool Globals::useMousePoint = false; @@ -19,6 +19,7 @@ POINT Globals::mousepoint; GFontRef g_fntdominant = NULL; GFontRef g_fntlighttrek = NULL; +HWND Globals::mainHwnd = NULL; Globals::Globals(void){} diff --git a/src/source/Listener/MenuButtonListener.cpp b/src/source/Listener/MenuButtonListener.cpp index 10f5eba..c2298ee 100644 --- a/src/source/Listener/MenuButtonListener.cpp +++ b/src/source/Listener/MenuButtonListener.cpp @@ -1,5 +1,6 @@ #include "Listener/MenuButtonListener.h" #include "DataModel/ToggleImageButtonInstance.h" +#include "Application.h" #include "Globals.h" void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button) { @@ -10,34 +11,13 @@ void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button) } else if(button->name == "file") { - HMENU hPopupMenu = CreatePopupMenu(); - HWND hwnd = CreateWindowEx( - WS_EX_APPWINDOW, - "MenuWindow", - "Main test", - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, - CW_USEDEFAULT, - 800, - 660, - NULL, // parent - NULL, // menu - GetModuleHandle(NULL), - NULL - ); - - AppendMenu(hPopupMenu, MF_STRING, 0, "Test"); - if(hPopupMenu == NULL) - { - MessageBox(NULL, "Menu is null!", "Failed", MB_OK); - } - else if(hwnd == NULL) - { - MessageBox(NULL, "HWND is null!", "Failed", MB_OK); - } - else if(!TrackPopupMenu(hPopupMenu, TPM_LEFTBUTTON, 100, 100, 0, hwnd, 0)) - { - MessageBox(NULL, "Failed to track!", "Failed", MB_OK); - } + HMENU mainmenu = CreatePopupMenu(); + AppendMenu(mainmenu, MF_STRING, 100, "New"); + AppendMenu(mainmenu, MF_STRING, 101, "Open..."); + AppendMenu(mainmenu, MF_STRING, 101, "Close"); + AppendMenu(mainmenu, MF_SEPARATOR, 0, NULL); + POINT p; + GetCursorPos(&p); + TrackPopupMenu(mainmenu, TPM_LEFTBUTTON, p.x, p.y, 0, Globals::mainHwnd, 0); } } \ No newline at end of file diff --git a/src/source/main.cpp b/src/source/main.cpp index 253d7d0..b0913c3 100644 --- a/src/source/main.cpp +++ b/src/source/main.cpp @@ -230,7 +230,7 @@ int main(int argc, char** argv) { } SendMessage(hwndMain, WM_SETICON, ICON_BIG,(LPARAM)LoadImage(GetModuleHandle(NULL), (LPCSTR)MAKEINTRESOURCEW(IDI_ICON1), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_DEFAULTSIZE)); - + Globals::mainHwnd = hwndMain; Application app = Application(hwndMain); app.run(); } diff --git a/src/source/propertyGrid.cpp b/src/source/propertyGrid.cpp index 13f16b2..51ee92a 100644 --- a/src/source/propertyGrid.cpp +++ b/src/source/propertyGrid.cpp @@ -36,7 +36,7 @@ #endif #ifndef _WIN32_WINNT // Necessary for WM_MOUSEWHEEL support -#define _WIN32_WINNT 0x0500 +#define _WIN32_WINNT 0x0400 #endif // MSVC++ Support @@ -959,7 +959,7 @@ static HWND CreateEdit(HINSTANCE hInstance, HWND hwndParent, INT id) return NULL; //DWM 1.4: Added Disable visual styles for this control. - SetWindowTheme(hwnd, L" ", L" "); + // SetWindowTheme(hwnd, L" ", L" "); SendMessage(hwnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), 0L); @@ -1268,7 +1268,7 @@ static HWND CreateButton(HINSTANCE hInstance, HWND hwndParent, INT id) return NULL; //DWM 1.4: Added Disable visual styles for this control. - SetWindowTheme(hwnd, L" ", L" "); + //SetWindowTheme(hwnd, L" ", L" "); SendMessage(hwnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), 0L); @@ -1505,7 +1505,7 @@ static HWND CreateDatePicker(HINSTANCE hInstance, HWND hwndParent, INT id, BOOL return NULL; //DWM 1.4: Added Disable visual styles for this control. - SetWindowTheme(hwnd, L" ", L" "); + //SetWindowTheme(hwnd, L" ", L" "); SendMessage(hwnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), 0L); @@ -1697,7 +1697,7 @@ static HWND CreateCombo(HINSTANCE hInstance, HWND hwndParent, INT id, BOOL fEdit //DWM 1.4: Disable visual styles for the time being since the combo looks bad // in this grid when drawn using the Vista and later styles. - SetWindowTheme(hwnd, L" ", L" "); + //SetWindowTheme(hwnd, L" ", L" "); SendMessage(hwnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), 0L);