Browse Source

Merge pull request #514 from AtomicGameEngine/JME-ATOMIC-512

Only respond to click event, instead of both mouse down + click
JoshEngebretson 10 years ago
parent
commit
0a330a414d
1 changed files with 11 additions and 5 deletions
  1. 11 5
      Source/AtomicEditor/Editors/ResourceEditor.cpp

+ 11 - 5
Source/AtomicEditor/Editors/ResourceEditor.cpp

@@ -61,7 +61,11 @@ public:
 
 
     bool OnEvent(const TBWidgetEvent &ev)
     bool OnEvent(const TBWidgetEvent &ev)
     {
     {
-        if (ev.type == EVENT_TYPE_CLICK || ev.type == EVENT_TYPE_POINTER_DOWN)
+        // Don't process pointer down, we only respond to click events
+        if (ev.type == EVENT_TYPE_POINTER_DOWN)
+            return true;
+
+        if (ev.type == EVENT_TYPE_CLICK)
         {
         {
             if (ev.target->GetID() == TBIDC("unsaved_modifications_dialog"))
             if (ev.target->GetID() == TBIDC("unsaved_modifications_dialog"))
             {
             {
@@ -83,24 +87,26 @@ public:
                 }
                 }
                 return true;
                 return true;
             }
             }
-            if (ev.target->GetID() == TBIDC("tabclose"))
+            else if (ev.target->GetID() == TBIDC("tabclose"))
             {
             {
                 if (RequestClose())
                 if (RequestClose())
                 {
                 {
                     container_->OnEvent(ev);
                     container_->OnEvent(ev);
-                    return true;
                 }
                 }
+
+                return true;
             }
             }
-            else 
+            else
             {
             {
                 TBWidgetEvent nevent = ev;
                 TBWidgetEvent nevent = ev;
                 nevent.target = this;
                 nevent.target = this;
-                container_->OnEvent(nevent);
+                return container_->OnEvent(nevent);
             }
             }
         }
         }
 
 
         return false;
         return false;
     }
     }
+
 };
 };
 
 
 ResourceEditor::ResourceEditor(Context* context, const String& fullpath, UITabContainer *container):
 ResourceEditor::ResourceEditor(Context* context, const String& fullpath, UITabContainer *container):