資源簡(jiǎn)介
1913557ListControl.rar

代碼片段和文件信息
//?GridList.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“ListControl.h“
#include?“GridList.h“
#include?“ListEdit.h“
#include?“ListControlDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
CListEdit?edit;
/////////////////////////////////////////////////////////////////////////////
//?CGridList
CGridList::CGridList()
{
}
CGridList::~CGridList()
{
}
BEGIN_MESSAGE_MAP(CGridList?CListCtrl)
//{{AFX_MSG_MAP(CGridList)
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CGridList?message?handlers
void?CGridList::PreSubclassWindow()
{
????Modifystyle(LVS_EDITLABELS0);
????Modifystyle(0LVS_REPORT);
Modifystyle(0LVS_SHOWSELALWAYS);
SetExtendedstyle(LVS_EX_FLATSB
????????????|LVS_EX_FULLROWSELECT
????????????|LVS_EX_HEADERDRAGDROP
????????????|LVS_EX_ONECLICKACTIVATE
????????????|LVS_EX_GRIDLINES);
//我加的
/* InsertColumn(0“序號(hào)“LVCFMT_CENTER);
????????InsertColumn(1“列名1“LVCFMT_CENTER);
????????InsertColumn(2“列名2“LVCFMT_CENTER);
????????InsertColumn(3“列名3“LVCFMT_CENTER);
SetColumnWidth(050);
????????SetColumnWidth(180);
????????SetColumnWidth(285);
????????SetColumnWidth(390);*/
/*CEdit?edit;*/
edit.Create(WS_CHILD|WS_CLIPSIBLINGS|WS_EX_TOOLWINDOW|WS_BORDERCRect(01010020)this1001);
CListCtrl::PreSubclassWindow();
????
}
void?CGridList::OnLButtonDown(UINT?nFlags?CPoint?point)?
{
//?TODO:?Add?your?message?handler?code?here?and/or?call?default
CListCtrl::OnLButtonDown(nFlags?point);
LVHITTESTINFO?info;
info.pt=point;
info.flags=LVHT_ONITEMLABEL;
int?nItem=SubItemHitTest(&info);?
if(nItem>=0&&info.iSubItem>0)
{
????row=info.iItem;
col=info.iSubItem;
this->ShowEdit();
}
}
/*void?CGridList::ShowEdit()
{
????CRect?rect;
GetSubItemRect(rowcolLVIR_LABELrect);
CString?str;
str=GetItemText(rowcol);
edit.MoveWindow(rect);
edit.SetWindowText(str);
edit.ShowWindow(SW_SHOW);
edit.SetSel(0100);
edit.SetFocus();
UpdateWindow();
}*/
BOOL?CGridList::DisposeEdit()
{
?????CString?sLabel;
?edit.GetWindowText(sLabel);
?this->SetItemText(rowcolsLabel);
?int?nHead?=?this->GetHeaderCtrl()->GetItemCount();
?int?nItem=this->GetItemCount();
?edit.ShowWindow(SW_HIDE);
?::SendMessage(this->GetParent()->GetSafeHwnd()NULLNULLNULL);
?return?TRUE;
}
void?CGridList::ShowEdit()
{
????CRect?rect;
GetSubItemRect(rowcolLVIR_LABELrect);
CString?str;
str=GetItemText(rowcol);
edit.MoveWindow(rect);
edit.SetWindowText(str);
edit.ShowWindow(SW_SHOW);
edit.SetSel(0100);
edit.SetFocus();
UpdateWindow();
}
//DEL?BOOL?CGridList::OnCommand(WPARAM?wParam?LPARAM?lParam)?
//DEL?{
//DEL? //?TODO:?Add?your?specialized?code?here?and/or?call?the?base?class
//DEL?
//DEL? return?CListCtrl::OnCommand(wParam?lParam);
//DEL?}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????19706??2014-07-04?20:03??ListControl\Debug\GridList.obj
?????文件?????110663??2014-07-15?09:57??ListControl\Debug\ListControl.exe
?????文件?????413396??2014-07-15?09:57??ListControl\Debug\ListControl.ilk
?????文件??????13947??2014-06-30?15:20??ListControl\Debug\ListControl.obj
?????文件????5499036??2014-06-11?08:43??ListControl\Debug\ListControl.pch
?????文件?????418816??2014-07-15?09:57??ListControl\Debug\ListControl.pdb
?????文件???????2580??2014-07-15?09:57??ListControl\Debug\ListControl.res
?????文件??????32447??2014-06-30?15:34??ListControl\Debug\ListControlDlg.obj
?????文件???????9870??2014-06-11?23:33??ListControl\Debug\ListEdit.obj
?????文件?????105497??2014-06-11?08:43??ListControl\Debug\StdAfx.obj
?????文件?????214016??2014-07-15?09:57??ListControl\Debug\vc60.idb
?????文件?????372736??2014-07-04?20:03??ListControl\Debug\vc60.pdb
?????文件???????3007??2014-07-04?20:03??ListControl\GridList.cpp
?????文件???????1288??2014-06-11?23:31??ListControl\GridList.h
?????文件??????35560??2014-07-15?09:57??ListControl\ListControl.aps
?????文件???????1495??2014-07-15?09:59??ListControl\ListControl.clw
?????文件???????2133??2014-06-11?08:30??ListControl\ListControl.cpp
?????文件???????4505??2014-06-11?10:47??ListControl\ListControl.dsp
?????文件????????530??2014-06-11?08:30??ListControl\ListControl.dsw
?????文件???????1379??2014-06-11?16:16??ListControl\ListControl.h
?????文件??????66560??2014-07-15?09:59??ListControl\ListControl.ncb
?????文件??????56832??2014-07-15?09:59??ListControl\ListControl.opt
?????文件????????925??2014-07-15?09:57??ListControl\ListControl.plg
?????文件???????5422??2014-07-15?09:57??ListControl\ListControl.rc
?????文件???????6237??2014-06-30?15:34??ListControl\ListControlDlg.cpp
?????文件???????1428??2014-06-30?15:18??ListControl\ListControlDlg.h
?????文件???????1173??2014-06-11?10:50??ListControl\ListEdit.cpp
?????文件???????1111??2014-06-11?10:50??ListControl\ListEdit.h
?????文件???????3669??2014-06-11?08:30??ListControl\ReadMe.txt
?????文件???????1078??2014-06-11?08:30??ListControl\res\ListControl.ico
............此處省略10個(gè)文件信息
評(píng)論
共有 條評(píng)論