Skip to content

Commit aa68c6d

Browse files
committed
Merge pull request #522 from fodinabor/FixIDEMenuWin
Fix ide menu on Windows
2 parents da6f5fd + 75bb507 commit aa68c6d

File tree

10 files changed

+32
-13
lines changed

10 files changed

+32
-13
lines changed

IDE/Build/Windows/Polycode.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PolycodeLibsRelease>$(PolycodeCoreLibsRelease);$(PolycodeDependLibsRelease);$(PolycodeWinLibsRelease)</PolycodeLibsRelease>
1414
</PropertyGroup>
1515
<PropertyGroup>
16-
<IncludePath>..\..\Contents\Include;$(PolycodeDir)Core\include;$(PolycodeDir)Modules\include;$(PolycodeDir)Core\Dependencies\include;$(PolycodeDir)Core\PolycodeView;$(PolycodeDir)Core\Dependencies\include\AL;$(IncludePath)</IncludePath>
16+
<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>
1717
</PropertyGroup>
1818
<PropertyGroup>
1919
<LibraryPath>$(PolycodeDir)Core\lib;$(PolycodeDir)Core\Dependencies\lib;$(PolycodeDir)Modules\lib;$(PolycodeDir)Modules\Dependencies\lib;$(LibraryPath)</LibraryPath>

IDE/Build/Windows/Polycode.rc

5.52 KB
Binary file not shown.

IDE/Build/Windows/Polycode.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<ClCompile Include="..\..\Contents\Source\ToolWindows.cpp" />
4545
<ClCompile Include="..\..\Contents\Source\TrackballCamera.cpp" />
4646
<ClCompile Include="..\..\Contents\Source\TransformGizmo.cpp" />
47+
<ClCompile Include="..\WindowsShared\PolycodeWinIDEView.cpp" />
4748
<ClCompile Include="main.cpp" />
4849
</ItemGroup>
4950
<ItemGroup>
@@ -81,6 +82,7 @@
8182
<ClInclude Include="..\..\Contents\Include\ToolWindows.h" />
8283
<ClInclude Include="..\..\Contents\Include\TrackballCamera.h" />
8384
<ClInclude Include="..\..\Contents\Include\TransformGizmo.h" />
85+
<ClInclude Include="..\WindowsShared\PolycodeWinIDEView.h" />
8486
<ClInclude Include="resource.h" />
8587
</ItemGroup>
8688
<ItemGroup>

IDE/Build/Windows/Polycode.vcxproj.filters

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@
111111
<ClCompile Include="..\..\Contents\Source\EntityEditorTreeView.cpp">
112112
<Filter>Source</Filter>
113113
</ClCompile>
114+
<ClCompile Include="..\WindowsShared\PolycodeWinIDEView.cpp">
115+
<Filter>Source</Filter>
116+
</ClCompile>
114117
</ItemGroup>
115118
<ItemGroup>
116119
<ClInclude Include="..\..\Contents\Include\ExampleBrowserWindow.h">
@@ -216,6 +219,9 @@
216219
<ClInclude Include="..\..\Contents\Include\EntityEditorTreeView.h">
217220
<Filter>Include</Filter>
218221
</ClInclude>
222+
<ClInclude Include="..\WindowsShared\PolycodeWinIDEView.h">
223+
<Filter>Include</Filter>
224+
</ClInclude>
219225
</ItemGroup>
220226
<ItemGroup>
221227
<ResourceCompile Include="Polycode.rc" />

IDE/Build/Windows/main.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#include <Polycode.h>
22
#include "PolycodeIDEApp.h"
3-
#include "PolycodeView.h"
3+
#include "PolycodeWinIDEView.h"
44
#include "windows.h"
55
#include "resource.h"
66
#include <Shlobj.h>
77
#include <Shlwapi.h>
88
#include <shellapi.h>
99

10+
extern PolycodeIDEApp *globalApp;
11+
1012
using namespace Polycode;
1113

