Browse Source

Fix for WebView resize issue, use key combinations as the shortcuts invocation isn't quite working

Josh Engebretson 10 years ago
parent
commit
1bbc00a183

+ 1 - 1
Data/AtomicEditor/CodeEditor/Editor.html

@@ -53,7 +53,7 @@
     editor.setTheme("ace/theme/monokai");
     editor.session.setMode("ace/mode/typescript");
     editor.session.setValue(value);
-    editor.gotoLine(0);
+    editor.gotoLine(0);    
 
     editor.getSession().on('change', function(e) {
       window.atomicQuery({request: 'change',

+ 1 - 1
Source/AtomicEditor/Editors/JSResourceEditor.cpp

@@ -106,7 +106,7 @@ void JSResourceEditor::HandleWebMessage(StringHash eventType, VariantMap& eventD
 
 void JSResourceEditor::FormatCode()
 {
-
+    //webClient_->ExecuteJavaScript("beautifyCode();");
 }
 
 bool JSResourceEditor::OnEvent(const TBWidgetEvent &ev)

+ 4 - 1
Source/AtomicWebView/UIWebView.cpp

@@ -83,7 +83,7 @@ public:
 
         TBRect rect = GetRect();
 
-        if ((rect.w < 0 || rect.h < 0) || (rect.w == rect.h == 0))
+        if (rect.w <= 0 || rect.h <= 0)
             return;
 
         webView_->webClient_->SetSize(rect.w, rect.h);
@@ -218,6 +218,8 @@ bool UIWebView::OnEvent(const TBWidgetEvent &ev)
     }
     else if (ev.type == EVENT_TYPE_SHORTCUT)
     {
+        // Currently handled by key combinations
+        /*
         if (ev.ref_id == TBIDC("copy"))
         {
             webClient_->ShortcutCopy();
@@ -248,6 +250,7 @@ bool UIWebView::OnEvent(const TBWidgetEvent &ev)
             webClient_->ShortcutRedo();
             return true;
         }
+        */
 
     }
 

+ 2 - 2
Source/AtomicWebView/WebKeyboardMac.cpp

@@ -22,8 +22,8 @@ static bool SDLScanCodeToDarwinScanCode(SDL_Scancode code, int& darwinScanCode)
 
     darwinScanCode = -1;
 
-    if (code >= SDL_SCANCODE_A && code <= SDL_SCANCODE_0)
-        return false;
+    //if (code >= SDL_SCANCODE_A && code <= SDL_SCANCODE_0)
+    //    return false;
 
     int numCodes = sizeof(darwin_scancode_table)/sizeof(SDL_Scancode);