Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RangeControl< TYPE > Class Template Reference

Control a Range and add undo/redo abilities. More...

#include <RangeControl.h>

Inheritance diagram for RangeControl< TYPE >:

Undoable List of all members.

Public Member Functions

 RangeControl (UndoHistory *history=0, Range< TYPE > *range=0)
virtual ~RangeControl ()
void Set (TYPE min, TYPE max)
void SetMin (TYPE min)
void SetMax (TYPE max)
void Apply (Range< TYPE > *r)
void UseRange (Range< TYPE > *range)
Range< TYPE > & GetRange ()
UndoMemento GetMemento ()
void StartCompound ()
void StopCompound ()

Private Attributes

SigC::Ptr< UndoHistoryfHistory
SigC::Ptr< Range< TYPE > > fRange
bool fBlockHistory

Detailed Description

template<class TYPE>
class RangeControl< TYPE >

Control a Range and add undo/redo abilities.

Id
RangeControl.h,v 1.4 2005/07/21 20:26:36 bv Exp

Midad

Contact: bv@bnl.gov

Created on: Wed Aug 21 11:02:44 2002

Definition at line 26 of file RangeControl.h.


Constructor & Destructor Documentation

template<class TYPE>
RangeControl< TYPE >::RangeControl UndoHistory history = 0,
Range< TYPE > *  range = 0
[inline]
 

Definition at line 31 of file RangeControl.h.

00032         : fHistory(history), fRange(range), fBlockHistory(false) { 
00033         if (!fHistory) fHistory = SigC::manage(new UndoHistory);
00034         if (!fRange) fRange = SigC::manage(new Range<TYPE>); 
00035     }

template<class TYPE>
virtual RangeControl< TYPE >::~RangeControl  )  [inline, virtual]
 

Definition at line 49 of file RangeControl.h.

00049 {}


Member Function Documentation

template<class TYPE>
void RangeControl< TYPE >::Apply Range< TYPE > *  r  )  [inline]
 

Definition at line 64 of file RangeControl.h.

00064                                {
00065         if (!fBlockHistory) fHistory->Store(*this);
00066         fRange->Set(r->Min(),r->Max());
00067     }

template<class TYPE>
UndoMemento RangeControl< TYPE >::GetMemento void   )  [inline, virtual]
 

Implements Undoable.

Definition at line 91 of file RangeControl.h.

00091                              {
00092         using namespace SigC;
00093         return bind(slot(*fRange,&Range<TYPE>::SetState),fRange->GetState());
00094     }

template<class TYPE>
Range<TYPE>& RangeControl< TYPE >::GetRange void   )  [inline]
 

Definition at line 88 of file RangeControl.h.

Referenced by GuiSlider::ApplyRange(), MultiPage::ColorSemanticHandler(), GfxTrackList::Configure(), GfxStripList::Configure(), GfxShowerList::Configure(), GfxDigitList::Configure(), GfxStripList::Init(), GfxDigitList::Init(), GuiSlider::UseExtremaControl(), and GuiSlider::UseRangeControl().

00088 { return *fRange; }

template<class TYPE>
void RangeControl< TYPE >::Set TYPE  min,
TYPE  max
[inline]
 

Definition at line 52 of file RangeControl.h.

Referenced by RangeControl< double >::Apply(), main(), RangeControl< double >::Set(), GuiSlider::UpdateRange(), and zoom_range().

00052                                  {
00053         if (!fBlockHistory) fHistory->Store(*this);
00054         fRange->Set(min,max);
00055     }

template<class TYPE>
void RangeControl< TYPE >::SetMax TYPE  max  )  [inline]
 

Definition at line 60 of file RangeControl.h.

Referenced by RangeControl< double >::SetMax().

00060                           {
00061         if (!fBlockHistory) fHistory->Store(*this);
00062         fRange->SetMax(max);
00063     }

template<class TYPE>
void RangeControl< TYPE >::SetMin TYPE  min  )  [inline]
 

Definition at line 56 of file RangeControl.h.

Referenced by RangeControl< double >::SetMin().

00056                           {
00057         if (!fBlockHistory) fHistory->Store(*this);
00058         fRange->SetMin(min);
00059     }

template<class TYPE>
void RangeControl< TYPE >::StartCompound  )  [inline]
 

Definition at line 96 of file RangeControl.h.

Referenced by GuiSlider::StartCompound().

00096                          { 
00097         fHistory->Store(*this);
00098         fBlockHistory = true;
00099     }

template<class TYPE>
void RangeControl< TYPE >::StopCompound  )  [inline]
 

Definition at line 100 of file RangeControl.h.

Referenced by GuiSlider::StopCompound().

00100                         {
00101         fBlockHistory = false;
00102     }

template<class TYPE>
void RangeControl< TYPE >::UseRange Range< TYPE > *  range  )  [inline]
 

Definition at line 78 of file RangeControl.h.

Referenced by GuiSlider::UseExtrema(), and GuiSlider::UseRange().

00078                                       {
00079         using namespace SigC;
00080         UndoItem ui(*this, 
00081                     SigC::bind(SigC::slot(*this,&RangeControl::UseRange),
00082                                fRange));
00083         fHistory->Store(ui);
00084         fRange = range;
00085     }


Member Data Documentation

template<class TYPE>
bool RangeControl< TYPE >::fBlockHistory [private]
 

Definition at line 108 of file RangeControl.h.

template<class TYPE>
SigC::Ptr<UndoHistory> RangeControl< TYPE >::fHistory [private]
 

Definition at line 106 of file RangeControl.h.

template<class TYPE>
SigC::Ptr<Range<TYPE> > RangeControl< TYPE >::fRange [private]
 

Definition at line 107 of file RangeControl.h.


The documentation for this class was generated from the following file:
Generated on Thu Nov 1 12:00:37 2007 for loon by  doxygen 1.3.9.1