资源简介

操作系统 读者写者 写优先 MFC vs2010 基于对话框的程序

资源截图

代码片段和文件信息

// EditListCtrl.cpp : 实现文件
//

#include “stdafx.h“
#include “WriteFirst.h“
#include “ProInputDlg.h“
#include “EditListCtrl.h“

// CEditListCtrl

IMPLEMENT_DYNAMIC(CEditListCtrl CListCtrl)

CEditListCtrl::CEditListCtrl()
{}
CEditListCtrl::~CEditListCtrl()
{}

BEGIN_MESSAGE_MAP(CEditListCtrl CListCtrl)
ON_WM_LBUTTONDBLCLK()
ON_MESSAGE(WM_EDIT_END &CEditListCtrl::OnEditEnd)
END_MESSAGE_MAP()

// CEditListCtrl 消息处理程序

void CEditListCtrl::OnLButtonDblClk(UINT nFlags CPoint point)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值

CRect rcCtrl;
LVHITTESTINFO lvhti;
lvhti.pt = point;
nItem = CListCtrl::SubItemHitTest(&lvhti);
if(nItem == -1)
return;
nSubItem = lvhti.iSubItem;
CListCtrl::GetSubItemRect(nItemnSubItemLVIR_LABELrcCtrl);
if(nSubItem == 2)
{
if(m_Combo.m_hWnd == NULL)
{
RECT rect;
rect.left = rcCtrl.left;
rect.top = rcCtrl.top;
rect.right = rcCtrl.right;
rect.bottom = rcCtrl.bottom;
m_Combo.Create(WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLISTrectthisIDC_COMBOX);
m_Combo.SetFont(this->GetFont()FALSE);
//if(nItem > -1)
//{
m_Combo.AddString(_T(“读者“));
m_Combo.AddString(_T(“写者“));
//}
m_Combo.ShowDropDown();
m_Combo.SelectString(-1GetItemText(nItemnSubItem));
}
m_Combo.SetWindowTextW(this->GetItemText(nItemnSubItem));
m_Combo.MoveWindow(&rcCtrlTRUE);
m_Combo.ShowWindow(TRUE);
}
else
{
if(m_Edit.m_hWnd == NULL)
{
RECT rect;
rect.left = rcCtrl.left;
rect.top = rcCtrl.top;
rect.right = rcCtrl.right;
rect.bottom = rcCtrl.bottom;
m_Edit.Create(WS_CHILD | ES_CENTER | WS_BORDER | ES_AUTOHSCROLL | ES_WANTRETURNrectthisIDC_EDIT);
m_Edit.SetFont(this->GetFont()FALSE);
}
m_Edit.SetWindowTextW(this->GetItemText(nItemnSubItem));
m_Edit.MoveWindow(&rcCtrlTRUE);
m_Edit.ShowWindow(TRUE);
}

CWnd * pParent = this->GetParent();
::PostMessageA(pParent->GetSafeHwnd()WM_EDITSTART_ADDLINE0(LPARAM)nItem);

CListCtrl::OnLButtonDblClk(nFlags point);
}

afx_msg LRESULT CEditListCtrl::OnEditEnd(WPARAM wParam LPARAM lParam)
{
CString str;
if(nSubItem == 2)
{
m_Combo.GetWindowTextW(str);
CListCtrl::SetItemText(nItemnSubItemstr);
m_Combo.ShowWindow(SW_HIDE);
m_Combo.UpdateData();
}
else
{
m_Edit.GetWindowTextW(str);
CListCtrl::SetItemText(nItemnSubItemstr);
m_Edit.ShowWindow(SW_HIDE);
m_Edit.UpdateData();
}
CWnd * pParent = this->GetParent();
::PostMessageA(pParent->GetSafeHwnd()WM_EDITEND_CHECK00);
return 0;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     300032  2012-07-11 09:37  WriteFirst\Debug\WriteFirst.exe

     文件    2569048  2012-07-11 09:37  WriteFirst\Debug\WriteFirst.ilk

     文件    5737472  2012-07-11 09:37  WriteFirst\Debug\WriteFirst.pdb

     文件          1  2009-08-31 02:32  WriteFirst\WriteFirst\ClassDiagram1.cd

     文件       6350  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\cl.command.1.tlog

     文件      74818  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\CL.read.1.tlog

     文件       6718  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\CL.write.1.tlog

     文件      33848  2012-07-11 08:43  WriteFirst\WriteFirst\Debug\EditListCtrl.obj

     文件          2  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\link-cvtres.read.1.tlog

     文件          2  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\link-cvtres.write.1.tlog

     文件          2  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\link.3348-cvtres.read.1.tlog

     文件          2  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\link.3348-cvtres.write.1.tlog

     文件          2  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\link.3348.read.1.tlog

     文件          2  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\link.3348.write.1.tlog

     文件       2766  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\link.command.1.tlog

     文件       6708  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\link.read.1.tlog

     文件       1892  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\link.write.1.tlog

     文件      22609  2012-07-11 08:43  WriteFirst\WriteFirst\Debug\ListCtrlCombo.obj

     文件      22107  2012-07-11 08:43  WriteFirst\WriteFirst\Debug\ListCtrlEdit.obj

     文件        710  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\mt.command.1.tlog

     文件        748  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\mt.read.1.tlog

     文件        494  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\mt.write.1.tlog

     文件      39240  2012-07-11 09:29  WriteFirst\WriteFirst\Debug\ProInputDlg.obj

     文件       1236  2012-07-11 08:43  WriteFirst\WriteFirst\Debug\rc.command.1.tlog

     文件       3794  2012-07-11 08:43  WriteFirst\WriteFirst\Debug\rc.read.1.tlog

     文件        582  2012-07-11 08:43  WriteFirst\WriteFirst\Debug\rc.write.1.tlog

     文件     638712  2012-07-11 08:43  WriteFirst\WriteFirst\Debug\stdafx.obj

     文件       8906  2012-07-11 09:29  WriteFirst\WriteFirst\Debug\threadproc.obj

     文件    2149376  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\vc100.idb

     文件    3641344  2012-07-11 09:37  WriteFirst\WriteFirst\Debug\vc100.pdb

............此处省略51个文件信息

评论

共有 条评论