[ENH] DepthMenu
Bert Freudenberg
bert at isgnw.CS.Uni-Magdeburg.De
Mon Sep 27 08:12:51 UTC 1999
Changes the 'set display depth...' menu to only offer supported display
depths. Requires my MiscFixes change set posted earlier.
/bert
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="DepthMenu-bf.22Sep334pm.cs"
Content-ID: <Pine.LNX.3.96.990927100243.31728C at balloon.cs.uni-magdeburg.de>
Content-Description:
'From Squeak 2.5 of August 6, 1999 on 22 September 1999 at 3:34:15 pm'!
"Change Set: depthmenu-bf
Date: 18 September 1999
Author: Bert Freudenberg
Changes the 'set display depth...' menu to only offer supported display depths."!
!DisplayScreen methodsFor: 'other' stamp: 'bf 9/18/1999 19:46'!
supportedDisplayDepths
"Return all pixel depths supported on the current host platform."
^#(1 2 4 8 16 32) select: [:d | self supportsDisplayDepth: d]! !
!HandMorph methodsFor: 'world menu commands' stamp: 'bf 9/18/1999 20:02'!
setDisplayDepth
"Let the user choose a new depth for the display. "
| result oldDepth |
oldDepth _ Display depth.
(result _ (SelectionMenu selections: Display supportedDisplayDepths) startUpWithCaption: 'Choose a display depth
(it is currently ' , oldDepth printString , ')') == nil ifFalse:
[Display newDepth: result].
(World isMorph and: [(Display depth < 4) ~= (oldDepth < 4)]) ifTrue:
["Repaint windows since they look better all white in depth < 4"
(SystemWindow windowsIn: World satisfying: [:w | true]) do:
[:w | w updatePaneColors]]! !
!ScreenController methodsFor: 'menu messages' stamp: 'bf 9/18/1999 20:01'!
setDisplayDepth
"Let the user choose a new depth for the display. "
| result |
(result _ (SelectionMenu selections: Display supportedDisplayDepths) startUpWithCaption: 'Choose a display depth
(it is currently ' , Display depth printString , ')') == nil ifFalse:
[Display newDepth: result]! !
More information about the Squeak-dev
mailing list
|