20 #include "../../../idlib/precompiled.h"
28 static char THIS_FILE[] = __FILE__;
31 #define PROPTREEITEM_EXPANDCOLUMN 16 // width of the expand column
32 #define PROPTREEITEM_COLRNG 5 // width of splitter
35 static const CString strOfficeFontName = _T(
"Tahoma");
36 static const CString strDefaultFontName = _T(
"MS Sans Serif");
66 static int CALLBACK FontFamilyProcFonts(
const LOGFONT
FAR* lplf,
const TEXTMETRIC
FAR*, ULONG,
LPARAM)
69 CString strFont = lplf->lfFaceName;
70 return strFont.CollateNoCase (strOfficeFontName) == 0 ? 0 : 1;
88 m_bDisableInput(
FALSE)
116 ON_WM_SYSCOLORCHANGE()
134 LPCTSTR pszCreateClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW, ::LoadCursor(
NULL, IDC_ARROW));
136 return pWnd->Create(pszCreateClass, _T(
""), dwStyle, rect, pParentWnd, nID);
142 if (CWnd::OnCreate(lpCreateStruct) == -1)
153 dwStyle = WS_VISIBLE|WS_CHILD|WS_VSCROLL;
157 TRACE0(
"Failed to create CPropTreeList\n");
166 dwStyle &= ~WS_VSCROLL;
168 if (!
m_Info.Create(_T(
""), dwStyle, rc,
this))
170 TRACE0(
"Failed to create CPropTreeInfo\n");
188 CWnd::OnSize(nType, cx, cy);
197 if (IsWindow(
m_List.m_hWnd))
200 if (IsWindow(
m_Info.m_hWnd))
205 if (IsWindow(
m_List.m_hWnd))
206 m_List.MoveWindow(0, 0, cx, cy);
213 NONCLIENTMETRICS info;
214 info.cbSize =
sizeof(info);
216 ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
sizeof(info), &info, 0);
219 memset(&lf, 0,
sizeof (LOGFONT));
222 lf.lfCharSet = (BYTE)GetTextCharsetInfo(dc.GetSafeHdc(),
NULL, 0);
224 lf.lfHeight = info.lfMenuFont.lfHeight;
225 lf.lfWeight = info.lfMenuFont.lfWeight;
226 lf.lfItalic = info.lfMenuFont.lfItalic;
229 _tcscpy(lf.lfFaceName, info.lfMenuFont.lfFaceName);
231 BOOL fUseSystemFont = (info.lfMenuFont.lfCharSet > SYMBOL_CHARSET);
235 if (::EnumFontFamilies(dc.GetSafeHdc(),
NULL, FontFamilyProcFonts, 0)==0)
238 _tcscpy(lf.lfFaceName, strOfficeFontName);
243 _tcscpy(lf.lfFaceName, strDefaultFontName);
250 lf.lfWeight = FW_BOLD;
340 if (pItem!=&
m_Root && !proc(
this, pItem, lParam))
366 if (!IsWindow(m_hWnd))
403 if (rc.IsRectEmpty())
469 if (!IsWindow(m_hWnd))
535 if (!rc.PtInRect(pt))
542 oy = pt.y - rc.Height() + pItem->
GetHeight();
633 if (p.y>=ipt.y && p.y<ipt.y + pItem->
GetHeight())
678 pWnd->EnableWindow(!bDisable);
862 if (!IsWindow(m_hWnd))
885 lpnm = (LPNMHDR)&nmmp;
893 lpnm->code = nNotifyCode;
894 lpnm->hwndFrom = m_hWnd;
906 CWnd::OnEnable(bEnable);
913 CWnd::OnSysColorChange();
CPropTreeItem * FocusPrev()
virtual BOOL HitButton(const POINT &pt)
void Select(BOOL bSelect=TRUE)
static CFont * GetNormalFont()
afx_msg void OnEnable(BOOL bEnable)
CPropTreeItem * GetNextVisible()
CPropTreeItem * m_pVisbleList
CONST PIXELFORMATDESCRIPTOR UINT
static CFont * s_pBoldFont
BOOL IsItemVisible(CPropTreeItem *pItem)
void SelectItems(CPropTreeItem *pItem, BOOL bSelect=TRUE)
void DeleteItem(CPropTreeItem *pItem)
BOOL HitCheckBox(const POINT &pt)
void SetChild(CPropTreeItem *pChild)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
afx_msg void OnSize(UINT nType, int cx, int cy)
void ResizeChildWindows(int cx, int cy)
CPropTreeItem * FocusNext()
void FreeGlobalResources()
void EnsureVisible(CPropTreeItem *pItem)
static CFont * GetBoldFont()
void SetPropOwner(CPropTree *pProp)
void SetFocusedItem(CPropTreeItem *pItem)
CPropTreeItem * GetFocusedItem()
static UINT s_nInstanceCount
void InitGlobalResources()
static BOOL CALLBACK EnumSelectAll(CPropTree *, CPropTreeItem *pItem, LPARAM lParam)
LRESULT SendNotify(UINT nNotifyCode, CPropTreeItem *pItem=NULL)
void SetParent(CPropTreeItem *pParent)
void InitPropTree(HINSTANCE hInstance)
void AddToVisibleList(CPropTreeItem *pItem)
void SetSibling(CPropTreeItem *pSibling)
CPropTreeItem * GetSibling()
void SetColumn(LONG nColumn)
CPropTreeItem * GetChild()
void SetOriginOffset(LONG nOffset)
CPropTreeItem * GetRootItem()
#define PTN_ITEMBUTTONCLICK
const POINT & GetLocation()
void SetCtrlID(UINT nCtrlID)
#define PTN_ITEMEXPANDING
BOOL EnumItems(CPropTreeItem *pItem, ENUMPROPITEMPROC proc, LPARAM lParam=0L)
CPropTreeItem * FocusFirst()
CPropTreeItem * GetVisibleList()
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
void Expand(BOOL bExpand=TRUE)
static BOOL CALLBACK EnumMoveAll(CPropTree *, CPropTreeItem *pItem, LPARAM)
BOOL Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
void RefreshItems(CPropTreeItem *pItem=NULL)
static BOOL CALLBACK EnumFindItem(CPropTree *pProp, CPropTreeItem *pItem, LPARAM lParam)
void SetNextVisible(CPropTreeItem *pVis)
void SetPropOwner(CPropTree *pProp)
MFnDagNode * GetParent(MFnDagNode *joint)
#define PROPTREEITEM_COLRNG
void Delete(CPropTreeItem *pItem)
static CPropTreeItem * s_pFound
static BOOL CALLBACK EnumRefreshAll(CPropTree *, CPropTreeItem *pItem, LPARAM)
afx_msg void OnSysColorChange()
CPropTreeItem * FindItem(const POINT &pt)
#define PROPTREEITEM_EXPANDCOLUMN
#define PTN_DELETEALLITEMS
CPropTreeItem * InsertItem(CPropTreeItem *pItem, CPropTreeItem *pParent=NULL)
void UpdateMoveAllItems()
void ShowInfoText(BOOL bShow=TRUE)
void DisableInput(BOOL bDisable=TRUE)
CPropTreeItem * GetParent()
CPropTreeItem * FocusLast()
void SetPropOwner(CPropTree *pProp)
BOOL Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
BOOL HitExpand(const POINT &pt)
static CFont * s_pNormalFont
LONG HitTest(const POINT &pt)