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

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

?? rtreview.cpp

?? EZ _USB Control PANEL 源代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
////////////////////////////////////////////////////////////////////////////////
// RTreView.cpp : implementation of the CRTreView class
// $Header: /USB/Util/EzMr/RTreView.cpp 3     8/08/00 2:26p Tpm $
// Copyright (c) 2000 Cypress Semiconductor. May not be reproduced without permission.
// See the EzUsb Developer's Kit license agreement for more details.
////////////////////////////////////////////////////////////////////////////////


#include "stdafx.h"
#include "EzMr.h"
#include "RTreDoc.h"
#include "RTreView.h"
//#include "ChooseLPARAMDialog.h"

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

//////////
// CRTreView

IMPLEMENT_DYNCREATE(CRTreView, CTreeView)

BEGIN_MESSAGE_MAP(CRTreView, CTreeView)
   //{{AFX_MSG_MAP(CRTreView)
ON_WM_CREATE()
	ON_WM_RBUTTONDOWN()
	ON_WM_CONTEXTMENU()
	ON_WM_LBUTTONDOWN()
	ON_WM_RBUTTONUP()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


//////////
// Constructor 
//
CRTreView::CRTreView()
: m_bShowHandlesAndLParams(FALSE)
{
	m_pOldSel = 0;
}


//////////
// Destructor 
//
CRTreView::~CRTreView()
{
}


//////////
// GetItemHandle() is a public member function which provides an operation
// which is not available in the TreeView control or any of the MFC tree
// classes (CTreeView, CTreeCtrl). It returns the HTREEITEM handle for
// the item you seek, when you provide the LPARAM value (TV_ITEM.lParam)
// which was specified for that item. A user specfied LPARAM value
// is often a pointer to the software representation of the visual element
// on a control window. The startHandle argument is an optional arguement
// which indicates that the search should begin at a specific "sub-root"
// in the tree control. If not specified by the user, the startHandle
// value will be TVI_ROOT which is treated by the control as a flag
// specifying the top-level item.
//
HTREEITEM CRTreView::GetItemHandle (LPARAM    lParam,
                                             HTREEITEM startHandle)
{
   ASSERT(lParam);

   SaveItemHandleUserParm_ userParm;
   userParm.m_lParam       = lParam;
   userParm.m_hTreeItem    = NULL;

   ApplyIfTrue_ ( CRTreView::ItemHasLparam_,
                  CRTreView::SaveItemHandle_,
                  reinterpret_cast<DWORD>( & userParm ),
                  startHandle);

   return userParm.m_hTreeItem;
}


//////////
// ApplyIfTrue() recurses the tree calling the predicate function for
// each item in the tree. If the predicate function returns TRUE,
// then the apply function is called. If the apply function returns
// TRUE, then the recursion continues. If the apply function returns
// FALSE, then the recursion ends.
//
BOOL CRTreView::ApplyIfTrue_ (TreePredicateFunction_ predicateFunction,
                                       TreeApplyFunction_     applyFunction,
                                       DWORD                  userParm,
                                       HTREEITEM              startHandle,
                                       BOOL                   recurseRootSiblings)
{
   // If startHandle is null, this is either a recursive base-case
   // indicating there are no more items below the current HTREEITEM,
   // or it indicates that the user called this function with a NULL
   // value as the start handle. The default value for startHandle is
   // TVI_ROOT whose value is considered by the TreeView control to
   // be a flag indicating the root item.

   if ( startHandle == NULL )
      return FALSE;

   // Get the starting location of the recursion.
   // The starting location defaults to the absolute root.

   HTREEITEM candidate;
   if ( startHandle == TVI_ROOT )
   {
      candidate = GetTreeCtrl().GetRootItem ();

      // If there are no items in the tree, then get out.

      if (candidate == NULL)
          return FALSE;
   }
   else
      candidate = startHandle;

   // Call the predicate function on the starting candidate.
   // If the predicate returns TRUE, then call the apply
   // function. If the apply function returns FALSE, it
   // indicates that no more calls to the apply function
   // should occur.

   if ( (this->*predicateFunction)(candidate, userParm ) == TRUE )
      if ( (this->*applyFunction)(candidate, userParm ) == FALSE )
          return FALSE;
      
   // Process each child of the candidate item. If that child
   // also has children, process each of those children.

   if ( GetTreeCtrl().ItemHasChildren( candidate ) )
   {
      // Get the first child's handle...

      HTREEITEM child = GetTreeCtrl().GetChildItem ( candidate );
      while (child)
      {
         // ... and recurse each child item.

         if ( ApplyIfTrue_
               (predicateFunction, applyFunction, userParm, child )
              == FALSE)
              return FALSE;

         // Get the next sibling of the child just recursed.

         child = GetTreeCtrl().GetNextSiblingItem ( child );
      }

      // Process siblings of the highest root

      if (recurseRootSiblings)
         candidate = GetTreeCtrl().GetNextSiblingItem(candidate);
      else
         candidate = NULL;
   }
   return TRUE;
}


