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 FXREALSPINNER_H
00025
#define FXREALSPINNER_H
00026
00027
#ifndef FXPACKER_H
00028
#include "FXPacker.h"
00029
#endif
00030
00031
namespace FX {
00032
00033
00034
00035
enum {
00036
REALSPIN_NORMAL = 0,
00037
REALSPIN_CYCLIC = 0x00020000,
00038
REALSPIN_NOTEXT = 0x00040000,
00039
REALSPIN_NOMAX = 0x00080000,
00040
REALSPIN_NOMIN = 0x00100000,
00041
REALSPIN_LOG = 0x00200000
00042 };
00043
00044
00045
class FXTextField;
00046
class FXDial;
00047
00048
00049
00050
class FXAPI FXRealSpinner :
public FXPacker {
00051 FXDECLARE(FXRealSpinner)
00052 protected:
00053 FXTextField *textField;
00054 FXArrowButton *upButton;
00055 FXArrowButton *downButton;
00056 FXdouble range[2];
00057 FXdouble base;
00058 FXdouble incr;
00059 FXdouble pos;
00060 FXint ticks;
00061 protected:
00062 FXRealSpinner();
00063 private:
00064 FXRealSpinner(const FXRealSpinner&);
00065 FXRealSpinner& operator=(const FXRealSpinner&);
00066 public:
00067
long onUpdIncrement(
FXObject*,FXSelector,
void*);
00068
long onCmdIncrement(FXObject*,FXSelector,
void*);
00069
long onUpdDecrement(FXObject*,FXSelector,
void*);
00070
long onCmdDecrement(FXObject*,FXSelector,
void*);
00071
long onCmdEntry(FXObject*,FXSelector,
void*);
00072
long onChgEntry(FXObject*,FXSelector,
void*);
00073
long onWheelEntry(FXObject*,FXSelector,
void*);
00074
long onKeyPress(FXObject*,FXSelector,
void*);
00075
long onKeyRelease(FXObject*,FXSelector,
void*);
00076
long onCmdSetValue(FXObject*,FXSelector,
void*);
00077
long onCmdSetIntValue(FXObject*,FXSelector,
void*);
00078
long onCmdGetIntValue(FXObject*,FXSelector,
void*);
00079
long onCmdSetIntRange(FXObject*,FXSelector,
void*);
00080
long onCmdGetIntRange(FXObject*,FXSelector,
void*);
00081
long onCmdSetRealValue(FXObject*,FXSelector,
void*);
00082
long onCmdGetRealValue(FXObject*,FXSelector,
void*);
00083
long onCmdSetRealRange(FXObject*,FXSelector,
void*);
00084
long onCmdGetRealRange(FXObject*,FXSelector,
void*);
00085
long onFocusSelf(FXObject*,FXSelector,
void*);
00086 public:
00087 enum{
00088 ID_INCREMENT=FXPacker::ID_LAST,
00089 ID_DECREMENT,
00090 ID_ENTRY,
00091 ID_LAST
00092 };
00093
public:
00094
00095
00096 FXRealSpinner(
FXComposite *p,FXint cols,
FXObject *tgt=NULL,FXSelector sel=0,FXuint opts=REALSPIN_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);
00097
00098
00099
virtual void layout();
00100
00101
00102
virtual void disable();
00103
00104
00105
virtual void enable();
00106
00107
00108
virtual FXint getDefaultWidth();
00109
00110
00111
virtual FXint getDefaultHeight();
00112
00113
00114
void increment();
00115
00116
00117
void decrement();
00118
00119
00120 FXbool isCyclic() const;
00121
00122
00123
void setCyclic(FXbool cyclic);
00124
00125
00126 FXbool isTextVisible() const;
00127
00128
00129 void setTextVisible(FXbool shown);
00130
00131
00132 virtual
void setValue(FXdouble value);
00133
00134
00135 FXdouble getValue()
const {
return pos; }
00136
00137
00138
void setRange(FXdouble lo,FXdouble hi);
00139
00140
00141 void getRange(FXdouble& lo,FXdouble& hi)
const { lo=range[0]; hi=range[1]; }
00142
00143
00144
void setIncrement(FXdouble increment);
00145
00146
00147 FXdouble getIncrement()
const {
return incr; }
00148
00149
00150
void setFont(FXFont *fnt);
00151
00152
00153 FXFont *getFont() const;
00154
00155
00156
void setHelpText(const FXString& text);
00157
00158
00159 const FXString& getHelpText() const;
00160
00161
00162
void setTipText(const FXString& text);
00163
00164
00165 const FXString& getTipText() const;
00166
00167
00168
void setSpinnerStyle(FXuint style);
00169
00170
00171 FXuint getSpinnerStyle() const;
00172
00173
00174
void setEditable(FXbool edit=TRUE);
00175
00176
00177 FXbool isEditable() const;
00178
00179
00180
void setUpArrowColor(FXColor clr);
00181
00182
00183 FXColor getUpArrowColor() const;
00184
00185
00186
void setDownArrowColor(FXColor clr);
00187
00188
00189 FXColor getDownArrowColor() const;
00190
00191
00192
void setTextColor(FXColor clr);
00193
00194
00195 FXColor getTextColor() const;
00196
00197
00198
void setSelBackColor(FXColor clr);
00199
00200
00201 FXColor getSelBackColor() const;
00202
00203
00204
void setSelTextColor(FXColor clr);
00205
00206
00207 FXColor getSelTextColor() const;
00208
00209
00210
void setCursorColor(FXColor clr);
00211
00212
00213 FXColor getCursorColor() const;
00214
00215
00216
void setNumColumns(FXint cols);
00217
00218
00219 FXint getNumColumns() const;
00220
00221
00222 virtual
void save(FXStream& store) const;
00223
00224
00225 virtual
void load(FXStream& store);
00226
00227
00228 virtual ~FXRealSpinner();
00229 };
00230
00231 }
00232
00233 #endif