Opened 8 years ago

Last modified 2 years ago

#7996 assigned enhancement

[BSlider] Range slider capability

Reported by: jwlh172 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/Interface Kit Version: R1/alpha3
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

I've enhanced the BSlider control to allow its use as a range slider; rather than only one movable thumb area, there are two, allowing the setting of an offset (starting point) and an end point.

In order to create the range slider, one can either set the final variable "dualMode" in the BSlider constructor to "true", or, after creation, can call the SetDualMode(true) member function.

SetOffsetValue(int32) and int32 OffsetValue() can be used to set and retrieve the new offset value, which, by default, is set to the slider's minimum value, while the end point value can still be set and retrieved using SetValue and Value.

Attachments (1)

InterfaceKit-RangeSlider-20110922.diff (25.1 KB ) - added by jwlh172 8 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by jwlh172, 8 years ago

Has a Patch: set

comment:2 by anevilyak, 8 years ago

Unfortunately, this patch cannot be applied as is ; it breaks binary compatibility in a number of ways:

1) It changes the signature of the existing constructor, which will result in symbol resolution failures since this results in the mangled name changing. In general, you cannot change the signature of existing public functions.

2) It adds an extra virtual ; one cannot change the number or order of virtual functions due to the fragile base class problem. BSlider has several reserved virtual slots for exactly this reason, you would need to instead replace the first one of those with your new virtual, and also add a compat placeholder to dispatch the old name.

3) It changes the size of the class by adding that boolean. There is a block of reserved data at the end of the class for precisely this reason, you would need to remove a byte from there and add your boolean in its place.

Last edited 8 years ago by anevilyak (previous) (diff)

in reply to:  2 comment:3 by jscipione, 8 years ago

Replying to anevilyak:

Unfortunately, this patch cannot be applied as is ; it breaks binary compatibility in a number of ways:

Why not make a BRangeSlider class instead. That certainly would get around the binary compatibility issues.

comment:4 by Charlie_X, 8 years ago

Are you offering to write the new class? Tests please.

comment:5 by pulkomandy, 5 years ago

Milestone: R1Unscheduled

comment:6 by pulkomandy, 4 years ago

Has a Patch: unset

comment:7 by axeld, 2 years ago

Owner: changed from axeld to nobody
Status: newassigned
Note: See TracTickets for help on using tickets.