129 BOOL
OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* _pResult)
131 if ( message == WM_NOTIFY )
133 LPNMHDR lpNmHdr =
reinterpret_cast<LPNMHDR
>(lParam);
134 if ( lpNmHdr->code == NM_CUSTOMDRAW )
136 LPNMLVCUSTOMDRAW lpLvCd =
reinterpret_cast<LPNMLVCUSTOMDRAW
>(lParam);
137 *_pResult = m_OnCustomDraw(lpLvCd);
147 LRESULT m_OnItemPaintSub(LPNMLVCUSTOMDRAW P,
int subItemNo)
151 pa.itemNo = P->nmcd.dwItemSpec;
152 pa.subItemNo = subItemNo;
153 pa.state = P->nmcd.uItemState;
154 pa.textColor = P->clrText;
155 pa.backColor = P->clrTextBk;
156 pa.rect = P->nmcd.rc;
159 P->clrText = pa.textColor;
160 P->clrTextBk = pa.backColor;
165 LRESULT m_OnCustomDraw(LPNMLVCUSTOMDRAW P)
167 switch ( P->nmcd.dwDrawStage )
171 return CDRF_NOTIFYITEMDRAW | CDRF_NOTIFYPOSTPAINT;
174 return CDRF_DODEFAULT;
175 case CDDS_ITEMPOSTPAINT:
179 pa.itemNo = P->nmcd.dwItemSpec;
181 pa.state = P->nmcd.uItemState;
182 pa.textColor = P->clrText;
183 pa.backColor = P->clrTextBk;
184 pa.rect = P->nmcd.rc;
189 case CDDS_ITEMPREPAINT:
192 return m_OnItemPaintSub(P, 0) | CDRF_NOTIFYPOSTPAINT;
194 return CDRF_NOTIFYSUBITEMDRAW | CDRF_NOTIFYPOSTPAINT;
195 case CDDS_ITEMPREPAINT | CDDS_SUBITEM:
196 return m_OnItemPaintSub(P, P->iSubItem);
198 return CDRF_DODEFAULT;
virtual void OnItemPainted(const TDrawParam *pParam)=0
[通知] アイテム描画終わり.
virtual bool HasSubItem(void) const =0
[確認] サブアイテム概念の有無
virtual void OnEndItemPaint(HDC dc)=0
[通知] 描画終了.
virtual void OnCalcItemRect(TDrawParam &_pa, bool isSub)=0
[確認] アイテムRECT計算
BOOL OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT *_pResult)
[通知] for notifications from parent
CAbstractCustomDraw(void)
コンストラクタ
virtual LRESULT OnItemPainting(TDrawParam *pParam)=0
[通知] アイテム描画.
virtual void OnBeginItemPaint(HDC dc)=0
[通知] 描画開始.
COLORREF textColor
テキストカラー
DWORD subItemNo
サブアイテムナンバー