From: qwerty2501 Date: Sat, 4 Feb 2012 06:57:20 +0000 (+0900) Subject: URLクリック時リンク機能実装 X-Git-Tag: v0.002~2^2~36 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d03d650f60a9f212edfeb7e8fb33e14a6819bc0d;p=nlite%2Fnlite.git URLクリック時リンク機能実装 --- diff --git a/nlite.suo b/nlite.suo index 8599cfa..cc9e503 100644 Binary files a/nlite.suo and b/nlite.suo differ diff --git a/nlite/nlite_commentview.cpp b/nlite/nlite_commentview.cpp index cef2a2b..5cb9ce0 100644 --- a/nlite/nlite_commentview.cpp +++ b/nlite/nlite_commentview.cpp @@ -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: diff --git a/nlite/nlite_commentview.h b/nlite/nlite_commentview.h index 8431b45..7466e55 100644 --- a/nlite/nlite_commentview.h +++ b/nlite/nlite_commentview.h @@ -339,6 +339,7 @@ namespace nlite{ CHeaderCtrl m_header; //ƒwƒbƒ_[ƒRƒ“ƒgƒ[ƒ‹ CCommentListWindow m_commentListWindow; //ƒRƒƒ“ƒgƒŠƒXƒgƒEƒBƒ“ƒhƒE CNicoLiveStream &stream; //•ú‘—ƒIƒuƒWƒFƒNƒg + GeneralProperty generalProperty; //ˆê”ʐݒè CCommentList commentlist; //ƒRƒƒ“ƒgƒŠƒXƒg CommentViewProperty viewproperty; //•\Ž¦ƒvƒƒpƒeƒB HFONT hHeaderFontNew; //ƒwƒbƒ_[ƒtƒHƒ“ƒg @@ -398,7 +399,7 @@ namespace nlite{ /// ///ƒvƒƒpƒeƒBÝ’è /// - VOID SetProperty(CommentViewProperty &setProperty); + VOID SetProperty(const CommentViewProperty &setProperty,const GeneralProperty &in_generalProperty); /// ///ƒvƒƒpƒeƒBŽæ“¾ diff --git a/nlite/nlite_mainframe.cpp b/nlite/nlite_mainframe.cpp index 94da298..81c3990 100644 --- a/nlite/nlite_mainframe.cpp +++ b/nlite/nlite_mainframe.cpp @@ -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();