21 #ifndef FXGRADIENTBAR_H 22 #define FXGRADIENTBAR_H 33 GRADIENTBAR_HORIZONTAL = 0,
34 GRADIENTBAR_VERTICAL = 0x00008000,
35 GRADIENTBAR_NO_CONTROLS = 0,
36 GRADIENTBAR_CONTROLS_TOP = 0x00010000,
37 GRADIENTBAR_CONTROLS_BOTTOM = 0x00020000,
38 GRADIENTBAR_CONTROLS_LEFT = GRADIENTBAR_CONTROLS_TOP,
39 GRADIENTBAR_CONTROLS_RIGHT = GRADIENTBAR_CONTROLS_BOTTOM
45 GRADIENT_BLEND_LINEAR,
48 GRADIENT_BLEND_INCREASING,
49 GRADIENT_BLEND_DECREASING
93 FXdouble getValue(FXint x,FXint y)
const;
94 FXint getSegmentLowerPos(FXint sg)
const;
95 FXint getSegmentUpperPos(FXint sg)
const;
96 FXint getSegmentMiddlePos(FXint sg)
const;
97 void drawUpArrow(
FXDCWindow& dc,FXint x,FXint y,FXColor clr);
98 void drawDnArrow(
FXDCWindow& dc,FXint x,FXint y,FXColor clr);
99 void drawRtArrow(
FXDCWindow& dc,FXint x,FXint y,FXColor clr);
100 void drawLtArrow(
FXDCWindow& dc,FXint x,FXint y,FXColor clr);
101 void drawBottomArrows(
FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
102 void drawTopArrows(
FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
103 void drawLeftArrows(
FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
104 void drawRightArrows(
FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
105 static FXdouble blendlinear(FXdouble middle,FXdouble pos);
106 static FXdouble blendpower(FXdouble middle,FXdouble pos);
107 static FXdouble blendsine(FXdouble middle,FXdouble pos);
108 static FXdouble blendincreasing(FXdouble middle,FXdouble pos);
109 static FXdouble blenddecreasing(FXdouble middle,FXdouble pos);
124 long onPaint(
FXObject*,FXSelector,
void*);
125 long onMotion(
FXObject*,FXSelector,
void*);
126 long onLeftBtnPress(
FXObject*,FXSelector,
void*);
127 long onLeftBtnRelease(
FXObject*,FXSelector,
void*);
128 long onRightBtnPress(
FXObject*,FXSelector,
void*);
129 long onRightBtnRelease(
FXObject*,FXSelector,
void*);
130 long onDNDEnter(
FXObject*,FXSelector,
void*);
131 long onDNDLeave(
FXObject*,FXSelector,
void*);
132 long onDNDMotion(
FXObject*,FXSelector,
void*);
133 long onDNDDrop(
FXObject*,FXSelector,
void*);
134 long onCmdBlending(
FXObject*,FXSelector,
void*);
135 long onUpdBlending(
FXObject*,FXSelector,
void*);
136 long onUpdSegColor(
FXObject*,FXSelector,
void*);
137 long onCmdSegColor(
FXObject*,FXSelector,
void*);
138 long onUpdRecenter(
FXObject*,FXSelector,
void*);
139 long onCmdRecenter(
FXObject*,FXSelector,
void*);
140 long onUpdSplit(
FXObject*,FXSelector,
void*);
141 long onCmdSplit(
FXObject*,FXSelector,
void*);
142 long onUpdMerge(
FXObject*,FXSelector,
void*);
143 long onCmdMerge(
FXObject*,FXSelector,
void*);
144 long onUpdUniform(
FXObject*,FXSelector,
void*);
145 long onCmdUniform(
FXObject*,FXSelector,
void*);
146 long onCmdReset(
FXObject*,FXSelector,
void*);
147 long onCmdSetHelp(
FXObject*,FXSelector,
void*);
148 long onCmdGetHelp(
FXObject*,FXSelector,
void*);
149 long onCmdSetTip(
FXObject*,FXSelector,
void*);
150 long onCmdGetTip(
FXObject*,FXSelector,
void*);
151 long onQueryHelp(
FXObject*,FXSelector,
void*);
152 long onQueryTip(
FXObject*,FXSelector,
void*);
155 ID_LOWER_COLOR=FXFrame::ID_LAST,
172 FXGradientBar(
FXComposite* p,
FXObject* tgt=
nullptr,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);
175 virtual void create();
178 virtual void layout();
181 virtual FXint getDefaultWidth();
184 virtual FXint getDefaultHeight();
190 FXint getSegment(FXint x,FXint y)
const;
197 FXint getGrip(FXint sg,FXint x,FXint y)
const;
205 void resetGradients();
211 void setGradients(
const FXGradient *segments,FXint nsegments);
218 void getGradients(
FXGradient*& segments,FXint& nsegments)
const;
221 void setCurrentSegment(FXint index,FXbool notify=
false);
227 void setAnchorSegment(FXint index);
233 FXbool selectSegments(FXint fm,FXint to,FXbool notify=
false);
236 FXbool deselectSegments(FXbool notify=
false);
239 FXbool isSegmentSelected(FXint s)
const;
242 void setSegmentLowerColor(FXint s,FXColor clr,FXbool notify=
false);
245 void setSegmentUpperColor(FXint s,FXColor clr,FXbool notify=
false);
248 FXColor getSegmentLowerColor(FXint s)
const;
251 FXColor getSegmentUpperColor(FXint s)
const;
254 void moveSegmentLower(FXint sg,FXdouble val,FXbool notify=
false);
257 void moveSegmentMiddle(FXint sg,FXdouble val,FXbool notify=
false);
260 void moveSegmentUpper(FXint sg,FXdouble val,FXbool notify=
false);
263 void moveSegments(FXint sglo,FXint sghi,FXdouble val,FXbool notify=
false);
266 FXdouble getSegmentLower(FXint sg)
const;
269 FXdouble getSegmentMiddle(FXint sg)
const;
272 FXdouble getSegmentUpper(FXint sg)
const;
279 void gradient(FXColor *ramp,FXint nramp)
const;
286 FXuint getSegmentBlend(FXint s)
const;
289 void splitSegments(FXint sglo,FXint sghi,FXbool notify=
false);
292 void mergeSegments(FXint sglo,FXint sghi,FXbool notify=
false);
295 void uniformSegments(FXint sglo,FXint sghi,FXbool notify=
false);
298 void blendSegments(FXint sglo,FXint sghi,FXuint blend=GRADIENT_BLEND_LINEAR,FXbool notify=
false);
301 void setControlSize(FXint cs);
307 void setBarSize(FXint bs);
313 FXuint getBarStyle()
const;
316 void setBarStyle(FXuint style);
319 void setSelectColor(FXColor clr);
337 virtual void save(
FXStream& store)
const;
FXint getNumSegments() const
Return the number of segments.
Definition: FXGradientBar.h:200
const FXString & getHelpText() const
Get status line help text for this gradient bar.
Definition: FXGradientBar.h:328
The Frame widget provides borders around some contents.
Definition: FXFrame.h:58
void setTipText(const FXString &text)
Set tool tip message for this gradient bar.
Definition: FXGradientBar.h:331
Base composite.
Definition: FXComposite.h:32
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
const FXString & getTipText() const
Get tool tip message for this gradient bar.
Definition: FXGradientBar.h:334
FXColor lowerColor
Upper value.
Definition: FXGradientBar.h:58
FXint getAnchorSegment() const
Return anchor segment, or -1 if there is no anchor segment.
Definition: FXGradientBar.h:230
FXColor upperColor
Lower color.
Definition: FXGradientBar.h:59
The gradient bar is a control that is used to edit color gradient, such as used in texture mapping an...
Definition: FXGradientBar.h:71
Definition: FX4Splitter.h:28
FXColor getSelectColor() const
Get color.
Definition: FXGradientBar.h:322
Definition: FXGradientBar.h:54
FXdouble upper
Middle value.
Definition: FXGradientBar.h:57
FXint getCurrentSegment() const
Return current segment, or -1 if there is no current segment.
Definition: FXGradientBar.h:224
FXuchar blend
Upper color.
Definition: FXGradientBar.h:60
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:138
Window Device Context.
Definition: FXDCWindow.h:48
An Image is a rectangular array of pixels.
Definition: FXImage.h:67
FXdouble middle
Lower value.
Definition: FXGradientBar.h:56
FXint getBarSize() const
Get bar size.
Definition: FXGradientBar.h:310
void setHelpText(const FXString &text)
Set status line help text for this gradient bar.
Definition: FXGradientBar.h:325
FXint getControlSize() const
Get control size.
Definition: FXGradientBar.h:304
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42