#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Thu, 07 Mar 2019 15:14:21 +0100
changeset 6032 6f88e34cb865
parent 6031 608583d9fea7
child 6033 83fa7b6785ec
#REFACTORING by stefan class: MenuPanel comment/format in: #ungrabKeyboard changed: #grabMouseAndKeyboard Use Logger Do not log warnings when grabKeyboard fails in windows (it is not implemented in windows!)
MenuPanel.st
--- a/MenuPanel.st	Thu Mar 07 10:42:40 2019 +0100
+++ b/MenuPanel.st	Thu Mar 07 15:14:21 2019 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1997 by eXept Software AG
               All Rights Reserved
@@ -4575,19 +4577,19 @@
         device activePointerGrab ~~ self ifTrue:[
             sensor flushMotionEventsFor:nil.
 
-            (self grabPointer) ifFalse:[
+            self grabPointer ifFalse:[
                 Delay waitForSeconds:0.1.
-                (self grabPointer) ifFalse:[
+                self grabPointer ifFalse:[
                     "give up"
-                    'MenuPanel [warning]: could not grab pointer' errorPrintCR.
+                    Logger warning:'MenuPanel could not grab pointer'.
                     self unmap
                 ].
             ].
-            device activePointerGrab == self ifFalse:[
-                'MenuPanel [warning]: could not grab pointer' errorPrintCR.
+            device activePointerGrab ~~ self ifTrue:[
+                Logger warning:'MenuPanel could not grab pointer'.
             ].                
         ] ifFalse:[
-            'MenuPanel [warning]: already pointer owner' errorPrintCR.
+            Logger warning:'MenuPanel already pointer owner'.
         ].    
 
         (activeGrab := device activeKeyboardGrab) ~~ self ifTrue:[
@@ -4597,18 +4599,18 @@
 "/                sensor flushKeyboardFor:activeGrab.
 "/            ].
             sensor flushKeyboardFor:nil.
-            self grabKeyboard.
-            device activeKeyboardGrab == self ifFalse:[
-                'MenuPanel [warning]: could not grab keyboard' errorPrintCR.
+            self grabKeyboard ifFalse:[
+                Logger warning:'MenuPanel could not grab keyboard'.
             ].                
         ] ifFalse:[
-            'MenuPanel [warning]: already keyboard owner' errorPrintCR.
-        ]
+            Logger warning:'MenuPanel already keyboard owner'.
+        ].
     ]
 
     "Modified: / 02-02-1998 / 23:43:59 / stefan"
     "Modified: / 15-03-1999 / 12:01:38 / cg"
     "Modified: / 05-03-2019 / 01:50:44 / Claus Gittinger"
+    "Modified: / 07-03-2019 / 14:37:38 / Stefan Vogel"
 !
 
 grabPointerWithCursor:aCursorOrNil
@@ -4625,9 +4627,11 @@
     super ungrabKeyboard.
 
     (previousKeyboardGrab notNil
-    and:[ previousKeyboardGrab realized ]) ifTrue:[
+     and:[previousKeyboardGrab realized]) ifTrue:[
         device grabKeyboardInView:previousKeyboardGrab.
     ].
+
+    "Modified (format): / 07-03-2019 / 14:33:14 / Stefan Vogel"
 !
 
 ungrabMouseAndKeyboard
@@ -5219,7 +5223,7 @@
      we have non translated sub menus (when using them later for viewing).
      Problem expecco Menu 'View' was somethimes untranslated and somethimes not.
      Dependent if this code was called before the user did open (instantiate) the menu via the application.
-     May also the shortcuts itself could vary when translated 'Open &File' -> 'Datei &öffnen' ????"
+     May also the shortcuts itself could vary when translated 'Open &File' -> 'Datei &öffnen' ????"
     Menu::NeedResourcesQuery answer:true do:[
 "/    Menu::NeedResourcesQuery answer:false do:[
         [true] whileTrue:[