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
|
void CDataDialog::InsertItems()
{
HWND hWnd = ::GetDlgItem(m_hWnd, IDC_LIST1);
// Set the LVCOLUMN structure with the required
// column information
LVCOLUMN list;
list.mask = LVCF_TEXT | LVCF_WIDTH |
LVCF_FMT | LVCF_SUBITEM;
list.fmt = LVCFMT_LEFT;
list.cx = 50;
list.pszText = L"Conductor";
list.iSubItem = 0;
//Inserts the column
::SendMessage(hWnd, LVM_INSERTCOLUMN,
(WPARAM)0, (WPARAM)&list);
list.cx = 100;
list.pszText = L"Resistivity";
list.iSubItem = 1;
::SendMessage(hWnd, LVM_INSERTCOLUMN,
(WPARAM)1, (WPARAM)&list);
list.cx = 100;
list.pszText = L"Permeability";
list.iSubItem = 2;
::SendMessage(hWnd, LVM_INSERTCOLUMN,
(WPARAM)2, (WPARAM)&list);
list.cx = 100;
list.pszText = L"Outer Diameter";
list.iSubItem = 3;
::SendMessage(hWnd, LVM_INSERTCOLUMN,
(WPARAM)3, (WPARAM)&list);
list.cx = 100;
list.pszText = L"Inner Diameter";
list.iSubItem = 4;
::SendMessage(hWnd, LVM_INSERTCOLUMN,
(WPARAM)4, (WPARAM)&list);
list.cx = 100;
list.pszText = L"Rdc";
list.iSubItem = 5;
::SendMessage(hWnd, LVM_INSERTCOLUMN,
(WPARAM)5, (WPARAM)&list);
list.cx = 100;
list.pszText = L"x component";
list.iSubItem = 6;
::SendMessage(hWnd, LVM_INSERTCOLUMN,
(WPARAM)6, (WPARAM)&list);
list.cx = 100;
list.pszText = L"y component";
list.iSubItem = 7;
::SendMessage(hWnd, LVM_INSERTCOLUMN,
(WPARAM)7, (WPARAM)&list);
// Inserts first Row with four columns .
for (int i = 1; i<=m_DialogCon; i++)
{
SetCell(hWnd, L"1", 0, 0);
SetCell(hWnd, L"0.0000386063", 0, 1);
SetCell(hWnd, L"1", 0, 2);
SetCell(hWnd, L"0.025146", 0, 3);
SetCell(hWnd, L"0.00971", 0, 4);
SetCell(hWnd, L"0.09136", 0, 5);
SetCell(hWnd, L"0", 0, 6);
SetCell(hWnd, L"15.24", 0, 7);
}
}
|