VOID CCommentView::OnConnect(){
commentlist.OnConnect();
- m_commentListWindow.SetRedraw(FALSE);
- m_commentListWindow.ResetContent();
+// m_commentListWindow.SetRedraw(FALSE);
+
}
auto &chat = *(CChatData*)lpMersureItemStruct->itemData;
- CDC cdc = m_commentListWindow.GetDC();
+ CDC cdc = this->GetDC();
RECT drowSize;
m_header.GetItemRect(COMMENT,&drowSize);
if(lParam->hwndFrom == m_header.m_hWnd){
- INT_PTR curSel = m_commentListWindow.GetCurSel();
+ //INT_PTR curSel = commentlist.GetCurSel();
SCROLLINFO scrollInfo = {0};
scrollInfo.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
- m_commentListWindow.GetScrollInfo(SB_VERT,&scrollInfo);
+ this->GetScrollInfo(SB_VERT,&scrollInfo);
scrollInfo.nPos++;
BOOL scrollFlag = scrollInfo.nPos + (int)scrollInfo.nPage >= scrollInfo.nMax;
UINT_PTR commentCount = commentlist.Size();
- m_commentListWindow.SetRedraw(FALSE);
- m_commentListWindow.ResetContent();
+// m_commentListWindow.SetRedraw(FALSE);
+ //m_commentListWindow.ResetContent();
+ /*
for(UINT_PTR index =0;index < commentCount;index++){
m_commentListWindow.AddString((LPCTSTR)&commentlist.GetChatAt(index));
}
-
+ */
- m_commentListWindow.SetCurSel(curSel);
+ //m_commentListWindow.SetCurSel(curSel);
- m_commentListWindow.SetRedraw(TRUE);
- m_commentListWindow.Invalidate();
+// m_commentListWindow.SetRedraw(TRUE);
+// m_commentListWindow.Invalidate();
if(scrollFlag == TRUE){
- m_commentListWindow.SendMessageW(WM_VSCROLL,SB_BOTTOM,0);
+// m_commentListWindow.SendMessageW(WM_VSCROLL,SB_BOTTOM,0);
}
INT_PTR itemCount = m_header.GetItemCount();
Lock();
- m_commentListWindow.SetRedraw(FALSE);
+// m_commentListWindow.SetRedraw(FALSE);
commentlist.OnChatReceve(chat,count);
- m_commentListWindow.AddString((LPCTSTR)&commentlist.back());
+ //m_commentListWindow.AddString((LPCTSTR)&commentlist.back());
SCROLLINFO scrollInfo = {0};
scrollInfo.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
- m_commentListWindow.GetScrollInfo(SB_VERT,&scrollInfo);
+// m_commentListWindow.GetScrollInfo(SB_VERT,&scrollInfo);
scrollInfo.nPos++;
if(scrollInfo.nPos + (int)scrollInfo.nPage >= scrollInfo.nMax == TRUE){
- m_commentListWindow.SendMessageW(WM_VSCROLL,MAKEWORD(SB_BOTTOM,0),0);
+// m_commentListWindow.SendMessageW(WM_VSCROLL,MAKEWORD(SB_BOTTOM,0),0);
}
Unlock();
}
VOID CCommentView::OnChatReceveSettle(UINT_PTR commentCount,UINT_PTR commentCountSum){
- m_commentListWindow.SetRedraw(TRUE);
+// m_commentListWindow.SetRedraw(TRUE);
return;
LRESULT CCommentView::OnListBoxDoubleClick(UINT uNotifyCode, int nID, CWindow wndCtl){
-
+ /*
if(wndCtl.m_hWnd == m_commentListWindow.m_hWnd){
- INT_PTR cursel = m_commentListWindow.GetCurSel();
+ //INT_PTR cursel = m_commentListWindow.GetCurSel();
+ INT_PTR cursel = 0;
if(cursel == LB_ERR)return 0;
auto chatData = commentlist.GetChatAt(cursel);
m_commentListWindow.Invalidate(TRUE);
}
-
+ */
return 0;
}
VOID CCommentView::OnDrawItem(UINT wParam,LPDRAWITEMSTRUCT lpDrawItemStruct){
- if((lpDrawItemStruct->hwndItem == m_commentListWindow.m_hWnd) && ((UINT)m_commentListWindow.GetCount() > lpDrawItemStruct->itemID)){
+ //if((lpDrawItemStruct->hwndItem == m_commentListWindow.m_hWnd)/* &&/* ((UINT)m_commentListWindow.GetCount() > lpDrawItemStruct->itemID)*/){
RECT noViewRect;
RECT userNameViewRect;
::DrawText(lpDrawItemStruct->hDC,dateString,_tcslen(dateString),&timeViewRect,DT_WORD_ELLIPSIS);
- }
+ //}
return;
}
-VOID CCommentView::OnPaint(HDC wParam){
- PAINTSTRUCT paintStruct;
- HDC paintDC = this->BeginPaint(&paintStruct);
- ::FillRect(paintDC,&paintStruct.rcPaint,(HBRUSH)GetStockObject(LTGRAY_BRUSH));
- this->EndPaint(&paintStruct);
-
-
- return;
-}
-
VOID CCommentView::OnSizing(UINT wParam,LPRECT lParam){
INT_PTR movePos = -1 * hScrollInfo.nPos;
m_header.DeferWindowPos(hDwp,m_header.m_hWnd,movePos,0,0,0,SWP_NOSIZE | SWP_NOZORDER);
- m_commentListWindow.DeferWindowPos(hDwp,m_commentListWindow.m_hWnd,movePos,commentViewConstant::HEADER_HAIGHT,hScrollInfo.nMax,client.cy - commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER);
+ m_commentListWindow.DeferWindowPos(hDwp,m_commentListWindow.m_hWnd,movePos,commentViewConstant::HEADER_HAIGHT,::GetSystemMetrics(SM_CXFULLSCREEN),client.cy - commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER);
EndDeferWindowPos(hDwp);
}
commentlist.OnDestroy();
m_header.DestroyWindow();
- m_commentListWindow.DestroyWindow();
+// m_commentListWindow.DestroyWindow();
return;
}
if(lParam->hwndFrom == m_header.m_hWnd){
- m_commentListWindow.Invalidate();
+// m_commentListWindow.Invalidate();
}
if(dy != 0){
hScrollInfo.nPos += dy;
- RECT headerPosRect;
- RECT listBoxPosRect;
- m_header.GetWindowRect(&headerPosRect);
- m_commentListWindow.GetWindowRect(&listBoxPosRect);
+ //RECT headerPosRect;
+ //RECT listBoxPosRect;
+ //m_header.GetWindowRect(&headerPosRect);
+ //m_commentListWindow.GetWindowRect(&listBoxPosRect);
INT_PTR moveRange = -(hScrollInfo.nPos);
+
+ /*
headerPosRect.bottom -= headerPosRect.top;
headerPosRect.top = 0;
headerPosRect.right += moveRange - headerPosRect.left;
m_header.MoveWindow(&headerPosRect);
m_commentListWindow.MoveWindow(&listBoxPosRect);
-
+ */
HDWP hDwp = BeginDeferWindowPos(2);
LRESULT CCommentView::OnCreate(LPCREATESTRUCT lpcs){
m_header.Create(m_hWnd,0,WC_HEADER,WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | HDS_BUTTONS | HDS_HOTTRACK |HDS_DRAGDROP | HDS_FULLDRAG ,0,commentViewConstant::HEADER_ID);
- m_commentListWindow.Create(m_hWnd,0,WC_LISTBOX,WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_CLIPCHILDREN | LBS_OWNERDRAWVARIABLE | LBS_NOTIFY | LBS_NOREDRAW , 0,commentViewConstant::LISTBOX_ID);
+ m_commentListWindow.Create(m_hWnd,0,WC_LISTBOX,WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN , 0,commentViewConstant::LISTBOX_ID);
m_commentListWindow.SetFont(AtlGetDefaultGuiFont());
+
+
/*
m_subListBox.SubclassWindow(m_commentListWindow);
m_subListBox.CreateMemoryDC();
HDWP hWindowPosInfo = BeginDeferWindowPos(2);
RECT bkWindowRect;
this->GetClientRect(&bkWindowRect);
- m_header.DeferWindowPos(hWindowPosInfo,m_header.m_hWnd,0,0,hScrollInfo.nMax,commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER | SWP_NOMOVE);
- m_commentListWindow.DeferWindowPos(hWindowPosInfo,m_header.m_hWnd,0,0,hScrollInfo.nMax,bkWindowRect.bottom - commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER | SWP_NOMOVE);
+ m_header.DeferWindowPos(hWindowPosInfo,m_header.m_hWnd,0,0,::GetSystemMetrics(SM_CXFULLSCREEN),commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER | SWP_NOMOVE);
+ m_commentListWindow.DeferWindowPos(hWindowPosInfo,m_header.m_hWnd,0,0,::GetSystemMetrics(SM_CXFULLSCREEN),bkWindowRect.bottom - commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER | SWP_NOMOVE);
EndDeferWindowPos(hWindowPosInfo);
bkWindowRect.left = hScrollInfo.nMax;
//\83R\83\81\83\93\83g\83r\83\85\81[\83N\83\89\83X\93à\95\94\83\8a\83X\83g\83N\83\89\83X
////////////////////////////////////////////////////////////////////
-CCommentListWindow::CCommentListWindow(CCommentView &in_self):self(in_self){}
\ No newline at end of file
+CCommentListWindow::CCommentListWindow(CCommentView &in_self):self(in_self){}
+
+
+
+VOID CCommentListWindow::OnPaint(HDC hdc){
+
+
+ SIZE bitmapSize;
+ m_bitmap.GetSize(bitmapSize);
+ RECT bitmapRect = {0};
+ RECT windowRect;
+ bitmapRect.right = bitmapSize.cx;
+ bitmapRect.bottom = bitmapSize.cy;
+ this->GetWindowRect(&windowRect);
+ m_memoryDC.FillRect(&bitmapRect,self.viewproperty.backColor);
+
+ PAINTSTRUCT ps;
+ HDC selfDC = this->BeginPaint(&ps);
+ ::BitBlt(selfDC,0,0,windowRect.right - windowRect.left,windowRect.bottom - windowRect.top,m_memoryDC,0,0,SRCCOPY);
+ this->EndPaint(&ps);
+
+ return;
+}
+
+
+
+LRESULT CCommentListWindow::OnCreate(LPCREATESTRUCT lpCreateStruct){
+ LRESULT lRet = this->DefWindowProc();
+
+ HDC hdc = this->GetDC();
+ m_memoryDC.CreateCompatibleDC(hdc);
+
+ m_bitmap.CreateCompatibleBitmap(hdc,::GetSystemMetrics(SM_CXFULLSCREEN),::GetSystemMetrics(SM_CYFULLSCREEN));
+ m_memoryDC.SelectBitmap(m_bitmap);
+ this->ReleaseDC(hdc);
+
+ return lRet;
+}
+
+VOID CCommentListWindow::OnLButtonDown(UINT wParam, _WTYPES_NS::CPoint &point){
+
+ return;
+}
+
+
+VOID CCommentListWindow::OnLButtonDbClk(UINT wParam, _WTYPES_NS::CPoint &point){
+
+ return;
+}
+
+LRESULT CCommentListWindow::OnEraseBkGnd(HDC lparam){
+
+ return TRUE;
+}
\ No newline at end of file
//\83R\83\81\83\93\83g\95\\8e¦\97p\83E\83B\83\93\83h\83E
class CCommentListWindow:public CWindowImpl<CCommentListWindow>{
-
+ //\83\81\83\93\83o
private:
CCommentView &self;
-
+ CBitmap m_bitmap;
+ CDC m_memoryDC;
//\83\81\83b\83Z\81[\83W\83}\83b\83v
//
BEGIN_MSG_MAP(CCommentListWindow)
-
+ MSG_WM_LBUTTONDBLCLK(OnLButtonDbClk)
+ MSG_WM_LBUTTONDOWN(OnLButtonDown)
+ MSG_WM_CREATE(OnCreate)
+ MSG_WM_ERASEBKGND(OnEraseBkGnd)
+ MSG_WM_PAINT(OnPaint)
END_MSG_MAP()
///
///\83R\83\93\83X\83g\83\89\83N\83^
///
- CCommentListWindow(CCommentView &self);
+ CCommentListWindow(CCommentView &self_in);
+
+
+ ///
+ ///\95`\89æ\8f\88\97\9d
+ ///
+ VOID DoPaint(CDCHandle dc);
+
+ //\83v\83\89\83C\83x\81[\83g\8aÖ\90\94
+ private:
+
+
+ //\83\81\83b\83Z\81[\83W\83n\83\93\83h\83\89
+ private:
+
+ ///
+ ///\83E\83B\83\93\83h\83E\8dì\90¬\8e\9e\82Ì\8f\88\97\9d
+ ///
+ LRESULT OnCreate(LPCREATESTRUCT lpCreateStruct);
+
+ ///
+ ///\83}\83E\83X\83N\83\8a\83b\83N\8e\9e\82Ì\8f\88\97\9d
+ ///
+ VOID OnLButtonDown(UINT wParam, _WTYPES_NS::CPoint &point);
+ ///
+ ///\95`\89æ\8f\88\97\9d
+ ///
+ VOID OnPaint(HDC hdc);
+
+ ///
+ ///\83}\83E\83X\83_\83u\83\8b\83N\83\8a\83b\83N\8e\9e\82Ì\8f\88\97\9d
+ ///
+ VOID OnLButtonDbClk(UINT wParam, _WTYPES_NS::CPoint &point);
+ ///
+ ///\94w\8ci\93h\82è\82Â\82Ô\82µ
+ ///
+ LRESULT OnEraseBkGnd(HDC lparam);
};
class CCommentView:public CWindowImpl<CCommentView>{
}HEADERSINFO,*LPHEADERSINFO;
- //\83R\83\81\83\93\83g\95\\8e¦\83E\83B\83\93\83h\83E\82Ì\83x\81[\83X\82Æ\82È\82é\83E\83B\83\93\83h\83E
- class CCommentListBaseWindow:public CWindowImpl<CCommentListBaseWindow>{
-
-
-
- public:
- //
- //\83E\83B\83\93\83h\83E\83N\83\89\83X\90é\8c¾
- //
- DECLARE_WND_CLASS_EX(commentViewConstant::NLITE_COMMENTLISTBASE,0,COLOR_BACKGROUND)
-
- BEGIN_MSG_MAP(CCommentListBaseWindow)
-
- MSG_WM_ERASEBKGND(OnEraseBkgnd)
-
- END_MSG_MAP()
-
- LRESULT OnEraseBkgnd(HDC wParam){
-
- return TRUE;
- }
-
- };
+
MSG_WM_MEASUREITEM(OnMeasureItem)
MSG_WM_SIZING(OnSizing)
MSG_WM_SIZE(OnSize)
- MSG_WM_PAINT(OnPaint)
MSG_WM_HSCROLL(OnHScroll)
MSG_WM_ERASEBKGND(OnEraseBkgnd)
COMMAND_CODE_HANDLER_EX(LBN_DBLCLK,OnListBoxDoubleClick)
//\83E\83B\83\93\83h\83E\83\81\83b\83Z\81[\83W\83n\83\93\83h\83\89
private:
-
- ///
- ///\94w\8ci\95`\89æ\8f\88\97\9d
- ///
- VOID OnPaint(HDC wParam);
///
///\83T\83C\83Y\95Ï\8dX\92\86\8f\88\97\9d