OSDN Git Service

URLクリック時リンク機能実装
authorqwerty2501 <riot313@gmail.com>
Sat, 4 Feb 2012 06:57:20 +0000 (15:57 +0900)
committerqwerty2501 <riot313@gmail.com>
Sat, 4 Feb 2012 06:57:20 +0000 (15:57 +0900)
nlite.suo
nlite/nlite_commentview.cpp
nlite/nlite_commentview.h
nlite/nlite_mainframe.cpp

index 8599cfa..cc9e503 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index cef2a2b..5cb9ce0 100644 (file)
@@ -354,9 +354,11 @@ namespace nlite{
                return nMax;
        }
 
-       VOID CCommentView::SetProperty(CommentViewProperty &setProperty){
+       VOID CCommentView::SetProperty(const CommentViewProperty &setProperty,const GeneralProperty &in_generalProperty){
 
+               
                viewproperty = setProperty;
+               generalProperty = in_generalProperty;
                m_commentListWindow.OnSetProperty();
                
                return;
@@ -1513,8 +1515,38 @@ end:
                switch(lParam->code){
 
                case EN_LINK:
+                       {
+                               ENLINK *lpenlk = (ENLINK *)lParam;
+                               if (lpenlk->msg == WM_LBUTTONDOWN) {
+                                       CRichEditCtrl chatReadEdit = lpenlk->nmhdr.hwndFrom;
+                                       chatReadEdit.SetSel(lpenlk->chrg);
+                                       CString selTextBuf;
+                                       chatReadEdit.GetSelText(selTextBuf);
+                                       if(regex_match((LPCTSTR)selTextBuf,nliteregex::URL) == TRUE){
+
+                                               if(self.generalProperty.browserPath.Length() == 0){
+
+                                                       ShellExecute(*this, NULL, selTextBuf, NULL, NULL, SW_SHOWNORMAL);
+
+                                               } else{
+
+
+                                               }
+
+                                               
+
+                                       } else if(regex_match((LPCTSTR)selTextBuf,nliteregex::VIDEOID) == TRUE){
+
+                                               dumpln(TEXT("videoId"));
+
+                                       } else if( regex_match((LPCTSTR)selTextBuf,nliteregex::LIVEID) == TRUE){
 
+                                               dumpln(TEXT("liveId"));
 
+                                       }
+                                       
+                               }
+                       }
                        break;
 
                case EN_MSGFILTER:
index 8431b45..7466e55 100644 (file)
@@ -339,6 +339,7 @@ namespace nlite{
                CHeaderCtrl m_header;                                           //\83w\83b\83_\81[\83R\83\93\83g\83\8d\81[\83\8b
                CCommentListWindow  m_commentListWindow;        //\83R\83\81\83\93\83g\83\8a\83X\83g\83E\83B\83\93\83h\83E
                CNicoLiveStream &stream;                                //\95ú\91\97\83I\83u\83W\83F\83N\83g
+               GeneralProperty generalProperty;                        //\88ê\94Ê\90Ý\92è
                CCommentList commentlist;                                       //\83R\83\81\83\93\83g\83\8a\83X\83g
                CommentViewProperty viewproperty;                       //\95\\8e¦\83v\83\8d\83p\83e\83B
                HFONT hHeaderFontNew;                                           //\83w\83b\83_\81[\83t\83H\83\93\83g
@@ -398,7 +399,7 @@ namespace nlite{
                ///
                ///\83v\83\8d\83p\83e\83B\90Ý\92è
                ///
-               VOID SetProperty(CommentViewProperty &setProperty);
+               VOID SetProperty(const CommentViewProperty &setProperty,const GeneralProperty &in_generalProperty);
 
                ///
                ///\83v\83\8d\83p\83e\83B\8eæ\93¾
index 94da298..81c3990 100644 (file)
@@ -183,7 +183,7 @@ VOID CNliteMainFrame::Initialize(LPCTSTR localAppDataPath){
 
        nliteProperty.ReadProperty();
 
-       commentView.SetProperty(nliteProperty.cvp);
+       commentView.SetProperty(nliteProperty.cvp,nliteProperty.gp);
 
        if(nliteProperty.gp.browserType == BT_NOSETTING){
                nliteProperty.CookieSetting();