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 onUpdEntry(FXObject*,FXSelector,
void*);
00072
long onCmdEntry(FXObject*,FXSelector,
void*);
00073
long onChgEntry(FXObject*,FXSelector,
void*);
00074
long onWheelEntry(FXObject*,FXSelector,
void*);
00075
long onKeyPress(FXObject*,FXSelector,
void*);
00076
long onKeyRelease(FXObject*,FXSelector,
void*);
00077
long onCmdSetValue(FXObject*,FXSelector,
void*);
00078
long onCmdSetIntValue(FXObject*,FXSelector,
void*);
00079
long onCmdGetIntValue(FXObject*,FXSelector,
void*);
00080
long onCmdSetIntRange(FXObject*,FXSelector,
void*);
00081
long onCmdGetIntRange(FXObject*,FXSelector,
void*);
00082
long onCmdSetRealValue(FXObject*,FXSelector,
void*);
00083
long onCmdGetRealValue(FXObject*,FXSelector,
void*);
00084
long onCmdSetRealRange(FXObject*,FXSelector,
void*);
00085
long onCmdGetRealRange(FXObject*,FXSelector,
void*);
00086
long onFocusSelf(FXObject*,FXSelector,
void*);
00087 public:
00088 enum{
00089 ID_INCREMENT=FXPacker::ID_LAST,
00090 ID_DECREMENT,
00091 ID_ENTRY,
00092 ID_LAST
00093 };
00094
public:
00095
00096
00097 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);
00098
00099
00100
virtual void layout();
00101
00102
00103
virtual void disable();
00104
00105
00106
virtual void enable();
00107
00108
00109
virtual FXint getDefaultWidth();
00110
00111
00112
virtual FXint getDefaultHeight();
00113
00114
00115
void increment();
00116
00117
00118
void decrement();
00119
00120
00121 FXbool isCyclic() const;
00122
00123
00124
void setCyclic(FXbool cyclic);
00125
00126
00127 FXbool isTextVisible() const;
00128
00129
00130 void setTextVisible(FXbool shown);
00131
00132
00133 virtual
void setValue(FXdouble value);
00134
00135
00136 FXdouble getValue()
const {
return pos; }
00137
00138
00139
void setRange(FXdouble lo,FXdouble hi);
00140
00141
00142 void getRange(FXdouble& lo,FXdouble& hi)
const { lo=range[0]; hi=range[1]; }
00143
00144
00145
void setIncrement(FXdouble increment);
00146
00147
00148 FXdouble getIncrement()
const {
return incr; }
00149
00150
00151
void setFont(FXFont *fnt);
00152
00153
00154 FXFont *getFont() const;
00155
00156
00157
void setHelpText(const FXString& text);
00158
00159
00160 FXString getHelpText() const;
00161
00162
00163
void setTipText(const FXString& text);
00164
00165
00166 FXString getTipText() const;
00167
00168
00169
void setSpinnerStyle(FXuint style);
00170
00171
00172 FXuint getSpinnerStyle() const;
00173
00174
00175
void setEditable(FXbool edit=TRUE);
00176
00177
00178 FXbool isEditable() const;
00179
00180
00181
void setUpArrowColor(FXColor clr);
00182
00183
00184 FXColor getUpArrowColor() const;
00185
00186
00187
void setDownArrowColor(FXColor clr);
00188
00189
00190 FXColor getDownArrowColor() const;
00191
00192
00193
void setTextColor(FXColor clr);
00194
00195
00196 FXColor getTextColor() const;
00197
00198
00199
void setSelBackColor(FXColor clr);
00200
00201
00202 FXColor getSelBackColor() const;
00203
00204
00205
void setSelTextColor(FXColor clr);
00206
00207
00208 FXColor getSelTextColor() const;
00209
00210
00211
void setCursorColor(FXColor clr);
00212
00213
00214 FXColor getCursorColor() const;
00215
00216
00217
void setNumColumns(FXint cols);
00218
00219
00220 FXint getNumColumns() const;
00221
00222
00223 virtual
void save(FXStream& store) const;
00224
00225
00226 virtual
void load(FXStream& store);
00227
00228
00229 virtual ~FXRealSpinner();
00230 };
00231
00232 }
00233
00234 #endif