OSDN Git Service

リンク処理記載
authorunknown <qwerty2501@users.sourceforge.jp>
Fri, 3 Feb 2012 06:33:29 +0000 (15:33 +0900)
committerunknown <qwerty2501@users.sourceforge.jp>
Fri, 3 Feb 2012 06:33:29 +0000 (15:33 +0900)
nlite.suo
nlite/nlite.h
nlite/nlite_commentWrite.cpp
nlite/nlite_commentview.cpp
nlite/nlite_commentview.h
nlite/nlite_property.cpp
nlite/nlite_property.h

index b845d2c..4752f1f 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index acc5541..0ca0989 100644 (file)
@@ -16,7 +16,7 @@ namespace nlite{
        
        //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\83v\83\8d\83p\83e\83B
        extern Property nliteProperty;                                          
-
+       const static UINT_PTR COMMENTVIEW_HEADERITEMSIZE = 5;
        enum MESSAGE{
                UM_COMMENTVIEW_SETCTRL = WM_USER + 1,
 
index 69c83c9..a3960ac 100644 (file)
@@ -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;
index 62f19cf..5aa57bb 100644 (file)
@@ -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);
                                }
 
+                                       //\8d\80\96Ú\82Ì\8fc\90ü\82ð\95`\89æ
+                               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;                                                                                //\83R\83\81\94Ô\95\\8e¦\97Ì\88æ
-               RECT userNameViewRect;                                                                  //\83\86\81[\83U\96¼\95\\8e¦\97Ì\88æ
-               RECT timeViewRect;                                                                              //\8e\9e\8aÔ\95\\8e¦\97Ì\88æ
-               RECT chatViewRect;                                                                              //\83R\83\81\83\93\83g\95\\8e¦\97Ì\88æ
-               RECT infoViewRect;                                                                              //\83R\83\81\83\93\83g\8fî\95ñ\95\\8e¦\97Ì\88æ
+               RECT noViewRect = headerRect[CCommentView::NO];                                                                         //\83R\83\81\94Ô\95\\8e¦\97Ì\88æ
+               RECT userNameViewRect = headerRect[CCommentView::USERNAME];                                                     //\83\86\81[\83U\96¼\95\\8e¦\97Ì\88æ
+               RECT chatViewRect = headerRect[CCommentView::COMMENT];                                                          //\83R\83\81\83\93\83g\95\\8e¦\97Ì\88æ
+               RECT timeViewRect = headerRect[CCommentView::TIME];                                                                     //\8e\9e\8aÔ\95\\8e¦\97Ì\88æ  
+               RECT infoViewRect  = headerRect[CCommentView::INFO];                                                                    //\83R\83\81\83\93\83g\8fî\95ñ\95\\8e¦\97Ì\88æ
 
 
                //
@@ -997,99 +1094,76 @@ overclientrect:
 
 
                COLORREF bkColor;                                                                                                       //\94w\8ci\90F
-               COLORREF sellLineColor;                                                                                         //\98g\90ü\90F
-               CPen sellLinePen;                                                                                                       //\98g\90ü\95`\89æ\97p\83y\83\93
-               CPen collLinePen;                                                                                                       //\8d\80\96Ú\8fc\90ü\95`\89æ\97p\83y\83\93
-               CBrush bkBrush;                                                                                                         //\94w\8ci\95`\89æ\97p\83u\83\89\83V
-               collLinePen.CreatePen(PS_SOLID,1,self.viewproperty.colLineColor);
-
-
+               CPen originSellLinePen;                                                                                                 //\98g\90ü\95`\89æ\97p\83y\83\93
+               CBrush originBkBrush;                                                                                                           //\94w\8ci\95`\89æ\97p\83u\83\89\83V
+               
                //\91I\91ð\8fó\91Ô\82©\83`\83F\83b\83N
                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);
 
 
                        }
                }
                
                //\94w\8ci\82Æ\98g\90ü\82ð\95`\89æ
-               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);
+               
 
                //\95`\89æ\83T\83C\83Y\82ð\8cv\8eZ
 
