Return to Appendix B.

ESBUTTON.H
// Matt Streeter
// 2/27/00
// ESBUTTON.H
// Header for class TESButton; custom implementation of TButton control
// Copyright Matt Streeter, 2000.  All rights reserved

#ifndef __ESBUTTON_H__
#define __ESBUTTON_H__

#include <owl\button.h>
#include <owl\color.h>
#include <windows.h>
#include "types.h"

// Set to 1 to enable use of custom TESButton class; otherwise default
// TButton class will be used.
#define USE_PRETTY_BUTTONS 1

class TESButton;

#include "eswindow.h"

struct TESButtonNode
{
	TESButton *pButton;
   TESButtonNode *pNext;
};

class TESButton: public TButton
{
  public:
	TESButton(TESWindow* parent,int Id,const char far* text,int X,int Y,int W,
		int H,bool isDefault = false,TModule* module = 0);
#if(USE_PRETTY_BUTTONS)
	TESButton(TESWindow *parent,int Id,	const char far* text,int X,int Y,
		bool isDefault = false,TModule* module = 0);
	int GetWidth() {return Attr.W;}
	int GetHeight() {return Attr.H;}
#endif
	~TESButton();
	static int IsESButton(TWindow *pWindow);

	static TESButtonNode *mpESButtonList;
	static TColor mFrameHighlightColor;
	static TColor mFrameLowlightColor;

#if(USE_PRETTY_BUTTONS)
	byte mbMouseIn;

	void EvMouseMove(uint modKeys, TPoint& point);
	void EvParentMouseMove(uint /*modKeys*/, TPoint& point);

	DECLARE_RESPONSE_TABLE(TESButton);

  protected:
	void MouseEnter();
	void MouseLeave();
	void GetWindowClass(WNDCLASS& WndClass);
	void ODADrawEntire(DRAWITEMSTRUCT far&);
	void Draw();
	int GetMinHeight(TWindow *pParent,char *pText);
   int GetMinWidth(TWindow *pParent,char *pText);

  private:
	int AddToButtonList(TESButton *pButton);
	int RemoveFromButtonList(TESButton *pButton);
   TESWindow *mpESParent;
#endif

};

#endif

Return to Appendix B.