ToolApplicationModel.st
changeset 803 f6ca4eb5da39
parent 802 c863da8d04d3
child 804 86883be6e643
--- a/ToolApplicationModel.st	Mon Feb 02 13:31:00 1998 +0100
+++ b/ToolApplicationModel.st	Mon Feb 02 17:04:39 1998 +0100
@@ -162,6 +162,12 @@
 #editUndo
 'Reverses the last action.'
 
+#historyMenuItem
+'Evaluates the text of the menu item for loading.'
+
+#historyEmptyMenu
+'Deletes all items of the history.'
+
 #helpClassDocumentation
 'Opens a HTML-browser with a class documentation for current application.'
 
@@ -452,12 +458,7 @@
                 #'translateLabel:' true
                 #'value:' #openTutorial
                 #'activeHelpKey:' #helpTutorial
-            )
-             #(#MenuItem
-                #'label:' 'Programmer''s Guide'
-                #'translateLabel:' true
-                #'value:' #openProgrammersGuide
-                #'activeHelpKey:' #helpProgrammersGuide
+                #'enabled:' #valueOfHavingTutorial
             )
              #(#MenuItem
                 #'label:' '-'
@@ -481,8 +482,6 @@
           ) nil
           nil
       )
-
-    "Modified: / 30.1.1998 / 00:03:59 / cg"
 !
 
 menuSettings
@@ -517,6 +516,16 @@
 
 !ToolApplicationModel class methodsFor:'resources'!
 
+desktopIcon
+
+    |desktopIcon|
+    desktopIcon := self stxIcon.
+    ^desktopIcon magnifyBy: Display preferredIconSize/desktopIcon extent
+
+
+
+!
+
 downIcon
     "Generated by the Image Editor"
     "
@@ -565,11 +574,6 @@
         constantNamed:#'ToolApplicationModel fileOutIcon'
         ifAbsentPut:[(Depth2Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B@@@@@@@B @@@@@@*(@@@@@BB @@@@@BB@@@@@@B@@@@@@@B@@@@@@@B@@@@@@@B@@@@@@@B@@@@@@@@@@@@@@@@@@@@@@@@@@@@D@@AQDEADQAAADDADQA@AD@ADQAAQDEADQAAADDADQAAA@@@PAAAAEE@@DA'); colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@A@A.A%BDG2ADI%@$I@SDH@@@H@@@H@@@H@@@H@@@@@@@@@@@Z&KW_7_;[6_;[6_;_7_;[6_;[6L+I[@Q'); yourself); yourself]!
 
-icon
-
-    ^self stxIcon
-!
-
 leftDownIcon
     "Generated by the Image Editor"
     "
@@ -618,6 +622,13 @@
         constantNamed:#'ToolApplicationModel loadIcon'
         ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUUUUU?UPUUUUW*5PU???>*/PU:****)PUUUUUUZPP@@@@@EPS?????&PS?????%PS?????&PS?????%PT?????9PT?????9PT?????9PT?????9PT?????9PT?????9PUO????>PUO????>PUO????>PU:*****PUUUUUUUP'); colorMap:(((Array new:4) at:1 put:((Color white)); at:2 put:((Color black)); at:3 put:((Color grey:49.9962)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@G@@@O G??8O??<O??<_??<???<???<???<???<???<_??<_??<_??<_??<_??<_??<O??<O??<O??<O??<O??<'); yourself); yourself]!
 
+menuIcon
+
+    |menuIcon|
+    menuIcon := self stxIcon.
+    ^menuIcon magnifyBy: MenuPanel defaultFont height/menuIcon height
+!
+
 newIcon
     "Generated by the Image Editor"
     "