-               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;
-
-               //\8d\80\96Ú\82Ì\8fc\90ü\82ð\95`\89æ
-               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);
                //\83e\83L\83X\83g\95`\89æ
                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<INT_PTR>(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<INT_PTR>(viewSellHeight) && 
-                       static_cast<INT>(loLparam) == 1){
+               
+               if(static_cast<INT>(loLparam) == 1 &&( IsOnNoOrUserName(CCommentView::NO,mousePoint) || IsOnNoOrUserName(CCommentView::USERNAME,mousePoint))){
                        
-                       dumpln(TEXT("\8ew"));
                        ::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 <REQRESIZE *>(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;
        }
 
index 4540bbf..8d15389 100644 (file)
@@ -5,6 +5,7 @@ namespace nlite{
        class CCommentView;
        class CCommentListWindow;
        class CChatChildCtrlsList;
+       class CChatChildCtrls;
 
        //\92è\90\94\97p\82Ì\96¼\91O\8bó\8aÔ
        namespace commentViewConstant{
@@ -29,6 +30,8 @@ namespace nlite{
        }
 
        class CChatReadEdit :public CWindowImpl<CChatReadEdit,CRichEditCtrl>{
+               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<CCommentListWindow>{
 
                friend CCommentView;
+               friend CChatChildCtrls;
+               friend CChatChildCtrlsList;
                
                
                //\83\81\83\93\83o
        private:
                CCommentView &self;
                UINT_PTR viewSellHeight;
+               CPen collLinePen;                                                                                                       //\8d\80\96Ú\8fc\90ü\95`\89æ\97p\83y\83\93
+               CPen normalSellLinePen;                                                                                                 //\98g\90ü\95`\89æ\97p\83y\83\93
+               CBrush normalBkBrush;                                                                                                           //\94w\8ci\95`\89æ\97p\83u\83\89\83V
+               CPen selectSellLinePen;                                                                                                 //\98g\90ü\95`\89æ\97p\83y\83\93
+               CBrush selectBkBrush;                                                                                                           //\94w\8ci\95`\89æ\97p\83u\83\89\83V
+               CFont linkFont;                                                                                                         //\83\8a\83\93\83N\95\8e\9a\97ñ\97p\82Ì\83t\83H\83\93\83g
                enum {
                        CALCEDIT_ID = 100
 
@@ -170,7 +181,7 @@ namespace nlite{
 
 
 
-       public:
+       private:
 
                ///
                ///\83R\83\93\83X\83g\83\89\83N\83^
@@ -184,6 +195,11 @@ namespace nlite{
 
 
                ///
+               ///\83v\83\8d\83p\83e\83B\90Ý\92è\8e\9e\82Ì\8f\88\97\9d
+               ///
+               VOID OnSetProperty();
+
+               ///
                ///\83X\83N\83\8d\81[\83\8b\83y\81[\83W\8cv\8eZ
                ///
                UINT_PTR CalcScrollPage(UINT_PTR nMax);
@@ -207,7 +223,7 @@ namespace nlite{
                ///
                ///\83A\83C\83e\83\80\95`\89æ
                ///
-               VOID DrawItem(CDC &dc,const RECT &rc,CChatData &chatData);
+               VOID DrawItem(CDC &dc,const RECT &rc,const RECT *headerRect,CChatData &chatData);
 
                ///
                ///\95`\89æ\8d\82\82³\82ð\83\8a\83Z\83b\83g
@@ -220,6 +236,11 @@ namespace nlite{
                ///
                CCommentList::iterator CalcClickLine(INT_PTR height);
 
+               ///
+               ///\83\86\81[\83U\96¼\82©\83R\83\81\94Ô\8fã\82©\82Ì\94»\92è
+               ///
+               BOOL IsOnNoOrUserName(UINT_PTR index,const POINT &point);
+
                //\83\81\83b\83Z\81[\83W\83n\83\93\83h\83\89
        private:
                
@@ -289,6 +310,7 @@ namespace nlite{
                friend CChatChildCtrls;
                friend CCommentListWindow;                                              //\83t\83\8c\83\93\83h\90é\8c¾
                friend CChatChildCtrlsList;
+               friend CChatChildCtrls;
                //\83v\83\89\83C\83x\81[\83g\8c^\81E\83N\83\89\83X\92è\8b`
        private:
 
index 5a72767..bc7072f 100644 (file)
@@ -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);
index eb1ca9f..43d65fd 100644 (file)
@@ -18,10 +18,10 @@ namespace nlite{
 
        
        
-#define COMMENTVIEW_HEADERITEMSIZE 5
+
        public:
                INT_PTR headerholSize[COMMENTVIEW_HEADERITEMSIZE];                      //\83w\83b\83_\89¡\83T\83C\83Y
-               INT_PTR headerOraderArray[COMMENTVIEW_HEADERITEMSIZE];          //\83w\83b\83_\95À\82Ñ\8f\87\94z\97ñ
+               INT_PTR headerOrderArray[COMMENTVIEW_HEADERITEMSIZE];           //\83w\83b\83_\95À\82Ñ\8f\87\94z\97ñ
                BOOL commentFoldingFlag;                                                                        //\83R\83\81\83\93\83g\90Ü\82è\82½\82½\82Ý\83t\83\89\83O
                UINT_PTR commentTimeType;                                                                       //\83R\83\81\83\93\83g\8e\9e\8aÔ\95\\8e¦\83^\83C\83v
                COLORREF backColor;                                                                                     //\8aî\92ê\82Ì\94w\8ci\90F
@@ -29,7 +29,7 @@ namespace nlite{
                COLORREF selectSellLineColor;                                                           //\91I\91ð\8e\9e\82Ì\98g\90ü
                COLORREF normalSellLineColor;                                                           //\92Ê\8fí\8e\9e\82Ì\98g\90ü
                COLORREF baseStringColor;                                                                       //\8aî\92ê\82Ì\95\8e\9a\90F
-               COLORREF IDLinkColor;                                                                           //\8aî\92ê\82Ì\83n\83C\83p\81[\83\8a\83\93\83N\82Ì\90F
+               COLORREF linkStringColor;                                                                               //\8aî\92ê\82Ì\83n\83C\83p\81[\83\8a\83\93\83N\82Ì\90F
                COLORREF anonymousIDLinkColor;                                                          //\93½\96¼ID\95\\8e¦\90F
                COLORREF colLineColor;                                                                          //\8d\80\96Ú\82Ì\8fc\90ü