3313 ! |
3315 ! |
3314 |
3316 |
3315 fetchDeviceResources |
3317 fetchDeviceResources |
3316 "fetch device colors, to avoid reallocation at redraw time" |
3318 "fetch device colors, to avoid reallocation at redraw time" |
3317 |
3319 |
3318 |bw lvl| |
|
3319 |
|
3320 super fetchDeviceResources. |
3320 super fetchDeviceResources. |
3321 |
3321 |
3322 "/ thats a kludge - will be replaced by values from the styleSheet ... |
3322 "/ thats a kludge - will be replaced by values from the styleSheet ... |
3323 "/ (i.e. read menu.buttonActiveLevel & menu.buttonPassiveLevel) |
3323 "/ (i.e. read menu.buttonActiveLevel & menu.buttonPassiveLevel) |
3324 |
3324 |
3325 onLevel := styleSheet at:#'menu.hilightLevel' default:0. |
3325 onLevel := styleSheet at:#'menu.hilightLevel' default:0. |
3326 |
|
3327 self isPopUpView ifTrue:[ |
|
3328 bw := styleSheet at:#'popup.borderWidth' default:1. |
|
3329 lvl := styleSheet at:#'popup.level' default:0. |
|
3330 ] ifFalse:[ |
|
3331 bw := styleSheet is3D ifFalse:[1] ifTrue:[0]. |
|
3332 ]. |
|
3333 self borderWidth:bw. |
|
3334 self level:lvl. |
|
3335 |
3326 |
3336 superMenu isNil ifTrue:[ |
3327 superMenu isNil ifTrue:[ |
3337 fgColor := DefaultForegroundColor onDevice:device. |
3328 fgColor := DefaultForegroundColor onDevice:device. |
3338 activeBgColor := DefaultHilightBackgroundColor onDevice:device. |
3329 activeBgColor := DefaultHilightBackgroundColor onDevice:device. |
3339 activeFgColor := DefaultHilightForegroundColor onDevice:device. |
3330 activeFgColor := DefaultHilightForegroundColor onDevice:device. |
3389 itemSpace := DefaultItemSpace. |
3380 itemSpace := DefaultItemSpace. |
3390 groupDividerSize := DefaultGroupDividerSize. |
3381 groupDividerSize := DefaultGroupDividerSize. |
3391 fitFirstPanel := false. |
3382 fitFirstPanel := false. |
3392 font := MenuView defaultFont onDevice:device. |
3383 font := MenuView defaultFont onDevice:device. |
3393 |
3384 |
3394 super level:(styleSheet is3D ifTrue:[1] ifFalse:[0]). |
3385 self updateLevelAndBorder. |
3395 ! |
3386 ! |
3396 |
3387 |
3397 initialize |
3388 initialize |
3398 "set default configuration |
3389 "set default configuration |
3399 " |
3390 " |
3508 "/ self doUngrab:(superMenu isNil) |
3500 "/ self doUngrab:(superMenu isNil) |
3509 "/ ]. |
3501 "/ ]. |
3510 |
3502 |
3511 super unmap. |
3503 super unmap. |
3512 shadowView notNil ifTrue:[shadowView unmap]. |
3504 shadowView notNil ifTrue:[shadowView unmap]. |
|
3505 ! |
|
3506 |
|
3507 updateLevelAndBorder |
|
3508 "update level & border, when it is known if I am a popUpView" |
|
3509 |
|
3510 |bw lvl| |
|
3511 |
|
3512 self isPopUpView ifTrue:[ |
|
3513 bw := styleSheet at:#'popup.borderWidth' default:1. |
|
3514 lvl := styleSheet at:#'popup.level' default:0. |
|
3515 ] ifFalse:[ |
|
3516 bw := styleSheet is3D ifFalse:[1] ifTrue:[0]. |
|
3517 ]. |
|
3518 self borderWidth:bw. |
|
3519 self level:lvl. |
3513 ! ! |
3520 ! ! |
3514 |
3521 |
3515 !MenuPanel methodsFor:'keyboard control'! |
3522 !MenuPanel methodsFor:'keyboard control'! |
3516 |
3523 |
3517 mnemonicViewNext:aKeyEvent |
3524 mnemonicViewNext:aKeyEvent |
3988 |
3995 |
3989 ! ! |
3996 ! ! |
3990 |
3997 |
3991 !MenuPanel methodsFor:'queries'! |
3998 !MenuPanel methodsFor:'queries'! |
3992 |
3999 |
|
4000 container:aView |
|
4001 super container:aView. |
|
4002 aView notNil ifTrue:[ |
|
4003 "/ I am no longer a popUpView |
|
4004 self updateLevelAndBorder |
|
4005 ]. |
|
4006 ! |
|
4007 |
3993 containsPoint:aPoint |
4008 containsPoint:aPoint |
3994 "returns true if point is contained by the view |
4009 "returns true if point is contained by the view |
3995 " |
4010 " |
3996 ^ self containsPointX:(aPoint x) y:(aPoint y) |
4011 ^ self containsPointX:(aPoint x) y:(aPoint y) |
3997 ! |
4012 ! |
4120 |
4135 |
4121 ActiveHelp isActive ifTrue:[ |
4136 ActiveHelp isActive ifTrue:[ |
4122 hlp := ActiveHelp currentHelpListener. |
4137 hlp := ActiveHelp currentHelpListener. |
4123 hlp initiateHelpFor:self atX:nil y:nil now:true. |
4138 hlp initiateHelpFor:self atX:nil y:nil now:true. |
4124 ]. |
4139 ]. |
4125 realized ifTrue:[self rearrangeItems]. |
4140 shown "realized" ifTrue:[self rearrangeItems]. |
4126 selection selected:true. |
4141 selection selected:true. |
4127 ]. |
4142 ]. |
4128 ! |
4143 ! |
4129 |
4144 |
4130 selectionIndex |
4145 selectionIndex |