-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClubDetailsDlg.cpp
82 lines (72 loc) · 2.04 KB
/
ClubDetailsDlg.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
/******************************************************************************
** (C) Chris Oldwood
**
** MODULE: CLUBDETAILSDLG.CPP
** COMPONENT: The Application.
** DESCRIPTION: CClubDetailsDlg class definition.
**
*******************************************************************************
*/
#include "Common.hpp"
#include "ClubDetailsDlg.hpp"
#include "ClubDetails.hpp"
/******************************************************************************
** Method: Constructor.
**
** Description: .
**
** Parameters: None.
**
** Returns: Nothing.
**
*******************************************************************************
*/
CClubDetailsDlg::CClubDetailsDlg(CRow& oDetails) : CDialog(IDD_CLUB_DETAILS)
, m_oDetails(oDetails)
{
DEFINE_CTRL_TABLE
CTRL(IDC_CLUB_NAME, &m_ebName)
CTRL(IDC_SEASON, &m_ebSeason)
CTRL(IDC_LEAGUE_NAME, &m_ebLeague)
END_CTRL_TABLE
}
/******************************************************************************
** Method: OnInitDialog()
**
** Description: Initialise the dialog.
**
** Parameters: None.
**
** Returns: Nothing.
**
*******************************************************************************
*/
void CClubDetailsDlg::OnInitDialog()
{
// Initialise the controls.
m_ebName.Text(m_oDetails[CClubDetails::NAME]);
m_ebName.TextLimit(CClubDetails::NAME_LEN);
m_ebSeason.Text(m_oDetails[CClubDetails::SEASON]);
m_ebSeason.TextLimit(CClubDetails::SEASON_LEN);
m_ebLeague.Text(m_oDetails[CClubDetails::LEAGUE]);
m_ebLeague.TextLimit(CClubDetails::LEAGUE_LEN);
}
/******************************************************************************
** Method: OnOk()
**
** Description: Validate the data and close the dialog.
**
** Parameters: None.
**
** Returns: true or false.
**
*******************************************************************************
*/
bool CClubDetailsDlg::OnOk()
{
// Fetch data from the controls.
m_oDetails[CClubDetails::NAME] = m_ebName.Text();
m_oDetails[CClubDetails::SEASON] = m_ebSeason.Text();
m_oDetails[CClubDetails::LEAGUE] = m_ebLeague.Text();
return true;
}