00001
00002
00003
00004
00005
00006 #include "stdafx.h"
00007 #include "FdmApp.h"
00008 #include "DownloaderProperties_MonitorPage_SkipList.h"
00009
00010 #ifdef _DEBUG
00011 #define new DEBUG_NEW
00012 #undef THIS_FILE
00013 static char THIS_FILE[] = __FILE__;
00014 #endif
00015
00016 CDownloaderProperties_MonitorPage_SkipList::CDownloaderProperties_MonitorPage_SkipList(CWnd* pParent )
00017 : CDialog(CDownloaderProperties_MonitorPage_SkipList::IDD, pParent)
00018 {
00019
00020
00021
00022 }
00023
00024 void CDownloaderProperties_MonitorPage_SkipList::DoDataExchange(CDataExchange* pDX)
00025 {
00026 CDialog::DoDataExchange(pDX);
00027
00028
00029
00030 }
00031
00032 BEGIN_MESSAGE_MAP(CDownloaderProperties_MonitorPage_SkipList, CDialog)
00033
00034 ON_WM_HELPINFO()
00035 ON_COMMAND(ID_WHATISTHIS, OnWhatisthis)
00036 ON_WM_CONTEXTMENU()
00037
00038 END_MESSAGE_MAP()
00039
00040 BOOL CDownloaderProperties_MonitorPage_SkipList::OnInitDialog()
00041 {
00042 CDialog::OnInitDialog();
00043
00044 SetDlgItemText (IDC_EXTS, _App.Monitor_SkipExts ());
00045 SetDlgItemText (IDC_SERVERS, _App.Monitor_SkipServers ());
00046
00047 ApplyLanguage ();
00048
00049 return TRUE;
00050 }
00051
00052 void CDownloaderProperties_MonitorPage_SkipList::OnOK()
00053 {
00054 CString str;
00055 GetDlgItemText (IDC_EXTS, str);
00056 _App.Monitor_SkipExts (str);
00057
00058 GetDlgItemText (IDC_SERVERS, str);
00059 str.Replace ("\r\n", " ");
00060 str.Replace ("\r", " ");
00061 str.Replace ("\n", " ");
00062 str.Replace ("http://", "");
00063 str.Replace ("https://", "");
00064 str.Replace ("ftp://", "");
00065 _App.Monitor_SkipServers (str);
00066
00067 CDialog::OnOK();
00068 }
00069
00070 void CDownloaderProperties_MonitorPage_SkipList::ApplyLanguage()
00071 {
00072 fsDlgLngInfo lnginfo [] = {
00073 fsDlgLngInfo (IDC_SKIPEXTS, L_SKIPFILESWITHEXTS),
00074 fsDlgLngInfo (IDC__SKIPSERVERS, L_SKIPSERVERS),
00075 fsDlgLngInfo (IDCANCEL, L_CANCEL),
00076 };
00077
00078 _LngMgr.ApplyLanguage (this, lnginfo, sizeof (lnginfo) / sizeof (fsDlgLngInfo), L_SKIPLIST);
00079 }
00080
00081 void CDownloaderProperties_MonitorPage_SkipList::PrepareCHMgr(CPoint point)
00082 {
00083 fsCtrlContextHelp aCH1 [] = {
00084 fsCtrlContextHelp (IDC_SKIPEXTS, LS (L_SKIPFILESWITHEXTSHERE)),
00085 fsCtrlContextHelp (IDC_EXTS, LS (L_SKIPFILESWITHEXTSHERE)),
00086 fsCtrlContextHelp (IDC__SKIPSERVERS, LS (L_SKIPSERVERS_HERE)),
00087 fsCtrlContextHelp (IDC_SERVERS, LS (L_SKIPSERVERS_HERE)),
00088 };
00089
00090 static fsCtrlContextHelp aCH [sizeof (aCH1) / sizeof (fsCtrlContextHelp)];
00091 CopyMemory (aCH, aCH1, sizeof (aCH));
00092
00093 _CHMgr.PrepareContextMenu (this, point, aCH, sizeof (aCH) / sizeof (fsCtrlContextHelp));
00094 }
00095
00096 BOOL CDownloaderProperties_MonitorPage_SkipList::OnHelpInfo(HELPINFO* pHelpInfo)
00097 {
00098 RECT rc;
00099 CWnd *pItem = GetDlgItem (pHelpInfo->iCtrlId);
00100 if (pItem == NULL)
00101 return TRUE;
00102 pItem->GetWindowRect (&rc);
00103 if (PtInRect (&rc, pHelpInfo->MousePos) == FALSE)
00104 {
00105 pHelpInfo->MousePos.x = rc.left + (rc.right - rc.left) / 2;
00106 pHelpInfo->MousePos.y = rc.top + (rc.bottom - rc.top) / 2;
00107 }
00108 PrepareCHMgr (pHelpInfo->MousePos);
00109 _CHMgr.OnWT ();
00110 return TRUE;
00111 }
00112
00113 void CDownloaderProperties_MonitorPage_SkipList::OnWhatisthis()
00114 {
00115 _CHMgr.OnWT ();
00116 }
00117
00118 void CDownloaderProperties_MonitorPage_SkipList::OnContextMenu(CWnd* pWnd, CPoint point)
00119 {
00120 PrepareCHMgr (point);
00121 _CHMgr.ShowMenu ();
00122 }