Mixer: Show peak value in tooltip on DPMs.

This commit is contained in:
Jonathan Moore Liles 2010-01-21 23:44:31 -06:00
parent 3e929e4b98
commit 78718c45d8
3 changed files with 10 additions and 2 deletions

View File

@ -39,6 +39,8 @@ Fl_Color DPM::_dim_gradient[128];
DPM::DPM ( int X, int Y, int W, int H, const char *L ) : DPM::DPM ( int X, int Y, int W, int H, const char *L ) :
Meter( X, Y, W, H, L ) Meter( X, Y, W, H, L )
{ {
tooltip( peak_string );
_last_drawn_hi_segment = 0; _last_drawn_hi_segment = 0;
pixels_per_segment( 4 ); pixels_per_segment( 4 );
@ -111,6 +113,9 @@ DPM::resize ( int X, int Y, int W, int H )
void void
DPM::draw ( void ) DPM::draw ( void )
{ {
snprintf( peak_string, sizeof( peak_string ), "%.1f", peak() );
tooltip( peak_string );
int v = pos( value() ); int v = pos( value() );
int pv = pos( peak() ); int pv = pos( peak() );

View File

@ -25,6 +25,8 @@
class DPM : public Meter class DPM : public Meter
{ {
char peak_string[10];
int _segments; int _segments;
int _pixels_per_segment; int _pixels_per_segment;
int _last_drawn_hi_segment; int _last_drawn_hi_segment;

View File

@ -34,8 +34,9 @@ protected:
virtual void draw ( void ) = 0; virtual void draw ( void ) = 0;
virtual int handle ( int m ) virtual int handle ( int m )
{ {
if ( m == FL_ENTER || m == FL_LEAVE )
if ( m == FL_PUSH ) return 1;
else if ( m == FL_PUSH )
{ {
// if ( Fl::event_button3() ) // if ( Fl::event_button3() )
// hide(); // hide();