////////////////////////////////////////////////////////////////////////////////
//
// APropertyUserControlEvent  -     
// ATreeCtrlEvent             -    ocx 
// AToolBarCtrlEvent          -    ocx toolbar'a
// AContextMenuEvent          -    ocx  
//
////////////////////////////////////////////////////////////////////////////////
#ifndef _APROPUSEREVENT_H
#define _APROPUSEREVENT_H

#ifndef _ABASEEVENT_H
#include "ABaseEvent.h"
#endif

#include "PArray.h"

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000     


class ATreeCtrlEvent;
class AToolBarCtrlEvent;
class AContextMenuEvent;

class UserControlEventCallback
{
  public:
    virtual bool CallbackCreateOCX ( LPDISPATCH iOcx, long controlID ) { return false; }
    virtual bool CallbackDestroyOCX(                  long controlID ) { return false; }
};


////////////////////////////////////////////////////////////////////////////////
//
// APropertyUserControlEvent  -     
//
////////////////////////////////////////////////////////////////////////////////
class APropertyUserControlEvent : public ABaseEvent
{
  UserControlEventCallback * m_notifyObj; //  
  long                       m_controlID;          //  
public:
  // 
	APropertyUserControlEvent( LPDISPATCH ctrl, long _controlID );           
  // 
  virtual ~APropertyUserControlEvent();

  void SetNotifyObj( UserControlEventCallback * obj ) { m_notifyObj = obj; }

protected:

  //puCreateOCX  " OCX ."
  afx_msg BOOL CreateOCX(  LPDISPATCH iOcx );
  //puDestroyOCX " OCX ."
  afx_msg BOOL DestroyOCX();

protected:


	DECLARE_EVENTSINK_MAP()
};

//-----------------------------------------------------------------------------
// ATreeCtrlEvent  -    ocx 
// ---
class ATreeCtrlEvent : public ABaseEvent
{
public:
	ATreeCtrlEvent( LPDISPATCH ctrl );           
  virtual ~ATreeCtrlEvent();

protected:
  afx_msg void BeforeLabelEdit ( short * Cancel );
  afx_msg void AfterLabelEdit  ( short * Cancel, BSTR * NewString );
  afx_msg void Collapse        ( struct INode * Node );
  afx_msg void Expand          ( struct INode * Node );
  afx_msg void NodeClick       ( struct INode * Node );
  afx_msg void NodeCheck       ( struct INode * Node );

  DECLARE_EVENTSINK_MAP()
};

//-----------------------------------------------------------------------------
// AToolBarCtrlEvent  -    ocx toolbar'a
// ---
class AToolBarCtrlEvent : public ABaseEvent
{
public:
	AToolBarCtrlEvent( LPDISPATCH ctrl );           
  virtual ~AToolBarCtrlEvent();

protected:
  afx_msg void ButtonClick     ( struct IButton * Button );
  afx_msg void Change          ();
  afx_msg void ButtonMenuClick ( struct IButtonMenu * ButtonMenu );
  afx_msg void ButtonDropDown  ( struct IButton * Button );



  DECLARE_EVENTSINK_MAP()
};


//-----------------------------------------------------------------------------
// AContextMenuEvent  -    ocx  
// ---
class AContextMenuEvent : public ABaseEvent
{
public:
  CMenu       m_contextMenu;      //  
  CBitmap     m_MenuBmp;          //   
  _DVCTreePtr m_ctrl;             // 
public:
	AContextMenuEvent( _DVCTree * ctrl );           
  virtual ~AContextMenuEvent();

protected:
  afx_msg void MenuCommand ( long Id );

  DECLARE_EVENTSINK_MAP()
};




////////////////////////////////////////////////////////////////////////////////
#endif 
