From: unknown Date: Fri, 3 Feb 2012 06:33:29 +0000 (+0900) Subject: リンク処理記載 X-Git-Tag: v0.002~2^2~39 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1a93577623ae51dcadb73d882a67e7ce80591462;p=nlite%2Fnlite.git リンク処理記載 --- diff --git a/nlite.suo b/nlite.suo index b845d2c..4752f1f 100644 Binary files a/nlite.suo and b/nlite.suo differ diff --git a/nlite/nlite.h b/nlite/nlite.h index acc5541..0ca0989 100644 --- a/nlite/nlite.h +++ b/nlite/nlite.h @@ -16,7 +16,7 @@ namespace nlite{ //ƒAƒvƒŠƒP[ƒVƒ‡ƒ“ƒvƒƒpƒeƒB extern Property nliteProperty; - + const static UINT_PTR COMMENTVIEW_HEADERITEMSIZE = 5; enum MESSAGE{ UM_COMMENTVIEW_SETCTRL = WM_USER + 1, diff --git a/nlite/nlite_commentWrite.cpp b/nlite/nlite_commentWrite.cpp index 69c83c9..a3960ac 100644 --- a/nlite/nlite_commentWrite.cpp +++ b/nlite/nlite_commentWrite.cpp @@ -160,7 +160,7 @@ LRESULT CCommentWriteWindow::OnCreate(LPCREATESTRUCT lpReateStruct){ commentColorBox.SetCurSel(0); commentSizeBox.SetCurSel(0); commentPosBox.SetCurSel(0); - CFont font; + CFontHandle font; font = AtlGetDefaultGuiFont(); CPaintDC pdc(*this); SIZE thisSize; diff --git a/nlite/nlite_commentview.cpp b/nlite/nlite_commentview.cpp index 62f19cf..5aa57bb 100644 --- a/nlite/nlite_commentview.cpp +++ b/nlite/nlite_commentview.cpp @@ -76,7 +76,7 @@ namespace nlite{ VOID CChatChildCtrls::Hide(HDWP hdwp){ - chatDispCtrl.DeferWindowPos(hdwp,chatDispCtrl.m_hWnd,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_HIDEWINDOW); + chatDispCtrl.DeferWindowPos(hdwp,chatDispCtrl,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_HIDEWINDOW); } @@ -156,7 +156,7 @@ namespace nlite{ if(m_hMaster.commentlist.Size() > 0){ - dumpln(TEXT("showcntrls:start")); + RECT headerRect; RECT tmpRect; RECT listRect; @@ -314,6 +314,8 @@ namespace nlite{ VOID CCommentView::SetProperty(CommentViewProperty &setProperty){ viewproperty = setProperty; + m_commentListWindow.OnSetProperty(); + return; } @@ -358,7 +360,7 @@ namespace nlite{ AddHeader(&headersinfo); - m_header.SetOrderArray(ARRAY_LENGTH(viewproperty.headerOraderArray),viewproperty.headerOraderArray); + m_header.SetOrderArray(ARRAY_LENGTH(viewproperty.headerOrderArray),viewproperty.headerOrderArray); @@ -548,7 +550,7 @@ namespace nlite{ VOID CCommentView::OnDestroy(){ - m_header.GetOrderArray(ARRAY_LENGTH(viewproperty.headerOraderArray),viewproperty.headerOraderArray); + m_header.GetOrderArray(ARRAY_LENGTH(viewproperty.headerOrderArray),viewproperty.headerOrderArray); INT_PTR headerItemcount = m_header.GetItemCount(); RECT headerItemRect; for(INT_PTR itemindex = 0;itemindex < headerItemcount;itemindex++){ @@ -785,11 +787,38 @@ namespace nlite{ CCommentListWindow::CCommentListWindow(CCommentView &in_self): self(in_self), viewSellHeight(0) - {} + { + CFontHandle font = ::AtlGetDefaultGuiFont(); + LOGFONT logfont; + font.GetLogFont(&logfont); + logfont.lfUnderline = TRUE; + + linkFont.CreateFontIndirect(&logfont); + } CCommentListWindow::~CCommentListWindow(){ } + VOID CCommentListWindow::OnSetProperty(){ + + if(IsWindow() == TRUE)this->SetRedraw(FALSE); + + if(collLinePen.IsNull() == FALSE)collLinePen.DeleteObject(); + if(normalSellLinePen.IsNull() == FALSE)normalSellLinePen.DeleteObject(); + if(normalBkBrush.IsNull() == FALSE)normalBkBrush.DeleteObject(); + if(selectSellLinePen.IsNull() ==FALSE)selectSellLinePen.DeleteObject(); + if(selectBkBrush.IsNull() == FALSE)selectBkBrush.DeleteObject(); + + collLinePen.CreatePen(PS_SOLID,1,self.viewproperty.colLineColor); + normalSellLinePen.CreatePen(PS_SOLID,1,self.viewproperty.normalSellLineColor); + normalBkBrush.CreateSolidBrush(self.viewproperty.backColor); + selectSellLinePen.CreatePen(PS_SOLID,1,self.viewproperty.selectSellLineColor); + selectBkBrush.CreateSolidBrush(self.viewproperty.selectBackColor); + + + if(IsWindow() == TRUE)this->SetRedraw(TRUE); + } + VOID CCommentListWindow::OnPaint(HDC in_hdc){ @@ -830,31 +859,85 @@ namespace nlite{ listRect.right = self.GetColumnHolSizeSum(); CCommentList::iterator chatData = commentList.GetShortCut(); - - - - CBrush baseBkBrush; - baseBkBrush.CreateSolidBrush(self.viewproperty.backColor); - mdc.FillRect(&listRect,baseBkBrush); - baseBkBrush.DeleteObject(); + + + + mdc.FillRect(&listRect,this->normalBkBrush); + CCommentList::iterator endData = commentList.end(); listRect.bottom = 0; + RECT headerRects[COMMENTVIEW_HEADERITEMSIZE]; + RECT colLineRects[COMMENTVIEW_HEADERITEMSIZE]; + RECT selectHeaderRects[COMMENTVIEW_HEADERITEMSIZE]; + + self.m_header.GetItemRect(CCommentView::NO,&headerRects[CCommentView::NO]); + self.m_header.GetItemRect(CCommentView::USERNAME,&headerRects[CCommentView::USERNAME]); + self.m_header.GetItemRect(CCommentView::COMMENT,&headerRects[CCommentView::COMMENT]); + self.m_header.GetItemRect(CCommentView::TIME,&headerRects[CCommentView::TIME]); + self.m_header.GetItemRect(CCommentView::INFO,&headerRects[CCommentView::INFO]); + memcpy(colLineRects,headerRects,sizeof(headerRects)); + + + + + + headerRects[CCommentView::NO].left += SELL_SPACE_LENGTH; + headerRects[CCommentView::USERNAME].left += SELL_SPACE_LENGTH; + headerRects[CCommentView::COMMENT].left += SELL_SPACE_LENGTH; + headerRects[CCommentView::TIME].left += SELL_SPACE_LENGTH; + headerRects[CCommentView::INFO].left += SELL_SPACE_LENGTH; + + headerRects[CCommentView::NO].right -= SELL_SPACE_LENGTH; + headerRects[CCommentView::USERNAME].right -= SELL_SPACE_LENGTH; + headerRects[CCommentView::COMMENT].right -= SELL_SPACE_LENGTH; + headerRects[CCommentView::TIME].right -= SELL_SPACE_LENGTH; + headerRects[CCommentView::INFO].right -= SELL_SPACE_LENGTH; + + headerRects[CCommentView::NO].top = SELL_SPACE_LENGTH; + headerRects[CCommentView::USERNAME].top = SELL_SPACE_LENGTH; + headerRects[CCommentView::COMMENT].top = SELL_SPACE_LENGTH; + headerRects[CCommentView::TIME].top = SELL_SPACE_LENGTH; + headerRects[CCommentView::INFO].top = SELL_SPACE_LENGTH; + + headerRects[CCommentView::NO].bottom = SELL_SPACE_LENGTH; + headerRects[CCommentView::USERNAME].bottom = SELL_SPACE_LENGTH; + headerRects[CCommentView::COMMENT].bottom = SELL_SPACE_LENGTH; + headerRects[CCommentView::TIME].bottom = SELL_SPACE_LENGTH; + headerRects[CCommentView::INFO].bottom = SELL_SPACE_LENGTH; + + INT_PTR listRectTop = listRect.top; for(;chatData != endData && listRect.top < clientRect.bottom;++chatData){ CalcItemHeight(*chatData); // dumpln(TEXT("height:%d"),chatData->viewData.height); listRect.bottom += chatData->viewData.height; + headerRects[CCommentView::NO].top = listRect.top + SELL_SPACE_LENGTH; + headerRects[CCommentView::USERNAME].top = listRect.top + SELL_SPACE_LENGTH; + headerRects[CCommentView::COMMENT].top = listRect.top + SELL_SPACE_LENGTH; + headerRects[CCommentView::TIME].top = listRect.top + SELL_SPACE_LENGTH; + headerRects[CCommentView::INFO].top = listRect.top + SELL_SPACE_LENGTH; + + headerRects[CCommentView::NO].bottom = listRect.bottom - SELL_SPACE_LENGTH; + headerRects[CCommentView::USERNAME].bottom = listRect.bottom - SELL_SPACE_LENGTH; + headerRects[CCommentView::COMMENT].bottom = listRect.bottom - SELL_SPACE_LENGTH; + headerRects[CCommentView::TIME].bottom = listRect.bottom - SELL_SPACE_LENGTH; + headerRects[CCommentView::INFO].bottom = listRect.bottom - SELL_SPACE_LENGTH; + if(chatData->viewData.selectFlag == TRUE){ selectFlag = TRUE; selectData = chatData; selectRect = listRect; + memcpy(selectHeaderRects,headerRects,sizeof(headerRects)); } else { - this->DrawItem(mdc,listRect,*chatData); + + + + this->DrawItem(mdc,listRect,headerRects,*chatData); } @@ -862,12 +945,26 @@ namespace nlite{ } viewSellHeight = listRect.bottom; - + + if(selectFlag == TRUE){ - this->DrawItem(mdc,selectRect,*selectData); + this->DrawItem(mdc,selectRect,selectHeaderRects,*selectData); } + //€–ڂ̏cü‚ð•`‰æ + mdc.SelectPen(collLinePen); + mdc.MoveTo(colLineRects[CCommentView::NO].right,listRectTop); + mdc.LineTo(colLineRects[CCommentView::NO].right,listRect.bottom); + mdc.MoveTo(colLineRects[CCommentView::USERNAME].right,listRectTop); + mdc.LineTo(colLineRects[CCommentView::USERNAME].right,listRect.bottom); + mdc.MoveTo(colLineRects[CCommentView::COMMENT].right,listRectTop); + mdc.LineTo(colLineRects[CCommentView::COMMENT].right,listRect.bottom); + mdc.MoveTo(colLineRects[CCommentView::TIME].right,listRectTop); + mdc.LineTo(colLineRects[CCommentView::TIME].right,listRect.bottom); + mdc.MoveTo(colLineRects[CCommentView::INFO].right,listRectTop); + mdc.LineTo(colLineRects[CCommentView::INFO].right,listRect.bottom); + } windowRect.left = listRect.right; mdc.FillRect(&windowRect,(HBRUSH)::GetStockObject(GRAY_BRUSH)); @@ -954,14 +1051,14 @@ overclientrect: return rslt; } - VOID CCommentListWindow::DrawItem(CDC &dc,const RECT &rc,CChatData &chatData){ + VOID CCommentListWindow::DrawItem(CDC &dc,const RECT &rc,const RECT *headerRect,CChatData &chatData){ - RECT noViewRect; //ƒRƒ”Ô•\Ž¦—̈æ - RECT userNameViewRect; //ƒ†[ƒU–¼•\Ž¦—̈æ - RECT timeViewRect; //ŽžŠÔ•\Ž¦—̈æ - RECT chatViewRect; //ƒRƒƒ“ƒg•\Ž¦—̈æ - RECT infoViewRect; //ƒRƒƒ“ƒgî•ñ•\Ž¦—̈æ + RECT noViewRect = headerRect[CCommentView::NO]; //ƒRƒ”Ô•\Ž¦—̈æ + RECT userNameViewRect = headerRect[CCommentView::USERNAME]; //ƒ†[ƒU–¼•\Ž¦—̈æ + RECT chatViewRect = headerRect[CCommentView::COMMENT]; //ƒRƒƒ“ƒg•\Ž¦—̈æ + RECT timeViewRect = headerRect[CCommentView::TIME]; //ŽžŠÔ•\Ž¦—̈æ + RECT infoViewRect = headerRect[CCommentView::INFO]; //ƒRƒƒ“ƒgî•ñ•\Ž¦—̈æ // @@ -997,99 +1094,76 @@ overclientrect: COLORREF bkColor; //”wŒiF - COLORREF sellLineColor; //˜güF - CPen sellLinePen; //˜gü•`‰æ—pƒyƒ“ - CPen collLinePen; //€–ڏcü•`‰æ—pƒyƒ“ - CBrush bkBrush; //”wŒi•`‰æ—pƒuƒ‰ƒV - collLinePen.CreatePen(PS_SOLID,1,self.viewproperty.colLineColor); - - + CPen originSellLinePen; //˜gü•`‰æ—pƒyƒ“ + CBrush originBkBrush; //”wŒi•`‰æ—pƒuƒ‰ƒV + //‘I‘ðó‘Ô‚©ƒ`ƒFƒbƒN if (chatData.viewData.selectFlag == TRUE) { bkColor = self.viewproperty.selectBackColor; - sellLineColor = self.viewproperty.selectSellLineColor; + + dc.SelectBrush(this->selectBkBrush); + dc.SelectPen(this->selectSellLinePen); } else { - sellLineColor = chatData.viewData.sellLineColor == CChatData::ViewData::INIT_COLOR ? self.viewproperty.normalSellLineColor : chatData.viewData.sellLineColor; + if(chatData.viewData.sellLineColor == CChatData::ViewData::INIT_COLOR){ + dc.SelectPen(this->normalSellLinePen); - if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR){ - - bkColor = chatData.viewData.backColor; + } else { - }else if(chatData.listenerData->originBkFlag == TRUE){ + originSellLinePen.CreatePen(PS_SOLID,1,chatData.viewData.sellLineColor); + dc.SelectPen(originSellLinePen); + } - bkColor = chatData.listenerData->bkColor; + + if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR || chatData.listenerData->originBkFlag == TRUE){ + + if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR){ + bkColor = chatData.viewData.backColor; + originBkBrush.CreateSolidBrush(chatData.viewData.backColor); + + }else if(chatData.listenerData->originBkFlag == TRUE){ + bkColor = chatData.listenerData->bkColor; + originBkBrush.CreateSolidBrush(chatData.listenerData->bkColor); + + } + + dc.SelectBrush(originBkBrush); } else { bkColor = self.viewproperty.backColor; - + dc.SelectBrush(this->normalBkBrush); + dc.SelectBrush(this->normalBkBrush); } } //”wŒi‚Ƙgü‚ð•`‰æ - sellLinePen.CreatePen(PS_SOLID,1,sellLineColor); - bkBrush.CreateSolidBrush(bkColor); - dc.SelectPen(sellLinePen); - dc.SelectBrush(bkBrush); + + dc.Rectangle(rc.left,rc.top - 1,rc.right ,rc.bottom + 1); dc.SetBkColor(bkColor); - dc.SetTextColor(chatData.viewData.stringColor == CChatData::ViewData::INIT_COLOR ? chatData.viewData.stringColor :self.viewproperty.baseStringColor); + //•`‰æƒTƒCƒY‚ðŒvŽZ - self.m_header.GetItemRect(CCommentView::NO,&noViewRect); - self.m_header.GetItemRect(CCommentView::USERNAME,&userNameViewRect); - self.m_header.GetItemRect(CCommentView::COMMENT,&chatViewRect); - self.m_header.GetItemRect(CCommentView::TIME,&timeViewRect); - self.m_header.GetItemRect(CCommentView::INFO,&infoViewRect); - - noViewRect.left += SELL_SPACE_LENGTH; - userNameViewRect.left += SELL_SPACE_LENGTH; - timeViewRect.left += SELL_SPACE_LENGTH; - chatViewRect.left += SELL_SPACE_LENGTH; - infoViewRect.left += SELL_SPACE_LENGTH; - - noViewRect.right -= SELL_SPACE_LENGTH; - userNameViewRect.right -= SELL_SPACE_LENGTH; - timeViewRect.right -= SELL_SPACE_LENGTH; - chatViewRect.right -= SELL_SPACE_LENGTH; - infoViewRect.right -= SELL_SPACE_LENGTH; - - noViewRect.top = rc.top + SELL_SPACE_LENGTH; - userNameViewRect.top = rc.top + SELL_SPACE_LENGTH; - timeViewRect.top = rc.top + SELL_SPACE_LENGTH; - chatViewRect.top = rc.top + SELL_SPACE_LENGTH; - infoViewRect.top = rc.top + SELL_SPACE_LENGTH; - - noViewRect.bottom = rc.bottom - SELL_SPACE_LENGTH; - userNameViewRect.bottom = rc.bottom - SELL_SPACE_LENGTH; - timeViewRect.bottom = rc.bottom - SELL_SPACE_LENGTH; - chatViewRect.bottom = rc.bottom - SELL_SPACE_LENGTH; - infoViewRect.bottom = rc.bottom - SELL_SPACE_LENGTH; - - //€–ڂ̏cü‚ð•`‰æ - dc.SelectPen(collLinePen); - dc.MoveTo(noViewRect.right,rc.top); - dc.LineTo(noViewRect.right,rc.bottom); - dc.MoveTo(userNameViewRect.right,rc.top); - dc.LineTo(userNameViewRect.right,rc.bottom); - dc.MoveTo(chatViewRect.right,rc.top); - dc.LineTo(chatViewRect.right,rc.bottom); - dc.MoveTo(timeViewRect.right,rc.top); - dc.LineTo(timeViewRect.right,rc.bottom); - + + + + dc.SelectFont(linkFont); + dc.SetTextColor(self.viewproperty.linkStringColor); //ƒeƒLƒXƒg•`‰æ dc.DrawTextW(noString,_tcslen(noString),&noViewRect,DT_WORD_ELLIPSIS); dc.DrawTextW(chatData.listenerData->user_id,chatData.listenerData->user_id.Length(),&userNameViewRect,DT_WORD_ELLIPSIS); - dc.DrawTextW(chatData.chatBuf,chatData.chatBuf.Length(),&chatViewRect,DT_WORDBREAK | DT_EDITCONTROL); + + dc.SelectFont(::AtlGetDefaultGuiFont()); + dc.SetTextColor(chatData.viewData.stringColor == CChatData::ViewData::INIT_COLOR ? chatData.viewData.stringColor :self.viewproperty.baseStringColor); dc.DrawTextW(dateString,_tcslen(dateString),&timeViewRect,DT_WORD_ELLIPSIS); return; @@ -1184,6 +1258,50 @@ end: } + BOOL CCommentListWindow::IsOnNoOrUserName(UINT_PTR index,const POINT &point){ + + POINT mousePoint = {0}; + RECT rc = {0}; + + self.m_header.GetItemRect(index,&rc); + BOOL rslt = FALSE; + + + if((mousePoint.x >= rc.left && mousePoint.x <= rc.right) && (point.y < static_cast(viewSellHeight))){ + + INT_PTR heightsum = 0; + auto clickData = self.commentlist.GetShortCut(); + auto endData = self.commentlist.end(); + for(;clickData != endData;++clickData){ + + heightsum += clickData->viewData.height; + + if(heightsum > point.y){ + + CDC cdc = this->GetDC(); + + rc.top = heightsum -= clickData->viewData.height; + SIZE stringSize; + //rc.bottom = rc.bottom; + cdc.SelectFont(linkFont); + ::GetTextExtentPoint32(cdc,clickData->chatBuf,clickData->chatBuf.Length(),&stringSize); + //cdc.DrawTextW(clickData->chatBuf,clickData->chatBuf.Length(),&rc,DT_CALCRECT | DT_WORD_ELLIPSIS); + rc.bottom += stringSize.cy; + rc.right += stringSize.cx; + dumpln(TEXT("rc.right :%d"),rc.right); + rslt = point.y >= rc.top && point.y <= rc.bottom && point.x >= rc.left && point.x <= rc.right; + + break; + + } + } + + } + + return rslt; + + } + VOID CCommentListWindow::OnLButtonDown(UINT wParam, _WTYPES_NS::CPoint &point){ @@ -1306,17 +1424,12 @@ end: 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(viewSellHeight) && - static_cast(loLparam) == 1){ + + if(static_cast(loLparam) == 1 &&( IsOnNoOrUserName(CCommentView::NO,mousePoint) || IsOnNoOrUserName(CCommentView::USERNAME,mousePoint))){ - dumpln(TEXT("Žw")); ::SetCursor(::LoadCursorW(NULL,IDC_HAND)); } else { @@ -1363,9 +1476,25 @@ end: _WTYPES_NS::CPoint point(windowrect.left + LOWORD(pmf->lParam),windowrect.top + HIWORD(pmf->lParam)); ::ScreenToClient(*this,&point); - if(pmf->msg == WM_LBUTTONDOWN)OnLButtonDown(pmf->wParam,point); - else if( pmf->msg== WM_LBUTTONDBLCLK)this->OnLButtonDblClk(pmf->wParam,point); - else if( pmf->msg == WM_MOUSEWHEEL)OnMouseWheel(LOWORD(pmf->wParam),HIWORD(pmf->wParam),point); + switch(pmf->msg){ + + case WM_LBUTTONDOWN: + OnLButtonDown(pmf->wParam,point); + break; + + case WM_LBUTTONDBLCLK: + OnLButtonDblClk(pmf->wParam,point); + break; + + case WM_MOUSEWHEEL: + OnMouseWheel(LOWORD(pmf->wParam),HIWORD(pmf->wParam),point); + break; + + default: + + break; + } + } @@ -1389,7 +1518,6 @@ end: auto pReqResize = reinterpret_cast (lParam); ::SetWindowPos(pReqResize->nmhdr.hwndFrom,NULL,0,0,pReqResize->rc.right - pReqResize->rc.left,pReqResize->rc.bottom - pReqResize->rc.top,SWP_NOZORDER | SWP_NOMOVE | SWP_HIDEWINDOW); - //calcRc = pReqResize->rc; return 0; } diff --git a/nlite/nlite_commentview.h b/nlite/nlite_commentview.h index 4540bbf..8d15389 100644 --- a/nlite/nlite_commentview.h +++ b/nlite/nlite_commentview.h @@ -5,6 +5,7 @@ namespace nlite{ class CCommentView; class CCommentListWindow; class CChatChildCtrlsList; + class CChatChildCtrls; //’萔—p‚Ì–¼‘O‹óŠÔ namespace commentViewConstant{ @@ -29,6 +30,8 @@ namespace nlite{ } class CChatReadEdit :public CWindowImpl{ + friend CCommentListWindow; + friend CChatChildCtrls; BEGIN_MSG_MAP(CChatReadEdit) @@ -49,7 +52,7 @@ namespace nlite{ CCommentView &m_master; - public: + private: enum { NO_DIOSCTRL_ID = 10000000, @@ -97,7 +100,7 @@ namespace nlite{ RECT rcBuf; - public: + private: typedef InternalList::reference reference; typedef InternalList::iterator iterator; @@ -133,12 +136,20 @@ namespace nlite{ class CCommentListWindow:public CWindowImpl{ friend CCommentView; + friend CChatChildCtrls; + friend CChatChildCtrlsList; //ƒƒ“ƒo private: CCommentView &self; UINT_PTR viewSellHeight; + CPen collLinePen; //€–ڏcü•`‰æ—pƒyƒ“ + CPen normalSellLinePen; //˜gü•`‰æ—pƒyƒ“ + CBrush normalBkBrush; //”wŒi•`‰æ—pƒuƒ‰ƒV + CPen selectSellLinePen; //˜gü•`‰æ—pƒyƒ“ + CBrush selectBkBrush; //”wŒi•`‰æ—pƒuƒ‰ƒV + CFont linkFont; //ƒŠƒ“ƒN•¶Žš—ñ—p‚̃tƒHƒ“ƒg enum { CALCEDIT_ID = 100 @@ -170,7 +181,7 @@ namespace nlite{ - public: + private: /// ///ƒRƒ“ƒXƒgƒ‰ƒNƒ^ @@ -184,6 +195,11 @@ namespace nlite{ /// + ///ƒvƒƒpƒeƒBÝ’莞‚̏ˆ— + /// + VOID OnSetProperty(); + + /// ///ƒXƒNƒ[ƒ‹ƒy[ƒWŒvŽZ /// UINT_PTR CalcScrollPage(UINT_PTR nMax); @@ -207,7 +223,7 @@ namespace nlite{ /// ///ƒAƒCƒeƒ€•`‰æ /// - VOID DrawItem(CDC &dc,const RECT &rc,CChatData &chatData); + VOID DrawItem(CDC &dc,const RECT &rc,const RECT *headerRect,CChatData &chatData); /// ///•`‰æ‚‚³‚ðƒŠƒZƒbƒg @@ -220,6 +236,11 @@ namespace nlite{ /// CCommentList::iterator CalcClickLine(INT_PTR height); + /// + ///ƒ†[ƒU–¼‚©ƒRƒ”ԏォ‚Ì”»’è + /// + BOOL IsOnNoOrUserName(UINT_PTR index,const POINT &point); + //ƒƒbƒZ[ƒWƒnƒ“ƒhƒ‰ private: @@ -289,6 +310,7 @@ namespace nlite{ friend CChatChildCtrls; friend CCommentListWindow; //ƒtƒŒƒ“ƒhéŒ¾ friend CChatChildCtrlsList; + friend CChatChildCtrls; //ƒvƒ‰ƒCƒx[ƒgŒ^EƒNƒ‰ƒX’è‹` private: diff --git a/nlite/nlite_property.cpp b/nlite/nlite_property.cpp index 5a72767..bc7072f 100644 --- a/nlite/nlite_property.cpp +++ b/nlite/nlite_property.cpp @@ -55,9 +55,15 @@ namespace nlite{ selectBackColor(PALETTERGB(255,240,240)), selectSellLineColor(PALETTERGB(255,0,0)), normalSellLineColor( PALETTERGB(0,0,0)), - colLineColor(PALETTERGB(224,224,224)) + colLineColor(PALETTERGB(224,224,224)), + linkStringColor(PALETTERGB(30,140,255)) { + for(INT_PTR orderIndex = 0;orderIndex < ARRAY_LENGTH(headerOrderArray);orderIndex++){ + + new(&headerOrderArray[orderIndex]) INT_PTR(orderIndex); + + } memset(headerholSize,-1,sizeof(headerholSize)); } @@ -253,8 +259,8 @@ namespace nlite{ NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.baseStringColor); NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.commentFoldingFlag); NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.commentTimeType); - NLITE_XML_WRITE_FOR_INT(pWriter,cvp.headerOraderArray); - NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.IDLinkColor); + NLITE_XML_WRITE_FOR_INT(pWriter,cvp.headerOrderArray); + NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.linkStringColor); NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.selectBackColor); NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.selectSellLineColor); NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.colLineColor); @@ -425,9 +431,9 @@ namespace nlite{ NLITE_R_X_P_I(nliteProperty,cvp,baseStringColor); NLITE_R_X_P_I(nliteProperty,cvp,commentFoldingFlag); NLITE_R_X_P_I(nliteProperty,cvp,commentTimeType); - NLITE_R_X_P_I(nliteProperty,cvp,IDLinkColor); + NLITE_R_X_P_I(nliteProperty,cvp,linkStringColor); NLITE_RXP_AI(nliteProperty,cvp,headerholSize); - NLITE_RXP_AI(nliteProperty,cvp,headerOraderArray); + NLITE_RXP_AI(nliteProperty,cvp,headerOrderArray); NLITE_R_X_P_I(nliteProperty,cvp,selectBackColor); NLITE_R_X_P_I(nliteProperty,cvp,selectSellLineColor); NLITE_R_X_P_I(nliteProperty,cvp,normalSellLineColor); diff --git a/nlite/nlite_property.h b/nlite/nlite_property.h index eb1ca9f..43d65fd 100644 --- a/nlite/nlite_property.h +++ b/nlite/nlite_property.h @@ -18,10 +18,10 @@ namespace nlite{ -#define COMMENTVIEW_HEADERITEMSIZE 5 + public: INT_PTR headerholSize[COMMENTVIEW_HEADERITEMSIZE]; //ƒwƒbƒ_‰¡ƒTƒCƒY - INT_PTR headerOraderArray[COMMENTVIEW_HEADERITEMSIZE]; //ƒwƒbƒ_•À‚я‡”z—ñ + INT_PTR headerOrderArray[COMMENTVIEW_HEADERITEMSIZE]; //ƒwƒbƒ_•À‚я‡”z—ñ BOOL commentFoldingFlag; //ƒRƒƒ“ƒgÜ‚肽‚½‚݃tƒ‰ƒO UINT_PTR commentTimeType; //ƒRƒƒ“ƒgŽžŠÔ•\Ž¦ƒ^ƒCƒv COLORREF backColor; //Šî’ê‚Ì”wŒiF @@ -29,7 +29,7 @@ namespace nlite{ COLORREF selectSellLineColor; //‘I‘ðŽž‚Ì˜gü COLORREF normalSellLineColor; //’ʏ펞‚̘gü COLORREF baseStringColor; //Šî’ê‚Ì•¶ŽšF - COLORREF IDLinkColor; //Šî’ê‚̃nƒCƒp[ƒŠƒ“ƒN‚̐F + COLORREF linkStringColor; //Šî’ê‚̃nƒCƒp[ƒŠƒ“ƒN‚̐F COLORREF anonymousIDLinkColor; //“½–¼ID•\Ž¦F COLORREF colLineColor; //€–ڂ̏cü