On Monday 08 October 2007 1:57 am, karl wrote:
Yet another fix to the fix :-) Karl
Thanks, Karl. The submenu stays put when pinned now. Just a small observation - when the submenu is pinned, the main menu stays up and gets deleted only when the first menu item in the submenu is picked. Shouldn't it be deleted when the submenu gets pinned?
Apologies for the delayed response. I was on vacation.
Subbu
The fix with your suggestion added
Karl
subbukk wrote:
On Monday 08 October 2007 1:57 am, karl wrote:
Yet another fix to the fix :-) Karl
Thanks, Karl. The submenu stays put when pinned now. Just a small observation - when the submenu is pinned, the main menu stays up and gets deleted only when the first menu item in the submenu is picked. Shouldn't it be deleted when the submenu gets pinned?
Apologies for the delayed response. I was on vacation.
Subbu _______________________________________________ Etoys mailing list Etoys@lists.laptop.org http://lists.laptop.org/listinfo/etoys
'From etoys2.2 of 22 September 2007 [latest update: #1699] on 13 October 2007 at 1:52:08 pm'! "Change Set: MenuMorph Date: 13 October 2007 Author: Karl Ramberg
Fixes issues with deletion of menus and submenus with 'StayUp' items"!
!MenuMorph methodsFor: 'accessing' stamp: 'kfr 10/13/2007 13:48'! stayUp: aBoolean stayUp := aBoolean. aBoolean ifTrue: [self removeStayUpBox. (self rootMenu ~= self and: [self rootMenu stayUp = false]) ifTrue: [self rootMenu delete]]! !
!MenuMorph methodsFor: 'control' stamp: 'kfr 10/7/2007 22:21'! activeSubmenu: aSubmenu activeSubMenu ifNotNil:[activeSubMenu stayUp ifFalse:[activeSubMenu delete]]. activeSubMenu _ aSubmenu.! !
!MenuMorph methodsFor: 'initialization' stamp: 'kfr 10/7/2007 22:24'! delete "Delete the receiver."
activeSubMenu ifNotNil: [activeSubMenu stayUp ifFalse:[activeSubMenu delete]]. self isFlexed ifTrue: [^ owner delete]. ^ super delete! !
On Saturday 13 October 2007 5:24 pm, Karl wrote:
The fix with your suggestion added
That was quick! The pinning works as expected now. Thanks.
1. The activeSubMenu and delete diffs come out squished in a single line (due to the usage of \n (0x0a) instead of \r as a line terminator). 2. The stayUp fix refers to rootMenu. If menus are nested more than two levels, then won't a parent Menu be different from rootMenu? A simpler way would be to use a guarded delete method like: dismiss self parentMenu ifNotNil: [ self parentMenu dismiss]. stayUp ifFalse: [ self delete ].
parentMenu: popUpOwner ifNil: [ ^nil ]. ^popUpOwner owner.
Now we can safely dismiss any menu without having to peek into their stayUp status. This could benefit submenus like layout (whose submenus should be made pinnable).
Subbu
subbukk wrote:
On Saturday 13 October 2007 5:24 pm, Karl wrote:
The fix with your suggestion added
That was quick! The pinning works as expected now. Thanks.
- The activeSubMenu and delete diffs come out squished in a single line (due
to the usage of \n (0x0a) instead of \r as a line terminator). 2. The stayUp fix refers to rootMenu. If menus are nested more than two levels, then won't a parent Menu be different from rootMenu? A simpler way would be to use a guarded delete method like: dismiss self parentMenu ifNotNil: [ self parentMenu dismiss]. stayUp ifFalse: [ self delete ].
parentMenu: popUpOwner ifNil: [ ^nil ]. ^popUpOwner owner.
Now we can safely dismiss any menu without having to peek into their stayUp status. This could benefit submenus like layout (whose submenus should be made pinnable).
But if I have a menu selected to be 'stay up' I don't want it deleted if I make a submenu 'stay up' as well. If I delete the rootmenu all submenus that do not have 'stay up' will be deleted.
I'm not sure what cause the line ending issue. I should pass changesets gzipped.
Karl
On Saturday 13 October 2007 7:48 pm, karl wrote:
But if I have a menu selected to be 'stay up' I don't want it deleted if I make a submenu 'stay up' as well.
It won't. dismiss will not affect stayUp menus.
If I delete the rootmenu all submenus that do not have 'stay up' will be deleted.
Popups should be dismissed, not deleted when an item is selected or the popup is canceled. This is equivalent to a delete unless stayUp is true. Then the dismiss is a no-op. A close operation is required to delete it.
I'm not sure what cause the line ending issue. I should pass changesets gzipped.
Did you try cut-n-paste from a Linux text editor into Squeak text box?
Subbu
subbukk wrote:
On Saturday 13 October 2007 7:48 pm, karl wrote:
But if I have a menu selected to be 'stay up' I don't want it deleted if I make a submenu 'stay up' as well.
It won't. dismiss will not affect stayUp menus.
Oh, I'm sorry. I did not read your suggestion carefully enough. I agree with you that 'dismiss' would work better and it's nicer programming :-)
If I delete the rootmenu all submenus that do not have 'stay up' will be deleted.
Popups should be dismissed, not deleted when an item is selected or the popup is canceled. This is equivalent to a delete unless stayUp is true. Then the dismiss is a no-op. A close operation is required to delete it.
Yup.
I'm not sure what cause the line ending issue. I should pass changesets gzipped.
Did you try cut-n-paste from a Linux text editor into Squeak text box?
No, it's a fileout from Squeak, but probably mangled by a e-mail program or some other part of the chain. Karl
etoys-dev@lists.squeakfoundation.org