// CodeGear C++Builder
// Copyright (c) 1995, 2025 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'ColorBtn.pas' rev: 37.00 (Windows)

#ifndef ColorBtnHPP
#define ColorBtnHPP

#pragma delphiheader begin
#pragma option push
#if defined(__BORLANDC__) && !defined(__clang__)
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#endif
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <Winapi.Windows.hpp>
#include <Winapi.Messages.hpp>
#include <System.SysUtils.hpp>
#include <System.Classes.hpp>
#include <Vcl.Graphics.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <System.Types.hpp>
#include <System.UITypes.hpp>

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

namespace Colorbtn
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TSMCustomColorBtn;
class DELPHICLASS TDropColorBtn;
class DELPHICLASS TSMColorWin;
class DELPHICLASS TColorButton;
//-- type declarations -------------------------------------------------------
enum DECLSPEC_DENUM TColorType : unsigned char { ctcText, ctcFill, ctcLine, ctcHighlight };

enum DECLSPEC_DENUM TDownButton : unsigned char { dbNone, dbColor, dbDropDown };

class PASCALIMPLEMENTATION TSMCustomColorBtn : public Vcl::Controls::TGraphicControl
{
	typedef Vcl::Controls::TGraphicControl inherited;
	
private:
	System::Uitypes::TColor FColor;
	bool FDragging;
	bool FFlat;
	bool FDown;
	bool FMouseInControl;
	System::Classes::TNotifyEvent FOnMouseEnter;
	System::Classes::TNotifyEvent FOnMouseLeave;
	System::Classes::TNotifyEvent FOnChange;
	HIDESBASE void __fastcall SetColor(System::Uitypes::TColor Value);
	void __fastcall SetFlat(bool Value);
	void __fastcall UpdateTracking();
	HIDESBASE MESSAGE void __fastcall CMEnabledChanged(Winapi::Messages::TMessage &Message);
	MESSAGE void __fastcall CMSysColorChange(Winapi::Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall CMMouseEnter(Winapi::Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall CMMouseLeave(Winapi::Messages::TMessage &Message);
	
protected:
	DYNAMIC void __fastcall MouseDown(System::Uitypes::TMouseButton Button, System::Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(System::Uitypes::TMouseButton Button, System::Classes::TShiftState Shift, int X, int Y);
	virtual void __fastcall Paint();
	
public:
	__fastcall virtual TSMCustomColorBtn(System::Classes::TComponent* AOwner);
	DYNAMIC void __fastcall Click();
	
__published:
	__property System::Uitypes::TColor Color = {read=FColor, write=SetColor, nodefault};
	__property bool Flat = {read=FFlat, write=SetFlat, default=0};
	__property System::Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
	__property System::Classes::TNotifyEvent OnMouseEnter = {read=FOnMouseEnter, write=FOnMouseEnter};
	__property System::Classes::TNotifyEvent OnMouseLeave = {read=FOnMouseLeave, write=FOnMouseLeave};
	__property Enabled = {default=1};
	__property ParentShowHint = {default=1};
	__property ShowHint;
	__property Visible = {default=1};
	__property OnClick;
	__property OnMouseDown;
	__property OnMouseMove;
	__property OnMouseUp;
public:
	/* TGraphicControl.Destroy */ inline __fastcall virtual ~TSMCustomColorBtn() { }
	
};


class PASCALIMPLEMENTATION TDropColorBtn : public TSMCustomColorBtn
{
	typedef TSMCustomColorBtn inherited;
	
private:
	bool FSelected;
	
protected:
	virtual void __fastcall Paint();
	
public:
	__fastcall virtual TDropColorBtn(System::Classes::TComponent* AOwner);
	
__published:
	__property bool Selected = {read=FSelected, write=FSelected, nodefault};
public:
	/* TGraphicControl.Destroy */ inline __fastcall virtual ~TDropColorBtn() { }
	
};


class PASCALIMPLEMENTATION TSMColorWin : public Vcl::Controls::TCustomControl
{
	typedef Vcl::Controls::TCustomControl inherited;
	
private:
	TColorButton* FColorButton;
	void __fastcall OnBtnClick(System::TObject* Sender);
	HIDESBASE MESSAGE void __fastcall WMMouseActivate(Winapi::Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall CMMouseLeave(Winapi::Messages::TMessage &Message);
	void __fastcall UpdateSelected();
	
protected:
	virtual void __fastcall CreateParams(Vcl::Controls::TCreateParams &Params);
	
public:
	__fastcall virtual TSMColorWin(System::Classes::TComponent* AOwner);
public:
	/* TCustomControl.Destroy */ inline __fastcall virtual ~TSMColorWin() { }
	
public:
	/* TWinControl.CreateParented */ inline __fastcall TSMColorWin(HWND ParentWindow) : Vcl::Controls::TCustomControl(ParentWindow) { }
	
};


class PASCALIMPLEMENTATION TColorButton : public TSMCustomColorBtn
{
	typedef TSMCustomColorBtn inherited;
	
private:
	Vcl::Graphics::TBitmap* FGlyphDropDown;
	Vcl::Graphics::TBitmap* FGlyphText;
	Vcl::Graphics::TBitmap* FGlyphFill;
	Vcl::Graphics::TBitmap* FGlyphLine;
	Vcl::Graphics::TBitmap* FGlyphHighlight;
	TDownButton FDownButton;
	TColorType FColorType;
	int FDropWidth;
	System::Classes::TNotifyEvent FOnDropClick;
	TSMColorWin* FDropPnl;
	void __fastcall SetColorType(TColorType Value);
	Vcl::Graphics::TBitmap* __fastcall GetGlyph();
	HIDESBASE MESSAGE void __fastcall CMMouseLeave(Winapi::Messages::TMessage &Message);
	
protected:
	DYNAMIC void __fastcall MouseDown(System::Uitypes::TMouseButton Button, System::Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(System::Uitypes::TMouseButton Button, System::Classes::TShiftState Shift, int X, int Y);
	virtual void __fastcall Paint();
	virtual void __fastcall CreateDropPnl();
	
public:
	__fastcall virtual TColorButton(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TColorButton();
	DYNAMIC void __fastcall Click();
	virtual void __fastcall DropClick();
	
__published:
	__property TColorType ColorType = {read=FColorType, write=SetColorType, nodefault};
	__property System::Classes::TNotifyEvent OnDropClick = {read=FOnDropClick, write=FOnDropClick};
};


//-- var, const, procedure ---------------------------------------------------
extern DELPHI_PACKAGE void __fastcall Register(void);
}	/* namespace Colorbtn */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_COLORBTN)
using namespace Colorbtn;
#endif
#pragma pack(pop)
#pragma option pop

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