Merge branch 'master' into DataModelV2

This commit is contained in:
Vulpovile
2021-03-07 21:13:24 -08:00
10 changed files with 58 additions and 73 deletions

View File

@@ -21,6 +21,7 @@ public:
static int surfaceId;
static const std::string g_PlaceholderName;
static COLORREF g_acrCustClr[16]; //Will be dynamic later
static HWND mainHwnd;
};
extern std::vector<Instance*> 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";

View File

@@ -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));

View File

@@ -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){}

View File

@@ -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);
}
}

View File

@@ -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();
}

View File

@@ -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);