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

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

?? inplaceedit.cpp

?? 這是書上的代碼
?? CPP
字號:
// InPlaceEdit.cpp : implementation file
//
// Adapted by Chris Maunder <cmaunder@mail.com>
// Copyright (c) 1998-2000. All Rights Reserved.
//
// The code contained in this file is based on the original
// CInPlaceEdit from http://www.codeguru.com/listview/edit_subitems.shtml
//
// 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 and all copyright 
// notices remains intact. 
//
// An email letting me know how you are using it would be nice as well. 
//
// 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.
//
// For use with CGridCtrl v2.10
//
// History:
//         10 May 1998  Uses GVN_ notifications instead of LVN_,
//                      Sends notification messages to the parent, 
//                      instead of the parent's parent.
//         15 May 1998  There was a problem when editing with the in-place editor, 
//                      there arises a general protection fault in user.exe, with a 
//                      few qualifications:
//                         (1) This only happens with owner-drawn buttons;
//                         (2) This only happens in Win95
//                         (3) This only happens if the handler for the button does not 
//                             create a new window (even an AfxMessageBox will avoid the 
//                             crash)
//                         (4) This will not happen if Spy++ is running.
//                      PreTranslateMessage was added to route messages correctly.
//                      (Matt Weagle found and fixed this problem)
//         26 Jul 1998  Removed the ES_MULTILINE style - that fixed a few probs!
//          6 Aug 1998  Added nID to the constructor param list
//          6 Sep 1998  Space no longer clears selection when starting edit (Franco Bez)
//         10 Apr 1999  Enter, Tab and Esc key prob fixed (Koay Kah Hoe)
//                      Workaround for bizzare "shrinking window" problem in CE
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "TCHAR.h"
#include "InPlaceEdit.h"

#include "GridCtrl.h"

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

/////////////////////////////////////////////////////////////////////////////
// CInPlaceEdit

CInPlaceEdit::CInPlaceEdit(CWnd* pParent, CRect& rect, DWORD dwStyle, UINT nID,
                           int nRow, int nColumn, CString sInitText, 
                           UINT nFirstChar)
{
    m_sInitText     = sInitText;
    m_nRow          = nRow;
    m_nColumn       = nColumn;
    m_nLastChar     = 0; 
    m_bExitOnArrows = (nFirstChar != VK_LBUTTON);    // If mouse click brought us here,
                                                     // then no exit on arrows

    m_Rect = rect;  // For bizarre CE bug.
    
    DWORD dwEditStyle = WS_BORDER|WS_CHILD|WS_VISIBLE| ES_AUTOHSCROLL //|ES_MULTILINE
        | dwStyle;
    if (!Create(dwEditStyle, rect, pParent, nID)) return;
    
    SetFont(pParent->GetFont());
    
    SetWindowText(sInitText);
    SetFocus();
    
    switch (nFirstChar){
        case VK_LBUTTON: 
        case VK_RETURN:   SetSel((int)_tcslen(m_sInitText), -1); return;
        case VK_BACK:     SetSel((int)_tcslen(m_sInitText), -1); break;
        case VK_TAB:
        case VK_DOWN: 
        case VK_UP:   
        case VK_RIGHT:
        case VK_LEFT:  
        case VK_NEXT:  
        case VK_PRIOR: 
        case VK_HOME:
        case VK_SPACE:
        case VK_END:      SetSel(0,-1); return;
        default:          SetSel(0,-1);
    }
    
    SendMessage(WM_CHAR, nFirstChar);
}

CInPlaceEdit::~CInPlaceEdit()
{
}

BEGIN_MESSAGE_MAP(CInPlaceEdit, CEdit)
    //{{AFX_MSG_MAP(CInPlaceEdit)
    ON_WM_KILLFOCUS()
    ON_WM_CHAR()
    ON_WM_KEYDOWN()
    ON_WM_GETDLGCODE()
    ON_WM_CREATE()
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

////////////////////////////////////////////////////////////////////////////
// CInPlaceEdit message handlers

// If an arrow key (or associated) is pressed, then exit if
//  a) The Ctrl key was down, or
//  b) m_bExitOnArrows == TRUE
void CInPlaceEdit::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;
    }
    
    CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
}

// As soon as this edit loses focus, kill it.
void CInPlaceEdit::OnKillFocus(CWnd* pNewWnd)
{
    CEdit::OnKillFocus(pNewWnd);
    EndEdit();
}

void CInPlaceEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
    if (nChar == VK_TAB || nChar == VK_RETURN)
    {
        m_nLastChar = nChar;
        GetParent()->SetFocus();    // This will destroy this window
        return;
    }
    if (nChar == VK_ESCAPE) 
    {
        SetWindowText(m_sInitText);    // restore previous text
        m_nLastChar = nChar;
        GetParent()->SetFocus();
        return;
    }
    
    CEdit::OnChar(nChar, nRepCnt, nFlags);
    
    // Resize edit control if needed
    
    // Get text extent
    CString str;
    GetWindowText( str );

    // add some extra buffer
    str += _T("  ");
    
    CWindowDC dc(this);
    CFont *pFontDC = dc.SelectObject(GetFont());
    CSize size = dc.GetTextExtent( str );
    dc.SelectObject( pFontDC );
       
    // Get client rect
    CRect ParentRect;
    GetParent()->GetClientRect( &ParentRect );
    
    // Check whether control needs to be resized
    // and whether there is space to grow
    if (size.cx > m_Rect.Width())
    {
        if( size.cx + m_Rect.left < ParentRect.right )
            m_Rect.right = m_Rect.left + size.cx;
        else
            m_Rect.right = ParentRect.right;
        MoveWindow( &m_Rect );
    }
}

UINT CInPlaceEdit::OnGetDlgCode() 
{
    return DLGC_WANTALLKEYS;
}

////////////////////////////////////////////////////////////////////////////
// CInPlaceEdit overrides

// Stoopid win95 accelerator key problem workaround - Matt Weagle.
BOOL CInPlaceEdit::PreTranslateMessage(MSG* pMsg) 
{
    // 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 CWnd::PreTranslateMessage(pMsg);
}

// Auto delete
void CInPlaceEdit::PostNcDestroy() 
{
    CEdit::PostNcDestroy();
    
    delete this;	
}

////////////////////////////////////////////////////////////////////////////
// CInPlaceEdit implementation

