6 Based on source code from Be Inc. RIP
7 Copyright 1995 Be Incorporated, All Rights Reserved.
10 #include "JSDSlider.h"
17 JSDSlider::JSDSlider(const char* name
, const char* label
,
18 BMessage
* msg
, int32 min
, int32 max
)
19 : BSlider(name
, label
, msg
, min
, max
, B_HORIZONTAL
)
24 JSDSlider::~JSDSlider()
30 JSDSlider::UpdateText() const
32 // When the slider's Draw method is called, this method will also be called.
33 // If its return value is non-NULL, then it will be drawn with the rest of
35 static char string
[64];
38 if (!strcmp("gamma", Name())) {
40 gamma
= exp((Value() * log(2.0) * 0.01) );
41 sprintf(string
, " %.2f", gamma
);
42 } else if (!strcmp("inkDensity", Name()) ) {
43 float density
= Value();
44 density
= (density
/ 127.0) * 100.0;
45 sprintf(string
," %.0f%%", density
);
48 fResult
.SetTo(string
);
49 return fResult
.String();