//-----------------------------------------------------------------------------
#ifndef PropViewFrameBaseH
#define PropViewFrameBaseH PropViewFrameBaseH
//-----------------------------------------------------------------------------
#include <wx/wx.h>
#include <wxPropGrid/Include/propgrid.h>

class wxPropertyGrid;
class wxPropertyGridEvent;

//-----------------------------------------------------------------------------
class PropGridFrameBase : public wxFrame
//-----------------------------------------------------------------------------
{
	// any class wishing to process wxWidgets events must use this macro
	DECLARE_EVENT_TABLE()
	wxPropertyGrid*						m_pPropGrid;
	wxTimer								m_ListUpdateTimer;
protected:
	//-----------------------------------------------------------------------------
	enum TTimerEvent
	//-----------------------------------------------------------------------------
	{
		teListUpdate
	};
	//-----------------------------------------------------------------------------
	// IDs for the controls and the menu commands
	enum TMenuItemBase
	//-----------------------------------------------------------------------------
	{
		widPropGrid = 1,
		miPopUpMethExec,
		miPopUpPropForceRefresh,
		miPopUpPropRestoreDefault,
		miPopUpPropAppendValue,
		miPopUpPropDeleteValue,
		miPopUpPropSetMultiple,
		miPopUpPropSetMultiple_FixedValue,
		miPopUpPropSetMultiple_FromToRange,
		mibLAST
	};

			void			CreatePropertyGrid( wxWindow* pParent, const wxSize& size = wxDefaultSize );
			wxPropertyGrid*	GetPropertyGrid( void ) { return m_pPropGrid; }
			void			OnPopUpPropForceRefresh( wxCommandEvent& e );
			void			OnPopUpPropRestoreDefault( wxCommandEvent& e );
			void			OnPopUpPropAppendValue( wxCommandEvent& e );
			void			OnPopUpPropDeleteValue( wxCommandEvent& e );
			void			OnPopUpPropSetMultiple_FixedValue( wxCommandEvent& e );
			void			OnPopUpPropSetMultiple_FromToRange( wxCommandEvent& e );
			void			OnPropertyChanged( wxPropertyGridEvent& e );
			void			OnPropertyRightClicked( wxPropertyGridEvent& e );
			void			OnPropertySelected( wxPropertyGridEvent& e );
			void			OnExecutePropGridMethod( wxCommandEvent& e );
			void			OnTimer( wxTimerEvent& e );
			void			StartPropertyGridUpdateTimer( int period_ms );
			void			StopPropertyGridUpdateTimer( void);
	virtual void			OnPropertyGridTimer( void ) = 0;
	virtual void			OnPropertyChangedCustom( wxPropertyGridEvent& ) {}
	virtual void			OnPropertyRightClickedCustom( wxPropertyGridEvent& ) {}
	virtual void			OnPropertySelectedCustom( wxPropertyGridEvent& ) {}
public:
	explicit				PropGridFrameBase( wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size );
						   ~PropGridFrameBase();
	virtual void			WriteErrorMessage( const wxString& msg ) = 0;
	virtual void			WriteLogMessage( const wxString& msg, const wxTextAttr& style = wxTextAttr(*wxBLACK) ) = 0;
};

#endif // PropViewFrameBaseH
