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)
Core
XUL
Tracking
()
VERIFIED
FIXED
mozilla0.9
People
(Reporter: janv, Assigned: dr)
Details
Attachments
(2 files)
|
7.13 KB,
patch
|
Details | Diff | Splinter Review | |
|
2.50 KB,
patch
|
Details | Diff | Splinter Review |
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
| Reporter | ||
Comment 1•25 years ago
|
||
| Reporter | ||
Comment 2•25 years ago
|
||
.
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
Comment 3•25 years ago
|
||
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?
Comment 4•25 years ago
|
||
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
Comment 5•25 years ago
|
||
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'.
| Reporter | ||
Comment 7•25 years ago
|
||
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 ?
Comment 8•25 years ago
|
||
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?
Comment 9•25 years ago
|
||
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.)
Comment 10•25 years ago
|
||
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.
| Reporter | ||
Comment 11•25 years ago
|
||
Right, GetFirstMenuItem and GetLastMenuItem method is needless.
Nice!
So how to determine searching for accesskey attribute or first letter in value
attribute ?
Comment 12•25 years ago
|
||
Shouldn't it always be done? What are the different widgets that this applies to?
| Reporter | ||
Comment 13•25 years ago
|
||
Comment 14•25 years ago
|
||
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?
| Reporter | ||
Comment 15•25 years ago
|
||
ok we can change item to nextItem back.
Filed new bug 67952 (Support for accessing menuitems with first letter)
Comment 16•25 years ago
|
||
so if we use nextItem, can someone r= this, or is there more work to do?
Keywords: mozilla0.9
Comment 17•25 years ago
|
||
looks ok to me, though the nsMenuPopupFrame.h diff is just spacing. no need to
check that part in.
r=pink.
Comment 18•25 years ago
|
||
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.
| Assignee | ||
Comment 19•25 years ago
|
||
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
Comment 20•25 years ago
|
||
sr=hyatt
| Reporter | ||
Comment 21•25 years ago
|
||
Sorry, but I'm very busy now. Check it in for me.
Thanks
| Assignee | ||
Comment 22•25 years ago
|
||
No problem. You have r= and sr=, and I'll check in (with Dean's changes) as soon
as the tree opens.
| Assignee | ||
Comment 23•25 years ago
|
||
checked in: nsMenuListener rev 1.10, nsMenuPopupFrame rev 1.117.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 24•25 years ago
|
||
checked in: nsMenuListener rev 1.10, nsMenuPopupFrame rev 1.118.
| Assignee | ||
Comment 25•25 years ago
|
||
ah! self-collision wierdness. uh, it's in.
Comment 26•25 years ago
|
||
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 → ---
| Assignee | ||
Comment 27•25 years ago
|
||
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.
Comment 28•25 years ago
|
||
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?
| Assignee | ||
Comment 29•25 years ago
|
||
Dean: bug 67952.
Comment 30•25 years ago
|
||
I'm an idiot. Not only that, but I can't read.
| Assignee | ||
Comment 31•25 years ago
|
||
woohoo, the tree opened. cvs rev 1.119.
Status: REOPENED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
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.
Description
•