亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? inplacelist.cpp

?? 這是書上的代碼
?? CPP
字號:
// InPlaceList.cpp : implementation file
//
// Written by Chris Maunder <cmaunder@mail.com>
// Copyright (c) 1998-2000. All Rights Reserved.
//
// The code contained in this file is based on the original
// CInPlaceList from http://www.codeguru.com/listview
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is 
// not sold for profit without the authors written consent, and 
// providing that this notice and the authors name is included. If 
// the source code in  this file is used in any commercial application 
// then acknowledgement must be made to the author of this file 
// (in whatever form you wish).
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability for any damage/loss of business that
// this product may cause.
//
// Expect bugs!
// 
// Please use and enjoy. Please let me know of any bugs/mods/improvements 
// that you have found/implemented and I will fix/incorporate them into this
// file. 
//
// 6 Aug 1998 - Added CComboEdit to subclass the edit control - code provided by 
//              Roelf Werkman <rdw@inn.nl>. Added nID to the constructor param list.
// 29 Nov 1998 - bug fix in onkeydown (Markus Irtenkauf)
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "InPlaceList.h"

#include "GridCtrl.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


/////////////////////////////////////////////////////////////////////////////
// CComboEdit

CComboEdit::CComboEdit()
{
}

CComboEdit::~CComboEdit()
{
}

// Stoopid win95 accelerator key problem workaround - Matt Weagle.
BOOL CComboEdit::PreTranslateMessage(MSG* pMsg) 
{
	// Make sure that the keystrokes continue to the appropriate handlers
	if (pMsg->message == WM_KEYDOWN || pMsg->message == WM_KEYUP)
	{
		::TranslateMessage(pMsg);
		::DispatchMessage(pMsg);
		return TRUE;
	}	

	// Catch the Alt key so we don't choke if focus is going to an owner drawn button
	if (pMsg->message == WM_SYSCHAR)
		return TRUE;

	return CEdit::PreTranslateMessage(pMsg);
}

BEGIN_MESSAGE_MAP(CComboEdit, CEdit)
	//{{AFX_MSG_MAP(CComboEdit)
	ON_WM_KILLFOCUS()
	ON_WM_KEYDOWN()
	ON_WM_KEYUP()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CComboEdit message handlers

void CComboEdit::OnKillFocus(CWnd* pNewWnd) 
{
	CEdit::OnKillFocus(pNewWnd);
	
    CInPlaceList* pOwner = (CInPlaceList*) GetOwner();  // This MUST be a CInPlaceList
    if (pOwner)
        pOwner->EndEdit();	
}

void CComboEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	if ((nChar == VK_PRIOR || nChar == VK_NEXT ||
		 nChar == VK_DOWN  || nChar == VK_UP   ||
		 nChar == VK_RIGHT || nChar == VK_LEFT) &&
		(GetKeyState(VK_CONTROL) < 0 && GetDlgCtrlID() == IDC_COMBOEDIT))
    {
        CWnd* pOwner = GetOwner();
        if (pOwner)
            pOwner->SendMessage(WM_KEYDOWN, nChar, nRepCnt+ (((DWORD)nFlags)<<16));
        return;
    }

	CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
}

void CComboEdit::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	if (nChar == VK_ESCAPE) 
	{
        CWnd* pOwner = GetOwner();
        if (pOwner)
            pOwner->SendMessage(WM_KEYUP, nChar, nRepCnt + (((DWORD)nFlags)<<16));
        return;
    }

	if (nChar == VK_TAB || nChar == VK_RETURN || nChar == VK_ESCAPE)
    {
        CWnd* pOwner = GetOwner();
        if (pOwner)
            pOwner->SendMessage(WM_KEYUP, nChar, nRepCnt + (((DWORD)nFlags)<<16));
        return;
    }

	CEdit::OnKeyUp(nChar, nRepCnt, nFlags);
}


/////////////////////////////////////////////////////////////////////////////
// CInPlaceList

