home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / Vcl / mask.hpp < prev    next >
C/C++ Source or Header  |  2000-02-01  |  11KB  |  291 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1999 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'Mask.pas' rev: 5.00
  6.  
  7. #ifndef MaskHPP
  8. #define MaskHPP
  9.  
  10. #pragma delphiheader begin
  11. #pragma option push -w-
  12. #pragma option push -Vx
  13. #include <Menus.hpp>    // Pascal unit
  14. #include <Graphics.hpp>    // Pascal unit
  15. #include <Forms.hpp>    // Pascal unit
  16. #include <Messages.hpp>    // Pascal unit
  17. #include <Controls.hpp>    // Pascal unit
  18. #include <StdCtrls.hpp>    // Pascal unit
  19. #include <Classes.hpp>    // Pascal unit
  20. #include <SysUtils.hpp>    // Pascal unit
  21. #include <Windows.hpp>    // Pascal unit
  22. #include <SysInit.hpp>    // Pascal unit
  23. #include <System.hpp>    // Pascal unit
  24.  
  25. //-- user supplied -----------------------------------------------------------
  26.  
  27. namespace Mask
  28. {
  29. //-- type declarations -------------------------------------------------------
  30. #pragma option push -b-
  31. enum TMaskCharType { mcNone, mcLiteral, mcIntlLiteral, mcDirective, mcMask, mcMaskOpt, mcFieldSeparator, 
  32.     mcField };
  33. #pragma option pop
  34.  
  35. #pragma option push -b-
  36. enum Mask__1 { mdReverseDir, mdUpperCase, mdLowerCase, mdLiteralChar };
  37. #pragma option pop
  38.  
  39. typedef Set<Mask__1, mdReverseDir, mdLiteralChar>  TMaskDirectives;
  40.  
  41. class DELPHICLASS EDBEditError;
  42. class PASCALIMPLEMENTATION EDBEditError : public Sysutils::Exception 
  43. {
  44.     typedef Sysutils::Exception inherited;
  45.     
  46. public:
  47.     #pragma option push -w-inl
  48.     /* Exception.Create */ inline __fastcall EDBEditError(const AnsiString Msg) : Sysutils::Exception(Msg
  49.         ) { }
  50.     #pragma option pop
  51.     #pragma option push -w-inl
  52.     /* Exception.CreateFmt */ inline __fastcall EDBEditError(const AnsiString Msg, const System::TVarRec 
  53.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  54.     #pragma option pop
  55.     #pragma option push -w-inl
  56.     /* Exception.CreateRes */ inline __fastcall EDBEditError(int Ident)/* overload */ : Sysutils::Exception(
  57.         Ident) { }
  58.     #pragma option pop
  59.     #pragma option push -w-inl
  60.     /* Exception.CreateResFmt */ inline __fastcall EDBEditError(int Ident, const System::TVarRec * Args
  61.         , const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
  62.     #pragma option pop
  63.     #pragma option push -w-inl
  64.     /* Exception.CreateHelp */ inline __fastcall EDBEditError(const AnsiString Msg, int AHelpContext) : 
  65.         Sysutils::Exception(Msg, AHelpContext) { }
  66.     #pragma option pop
  67.     #pragma option push -w-inl
  68.     /* Exception.CreateFmtHelp */ inline __fastcall EDBEditError(const AnsiString Msg, const System::TVarRec 
  69.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  70.         ) { }
  71.     #pragma option pop
  72.     #pragma option push -w-inl
  73.     /* Exception.CreateResHelp */ inline __fastcall EDBEditError(int Ident, int AHelpContext)/* overload */
  74.          : Sysutils::Exception(Ident, AHelpContext) { }
  75.     #pragma option pop
  76.     #pragma option push -w-inl
  77.     /* Exception.CreateResFmtHelp */ inline __fastcall EDBEditError(System::PResStringRec ResStringRec, 
  78.         const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(
  79.         ResStringRec, Args, Args_Size, AHelpContext) { }
  80.     #pragma option pop
  81.     
  82. public:
  83.     #pragma option push -w-inl
  84.     /* TObject.Destroy */ inline __fastcall virtual ~EDBEditError(void) { }
  85.     #pragma option pop
  86.     
  87. };
  88.  
  89.  
  90. #pragma option push -b-
  91. enum Mask__3 { msMasked, msReEnter, msDBSetText };
  92. #pragma option pop
  93.  
  94. typedef Set<Mask__3, msMasked, msDBSetText>  TMaskedState;
  95.  
  96. class DELPHICLASS TCustomMaskEdit;
  97. class PASCALIMPLEMENTATION TCustomMaskEdit : public Stdctrls::TCustomEdit 
  98. {
  99.     typedef Stdctrls::TCustomEdit inherited;
  100.     
  101. private:
  102.     AnsiString FEditMask;
  103.     char FMaskBlank;
  104.     int FMaxChars;
  105.     bool FMaskSave;
  106.     TMaskedState FMaskState;
  107.     int FCaretPos;
  108.     int FBtnDownX;
  109.     AnsiString FOldValue;
  110.     bool FSettingCursor;
  111.     bool __fastcall DoInputChar(char &NewChar, int MaskOffset);
  112.     bool __fastcall InputChar(char &NewChar, int Offset);
  113.     bool __fastcall DeleteSelection(AnsiString &Value, int Offset, int Len);
  114.     int __fastcall InputString(AnsiString &Value, const AnsiString NewValue, int Offset);
  115.     AnsiString __fastcall AddEditFormat(const AnsiString Value, bool Active);
  116.     AnsiString __fastcall RemoveEditFormat(const AnsiString Value);
  117.     int __fastcall FindLiteralChar(int MaskOffset, char InChar);
  118.     AnsiString __fastcall GetEditText();
  119.     bool __fastcall GetMasked(void);
  120.     HIDESBASE AnsiString __fastcall GetText();
  121.     int __fastcall GetMaxLength(void);
  122.     bool __fastcall CharKeys(char &CharCode);
  123.     void __fastcall SetEditText(const AnsiString Value);
  124.     void __fastcall SetEditMask(const AnsiString Value);
  125.     HIDESBASE void __fastcall SetMaxLength(int Value);
  126.     HIDESBASE void __fastcall SetText(const AnsiString Value);
  127.     void __fastcall DeleteKeys(Word CharCode);
  128.     void __fastcall HomeEndKeys(Word CharCode, Classes::TShiftState Shift);
  129.     void __fastcall CursorInc(int CursorPos, int Incr);
  130.     void __fastcall CursorDec(int CursorPos);
  131.     void __fastcall ArrowKeys(Word CharCode, Classes::TShiftState Shift);
  132.     HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  133.     HIDESBASE MESSAGE void __fastcall WMLButtonUp(Messages::TWMMouse &Message);
  134.     HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  135.     MESSAGE void __fastcall WMCut(Messages::TMessage &Message);
  136.     MESSAGE void __fastcall WMPaste(Messages::TMessage &Message);
  137.     HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TWMNoParams &Message);
  138.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
  139.     HIDESBASE MESSAGE void __fastcall CMTextChanged(Messages::TMessage &Message);
  140.     MESSAGE void __fastcall CMWantSpecialKey(Messages::TWMKey &Message);
  141.     
  142. protected:
  143.     void __fastcall ReformatText(const AnsiString NewMask);
  144.     void __fastcall GetSel(int &SelStart, int &SelStop);
  145.     void __fastcall SetSel(int SelStart, int SelStop);
  146.     HIDESBASE void __fastcall SetCursor(int Pos);
  147.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  148.     DYNAMIC void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
  149.     DYNAMIC void __fastcall KeyPress(char &Key);
  150.     virtual bool __fastcall EditCanModify(void);
  151.     virtual void __fastcall Reset(void);
  152.     int __fastcall GetFirstEditChar(void);
  153.     int __fastcall GetLastEditChar(void);
  154.     int __fastcall GetNextEditChar(int Offset);
  155.     int __fastcall GetPriorEditChar(int Offset);
  156.     int __fastcall GetMaxChars(void);
  157.     virtual bool __fastcall Validate(const AnsiString Value, int &Pos);
  158.     virtual void __fastcall ValidateError(void);
  159.     void __fastcall CheckCursor(void);
  160.     __property AnsiString EditMask = {read=FEditMask, write=SetEditMask};
  161.     __property TMaskedState MaskState = {read=FMaskState, write=FMaskState, nodefault};
  162.     __property int MaxLength = {read=GetMaxLength, write=SetMaxLength, default=0};
  163.     
  164. public:
  165.     __fastcall virtual TCustomMaskEdit(Classes::TComponent* AOwner);
  166.     virtual void __fastcall ValidateEdit(void);
  167.     virtual void __fastcall Clear(void);
  168.     HIDESBASE int __fastcall GetTextLen(void);
  169.     __property bool IsMasked = {read=GetMasked, nodefault};
  170.     __property AnsiString EditText = {read=GetEditText, write=SetEditText};
  171.     __property AnsiString Text = {read=GetText, write=SetText};
  172. public:
  173.     #pragma option push -w-inl
  174.     /* TWinControl.CreateParented */ inline __fastcall TCustomMaskEdit(HWND ParentWindow) : Stdctrls::TCustomEdit(
  175.         ParentWindow) { }
  176.     #pragma option pop
  177.     #pragma option push -w-inl
  178.     /* TWinControl.Destroy */ inline __fastcall virtual ~TCustomMaskEdit(void) { }
  179.     #pragma option pop
  180.     
  181. };
  182.  
  183.  
  184. class DELPHICLASS TMaskEdit;
  185. class PASCALIMPLEMENTATION TMaskEdit : public TCustomMaskEdit 
  186. {
  187.     typedef TCustomMaskEdit inherited;
  188.     
  189. __published:
  190.     __property Anchors ;
  191.     __property AutoSelect ;
  192.     __property AutoSize ;
  193.     __property BiDiMode ;
  194.     __property BorderStyle ;
  195.     __property CharCase ;
  196.     __property Color ;
  197.     __property Constraints ;
  198.     __property Ctl3D ;
  199.     __property DragCursor ;
  200.     __property DragKind ;
  201.     __property DragMode ;
  202.     __property Enabled ;
  203.     __property EditMask ;
  204.     __property Font ;
  205.     __property ImeMode ;
  206.     __property ImeName ;
  207.     __property MaxLength ;
  208.     __property ParentBiDiMode ;
  209.     __property ParentColor ;
  210.     __property ParentCtl3D ;
  211.     __property ParentFont ;
  212.     __property ParentShowHint ;
  213.     __property PasswordChar ;
  214.     __property PopupMenu ;
  215.     __property ReadOnly ;
  216.     __property ShowHint ;
  217.     __property TabOrder ;
  218.     __property TabStop ;
  219.     __property Text ;
  220.     __property Visible ;
  221.     __property OnChange ;
  222.     __property OnClick ;
  223.     __property OnDblClick ;
  224.     __property OnDragDrop ;
  225.     __property OnDragOver ;
  226.     __property OnEndDock ;
  227.     __property OnEndDrag ;
  228.     __property OnEnter ;
  229.     __property OnExit ;
  230.     __property OnKeyDown ;
  231.     __property OnKeyPress ;
  232.     __property OnKeyUp ;
  233.     __property OnMouseDown ;
  234.     __property OnMouseMove ;
  235.     __property OnMouseUp ;
  236.     __property OnStartDock ;
  237.     __property OnStartDrag ;
  238. public:
  239.     #pragma option push -w-inl
  240.     /* TCustomMaskEdit.Create */ inline __fastcall virtual TMaskEdit(Classes::TComponent* AOwner) : TCustomMaskEdit(
  241.         AOwner) { }
  242.     #pragma option pop
  243.     
  244. public:
  245.     #pragma option push -w-inl
  246.     /* TWinControl.CreateParented */ inline __fastcall TMaskEdit(HWND ParentWindow) : TCustomMaskEdit(ParentWindow
  247.         ) { }
  248.     #pragma option pop
  249.     #pragma option push -w-inl
  250.     /* TWinControl.Destroy */ inline __fastcall virtual ~TMaskEdit(void) { }
  251.     #pragma option pop
  252.     
  253. };
  254.  
  255.  
  256. //-- var, const, procedure ---------------------------------------------------
  257. extern PACKAGE char DefaultBlank;
  258. extern PACKAGE char MaskFieldSeparator;
  259. extern PACKAGE char MaskNoSave;
  260. static const char mDirReverse = '\x21';
  261. static const char mDirUpperCase = '\x3e';
  262. static const char mDirLowerCase = '\x3c';
  263. static const char mDirLiteral = '\x5c';
  264. static const char mMskAlpha = '\x4c';
  265. static const char mMskAlphaOpt = '\x6c';
  266. static const char mMskAlphaNum = '\x41';
  267. static const char mMskAlphaNumOpt = '\x61';
  268. static const char mMskAscii = '\x43';
  269. static const char mMskAsciiOpt = '\x63';
  270. static const char mMskNumeric = '\x30';
  271. static const char mMskNumericOpt = '\x39';
  272. static const char mMskNumSymOpt = '\x23';
  273. static const char mMskTimeSeparator = '\x3a';
  274. static const char mMskDateSeparator = '\x2f';
  275. extern PACKAGE bool __fastcall MaskGetMaskSave(const AnsiString EditMask);
  276. extern PACKAGE char __fastcall MaskGetMaskBlank(const AnsiString EditMask);
  277. extern PACKAGE int __fastcall MaskGetFldSeparator(const AnsiString EditMask);
  278. extern PACKAGE AnsiString __fastcall FormatMaskText(const AnsiString EditMask, const AnsiString Value
  279.     );
  280.  
  281. }    /* namespace Mask */
  282. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  283. using namespace Mask;
  284. #endif
  285. #pragma option pop    // -w-
  286. #pragma option pop    // -Vx
  287.  
  288. #pragma delphiheader end.
  289. //-- end unit ----------------------------------------------------------------
  290. #endif    // Mask
  291.