Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | Class Members | Related Pages

PlotMM::Scale Class Reference

Inheritance diagram for PlotMM::Scale:

Inheritance graph
Collaboration diagram for PlotMM::Scale:
List of all members.

Detailed Description

Class to draw a scale.

Public Member Functions

 Scale (Gtk::PositionType p, ScaleLabels *labels=0)
virtual ~Scale ()
void set_position (Gtk::PositionType p)
Gtk::PositionType position () const
void set_ticklengths (int major, int minor)
int major_ticklength () const
int minor_ticklength () const
void set_enabled (bool b)
bool enabled () const
const DoubleIntMapscale_map () const
void set_range (double l, double r)
void set_range (double l, double r, bool lg)
void set_autoscale (bool b)
bool autoscale () const
void begin_autoscale ()
void autoscale (double min, double max)
void end_autoscale ()

Public Attributes

SigC::Signal1< void, bool > signal_enabled

Protected Member Functions

virtual void on_realize ()
virtual bool on_expose_event (GdkEventExpose *event)
virtual void on_tick_change ()
virtual void redraw ()=0

Protected Attributes

Glib::RefPtr< Gdk::GC > gc_
Glib::RefPtr< Gdk::Window > window_
Glib::RefPtr< Gdk::Window > labwin_
ScaleDiv scaleDiv_
DoubleIntMap scaleMap_

Constructor & Destructor Documentation

Scale::Scale Gtk::PositionType  p,
ScaleLabels l = 0


Upon construction, the position for the Scale must be declared. Optionally, a reference to a ScaleLabels instance can be provided to allow for automatic label generation. If the labels are actually shown can be set with ScaleLabels::set_enabled()

Scale::~Scale  )  [virtual]


Member Function Documentation

void Scale::autoscale double  min,
double  max

Add autoscale information

The given minimum and maximum value extend the current autoscale information. Call end_autoscale() when finished.

bool PlotMM::Scale::autoscale  )  const

Query if autoscaling is enabled.

void Scale::begin_autoscale  ) 

Reset autoscale information

Before updating autoscale information with autoscale(min,max), begin_autoscale must be called to reset the old autoscale information. Call end_autoscale() when finished.

bool PlotMM::Scale::enabled  )  const

Query if the scale is enabled (i.e. visible).

void Scale::end_autoscale  ) 

Finish update of autoscale information

After updating autoscale information with autoscale(min,max) this function sets the new range of values.

See also:

int PlotMM::Scale::major_ticklength  )  const

Return the major ticklength.

int PlotMM::Scale::minor_ticklength  )  const

Return the minor ticklength.

bool Scale::on_expose_event GdkEventExpose *  event  )  [protected, virtual]

Handles an expose event

void Scale::on_realize  )  [protected, virtual]

Do the necessary initializations when window is realized.

virtual void PlotMM::Scale::on_tick_change  )  [protected, virtual]

implement this to react on changes of tick lengths

Reimplemented in PlotMM::VScale, and PlotMM::HScale.

Gtk::PositionType PlotMM::Scale::position  )  const

Return where the scale is positioned.

const DoubleIntMap& PlotMM::Scale::scale_map  )  const

Query the ScaleMap used by this scale.

void Scale::set_autoscale bool  b  ) 

Turn on autoscaling

void Scale::set_enabled bool  b  ) 

Enable drawing of scales

If scale drawing is disabled, no space will be occupied and nothing will be displayed. If a ScaleLabels instance was specified, the ScaleLabels will also be disabled.

To re-enable Scale and ScaleLabels drawing, call this function with true.

void Scale::set_position Gtk::PositionType  p  ) 

Change the position of the Scale (may not work)

check this out

void Scale::set_range double  l,
double  r,
bool  lg

Set the range of double values the scale represents.

To make the scale logarithmic, true can be given as the third argument. After setting the new range, the scale is redrawn.

void Scale::set_range double  l,
double  r

Set the range of double values the scale represents.

To make the scale logarithmic, true can be given as the third argument. After setting the new range, the scale is redrawn.

void Scale::set_ticklengths int  major,
int  minor

Set the length of major and minor ticks

Member Data Documentation

SigC::Signal1<void,bool> PlotMM::Scale::signal_enabled

This signal is thrown whenever the scale is enabled or disabled

See also:
set_enabled, enabled

Generated on Thu Nov 10 15:26:23 2005 for PlotMM by  doxygen 1.4.4