ApplicationModel.st
changeset 1565 ea35a676f0b1
parent 1556 388922a9c6eb
child 1570 5ef90b35b7d6
equal deleted inserted replaced
1564:7647fb7ddd61 1565:ea35a676f0b1
  2325         "/ a supersend;
  2325         "/ a supersend;
  2326         "/ VW does it by returning false from requestForWindowClose
  2326         "/ VW does it by returning false from requestForWindowClose
  2327         "/ sigh.
  2327         "/ sigh.
  2328 
  2328 
  2329         self requestForWindowClose ifTrue:[
  2329         self requestForWindowClose ifTrue:[
  2330             self closeDownViews
  2330             window isSlave ifTrue:[
       
  2331                 window destroy
       
  2332             ] ifFalse:[
       
  2333                 self closeDownViews
       
  2334             ]
  2331         ]
  2335         ]
  2332     ].
  2336     ].
  2333 
  2337 
  2334     "Modified: / 19.6.1998 / 01:37:17 / cg"
  2338     "Modified: / 19.6.1998 / 01:37:17 / cg"
  2335 !
  2339 !
  2340      this is forwarded here to a simple (non topView-specific) closeRequest,
  2344      this is forwarded here to a simple (non topView-specific) closeRequest,
  2341      effectively closing all of my views.
  2345      effectively closing all of my views.
  2342      MultiView applications should redefine this method if closing of individual
  2346      MultiView applications should redefine this method if closing of individual
  2343      views closing is to be caught and/or should not close all of them."
  2347      views closing is to be caught and/or should not close all of them."
  2344 
  2348 
  2345     |sav|
  2349     |sav myWindow|
       
  2350 
       
  2351     myWindow := self window.
  2346 
  2352 
  2347     "/ In multiView apps, tell my master.
  2353     "/ In multiView apps, tell my master.
  2348     "/ (but not if I am a modal reincarnation)
  2354     "/ (but not if I am a modal reincarnation)
  2349     (masterApplication notNil 
  2355     (masterApplication notNil 
  2350     and:[self window topView isModal not]) ifTrue:[
  2356     and:[myWindow topView isModal not]) ifTrue:[
  2351 
  2357 
  2352         "/ temporary clear my masterApplication to prevent
  2358         "/ temporary clear my masterApplication to prevent
  2353         "/ endless recursion, in case the master sends me
  2359         "/ endless recursion, in case the master sends me
  2354         "/ a closeRequest (although, it is supposed to
  2360         "/ a closeRequest (although, it is supposed to
  2355         "/ send me a closeDownViews ...)
  2361         "/ send me a closeDownViews ...)
  2356 
  2362 
  2357         sav := masterApplication.
  2363         sav := masterApplication.
  2358         masterApplication := nil.
  2364         masterApplication := nil.
  2359         sav closeRequestFor:(self window).
  2365         aTopView isSlave ifTrue:[
       
  2366             sav closeRequestFor:aTopView.
       
  2367         ] ifFalse:[
       
  2368             sav closeRequestFor:myWindow.
       
  2369         ].
  2360 
  2370 
  2361         "/ restore - in case master did not want me to close ...
  2371         "/ restore - in case master did not want me to close ...
  2362         masterApplication := sav.
  2372         masterApplication := sav.
  2363     ] ifFalse:[
  2373     ] ifFalse:[
  2364         self closeRequest
  2374         ((aTopView == myWindow) or:[aTopView isSlave not]) ifTrue:[
       
  2375             self closeRequest
       
  2376         ] ifFalse:[
       
  2377             aTopView application closeRequest.
       
  2378         ]
  2365     ]
  2379     ]
  2366 !
  2380 !
  2367 
  2381 
  2368 doAccept
  2382 doAccept
  2369     "this is invoked by the Return-Key (if returnIsOK) or
  2383     "this is invoked by the Return-Key (if returnIsOK) or
  2589 ! !
  2603 ! !
  2590 
  2604 
  2591 !ApplicationModel class methodsFor:'documentation'!
  2605 !ApplicationModel class methodsFor:'documentation'!
  2592 
  2606 
  2593 version
  2607 version
  2594     ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.166 2002-02-25 20:06:00 cg Exp $'
  2608     ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.167 2002-05-03 18:05:22 cg Exp $'
  2595 ! !
  2609 ! !
  2596 ApplicationModel initialize!
  2610 ApplicationModel initialize!