// Borland C++ Builder
// Copyright (c) 1995, 2005 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Colorgrd.pas' rev: 10.00

#ifndef ColorgrdHPP
#define ColorgrdHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Extctrls.hpp>	// Pascal unit
#include <Menus.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Colorgrd
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TGridOrdering { go16x1, go8x2, go4x4, go2x8, go1x16 };
#pragma option pop

class DELPHICLASS TColorGrid;
class PASCALIMPLEMENTATION TColorGrid : public Controls::TCustomControl 
{
	typedef Controls::TCustomControl inherited;
	
private:
	tagPALETTEENTRY FPaletteEntries[20];
	bool FClickEnablesColor;
	int FForegroundIndex;
	int FBackgroundIndex;
	bool FForegroundEnabled;
	bool FBackgroundEnabled;
	int FSelection;
	int FCellXSize;
	int FCellYSize;
	int FNumXSquares;
	int FNumYSquares;
	TGridOrdering FGridOrdering;
	bool FHasFocus;
	Classes::TNotifyEvent FOnChange;
	Controls::TMouseButton FButton;
	bool FButtonDown;
	void __fastcall DrawSquare(int Which, bool ShowSelector);
	void __fastcall DrawFgBg(void);
	void __fastcall UpdateCellSizes(bool DoRepaint);
	void __fastcall SetGridOrdering(TGridOrdering Value);
	Graphics::TColor __fastcall GetForegroundColor(void);
	Graphics::TColor __fastcall GetBackgroundColor(void);
	void __fastcall SetForegroundIndex(int Value);
	void __fastcall SetBackgroundIndex(int Value);
	void __fastcall SetSelection(int Value);
	void __fastcall EnableForeground(bool Value);
	void __fastcall EnableBackground(bool Value);
	HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
	HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
	MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
	HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
	HIDESBASE MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Message);
	
protected:
	DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	virtual void __fastcall CreateWnd(void);
	virtual void __fastcall Paint(void);
	DYNAMIC void __fastcall Change(void);
	int __fastcall SquareFromPos(int X, int Y);
	
public:
	__fastcall virtual TColorGrid(Classes::TComponent* AOwner);
	int __fastcall ColorToIndex(Graphics::TColor AColor);
	__property Graphics::TColor ForegroundColor = {read=GetForegroundColor, nodefault};
	__property Graphics::TColor BackgroundColor = {read=GetBackgroundColor, nodefault};
	
__published:
	__property Anchors  = {default=3};
	__property bool ClickEnablesColor = {read=FClickEnablesColor, write=FClickEnablesColor, default=0};
	__property Constraints ;
	__property Ctl3D ;
	__property DragCursor  = {default=-12};
	__property DragMode  = {default=0};
	__property Enabled  = {default=1};
	__property TGridOrdering GridOrdering = {read=FGridOrdering, write=SetGridOrdering, default=2};
	__property int ForegroundIndex = {read=FForegroundIndex, write=SetForegroundIndex, default=0};
	__property int BackgroundIndex = {read=FBackgroundIndex, write=SetBackgroundIndex, default=0};
	__property bool ForegroundEnabled = {read=FForegroundEnabled, write=EnableForeground, default=1};
	__property bool BackgroundEnabled = {read=FBackgroundEnabled, write=EnableBackground, default=1};
	__property Font ;
	__property ParentCtl3D  = {default=1};
	__property ParentFont  = {default=1};
	__property ParentShowHint  = {default=1};
	__property PopupMenu ;
	__property int Selection = {read=FSelection, write=SetSelection, default=0};
	__property ShowHint ;
	__property TabOrder  = {default=-1};
	__property TabStop  = {default=0};
	__property Visible  = {default=1};
	__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
	__property OnClick ;
	__property OnDragDrop ;
	__property OnDragOver ;
	__property OnEndDrag ;
	__property OnEnter ;
	__property OnExit ;
	__property OnKeyDown ;
	__property OnKeyPress ;
	__property OnKeyUp ;
	__property OnMouseDown ;
	__property OnMouseMove ;
	__property OnMouseUp ;
	__property OnStartDrag ;
public:
	#pragma option push -w-inl
	/* TCustomControl.Destroy */ inline __fastcall virtual ~TColorGrid(void) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TColorGrid(HWND ParentWindow) : Controls::TCustomControl(ParentWindow) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
static const Shortint NumPaletteEntries = 0x14;

}	/* namespace Colorgrd */
using namespace Colorgrd;
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// Colorgrd
