home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / Essentials / SETUP.EXE / %MAINDIR% / EsCal.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-11-28  |  9.0 KB  |  249 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'EsCal.pas' rev: 3.00
  6.  
  7. #ifndef EsCalHPP
  8. #define EsCalHPP
  9. #include <EsUtil.hpp>
  10. #include <EsData.hpp>
  11. #include <EsBase.hpp>
  12. #include <SysUtils.hpp>
  13. #include <Messages.hpp>
  14. #include <Menus.hpp>
  15. #include <Forms.hpp>
  16. #include <Graphics.hpp>
  17. #include <Controls.hpp>
  18. #include <Classes.hpp>
  19. #include <Buttons.hpp>
  20. #include <Windows.hpp>
  21. #include <SysInit.hpp>
  22. #include <System.hpp>
  23.  
  24. //-- user supplied -----------------------------------------------------------
  25.  
  26. namespace Escal
  27. {
  28. //-- type declarations -------------------------------------------------------
  29. enum TEsDateFormat { dfShort, dfLong };
  30.  
  31. typedef Shortint TEsDayNameWidth;
  32.  
  33. enum TEsDayType { dtSunday, dtMonday, dtTuesday, dtWednesday, dtThursday, dtFriday, dtSaturday };
  34.  
  35. typedef Graphics::TColor TEsCalColorArray[6];
  36.  
  37. enum TEsCalColorScheme { csCustom, csWindows, csGold, csOcean, csRose };
  38.  
  39. typedef Graphics::TColor TEsCalSchemeArray[5][6];
  40.  
  41. class DELPHICLASS TEsCalColors;
  42. class PASCALIMPLEMENTATION TEsCalColors : public Classes::TPersistent 
  43. {
  44.     typedef Classes::TPersistent inherited;
  45.     
  46. private:
  47.     bool FUpdating;
  48.     Classes::TNotifyEvent FOnChange;
  49.     bool SettingScheme;
  50.     void __fastcall DoOnChange(void);
  51.     Graphics::TColor __fastcall GetColor(int Index);
  52.     void __fastcall SetColor(int Index, Graphics::TColor Value);
  53.     void __fastcall SetColorScheme(TEsCalColorScheme Value);
  54.     
  55. public:
  56.     Graphics::TColor FCalColors[6];
  57.     TEsCalColorScheme FColorScheme;
  58.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  59.     void __fastcall BeginUpdate(void);
  60.     void __fastcall EndUpdate(void);
  61.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  62.     
  63. __published:
  64.     __property Graphics::TColor ActiveDay = {read=GetColor, write=SetColor, index=0, nodefault};
  65.     __property TEsCalColorScheme ColorScheme = {read=FColorScheme, write=SetColorScheme, nodefault};
  66.     __property Graphics::TColor DayNames = {read=GetColor, write=SetColor, index=1, nodefault};
  67.     __property Graphics::TColor Days = {read=GetColor, write=SetColor, index=2, nodefault};
  68.     __property Graphics::TColor InactiveDays = {read=GetColor, write=SetColor, index=3, nodefault};
  69.     __property Graphics::TColor MonthAndYear = {read=GetColor, write=SetColor, index=4, nodefault};
  70.     __property Graphics::TColor Weekend = {read=GetColor, write=SetColor, index=5, nodefault};
  71. public:
  72.     /* TPersistent.Destroy */ __fastcall virtual ~TEsCalColors(void) { }
  73.     
  74. public:
  75.     /* TObject.Create */ __fastcall TEsCalColors(void) : Classes::TPersistent() { }
  76.     
  77. };
  78.  
  79. typedef void __fastcall (__closure *TDateChangeEvent)(System::TObject* Sender, System::TDateTime Date
  80.     );
  81.  
  82. class DELPHICLASS TEsCustomCalendar;
  83. class PASCALIMPLEMENTATION TEsCustomCalendar : public Esbase::TEsBase 
  84. {
  85.     typedef Esbase::TEsBase inherited;
  86.     
  87. protected:
  88.     bool FBrowsing;
  89.     TEsCalColors* FColors;
  90.     System::TDateTime FDate;
  91.     TEsDateFormat FDateFormat;
  92.     TEsDayNameWidth FDayNameWidth;
  93.     bool FShowDate;
  94.     bool FShowInactive;
  95.     bool FShowToday;
  96.     TFormBorderStyle FBorderStyle;
  97.     TEsDayType FWeekStarts;
  98.     TDateChangeEvent FOnChange;
  99.     Buttons::TSpeedButton* clBtnLeft;
  100.     Buttons::TSpeedButton* clBtnRight;
  101.     Buttons::TSpeedButton* clBtnToday;
  102.     bool clInPopup;
  103.     Buttons::TSpeedButton* clBtnNextYear;
  104.     Buttons::TSpeedButton* clBtnPrevYear;
  105.     Byte clCalendar[42];
  106.     Word clDay;
  107.     Byte clFirst;
  108.     Byte clLast;
  109.     Word clMonth;
  110.     Windows::TRect clRowCol[8][7];
  111.     bool cSettingScheme;
  112.     Word clYear;
  113.     int clWidth;
  114.     bool clPopup;
  115.     void __fastcall SetBorderStyle(Forms::TBorderStyle Value);
  116.     void __fastcall SetDate(System::TDateTime Value);
  117.     void __fastcall SetDateFormat(TEsDateFormat Value);
  118.     void __fastcall SetDayNameWidth(TEsDayNameWidth Value);
  119.     void __fastcall SetShowDate(bool Value);
  120.     void __fastcall SetShowInactive(bool Value);
  121.     void __fastcall SetShowToday(bool Value);
  122.     void __fastcall SetWeekStarts(TEsDayType Value);
  123.     void __fastcall calBtnClick(System::TObject* Sender);
  124.     void __fastcall calChangeMonth(System::TObject* Sender);
  125.     void __fastcall calColorChange(System::TObject* Sender);
  126.     Windows::TRect __fastcall calGetCurrentRectangle();
  127.     void __fastcall calRebuildCalArray(void);
  128.     void __fastcall calRecalcSize(void);
  129.     HIDESBASE MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Msg);
  130.     HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TMessage &Msg);
  131.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TMessage &Msg);
  132.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Msg);
  133.     HIDESBASE MESSAGE void __fastcall WMEraseBkgnd(Messages::TWMEraseBkgnd &Msg);
  134.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Msg);
  135.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  136.     virtual void __fastcall CreateWnd(void);
  137.     DYNAMIC void __fastcall DoOnChange(System::TDateTime Value);
  138.     DYNAMIC void __fastcall DoOnMouseWheel(Classes::TShiftState Shift, short Delta, short XPos, short YPos
  139.         );
  140.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  141.     DYNAMIC void __fastcall KeyPress(char &Key);
  142.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  143.         int Y);
  144.     DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
  145.         Y);
  146.     virtual void __fastcall Paint(void);
  147.     
  148. public:
  149.     __fastcall virtual TEsCustomCalendar(Classes::TComponent* AOwner);
  150.     __fastcall virtual TEsCustomCalendar(Classes::TComponent* AOwner, bool AsPopup);
  151.     __fastcall virtual ~TEsCustomCalendar(void);
  152.     virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
  153.     __property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle, default=0};
  154.     __property bool Browsing = {read=FBrowsing, nodefault};
  155.     __property TEsCalColors* Colors = {read=FColors, write=FColors};
  156.     __property TEsDayNameWidth DayNameWidth = {read=FDayNameWidth, write=SetDayNameWidth, default=3};
  157.     __property System::TDateTime Date = {read=FDate, write=SetDate};
  158.     __property TEsDateFormat DateFormat = {read=FDateFormat, write=SetDateFormat, default=1};
  159.     __property bool ShowDate = {read=FShowDate, write=SetShowDate, default=1};
  160.     __property bool ShowInactive = {read=FShowInactive, write=SetShowInactive, default=0};
  161.     __property bool ShowToday = {read=FShowToday, write=SetShowToday, default=1};
  162.     __property TEsDayType WeekStarts = {read=FWeekStarts, write=SetWeekStarts, default=0};
  163.     __property TDateChangeEvent OnChange = {read=FOnChange, write=FOnChange};
  164. public:
  165.     /* TWinControl.CreateParented */ __fastcall TEsCustomCalendar(HWND ParentWindow) : Esbase::TEsBase(
  166.         ParentWindow) { }
  167.     
  168. };
  169.  
  170. class DELPHICLASS TEsCalendar;
  171. class PASCALIMPLEMENTATION TEsCalendar : public Escal::TEsCustomCalendar 
  172. {
  173.     typedef Escal::TEsCustomCalendar inherited;
  174.     
  175. __published:
  176.     __property Align ;
  177.     __property BorderStyle ;
  178.     __property Colors ;
  179.     __property Ctl3D ;
  180.     __property Cursor ;
  181.     __property DayNameWidth ;
  182.     __property DateFormat ;
  183.     __property DragCursor ;
  184.     __property DragMode ;
  185.     __property Enabled ;
  186.     __property EsLabelInfo ;
  187.     __property Font ;
  188.     __property ParentCtl3D ;
  189.     __property ParentFont ;
  190.     __property ParentShowHint ;
  191.     __property PopupMenu ;
  192.     __property ShowDate ;
  193.     __property ShowHint ;
  194.     __property ShowInactive ;
  195.     __property ShowToday ;
  196.     __property TabOrder ;
  197.     __property TabStop ;
  198.     __property Version ;
  199.     __property Visible ;
  200.     __property WeekStarts ;
  201.     __property OnChange ;
  202.     __property OnDblClick ;
  203.     __property OnDragDrop ;
  204.     __property OnDragOver ;
  205.     __property OnEndDrag ;
  206.     __property OnEnter ;
  207.     __property OnExit ;
  208.     __property OnKeyDown ;
  209.     __property OnKeyPress ;
  210.     __property OnKeyUp ;
  211.     __property OnMouseDown ;
  212.     __property OnMouseMove ;
  213.     __property OnMouseUp ;
  214.     __property OnStartDrag ;
  215. public:
  216.     /* TEsCustomCalendar.Create */ __fastcall virtual TEsCalendar(Classes::TComponent* AOwner) : Escal::
  217.         TEsCustomCalendar(AOwner) { }
  218.     /* TEsCustomCalendar.CreateEx */ __fastcall virtual TEsCalendar(Classes::TComponent* AOwner, bool AsPopup
  219.         ) : Escal::TEsCustomCalendar(AOwner, AsPopup) { }
  220.     /* TEsCustomCalendar.Destroy */ __fastcall virtual ~TEsCalendar(void) { }
  221.     
  222. public:
  223.     /* TWinControl.CreateParented */ __fastcall TEsCalendar(HWND ParentWindow) : Escal::TEsCustomCalendar(
  224.         ParentWindow) { }
  225.     
  226. };
  227.  
  228. //-- var, const, procedure ---------------------------------------------------
  229. #define calDefBorderStyle (Forms::TFormBorderStyle)(0)
  230. #define calDefColor (int)(-2147483633)
  231. #define calDefDateFormat (TEsDateFormat)(1)
  232. #define calDefDayNameWidth (Byte)(3)
  233. #define calDefHeight (Byte)(140)
  234. #define calDefShowDate (bool)(1)
  235. #define calDefShowInactive (bool)(0)
  236. #define calDefShowToday (bool)(1)
  237. #define calDefTabStop (bool)(1)
  238. #define calDefWeekStarts (TEsDayType)(0)
  239. #define calDefWidth (Byte)(200)
  240. #define calMargin (Byte)(4)
  241. extern PACKAGE Graphics::TColor CalScheme[5][6];
  242.  
  243. }    /* namespace Escal */
  244. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  245. using namespace Escal;
  246. #endif
  247. //-- end unit ----------------------------------------------------------------
  248. #endif    // EsCal
  249.