20 #include "../../../idlib/precompiled.h"
27 #define PROPTREEITEM_DEFHEIGHT 21 // default heigt of an item
28 #define PROPTREEITEM_SPACE 5 // default horz spacing
29 #define PROPTREEITEM_EXPANDBOX 9 // size of the expand box
30 #define PROPTREEITEM_CHECKBOX 14 // size of the check box
31 #define PROPTREEITEM_EXPANDCOLUMN 16 // width of the expand column
32 #define PNINDENT 16 // child level indent
34 #define PROPTREEITEM_EXPANDBOXHALF (PROPTREEITEM_EXPANDBOX/2)
44 for (; w>0; w-=2, x+=2)
45 SetPixel(hdc, x, y, GetSysColor(COLOR_BTNSHADOW));
56 hPen = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW));
57 oPen = (HPEN)SelectObject(hdc, hPen);
58 oBrush = (HBRUSH)SelectObject(hdc, GetStockObject(bFill ? WHITE_BRUSH : NULL_BRUSH));
61 SelectObject(hdc, GetStockObject(BLACK_PEN));
72 SelectObject(hdc, oPen);
73 SelectObject(hdc, oBrush);
93 m_rcCheckbox(0,0,0,0),
394 LONG nTotal, nCol, ey;
403 m_loc = CPoint(x, y);
428 HGDIOBJ hOld = pDC->SelectObject(GetSysColorBrush(COLOR_BTNFACE));
429 pDC->PatBlt(rc.left, drc.top, rc.right - rc.left + 1, drc.Height(), PATCOPY);
430 pDC->SelectObject(hOld);
454 ir.top =
m_loc.y + ey;
469 hRgn = CreateRectRgn(drc.left, drc.top, drc.right, drc.bottom);
470 SelectClipRgn(pDC->m_hDC, hRgn);
489 pDC->SetTextColor(GetSysColor(COLOR_BTNTEXT));
490 pDC->SetBkMode(TRANSPARENT);
491 pDC->DrawText(
m_sLabel, &ir, DT_SINGLELINE|DT_VCENTER|DT_CALCRECT);
496 HGDIOBJ oPen = pDC->SelectObject(GetStockObject(NULL_PEN));
497 HGDIOBJ oBrush = pDC->SelectObject(GetSysColorBrush(COLOR_HIGHLIGHT));
505 pDC->SelectObject(oPen);
506 pDC->SelectObject(oBrush);
508 pDC->SetTextColor(GetSysColor(COLOR_BTNHIGHLIGHT));
512 if (!
m_pProp->IsWindowEnabled())
513 pDC->SetTextColor(GetSysColor(COLOR_GRAYTEXT));
515 pDC->DrawText(
m_sLabel, &ir, DT_SINGLELINE|DT_VCENTER);
523 pDC->DrawFrameControl(&ir, DFC_BUTTON, DFCS_BUTTONCHECK | (
IsChecked() ? DFCS_CHECKED : 0));
529 SelectClipRgn(pDC->m_hDC,
NULL);
540 CPen pn1(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW));
543 pOld = pDC->SelectObject(&pn1);
544 pDC->MoveTo(nCol, drc.top);
545 pDC->LineTo(nCol, drc.bottom);
547 CPen pn2(PS_SOLID, 1, GetSysColor(COLOR_BTNHIGHLIGHT));
548 pDC->SelectObject(&pn2);
549 pDC->MoveTo(nCol + 1, drc.top);
550 pDC->LineTo(nCol + 1, drc.bottom);
552 pDC->SelectObject(pOld);
560 SelectClipRgn(pDC->m_hDC, hRgn);
564 SelectClipRgn(pDC->m_hDC,
NULL);
#define PROPTREEITEM_DEFHEIGHT
#define PROPTREEITEM_EXPANDBOX
CPropTreeItem * m_pSibling
void HasCheckBox(BOOL bCheckbox=TRUE)
void Select(BOOL bSelect=TRUE)
static CFont * GetNormalFont()
void ReadOnly(BOOL bReadOnly=TRUE)
void Check(BOOL bCheck=TRUE)
CPropTreeItem * GetNextVisible()
const POINT & GetOrigin()
CONST PIXELFORMATDESCRIPTOR UINT
#define PROPTREEITEM_CHECKBOX
virtual LONG DrawItem(CDC *pDC, const RECT &rc, LONG x, LONG y)
virtual void DrawAttribute(CDC *pDC, const RECT &rc)
BOOL HitCheckBox(const POINT &pt)
#define PROPTREEITEM_SPACE
#define PROPTREEITEM_EXPANDBOXHALF
void SetChild(CPropTreeItem *pChild)
void SetLabelText(LPCTSTR sLabel)
static CFont * GetBoldFont()
#define PROPTREEITEM_EXPANDCOLUMN
virtual LPARAM GetItemValue()
LRESULT SendNotify(UINT nNotifyCode, CPropTreeItem *pItem=NULL)
void SetParent(CPropTreeItem *pParent)
void AddToVisibleList(CPropTreeItem *pItem)
void SetSibling(CPropTreeItem *pSibling)
GLubyte GLubyte GLubyte GLubyte w
CPropTreeItem * GetSibling()
CPropTreeItem * GetChild()
CPropTreeItem * GetRootItem()
const POINT & GetLocation()
typedef HDC(WINAPI *PFNWGLGETCURRENTREADDCARBPROC)(void)
void SetCtrlID(UINT nCtrlID)
void Expand(BOOL bExpand=TRUE)
void RefreshItems(CPropTreeItem *pItem=NULL)
void SetNextVisible(CPropTreeItem *pVis)
void SetInfoText(LPCTSTR sInfo)
virtual void SetItemValue(LPARAM lParam)
CPropTreeItem * m_pParent
void Activate(int activateType, CPoint point)
CPropTreeItem * GetParent()
void SetPropOwner(CPropTree *pProp)
virtual void OnActivate(int activateType, CPoint point)
BOOL HitExpand(const POINT &pt)