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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? inplacelist.cpp

?? 我用Visual C++練習第三方組件GridCtrl
?? 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);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av综合一区| 亚洲欧美另类久久久精品2019| 精品国产电影一区二区| www国产亚洲精品久久麻豆| 国产三级一区二区三区| 亚洲色图一区二区三区| 亚洲1区2区3区4区| 久久国产夜色精品鲁鲁99| 国产成人精品一区二区三区网站观看 | 毛片基地黄久久久久久天堂| 国内精品伊人久久久久av一坑 | 中文字幕+乱码+中文字幕一区| 亚洲久草在线视频| 蜜臀av亚洲一区中文字幕| 懂色中文一区二区在线播放| 色综合久久久久综合99| 欧美巨大另类极品videosbest | 成人午夜在线免费| 在线免费观看一区| 26uuu久久天堂性欧美| 亚洲精品伦理在线| 久久激情五月激情| 一本一本大道香蕉久在线精品 | 久久99国产精品久久| 色综合欧美在线视频区| 久久久99精品免费观看不卡| 亚洲成人久久影院| 成人免费视频app| 日韩一区二区在线看片| 亚洲欧美日韩中文字幕一区二区三区| 美女视频黄免费的久久 | 亚洲美女视频在线观看| 精品一区二区在线播放| 欧美在线free| 国产精品久久久久毛片软件| 日本亚洲一区二区| 一本久道久久综合中文字幕| 欧美精品一区二区三区在线播放| 一区二区三区精品| 岛国精品一区二区| 制服丝袜亚洲播放| 一区二区三区欧美日| 丁香天五香天堂综合| 日韩三级av在线播放| 亚洲综合激情网| www.66久久| 久久奇米777| 免费一区二区视频| 欧美亚洲日本国产| 国产精品国产自产拍高清av王其| 狠狠色狠狠色合久久伊人| 欧美日本在线播放| 亚洲在线视频免费观看| 99视频精品全部免费在线| 久久久综合视频| 乱中年女人伦av一区二区| 欧美日韩你懂的| 樱桃视频在线观看一区| aaa国产一区| 另类小说一区二区三区| 欧美精品v国产精品v日韩精品 | jvid福利写真一区二区三区| 日韩精品资源二区在线| 午夜影院在线观看欧美| 欧美午夜电影一区| 亚洲精品一二三| 99久久精品费精品国产一区二区| 欧美激情中文字幕| 国产成人亚洲综合a∨猫咪| 精品国产百合女同互慰| 精品一区二区三区久久| 日韩精品资源二区在线| 天天操天天干天天综合网| 欧美日韩中文国产| 亚洲电影一级片| 欧美日本精品一区二区三区| 亚洲成a人片在线不卡一二三区| 色网站国产精品| 亚洲综合视频在线| 欧美久久久久久蜜桃| 午夜精品久久久久久久99水蜜桃| 欧美日韩精品欧美日韩精品| 亚洲成在人线在线播放| 在线不卡免费欧美| 免费人成黄页网站在线一区二区 | 激情综合一区二区三区| 精品欧美一区二区三区精品久久| 极品少妇一区二区三区精品视频 | 韩国精品免费视频| 精品国产一区二区三区久久影院| 蜜乳av一区二区| 2020日本不卡一区二区视频| 国产美女娇喘av呻吟久久| 国产日韩欧美不卡在线| www.99精品| 亚洲成人自拍网| 欧美一区二区精品在线| 精品在线免费观看| 国产精品日产欧美久久久久| 99re8在线精品视频免费播放| 亚洲一区二区四区蜜桃| 欧美一区二区三区性视频| 激情综合网最新| 国产精品第五页| 欧洲国内综合视频| 日本一不卡视频| 国产精品免费久久久久| 91官网在线免费观看| 丝瓜av网站精品一区二区| 欧美精品一区二区久久久| 不卡区在线中文字幕| 亚洲成人免费观看| 久久综合色8888| 91美女在线看| 奇米一区二区三区| 国产精品视频九色porn| 欧美日韩一区国产| 激情综合色综合久久综合| 自拍av一区二区三区| 7777精品伊人久久久大香线蕉最新版 | 欧美天堂亚洲电影院在线播放| 男女激情视频一区| 国产精品嫩草影院com| 欧美撒尿777hd撒尿| 国产乱人伦偷精品视频不卡| 亚洲欧美视频一区| 精品女同一区二区| av一区二区不卡| 另类人妖一区二区av| 亚洲人成网站色在线观看| 欧美大片一区二区| 色婷婷香蕉在线一区二区| 激情欧美一区二区三区在线观看| 亚洲三级电影网站| 欧美成人一区二区三区片免费| 色综合久久88色综合天天6| 久久er精品视频| 亚洲一区二区欧美日韩| 久久综合狠狠综合久久综合88 | 日韩经典一区二区| 国产精品国产三级国产普通话蜜臀 | 国产日韩欧美在线一区| 欧美日韩国产成人在线免费| 国产不卡视频一区二区三区| 日韩激情视频网站| 亚洲男人的天堂av| 久久精品无码一区二区三区| 欧美电影在线免费观看| jizz一区二区| 久久99精品久久久久久国产越南| 一二三区精品福利视频| 中文成人av在线| 精品国产髙清在线看国产毛片| 欧美性猛交xxxxxx富婆| 99久久综合国产精品| 国产一区 二区 三区一级| 日韩电影免费一区| 亚洲影院理伦片| 亚洲视频每日更新| 中文字幕成人av| 久久久久久久网| 欧美一区二区三区在| 欧美三级在线视频| 色综合久久中文字幕综合网| eeuss国产一区二区三区| 国产一区福利在线| 麻豆极品一区二区三区| 日韩av一区二区在线影视| 亚洲综合一区二区精品导航| 亚洲嫩草精品久久| 中文字幕在线不卡视频| 国产精品视频线看| 欧美韩国日本一区| 久久久精品免费网站| 337p日本欧洲亚洲大胆精品| 日韩欧美一级二级| 欧美一级日韩一级| 91精品国产麻豆| 91精品免费在线| 91精品国产综合久久精品麻豆 | 亚洲成av人片在www色猫咪| 成人91在线观看| 欧美经典一区二区| 国产目拍亚洲精品99久久精品| 久久中文娱乐网| 久久久综合精品| 中文字幕欧美区| 中文字幕一区二区三区不卡在线| 中文久久乱码一区二区| 综合久久给合久久狠狠狠97色| 视频一区视频二区中文字幕| 久久久久久久久久电影| 久久这里只有精品首页| 久久久久99精品一区| 国产欧美精品国产国产专区| 中文字幕欧美激情| 国产精品成人一区二区三区夜夜夜| 国产91丝袜在线18| 视频一区二区国产| 麻豆91在线看|