飘云阁

 找回密码
 加入我们

QQ登录

只需一步,快速开始

查看: 8070|回复: 8

一個超棒的農曆控件 for Delphi

[复制链接]

该用户从未签到

发表于 2006-6-4 22:47:06 | 显示全部楼层 |阅读模式
一個超棒的農曆控件 for Delphi
ChnCalendar.pas
  1. unit ChnCalendar;

  2. interface

  3. uses
  4.   Windows, DateUtils, Messages, DateWin, Forms, SysUtils, DateCn, StdCtrls, Classes, Controls, CommCtrl, ComCtrls, Graphics;

  5. type
  6.   tagRGBTRIPLE = packed record
  7.     rgbtBlue: Byte;
  8.     rgbtGreen: Byte;
  9.     rgbtRed: Byte;
  10.   end;
  11.   TRGBTriple = tagRGBTRIPLE;
  12.   PRGBTripleArray = ^TRGBTripleArray;
  13.   TRGBTripleArray = array[0..32767] of TRGBTriple;
  14.   TChnCalendar = class(TCustomControl)
  15.   private
  16.     { Private declarations }
  17. //    isChangeBmp: Boolean;
  18.     CnDate: string;
  19.     ButtonRect: TRect;
  20.     YearEdit,
  21.       MonthEdit,
  22.       DayEdit: TEdit;
  23.     MouseStyle: integer;
  24.     FLastChange: TSystemTime;
  25.     FDateTime: TDateTime;
  26.     FFrameColor: TColor;
  27.     FCnDateColor: TColor;
  28.     FButtonColor: TColor;
  29.     FBackPicture: TbitMap;
  30.     FAlphaBlend: Byte;
  31.     procedure DrawButton(iStyle: integer);
  32.     procedure SetDateTime(const Value: TDateTime);
  33.     procedure WMSize(var Msg: TWMSize); message wm_Size;
  34.     procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN;
  35.     procedure SetFrameColor(const Value: TColor);
  36.     procedure setCnDateColor(const Value: TColor);
  37.     procedure setButtonColor(const Value: TColor);
  38.     procedure SetBackPicture(const Value: TbitMap);
  39. //    procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP;
  40. //    procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE;
  41.   protected
  42.     { Protected declarations }
  43.     procedure Paint; override;
  44.   public
  45.     { Public declarations }
  46.     constructor Create(AOwner: TComponent); override;
  47.     destructor Destroy; override;
  48.   published
  49.     { Published declarations }
  50.     property DateTime: TDateTime read FDateTime write SetDateTime;
  51.     property FrameColor: TColor read FFrameColor write SetFrameColor;
  52.     property CnDateColor: TColor read FCnDateColor write setCnDateColor;
  53.     property ButtonColor: TColor read FButtonColor write setButtonColor;
  54.     property BackPicture: TbitMap read FBackPicture write SetBackPicture;
  55.     property AlphaBlend: Byte read FAlphaBlend write FAlphaBlend;
  56.     property Color;
  57.     property Align;
  58.     property Anchors;
  59.     property Enabled;
  60.     property Font;
  61.     property ParentBiDiMode;
  62.     property ParentBackground;
  63.     property ParentColor;
  64.     property ParentCtl3D;
  65.     property ParentFont;
  66.     property ParentShowHint;
  67.     property PopupMenu;
  68.     property ShowHint;
  69.     property TabOrder;
  70.     property TabStop;
  71.     property Visible;
  72.     property OnClick;
  73.     property OnDblClick;
  74.     property OnEnter;
  75.     property OnExit;
  76.     property OnMouseDown;
  77.     property OnMouseMove;
  78.     property OnMouseUp;
  79.     property OnResize;
  80.   end;

  81. procedure Register;

  82. implementation

  83. uses Grids;

  84. procedure Register;
  85. begin
  86.   RegisterComponents('Standard', [TChnCalendar]);
  87. end;



  88. { TChnCalendar }


  89. constructor TChnCalendar.Create(AOwner: TComponent);
  90. begin
  91. //  CheckCommonControl(ICC_USEREX_CLASSES);
  92.   inherited Create(AOwner);
  93. //  DateTimeToSystemTime(DateTime, FLastChange);
  94. //  FShowCheckbox := False;
  95. //  FChecked := True;
  96.   SetBounds(0, 0, 186, 15);
  97.   ControlStyle := ControlStyle + [csAcceptsControls];
  98.   FBackPicture := TBitMap.Create;
  99.   Color := clWindow;
  100.   FCnDateColor := clGreen;
  101.   FButtonColor := clPurple;
  102.   FAlphaBlend := 50;
  103.   ParentColor := False;
  104.   TabStop := True;
  105.   YearEdit := TEdit.Create(Self);
  106.   with YearEdit do
  107.   begin
  108.     BorderStyle := bsNone;
  109.     Parent := Self;
  110.     SetBounds(0, 0, 31, 13);
  111.     Left := 3;
  112.     Top := 1;
  113.     Text := FormatDateTime('YYYY', Now);
  114.   end;

  115.   MonthEdit := TEdit.Create(Self);
  116.   with MonthEdit do
  117.   begin
  118.     BorderStyle := bsNone;
  119.     Parent := Self;
  120.     SetBounds(0, 0, 15, 13);
  121.     Left := 41;
  122.     Top := 1;
  123.     Text := FormatDateTime('M', Now);
  124.   end;

  125.   DayEdit := TEdit.Create(Self);
  126.   with DayEdit do
  127.   begin
  128.     BorderStyle := bsNone;
  129.     Parent := Self;
  130.     SetBounds(0, 0, 15, 13);
  131.     Left := 65;
  132.     Top := 1;
  133.     Text := FormatDateTime('D', Now);
  134.   end;

  135.   FRM_Date := TFRM_Date.Create(Application);
  136.   DateTime := Now;
  137. //  CnDate := CnanimalOfYear(DateTime) + CnMonthOfDate(DateTime) + CnDayOfDate(DateTime);

  138. end;


  139. destructor TChnCalendar.Destroy;
  140. begin
  141.   FBackPicture.Free;
  142.   inherited;
  143. end;

  144. procedure TChnCalendar.DrawButton(iStyle: integer);
  145.   procedure Trigon(Canvas: TCanvas; xy1, xy2, xy3: TPoint);
  146.   var
  147.     xy: array[1..4] of TPoint;
  148.   begin
  149.     xy[1] := xy1;
  150.     xy[2] := xy2;
  151.     xy[3] := xy3;
  152.     xy[4] := xy1;
  153.     Canvas.Polygon(xy);
  154.   end;
  155. var
  156.   TrigonLeft: integer;
  157. begin
  158.   Canvas.Brush.Style := bsSolid;
  159.   case iStyle of
  160.     0:
  161.       begin
  162.         Canvas.Pen.Color := FrameColor;
  163.         Canvas.Brush.Color := FButtonColor; // clPurple;
  164.       end;
  165.     1, 2:
  166.       begin
  167.         Canvas.Pen.Color := clBlack;
  168.         Canvas.Brush.Color := $00E47AC8;
  169.       end;
  170.   end;

  171.   Canvas.Rectangle(RECT(Width - 15, 1, Width - 1, Height - 1));

  172.   //画三角形
  173.   case iStyle of
  174.     0, 1:
  175.       begin
  176.         Canvas.Brush.Color := clWhite;
  177.         Canvas.Pen.Color := clWhite;
  178.       end;
  179.     2:
  180.       begin
  181.         Canvas.Brush.Color := $00E4E4E4;
  182.         Canvas.Pen.Color := $00E4E4E4;
  183.       end;
  184.   end;
  185.   TrigonLeft := Width - 15;
  186.   Trigon(Canvas, Point(TrigonLeft + 3, 5), Point(TrigonLeft + 9, 5), Point(TrigonLeft + 6, 8));

  187. end;

  188. procedure TChnCalendar.Paint;
  189. var
  190.   TextTop: integer;
  191. begin
  192.   inherited;
  193.   YearEdit.Color := color;
  194.   MonthEdit.Color := color;
  195.   DayEdit.Color := Color;
  196.   ButtonRect := RECT(Width - 15, 1, Width - 1, Height - 1);
  197.   Canvas.Pen.Color := FrameColor;
  198.   Canvas.Brush.Color := Color;
  199.   Canvas.FillRect(ClientRect);
  200.   Canvas.Rectangle(ClientRect);
  201.   canvas.Font.Color := Font.Color;
  202.   TextTop := (Height - canvas.TextHeight('A')) div 2;
  203.   Canvas.TextOut(33, TextTop, '-');
  204.   Canvas.TextOut(60, TextTop, '-');
  205.   canvas.Font.Color := FCnDateColor;
  206.   Canvas.TextOut(84, TextTop, CnDate);
  207.   canvas.Font.Color := Font.Color;

  208.   DrawButton(0);
  209. end;

  210. procedure BmpAlphaBlend(var dBmp: TBitMap; sBmp: TBitmap; Pos: TPoint; Alpha: integer; TranColor: TColor = -1);
  211.   function IntToByte(i: Integer): Byte;
  212.   begin
  213.     if i > 255 then
  214.       Result := 255
  215.     else if i < 0 then
  216.       Result := 0
  217.     else
  218.       Result := i;
  219.   end;
  220.   function GetSLColor(pRGB: TRGBTriple): TColor;
  221.   begin
  222.     Result := RGB(pRGB.rgbtRed, pRGB.rgbtGreen, pRGB.rgbtBlue);
  223.   end;
  224. var
  225.   p0, p1: PRGBTripleArray;
  226.   r, g, b, p, x, y: Integer;
  227. begin
  228.   sBmp.PixelFormat := pf24bit;
  229.   dBmp.PixelFormat := pf24bit;
  230.   if TranColor = -1 then
  231.     TranColor := sBmp.Canvas.Pixels[0, 0];
  232.   for y := 0 to sBmp.Height - 1 do
  233.     if (y + Pos.y >= 0) and (y + Pos.Y < dBmp.Height) then
  234.     begin
  235.       p0 := dBmp.ScanLine[y + Pos.y];
  236.       p1 := sBmp.ScanLine[y];
  237.       for x := 0 to sBmp.Width - 1 do
  238.         if (x + pos.X >= 0) and (x + Pos.X < dBmp.Width) then
  239.           if GetSLCOlor(p1[x]) <> TranColor then
  240.           begin
  241.             p0[x + pos.X].rgbtRed := IntToByte((p0[x + pos.X].rgbtRed * (100 - Alpha) +
  242.               p1[x].rgbtRed * Alpha) div 100);

  243.             p0[x + pos.X].rgbtGreen := IntToByte((p0[x + pos.X].rgbtGreen * (100 - Alpha) +
  244.               p1[x].rgbtGreen * Alpha) div 100);

  245.             p0[x + pos.X].rgbtBlue := IntToByte((p0[x + pos.X].rgbtBlue * (100 - Alpha) +
  246.               p1[x].rgbtBlue * Alpha) div 100);
  247.           end;
  248.     end;

  249. end;

  250. procedure TChnCalendar.SetBackPicture(const Value: TbitMap);
  251. begin
  252.   FBackPicture.Assign(Value);

  253. end;

  254. procedure TChnCalendar.setButtonColor(const Value: TColor);
  255. begin
  256.   if FButtonColor <> Value then
  257.   begin
  258.     FButtonColor := Value;
  259.     Invalidate;
  260.   end;
  261. end;

  262. procedure TChnCalendar.setCnDateColor(const Value: TColor);
  263. begin
  264.   if FCnDateColor <> Value then
  265.   begin
  266.     FCnDateColor := Value;
  267.     Invalidate;
  268.   end;
  269. end;

  270. procedure TChnCalendar.SetDateTime(const Value: TDateTime);
  271. begin
  272.   if Value <> FDateTime then
  273.   begin
  274.     FDateTime := Value;
  275.     YearEdit.Text := FormatDateTime('YYYY', FDateTime);
  276.     MonthEdit.Text := FormatDateTime('m', FDateTime);
  277.     DayEdit.Text := FormatDateTime('d', FDateTime);
  278.     CnDate := CnanimalOfYear(DateTime) + CnMonthOfDate(DateTime) + CnDayOfDate(DateTime);
  279.     Invalidate;
  280.   end;
  281. end;

  282. procedure TChnCalendar.SetFrameColor(const Value: TColor);
  283. begin
  284.   FFrameColor := Value;
  285.   Invalidate;
  286. end;

  287. function FormExists(FORM_NAME: string): BOOLEAN;
  288. begin
  289.   if Application.FindComponent(FORM_NAME) = nil then
  290.     RESULT := FALSE
  291.   else
  292.     RESULT := TRUE;
  293. end;

  294. function DayOfMonth(Year, Month: Integer): integer; overload;
  295. begin
  296.   try
  297.     Result := MonthDays[IsLeapYear(Year), Month];
  298.   except
  299.     Result := 0;
  300.   end;
  301. end;

  302. function DayOfMonth(Dates: TDateTime): integer; overload;
  303. var
  304.   Year, Month, Day, Hour: Word;

  305. begin
  306.   DecodeDate(Dates, Year, Month, day);
  307.   Result := MonthDays[IsLeapYear(Year), Month];
  308. end;

  309. function DaysOfMonth(Dates: TDateTime): Integer;
  310. begin
  311.   Result := DayOfMonth(YearOf(Dates), MonthOf(Dates));
  312. end;


  313. function SetDateTime(NYear, NMonth, NDay: Word): TDate;
  314. var
  315.   MyDay: Word;
  316. begin
  317.   MyDay := DayOfMonth(NYear, NMonth);
  318.   if MyDay < NDay then
  319.     NDay := MyDay;
  320.   Result := EncodeDate(NYear, NMonth, NDay);

  321. end;


  322. procedure AdjustDropDownForm(AControl: TControl; HostControl: TControl);
  323. var
  324.   WorkArea: TRect;
  325.   HostP, PDelpta: TPoint;
  326. begin
  327.   SystemParametersInfo(SPI_GETWORKAREA, 0, @WorkArea, 0);
  328.   HostP := HostControl.ClientToScreen(Point(0, 0));
  329.   PDelpta := AControl.ClientToScreen(Point(0, 0));

  330.   AControl.Left := HostP.x;
  331.   AControl.Top := HostP.y + HostControl.Height + 1;

  332.   if (AControl.Width > WorkArea.Right - WorkArea.Left) then
  333.     AControl.Width := WorkArea.Right - WorkArea.Left;

  334.   if (AControl.Left + AControl.Width > WorkArea.Right) then
  335.     AControl.Left := WorkArea.Right - AControl.Width;
  336.   if (AControl.Left < WorkArea.Left) then
  337.     AControl.Left := WorkArea.Left;


  338.   if (AControl.Top + AControl.Height > WorkArea.Bottom) then
  339.   begin
  340.     if (HostP.y - WorkArea.Top > WorkArea.Bottom - HostP.y - HostControl.Height) then
  341.       AControl.Top := HostP.y - AControl.Height;
  342.   end;

  343.   if (AControl.Top < WorkArea.Top) then
  344.   begin
  345.     AControl.Height := AControl.Height - (WorkArea.Top - AControl.Top);
  346.     AControl.Top := WorkArea.Top;
  347.   end;

  348.   if (AControl.Top + AControl.Height > WorkArea.Bottom) then
  349.   begin
  350.     AControl.Height := WorkArea.Bottom - AControl.Top;
  351.   end;

  352. end;


  353. procedure TChnCalendar.WMLButtonDown(var Message: TWMLButtonDown);
  354. var
  355.   xy: TPoint;
  356.   P: TPoint;
  357.   bmp: TbitMap;
  358. begin
  359.   xy := Point(Message.Pos.x, Message.Pos.y);
  360.   if PtInRect(ButtonRect, xy) then
  361.   begin
  362. //    FRM_Date.ShowDateWin(YearEdit, MonthEdit, DayEdit, Self);
  363.     FRM_Date.YearEdit := YearEdit;
  364.     FRM_Date.MonthEdit := MonthEdit;
  365.     FRM_Date.DayEdit := DayEdit;
  366.     MHostControl := Self;
  367. //if isChangeBmp then
  368.     with FRM_Date do
  369.     begin
  370.       Image1.Picture.Bitmap.Assign(FBackPicture);
  371.       Label16.Visible := FBackPicture.Width =0;
  372.       Label20.Visible := FBackPicture.Width =0;
  373.       if Image1.Picture.Graphic <> nil then
  374.       begin
  375.         bmp := TbitMap.Create;
  376.         bmp.Width := Image1.Width;
  377.         bmp.Height := Image1.Height;
  378.         bmp.Canvas.Brush.Color := Color;
  379.         bmp.Canvas.FillRect(RECT(0, 0, bmp.Width,
  380.           bmp.Height));

  381.         P := Point((bmp.Width - FBackPicture.Width) div 2,
  382.           (bmp.Height - FBackPicture.Height) div 2);
  383.         BmpAlphaBlend(bmp, FBackPicture, P, FAlphaBlend);
  384.         Image1.Canvas.Draw(0, 0, bmp);
  385.         bmp.free;

  386.       end;
  387.     end;
  388. //    isChangeBmp := False;

  389.     with FRM_Date do
  390.     begin
  391.       if Image1.Picture.Graphic = nil then
  392.         StaticText1.Caption := 'aaaa';

  393.       YearEdit.Text := IntToStr(StrTOIntDef(YearEdit.Text, YearOf(Date)));
  394.       MonthEdit.Text := IntToStr(StrTOIntDef(MonthEdit.Text, MonthOf(Date)));
  395.       DayEdit.Text := IntToStr(StrTOIntDef(DayEdit.Text, DayOfMonth(Date)));

  396.       if (StrToInt(YearEdit.Text) > 2050) or (StrToInt(YearEdit.Text) < 1901) then
  397.         YearEdit.Text := IntToStr(YearOf(Date));

  398.       if (StrToInt(MonthEdit.Text) > 12) or (StrToInt(MonthEdit.Text) < 1) then
  399.         MonthEdit.Text := IntToStr(MonthOf(Date));

  400.       if StrToInt(DayEdit.Text) > DayOfMonth(StrToInt(YearEdit.Text), StrToInt(MonthEdit.Text)) then
  401.         DayEdit.Text := IntToStr(DayOfMonth(StrToInt(YearEdit.Text), StrToInt(MonthEdit.Text)));

  402.       NDate := EncodeDate(StrToInt(YearEdit.text), StrToInt(MonthEdit.text), StrToInt(DayEdit.text));
  403.     end;
  404.     AdjustDropDownForm(FRM_Date, Self);
  405.     FRM_Date.Show;
  406. //    ShowWindow(MonthWin.Handle, SW_SHOWNORMAL);
  407.   end;
  408. {    if MouseStyle <> 2 then
  409.     begin
  410.       MouseStyle := 2;
  411.       DrawButton(2);
  412.     end;
  413. }
  414. end;
  415. {
  416. procedure TChnCalendar.WMLButtonUp(var Message: TWMLButtonUp);
  417. var
  418.   xy: TPoint;
  419. begin
  420.   xy := Point(Message.Pos.x, Message.Pos.y);
  421.   if PtInRect(ButtonRect, xy) then
  422.   begin
  423.     MouseStyle := 0;
  424.     DrawButton(0);
  425.   end;

  426. end;

  427. procedure TChnCalendar.WMMouseMove(var Message: TWMMouseMove);
  428. var
  429.   xy: TPoint;
  430. begin
  431.   xy := Point(Message.Pos.x, Message.Pos.y);
  432.   if PtInRect(ButtonRect, xy) then
  433.     if MouseStyle <> 1 then
  434.     begin
  435.       MouseStyle := 1;
  436.       DrawButton(1);
  437.     end;

  438. end;
  439. }

  440. procedure TChnCalendar.WMSize(var Msg: TWMSize);
  441. begin
  442.   YearEdit.Top := (Height - YearEdit.Height) div 2;
  443.   MonthEdit.Top := YearEdit.Top;
  444.   DayEdit.Top := YearEdit.Top;
  445. end;

  446. end.