CInPlaceList::CInPlaceList(CWnd* pParent, CRect& rect, DWORD dwStyle, UINT nID,
                           int nRow, int nColumn, 
						   CStringArray& Items, CString sInitText, 
						   UINT nFirstChar)
{
	m_nNumLines = 4;
	m_sInitText = sInitText;
 	m_nRow		= nRow;
 	m_nCol      = nColumn;
 	m_nLastChar = 0; 
	m_bExitOnArrows = FALSE; //(nFirstChar != VK_LBUTTON);	// If mouse click brought us here,

	// Create the combobox
 	DWORD dwComboStyle = WS_BORDER|WS_CHILD|WS_VISIBLE|WS_VSCROLL|
 					     CBS_AUTOHSCROLL | dwStyle;
	int nHeight = rect.Height();
	rect.bottom = rect.bottom + m_nNumLines*nHeight + ::GetSystemMetrics(SM_CYHSCROLL);
	if (!Create(dwComboStyle, rect, pParent, nID)) return;

	// Add the strings
	for (int i = 0; i < Items.GetSize(); i++) 
		AddString(Items[i]);

	// Get the maximum width of the text strings
	int nMaxLength = 0;
	CClientDC dc(GetParent());
	CFont* pOldFont = dc.SelectObject(pParent->GetFont());

	for (i = 0; i < Items.GetSize(); i++) 
		nMaxLength = max(nMaxLength, dc.GetTextExtent(Items[i]).cx);

	nMaxLength += (::GetSystemMetrics(SM_CXVSCROLL) + dc.GetTextExtent(_T(" ")).cx*2);
	dc.SelectObject(pOldFont);

    if (nMaxLength > rect.Width())
	    rect.right = rect.left + nMaxLength;

	// Resize the edit window and the drop down window
	MoveWindow(rect);

	SetFont(pParent->GetFont());
	SetItemHeight(-1, nHeight);

	SetDroppedWidth(nMaxLength);
	SetHorizontalExtent(0); // no horz scrolling

	// Set the initial text to m_sInitText
	if (SelectString(-1, m_sInitText) == CB_ERR) 
		SetWindowText(m_sInitText);		// No text selected, so restore what was there before

    // Subclass the combobox edit control if style includes CBS_DROPDOWN
    if ((dwStyle & CBS_DROPDOWNLIST) != CBS_DROPDOWNLIST)
    {
        m_edit.SubclassDlgItem(IDC_COMBOEDIT, this);
 	    SetFocus();
        switch (nFirstChar)
        {
            case VK_LBUTTON: 
            case VK_RETURN:   m_edit.SetSel((int)_tcslen(m_sInitText), -1); return;
            case VK_BACK:     m_edit.SetSel((int)_tcslen(m_sInitText), -1); break;
            case VK_DOWN: 
            case VK_UP:   
            case VK_RIGHT:
            case VK_LEFT:  
            case VK_NEXT:  
            case VK_PRIOR: 
            case VK_HOME:  
            case VK_END:      m_edit.SetSel(0,-1); return;
            default:          m_edit.SetSel(0,-1);
        }
        SendMessage(WM_CHAR, nFirstChar);
    }
    else
 	    SetFocus();
}

CInPlaceList::~CInPlaceList()
{
}

void CInPlaceList::EndEdit()
{
    CString str;
    GetWindowText(str);
 
    // Send Notification to parent
    GV_DISPINFO dispinfo;

    dispinfo.hdr.hwndFrom = GetSafeHwnd();
    dispinfo.hdr.idFrom   = GetDlgCtrlID();
    dispinfo.hdr.code     = GVN_ENDLABELEDIT;
 
    dispinfo.item.mask    = LVIF_TEXT|LVIF_PARAM;
    dispinfo.item.row     = m_nRow;
    dispinfo.item.col     = m_nCol;
    dispinfo.item.strText = str;
    dispinfo.item.lParam  = (LPARAM) m_nLastChar; 
 
    CWnd* pOwner = GetOwner();
    if (IsWindow(pOwner->GetSafeHwnd()))
        pOwner->SendMessage(WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&dispinfo );
 
    // Close this window (PostNcDestroy will delete this)
    PostMessage(WM_CLOSE, 0, 0);
}

void CInPlaceList::PostNcDestroy() 
{
	CComboBox::PostNcDestroy();

	delete this;
}

BEGIN_MESSAGE_MAP(CInPlaceList, CComboBox)
	//{{AFX_MSG_MAP(CInPlaceList)
	ON_WM_KILLFOCUS()
	ON_WM_KEYDOWN()
	ON_WM_KEYUP()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CInPlaceList message handlers

