📄 presetwindowinglc.cpp
字号:
// PresetWindowingLC.cpp : implementation file//#include "stdafx.h"#include "fusion.h"#include "PresetWindowingLC.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// RxPresetWindowingLCRxPresetWindowingLC::RxPresetWindowingLC(){}RxPresetWindowingLC::~RxPresetWindowingLC(){}BEGIN_MESSAGE_MAP(RxPresetWindowingLC, CListCtrl) //{{AFX_MSG_MAP(RxPresetWindowingLC) ON_WM_LBUTTONDOWN() //}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// RxPresetWindowingLC message handlersvoid RxPresetWindowingLC::OnLButtonDown(UINT nFlags, CPoint point) { // save focus item, before mouse button down int iOldFocus = GetNextItem(-1, LVNI_FOCUSED); CListCtrl::OnLButtonDown(nFlags, point); // save focus item, after mouse button down int iNewFocus = GetNextItem(-1, LVNI_FOCUSED); // check double click if(iOldFocus == iNewFocus) { // Get Row Number(0 Base) LVHITTESTINFO ht; ht.pt = point; ListView_SubItemHitTest(m_hWnd, &ht); if(ht.iItem < 0 || ht.iSubItem < 0) return; // 急琶等 Cell俊 措茄 Rect蔼阑 掘绢柯促. 0 拿烦狼 蔼篮 促弗 规过栏肺 掘绢具茄促. CRect rcCell; UINT nStyle; if(ht.iSubItem == 0) { int iWidth = GetColumnWidth(0); GetSubItemRect(ht.iItem, 1, LVIR_BOUNDS, rcCell); rcCell.right = rcCell.left; rcCell.left = rcCell.left - iWidth; nStyle = WS_CHILD|WS_VISIBLE|WS_BORDER|ES_AUTOHSCROLL|ES_LEFT; } else { GetSubItemRect(ht.iItem, ht.iSubItem, LVIR_BOUNDS, rcCell); nStyle = WS_CHILD|WS_VISIBLE|WS_BORDER|ES_AUTOHSCROLL|ES_RIGHT; } rcCell.top -= 3; RxListCtrlEditBox *pEdit = new RxListCtrlEditBox; pEdit->SetListCtrlInfo(ht.iItem, ht.iSubItem, GetItemText(ht.iItem, ht.iSubItem)); pEdit->Create(nStyle, rcCell, this, ID_LISTCTRL_EDITBOX); } CListCtrl::OnLButtonDown(nFlags, point);}// 俊叼飘 祈笼吝俊 庆歹狼 农扁甫 函版且版快 碍力肺 器目胶甫 化绢柯促// Prevent column resizing - Zafir Anjum (1998/08/06)BOOL RxPresetWindowingLC::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { switch (((NMHDR*)lParam)->code) { case HDN_BEGINTRACKW: case HDN_BEGINTRACKA: if(::GetFocus() != GetSafeHwnd()) ::SetFocus(GetSafeHwnd()); break; case LISTCTRL_CHANGED : GetParent()->SendMessage(WM_NOTIFY, wParam, lParam); return TRUE; } return CListCtrl::OnNotify(wParam, lParam, pResult);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -