From: qwerty2501 Date: Sun, 5 Feb 2012 05:15:10 +0000 (+0900) Subject: フォーカス処理修正 X-Git-Tag: v0.002~2^2~33 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e5f2a82401e68a60cd2350d58a44f2d3e4c16924;p=nlite%2Fnlite.git フォーカス処理修正 --- diff --git a/nlite.suo b/nlite.suo index 3d7da15..411dad8 100644 Binary files a/nlite.suo and b/nlite.suo differ diff --git a/nlite/Resource.h b/nlite/Resource.h index 60976f4..7651f38 100644 --- a/nlite/Resource.h +++ b/nlite/Resource.h @@ -10,6 +10,7 @@ #define IDD_DIALOG_BROWSERTYPE 211 #define IDD_DIALOG_VIEW_PROPERTY 213 #define IDD_DIALOG_GENERAL_PAGE 216 +#define IDD_ADDMYLISTDIALOG 219 #define IDC_EDIT1 1000 #define IDC_BUTTON_COOKIE_OK 1001 #define IDC_APPLY 1003 diff --git a/nlite/nlite.rc b/nlite/nlite.rc index db96b48..523a055 100644 --- a/nlite/nlite.rc +++ b/nlite/nlite.rc @@ -61,6 +61,16 @@ IDC_NLITE MENU // Dialog resources // LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +IDD_ADDMYLISTDIALOG DIALOG 0, 0, 186, 160 +STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU +CAPTION "ƒ}ƒCƒŠƒXƒg“o˜^" +FONT 8, "Ms Shell Dlg" +{ +} + + + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG_BROWSERTYPE DIALOG 0, 0, 123, 110 STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU CAPTION "ƒNƒbƒL[‚̐ݒè" @@ -157,7 +167,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL { BLOCK "08000025" { - VALUE "LegalCopyright", "Copyright (C) 2011 Kohsuke Oikawa." + VALUE "LegalCopyright", "Copyright (C) 2012 Kohsuke Oikawa." VALUE "OriginalFilename", "nlite.exe" VALUE "ProductName", "nlite" VALUE "ProductVersion", "0.001" diff --git a/nlite/nlite.vcxproj b/nlite/nlite.vcxproj index 95fb94e..318eeea 100644 --- a/nlite/nlite.vcxproj +++ b/nlite/nlite.vcxproj @@ -110,6 +110,7 @@ + @@ -127,6 +128,7 @@ + diff --git a/nlite/nlite.vcxproj.filters b/nlite/nlite.vcxproj.filters index 0639688..512e957 100644 --- a/nlite/nlite.vcxproj.filters +++ b/nlite/nlite.vcxproj.filters @@ -75,6 +75,9 @@ ヘッダー ファイル + + ヘッダー ファイル + @@ -116,6 +119,9 @@ ソース ファイル + + ソース ファイル + diff --git a/nlite/nlite_addTomylistWindow.cpp b/nlite/nlite_addTomylistWindow.cpp new file mode 100644 index 0000000..646c2ba --- /dev/null +++ b/nlite/nlite_addTomylistWindow.cpp @@ -0,0 +1,100 @@ +#include "stdafx.h" +#include "nlite_include.h" + + +namespace nlite{ + + + CAddToMyListWindow::CAddToMyListWindow(CNicoVideoAuth &in_auth):refAuth(in_auth){} + + + BOOL CAddToMyListWindow::PreTranslateMessage(MSG* pMsg){ + if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) && + (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST)) + return FALSE; + + return (BOOL)SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg); + } + + + INT_PTR CAddToMyListWindow::OnCreate(LPCREATESTRUCT lpCreateStruct){ + LRESULT lRet = DefWindowProc(); + + HRESULT hRet = QueryControl(&m_pWB2); + if(SUCCEEDED(hRet)){ + DispEventAdvise(m_pWB2, &DIID_DWebBrowserEvents2); + } + + + + return lRet; + } + + + VOID CAddToMyListWindow::OnDestroy(){ + if(m_pWB2){ + DispEventUnadvise(m_pWB2, &DIID_DWebBrowserEvents2); + } + + SetMsgHandled(false); + } + + VOID WINAPI CAddToMyListWindow::OnTitleChange(BSTR title){ + GetTopLevelWindow().SetWindowText(COLE2CT(title)); + } + + VOID CAddToMyListWindow::Navigate(LPCTSTR lpszUrl){ + if(m_pWB2){ + CComVariant v; + m_pWB2->Navigate(CComBSTR(lpszUrl), &v, &v, &v, &v); + } + } + + CAddToMyListDialog::CAddToMyListDialog(CNicoVideoAuth &in_auth):refAuth(in_auth),addToMyListWindow(in_auth){ + + + } + + + BOOL CAddToMyListDialog::OnInitDialog(CWindow wndFocus, LPARAM lInitParam){ + + + + + + // ƒXƒNƒŠ[ƒ“‚Ì’†‰›‚É”z’u + CenterWindow(); + + /* + // ‘å‚«‚¢ƒAƒCƒRƒ“Ý’è + HICON hIcon = AtlLoadIconImage(IDD_ADDMYLISTDIALOG, LR_DEFAULTCOLOR, + ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); + SetIcon(hIcon, TRUE); + + // ¬‚³‚¢ƒAƒCƒRƒ“Ý’è + HICON hIconSmall = AtlLoadIconImage(IDD_ADDMYLISTDIALOG, LR_DEFAULTCOLOR, + ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)); + SetIcon(hIconSmall, FALSE); + */ + //addToMyListWindow.Create(m_hWnd, rcDefault,_T("Shell.Explorer.2"),WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE, IDC_IE); + + + + + + + //addToMyListWindow.Navigate(_T("http://wtl.sourceforge.net/")); + + return TRUE; + } + + VOID CAddToMyListDialog::OnOK(UINT uNotifyCode, int nID, CWindow wndCtl){ + EndDialog(nID); + } + + VOID CAddToMyListDialog::OnCancel(UINT uNotifyCode, int nID, CWindow wndCtl){ + EndDialog(nID); + } + + +} \ No newline at end of file diff --git a/nlite/nlite_addTomylistWindow.h b/nlite/nlite_addTomylistWindow.h new file mode 100644 index 0000000..2f13b72 --- /dev/null +++ b/nlite/nlite_addTomylistWindow.h @@ -0,0 +1,86 @@ +#pragma once + +#define IDC_IE 1001 + +namespace nlite{ + + class CAddToMyListDialog; + + + class CAddToMyListWindow : public CWindowImpl, + public IDispEventImpl + { + friend CAddToMyListDialog; + public: + DECLARE_WND_SUPERCLASS(NULL, CAxWindow::GetWndClassName()) + + CComPtr m_pWB2; + CNicoVideoAuth &refAuth; + + BOOL PreTranslateMessage(MSG* pMsg); + + + BEGIN_MSG_MAP(CAddToMyListWindow) + MSG_WM_CREATE(OnCreate) + MSG_WM_DESTROY(OnDestroy) + END_MSG_MAP() + + BEGIN_SINK_MAP(CAddToMyListWindow) + SINK_ENTRY_EX(IDC_IE, + DIID_DWebBrowserEvents2, DISPID_TITLECHANGE, OnTitleChange) + END_SINK_MAP() + + + public: + CAddToMyListWindow(CNicoVideoAuth &in_auth); + + private: + + /// + ///ì¬Žž‚̏ˆ— + /// + INT_PTR OnCreate(LPCREATESTRUCT lpCreateStruct); + + /// + ///”jŠüŽž‚̏ˆ— + /// + VOID OnDestroy(); + + + + VOID WINAPI OnTitleChange(BSTR title); + + VOID Navigate(LPCTSTR lpszUrl); + + + }; + + + class CAddToMyListDialog:public CDialogImpl + { + + CAddToMyListWindow addToMyListWindow; + + + CNicoVideoAuth &refAuth; + + public: + enum {IDD = IDD_ADDMYLISTDIALOG}; + + BEGIN_MSG_MAP(CAddToMyListDialog) + MSG_WM_INITDIALOG(OnInitDialog) + COMMAND_ID_HANDLER_EX(IDOK, OnOK) + COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel) + END_MSG_MAP() + + + CAddToMyListDialog(CNicoVideoAuth &in_auth); + + private: + BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam); + VOID OnOK(UINT uNotifyCode, int nID, CWindow wndCtl); + + VOID OnCancel(UINT uNotifyCode,INT nID,CWindow wndCtl); + + }; +} \ No newline at end of file diff --git a/nlite/nlite_commentview.cpp b/nlite/nlite_commentview.cpp index b3089f3..ac98a1b 100644 --- a/nlite/nlite_commentview.cpp +++ b/nlite/nlite_commentview.cpp @@ -1482,7 +1482,8 @@ end: GetCursorPos(&mousePoint); ::ScreenToClient(*this,&mousePoint); - if(static_cast(loLparam) == 1 &&( IsOnNoOrUserName(CCommentView::NO,mousePoint) || IsOnNoOrUserName(CCommentView::USERNAME,mousePoint))){ + if(/*static_cast(loLparam) == 1 &&*/( IsOnNoOrUserName(CCommentView::NO,mousePoint) || IsOnNoOrUserName(CCommentView::USERNAME,mousePoint))){ + ::SetCursor(::LoadCursorW(NULL,IDC_HAND)); @@ -1530,7 +1531,12 @@ end: } else if(regex_match((LPCTSTR)selTextBuf,nliteregex::VIDEOID) == TRUE){ - dumpln(TEXT("videoId")); + CAddToMyListDialog addToMyListDialog(self.refAuth); + addToMyListDialog.DoModal(); + + + ::SetFocus(lParam->hwndFrom); + } else if( regex_match((LPCTSTR)selTextBuf,nliteregex::LIVEID) == TRUE){ diff --git a/nlite/nlite_commentview.h b/nlite/nlite_commentview.h index 6e5b3bc..eaa3954 100644 --- a/nlite/nlite_commentview.h +++ b/nlite/nlite_commentview.h @@ -154,7 +154,10 @@ namespace nlite{ 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 + CFont linkFont; + + + //ƒŠƒ“ƒN•¶Žš—ñ—p‚̃tƒHƒ“ƒg enum { CALCEDIT_ID = 100 diff --git a/nlite/nlite_common.cpp b/nlite/nlite_common.cpp index 4beee1b..4af570e 100644 --- a/nlite/nlite_common.cpp +++ b/nlite/nlite_common.cpp @@ -39,7 +39,8 @@ Property nliteProperty; return rslt; } - + + const CApplicationInfo * appInfo = NULL; diff --git a/nlite/nlite_include.h b/nlite/nlite_include.h index dbf4610..229c275 100644 --- a/nlite/nlite_include.h +++ b/nlite/nlite_include.h @@ -13,7 +13,7 @@ #include "nlite_commentWrite.h" #include "nlite_nlib.h" #include "nlite_property.h" - +#include "nlite_addTomylistWindow.h" #include "nlite_chatData.h" #include "nlite_commentview.h" #include "nlite_appinfo.h" diff --git a/nlite/stdafx.h b/nlite/stdafx.h index 46540fd..11b5d0b 100644 --- a/nlite/stdafx.h +++ b/nlite/stdafx.h @@ -59,7 +59,6 @@ extern CAppModule _Module; #include #include #include - #include #include #include @@ -69,6 +68,7 @@ extern CAppModule _Module; #include #include #include +#include #include #pragma comment(lib, "xmllite.lib")