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

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

?? gridctrl.cpp

?? 股票軟件
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
// GridCtrl.cpp : implementation file
//
// MFC Grid Control v2.26
//
// Written by Chris Maunder <chris@codeproject.com>
// Copyright (c) 1998-2005. All Rights Reserved.
/
// The code contained in this file was based on the original
// WorldCom Grid control written by Joe Willcoxson,
//        mailto:chinajoe@aol.com
//        http://users.aol.com/chinajoe
// (These addresses may be out of date) The code has gone through 
// so many modifications that I'm not sure if there is even a single 
// original line of code. In any case Joe's code was a great 
// framework on which to build.
//
// 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.
//
// Expect bugs!
// 
// Please use and enjoy, and let me know of any bugs/mods/improvements 
// that you have found/implemented and I will fix/incorporate them into 
// this file. 
//
//  History:
//  --------
//  This control is constantly evolving, sometimes due to new features that I
//  feel are necessary, and sometimes due to existing bugs. Where possible I
//  have credited the changes to those who contributed code corrections or
//  enhancements (names in brackets) or code suggestions (suggested by...)
//
//          1.0 - 1.13   20 Feb 1998 - 6 May 1999
//                          First release version. Progressed from being a basic
//                          grid based on the original WorldCom Grid control
//                          written by Joe Willcoxson (mailto:chinajoe@aol.com,
//                          http://users.aol.com/chinajoe) to something a little
//                          more feature rich. Rewritten so many times I doubt
//                          there is a single line of Joe's code left. Many, many,
//                          MANY people sent in bug reports and fixes. Thank you
//                          all.
//
//          2.0         1 Feb 2000
//                          Rewritten to make the grid more object oriented, in
//                          that the CGridCell class now takes care of cell-specific
//                          tasks. This makes the code more robust, but more
//                          importantly it allows the simple insertion of other
//                          types of cells.
//                          
//          2.10       11 Mar 2000 - Ken Bertelson and Chris Maunder
//                          - Additions for virtual CGridCell support of embedded tree 
//                            & cell buttons implementation
//                          - Optional WYSIWYG printing
//                          - Awareness of hidden (0 width/height) rows and columns for 
//                            key movements,  cut, copy, paste, and autosizing
//                          - CGridCell can make title tips display any text rather than 
//                            cell text only
//                          - Minor vis bug fixes
//                          - CGridCtrl now works with CGridCellBase instead of CGridCell
//                            This is a taste of things to come.
//
//          2.20       30 Jul 2000 - Chris Maunder
//                          - Font storage optimised (suggested by Martin Richter)
//                          - AutoSizeColumn works on either column header, data or both
//                          - EnsureVisible. The saga continues... (Ken)
//                          - Rewrote exception handling
//                          - Added TrackFocusCell and FrameFocusCell properties, as well as
//                            ExpandLastColumn (suggested by Bruce E. Stemplewski).
//                          - InsertColumn now allows you to insert columns at the end of the
//                            column range (David Weibel)
//                          - Shift-cell-selection more intuitive
//                          - API change: Set/GetGridColor now Set/GetGridLineColor
//                          - API change: Set/GetBkColor now Set/GetGridBkColor
//                          - API change: Set/GetTextColor, Set/GetTextBkColor depricated 
//                          - API change: Set/GetFixedTextColor, Set/GetFixedBkColor depricated 
//                          - Stupid DDX_GridControl workaround removed.
//                          - Added "virtual mode" via Set/GetVirtualMode
//                          - Added SetCallbackFunc to allow callback functions in virtual mode
//                          - Added Set/GetAutoSizeStyle
//                          - AutoSize() bug fixed
//                          - added GVIS_FIXEDROW, GVIS_FIXEDCOL states
//                          - added Get/SetFixed[Row|Column]Selection
//                          - cell "Get" methods now const'd. Sorry folks...
//                          - GetMouseScrollLines now uses win98/W2K friendly code
//                          - WS_EX_CLIENTEDGE style now implicit
//
//                          [ Only the latest version and major version changes will be shown ]
////
//          2.25       13 Mar 2004 - Chris Maunder
//                                 - Minor changes so it will compile in VS.NET (inc. Whidbey)
//                                 - Fixed minor bug in EnsureVisible - Junlin Xu
//                                 - Changed AfxGetInstanceHandle for AfxGetResourceHandle in RegisterWindowClass
//					               - Various changes thanks to Yogurt
//
//          2.26       13 Dec 2005 - Pierre Couderc
//                                 - Added sort in Virtual mode
//                                 - Change row/column order programatically or via drag and drop
//                                 - Added save/restore layer (for undoing row/column order changes)
//
// TODO:   1) Implement sparse grids (super easy now)
//         2) Fix it so that as you drag select, the speed of selection increases
//            with time.
//         3) Scrolling is still a little dodgy (too much grey area). I know there
//            is a simple fix but it's been a low priority
//
// ISSUES: 1) WindowFromPoint seems to do weird things in W2K. Causing problems for
//            the rigt-click-on-titletip code.
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MemDC.h"
#include "GridCtrl.h"
#include <algorithm>

