Recent

Author Topic: WLibrary  (Read 7437 times)

wOvAN

  • New Member
  • *
  • Posts: 47
    • wxSoft.Ru
WLibrary
« on: January 08, 2010, 02:06:54 pm »
Hello. Let me share with you a small set of components. Hoping it'll be extended in future.
For now it includes:

* TWPanel - simple panel with OnPaint event.

and a couple data aware components

* TWDBFilterDialog - Filter dialog for a given datasource.
* TWDBDateEdit.

Any ideas and coding are welcomed. :)


 

JD

  • Hero Member
  • *****
  • Posts: 1793
Re: WLibrary
« Reply #1 on: January 11, 2010, 08:51:55 am »
Hello,

I installed & tried the data bound TDateEdit & got exception errors due to this line in the code of the wdbdateedit.pas file

Code: [Select]
  FDataLink.Field.AsDateTime := Date;
Windows (10, 7) - Lazarus 2.1/FPC 3.2, Delphi

Indy 10.6 series; mORMot; Zeos 7.3; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

wOvAN

  • New Member
  • *
  • Posts: 47
    • wxSoft.Ru
Re: WLibrary
« Reply #2 on: January 13, 2010, 01:16:36 am »
Hello,

I installed & tried the data bound TDateEdit & got exception errors due to this line in the code of the wdbdateedit.pas file

Code: [Select]
  FDataLink.Field.AsDateTime := Date;

I guess the assigned field wasn't a datetime format? this could ba the only reasonable reason that caused convertion error.

JD

  • Hero Member
  • *****
  • Posts: 1793
Re: WLibrary
« Reply #3 on: January 13, 2010, 11:16:17 am »
Thanks a lot. That was the cause of problem.

I noticed that your databound date component allows edit masks. That will be very useful for me.

I also noticed that the date component does not automatically put the table in the edit state when I make changes to the date.

So I had to add the following code snippet to the component's OnKeyDown method

Code: [Select]

{-----------------------------------------------------------------------------------
  wdbedDateVisite OnKeyDown

  Procedure to put the table into edit mode once the user presses a key while in the
  date field. The component does not do this automatically so I had to add this code.

------------------------------------------------------------------------------------}
procedure TfrmCarnetdeBord.wdbedDateVisiteKeyDown(Sender: TObject;
  var Key: Word; Shift: TShiftState);
begin
  // Put the table into edit mode if this is not already the case
  //
  if dmGestionnaire.ztblCarnet.State in [dsBrowse] then
    dmGestionnaire.ztblCarnet.Edit;
end;



Will you include this modification in future releases? In addition, will you add a means of validating the date entered into the field by the user or should I used the ValidateEdit procedure of the component?
Windows (10, 7) - Lazarus 2.1/FPC 3.2, Delphi

Indy 10.6 series; mORMot; Zeos 7.3; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

 

TinyPortal © 2005-2018