void CInPlaceList::OnKillFocus(CWnd* pNewWnd) 
{
	CComboBox::OnKillFocus(pNewWnd);

	if (GetSafeHwnd() == pNewWnd->GetSafeHwnd())
        return;

    // Only end editing on change of focus if we're using the CBS_DROPDOWNLIST style
    if ((GetStyle() & CBS_DROPDOWNLIST) == CBS_DROPDOWNLIST)
        EndEdit();
}

// If an arrow key (or associated) is pressed, then exit if
//  a) The Ctrl key was down, or
//  b) m_bExitOnArrows == TRUE
void CInPlaceList::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	if ((nChar == VK_PRIOR || nChar == VK_NEXT ||
		 nChar == VK_DOWN  || nChar == VK_UP   ||
		 nChar == VK_RIGHT || nChar == VK_LEFT) &&
		(m_bExitOnArrows || GetKeyState(VK_CONTROL) < 0))
	{
		m_nLastChar = nChar;
		GetParent()->SetFocus();
		return;
	}

	CComboBox::OnKeyDown(nChar, nRepCnt, nFlags);
}

// Need to keep a lookout for Tabs, Esc and Returns.
void CInPlaceList::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	if (nChar == VK_ESCAPE) 
		SetWindowText(m_sInitText);	// restore previous text

	if (nChar == VK_TAB || nChar == VK_RETURN || nChar == VK_ESCAPE)
	{
		m_nLastChar = nChar;
		GetParent()->SetFocus();	// This will destroy this window
		return;
	}

	CComboBox::OnKeyUp(nChar, nRepCnt, nFlags);
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆欧美日韩一区| 亚洲一区二区三区小说| 久久久久久麻豆| 国产精品天干天干在观线| 亚洲欧美另类小说视频| 天使萌一区二区三区免费观看| 麻豆国产精品视频| 色综合久久88色综合天天免费| 欧美人与禽zozo性伦| 久久久.com| 亚洲第四色夜色| 成人免费高清视频在线观看| 欧美日韩国产美| 日韩av一区二| 欧美伊人久久久久久久久影院| 久久综合成人精品亚洲另类欧美 | 免费观看91视频大全| hitomi一区二区三区精品| 337p亚洲精品色噜噜噜| 国产最新精品精品你懂的| 色综合久久综合| 亚洲高清视频在线| 色八戒一区二区三区| 中文字幕精品一区二区三区精品| 日日夜夜免费精品| 欧美精品一区在线观看| 亚洲h动漫在线| 欧美va亚洲va香蕉在线| 免费成人结看片| 久久久久久久久久电影| 91麻豆福利精品推荐| 亚洲欧美综合色| 成人免费福利片| 亚洲成av人片在线观看| 久久久久久久久岛国免费| 91成人看片片| 日本中文一区二区三区| 中文字幕色av一区二区三区| 欧美日韩极品在线观看一区| 国产原创一区二区三区| 有坂深雪av一区二区精品| 日本韩国一区二区三区| 韩国三级电影一区二区| 亚洲精品一二三| 欧美大白屁股肥臀xxxxxx| 另类人妖一区二区av| 日韩精品中文字幕在线一区| 色综合久久久久综合体桃花网| 久久99精品久久久久久久久久久久| 欧美视频在线不卡| 成人综合日日夜夜| 日本成人中文字幕在线视频| 亚洲品质自拍视频| 亚洲精品在线电影| 欧美丰满嫩嫩电影| 日本aⅴ免费视频一区二区三区| 国产精品免费观看视频| 精品国产露脸精彩对白| 欧美日韩午夜在线| 久久国产福利国产秒拍| 亚洲国产成人va在线观看天堂| 国产午夜精品一区二区三区嫩草 | 国产综合色在线视频区| 亚洲成av人片| 一区二区三区四区不卡在线| 欧美二区三区的天堂| 色综合天天综合色综合av| 亚洲成人你懂的| 亚洲欧美一区二区三区孕妇| 国产精品情趣视频| 欧美白人最猛性xxxxx69交| 欧美人妇做爰xxxⅹ性高电影| 91麻豆产精品久久久久久| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 欧美一区二区三区婷婷月色| 狠狠色狠狠色综合日日91app| 视频一区中文字幕国产| 亚洲午夜羞羞片| 亚洲欧美日韩国产综合在线| 国产欧美精品区一区二区三区| 色吊一区二区三区| 色哟哟亚洲精品| 91蜜桃在线观看| 91免费观看视频| av影院午夜一区| 成人av电影免费在线播放| 丝袜美腿亚洲一区二区图片| 亚洲亚洲人成综合网络| 亚洲最新视频在线观看| 一区二区高清视频在线观看| 亚洲精品免费一二三区| 夜夜揉揉日日人人青青一国产精品| 亚洲免费在线看| 亚洲综合一区二区三区| 亚洲宅男天堂在线观看无病毒| 亚洲一区二区三区四区五区黄 | 亚洲国产一区二区在线播放| 亚洲激情自拍视频| 亚洲成人免费看| 蜜桃视频在线一区| 国产一区二区三区在线观看精品 | 亚洲成人免费电影| 日本aⅴ精品一区二区三区| 免费在线观看一区| 国产在线视频一区二区| 成人免费观看视频| 在线亚洲人成电影网站色www| 日本aⅴ免费视频一区二区三区 | 色呦呦日韩精品| 欧美视频一区二区在线观看| 777午夜精品免费视频| 久久久久久久精| 自拍偷拍国产精品| 一区二区三区四区乱视频| 亚洲一区二区三区四区五区中文| 精品88久久久久88久久久| 国产欧美一区二区三区沐欲| 国产精品福利一区二区三区| 精品国产乱码久久久久久老虎| 国产亚洲精品精华液| 国产精品精品国产色婷婷| 婷婷激情综合网| 亚洲午夜激情av| 国产精品一线二线三线| 久久99久久99小草精品免视看| 丁香一区二区三区| 国产在线精品不卡| 色视频欧美一区二区三区| 91麻豆精品久久久久蜜臀| 中文字幕av不卡| 免费在线视频一区| 色激情天天射综合网| 26uuuu精品一区二区| 亚洲香肠在线观看| 国产91在线观看丝袜| 欧美色成人综合| 中文字幕在线观看一区| 日本成人超碰在线观看| 91网站在线播放| www欧美成人18+| 婷婷成人综合网| 91蝌蚪porny| 久久婷婷国产综合国色天香| 污片在线观看一区二区| 不卡欧美aaaaa| 精品国产乱码久久久久久免费| 亚洲高清免费观看 | 国产精品18久久久久久久网站| 欧美性视频一区二区三区| 国产欧美日韩另类一区| 久久国产精品无码网站| 欧美电影在哪看比较好| 一区二区三区四区不卡视频 | 国产精品久久久久久久久免费桃花| 欧美aaaaaa午夜精品| 欧美视频一区二区三区四区| 国产婷婷色一区二区三区| 美国毛片一区二区三区| 制服.丝袜.亚洲.另类.中文 | 国产日韩欧美a| 久久99久久久久| 欧美日韩欧美一区二区| 一区二区三区精品在线| 91视频你懂的| 成人免费在线播放视频| www.在线成人| 中文字幕第一区二区| 国产一区二区不卡| 久久久噜噜噜久久人人看| 奇米精品一区二区三区在线观看| 欧美唯美清纯偷拍| 亚洲一二三四久久| 欧美色图一区二区三区| 一区二区三区免费观看| 欧洲精品视频在线观看| 一区二区视频免费在线观看| 一本到高清视频免费精品| 亚洲手机成人高清视频| 一本一本大道香蕉久在线精品| 亚洲精品一二三四区| 欧美中文字幕一区二区三区| 亚洲一区二区三区影院| 欧美电影一区二区| 久久66热偷产精品| 久久久影视传媒| av资源站一区| 亚洲综合色噜噜狠狠| 欧美高清激情brazzers| 日本不卡不码高清免费观看| 精品日韩av一区二区| 国产精品99久久久久久宅男| 中文字幕 久热精品 视频在线 | 蜜臀av一区二区在线观看| 精品国产乱子伦一区| 国产成人精品午夜视频免费| 国产精品麻豆欧美日韩ww| 色噜噜狠狠成人网p站| 日韩精品国产欧美| 久久先锋影音av| 99精品国产一区二区三区不卡|