-Fixed Dial label()

This commit is contained in:
Harry van Haaren 2015-01-24 11:34:23 +00:00
parent 61a45d13e4
commit 559f4ca436

View file

@ -20,6 +20,7 @@
#ifndef AVTK_DIAL_H
#define AVTK_DIAL_H
#include <string>
#include <stdio.h>
#include <FL/Fl_Dial.H>
#include <FL/Fl_Slider.H>
@ -31,8 +32,7 @@ class Dial : public Fl_Slider
{
public:
Dial(int _x, int _y, int _w, int _h, const char* _lab=0):
Fl_Slider(_x, _y, _w, _h, _lab),
_label ( 0 )
Fl_Slider(_x, _y, _w, _h, _lab)
{
x = _x;
y = _y;
@ -45,19 +45,17 @@ class Dial : public Fl_Slider
mouseClicked = false;
highlight = false;
if ( _lab != 0 )
_label = strdup( _lab );
_label = _lab;
}
~Dial()
{
if( _label )
free( _label );
}
bool highlight;
int x, y, w, h;
char* _label;
//char* _label;
std::string _label;
float radius;
float lineWidth;
@ -69,12 +67,8 @@ class Dial : public Fl_Slider
void setLabel( const char* newLabel )
{
//if( _label )
// free( _label );
//_label = strdup( newLabel );
//label( _label );
_label = newLabel;
label( _label.c_str() );
redraw();
}