20 #include "../../../idlib/precompiled.h"
24 #include "../../../sys/win32/rc/proptree_Resource.h"
30 static char THIS_FILE[] = __FILE__;
33 #define PROPTREEITEM_EXPANDCOLUMN 16 // width of the expand column
34 #define PROPTREEITEM_COLRNG 5 // width of splitter
35 #define PROPTREEITEM_DEFHEIGHT 21 // default heigt of an item
44 m_BackBufferSize(0,0),
85 LPCTSTR pszCreateClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, ::LoadCursor(
NULL, IDC_ARROW));
87 return pWnd->Create(pszCreateClass, _T(
""), dwStyle, rect, pParentWnd, nID);
93 CWnd::OnSize(nType, cx, cy);
117 int nPlanes = dc.GetDeviceCaps(PLANES);
118 int nBitCount = dc.GetDeviceCaps(BITSPIXEL);
135 nHeight = rc.Height() + 1;
137 ZeroMemory(&si,
sizeof(SCROLLINFO));
138 si.cbSize =
sizeof(SCROLLINFO);
139 si.fMask = SIF_RANGE|SIF_PAGE;
144 if ((
int)si.nPage>si.nMax)
147 SetScrollInfo(SB_VERT, &si,
TRUE);
164 memdc.CreateCompatibleDC(&dc);
171 memdc.SelectObject(GetSysColorBrush(COLOR_BTNFACE));
172 memdc.PatBlt(rc.left, rc.top, rc.Width(), rc.Height(), PATCOPY);
176 memdc.PatBlt(rc.left, rc.top, rc.Width(), rc.Height(),
m_pProp->IsWindowEnabled() ? WHITENESS : PATCOPY);
180 memdc.SelectObject(GetSysColorBrush(COLOR_BTNFACE));
184 memdc.DrawEdge(&rc, BDR_SUNKENOUTER, BF_RECT);
194 HRGN hRgn = CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
195 SelectClipRgn(memdc.m_hDC, hRgn);
205 SelectClipRgn(memdc.m_hDC,
NULL);
210 dc.BitBlt(rc.left, rc.top, rc.Width(), rc.Height(), &memdc, rc.left, rc.top, SRCCOPY);
217 if (nHitTest==HTCLIENT)
240 return CWnd::OnSetCursor(pWnd, nHitTest, message);
253 if (!
m_pProp->IsWindowEnabled())
325 if (pItem!=pOldFocus)
417 if (pItem!=pOldFocus)
458 ZeroMemory(&si,
sizeof(SCROLLINFO));
459 si.cbSize =
sizeof(SCROLLINFO);
460 si.fMask = SIF_RANGE;
462 GetScrollInfo(SB_VERT, &si);
467 if (si.nMax - si.nMin < rc.Height())
559 return DLGC_WANTARROWS|DLGC_WANTCHARS|DLGC_WANTALLKEYS;
572 nHeight = rc.Height() + 1;
574 ZeroMemory(&si,
sizeof(SCROLLINFO));
575 si.cbSize =
sizeof(SCROLLINFO);
576 si.fMask = SIF_RANGE;
578 GetScrollInfo(SB_VERT, &si);
605 ny = __min(__max(ny, si.nMin), si.nMax - nHeight);
611 SetScrollInfo(SB_VERT, &si,
TRUE);
CPropTreeItem * FocusPrev()
void Select(BOOL bSelect=TRUE)
void Check(BOOL bCheck=TRUE)
const POINT & GetOrigin()
CONST PIXELFORMATDESCRIPTOR UINT
BOOL IsItemVisible(CPropTreeItem *pItem)
void SelectItems(CPropTreeItem *pItem, BOOL bSelect=TRUE)
virtual LONG DrawItem(CDC *pDC, const RECT &rc, LONG x, LONG y)
#define PROPTREEITEM_EXPANDCOLUMN
afx_msg void OnLButtonUp(UINT nFlags, CPoint point)
CPropTreeItem * FocusNext()
void RecreateBackBuffer(int cx, int cy)
void SetFocusedItem(CPropTreeItem *pItem)
CPropTreeItem * GetFocusedItem()
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point)
afx_msg BOOL OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message)
afx_msg UINT OnGetDlgCode()
LRESULT SendNotify(UINT nNotifyCode, CPropTreeItem *pItem=NULL)
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
CPropTreeItem * GetSibling()
void SetColumn(LONG nColumn)
CPropTreeItem * GetChild()
void SetOriginOffset(LONG nOffset)
CPropTreeItem * GetRootItem()
#define PTN_ITEMBUTTONCLICK
afx_msg void OnLButtonDown(UINT nFlags, CPoint point)
#define PTN_ITEMEXPANDING
CPropTreeItem * FocusFirst()
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
void Expand(BOOL bExpand=TRUE)
#define PROPTREEITEM_COLRNG
#define PROPTREEITEM_DEFHEIGHT
CPropTreeItem * FindItem(const POINT &pt)
void UpdateMoveAllItems()
void Activate(int activateType, CPoint point)
afx_msg void OnSize(UINT nType, int cx, int cy)
CPropTreeItem * FocusLast()
afx_msg void OnMouseMove(UINT nFlags, CPoint point)
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
BOOL Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
LONG HitTest(const POINT &pt)