- /***********************************************************************
- *
- * This module is part of the XMLGUI system
- *
- * File name: DlgItemTemplate.h
- *
- * Creation date: [12 AUGUST 2002]
- *
- * Author(s): [Kolosenko Ruslan]
- *
- * Description: Declares the CDlgItemTemplate class
- *
- **********************************************************************/
- #ifndef AFX_DLGITEMTEMPLATE_H_RKOL_8_12_2002_
- #define AFX_DLGITEMTEMPLATE_H_RKOL_8_12_2002_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "XMLGUIMacro.h"
- class XMLGUI_EXT_CLASS CDlgItemTemplate
- {
- public:
- CDlgItemTemplate();
- virtual ~CDlgItemTemplate();
- // control's data ( public access )
- DWORD style; // style of the control's window
- DWORD dwExtendedStyle; // ex.style of the control's window
- // all sizes below are in dialog units
- short x; // left border of the control's window
- short y; // top border of the control's window
- short cx; // width of the control's window
- short cy; // height of the control's window
- WORD id; // ID of the control
- protected:
- // control's data ( protected access )
- _bstr_t m_strWndClass; // window class for the control can be specified either
- WORD m_nWndClassOrdinal; // by name or by ordinal number
- _bstr_t m_strTitle; // text in the control's window, in some cases
- WORD m_nRCOrdinal; // the meaning of the text is the name of another
- // resource ( e.g. name of the icon ). In these cases this value may be specified
- // by the ordinal indicating resource ID rather than name string.
- BOOL m_bIsActiveX; // TRUE if control represents an OLE control
- LPDLGITEMTEMPLATE m_pWinTemplate; // pointer to generated DLGITEMTEMPLATE structure
- LPVOID m_pInitData; // pointer to the allocated memory with init data
- // for OLE controls and other controls that require init data section
- public:
- // retrieving and setting protected control's data members1
- CString GetWndClass() // get control's window class
- { return (LPCTSTR)m_strWndClass; }
- void SetWndClass(LPCTSTR szClass) // set control's window class
- { m_strWndClass = szClass; m_nWndClassOrdinal = 0; }
- void SetWndClass(const _bstr_t& strClass)
- { m_strWndClass = strClass; m_nWndClassOrdinal = 0; }
- WORD GetWndClassOrdinal() // get control's window class ordinal
- { return m_nWndClassOrdinal; }
- void SetWndClassOrdinal(WORD nID) // set control's window class ordinal
- { m_nWndClassOrdinal = nID; m_strWndClass = _T(""); }
- CString GetTitle() // get control's window text
- { return (LPCTSTR)m_strTitle; }
- void SetTitle(LPCTSTR szTitle) // set control's window text
- { m_strTitle = szTitle; m_nRCOrdinal = 0; }
- void SetTitle(const _bstr_t& strTitle)
- { m_strTitle = strTitle; m_nRCOrdinal = 0; }
- WORD GetRCOrdinal() // get control's resource ID ordinal
- { return m_nRCOrdinal; }
- void SetRCOrdinal(WORD nID) // set control's resource ID ordinal
- { m_nRCOrdinal = nID; m_strTitle = _T(""); }
- // general dlgitemtemplate's operations with public access
- BOOL SerializeFrom(IXMLElement* pXMLTag); // create dialog item template
- // given a pointer to XML element
- operator LPDLGITEMTEMPLATE(); // create and return Win32 DLGITEMTEMPLATE structure
- UINT Length(); // return length in bytes of the resulting DLGITEMTEMPLATE structure
- LPVOID GetInitData(); // create and return init data section for the control
- UINT InitDataLength(); // return length in bytes of the control's init data section
- UINT FillBuffer(LPVOID lpStructBuffer); // fill already allocated memory with
- // DLGITEMTEMPLATE structure, introduced for fast DLGTEMPLATE building
- UINT FillInitDataBuffer(LPVOID lpInitDataBuffer); // fill already allocated memory
- // with init data section for the control
- void Invalidate(); // invalidate previously built DLGITEMTEMPLATE structure,
- // free the allocated memory
- };
- #endif // AFX_DLGITEMTEMPLATE_H_RKOL_8_12_2002_