ToolApplicationModel.st
changeset 984 a0a868c45691
parent 982 807f440e0df7
child 987 54c15a2642f6
equal deleted inserted replaced
983:1a91a129a8cc 984:a0a868c45691
  1075     "returns the default info label; here an empty string"
  1075     "returns the default info label; here an empty string"
  1076 
  1076 
  1077     ^''
  1077     ^''
  1078 !
  1078 !
  1079 
  1079 
       
  1080 doShowHelp:aHelpText
       
  1081     "displays aHelpText in the info label or if present detours it to its masterApplication"
       
  1082 
       
  1083     aHelpText isNil 
       
  1084         ifTrue:  [self updateInfoLabel] 
       
  1085         ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString readStream through: $.)].
       
  1086 
       
  1087     "Created: / 20.6.1998 / 16:37:23 / cg"
       
  1088 !
       
  1089 
  1080 openAbout
  1090 openAbout
  1081     "opens an about box"
  1091     "opens an about box"
  1082 
  1092 
  1083     |box|
  1093     |box|
  1084 
  1094 
  1137         ifTrue: [ActiveHelp startFor: self]
  1147         ifTrue: [ActiveHelp startFor: self]
  1138         ifFalse: [ActiveHelp stopFor: self. self updateInfoLabel]
  1148         ifFalse: [ActiveHelp stopFor: self. self updateInfoLabel]
  1139 !
  1149 !
  1140 
  1150 
  1141 showHelp:aHelpText for:view
  1151 showHelp:aHelpText for:view
  1142     "displays aHelpText in the info label or if present detours it to its masterApplication"
  1152     "displays aHelpText in the info label or if present detours it to its masterApplication.
       
  1153      Here, an event is pushed for myself to synchronize the helpDisplay
       
  1154      with event handling."
       
  1155 
       
  1156     |wg mySensor|
  1143 
  1157 
  1144     self showHelp ifFalse: [^true].
  1158     self showHelp ifFalse: [^true].
  1145     masterApplication notNil ifTrue: [masterApplication showHelp: aHelpText for:view].
  1159     masterApplication notNil ifTrue: [masterApplication showHelp: aHelpText for:view].
  1146     aHelpText isNil 
  1160 
  1147         ifTrue:  [self updateInfoLabel] 
  1161 "/ OLD: show it right here ...
  1148         ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString readStream through: $.)].
  1162 "/    aHelpText isNil 
       
  1163 "/        ifTrue:  [self updateInfoLabel] 
       
  1164 "/        ifFalse: [self valueOfInfoLabel value: (aHelpText asString printString readStream through: $.)].
       
  1165     "/ the nil-tests should not be req'd - but thats a last-minute
       
  1166     "/ change and I dont want to breaks the delivery ...
       
  1167 
       
  1168 "/ NEW: push it into the event queue, to have it displayed
       
  1169 "/ syncronously with other events.
       
  1170 "/ (also any errors are reported as occurring in my context;
       
  1171 "/  instead of occurring in the activeHelp context).
       
  1172 
       
  1173     (wg := self windowGroup) notNil ifTrue:[
       
  1174         mySensor := wg sensor.
       
  1175         mySensor notNil ifTrue:[
       
  1176             mySensor flushEventsFor:self withType:#doShowHelp:.
       
  1177             mySensor pushUserEvent:#doShowHelp: for:self withArguments:(Array with:aHelpText).
       
  1178         ].
       
  1179     ].
       
  1180 
  1149     ^true
  1181     ^true
       
  1182 
       
  1183     "Modified: / 20.6.1998 / 16:47:37 / cg"
  1150 !
  1184 !
  1151 
  1185 
  1152 updateInfoLabel
  1186 updateInfoLabel
  1153     "updates the info label at the bottom"
  1187     "updates the info label at the bottom"
  1154 
  1188 
  1421 ! !
  1455 ! !
  1422 
  1456 
  1423 !ToolApplicationModel class methodsFor:'documentation'!
  1457 !ToolApplicationModel class methodsFor:'documentation'!
  1424 
  1458 
  1425 version
  1459 version
  1426     ^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.60 1998-06-20 12:51:54 cg Exp $'
  1460     ^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.61 1998-06-20 14:48:01 cg Exp $'
  1427 ! !
  1461 ! !