#FEATURE by cg
class: SystemStatusMonitor
added: #menuChangeUpdateInterval
class: SystemStatusMonitor class
added:
#fileMenu
#viewMenu
changed: #mainMenu
--- a/SystemStatusMonitor.st Mon Oct 29 15:15:55 2018 +0100
+++ b/SystemStatusMonitor.st Mon Oct 29 15:21:03 2018 +0100
@@ -63,6 +63,34 @@
!SystemStatusMonitor class methodsFor:'menu specs'!
+fileMenu
+ "This resource specification was automatically generated
+ by the MenuEditor of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the MenuEditor may not be able to read the specification."
+
+
+ "
+ MenuEditor new openOnClass:SystemStatusMonitor andSelector:#fileMenu
+ (Menu new fromLiteralArrayEncoding:(SystemStatusMonitor fileMenu)) startUp
+ "
+
+ <resource: #menu>
+
+ ^
+ #(Menu
+ (
+ (MenuItem
+ label: 'Exit'
+ itemValue: closeRequestToTopView
+ )
+ )
+ nil
+ nil
+ )
+!
+
mainMenu
"This resource specification was automatically generated
by the MenuEditor of ST/X."
@@ -83,17 +111,39 @@
(
(MenuItem
label: 'File'
- submenu:
- (Menu
- (
- (MenuItem
- label: 'Exit'
- itemValue: closeRequestToTopView
- )
- )
- nil
- nil
- )
+ submenuChannel: fileMenu
+ )
+ (MenuItem
+ label: 'View'
+ submenuChannel: viewMenu
+ )
+ )
+ nil
+ nil
+ )
+!
+
+viewMenu
+ "This resource specification was automatically generated
+ by the MenuEditor of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the MenuEditor may not be able to read the specification."
+
+
+ "
+ MenuEditor new openOnClass:SystemStatusMonitor andSelector:#viewMenu
+ (Menu new fromLiteralArrayEncoding:(SystemStatusMonitor viewMenu)) startUp
+ "
+
+ <resource: #menu>
+
+ ^
+ #(Menu
+ (
+ (MenuItem
+ label: 'Update Interval...'
+ itemValue: menuChangeUpdateInterval
)
)
nil
@@ -329,6 +379,16 @@
self topView closeRequest
!
+menuChangeUpdateInterval
+ |newInterval|
+
+ newInterval := Dialog request:'Update interval (seconds):' initialAnswer:updateDelay printString.
+ newInterval isEmptyOrNil ifTrue:[^ self].
+ updateDelay := Number readFrom:newInterval onError:[updateDelay].
+
+ "Created: / 29-10-2018 / 15:20:47 / Claus Gittinger"
+!
+
selectionIndicesDo:aBlock
"evaluate aBlock on all selected indices"