Cairo__AbstractViewer.st
changeset 57 2c9a342e1f2a
parent 52 5a800f51a584
child 88 9d51db2ba641
--- a/Cairo__AbstractViewer.st	Mon Feb 29 18:08:00 2016 +0000
+++ b/Cairo__AbstractViewer.st	Tue Mar 01 16:10:07 2016 +0000
@@ -152,29 +152,34 @@
               (
                (MenuItem
                   label: 'Cut'
-                  itemValue: cutSelection
+                  itemValue: editMenuCut
                   nameKey: Cut
                   shortcutKey: Cut
+                  ignoreShortcutKeys: true
                 )
                (MenuItem
                   label: 'Copy'
-                  itemValue: copySelection
+                  itemValue: editMenuCopy
                   nameKey: Copy
                   shortcutKey: Copy
+                  ignoreShortcutKeys: true
                 )
                (MenuItem
                   label: 'Paste'
-                  itemValue: paste
+                  itemValue: editMenuPaste
                   nameKey: Paste
                   shortcutKey: Paste
+                  ignoreShortcutKeys: true
                 )
                (MenuItem
                   label: '-'
                 )
                (MenuItem
                   label: 'Accept'
+                  itemValue: editMenuAccept
                   nameKey: Accept
                   shortcutKey: Accept
+                  ignoreShortcutKeys: true
                 )
                )
               nil
@@ -232,6 +237,11 @@
                   itemValue: menuZoomSet:
                   argument: 400
                 )
+               (MenuItem
+                  label: '800%'
+                  itemValue: menuZoomSet:
+                  argument: 800
+                )
                )
               nil
               nil
@@ -241,8 +251,16 @@
         nil
         nil
       )
+! !
 
-    "Modified: / 28-02-2016 / 16:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!AbstractViewer class methodsFor:'queries'!
+
+isAbstract
+    "Return if this class is an abstract class.
+     True is returned here for myself only; false for subclasses.
+     Abstract subclasses must redefine again."
+
+    ^ self == Cairo::AbstractViewer.
 ! !
 
 !AbstractViewer methodsFor:'aspects'!
@@ -411,30 +429,27 @@
 !
 
 menuExamplesFromClass: aClass
-    | examples |
-
-    examples := aClass testSelectors collect:[:each | aClass lookupMethodFor: each ].    
-    examples sort: [ :a :b | (a annotationsAt: #example: orAt: #example:category:) first arguments first 
-                                < (b annotationsAt: #example: orAt: #example:category:) first arguments first ].
-    ^ self menuExamplesFromMethods: examples
+    ^ self menuExamplesFromSuite: aClass buildSuite.
 
     "Created: / 26-02-2016 / 22:34:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-02-2016 / 09:04:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-03-2016 / 10:05:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-menuExamplesFromMethods: methods
-    | menu |
+menuExamplesFromSuite: aTestSuite
+    | examples menu |
 
+    examples := aTestSuite tests.
+    examples sort: [ :a :b | a name < b name ].
     menu := Menu new.
-    methods do:[:method | 
+    examples do:[:example | 
         menu addItem: (MenuItem
-                        label: (method annotationsAt: #example: orAt: #example:category:) first arguments first
-                        itemValue: #menuExampleShowMethod: 
-                        argument: method)
+                        label: example name
+                        itemValue: #menuExampleShow: 
+                        argument: example source)
     ].
     ^ menu
 
-    "Created: / 26-02-2016 / 22:35:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 01-03-2016 / 10:04:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !AbstractViewer methodsFor:'menu actions'!