OSDN Git Service

フォーカス処理修正
authorqwerty2501 <riot313@gmail.com>
Sun, 5 Feb 2012 05:15:10 +0000 (14:15 +0900)
committerqwerty2501 <riot313@gmail.com>
Sun, 5 Feb 2012 05:15:10 +0000 (14:15 +0900)
12 files changed:
nlite.suo
nlite/Resource.h
nlite/nlite.rc
nlite/nlite.vcxproj
nlite/nlite.vcxproj.filters
nlite/nlite_addTomylistWindow.cpp [new file with mode: 0644]
nlite/nlite_addTomylistWindow.h [new file with mode: 0644]
nlite/nlite_commentview.cpp
nlite/nlite_commentview.h
nlite/nlite_common.cpp
nlite/nlite_include.h
nlite/stdafx.h

index 3d7da15..411dad8 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index 60976f4..7651f38 100644 (file)
@@ -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
index db96b48..523a055 100644 (file)
@@ -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 "\83}\83C\83\8a\83X\83g\93o\98^"
+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 "\83N\83b\83L\81[\82Ì\90Ý\92è"
@@ -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"
index 95fb94e..318eeea 100644 (file)
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="nlite.h" />
+    <ClInclude Include="nlite_addTomylistWindow.h" />
     <ClInclude Include="nlite_chatData.h" />
     <ClInclude Include="nlite_commentview.h" />
     <ClInclude Include="nlite_commentWrite.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="nlite.cpp" />
+    <ClCompile Include="nlite_addTomylistWindow.cpp" />
     <ClCompile Include="nlite_appInfo.cpp" />
     <ClCompile Include="nlite_chatData.cpp" />
     <ClCompile Include="nlite_commentview.cpp" />
index 0639688..512e957 100644 (file)
@@ -75,6 +75,9 @@
     <ClInclude Include="nlite_mainframe.h">
       <Filter>ヘッダー ファイル</Filter>
     </ClInclude>
+    <ClInclude Include="nlite_addTomylistWindow.h">
+      <Filter>ヘッダー ファイル</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="stdafx.cpp">
     <ClCompile Include="nlite_common.cpp">
       <Filter>ソース ファイル</Filter>
     </ClCompile>
+    <ClCompile Include="nlite_addTomylistWindow.cpp">
+      <Filter>ソース ファイル</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="nlite.rc">
diff --git a/nlite/nlite_addTomylistWindow.cpp b/nlite/nlite_addTomylistWindow.cpp
new file mode 100644 (file)
index 0000000..646c2ba
--- /dev/null
@@ -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){
+               
+
+               
+               
+               
+               // \83X\83N\83\8a\81[\83\93\82Ì\92\86\89\9b\82É\94z\92u
+               CenterWindow();
+
+               /*
+               // \91å\82«\82¢\83A\83C\83R\83\93\90Ý\92è
+               HICON hIcon = AtlLoadIconImage(IDD_ADDMYLISTDIALOG, LR_DEFAULTCOLOR,
+                       ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
+               SetIcon(hIcon, TRUE);
+
+               // \8f¬\82³\82¢\83A\83C\83R\83\93\90Ý\92è
+               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 (file)
index 0000000..2f13b72
--- /dev/null
@@ -0,0 +1,86 @@
+#pragma once
+
+#define IDC_IE 1001
+
+namespace nlite{
+
+       class CAddToMyListDialog;
+
+
+       class CAddToMyListWindow : public CWindowImpl<CAddToMyListWindow, CAxWindow>,
+               public IDispEventImpl<IDC_IE, CAddToMyListWindow, &DIID_DWebBrowserEvents2, &LIBID_SHDocVw, 1, 1>
+       {
+               friend CAddToMyListDialog;
+       public:
+               DECLARE_WND_SUPERCLASS(NULL, CAxWindow::GetWndClassName())
+
+               CComPtr<IWebBrowser2> 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:
+
+               ///
+               ///\8dì\90¬\8e\9e\82Ì\8f\88\97\9d
+               ///
+               INT_PTR OnCreate(LPCREATESTRUCT lpCreateStruct);
+
+               ///
+               ///\94j\8aü\8e\9e\82Ì\8f\88\97\9d
+               ///
+               VOID OnDestroy();
+
+
+
+               VOID WINAPI OnTitleChange(BSTR title);
+
+               VOID Navigate(LPCTSTR lpszUrl);
+
+
+       };
+
+
+       class CAddToMyListDialog:public CDialogImpl<CAddToMyListDialog>
+       {
+
+               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
index b3089f3..ac98a1b 100644 (file)
@@ -1482,7 +1482,8 @@ end:
                GetCursorPos(&mousePoint);
                ::ScreenToClient(*this,&mousePoint);
                
-               if(static_cast<INT>(loLparam) == 1 &&( IsOnNoOrUserName(CCommentView::NO,mousePoint) || IsOnNoOrUserName(CCommentView::USERNAME,mousePoint))){
+               if(/*static_cast<INT>(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){
                                                
index 6e5b3bc..eaa3954 100644 (file)
@@ -154,7 +154,10 @@ namespace nlite{
                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
+               CFont linkFont;
+
+
+               //\83\8a\83\93\83N\95\8e\9a\97ñ\97p\82Ì\83t\83H\83\93\83g
                enum {
                        CALCEDIT_ID = 100
 
index 4beee1b..4af570e 100644 (file)
@@ -39,7 +39,8 @@ Property nliteProperty;
        return rslt;
 
  }
+
+
 
 const CApplicationInfo * appInfo = NULL;
 
index dbf4610..229c275 100644 (file)
@@ -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"
index 46540fd..11b5d0b 100644 (file)
@@ -59,7 +59,6 @@ extern CAppModule _Module;
 #include <atlwin.h>
 #include <atlhost.h>
 #include <atlctl.h>
-
 #include <atlcrack.h>
 #include <atlmisc.h>
 #include <atlframe.h>
@@ -69,6 +68,7 @@ extern CAppModule _Module;
 #include <atlsplit.h>
 #include <atldlgs.h>
 #include <shellapi.h>
+#include <exdispid.h>
 #include <xmllite.h>
 
 #pragma comment(lib, "xmllite.lib")