disable hook & browse menu items, if there is no class yet.
disable align stuff, if there is no selection.
--- a/UIPainter.st Tue Jan 27 21:02:33 1998 +0100
+++ b/UIPainter.st Tue Jan 27 21:29:56 1998 +0100
@@ -714,6 +714,7 @@
#(#MenuItem
#'label:' 'Create Hook Methods'
#'value:' #doInstallHooks
+ #'enabled:' #hasSpecClass
)
#(#MenuItem
#'label:' '-'
@@ -730,6 +731,7 @@
#(#MenuItem
#'label:' 'Browse Aspect Methods'
#'value:' #doBrowseAspectMethods
+ #'enabled:' #hasSpecClass
)
#(#MenuItem
#'label:' '-'
@@ -817,6 +819,8 @@
) nil
nil
)
+
+ "Modified: / 27.1.1998 / 21:25:27 / cg"
!
menuAlign
@@ -841,48 +845,56 @@
#'label:' 'Align Left'
#'value:' #alignSelectionLeft
#'activeHelpKey:' #alignSelectionLeft
+ #'enabled:' #hasSelection
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignL 'Align Left')
)
#(#MenuItem
#'label:' 'Align Right'
#'value:' #alignSelectionRight
#'activeHelpKey:' #alignSelectionRight
+ #'enabled:' #hasSelection
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignR 'Align Right')
)
#(#MenuItem
#'label:' 'Align Left & Right'
#'value:' #alignSelectionLeftAndRight
#'activeHelpKey:' #alignSelectionLeftAndRight
+ #'enabled:' #hasSelection
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignLR 'Align Left & Right')
)
#(#MenuItem
#'label:' 'Align top'
#'value:' #alignSelectionTop
#'activeHelpKey:' #alignSelectionTop
+ #'enabled:' #hasSelection
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignT 'Align top')
)
#(#MenuItem
#'label:' 'Align Bottom'
#'value:' #alignSelectionBottom
#'activeHelpKey:' #alignSelectionBottom
+ #'enabled:' #hasSelection
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignB 'Align Bottom')
)
#(#MenuItem
#'label:' 'Align Top & Bottom'
#'value:' #alignSelectionTopAndBottom
#'activeHelpKey:' #alignSelectionTopAndBottom
+ #'enabled:' #hasSelection
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignTB 'Align Top & Bottom')
)
#(#MenuItem
#'label:' 'Align Centered Horizontal'
#'value:' #alignSelectionCenterHor
#'activeHelpKey:' #alignSelectionCenterHor
+ #'enabled:' #hasSelection
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignCenterH 'Align Centered Horizontal')
)
#(#MenuItem
#'label:' 'Align Centered Vertical'
#'value:' #alignSelectionCenterVer
#'activeHelpKey:' #alignSelectionCenterVer
+ #'enabled:' #hasSelection
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignCenterV 'Align Centered Vertical')
)
#(#MenuItem
@@ -892,11 +904,13 @@
#'label:' 'Spread Horizontal'
#'value:' #spreadSelectionHor
#'activeHelpKey:' #spreadSelectionHor
+ #'enabled:' #hasSelection
)
#(#MenuItem
#'label:' 'Spread Vertical'
#'value:' #spreadSelectionVer
#'activeHelpKey:' #spreadSelectionVer
+ #'enabled:' #hasSelection
)
#(#MenuItem
#'label:' '-'
@@ -905,15 +919,19 @@
#'label:' 'Center Horizontal In Frame'
#'value:' #centerSelectionHor
#'activeHelpKey:' #centerSelectionHor
+ #'enabled:' #hasSelection
)
#(#MenuItem
#'label:' 'Center Vertical In Frame'
#'value:' #centerSelectionVer
#'activeHelpKey:' #centerSelectionVer
+ #'enabled:' #hasSelection
)
) nil
nil
)
+
+ "Modified: / 27.1.1998 / 21:27:33 / cg"
!
menuEdit