@@ -642,18 +653,6 @@
         constantNamed:#'ToolApplicationModel removeIcon'
         ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@BUUUUP@@B/???2@@B+???2 @A*???0@@A:/??*8@A>+?>+8@A?*?:/8@A?:/*?8@A?>*+?8@A??*/?8@A??*/?8@A?>*+?8@A?:/*?8@A?*?:/8@A>+?>+8@A:/??*8@A*???:(@B+???>(@B/????(@B*****(@@@@@@@@@'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color grey:49.9962)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@_??@_?? _??0_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8'); yourself); yourself]!
 
-reviseAllButtonIcon
-    "Generated by the Image Editor"
-    "
-    ImageEditor openOnClass:self andSelector:#reviseAllButtonIcon
-    "
-
-    <resource: #image>
-
-    ^Icon
-        constantNamed:#'ToolApplicationModel reviseAllButtonIcon'
-        ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'EUUU@@@@UVUY@@@@UY?6@@@@UW0=@@@@UWO=AUUPUWO-@@@@UW>=AUUPEY?6A@@P@BUXUUTP@A @P@DP@IPEUUDP@F@D@ADP@%@DEADP@X@DPQDPBT@DPADPA @DDADPEP@DAADPFP@D@QEPAP@DPQD@@P@DEAT@@@@D@A@@@@@EUU@@'); colorMap:(((Array new:4) at:1 put:((Color white)); at:2 put:((Color black)); at:3 put:((Color grey:49.9962)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@A>@@C?@@C?@@C?@@C?@@C?O<C?O<A>?<A ?<CC?<CC?<FC?<FC?<LC?<LC?<XC?<HC?<@C?0@C?0@C?@@C?@'); yourself); yourself]!
-
 rightIcon
     "Generated by the Image Editor"
     "
@@ -714,7 +713,8 @@
 
     ^Icon
         constantNamed:#'ToolApplicationModel stxIcon'
-        ifAbsentPut:[(Depth2Image new) width: 19; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@L@@@@@@@@@@@@@@@T@@D@@AP@APP@AP@@@@@E@E@@@@EA@@@@@TT@C@@@U@@@@@AP@@@@@U@@@@@EA@@L@APA@@@@T@D@@@U@@@@@AT@@D@0@@@@@A@@@@@@@b'); colorMap:((OrderedCollection new add:(Color grey:9.41024); add:(Color red:0.0 green:80.7828 blue:18.8205); add:(Color black); add:(Color white); yourself)); yourself]!
+        ifAbsentPut:[(Depth2Image new) width: 48; height: 48; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@U@@@@@@@AP@@@@@AUP@@@@@@E@@@@@@AUP@@@@@@T@@@@@@AUP@@@@@EP@@@@@@AUP@@@@@DP@@@@@@AUD@@@@AU@@@@@@@@UT@@@@@T@@@@@@@@UT@@@@QP@@@@@@@@EU@@@@U@@@@@@@@@AU@@@AD@@@@@@@@@ATP@@UP@@@@@@@@@AUP@@Q@@@@@@@@@@@UT@AD@@@@@@@@@@@AQ@DP@@@@@@@@@@@EU@Q@@@@@@@@@@@@ATQT@@@@@@@@@@@@AUTP@@@@@@@@@@@@@EPP@@@@@@@@@@@@@QU@@@@@@@@@@@@@@EU@@@@@@@@@@@@@@UT@@@@@@@@@@@@@AUE@@@@@@@@@@@@@EUU@@@@@@@@@@@@@UPEP@@@@@@@@@@@AUPAT@@@@@@@@@@@EE@AU@@@@@@@@@@AET@@E@@@@@@@@@@AUP@@EP@@@@@@@@@UU@@@AP@@@@@@@@AUP@@@AT@@@@@@@@EUP@@@@T@@@@@@@AUU@@@@@E@@@@@@@EUT@@@@@DP@@@@@@UUP@@@@@AP@@@@@@UUP@@@@@@T@@@@@@UU@@@@@@@E@@@@@@ET@@@@@@@A@@@@@@@@@@@@@@@@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'); colorMap:((OrderedCollection new add:(Color grey:9.99924); add:(Color red:0.0 green:80.0 blue:20.0); add:(Color black); add:(Color white); yourself)); yourself]
+!
 
 upIcon
     "Generated by the Image Editor"
@@ -775,6 +775,16 @@
 
 !
 
+valueOfHavingTutorial
+
+    |holder|
+    (holder := builder bindingAt:#valueOfHavingTutorial) isNil ifTrue:[
+        builder aspectAt:#valueOfHavingTutorial put:(holder :=  false asValue).
+    ].
+    ^ holder
+
+!
+
 valueOfInfoLabel
 
     |holder|
@@ -865,20 +875,15 @@
 
 !
 
-openProgrammersGuide
+openTutorial
+
+    self openTutorial: 'doc/online/english/getstart/tutorial.html'
+!
+
+openTutorial: aHTMLFilename
 
     |dir|
-    ((dir := Smalltalk getSystemFileName: 'doc/online/english/programming/TOP.html') asFilename exists)
-    ifTrue:
-    [
-        ^HTMLDocumentView openFullOnFile: dir
-    ]
-!
-
-openTutorial
-
-    |dir|
-    ((dir := Smalltalk getSystemFileName: 'doc/online/english/getstart/tutorial.html') asFilename exists)
+    ((dir := Smalltalk getSystemFileName: aHTMLFilename) asFilename exists)
     ifTrue:
     [
         ^HTMLDocumentView openFullOnFile: dir
@@ -948,9 +953,9 @@
     menu := Menu new receiver: self.
     (self history collect: [:histEntry| histEntry value]) asSet asOrderedCollection do:
     [:historyEntryType|    
-        menu addItemGroup: ((a := self history select: [:histEntry| histEntry value = historyEntryType]) collect: [:histEntry|  MenuItem new label: histEntry key printString; value: histEntry value; argument: histEntry key]).
+        menu addItemGroup: ((a := self history select: [:histEntry| histEntry value = historyEntryType]) collect: [:histEntry|  MenuItem new label: histEntry key printString; value: histEntry value; argument: histEntry key; activeHelpKey: #historyMenuItem]).
     ]. 
-    menu addItem: (MenuItem new label: 'Empty History'; value: #emptyHistory).
+    menu addItem: (MenuItem new label: 'Empty History'; value: #emptyHistory; activeHelpKey: #historyEmptyMenu).
 
     ^menu
 !
@@ -1057,5 +1062,5 @@
 !ToolApplicationModel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.28 1998-02-02 12:31:00 tz Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.29 1998-02-02 16:04:39 tz Exp $'
 ! !