Преглед изворни кода

Merge pull request #522 from fodinabor/FixIDEMenuWin

Fix ide menu on Windows
Ivan Safrin пре 11 година
родитељ
комит
aa68c6dcbe

+ 1 - 1
IDE/Build/Windows/Polycode.props

@@ -13,7 +13,7 @@
     <PolycodeLibsRelease>$(PolycodeCoreLibsRelease);$(PolycodeDependLibsRelease);$(PolycodeWinLibsRelease)</PolycodeLibsRelease>
   </PropertyGroup>
   <PropertyGroup>
-    <IncludePath>..\..\Contents\Include;$(PolycodeDir)Core\include;$(PolycodeDir)Modules\include;$(PolycodeDir)Core\Dependencies\include;$(PolycodeDir)Core\PolycodeView;$(PolycodeDir)Core\Dependencies\include\AL;$(IncludePath)</IncludePath>
+    <IncludePath>..\WindowsShared;..\..\Contents\Include;$(PolycodeDir)Core\include;$(PolycodeDir)Modules\include;$(PolycodeDir)Core\Dependencies\include;$(PolycodeDir)Core\PolycodeView;$(PolycodeDir)Core\Dependencies\include\AL;$(SolutionDir);$(IncludePath)</IncludePath>
   </PropertyGroup>
   <PropertyGroup>
     <LibraryPath>$(PolycodeDir)Core\lib;$(PolycodeDir)Core\Dependencies\lib;$(PolycodeDir)Modules\lib;$(PolycodeDir)Modules\Dependencies\lib;$(LibraryPath)</LibraryPath>

BIN
IDE/Build/Windows/Polycode.rc


+ 2 - 0
IDE/Build/Windows/Polycode.vcxproj

@@ -44,6 +44,7 @@
     <ClCompile Include="..\..\Contents\Source\ToolWindows.cpp" />
     <ClCompile Include="..\..\Contents\Source\TrackballCamera.cpp" />
     <ClCompile Include="..\..\Contents\Source\TransformGizmo.cpp" />
+    <ClCompile Include="..\WindowsShared\PolycodeWinIDEView.cpp" />
     <ClCompile Include="main.cpp" />
   </ItemGroup>
   <ItemGroup>
@@ -81,6 +82,7 @@
     <ClInclude Include="..\..\Contents\Include\ToolWindows.h" />
     <ClInclude Include="..\..\Contents\Include\TrackballCamera.h" />
     <ClInclude Include="..\..\Contents\Include\TransformGizmo.h" />
+    <ClInclude Include="..\WindowsShared\PolycodeWinIDEView.h" />
     <ClInclude Include="resource.h" />
   </ItemGroup>
   <ItemGroup>

+ 6 - 0
IDE/Build/Windows/Polycode.vcxproj.filters

@@ -111,6 +111,9 @@
     <ClCompile Include="..\..\Contents\Source\EntityEditorTreeView.cpp">
       <Filter>Source</Filter>
     </ClCompile>
+    <ClCompile Include="..\WindowsShared\PolycodeWinIDEView.cpp">
+      <Filter>Source</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\Contents\Include\ExampleBrowserWindow.h">
@@ -216,6 +219,9 @@
     <ClInclude Include="..\..\Contents\Include\EntityEditorTreeView.h">
       <Filter>Include</Filter>
     </ClInclude>
+    <ClInclude Include="..\WindowsShared\PolycodeWinIDEView.h">
+      <Filter>Include</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="Polycode.rc" />

+ 11 - 4
IDE/Build/Windows/main.cpp

@@ -1,12 +1,14 @@
 #include <Polycode.h>
 #include "PolycodeIDEApp.h"
-#include "PolycodeView.h"
+#include "PolycodeWinIDEView.h"
 #include "windows.h"
 #include "resource.h"
 #include <Shlobj.h>
 #include <Shlwapi.h>
 #include <shellapi.h>
 