//////////
// TruePredicate_() is a predicate function for use by ApplyIfTrue().
// It is used when an "apply" function is to be called for each item.
//
BOOL CRTreView::TruePredicate_(HTREEITEM candidate, DWORD userParm)
{
    ASSERT(candidate);

    return TRUE; // Call the apply function.
}


//////////
// ItemHasText_() is a predicate function for ApplyIfTrue_().
// It determines whether the item in the TreeView has text
// which equals some user specified value.
//
BOOL CRTreView::ItemHasText_(HTREEITEM candidate, DWORD userParm)
{
   ASSERT(candidate && userParm);

   return  (reinterpret_cast<SaveItemHandleUserParm_*>(userParm)->m_text ==
            GetTreeCtrl().GetItemText(candidate)) == 0;
}


//////////
// ItemHasLparam_() is a predicate function for ApplyIfTrue_().
// It determines whether the item in the TreeView has an LPARAM
// value which equals some user specified value.
//
BOOL CRTreView::ItemHasLparam_(HTREEITEM candidate, DWORD userParm)
{
   ASSERT(candidate && userParm);

   return reinterpret_cast<SaveItemHandleUserParm_*>(userParm)->m_lParam ==  
          LPARAM(GetTreeCtrl().GetItemData(candidate));
}


//////////
// SaveItemHandle_() is an apply function for ApplyIfTrue_().
// It saves the LPARAM for the candidate item in the user specified location. 
//
BOOL CRTreView::SaveItemHandle_(HTREEITEM candidate, DWORD userParm)
{
    ASSERT(candidate && userParm);

    reinterpret_cast<SaveItemHandleUserParm_*>(userParm)->m_hTreeItem
       = candidate;    
    return FALSE; // done
}


//////////
// SaveItemsLparams_() is an apply function for ApplyIfTrue_().
// It saves the LPARAM for the candidate item in the user specified array.
//
BOOL CRTreView::SaveItemsLParams_(HTREEITEM candidate, DWORD userParm)
{
   ASSERT(candidate && userParm);

   CDWordArray* arrayOfTreeViewLParams = 
                reinterpret_cast<CDWordArray*>(userParm);
   DWORD data = GetTreeCtrl().GetItemData(candidate);
   ASSERT(data);
   arrayOfTreeViewLParams->Add(data);
   return TRUE; // keep going...
}


