home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 February / Chip_2003-02_cd1.bin / zkuste / delphi / kompon / d34567 / KADAO77.ZIP / KADaoInfoU.pas < prev    next >
Pascal/Delphi Source File  |  2001-06-22  |  3KB  |  121 lines

  1. (*****************************************************************************)
  2. (* MODULE: ACCINFOU                                                          *)
  3. (* AUTHOR: Peter Blair                                                       *)
  4. (* RIGHTS: Reggatta Systems, Inc. - COPYRIGHT 1995 - 1998                    *)
  5. (* DESCR.: This module contains classes for InfoPower compatibility          *)
  6. (*****************************************************************************)
  7. unit KADaoInfoU;
  8. //$I BSE.INC}
  9. interface
  10. uses
  11.     DAOApi, 
  12.     {$IFDEF DAO35}
  13.     DAO35Api,
  14.     {$ENDIF}
  15.     {$IFDEF DAO36}
  16.     DAO36Api,
  17.     {$ENDIF}
  18.     DBTables, Windows, SysUtils, Classes, Db, DBCommon, KDaoDataBase, ActiveX, Forms, KDaoTable, wwTable, wwTypes;
  19.  
  20. type
  21.     TwwKADaoTable =
  22.     class( TKADaoTable )
  23.     private
  24.         FControlType    : TwwTableDisplayType;
  25.         FPictureMasks   : TStrings;
  26.         FUsePictureMask : boolean;
  27.         FOnInvalidValue : TwwInvalidValueEvent;
  28.  
  29.         function GetControlType : TStrings;
  30.         procedure SetControlType( sel : TStrings );
  31.         function GetPictureMasks : TStrings;
  32.         procedure SetPictureMasks( sel : TStrings );
  33.  
  34.     protected
  35.         procedure DoBeforePost; override; { For picture support }
  36.  
  37.     public
  38.         constructor Create( AOwner : TComponent ); override;
  39.         destructor Destroy; override;
  40.  
  41.     published
  42.         property ControlType : TStrings
  43.         read  GetControlType
  44.         write setControltype stored TRUE;
  45.         property PictureMasks: TStrings
  46.         read GetPictureMasks
  47.         write SetPictureMasks;
  48.         property ValidateWithMask : boolean
  49.         read FUsePictureMask
  50.         write FUsePictureMask;
  51.         property OnInvalidValue: TwwInvalidValueEvent
  52.         read FOnInvalidValue
  53.         write FOnInvalidValue;
  54.     end;
  55.  
  56. procedure register;
  57.  
  58. implementation
  59.  
  60. uses DaoUtils, Dialogs, SortByDialog, QueryDefDialogUnit, MasterDetailFormUnit,  wwCommon;
  61.  
  62.  
  63. constructor TwwKADaoTable.create( AOwner : TComponent );
  64. begin
  65.     inherited Create( AOwner );
  66.     FControlType    := TStringList.create;
  67.     FPictureMasks   := TStringList.create;
  68.     FUsePictureMask := True;
  69. end;
  70.  
  71.  
  72. destructor TwwKADaoTable.Destroy;
  73. begin
  74.     FControlType.Free;
  75.     FPictureMasks.Free;
  76.     FPictureMasks:= nil;
  77.     inherited Destroy;
  78. end;
  79.  
  80.  
  81. function TwwKADaoTable.GetControltype : TStrings;
  82. begin
  83.     Result := FControlType;
  84. end;
  85.  
  86.  
  87. procedure TwwKADaoTable.SetControlType( sel : TStrings );
  88. begin
  89.     FControlType.Assign( sel );
  90. end;
  91.  
  92.  
  93. function TwwKADaoTable.GetPictureMasks : TStrings;
  94. begin
  95.     Result:= FPictureMasks
  96. end;
  97.  
  98.  
  99. procedure TwwKADaoTable.SetPictureMasks( sel : TStrings );
  100. begin
  101.     FPictureMasks.Assign( sel );
  102. end;
  103.  
  104.  
  105. procedure TwwKADaoTable.DoBeforePost;
  106. begin
  107.     inherited DoBeforePost;
  108.     if FUsePictureMask then
  109.         wwValidatePictureFields( self, FOnInvalidValue );
  110. end;
  111.  
  112.  
  113. procedure register;
  114. begin
  115.     RegisterComponents('KA Dao', [ TwwKADaoTable] );
  116. end;
  117.  
  118.  
  119. end.
  120.  
  121.