source: trunk/src/NewTorrentTrackerAD.hpp @ 493

Revision 493, 2.0 KB checked in by Eoin, 12 years ago (diff)

Freedom from automatic ATL and/or WTL namespaces.

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#pragma once
8
9#define HAL_TRACKER_ADD_BEGIN           15500
10#define IDC_TRACKER_EDIT_URL        HAL_TRACKER_ADD_BEGIN + 1
11#define IDC_TRACKER_EDIT_TIER       HAL_TRACKER_ADD_BEGIN + 2
12#define IDC_TRACKER_TEXT_URL        HAL_TRACKER_ADD_BEGIN + 3
13#define IDC_TRACKER_TEXT_TIER       HAL_TRACKER_ADD_BEGIN + 4
14
15#include "GenericAddDialog.hpp"
16
17class NewTorrent_TrackerAddDialog :
18        public ATL::CDialogImpl<NewTorrent_TrackerAddDialog>,
19        public WTLx::GenericAddDialog<NewTorrent_TrackerAddDialog, IDD_TRACKEDIT>,
20        public WTL::CDialogResize<NewTorrent_TrackerAddDialog>,
21        public CWinDataExchangeEx<NewTorrent_TrackerAddDialog>
22{
23public:
24        typedef NewTorrent_TrackerAddDialog thisClass;
25        typedef WTLx::GenericAddDialog<thisClass, IDD_TRACKEDIT> genericBaseClass;
26        typedef WTL::CDialogResize<thisClass> resizeClass;
27       
28public:
29        NewTorrent_TrackerAddDialog(wstring title, hal::tracker_detail& tracker) :
30                genericBaseClass(title, "genericAddDlgs/NewTorrentAddTracker", "NewTorrentAddTracker"),
31                tracker_(tracker)
32        {}
33
34    BEGIN_MSG_MAP_EX(TrackerAddDialog)
35                CHAIN_MSG_MAP(resizeClass)
36                CHAIN_MSG_MAP(genericBaseClass)
37    END_MSG_MAP()
38
39    BEGIN_DDX_MAP(TrackerAddDialog)
40                DDX_EX_STDWSTRING(IDC_TRACKER_EDIT_URL, tracker_.url);
41        DDX_INT(IDC_TRACKER_EDIT_TIER, tracker_.tier)
42    END_DDX_MAP()       
43
44        BEGIN_DLGRESIZE_MAP(thisClass)
45                DLGRESIZE_CONTROL(IDC_TRACKER_EDIT_URL, DLSZ_SIZE_X)
46                DLGRESIZE_CONTROL(IDC_TRACKER_EDIT_TIER, DLSZ_MOVE_X)
47                DLGRESIZE_CONTROL(IDC_TRACKER_TEXT_URL, DLSZ_SIZE_X)
48                DLGRESIZE_CONTROL(IDC_TRACKER_TEXT_TIER, DLSZ_MOVE_X)
49                DLGRESIZE_CONTROL(IDOK, DLSZ_MOVE_X|DLSZ_MOVE_Y)
50                DLGRESIZE_CONTROL(IDCANCEL, DLSZ_MOVE_X|DLSZ_MOVE_Y)
51        END_DLGRESIZE_MAP()
52
53private:
54        wstring title_;
55        hal::tracker_detail& tracker_;
56};
Note: See TracBrowser for help on using the repository browser.