WindowBuilder.st
changeset 3262 74842f3b79eb
parent 3035 f5bb484a1205
child 3309 6022df917d8d
equal deleted inserted replaced
3261:6edd75bca965 3262:74842f3b79eb
  1415      and specifies if the view should be opened as a
  1415      and specifies if the view should be opened as a
  1416         modal view (blocking interaction to the currently active view),
  1416         modal view (blocking interaction to the currently active view),
  1417         as popUp (also blocking)
  1417         as popUp (also blocking)
  1418         or as a normal view."
  1418         or as a normal view."
  1419 
  1419 
  1420     |appWinClass device wg mainWin x y monitorBounds|
  1420     |appWinClass device wg mainWin x y monitorBounds newOrigin|
  1421 
  1421 
  1422     device := window device.
  1422     device := window device.
  1423 
  1423 
  1424     "/ ********* MULTI SCREEN
  1424     "/ ********* MULTI SCREEN
  1425 
  1425 
  1456             window fixSize
  1456             window fixSize
  1457         ]
  1457         ]
  1458     ].
  1458     ].
  1459 
  1459 
  1460     ((type == #dialog) or:[type == #toolDialog or:[ type == #popUp or:[type == #popUpWithFrame]] ]) ifTrue:[
  1460     ((type == #dialog) or:[type == #toolDialog or:[ type == #popUp or:[type == #popUpWithFrame]] ]) ifTrue:[
  1461         |newOrigin|
       
  1462 
       
  1463         ((origin isNil and:[window class forceModalBoxesToOpenAtCenter])
  1461         ((origin isNil and:[window class forceModalBoxesToOpenAtCenter])
  1464          or:[origin == #center]) ifTrue:[
  1462          or:[origin == #center]) ifTrue:[
  1465             newOrigin := nil.
  1463             newOrigin := nil.
  1466         ] ifFalse:[
  1464         ] ifFalse:[
  1467             origin isPoint ifTrue:[
  1465             origin isPoint ifTrue:[
  1476         newOrigin isNil ifTrue:[
  1474         newOrigin isNil ifTrue:[
  1477             newOrigin := monitorBounds center rounded - (window extent // 2).
  1475             newOrigin := monitorBounds center rounded - (window extent // 2).
  1478         ].
  1476         ].
  1479 
  1477 
  1480         UserPreferences current forceWindowsIntoMonitorBounds ifTrue:[
  1478         UserPreferences current forceWindowsIntoMonitorBounds ifTrue:[
  1481             window corner y > monitorBounds bottom ifTrue:[
  1479             (newOrigin x + window height) > monitorBounds bottom ifTrue:[
  1482                 y := monitorBounds bottom - window height.
  1480                 y := monitorBounds bottom - window height - 20.
       
  1481                 newOrigin := (newOrigin x @ y).
       
  1482             ].
       
  1483             (newOrigin x + window height) > (device usableHeightAt:newOrigin+window extent) ifTrue:[
       
  1484                 y := (device usableHeightAt:newOrigin+window extent) - window height - 20.
  1483                 newOrigin := (newOrigin x @ y).
  1485                 newOrigin := (newOrigin x @ y).
  1484             ].
  1486             ].
  1485         ].
  1487         ].
  1486         window origin:newOrigin.
  1488         window origin:newOrigin.
  1487         type == #toolDialog ifTrue:[
  1489         type == #toolDialog ifTrue:[
  1622 ! !
  1624 ! !
  1623 
  1625 
  1624 !WindowBuilder class methodsFor:'documentation'!
  1626 !WindowBuilder class methodsFor:'documentation'!
  1625 
  1627 
  1626 version
  1628 version
  1627     ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.151 2012-11-27 15:54:14 cg Exp $'
  1629     ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.152 2013-12-10 22:13:24 cg Exp $'
  1628 !
  1630 !
  1629 
  1631 
  1630 version_CVS
  1632 version_CVS
  1631     ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.151 2012-11-27 15:54:14 cg Exp $'
  1633     ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.152 2013-12-10 22:13:24 cg Exp $'
  1632 ! !
  1634 ! !
       
  1635