ShowMeHowItWorks.st
changeset 3818 c3fd02d2d975
parent 3817 34cfc2fb2258
child 3819 a2f591cb8405
equal deleted inserted replaced
3817:34cfc2fb2258 3818:c3fd02d2d975
   911 
   911 
   912     "Created: / 19-07-2019 / 13:53:05 / Claus Gittinger"
   912     "Created: / 19-07-2019 / 13:53:05 / Claus Gittinger"
   913     "Modified: / 23-07-2019 / 09:38:38 / Claus Gittinger"
   913     "Modified: / 23-07-2019 / 09:38:38 / Claus Gittinger"
   914 !
   914 !
   915 
   915 
       
   916 scrollToEnd
       
   917     <action>
       
   918 
       
   919     |scrollWrapper|
       
   920 
       
   921     "/ look for a scrollable view along the superview hierarchy
       
   922     scrollWrapper := lastComponent 
       
   923         allSuperViewsDetect:[:v | v isScrollWrapper]
       
   924         ifNone:nil.
       
   925 
       
   926     scrollWrapper isNil ifTrue:[
       
   927         "/ look in subviews for the first scrollWrapper
       
   928         scrollWrapper := lastComponent 
       
   929             allSubViewsDetect:[:v | v shown and:[v isScrollWrapper]]
       
   930             ifNone:nil.
       
   931     ].
       
   932     scrollWrapper notNil ifTrue:[
       
   933         scrollWrapper scrollBar scrollToEnd
       
   934     ].
       
   935 !
       
   936 
   916 select:itemsIndexOrLabelOrPattern
   937 select:itemsIndexOrLabelOrPattern
   917     "select an item by label,
   938     "select an item by label,
   918      allowed after moving to:
   939      allowed after moving to:
   919         a ComboBox
   940         a ComboBox
   920         a SelectionInListView
   941         a SelectionInListView
  2374             nextCommand := opStream next.
  2395             nextCommand := opStream next.
  2375             self doCommand:nextCommand.
  2396             self doCommand:nextCommand.
  2376 
  2397 
  2377             Display shiftDown ifTrue:[
  2398             Display shiftDown ifTrue:[
  2378                 (IntroShownCount ? 0) > 3 ifFalse:[
  2399                 (IntroShownCount ? 0) > 3 ifFalse:[
  2379                     self tell:(self possiblyTranslate:'You pressed the SHIFT key.').
  2400                     self tell:(self class classResources string:'You pressed the SHIFT key.').
  2380                 ].    
  2401                 ].    
  2381                 self tell:(self possiblyTranslate:'Do you want to stop the show?').
  2402                 self tell:(self class classResources string:'Do you want to stop the show?').
  2382                 (Dialog confirm:(resources stringWithCRs:'Stop the demonstration?'))
  2403                 (Dialog confirm:(resources stringWithCRs:'Stop the demonstration?'))
  2383                 ifTrue:[
  2404                 ifTrue:[
  2384                     self tell:(self possiblyTranslate:'OK,').
  2405                     self tell:(self possiblyTranslate:'OK,').
  2385                     self tell:(self possiblyTranslate:(self randomThankYou)).
  2406                     self tell:(self class classResources string:(self randomThankYou)).
  2386                     ^ AbortOperationRequest raise
  2407                     ^ AbortOperationRequest raise
  2387                 ].    
  2408                 ].    
  2388             ].    
  2409             ].    
  2389         ].    
  2410         ].    
  2390     ] ensure:[
  2411     ] ensure:[
  2423     "Created: / 19-07-2019 / 10:52:24 / Claus Gittinger"
  2444     "Created: / 19-07-2019 / 10:52:24 / Claus Gittinger"
  2424     "Modified: / 23-07-2019 / 11:48:45 / Claus Gittinger"
  2445     "Modified: / 23-07-2019 / 11:48:45 / Claus Gittinger"
  2425 !
  2446 !
  2426 
  2447 
  2427 possiblyTranslate:aString
  2448 possiblyTranslate:aString
  2428     translate ifTrue:[^ self class classResources string:aString].
  2449     |xLatedMessage|
       
  2450 
       
  2451     translate ifTrue:[
       
  2452         xLatedMessage := self class classResources stringWithCRs:aString.
       
  2453         ^ xLatedMessage
       
  2454     ].
  2429     ^ aString
  2455     ^ aString
  2430 
       
  2431     "Created: / 23-07-2019 / 11:48:17 / Claus Gittinger"
       
  2432 ! !
  2456 ! !
  2433 
  2457 
  2434 !ShowMeHowItWorks::ItemInView class methodsFor:'documentation'!
  2458 !ShowMeHowItWorks::ItemInView class methodsFor:'documentation'!
  2435 
  2459 
  2436 documentation
  2460 documentation