void CInPlaceEdit::EndEdit()
{
    CString str;

    // EFW - BUG FIX - Clicking on a grid scroll bar in a derived class
    // that validates input can cause this to get called multiple times
    // causing assertions because the edit control goes away the first time.
    static BOOL bAlreadyEnding = FALSE;

    if(bAlreadyEnding)
        return;

    bAlreadyEnding = TRUE;
    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_nColumn;
    dispinfo.item.strText  = str;
    dispinfo.item.lParam  = (LPARAM) m_nLastChar;

    CWnd* pOwner = GetOwner();
    if (pOwner)
        pOwner->SendMessage(WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&dispinfo );

    // Close this window (PostNcDestroy will delete this)
    PostMessage(WM_CLOSE, 0, 0);
    bAlreadyEnding = FALSE;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av亚洲一区中文字幕| 欧美老肥妇做.爰bbww视频| 日韩电影在线一区二区| 一区二区三区国产| 亚洲精品午夜久久久| 亚洲图片有声小说| 国产精品久久久爽爽爽麻豆色哟哟 | 国产精品免费av| 精品成a人在线观看| 精品久久久久久久久久久久久久久 | 国产传媒一区在线| 国产精品主播直播| 国产电影一区二区三区| 丰满亚洲少妇av| 成人精品一区二区三区中文字幕 | 欧美精品一区男女天堂| 欧美精品一区二区三区很污很色的 | 欧美中文字幕亚洲一区二区va在线| 黑人巨大精品欧美黑白配亚洲| 九九视频精品免费| 粉嫩蜜臀av国产精品网站| 成人午夜在线播放| 色狠狠av一区二区三区| 欧美日韩综合一区| 久久影音资源网| 成人欧美一区二区三区小说| 亚洲午夜精品在线| 久久爱www久久做| bt7086福利一区国产| 欧美日韩一区视频| 精品日产卡一卡二卡麻豆| 国产精品午夜电影| 亚洲国产精品尤物yw在线观看| 视频一区二区三区中文字幕| 精彩视频一区二区三区| 《视频一区视频二区| 亚洲免费观看在线观看| 亚洲国产视频网站| 麻豆精品视频在线观看| 国产福利一区二区三区视频在线 | 狠狠色狠狠色综合日日91app| 精品一区中文字幕| 国产999精品久久久久久绿帽| 成人性生交大片免费看中文| 成人激情校园春色| 欧美亚洲国产一卡| 欧美一区二区视频在线观看 | 日本中文字幕一区二区有限公司| 日韩激情在线观看| 国产精品亚洲第一 | 国产欧美日本一区视频| 亚洲欧美怡红院| 三级欧美韩日大片在线看| 国产精选一区二区三区| 色偷偷久久一区二区三区| 3d动漫精品啪啪| 国产精品污www在线观看| 亚洲国产精品久久人人爱蜜臀 | 国产一区二区三区免费| 精品亚洲国产成人av制服丝袜| 国产一区美女在线| 欧美高清视频不卡网| 国产精品国产a级| 蜜桃视频在线观看一区| 91捆绑美女网站| 欧美精品一区二区三区四区| 一区二区理论电影在线观看| 国精产品一区一区三区mba视频| 色综合婷婷久久| 久久久久久久电影| 亚洲成a人片在线不卡一二三区| 国产精品99久| 欧美刺激脚交jootjob| 一区二区日韩av| www.在线成人| 久久久久久免费毛片精品| 亚洲美女精品一区| 国产精品一区免费在线观看| 91精品国产乱| 亚洲第一狼人社区| 99久久精品国产一区| 日韩片之四级片| 亚洲一本大道在线| 一本久道久久综合中文字幕| 日韩欧美另类在线| 天天av天天翘天天综合网| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 亚洲六月丁香色婷婷综合久久| 丝袜诱惑亚洲看片| 在线观看日韩精品| 亚洲女子a中天字幕| www.成人在线| 国产精品传媒入口麻豆| 国产成人免费在线观看| 精品福利一二区| 国内偷窥港台综合视频在线播放| 欧美一区二区大片| 日本不卡在线视频| 日韩一二在线观看| 美国一区二区三区在线播放| 欧美性生活大片视频| 亚洲午夜三级在线| 欧美性做爰猛烈叫床潮| 亚洲伦在线观看| 欧美午夜一区二区| 天堂蜜桃91精品| 日韩免费观看高清完整版| 久久国产福利国产秒拍| 久久婷婷色综合| 一本一道久久a久久精品| 国产精品成人免费精品自在线观看| 国产精品66部| 17c精品麻豆一区二区免费| 色婷婷国产精品久久包臀| 一区二区激情视频| 日韩精品中文字幕在线一区| 精品亚洲欧美一区| 国产精品乱码人人做人人爱| 99久久er热在这里只有精品66| 亚洲美女偷拍久久| 67194成人在线观看| 国产原创一区二区三区| 亚洲色图欧美在线| 欧美日韩色综合| 狠狠狠色丁香婷婷综合激情| 久久一留热品黄| 99re亚洲国产精品| 国产综合色视频| 亚洲女同ⅹxx女同tv| 欧美一区二区三区日韩| 国产成人精品aa毛片| 一区二区三区四区精品在线视频| 3atv在线一区二区三区| 国产不卡视频一区| 日韩和欧美的一区| 中文字幕精品一区二区精品绿巨人 | 69精品人人人人| 精品亚洲免费视频| 一区二区三区在线视频免费| 日韩精品一区国产麻豆| 91一区在线观看| 久久精品国产免费| 亚洲综合一二区| 国产三区在线成人av| 91麻豆精品国产91久久久久久 | 69堂亚洲精品首页| 懂色一区二区三区免费观看| 一级中文字幕一区二区| 2021国产精品久久精品| 欧美日韩午夜影院| 97国产精品videossex| 久99久精品视频免费观看| 久久久久久久久久久久久久久99 | 日韩一区二区三区免费看| 91亚洲精品乱码久久久久久蜜桃 | 成人av免费在线播放| 国产综合色产在线精品 | 免费看精品久久片| 国产精品青草综合久久久久99| 日韩一区二区三区四区| 91成人免费在线视频| 99视频精品全部免费在线| 国产盗摄女厕一区二区三区| 日本成人在线电影网| 亚洲综合成人在线视频| 国产精品女人毛片| 久久九九久精品国产免费直播| 欧美一区二区日韩| 91麻豆精品国产综合久久久久久| 欧美自拍偷拍午夜视频| 99九九99九九九视频精品| 成人午夜碰碰视频| 岛国av在线一区| 丰满白嫩尤物一区二区| 国产成人免费视频一区| 国产成人av一区二区| 成人在线视频首页| 国产精品77777竹菊影视小说| 狠狠色狠狠色综合系列| 国产二区国产一区在线观看| 国产精品 欧美精品| 国产精品996| av不卡在线观看| 盗摄精品av一区二区三区| 国产最新精品免费| 极品少妇一区二区三区精品视频| 韩国一区二区三区| 成人高清在线视频| 91视频你懂的| 欧美日韩国产高清一区二区三区| 欧美日韩一级视频| 欧美一区二区女人| 久久精品欧美一区二区三区麻豆| 亚洲国产经典视频| 亚洲主播在线观看| 蜜桃av噜噜一区二区三区小说| 韩国成人精品a∨在线观看| 麻豆精品一区二区| 国产成人免费在线观看不卡| 欧美色视频一区|