//*******************************************************************************
// COPYRIGHT NOTES
// ---------------
// This source code is a part of Tangram library.
// You may use, compile or redistribute it as part of your application
// for free. You cannot redistribute it as a part of a software development
// library without the agreement of the author. If the sources are
// distributed along with the application, you should leave the original
// copyright notes in the source code without any changes.
// This code can be used WITHOUT ANY WARRANTIES on your own risk.
//
// For the latest updates to this library, check site:
// http://www.tangramdev.com
//
// sunhui
//*******************************************************************************
// Board.h : Declaration of the CTangramWindow
#ifndef __BOARD_H_
#define __BOARD_H_
#include "resource.h" // main symbols
#include "TabWnd.h"
/////////////////////////////////////////////////////////////////////////////
// CTangramWindow
class ATL_NO_VTABLE CTangramWindow : public CTangramWindowObj,
public CComObjectRootEx<CComSingleThreadModel>,
public CStockPropImpl<CTangramWindow, ITangramWindow, &__uuidof(ITangramWindow), &LIBID_VisualFrameWorkLib>,
public CComControl<CTangramWindow>,
public IPersistStreamInitImpl<CTangramWindow>,
public IOleControlImpl<CTangramWindow>,
public IOleObjectImpl<CTangramWindow>,
public IViewObjectExImpl<CTangramWindow>,
public IOleInPlaceObjectWindowlessImpl<CTangramWindow>,
public IPersistStorageImpl<CTangramWindow>,
public ISpecifyPropertyPagesImpl<CTangramWindow>,
public IQuickActivateImpl<CTangramWindow>,
public CComCoClass<CTangramWindow, &CLSID_TangramWindow>
{
public:
CTangramWindow()
{
((CDocCntrItem*)m_pOleItem)->m_pTangramWindow = this;
m_pPicture = NULL;
}
DECLARE_REGISTRY_RESOURCEID(IDR_TangramWindow)
DECLARE_NOT_AGGREGATABLE(CTangramWindow)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CTangramWindow)
COM_INTERFACE_ENTRY(ITangramWindow)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IViewObjectEx)
COM_INTERFACE_ENTRY(IViewObject2)
COM_INTERFACE_ENTRY(IViewObject)
COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
COM_INTERFACE_ENTRY(IOleInPlaceObject)
COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
COM_INTERFACE_ENTRY(IOleControl)
COM_INTERFACE_ENTRY(IOleObject)
COM_INTERFACE_ENTRY(IPersistStreamInit)
COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
COM_INTERFACE_ENTRY(ISpecifyPropertyPages)
COM_INTERFACE_ENTRY(IQuickActivate)
COM_INTERFACE_ENTRY(IPersistStorage)
END_COM_MAP()
BEGIN_PROP_MAP(CTangramWindow)
PROP_DATA_ENTRY("_cx", m_sizeExtent.cx, VT_UI4)
PROP_DATA_ENTRY("_cy", m_sizeExtent.cy, VT_UI4)
//PROP_ENTRY("Caption", DISPID_CAPTION, CLSID_NULL)
//PROP_ENTRY("Enabled", DISPID_ENABLED, CLSID_NULL)
//PROP_ENTRY("Font", DISPID_FONT, CLSID_StockFontPage)
//PROP_ENTRY("MouseIcon", DISPID_MOUSEICON, CLSID_StockPicturePage)
//PROP_ENTRY("MousePointer", DISPID_MOUSEPOINTER, CLSID_NULL)
PROP_ENTRY("Picture", DISPID_PICTURE, CLSID_StockPicturePage)
//PROP_ENTRY("Text", DISPID_TEXT, CLSID_NULL)
// Example entries
// PROP_ENTRY("Property Description", dispid, clsid)
// PROP_PAGE(CLSID_StockColorPage)
END_PROP_MAP()
BEGIN_MSG_MAP(CTangramWindow)
CHAIN_MSG_MAP(CComControl<CTangramWindow>)
DEFAULT_REFLECTION_HANDLER()
END_MSG_MAP()
// Handler prototypes:
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
// LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
// LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
// ITangramWindow
public:
virtual HBITMAP GetBitmap();
//CComBSTR m_bstrCaption;
//BOOL m_bEnabled;
//CComPtr<IFontDisp> m_pFont;
//CComPtr<IPictureDisp> m_pMouseIcon;
CComPtr<IPictureDisp> m_pPicture;
//LONG m_nMousePointer;
//CComBSTR m_bstrText;
};
OBJECT_ENTRY_AUTO(__uuidof(TangramWindow), CTangramWindow)
#endif //__BOARD_H_