this->GetScrollInfo(SB_HORZ,&hScrollInfo);
-
HDWP hDwp = BeginDeferWindowPos(2);
}
}
-
+
return;
}
CCommentListWindow::CCommentListWindow(CCommentView &in_self):
self(in_self)
-{}
+ {}
CCommentListWindow::~CCommentListWindow(){
-
-
}
-VOID CCommentListWindow::OnPaint(HDC hdc){
+VOID CCommentListWindow::OnPaint(HDC in_hdc){
this->GetClientRect(&clientRect);
+
this->GetWindowRect(&windowRect);
windowRect.right -= windowRect.left;
windowRect.bottom -= windowRect.top;
windowRect.top = 0;
RECT listRect = windowRect;
listRect.right = self.GetColumnHolSizeSum();
-
- m_memoryDC.FillRect(&clientRect,(HBRUSH)::GetStockObject(GRAY_BRUSH));
- CCommentList &commentList = self.commentlist;
+ HDC hdc = this->GetDC();
+ {
+ CMemoryDC mdc(hdc,listRect);
+ mdc.SelectFont(AtlGetDefaultGuiFont());
+ mdc.FillRect(&clientRect,(HBRUSH)::GetStockObject(GRAY_BRUSH));
+
+ CCommentList &commentList = self.commentlist;
- if(commentList.Size() > (UINT_PTR)self.viewStartHeight){
+ if(commentList.Size() > (UINT_PTR)self.viewStartHeight){
-
- CCommentList::iterator chatData = commentList.begin();
- std::advance(chatData,self.viewStartHeight);
+ clock_t start,sum = 0;;
+ CCommentList::iterator chatData = commentList.begin();
+ std::advance(chatData,self.viewStartHeight);
- CBrush baseBkBrush;
- baseBkBrush.CreateSolidBrush(self.viewproperty.backColor);
- m_memoryDC.FillRect(&listRect,baseBkBrush);
- baseBkBrush.DeleteObject();
- CCommentList::iterator endData = commentList.end();
- listRect.bottom = 0;
- for(;chatData != endData && listRect.top < clientRect.bottom;++chatData){
- listRect.bottom += chatData->height;
+ CBrush baseBkBrush;
+ baseBkBrush.CreateSolidBrush(self.viewproperty.backColor);
+ mdc.FillRect(&listRect,baseBkBrush);
+ baseBkBrush.DeleteObject();
+ CCommentList::iterator endData = commentList.end();
+ listRect.bottom = 0;
+ for(;chatData != endData && listRect.top < clientRect.bottom;++chatData){
+ listRect.bottom += chatData->height;
+ start = clock();
+ this->DrawItem(mdc,listRect,*chatData);
+ sum += clock() - start;
- this->DrawItem(m_memoryDC,listRect,*chatData);
-
-
- listRect.top = listRect.bottom;
- }
+ listRect.top = listRect.bottom;
+ }
+
+
+ dumpln(TEXT("viewtime:%d"),sum);
- }
+ }
- PAINTSTRUCT ps;
- HDC selfDC = this->BeginPaint(&ps);
- BOOL rslt = ::BitBlt(selfDC,0,0,windowRect.right,windowRect.bottom,m_memoryDC,0,0,SRCCOPY);
- this->EndPaint(&ps);
+ }
+ this->ReleaseDC(hdc);
+
return;
VOID CCommentListWindow::OnSize(UINT wParam, _WTYPES_NS::CSize &windowSize){
+
SCROLLINFO vScrollInfo = {0};
vScrollInfo.fMask = SIF_ALL;
VOID CCommentListWindow::DrawItem(CDC &dc,RECT &rc,CChatData &chatData){
+
RECT noViewRect;
RECT userNameViewRect;
RECT timeViewRect;
_tcsftime(dateString,ARRAY_LENGTH(dateString),ct.tm_hour != 0 ? TEXT("%H:%M:%S") : TEXT("%M:%S"),&ct);
COLORREF bkColor;
-
+ COLORREF outLineColor;
+
CPen outLinePen;
CPen colLinePen;
+ CBrush bkBrush;
colLinePen.CreatePen(PS_SOLID,1,ColorList::colLine);
if (chatData.selectFlag == TRUE)
{
bkColor = ColorList::selectBack;
- outLinePen.CreatePen(PS_SOLID,1,ColorList::outLineSelect);
+ outLineColor = ColorList::outLineSelect;
+
+
}
else
{
- outLinePen.CreatePen(PS_SOLID,1,ColorList::outLineNomal);
+ outLineColor = ColorList::outLineNomal;
if(chatData.listenerData->originBkFlag == TRUE){
bkColor = chatData.listenerData->bkColor;
-
+
+
} else {
bkColor = self.viewproperty.backColor;
}
}
+ outLinePen.CreatePen(PS_SOLID,1,outLineColor);
+ bkBrush.CreateSolidBrush(bkColor);
+ dc.FillRect(&rc,bkBrush);
dc.SelectPen(outLinePen);
+
dc.SetBkColor(bkColor);
//\83e\83L\83X\83g\82Ì\83J\83\89\81[\82ð\90Ý\92è
dc.SetTextColor(self.viewproperty.baseStringColor);
- CBrush bkBrush;
- bkBrush.CreateSolidBrush(bkColor);
- dc.FillRect(&rc,bkBrush);
- bkBrush.DeleteObject();
+
+
+
+
//\95`\89æ\83T\83C\83Y\82ð\8cv\8eZ
drowSize.right -= 2;
drowSize.bottom = 0;
-
- m_memoryDC.DrawTextW(chatData.chatBuf,chatData.chatBuf.length(),&drowSize, DT_CALCRECT | DT_WORDBREAK);
-
+ CDCHandle cdc = this->GetDC();
+ cdc.SelectFont(AtlGetDefaultGuiFont());
+ ::DrawTextW(cdc,chatData.chatBuf,chatData.chatBuf.length(),&drowSize, DT_CALCRECT | DT_WORDBREAK);
+ this->ReleaseDC(cdc);
drowSize.top -= 2;
drowSize.bottom += 2;
LRESULT CCommentListWindow::OnCreate(LPCREATESTRUCT lpCreateStruct){
-
- HDC hdc = this->GetDC();
- m_memoryDC.CreateCompatibleDC(hdc);
-
- m_bitmap.CreateCompatibleBitmap(hdc,::GetSystemMetrics(SM_CXFULLSCREEN),::GetSystemMetrics(SM_CYFULLSCREEN));
- m_memoryDC.SelectBitmap(m_bitmap);
- m_memoryDC.SelectFont(AtlGetDefaultGuiFont());
- this->ReleaseDC(hdc);
-
return 0;
}
bkColor = RGB(red,green,blue);
}while(colorCollector.Find(bkColor));
-
+
chatData.listenerData->originBkFlag = TRUE;
-
+ chatData.listenerData->SetBkColor(bkColor);
} else {
- bkColor = self.viewproperty.backColor;
+
chatData.listenerData->originBkFlag = FALSE;
}
- chatData.listenerData->SetBkColor(bkColor);
+
if(TryEnterCriticalSection(&this->m_sec) == TRUE){
this->Invalidate(TRUE);