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

// (DO NOT EDIT: machine generated header) 'DropDownButton.pas' rev: 22.00

#ifndef DropdownbuttonHPP
#define DropdownbuttonHPP

#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 <SysUtils.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Dialogs.hpp>	// Pascal unit
#include <ColorForm.hpp>	// Pascal unit
#include <Types.hpp>	// Pascal unit

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

namespace Dropdownbutton
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TBtnState { bsNormal, bsFocus, bsDown, bsDropDown };
#pragma option pop

class DELPHICLASS TDropDownButton;
class PASCALIMPLEMENTATION TDropDownButton : public Controls::TCustomControl
{
	typedef Controls::TCustomControl inherited;
	
private:
	Graphics::TBitmap* FGraphic;
	Graphics::TBitmap* FDownBmp;
	TBtnState FState;
	bool FDowned;
	Types::TPoint FDownPoint;
	Controls::TMouseEvent FOnDropMouseUp;
	Controls::TMouseEvent FOnDropMouseDown;
	Classes::TNotifyEvent FOnMouseLeave;
	Classes::TNotifyEvent FOnMouseEnter;
	bool FTransparent;
	Classes::TNotifyEvent FOnInitData;
	HIDESBASE MESSAGE void __fastcall CMMouseEnter(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
	void __fastcall SetState(const TBtnState Value);
	void __fastcall SetGraphic(const Graphics::TBitmap* Value);
	void __fastcall SetTransparent(const bool Value);
	
protected:
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	virtual void __fastcall Paint(void);
	DYNAMIC void __fastcall Click(void);
	
public:
	__fastcall virtual TDropDownButton(Classes::TComponent* AOwner);
	__fastcall virtual ~TDropDownButton(void);
	__property TBtnState State = {read=FState, write=SetState, nodefault};
	
__published:
	__property OnClick;
	__property OnMouseDown;
	__property OnMouseUp;
	__property Classes::TNotifyEvent OnMouseEnter = {read=FOnMouseEnter, write=FOnMouseEnter};
	__property Classes::TNotifyEvent OnMouseLeave = {read=FOnMouseLeave, write=FOnMouseLeave};
	__property Controls::TMouseEvent OnDropMouseDown = {read=FOnDropMouseDown, write=FOnDropMouseDown};
	__property Controls::TMouseEvent OnDropMouseUp = {read=FOnDropMouseUp, write=FOnDropMouseUp};
	__property Graphics::TBitmap* Graphic = {read=FGraphic, write=SetGraphic};
	__property bool Transparent = {read=FTransparent, write=SetTransparent, default=0};
	__property Classes::TNotifyEvent OnInitData = {read=FOnInitData, write=FOnInitData};
public:
	/* TWinControl.CreateParented */ inline __fastcall TDropDownButton(HWND ParentWindow) : Controls::TCustomControl(ParentWindow) { }
	
};


class DELPHICLASS TColorButton;
class PASCALIMPLEMENTATION TColorButton : public TDropDownButton
{
	typedef TDropDownButton inherited;
	
private:
	Graphics::TColor FSelected;
	Colorform::TfrmColor* FColorForm;
	bool FListVisible;
	Classes::TNotifyEvent FOnSetColor;
	Graphics::TColor FDefaultColor;
	MESSAGE void __fastcall WMDeactive(Messages::TMessage &Message);
	MESSAGE void __fastcall WMCancel(Messages::TMessage &Message);
	MESSAGE void __fastcall WMColor(Messages::TMessage &Message);
	void __fastcall SetSelected(const Graphics::TColor Value);
	void __fastcall SetDefaultColor(const Graphics::TColor Value);
	
protected:
	virtual void __fastcall Paint(void);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall Click(void);
	
public:
	__fastcall virtual TColorButton(Classes::TComponent* AOwner);
	__fastcall virtual ~TColorButton(void);
	
__published:
	__property Graphics::TColor Selected = {read=FSelected, write=SetSelected, default=0};
	__property Classes::TNotifyEvent OnSetColor = {read=FOnSetColor, write=FOnSetColor};
	__property Graphics::TColor DefaultColor = {read=FDefaultColor, write=SetDefaultColor, nodefault};
public:
	/* TWinControl.CreateParented */ inline __fastcall TColorButton(HWND ParentWindow) : TDropDownButton(ParentWindow) { }
	
};


//-- var, const, procedure ---------------------------------------------------
static const System::Word WM_DEACTIVE = 0x7e9;
static const System::Word WM_CANCEL = 0x7ea;
static const System::Word WM_COLOR = 0x7eb;

}	/* namespace Dropdownbutton */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE)
using namespace Dropdownbutton;
#endif
#pragma pack(pop)
#pragma option pop

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