1214
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
7375
PathRemoveFileSpec( FilePath );
7476
SetCurrentDirectory( FilePath );
7577

76-
PolycodeView *view = new PolycodeView(hInstance, nCmdShow, L"Polycode", true, false);
78+
PolycodeWinIDEView *view = new PolycodeWinIDEView(hInstance, nCmdShow, L"Polycode", true, false);
7779
PolycodeIDEApp *app = new PolycodeIDEApp(view);
7880

81+
globalApp = app;
82+
7983
if(fileName != "") {
8084
app->openProject(fileName);
8185
}
@@ -89,8 +93,11 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
8993
MSG Msg;
9094
do {
9195
while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE)) {
92-
TranslateMessage(&Msg);
93-
DispatchMessage(&Msg);
96+
97+
if (!TranslateAccelerator(view->hwnd, view->haccel, &Msg)) {
98+
TranslateMessage(&Msg);
99+
DispatchMessage(&Msg);
100+
}
94101
}
95102
if(((Win32Core*)app->core)->hasCopyDataString) {
96103
app->openProject(((Win32Core*)app->core)->copyDataString);

IDE/Build/Windows/resource.h

2.16 KB
Binary file not shown.

IDE/Build/Windows2013/Polycode.sln

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

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

IDE/Build/WindowsShared/PolycodeWinIDEView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ PolycodeWinIDEView::PolycodeWinIDEView(HINSTANCE hInstance, int nCmdShow, LPCTST
286286
wcex.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
287287
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
288288
wcex.hbrBackground = NULL;
289-
wcex.lpszMenuName = MAKEINTRESOURCE(IDR_POLYCODEMENU);
289+
wcex.lpszMenuName = MAKEINTRESOURCE(IDR_POLYCODEMENU);
290290
wcex.lpszClassName = L"POLYCODEAPPLICATION";
291291
wcex.hIconSm = LoadIcon(hInstance, IDI_APPLICATION);
292292

IDE/Contents/Include/PolycodeIDEApp.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#if defined(__APPLE__) && defined(__MACH__)
2424
#import "PolycodeView.h"
25+
#elif defined(_WINDOWS)
26+
#include "PolycodeWinIDEView.h"
2527
#else
2628
#include "PolycodeView.h"
2729
#endif
@@ -53,7 +55,7 @@ using namespace Polycode;
5355
class PolycodeIDEApp : public EventDispatcher {
5456
public:
5557
#ifdef _WINDOWS
56-
PolycodeIDEApp(PolycodeViewBase *view);
58+
PolycodeIDEApp(PolycodeWinIDEView *view);
5759
#else
5860
PolycodeIDEApp(PolycodeView *view);
5961
#endif

IDE/Contents/Source/PolycodeIDEApp.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ PolycodeEditorManager *globalEditorManager;
3232
Scene *globalScene;
3333

3434
#ifdef _WINDOWS
35-
PolycodeIDEApp::PolycodeIDEApp(PolycodeViewBase *view) : EventDispatcher() {
35+
PolycodeIDEApp::PolycodeIDEApp(PolycodeWinIDEView *view) : EventDispatcher() {
36+
core = new POLYCODE_CORE((PolycodeWinIDEView*)view, 1100, 700,false,false, 0, 0,60, -1, true);
3637
#else
3738
PolycodeIDEApp::PolycodeIDEApp(PolycodeView *view) : EventDispatcher() {
39+
core = new POLYCODE_CORE((PolycodeView*)view, 1100, 700,false,false, 0, 0,60, -1, true);
3840
#endif
39-
core = new POLYCODE_CORE((PolycodeView*)view, 1100, 700,false,false, 0, 0,60, -1, true);
41+
4042
// core->pauseOnLoseFocus = true;
4143

4244
printf("DIR: %s\n", core->getDefaultWorkingDirectory().c_str());

0 commit comments

Comments
 (0)