-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNewMarkDlg.cpp
115 lines (91 loc) · 3.07 KB
/
NewMarkDlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
This file is part of Tibia Map Viewer.
Copyright (c) 2001-2006 by Yury Sidorov.
Tibia Map Viewer is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Tibia Map Viewer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Tibia Map Viewer; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// NewMarkDlg.cpp : implementation file
//
#include "stdafx.h"
#include "TMViewer.h"
#include "NewMarkDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNewMarkDlg dialog
CNewMarkDlg::CNewMarkDlg(CWnd* pParent /*=NULL*/)
: CDialog(CNewMarkDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CNewMarkDlg)
m_ShortText = _T("");
m_LongText = _T("");
m_CategoryIdx = 0;
//}}AFX_DATA_INIT
}
void CNewMarkDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CNewMarkDlg)
DDX_Control(pDX, IDC_cbCategory, m_Category);
DDX_Text(pDX, IDC_ShortText, m_ShortText);
DDX_Text(pDX, IDC_LongText, m_LongText);
DDX_CBIndex(pDX, IDC_cbCategory, m_CategoryIdx);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CNewMarkDlg, CDialog)
//{{AFX_MSG_MAP(CNewMarkDlg)
ON_NOTIFY(CBEN_GETDISPINFO, IDC_cbCategory, OnGetdispinfocbCategory)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNewMarkDlg message handlers
void CNewMarkDlg::OnGetdispinfocbCategory(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
*pResult = 0;
}
BOOL CNewMarkDlg::OnInitDialog()
{
CDialog::OnInitDialog();
if (!m_Caption.IsEmpty())
SetWindowText(m_Caption);
m_Images.Create(&theApp.m_map.Content.MarkImages);
m_Category.SetImageList(&m_Images);
int i;
COMBOBOXEXITEM ci;
ci.mask = CBEIF_IMAGE | CBEIF_SELECTEDIMAGE | CBEIF_TEXT;
CMarkCategories &mcs = theApp.m_map.Content.MarkCategories;
for (i = 0; i < mcs.GetSize(); i++) {
ci.iItem = i;
ci.iImage = i;
ci.iSelectedImage = i;
ci.pszText = mcs[i]->Name.LockBuffer();
m_Category.InsertItem(&ci);
mcs[i]->Name.UnlockBuffer();
}
m_Category.GetComboBoxCtrl()->SetCurSel(m_CategoryIdx);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CNewMarkDlg::OnDestroy()
{
m_Category.SetImageList(NULL);
CDialog::OnDestroy();
}
void CNewMarkDlg::OnOK()
{
CDialog::OnOK();
}