Closed Bug 67731 Opened 25 years ago Closed 25 years ago

Popups should be scrollable also with HOME, END, PAGE DOWN, PAGE UP key

Categories

(Core :: XUL, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9

People

(Reporter: janv, Assigned: dr)

Details

Attachments

(2 files)

Some indications you can find in last comments of bug 43728. I have initial patch for this, which supports scrolling with HOME and END key Patch also contains my little extension to menus. <menupopup search="true"> <menuitem value="Black"/> <menuitem value="Red"/> </menupopup> when you hit "r" red menuitem is selected, but not entered This is usefull for some situations, especially for menulists, I think Something like <menuitem value="Black" accesskey="b"/> but without defining accesskey for each menuitem, first letter is automatically considered as key
Attached patch initial patch — — Splinter Review
.
Summary: Menus should be scrollable also with HOME, END, PAGE DOWN, PAGE UP key → Popups should be scrollable also with HOME, END, PAGE DOWN, PAGE UP key
This is cool; why the change from menus to popups, though? Comments from a cursory look at the patch: Is it me, or can immediateParent leak? + nsCOMPtr<nsIMenuFrame> menuFrame = do_QueryInterface(frame); Implicit assignment is preferred, e.g. + nsCOMPtr<nsIMenuFrame> menuFrame (do_QueryInterface(frame)); pink/hyatt, what do you think of this patch, and the search attribute idea?
Blake: frames are not reference-counted. Yes, the typename (nsIFrame) lies. There could be a bug asking Gecko owners to rename them to nsCFrame or some such, but it's not likely to get fixed soon (it may even be likelier that the lie will become the truth, and nsIFrame instances will be ref-counted -- some day not much sooner). This is pretty well known, and a fact of life. FYI, and I hope I haven't misspoken . /be
what is the "search" popup, and why is it hardcoded in the popupframe?
I like the using of the first letter as an access key if one is not explicitly defined, but how you describe it is not how things behave, at least in the Windows world. In Windows, if I have a menu with: Red Black pressing 'B' will select and execute the Black menu item. But if I have a menu with: Red Black Blue Beige pressing 'B' repeatedly will cycle through all items starting with a 'B'.
Thanks for all comments. blake: nsCOMPtr<nsIMenuFrame> menuFrame = do_QueryInterface(frame) - this was just cut 'n paste from already implemented method, sorry pink: Do you mean, make "search" attribute XUL atom ? dean: good idea Does anybody know how to get last child of frame in better way as it is in patch ?
no, i mean "what is the 'search' attribute, and why is it in the code?!?" What is a search popup? Why are we looking for a 'search' attribute?
I don't understand why you have a full-blown implementation of GetFirstMenuItem and GetLastMenuItem. GetFirstMenuItem is just GetNextMenuItem(nsnull, etc.) and GetLastMenuItem is just GetPrevMenuItem(nsnull, etc.)
I also dislike the "search" attribute. We should figure out when this behavior is supposed to be used and build in in to the widgets without the need for an attribute.
Right, GetFirstMenuItem and GetLastMenuItem method is needless. Nice! So how to determine searching for accesskey attribute or first letter in value attribute ?
Shouldn't it always be done? What are the different widgets that this applies to?
Hey, that was pretty easy. Although the change from "nextItem" to "item" probably isn't necessary. The script uses "nextItem" in a few other places, even when it's doing GetNextMenuItem(nsnull, ...). Are you going to take that access key thing in a separate bug?
ok we can change item to nextItem back. Filed new bug 67952 (Support for accessing menuitems with first letter)
so if we use nextItem, can someone r= this, or is there more work to do?
Keywords: mozilla0.9
looks ok to me, though the nsMenuPopupFrame.h diff is just spacing. no need to check that part in. r=pink.
If I wanted to be picky (that'd be a surprise!), I'd request changing the comment in nsMenuListener.cpp that reads "The arrow keys were pressed", since it's now more than just arrow keys.
i'll get this in with dean's requested changes (jan, it looks like you're not still working on this -- correct me if i'm wrong).
Assignee: varga → dr
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9
sr=hyatt
Sorry, but I'm very busy now. Check it in for me. Thanks
No problem. You have r= and sr=, and I'll check in (with Dean's changes) as soon as the tree opens.
checked in: nsMenuListener rev 1.10, nsMenuPopupFrame rev 1.117.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
checked in: nsMenuListener rev 1.10, nsMenuPopupFrame rev 1.118.
ah! self-collision wierdness. uh, it's in.
Something slightly amiss here. Home works fine, but End just scrolls up by one menu item each time. Hmmmm.... Oh. Code's wrong. Check out http://lxr.mozilla.org/seamonkey/source/layout/xul/base/src/nsMenuPopupFrame.cpp #1194 "mCurrentMenu" should be "nsnull". I'm going to re-open this till that gets changed.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Oops, my mistake. The funny thing is that it seemed to work for me -- hit home and then end over and over, and it appears to work because "end" just scrolls up one position :) I'll check in asap.
Jan, when you trimmed this down to be only for home and end keys, did you file a different bug containing your work on using the first letter as an access key if one is not defined?
Dean: bug 67952.
I'm an idiot. Not only that, but I can't read.
woohoo, the tree opened. cvs rev 1.119.
Status: REOPENED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Much better. Verifying on 2001032804, Win2000.
Status: RESOLVED → VERIFIED
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: