33 |
BEGIN_MESSAGE_MAP(ResultDialog, CDialog) |
BEGIN_MESSAGE_MAP(ResultDialog, CDialog) |
34 |
ON_WM_SETFOCUS() |
ON_WM_SETFOCUS() |
35 |
ON_BN_CLICKED(IDC_DETAILS, OnBnClickedDetails) |
ON_BN_CLICKED(IDC_DETAILS, OnBnClickedDetails) |
36 |
|
ON_NOTIFY(NM_DBLCLK, IDC_LIST, OnNMDblclkList) |
37 |
END_MESSAGE_MAP() |
END_MESSAGE_MAP() |
38 |
|
|
39 |
|
|
105 |
{ |
{ |
106 |
CListCtrl *list = (CListCtrl *) GetDlgItem(IDC_LIST); |
CListCtrl *list = (CListCtrl *) GetDlgItem(IDC_LIST); |
107 |
int sel = list->GetSelectionMark(); |
int sel = list->GetSelectionMark(); |
108 |
|
CString barcode = list->GetItemText(sel,0); |
109 |
|
|
110 |
if (sel == -1) { |
if (sel == -1) { |
111 |
MessageBox("You must select an item"); |
MessageBox("You must select an item"); |
112 |
} else { |
} else { |
113 |
ResultDetailsDialog resdialog; |
ResultDetailsDialog resdialog; |
114 |
resdialog.m_resultIndex = sel; |
resdialog.m_barcode = barcode; |
115 |
|
|
116 |
resdialog.DoModal(); |
resdialog.DoModal(); |
117 |
} |
} |
118 |
} |
} |
119 |
|
|
120 |
|
void ResultDialog::OnNMDblclkList(NMHDR *pNMHDR, LRESULT *pResult) |
121 |
|
{ |
122 |
|
CListCtrl *list = (CListCtrl *) GetDlgItem(IDC_LIST); |
123 |
|
int sel = list->GetSelectionMark(); |
124 |
|
CString barcode = list->GetItemText(sel,0); |
125 |
|
|
126 |
|
ResultDetailsDialog resdialog; |
127 |
|
resdialog.m_barcode = barcode; |
128 |
|
|
129 |
|
resdialog.DoModal(); |
130 |
|
|
131 |
|
*pResult = 0; |
132 |
|
} |