//---------------------------------------------------------------------------

#ifndef CustomDrawTreeViewH
#define CustomDrawTreeViewH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include <ImgList.hpp>
#include <Menus.hpp>
//---------------------------------------------------------------------------
class TCustomDrawForm : public TForm
{
__published:	// IDE-managed Components
	TImage *Image1;
	TTreeView *TV;
	TImageList *ImageList;
	TMainMenu *MainMenu1;
	TMenuItem *File1;
	TMenuItem *Exit1;
	TMenuItem *TreeView1;
	TMenuItem *CustomDraw1;
	TMenuItem *Font2;
	TMenuItem *Color2;
	TMenuItem *Drawing1;
	TMenuItem *Font1;
	TMenuItem *Selection1;
	TMenuItem *SelectionBackground1;
	TMenuItem *Background1;
	TMenuItem *Color1;
	TMenuItem *BrushStyle1;
	TMenuItem *Solid1;
	TMenuItem *Clear1;
	TMenuItem *Horizontal1;
	TMenuItem *Vertical1;
	TMenuItem *FDiagonal1;
	TMenuItem *BDiagonal1;
	TMenuItem *Cross1;
	TMenuItem *DiagCross1;
	TMenuItem *Bitmap1;
	TMenuItem *None1;
	TMenuItem *Tile1;
	TMenuItem *Stretch1;
	TMenuItem *N2;
	TMenuItem *DefaultDrawing1;
	TMenuItem *OnCustomDraw1;
	TMenuItem *OnCustomDrawItem1;
	TMenuItem *ButtonColor1;
	TMenuItem *ButtonSize1;
	TFontDialog *TVFontDialog;
	TFontDialog *SelectedFontDialog;
	TColorDialog *BkgColorDialog;
	TColorDialog *SelBkgColorDialog;
	TColorDialog *ButtonColorDialog;
	TColorDialog *TVColorDialog;
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall TVCustomDraw(TCustomTreeView *Sender, const TRect &ARect,
          bool &DefaultDraw);
	void __fastcall TVCustomDrawItem(TCustomTreeView *Sender, TTreeNode *Node,
          TCustomDrawState State, bool &DefaultDraw);
	void __fastcall TVExpanded(TObject *Sender, TTreeNode *Node);
	void __fastcall TVGetImageIndex(TObject *Sender, TTreeNode *Node);
	void __fastcall TVGetSelectedIndex(TObject *Sender, TTreeNode *Node);
	void __fastcall Exit1Click(TObject *Sender);
	void __fastcall Selection1Click(TObject *Sender);
	void __fastcall Color1Click(TObject *Sender);
	void __fastcall SelectionBackground1Click(TObject *Sender);
	void __fastcall Solid1Click(TObject *Sender);
	void __fastcall None1Click(TObject *Sender);
	void __fastcall OnCustomDraw1Click(TObject *Sender);
	void __fastcall OnCustomDrawItem1Click(TObject *Sender);
	void __fastcall ButtonColor1Click(TObject *Sender);
	void __fastcall ButtonSize1Click(TObject *Sender);
	void __fastcall Drawing1Click(TObject *Sender);
	void __fastcall Color2Click(TObject *Sender);
	void __fastcall CustomDraw1Click(TObject *Sender);
	void __fastcall Font2Click(TObject *Sender);
private:	// User declarations
	int FButtonSize;
	bool FDefaultDraw;
	bool FDefaultDrawItem;
	TColor FBackgroundColor;
	TBrushStyle FBrushStyle;
	void __fastcall DrawButton(TRect *ARect, TTreeNode *Node);
	void __fastcall DrawImage(TRect *NodeRect, int ImageIndex);
	void __fastcall SetCustomDraw(bool Value);
public:		// User declarations
	__fastcall TCustomDrawForm(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TCustomDrawForm *CustomDrawForm;
//---------------------------------------------------------------------------
#endif