复制代码

[ 本帖最后由 黑夜彩虹 于 2006-6-4 22:57 编辑 ]
1.gif

Calendars.rar

47.69 KB, 下载次数: 10, 下载积分: 飘云币 -2 枚

PYG19周年生日快乐!

该用户从未签到

 楼主| 发表于 2006-6-4 22:48:08 | 显示全部楼层

DateCn.pas

DateCn.pas
  1. Unit DateCn;

  2. Interface

  3. Uses Windows, SysUtils, Controls;

  4. Const
  5.   //农历月份数据,每年4字节,从1901年开始,共150年
  6.   //数据来源:UCDOS 6.0 UCT.COM
  7.   //分析整理:Copyright (c) 1996-1998, Randolph
  8.   //数据解析:
  9.   //如果第一字节的bit7为1,则该年1月1日位于农历12月,否则位于11月
  10.   //第一字节去除bit7为该年1月1日的农历日期
  11.   //         第二字节                 第三字节
  12.   //bit:     7  6  5  4  3  2  1  0   7  6  5  4  3  2  1  0
  13.   //农历月份:16 15 14 13 12 11 10 9   8  7  6  5  4  3  2  1
  14.   //农历月份指的是从该年1月1日的农历月份算起的顺序号
  15.   //农历月份对应的bit为1则该月为30日,否则为29日
  16.   //第四字节为闰月月份
  17. //  BaseDate='2000/02/04';//2000立春
  18.   BaseAnimalDate = '1972'; //1972年支为子(是鼠年)
  19.   BaseSkyStemDate = '1974'; //1974年干为甲
  20.   START_YEAR = 1901;
  21.   END_YEAR = 2050;

  22.   gLunarHolDay: Array[0..1799] Of Byte = (
  23.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1901
  24.     $96, $A4, $96, $96, $97, $87, $79, $79, $79, $69, $78, $78, //1902
  25.     $96, $A5, $87, $96, $87, $87, $79, $69, $69, $69, $78, $78, //1903
  26.     $86, $A5, $96, $A5, $96, $97, $88, $78, $78, $79, $78, $87, //1904
  27.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1905
  28.     $96, $A4, $96, $96, $97, $97, $79, $79, $79, $69, $78, $78, //1906
  29.     $96, $A5, $87, $96, $87, $87, $79, $69, $69, $69, $78, $78, //1907
  30.     $86, $A5, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //1908
  31.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1909
  32.     $96, $A4, $96, $96, $97, $97, $79, $79, $79, $69, $78, $78, //1910
  33.     $96, $A5, $87, $96, $87, $87, $79, $69, $69, $69, $78, $78, //1911
  34.     $86, $A5, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //1912
  35.     $95, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1913
  36.     $96, $B4, $96, $A6, $97, $97, $79, $79, $79, $69, $78, $78, //1914
  37.     $96, $A5, $97, $96, $97, $87, $79, $79, $69, $69, $78, $78, //1915
  38.     $96, $A5, $96, $A5, $96, $97, $88, $78, $78, $79, $77, $87, //1916
  39.     $95, $B4, $96, $A6, $96, $97, $78, $79, $78, $69, $78, $87, //1917
  40.     $96, $B4, $96, $A6, $97, $97, $79, $79, $79, $69, $78, $77, //1918
  41.     $96, $A5, $97, $96, $97, $87, $79, $79, $69, $69, $78, $78, //1919
  42.     $96, $A5, $96, $A5, $96, $97, $88, $78, $78, $79, $77, $87, //1920
  43.     $95, $B4, $96, $A5, $96, $97, $78, $79, $78, $69, $78, $87, //1921
  44.     $96, $B4, $96, $A6, $97, $97, $79, $79, $79, $69, $78, $77, //1922
  45.     $96, $A4, $96, $96, $97, $87, $79, $79, $69, $69, $78, $78, //1923
  46.     $96, $A5, $96, $A5, $96, $97, $88, $78, $78, $79, $77, $87, //1924
  47.     $95, $B4, $96, $A5, $96, $97, $78, $79, $78, $69, $78, $87, //1925
  48.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1926
  49.     $96, $A4, $96, $96, $97, $87, $79, $79, $79, $69, $78, $78, //1927
  50.     $96, $A5, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //1928
  51.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $79, $77, $87, //1929
  52.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1930
  53.     $96, $A4, $96, $96, $97, $87, $79, $79, $79, $69, $78, $78, //1931
  54.     $96, $A5, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //1932
  55.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //1933
  56.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1934
  57.     $96, $A4, $96, $96, $97, $97, $79, $79, $79, $69, $78, $78, //1935
  58.     $96, $A5, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //1936
  59.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //1937
  60.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1938
  61.     $96, $A4, $96, $96, $97, $97, $79, $79, $79, $69, $78, $78, //1939
  62.     $96, $A5, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //1940
  63.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //1941
  64.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1942
  65.     $96, $A4, $96, $96, $97, $97, $79, $79, $79, $69, $78, $78, //1943
  66.     $96, $A5, $96, $A5, $A6, $96, $88, $78, $78, $78, $87, $87, //1944
  67.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $79, $77, $87, //1945
  68.     $95, $B4, $96, $A6, $97, $97, $78, $79, $78, $69, $78, $77, //1946
  69.     $96, $B4, $96, $A6, $97, $97, $79, $79, $79, $69, $78, $78, //1947
  70.     $96, $A5, $A6, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //1948
  71.     $A5, $B4, $96, $A5, $96, $97, $88, $79, $78, $79, $77, $87, //1949
  72.     $95, $B4, $96, $A5, $96, $97, $78, $79, $78, $69, $78, $77, //1950
  73.     $96, $B4, $96, $A6, $97, $97, $79, $79, $79, $69, $78, $78, //1951
  74.     $96, $A5, $A6, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //1952
  75.     $A5, $B4, $96, $A5, $96, $97, $88, $78, $78, $79, $77, $87, //1953
  76.     $95, $B4, $96, $A5, $96, $97, $78, $79, $78, $68, $78, $87, //1954
  77.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1955
  78.     $96, $A5, $A5, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //1956
  79.     $A5, $B4, $96, $A5, $96, $97, $88, $78, $78, $79, $77, $87, //1957
  80.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //1958
  81.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1959
  82.     $96, $A4, $A5, $A5, $A6, $96, $88, $88, $88, $78, $87, $87, //1960
  83.     $A5, $B4, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //1961
  84.     $96, $B4, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //1962
  85.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1963
  86.     $96, $A4, $A5, $A5, $A6, $96, $88, $88, $88, $78, $87, $87, //1964
  87.     $A5, $B4, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //1965
  88.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //1966
  89.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1967
  90.     $96, $A4, $A5, $A5, $A6, $A6, $88, $88, $88, $78, $87, $87, //1968
  91.     $A5, $B4, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //1969
  92.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //1970
  93.     $96, $B4, $96, $A6, $97, $97, $78, $79, $79, $69, $78, $77, //1971
  94.     $96, $A4, $A5, $A5, $A6, $A6, $88, $88, $88, $78, $87, $87, //1972
  95.     $A5, $B5, $96, $A5, $A6, $96, $88, $78, $78, $78, $87, $87, //1973
  96.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //1974
  97.     $96, $B4, $96, $A6, $97, $97, $78, $79, $78, $69, $78, $77, //1975
  98.     $96, $A4, $A5, $B5, $A6, $A6, $88, $89, $88, $78, $87, $87, //1976
  99.     $A5, $B4, $96, $A5, $96, $96, $88, $88, $78, $78, $87, $87, //1977
  100.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $79, $78, $87, //1978
  101.     $96, $B4, $96, $A6, $96, $97, $78, $79, $78, $69, $78, $77, //1979
  102.     $96, $A4, $A5, $B5, $A6, $A6, $88, $88, $88, $78, $87, $87, //1980
  103.     $A5, $B4, $96, $A5, $A6, $96, $88, $88, $78, $78, $77, $87, //1981
  104.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $79, $77, $87, //1982
  105.     $95, $B4, $96, $A5, $96, $97, $78, $79, $78, $69, $78, $77, //1983
  106.     $96, $B4, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $87, //1984
  107.     $A5, $B4, $A6, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //1985
  108.     $A5, $B4, $96, $A5, $96, $97, $88, $78, $78, $79, $77, $87, //1986
  109.     $95, $B4, $96, $A5, $96, $97, $88, $79, $78, $69, $78, $87, //1987
  110.     $96, $B4, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $86, //1988
  111.     $A5, $B4, $A5, $A5, $A6, $96, $88, $88, $88, $78, $87, $87, //1989
  112.     $A5, $B4, $96, $A5, $96, $96, $88, $78, $78, $79, $77, $87, //1990
  113.     $95, $B4, $96, $A5, $86, $97, $88, $78, $78, $69, $78, $87, //1991
  114.     $96, $B4, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $86, //1992
  115.     $A5, $B3, $A5, $A5, $A6, $96, $88, $88, $88, $78, $87, $87, //1993
  116.     $A5, $B4, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //1994
  117.     $95, $B4, $96, $A5, $96, $97, $88, $76, $78, $69, $78, $87, //1995
  118.     $96, $B4, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $86, //1996
  119.     $A5, $B3, $A5, $A5, $A6, $A6, $88, $88, $88, $78, $87, $87, //1997
  120.     $A5, $B4, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //1998
  121.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //1999
  122.     $96, $B4, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $86, //2000
  123.     $A5, $B3, $A5, $A5, $A6, $A6, $88, $88, $88, $78, $87, $87, //2001
  124.     $A5, $B4, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //2002
  125.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //2003
  126.     $96, $B4, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $86, //2004
  127.     $A5, $B3, $A5, $A5, $A6, $A6, $88, $88, $88, $78, $87, $87, //2005
  128.     $A5, $B4, $96, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //2006
  129.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $69, $78, $87, //2007
  130.     $96, $B4, $A5, $B5, $A6, $A6, $87, $88, $87, $78, $87, $86, //2008
  131.     $A5, $B3, $A5, $B5, $A6, $A6, $88, $88, $88, $78, $87, $87, //2009
  132.     $A5, $B4, $96, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //2010
  133.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $79, $78, $87, //2011
  134.     $96, $B4, $A5, $B5, $A5, $A6, $87, $88, $87, $78, $87, $86, //2012
  135.     $A5, $B3, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $87, //2013
  136.     $A5, $B4, $96, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //2014
  137.     $95, $B4, $96, $A5, $96, $97, $88, $78, $78, $79, $77, $87, //2015
  138.     $95, $B4, $A5, $B4, $A5, $A6, $87, $88, $87, $78, $87, $86, //2016
  139.     $A5, $C3, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $87, //2017
  140.     $A5, $B4, $A6, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //2018
  141.     $A5, $B4, $96, $A5, $96, $96, $88, $78, $78, $79, $77, $87, //2019
  142.     $95, $B4, $A5, $B4, $A5, $A6, $97, $87, $87, $78, $87, $86, //2020
  143.     $A5, $C3, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $86, //2021
  144.     $A5, $B4, $A5, $A5, $A6, $96, $88, $88, $88, $78, $87, $87, //2022
  145.     $A5, $B4, $96, $A5, $96, $96, $88, $78, $78, $79, $77, $87, //2023
  146.     $95, $B4, $A5, $B4, $A5, $A6, $97, $87, $87, $78, $87, $96, //2024
  147.     $A5, $C3, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $86, //2025
  148.     $A5, $B3, $A5, $A5, $A6, $A6, $88, $88, $88, $78, $87, $87, //2026
  149.     $A5, $B4, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //2027
  150.     $95, $B4, $A5, $B4, $A5, $A6, $97, $87, $87, $78, $87, $96, //2028
  151.     $A5, $C3, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $86, //2029
  152.     $A5, $B3, $A5, $A5, $A6, $A6, $88, $88, $88, $78, $87, $87, //2030
  153.     $A5, $B4, $96, $A5, $96, $96, $88, $78, $78, $78, $87, $87, //2031
  154.     $95, $B4, $A5, $B4, $A5, $A6, $97, $87, $87, $78, $87, $96, //2032
  155.     $A5, $C3, $A5, $B5, $A6, $A6, $88, $88, $88, $78, $87, $86, //2033
  156.     $A5, $B3, $A5, $A5, $A6, $A6, $88, $78, $88, $78, $87, $87, //2034
  157.     $A5, $B4, $96, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //2035
  158.     $95, $B4, $A5, $B4, $A5, $A6, $97, $87, $87, $78, $87, $96, //2036
  159.     $A5, $C3, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $86, //2037
  160.     $A5, $B3, $A5, $A5, $A6, $A6, $88, $88, $88, $78, $87, $87, //2038
  161.     $A5, $B4, $96, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //2039
  162.     $95, $B4, $A5, $B4, $A5, $A6, $97, $87, $87, $78, $87, $96, //2040
  163.     $A5, $C3, $A5, $B5, $A5, $A6, $87, $88, $87, $78, $87, $86, //2041
  164.     $A5, $B3, $A5, $B5, $A6, $A6, $88, $88, $88, $78, $87, $87, //2042
  165.     $A5, $B4, $96, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //2043
  166.     $95, $B4, $A5, $B4, $A5, $A6, $97, $87, $87, $88, $87, $96, //2044
  167.     $A5, $C3, $A5, $B4, $A5, $A6, $87, $88, $87, $78, $87, $86, //2045
  168.     $A5, $B3, $A5, $B5, $A6, $A6, $87, $88, $88, $78, $87, $87, //2046
  169.     $A5, $B4, $96, $A5, $A6, $96, $88, $88, $78, $78, $87, $87, //2047
  170.     $95, $B4, $A5, $B4, $A5, $A5, $97, $87, $87, $88, $86, $96, //2048
  171.     $A4, $C3, $A5, $A5, $A5, $A6, $97, $87, $87, $78, $87, $86, //2049
  172.     $A5, $C3, $A5, $B5, $A6, $A6, $87, $88, $78, $78, $87, $87); //2050


  173.   CnData: Array[0..599] Of Byte = (
  174.     $0B, $52, $BA, $00, $16, $A9, $5D, $00, $83, $A9, $37, $05, $0E, $74, $9B,
  175.     $00,
  176.     $1A, $B6, $55, $00, $87, $B5, $55, $04, $11, $55, $AA, $00, $1C, $A6, $B5,
  177.     $00,
  178.     $8A, $A5, $75, $02, $14, $52, $BA, $00, $81, $52, $6E, $06, $0D, $E9, $37,
  179.     $00,
  180.     $18, $74, $97, $00, $86, $EA, $96, $05, $10, $6D, $55, $00, $1A, $35, $AA,
  181.     $00,
  182.     $88, $4B, $6A, $02, $13, $A5, $6D, $00, $1E, $D2, $6E, $07, $0B, $D2, $5E,
  183.     $00,
  184.     $17, $E9, $2E, $00, $84, $D9, $2D, $05, $0F, $DA, $95, $00, $19, $5B, $52,
  185.     $00,
  186.     $87, $56, $D4, $04, $11, $4A, $DA, $00, $1C, $A5, $5D, $00, $89, $A4, $BD,
  187.     $02,
  188.     $15, $D2, $5D, $00, $82, $B2, $5B, $06, $0D, $B5, $2B, $00, $18, $BA, $95,
  189.     $00,
  190.     $86, $B6, $A5, $05, $10, $56, $B4, $00, $1A, $4A, $DA, $00, $87, $49, $BA,
  191.     $03,
  192.     $13, $A4, $BB, $00, $1E, $B2, $5B, $07, $0B, $72, $57, $00, $16, $75, $2B,
  193.     $00,
  194.     $84, $6D, $2A, $06, $0F, $AD, $55, $00, $19, $55, $AA, $00, $86, $55, $6C,
  195.     $04,
  196.     $12, $C9, $76, $00, $1C, $64, $B7, $00, $8A, $E4, $AE, $02, $15, $EA, $56,
  197.     $00,
  198.     $83, $DA, $55, $07, $0D, $5B, $2A, $00, $18, $AD, $55, $00, $85, $AA, $D5,
  199.     $05,
  200.     $10, $53, $6A, $00, $1B, $A9, $6D, $00, $88, $A9, $5D, $03, $13, $D4, $AE,
  201.     $00,
  202.     $81, $D4, $AB, $08, $0C, $BA, $55, $00, $16, $5A, $AA, $00, $83, $56, $AA,
  203.     $06,
  204.     $0F, $AA, $D5, $00, $19, $52, $DA, $00, $86, $52, $BA, $04, $11, $A9, $5D,
  205.     $00,
  206.     $1D, $D4, $9B, $00, $8A, $74, $9B, $03, $15, $B6, $55, $00, $82, $AD, $55,
  207.     $07,
  208.     $0D, $55, $AA, $00, $18, $A5, $B5, $00, $85, $A5, $75, $05, $0F, $52, $B6,
  209.     $00,
  210.     $1B, $69, $37, $00, $89, $E9, $37, $04, $13, $74, $97, $00, $81, $EA, $96,
  211.     $08,
  212.     $0C, $6D, $52, $00, $16, $2D, $AA, $00, $83, $4B, $6A, $06, $0E, $A5, $6D,
  213.     $00,
  214.     $1A, $D2, $6E, $00, $87, $D2, $5E, $04, $12, $E9, $2E, $00, $1D, $EC, $96,
  215.     $0A,
  216.     $0B, $DA, $95, $00, $15, $5B, $52, $00, $82, $56, $D2, $06, $0C, $2A, $DA,
  217.     $00,
  218.     $18, $A4, $DD, $00, $85, $A4, $BD, $05, $10, $D2, $5D, $00, $1B, $D9, $2D,
  219.     $00,
  220.     $89, $B5, $2B, $03, $14, $BA, $95, $00, $81, $B5, $95, $08, $0B, $56, $B2,
  221.     $00,
  222.     $16, $2A, $DA, $00, $83, $49, $B6, $05, $0E, $64, $BB, $00, $19, $B2, $5B,
  223.     $00,
  224.     $87, $6A, $57, $04, $12, $75, $2B, $00, $1D, $B6, $95, $00, $8A, $AD, $55,
  225.     $02,
  226.     $15, $55, $AA, $00, $82, $55, $6C, $07, $0D, $C9, $76, $00, $17, $64, $B7,
  227.     $00,
  228.     $86, $E4, $AE, $05, $11, $EA, $56, $00, $1B, $6D, $2A, $00, $88, $5A, $AA,
  229.     $04,
  230.     $14, $AD, $55, $00, $81, $AA, $D5, $09, $0B, $52, $EA, $00, $16, $A9, $6D,
  231.     $00,
  232.     $84, $A9, $5D, $06, $0F, $D4, $AE, $00, $1A, $EA, $4D, $00, $87, $BA, $55,
  233.     $04,
  234.     $12, $5A, $AA, $00, $1D, $AB, $55, $00, $8A, $A6, $D5, $02, $14, $52, $DA,
  235.     $00,
  236.     $82, $52, $BA, $06, $0D, $A9, $3B, $00, $18, $B4, $9B, $00, $85, $74, $9B,
  237.     $05,
  238.     $11, $B5, $4D, $00, $1C, $D6, $A9, $00, $88, $35, $AA, $03, $13, $A5, $B5,
  239.     $00,
  240.     $81, $A5, $75, $0B, $0B, $52, $B6, $00, $16, $69, $37, $00, $84, $E9, $2F,
  241.     $06,
  242.     $10, $F4, $97, $00, $1A, $75, $4B, $00, $87, $6D, $52, $05, $11, $2D, $69,
  243.     $00,
  244.     $1D, $95, $B5, $00, $8A, $A5, $6D, $02, $15, $D2, $6E, $00, $82, $D2, $5E,
  245.     $07,
  246.     $0E, $E9, $2E, $00, $19, $EA, $96, $00, $86, $DA, $95, $05, $10, $5B, $4A,
  247.     $00,
  248.     $1C, $AB, $69, $00, $88, $2A, $D8, $03);

  249. Function DaysNumberOfDate(Date: TDate): Integer;
  250. //日期是该年的第几天,1月1日为第一天
  251. Function CnMonthOfDate(Date: TDate; Days: Integer): String; OverLoad;
  252. Function CnMonthOfDate(Date: TDate): String; OverLoad; //指定日期的农历月

  253. Function CnMonth(Date: TDate): Integer; //指定日期的农历月
  254. Function CnDay(Date: TDate): Integer; //指定日期的农历日包括节日
  255. Function CnDayOfDate(Date: TDate): String; overload; //指定日期的农历日包括节日
  256. Function CnDayOfDate(Year,Month,Day: integer): String; overload; //指定日期的农历日包括节日

  257. Function CnDayOfDate(Date: TDate; Days: integer; ShowDate: Boolean = false): String; overload; //指定日期的农历日包括节日

  258. Function CnDateOfDateStr(Date: TDate): String; //指定日期的农历日期
  259. Function CnDayOfDatePH(Date: TDate): String; //指定日期的农历月
  260. Function CnDateOfDateStrPH(Date: TDate): String; //指定日期的农历日期包括节日

  261. Function CnDayOfDateJr(Date: TDate): String; overload; //只有节日
  262. Function CnDayOfDateJr(Date: TDate; Days: Integer): String; overload; //只有节日

  263. Function CnanimalOfYear(Date: TDate): String; //返回十二生肖(地支)
  264. Function CnSkyStemOfYear(Date: TDate): String; //返回十大天干
  265. Function CnSolarTerm(Date: TDate): String; //返回十大天干

  266. Function GetLunarHolDay(InDate: TDateTime): String; overload;
  267. Function GetLunarHolDay(InDate: TDateTime; Days: Integer): String; overload;

  268. Function l_GetLunarHolDay(iYear, iMonth, iDay: Word): Word;
  269. Function GetAnimal(Date: TDate): integer; //返回十二生肖

  270. Function GetCnDateToDate(dDate: TDateTime): TDateTime; overload;
  271. Function GetCnDateToDate(cYear, cMonth, cDay: word): TDateTime; overload;

  272. Function OtherHoliday(Month, Day: integer): String;
  273. Function Holiday(Date: TDateTime; Day: integer): String;
  274. Function GetDays(ADate: TDate): Extended;

  275. Function Constellation(Date: TDateTime; Day: integer): String; overload;
  276. Function Constellation(ADate: TDate): String; overload;
  277. //procedure l_CalcLunarDate(var iYear,iMonth,iDay:Word;iSpanDays:Longword);
  278. //function CalcDateDiff(iEndYear,iEndMonth,iEndDay:Word;iStartYear:Word;iStartMonth:Word;iStartDay:Word):Longword;

  279. Implementation

  280. Function Year(MyDate: TDateTime): Word;
  281. Begin
  282.   result := StrToInt(FormatDateTime('yyyy', MyDate)); //SetDates(MyDate, 1);
  283. End;

  284. Function Month(MyDate: TDateTime): Word;
  285. Begin
  286.   result := StrToInt(FormatDateTime('mm', MyDate)); //SetDates(MyDate, 2);
  287. End;

  288. Function day(MyDate: TDateTime): Word;
  289. Begin
  290.   result := StrToInt(FormatDateTime('dd', MyDate)); //SetDates(MyDate, 3);
  291. End;


  292. //日期是该年的第几天,1月1日为第一天

  293. Function DaysNumberOfDate(Date: TDate): Integer;
  294. Var
  295.   DaysNumber: Integer;
  296.   I: Integer;
  297.   yyyy, mm, dd: Word;
  298. Begin
  299.   //  Date := StrToDate(FormatDateTime('yyyy/mm/dd', Date));
  300.   DecodeDate(Date, yyyy, mm, dd);
  301.   DaysNumber := 0;
  302.   For I := 1 To mm - 1 Do
  303.     Inc(DaysNumber, MonthDays[IsLeapYear(yyyy), I]);
  304.   Inc(DaysNumber, dd);
  305.   Result := DaysNumber;
  306. End;

  307. //日期的农历日期,返回农历格式:月份*100 + 日,负数为闰月
  308. //超出范围则返回0

  309. Function GetAnimal(Date: TDate): integer; //返回十二生肖
  310. Var
  311.   Animal: String;
  312. Begin
  313.   Animal := CnanimalOfYear(Date);
  314.   If Animal = '子鼠' Then
  315.     result := 0;

  316.   If Animal = '丑牛' Then
  317.     result := 1;

  318.   If Animal = '寅虎' Then
  319.     result := 2;

  320.   If Animal = '卯兔' Then
  321.     result := 3;

  322.   If Animal = '辰龙' Then
  323.     result := 4;

  324.   If Animal = '巳蛇' Then
  325.     result := 5;

  326.   If Animal = '午马' Then
  327.     result := 6;

  328.   If Animal = '未羊' Then
  329.     result := 7;

  330.   If Animal = '申猴' Then
  331.     result := 8;

  332.   If Animal = '酉鸡' Then
  333.     result := 9;

  334.   If Animal = '戌狗' Then
  335.     result := 10;

  336.   If Animal = '亥猪' Then
  337.     result := 11;


  338. End;

  339. Function CnDateOfDate(Date: TDate): Integer;
  340. Var
  341.   CnMonth, CnMonthDays: Array[0..15] Of Integer;
  342.   CnBeginDay, LeapMonth: Integer;
  343.   yyyy, mm, dd: Word;
  344.   Bytes: Array[0..3] Of Byte;
  345.   I: Integer;
  346.   CnMonthData: Word;
  347.   DaysCount, CnDaysCount, ResultMonth, ResultDay: Integer;
  348. Begin
  349.   //  Date := StrToDate(FormatDateTime('yyyy/mm/dd', Date));
  350.   DecodeDate(Date, yyyy, mm, dd);
  351.   If (yyyy < 1901) Or (yyyy > 2050) Then
  352.     Begin
  353.       Result := 0;
  354.       Exit;
  355.     End;
  356.   Bytes[0] := CnData[(yyyy - 1901) * 4];
  357.   Bytes[1] := CnData[(yyyy - 1901) * 4 + 1];
  358.   Bytes[2] := CnData[(yyyy - 1901) * 4 + 2];
  359.   Bytes[3] := CnData[(yyyy - 1901) * 4 + 3];
  360.   If (Bytes[0] And $80) <> 0 Then
  361.     CnMonth[0] := 12
  362.   Else
  363.     CnMonth[0] := 11;
  364.   CnBeginDay := (Bytes[0] And $7F);
  365.   CnMonthData := Bytes[1];
  366.   CnMonthData := CnMonthData Shl 8;
  367.   CnMonthData := CnMonthData Or Bytes[2];
  368.   LeapMonth := Bytes[3];

  369.   For I := 15 Downto 0 Do
  370.     Begin
  371.       CnMonthDays[15 - I] := 29;
  372.       If ((1 Shl I) And CnMonthData) <> 0 Then
  373.         Inc(CnMonthDays[15 - I]);
  374.       If CnMonth[15 - I] = LeapMonth Then
  375.         CnMonth[15 - I + 1] := -LeapMonth
  376.       Else
  377.         Begin
  378.           If CnMonth[15 - I] < 0 Then //上月为闰月
  379.             CnMonth[15 - I + 1] := -CnMonth[15 - I] + 1
  380.           Else
  381.             CnMonth[15 - I + 1] := CnMonth[15 - I] + 1;
  382.           If CnMonth[15 - I + 1] > 12 Then CnMonth[15 - I + 1] := 1;
  383.         End;
  384.     End;

  385.   DaysCount := DaysNumberOfDate(Date) - 1;
  386.   If DaysCount <= (CnMonthDays[0] - CnBeginDay) Then
  387.     Begin
  388.       If (yyyy > 1901) And
  389.         (CnDateOfDate(EncodeDate(yyyy - 1, 12, 31)) < 0) Then
  390.         ResultMonth := -CnMonth[0]
  391.       Else
  392.         ResultMonth := CnMonth[0];
  393.       ResultDay := CnBeginDay + DaysCount;
  394.     End
  395.   Else
  396.     Begin
  397.       CnDaysCount := CnMonthDays[0] - CnBeginDay;
  398.       I := 1;
  399.       While (CnDaysCount < DaysCount) And
  400.         (CnDaysCount + CnMonthDays[I] < DaysCount) Do
  401.         Begin
  402.           Inc(CnDaysCount, CnMonthDays[I]);
  403.           Inc(I);
  404.         End;
  405.       ResultMonth := CnMonth[I];
  406.       ResultDay := DaysCount - CnDaysCount;
  407.     End;
  408.   If ResultMonth > 0 Then
  409.     Result := ResultMonth * 100 + ResultDay
  410.   Else
  411.     Result := ResultMonth * 100 - ResultDay
  412. End;

  413. Function CnMonth(Date: TDate): Integer;
  414. Begin
  415.   Result := Abs(CnDateOfDate(Date) Div 100);
  416. End;

  417. Function CnMonthOfDate(Date: TDate; Days: Integer): String;
  418. Var
  419.   Year, Month, Day: word;
  420. Begin
  421.   DecodeDate(Date, Year, Month, Day);
  422.   Result := CnMonthOfDate(EncodeDate(Year, Month, Days));

  423. End;

  424. Function CnMonthOfDate(Date: TDate): String;
  425. Const
  426.   CnMonthStr: Array[1..12] Of String = (
  427.     '正', '二', '三', '四', '五', '六', '七', '八', '九', '十',
  428.     '冬', '腊');
  429. Var
  430.   Month: Integer;
  431. Begin
  432.   //  Date := StrToDate(FormatDateTime('yyyy/mm/dd', Date));
  433.   Month := CnDateOfDate(Date) Div 100;
  434.   If Month < 0 Then
  435.     Result := '闰' + CnMonthStr[-Month]
  436.   Else
  437.     Result := CnMonthStr[Month] + '月';
  438. End;

  439. Function CnDayOfDatePH(Date: TDate): String;
  440. Const
  441.   CnDayStr: Array[1..30] Of String = (
  442.     '初一', '初二', '初三', '初四', '初五',
  443.     '初六', '初七', '初八', '初九', '初十',
  444.     '十一', '十二', '十三', '十四', '十五',
  445.     '十六', '十七', '十八', '十九', '二十',
  446.     '廿一', '廿二', '廿三', '廿四', '廿五',
  447.     '廿六', '廿七', '廿八', '廿九', '三十');
  448. Var
  449.   Day: Integer;
  450. Begin
  451.   //  Date := StrToDate(FormatDateTime('yyyy/mm/dd', Date));
  452.   Day := Abs(CnDateOfDate(Date)) Mod 100;
  453.   Result := CnDayStr[Day];
  454. End;

  455. Function CnDateOfDateStr(Date: TDate): String;
  456. Begin
  457.   Result := CnMonthOfDate(Date) + CnDayOfDatePH(Date);
  458. End;

  459. Function CnDayOfDate(Date: TDate; Days: integer; ShowDate: Boolean = false): String; //指定日期的农历日包括节日
  460. Var
  461.   Year, Month, Day: word;
  462. Begin
  463.   DecodeDate(Date, Year, Month, Day);
  464.   Result := CnDayOfDate(EncodeDate(Year, Month, Days));

  465. End;

  466. Function CnDayOfDate(Year,Month,Day: integer): String; overload; //指定日期的农历日包括节日
  467. Begin
  468.   Result := CnDayOfDate(EncodeDate(Year, Month, Day));
  469. End;


  470. Function CnDay(Date: TDate): Integer;
  471. Begin
  472.   Result := Abs(CnDateOfDate(Date)) Mod 100;
  473. End;

  474. Function CnDayOfDate(Date: TDate): String;
  475. Const
  476.   CnDayStr: Array[1..30] Of String = (
  477.     '初一', '初二', '初三', '初四', '初五',
  478.     '初六', '初七', '初八', '初九', '初十',
  479.     '十一', '十二', '十三', '十四', '十五',
  480.     '十六', '十七', '十八', '十九', '二十',
  481.     '廿一', '廿二', '廿三', '廿四', '廿五',
  482.     '廿六', '廿七', '廿八', '廿九', '三十');
  483. Var
  484.   Day: Integer;
  485. Begin
  486.   //  Date := StrToDate(FormatDateTime('yyyy/mm/dd', Date));
  487.   Day := Abs(CnDateOfDate(Date)) Mod 100;
  488.   Result := CnDayStr[Day];

  489. End;

  490. Function CnDateOfDateStrPH(Date: TDate): String;
  491. Begin
  492.   Result := CnMonthOfDate(Date) + CnDayOfDate(Date);
  493. End;

  494. Function CnDayOfDateJr(Date: TDate; Days: Integer): String;
  495. Var
  496.   Year, Month, Day: word;
  497. Begin
  498.   DecodeDate(Date, Year, Month, Day);
  499.   Result := CnDayOfDateJr(EncodeDate(Year, Month, Days));

  500. End;

  501. Function CnDayOfDateJr(Date: TDate): String;
  502. Var
  503.   Day: Integer;
  504. Begin
  505.   Result := '';
  506.   Day := Abs(CnDateOfDate(Date)) Mod 100;
  507.   Case Day Of
  508.     1:
  509.       If (CnMonthOfDate(Date) = '正月') Then
  510.         Result := '春节';
  511.     5:
  512.       If CnMonthOfDate(Date) = '五月' Then
  513.         Result := '端午节';
  514.     7:
  515.       If CnMonthOfDate(Date) = '七月' Then
  516.         Result := '七夕节';
  517.     15:
  518.       If CnMonthOfDate(Date) = '八月' Then
  519.         Result := '中秋节'
  520.       Else
  521.         If (CnMonthOfDate(Date) = '正月') Then
  522.           Result := '元宵节';
  523.     9:
  524.       If CnMonthOfDate(Date) = '九月' Then
  525.         Result := '重阳节';
  526.     8:
  527.       If CnMonthOfDate(Date) = '腊月' Then
  528.         Result := '腊八节';
  529.   Else
  530.     If (CnMonthOfDate(Date + 1) = '正月') And (CnMonthOfDate(Date) <> '正月') Then
  531.       Result := '除夕';
  532.   End; {case}
  533. End;

  534. Function CnanimalOfYear(Date: TDate): String; //返回十二生肖
  535. Var
  536.   i: integer;
  537.   DateStr: String;
  538. Begin
  539.   DateStr := FormatDateTime('yyyy/mm/dd', Date);
  540.   i := length(inttostr(month(date)));
  541.   Case (StrToInt(Copy(DateStr, 1, 4)) - StrToInt(BaseAnimalDate))
  542.     Mod 12 Of
  543.     0:
  544.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  545.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  546.         Result := '子鼠'
  547.       Else
  548.         Begin
  549.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  550.             Result := '亥猪'
  551.           Else
  552.             Result := '子鼠';
  553.         End;
  554.     1, -11:
  555.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  556.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  557.         Result := '丑牛'
  558.       Else
  559.         Begin
  560.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  561.             Result := '子鼠'
  562.           Else
  563.             Result := '丑牛';
  564.         End;
  565.     2, -10:
  566.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  567.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  568.         Result := '寅虎'
  569.       Else
  570.         Begin
  571.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  572.             Result := '丑牛'
  573.           Else
  574.             Result := '寅虎';
  575.         End;
  576.     3, -9:
  577.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  578.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  579.         Result := '卯兔'
  580.       Else
  581.         Begin
  582.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  583.             Result := '寅虎'
  584.           Else
  585.             Result := '卯兔';
  586.         End;
  587.     4, -8:
  588.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  589.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  590.         Result := '辰龙'
  591.       Else
  592.         Begin
  593.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  594.             Result := '卯兔'
  595.           Else
  596.             Result := '辰龙';
  597.         End;
  598.     5, -7:
  599.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  600.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  601.         Result := '巳蛇'
  602.       Else
  603.         Begin
  604.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  605.             Result := '辰龙'
  606.           Else
  607.             Result := '巳蛇';
  608.         End;
  609.     6, -6:
  610.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  611.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  612.         Result := '午马'
  613.       Else
  614.         Begin
  615.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  616.             Result := '巳蛇'
  617.           Else
  618.             Result := '午马';
  619.         End;
  620.     7, -5:
  621.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  622.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  623.         Result := '未羊'
  624.       Else
  625.         Begin
  626.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  627.             Result := '午马'
  628.           Else
  629.             Result := '未羊';
  630.         End;
  631.     8, -4:
  632.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  633.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  634.         Result := '申猴'
  635.       Else
  636.         Begin
  637.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  638.             Result := '未羊'
  639.           Else
  640.             Result := '申猴';
  641.         End;
  642.     9, -3:
  643.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  644.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  645.         Result := '酉鸡'
  646.       Else
  647.         Begin
  648.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  649.             Result := '申猴'
  650.           Else
  651.             Result := '酉鸡';
  652.         End;
  653.     10, -2:
  654.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  655.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  656.         Result := '戌狗'
  657.       Else
  658.         Begin
  659.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  660.             Result := '酉鸡'
  661.           Else
  662.             Result := '戌狗';
  663.         End;
  664.     11, -1:
  665.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  666.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  667.         Result := '亥猪'
  668.       Else
  669.         Begin
  670.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  671.             Result := '戌狗'
  672.           Else
  673.             Result := '亥猪';
  674.         End;
  675.   End; {case}
  676. End;

  677. Function CnSkyStemOfYear(Date: TDate): String; //返回十大天干
  678. Var
  679.   i: integer;
  680.   DateStr: String;
  681. Begin
  682.   DateStr := FormatDateTime('yyyy/mm/dd', Date);
  683.   i := length(inttostr(month(date)));
  684.   Case (StrToInt(Copy(DateStr, 1, 4)) - StrToInt(BaseSkyStemDate))
  685.     Mod 10 Of
  686.     0:
  687.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  688.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  689.         Result := '甲'
  690.       Else
  691.         Begin
  692.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  693.             Result := '癸'
  694.           Else
  695.             Result := '甲';
  696.         End;
  697.     1, -9:
  698.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  699.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  700.         Result := '乙'
  701.       Else
  702.         Begin
  703.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  704.             Result := '甲'
  705.           Else
  706.             Result := '乙';
  707.         End;
  708.     2, -8:
  709.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  710.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  711.         Result := '丙'
  712.       Else
  713.         Begin
  714.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  715.             Result := '乙'
  716.           Else
  717.             Result := '丙';
  718.         End;
  719.     3, -7:
  720.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  721.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  722.         Result := '丁'
  723.       Else
  724.         Begin
  725.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  726.             Result := '丙'
  727.           Else
  728.             Result := '丁';
  729.         End;
  730.     4, -6:
  731.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  732.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  733.         Result := '戊'
  734.       Else
  735.         Begin
  736.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  737.             Result := '丁'
  738.           Else
  739.             Result := '戊';
  740.         End;
  741.     5, -5:
  742.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  743.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  744.         Result := '巳'
  745.       Else
  746.         Begin
  747.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  748.             Result := '戊'
  749.           Else
  750.             Result := '巳';
  751.         End;
  752.     6, -4:
  753.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  754.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  755.         Result := '庚'
  756.       Else
  757.         Begin
  758.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  759.             Result := '巳'
  760.           Else
  761.             Result := '庚';
  762.         End;
  763.     7, -3:
  764.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  765.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  766.         Result := '辛'
  767.       Else
  768.         Begin
  769.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  770.             Result := '庚'
  771.           Else
  772.             Result := '辛';
  773.         End;
  774.     8, -2:
  775.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  776.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  777.         Result := '壬'
  778.       Else
  779.         Begin
  780.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  781.             Result := '辛'
  782.           Else
  783.             Result := '壬';
  784.         End;
  785.     9, -1:
  786.       If (StrToInt(Copy(DateStr, 6, i)) < 4) And ((Pos('腊',
  787.         CnMonthOfDate(Date)) = 0) And (Pos('冬', CnMonthOfDate(Date)) = 0)) Then
  788.         Result := '癸'
  789.       Else
  790.         Begin
  791.           If StrToInt(Copy(DateStr, 6, i)) < 4 Then
  792.             Result := '壬'
  793.           Else
  794.             Result := '癸';
  795.         End;
  796.   End;
  797.   Result := Result + Copy(CnanimalOfYear(Date), 1, 3);
  798. End;

  799. Function CnSolarTerm(Date: TDate): String; //返回十大天干
  800. Var
  801.   Year, Month, Day, Hour: Word;
  802. Begin
  803.   DecodeDate(Date, Year, Month, Day);
  804.   //  d:=( ( 31556925974.7*(Year-1900) + SolarTerm[Month]*60000) + Date(1900,0,6,2,5) );

  805. End;

  806. Function GetLunarHolDay(InDate: TDateTime; Days: Integer): String;
  807. Var
  808.   Year, Month, Day, Hour: Word;
  809. Begin
  810.   DecodeDate(Date, Year, Month, Day);
  811.   Result := GetLunarHolDay(EncodeDate(Year, Month, Days));

  812. End;

  813. Function GetLunarHolDay(InDate: TDateTime): String;
  814. Var
  815.   i, iYear, iMonth, iDay: Word;
  816. Begin
  817.   //  InDate := StrToDate(FormatDateTime('yyyy/mm/dd', InDate));

  818.   Result := '';
  819.   DecodeDate(InDate, iYear, iMonth, iDay);

  820.   i := l_GetLunarHolDay(iYear, iMonth, iDay);
  821.   Case i Of
  822.     1: Result := '小寒';
  823.     2: Result := '大寒';
  824.     3: Result := '立春';
  825.     4: Result := '雨水';
  826.     5: Result := '惊蛰';
  827.     6: Result := '春分';
  828.     7: Result := '清明';
  829.     8: Result := '谷雨';
  830.     9: Result := '立夏';
  831.     10: Result := '小满';
  832.     11: Result := '芒种';
  833.     12: Result := '夏至';
  834.     13: Result := '小暑';
  835.     14: Result := '大暑';
  836.     15: Result := '立秋';
  837.     16: Result := '处暑';
  838.     17: Result := '白露';
  839.     18: Result := '秋分';
  840.     19: Result := '寒露';
  841.     20: Result := '霜降';
  842.     21: Result := '立冬';
  843.     22: Result := '小雪';
  844.     23: Result := '大雪';
  845.     24: Result := '冬至';
  846.   End;
  847. End;

  848. Function l_GetLunarHolDay(iYear, iMonth, iDay: Word): Word;
  849. Var
  850.   Flag: Byte;
  851.   Day: Word;
  852. Begin
  853.   //  var offDate = new Date( ( 31556925974.7*(y-1900) + sTermInfo[n]*60000  ) + Date.UTC(1900,0,6,2,5) )
  854.   Flag := gLunarHolDay[(iYear - START_YEAR) * 12 + iMonth - 1];
  855.   If iDay < 15 Then
  856.     Day := 15 - ((Flag Shr 4) And $0F)
  857.   Else
  858.     Day := (Flag And $0F) + 15;
  859.   If iDay = Day Then
  860.     If iDay > 15 Then
  861.       Result := (iMonth - 1) * 2 + 2
  862.     Else
  863.       Result := (iMonth - 1) * 2 + 1
  864.   Else
  865.     Result := 0;
  866. End;


  867. Function OtherHoliday(Month, Day: integer): String;
  868. Begin
  869.   //五月的第二个星期日庆祝母亲节
  870.   //將每年6月的第3個星期天定為父親節      ?
  871.   {

  872.   新年元旦[01/01] 腊八节[农历十二月初八]


  873.    世界湿地日[02/02] 国际气象节[02/10] 情人节[02/14]
  874.   除夕[农历十二月三十] 春节[农历正月初一] 元宵节[农历正月十五]


  875.    全国爱耳日[03/03] 妇女节[03/08] 植树节[03/12]
  876.   国际警察日[03/14] 国际消费日[03/15] 世界森林日[03/21]
  877.   世界水日[03/22] 世界气象日[03/23] 世界防治结核病日[03/24]


  878.    愚人节[04/01] 清明[04/05] 世界卫生日[04/07]
  879.   世界地球日[04/22]


  880.    国际劳动节[05/01] 中国青年节[05/04] 全国碘缺乏病日[05/05]
  881.   世界红十字日[05/08] 国际护士节[05/12] 国际家庭日[05/15]
  882.   世界电信日[05/17] 国际博物馆日[05/18] 全国助残日[05/19]
  883.   全国学生营养日[05/20] 国际生物多样性日[05/22] 国际牛奶日[05/23]
  884.   世界无烟日[05/31] 端午节[农历五月初五] 母亲节[第二个星期日]


  885.    国际儿童节[06/01] 世界环境日[06/05] 全国爱眼日[06/06]
  886.   端午节[06/15] 父亲节[第三个星期日] 防治荒漠化和干旱日[06/17]
  887.   国际奥林匹克日[06/23] 全国土地日[06/25] 国际反毒品日[06/26]


  888.    香港回归日[07/01] 七夕情人节[农历七月初七] 建党日[07/01] 
  889.   中国人民抗日战争纪念日[07/07] 世界人口日[07/11] 


  890.    八一建军节[08/01]  


  891.    劳动节[09/02]  国际扫盲日[09/08] 教师节[09/10]
  892.   国际臭氧层保护日[09/16] 国际和平日[09/17] 国际爱牙日[09/20]
  893.   中秋节[农历八月十五] 国际聋人节[09/22] 世界旅游日[09/27]
  894.   重阳节[农历九月九日]


  895.    国庆节[10/01]  国际音乐节[10/01] 国际减轻自然灾害日[10/02]
  896.   世界动物日[10/04] 国际住房日[10/07] 全国高血压日[10/08]
  897.   世界视觉日[10/08] 世界邮政日[10/09] 世界精神卫生日[10/10]
  898.   国际盲人节[10/15] 世界粮食节[10/16] 世界消除贫困日[10/17]
  899.   世界传统医药日[10/22] 联合国日[10/24] 万圣节[10/31]



  900.    中国记者日[11/08]  消防宣传日[11/09] 世界糖尿病日[11/14]
  901.   国际大学生节[11/17] 感恩节[11/28]


  902.    冬至节[农历12月22日] 世界艾滋病日[12/01] 世界残疾人日[12/03]
  903.   世界足球日[12/09] 圣诞节[12/25]





  904.   }
  905.   result := '';

  906.   Case Month Of
  907.     1:
  908.       Begin
  909.       End;

  910.     2:
  911.       Begin

  912.         If day = 2 Then
  913.           result := '湿地日';

  914.         If day = 10 Then
  915.           result := '气象节';

  916.       End;
  917.     3:
  918.       Begin
  919.         If day = 3 Then
  920.           result := '爱耳日';


  921.         If day = 12 Then
  922.           result := '植树节';

  923.         If day = 14 Then
  924.           result := '警察日';

  925.         If day = 15 Then
  926.           result := '消费节';

  927.         If day = 21 Then
  928.           result := '森林日';

  929.         If day = 22 Then
  930.           result := '水日';

  931.         If day = 23 Then
  932.           result := '气象日';

  933.       End;
  934.     4:
  935.       Begin

  936.         If day = 7 Then
  937.           result := '卫生日';

  938.         If day = 22 Then
  939.           result := '地球日';

  940.       End;
  941.     5:
  942.       Begin
  943.         If day = 8 Then
  944.           result := '红十字';

  945.         If day = 12 Then
  946.           result := '护士节';

  947.         If day = 15 Then
  948.           result := '家庭日';

  949.         If day = 17 Then
  950.           result := '电信日';

  951.         If day = 18 Then
  952.           result := '博物馆';

  953.         If day = 19 Then
  954.           result := '助残日';

  955.         If day = 23 Then
  956.           result := '牛奶日';

  957.         If day = 31 Then
  958.           result := '无烟日';

  959.         // 母亲节[第二个星期日]
  960.       End;
  961.     6:
  962.       Begin

  963.         If day = 5 Then
  964.           result := '环境日';

  965.         If day = 6 Then
  966.           result := '爱眼日';

  967.         If day = 23 Then
  968.           result := '体育日';

  969.         If day = 25 Then
  970.           result := '土地日';

  971.         If day = 26 Then
  972.           result := '反毒品';

  973.         // 父亲节[第三个星期日]
  974.       End;
  975.     7:
  976.       Begin

  977.         If day = 11 Then
  978.           result := '人口日';

  979.       End;
  980.     8:
  981.       Begin

  982.       End;
  983.     9:
  984.       Begin
  985.         If day = 8 Then
  986.           result := '扫盲日';


  987.         If day = 17 Then
  988.           result := '和平日';

  989.         If day = 20 Then
  990.           result := '爱牙日';

  991.         If day = 22 Then
  992.           result := '聋人节';

  993.         If day = 27 Then
  994.           result := '旅游日';

  995.       End;
  996.     10:
  997.       Begin

  998.         If day = 6 Then
  999.           result := '老人节';

  1000.         If day = 4 Then
  1001.           result := '动物日';

  1002.         If day = 7 Then
  1003.           result := '住房日';

  1004.         If day = 9 Then
  1005.           result := '邮政日';

  1006.         If day = 15 Then
  1007.           result := '盲人节';

  1008.         If day = 16 Then
  1009.           result := '粮食日';


  1010.       End;

  1011.     11:
  1012.       Begin
  1013.         If day = 8 Then
  1014.           result := '记者日';

  1015.         If day = 9 Then
  1016.           result := '消防日';

  1017.         If day = 17 Then
  1018.           result := '大学生';


  1019.       End;
  1020.     12:
  1021.       Begin
  1022.         If day = 9 Then
  1023.           result := '足球日';

  1024.         If day = 24 Then
  1025.           result := '平安夜';
  1026.       End;

  1027.   End;
  1028. End;

  1029. Function Holiday(Date: TDateTime; Day: integer): String;
  1030. Var
  1031.   dDate: TDate;
  1032. Begin
  1033.   result := '';
  1034. //  result := OtherHoliday(Month(Date), Day);

  1035.   Case Month(Date) Of
  1036.     1:
  1037.       Begin
  1038.         If day = 1 Then
  1039.           result := '元旦节';
  1040.       End;

  1041.     2:
  1042.       Begin
  1043.         If day = 14 Then
  1044.           result := '情人节';
  1045.       End;
  1046.     3:
  1047.       Begin
  1048.         If day = 8 Then
  1049.           result := '妇女节';
  1050.       End;
  1051.     4:
  1052.       Begin
  1053.         If day = 1 Then
  1054.           result := '愚人节';
  1055.       End;
  1056.     5:
  1057.       Begin
  1058.         If day = 1 Then
  1059.           result := '劳动节';

  1060.         If day = 4 Then
  1061.           result := '青年节';

  1062.         // 母亲节[第二个星期日]
  1063.         dDate := EnCodeDate(Year(Date), Month(Date), Day);
  1064.         If (DayOfWeek(dDate) = 1) Then
  1065.           If (Trunc((Day - 1) / 7) = 1) Then
  1066.             result := '母亲节';

  1067.       End;
  1068.     6:
  1069.       Begin
  1070.         If day = 1 Then
  1071.           result := '儿童节';

  1072.         // 父亲节[第三个星期日]
  1073.         dDate := EnCodeDate(Year(Date), Month(Date), Day);
  1074.         If (DayOfWeek(dDate) = 1) Then
  1075.           If (Trunc((Day - 1) / 7) = 2) Then
  1076.             result := '父亲节';
  1077.       End;
  1078.     7:
  1079.       Begin
  1080.         If day = 1 Then
  1081.           result := '建党节';
  1082.       End;
  1083.     8:
  1084.       Begin
  1085.         If day = 1 Then
  1086.           result := '建军节';

  1087.       End;
  1088.     9:
  1089.       Begin
  1090.         If day = 10 Then
  1091.           result := '教师节';
  1092.       End;
  1093.     10:
  1094.       Begin
  1095.         If day = 1 Then
  1096.           result := '国庆节';

  1097.         If day = 6 Then
  1098.           result := '老人节';

  1099.         If day = 31 Then
  1100.           result := '万圣节';

  1101.       End;

  1102.     11:
  1103.       Begin
  1104.         If day = 8 Then
  1105.           result := '记者日';

  1106.         // 感恩节(11月的第四个星期四 )
  1107.         dDate := EnCodeDate(Year(Date), Month(Date), Day);
  1108.         If (DayOfWeek(dDate) = 5) Then
  1109.           If (Trunc((Day - 1) / 7) = 3) Then
  1110.             result := '感恩节';

  1111.       End;
  1112.     12:
  1113.       Begin
  1114.         If day = 25 Then
  1115.           result := '圣诞节';
  1116.       End;

  1117.   End;
  1118. End;

  1119. Function GetCnDateToDate(dDate: TDateTime): TDateTime;
  1120. Begin
  1121.   Result := GetCnDateToDate(Year(Now), CnMonth(dDate), CnDay(dDate));
  1122. End;

  1123. Function GetCnDateToDate(cYear, cMonth, cDay: word): TDateTime;
  1124. Var
  1125.   tempDate: TDateTime;
  1126.   tempDay, tempMonth: Integer;

  1127. Begin
  1128.   If cMonth > 11 Then
  1129.     tempDate := EnCodeDate(cYear - 1, cMonth, cDay)
  1130.   Else
  1131.     tempDate := EnCodeDate(cYear, cMonth, cDay);

  1132.   Result := 0;
  1133.   tempMonth := 0;
  1134.   tempDay := 0;
  1135.   While Result = 0 Do
  1136.     Begin
  1137.       tempDate := tempDate + 1;

  1138.       If CnMonth(tempDate) = cMonth Then
  1139.         If CnDay(tempDate) = cDay Then
  1140.           Begin
  1141.             Result := tempDate;
  1142.             exit;
  1143.           End
  1144.         Else
  1145.           If (cDay = 30) And (CnDay(tempDate) = 29)
  1146.             And (CnDay(tempDate + 1) <> 30) Then
  1147.             Begin
  1148.             //如果是没有30(闰月),就提前一天
  1149.               Result := tempDate;
  1150.               exit;
  1151.             End;

  1152.     End;
  1153. End;

  1154. Function GetDays(ADate: TDate): Extended;
  1155. Var
  1156.   FirstOfYear: TDateTime;
  1157. Begin
  1158.   FirstOfYear := EncodeDate(StrToInt(FormatDateTime('yyyy', now)) - 1, 12, 31);
  1159.   Result := ADate - FirstOfYear;
  1160. End;

  1161. Function Constellation(Date: TDateTime; Day: integer): String; overload;
  1162. Var
  1163.   Year, Month, Days, Hour: Word;
  1164. Begin
  1165.   DecodeDate(Date, Year, Month, Days);
  1166.   Result := Constellation(EncodeDate(Year, Month, Day));
  1167. end;

  1168. Function Constellation(ADate: TDate): String;
  1169. Begin
  1170.   Case Month(ADate) Of
  1171.     1:
  1172.       Begin
  1173.         If day(ADate) <= 19 Then
  1174.           result := '摩羯座';

  1175.         If day(ADate) >= 20 Then
  1176.           result := '水瓶座';
  1177.       End;

  1178.     2:
  1179.       Begin
  1180.         If day(ADate) <= 18 Then
  1181.           result := '水瓶座';

  1182.         If day(ADate) >= 19 Then
  1183.           result := '双鱼座';
  1184.       End;

  1185.     3:
  1186.       Begin
  1187.         If day(ADate) <= 20 Then
  1188.           result := '双鱼座';

  1189.         If day(ADate) >= 21 Then
  1190.           result := '白羊座';
  1191.       End;

  1192.     4:
  1193.       Begin
  1194.         If day(ADate) <= 19 Then
  1195.           result := '白羊座';

  1196.         If day(ADate) >= 20 Then
  1197.           result := '金牛座';
  1198.       End;

  1199.     5:
  1200.       Begin
  1201.         If day(ADate) <= 20 Then
  1202.           result := '金牛座';

  1203.         If day(ADate) >= 21 Then
  1204.           result := '双子座';
  1205.       End;

  1206.     6:
  1207.       Begin
  1208.         If day(ADate) <= 21 Then
  1209.           result := '双子座';

  1210.         If day(ADate) >= 22 Then
  1211.           result := '巨蟹座';
  1212.       End;

  1213.     7:
  1214.       Begin
  1215.         If day(ADate) <= 22 Then
  1216.           result := '巨蟹座';

  1217.         If day(ADate) >= 23 Then
  1218.           result := '狮子座';
  1219.       End;

  1220.     8:
  1221.       Begin
  1222.         If day(ADate) <= 22 Then
  1223.           result := '狮子座';

  1224.         If day(ADate) >= 24 Then
  1225.           result := '处女座';
  1226.       End;

  1227.     9:
  1228.       Begin
  1229.         If day(ADate) <= 22 Then
  1230.           result := '处女座';

  1231.         If day(ADate) >= 23 Then
  1232.           result := '天秤座';
  1233.       End;

  1234.     10:
  1235.       Begin
  1236.         If day(ADate) <= 23 Then
  1237.           result := '天秤座';

  1238.         If day(ADate) >= 24 Then
  1239.           result := '天蝎座';
  1240.       End;

  1241.     11:
  1242.       Begin
  1243.         If day(ADate) <= 21 Then
  1244.           result := '天蝎座';

  1245.         If day(ADate) >= 22 Then
  1246.           result := '射手座';
  1247.       End;

  1248.     12:
  1249.       Begin
  1250.         If day(ADate) <= 21 Then
  1251.           result := '射手座';

  1252.         If day(ADate) >= 22 Then
  1253.           result := '摩羯座';
  1254.       End;
  1255.   End;
  1256. End;
  1257. {
  1258. //存储星座配信息
  1259. 1白羊座: 03月21日-------04月19日  Aries
  1260. 2金牛座: 04月20日-------05月20日  Taurus
  1261. 3双子座: 05月21日-------06月21日  Gemini
  1262. 4巨蟹座: 06月22日-------07月22日  Cancer
  1263. 5狮子座: 07月23日-------08月22日  Leo
  1264. 6处女座: 08月23日-------09月22日  Virgo
  1265. 7天秤座: 09月23日-------10月23日  Libra
  1266. 8天蝎座: 10月24日-------11月21日  Scorpio
  1267. 9射手座: 11月22日-------12月21日  Sagittarius
  1268. 10摩羯座: 12月22日-------01月19日  Capricorn
  1269. 11水瓶座: 01月20日-------02月18日  Aquarius
  1270. 12双鱼座: 02月19日-------03月20日  Pisces
  1271. }
  1272. End.

