Closed Bug 90314 Opened 23 years ago Closed 23 years ago

Create <spinbuttons/> widget

Categories

(Core :: XUL, defect)

x86
Other
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.3

People

(Reporter: hwaara, Assigned: hwaara)

References

()

Details

(Whiteboard: approved for 0.9.3)

Attachments

(9 files)

In order for bug 90289 to get fixed, we need a <sprinbuttons/> widget (so we can be 4xp). A spinbutton is a simple widget, that exists on all operating systems I know of. It's two arrows - one pointing up and one down. [A] [V] My idea is this: if you click the up arrow, an onUp() event is fired. If down, the onDown() event is triggered.
Trying to fix this, but still reading up on XBL.
I want to be the r or sr on this bug when you have a patch ready.
Blocks: 90289
I will give the choice to have this either horizontally or vertically: [<][>] OR [A] [V] Currently, I will use the down/up arrows from scrollbars the themes. However, I would appreciate if the theme owners could make arrows for their themes that would look better (if this solution proves to look bad). Hewitt, Marlon and Andreww? Reassign to myself
Assignee: trudelle → hwaara
i suggest using a regular widget button with a black arrow centered. i believe these arrows exist in back and forward buttons for various dialogs
Ok, here is the first draft of the implementation. I used a simple XUL testcase with just <window><spinbuttons/></window> in it to try it. The console prints that it rendered successfully, not sure why it not visible though. For now, I will use the scrollbar's arrows but I hope to have something better in modern3 later. I'm no good with photoshop... Please take a look at the patch.
seems like you aught to msg marlon about getting new widget icons for them.
Would be great if someone could look at the patch and tell me why it's not displaying. :)
Yahoo, got it partly working now. Now to struggle with events and inheritance...
With some blood, sweat, hacking and help from the npm.xml people I am making good progress on this one.
Status: NEW → ASSIGNED
I apologize for being behind on my bugmail, but ... I can't think of a single case where you'd ever need orient="horizontal".
oh! i know, let's design our entire toolkit around what MPT can or cannot come up with in his brain ;)
Attached image message header navigation idea#1 (deleted) —
Marlong: Good idea. However, I believe that's another widget. I removed support for orient (this made stuff a lot more simple). I may reimplement it some day if anyone needs it then. I am 90% done with this patch... there's still one problem: I still need theme images for this widget. It's simple: two buttons with arrows on them. I tried with the arrows we already had -- it didn't look good. Marlon, is it possible you could make up something quick (just uparrow-button, downarrow-button and both depressed) for modern?
Attached image arrows.png - cut these up for arrows (deleted) —
please use a widget button, and place these arrows inside for normal and active states
Thanks Marlon! I will try and make something useful out of it.
Marlon, you don't mean that I should use *one* button though? Since it's up and down... (just making sure.)
no i just meant you could cut them out and use them how you need.
Ok, I composed modern3 buttons for this by hand in photoshop (a real PITA -- took 3 hours!). I had to take the button parts and put it together by hand to make it as small as possible. Anyway, got it working nicely now. Do I really have go through this pain for Classic too or is there a shortcut?
Yay! The images for all themes (win classic and mac classic uses the same) are done and the xbl is done! The events' names are: onup() and ondown() (since there is only a vertical orient anyway now.) The syntax is easy: <spinbuttons ondown="decreaseSomeValue()"/> Coming up: screenshot of classic and modern <spinbuttons/>, and patch for review.
Attached image Screenshot of the current UI. (deleted) —
I need permission from hewitt, I suppose, to create the directory "spinbuttons" in themes/modern/global in CVS. In that dir resides all the modern images for <spinbuttons/>. Because I couldn't add the dir (w/o permission), I decided to not include images in my patch. Hewitt?
Little nits: spinbtn-up-act.gif should be spinbutton-up-active.gif (same for the rest of the images) Either way, r=aegis Of course, take my r= with a grain of salt, since I'm by not an XBL guru. But I didn't see any glaring problems. :)
I'm not sure the names should be that way. I'm using the same naming convention as most images under the themes/ directory.
Hewitt gave me a couple of suggestions and comments. I will post a cleaner and better patch incorporating his feedback soon.
Attached patch Better patch. (deleted) — Splinter Review
Ok, incorporated feedback from hewitt and added the dir to CVS. The latest patch is a full one, so all images are cvs added to... Can I get a sr=hyatt (and maybe r=hewitt as bonus)?
Ouch, the last one was horked (events horked, visibility horked) due to a minor problem in my xml. Sorry about that. Let me attach a fix that works perfectly.
BTW, on Windows, there is a font (Marlett) that has the glyphs you should use for the arrows. That makes sure that they are anti-aliased and look good at all sizes.
Does everybody have this font? I don't see it on my system.
Well, the fonts thing is not gonna happen anyway. Besides, if you really want it to happen (for all other widgets with arrows), it's Another Bug. :) Requesting sr= from hyatt...
Target Milestone: --- → mozilla0.9.3
Hyatt? Bueller, bueller... I want this in for 0.9.3
*** Bug 92311 has been marked as a duplicate of this bug. ***
How does this relate to hewitt's new widgets? I'm not sure I see the need for a <spinbuttons> widget by itself (i.e., it seems like this would only ever be used as part of a textbox/spinbutton widget, and that widget could just have the buttons defined in its XBL.
I can see many possible usages of this widget, when grouped together with a popupmenu (click up to go up in the menu...) or with a textbox. Do you want me to make two widgets on top of this that groups <spinbuttons/> together with a popupmenu and a textbox or what?
sr=hyatt
a=dbaron on behalf of drivers for trunk checkin during 0.9.3 closure
Whiteboard: approved for 0.9.3
fix checked in. who-hoo!
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
May God have mercy on us all. The 212 bug spam-o-rama is Now!
QA Contact: aegis → jrgm
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: