source: trunk/src/advtabs/Tracker.hpp @ 507

Revision 507, 2.9 KB checked in by Eoin, 11 years ago (diff)

Added ListViewIterators?.hpp.

Major find and replace of TorrentDetails? and associated classes to torrent_details.

Line 
1
2//         Copyright Eóin O'Callaghan 2006 - 2008.
3// Distributed under the Boost Software License, Version 1.0.
4//    (See accompanying file LICENSE_1_0.txt or copy at
5//          http://www.boost.org/LICENSE_1_0.txt)
6
7#define ID_TRACKER_BEGIN        16000
8#define HAL_TRACKER_LABEL       ID_TRACKER_BEGIN + 1
9#define HAL_LOGIN_APPLY         ID_TRACKER_BEGIN + 2
10#define HAL_REANNOUNCE          ID_TRACKER_BEGIN + 3
11
12#ifndef RC_INVOKED
13
14#pragma once
15
16#include "stdAfx.hpp"
17#include "Halite.hpp"
18
19#include "DdxEx.hpp"
20#include "EditHilight.hpp"
21#include "global/string_conv.hpp"
22
23#include "TrackerListView.hpp"
24#include "../HaliteTabPage.hpp"
25#include "../HaliteListManager.hpp"
26#include "../HaliteDialogBase.hpp"
27
28class AdvTrackerDialog :
29        public CHalTabPageImpl<AdvTrackerDialog>,
30        public ATL::CAutoSizeWindow<AdvTrackerDialog, false>,
31        public CHaliteDialogBase<AdvTrackerDialog>,
32        public CWinDataExchangeEx<AdvTrackerDialog>
33{
34protected:
35        typedef AdvTrackerDialog thisClass;
36        typedef CHalTabPageImpl<thisClass> baseClass;
37        typedef ATL::CAutoSizeWindow<thisClass, false> autosizeClass;
38        typedef CHaliteDialogBase<thisClass> dialogBaseClass;
39
40public:
41        enum { IDD = HAL_ADVTRACKER };
42
43        AdvTrackerDialog(HaliteWindow& HalWindow) :
44                dialogBaseClass(HalWindow),
45                m_list("listviews/tracker", "TrackerListView")
46        {}
47
48        BOOL PreTranslateMessage(MSG* pMsg)
49        {
50                return this->IsDialogMessage(pMsg);
51        }
52
53        BEGIN_MSG_MAP_EX(thisClass)
54                MSG_WM_INITDIALOG(onInitDialog)
55                MSG_WM_CLOSE(onClose)
56
57                COMMAND_ID_HANDLER_EX(HAL_LOGIN_APPLY, onLoginApply)
58                COMMAND_ID_HANDLER_EX(HAL_REANNOUNCE, onReannounce)
59                COMMAND_ID_HANDLER_EX(HAL_TRACKER_LOGINCHECK, onLoginCheck)
60                COMMAND_ID_HANDLER_EX(HAL_TRACKER_RESET, onReset)
61                COMMAND_ID_HANDLER_EX(HAL_TRACKER_APPLY, onApply)
62
63        //      COMMAND_RANGE_CODE_HANDLER_EX(HAL_TRACKER_USER, HAL_TRACKER_PASS, EN_KILLFOCUS, OnEditKillFocus)
64
65                if (uMsg == WM_FORWARDMSG)
66                        if (PreTranslateMessage((LPMSG)lParam)) return TRUE;
67
68                CHAIN_MSG_MAP(dialogBaseClass)
69                CHAIN_MSG_MAP(autosizeClass)
70                CHAIN_MSG_MAP(baseClass)
71                REFLECT_NOTIFICATIONS()
72        END_MSG_MAP()
73
74        BEGIN_DDX_MAP(thisClass)
75                DDX_WTLx_WSTRING(userEdit_, username_)
76                DDX_WTLx_WSTRING(passEdit_, password_)
77    END_DDX_MAP()
78       
79        static CWindowMapStruct* GetWindowMap();
80
81        LRESULT onInitDialog(HWND, LPARAM);
82        void onClose();
83
84        void onLoginCheck(UINT, int, HWND hWnd);
85        LRESULT OnEditKillFocus(UINT uCode, int nCtrlID, HWND hwndCtrl);
86        void onLoginApply(UINT, int, HWND);
87        void onReannounce(UINT, int, HWND);
88
89        void onApply(UINT, int, HWND);
90        void onReset(UINT, int, HWND);
91
92        void setLoginUiState(); 
93        void uiUpdate(const hal::torrent_details_manager& tD);
94        void focusChanged(const hal::torrent_details_ptr pT);
95        void trackerListEdited();
96
97protected:
98        string current_torrent_name_;
99        TrackerListViewCtrl m_list;
100
101        wstring username_;
102        wstring password_;
103
104        WTLx::EditHilight userEdit_;
105        WTLx::EditHilight passEdit_;
106};
107
108#endif // RC_INVOKED
Note: See TracBrowser for help on using the repository browser.