Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXGradientBar Class Reference

The gradient bar is a control that is used to edit color gradient, such as used in texture mapping and shape filling. More...

#include <FXGradientBar.h>

Inheritance diagram for FX::FXGradientBar:

FX::FXFrame FX::FXWindow FX::FXDrawable FX::FXId FX::FXObject List of all members.

Public Types

enum  {
  ID_LOWER_COLOR = FXFrame::ID_LAST,
  ID_UPPER_COLOR,
  ID_BLEND_LINEAR,
  ID_BLEND_POWER,
  ID_BLEND_SINE,
  ID_BLEND_INCREASING,
  ID_BLEND_DECREASING,
  ID_RECENTER,
  ID_SPLIT,
  ID_MERGE,
  ID_UNIFORM,
  ID_LAST
}

Public Member Functions

 FXGradientBar (FXComposite *p, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=FRAME_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
virtual void create ()
virtual void layout ()
virtual FXint getDefaultWidth ()
virtual FXint getDefaultHeight ()
FXint getSegment (FXint x, FXint y) const
FXint getGrip (FXint sg, FXint x, FXint y) const
FXint getNumSegments () const
void setGradients (const FXGradient *segments, FXint nsegments)
void getGradients (FXGradient *&segments, FXint &nsegments) const
void setCurrentSegment (FXint index, FXbool notify=FALSE)
FXint getCurrentSegment () const
void setAnchorSegment (FXint index)
FXint getAnchorSegment () const
FXbool selectSegments (FXint fm, FXint to, FXbool notify=FALSE)
FXbool deselectSegments (FXbool notify)
FXbool isSegmentSelected (FXint s) const
void setSegmentLowerColor (FXint s, FXColor clr, FXbool notify=FALSE)
void setSegmentUpperColor (FXint s, FXColor clr, FXbool notify=FALSE)
FXColor getSegmentLowerColor (FXint s) const
FXColor getSegmentUpperColor (FXint s) const
void moveSegmentLower (FXint sg, FXdouble val, FXbool notify=FALSE)
void moveSegmentMiddle (FXint sg, FXdouble val, FXbool notify=FALSE)
void moveSegmentUpper (FXint sg, FXdouble val, FXbool notify=FALSE)
void moveSegments (FXint sglo, FXint sghi, FXdouble val, FXbool notify=FALSE)
FXdouble getSegmentLower (FXint sg) const
FXdouble getSegmentMiddle (FXint sg) const
FXdouble getSegmentUpper (FXint sg) const
void gradient (FXColor *ramp, FXint nramp)
FXuint getSegmentBlend (FXint s) const
void splitSegments (FXint sglo, FXint sghi, FXbool notify=FALSE)
void mergeSegments (FXint sglo, FXint sghi, FXbool notify=FALSE)
void uniformSegments (FXint sglo, FXint sghi, FXbool notify=FALSE)
void blendSegments (FXint sglo, FXint sghi, FXuint blend=GRADIENT_BLEND_LINEAR, FXbool notify=FALSE)
FXuint getBarStyle () const
void setBarStyle (FXuint style)
void setSelectColor (FXColor clr)
FXColor getSelectColor () const
void setHelpText (const FXString &text)
FXString getHelpText () const
void setTipText (const FXString &text)
FXString getTipText () const
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
virtual ~FXGradientBar ()

Detailed Description

The gradient bar is a control that is used to edit color gradient, such as used in texture mapping and shape filling.

See also:


Constructor & Destructor Documentation

FX::FXGradientBar::FXGradientBar FXComposite p,
FXObject tgt = NULL,
FXSelector  sel = 0,
FXuint  opts = FRAME_NORMAL,
FXint  x = 0,
FXint  y = 0,
FXint  w = 0,
FXint  h = 0,
FXint  pl = DEFAULT_PAD,
FXint  pr = DEFAULT_PAD,
FXint  pt = DEFAULT_PAD,
FXint  pb = DEFAULT_PAD
 

Construct a gradient bar.

virtual FX::FXGradientBar::~FXGradientBar  )  [virtual]
 

Destructor.


Member Function Documentation

virtual void FX::FXGradientBar::create  )  [virtual]
 

Create server-side resources.

Reimplemented from FX::FXWindow.

virtual void FX::FXGradientBar::layout  )  [virtual]
 

Perform layout.

Reimplemented from FX::FXWindow.

virtual FXint FX::FXGradientBar::getDefaultWidth  )  [virtual]
 

Return default width.

Reimplemented from FX::FXFrame.

virtual FXint FX::FXGradientBar::getDefaultHeight  )  [virtual]
 

Return default height.

Reimplemented from FX::FXFrame.

FXint FX::FXGradientBar::getSegment FXint  x,
FXint  y
const
 

Obtain segment containing location x, y.

Returns -1 if no matching segment was found.

FXint FX::FXGradientBar::getGrip FXint  sg,
FXint  x,
FXint  y
const
 

Get the grip in segment sg which is closest to location (x, y), one of GRIP_LOWER, GRIP_SEG_LOWER, GRIP_MIDDLE, GRIP_SEG_UPPER, GRIP_UPPER or GRIP_NONE.

FXint FX::FXGradientBar::getNumSegments  )  const [inline]
 

