-rw-r--r-- | AutoBestDlg.cpp | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/AutoBestDlg.cpp b/AutoBestDlg.cpp new file mode 100644 index 0000000..cf18c9c --- a/dev/null +++ b/AutoBestDlg.cpp | |||
@@ -0,0 +1,109 @@ | |||
1 | // AutoBestDlg.cpp : implementation file | ||
2 | // | ||
3 | |||
4 | #include "stdafx.h" | ||
5 | #include "Dipstick.h" | ||
6 | #include "AutoBestDlg.h" | ||
7 | |||
8 | #include "URLSource.h" | ||
9 | |||
10 | #ifdef _DEBUG | ||
11 | #define new DEBUG_NEW | ||
12 | #undef THIS_FILE | ||
13 | static char THIS_FILE[] = __FILE__; | ||
14 | #endif | ||
15 | |||
16 | ///////////////////////////////////////////////////////////////////////////// | ||
17 | // CAutoBestDlg dialog | ||
18 | |||
19 | |||
20 | CAutoBestDlg::CAutoBestDlg(CWnd* pParent /*=NULL*/) | ||
21 | : CDialog(CAutoBestDlg::IDD, pParent) | ||
22 | { | ||
23 | //{{AFX_DATA_INIT(CAutoBestDlg) | ||
24 | m_PktLoss = _T(""); | ||
25 | m_RTT = _T(""); | ||
26 | m_URL = _T(""); | ||
27 | //}}AFX_DATA_INIT | ||
28 | } | ||
29 | |||
30 | |||
31 | void CAutoBestDlg::DoDataExchange(CDataExchange* pDX) | ||
32 | { | ||
33 | CDialog::DoDataExchange(pDX); | ||
34 | //{{AFX_DATA_MAP(CAutoBestDlg) | ||
35 | DDX_Control(pDX, IDC_DROPSOURCE, m_DropSourceCtl); | ||
36 | DDX_Control(pDX, IDC_PREV, m_PrevCtl); | ||
37 | DDX_Control(pDX, IDC_NEXT, m_NextCtl); | ||
38 | DDX_Text(pDX, IDC_PKTLOSS, m_PktLoss); | ||
39 | DDX_Text(pDX, IDC_RTT, m_RTT); | ||
40 | DDX_Text(pDX, IDC_URL, m_URL); | ||
41 | //}}AFX_DATA_MAP | ||
42 | } | ||
43 | |||
44 | |||
45 | BEGIN_MESSAGE_MAP(CAutoBestDlg, CDialog) | ||
46 | //{{AFX_MSG_MAP(CAutoBestDlg) | ||
47 | ON_BN_CLICKED(IDC_NEXT, OnNext) | ||
48 | ON_BN_CLICKED(IDC_PREV, OnPrev) | ||
49 | ON_WM_LBUTTONDOWN() | ||
50 | ON_BN_CLICKED(IDC_COPYURL, OnCopyurl) | ||
51 | ON_WM_HELPINFO() | ||
52 | //}}AFX_MSG_MAP | ||
53 | END_MESSAGE_MAP() | ||
54 | |||
55 | ///////////////////////////////////////////////////////////////////////////// | ||
56 | // CAutoBestDlg message handlers | ||
57 | |||
58 | void CAutoBestDlg::OnNext() | ||
59 | { | ||
60 | EndDialog(IDC_NEXT); | ||
61 | } | ||
62 | |||
63 | void CAutoBestDlg::OnPrev() | ||
64 | { | ||
65 | EndDialog(IDC_PREV); | ||
66 | } | ||
67 | |||
68 | BOOL CAutoBestDlg::OnInitDialog() | ||
69 | { | ||
70 | CDialog::OnInitDialog(); | ||
71 | |||
72 | m_NextCtl.EnableWindow(m_bNext); | ||
73 | m_PrevCtl.EnableWindow(m_bPrev); | ||
74 | |||
75 | VERIFY(m_DropSourceCtl.Open(IDR_DRAGAVI)); | ||
76 | SetWindowPos(&CWnd::wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); | ||
77 | |||
78 | return TRUE; // return TRUE unless you set the focus to a control | ||
79 | // EXCEPTION: OCX Property Pages should return FALSE | ||
80 | } | ||
81 | |||
82 | CAutoBestDlg::~CAutoBestDlg() | ||
83 | { | ||
84 | } | ||
85 | |||
86 | void CAutoBestDlg::OnLButtonDown(UINT nFlags, CPoint point) | ||
87 | { | ||
88 | if(ChildWindowFromPoint(point,CWP_ALL)==&m_DropSourceCtl){ | ||
89 | TRACE0("Dragging!\n"); | ||
90 | CURLSource us(m_URL); | ||
91 | m_DropSourceCtl.Stop(); | ||
92 | us.DoDragDrop(DROPEFFECT_COPY|DROPEFFECT_LINK); | ||
93 | m_DropSourceCtl.Play(0,-1,-1); | ||
94 | }else | ||
95 | CDialog::OnLButtonDown(nFlags, point); | ||
96 | } | ||
97 | |||
98 | void CAutoBestDlg::OnCopyurl() | ||
99 | { | ||
100 | CURLSource *us = new CURLSource(m_URL); | ||
101 | us->SetClipboard(); | ||
102 | us->FlushClipboard(); | ||
103 | } | ||
104 | |||
105 | BOOL CAutoBestDlg::OnHelpInfo(HELPINFO* pHelpInfo) | ||
106 | { | ||
107 | WinHelp(IDD|0x20000l); | ||
108 | return TRUE; | ||
109 | } | ||