//////////
// ShowHandleAndLParam() is an apply function for ApplyIfTrue_(). It shows
// the HTREEITEM handle and TVI_ITEM.lParam value for an item.
//
BOOL CRTreView::ShowHandleAndLParam_(HTREEITEM candidate, DWORD userParm) 
{
    TV_ITEM item;
    TCHAR pszText[255];
    item.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_PARAM;
    item.cchTextMax = sizeof pszText;
    item.pszText = pszText;
    item.hItem = candidate;

    CString text;

    GetTreeCtrl().GetItem(&item);

    if (userParm == TRUE)
    {
        CString szTmp;
        CString fmt("HTREEITEM=%#8x");
        szTmp.Format(fmt, reinterpret_cast<int>(candidate));
        text = CString(item.pszText) + CString(" ") + szTmp;
        
        fmt = CString("LPARAM=%#8x");
        szTmp.Format(fmt, item.lParam);
        //szTmp.Format(fmt, reinterpret_cast<long>(item.lParam));
       text = text + CString(" ") + szTmp;
    }
    else
    {
        text = item.pszText;
        int offset = text.Find(_T(' '));
        ASSERT(offset != -1);
        text = text.Left( offset );
    }

    item.pszText = const_cast<TCHAR*>((LPCTSTR)text);

    GetTreeCtrl().SetItem(&item);
    
    return TRUE;
}


//////////
// CRTreCompare() is a global function which is called by the
// TreeView control when the user calls SortChildrenCB() and specifies
// this function as the value of LPTV_SORTCB.lpfnCompare.
//
int CALLBACK
CRTreViewCompare(LPARAM item1Param, LPARAM item2Param, LPARAM pThis)
{
   return (reinterpret_cast<CRTreView*>(pThis))->
                            SortCompare(item1Param, item2Param);
}


