RE: [Plib-users] legend update
Brought to you by:
sjbaker
|
From: Sebastian U. <ud...@ha...> - 2002-01-29 19:45:19
|
On Tue, 29 Jan 2002, st...@nt... (stathis) wrote:
> Date: Tue, 29 Jan 2002 17:33:41 -0000
> To: pli...@li...
> From: st...@nt... (stathis)
> Subject: RE: [Plib-users] legend update
>
> Hi again,
>
> I read carefully what everyone proposed. For my purposes the sliderCB as
> I initialy said is a "generic" callback used by many sliders, so the static
> idea is not solving it [...] I think the best solution would be to
> actually derive a class from puSlider as Sebastian said. To quickly solve
> it I ended up hacking a little bit the pu.h.I know I shouldn't but I have
> to get a solution quickly for now.
[...]
How about:
class legendSlider : public puSlider
{
protected:
char legendbuf [ 10 ] ;
public:
void doHit ( int button, int updown, int x, int y )
{
puSlider::doHit ( button, updown, x, y ) ;
snprintf ( legendbuf, 10, "%.2f", getFloatValue () ) ;
}
legendSlider ( int minx, int miny, int sz, int vertical = FALSE ) :
puSlider ( minx, miny, sz, vertical )
{
setLegend ( legendbuf ) ;
}
} ;
- Sebastian
|