VOID CCommentView::OnConnect(){
m_commentListWindow.SetRedraw(FALSE);
+ m_commentListWindow.ResetViewSellHeight();
-#ifdef USE_RICHEDIT
chatChildCtrlsList.AllHide();
-#endif
+
commentlist.OnConnect();
SCROLLINFO vScrollInfo = {0};
////////////////////////////////////////////////////////////////////
CCommentListWindow::CCommentListWindow(CCommentView &in_self):
- self(in_self)
+ self(in_self),
+ viewSellHeight(0)
{}
CCommentListWindow::~CCommentListWindow(){
listRect.top = listRect.bottom;
}
-
+ viewSellHeight = listRect.bottom;
if(selectFlag == TRUE){
return;
}
+ VOID CCommentListWindow::ResetViewSellHeight(){
+
+ viewSellHeight = 0;
+
+ return;
+ }
VOID CCommentListWindow::ShowCurSel(){
CCommentList::iterator chatData = self.commentlist.GetShortCut();
CCommentList::iterator end = self.commentlist.end();
-
+
+
for(; chatData != end ;(++chatData)){
CalcItemHeight(*chatData);
heightSum += chatData->viewData.height;
- if(point.x > (INT_PTR)self.GetColumnHolSizeSum()) return;
- auto end = self.commentlist.end();
- auto lineIte = CalcClickLine(point.y);
- if( lineIte == end)return;
+ if(!(point.x > (INT_PTR)self.GetColumnHolSizeSum() || self.commentlist.empty() == TRUE)){
+ auto end = self.commentlist.end();
+ auto lineIte = CalcClickLine(point.y);
+ if( lineIte == end)goto endlabel;
- COLORREF bkColor;
- if(lineIte->listenerData->originBkFlag == FALSE){
- CListenerColorCollector colorCollector;
- listenerList.BkColorCollect(colorCollector);
- UCHAR red;
- UCHAR green;
- UCHAR blue;
-
- srand((unsigned int)time(NULL));
- do{
-
- red = getrgb();
- green = getrgb();
- blue = getrgb();
- bkColor = PALETTERGB(red,green,blue);
-
- }while(colorCollector.Find(bkColor));
-
- lineIte->listenerData->originBkFlag = TRUE;
- lineIte->listenerData->SetBkColor(bkColor);
- } else {
+
+ COLORREF bkColor;
+ if(lineIte->listenerData->originBkFlag == FALSE){
+ CListenerColorCollector colorCollector;
+ listenerList.BkColorCollect(colorCollector);
+ UCHAR red;
+ UCHAR green;
+ UCHAR blue;
+
+ srand((unsigned int)time(NULL));
+ do{
+
+ red = getrgb();
+ green = getrgb();
+ blue = getrgb();
+ bkColor = PALETTERGB(red,green,blue);
+
+ }while(colorCollector.Find(bkColor));
+
+ lineIte->listenerData->originBkFlag = TRUE;
+ lineIte->listenerData->SetBkColor(bkColor);
+ } else {
- lineIte->listenerData->originBkFlag = FALSE;
+ lineIte->listenerData->originBkFlag = FALSE;
+ }
}
+endlabel:
this->Invalidate(TRUE);
return;
}
+ LRESULT CCommentListWindow::OnSetCursor(HWND wparam,UINT loLparam,UINT hiLparam){
+
+ POINT mousePoint = {0};
+ RECT noRect = {0};
+ RECT userRect = {0};
+ self.m_header.GetItemRect(CCommentView::NO,&noRect);
+ self.m_header.GetItemRect(CCommentView::USERNAME,&userRect);
+ GetCursorPos(&mousePoint);
+ ::ScreenToClient(*this,&mousePoint);
+ if(((mousePoint.x >= noRect.left && mousePoint.x <= noRect.right) || (mousePoint.x >= userRect.left && mousePoint.x <= userRect.right))&&
+ mousePoint.y <= static_cast<INT_PTR>(viewSellHeight) &&
+ static_cast<INT>(loLparam) == 1){
+
+ dumpln(TEXT("\8ew"));
+ ::SetCursor(::LoadCursorW(NULL,IDC_HAND));
+
+ } else {
+
+ DefWindowProc ();
+
+ }
+
+
+
+
+
+ return FALSE;
+ }
+
LRESULT CCommentListWindow::OnMouseWheel(UINT loWparam,SHORT hiWparam,CPoint &point){
//\83\81\83\93\83o
private:
CCommentView &self;
+ UINT_PTR viewSellHeight;
enum {
CALCEDIT_ID = 100
MSG_WM_PAINT(OnPaint)
MSG_WM_SIZE(OnSize)
MSG_WM_KEYDOWN(OnKeyDown)
+ MSG_WM_SETCURSOR(OnSetCursor)
MESSAGE_HANDLER_EX(UM_COMMENTVIEW_SETCTRL,OnSetCtrol)
NOTIFY_ID_HANDLER_EX(CChatChildCtrls::CHAT_DISPCTRL_ID,OnChatControlNortify)
NOTIFY_HANDLER_EX(CALCEDIT_ID,EN_REQUESTRESIZE,OnCalcSellSize)
///
VOID DrawItem(CDC &dc,const RECT &rc,CChatData &chatData);
-
+ ///
+ ///\95`\89æ\8d\82\82³\82ð\83\8a\83Z\83b\83g
+ ///
+ VOID ResetViewSellHeight();
///
///
VOID OnKeyDown(TCHAR vKey,UINT loLParam,UINT hiLParam);
+ ///
+ ///\83J\81[\83\\83\8b\95Ï\8dX\8f\88\97\9d
+ ///
+ LRESULT OnSetCursor(HWND wparam,UINT loLparam,UINT hiLparam);
///
///\83`\83\83\83b\83g\83R\83\93\83g\83\8d\81[\83\8b\92Ê\92m