From 8a3a38b2a0474732fe258bde85c88277b0650292 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Wed, 28 May 2008 01:13:23 -0500 Subject: [PATCH] Properly clear pushed and belowmouse at sequence widget destruction time. --- Timeline/Sequence_Widget.C | 29 +++++++++++++++++++++++++++++ Timeline/Sequence_Widget.H | 25 +++---------------------- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/Timeline/Sequence_Widget.C b/Timeline/Sequence_Widget.C index 6db33cf..d474517 100644 --- a/Timeline/Sequence_Widget.C +++ b/Timeline/Sequence_Widget.C @@ -34,6 +34,35 @@ Fl_Color Sequence_Widget::_selection_color = FL_MAGENTA; +Sequence_Widget::Sequence_Widget ( ) +{ + _sequence = NULL; + + _r = &_range; + + _r->start = _r->offset = _r->length = 0; + + _drag = NULL; + + _box_color = FL_BACKGROUND_COLOR; + _color = FL_FOREGROUND_COLOR; +} + +Sequence_Widget::~Sequence_Widget ( ) +{ + redraw(); + + if ( this == _pushed ) + _pushed = NULL; + + if ( this == _belowmouse ) + _belowmouse = NULL; + + _sequence->remove( this ); + + _selection.remove( this ); +} + void Sequence_Widget::get ( Log_Entry &e ) const { diff --git a/Timeline/Sequence_Widget.H b/Timeline/Sequence_Widget.H index 3158342..640ad3c 100644 --- a/Timeline/Sequence_Widget.H +++ b/Timeline/Sequence_Widget.H @@ -158,30 +158,11 @@ protected: _box_color = rhs._box_color; }; -public: - - Sequence_Widget ( ) - { - _sequence = NULL; - - _r = &_range; - - _r->start = _r->offset = _r->length = 0; - - _drag = NULL; + Sequence_Widget ( ); - _box_color = FL_BACKGROUND_COLOR; - _color = FL_FOREGROUND_COLOR; - } - - virtual ~Sequence_Widget ( ) - { - redraw(); - - _sequence->remove( this ); +public: - _selection.remove( this ); - } + virtual ~Sequence_Widget ( ); const Sequence_Widget & operator= ( const Sequence_Widget &rhs )