summaryrefslogtreecommitdiffabout
path: root/AutoBestDlg.cpp
authorMichael Krelin <hacker@klever.net>2004-07-05 01:53:09 (UTC)
committer Michael Krelin <hacker@klever.net>2004-07-05 01:53:09 (UTC)
commit5305ddd8332ebd905ebef3b8365fc0d736858a7a (patch) (side-by-side diff)
treeba6dc874bdcb00bd2e116b377a92f347ab81a733 /AutoBestDlg.cpp
downloaddipstick-5305ddd8332ebd905ebef3b8365fc0d736858a7a.zip
dipstick-5305ddd8332ebd905ebef3b8365fc0d736858a7a.tar.gz
dipstick-5305ddd8332ebd905ebef3b8365fc0d736858a7a.tar.bz2
initial commit into svn repository
git-svn-id: http://svn.klever.net/kin/dipstick/trunk@1 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (limited to 'AutoBestDlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r--AutoBestDlg.cpp109
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 @@
+// AutoBestDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "Dipstick.h"
+#include "AutoBestDlg.h"
+
+#include "URLSource.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CAutoBestDlg dialog
+
+
+CAutoBestDlg::CAutoBestDlg(CWnd* pParent /*=NULL*/)
+ : CDialog(CAutoBestDlg::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CAutoBestDlg)
+ m_PktLoss = _T("");
+ m_RTT = _T("");
+ m_URL = _T("");
+ //}}AFX_DATA_INIT
+}
+
+
+void CAutoBestDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CAutoBestDlg)
+ DDX_Control(pDX, IDC_DROPSOURCE, m_DropSourceCtl);
+ DDX_Control(pDX, IDC_PREV, m_PrevCtl);
+ DDX_Control(pDX, IDC_NEXT, m_NextCtl);
+ DDX_Text(pDX, IDC_PKTLOSS, m_PktLoss);
+ DDX_Text(pDX, IDC_RTT, m_RTT);
+ DDX_Text(pDX, IDC_URL, m_URL);
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CAutoBestDlg, CDialog)
+ //{{AFX_MSG_MAP(CAutoBestDlg)
+ ON_BN_CLICKED(IDC_NEXT, OnNext)
+ ON_BN_CLICKED(IDC_PREV, OnPrev)
+ ON_WM_LBUTTONDOWN()
+ ON_BN_CLICKED(IDC_COPYURL, OnCopyurl)
+ ON_WM_HELPINFO()
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CAutoBestDlg message handlers
+
+void CAutoBestDlg::OnNext()
+{
+ EndDialog(IDC_NEXT);
+}
+
+void CAutoBestDlg::OnPrev()
+{
+ EndDialog(IDC_PREV);
+}
+
+BOOL CAutoBestDlg::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ m_NextCtl.EnableWindow(m_bNext);
+ m_PrevCtl.EnableWindow(m_bPrev);
+
+ VERIFY(m_DropSourceCtl.Open(IDR_DRAGAVI));
+ SetWindowPos(&CWnd::wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+CAutoBestDlg::~CAutoBestDlg()
+{
+}
+
+void CAutoBestDlg::OnLButtonDown(UINT nFlags, CPoint point)
+{
+ if(ChildWindowFromPoint(point,CWP_ALL)==&m_DropSourceCtl){
+ TRACE0("Dragging!\n");
+ CURLSource us(m_URL);
+ m_DropSourceCtl.Stop();
+ us.DoDragDrop(DROPEFFECT_COPY|DROPEFFECT_LINK);
+ m_DropSourceCtl.Play(0,-1,-1);
+ }else
+ CDialog::OnLButtonDown(nFlags, point);
+}
+
+void CAutoBestDlg::OnCopyurl()
+{
+CURLSource *us = new CURLSource(m_URL);
+ us->SetClipboard();
+ us->FlushClipboard();
+}
+
+BOOL CAutoBestDlg::OnHelpInfo(HELPINFO* pHelpInfo)
+{
+ WinHelp(IDD|0x20000l);
+ return TRUE;
+}