// OLE stuff for clipboard operations
#include <afxadv.h>            // For CSharedFile
#include <afxconv.h>           // For LPTSTR -> LPSTR macros

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

// Spit out some messages as a sanity check for programmers
#ifdef GRIDCONTROL_NO_TITLETIPS
#pragma message(" -- CGridCtrl: No titletips for cells with large data")
#endif
#ifdef GRIDCONTROL_NO_DRAGDROP
#pragma message(" -- CGridCtrl: No OLE drag and drop")
#endif
#ifdef GRIDCONTROL_NO_CLIPBOARD
#pragma message(" -- CGridCtrl: No clipboard support")
#endif
#ifdef GRIDCONTROL_NO_PRINTING
#pragma message(" -- CGridCtrl: No printing support")
#endif


IMPLEMENT_DYNCREATE(CGridCtrl, CWnd)


// Get the number of lines to scroll with each mouse wheel notch
// Why doesn't windows give us this function???
UINT GetMouseScrollLines()
{
    int nScrollLines = 3;            // reasonable default

#ifndef _WIN32_WCE
    // Do things the hard way in win95
    OSVERSIONINFO VersionInfo;
    VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
    if (!GetVersionEx(&VersionInfo) || 
        (VersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && VersionInfo.dwMinorVersion == 0))
    {
        HKEY hKey;
        if (RegOpenKeyEx(HKEY_CURRENT_USER,  _T("Control Panel\\Desktop"),
            0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
        {
            TCHAR szData[128];
            DWORD dwKeyDataType;
            DWORD dwDataBufSize = sizeof(szData);
            
            if (RegQueryValueEx(hKey, _T("WheelScrollLines"), NULL, &dwKeyDataType,
                (LPBYTE) &szData, &dwDataBufSize) == ERROR_SUCCESS)
            {
                nScrollLines = _tcstoul(szData, NULL, 10);
            }
            RegCloseKey(hKey);
        }
    }
    // win98 or greater
    else
           SystemParametersInfo (SPI_GETWHEELSCROLLLINES, 0, &nScrollLines, 0);
#endif

    return nScrollLines;
}

/////////////////////////////////////////////////////////////////////////////
// CGridCtrl

CGridCtrl::CGridCtrl(int nRows, int nCols, int nFixedRows, int nFixedCols)
{
    RegisterWindowClass();

#if !defined(GRIDCONTROL_NO_DRAGDROP) || !defined(GRIDCONTROL_NO_CLIPBOARD)
    _AFX_THREAD_STATE* pState = AfxGetThreadState();
    if (!pState->m_bNeedTerm && !AfxOleInit())
        AfxMessageBox(_T("OLE initialization failed. Make sure that the OLE libraries are the correct version"));
#endif

    // Store the system colours in case they change. The gridctrl uses
    // these colours, and in OnSysColorChange we can check to see if
    // the gridctrl colours have been changed from the system colours.
    // If they have, then leave them, otherwise change them to reflect
    // the new system colours.
    m_crWindowText        = ::GetSysColor(COLOR_WINDOWTEXT);
    m_crWindowColour      = ::GetSysColor(COLOR_WINDOW);
    m_cr3DFace            = ::GetSysColor(COLOR_3DFACE);
    m_crShadow            = ::GetSysColor(COLOR_3DSHADOW);
    m_crGridLineColour    = RGB(192,192,192);

    m_nRows               = 0;
    m_nCols               = 0;
    m_nFixedRows          = 0;
    m_nFixedCols          = 0;
	m_InDestructor        = false;

    m_bVirtualMode        = FALSE;
    m_pfnCallback         = NULL;

    m_nVScrollMax         = 0;          // Scroll position
    m_nHScrollMax         = 0;
    m_nRowsPerWheelNotch  = GetMouseScrollLines(); // Get the number of lines
                                                   // per mouse wheel notch to scroll
    m_nBarState           = GVL_NONE;
    m_MouseMode           = MOUSE_NOTHING;
    m_nGridLines          = GVL_BOTH;
    m_bEditable           = TRUE;
    m_bListMode           = FALSE;
    m_bSingleRowSelection = FALSE;
    m_bSingleColSelection = FALSE;
    m_bLMouseButtonDown   = FALSE;
    m_bRMouseButtonDown   = FALSE;
    m_bAllowDraw          = TRUE;       // allow draw updates
    m_bEnableSelection    = TRUE;
    m_bFixedColumnSelection = TRUE;
    m_bFixedRowSelection  = TRUE;
    m_bAllowRowResize     = TRUE;
    m_bAllowColumnResize  = TRUE;
    m_bSortOnClick        = FALSE;      // Sort on header row click
    m_bHandleTabKey       = TRUE;
#ifdef _WIN32_WCE
    m_bDoubleBuffer       = FALSE;      // Use double buffering to avoid flicker?
#else
    m_bDoubleBuffer       = TRUE;       // Use double buffering to avoid flicker?
#endif
    m_bTitleTips          = TRUE;       // show cell title tips
	
	m_bOuterHScrollBar   = FALSE;     // no outer HScroll Bar
	m_hwndOuterHScroll   = NULL;      // outer hscroll window

    m_bWysiwygPrinting    = FALSE;      // use size-to-width printing

    m_bHiddenColUnhide    = TRUE;       // 0-width columns can be expanded via mouse
    m_bHiddenRowUnhide    = TRUE;       // 0-Height rows can be expanded via mouse

    m_bAllowColHide       = TRUE;       // Columns can be contracted to 0-width via mouse
    m_bAllowRowHide       = TRUE;       // Rows can be contracted to 0-height via mouse

    m_bAscending          = TRUE;       // sorting stuff
    m_nSortColumn         = -1;
	m_pfnCompare		  = NULL;
	m_pfnVirtualCompare   = NULL;
    m_nAutoSizeColumnStyle = GVS_BOTH;  // Autosize grid using header and data info

    m_nTimerID            = 0;          // For drag-selection
    m_nTimerInterval      = 25;         // (in milliseconds)
    m_nResizeCaptureRange = 3;          // When resizing columns/row, the cursor has to be
                                        // within +/-3 pixels of the dividing line for
                                        // resizing to be possible
    m_pImageList          = NULL;       // Images in the grid
    m_bAllowDragAndDrop   = FALSE;      // for drag and drop - EFW - off by default
    m_bTrackFocusCell     = TRUE;       // Track Focus cell?
    m_bFrameFocus         = TRUE;       // Frame the selected cell?
	m_AllowReorderColumn	= false;
	m_QuitFocusOnTab = false;
	m_AllowSelectRowInFixedCol = false;
	m_bDragRowMode = TRUE; // allow to drop a line over another one to change row order
    m_pRtcDefault = RUNTIME_CLASS(CGridCell);

    SetupDefaultCells();
    SetGridBkColor(m_crShadow);

    // Set up the initial grid size
    SetRowCount(nRows);
    SetColumnCount(nCols);
    SetFixedRowCount(nFixedRows);
    SetFixedColumnCount(nFixedCols);

    SetTitleTipTextClr(CLR_DEFAULT);  //FNA
    SetTitleTipBackClr(CLR_DEFAULT); 

    // set initial selection range (ie. none)
    m_SelectedCellMap.RemoveAll();
    m_PrevSelectedCellMap.RemoveAll();

#if !defined(_WIN32_WCE_NO_PRINTING) && !defined(GRIDCONTROL_NO_PRINTING)
    // EFW - Added to support shaded/unshaded printout and
    // user-definable margins.
    m_bShadedPrintOut = TRUE;
    SetPrintMarginInfo(2, 2, 4, 4, 1, 1, 1);
#endif
}

CGridCtrl::~CGridCtrl()
{
	m_InDestructor = true;
    DeleteAllItems();

#ifndef GRIDCONTROL_NO_TITLETIPS
    if (m_bTitleTips && ::IsWindow(m_TitleTip.GetSafeHwnd())) 
        m_TitleTip.DestroyWindow();
#endif

    DestroyWindow();

#if !defined(GRIDCONTROL_NO_DRAGDROP) || !defined(GRIDCONTROL_NO_CLIPBOARD)
    // BUG FIX - EFW
    COleDataSource *pSource = COleDataSource::GetClipboardOwner();
    if(pSource)
        COleDataSource::FlushClipboard();
#endif
}

// Register the window class if it has not already been registered.
BOOL CGridCtrl::RegisterWindowClass()
{
    WNDCLASS wndcls;
    //HINSTANCE hInst = AfxGetInstanceHandle();
    HINSTANCE hInst = AfxGetResourceHandle();

    if (!(::GetClassInfo(hInst, GRIDCTRL_CLASSNAME, &wndcls)))
    {
        // otherwise we need to register a new class
        wndcls.style            = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
        wndcls.lpfnWndProc      = ::DefWindowProc;
        wndcls.cbClsExtra       = wndcls.cbWndExtra = 0;
        wndcls.hInstance        = hInst;
        wndcls.hIcon            = NULL;
#ifndef _WIN32_WCE_NO_CURSOR
        wndcls.hCursor          = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
#else
        wndcls.hCursor          = 0;
#endif
        wndcls.hbrBackground    = (HBRUSH) (COLOR_3DFACE + 1);
        wndcls.lpszMenuName     = NULL;
        wndcls.lpszClassName    = GRIDCTRL_CLASSNAME;

        if (!AfxRegisterClass(&wndcls))
        {
            AfxThrowResourceException();
            return FALSE;
        }
    }

    return TRUE;
}

BOOL CGridCtrl::Initialise()
{
    // Stop re-entry problems
    static BOOL bInProcedure = FALSE;
    if (bInProcedure)
        return FALSE;
    bInProcedure = TRUE;

#ifndef GRIDCONTROL_NO_TITLETIPS
    m_TitleTip.SetParentWnd(this);
#endif

	// This would be a good place to register the droptarget but
	// unfortunately this causes problems if you are using the 
	// grid in a view. 
	// Moved from OnSize.
//#ifndef GRIDCONTROL_NO_DRAGDROP
//    m_DropTarget.Register(this);
//#endif

    if (::IsWindow(m_hWnd))
        ModifyStyleEx(0, WS_EX_CLIENTEDGE);

	// Kludge: Make sure the client edge shows
	// This is so horrible it makes my eyes water.
	CRect rect;
	GetWindowRect(rect);
	CWnd* pParent = GetParent();
	if (pParent != NULL)
		pParent->ScreenToClient(rect);
	rect.InflateRect(1,1);	MoveWindow(rect);
	rect.DeflateRect(1,1);  MoveWindow(rect);
 
    bInProcedure = FALSE;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品久久只有精品| 国产校园另类小说区| 亚洲欧洲精品一区二区精品久久久| 久久电影网电视剧免费观看| 日韩午夜电影av| 久久er99精品| 日本一区二区三区电影| 国产不卡视频在线播放| 欧美电影免费观看高清完整版| 亚洲精品成人悠悠色影视| 五月天国产精品| 国产成人啪午夜精品网站男同| 久久99国产精品久久| 久草在线在线精品观看| 一本大道久久a久久综合| 国产91丝袜在线18| 国产麻豆视频一区二区| 在线精品亚洲一区二区不卡| 丝袜美腿亚洲一区| 欧美tickling挠脚心丨vk| 久久99精品国产| 亚洲男人天堂av| 欧美一区二区三区啪啪| 粉嫩aⅴ一区二区三区四区 | 亚洲香蕉伊在人在线观| 日韩一区二区三区在线观看| 国产很黄免费观看久久| 亚洲综合一区二区精品导航| 日韩欧美国产一区在线观看| 99精品久久99久久久久| 日本欧美一区二区三区乱码| 日韩高清在线一区| 国产精品一区在线观看乱码| 精品视频在线看| 欧美激情一区二区在线| 懂色中文一区二区在线播放| 亚洲自拍偷拍av| 亚洲风情在线资源站| 亚洲精品视频在线| 久久人人爽爽爽人久久久| 视频一区免费在线观看| 日本道在线观看一区二区| 亚洲人妖av一区二区| 亚洲精品在线三区| 在线亚洲免费视频| 豆国产96在线|亚洲| 欧美手机在线视频| 久久久久久久久久久久久女国产乱 | 青青青伊人色综合久久| 色8久久精品久久久久久蜜| 欧美人伦禁忌dvd放荡欲情| 裸体在线国模精品偷拍| 色婷婷激情综合| 亚洲一本大道在线| 欧美一区永久视频免费观看| 国产精品99久久久久久有的能看| 国产色产综合色产在线视频| 色综合天天做天天爱| 国产精品麻豆网站| 91极品视觉盛宴| 亚洲激情六月丁香| 欧美日本一区二区| 午夜精品福利在线| 欧美影院午夜播放| 亚洲欧美欧美一区二区三区| 91麻豆精品国产无毒不卡在线观看 | 欧美日韩免费视频| 久久91精品久久久久久秒播| 欧美一卡二卡在线观看| 性做久久久久久久久| 欧美欧美欧美欧美| 国产成人av自拍| 久久综合九色综合欧美98| 色综合天天综合| 成人免费视频播放| 亚洲综合免费观看高清在线观看| 丁香桃色午夜亚洲一区二区三区| 精品国产欧美一区二区| 成人激情午夜影院| 一区二区三区久久| 国产日韩欧美亚洲| 欧美国产一区二区在线观看| 成人av小说网| 国产精品久久夜| 亚洲国产成人午夜在线一区| 久久久久久久久久久99999| 日韩欧美一区二区在线视频| 综合欧美一区二区三区| 国产精品国模大尺度视频| 最近日韩中文字幕| 一区二区三区在线看| 亚洲一级二级在线| 麻豆精品一二三| 国产精品亚洲一区二区三区妖精| 国产伦精品一区二区三区视频青涩| 国产一区二区在线视频| 成人国产在线观看| 欧美日韩精品欧美日韩精品一综合| 欧美精三区欧美精三区| 日韩一二三区不卡| 国产精品免费视频一区| 亚洲精品免费在线播放| 日韩精品一二三四| 国产精品1024| 色噜噜久久综合| 91精品国产色综合久久不卡电影| 欧美成人aa大片| 国产精品美日韩| 亚洲成人自拍偷拍| 国产一区二区三区四| 99久久婷婷国产综合精品| 欧美日韩国产一区二区三区地区| 日韩欧美在线影院| 亚洲天堂福利av| 日本欧美肥老太交大片| 福利91精品一区二区三区| 欧洲精品中文字幕| 久久精品人人做| 亚洲成人动漫av| 国产·精品毛片| 91超碰这里只有精品国产| 国产精品嫩草影院av蜜臀| 午夜精品久久久久久久蜜桃app| 国内精品伊人久久久久av影院| 97久久精品人人做人人爽50路| 欧美一卡2卡三卡4卡5免费| 亚洲欧美日韩国产手机在线| 青青青伊人色综合久久| 色香蕉成人二区免费| 精品国产区一区| 午夜视频在线观看一区二区| 丁香亚洲综合激情啪啪综合| 3751色影院一区二区三区| 中文字幕av不卡| 狠狠色丁香婷婷综合| 欧美熟乱第一页| 亚洲欧洲三级电影| 国产精品系列在线观看| 欧美精品 日韩| 亚洲一线二线三线视频| 成人免费高清在线观看| 日韩精品在线一区二区| 亚洲h在线观看| 色老头久久综合| 国产精品―色哟哟| 国产一区亚洲一区| 日韩欧美色综合网站| 综合分类小说区另类春色亚洲小说欧美 | 国产免费久久精品| 国产91高潮流白浆在线麻豆 | 美美哒免费高清在线观看视频一区二区| 岛国精品在线观看| 国产精品国产精品国产专区不蜜| 91精品免费在线| 久久免费电影网| 欧美日韩日日摸| 欧美本精品男人aⅴ天堂| 五月婷婷综合激情| 777午夜精品免费视频| 亚洲美女视频在线| 91丨九色丨蝌蚪丨老版| 国产精品丝袜91| 久久99久久99小草精品免视看| 国产真实乱对白精彩久久| 欧美大胆一级视频| 精品亚洲porn| 天堂影院一区二区| 欧美精品一区视频| 欧洲一区二区三区在线| 蜜臀a∨国产成人精品| 久久日韩精品一区二区五区| 91精品国产麻豆| 色猫猫国产区一区二在线视频| 国产午夜精品久久久久久免费视 | 日日夜夜精品视频天天综合网| 丁香婷婷深情五月亚洲| 久久久久久久久97黄色工厂| 久久国产人妖系列| 国产校园另类小说区| 成人丝袜高跟foot| 亚洲男女一区二区三区| 色婷婷国产精品综合在线观看| 亚洲人成精品久久久久| 欧美日韩精品欧美日韩精品一| 日韩成人免费看| 久久免费看少妇高潮| 北条麻妃国产九九精品视频| 亚洲视频资源在线| 欧美怡红院视频| 喷白浆一区二区| 欧美国产乱子伦 | 精品国产乱码91久久久久久网站| 久久丁香综合五月国产三级网站| 久久久久久久久蜜桃| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 在线观看免费亚洲| 福利电影一区二区三区| 大白屁股一区二区视频| 麻豆精品国产91久久久久久| 午夜激情一区二区三区|