-
Notifications
You must be signed in to change notification settings - Fork 0
/
DlgBarSelectMedium.cpp
executable file
·79 lines (65 loc) · 1.96 KB
/
DlgBarSelectMedium.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
// DlgBarSelectMedium.cpp : implementation file
//
#include "stdafx.h"
#include "CdCoverCreator2.h"
#include "CdCoverCreator2Doc.h"
#include "DlgBarSelectMedium.h"
// CDlgBarSelectMedium dialog
IMPLEMENT_DYNAMIC(CDlgBarSelectMedium, CDialogBar)
CDlgBarSelectMedium::CDlgBarSelectMedium(CWnd* pParent /*=NULL*/)
: CDialogBar ()
{
}
CDlgBarSelectMedium::~CDlgBarSelectMedium()
{
}
void CDlgBarSelectMedium::DoDataExchange(CDataExchange* pDX)
{
CDialogBar::DoDataExchange(pDX);
}
void CDlgBarSelectMedium::SetMediumType (MediumType type)
{
switch (type)
{
case MediumJewelCase:
((CComboBox*) GetDlgItem (IDC_COMBO_MEDIUM))->SelectString (-1, "Jewel Case");
break;
case MediumSlimCase:
((CComboBox*) GetDlgItem (IDC_COMBO_MEDIUM))->SelectString (-1, "Slim Case");
break;
case MediumPaperSleeve:
((CComboBox*) GetDlgItem (IDC_COMBO_MEDIUM))->SelectString (-1, "Paper Sleeve");
break;
case MediumDVDBox:
((CComboBox*) GetDlgItem (IDC_COMBO_MEDIUM))->SelectString (-1, "DVD Box");
break;
}
}
MediumType CDlgBarSelectMedium::GetMediumType ()
{
CString str;
((CComboBox*) GetDlgItem (IDC_COMBO_MEDIUM))->GetLBText (((CComboBox*) GetDlgItem (IDC_COMBO_MEDIUM))->GetCurSel (), str);
if (str == "Jewel Case")
return MediumJewelCase;
if (str == "Slim Case")
return MediumSlimCase;
if (str == "Paper Sleeve")
return MediumPaperSleeve;
if (str == "DVD Box")
return MediumDVDBox;
return (MediumType) -1;
}
BEGIN_MESSAGE_MAP(CDlgBarSelectMedium, CDialogBar)
ON_CBN_SELCHANGE(IDC_COMBO_MEDIUM, OnCbnSelchangeComboMedium)
END_MESSAGE_MAP()
// CDlgBarSelectMedium message handlers
void CDlgBarSelectMedium::OnCbnSelchangeComboMedium()
{
CMDIChildWnd* pChild = ((CMDIFrameWnd*) AfxGetMainWnd ())->MDIGetActive ();
if (pChild != NULL)
{
CCdCoverCreator2Doc* pDoc = (CCdCoverCreator2Doc*) pChild->GetActiveDocument ();
if (pDoc != NULL)
pDoc->SetMediumType (GetMediumType ());
}
}