+extern PolycodeIDEApp *globalApp;
+
 using namespace Polycode;
 
 void registerFileType(String extension, String progId, String app, String defaultIcon, String desc) {
@@ -73,9 +75,11 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
 	PathRemoveFileSpec( FilePath );    
 	SetCurrentDirectory( FilePath );
 
-	PolycodeView *view = new PolycodeView(hInstance, nCmdShow, L"Polycode", true, false);
+	PolycodeWinIDEView *view = new PolycodeWinIDEView(hInstance, nCmdShow, L"Polycode", true, false);
 	PolycodeIDEApp *app = new PolycodeIDEApp(view);
 
+	globalApp = app;
+
 	if(fileName != "") {
 		app->openProject(fileName);
 	}
@@ -89,8 +93,11 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
 	MSG Msg;
 	do {
 		while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE)) {
-			TranslateMessage(&Msg);
-			DispatchMessage(&Msg);
+
+			if (!TranslateAccelerator(view->hwnd, view->haccel, &Msg)) {
+				TranslateMessage(&Msg);
+				DispatchMessage(&Msg);
+			}
 		}
 		if(((Win32Core*)app->core)->hasCopyDataString) {
 			app->openProject(((Win32Core*)app->core)->copyDataString);

BIN
IDE/Build/Windows/resource.h


+ 4 - 4
IDE/Build/Windows2013/Polycode.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Express 2013 for Windows Desktop
-VisualStudioVersion = 12.0.21005.1
+# Visual Studio 2013
+VisualStudioVersion = 12.0.30501.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Polycode", "Polycode.vcxproj", "{D6C2171B-9167-4FB6-851A-DC1CEDCFC43D}"
 EndProject
@@ -18,8 +18,8 @@ Global
 		Release|x64 = Release|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{D6C2171B-9167-4FB6-851A-DC1CEDCFC43D}.Debug|Win32.ActiveCfg = Debug|x64
-		{D6C2171B-9167-4FB6-851A-DC1CEDCFC43D}.Debug|Win32.Build.0 = Debug|x64
+		{D6C2171B-9167-4FB6-851A-DC1CEDCFC43D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D6C2171B-9167-4FB6-851A-DC1CEDCFC43D}.Debug|Win32.Build.0 = Debug|Win32
 		{D6C2171B-9167-4FB6-851A-DC1CEDCFC43D}.Debug|x64.ActiveCfg = Debug|x64
 		{D6C2171B-9167-4FB6-851A-DC1CEDCFC43D}.Debug|x64.Build.0 = Debug|x64
 		{D6C2171B-9167-4FB6-851A-DC1CEDCFC43D}.Release|Win32.ActiveCfg = Release|Win32

+ 1 - 1
IDE/Build/WindowsShared/PolycodeWinIDEView.cpp

@@ -286,7 +286,7 @@ PolycodeWinIDEView::PolycodeWinIDEView(HINSTANCE hInstance, int nCmdShow, LPCTST
 	wcex.hIcon			= LoadIcon(hInstance, IDI_APPLICATION);
 	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
 	wcex.hbrBackground	= NULL;
-	wcex.lpszMenuName = MAKEINTRESOURCE(IDR_POLYCODEMENU);
+	wcex.lpszMenuName	= MAKEINTRESOURCE(IDR_POLYCODEMENU);
 	wcex.lpszClassName	= L"POLYCODEAPPLICATION";
 	wcex.hIconSm		= LoadIcon(hInstance, IDI_APPLICATION);
 

+ 3 - 1
IDE/Contents/Include/PolycodeIDEApp.h

@@ -22,6 +22,8 @@
 
 #if defined(__APPLE__) && defined(__MACH__)
 #import "PolycodeView.h"
+#elif defined(_WINDOWS)
+#include "PolycodeWinIDEView.h"
 #else
 #include "PolycodeView.h"
 #endif
@@ -53,7 +55,7 @@ using namespace Polycode;
 class PolycodeIDEApp : public EventDispatcher {
 public:
 #ifdef _WINDOWS
-	PolycodeIDEApp(PolycodeViewBase *view);
+	PolycodeIDEApp(PolycodeWinIDEView *view);
 #else
 	PolycodeIDEApp(PolycodeView *view);
 #endif

+ 4 - 2
IDE/Contents/Source/PolycodeIDEApp.cpp

@@ -32,11 +32,13 @@ PolycodeEditorManager *globalEditorManager;
 Scene *globalScene;
 
 #ifdef _WINDOWS
-PolycodeIDEApp::PolycodeIDEApp(PolycodeViewBase *view) : EventDispatcher() {
+PolycodeIDEApp::PolycodeIDEApp(PolycodeWinIDEView *view) : EventDispatcher() {
+core = new POLYCODE_CORE((PolycodeWinIDEView*)view, 1100, 700,false,false, 0, 0,60, -1, true);
 #else
 PolycodeIDEApp::PolycodeIDEApp(PolycodeView *view) : EventDispatcher() {
+core = new POLYCODE_CORE((PolycodeView*)view, 1100, 700,false,false, 0, 0,60, -1, true);
 #endif
-	core = new POLYCODE_CORE((PolycodeView*)view, 1100, 700,false,false, 0, 0,60, -1, true);
+	
 //	core->pauseOnLoseFocus = true;
     
 	printf("DIR: %s\n", core->getDefaultWorkingDirectory().c_str());