//////////
// SortCompare() is a virtual function which implements a compare
// of two items in the tree. Since TreeView items are most
// often sorted by the text associated with that item,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品亚洲а∨天堂免在线| 6080日韩午夜伦伦午夜伦| 91精品91久久久中77777| 91精品国产综合久久久久久漫画| 欧美激情资源网| 青青国产91久久久久久| 91女厕偷拍女厕偷拍高清| 日韩美女在线视频| 午夜精品久久久久久久蜜桃app| 成人综合婷婷国产精品久久| 欧美一级理论性理论a| 亚洲大片精品永久免费| 91免费小视频| 日本一区二区视频在线观看| 国产在线精品视频| 日韩欧美一级片| 日韩精品免费视频人成| 欧美三级电影在线看| 日韩美女久久久| 成人av动漫在线| 亚洲国产精品ⅴa在线观看| 精品一区在线看| 日韩欧美一级二级三级| 天天亚洲美女在线视频| 欧美猛男gaygay网站| 亚洲一区视频在线| 91在线码无精品| 亚洲蜜桃精久久久久久久| 99精品视频在线免费观看| 中文字幕永久在线不卡| 91视频在线观看免费| 国产精品久久久久久久久果冻传媒| 激情小说欧美图片| 久久久久青草大香线综合精品| 国内一区二区在线| 国产亚洲综合av| 99久久精品久久久久久清纯| 亚洲精品成人在线| 在线看日韩精品电影| 五月天婷婷综合| 日韩一区二区三区免费看| 久久精品国产免费| 国产亚洲婷婷免费| 91在线观看高清| 天天亚洲美女在线视频| 欧美xxxxx牲另类人与| 国产麻豆精品theporn| 国产精品天干天干在线综合| 91在线精品一区二区| 亚洲一区av在线| 日韩欧美电影一二三| 成人中文字幕在线| 亚洲第一会所有码转帖| 精品久久人人做人人爰| 国产电影精品久久禁18| 亚洲女与黑人做爰| 制服丝袜在线91| 大白屁股一区二区视频| 欧美一二三区精品| 亚洲一区二区欧美| 日韩欧美一级精品久久| av中文一区二区三区| 午夜一区二区三区视频| 精品国产露脸精彩对白| av午夜一区麻豆| 亚洲123区在线观看| 国产亚洲制服色| 欧美三电影在线| 国产成人免费视频一区| 亚洲一区二区三区精品在线| 国产午夜亚洲精品羞羞网站| 欧美亚洲国产一区二区三区| 国产一区二区不卡在线| 亚洲图片自拍偷拍| 国产欧美一区二区精品性| 欧美日韩一区久久| 成人免费观看男女羞羞视频| 三级影片在线观看欧美日韩一区二区 | 综合久久给合久久狠狠狠97色 | 免费观看成人av| 亚洲欧洲性图库| 精品国产伦一区二区三区观看方式 | av不卡免费在线观看| 日本女人一区二区三区| 樱花影视一区二区| 国产欧美精品一区二区色综合| 在线91免费看| 一本久久综合亚洲鲁鲁五月天 | 欧美色图第一页| 成人午夜电影久久影院| 免费成人在线播放| 亚洲国产成人va在线观看天堂| 中文字幕久久午夜不卡| 欧美精品一区二区三区很污很色的 | 制服.丝袜.亚洲.中文.综合| 91在线国产观看| 国产91对白在线观看九色| 久久精品二区亚洲w码| 午夜伦欧美伦电影理论片| 亚洲欧洲av在线| 国产精品久久网站| 久久久久久久久伊人| 日韩精品中文字幕在线一区| 欧美女孩性生活视频| 欧美影院精品一区| 色香蕉成人二区免费| 成人午夜激情影院| 丁香婷婷综合色啪| 国产成人免费视频精品含羞草妖精| 久久99在线观看| 久久疯狂做爰流白浆xx| 久久成人免费电影| 国产一区福利在线| 激情偷乱视频一区二区三区| 精品影视av免费| 国产九九视频一区二区三区| 国产高清视频一区| av资源网一区| 在线一区二区观看| 欧美日韩mp4| 日韩美女一区二区三区四区| 精品久久一区二区三区| 国产夜色精品一区二区av| 欧美激情中文字幕| 亚洲精选一二三| 亚洲小说春色综合另类电影| 日韩成人dvd| 国产乱码一区二区三区| 粉嫩一区二区三区在线看| 波多野结衣在线一区| 91天堂素人约啪| 欧美色偷偷大香| 精品久久国产97色综合| 国产精品久久久久久久久免费桃花 | 91影视在线播放| 欧美午夜精品一区二区三区| 91精品国产综合久久久久久久| 日韩欧美一级片| 国产精品私人自拍| 亚洲大片精品永久免费| 久久国产剧场电影| 成人免费观看视频| 欧美日韩aaaaaa| 日本一区二区在线不卡| 一区二区三区欧美在线观看| 免费一区二区视频| 国产aⅴ综合色| 欧美精三区欧美精三区| 久久美女高清视频| 亚洲国产一区视频| 国产在线精品一区二区夜色 | 一区二区三区四区不卡视频| 日韩国产在线一| 国产成人高清在线| 欧美精品在线观看一区二区| 久久久久久久久久久黄色| 亚洲黄色av一区| 国内精品嫩模私拍在线| 在线观看免费一区| 国产视频视频一区| 日韩黄色片在线观看| 97久久超碰国产精品| 欧美精品一区二| 婷婷国产在线综合| 色婷婷av一区二区| 久久精品男人天堂av| 蜜臀91精品一区二区三区 | 成人午夜电影网站| 日韩小视频在线观看专区| 怡红院av一区二区三区| 国产成人8x视频一区二区| 91精品国产综合久久香蕉的特点| 国产精品短视频| 黄网站免费久久| 日韩视频一区二区| 日日欢夜夜爽一区| 欧美在线视频全部完| 中文字幕在线免费不卡| 国产精品一品二品| 欧美成人福利视频| 丝瓜av网站精品一区二区| 色婷婷精品大在线视频| 亚洲婷婷在线视频| 丁香天五香天堂综合| 久久久不卡网国产精品二区| 精品制服美女久久| 欧美电影免费观看高清完整版在| 午夜免费欧美电影| 欧美久久婷婷综合色| 性做久久久久久免费观看欧美| 色综合久久88色综合天天| 亚洲人123区| 成人晚上爱看视频| 国产精品天干天干在线综合| 国产精品一二三四区| 久久蜜桃一区二区| 丁香天五香天堂综合| 国产精品全国免费观看高清| 成人一级片网址| 亚洲欧洲精品一区二区精品久久久 |