0 20 40 60 80 10
| | | | | |
xxxxxxxxxxxxxxxxxxxxxxxxxx
The problem is that the "100" is cut after the first zero.
Questions are: why and how do I avoid this? Answers?
Hi![snip]
I asked this question in 1996 in OS2.PROG.GER, got no answer and ran
into it this evening once again: what am I doing wrong with my slider?
There is a slider inside a dialog, the dialog was created via IBM's
Dialog Editor (see progress.dlg). The Dialog Editor isn't able to
define ticks or scale texts. So I'm doing it by hand (see
drverify.cpp). None of the calls fail but the result is ugly:
There is a slider inside a dialog, the dialog was created via IBM's
Dialog Editor (see progress.dlg). The Dialog Editor isn't able to
define ticks or scale texts. So I'm doing it by hand (see
drverify.cpp). None of the calls fail but the result is ugly:
0 20 40 60 80 10
| | | | | |
xxxxxxxxxxxxxxxxxxxxxxxxxx
The problem is that the "100" is cut after the first zero. Questions
are: why and how do I avoid this? Answers?
[...]
0 20 40 60 80 10
| | | | | |
xxxxxxxxxxxxxxxxxxxxxxxxxx
The problem is that the "100" is cut after the first zero.
Questions are: why and how do I avoid this? Answers?
Unfortunately the why is answered very easily: It's built in and can't
be changed. Obviously the slider control does not leave enough room
for text at the far left and far right positions.
To avoid this, the PM Guide and Reference recommends the use of:
- smaller font,
- shorter text,
- static control.
But doesn't this mean that the "tick text" feature of a
slider is totally useless? IBM can't require that we stick
to 1 or 2 character text!
[...]To avoid this, the PM Guide and Reference recommends the
use of:
"static control" is very urgly to handle (not worth the
effort in my case),
shorter text no option (how do you shorten 100? "C"?).
Using a smaller font is a nice idea
but IMHO one should stay in the same font family and with
the today usage of "WarpSans.9" in dialogs there is no
smaller WarpSans font.
Idea: if you take a look at the setting notebook of c:\os2\apps\klondike.exe (options) you will notice that the
slider has three ticks but the left one isn't located at
the left margin. Probably the ticks are placed using
SLM_ADDDETENT.
There is a slider inside a dialog, the dialog was created via IBM's
Dialog Editor (see progress.dlg). The Dialog Editor isn't able to
define ticks or scale texts. So I'm doing it by hand (see
drverify.cpp). None of the calls fail but the result is ugly:
0 20 40 60 80 10
| | | | | |
xxxxxxxxxxxxxxxxxxxxxxxxxx
Are "40" and "80" really justified differently from the others? Those
2 are right justified and the other tick values are left justified.
Does the justification alternate from one tick mark to the next?
Basically, what you want is the text to be right justified on all tick marks, or at least the last one. If the justification does alternate
left and right, reducing the number of ticks by one might give you
the desired result:
0 25 50 75 100
| | | | |
+=====+=====+=====+=====+
The problem is that the "100" is cut after the first zero. Questions
are: why and how do I avoid this? Answers?
Another possible work-around would be to re-label the dialogue as "Percentage remaining" instead of "Percentage done", and have the
ticks go from 100 down to 0. This doesn't solve the underlying
problem, but is possibly a quick kludge.
Otherwise you are faced with what Udo has said: shorter text
[unlikely], smaller font, or a static text control for your tick
marks' text.
[...]To avoid this, the PM Guide and Reference recommends the
use of:
"static control" is very urgly to handle (not worth the
effort in my case),
Yes. But is it at all necessary to have the text?
I assume, that you are using the slider only as a status bar !?
Idea: if you take a look at the setting notebook ofPossibly, unfortunately I don't have enough time to check it myself.
c:\os2\apps\klondike.exe (options) you will notice that the
slider has three ticks but the left one isn't located at
the left margin. Probably the ticks are placed using
SLM_ADDDETENT.
Just an idea: Did you try, if at all possible, to strcat a few spaces
(" ") to the "100", ending up with something like "100 ". Maybe it
helps to shift the second 0 a bit to the left.
Yes, it's a status bar. But the process displayed could run
some hours:
When thinking about my specific use of a slider something
like the windows solution would be nice: display the
percentage value as a number inside the slider. Is there
source code how to subclass a slider to build such a beast?
[...]Just an idea:
Genius!
[...]
Yes, it's a status bar. But the process displayed could runYes, then it's a better idea to have the text.
some hours:
[...]
When thinking about my specific use of a slider something
like the windows solution would be nice: display the
percentage value as a number inside the slider. Is there
source code how to subclass a slider to build such a beast?
I don't know.
In FleetStreet, there is a status bar with text (percentage) in a
slider arm type 'thing'; try "Aufholen".
Unfortunately, I don't know...
whether the status bar is realized as a slider. Maybe, you want to
have a look at the source code, which is freely available probably in every BBS with OS/2 software.
Sysop: | digital man |
---|---|
Location: | Riverside County, California |
Users: | 1,028 |
Nodes: | 17 (0 / 17) |
Uptime: | 180:44:05 |
Calls: | 503,705 |
Calls today: | 8 |
Files: | 158,903 |
D/L today: |
13,131 files (3,978M bytes) |
Messages: | 444,324 |
Posted today: | 2 |