复制代码
PYG19周年生日快乐!

该用户从未签到

 楼主| 发表于 2006-6-4 22:49:28 | 显示全部楼层

DateWin.pas

DateWin.pas
  1. unit DateWin;

  2. interface

  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   ExtCtrls, StdCtrls, ComCtrls, DateUtils;

  6. type
  7.   TFRM_Date = class(TForm)
  8.     Label1: TLabel;
  9.     Label2: TLabel;
  10.     Label3: TLabel;
  11.     Label4: TLabel;
  12.     Label5: TLabel;
  13.     Label6: TLabel;
  14.     Label7: TLabel;
  15.     Label8: TLabel;
  16.     day1: TLabel;
  17.     Cnday: TLabel;
  18.     Label9: TLabel;
  19.     Label10: TLabel;
  20.     Label11: TLabel;
  21.     Label12: TLabel;
  22.     Label13: TLabel;
  23.     Label14: TLabel;
  24.     Label15: TLabel;
  25.     Bevel1: TBevel;
  26.     Bevel2: TBevel;
  27.     Label16: TLabel;
  28.     Label17: TLabel;
  29.     Label18: TLabel;
  30.     Label19: TLabel;
  31.     Shape2: TShape;
  32.     UpDown1: TUpDown;
  33.     UpDown2: TUpDown;
  34.     Label20: TLabel;
  35.     StaticText1: TStaticText;
  36.     Label21: TLabel;
  37.     Label22: TLabel;
  38.     Image1: TImage;
  39.     Shape1: TShape;
  40.     //CnDayClick
  41.     procedure CnDayClick(Sender: TObject);
  42.     procedure CHnDayClick(Sender: TObject);
  43.     procedure Label1Click(Sender: TObject);
  44.     procedure FormCreate(Sender: TObject);
  45.     procedure FormShow(Sender: TObject);
  46.     procedure UpDown1Click(Sender: TObject; Button: TUDBtnType);
  47.     procedure Label17Click(Sender: TObject);
  48.     procedure UpDown2Click(Sender: TObject; Button: TUDBtnType);
  49.     procedure Label5Click(Sender: TObject);
  50.     procedure FormDeactivate(Sender: TObject);
  51.     procedure CnDayMouseDown(Sender: TObject; Button: TMouseButton;
  52.       Shift: TShiftState; X, Y: Integer);
  53.     procedure ChnDateMouseDown(Sender: TObject; Button: TMouseButton;
  54.       Shift: TShiftState; X, Y: Integer);
  55.     procedure StaticText1Click(Sender: TObject);
  56.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  57.     procedure FormPaint(Sender: TObject);

  58.   private
  59.     { Private declarations }
  60.     procedure LoadLAB;
  61.     procedure DateChange(MyTime: TDateTime);
  62.     procedure OK;
  63.   public
  64.     { Public declarations }
  65.     FPicture_AlphaBlend: Byte;
  66.     FPicture: TbitMap;
  67.     NDate: Tdate;
  68.     YearEdit, MonthEdit, DayEdit: TEdit;
  69.     ChDateLabel: TLabel;

  70.     procedure ShowDateWin(YearEdit1, MonthEdit1, DayEdit1: TEdit; {ChDateLabel1: TLabel;} HostControl: TControl; Bmp: TBitMap = nil; iAlphaBlend: Byte = 150);
  71.   end;

  72. var
  73.   FRM_Date: TFRM_Date;
  74.   CnDate: array[1..37] of TLabel;
  75.   ChnDate: array[1..37] of TLabel;
  76.   NYear, NMonth, NDay: Word;
  77.   MHostControl: TControl;
  78. implementation

  79. uses DateCn, ChnCalendar;

  80. {$R *.DFM}



  81. function FormExists(FORM_NAME: string): BOOLEAN;
  82. begin
  83.   if Application.FindComponent(FORM_NAME) = nil then
  84.     RESULT := FALSE
  85.   else
  86.     RESULT := TRUE;
  87. end;

  88. function DayOfMonth(Year, Month: Integer): integer; overload;
  89. begin
  90.   try
  91.     Result := MonthDays[IsLeapYear(Year), Month];
  92.   except
  93.     Result := 0;
  94.   end;
  95. end;

  96. function DayOfMonth(Dates: TDateTime): integer; overload;
  97. var
  98.   Year, Month, Day, Hour: Word;

  99. begin
  100.   DecodeDate(Dates, Year, Month, day);
  101.   Result := MonthDays[IsLeapYear(Year), Month];
  102. end;

  103. function DaysOfMonth(Dates: TDateTime): Integer;
  104. begin
  105.   Result := DayOfMonth(YearOf(Dates), MonthOf(Dates));
  106. end;


  107. function SetDateTime(NYear, NMonth, NDay: Word): TDate;
  108. var
  109.   MyDay: Word;
  110. begin
  111.   MyDay := DayOfMonth(NYear, NMonth);
  112.   if MyDay < NDay then
  113.     NDay := MyDay;
  114.   Result := EncodeDate(NYear, NMonth, NDay);

  115. end;


  116. procedure TFRM_Date.Label1Click(Sender: TObject);
  117. begin
  118.   //  Self.Close ;
  119.   UpDown1.Visible := true;
  120.   UpDown2.Visible := false;

  121. end;

  122. procedure TFRM_Date.LoadLAB;
  123. var
  124.   i: integer;
  125. begin

  126.   for i := 1 to 37 do
  127.   begin
  128.     CnDate[i] := TLabel.Create(self);
  129.     CnDate[i].parent := self;
  130.     ChnDate[i] := TLabel.Create(self);
  131.     ChnDate[i].parent := self;

  132.     CnDate[i].OnClick := CnDayClick;
  133.     CnDate[i].OnMouseDown := CnDayMouseDown;
  134.     ChnDate[i].OnClick := ChnDayClick;
  135.     ChnDate[i].OnMouseDown := ChnDateMouseDown;
  136.     CnDate[i].AutoSize := false;
  137.     ChnDate[i].AutoSize := false;
  138.     CnDate[i].Width := day1.Width;
  139.     ChnDate[i].Width := Cnday.Width;
  140.     CnDate[i].Height := day1.Height;
  141.     ChnDate[i].Height := Cnday.Height;
  142.     CnDate[i].Alignment := day1.Alignment;
  143.     ChnDate[i].Alignment := Cnday.Alignment;
  144.     CnDate[i].Layout := day1.Layout;
  145.     ChnDate[i].Layout := Cnday.Layout;

  146.     if i = 1 then
  147.     begin
  148.       CnDate[i].Left := day1.Left;
  149.       CnDate[i].Top := day1.Top;
  150.       ChnDate[i].Left := Cnday.Left;
  151.       ChnDate[i].Top := Cnday.Top;

  152.     end
  153.     else
  154.     begin

  155.       if ((i - 1) / 7) = ((i - 1) div 7) then
  156.       begin
  157.         CnDate[i].Top := CnDate[i - 1].Top + 32;
  158.         CnDate[i].Left := day1.Left;
  159.         ChnDate[i].Top := ChnDate[i - 1].Top + 32;
  160.         ChnDate[i].Left := Cnday.Left;

  161.       end
  162.       else
  163.       begin

  164.         CnDate[i].Top := CnDate[i - 1].Top;
  165.         CnDate[i].Left := CnDate[i - 1].Left + 42;
  166.         ChnDate[i].Top := ChnDate[i - 1].Top;
  167.         ChnDate[i].Left := ChnDate[i - 1].Left + 42;

  168.       end;
  169.     end;
  170.     CnDate[i].Font := day1.Font;
  171.     ChnDate[i].Font := Cnday.Font;
  172.     CnDate[i].Font.Color := clBlack;
  173.     CnDate[i].AutoSize := false;
  174.     ChnDate[i].AutoSize := false;
  175.     CnDate[i].Transparent := true;
  176.     ChnDate[i].Transparent := true;

  177.       //        CnDate[i].Caption :='22';
  178.       //        CnDate[i].Visible  :=true;
  179.       //        ChnDate[i].Caption :='初一';

  180.   end;

  181. end;


  182. procedure TFRM_Date.DateChange(MyTime: TDateTime);
  183. var
  184.   i, S: integer;
  185.   StarNo: integer;
  186.   Present: TDateTime;
  187.   Year, Month, Day, Hour: Word;

  188. begin
  189.   //  Label6.Caption :=datetostr(MyTime);
  190.   //  Label14.Caption :='今天:'+datetostr(date);
  191.   //  MyDates:=MyTime;
  192.   Label20.Caption := IntToStr(DateUtils.YearOf(Mytime));
  193.   Label17.Caption := IntToStr(DateUtils.MonthOf(Mytime));
  194.   Label16.Caption := Label17.Caption;
  195.   Label1.Caption := IntToStr(DateUtils.YearOf(Mytime));
  196.   Label21.Caption := CnanimalOfYear(Mytime);


  197.   for i := 1 to 37 do
  198.   begin
  199.     CnDate[i].Visible := false;
  200.     ChnDate[i].Visible := false;
  201.     ChnDate[i].Font.Color := clBlack;
  202.     CnDate[i].Font.Color := clBlack;
  203.     CnDate[i].Font.Size := 11;
  204.     CnDate[i].Color := self.Color;
  205.     ChnDate[i].Color := self.Color;
  206.   end;

  207.   DecodeDate(MyTime, Year, Month, Day);
  208.   Present := EncodeDate(Year, Month, 1);
  209.   StarNo := dayofweek(Present);
  210.   s := starno + DayOfMonth(Present) - 1;
  211.   try
  212.     for i := StarNo to s do
  213.     begin
  214.       Present := EncodeDate(Year, Month, i - StarNo + 1);
  215.       CnDate[i].Caption := IntToStr(i - StarNo + 1);
  216.       CnDate[i].Tag := i - StarNo + 1;
  217.       ChnDate[i].Tag := CnDate[i].Tag;
  218.       ChnDate[i].Caption := CnDayOfDate(Present);
  219.       if ChnDate[i].Caption = '初一' then
  220.       begin
  221.         ChnDate[i].Caption := CnMonthOfDate(Present);
  222.         ChnDate[i].Font.Color := clRed;
  223.       end
  224.       else
  225.         ChnDate[i].Font.Color := Cnday.Font.Color;
  226.       if length(Holiday(MyTime, i - StarNo + 1)) > 3 then
  227.       begin
  228.         ChnDate[i].Caption := Holiday(MyTime, i - StarNo + 1);
  229.         ChnDate[i].Font.Color := $000080FF;
  230.       end;
  231.       if DateCn.GetLunarHolDay(Present) <> '' then
  232.       begin
  233.         ChnDate[i].Caption := GetLunarHolDay(Present);
  234.         ChnDate[i].Font.Color := $00FF5353;
  235.       end;
  236.       if DateCn.CnDayOfDateJr(Present) <> '' then
  237.       begin
  238.         ChnDate[i].Caption := CnDayOfDateJr(Present);
  239.         ChnDate[i].Font.Color := $000080FF;
  240.       end;
  241.       if i - StarNo + 1 = day then
  242.       begin

  243.         Shape2.Left := CnDate[i].left - 1;
  244.         Shape2.Top := CnDate[i].top + 1;
  245.         Label22.Caption := Constellation(Present, day);
  246.       end;


  247.       CnDate[i].Visible := true;
  248.       ChnDate[i].Visible := true;

  249.     end;

  250.   except
  251.     on EConvertError do
  252.     begin
  253.         //   showmessage(inttostr(i));
  254.       exit;
  255.     end
  256.   else exit;
  257.   end;

  258. end;


  259. procedure TFRM_Date.FormCreate(Sender: TObject);
  260. begin
  261.   LoadLAB;
  262.   NDate := Date;

  263. end;

  264. procedure TFRM_Date.FormShow(Sender: TObject);
  265. begin
  266.   DecodeDate(NDate, NYear, NMonth, NDay);
  267.   UpDown1.Position := NYear;
  268.   UpDown2.Position := NMonth;

  269.   DateChange(NDate);
  270. end;

  271. procedure TFRM_Date.CHnDayClick(Sender: TObject);
  272. begin
  273.   Label5Click(nil);
  274.   Nday := (sender as TLabel).Tag;
  275.   OK;
  276. end;

  277. procedure TFRM_Date.CnDayClick(Sender: TObject);
  278. begin
  279.   Label5Click(nil);
  280.   Nday := (sender as TLabel).Tag;
  281.   OK;

  282. end;

  283. procedure TFRM_Date.UpDown1Click(Sender: TObject; Button: TUDBtnType);
  284. var
  285.   Present: TDate;
  286. begin
  287.   NYear := UpDown1.Position;
  288.   Present := SetDateTime(NYear, NMonth, NDay);
  289.   DateChange(Present);
  290. end;

  291. procedure TFRM_Date.Label17Click(Sender: TObject);
  292. begin
  293.   UpDown2.Visible := true;
  294.   UpDown1.Visible := false;
  295. end;

  296. procedure TFRM_Date.UpDown2Click(Sender: TObject; Button: TUDBtnType);
  297. var
  298.   Present: TDate;
  299. begin
  300.   NMonth := UpDown2.Position;
  301.   Present := SetDateTime(NYear, NMonth, NDay);
  302.   DateChange(Present);

  303. end;

  304. procedure TFRM_Date.Label5Click(Sender: TObject);
  305. begin
  306.   UpDown2.Visible := False;
  307.   UpDown1.Visible := false;

  308. end;

  309. procedure TFRM_Date.FormDeactivate(Sender: TObject);
  310. begin
  311.   Self.Close;
  312. end;

  313. procedure TFRM_Date.ChnDateMouseDown(Sender: TObject; Button: TMouseButton;
  314.   Shift: TShiftState; X, Y: Integer);
  315. begin
  316.   Shape2.Left := (sender as TLabel).left;
  317.   Shape2.Top := (sender as TLabel).top - 16;

  318. end;

  319. procedure TFRM_Date.CnDayMouseDown(Sender: TObject; Button: TMouseButton;
  320.   Shift: TShiftState; X, Y: Integer);
  321. begin
  322.   Shape2.Left := (sender as TLabel).left - 1;
  323.   Shape2.Top := (sender as TLabel).top + 1;

  324. end;

  325. procedure TFRM_Date.StaticText1Click(Sender: TObject);
  326. begin
  327.   NDate := Date;
  328.   FormShow(nil);
  329. end;

  330. procedure TFRM_Date.OK;
  331. begin
  332.   NDate := EncodeDate(NYear, NMonth, NDay);
  333. //  TChnCalendar(MHostControl).IsInit := False;
  334.   TChnCalendar(MHostControl).DateTime := NDate;
  335.   Close;
  336. end;

  337. procedure TFRM_Date.ShowDateWin(YearEdit1, MonthEdit1, DayEdit1: TEdit;
  338.   HostControl: TControl; Bmp: TBitMap = nil; iAlphaBlend: Byte = 150);
  339. var
  340.   P: TPoint;
  341.   FBackPicture: TbitMap;
  342. begin
  343. {  if not FormExists('FRM_Date') then
  344.     Self := TFRM_Date.Create(Application);
  345.   YearEdit := YearEdit1;
  346.   MonthEdit := MonthEdit1;
  347.   DayEdit := DayEdit1;
  348. //  ChDateLabel := ChDateLabel1;
  349.   MHostControl := HostControl;

  350.   YearEdit.Text := IntToStr(StrTOIntDef(YearEdit.Text, YearOf(Date)));
  351.   MonthEdit.Text := IntToStr(StrTOIntDef(MonthEdit.Text, MonthOf(Date)));
  352.   DayEdit.Text := IntToStr(StrTOIntDef(DayEdit.Text, DayOfMonth(Date)));

  353.   if (StrToInt(YearEdit.Text) > 2050) or (StrToInt(YearEdit.Text) < 1901) then
  354.     YearEdit.Text := IntToStr(YearOf(Date));

  355.   if (StrToInt(MonthEdit.Text) > 12) or (StrToInt(MonthEdit.Text) < 1) then
  356.     MonthEdit.Text := IntToStr(MonthOf(Date));

  357.   if StrToInt(DayEdit.Text) > DayOfMonth(StrToInt(YearEdit.Text), StrToInt(MonthEdit.Text)) then
  358.     DayEdit.Text := IntToStr(DayOfMonth(StrToInt(YearEdit.Text), StrToInt(MonthEdit.Text)));

  359.   NDate := EncodeDate(StrToInt(YearEdit.text), StrToInt(MonthEdit.text), StrToInt(DayEdit.text));
  360.   AdjustDropDownForm(Self, HostControl);

  361.   Image1.Picture.Bitmap.Assign(Bmp);
  362.   Label16.Visible := Image1.Picture.Graphic = nil;
  363.   Label20.Visible := Image1.Picture.Graphic = nil;
  364.   if Image1.Picture.Graphic <> nil then
  365.   begin
  366.     FBackPicture := TbitMap.Create;
  367.     FBackPicture.Width := Image1.Width ;
  368.     FBackPicture.Height := Image1.Height;
  369.     FBackPicture.Canvas.Brush.Color := Color;
  370.     FBackPicture.Canvas.FillRect(RECT(0, 0, FBackPicture.Width,
  371.       FBackPicture.Height));

  372.     P := Point((FBackPicture.Width - bmp.Width) div 2,
  373.       (FBackPicture.Height - bmp.Height) div 2);
  374.     BmpAlphaBlend(FBackPicture, Bmp, P, iAlphaBlend);
  375.     Image1.Canvas.Draw(0, 0, FBackPicture);
  376.     FBackPicture.free;

  377.   end;
  378.   Self.Show;  }
  379. end;

  380. procedure TFRM_Date.FormClose(Sender: TObject; var Action: TCloseAction);
  381. begin
  382.   Application.RemoveComponent(Self);
  383.   Self := nil;
  384.   Self.Free;

  385. end;

  386. procedure TFRM_Date.FormPaint(Sender: TObject);
  387. var
  388.   P: TPoint;
  389.   FBackPicture: TbitMap;
  390. begin
  391. //
  392.                          {
  393.   if not FPicture.Empty then
  394.   begin
  395.     FBackPicture := TbitMap.Create;
  396.     FBackPicture.Width := ClientWidth;
  397.     FBackPicture.Height := ClientHeight;
  398.     FBackPicture.Canvas.Brush.Color := Color;
  399.     FBackPicture.Canvas.FillRect(RECT(0, 0, FBackPicture.Width,
  400.       FBackPicture.Height));

  401.     P := Point((FBackPicture.Width - FPicture.Width) div 2,
  402.       (FBackPicture.Height - FPicture.Height) div 2);
  403.     BmpAlphaBlend(FBackPicture, FPicture, P, FPicture_AlphaBlend);
  404.     Canvas.Draw(0, 0, FBackPicture);
  405.     FBackPicture.free;
  406.   end;
  407.   }
  408. end;

  409. end.
