home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / COLORGRD.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-06  |  5.5 KB  |  160 lines

  1. //----------------------------------------------------------------------------
  2. // ColorGrd.hpp - dcc32 generated hdr (DO NOT EDIT) rev: -2
  3. // From: ColorGrd.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef ColorGrdHPP
  6. #define ColorGrdHPP
  7. //----------------------------------------------------------------------------
  8. #ifndef MenusHPP
  9. #include <Menus.hpp>
  10. #endif
  11.  
  12. #ifndef ExtCtrlsHPP
  13. #include <ExtCtrls.hpp>
  14. #endif
  15.  
  16. #ifndef ControlsHPP
  17. #include <Controls.hpp>
  18. #endif
  19.  
  20. #ifndef FormsHPP
  21. #include <Forms.hpp>
  22. #endif
  23.  
  24. #ifndef GraphicsHPP
  25. #include <Graphics.hpp>
  26. #endif
  27.  
  28. #ifndef ClassesHPP
  29. #include <Classes.hpp>
  30. #endif
  31.  
  32. #ifndef MessagesHPP
  33. #include <Messages.hpp>
  34. #endif
  35.  
  36. #ifndef WindowsHPP
  37. #include <Windows.hpp>
  38. #endif
  39.  
  40. #ifndef SystemHPP
  41. #include <System.hpp>
  42. #endif
  43.  
  44. namespace Colorgrd
  45. {
  46. //-- type declarations -------------------------------------------------------
  47. enum TGridOrdering { go16x1, go8x2, go4x4, go2x8, go1x16 };
  48.  
  49. class __declspec(delphiclass) TColorGrid;
  50. class __declspec(pascalimplementation) TColorGrid : public Controls::TCustomControl
  51. {
  52.     typedef TColorGrid ThisClass;
  53.     typedef Controls::TCustomControl inherited;
  54.     
  55. private:
  56.     Windows::TPaletteEntry FPaletteEntries[20];
  57.     System::Boolean FClickEnablesColor;
  58.     System::Integer FForegroundIndex;
  59.     System::Integer FBackgroundIndex;
  60.     System::Boolean FForegroundEnabled;
  61.     System::Boolean FBackgroundEnabled;
  62.     System::Integer FSelection;
  63.     System::Integer FCellXSize;
  64.     System::Integer FCellYSize;
  65.     System::Integer FNumXSquares;
  66.     System::Integer FNumYSquares;
  67.     TGridOrdering FGridOrdering;
  68.     System::Boolean FHasFocus;
  69.     Classes::TNotifyEvent FOnChange;
  70.     TMouseButton FButton;
  71.     System::Boolean FButtonDown;
  72.     void __fastcall DrawSquare(System::Integer Which, System::Boolean ShowSelector);
  73.     void __fastcall DrawFgBg(void);
  74.     void __fastcall UpdateCellSizes(System::Boolean DoRepaint);
  75.     void __fastcall SetGridOrdering(TGridOrdering Value);
  76.     Graphics::TColor __fastcall GetForegroundColor(void);
  77.     Graphics::TColor __fastcall GetBackgroundColor(void);
  78.     void __fastcall SetForegroundIndex(System::Integer Value);
  79.     void __fastcall SetBackgroundIndex(System::Integer Value);
  80.     void __fastcall SetSelection(System::Integer Value);
  81.     void __fastcall EnableForeground(System::Boolean Value);
  82.     void __fastcall EnableBackground(System::Boolean Value);
  83.     MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  84.     MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
  85.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
  86.     MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  87.     MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Message);
  88.     
  89. protected:
  90.     virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);
  91.     virtual void __fastcall MouseDown(Controls::TMouseButton Button,  Classes::TShiftState Shift, System::Integer 
  92.         X, System::Integer Y);
  93.     virtual void __fastcall MouseMove( Classes::TShiftState Shift, System::Integer X, System::Integer Y
  94.         );
  95.     virtual void __fastcall MouseUp(Controls::TMouseButton Button,  Classes::TShiftState Shift, System::Integer 
  96.         X, System::Integer Y);
  97.     virtual void __fastcall CreateWnd(void);
  98.     virtual void __fastcall Paint(void);
  99.     virtual void __fastcall Change(void);
  100.     System::Integer __fastcall SquareFromPos(System::Integer X, System::Integer Y);
  101.     
  102. public:
  103.     __fastcall virtual TColorGrid(Classes::TComponent *AOwner);
  104.     __property Graphics::TColor ForegroundColor = {read=GetForegroundColor, nodefault};
  105.     __property Graphics::TColor BackgroundColor = {read=GetBackgroundColor, nodefault};
  106.     
  107. __published:
  108.     __property System::Boolean ClickEnablesColor = {read=FClickEnablesColor, write=FClickEnablesColor, 
  109.         default=0};
  110.     __property Ctl3D ;
  111.     __property DragCursor ;
  112.     __property DragMode ;
  113.     __property Enabled ;
  114.     __property TGridOrdering GridOrdering = {read=FGridOrdering, write=SetGridOrdering, default=2};
  115.     __property System::Integer ForegroundIndex = {read=FForegroundIndex, write=SetForegroundIndex, default=0
  116.         };
  117.     __property System::Integer BackgroundIndex = {read=FBackgroundIndex, write=SetBackgroundIndex, default=0
  118.         };
  119.     __property System::Boolean ForegroundEnabled = {read=FForegroundEnabled, write=EnableForeground, default=1
  120.         };
  121.     __property System::Boolean BackgroundEnabled = {read=FBackgroundEnabled, write=EnableBackground, default=1
  122.         };
  123.     __property Font ;
  124.     __property ParentCtl3D ;
  125.     __property ParentFont ;
  126.     __property ParentShowHint ;
  127.     __property PopupMenu ;
  128.     __property System::Integer Selection = {read=FSelection, write=SetSelection, default=0};
  129.     __property ShowHint ;
  130.     __property TabOrder ;
  131.     __property TabStop ;
  132.     __property Visible ;
  133.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  134.     __property OnClick ;
  135.     __property OnDragDrop ;
  136.     __property OnDragOver ;
  137.     __property OnEndDrag ;
  138.     __property OnEnter ;
  139.     __property OnExit ;
  140.     __property OnKeyDown ;
  141.     __property OnKeyPress ;
  142.     __property OnKeyUp ;
  143.     __property OnMouseDown ;
  144.     __property OnMouseMove ;
  145.     __property OnMouseUp ;
  146. public:
  147.     /* !! TCustomControl.Destroy */ __fastcall virtual ~TColorGrid(void) { }
  148.     
  149. };
  150.  
  151. //-- var, const, procedure ---------------------------------------------------
  152. #define NumPaletteEntries System::Byte(20)
  153.  
  154. }    /* namespace Colorgrd */
  155. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  156. using namespace Colorgrd;
  157. #endif
  158. //-- end unit ----------------------------------------------------------------
  159. #endif    // ColorGrd
  160.