Spinbutton question - OS2

This is a discussion on Spinbutton question - OS2 ; Hi folks, is there an easy way create a spin button, that increments by values other than 1 ? I.e. something like in the range from 0 to 100 only multiples of 10 are allowed. -- Ruediger "Rudi" Ihle [S&T ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Spinbutton question

  1. Spinbutton question

    Hi folks,

    is there an easy way create a spin button, that
    increments by values other than 1 ?

    I.e. something like in the range from 0 to 100
    only multiples of 10 are allowed.


    --
    Ruediger "Rudi" Ihle [S&T Systemtechnik GmbH, Germany]
    http://www.s-t.de
    Please remove all characters left of the "R" in my email address


  2. Re: Spinbutton question

    On 31 Jan 2005 09:11:30 GMT, Ruediger Ihle wrote:

    > is there an easy way create a spin button, that
    > increments by values other than 1 ?
    >
    > I.e. something like in the range from 0 to 100
    > only multiples of 10 are allowed.


    If you have a fixed range, then you can use a preset array of values.
    If not, then you'll have to do a bit more work with message processing.

  3. Re: Spinbutton question

    On Tue, 1 Feb 2005 01:30:09 UTC, Paul Ratcliffe
    wrote:


    > If you have a fixed range, then you can use a
    > preset array of values.


    The preset array is not an option, because in the real
    code the range will be much bigger and would result in
    a huge string array.


    > If not, then you'll have to do a bit more work
    > with message processing.


    Hmm, that's what it looks like...


    --
    Ruediger "Rudi" Ihle [S&T Systemtechnik GmbH, Germany]
    http://www.s-t.de
    Please remove all characters left of the "R" in my email address


  4. Re: Spinbutton question

    On Tue, 1 Feb 2005 01:30:09 UTC, Paul Ratcliffe
    wrote:

    > If not, then you'll have to do a bit more work with
    > message processing.


    Actually, this was easier than I thought ;-). The
    trick is to disassociate the edit field from the
    arrows by sending SPBM_SETMASTER with param1 set
    to NULLHANDLE. After that, SPBN_UPARROW, SPBN_DOWNARROW
    and SPBN_KILLFOCUS need to be handled by the application.
    This way it is possible to change the increment value.
    It can even be done dynamically, resulting in some kind
    of logarithmic behaviour. Pretty cool !


    --
    Ruediger "Rudi" Ihle [S&T Systemtechnik GmbH, Germany]
    http://www.s-t.de
    Please remove all characters left of the "R" in my email address


+ Reply to Thread