复制代码
PYG19周年生日快乐!

该用户从未签到

 楼主| 发表于 2006-6-4 22:50:17 | 显示全部楼层

DateWin.dfm

DateWin.dfm
  1. object FRM_Date: TFRM_Date
  2.   Left = 568
  3.   Top = 125
  4.   BorderStyle = bsNone
  5.   Caption = 'FRM_Date'
  6.   ClientHeight = 274
  7.   ClientWidth = 313
  8.   Color = clWhite
  9.   Font.Charset = GB2312_CHARSET
  10.   Font.Color = clWindowText
  11.   Font.Height = -12
  12.   Font.Name = #23435#20307
  13.   Font.Style = []
  14.   OldCreateOrder = False
  15.   OnClose = FormClose
  16.   OnCreate = FormCreate
  17.   OnDeactivate = FormDeactivate
  18.   OnPaint = FormPaint
  19.   OnShow = FormShow
  20.   PixelsPerInch = 96
  21.   TextHeight = 12
  22.   object Shape1: TShape
  23.     Left = 0
  24.     Top = 0
  25.     Width = 313
  26.     Height = 274
  27.     Align = alClient
  28.   end
  29.   object Image1: TImage
  30.     Left = 9
  31.     Top = 56
  32.     Width = 297
  33.     Height = 191
  34.   end
  35.   object Label20: TLabel
  36.     Left = 0
  37.     Top = 56
  38.     Width = 313
  39.     Height = 72
  40.     Alignment = taCenter
  41.     AutoSize = False
  42.     Caption = '2002'
  43.     Font.Charset = ANSI_CHARSET
  44.     Font.Color = 14543103
  45.     Font.Height = -64
  46.     Font.Name = 'Arial Black'
  47.     Font.Style = []
  48.     ParentFont = False
  49.     Transparent = True
  50.     Layout = tlCenter
  51.   end
  52.   object Label16: TLabel
  53.     Left = 0
  54.     Top = 98
  55.     Width = 313
  56.     Height = 134
  57.     Alignment = taCenter
  58.     AutoSize = False
  59.     Caption = '6'
  60.     Font.Charset = ANSI_CHARSET
  61.     Font.Color = 15461355
  62.     Font.Height = -120
  63.     Font.Name = 'Arial Black'
  64.     Font.Style = []
  65.     ParentFont = False
  66.     Transparent = True
  67.     Layout = tlCenter
  68.   end
  69.   object Bevel2: TBevel
  70.     Left = 9
  71.     Top = 46
  72.     Width = 297
  73.     Height = 10
  74.     Shape = bsBottomLine
  75.   end
  76.   object Shape2: TShape
  77.     Left = 12
  78.     Top = 56
  79.     Width = 38
  80.     Height = 30
  81.     Brush.Color = 8512126
  82.   end
  83.   object Label1: TLabel
  84.     Left = 120
  85.     Top = 0
  86.     Width = 76
  87.     Height = 41
  88.     Cursor = crHandPoint
  89.     Hint = #21333#20987#25913#21464#24180#20221
  90.     Alignment = taCenter
  91.     Caption = '2002'
  92.     Color = 15268607
  93.     Font.Charset = ANSI_CHARSET
  94.     Font.Color = clBlue
  95.     Font.Height = -29
  96.     Font.Name = 'Arial Black'
  97.     Font.Style = []
  98.     ParentColor = False
  99.     ParentFont = False
  100.     ParentShowHint = False
  101.     ShowHint = True
  102.     Transparent = True
  103.     Layout = tlCenter
  104.     OnClick = Label1Click
  105.   end
  106.   object Label2: TLabel
  107.     Left = 19
  108.     Top = 40
  109.     Width = 36
  110.     Height = 12
  111.     Alignment = taCenter
  112.     Caption = #26143#26399#26085
  113.     Font.Charset = GB2312_CHARSET
  114.     Font.Color = clRed
  115.     Font.Height = -12
  116.     Font.Name = #23435#20307
  117.     Font.Style = []
  118.     ParentFont = False
  119.     Layout = tlCenter
  120.     OnClick = Label5Click
  121.   end
  122.   object Label3: TLabel
  123.     Left = 59
  124.     Top = 40
  125.     Width = 36
  126.     Height = 12
  127.     Alignment = taCenter
  128.     Caption = #26143#26399#19968
  129.     Font.Charset = GB2312_CHARSET
  130.     Font.Color = clBlack
  131.     Font.Height = -12
  132.     Font.Name = #23435#20307
  133.     Font.Style = []
  134.     ParentFont = False
  135.     Layout = tlCenter
  136.     OnClick = Label5Click
  137.   end
  138.   object Label4: TLabel
  139.     Left = 99
  140.     Top = 40
  141.     Width = 36
  142.     Height = 12
  143.     Alignment = taCenter
  144.     Caption = #26143#26399#20108
  145.     Font.Charset = GB2312_CHARSET
  146.     Font.Color = clBlack
  147.     Font.Height = -12
  148.     Font.Name = #23435#20307
  149.     Font.Style = []
  150.     ParentFont = False
  151.     Layout = tlCenter
  152.     OnClick = Label5Click
  153.   end
  154.   object Label5: TLabel
  155.     Left = 179
  156.     Top = 40
  157.     Width = 36
  158.     Height = 12
  159.     Alignment = taCenter
  160.     Caption = #26143#26399#22235
  161.     Font.Charset = GB2312_CHARSET
  162.     Font.Color = clBlack
  163.     Font.Height = -12
  164.     Font.Name = #23435#20307
  165.     Font.Style = []
  166.     ParentFont = False
  167.     Layout = tlCenter
  168.     OnClick = Label5Click
  169.   end
  170.   object Label6: TLabel
  171.     Left = 139
  172.     Top = 40
  173.     Width = 36
  174.     Height = 12
  175.     Alignment = taCenter
  176.     Caption = #26143#26399#19977
  177.     Font.Charset = GB2312_CHARSET
  178.     Font.Color = clBlack
  179.     Font.Height = -12
  180.     Font.Name = #23435#20307
  181.     Font.Style = []
  182.     ParentFont = False
  183.     Layout = tlCenter
  184.     OnClick = Label5Click
  185.   end
  186.   object Label7: TLabel
  187.     Left = 259
  188.     Top = 40
  189.     Width = 36
  190.     Height = 12
  191.     Alignment = taCenter
  192.     Caption = #26143#26399#20845
  193.     Font.Charset = GB2312_CHARSET
  194.     Font.Color = clRed
  195.     Font.Height = -12
  196.     Font.Name = #23435#20307
  197.     Font.Style = []
  198.     ParentFont = False
  199.     Layout = tlCenter
  200.     OnClick = Label5Click
  201.   end
  202.   object Label8: TLabel
  203.     Left = 219
  204.     Top = 40
  205.     Width = 36
  206.     Height = 12
  207.     Alignment = taCenter
  208.     Caption = #26143#26399#20116
  209.     Font.Charset = GB2312_CHARSET
  210.     Font.Color = clBlack
  211.     Font.Height = -12
  212.     Font.Name = #23435#20307
  213.     Font.Style = []
  214.     ParentFont = False
  215.     Layout = tlCenter
  216.     OnClick = Label5Click
  217.   end
  218.   object day1: TLabel
  219.     Left = 14
  220.     Top = 56
  221.     Width = 36
  222.     Height = 16
  223.     Alignment = taCenter
  224.     AutoSize = False
  225.     Caption = '22'
  226.     Font.Charset = ANSI_CHARSET
  227.     Font.Color = clBlack
  228.     Font.Height = -14
  229.     Font.Name = 'Arial Black'
  230.     Font.Style = []
  231.     ParentFont = False
  232.     Transparent = True
  233.     Layout = tlCenter
  234.     Visible = False
  235.   end
  236.   object Cnday: TLabel
  237.     Left = 13
  238.     Top = 73
  239.     Width = 36
  240.     Height = 12
  241.     Alignment = taCenter
  242.     AutoSize = False
  243.     Caption = #21021#19968
  244.     Font.Charset = GB2312_CHARSET
  245.     Font.Color = 16384
  246.     Font.Height = -12
  247.     Font.Name = #23435#20307
  248.     Font.Style = []
  249.     ParentFont = False
  250.     Transparent = True
  251.     Layout = tlCenter
  252.     Visible = False
  253.   end
  254.   object Label9: TLabel
  255.     Left = 20
  256.     Top = 253
  257.     Width = 36
  258.     Height = 12
  259.     Alignment = taCenter
  260.     Caption = #26143#26399#26085
  261.     Font.Charset = GB2312_CHARSET
  262.     Font.Color = clRed
  263.     Font.Height = -12
  264.     Font.Name = #23435#20307
  265.     Font.Style = []
  266.     ParentFont = False
  267.     Layout = tlCenter
  268.   end
  269.   object Label10: TLabel
  270.     Left = 60
  271.     Top = 253
  272.     Width = 36
  273.     Height = 12
  274.     Alignment = taCenter
  275.     Caption = #26143#26399#19968
  276.     Font.Charset = GB2312_CHARSET
  277.     Font.Color = clBlack
  278.     Font.Height = -12
  279.     Font.Name = #23435#20307
  280.     Font.Style = []
  281.     ParentFont = False
  282.     Layout = tlCenter
  283.   end
  284.   object Label11: TLabel
  285.     Left = 100
  286.     Top = 253
  287.     Width = 36
  288.     Height = 12
  289.     Alignment = taCenter
  290.     Caption = #26143#26399#20108
  291.     Font.Charset = GB2312_CHARSET
  292.     Font.Color = clBlack
  293.     Font.Height = -12
  294.     Font.Name = #23435#20307
  295.     Font.Style = []
  296.     ParentFont = False
  297.     Layout = tlCenter
  298.   end
  299.   object Label12: TLabel
  300.     Left = 140
  301.     Top = 253
  302.     Width = 36
  303.     Height = 12
  304.     Alignment = taCenter
  305.     Caption = #26143#26399#19977
  306.     Font.Charset = GB2312_CHARSET
  307.     Font.Color = clBlack
  308.     Font.Height = -12
  309.     Font.Name = #23435#20307
  310.     Font.Style = []
  311.     ParentFont = False
  312.     Layout = tlCenter
  313.   end
  314.   object Label13: TLabel
  315.     Left = 180
  316.     Top = 253
  317.     Width = 36
  318.     Height = 12
  319.     Alignment = taCenter
  320.     Caption = #26143#26399#22235
  321.     Font.Charset = GB2312_CHARSET
  322.     Font.Color = clBlack
  323.     Font.Height = -12
  324.     Font.Name = #23435#20307
  325.     Font.Style = []
  326.     ParentFont = False
  327.     Layout = tlCenter
  328.   end
  329.   object Label14: TLabel
  330.     Left = 220
  331.     Top = 253
  332.     Width = 36
  333.     Height = 12
  334.     Alignment = taCenter
  335.     Caption = #26143#26399#20116
  336.     Font.Charset = GB2312_CHARSET
  337.     Font.Color = clBlack
  338.     Font.Height = -12
  339.     Font.Name = #23435#20307
  340.     Font.Style = []
  341.     ParentFont = False
  342.     Layout = tlCenter
  343.   end
  344.   object Label15: TLabel
  345.     Left = 260
  346.     Top = 253
  347.     Width = 36
  348.     Height = 12
  349.     Alignment = taCenter
  350.     Caption = #26143#26399#20845
  351.     Font.Charset = GB2312_CHARSET
  352.     Font.Color = clRed
  353.     Font.Height = -12
  354.     Font.Name = #23435#20307
  355.     Font.Style = []
  356.     ParentFont = False
  357.     Layout = tlCenter
  358.   end
  359.   object Bevel1: TBevel
  360.     Left = 9
  361.     Top = 240
  362.     Width = 297
  363.     Height = 10
  364.     Shape = bsBottomLine
  365.   end
  366.   object Label17: TLabel
  367.     Left = 10
  368.     Top = 3
  369.     Width = 36
  370.     Height = 37
  371.     Cursor = crHandPoint
  372.     Hint = #21333#20987#25913#21464#26376#20221
  373.     Alignment = taCenter
  374.     Caption = '12'
  375.     Font.Charset = ANSI_CHARSET
  376.     Font.Color = 12615808
  377.     Font.Height = -32
  378.     Font.Name = 'Arial'
  379.     Font.Style = [fsBold]
  380.     ParentFont = False
  381.     ParentShowHint = False
  382.     ShowHint = True
  383.     Transparent = True
  384.     OnClick = Label17Click
  385.   end
  386.   object Label18: TLabel
  387.     Left = 45
  388.     Top = 20
  389.     Width = 15
  390.     Height = 14
  391.     Caption = #26376
  392.     Font.Charset = GB2312_CHARSET
  393.     Font.Color = clWindowText
  394.     Font.Height = -14
  395.     Font.Name = #23435#20307
  396.     Font.Style = [fsBold]
  397.     ParentFont = False
  398.   end
  399.   object Label19: TLabel
  400.     Left = 205
  401.     Top = 17
  402.     Width = 15
  403.     Height = 14
  404.     Caption = #24180
  405.     Font.Charset = GB2312_CHARSET
  406.     Font.Color = clWindowText
  407.     Font.Height = -14
  408.     Font.Name = #23435#20307
  409.     Font.Style = [fsBold]
  410.     ParentFont = False
  411.   end
  412.   object Label21: TLabel
  413.     Left = 230
  414.     Top = 212
  415.     Width = 78
  416.     Height = 35
  417.     Alignment = taCenter
  418.     AutoSize = False
  419.     Caption = #26411#40857
  420.     Font.Charset = GB2312_CHARSET
  421.     Font.Color = 16768477
  422.     Font.Height = -35
  423.     Font.Name = #38582#20070
  424.     Font.Style = [fsBold]
  425.     ParentFont = False
  426.     Transparent = True
  427.   end
  428.   object Label22: TLabel
  429.     Left = 152
  430.     Top = 223
  431.     Width = 69
  432.     Height = 23
  433.     Alignment = taCenter
  434.     AutoSize = False
  435.     Caption = #26411#40857
  436.     Font.Charset = GB2312_CHARSET
  437.     Font.Color = 16744703
  438.     Font.Height = -19
  439.     Font.Name = #40657#20307
  440.     Font.Style = [fsBold]
  441.     ParentFont = False
  442.     Transparent = True
  443.   end
  444.   object UpDown1: TUpDown
  445.     Left = 221
  446.     Top = 10
  447.     Width = 16
  448.     Height = 24
  449.     Min = 1901
  450.     Max = 2050
  451.     Position = 1901
  452.     TabOrder = 0
  453.     Visible = False
  454.     OnClick = UpDown1Click
  455.   end
  456.   object UpDown2: TUpDown
  457.     Left = 61
  458.     Top = 10
  459.     Width = 16
  460.     Height = 24
  461.     Min = 1
  462.     Max = 12
  463.     Position = 12
  464.     TabOrder = 1
  465.     Visible = False
  466.     OnClick = UpDown2Click
  467.   end
  468.   object StaticText1: TStaticText
  469.     Left = 272
  470.     Top = 17
  471.     Width = 28
  472.     Height = 16
  473.     Cursor = crHandPoint
  474.     Alignment = taCenter
  475.     BorderStyle = sbsSingle
  476.     Caption = #20170#22825
  477.     Color = 13693646
  478.     ParentColor = False
  479.     TabOrder = 2
  480.     OnClick = StaticText1Click
  481.   end
  482. end
复制代码
PYG19周年生日快乐!

该用户从未签到

发表于 2006-6-5 20:39:23 | 显示全部楼层
晕了....
PYG19周年生日快乐!

该用户从未签到

发表于 2006-6-5 22:07:08 | 显示全部楼层
倒了~~~
PYG19周年生日快乐!

该用户从未签到

发表于 2006-6-7 12:42:22 | 显示全部楼层
收下了!!!!
PYG19周年生日快乐!
  • TA的每日心情
    开心
    2018-5-6 16:27
  • 签到天数: 7 天

    [LV.3]偶尔看看II

    发表于 2006-6-10 12:32:57 | 显示全部楼层
    写编程。。。谈何容易呀。。。
    PYG19周年生日快乐!

    该用户从未签到

    发表于 2006-6-13 12:55:49 | 显示全部楼层
    慌了~~~~~
      这么多地~~~
    有没有POWERBUILDER    这样的东西啊 ~
      学习学习啊~
    PYG19周年生日快乐!
    您需要登录后才可以回帖 登录 | 加入我们

    本版积分规则

    快速回复 返回顶部 返回列表