source: trunk/src/NewTorrentTrackerAD.hpp @ 419

Revision 419, 1.5 KB checked in by Eoin, 12 years ago (diff)

Factored out base code for adding and editing items in ListViews?. Made the NewTorrent? Tracker ListView? editable.

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