In the name of Allah

Assalamo Alaikom WR WB..

--------------------------------------------------------
    File Name: hijri.txt
  Description: Instructions for using THijriDateEdit and THijriDBDateEdit
       Author: Adeeb Rantawi (adeeb@rantawi.com)
         Date: 04 June 2000
--------------------------------------------------------
Please, read text in hijri.pas file first.

Contents:
  1- Installation.
  2- Remarks.
  3- Added Properties and Events.
  4- How to use.
  5- Uninstalling.
  6- How to contact me.

--------------------------------------------------------
*** Installation ***

1- Extract files to a new folder.
2- Copy "hijri.pas" and "hijri.dcr" to your delphi\lib folder
   (or any folder you want).
3- Run Delphi.. select "Component -> Install Component...".
4- Select or type "hijri.pas" in "Unit file name" field (with complete path).
5- Click OK.. the package file will open.. Click "Install" or "Compile".

You should have two new components added to a new palette page called
"Arab Developers".. you may change this by typing what ever name you
like in following source code line (in hijri.pas file of course):

RegisterComponents('PAGE NAME HERE', [THijriDateEdit, THijriDBDateEdit]);

* We recommend that you keep it "Arab Developers" so you will add other
components in future inshallah (this is just the beginning).
--------------------------------------------------------
*** Remarks ***

This components are based on TStringGrid component because:

1- You can't use any field component (TEdit etc.) to display Arabic numbers
(hindi actually) with slashes "/" inside, like in date, without numbers being
reversed.. TRY it yourself.. this is a Windows little bug (from Arabs
prospective).
2- TStringGrid is the best way (in hand) to do it.

NOTE: Do NOT change other properties inherited from TStringGrid (I can't hide it).
--------------------------------------------------------
*** Added Properties and Events ***

- Property:  DateText >> To get or set current "hijri date" value
- Event:     OnChange >> Activated when user types something in cells
- Event:   OnDayError >> Activated when user types invalid Day value
- Event: OnMonthError >> Activated when user types invalid Month value
- Event:  OnYearError >> Activated when user types invalid Year value

NOTE: the components will not allow user to proceed without typing correct
values.. you may use On...Error events to give him/her instant error messages.
--------------------------------------------------------
*** How to use ***

1- Placing in forms:
   * Set THijriDateEdit property value "DateText" to any date like 12/12/1420.
   * Set THijriDBDateEdit associated database field value when creating the
   database so that its Default value is "TODAY".

2- From user point of view:
   * Type numbers and use "/" to jump from cell to cell or use mouse.
   * Use "Shift+Delete" to delete a number in cells (like TStringGrid).
   * Remember you can't proceed with invalid numbers!!

3- From your point of view:
   * Use it as any other components.. these components are made to be self 
     contained.
   * Its better to use common (the same) On..Error events for all components
     of this type.
   * You may use the following external functions:
     - GregToHijri(Date: TDateTime): String;
     - HijriToGreg(Date: String): TDateTime;
     - ReverseHijri(Date: String): String;
     Without using the components by adding "hijri" to your "uses" clause.
   <<<<<**********************>>>>>
   <<** THIS IS VERY IMPORTANT **>>
   <<<<<**********************>>>>>
   * For displaying in Labels, Grids, DBGrids, and Report components etc. use
     code like this:

**************
Label1.Caption := ReverseHijri(GregToHijri(Now));


{ NOTE: Use OnGetText and OnSetText from database fields palette after you add it to TTable}
procedure TDataModule.THijriDateGetText(Sender: TField; var Text: String; DisplayText: Boolean);
begin
  Text:= ReverseHijri(GregToHijri(Sender.AsDateTime));
end;

procedure TDataModule.THijriDateSetText(Sender: TField; const Text: String);
begin
  Sender.AsDateTime := HijriToGreg(Text)
end;


{ QuickReport OnPrint event }
procedure TFormReport.QRDBAllDatesPrint(sender: TObject; var Value: String);
begin
  Value := ReverseHijri(GregToHijri(StrToDate(Value))) + '';
end;
**************

--------------------------------------------------------
*** Uninstalling ***

1- Open the package where you installed "hijri.pas".
2- Delete it from package.
3- Recompile package.

You may then delete "hijri.pas" and "hijri.dcr" from folder where
you copied it.
--------------------------------------------------------
*** How to contact me ***

My name is Adeeb Rantawi.. I prefer you contact me via e-mail at adeeb@rantawi.com
Or you may send messages to http://www.arabdevelopers.com and my friends there
will reach me (May Allah bless them and you).
--------------------------------------------------------END