00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _FL_MASKED_INPUT_H_
00023 #define _FL_MASKED_INPUT_H_
00024
00025 #include "Fl_Input.h"
00026 #include "Fl_String.h"
00027
00029 class FL_API Fl_Masked_Input : public Fl_Input {
00030 public:
00031
00033 Fl_Masked_Input(int x,int y,int w,int h,const char *l = 0)
00034 : Fl_Input(x, y, w, h, l) {}
00035
00037 Fl_Masked_Input(const char* l = 0,int layout_size=30,Fl_Align layout_al=FL_ALIGN_TOP,int label_w=100)
00038 : Fl_Input(l,layout_size,layout_al,label_w) {}
00039
00040 void mask(const char *m);
00041 const char *mask() const { return m_mask.c_str(); }
00042
00043 virtual int handle(int event);
00044
00045 private:
00046 Fl_String m_mask;
00047 Fl_String m_inputMask;
00048 Fl_String m_backgroundMask;
00049
00050 bool checkCharacterAtPos(int pos,char& key);
00051 bool checkCharacter(int pos,char& key);
00052 };
00053
00054 #endif