Browse Source

Scintilla: Added PageUp/Down support.

Branimir Karadžić 10 years ago
parent
commit
0d6b83055f

+ 1 - 1
3rdparty/scintilla/include/Platform.h

@@ -65,7 +65,7 @@
 #undef PLAT_MACOSX
 #define PLAT_MACOSX 1
 
-#if defined(__WIN32__) || defined(_WIN32) || defined(_WIN64)
+#elif defined(__WIN32__) || defined(_WIN32) || defined(_WIN64)
 #undef PLAT_WIN
 #define PLAT_WIN 1
 

+ 6 - 0
examples/common/imgui/ocornut_imgui.cpp

@@ -14,6 +14,7 @@
 
 #if defined(SCI_NAMESPACE)
 #	include "../entry/input.h"
+#	include "scintilla.h"
 #endif // defined(SCI_NAMESPACE)
 
 #include "vs_ocornut_imgui.bin.h"
@@ -247,6 +248,11 @@ struct OcornutImguiContext
 		ImGui::NewFrame();
 
 		//ImGui::ShowTestWindow(); //Debug only.
+		//
+#if defined(SCI_NAMESPACE) && 0
+		bool opened = true;
+		ImGuiScintilla("Scintilla Editor", &opened, ImVec2(640.0f, 480.0f) );
+#endif // 0
 	}
 
 	void endFrame()

+ 8 - 0
examples/common/imgui/scintilla.cpp

@@ -666,6 +666,14 @@ public:
 		{
 			Editor::KeyDown(SCK_DOWN, shift, ctrl, alt);
 		}
+		else if (ImGui::IsKeyPressed(entry::Key::PageUp) )
+		{
+			Editor::KeyDown(SCK_PRIOR, shift, ctrl, alt);
+		}
+		else if (ImGui::IsKeyPressed(entry::Key::PageDown) )
+		{
+			Editor::KeyDown(SCK_NEXT, shift, ctrl, alt);
+		}
 		else if (ImGui::IsKeyPressed(entry::Key::Home) )
 		{
 			Editor::KeyDown(SCK_HOME, shift, ctrl, alt);