00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#ifndef FXCOLORWHEEL_H
00025
#define FXCOLORWHEEL_H
00026
00027
#ifndef FXFRAME_H
00028
#include "FXFrame.h"
00029
#endif
00030
00031
namespace FX {
00032
00033
00034
class FXImage;
00035
00036
00037
00038
00039
00040
00041
00042 class FXAPI FXColorWheel :
public FXFrame {
00043 FXDECLARE(FXColorWheel)
00044
protected:
00045
FXImage *dial;
00046 FXfloat hsv[3];
00047 FXint spotx;
00048 FXint spoty;
00049 FXint dialx;
00050 FXint dialy;
00051
FXString tip;
00052
FXString help;
00053
protected:
00054 FXColorWheel();
00055
void updatedial();
00056
void movespot(FXint x,FXint y);
00057 FXbool hstoxy(FXint& x,FXint& y,FXfloat h,FXfloat s)
const;
00058 FXbool xytohs(FXfloat& h,FXfloat& s,FXint x,FXint y)
const;
00059
private:
00060 FXColorWheel(
const FXColorWheel&);
00061 FXColorWheel &operator=(
const FXColorWheel&);
00062
public:
00063
long onPaint(
FXObject*,FXSelector,
void*);
00064
long onLeftBtnPress(
FXObject*,FXSelector,
void*);
00065
long onLeftBtnRelease(
FXObject*,FXSelector,
void*);
00066
long onMotion(
FXObject*,FXSelector,
void*);
00067
long onMouseWheel(
FXObject*,FXSelector,
void*);
00068
long onCmdSetHelp(
FXObject*,FXSelector,
void*);
00069
long onCmdGetHelp(
FXObject*,FXSelector,
void*);
00070
long onCmdSetTip(
FXObject*,FXSelector,
void*);
00071
long onCmdGetTip(
FXObject*,FXSelector,
void*);
00072
long onQueryHelp(
FXObject*,FXSelector,
void*);
00073
long onQueryTip(
FXObject*,FXSelector,
void*);
00074
public:
00075
00076
00077 FXColorWheel(
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);
00078
00079
00080 virtual void create();
00081
00082
00083
virtual void detach();
00084
00085
00086 virtual void layout();
00087
00088
00089
virtual FXint getDefaultWidth();
00090
00091
00092 virtual FXint getDefaultHeight();
00093
00094
00095
void setHue(FXfloat h);
00096
00097
00098 FXfloat getHue()
const {
return hsv[0]; }
00099
00100
00101
void setSat(FXfloat s);
00102
00103
00104 FXfloat getSat()
const {
return hsv[1]; }
00105
00106
00107
void setVal(FXfloat v);
00108
00109
00110 FXfloat getVal()
const {
return hsv[2]; }
00111
00112
00113
void setHelpText(
const FXString& text);
00114
00115
00116
const FXString& getHelpText()
const {
return help; }
00117
00118
00119
void setTipText(
const FXString& text);
00120
00121
00122
const FXString& getTipText()
const {
return tip; }
00123
00124
00125
virtual void save(FXStream& store)
const;
00126
00127
00128
virtual void load(FXStream& store);
00129
00130
00131
virtual ~FXColorWheel();
00132 };
00133
00134 }
00135
00136
#endif