diff --git a/Dialogs.rc b/Dialogs.rc index 81fbf6c..94f7028 100644 --- a/Dialogs.rc +++ b/Dialogs.rc @@ -4,8 +4,7 @@ #include #include -#include -#include "resource.h" //Should not have to do this... +#include "resource.h" @@ -35,9 +34,8 @@ FONT 8, "Ms Shell Dlg" } - // // Icon resources // LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN -IDI_ICON1 ICON "FatB3dIcon.ico" \ No newline at end of file +IDI_ICON1 ICON "FatB3dIcon.ico" diff --git a/resource.h b/resource.h index c126a1e..3e6c88f 100644 --- a/resource.h +++ b/resource.h @@ -1,10 +1,9 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by dialogs.rc -// -#define IDI_ICON1 101 -#define IDB_BITMAP1 102 -#define IDD_DIALOG1 103 -#define IDC_EDIT1 1001 -#define IDC_PROPERTYGRID 2000 - +#ifndef IDC_STATIC +#define IDC_STATIC (-1) +#endif + +#define IDI_ICON1 101 +#define IDB_BITMAP1 102 +#define IDD_DIALOG1 103 +#define IDD_DIALOG2 104 +#define IDC_EDIT1 1001 diff --git a/src/source/Application.cpp b/src/source/Application.cpp index 104de26..33823d9 100644 --- a/src/source/Application.cpp +++ b/src/source/Application.cpp @@ -673,17 +673,18 @@ void Application::onGraphics(RenderDevice* rd) { - renderDevice->setShininess(70); - renderDevice->setSpecularCoefficient(Color3(0.1F, 0.1F, 0.1F)); + //renderDevice->setShininess(70); + //renderDevice->setSpecularCoefficient(Color3(0.1F, 0.1F, 0.1F)); - //float lightAmbient[] = { 0.5F, 0.6F, 0.9F, 1.0F }; - //float lightDiffuse[] = { 0.6F, 0.4F, 0.9F, 1.0F }; + float lightAmbient[] = { 0.5F, 0.6F, 0.9F, 1.0F }; + float lightDiffuse[] = { 0.6F, 0.4F, 0.9F, 1.0F }; + float lightSpecular[] = { 0.8F, 0.8F, 0.8F, 1.0F }; //float lightSpecular[] = { 0.8F, 0.6F, 1.0F, 1.0F }; - //glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, lightAmbient); - //glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, lightDiffuse); - //glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, lightSpecular); - //glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 70); + glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, lightAmbient); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, lightDiffuse); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, lightSpecular); + glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 70); rd->beforePrimitive(); diff --git a/src/source/DataModelV2/GuiRootInstance.cpp b/src/source/DataModelV2/GuiRootInstance.cpp index 7efdbd9..1377f14 100644 --- a/src/source/DataModelV2/GuiRootInstance.cpp +++ b/src/source/DataModelV2/GuiRootInstance.cpp @@ -184,6 +184,8 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0) button->fontLocationRelativeTo = Vector2(10, 0); button->setAllColorsSame(); button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F); + button->setName("insert"); + button->setButtonListener(menuListener); button = makeTextButton(); button->boxBegin = Vector2(500, 0); diff --git a/src/source/Listener/MenuButtonListener.cpp b/src/source/Listener/MenuButtonListener.cpp index ab644c8..2c9ea53 100644 --- a/src/source/Listener/MenuButtonListener.cpp +++ b/src/source/Listener/MenuButtonListener.cpp @@ -2,6 +2,33 @@ #include "DataModelV2/ToggleImageButtonInstance.h" #include "Application.h" #include "Globals.h" +#include "../../resource.h" + +INT_PTR CALLBACK InsertDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) +{ + switch(Message) + { + case WM_INITDIALOG: + return TRUE; + break; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDOK: + //g_dataModel->setMessage("lol u thought"); + EndDialog(hwnd, IDOK); + break; + case IDCANCEL: + EndDialog(hwnd, IDCANCEL); + break; + } + break; + default: + return FALSE; + } + return TRUE; +} + void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button) { if(button->name == "go") @@ -20,4 +47,11 @@ void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button) GetCursorPos(&p); TrackPopupMenu(mainmenu, TPM_LEFTBUTTON, p.x, p.y, 0, Globals::mainHwnd, 0); } -} \ No newline at end of file + else if(button->name == "insert") + { + //HWND aDiag = CreateDialog((HINSTANCE) GetWindowLong(Globals::mainHwnd, GWL_HINSTANCE), MAKEINTRESOURCE(IDD_DIALOG1), Globals::mainHwnd, (DLGPROC)InsertDlgProc); + HWND aDiag2 = CreateDialog((HINSTANCE) GetWindowLong(Globals::mainHwnd, GWL_HINSTANCE), MAKEINTRESOURCE(IDD_DIALOG2), Globals::mainHwnd, (DLGPROC)InsertDlgProc); + } +} + +