Return the number of segments.

void FX::FXGradientBar::setGradients const FXGradient *  segments,
FXint  nsegments
 

Replace the current gradient segments.

The gradient bar makes a copy of the input segments array.

void FX::FXGradientBar::getGradients FXGradient *&  segments,
FXint &  nsegments
const
 

Return a copy of the gradient segments.

The array of segments is allocated using FXMALLOC and should be freed by the caller using FXFREE.

void FX::FXGradientBar::setCurrentSegment FXint  index,
FXbool  notify = FALSE
 

Change current segment.

FXint FX::FXGradientBar::getCurrentSegment  )  const [inline]
 

Return current segment, or -1 if there is no current segment.

void FX::FXGradientBar::setAnchorSegment FXint  index  ) 
 

Change anchor segment.

FXint FX::FXGradientBar::getAnchorSegment  )  const [inline]
 

Return anchor segment, or -1 if there is no anchor segment.

FXbool FX::FXGradientBar::selectSegments FXint  fm,
FXint  to,
FXbool  notify = FALSE
 

Select segment(s).

FXbool FX::FXGradientBar::isSegmentSelected FXint  s  )  const
 

Returns TRUE if the specified segment is selected.

void FX::FXGradientBar::setSegmentLowerColor FXint  s,
FXColor  clr,
FXbool  notify = FALSE
 

Set lower color of a segment.

void FX::FXGradientBar::setSegmentUpperColor FXint  s,
FXColor  clr,
FXbool  notify = FALSE
 

Set upper color of a segment.

FXColor FX::FXGradientBar::getSegmentLowerColor FXint  s  )  const
 

Get lower color of a segment.

FXColor FX::FXGradientBar::getSegmentUpperColor FXint  s  )  const
 

Get upper color of a segment.

void FX::FXGradientBar::moveSegmentLower FXint  sg,
FXdouble  val,
FXbool  notify = FALSE
 

Move lower point of segment sg.

void FX::FXGradientBar::moveSegmentMiddle FXint  sg,
FXdouble  val,
FXbool  notify = FALSE
 

Move middle point of segment sg.

void FX::FXGradientBar::moveSegmentUpper FXint  sg,
FXdouble  val,
FXbool  notify = FALSE
 

Move upper point of segment sg.

void FX::FXGradientBar::moveSegments FXint  sglo,
FXint  sghi,
FXdouble  val,
FXbool  notify = FALSE
 

Move segments sglo to sghi to new position val.

FXdouble FX::FXGradientBar::getSegmentLower FXint  sg  )  const
 

Get lower value of segment sg.

FXdouble FX::FXGradientBar::getSegmentMiddle FXint  sg  )  const
 

Get middle value of segment sg.

FXdouble FX::FXGradientBar::getSegmentUpper FXint  sg  )  const
 

Get upper value of segment sg.

void FX::FXGradientBar::gradient FXColor *  ramp,
FXint  nramp
 

Get gradient ramp.

The ramp argument should be an array of size nramp, which will be filled with the appropriate color values.

FXuint FX::FXGradientBar::getSegmentBlend FXint  s  )  const
 

Get blend mode of segment, one of GRADIENT_BLEND_LINEAR, GRADIENT_BLEND_POWER, GRADIENT_BLEND_SINE, GRADIENT_BLEND_INCREASING, or GRADIENT_BLEND_DECREASING.

void FX::FXGradientBar::splitSegments FXint  sglo,
FXint  sghi,
FXbool  notify = FALSE
 

Split segment at the midpoint.

void FX::FXGradientBar::mergeSegments FXint  sglo,
FXint  sghi,
FXbool  notify = FALSE
 

Merge segments.

void FX::FXGradientBar::uniformSegments FXint  sglo,
FXint  sghi,
FXbool  notify = FALSE
 

Make segments uniformly distributed.

void FX::FXGradientBar::blendSegments FXint  sglo,
FXint  sghi,
FXuint  blend = GRADIENT_BLEND_LINEAR,
FXbool  notify = FALSE
 

Change blend mode of segment.

FXuint FX::FXGradientBar::getBarStyle  )  const
 

Get the gradient bar style.

void FX::FXGradientBar::setBarStyle FXuint  style  ) 
 

Change the gradient bar style.

void FX::FXGradientBar::setSelectColor FXColor  clr  ) 
 

Set color.

FXColor FX::FXGradientBar::getSelectColor  )  const [inline]
 

Get color.

void FX::FXGradientBar::setHelpText const FXString text  )  [inline]
 

Set status line help text for this gradient bar.

FXString FX::FXGradientBar::getHelpText  )  const [inline]
 

Get status line help text for this gradient bar.

void FX::FXGradientBar::setTipText const FXString text  )  [inline]
 

Set tool tip message for this gradient bar.

FXString FX::FXGradientBar::getTipText  )  const [inline]
 

Get tool tip message for this gradient bar.

virtual void FX::FXGradientBar::save FXStream store  )  const [virtual]
 

Save gradient bar to a stream.

Reimplemented from FX::FXFrame.

virtual void FX::FXGradientBar::load FXStream store  )  [virtual]
 

Load gradient bar from a stream.

Reimplemented from FX::FXFrame.

Copyright © 1997-2004 Jeroen van der Zijp