返回   cpper编程论坛 > Zion/测试
注册账号 论坛帮助 会员列表 日历事件 搜索 今日新帖 标记版面已读

Zion/测试 惹人烦的东西这边来

回复
 
LinkBack 主题工具 显示模式
  #1 (permalink)  
旧 2004-01-19
高级会员
 
注册日期: 2003-08-02
帖子: 105
koolplay 正向着好的方向发展
默认 TVIS_EXPANDED

树类有一个成员函数GetItemState我不太明白。其中第一个参数我知道,但是第2个参数是什么东西?某本书上第2个参数用了TVIS_EXPANDED,但是我却在MSDN里查不到这个宏。
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #2 (permalink)  
旧 2004-01-20
Elminster 的头像
超级版主
 
注册日期: 2002-09-09
帖子: 1,763
Elminster 正向着好的方向发展
默认

啧啧,不是你没用心查,就是你的 MSDN 该更新了:

[quote=MSDN]Tree-View Control Item States

--------------------------------------------------------------------------------

This section lists the item state flags used to indicate the state of an item in a tree-view control.

Constants

TVIS_BOLD
The item is bold.

TVIS_CUT
The item is selected as part of a cut-and-paste operation.

TVIS_DROPHILITED
The item is selected as a drag-and-drop target.

TVIS_EXPANDED
The item's list of child items is currently expanded; that is, the child items are visible. This value applies only to parent items.


TVIS_EXPANDEDONCE
The item's list of child items has been expanded at least once. The TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification messages are not generated for parent items that have this state set in response to a TVM_EXPAND message. Using TVE_COLLAPSE and TVE_COLLAPSERESET with TVM_EXPAND will cause this state to be reset. This value applies only to parent items.

TVIS_EXPANDPARTIAL
Version 4.70. A partially expanded tree-view item. In this state, some, but not all, of the child items are visible and the parent item's plus symbol is displayed.

TVIS_SELECTED
The item is selected. Its appearance depends on whether it has the focus. The item will be drawn using the system colors for selection.

Note:
When you set or retrieve an item's overlay image index or state image index, you must specify the following masks in the stateMask member of the TVITEM structure. These values can also be used to mask off the state bits that are not of interest.

TVIS_OVERLAYMASK
Mask for the bits used to specify the item's overlay image index.

TVIS_STATEIMAGEMASK
Mask for the bits used to specify the item's state image index.

TVIS_USERMASK
Same as TVIS_STATEIMAGEMASK.


--------------------------------------------------------------------------------

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #3 (permalink)  
旧 2004-01-20
Elminster 的头像
超级版主
 
注册日期: 2002-09-09
帖子: 1,763
Elminster 正向着好的方向发展
默认

第二个参数在 MSDN 里也有声明:

[quote=MSDN] MFC Library Reference

CTreeCtrl::GetItemStateSee Also
CTreeCtrl Overview | Class Members | Hierarchy Chart | CTreeCtrl::GetItem
Returns the state of the item specified by hItem.

UINT GetItemState(
HTREEITEM hItem,
UINT nStateMask
) const;
Parameters
hItem
Handle of the item whose state is to be retrieved.
nStateMask
Mask indicating which states are to be retrieved. For more information on possible values for nStateMask, see the discussion of the state and stateMask members of the TVITEM structure in the Platform SDK.
Return Value
A UINT specifying the item's state. For information on possible values, see CTreeCtrl::GetItem.

Example
// The pointer to my tree control.
extern CTreeCtrl* pmyTreeCtrl;

// Show all of the visible items in bold.
HTREEITEM hItem = pmyTreeCtrl->GetFirstVisibleItem();

while (hItem != NULL)
{
pmyTreeCtrl->SetItemState(hItem, TVIS_BOLD, TVIS_BOLD);
ASSERT(pmyTreeCtrl->GetItemState(hItem, TVIS_BOLD) == TVIS_BOLD);
hItem = pmyTreeCtrl->GetNextVisibleItem(hItem);
}
See Also
CTreeCtrl Overview | Class Members | Hierarchy Chart | CTreeCtrl::GetItem



--------------------------------------------------------------------------------

Send feedback on this topic to Microsoft

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #4 (permalink)  
旧 2004-01-20
Elminster 的头像
超级版主
 
注册日期: 2002-09-09
帖子: 1,763
Elminster 正向着好的方向发展
默认

剩下的问题我也懒得回答了,都是直接在 MSDN 里可以查到的东西,有一个问题例外:debug assertion failed 的意思是你的程序里面有错误,访问了不该访问的东西,比如指向非法内存的指针、对应窗口已经销毁的句柄,诸如此类。换句话说,你的程序有毛病。
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #5 (permalink)  
旧 2004-01-20
Elminster 的头像
超级版主
 
注册日期: 2002-09-09
帖子: 1,763
Elminster 正向着好的方向发展
默认

附带一提:这种发帖方式不好,白白占据了大半个版面,结果每帖只有一句话,整理一下集中放到一个帖子里不好么?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #6 (permalink)  
旧 2004-01-20
高级会员
 
注册日期: 2003-08-02
帖子: 105
koolplay 正向着好的方向发展
默认

我怕问题一集中,大家只讨论容易的问题,其它问题都忽略了
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
回复

书签
主题工具
显示模式

发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码
Trackbacks are 启用
Pingbacks are 启用
Refbacks are 启用



所有时间均为格林尼治时间 +9。现在的时间是 07:25 AM


Powered by vBulletin® 版本 3.7.0
版权所有 ©2000 - 2008,Jelsoft Enterprises Ltd.
(C) Copy Right All Right Reserved 2001 - 2007

Search Engine Friendly URLs by vBSEO 3.1.0