Subj : Slider Problems
To   : David Noon
From : Vitus Jensen
Date : Thu Nov 02 2000 05:12 pm

Moin David!

30.10.2000, David Noon wrote a message to Vitus Jensen:

VJ>> There is a slider inside a dialog, the dialog was created via IBM's
VJ>> Dialog Editor (see progress.dlg).  The Dialog Editor isn't able to
VJ>> define ticks or scale texts.  So I'm doing it by hand (see
VJ>> drverify.cpp). None of the calls fail but the result is ugly:

VJ>>     0    20  40    60  80    10
VJ>>     |    |    |    |    |    |
VJ>>     xxxxxxxxxxxxxxxxxxxxxxxxxx

DN> Are "40" and "80" really justified differently from the others? Those
DN> 2 are right justified and the other tick values are left justified.
DN> Does the justification alternate from one tick mark to the next?

No no.  I just had problems doing the correct display in ASCII.  All numbers
are centered above their ticks.


DN> Basically, what you want is the text to be right justified on all tick
DN> marks, or at least the last one. If the justification does alternate
DN> left and right, reducing the number of ticks by one might give you
DN> the desired result:

DN>      0     25   50     75  100
DN>      |     |     |     |     |
DN>      +=====+=====+=====+=====+


How do you change the justification (on any text)?  I searched the
WinSetPresParam() documentation but there is no attribute "justification"
listed.


VJ>> The problem is that the "100" is cut after the first zero.  Questions
VJ>> are: why and how do I avoid this?  Answers?

DN> Another possible work-around would be to re-label the dialogue as
DN> "Percentage remaining" instead of "Percentage done", and have the
DN> ticks go from 100 down to 0. This doesn't solve the underlying
DN> problem, but is possibly a quick kludge.

DN> Otherwise you are faced with what Udo has said: shorter text
DN> [unlikely], smaller font, or a static text control for your tick
DN> marks' text.

Just crude hacks...

You could also place all ticks by hand (SLM_ADDDETENT) and make sure there is
enough room for "100".

Currently I'm using a different aproach:

       20   40   60   80
   |    |    |    |    |    |
   +====+====+====+====+====+

The user has to guess that the two empty ticks contain the values "0" and
"100". <g>


Bye,
  Vitus

---
* Origin: Request VRAID - Software RAID for OS/2! (2:2474/424.1)